Plugin Directory

Changeset 3735564


Ignore:
Timestamp:
10/08/2026 09:25:58 PM (2 weeks ago)
Author:
naseraleisa
Message:

Update trunk to version 1.6.0

Location:
jaak-for-woocommerce/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • jaak-for-woocommerce/trunk/changelog.txt

    r3657295 r3735564  
    11*** Jaak Changelog ***
     2
     32026-10-09 - version 1.6.0
     4* Include plugin version in API requests.
    25
    362026-08-20 - version 1.5.0
  • jaak-for-woocommerce/trunk/dist/bulk-action.asset.php

    r3657295 r3735564  
    1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-element'), 'version' => '10f0835e8c96781470d5');
     1<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-element'), 'version' => '0635aff542033b047642');
  • jaak-for-woocommerce/trunk/dist/bulk-action.js

    r3657295 r3735564  
    1 (()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{base64:()=>Yo,base64url:()=>Xo,bigint:()=>ua,boolean:()=>pa,browserEmail:()=>Jo,cidrv4:()=>Vo,cidrv6:()=>Go,cuid:()=>zo,cuid2:()=>Oo,date:()=>sa,datetime:()=>aa,domain:()=>ta,duration:()=>Ao,e164:()=>na,email:()=>Fo,emoji:()=>Bo,extendedDuration:()=>Co,guid:()=>Ro,hex:()=>ga,hostname:()=>ea,html5Email:()=>Mo,idnEmail:()=>qo,integer:()=>da,ipv4:()=>Ko,ipv6:()=>Wo,ksuid:()=>To,lowercase:()=>ma,mac:()=>Ho,md5_base64:()=>wa,md5_base64url:()=>Sa,md5_hex:()=>ba,nanoid:()=>Po,null:()=>ha,number:()=>la,rfc5322Email:()=>Uo,sha1_base64:()=>ka,sha1_base64url:()=>Ea,sha1_hex:()=>xa,sha256_base64:()=>Oa,sha256_base64url:()=>$a,sha256_hex:()=>za,sha384_base64:()=>Ta,sha384_base64url:()=>Pa,sha384_hex:()=>Ia,sha512_base64:()=>Ca,sha512_base64url:()=>Ra,sha512_hex:()=>Aa,string:()=>ca,time:()=>oa,ulid:()=>$o,undefined:()=>fa,unicodeEmail:()=>Lo,uppercase:()=>ya,uuid:()=>jo,uuid4:()=>No,uuid6:()=>Zo,uuid7:()=>Do,xid:()=>Io});var n={};e.r(n),e.d(n,{endsWith:()=>Nd,gt:()=>_d,gte:()=>vd,includes:()=>Rd,length:()=>Td,lowercase:()=>Ad,lt:()=>yd,lte:()=>gd,maxLength:()=>$d,maxSize:()=>Ed,mime:()=>Dd,minLength:()=>Id,minSize:()=>zd,multipleOf:()=>kd,negative:()=>wd,nonnegative:()=>xd,nonpositive:()=>Sd,normalize:()=>Md,overwrite:()=>Fd,positive:()=>bd,property:()=>Zd,regex:()=>Pd,size:()=>Od,slugify:()=>Jd,startsWith:()=>jd,toLowerCase:()=>Ld,toUpperCase:()=>qd,trim:()=>Ud,uppercase:()=>Cd});var r={};e.r(r),e.d(r,{ZodISODate:()=>rl,ZodISODateTime:()=>tl,ZodISODuration:()=>al,ZodISOTime:()=>il,date:()=>sl,datetime:()=>nl,duration:()=>cl,time:()=>ol});var s={};e.r(s),e.d(s,{ZodAny:()=>Jp,ZodArray:()=>eh,ZodBase64:()=>dp,ZodBase64URL:()=>pp,ZodBigInt:()=>Cp,ZodBigIntFormat:()=>jp,ZodBoolean:()=>Pp,ZodCIDRv4:()=>op,ZodCIDRv6:()=>cp,ZodCUID:()=>Jl,ZodCUID2:()=>Bl,ZodCatch:()=>Hh,ZodCodec:()=>tf,ZodCustom:()=>ff,ZodCustomStringFormat:()=>_p,ZodDate:()=>Yp,ZodDefault:()=>Uh,ZodDiscriminatedUnion:()=>lh,ZodE164:()=>fp,ZodEmail:()=>$l,ZodEmoji:()=>Ml,ZodEnum:()=>Eh,ZodExactOptional:()=>Nh,ZodFile:()=>Th,ZodFunction:()=>pf,ZodGUID:()=>Tl,ZodIPv4:()=>ep,ZodIPv6:()=>sp,ZodIntersection:()=>hh,ZodJWT:()=>yp,ZodKSUID:()=>Yl,ZodLazy:()=>cf,ZodLiteral:()=>$h,ZodMAC:()=>np,ZodMap:()=>wh,ZodNaN:()=>Gh,ZodNanoID:()=>Ll,ZodNever:()=>Wp,ZodNonOptional:()=>Qh,ZodNull:()=>Lp,ZodNullable:()=>Dh,ZodNumber:()=>xp,ZodNumberFormat:()=>Ep,ZodObject:()=>rh,ZodOptional:()=>Rh,ZodPipe:()=>Xh,ZodPrefault:()=>qh,ZodPromise:()=>df,ZodReadonly:()=>rf,ZodRecord:()=>gh,ZodSet:()=>xh,ZodString:()=>El,ZodStringFormat:()=>Ol,ZodSuccess:()=>Kh,ZodSymbol:()=>Dp,ZodTemplateLiteral:()=>of,ZodTransform:()=>Ah,ZodTuple:()=>mh,ZodType:()=>xl,ZodULID:()=>Wl,ZodURL:()=>Zl,ZodUUID:()=>Al,ZodUndefined:()=>Mp,ZodUnion:()=>ah,ZodUnknown:()=>Bp,ZodVoid:()=>Vp,ZodXID:()=>Vl,ZodXor:()=>uh,_ZodString:()=>kl,_default:()=>Lh,_function:()=>hf,any:()=>Qp,array:()=>th,base64:()=>lp,base64url:()=>hp,bigint:()=>Rp,boolean:()=>Ap,catch:()=>Vh,check:()=>mf,cidrv4:()=>ap,cidrv6:()=>up,codec:()=>nf,cuid:()=>Ql,cuid2:()=>Kl,custom:()=>yf,date:()=>Xp,describe:()=>vf,discriminatedUnion:()=>ph,e164:()=>mp,email:()=>Il,emoji:()=>Ul,enum:()=>zh,exactOptional:()=>Zh,file:()=>Ph,float32:()=>Op,float64:()=>$p,function:()=>hf,guid:()=>Pl,hash:()=>Sp,hex:()=>wp,hostname:()=>bp,httpUrl:()=>Fl,instanceof:()=>wf,int:()=>zp,int32:()=>Ip,int64:()=>Np,intersection:()=>fh,ipv4:()=>tp,ipv6:()=>ip,json:()=>xf,jwt:()=>gp,keyof:()=>nh,ksuid:()=>Xl,lazy:()=>uf,literal:()=>Ih,looseObject:()=>oh,looseRecord:()=>bh,mac:()=>rp,map:()=>Sh,meta:()=>bf,nan:()=>Yh,nanoid:()=>ql,nativeEnum:()=>Oh,never:()=>Hp,nonoptional:()=>Bh,null:()=>qp,nullable:()=>Fh,nullish:()=>Mh,number:()=>kp,object:()=>sh,optional:()=>jh,partialRecord:()=>vh,pipe:()=>ef,prefault:()=>Jh,preprocess:()=>kf,promise:()=>lf,readonly:()=>sf,record:()=>_h,refine:()=>gf,set:()=>kh,strictObject:()=>ih,string:()=>zl,stringFormat:()=>vp,stringbool:()=>Sf,success:()=>Wh,superRefine:()=>_f,symbol:()=>Fp,templateLiteral:()=>af,transform:()=>Ch,tuple:()=>yh,uint32:()=>Tp,uint64:()=>Zp,ulid:()=>Hl,undefined:()=>Up,union:()=>ch,unknown:()=>Kp,url:()=>Dl,uuid:()=>Cl,uuidv4:()=>Rl,uuidv6:()=>jl,uuidv7:()=>Nl,void:()=>Gp,xid:()=>Gl,xor:()=>dh});var i={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o=new class{#e=i;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},a="undefined"==typeof window||"Deno"in globalThis;function c(){}function u(e){return"number"==typeof e&&e>=0&&e!==1/0}function d(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function p(e,t){return"function"==typeof e?e(t):e}function h(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o)if(r){if(t.queryHash!==m(o,t.options))return!1}else if(!g(t.queryKey,o))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function f(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(y(t.options.mutationKey)!==y(i))return!1}else if(!g(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function m(e,t){return(t?.queryKeyHashFn||y)(e)}function y(e){return JSON.stringify(e,(e,t)=>S(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function g(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(n=>g(e[n],t[n]))}var _=Object.prototype.hasOwnProperty;function v(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=w(e)&&w(t);if(!(r||S(e)&&S(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),o=i.length,a=r?new Array(o):{};let c=0;for(let u=0;u<o;u++){const o=r?u:i[u],d=e[o],l=t[o];if(d===l){a[o]=d,(r?u<s:_.call(e,o))&&c++;continue}if(null===d||null===l||"object"!=typeof d||"object"!=typeof l){a[o]=l;continue}const p=v(d,l,n+1);a[o]=p,p===d&&c++}return s===o&&c===s?e:a}function b(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function S(e){if(!x(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!x(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function k(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?v(e,t):t}function E(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function z(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var O=Symbol();function $(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==O?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function I(e,t){return"function"==typeof e?e(...t):!!e}var T=function(e){setTimeout(e,0)},P=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},s=T;const i=r=>{t?e.push(r):s(()=>{n(r)})};return{batch:i=>{let o;t++;try{o=i()}finally{t--,t||(()=>{const t=e;e=[],t.length&&s(()=>{r(()=>{t.forEach(e=>{n(e)})})})})()}return o},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{s=e}}}(),A=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},C=new class extends A{#n;#r;#s;constructor(){super(),this.#s=e=>{if(!a&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#n!==e&&(this.#n=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#n?this.#n:"hidden"!==globalThis.document?.visibilityState}},R=new class extends A{#i=!0;#r;#s;constructor(){super(),this.#s=e=>{if(!a&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#i!==e&&(this.#i=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#i}};function j(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}function N(e){return Math.min(1e3*2**e,3e4)}function Z(e){return"online"!==(e??"online")||R.isOnline()}var D=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function F(e){let t,n=!1,r=0;const s=j(),i=()=>"pending"!==s.status,c=()=>C.isFocused()&&("always"===e.networkMode||R.isOnline())&&e.canRun(),u=()=>Z(e.networkMode)&&e.canRun(),d=e=>{i()||(t?.(),s.resolve(e))},l=e=>{i()||(t?.(),s.reject(e))},p=()=>new Promise(n=>{t=e=>{(i()||c())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,i()||e.onContinue?.()}),h=()=>{if(i())return;let t;const s=0===r?e.initialPromise:void 0;try{t=s??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(d).catch(t=>{if(i())return;const s=e.retry??(a?0:3),u=e.retryDelay??N,d="function"==typeof u?u(r,t):u,f=!0===s||"number"==typeof s&&r<s||"function"==typeof s&&s(r,t);var m;!n&&f?(r++,e.onFail?.(r,t),(m=d,new Promise(e=>{o.setTimeout(e,m)})).then(()=>c()?void 0:p()).then(()=>{n?l(t):h()})):l(t)})};return{promise:s,status:()=>s.status,cancel:t=>{if(!i()){const n=new D(t);l(n),e.onCancel?.(n)}},continue:()=>(t?.(),s),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:u,start:()=>(u()?h():p().then(h),s)}}var M=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),u(this.gcTime)&&(this.#o=o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a?1/0:3e5))}clearGcTimeout(){this.#o&&(o.clearTimeout(this.#o),this.#o=void 0)}},U=class extends M{#a;#c;#u;#d;#l;#p;#h;constructor(e){super(),this.#h=!1,this.#p=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#d=e.client,this.#u=this.#d.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=J(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(e){if(this.options={...this.#p,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=J(this.options);void 0!==e.data&&(this.setState(q(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){const n=k(this.state.data,e,this.options);return this.#f({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#l?.promise;return this.#l?.cancel(e),t?t.then(c).catch(c):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#a)}isActive(){return this.observers.some(e=>!1!==p(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===O||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===l(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!d(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#l&&(this.#h?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#l?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,n.signal)})},s=()=>{const e=$(this.options,t),n=(()=>{const e={client:this.#d,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#h=!1,this.options.persister?this.options.persister(e,n,this):e(n)},i=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#d,state:this.state,fetchFn:s};return r(e),e})();this.options.behavior?.onFetch(i,this),this.#c=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===i.fetchOptions?.meta||this.#f({type:"fetch",meta:i.fetchOptions?.meta}),this.#l=F({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:e=>{e instanceof D&&e.revert&&this.setState({...this.#c,fetchStatus:"idle"}),n.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const e=await this.#l.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof D){if(e.silent)return this.#l.promise;if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#f({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...L(t.data,this.options),fetchMeta:e.meta??null};case"success":const n={...t,...q(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=e.manual?n:void 0,n;case"error":const r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function L(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Z(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function q(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function J(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Q=class extends A{constructor(e={}){super(),this.config=e,this.#m=new Map}#m;build(e,t,n){const r=t.queryKey,s=t.queryHash??m(r,t);let i=this.get(s);return i||(i=new U({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#m.has(e.queryHash)||(this.#m.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#m.get(e.queryHash);t&&(e.destroy(),t===e&&this.#m.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){P.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#m.get(e)}getAll(){return[...this.#m.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>h(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>h(e,t)):t}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){P.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){P.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},B=class extends M{#d;#y;#g;#l;constructor(e){super(),this.#d=e.client,this.mutationId=e.mutationId,this.#g=e.mutationCache,this.#y=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#y.includes(e)||(this.#y.push(e),this.clearGcTimeout(),this.#g.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#y=this.#y.filter(t=>t!==e),this.scheduleGc(),this.#g.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#y.length||("pending"===this.state.status?this.scheduleGc():this.#g.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#f({type:"continue"})},n={client:this.#d,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=F({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#g.canRun(this)});const r="pending"===this.state.status,s=!this.#l.canStart();try{if(r)t();else{this.#f({type:"pending",variables:e,isPaused:s}),this.#g.config.onMutate&&await this.#g.config.onMutate(e,this,n);const t=await(this.options.onMutate?.(e,n));t!==this.state.context&&this.#f({type:"pending",context:t,variables:e,isPaused:s})}const i=await this.#l.start();return await(this.#g.config.onSuccess?.(i,e,this.state.context,this,n)),await(this.options.onSuccess?.(i,e,this.state.context,n)),await(this.#g.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n)),await(this.options.onSettled?.(i,null,e,this.state.context,n)),this.#f({type:"success",data:i}),i}catch(t){try{await(this.#g.config.onError?.(t,e,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onError?.(t,e,this.state.context,n))}catch(e){Promise.reject(e)}try{await(this.#g.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onSettled?.(void 0,t,e,this.state.context,n))}catch(e){Promise.reject(e)}throw this.#f({type:"error",error:t}),t}finally{this.#g.runNext(this)}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),P.batch(()=>{this.#y.forEach(t=>{t.onMutationUpdate(e)}),this.#g.notify({mutation:this,type:"updated",action:e})})}},K=class extends A{constructor(e={}){super(),this.config=e,this.#_=new Set,this.#v=new Map,this.#b=0}#_;#v;#b;build(e,t,n){const r=new B({client:e,mutationCache:this,mutationId:++this.#b,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#_.add(e);const t=W(e);if("string"==typeof t){const n=this.#v.get(t);n?n.push(e):this.#v.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#_.delete(e)){const t=W(e);if("string"==typeof t){const n=this.#v.get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#v.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=W(e);if("string"==typeof t){const n=this.#v.get(t),r=n?.find(e=>"pending"===e.state.status);return!r||r===e}return!0}runNext(e){const t=W(e);if("string"==typeof t){const n=this.#v.get(t)?.find(t=>t!==e&&t.state.isPaused);return n?.continue()??Promise.resolve()}return Promise.resolve()}clear(){P.batch(()=>{this.#_.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#_.clear(),this.#v.clear()})}getAll(){return Array.from(this.#_)}find(e){const t={exact:!0,...e};return this.getAll().find(e=>f(t,e))}findAll(e={}){return this.getAll().filter(t=>f(e,t))}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return P.batch(()=>Promise.all(e.map(e=>e.continue().catch(c))))}};function W(e){return e.options.scope?.id}function H(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let n=!1;const u=e=>{!function(e,n,r){let s,i=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t.signal,i||(i=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)})}(e,0,()=>n=!0)},d=$(t.options,t.fetchOptions),l=async(e,r,s)=>{if(n)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);const i=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:s?"backward":"forward",meta:t.options.meta};return u(e),e})(),o=await d(i),{maxPages:a}=t.options,c=s?z:E;return{pages:c(e.pages,o,a),pageParams:c(e.pageParams,r,a)}};if(s&&i.length){const e="backward"===s,t={pages:i,pageParams:o},n=(e?G:V)(r,t);a=await l(t,n,e)}else{const t=e??i.length;do{const e=0===c?o[0]??r.initialPageParam:V(r,a);if(c>0&&null==e)break;a=await l(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function V(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function G(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}const Y=window.React,X=window.ReactJSXRuntime;var ee=Y.createContext(void 0),te=e=>{const t=Y.useContext(ee);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ne=({client:e,children:t})=>(Y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,X.jsx)(ee.Provider,{value:e,children:t}));const re=window.wp.element;var se=class extends A{constructor(e,t){super(),this.options=t,this.#d=e,this.#w=null,this.#S=j(),this.bindMethods(),this.setOptions(t)}#d;#x=void 0;#k=void 0;#E=void 0;#z;#O;#S;#w;#$;#I;#T;#P;#A;#C;#R=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#x.addObserver(this),ie(this.#x,this.options)?this.#j():this.updateResult(),this.#N())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oe(this.#x,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oe(this.#x,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#Z(),this.#D(),this.#x.removeObserver(this)}setOptions(e){const t=this.options,n=this.#x;if(this.options=this.#d.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof p(this.options.enabled,this.#x))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#F(),this.#x.setOptions(this.options),t._defaulted&&!b(this.options,t)&&this.#d.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#x,observer:this});const r=this.hasListeners();r&&ae(this.#x,n,this.options,t)&&this.#j(),this.updateResult(),!r||this.#x===n&&p(this.options.enabled,this.#x)===p(t.enabled,this.#x)&&l(this.options.staleTime,this.#x)===l(t.staleTime,this.#x)||this.#M();const s=this.#U();!r||this.#x===n&&p(this.options.enabled,this.#x)===p(t.enabled,this.#x)&&s===this.#C||this.#L(s)}getOptimisticResult(e){const t=this.#d.getQueryCache().build(this.#d,e),n=this.createResult(t,e);return r=n,!b(this.getCurrentResult(),r)&&(this.#E=n,this.#O=this.options,this.#z=this.#x.state),n;var r}getCurrentResult(){return this.#E}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#S.status||this.#S.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(e){this.#R.add(e)}getCurrentQuery(){return this.#x}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#d.defaultQueryOptions(e),n=this.#d.getQueryCache().build(this.#d,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#j({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#E))}#j(e){this.#F();let t=this.#x.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#M(){this.#Z();const e=l(this.options.staleTime,this.#x);if(a||this.#E.isStale||!u(e))return;const t=d(this.#E.dataUpdatedAt,e)+1;this.#P=o.setTimeout(()=>{this.#E.isStale||this.updateResult()},t)}#U(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#x):this.options.refetchInterval)??!1}#L(e){this.#D(),this.#C=e,!a&&!1!==p(this.options.enabled,this.#x)&&u(this.#C)&&0!==this.#C&&(this.#A=o.setInterval(()=>{(this.options.refetchIntervalInBackground||C.isFocused())&&this.#j()},this.#C))}#N(){this.#M(),this.#L(this.#U())}#Z(){this.#P&&(o.clearTimeout(this.#P),this.#P=void 0)}#D(){this.#A&&(o.clearInterval(this.#A),this.#A=void 0)}createResult(e,t){const n=this.#x,r=this.options,s=this.#E,i=this.#z,o=this.#O,a=e!==n?e.state:this.#k,{state:c}=e;let u,d={...c},l=!1;if(t._optimisticResults){const s=this.hasListeners(),i=!s&&ie(e,t),o=s&&ae(e,n,t,r);(i||o)&&(d={...d,...L(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:f,status:m}=d;u=d.data;let y=!1;if(void 0!==t.placeholderData&&void 0===u&&"pending"===m){let e;s?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=s.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#T?.state.data,this.#T):t.placeholderData,void 0!==e&&(m="success",u=k(s?.data,e,t),l=!0)}if(t.select&&void 0!==u&&!y)if(s&&u===i?.data&&t.select===this.#$)u=this.#I;else try{this.#$=t.select,u=t.select(u),u=k(s?.data,u,t),this.#I=u,this.#w=null}catch(e){this.#w=e}this.#w&&(h=this.#w,u=this.#I,f=Date.now(),m="error");const g="fetching"===d.fetchStatus,_="pending"===m,v="error"===m,b=_&&g,w=void 0!==u,S={status:m,fetchStatus:d.fetchStatus,isPending:_,isSuccess:"success"===m,isError:v,isInitialLoading:b,isLoading:b,data:u,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:f,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>a.dataUpdateCount||d.errorUpdateCount>a.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!w,isPaused:"paused"===d.fetchStatus,isPlaceholderData:l,isRefetchError:v&&w,isStale:ce(e,t),refetch:this.refetch,promise:this.#S,isEnabled:!1!==p(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==S.data,r="error"===S.status&&!t,s=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},i=()=>{const e=this.#S=S.promise=j();s(e)},o=this.#S;switch(o.status){case"pending":e.queryHash===n.queryHash&&s(o);break;case"fulfilled":(r||S.data!==o.value)&&i();break;case"rejected":r&&S.error===o.reason||i()}}return S}updateResult(){const e=this.#E,t=this.createResult(this.#x,this.options);this.#z=this.#x.state,this.#O=this.options,void 0!==this.#z.data&&(this.#T=this.#x),b(t,e)||(this.#E=t,this.#q({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!this.#R.size)return!0;const r=new Set(n??this.#R);return this.options.throwOnError&&r.add("error"),Object.keys(this.#E).some(t=>{const n=t;return this.#E[n]!==e[n]&&r.has(n)})})()}))}#F(){const e=this.#d.getQueryCache().build(this.#d,this.options);if(e===this.#x)return;const t=this.#x;this.#x=e,this.#k=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#N()}#q(e){P.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#E)}),this.#d.getQueryCache().notify({query:this.#x,type:"observerResultsUpdated"})})}};function ie(e,t){return function(e,t){return!1!==p(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&oe(e,t,t.refetchOnMount)}function oe(e,t,n){if(!1!==p(t.enabled,e)&&"static"!==l(t.staleTime,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&ce(e,t)}return!1}function ae(e,t,n,r){return(e!==t||!1===p(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&ce(e,n)}function ce(e,t){return!1!==p(t.enabled,e)&&e.isStaleByTime(l(t.staleTime,e))}var ue=Y.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),de=Y.createContext(!1),le=(de.Provider,(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()}));var pe=class extends A{#d;#E=void 0;#J;#Q;constructor(e,t){super(),this.#d=e,this.setOptions(t),this.bindMethods(),this.#B()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#d.defaultMutationOptions(e),b(this.options,t)||this.#d.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this}),t?.mutationKey&&this.options.mutationKey&&y(t.mutationKey)!==y(this.options.mutationKey)?this.reset():"pending"===this.#J?.state.status&&this.#J.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#J?.removeObserver(this)}onMutationUpdate(e){this.#B(),this.#q(e)}getCurrentResult(){return this.#E}reset(){this.#J?.removeObserver(this),this.#J=void 0,this.#B(),this.#q()}mutate(e,t){return this.#Q=t,this.#J?.removeObserver(this),this.#J=this.#d.getMutationCache().build(this.#d,this.options),this.#J.addObserver(this),this.#J.execute(e)}#B(){const e=this.#J?.state??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};this.#E={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#q(e){P.batch(()=>{if(this.#Q&&this.hasListeners()){const t=this.#E.variables,n=this.#E.context,r={client:this.#d,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===e?.type){try{this.#Q.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if("error"===e?.type){try{this.#Q.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#E)})})}};const he="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,fe="10.50.0",me=globalThis;function ye(){return ge(me),me}function ge(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||fe,t[fe]=t[fe]||{}}function _e(e,t,n=me){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[fe]=r[fe]||{};return s[e]||(s[e]=t())}const ve=["debug","info","warn","error","log","assert","trace"],be={};function we(e){if(!("console"in me))return e();const t=me.console,n={},r=Object.keys(be);r.forEach(e=>{const r=be[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function Se(){return ke().enabled}function xe(e,...t){he&&Se()&&we(()=>{me.console[e](`Sentry Logger [${e}]:`,...t)})}function ke(){return he?_e("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const Ee=function(){ke().enabled=!0},ze=function(...e){xe("log",...e)},Oe=function(...e){xe("warn",...e)},$e=function(...e){xe("error",...e)},Ie=[];function Te(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;if(t.forEach(e=>{e.isDefaultInstance=!0}),Array.isArray(n))r=[...t,...n];else if("function"==typeof n){const e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return function(e){const t={};return e.forEach(e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(r)}function Pe(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Ae(e,t,n){if(n[t.name])he&&ze(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,Ie.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),Ie.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}["processSpan","processSegmentSpan"].forEach(n=>{const r=t[n];"function"==typeof r&&e.on(n,n=>r.call(t,n,e))}),he&&ze(`Integration installed: ${t.name}`)}}function Ce(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}const Re=Object.prototype.toString;function je(e){switch(Re.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Qe(e,Error)}}function Ne(e,t){return Re.call(e)===`[object ${t}]`}function Ze(e){return Ne(e,"ErrorEvent")}function De(e){return Ne(e,"DOMError")}function Fe(e){return Ne(e,"String")}function Me(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ue(e){return null===e||Me(e)||"object"!=typeof e&&"function"!=typeof e}function Le(e){return Ne(e,"Object")}function qe(e){return"undefined"!=typeof Event&&Qe(e,Event)}function Je(e){return Boolean(e?.then&&"function"==typeof e.then)}function Qe(e,t){try{return e instanceof t}catch{return!1}}function Be(e){return!("object"!=typeof e||null===e||!(e.__isVue||e._isVue||e.__v_isVNode))}function Ke(e){return"undefined"!=typeof Request&&Qe(e,Request)}const We=me;function He(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,o=0;const a=" > ",c=a.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&i++<r&&(u=Ve(n,d),!("html"===u||i>1&&o+s.length*c+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function Ve(e,t){const n=e,r=[];if(!n?.tagName)return"";if(We.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(s?.length)s.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const e=n.className;if(e&&Fe(e)){const t=e.split(/\s+/);for(const e of t)r.push(`.${e}`)}}for(const e of["aria-label","type","name","title","alt"]){const t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join("")}function Ge(){try{return We.document.location.href}catch{return""}}function Ye(e,t,n){if(!(t in e))return;const r=e[t];if("function"!=typeof r)return;const s=n(r);"function"==typeof s&&et(s,r);try{e[t]=s}catch{he&&ze(`Failed to replace method "${t}" in object`,e)}}function Xe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{he&&ze(`Failed to add non-enumerable property "${t}" to object`,e)}}function et(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Xe(e,"__sentry_original__",t)}catch{}}function tt(e){return e.__sentry_original__}function nt(e){if(je(e))return{message:e.message,name:e.name,stack:e.stack,...st(e)};if(qe(e)){const t={type:e.type,target:rt(e.target),currentTarget:rt(e.currentTarget),...st(e)};return"undefined"!=typeof CustomEvent&&Qe(e,CustomEvent)&&(t.detail=e.detail),t}return e}function rt(e){try{return"undefined"!=typeof Element&&Qe(e,Element)?He(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function st(e){return"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e)):{}}let it,ot;function at(e){if(void 0!==it)return it?it(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=me;return t in n&&"function"==typeof n[t]?(it=n[t],it(e)):(it=null,e())}function ct(){return at(()=>Math.random())}function ut(){return at(()=>Date.now())}function dt(e=function(){const e=me;return e.crypto||e.msCrypto}()){try{if(e?.randomUUID)return at(()=>e.randomUUID()).replace(/-/g,"")}catch{}return ot||(ot=[1e7]+1e3+4e3+8e3+1e11),ot.replace(/[018]/g,e=>(e^(16*ct()&15)>>e/4).toString(16))}function lt(e){return e.exception?.values?.[0]}function pt(e){const{message:t,event_id:n}=e;if(t)return t;const r=lt(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ht(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function ft(e,t){const n=lt(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}}function mt(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{Xe(e,"__sentry_captured__",!0)}catch{}return!1}const yt="?",gt=/\(error: (.*)\)/,_t=/captureMessage|captureException/;function vt(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{const s=[],i=e.split("\n");for(let e=n;e<i.length;e++){let n=i[e];n.length>1024&&(n=n.slice(0,1024));const o=gt.test(n)?n.replace(gt,"$1"):n;if(!o.includes("Error: ")){for(const e of t){const t=e(o);if(t){s.push(t);break}}if(s.length>=50+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(bt(t).function||"")&&t.pop(),t.reverse(),_t.test(bt(t).function||"")&&(t.pop(),_t.test(bt(t).function||"")&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||bt(t).filename,function:e.function||yt}))}(s.slice(r))}}function bt(e){return e[e.length-1]||{}}const wt="<anonymous>";function St(e){try{return e&&"function"==typeof e&&e.name||wt}catch{return wt}}function xt(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function kt(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function Et(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function zt(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{Be(r)?n.push(kt(r)):n.push(String(r))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Ot(e,t,n=!1){return!!Fe(e)&&(Ne(t,"RegExp")?t.test(e):Fe(t)?n?e===t:e.includes(t):"function"==typeof t&&t(e))}function $t(e,t=[],n=!1){return t.some(t=>Ot(e,t,n))}const It=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],Tt=(e={})=>{let t;return{name:"EventFilters",setup(n){const r=n.getOptions();t=At(e,r)},processEvent(n,r,s){if(!t){const n=s.getOptions();t=At(e,n)}return function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(!t?.length)return!1;const n=e.transaction;return!!n&&$t(n,t)}(e,t.ignoreTransactions))return he&&Oe(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${pt(e)}`),!0}else{if(function(e,t){return!!t?.length&&Ce(e).some(e=>$t(e,t))}(e,t.ignoreErrors))return he&&Oe(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${pt(e)}`),!0;if(function(e){return!!e.exception?.values?.length&&(!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return he&&Oe(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${pt(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=Ct(e);return!!n&&$t(n,t)}(e,t.denyUrls))return he&&Oe(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${pt(e)}.\nUrl: ${Ct(e)}`),!0;if(!function(e,t){if(!t?.length)return!0;const n=Ct(e);return!n||$t(n,t)}(e,t.allowUrls))return he&&Oe(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${pt(e)}.\nUrl: ${Ct(e)}`),!0}return!1}(n,t)?null:n}}},Pt=(e={})=>({...Tt(e),name:"InboundFilters"});function At(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:It],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Ct(e){try{const t=[...e.exception?.values??[]].reverse().find(e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length),n=t?.stacktrace?.frames;return n?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch{return he&&$e(`Cannot extract url for event ${pt(e)}`),null}}function Rt(){return ut()/1e3}let jt;function Nt(){return(jt??(jt=function(){const{performance:e}=me;if(!e?.now||!e.timeOrigin)return Rt;const t=e.timeOrigin;return()=>(t+at(()=>e.now()))/1e3}()))()}function Zt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Nt(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:dt()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Dt(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&0===Object.keys(t).length)return e;const r={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=Dt(r[e],t[e],n-1));return r}function Ft(){return dt()}function Mt(){return dt().substring(16)}const Ut="_sentrySpan";function Lt(e,t){t?Xe(e,Ut,t):delete e[Ut]}function qt(e){return e[Ut]}class Jt{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ft(),sampleRand:ct()}}clone(){const e=new Jt;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,Lt(e,qt(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Zt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,n=t instanceof Jt?t.getScopeData():Le(t)?e:void 0,{tags:r,attributes:s,extra:i,user:o,contexts:a,level:c,fingerprint:u=[],propagationContext:d,conversationId:l}=n||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...a},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),l&&(this._conversationId=l),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Lt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ft(),sampleRand:ct()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:Rt(),...e,message:e.message?Et(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:qt(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Dt(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t?.event_id||dt();if(!this._client)return he&&Oe("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n?.event_id||dt();if(!this._client)return he&&Oe("No client configured on scope - will not capture message!"),r;const s=n?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:s,...n,event_id:r},this),r}captureEvent(e,t){const n=e.event_id||t?.event_id||dt();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(he&&Oe("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const Qt=e=>e instanceof Promise&&!e[Bt],Bt=Symbol("chained PromiseLike");class Kt{constructor(e,t){let n,r;n=e||new Jt,r=t||new Jt,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(e){throw this._popScope(),e}return Je(n)?((e,t,n)=>{const r=e.then(e=>(t(),e),e=>{throw n(),e});return Qt(r)&&Qt(e)?r:((e,t)=>{let n=!1;for(const r in e){if(r in t)continue;n=!0;const s=e[r];"function"==typeof s?Object.defineProperty(t,r,{value:(...t)=>s.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=s}return n&&Object.assign(t,{[Bt]:!0}),t})(e,r)})(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1||!this._stack.pop())}}function Wt(){const e=ge(ye());return e.stack=e.stack||new Kt(_e("defaultCurrentScope",()=>new Jt),_e("defaultIsolationScope",()=>new Jt))}function Ht(e){return Wt().withScope(e)}function Vt(e,t){const n=Wt();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Gt(e){return Wt().withScope(()=>e(Wt().getIsolationScope()))}function Yt(e){const t=ge(e);return t.acs?t.acs:{withIsolationScope:Gt,withScope:Ht,withSetScope:Vt,withSetIsolationScope:(e,t)=>Gt(t),getCurrentScope:()=>Wt().getScope(),getIsolationScope:()=>Wt().getIsolationScope()}}let Xt;function en(){return Yt(ye()).getCurrentScope()}function tn(){return Yt(ye()).getIsolationScope()}function nn(){return en().getClient()}function rn(e){const t=void 0;const n=e.getPropagationContext(),{traceId:r,parentSpanId:s,propagationSpanId:i}=n,o={trace_id:r,span_id:i||Mt()};return s&&(o.parent_span_id=s),o}const sn=new WeakMap,on=()=>({name:"FunctionToString",setupOnce(){Xt=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=tt(this),n=sn.has(nn())&&void 0!==t?t:this;return Xt.apply(n,e)}}catch{}},setup(e){sn.set(e,!0)}}),an="sentry.profile_id",cn="sentry.exclusive_time";function un(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}}function dn(e){const t=e;return{scope:t._sentryScope,isolationScope:un(t._sentryIsolationScope)}}let ln=!1;function pn(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:yn(e).parent_span_id,i=dn(e).scope;return{parent_span_id:s,span_id:r?i?.getPropagationContext().propagationSpanId||Mt():t,trace_id:n}}function hn(e){return e&&e.length>0?e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:s})=>({span_id:e,trace_id:t,sampled:1===n,attributes:s,...r})):void 0}function fn(e){return"number"==typeof e?mn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?mn(e.getTime()):Nt()}function mn(e){return e>9999999999?e/1e3:e}function yn(e){if(function(e){return"function"==typeof e.getSpanJSON}(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(e)){const{attributes:r,startTime:s,name:i,endTime:o,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:gn(e),start_timestamp:fn(s),timestamp:fn(o)||void 0,status:vn(a),op:r["sentry.op"],origin:r["sentry.origin"],links:hn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function gn(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function vn(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"internal_error"}const bn=function(e){return e._sentryRootSpan||e};function wn(){ln||(we(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),ln=!0)}const Sn=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!kn(e,t)&&!!xn(e,t))))}(e,t)||!!function(e,t){const n=En(t),r=En(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!kn(e,t)&&!!xn(e,t)))}(e,t))}(t,e))return he&&Oe("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function xn(e,t){let n=xt(e),r=xt(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],s=n[e];if(t.filename!==s.filename||t.lineno!==s.lineno||t.colno!==s.colno||t.function!==s.function)return!1}return!0}function kn(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch{return!1}}function En(e){return e.exception?.values?.[0]}const zn="production",On=/^o(\d+)\./,$n=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function In(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${o}`}function Tn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Pn(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=function(e){const t=e.match(On);return t?.[1]}(n)),r}function An(e,t=100,n=1/0){try{return Rn("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Cn(e,t=3,n=102400){const r=An(e,t);return s=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(s))>n?Cn(e,t-1,n):r;var s}function Rn(e,t,n=1/0,r=1/0,s=function(){const e=new WeakSet;return[function(t){return!!e.has(t)||(e.add(t),!1)},function(t){e.delete(t)}]}()){const[i,o]=s;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const a=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof globalThis&&t===globalThis)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(Be(t))return kt(t);if(Le(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n)return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${St(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}var n}(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const c="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===c)return a.replace("object ","");if(i(t))return"[Circular ~]";const u=t;if(u&&"function"==typeof u.toJSON)try{return Rn("",u.toJSON(),c-1,r,s)}catch{}const d=Array.isArray(t)?[]:{};let l=0;const p=nt(t);for(const e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(l>=r){d[e]="[MaxProperties ~]";break}const t=p[e];d[e]=Rn(e,t,c-1,r,s),l++}return o(t),d}function jn(e,t=[]){return[e,t]}function Nn(e,t){const[n,r]=e;return[n,[...r,t]]}function Zn(e,t){const n=e[1];for(const e of n)if(t(e,e[0].type))return!0;return!1}function Dn(e){const t=ge(me);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function Fn(e){const[t,n]=e;let r=JSON.stringify(t);function s(e){"string"==typeof r?r="string"==typeof e?r+e:[Dn(r),e]:r.push("string"==typeof e?Dn(e):e)}for(const e of n){const[t,n]=e;if(s(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)s(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(An(n))}s(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(r)}function Mn(e){const t="string"==typeof e.data?Dn(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Un={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function Ln(e){return function(e){return e in Un}(e)?Un[e]:e}function qn(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Jn(e,t){const n=t??function(e){return Qn().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=In(r)),jn(s,[(i=e,[{type:"log",item_count:i.length,content_type:"application/vnd.sentry.items.log+json"},{items:i}])]);var i}(n,r._metadata,r.tunnel,e.getDsn());Qn().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function Qn(){return _e("clientToLogBufferMap",()=>new WeakMap)}function Bn(e,t){const n=t??function(e){return Kn().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=In(r)),jn(s,[(i=e,[{type:"trace_metric",item_count:i.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:i}])]);var i}(n,r._metadata,r.tunnel,e.getDsn());Kn().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Kn(){return _e("clientToMetricBufferMap",()=>new WeakMap)}function Wn(e){return e.split(",").map(e=>{const t=e.indexOf("=");return-1===t?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function Hn(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s={environment:n.environment||zn,release:n.release,public_key:r,trace_id:e,org_id:Pn(t)};return t.emit("createDsc",s),s}function Vn(e){const t=nn();if(!t)return{};const n=bn(e),r=yn(n),s=r.data,i=n.spanContext().traceState,o=i?.get("sentry.sample_rate")??s["sentry.sample_rate"]??s["sentry.previous_trace_sample_rate"];function a(e){return"number"!=typeof o&&"string"!=typeof o||(e.sample_rate=`${o}`),e}const c=n._frozenDsc;if(c)return a(c);const u=i?.get("sentry.dsc"),d=u&&function(e){const t=function(e){if(e&&(Fe(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{const n=Wn(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Wn(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>(t.startsWith("sentry-")&&(e[t.slice(7)]=n),e),{});return Object.keys(n).length>0?n:void 0}(u);if(d)return a(d);const l=Hn(e.spanContext().traceId,t),p=s["sentry.source"]??s["sentry.span.source"],h=r.description;return"url"!==p&&h&&(l.transaction=h),function(){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=nn()?.getOptions();return!(!e||null==e.tracesSampleRate&&!e.tracesSampler)}()&&(l.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return 1===t}(n)),l.sample_rand=i?.get("sentry.sample_rand")??dn(n).scope?.getPropagationContext().sampleRand.toString()),a(l),t.emit("createDsc",l,n),l}function Gn(e){return new Xn(t=>{t(e)})}function Yn(e){return new Xn((t,n)=>{n(e)})}class Xn{constructor(e){this._state=0,this._handlers=[],this._runExecutor(e)}then(e,t){return new Xn((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new Xn((t,n)=>{let r,s;return this.then(t=>{s=!1,r=t,e&&e()},t=>{s=!0,r=t,e&&e()}).then(()=>{s?n(r):t(r)})})}_executeHandlers(){if(0===this._state)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(1===this._state&&e[1](this._value),2===this._state&&e[2](this._value),e[0]=!0)})}_runExecutor(e){const t=(e,t)=>{0===this._state&&(Je(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(1,e)},r=e=>{t(2,e)};try{e(n,r)}catch(e){r(e)}}}function er(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}const tr=Symbol.for("SentryBufferFullError");function nr(e=100){const t=new Set;function n(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(r){if(!(t.size<e))return Yn(tr);const s=r();return t.add(s),s.then(()=>n(s),()=>n(s)),s},drain:function(e){if(!t.size)return Gn(!0);const n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;const r=[n,new Promise(t=>er(setTimeout(()=>t(!1),e)))];return Promise.race(r)}}}function rr(e,t,n=nr(e.bufferSize||64)){let r={};return{send:function(s){const i=[];if(Zn(s,(t,n)=>{const s=Ln(n);!function(e,t,n=ut()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,s)?i.push(t):e.recordDroppedEvent("ratelimit_backoff",s)}),0===i.length)return Promise.resolve({});const o=jn(s[0],i),a=t=>{!function(e,t){return Zn(e,(e,n)=>t.includes(n))}(o,["client_report"])?Zn(o,(n,r)=>{e.recordDroppedEvent(t,Ln(r))}):he&&Oe(`Dropping client report. Will not send outcomes (reason: ${t}).`)};return n.add(()=>t({body:Fn(o)}).then(e=>413===e.statusCode?(he&&$e("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),a("send_error"),e):(he&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Oe(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=ut()){const s={...e},i=n?.["x-sentry-rate-limits"],o=n?.["retry-after"];if(i)for(const e of i.trim().split(",")){const[t,n,,,i]=e.split(":",5),o=parseInt(t,10),a=1e3*(isNaN(o)?60:o);if(n)for(const e of n.split(";"))"metric_bucket"===e&&i&&!i.split(";").includes("custom")||(s[e]=r+a);else s.all=r+a}else o?s.all=r+function(e,t=ut()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(o,r):429===t&&(s.all=r+6e4);return s}(r,e),e),e=>{throw a("network_error"),he&&$e("Encountered error running transport request:",e),e})).then(e=>e,e=>{if(e===tr)return he&&$e("Skipped sending event because buffer is full."),a("queue_overflow"),Promise.resolve({});throw e})},flush:e=>n.drain(e)}}function sr(e,t,n,r=0){try{const s=ir(t,n,e,r);return Je(s)?s:Gn(s)}catch(e){return Yn(e)}}function ir(e,t,n,r){const s=n[r];if(!e||!s)return e;const i=s({...e},t);return he&&null===i&&ze(`Event processor "${s.id||"?"}" dropped event`),Je(i)?i.then(e=>ir(e,t,n,r+1)):ir(i,t,n,r+1)}let or,ar,cr,ur;function dr(e,t){const{extra:n,tags:r,attributes:s,user:i,contexts:o,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:d,eventProcessors:l,attachments:p,propagationContext:h,transactionName:f,span:m}=t;lr(e,"extra",n),lr(e,"tags",r),lr(e,"attributes",s),lr(e,"user",i),lr(e,"contexts",o),e.sdkProcessingMetadata=Dt(e.sdkProcessingMetadata,c,2),a&&(e.level=a),f&&(e.transactionName=f),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...h}}function lr(e,t,n){e[t]=Dt(e[t],n,1)}function pr(e,t){const n=_e("globalScope",()=>new Jt).getScopeData();return e&&dr(n,e.getScopeData()),t&&dr(n,t.getScopeData()),n}function hr(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||dt(),timestamp:t.timestamp||Rt()},u=n.integrations||e.integrations.map(e=>e.name);!function(e,t){const{environment:n,release:r,dist:s,maxValueLength:i}=t;e.environment=e.environment||n||zn,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s);const o=e.request;o?.url&&i&&(o.url=Et(o.url,i)),i&&e.exception?.values?.forEach(e=>{e.value&&(e.value=Et(e.value,i))})}(c,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(c,u),s&&s.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=function(e){const t=me._sentryDebugIds,n=me._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],s=n?Object.keys(n):[];if(ur&&r.length===ar&&s.length===cr)return ur;ar=r.length,cr=s.length,ur={},or||(or={});const i=(t,n)=>{for(const r of t){const t=n[r],s=or?.[r];if(s&&ur&&t)ur[s[0]]=t,or&&(or[r]=[s[0],t]);else if(t){const n=e(r);for(let e=n.length-1;e>=0;e--){const s=n[e],i=s?.filename;if(i&&ur&&or){ur[i]=t,or[r]=[i,t];break}}}}};return t&&i(r,t),n&&i(s,n),ur}(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}(c,e.stackParser);const d=function(e,t){if(!t)return e;const n=e?e.clone():new Jt;return n.update(t),n}(r,n.captureContext);n.mechanism&&ft(c,n.mechanism);const l=s?s.getEventProcessors():[],p=pr(i,d),h=[...n.attachments||[],...p.attachments];h.length&&(n.attachments=h),function(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;!function(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),o&&(e.level=o),a&&"transaction"!==e.type&&(e.transaction=a)}(e,t),r&&function(e,t){e.contexts={trace:pn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Vn(t),...e.sdkProcessingMetadata};const n=yn(bn(t)).description;n&&!e.transaction&&"transaction"===e.type&&(e.transaction=n)}(e,r),function(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,s),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,i)}(c,p);const f=[...l,...p.eventProcessors];return(n.data&&!0===n.data.__sentry__?Gn(c):sr(f,c,n)).then(e=>(e&&function(e){const t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof o&&o>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:An(e.data,t,n)}}))},...e.user&&{user:An(e.user,t,n)},...e.contexts&&{contexts:An(e.contexts,t,n)},...e.extra&&{extra:An(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=An(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:An(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=An(e.contexts.flags,3,n)),r}(e,o,a):e))}const fr=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function mr(e){ze(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function yr(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(_r(n)){if(Ot(e.description,n))return he&&mr(e),!0;continue}if(!n.name&&!n.op)continue;const t=!n.name||Ot(e.description,n.name),r=!n.op||e.op&&Ot(e.op,n.op);if(t&&r)return he&&mr(e),!0}return!1}function gr(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function _r(e){return"string"==typeof e||e instanceof RegExp}const vr="Not capturing exception because it's already been captured.",br="Discarded session because of missing or non-string release",wr=Symbol.for("SentryInternalError"),Sr=Symbol.for("SentryDoNotSendEventError");function xr(e){return{message:e,[wr]:!0}}function kr(e){return{message:e,[Sr]:!0}}function Er(e){return!!e&&"object"==typeof e&&wr in e}function zr(e){return!!e&&"object"==typeof e&&Sr in e}function Or(e,t,n,r,s){let i,o=0,a=!1;e.on(n,()=>{o=0,clearTimeout(i),a=!1}),e.on(t,t=>{o+=r(t),o>=8e5?s(e):a||(a=!0,i=er(setTimeout(()=>{s(e)},5e3)))}),e.on("flush",()=>{s(e)})}class $r{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=nr(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=$n.exec(e);if(!t)return void we(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});const[n,r,s="",i="",o="",a=""]=t.slice(1);let c="",u=a;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return Tn({host:i,pass:s,path:c,projectId:u,port:o,protocol:n,publicKey:r})}(e):Tn(e);if(t&&function(e){if(!he)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&($e(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&($e(`Invalid Sentry Dsn: Invalid port ${t}`),1):($e(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):($e(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):he&&Oe("No DSN provided, client will not send events."),this._dsn){const s=(t=this._dsn,n=e.tunnel,r=e._metadata?e._metadata.sdk:void 0,n||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(t)}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(t,r)}`);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:s})}var t,n,r;this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Or(this,"afterCaptureLog","flushLogs",Cr,Jn),(this._options.enableMetrics??this._options._experiments?.enableMetrics??1)&&Or(this,"afterCaptureMetric","flushMetrics",Ar,Bn)}captureException(e,t,n){const r=dt();if(mt(e))return he&&ze(vr),r;const s={event_id:r,...t};return this._process(()=>this.eventFromException(e,s).then(e=>this._captureEvent(e,s,n)).then(e=>e),"error"),s.event_id}captureMessage(e,t,n,r){const s={event_id:dt(),...n},i=Me(e)?e:String(e),o=Ue(e),a=o?this.eventFromMessage(i,t,s):this.eventFromException(e,s);return this._process(()=>a.then(e=>this._captureEvent(e,s,r)),o?"unknown":"error"),s.event_id}captureEvent(e,t,n){const r=dt();if(t?.originalException&&mt(t.originalException))return he&&ze(vr),r;const s={event_id:r,...t},i=e.sdkProcessingMetadata||{},o=i.capturedSpanScope,a=i.capturedSpanIsolationScope,c=Ir(e.type);return this._process(()=>this._captureEvent(e,s,o||n,a),c),s.event_id}captureSession(e){this.sendSession(e),Zt(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(!t)return!0;this.emit("flush");const n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){Jn(this);const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),Ae(this,e,this._integrations),t||Pe(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){const s=qn(n),i=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){if(!t)return e;const n=e.sdk||{};e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0}}(e,n?.sdk);const o=function(e,t,n,r){const s=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:In(r)},...s&&{trace:s}}}(e,s,r,t);return delete e.sdkProcessingMetadata,jn(o,[[{type:i},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Nn(n,Mn(e));this.sendEnvelope(n).then(t=>this.emit("afterSendEvent",e,t))}sendSession(e){const{release:t,environment:n=zn}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(he&&Oe(br));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(he&&Oe(br));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=function(e,t,n,r){const s=qn(n);return jn({sent_at:(new Date).toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:In(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){const r=`${e}:${t}`;he&&ze(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return he&&$e("Error while sending envelope:",e),{}}return he&&$e("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&Ae(e,t,n)}),n}(this,e),Pe(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const s=t.exception?.values;if(s){r=!0,n=!1;for(const e of s)if(!1===e.mechanism?.handled){n=!0;break}}const i="ok"===e.status;(i&&0===e.errors||i&&n)&&(Zt(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const s=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i?.length&&(t.integrations=i),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),hr(s,e,t,n,this,r).then(e=>{if(null===e)return e;this.emit("postprocessEvent",e,t),e.contexts={trace:{...e.contexts?.trace,...rn(n)},...e.contexts};const r=function(e,t){const n=t.getPropagationContext();return n.dsc||Hn(n.traceId,e)}(this,n);return e.sdkProcessingMetadata={dynamicSamplingContext:r,...e.sdkProcessingMetadata},e})}_captureEvent(e,t={},n=en(),r=tn()){return he&&Tr(e)&&ze(`Captured error event \`${Ce(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{he&&(zr(e)?ze(e.message):Er(e)?Oe(e.message):Oe(e))})}_processEvent(e,t,n,r){const s=this.getOptions(),{sampleRate:i}=s,o=Pr(e),a=Tr(e),c=`before send for type \`${e.type||"error"}\``,u=void 0===i?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}(i);if(a&&"number"==typeof u&&ct()>u)return this.recordDroppedEvent("sample_rate","error"),Yn(kr(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const d=Ir(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(null===e)throw this.recordDroppedEvent("event_processor",d),kr("An event processor returned `null`, will not send event.");if(!0===t.data?.__sentry__)return e;const n=function(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,ignoreSpans:o}=t,a=!((c=t.beforeSendSpan)&&"function"==typeof c&&"_streamed"in c&&c._streamed)&&t.beforeSendSpan;var c;let u=n;if(Tr(u)&&s)return s(u,r);if(Pr(u)){if(a||o){const t=function(e){const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:a}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o?.[an],exclusive_time:o?.[cn],measurements:e.measurements,is_segment:!0}}(u);if(o?.length&&yr(t,o))return null;if(a){const e=a(t);e?u=Dt(n,{type:"transaction",timestamp:(d=e).timestamp,start_timestamp:d.start_timestamp,transaction:d.description,contexts:{trace:{trace_id:d.trace_id,span_id:d.span_id,parent_span_id:d.parent_span_id,op:d.op,status:d.status,origin:d.origin,data:{...d.data,...d.profile_id&&{[an]:d.profile_id},...d.exclusive_time&&{[cn]:d.exclusive_time}}}},measurements:d.measurements}):wn()}if(u.spans){const t=[],n=u.spans;for(const e of n)if(o?.length&&yr(e,o))gr(n,e);else if(a){const n=a(e);n?t.push(n):(wn(),t.push(e))}else t.push(e);const r=u.spans.length-t.length;r&&e.recordDroppedEvent("before_send","span",r),u.spans=t}}if(i){if(u.spans){const e=u.spans.length;u.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return i(u,r)}}var d;return u}(this,s,e,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Je(e))return e.then(e=>{if(!Le(e)&&null!==e)throw xr(n);return e},e=>{throw xr(`${t} rejected with ${e}`)});if(!Le(e)&&null!==e)throw xr(n);return e}(n,c)}).then(s=>{if(null===s){if(this.recordDroppedEvent("before_send",d),o){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw kr(`${c} returned \`null\`, will not send event.`)}const i=n.getSession()||r.getSession();if(a&&i&&this._updateSessionFromEvent(i,s),o){const e=(s.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(s.spans?s.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const u=s.transaction_info;if(o&&u&&s.transaction!==e.transaction){const e="custom";s.transaction_info={...u,source:e}}return this.sendEvent(s,t),s}).then(null,e=>{if(zr(e)||Er(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),xr(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===tr&&this.recordDroppedEvent("queue_overflow",t),e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){he&&ze("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(he&&ze("No outcomes to send"));if(!this._dsn)return void(he&&ze("No dsn provided, will not send outcomes"));he&&ze("Sending outcomes:",e);const t=(n=e,jn((r=this._options.tunnel&&In(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:Rt(),discarded_events:n}]]));var n,r;this.sendEnvelope(t)}}function Ir(e){return"replay_event"===e?"replay":e||"error"}function Tr(e){return void 0===e.type}function Pr(e){return"transaction"===e.type}function Ar(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+Rr(e.attributes)}function Cr(e){let t=0;return e.message&&(t+=2*e.message.length),t+Rr(e.attributes)}function Rr(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*jr(e[0]):Ue(e)?t+=jr(e):t+=100}),t}function jr(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}function Nr(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}function Zr(e){return function(e){return je(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function Dr(e,t){const n=Mr(e,t),r={type:qr(t),value:Jr(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Fr(e,t){return{exception:{values:[Dr(e,t)]}}}function Mr(e,t){const n=t.stacktrace||t.stack||"",r=function(e){return e&&Ur.test(e.message)?1:0}(t),s=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);try{return e(n,r,s)}catch{}return[]}const Ur=/Minified React error #\d+;/i;function Lr(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function qr(e){const t=e?.name;return!t&&Lr(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Jr(e){const t=e?.message;return Lr(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?Zr(t.error):Zr(e):"No error message"}function Qr(e,t,n,r,s){let i;if(Ze(t)&&t.error)return Fr(e,t.error);if(De(t)||Ne(t,"DOMException")){const s=t;if("stack"in t)i=Fr(e,t);else{const t=s.name||(De(s)?"DOMError":"DOMException"),o=s.message?`${t}: ${s.message}`:t;i=Br(e,o,n,r),ht(i,o)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return je(t)?Fr(e,t):Le(t)||qe(t)?(i=function(e,t,n,r){const s=nn(),i=s?.getOptions().normalizeDepth,o=(a=t,Object.values(a).find(e=>e instanceof Error));var a;const c={__serialized__:Cn(t,i)};if(o)return{exception:{values:[Dr(e,o)]},extra:c};const u={exception:{values:[{type:qe(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Kr(t,{isUnhandledRejection:r})}]},extra:c};if(n){const t=Mr(e,n);t.length&&(u.exception.values[0].stacktrace={frames:t})}return u}(e,t,n,s),ft(i,{synthetic:!0}),i):(i=Br(e,t,n,r),ht(i,`${t}`,void 0),ft(i,{synthetic:!0}),i)}function Br(e,t,n,r){const s={};if(r&&n){const r=Mr(e,n);r.length&&(s.exception={values:[{value:t,stacktrace:{frames:r}}]}),ft(s,{synthetic:!0})}if(Me(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return s.logentry={message:e,params:n},s}return s.message=t,s}function Kr(e,{isUnhandledRejection:t}){const n=function(e){const t=Object.keys(nt(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}(e),r=t?"promise rejection":"exception";return Ze(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:qe(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Wr(e,t){return en().captureEvent(e,t)}function Hr(e){const t=tn(),{user:n}=pr(t,en()),{userAgent:r}=me.navigator||{},s=function(e){const t=Nt(),n={sid:dt(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return{sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}(n)};return e&&Zt(n,e),n}({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return"ok"===i?.status&&Zt(i,{status:"exited"}),Vr(),t.setSession(s),s}function Vr(){const e=tn(),t=en().getSession()||e.getSession();t&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),Zt(e,t)}(t),Gr(),e.setSession()}function Gr(){const e=tn(),t=nn(),n=e.getSession();n&&t&&t.captureSession(n)}function Yr(e=!1){e?Vr():Gr()}const Xr=me;let es=0;function ts(){return es>0}function ns(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(tt(e))return e}catch{return e}const n=function(...n){try{const r=n.map(e=>ns(e,t));return e.apply(this,r)}catch(e){throw es++,setTimeout(()=>{es--}),function(...e){const t=Yt(ye());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}(r=>{var s;r.addEventProcessor(e=>(t.mechanism&&(ht(e,void 0,void 0),ft(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),s=e,en().captureException(s,function(e){if(e)return function(e){return e instanceof Jt||"function"==typeof e}(e)||function(e){return Object.keys(e).some(e=>fr.includes(e))}(e)?{captureContext:e}:e}(void 0))}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}et(n,e),Xe(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}class rs extends $r{constructor(e){const t=(n=e,{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:Xr.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...n});var n;!function(e,t,n=[t],r="npm"){const s=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${t}`,s.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:fe})),s.version=fe)}(t,"browser",["browser"],Xr.SENTRY_SDK_SOURCE||"npm"),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?"auto":"never",...t._metadata.sdk.settings}),super(t);const{sendDefaultPii:r,sendClientReports:s,enableLogs:i,_experiments:o,enableMetrics:a}=this._options,c=a??o?.enableMetrics??!0;Xr.document&&(s||i||c)&&Xr.document.addEventListener("visibilitychange",()=>{"hidden"===Xr.document.visibilityState&&(s&&this._flushOutcomes(),i&&Jn(this),c&&Bn(this))}),r&&this.on("beforeSendSession",Nr)}eventFromException(e,t){return function(e,t,n,r){const s=Qr(e,t,n?.syntheticException||void 0,r);return ft(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),Gn(s)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,s){const i=Br(e,t,r?.syntheticException||void 0,s);return i.level=n,r?.event_id&&(i.event_id=r.event_id),Gn(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}}const ss={},is={};function os(e,t){ss[e]=ss[e]||[],ss[e].push(t)}function as(e,t){if(!is[e]){is[e]=!0;try{t()}catch(t){he&&$e(`Error while instrumenting ${e}`,t)}}}function cs(e,t){const n=e&&ss[e];if(n)for(const r of n)try{r(t)}catch(t){he&&$e(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${St(r)}\nError:`,t)}}function us(){"console"in me&&ve.forEach(function(e){e in me.console&&Ye(me.console,e,function(t){return be[e]=t,function(...t){cs("console",{args:t,level:e});const n=be[e];n?.apply(me.console,t)}})})}const ds=me;function ls(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function ps(e,t=!1){t&&!function(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in ds))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}())return!1;if(ls(ds.fetch))return!0;let e=!1;const t=ds.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=ls(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){he&&Oe("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}()||Ye(me,"fetch",function(t){return function(...n){const r=new Error,{method:s,url:i}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:fs(t),method:hs(n,"method")?String(n.method).toUpperCase():Ke(t)&&hs(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:fs(t),method:hs(t,"method")?String(t.method).toUpperCase():"GET"}}(n),o={args:n,fetchData:{method:s,url:i},startTimestamp:1e3*Nt(),virtualError:r,headers:ms(n)};return e||cs("fetch",{...o}),t.apply(me,n).then(async t=>(e?e(t):cs("fetch",{...o,endTimestamp:1e3*Nt(),response:t}),t),e=>{cs("fetch",{...o,endTimestamp:1e3*Nt(),error:e}),je(e)&&void 0===e.stack&&(e.stack=r.stack,Xe(e,"framesToPop",1));const t=nn(),n=t?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==n&&e instanceof TypeError&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const t=new URL(o.fetchData.url).host;"always"===n?e.message=`${e.message} (${t})`:Xe(e,"__sentry_fetch_url_host__",t)}catch{}throw e})}})}function hs(e,t){return!!e&&"object"==typeof e&&!!e[t]}function fs(e){return"string"==typeof e?e:e?hs(e,"url")?e.url:e.toString?e.toString():"":""}function ms(e){const[t,n]=e;try{if("object"==typeof n&&null!==n&&"headers"in n&&n.headers)return new Headers(n.headers);if(Ke(t))return new Headers(t.headers)}catch{}}const ys=100;function gs(e,t){const n=nn(),r=tn();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=ys}=n.getOptions();if(i<=0)return;const o={timestamp:Rt(),...e},a=s?we(()=>s(o,t)):o;null!==a&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}function _s(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}function vs(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const bs=me;let ws,Ss,xs;function ks(){if(!bs.document)return;const e=cs.bind(null,"dom"),t=Es(e,!0);bs.document.addEventListener("click",t,!1),bs.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=bs,r=n[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Ye(r,"addEventListener",function(t){return function(n,r,s){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},i=r[n]=r[n]||{refCount:0};if(!i.handler){const r=Es(e);i.handler=r,t.call(this,n,r,s)}i.refCount++}catch{}return t.call(this,n,r,s)}}),Ye(r,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},s=n[t];s&&(s.refCount--,s.refCount<=0&&(e.call(this,t,s.handler,r),s.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function Es(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;Xe(n,"_sentryCaptured",!0),r&&!r._sentryId&&Xe(r,"_sentryId",dt());const s="keypress"===n.type?"input":n.type;(function(e){if(e.type!==Ss)return!1;try{if(!e.target||e.target._sentryId!==xs)return!1}catch{}return!0})(n)||(e({event:n,name:s,global:t}),Ss=n.type,xs=r?r._sentryId:void 0),clearTimeout(ws),ws=bs.setTimeout(()=>{xs=void 0,Ss=void 0},1e3)}}const zs="__sentry_xhr_v3__";function Os(){if(!bs.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,s=1e3*Nt(),i=Fe(n[0])?n[0].toUpperCase():void 0,o=function(e){if(Fe(e))return e;try{return e.toString()}catch{}}(n[1]);if(!i||!o)return e.apply(t,n);t[zs]={method:i,url:o,request_headers:{}},"POST"===i&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const a=()=>{const e=t[zs];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}cs("xhr",{endTimestamp:1e3*Nt(),startTimestamp:s,xhr:t,virtualError:r})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(a(),e.apply(t,n))}):t.addEventListener("readystatechange",a),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,s]=n,i=t[zs];return i&&Fe(r)&&Fe(s)&&(i.request_headers[r.toLowerCase()]=s),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[zs];return r?(void 0!==n[0]&&(r.body=n[0]),cs("xhr",{startTimestamp:1e3*Nt(),xhr:t}),e.apply(t,n)):e.apply(t,n)}})}let $s;function Is(e){const t="history";os(t,e),as(t,Ts)}function Ts(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=$s,s=function(e){try{return new URL(e,bs.location.origin).toString()}catch{return e}}(String(n));if($s=s,r===s)return e.apply(this,t);cs("history",{from:r,to:s})}return e.apply(this,t)}}bs.addEventListener("popstate",()=>{const e=bs.location.href,t=$s;$s=e,t!==e&&cs("history",{from:t,to:e})}),"history"in ds&&ds.history&&(Ye(bs.history,"pushState",e),Ye(bs.history,"replaceState",e))}const Ps="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,As=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console";os(t,e),as(t,us)}(function(e){return function(t){if(nn()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:(r=t.level,"warn"===r?"warning":["fatal","error","warning","log","info","debug"].includes(r)?r:"log"),message:zt(t.args," ")};var r;if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${zt(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}gs(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(nn()!==e)return;let r,s,i="object"==typeof t?t.serializeAttribute:void 0,o="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;o&&o>1024&&(Ps&&Oe(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=1024),"string"==typeof i&&(i=[i]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=He(t,{keyAttrs:i,maxStringLength:o}),s=function(e,t=5){if(!We.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}(t)}catch{r="<unknown>"}if(0===r.length)return;const a={category:`ui.${n.name}`,message:r};s&&(a.data={"ui.component_name":s}),gs(a,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),os("dom",n),as("dom",ks)),t.xhr&&function(e){os("xhr",e),as("xhr",Os)}(function(e){return function(t){if(nn()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,s=t.xhr[zs];if(!n||!r||!s)return;const{method:i,url:o,status_code:a,body:c}=s,u={method:i,url:o,status_code:a},d={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},l={category:"xhr",data:u,type:"http",level:_s(a)};e.emit("beforeOutgoingRequestBreadcrumb",l,d),gs(l,d)}}(e)),t.fetch&&function(e){const t="fetch";os(t,e),as(t,()=>ps(void 0,void 0))}(function(e){return function(t){if(nn()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const s={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},i={category:"fetch",data:t.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),gs(i,s)}else{const s=t.response,i={...t.fetchData,status_code:s?.status},o={input:t.args,response:s,startTimestamp:n,endTimestamp:r},a={category:"fetch",data:i,type:"http",level:_s(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,o),gs(a,o)}}}(e)),t.history&&Is(function(e){return function(t){if(nn()!==e)return;let n=t.from,r=t.to;const s=vs(Xr.location.href);let i=n?vs(n):void 0;const o=vs(r);i?.path||(i=s),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),s.protocol===i.protocol&&s.host===i.host&&(n=i.relative),gs({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){nn()===e&&gs({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:pt(t)},{event:t})}}(e))}}},Cs="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),Rs=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&Ye(Xr,"setTimeout",js),t.setInterval&&Ye(Xr,"setInterval",js),t.requestAnimationFrame&&Ye(Xr,"requestAnimationFrame",Ns),t.XMLHttpRequest&&"XMLHttpRequest"in Xr&&Ye(XMLHttpRequest.prototype,"send",Zs);const e=t.eventTarget;e&&(Array.isArray(e)?e:Cs).forEach(e=>function(e,t){const n=Xr,r=n[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Ye(r,"addEventListener",function(n){return function(r,s,i){try{"function"==typeof s.handleEvent&&(s.handleEvent=ns(s.handleEvent,{mechanism:{data:{handler:St(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&function(e,t,n){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,n)}(this,r,s),n.apply(this,[r,ns(s,{mechanism:{data:{handler:St(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),i])}}),Ye(r,"removeEventListener",function(e){return function(t,n,r){try{const s=n.__sentry_wrapped__;s&&e.call(this,t,s,r)}catch{}return e.call(this,t,n,r)}}))}(e,t))}}};function js(e){return function(...t){const n=t[0];return t[0]=ns(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${St(e)}`}}),e.apply(this,t)}}function Ns(e){return function(t){return e.apply(this,[ns(t,{mechanism:{data:{handler:St(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Zs(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Ye(n,e,function(t){const n={mechanism:{data:{handler:St(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=tt(t);return r&&(n.mechanism.data.handler=St(r)),ns(t,n)})}),e.apply(this,t)}}const Ds=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===Xr.document)return void(Ps&&Oe("Using the `browserSessionIntegration` in non-browser environments is not supported."));Hr({ignoreDuration:!0}),Yr();const e=tn();let n=e.getUser();e.addScopeListener(e=>{const t=e.getUser();n?.id===t?.id&&n?.ip_address===t?.ip_address||(Yr(),n=t)}),"route"===t&&Is(({from:e,to:t})=>{e!==t&&(Hr({ignoreDuration:!0}),Yr())})}}};function Fs(){try{const e=Xr.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}let Ms=null;function Us(){Ms=me.onerror,me.onerror=function(e,t,n,r,s){return cs("error",{column:r,error:s,line:n,msg:e,url:t}),!!Ms&&Ms.apply(this,arguments)},me.onerror.__SENTRY_INSTRUMENTED__=!0}let Ls=null;function qs(){Ls=me.onunhandledrejection,me.onunhandledrejection=function(e){return cs("unhandledrejection",e),!Ls||Ls.apply(this,arguments)},me.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Js=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(){const t="error";os(t,t=>{const{stackParser:n,attachStacktrace:r}=Bs();if(nn()!==e||ts())return;const{msg:s,url:i,line:o,column:a,error:c}=t,u=function(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[];return 0===c.length&&c.push({colno:r,lineno:n,filename:Ks(t)??Ge(),function:yt,in_app:!0}),e}(Qr(n,c||s,void 0,r,!1),i,o,a);u.level="error",Wr(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})}),as(t,Us)}()}(e),Qs("onerror")),t.onunhandledrejection&&(function(e){!function(){const t="unhandledrejection";os(t,t=>{const{stackParser:n,attachStacktrace:r}=Bs();if(nn()!==e||ts())return;const s=function(e){if(Ue(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t),i=Ue(s)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`}]}}:Qr(n,s,void 0,r,!0);i.level="error",Wr(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})}),as(t,qs)}()}(e),Qs("onunhandledrejection"))}}};function Qs(e){Ps&&ze(`Global Handler attached: ${e}`)}function Bs(){const e=nn();return e?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Ks(e){if(Fe(e)&&0!==e.length)return e.startsWith("data:")?`<${function(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=e.includes(";base64,"),i=e.indexOf(",");let o="";if(t&&-1!==i){const t=e.slice(i+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${s?",base64":""}${o?`,${o}`:""}`}return e}(e,!1)}>`:e}function Ws(e,t,n,r,s,i){if(!s.exception?.values||!i||!Qe(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=Hs(e,t,r,i.originalException,n,s.exception.values,o,0))}function Hs(e,t,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if(Qe(r[s],Error)){Gs(o,a,r);const i=e(t,r[s]),u=c.length;Ys(i,s,u,a),c=Hs(e,t,n,r[s],s,[i,...c],i,u)}return Vs(r)&&r.errors.forEach((i,u)=>{if(Qe(i,Error)){Gs(o,a,r);const d=e(t,i),l=c.length;Ys(d,`errors[${u}]`,l,a),c=Hs(e,t,n,i,s,[d,...c],d,l)}}),c}function Vs(e){return Array.isArray(e.errors)}function Gs(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Vs(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ys(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}const Xs=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,s){Ws(Dr,s.getOptions().stackParser,n,t,e,r)}}};function ei(e,t,n,r){const s={filename:e,function:"<anonymous>"===t?yt:t,in_app:!0};return void 0!==n&&(s.lineno=n),void 0!==r&&(s.colno=r),s}const ti=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ni=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ri=/\((\S*)(?::(\d+))(?::(\d+))\)/,si=/at (.+?) ?\(data:(.+?),/,ii=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,oi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ai=vt([30,e=>{const t=e.match(si);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=ti.exec(e);if(n){const[,e,t,r]=n;return ei(e,yt,+t,+r)}const r=ni.exec(e);if(r){if(0===r[2]?.indexOf("eval")){const e=ri.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}const[e,t]=ci(r[1]||yt,r[2]);return ei(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],[50,e=>{const t=ii.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=oi.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||yt;return[n,e]=ci(n,e),ei(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),ci=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:yt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},ui="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,di={};function li(e,t=function(e){const t=di[e];if(t)return t;let n=bs[e];if(ls(n))return di[e]=n.bind(bs);const r=bs.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const s=t.contentWindow;s?.[e]&&(n=s[e]),r.head.removeChild(t)}catch(t){ui&&Oe(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n?di[e]=n.bind(bs):n}("fetch")){let n=0,r=0;return rr(e,async function(s){const i=s.body.length;n+=i,r++;const o={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")}}}catch(e){throw di.fetch=void 0,e}finally{n-=i,r--}},nr(e.bufferSize||40))}const pi="string"==typeof window.JAAK_VERSION&&window.JAAK_VERSION.length>0?window.JAAK_VERSION:null;!function(e={}){const t=!e.skipBrowserExtensionCheck&&!!function(){if(void 0===Xr.window)return!1;const e=Xr;if(e.nw)return!1;const t=e.chrome||e.browser;if(!t?.runtime?.id)return!1;const n=Ge();return!(Xr===Xr.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}()&&(Ps&&we(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0);let n=null==e.defaultIntegrations?[Pt(),on(),{name:"ConversationId",setup(e){e.on("spanStart",e=>{const t=en().getScopeData(),n=tn().getScopeData(),r=t.conversationId||n.conversationId;if(r){const{op:t,data:n,description:s}=yn(e);if(!t?.startsWith("gen_ai.")&&!n["ai.operationId"]&&!s?.startsWith("ai."))return;e.setAttribute("gen_ai.conversation.id",r)}})}},Rs(),As(),Js(),Xs(),Sn(),{name:"HttpContext",preprocessEvent(e){if(!Xr.navigator&&!Xr.location&&!Xr.document)return;const t=function(){const e=Ge(),{referrer:t}=Xr.document||{},{userAgent:n}=Xr.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}},{name:"CultureContext",preprocessEvent(e){const t=Fs();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=Fs();t&&(e.attributes={"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar,...e.attributes})}},Ds()]:e.defaultIntegrations;const r={...e,enabled:!t&&e.enabled,stackParser:(s=e.stackParser||ai,Array.isArray(s)?vt(...s):s),integrations:Te({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||li};var s;!function(e,t){!0===t.debug&&(he?Ee():we(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),en().update(t.initialScope);const n=new e(t);(function(e){en().setClient(e)})(n),n.init()}(rs,r)}({dsn:"https://bd3b645ba0f80fff939178d86353467c@o4507568947200000.ingest.de.sentry.io/4511292185641040",environment:window.JAAK_SENTRY_ENV,release:null===pi?void 0:`jaak-for-woocommerce@${pi}`,tracesSampleRate:0,sendDefaultPii:!0,normalizeDepth:10,normalizeMaxBreadth:5e3,initialScope:{...window.JAAK_WP_USER?{user:window.JAAK_WP_USER}:{},tags:{wp_site_url:window.WORDPRESS_SITE_URL,wp_site_url_hostname:function(e){if("string"!=typeof e||0===e.length)return null;try{return new URL(e).hostname}catch{return null}}(window.WORDPRESS_SITE_URL),jaak_version:pi,wp_version:"string"==typeof window.JAAK_WP_VERSION?window.JAAK_WP_VERSION:null,wc_version:"string"==typeof window.JAAK_WC_VERSION?window.JAAK_WC_VERSION:null,php_version:"string"==typeof window.JAAK_PHP_VERSION?window.JAAK_PHP_VERSION:null}}});var hi=(e,t,n)=>((e,t,n={})=>{let r=`${e}=${t}`;if(e.startsWith("__Secure-")&&!n.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(e.startsWith("__Host-")){if(!n.secure)throw new Error("__Host- Cookie must have Secure attributes");if("/"!==n.path)throw new Error('__Host- Cookie must have Path attributes with "/"');if(n.domain)throw new Error("__Host- Cookie must not have Domain attributes")}for(const e of["domain","path"])if(n[e]&&/[;\r\n]/.test(n[e]))throw new Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&"number"==typeof n.maxAge&&n.maxAge>=0){if(n.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+="; Max-Age="+(0|n.maxAge)}if(n.domain&&"host"!==n.prefix&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r})(e,t=encodeURIComponent(t),n);Error;var fi=(e,t)=>{for(const[n,r]of Object.entries(t)){const t=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(t,r?`/${r}`:"")}return e},mi=e=>{const t=new URLSearchParams;for(const[n,r]of Object.entries(e))if(void 0!==r)if(Array.isArray(r))for(const e of r)t.append(n,e);else t.set(n,r);return t},yi=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,"/"):e.replace(/\/index(?=\?|$)/,"");function gi(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function _i(e,t){if(!gi(e)&&!gi(t))return t;const n={...e};for(const e in t){const r=t[e];gi(n[e])&&gi(r)?n[e]=_i(n[e],r):n[e]=r}return n}var vi=(e,t)=>new Proxy(()=>{},{get(n,r){if("string"==typeof r&&"then"!==r)return vi(e,[...t,r])},apply:(n,r,s)=>e({path:t,args:s})}),bi=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){const t=new FormData;for(const[n,r]of Object.entries(e.form))if(void 0!==r)if(Array.isArray(r))for(const e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType="application/json"),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase();const r={...e?.header,..."function"==typeof t?.headers?await t.headers():t?.headers};if(e?.cookie){const t=[];for(const[n,r]of Object.entries(e.cookie))t.push(hi(n,r,{path:"/"}));r.Cookie=t.join(",")}this.cType&&(r["Content-Type"]=this.cType);const s=new Headers(r??void 0);let i=this.url;i=yi(i),i=fi(i,this.pathParams),this.queryParams&&(i=i+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const o=!("GET"===n||"HEAD"===n);return(t?.fetch||fetch)(i,{body:o?this.rBody:void 0,method:n,headers:s,...t?.init})}},wi=(e,t)=>vi(function n(r){const s=t?.buildSearchParams??mi,i=[...r.path],o=i.slice(-3).reverse();if("toString"===o[0])return"name"===o[1]?o[2]||"":n.toString();if("valueOf"===o[0])return"name"===o[1]?o[2]||"":n;let a="";if(/^\$/.test(o[0])){const e=i.pop();e&&(a=e.replace(/^\$/,""))}const c=i.join("/"),u=((e,t)=>(e=e.replace(/\/+$/,""),(e+="/")+t.replace(/^\/+/,"")))(e,c);if("url"===a||"path"===a){let t=u;return r.args[0]&&(r.args[0].param&&(t=fi(u,r.args[0].param)),r.args[0].query&&(t=t+"?"+s(r.args[0].query).toString())),t=yi(t),"url"===a?new URL(t):t.slice(e.replace(/\/+$/,"").length).replace(/^\/?/,"/")}if("ws"===a){const e=(r.args[0]&&r.args[0].param?fi(u,r.args[0].param):u).replace(/^http/,"ws"),n=new URL(e),s=r.args[0]?.query;return s&&Object.entries(s).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>void 0!==t?.webSocket&&"function"==typeof t.webSocket?t.webSocket(...e):new WebSocket(...e))(n.toString())}const d=new bi(u,a,{buildSearchParams:s});if(a){t??={};const e=_i(t,{...r.args[1]});return d.fetch(r.args[0],e)}return d},[]);function Si(e,t){if(!e)throw new Error(t)}class xi extends Error{#K=Symbol("GeneralException");constructor({type:e,title:t="Error",detail:n,context:r}){super(e),this.name="GeneralException",this.type=e,this.title=t,this.detail=n,this.context=r}}function ki(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const s=o.prototype,i=Object.keys(s);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=s[t].bind(n))}}const s=n?.Parent??Object;class i extends s{}function o(e){var t;const s=n?.Parent?new i:this;r(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}Object.freeze({status:"aborted"}),Symbol("zod_brand");class Ei extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class zi extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Oi={};function $i(e){return e&&Object.assign(Oi,e),Oi}function Ii(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function Ti(e,t="|"){return e.map(e=>Vi(e)).join(t)}function Pi(e,t){return"bigint"==typeof t?t.toString():t}function Ai(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ci(e){return null==e}function Ri(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const ji=Symbol("evaluating");function Ni(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ji)return void 0===r&&(r=ji,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Zi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Di(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Fi(e){return JSON.stringify(e)}const Mi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ui(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Li=Ai(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function qi(e){if(!1===Ui(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==Ui(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Ji(e){return qi(e)?{...e}:Array.isArray(e)?[...e]:e}const Qi=new Set(["string","number","symbol"]),Bi=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ki(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wi(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Hi(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function Vi(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}const Gi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Yi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Xi(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function eo(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function to(e){return"string"==typeof e?e:e?.message}function no(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=to(e.inst?._zod.def?.error?.(e))??to(t?.error?.(e))??to(n.customError?.(e))??to(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ro(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function so(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function io(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const oo=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Pi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ao=ki("$ZodError",oo),co=ki("$ZodError",oo,{Parent:Error}),uo=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Ei;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>no(e,i,$i())));throw Mi(t,s?.callee),t}return o.value},lo=uo(co),po=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>no(e,i,$i())));throw Mi(t,s?.callee),t}return o.value},ho=po(co),fo=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Ei;return i.issues.length?{success:!1,error:new(e??ao)(i.issues.map(e=>no(e,s,$i())))}:{success:!0,data:i.value}},mo=fo(co),yo=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>no(e,s,$i())))}:{success:!0,data:i.value}},go=yo(co),_o=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return uo(e)(t,n,s)},vo=e=>(t,n,r)=>uo(e)(t,n,r),bo=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return po(e)(t,n,s)},wo=e=>async(t,n,r)=>po(e)(t,n,r),So=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return fo(e)(t,n,s)},xo=e=>(t,n,r)=>fo(e)(t,n,r),ko=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yo(e)(t,n,s)},Eo=e=>async(t,n,r)=>yo(e)(t,n,r),zo=/^[cC][^\s-]{8,}$/,Oo=/^[0-9a-z]+$/,$o=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Io=/^[0-9a-vA-V]{20}$/,To=/^[A-Za-z0-9]{27}$/,Po=/^[a-zA-Z0-9_-]{21}$/,Ao=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Co=/^[-+]?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)?)??$/,Ro=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,jo=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,No=jo(4),Zo=jo(6),Do=jo(7),Fo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mo=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Uo=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Lo=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,qo=Lo,Jo=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Qo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Bo(){return new RegExp(Qo,"u")}const Ko=/^(?:(?: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])$/,Wo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ho=e=>{const t=Ki(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Vo=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Go=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xo=/^[A-Za-z0-9_-]*$/,ea=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ta=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,na=/^\+[1-9]\d{6,14}$/,ra="(?:(?:\\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])))",sa=new RegExp(`^${ra}$`);function ia(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function oa(e){return new RegExp(`^${ia(e)}$`)}function aa(e){const t=ia({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${ra}T(?:${r})$`)}const ca=e=>new RegExp(`^${e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*"}$`),ua=/^-?\d+n?$/,da=/^-?\d+$/,la=/^-?\d+(?:\.\d+)?$/,pa=/^(?:true|false)$/i,ha=/^null$/i,fa=/^undefined$/i,ma=/^[^A-Z]*$/,ya=/^[^a-z]*$/,ga=/^[0-9a-fA-F]*$/;function _a(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function va(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const ba=/^[0-9a-fA-F]{32}$/,wa=_a(22,"=="),Sa=va(22),xa=/^[0-9a-fA-F]{40}$/,ka=_a(27,"="),Ea=va(27),za=/^[0-9a-fA-F]{64}$/,Oa=_a(43,"="),$a=va(43),Ia=/^[0-9a-fA-F]{96}$/,Ta=_a(64,""),Pa=va(64),Aa=/^[0-9a-fA-F]{128}$/,Ca=_a(86,"=="),Ra=va(86),ja=ki("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Na={number:"number",bigint:"bigint",object:"date"},Za=ki("$ZodCheckLessThan",(e,t)=>{ja.init(e,t);const n=Na[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Da=ki("$ZodCheckGreaterThan",(e,t)=>{ja.init(e,t);const n=Na[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fa=ki("$ZodCheckMultipleOf",(e,t)=>{ja.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(0===s&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(s=Number.parseInt(e[1]))}const i=n>s?n:s;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ma=ki("$ZodCheckNumberFormat",(e,t)=>{ja.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=Gi[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=s,r.maximum=i,n&&(r.pattern=da)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a))return void o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Ua=ki("$ZodCheckBigIntFormat",(e,t)=>{ja.init(e,t);const[n,r]=Yi[t.format];e._zod.onattach.push(e=>{const s=e._zod.bag;s.format=t.format,s.minimum=n,s.maximum=r}),e._zod.check=s=>{const i=s.value;i<n&&s.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&s.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),La=ki("$ZodCheckMaxSize",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ci(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;r.size<=t.maximum||n.issues.push({origin:ro(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),qa=ki("$ZodCheckMinSize",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ci(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;r.size>=t.minimum||n.issues.push({origin:ro(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ja=ki("$ZodCheckSizeEquals",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ci(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{const r=n.value,s=r.size;if(s===t.size)return;const i=s>t.size;n.issues.push({origin:ro(r),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Qa=ki("$ZodCheckMaxLength",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ci(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const s=so(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ba=ki("$ZodCheckMinLength",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ci(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const s=so(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ka=ki("$ZodCheckLengthEquals",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ci(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,s=r.length;if(s===t.length)return;const i=so(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Wa=ki("$ZodCheckStringFormat",(e,t)=>{var n,r;ja.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ha=ki("$ZodCheckRegex",(e,t)=>{Wa.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Va=ki("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ma),Wa.init(e,t)}),Ga=ki("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ya),Wa.init(e,t)}),Ya=ki("$ZodCheckIncludes",(e,t)=>{ja.init(e,t);const n=Ki(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Xa=ki("$ZodCheckStartsWith",(e,t)=>{ja.init(e,t);const n=new RegExp(`^${Ki(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ec=ki("$ZodCheckEndsWith",(e,t)=>{ja.init(e,t);const n=new RegExp(`.*${Ki(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function tc(e,t,n){e.issues.length&&t.issues.push(...eo(n,e.issues))}const nc=ki("$ZodCheckProperty",(e,t)=>{ja.init(e,t),e._zod.check=e=>{const n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>tc(n,e,t.property));tc(n,e,t.property)}}),rc=ki("$ZodCheckMimeType",(e,t)=>{ja.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),sc=ki("$ZodCheckOverwrite",(e,t)=>{ja.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class ic{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>`  ${e}`)].join("\n"))}}const oc={major:4,minor:3,patch:6},ac=ki("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=oc;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,s=Xi(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&!1===n?.async)throw new Ei;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(s||(s=Xi(e,t)))});else{if(e.issues.length===t)continue;s||(s=Xi(e,t))}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(Xi(n))return n.aborted=!0,n;const o=t(s,r,i);if(o instanceof Promise){if(!1===i.async)throw new Ei;return o.then(t=>e._zod.parse(t,i))}return e._zod.parse(o,i)};e._zod.run=(s,i)=>{if(i.skipChecks)return e._zod.parse(s,i);if("backward"===i.direction){const t=e._zod.parse({value:s.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,s,i)):n(t,s,i)}const o=e._zod.parse(s,i);if(o instanceof Promise){if(!1===i.async)throw new Ei;return o.then(e=>t(e,r,i))}return t(o,r,i)}}Ni(e,"~standard",()=>({validate:t=>{try{const n=mo(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return go(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),cc=ki("$ZodString",(e,t)=>{ac.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ca(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),uc=ki("$ZodStringFormat",(e,t)=>{Wa.init(e,t),cc.init(e,t)}),dc=ki("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ro),uc.init(e,t)}),lc=ki("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=jo(e))}else t.pattern??(t.pattern=jo());uc.init(e,t)}),pc=ki("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Fo),uc.init(e,t)}),hc=ki("$ZodURL",(e,t)=>{uc.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=s.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),fc=ki("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Bo()),uc.init(e,t)}),mc=ki("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Po),uc.init(e,t)}),yc=ki("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=zo),uc.init(e,t)}),gc=ki("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Oo),uc.init(e,t)}),_c=ki("$ZodULID",(e,t)=>{t.pattern??(t.pattern=$o),uc.init(e,t)}),vc=ki("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Io),uc.init(e,t)}),bc=ki("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=To),uc.init(e,t)}),wc=ki("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=aa(t)),uc.init(e,t)}),Sc=ki("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=sa),uc.init(e,t)}),xc=ki("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=oa(t)),uc.init(e,t)}),kc=ki("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ao),uc.init(e,t)}),Ec=ki("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ko),uc.init(e,t),e._zod.bag.format="ipv4"}),zc=ki("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Wo),uc.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Oc=ki("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Ho(t.delimiter)),uc.init(e,t),e._zod.bag.format="mac"}),$c=ki("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Vo),uc.init(e,t)}),Ic=ki("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Go),uc.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Tc(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Pc=ki("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Yo),uc.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Tc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Ac=ki("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Xo),uc.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!Xo.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Tc(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Cc=ki("$ZodE164",(e,t)=>{t.pattern??(t.pattern=na),uc.init(e,t)}),Rc=ki("$ZodJWT",(e,t)=>{uc.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&"JWT"!==s?.typ||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),jc=ki("$ZodCustomStringFormat",(e,t)=>{uc.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Nc=ki("$ZodNumber",(e,t)=>{ac.init(e,t),e._zod.pattern=e._zod.bag.pattern??la,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const s=n.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),Zc=ki("$ZodNumberFormat",(e,t)=>{Ma.init(e,t),Nc.init(e,t)}),Dc=ki("$ZodBoolean",(e,t)=>{ac.init(e,t),e._zod.pattern=pa,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const s=n.value;return"boolean"==typeof s||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Fc=ki("$ZodBigInt",(e,t)=>{ac.init(e,t),e._zod.pattern=ua,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Mc=ki("$ZodBigIntFormat",(e,t)=>{Ua.init(e,t),Fc.init(e,t)}),Uc=ki("$ZodSymbol",(e,t)=>{ac.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return"symbol"==typeof r||t.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),t}}),Lc=ki("$ZodUndefined",(e,t)=>{ac.init(e,t),e._zod.pattern=fa,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}}),qc=ki("$ZodNull",(e,t)=>{ac.init(e,t),e._zod.pattern=ha,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),Jc=ki("$ZodAny",(e,t)=>{ac.init(e,t),e._zod.parse=e=>e}),Qc=ki("$ZodUnknown",(e,t)=>{ac.init(e,t),e._zod.parse=e=>e}),Bc=ki("$ZodNever",(e,t)=>{ac.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),Kc=ki("$ZodVoid",(e,t)=>{ac.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}}),Wc=ki("$ZodDate",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const s=n.value,i=s instanceof Date;return i&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...i?{received:"Invalid Date"}:{},inst:e}),n}});function Hc(e,t,n){e.issues.length&&t.issues.push(...eo(n,e.issues)),t.value[n]=e.value}const Vc=ki("$ZodArray",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let e=0;e<s.length;e++){const o=s[e],a=t.element._zod.run({value:o,issues:[]},r);a instanceof Promise?i.push(a.then(t=>Hc(t,n,e))):Hc(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function Gc(e,t,n,r,s){if(e.issues.length){if(s&&!(n in r))return;t.issues.push(...eo(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Yc(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Xc(e,t,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,u=c.def.type,d="optional"===c.optout;for(const s in t){if(a.has(s))continue;if("never"===u){o.push(s);continue}const i=c.run({value:t[s],issues:[]},r);i instanceof Promise?e.push(i.then(e=>Gc(e,n,s,t,d))):Gc(i,n,s,t,d)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const eu=ki("$ZodObject",(e,t)=>{ac.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=Ai(()=>Yc(t));Ni(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const s=Ui,i=t.catchall;let o;e._zod.parse=(t,n)=>{o??(o=r.value);const a=t.value;if(!s(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=o.shape;for(const e of o.keys){const r=u[e],s="optional"===r._zod.optout,i=r._zod.run({value:a[e],issues:[]},n);i instanceof Promise?c.push(i.then(n=>Gc(n,t,e,a,s))):Gc(i,t,e,a,s)}return i?Xc(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),tu=ki("$ZodObjectJIT",(e,t)=>{eu.init(e,t);const n=e._zod.parse,r=Ai(()=>Yc(t));let s;const i=Ui,o=!Oi.jitless,a=o&&Li.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=r.value);const p=d.value;return i(p)?o&&a&&!1===l?.async&&!0!==l.jitless?(s||(s=(e=>{const t=new ic(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Fi(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of n.keys)i[e]="key_"+o++;t.write("const newResult = {};");for(const r of n.keys){const n=i[r],o=Fi(r),a=e[r],c="optional"===a?._zod?.optout;t.write(`const ${n} = ${s(r)};`),c?t.write(`\n        if (${n}.issues.length) {\n          if (${o} in input) {\n            payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n              ...iss,\n              path: iss.path ? [${o}, ...iss.path] : [${o}]\n            })));\n          }\n        }\n        \n        if (${n}.value === undefined) {\n          if (${o} in input) {\n            newResult[${o}] = undefined;\n          }\n        } else {\n          newResult[${o}] = ${n}.value;\n        }\n        \n      `):t.write(`\n        if (${n}.issues.length) {\n          payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n            ...iss,\n            path: iss.path ? [${o}, ...iss.path] : [${o}]\n          })));\n        }\n        \n        if (${n}.value === undefined) {\n          if (${o} in input) {\n            newResult[${o}] = undefined;\n          }\n        } else {\n          newResult[${o}] = ${n}.value;\n        }\n        \n      `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=s(d,l),c?Xc([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function nu(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const s=e.filter(e=>!Xi(e));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>no(e,r,$i())))}),t)}const ru=ki("$ZodUnion",(e,t)=>{ac.init(e,t),Ni(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Ni(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Ni(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ni(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Ri(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>nu(t,s,e,i)):nu(a,s,e,i)}});function su(e,t,n,r){const s=e.filter(e=>0===e.issues.length);return 1===s.length?(t.value=s[0].value,t):(0===s.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>no(e,r,$i())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}const iu=ki("$ZodXor",(e,t)=>{ru.init(e,t),t.inclusive=!1;const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);t instanceof Promise?(a.push(t),o=!0):a.push(t)}return o?Promise.all(a).then(t=>su(t,s,e,i)):su(a,s,e,i)}}),ou=ki("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ru.init(e,t);const n=e._zod.parse;Ni(e._zod,"propValues",()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(const r of n)e[t].add(r)}}return e});const r=Ai(()=>{const e=t.options,n=new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(s,i)=>{const o=s.value;if(!Ui(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const a=r.value.get(o?.[t.discriminator]);return a?a._zod.run(s,i):t.unionFallback?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),s)}}),au=ki("$ZodIntersection",(e,t)=>{ac.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,s=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([t,n])=>uu(e,t,n)):uu(e,s,i)}});function cu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(qi(e)&&qi(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),s={...e,...t};for(const n of r){const r=cu(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=cu(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function uu(e,t,n){const r=new Map;let s;for(const n of t.issues)if("unrecognized_keys"===n.code){s??(s=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const i=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&s&&e.issues.push({...s,keys:i}),Xi(e))return e;const o=cu(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const du=ki("$ZodTuple",(e,t)=>{ac.init(e,t);const n=t.items;e._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const o=[],a=[...n].reverse().findIndex(e=>"optional"!==e._zod.optin),c=-1===a?0:n.length-a;if(!t.rest){const t=i.length>n.length,s=i.length<c-1;if(t||s)return r.issues.push({...t?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),r}let u=-1;for(const e of n){if(u++,u>=i.length&&u>=c)continue;const t=e._zod.run({value:i[u],issues:[]},s);t instanceof Promise?o.push(t.then(e=>lu(e,r,u))):lu(t,r,u)}if(t.rest){const e=i.slice(n.length);for(const n of e){u++;const e=t.rest._zod.run({value:n,issues:[]},s);e instanceof Promise?o.push(e.then(e=>lu(e,r,u))):lu(e,r,u)}}return o.length?Promise.all(o).then(()=>r):r}});function lu(e,t,n){e.issues.length&&t.issues.push(...eo(n,e.issues)),t.value[n]=e.value}const pu=ki("$ZodRecord",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!qi(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const e of o)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){a.add("number"==typeof e?e.toString():e);const o=t.valueType._zod.run({value:s[e],issues:[]},r);o instanceof Promise?i.push(o.then(t=>{t.issues.length&&n.issues.push(...eo(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...eo(e,o.issues)),n.value[e]=o.value)}let c;for(const e in s)a.has(e)||(c=c??[],c.push(e));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c})}else{n.value={};for(const o of Reflect.ownKeys(s)){if("__proto__"===o)continue;let a=t.keyType._zod.run({value:o,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof o&&la.test(o)&&a.issues.length){const e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(a=e)}if(a.issues.length){"loose"===t.mode?n.value[o]=s[o]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>no(e,r,$i())),input:o,path:[o],inst:e});continue}const c=t.valueType._zod.run({value:s[o],issues:[]},r);c instanceof Promise?i.push(c.then(e=>{e.issues.length&&n.issues.push(...eo(o,e.issues)),n.value[a.value]=e.value})):(c.issues.length&&n.issues.push(...eo(o,c.issues)),n.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>n):n}}),hu=ki("$ZodMap",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!(s instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:s,inst:e}),n;const i=[];n.value=new Map;for(const[o,a]of s){const c=t.keyType._zod.run({value:o,issues:[]},r),u=t.valueType._zod.run({value:a,issues:[]},r);c instanceof Promise||u instanceof Promise?i.push(Promise.all([c,u]).then(([t,i])=>{fu(t,i,n,o,s,e,r)})):fu(c,u,n,o,s,e,r)}return i.length?Promise.all(i).then(()=>n):n}});function fu(e,t,n,r,s,i,o){e.issues.length&&(Qi.has(typeof r)?n.issues.push(...eo(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:s,inst:i,issues:e.issues.map(e=>no(e,o,$i()))})),t.issues.length&&(Qi.has(typeof r)?n.issues.push(...eo(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:s,inst:i,key:r,issues:t.issues.map(e=>no(e,o,$i()))})),n.value.set(e.value,t.value)}const mu=ki("$ZodSet",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!(s instanceof Set))return n.issues.push({input:s,inst:e,expected:"set",code:"invalid_type"}),n;const i=[];n.value=new Set;for(const e of s){const s=t.valueType._zod.run({value:e,issues:[]},r);s instanceof Promise?i.push(s.then(e=>yu(e,n))):yu(s,n)}return i.length?Promise.all(i).then(()=>n):n}});function yu(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const gu=ki("$ZodEnum",(e,t)=>{ac.init(e,t);const n=Ii(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Qi.has(typeof e)).map(e=>"string"==typeof e?Ki(e):e.toString()).join("|")})$`),e._zod.parse=(t,s)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),_u=ki("$ZodLiteral",(e,t)=>{if(ac.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?Ki(e):e?Ki(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),vu=ki("$ZodFile",(e,t)=>{ac.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}}),bu=ki("$ZodTransform",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new zi(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(e=>(n.value=e,n));if(s instanceof Promise)throw new Ei;return n.value=s,n}});function wu(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Su=ki("$ZodOptional",(e,t)=>{ac.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ni(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ni(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ri(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>wu(t,e.value)):wu(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),xu=ki("$ZodExactOptional",(e,t)=>{Su.init(e,t),Ni(e._zod,"values",()=>t.innerType._zod.values),Ni(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ku=ki("$ZodNullable",(e,t)=>{ac.init(e,t),Ni(e._zod,"optin",()=>t.innerType._zod.optin),Ni(e._zod,"optout",()=>t.innerType._zod.optout),Ni(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ri(e.source)}|null)$`):void 0}),Ni(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),Eu=ki("$ZodDefault",(e,t)=>{ac.init(e,t),e._zod.optin="optional",Ni(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>zu(e,t)):zu(r,t)}});function zu(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Ou=ki("$ZodPrefault",(e,t)=>{ac.init(e,t),e._zod.optin="optional",Ni(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),$u=ki("$ZodNonOptional",(e,t)=>{ac.init(e,t),Ni(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(t=>Iu(t,e)):Iu(s,e)}});function Iu(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Tu=ki("$ZodSuccess",(e,t)=>{ac.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new zi("ZodSuccess");const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}}),Pu=ki("$ZodCatch",(e,t)=>{ac.init(e,t),Ni(e._zod,"optin",()=>t.innerType._zod.optin),Ni(e._zod,"optout",()=>t.innerType._zod.optout),Ni(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>no(e,n,$i()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>no(e,n,$i()))},input:e.value}),e.issues=[]),e)}}),Au=ki("$ZodNaN",(e,t)=>{ac.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),Cu=ki("$ZodPipe",(e,t)=>{ac.init(e,t),Ni(e._zod,"values",()=>t.in._zod.values),Ni(e._zod,"optin",()=>t.in._zod.optin),Ni(e._zod,"optout",()=>t.out._zod.optout),Ni(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ru(e,t.in,n)):Ru(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ru(e,t.out,n)):Ru(r,t.out,n)}});function Ru(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ju=ki("$ZodCodec",(e,t)=>{ac.init(e,t),Ni(e._zod,"values",()=>t.in._zod.values),Ni(e._zod,"optin",()=>t.in._zod.optin),Ni(e._zod,"optout",()=>t.out._zod.optout),Ni(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Nu(e,t,n)):Nu(r,t,n)}{const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Nu(e,t,n)):Nu(r,t,n)}}});function Nu(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){const r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Zu(e,r,t.out,n)):Zu(e,r,t.out,n)}{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Zu(e,r,t.in,n)):Zu(e,r,t.in,n)}}function Zu(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const Du=ki("$ZodReadonly",(e,t)=>{ac.init(e,t),Ni(e._zod,"propValues",()=>t.innerType._zod.propValues),Ni(e._zod,"values",()=>t.innerType._zod.values),Ni(e._zod,"optin",()=>t.innerType?._zod?.optin),Ni(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Fu):Fu(r)}});function Fu(e){return e.value=Object.freeze(e.value),e}const Mu=ki("$ZodTemplateLiteral",(e,t)=>{ac.init(e,t);const n=[];for(const e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);const t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${e._zod.traits}`);const r=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(r,s))}else{if(null!==e&&!Bi.has(typeof e))throw new Error(`Invalid template literal part: ${e}`);n.push(Ki(`${e}`))}e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>"string"!=typeof n.value?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),Uu=ki("$ZodFunction",(e,t)=>(ac.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw new Error("implement() must be called with a function");return function(...n){const r=e._def.input?lo(e._def.input,n):n,s=Reflect.apply(t,this,r);return e._def.output?lo(e._def.output,s):s}},e.implementAsync=t=>{if("function"!=typeof t)throw new Error("implementAsync() must be called with a function");return async function(...n){const r=e._def.input?await ho(e._def.input,n):n,s=await Reflect.apply(t,this,r);return e._def.output?await ho(e._def.output,s):s}},e._zod.parse=(t,n)=>{if("function"!=typeof t.value)return t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}),t;const r=e._def.output&&"promise"===e._def.output._zod.def.type;return t.value=r?e.implementAsync(t.value):e.implement(t.value),t},e.input=(...t)=>{const n=e.constructor;return Array.isArray(t[0])?new n({type:"function",input:new du({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}):new n({type:"function",input:t[0],output:e._def.output})},e.output=t=>new(0,e.constructor)({type:"function",input:e._def.input,output:t}),e)),Lu=ki("$ZodPromise",(e,t)=>{ac.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),qu=ki("$ZodLazy",(e,t)=>{ac.init(e,t),Ni(e._zod,"innerType",()=>t.getter()),Ni(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ni(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ni(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ni(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Ju=ki("$ZodCustom",(e,t)=>{ja.init(e,t),ac.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(t=>Qu(t,n,r,e));Qu(s,n,r,e)}});function Qu(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(io(e))}}var Bu;Symbol("ZodOutput"),Symbol("ZodInput");(Bu=globalThis).__zod_globalRegistry??(Bu.__zod_globalRegistry=new class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const Ku=globalThis.__zod_globalRegistry;function Wu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Hi(t)})}function Hu(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Hi(t)})}function Vu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Hi(t)})}function Gu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Hi(t)})}function Yu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Hi(t)})}function Xu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Hi(t)})}function ed(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Hi(t)})}function td(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Hi(t)})}function nd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Hi(t)})}function rd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Hi(t)})}function sd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Hi(t)})}function id(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Hi(t)})}function od(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Hi(t)})}function ad(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Hi(t)})}function cd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Hi(t)})}function ud(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Hi(t)})}function dd(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Hi(t)})}function ld(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Hi(t)})}function pd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Hi(t)})}function hd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Hi(t)})}function fd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Hi(t)})}function md(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Hi(t)})}function yd(e,t){return new Za({check:"less_than",...Hi(t),value:e,inclusive:!1})}function gd(e,t){return new Za({check:"less_than",...Hi(t),value:e,inclusive:!0})}function _d(e,t){return new Da({check:"greater_than",...Hi(t),value:e,inclusive:!1})}function vd(e,t){return new Da({check:"greater_than",...Hi(t),value:e,inclusive:!0})}function bd(e){return _d(0,e)}function wd(e){return yd(0,e)}function Sd(e){return gd(0,e)}function xd(e){return vd(0,e)}function kd(e,t){return new Fa({check:"multiple_of",...Hi(t),value:e})}function Ed(e,t){return new La({check:"max_size",...Hi(t),maximum:e})}function zd(e,t){return new qa({check:"min_size",...Hi(t),minimum:e})}function Od(e,t){return new Ja({check:"size_equals",...Hi(t),size:e})}function $d(e,t){return new Qa({check:"max_length",...Hi(t),maximum:e})}function Id(e,t){return new Ba({check:"min_length",...Hi(t),minimum:e})}function Td(e,t){return new Ka({check:"length_equals",...Hi(t),length:e})}function Pd(e,t){return new Ha({check:"string_format",format:"regex",...Hi(t),pattern:e})}function Ad(e){return new Va({check:"string_format",format:"lowercase",...Hi(e)})}function Cd(e){return new Ga({check:"string_format",format:"uppercase",...Hi(e)})}function Rd(e,t){return new Ya({check:"string_format",format:"includes",...Hi(t),includes:e})}function jd(e,t){return new Xa({check:"string_format",format:"starts_with",...Hi(t),prefix:e})}function Nd(e,t){return new ec({check:"string_format",format:"ends_with",...Hi(t),suffix:e})}function Zd(e,t,n){return new nc({check:"property",property:e,schema:t,...Hi(n)})}function Dd(e,t){return new rc({check:"mime_type",mime:e,...Hi(t)})}function Fd(e){return new sc({check:"overwrite",tx:e})}function Md(e){return Fd(t=>t.normalize(e))}function Ud(){return Fd(e=>e.trim())}function Ld(){return Fd(e=>e.toLowerCase())}function qd(){return Fd(e=>e.toUpperCase())}function Jd(){return Fd(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))}function Qd(e,t,n,r={}){const s=Hi(r),i={...Hi(r),check:"string_format",type:"string",format:t,fn:"function"==typeof n?n:e=>n.test(e),...s};return n instanceof RegExp&&(i.pattern=n),new e(i)}function Bd(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ku,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Kd(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{const n=o.schema,i=t.processors[s.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(o.ref||(o.ref=i),Kd(i,t,r),t.seen.get(i).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),"input"===t.io&&Vd(e)&&(delete o.schema.examples,delete o.schema.default),"input"===t.io&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Wd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}const s=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:s,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,s=e.external.uri??(e=>e);if(n)return{ref:s(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${s("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const s=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:s+i}})(t);r.def={...r.schema},i&&(r.defId=i);const o=r.schema;for(const e in o)delete o[e];o.$ref=s};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){s(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){s(n);continue}}const i=e.metadataRegistry.get(n[0])?.id;(i||r.cycle||r.count>1&&"ref"===e.reused)&&s(n)}}function Hd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const s=n.def??n.schema,i={...s},o=n.ref;if(n.ref=null,o){r(o);const n=e.seen.get(o),a=n.schema;if(!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(s,a):(s.allOf=s.allOf??[],s.allOf.push(a)),Object.assign(s,i),t._zod.parent===o)for(const e in s)"$ref"!==e&&"allOf"!==e&&(e in i||delete s[e]);if(a.$ref&&n.def)for(const e in s)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(s[e])===JSON.stringify(n.def[e])&&delete s[e]}const a=t._zod.parent;if(a&&a!==o){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(s.$ref=t.schema.$ref,t.def))for(const e in s)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(s[e])===JSON.stringify(t.def[e])&&delete s[e]}e.override({zodSchema:t,jsonSchema:s,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const s={};if("draft-2020-12"===e.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?s.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(n)}Object.assign(s,n.def??n.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?s.$defs=i:s.definitions=i);try{const n=JSON.parse(JSON.stringify(s));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Gd(t,"input",e.processors),output:Gd(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function Vd(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return Vd(r.element,n);if("set"===r.type)return Vd(r.valueType,n);if("lazy"===r.type)return Vd(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return Vd(r.innerType,n);if("intersection"===r.type)return Vd(r.left,n)||Vd(r.right,n);if("record"===r.type||"map"===r.type)return Vd(r.keyType,n)||Vd(r.valueType,n);if("pipe"===r.type)return Vd(r.in,n)||Vd(r.out,n);if("object"===r.type){for(const e in r.shape)if(Vd(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(Vd(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(Vd(e,n))return!0;return!(!r.rest||!Vd(r.rest,n))}return!1}const Gd=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=Bd({...s??{},target:i,io:t,processors:n});return Kd(e,o),Wd(o,e),Hd(o,e)},Yd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Xd=(e,t,n,r)=>{const s=e._zod.def,i=!1===s.inclusive,o=s.options.map((e,n)=>Kd(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=o:n.anyOf=o},el=(e,t,n,r)=>{const s=e._zod.def;Kd(s.innerType,t,r),t.seen.get(e).ref=s.innerType},tl=ki("ZodISODateTime",(e,t)=>{wc.init(e,t),Ol.init(e,t)});function nl(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Hi(t)})}(tl,e)}const rl=ki("ZodISODate",(e,t)=>{Sc.init(e,t),Ol.init(e,t)});function sl(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Hi(t)})}(rl,e)}const il=ki("ZodISOTime",(e,t)=>{xc.init(e,t),Ol.init(e,t)});function ol(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Hi(t)})}(il,e)}const al=ki("ZodISODuration",(e,t)=>{kc.init(e,t),Ol.init(e,t)});function cl(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Hi(t)})}(al,e)}const ul=(e,t)=>{ao.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>r({issues:e}));else if("invalid_key"===s.code)r({issues:s.issues});else if("invalid_element"===s.code)r({issues:s.issues});else if(0===s.path.length)n._errors.push(t(s));else{let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Pi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Pi,2)}},isEmpty:{get:()=>0===e.issues.length}})},dl=(ki("ZodError",ul),ki("ZodError",ul,{Parent:Error})),ll=uo(dl),pl=po(dl),hl=fo(dl),fl=yo(dl),ml=_o(dl),yl=vo(dl),gl=bo(dl),_l=wo(dl),vl=So(dl),bl=xo(dl),wl=ko(dl),Sl=Eo(dl),xl=ki("ZodType",(e,t)=>(ac.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Gd(e,"input"),output:Gd(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=Bd({...n,processors:t});return Kd(e,r),Wd(r,e),Hd(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Di(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Wi(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>ll(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>hl(e,t,n),e.parseAsync=async(t,n)=>pl(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>fl(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ml(e,t,n),e.decode=(t,n)=>yl(e,t,n),e.encodeAsync=async(t,n)=>gl(e,t,n),e.decodeAsync=async(t,n)=>_l(e,t,n),e.safeEncode=(t,n)=>vl(e,t,n),e.safeDecode=(t,n)=>bl(e,t,n),e.safeEncodeAsync=async(t,n)=>wl(e,t,n),e.safeDecodeAsync=async(t,n)=>Sl(e,t,n),e.refine=(t,n)=>e.check(gf(t,n)),e.superRefine=t=>e.check(_f(t)),e.overwrite=t=>e.check(Fd(t)),e.optional=()=>jh(e),e.exactOptional=()=>Zh(e),e.nullable=()=>Fh(e),e.nullish=()=>jh(Fh(e)),e.nonoptional=t=>Bh(e,t),e.array=()=>th(e),e.or=t=>ch([e,t]),e.and=t=>fh(e,t),e.transform=t=>ef(e,Ch(t)),e.default=t=>Lh(e,t),e.prefault=t=>Jh(e,t),e.catch=t=>Vh(e,t),e.pipe=t=>ef(e,t),e.readonly=()=>sf(e),e.describe=t=>{const n=e.clone();return Ku.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Ku.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Ku.get(e);const n=e.clone();return Ku.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),kl=ki("_ZodString",(e,t)=>{cc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:s,maximum:i,format:o,patterns:a,contentEncoding:c}=e._zod.bag;if("number"==typeof s&&(r.minLength=s),"number"==typeof i&&(r.maxLength=i),o&&(r.format=Yd[o]??o,""===r.format&&delete r.format,"time"===o&&delete r.format),c&&(r.contentEncoding=c),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Pd(...t)),e.includes=(...t)=>e.check(Rd(...t)),e.startsWith=(...t)=>e.check(jd(...t)),e.endsWith=(...t)=>e.check(Nd(...t)),e.min=(...t)=>e.check(Id(...t)),e.max=(...t)=>e.check($d(...t)),e.length=(...t)=>e.check(Td(...t)),e.nonempty=(...t)=>e.check(Id(1,...t)),e.lowercase=t=>e.check(Ad(t)),e.uppercase=t=>e.check(Cd(t)),e.trim=()=>e.check(Ud()),e.normalize=(...t)=>e.check(Md(...t)),e.toLowerCase=()=>e.check(Ld()),e.toUpperCase=()=>e.check(qd()),e.slugify=()=>e.check(Jd())}),El=ki("ZodString",(e,t)=>{cc.init(e,t),kl.init(e,t),e.email=t=>e.check(Wu($l,t)),e.url=t=>e.check(ed(Zl,t)),e.jwt=t=>e.check(md(yp,t)),e.emoji=t=>e.check(td(Ml,t)),e.guid=t=>e.check(Hu(Tl,t)),e.uuid=t=>e.check(Vu(Al,t)),e.uuidv4=t=>e.check(Gu(Al,t)),e.uuidv6=t=>e.check(Yu(Al,t)),e.uuidv7=t=>e.check(Xu(Al,t)),e.nanoid=t=>e.check(nd(Ll,t)),e.guid=t=>e.check(Hu(Tl,t)),e.cuid=t=>e.check(rd(Jl,t)),e.cuid2=t=>e.check(sd(Bl,t)),e.ulid=t=>e.check(id(Wl,t)),e.base64=t=>e.check(pd(dp,t)),e.base64url=t=>e.check(hd(pp,t)),e.xid=t=>e.check(od(Vl,t)),e.ksuid=t=>e.check(ad(Yl,t)),e.ipv4=t=>e.check(cd(ep,t)),e.ipv6=t=>e.check(ud(sp,t)),e.cidrv4=t=>e.check(dd(op,t)),e.cidrv6=t=>e.check(ld(cp,t)),e.e164=t=>e.check(fd(fp,t)),e.datetime=t=>e.check(nl(t)),e.date=t=>e.check(sl(t)),e.time=t=>e.check(ol(t)),e.duration=t=>e.check(cl(t))});function zl(e){return function(e,t){return new e({type:"string",...Hi(t)})}(El,e)}const Ol=ki("ZodStringFormat",(e,t)=>{uc.init(e,t),kl.init(e,t)}),$l=ki("ZodEmail",(e,t)=>{pc.init(e,t),Ol.init(e,t)});function Il(e){return Wu($l,e)}const Tl=ki("ZodGUID",(e,t)=>{dc.init(e,t),Ol.init(e,t)});function Pl(e){return Hu(Tl,e)}const Al=ki("ZodUUID",(e,t)=>{lc.init(e,t),Ol.init(e,t)});function Cl(e){return Vu(Al,e)}function Rl(e){return Gu(Al,e)}function jl(e){return Yu(Al,e)}function Nl(e){return Xu(Al,e)}const Zl=ki("ZodURL",(e,t)=>{hc.init(e,t),Ol.init(e,t)});function Dl(e){return ed(Zl,e)}function Fl(e){return ed(Zl,{protocol:/^https?$/,hostname:ta,...Hi(e)})}const Ml=ki("ZodEmoji",(e,t)=>{fc.init(e,t),Ol.init(e,t)});function Ul(e){return td(Ml,e)}const Ll=ki("ZodNanoID",(e,t)=>{mc.init(e,t),Ol.init(e,t)});function ql(e){return nd(Ll,e)}const Jl=ki("ZodCUID",(e,t)=>{yc.init(e,t),Ol.init(e,t)});function Ql(e){return rd(Jl,e)}const Bl=ki("ZodCUID2",(e,t)=>{gc.init(e,t),Ol.init(e,t)});function Kl(e){return sd(Bl,e)}const Wl=ki("ZodULID",(e,t)=>{_c.init(e,t),Ol.init(e,t)});function Hl(e){return id(Wl,e)}const Vl=ki("ZodXID",(e,t)=>{vc.init(e,t),Ol.init(e,t)});function Gl(e){return od(Vl,e)}const Yl=ki("ZodKSUID",(e,t)=>{bc.init(e,t),Ol.init(e,t)});function Xl(e){return ad(Yl,e)}const ep=ki("ZodIPv4",(e,t)=>{Ec.init(e,t),Ol.init(e,t)});function tp(e){return cd(ep,e)}const np=ki("ZodMAC",(e,t)=>{Oc.init(e,t),Ol.init(e,t)});function rp(e){return function(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Hi(t)})}(np,e)}const sp=ki("ZodIPv6",(e,t)=>{zc.init(e,t),Ol.init(e,t)});function ip(e){return ud(sp,e)}const op=ki("ZodCIDRv4",(e,t)=>{$c.init(e,t),Ol.init(e,t)});function ap(e){return dd(op,e)}const cp=ki("ZodCIDRv6",(e,t)=>{Ic.init(e,t),Ol.init(e,t)});function up(e){return ld(cp,e)}const dp=ki("ZodBase64",(e,t)=>{Pc.init(e,t),Ol.init(e,t)});function lp(e){return pd(dp,e)}const pp=ki("ZodBase64URL",(e,t)=>{Ac.init(e,t),Ol.init(e,t)});function hp(e){return hd(pp,e)}const fp=ki("ZodE164",(e,t)=>{Cc.init(e,t),Ol.init(e,t)});function mp(e){return fd(fp,e)}const yp=ki("ZodJWT",(e,t)=>{Rc.init(e,t),Ol.init(e,t)});function gp(e){return md(yp,e)}const _p=ki("ZodCustomStringFormat",(e,t)=>{jc.init(e,t),Ol.init(e,t)});function vp(e,t,n={}){return Qd(_p,e,t,n)}function bp(e){return Qd(_p,"hostname",ea,e)}function wp(e){return Qd(_p,"hex",ga,e)}function Sp(e,n){const r=`${e}_${n?.enc??"hex"}`,s=t[r];if(!s)throw new Error(`Unrecognized hash format: ${r}`);return Qd(_p,r,s,n)}const xp=ki("ZodNumber",(e,t)=>{Nc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:s,maximum:i,format:o,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;"string"==typeof o&&o.includes("int")?r.type="integer":r.type="number","number"==typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u),"number"==typeof s&&(r.minimum=s,"number"==typeof u&&"draft-04"!==t.target&&(u>=s?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c),"number"==typeof i&&(r.maximum=i,"number"==typeof c&&"draft-04"!==t.target&&(c<=i?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(_d(t,n)),e.gte=(t,n)=>e.check(vd(t,n)),e.min=(t,n)=>e.check(vd(t,n)),e.lt=(t,n)=>e.check(yd(t,n)),e.lte=(t,n)=>e.check(gd(t,n)),e.max=(t,n)=>e.check(gd(t,n)),e.int=t=>e.check(zp(t)),e.safe=t=>e.check(zp(t)),e.positive=t=>e.check(_d(0,t)),e.nonnegative=t=>e.check(vd(0,t)),e.negative=t=>e.check(yd(0,t)),e.nonpositive=t=>e.check(gd(0,t)),e.multipleOf=(t,n)=>e.check(kd(t,n)),e.step=(t,n)=>e.check(kd(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function kp(e){return function(e,t){return new e({type:"number",checks:[],...Hi(t)})}(xp,e)}const Ep=ki("ZodNumberFormat",(e,t)=>{Zc.init(e,t),xp.init(e,t)});function zp(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Hi(t)})}(Ep,e)}function Op(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Hi(t)})}(Ep,e)}function $p(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Hi(t)})}(Ep,e)}function Ip(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Hi(t)})}(Ep,e)}function Tp(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Hi(t)})}(Ep,e)}const Pp=ki("ZodBoolean",(e,t)=>{Dc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function Ap(e){return function(e,t){return new e({type:"boolean",...Hi(t)})}(Pp,e)}const Cp=ki("ZodBigInt",(e,t)=>{Fc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema")})(0,e),e.gte=(t,n)=>e.check(vd(t,n)),e.min=(t,n)=>e.check(vd(t,n)),e.gt=(t,n)=>e.check(_d(t,n)),e.gte=(t,n)=>e.check(vd(t,n)),e.min=(t,n)=>e.check(vd(t,n)),e.lt=(t,n)=>e.check(yd(t,n)),e.lte=(t,n)=>e.check(gd(t,n)),e.max=(t,n)=>e.check(gd(t,n)),e.positive=t=>e.check(_d(BigInt(0),t)),e.negative=t=>e.check(yd(BigInt(0),t)),e.nonpositive=t=>e.check(gd(BigInt(0),t)),e.nonnegative=t=>e.check(vd(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(kd(t,n));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Rp(e){return function(e,t){return new e({type:"bigint",...Hi(t)})}(Cp,e)}const jp=ki("ZodBigIntFormat",(e,t)=>{Mc.init(e,t),Cp.init(e,t)});function Np(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Hi(t)})}(jp,e)}function Zp(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Hi(t)})}(jp,e)}const Dp=ki("ZodSymbol",(e,t)=>{Uc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema")})(0,e)});function Fp(e){return function(e,t){return new e({type:"symbol",...Hi(t)})}(Dp,e)}const Mp=ki("ZodUndefined",(e,t)=>{Lc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema")})(0,e)});function Up(e){return function(e,t){return new e({type:"undefined",...Hi(t)})}(Mp,e)}const Lp=ki("ZodNull",(e,t)=>{qc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{"openapi-3.0"===t.target?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"})(0,e,t)});function qp(e){return function(e,t){return new e({type:"null",...Hi(t)})}(Lp,e)}const Jp=ki("ZodAny",(e,t)=>{Jc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Qp(){return new Jp({type:"any"})}const Bp=ki("ZodUnknown",(e,t)=>{Qc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Kp(){return new Bp({type:"unknown"})}const Wp=ki("ZodNever",(e,t)=>{Bc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function Hp(e){return function(e,t){return new e({type:"never",...Hi(t)})}(Wp,e)}const Vp=ki("ZodVoid",(e,t)=>{Kc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Void cannot be represented in JSON Schema")})(0,e)});function Gp(e){return function(e,t){return new e({type:"void",...Hi(t)})}(Vp,e)}const Yp=ki("ZodDate",(e,t)=>{Wc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Date cannot be represented in JSON Schema")})(0,e),e.min=(t,n)=>e.check(vd(t,n)),e.max=(t,n)=>e.check(gd(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Xp(e){return function(e,t){return new e({type:"date",...Hi(t)})}(Yp,e)}const eh=ki("ZodArray",(e,t)=>{Vc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;"number"==typeof o&&(s.minItems=o),"number"==typeof a&&(s.maxItems=a),s.type="array",s.items=Kd(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Id(t,n)),e.nonempty=t=>e.check(Id(1,t)),e.max=(t,n)=>e.check($d(t,n)),e.length=(t,n)=>e.check(Td(t,n)),e.unwrap=()=>e.element});function th(e,t){return function(e,t,n){return new e({type:"array",element:t,...Hi(n)})}(eh,e,t)}function nh(e){const t=e._zod.def.shape;return zh(Object.keys(t))}const rh=ki("ZodObject",(e,t)=>{tu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const e in o)s.properties[e]=Kd(o[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));c.size>0&&(s.required=Array.from(c)),"never"===i.catchall?._zod.def.type?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=Kd(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(s.additionalProperties=!1)})(e,t,n,r),Ni(e,"shape",()=>t.shape),e.keyof=()=>zh(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Kp()}),e.loose=()=>e.clone({...e._zod.def,catchall:Kp()}),e.strict=()=>e.clone({...e._zod.def,catchall:Hp()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!qi(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Di(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Zi(this,"shape",n),n}});return Wi(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!qi(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Di(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Zi(this,"shape",n),n}});return Wi(e,n)}(e,t),e.merge=t=>function(e,t){const n=Di(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Zi(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Wi(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Wi(e,Di(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Zi(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Di(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Zi(this,"shape",r),r},checks:[]});return Wi(e,s)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Di(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)s[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Zi(this,"shape",s),s},checks:[]});return Wi(t,s)}(Rh,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Di(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in s))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)s[t]=new e({type:"nonoptional",innerType:r[t]});return Zi(this,"shape",s),s}});return Wi(t,r)}(Qh,e,t[0])});function sh(e,t){const n={type:"object",shape:e??{},...Hi(t)};return new rh(n)}function ih(e,t){return new rh({type:"object",shape:e,catchall:Hp(),...Hi(t)})}function oh(e,t){return new rh({type:"object",shape:e,catchall:Kp(),...Hi(t)})}const ah=ki("ZodUnion",(e,t)=>{ru.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xd(e,t,n,r),e.options=t.options});function ch(e,t){return new ah({type:"union",options:e,...Hi(t)})}const uh=ki("ZodXor",(e,t)=>{ah.init(e,t),iu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xd(e,t,n,r),e.options=t.options});function dh(e,t){return new uh({type:"union",options:e,inclusive:!1,...Hi(t)})}const lh=ki("ZodDiscriminatedUnion",(e,t)=>{ah.init(e,t),ou.init(e,t)});function ph(e,t,n){return new lh({type:"union",options:t,discriminator:e,...Hi(n)})}const hh=ki("ZodIntersection",(e,t)=>{au.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i=Kd(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=Kd(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,c=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=c})(e,t,n,r)});function fh(e,t){return new hh({type:"intersection",left:e,right:t})}const mh=ki("ZodTuple",(e,t)=>{du.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="array";const o="draft-2020-12"===t.target?"prefixItems":"items",a="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",c=i.items.map((e,n)=>Kd(e,t,{...r,path:[...r.path,o,n]})),u=i.rest?Kd(i.rest,t,{...r,path:[...r.path,a,..."openapi-3.0"===t.target?[i.items.length]:[]]}):null;"draft-2020-12"===t.target?(s.prefixItems=c,u&&(s.items=u)):"openapi-3.0"===t.target?(s.items={anyOf:c},u&&s.items.anyOf.push(u),s.minItems=c.length,u||(s.maxItems=c.length)):(s.items=c,u&&(s.additionalItems=u));const{minimum:d,maximum:l}=e._zod.bag;"number"==typeof d&&(s.minItems=d),"number"==typeof l&&(s.maxItems=l)})(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function yh(e,t,n){const r=t instanceof ac;return new mh({type:"tuple",items:e,rest:r?t:null,...Hi(r?n:t)})}const gh=ki("ZodRecord",(e,t)=>{pu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,a=o._zod.bag,c=a?.patterns;if("loose"===i.mode&&c&&c.size>0){const e=Kd(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const t of c)s.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(s.propertyNames=Kd(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=Kd(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=o._zod.values;if(u){const e=[...u].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(s.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function _h(e,t,n){return new gh({type:"record",keyType:e,valueType:t,...Hi(n)})}function vh(e,t,n){const r=Wi(e);return r._zod.values=void 0,new gh({type:"record",keyType:r,valueType:t,...Hi(n)})}function bh(e,t,n){return new gh({type:"record",keyType:e,valueType:t,mode:"loose",...Hi(n)})}const wh=ki("ZodMap",(e,t)=>{hu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Map cannot be represented in JSON Schema")})(0,e),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(zd(...t)),e.nonempty=t=>e.check(zd(1,t)),e.max=(...t)=>e.check(Ed(...t)),e.size=(...t)=>e.check(Od(...t))});function Sh(e,t,n){return new wh({type:"map",keyType:e,valueType:t,...Hi(n)})}const xh=ki("ZodSet",(e,t)=>{mu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Set cannot be represented in JSON Schema")})(0,e),e.min=(...t)=>e.check(zd(...t)),e.nonempty=t=>e.check(zd(1,t)),e.max=(...t)=>e.check(Ed(...t)),e.size=(...t)=>e.check(Od(...t))});function kh(e,t){return new xh({type:"set",valueType:e,...Hi(t)})}const Eh=ki("ZodEnum",(e,t)=>{gu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=Ii(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const s={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);s[r]=t.entries[r]}return new Eh({...t,checks:[],...Hi(r),entries:s})},e.exclude=(e,r)=>{const s={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete s[t]}return new Eh({...t,checks:[],...Hi(r),entries:s})}});function zh(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Eh({type:"enum",entries:n,...Hi(t)})}function Oh(e,t){return new Eh({type:"enum",entries:e,...Hi(t)})}const $h=ki("ZodLiteral",(e,t)=>{_u.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,s=[];for(const e of r.values)if(void 0===e){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(e))}else s.push(e);if(0===s.length);else if(1===s.length){const e=s[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else s.every(e=>"number"==typeof e)&&(n.type="number"),s.every(e=>"string"==typeof e)&&(n.type="string"),s.every(e=>"boolean"==typeof e)&&(n.type="boolean"),s.every(e=>null===e)&&(n.type="null"),n.enum=s})(e,t,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ih(e,t){return new $h({type:"literal",values:Array.isArray(e)?e:[e],...Hi(t)})}const Th=ki("ZodFile",(e,t)=>{vu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:o,mime:a}=e._zod.bag;void 0!==i&&(s.minLength=i),void 0!==o&&(s.maxLength=o),a?1===a.length?(s.contentMediaType=a[0],Object.assign(r,s)):(Object.assign(r,s),r.anyOf=a.map(e=>({contentMediaType:e}))):Object.assign(r,s)})(e,0,n),e.min=(t,n)=>e.check(zd(t,n)),e.max=(t,n)=>e.check(Ed(t,n)),e.mime=(t,n)=>e.check(Dd(Array.isArray(t)?t:[t],n))});function Ph(e){return function(e,t){return new e({type:"file",...Hi(t)})}(Th,e)}const Ah=ki("ZodTransform",(e,t)=>{bu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new zi(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(io(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(io(t))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)}});function Ch(e){return new Ah({type:"transform",transform:e})}const Rh=ki("ZodOptional",(e,t)=>{Su.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function jh(e){return new Rh({type:"optional",innerType:e})}const Nh=ki("ZodExactOptional",(e,t)=>{xu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Zh(e){return new Nh({type:"optional",innerType:e})}const Dh=ki("ZodNullable",(e,t)=>{ku.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i=Kd(s.innerType,t,r),o=t.seen.get(e);"openapi-3.0"===t.target?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fh(e){return new Dh({type:"nullable",innerType:e})}function Mh(e){return jh(Fh(e))}const Uh=ki("ZodDefault",(e,t)=>{Eu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Kd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Lh(e,t){return new Uh({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():Ji(t)}})}const qh=ki("ZodPrefault",(e,t)=>{Ou.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Kd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jh(e,t){return new qh({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():Ji(t)}})}const Qh=ki("ZodNonOptional",(e,t)=>{$u.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Kd(s.innerType,t,r),t.seen.get(e).ref=s.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Bh(e,t){return new Qh({type:"nonoptional",innerType:e,...Hi(t)})}const Kh=ki("ZodSuccess",(e,t)=>{Tu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t),e.unwrap=()=>e._zod.def.innerType});function Wh(e){return new Kh({type:"success",innerType:e})}const Hh=ki("ZodCatch",(e,t)=>{Pu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;let i;Kd(s.innerType,t,r),t.seen.get(e).ref=s.innerType;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Vh(e,t){return new Hh({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}const Gh=ki("ZodNaN",(e,t)=>{Au.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema")})(0,e)});function Yh(e){return function(e,t){return new e({type:"nan",...Hi(t)})}(Gh,e)}const Xh=ki("ZodPipe",(e,t)=>{Cu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i="input"===t.io?"transform"===s.in._zod.def.type?s.out:s.in:s.out;Kd(i,t,r),t.seen.get(e).ref=i})(e,t,0,r),e.in=t.in,e.out=t.out});function ef(e,t){return new Xh({type:"pipe",in:e,out:t})}const tf=ki("ZodCodec",(e,t)=>{Xh.init(e,t),ju.init(e,t)});function nf(e,t,n){return new tf({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const rf=ki("ZodReadonly",(e,t)=>{Du.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Kd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sf(e){return new rf({type:"readonly",innerType:e})}const of=ki("ZodTemplateLiteral",(e,t)=>{Mu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=s.source})(e,0,n)});function af(e,t){return new of({type:"template_literal",parts:e,...Hi(t)})}const cf=ki("ZodLazy",(e,t)=>{qu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.innerType;Kd(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.unwrap=()=>e._zod.def.getter()});function uf(e){return new cf({type:"lazy",getter:e})}const df=ki("ZodPromise",(e,t)=>{Lu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Kd(s.innerType,t,r),t.seen.get(e).ref=s.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function lf(e){return new df({type:"promise",innerType:e})}const pf=ki("ZodFunction",(e,t)=>{Uu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Function types cannot be represented in JSON Schema")})(0,e)});function hf(e){return new pf({type:"function",input:Array.isArray(e?.input)?yh(e?.input):e?.input??th(Kp()),output:e?.output??Kp()})}const ff=ki("ZodCustom",(e,t)=>{Ju.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});function mf(e){const t=new ja({check:"custom"});return t._zod.check=e,t}function yf(e,t){return function(e,t,n){const r=Hi(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}(ff,e??(()=>!0),t)}function gf(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Hi(n)})}(ff,e,t)}function _f(e){return function(e){const t=function(e){const t=new ja({check:"custom",...Hi(void 0)});return t._zod.check=e,t}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(io(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(io(r))}},e(n.value,n)));return t}(e)}const vf=function(e){const t=new ja({check:"describe"});return t._zod.onattach=[t=>{const n=Ku.get(t)??{};Ku.add(t,{...n,description:e})}],t._zod.check=()=>{},t},bf=function(e){const t=new ja({check:"meta"});return t._zod.onattach=[t=>{const n=Ku.get(t)??{};Ku.add(t,{...n,...e})}],t._zod.check=()=>{},t};function wf(e,t={}){const n=new ff({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...Hi(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}const Sf=(...e)=>function(e,t){const n=Hi(t);let r=n.truthy??["true","1","yes","on","y","enabled"],s=n.falsy??["false","0","no","off","n","disabled"];"sensitive"!==n.case&&(r=r.map(e=>"string"==typeof e?e.toLowerCase():e),s=s.map(e=>"string"==typeof e?e.toLowerCase():e));const i=new Set(r),o=new Set(s),a=e.Codec??ju,c=e.Boolean??Dc,u=new a({type:"pipe",in:new(e.String??cc)({type:"string",error:n.error}),out:new c({type:"boolean",error:n.error}),transform:(e,t)=>{let r=e;return"sensitive"!==n.case&&(r=r.toLowerCase()),!!i.has(r)||!o.has(r)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...o],input:t.value,inst:u,continue:!1}),{})},reverseTransform:(e,t)=>!0===e?r[0]||"true":s[0]||"false",error:n.error});return u}({Codec:tf,Boolean:Pp,String:El},...e);function xf(e){const t=uf(()=>ch([zl(e),kp(),Ap(),qp(),th(t),_h(zl(),t)]));return t}function kf(e,t){return ef(Ch(e),t)}var Ef;function zf(e){if("KW"!==e.country)throw new Error("The shipping address is not in Kuwait. Only Kuwaiti shipping addresses are supported.")}function Of(e,t){const n=e[t];return zf(n),{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:n.city,province:n.state.length>0?n.state:null,address_line_1:n.address_1,address_line_2:n.address_2.length>0?n.address_2:null},name:Af(e)}}function $f(e,t){const n=e[t];return zf(n),{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:[n.state,n.city].filter(e=>e.length>0).join(" --- "),province:null,address_line_1:n.address_1,address_line_2:n.address_2.length>0?n.address_2:null},name:Af(e)}}function If(e,t){const n=e[t];zf(n);const r=Pf(e,"_billing_piece")??"",s=Pf(e,"_billing_name"),i=`BLOCK_FIELD: ${r} --- STREET_FIELD: ${n.postcode} --- HOUSE_FIELD: ${n.address_1} --- FLOOR_APT_FIELD: ${n.address_2}`;return{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:n.city,province:n.state.length>0?n.state:null,address_line_1:i,address_line_2:null},name:"string"==typeof s&&s.length>0?s:Af(e)}}function Tf(e,t){const n=Pf(e,"governorate")??"",r=["area1","area2","area3","area4","area5","area6"].map(t=>Pf(e,t)??"").filter(e=>e.length>0),s=Pf(e,"block")??"",i=Pf(e,"street")??"",o=Pf(e,"house")??"";return{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:r.join(" --- "),province:n.length>0?n:null,address_line_1:`BLOCK_FIELD: ${s} --- STREET_FIELD: ${i} --- HOUSE_FIELD: ${o}`,address_line_2:null},name:Af(e)}}function Pf(e,t){const n=e.meta_data.find(e=>e.key===t);return n&&"string"==typeof n.value?n.value:null}function Af(e){const t=Cf(e.shipping.first_name,e.shipping.last_name);if(t.length>0)return t;const n=Cf(e.billing.first_name,e.billing.last_name);return n.length>0?n:(console.warn(`Order ${e.id} is missing customer name in both shipping address and billing address.`),"")}function Cf(e,t){const n=e.trim(),r=t.trim();return 0===n.length?"":r.length>0?`${n} ${r}`:n}Ef||(Ef={}),new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]),$i({localeError:(()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(t){return e[t]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return e=>{switch(e.code){case"invalid_type":{const t=r[e.expected]??e.expected,n=function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(null===e)return"null";if(Array.isArray(e))return"array";const t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return t}(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case"invalid_value":return 1===e.values.length?`Invalid input: expected ${Vi(e.values[0])}`:`Invalid option: expected one of ${Ti(e.values,"|")}`;case"too_big":{const n=e.inclusive?"<=":"<",r=t(e.origin);return r?`Too big: expected ${e.origin??"value"} to have ${n}${e.maximum.toString()} ${r.unit??"elements"}`:`Too big: expected ${e.origin??"value"} to be ${n}${e.maximum.toString()}`}case"too_small":{const n=e.inclusive?">=":">",r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case"invalid_format":{const t=e;return"starts_with"===t.format?`Invalid string: must start with "${t.prefix}"`:"ends_with"===t.format?`Invalid string: must end with "${t.suffix}"`:"includes"===t.format?`Invalid string: must include "${t.includes}"`:"regex"===t.format?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${Ti(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`}}})()});const Rf=sh({id:kp(),order_key:zl(),billing:sh({first_name:zl(),last_name:zl(),address_1:zl(),address_2:zl(),city:zl(),state:zl(),postcode:zl(),country:zl(),email:ch([Il().trim(),Ih("").transform(e=>e||null)]),phone:zl()}),shipping:sh({first_name:zl(),last_name:zl(),company:zl(),address_1:zl(),address_2:zl(),city:zl(),state:zl(),postcode:zl(),country:zl(),phone:zl()}),meta_data:th(sh({key:zl(),value:Kp()})).default([])}),jf=window.WORDPRESS_SITE_URL;Si("string"==typeof jf&&jf.length>0,"WORDPRESS_SITE_URL is not defined");const Nf=new URL(jf).hostname,Zf=window.JAAK_WORDPRESS_REST_ROOT;Si("string"==typeof Zf&&Zf.length>0,"JAAK_WORDPRESS_REST_ROOT is not defined");const Df=window.JAAK_SITE_BASE_URL;Si("string"==typeof Df&&Df.length>0,"SITE_BASE_URL is not defined");const Ff=function(e,t){const n=function(e,t){if("string"!=typeof e||0===e.length)throw new Error(`${t} is missing or not a string.`);try{new URL(e)}catch{throw new Error(`${t} is not a valid URL: ${e}`)}return e}(e,"API_ROOT_URL");return wi(n,t).api}(Zf,{headers:{"X-WP-Nonce":"string"==typeof window.wp_api_settings?.nonce?window.wp_api_settings.nonce:""}});async function Mf(e){console.debug(`Fetching WooCommerce orders: ${e.join(", ")}`);const t=`${Zf}/orders`,n=window.wp_api_settings?.nonce;Si("string"==typeof n&&n.length>0,"WP Nonce is not defined");const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":n},credentials:"include",body:JSON.stringify({order_ids:e})});if(!r.ok)throw new xi({type:"api_error",title:"Failed to fetch orders from WordPress",detail:`${r.status} ${r.statusText}`});const s=await r.json();Wr({level:"debug",message:"[jaak-for-woocommerce] Raw order data from WordPress REST API",extra:{requested_order_ids:e,raw_response:s}});const i=th(Rf).parse(s);return console.debug(`Fetched ${i.length} order(s)`),i}function Uf(){const e=`${window.WORDPRESS_SITE_URL}/wp-admin/admin.php?page=wc-settings&tab=integration&section=jaak`;return(0,X.jsxs)("div",{className:"rounded border border-yellow-200 bg-yellow-50 px-4 py-3 text-yellow-800",children:[(0,X.jsxs)("p",{className:"text-sm",children:[(0,X.jsx)("strong",{children:"Configuration Required:"})," ","Jaak plugin is not configured. Please add your API key in the plugin settings to use this feature."]}),(0,X.jsx)("p",{className:"mt-2 text-sm",children:(0,X.jsx)("a",{href:e,className:"font-medium text-yellow-900 underline hover:text-yellow-700",children:"Go to Settings →"})})]})}function Lf({error:e}){return e instanceof xi&&"unauthorized"===e.type?(0,X.jsxs)("div",{className:"rounded border border-yellow-200 bg-yellow-50 px-4 py-3 text-yellow-800",children:[(0,X.jsx)("p",{className:"text-sm font-semibold",children:e.title}),"string"==typeof e.detail&&e.detail.length>0&&(0,X.jsx)("p",{className:"mt-1 text-sm",children:e.detail})]}):e instanceof xi?(0,X.jsxs)("div",{className:"rounded border border-red-200 bg-red-50 px-4 py-3 text-red-800",children:[(0,X.jsx)("p",{className:"text-sm font-semibold",children:e.title}),"string"==typeof e.detail&&e.detail.length>0&&(0,X.jsxs)("details",{className:"mt-2",children:[(0,X.jsx)("summary",{className:"cursor-pointer text-xs",children:"Show error details"}),(0,X.jsx)("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap text-xs",children:e.detail})]})]}):(0,X.jsx)("div",{className:"rounded border border-red-200 bg-red-50 px-4 py-3 text-red-800",children:(0,X.jsxs)("p",{className:"text-sm",children:[e.name,": ",e.message]})})}function qf({order_ids:e,on_close:t}){const n=function(e,t,n){const r=Y.useContext(de),s=Y.useContext(ue),i=te(n),o=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const u=i.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,n=e=>"static"===e?e:Math.max(e??t,t),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>n(r(...e)):n(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(o),((e,t,n)=>{const r=n?.state.error&&"function"==typeof e.throwOnError?I(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))})(o,s,u),(e=>{Y.useEffect(()=>{e.clearReset()},[e])})(s);const d=!i.getQueryCache().get(o.queryHash),[l]=Y.useState(()=>new t(i,o)),p=l.getOptimisticResult(o),h=!r&&!1!==e.subscribed;if(Y.useSyncExternalStore(Y.useCallback(e=>{const t=h?l.subscribe(P.batchCalls(e)):c;return l.updateResult(),t},[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Y.useEffect(()=>{l.setOptions(o)},[o,l]),((e,t)=>e?.suspense&&t.isPending)(o,p))throw le(o,l,s);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&void 0===e.data||I(n,[e.error,r])))({result:p,errorResetBoundary:s,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw p.error;if(i.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!a&&((e,t)=>e.isLoading&&e.isFetching&&!t)(p,r)){const e=d?le(o,l,s):u?.promise;e?.catch(c).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?p:l.trackResult(p)}({queryKey:["bulk-tasks",...e],queryFn:async()=>async function(e){console.debug(`Getting tasks for order keys: ${e.join(", ")}`);const t=await Ff.tasks.$get({query:{external_id:e}});if(401===t.status||403===t.status)throw new xi({type:"unauthorized",title:"Authentication Failed",detail:"Please check your API key configuration."});if(400===t.status){const e=await t.json();throw console.error("Bad request response data:",e),new xi({type:"bad_request",title:"Bad Request",detail:JSON.stringify(e,null,2)})}const n=(await t.json()).data;if(console.debug(`Got ${n.length} task(s)`),n[0])return n;if(0===n.length)return null;throw new Error("No tasks found")}((await Mf(e)).map(e=>e.order_key))},se,void 0);const r=function(e){const t=te(void 0),[n]=Y.useState(()=>new pe(t,e));Y.useEffect(()=>{n.setOptions(e)},[n,e]);const r=Y.useSyncExternalStore(Y.useCallback(e=>n.subscribe(P.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=Y.useCallback((e,t)=>{n.mutate(e,t).catch(c)},[n]);if(r.error&&I(n.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:s,mutateAsync:r.mutate}}({mutationFn:async()=>async function(e){console.debug(`Creating tasks for order IDs: ${e.join(", ")}`);const t=await Mf(e);console.debug(`Submitting tasks for ${t.length} order(s)`);const n=t.map(e=>function(e){const t=e.shipping.address_1.length>0?"shipping":"billing",n=!0===window.JAAK_IS_FORCE_DEFAULT_ADDRESS_PARSER,{parser:r,parser_name:s}=function(e,t={}){if(!0===t.force_default_address_parser)return{parser:Of,parser_name:"default_parser"};const n=e.toLowerCase();return n.endsWith("eitkw.com")?{parser:$f,parser_name:"eit_parser"}:n.endsWith("gbc-kwt.com")?{parser:If,parser_name:"gbc_parser"}:n.endsWith("somedaykw.com")?{parser:Tf,parser_name:"someday_parser"}:{parser:Of,parser_name:"default_parser"}}(Nf,{force_default_address_parser:n}),i=r(e,t);return function(e,t){Wr({level:"debug",message:"[jaak-for-woocommerce] Order fields parsed",extra:{order_id:e.id,parser_name:t.parser_name,is_force_default_address_parser:t.is_force_default_address_parser,source_address_key:t.source_address_key,parsed_destination:t.parsed_order.destination,parsed_name:t.parsed_order.name}})}(e,{parser_name:s,source_address_key:t,parsed_order:i,is_force_default_address_parser:n}),{external_id:e.order_key,external_ref:e.id.toString(),external_url:`${jf}/wp-admin/post.php?post=${e.id}&action=edit`,woocommerce_shop_domain:jf,destination:i.destination,email:e.billing.email,phone:e.shipping.phone||e.billing.phone,name:i.name}}(e)),r=await Ff.tasks.$post({json:n});if(401===r.status||403===r.status)throw new xi({type:"unauthorized",title:"Authentication Failed",detail:"Please check your API key configuration."});if(!r.ok){let e="Failed to create tasks";try{const t=await r.json();e=JSON.stringify(t,null,2)}catch(e){console.error("Failed to parse error response:",e)}throw new xi({type:"bad_request",title:"Failed to create tasks",detail:e})}}(e),onSuccess:()=>{t()}});return!0===window.JAAK_IS_CONFIGURED?n.isPending?(0,X.jsx)("div",{className:"w-full max-w-2xl rounded-lg bg-white p-6 shadow-xl",children:(0,X.jsxs)("div",{className:"flex items-center justify-center",children:[(0,X.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-b-2 border-blue-600"}),(0,X.jsx)("span",{className:"ms-2",children:"Loading..."})]})}):(0,X.jsxs)("div",{className:"w-full max-w-2xl rounded-lg bg-white p-6 shadow-xl",children:[(0,X.jsx)("h2",{className:"mb-4 text-xl font-bold",children:"Send Orders to Jaak"}),(0,X.jsxs)("p",{className:"mb-2 font-semibold",children:["Do you want to send ",e.length," selected order(s) to Jaak?"]}),(0,X.jsx)("p",{className:"mb-4 text-sm italic text-gray-600",children:"Note that it may take a moment until all orders are available on your Jaak dashboard."}),n.isError&&(0,X.jsx)("div",{className:"mb-4",children:(0,X.jsx)(Lf,{error:n.error})}),r.isError&&(0,X.jsx)("div",{className:"mb-4",children:(0,X.jsx)(Lf,{error:r.error})}),n.data&&n.data.length>0&&(0,X.jsxs)("div",{className:"mb-4 rounded border border-blue-200 bg-blue-50 p-4",children:[(0,X.jsx)("p",{className:"mb-2 font-semibold",children:"Some selected orders already exist in Jaak:"}),(0,X.jsx)("ul",{className:"list-inside list-disc space-y-1",children:n.data.sort((e,t)=>"string"!=typeof e.external_ref||"string"!=typeof t.external_ref?0:t.external_ref.localeCompare(e.external_ref)).map(e=>(0,X.jsxs)("li",{className:"text-sm",children:["Order ",e.external_ref," already exists in Jaak (",(0,X.jsx)("a",{href:`${Df}/tasks/${e.id}`,target:"_blank",rel:"noopener",className:"text-blue-600 hover:underline",children:"link"}),")"]},e.id))})]}),(0,X.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,X.jsx)("button",{type:"button",onClick:t,className:"rounded-md border border-gray-300 px-4 py-2 text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,X.jsx)("button",{type:"button",onClick:()=>r.mutate(),disabled:r.isPending,className:`rounded-md px-4 py-2 text-white ${r.isError?"bg-red-600 hover:bg-red-700":"bg-blue-600 hover:bg-blue-700"} disabled:cursor-not-allowed disabled:bg-gray-400`,children:r.isPending?"Sending...":"Send to Jaak"})]}),(0,X.jsx)("div",{className:"mt-4 text-end",children:(0,X.jsx)("a",{href:`${Df}/docs`,target:"_blank",rel:"noopener",className:"text-sm text-blue-600 hover:underline",children:"Help"})})]}):(0,X.jsxs)("div",{className:"w-full max-w-2xl rounded-lg bg-white p-6 shadow-xl",children:[(0,X.jsx)("h2",{className:"mb-4 text-xl font-bold",children:"Send Orders to Jaak"}),(0,X.jsx)(Uf,{}),(0,X.jsx)("div",{className:"mt-4 flex justify-end",children:(0,X.jsx)("button",{type:"button",onClick:t,className:"rounded-md border border-gray-300 px-4 py-2 text-gray-700 hover:bg-gray-50",children:"Close"})})]})}const Jf=new class{#W;#g;#p;#H;#V;#G;#Y;#X;constructor(e={}){this.#W=e.queryCache||new Q,this.#g=e.mutationCache||new K,this.#p=e.defaultOptions||{},this.#H=new Map,this.#V=new Map,this.#G=0}mount(){this.#G++,1===this.#G&&(this.#Y=C.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#W.onFocus())}),this.#X=R.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#W.onOnline())}))}unmount(){this.#G--,0===this.#G&&(this.#Y?.(),this.#Y=void 0,this.#X?.(),this.#X=void 0)}isFetching(e){return this.#W.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#g.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#W.build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(l(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#W.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#W.get(r.queryHash),i=s?.state.data,o=function(e,t){return"function"==typeof e?e(t):e}(t,i);if(void 0!==o)return this.#W.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return P.batch(()=>this.#W.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state}removeQueries(e){const t=this.#W;P.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const n=this.#W;return P.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=P.batch(()=>this.#W.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(c).catch(c)}invalidateQueries(e,t={}){return P.batch(()=>(this.#W.findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=P.batch(()=>this.#W.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(c)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(r).then(c)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=this.#W.build(this,t);return n.isStaleByTime(l(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(c).catch(c)}fetchInfiniteQuery(e){return e.behavior=H(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(c).catch(c)}ensureInfiniteQueryData(e){return e.behavior=H(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return R.isOnline()?this.#g.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#W}getMutationCache(){return this.#g}getDefaultOptions(){return this.#p}setDefaultOptions(e){this.#p=e}setQueryDefaults(e,t){this.#H.set(y(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#H.values()],n={};return t.forEach(t=>{g(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#V.set(y(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#V.values()],n={};return t.forEach(t=>{g(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#p.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=m(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===O&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#p.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#W.clear(),this.#g.clear()}};document.addEventListener("DOMContentLoaded",()=>{console.log("[Jaak] Bulk action script loaded");const e=document.getElementById("jaak-bulk-action-root");if(!e)return void console.log("[Jaak] Bulk action root not found");console.log("[Jaak] Bulk action root found:",e);const t=document.querySelector('select[name="action"]'),n=document.querySelector("#doaction");t&&n?(console.log("[Jaak] Bulk action controls found, adding event listener"),n.addEventListener("click",n=>{const r=t.value;if(console.log("[Jaak] Bulk action clicked:",r),"jaak_send_to_jaak"===r){n.preventDefault();const t=document.querySelectorAll('input[name="post[]"]:checked, input[name="id[]"]:checked'),r=Array.from(t).map(e=>Number.parseInt(e.value,10));if(console.log("[Jaak] Selected order IDs:",r),0===r.length)return void alert("Please select at least one order.");e.style.display="flex",console.log("[Jaak] Rendering bulk action modal");const s=(0,re.createRoot)(e);s.render((0,X.jsx)(ne,{client:Jf,children:(0,X.jsx)(qf,{order_ids:r,on_close:()=>{console.log("[Jaak] Closing modal"),s.unmount(),e.style.display="none"}})}))}})):console.log("[Jaak] Bulk action controls not found")})})();
     1(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{base64:()=>Xo,base64url:()=>ea,bigint:()=>da,boolean:()=>ha,browserEmail:()=>Qo,cidrv4:()=>Go,cidrv6:()=>Yo,cuid:()=>Oo,cuid2:()=>$o,date:()=>ia,datetime:()=>ca,domain:()=>na,duration:()=>Co,e164:()=>ra,email:()=>Mo,emoji:()=>Ko,extendedDuration:()=>No,guid:()=>jo,hex:()=>_a,hostname:()=>ta,html5Email:()=>Uo,idnEmail:()=>Jo,integer:()=>la,ipv4:()=>Wo,ipv6:()=>Ho,ksuid:()=>Po,lowercase:()=>ya,mac:()=>Vo,md5_base64:()=>Sa,md5_base64url:()=>xa,md5_hex:()=>wa,nanoid:()=>Ao,null:()=>fa,number:()=>pa,rfc5322Email:()=>Lo,sha1_base64:()=>Ea,sha1_base64url:()=>za,sha1_hex:()=>ka,sha256_base64:()=>$a,sha256_base64url:()=>Ia,sha256_hex:()=>Oa,sha384_base64:()=>Pa,sha384_base64url:()=>Aa,sha384_hex:()=>Ta,sha512_base64:()=>Na,sha512_base64url:()=>ja,sha512_hex:()=>Ca,string:()=>ua,time:()=>aa,ulid:()=>Io,undefined:()=>ma,unicodeEmail:()=>qo,uppercase:()=>ga,uuid:()=>Ro,uuid4:()=>Zo,uuid6:()=>Do,uuid7:()=>Fo,xid:()=>To});var n={};e.r(n),e.d(n,{endsWith:()=>Zd,gt:()=>vd,gte:()=>bd,includes:()=>jd,length:()=>Pd,lowercase:()=>Cd,lt:()=>gd,lte:()=>_d,maxLength:()=>Id,maxSize:()=>zd,mime:()=>Fd,minLength:()=>Td,minSize:()=>Od,multipleOf:()=>Ed,negative:()=>Sd,nonnegative:()=>kd,nonpositive:()=>xd,normalize:()=>Ud,overwrite:()=>Md,positive:()=>wd,property:()=>Dd,regex:()=>Ad,size:()=>$d,slugify:()=>Qd,startsWith:()=>Rd,toLowerCase:()=>qd,toUpperCase:()=>Jd,trim:()=>Ld,uppercase:()=>Nd});var r={};e.r(r),e.d(r,{ZodISODate:()=>sl,ZodISODateTime:()=>nl,ZodISODuration:()=>cl,ZodISOTime:()=>ol,date:()=>il,datetime:()=>rl,duration:()=>ul,time:()=>al});var s={};e.r(s),e.d(s,{ZodAny:()=>Qp,ZodArray:()=>th,ZodBase64:()=>lp,ZodBase64URL:()=>hp,ZodBigInt:()=>Np,ZodBigIntFormat:()=>Rp,ZodBoolean:()=>Ap,ZodCIDRv4:()=>ap,ZodCIDRv6:()=>up,ZodCUID:()=>Ql,ZodCUID2:()=>Kl,ZodCatch:()=>Vh,ZodCodec:()=>nf,ZodCustom:()=>mf,ZodCustomStringFormat:()=>vp,ZodDate:()=>Xp,ZodDefault:()=>Lh,ZodDiscriminatedUnion:()=>ph,ZodE164:()=>mp,ZodEmail:()=>Il,ZodEmoji:()=>Ul,ZodEnum:()=>zh,ZodExactOptional:()=>Zh,ZodFile:()=>Ph,ZodFunction:()=>hf,ZodGUID:()=>Pl,ZodIPv4:()=>tp,ZodIPv6:()=>ip,ZodIntersection:()=>fh,ZodJWT:()=>gp,ZodKSUID:()=>Xl,ZodLazy:()=>uf,ZodLiteral:()=>Ih,ZodMAC:()=>rp,ZodMap:()=>Sh,ZodNaN:()=>Yh,ZodNanoID:()=>ql,ZodNever:()=>Hp,ZodNonOptional:()=>Bh,ZodNull:()=>qp,ZodNullable:()=>Fh,ZodNumber:()=>kp,ZodNumberFormat:()=>zp,ZodObject:()=>sh,ZodOptional:()=>jh,ZodPipe:()=>ef,ZodPrefault:()=>Jh,ZodPromise:()=>lf,ZodReadonly:()=>sf,ZodRecord:()=>_h,ZodSet:()=>kh,ZodString:()=>zl,ZodStringFormat:()=>$l,ZodSuccess:()=>Wh,ZodSymbol:()=>Fp,ZodTemplateLiteral:()=>af,ZodTransform:()=>Ch,ZodTuple:()=>yh,ZodType:()=>kl,ZodULID:()=>Hl,ZodURL:()=>Dl,ZodUUID:()=>Cl,ZodUndefined:()=>Up,ZodUnion:()=>ch,ZodUnknown:()=>Kp,ZodVoid:()=>Gp,ZodXID:()=>Gl,ZodXor:()=>dh,_ZodString:()=>El,_default:()=>qh,_function:()=>ff,any:()=>Bp,array:()=>nh,base64:()=>pp,base64url:()=>fp,bigint:()=>jp,boolean:()=>Cp,catch:()=>Gh,check:()=>yf,cidrv4:()=>cp,cidrv6:()=>dp,codec:()=>rf,cuid:()=>Bl,cuid2:()=>Wl,custom:()=>gf,date:()=>eh,describe:()=>bf,discriminatedUnion:()=>hh,e164:()=>yp,email:()=>Tl,emoji:()=>Ll,enum:()=>Oh,exactOptional:()=>Dh,file:()=>Ah,float32:()=>$p,float64:()=>Ip,function:()=>ff,guid:()=>Al,hash:()=>xp,hex:()=>Sp,hostname:()=>wp,httpUrl:()=>Ml,instanceof:()=>Sf,int:()=>Op,int32:()=>Tp,int64:()=>Zp,intersection:()=>mh,ipv4:()=>np,ipv6:()=>op,json:()=>kf,jwt:()=>_p,keyof:()=>rh,ksuid:()=>ep,lazy:()=>df,literal:()=>Th,looseObject:()=>ah,looseRecord:()=>wh,mac:()=>sp,map:()=>xh,meta:()=>wf,nan:()=>Xh,nanoid:()=>Jl,nativeEnum:()=>$h,never:()=>Vp,nonoptional:()=>Kh,null:()=>Jp,nullable:()=>Mh,nullish:()=>Uh,number:()=>Ep,object:()=>ih,optional:()=>Rh,partialRecord:()=>bh,pipe:()=>tf,prefault:()=>Qh,preprocess:()=>Ef,promise:()=>pf,readonly:()=>of,record:()=>vh,refine:()=>_f,set:()=>Eh,strictObject:()=>oh,string:()=>Ol,stringFormat:()=>bp,stringbool:()=>xf,success:()=>Hh,superRefine:()=>vf,symbol:()=>Mp,templateLiteral:()=>cf,transform:()=>Nh,tuple:()=>gh,uint32:()=>Pp,uint64:()=>Dp,ulid:()=>Vl,undefined:()=>Lp,union:()=>uh,unknown:()=>Wp,url:()=>Fl,uuid:()=>Nl,uuidv4:()=>jl,uuidv6:()=>Rl,uuidv7:()=>Zl,void:()=>Yp,xid:()=>Yl,xor:()=>lh});var i={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o=new class{#e=i;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},a="undefined"==typeof window||"Deno"in globalThis;function c(){}function u(e){return"number"==typeof e&&e>=0&&e!==1/0}function d(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function p(e,t){return"function"==typeof e?e(t):e}function h(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o)if(r){if(t.queryHash!==m(o,t.options))return!1}else if(!g(t.queryKey,o))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function f(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(y(t.options.mutationKey)!==y(i))return!1}else if(!g(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function m(e,t){return(t?.queryKeyHashFn||y)(e)}function y(e){return JSON.stringify(e,(e,t)=>S(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function g(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(n=>g(e[n],t[n]))}var _=Object.prototype.hasOwnProperty;function v(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=w(e)&&w(t);if(!(r||S(e)&&S(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),o=i.length,a=r?new Array(o):{};let c=0;for(let u=0;u<o;u++){const o=r?u:i[u],d=e[o],l=t[o];if(d===l){a[o]=d,(r?u<s:_.call(e,o))&&c++;continue}if(null===d||null===l||"object"!=typeof d||"object"!=typeof l){a[o]=l;continue}const p=v(d,l,n+1);a[o]=p,p===d&&c++}return s===o&&c===s?e:a}function b(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function S(e){if(!x(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!x(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function k(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?v(e,t):t}function E(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function z(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var O=Symbol();function $(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==O?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function I(e,t){return"function"==typeof e?e(...t):!!e}var T=function(e){setTimeout(e,0)},P=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},s=T;const i=r=>{t?e.push(r):s(()=>{n(r)})};return{batch:i=>{let o;t++;try{o=i()}finally{t--,t||(()=>{const t=e;e=[],t.length&&s(()=>{r(()=>{t.forEach(e=>{n(e)})})})})()}return o},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{s=e}}}(),A=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},C=new class extends A{#n;#r;#s;constructor(){super(),this.#s=e=>{if(!a&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#n!==e&&(this.#n=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#n?this.#n:"hidden"!==globalThis.document?.visibilityState}},N=new class extends A{#i=!0;#r;#s;constructor(){super(),this.#s=e=>{if(!a&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#i!==e&&(this.#i=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#i}};function j(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}function R(e){return Math.min(1e3*2**e,3e4)}function Z(e){return"online"!==(e??"online")||N.isOnline()}var D=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function F(e){let t,n=!1,r=0;const s=j(),i=()=>"pending"!==s.status,c=()=>C.isFocused()&&("always"===e.networkMode||N.isOnline())&&e.canRun(),u=()=>Z(e.networkMode)&&e.canRun(),d=e=>{i()||(t?.(),s.resolve(e))},l=e=>{i()||(t?.(),s.reject(e))},p=()=>new Promise(n=>{t=e=>{(i()||c())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,i()||e.onContinue?.()}),h=()=>{if(i())return;let t;const s=0===r?e.initialPromise:void 0;try{t=s??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(d).catch(t=>{if(i())return;const s=e.retry??(a?0:3),u=e.retryDelay??R,d="function"==typeof u?u(r,t):u,f=!0===s||"number"==typeof s&&r<s||"function"==typeof s&&s(r,t);var m;!n&&f?(r++,e.onFail?.(r,t),(m=d,new Promise(e=>{o.setTimeout(e,m)})).then(()=>c()?void 0:p()).then(()=>{n?l(t):h()})):l(t)})};return{promise:s,status:()=>s.status,cancel:t=>{if(!i()){const n=new D(t);l(n),e.onCancel?.(n)}},continue:()=>(t?.(),s),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:u,start:()=>(u()?h():p().then(h),s)}}var M=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),u(this.gcTime)&&(this.#o=o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a?1/0:3e5))}clearGcTimeout(){this.#o&&(o.clearTimeout(this.#o),this.#o=void 0)}},U=class extends M{#a;#c;#u;#d;#l;#p;#h;constructor(e){super(),this.#h=!1,this.#p=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#d=e.client,this.#u=this.#d.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=J(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(e){if(this.options={...this.#p,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=J(this.options);void 0!==e.data&&(this.setState(q(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){const n=k(this.state.data,e,this.options);return this.#f({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#l?.promise;return this.#l?.cancel(e),t?t.then(c).catch(c):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#a)}isActive(){return this.observers.some(e=>!1!==p(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===O||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===l(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!d(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#l&&(this.#h?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#l?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,n.signal)})},s=()=>{const e=$(this.options,t),n=(()=>{const e={client:this.#d,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#h=!1,this.options.persister?this.options.persister(e,n,this):e(n)},i=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#d,state:this.state,fetchFn:s};return r(e),e})();this.options.behavior?.onFetch(i,this),this.#c=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===i.fetchOptions?.meta||this.#f({type:"fetch",meta:i.fetchOptions?.meta}),this.#l=F({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:e=>{e instanceof D&&e.revert&&this.setState({...this.#c,fetchStatus:"idle"}),n.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const e=await this.#l.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof D){if(e.silent)return this.#l.promise;if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#f({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...L(t.data,this.options),fetchMeta:e.meta??null};case"success":const n={...t,...q(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=e.manual?n:void 0,n;case"error":const r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function L(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Z(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function q(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function J(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Q=class extends A{constructor(e={}){super(),this.config=e,this.#m=new Map}#m;build(e,t,n){const r=t.queryKey,s=t.queryHash??m(r,t);let i=this.get(s);return i||(i=new U({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#m.has(e.queryHash)||(this.#m.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#m.get(e.queryHash);t&&(e.destroy(),t===e&&this.#m.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){P.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#m.get(e)}getAll(){return[...this.#m.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>h(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>h(e,t)):t}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){P.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){P.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},B=class extends M{#d;#y;#g;#l;constructor(e){super(),this.#d=e.client,this.mutationId=e.mutationId,this.#g=e.mutationCache,this.#y=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#y.includes(e)||(this.#y.push(e),this.clearGcTimeout(),this.#g.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#y=this.#y.filter(t=>t!==e),this.scheduleGc(),this.#g.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#y.length||("pending"===this.state.status?this.scheduleGc():this.#g.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#f({type:"continue"})},n={client:this.#d,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=F({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#g.canRun(this)});const r="pending"===this.state.status,s=!this.#l.canStart();try{if(r)t();else{this.#f({type:"pending",variables:e,isPaused:s}),this.#g.config.onMutate&&await this.#g.config.onMutate(e,this,n);const t=await(this.options.onMutate?.(e,n));t!==this.state.context&&this.#f({type:"pending",context:t,variables:e,isPaused:s})}const i=await this.#l.start();return await(this.#g.config.onSuccess?.(i,e,this.state.context,this,n)),await(this.options.onSuccess?.(i,e,this.state.context,n)),await(this.#g.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n)),await(this.options.onSettled?.(i,null,e,this.state.context,n)),this.#f({type:"success",data:i}),i}catch(t){try{await(this.#g.config.onError?.(t,e,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onError?.(t,e,this.state.context,n))}catch(e){Promise.reject(e)}try{await(this.#g.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onSettled?.(void 0,t,e,this.state.context,n))}catch(e){Promise.reject(e)}throw this.#f({type:"error",error:t}),t}finally{this.#g.runNext(this)}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),P.batch(()=>{this.#y.forEach(t=>{t.onMutationUpdate(e)}),this.#g.notify({mutation:this,type:"updated",action:e})})}},K=class extends A{constructor(e={}){super(),this.config=e,this.#_=new Set,this.#v=new Map,this.#b=0}#_;#v;#b;build(e,t,n){const r=new B({client:e,mutationCache:this,mutationId:++this.#b,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#_.add(e);const t=W(e);if("string"==typeof t){const n=this.#v.get(t);n?n.push(e):this.#v.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#_.delete(e)){const t=W(e);if("string"==typeof t){const n=this.#v.get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#v.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=W(e);if("string"==typeof t){const n=this.#v.get(t),r=n?.find(e=>"pending"===e.state.status);return!r||r===e}return!0}runNext(e){const t=W(e);if("string"==typeof t){const n=this.#v.get(t)?.find(t=>t!==e&&t.state.isPaused);return n?.continue()??Promise.resolve()}return Promise.resolve()}clear(){P.batch(()=>{this.#_.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#_.clear(),this.#v.clear()})}getAll(){return Array.from(this.#_)}find(e){const t={exact:!0,...e};return this.getAll().find(e=>f(t,e))}findAll(e={}){return this.getAll().filter(t=>f(e,t))}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return P.batch(()=>Promise.all(e.map(e=>e.continue().catch(c))))}};function W(e){return e.options.scope?.id}function H(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let n=!1;const u=e=>{!function(e,n,r){let s,i=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t.signal,i||(i=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)})}(e,0,()=>n=!0)},d=$(t.options,t.fetchOptions),l=async(e,r,s)=>{if(n)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);const i=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:s?"backward":"forward",meta:t.options.meta};return u(e),e})(),o=await d(i),{maxPages:a}=t.options,c=s?z:E;return{pages:c(e.pages,o,a),pageParams:c(e.pageParams,r,a)}};if(s&&i.length){const e="backward"===s,t={pages:i,pageParams:o},n=(e?G:V)(r,t);a=await l(t,n,e)}else{const t=e??i.length;do{const e=0===c?o[0]??r.initialPageParam:V(r,a);if(c>0&&null==e)break;a=await l(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function V(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function G(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}const Y=window.React,X=window.ReactJSXRuntime;var ee=Y.createContext(void 0),te=e=>{const t=Y.useContext(ee);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ne=({client:e,children:t})=>(Y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,X.jsx)(ee.Provider,{value:e,children:t}));const re=window.wp.element;var se=class extends A{constructor(e,t){super(),this.options=t,this.#d=e,this.#w=null,this.#S=j(),this.bindMethods(),this.setOptions(t)}#d;#x=void 0;#k=void 0;#E=void 0;#z;#O;#S;#w;#$;#I;#T;#P;#A;#C;#N=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#x.addObserver(this),ie(this.#x,this.options)?this.#j():this.updateResult(),this.#R())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oe(this.#x,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oe(this.#x,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#Z(),this.#D(),this.#x.removeObserver(this)}setOptions(e){const t=this.options,n=this.#x;if(this.options=this.#d.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof p(this.options.enabled,this.#x))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#F(),this.#x.setOptions(this.options),t._defaulted&&!b(this.options,t)&&this.#d.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#x,observer:this});const r=this.hasListeners();r&&ae(this.#x,n,this.options,t)&&this.#j(),this.updateResult(),!r||this.#x===n&&p(this.options.enabled,this.#x)===p(t.enabled,this.#x)&&l(this.options.staleTime,this.#x)===l(t.staleTime,this.#x)||this.#M();const s=this.#U();!r||this.#x===n&&p(this.options.enabled,this.#x)===p(t.enabled,this.#x)&&s===this.#C||this.#L(s)}getOptimisticResult(e){const t=this.#d.getQueryCache().build(this.#d,e),n=this.createResult(t,e);return r=n,!b(this.getCurrentResult(),r)&&(this.#E=n,this.#O=this.options,this.#z=this.#x.state),n;var r}getCurrentResult(){return this.#E}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#S.status||this.#S.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(e){this.#N.add(e)}getCurrentQuery(){return this.#x}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#d.defaultQueryOptions(e),n=this.#d.getQueryCache().build(this.#d,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#j({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#E))}#j(e){this.#F();let t=this.#x.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#M(){this.#Z();const e=l(this.options.staleTime,this.#x);if(a||this.#E.isStale||!u(e))return;const t=d(this.#E.dataUpdatedAt,e)+1;this.#P=o.setTimeout(()=>{this.#E.isStale||this.updateResult()},t)}#U(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#x):this.options.refetchInterval)??!1}#L(e){this.#D(),this.#C=e,!a&&!1!==p(this.options.enabled,this.#x)&&u(this.#C)&&0!==this.#C&&(this.#A=o.setInterval(()=>{(this.options.refetchIntervalInBackground||C.isFocused())&&this.#j()},this.#C))}#R(){this.#M(),this.#L(this.#U())}#Z(){this.#P&&(o.clearTimeout(this.#P),this.#P=void 0)}#D(){this.#A&&(o.clearInterval(this.#A),this.#A=void 0)}createResult(e,t){const n=this.#x,r=this.options,s=this.#E,i=this.#z,o=this.#O,a=e!==n?e.state:this.#k,{state:c}=e;let u,d={...c},l=!1;if(t._optimisticResults){const s=this.hasListeners(),i=!s&&ie(e,t),o=s&&ae(e,n,t,r);(i||o)&&(d={...d,...L(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:f,status:m}=d;u=d.data;let y=!1;if(void 0!==t.placeholderData&&void 0===u&&"pending"===m){let e;s?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=s.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#T?.state.data,this.#T):t.placeholderData,void 0!==e&&(m="success",u=k(s?.data,e,t),l=!0)}if(t.select&&void 0!==u&&!y)if(s&&u===i?.data&&t.select===this.#$)u=this.#I;else try{this.#$=t.select,u=t.select(u),u=k(s?.data,u,t),this.#I=u,this.#w=null}catch(e){this.#w=e}this.#w&&(h=this.#w,u=this.#I,f=Date.now(),m="error");const g="fetching"===d.fetchStatus,_="pending"===m,v="error"===m,b=_&&g,w=void 0!==u,S={status:m,fetchStatus:d.fetchStatus,isPending:_,isSuccess:"success"===m,isError:v,isInitialLoading:b,isLoading:b,data:u,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:f,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>a.dataUpdateCount||d.errorUpdateCount>a.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!w,isPaused:"paused"===d.fetchStatus,isPlaceholderData:l,isRefetchError:v&&w,isStale:ce(e,t),refetch:this.refetch,promise:this.#S,isEnabled:!1!==p(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==S.data,r="error"===S.status&&!t,s=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},i=()=>{const e=this.#S=S.promise=j();s(e)},o=this.#S;switch(o.status){case"pending":e.queryHash===n.queryHash&&s(o);break;case"fulfilled":(r||S.data!==o.value)&&i();break;case"rejected":r&&S.error===o.reason||i()}}return S}updateResult(){const e=this.#E,t=this.createResult(this.#x,this.options);this.#z=this.#x.state,this.#O=this.options,void 0!==this.#z.data&&(this.#T=this.#x),b(t,e)||(this.#E=t,this.#q({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!this.#N.size)return!0;const r=new Set(n??this.#N);return this.options.throwOnError&&r.add("error"),Object.keys(this.#E).some(t=>{const n=t;return this.#E[n]!==e[n]&&r.has(n)})})()}))}#F(){const e=this.#d.getQueryCache().build(this.#d,this.options);if(e===this.#x)return;const t=this.#x;this.#x=e,this.#k=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#R()}#q(e){P.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#E)}),this.#d.getQueryCache().notify({query:this.#x,type:"observerResultsUpdated"})})}};function ie(e,t){return function(e,t){return!1!==p(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&oe(e,t,t.refetchOnMount)}function oe(e,t,n){if(!1!==p(t.enabled,e)&&"static"!==l(t.staleTime,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&ce(e,t)}return!1}function ae(e,t,n,r){return(e!==t||!1===p(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&ce(e,n)}function ce(e,t){return!1!==p(t.enabled,e)&&e.isStaleByTime(l(t.staleTime,e))}var ue=Y.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),de=Y.createContext(!1),le=(de.Provider,(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()}));var pe=class extends A{#d;#E=void 0;#J;#Q;constructor(e,t){super(),this.#d=e,this.setOptions(t),this.bindMethods(),this.#B()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#d.defaultMutationOptions(e),b(this.options,t)||this.#d.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this}),t?.mutationKey&&this.options.mutationKey&&y(t.mutationKey)!==y(this.options.mutationKey)?this.reset():"pending"===this.#J?.state.status&&this.#J.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#J?.removeObserver(this)}onMutationUpdate(e){this.#B(),this.#q(e)}getCurrentResult(){return this.#E}reset(){this.#J?.removeObserver(this),this.#J=void 0,this.#B(),this.#q()}mutate(e,t){return this.#Q=t,this.#J?.removeObserver(this),this.#J=this.#d.getMutationCache().build(this.#d,this.options),this.#J.addObserver(this),this.#J.execute(e)}#B(){const e=this.#J?.state??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};this.#E={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#q(e){P.batch(()=>{if(this.#Q&&this.hasListeners()){const t=this.#E.variables,n=this.#E.context,r={client:this.#d,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===e?.type){try{this.#Q.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if("error"===e?.type){try{this.#Q.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#E)})})}};const he="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,fe="10.50.0",me=globalThis;function ye(){return ge(me),me}function ge(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||fe,t[fe]=t[fe]||{}}function _e(e,t,n=me){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[fe]=r[fe]||{};return s[e]||(s[e]=t())}const ve=["debug","info","warn","error","log","assert","trace"],be={};function we(e){if(!("console"in me))return e();const t=me.console,n={},r=Object.keys(be);r.forEach(e=>{const r=be[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function Se(){return ke().enabled}function xe(e,...t){he&&Se()&&we(()=>{me.console[e](`Sentry Logger [${e}]:`,...t)})}function ke(){return he?_e("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const Ee=function(){ke().enabled=!0},ze=function(...e){xe("log",...e)},Oe=function(...e){xe("warn",...e)},$e=function(...e){xe("error",...e)},Ie=[];function Te(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;if(t.forEach(e=>{e.isDefaultInstance=!0}),Array.isArray(n))r=[...t,...n];else if("function"==typeof n){const e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return function(e){const t={};return e.forEach(e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(r)}function Pe(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Ae(e,t,n){if(n[t.name])he&&ze(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,Ie.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),Ie.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}["processSpan","processSegmentSpan"].forEach(n=>{const r=t[n];"function"==typeof r&&e.on(n,n=>r.call(t,n,e))}),he&&ze(`Integration installed: ${t.name}`)}}function Ce(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}const Ne=Object.prototype.toString;function je(e){switch(Ne.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Qe(e,Error)}}function Re(e,t){return Ne.call(e)===`[object ${t}]`}function Ze(e){return Re(e,"ErrorEvent")}function De(e){return Re(e,"DOMError")}function Fe(e){return Re(e,"String")}function Me(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ue(e){return null===e||Me(e)||"object"!=typeof e&&"function"!=typeof e}function Le(e){return Re(e,"Object")}function qe(e){return"undefined"!=typeof Event&&Qe(e,Event)}function Je(e){return Boolean(e?.then&&"function"==typeof e.then)}function Qe(e,t){try{return e instanceof t}catch{return!1}}function Be(e){return!("object"!=typeof e||null===e||!(e.__isVue||e._isVue||e.__v_isVNode))}function Ke(e){return"undefined"!=typeof Request&&Qe(e,Request)}const We=me;function He(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,o=0;const a=" > ",c=a.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&i++<r&&(u=Ve(n,d),!("html"===u||i>1&&o+s.length*c+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function Ve(e,t){const n=e,r=[];if(!n?.tagName)return"";if(We.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(s?.length)s.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const e=n.className;if(e&&Fe(e)){const t=e.split(/\s+/);for(const e of t)r.push(`.${e}`)}}for(const e of["aria-label","type","name","title","alt"]){const t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join("")}function Ge(){try{return We.document.location.href}catch{return""}}function Ye(e,t,n){if(!(t in e))return;const r=e[t];if("function"!=typeof r)return;const s=n(r);"function"==typeof s&&et(s,r);try{e[t]=s}catch{he&&ze(`Failed to replace method "${t}" in object`,e)}}function Xe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{he&&ze(`Failed to add non-enumerable property "${t}" to object`,e)}}function et(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Xe(e,"__sentry_original__",t)}catch{}}function tt(e){return e.__sentry_original__}function nt(e){if(je(e))return{message:e.message,name:e.name,stack:e.stack,...st(e)};if(qe(e)){const t={type:e.type,target:rt(e.target),currentTarget:rt(e.currentTarget),...st(e)};return"undefined"!=typeof CustomEvent&&Qe(e,CustomEvent)&&(t.detail=e.detail),t}return e}function rt(e){try{return"undefined"!=typeof Element&&Qe(e,Element)?He(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function st(e){return"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e)):{}}let it,ot;function at(e){if(void 0!==it)return it?it(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=me;return t in n&&"function"==typeof n[t]?(it=n[t],it(e)):(it=null,e())}function ct(){return at(()=>Math.random())}function ut(){return at(()=>Date.now())}function dt(e=function(){const e=me;return e.crypto||e.msCrypto}()){try{if(e?.randomUUID)return at(()=>e.randomUUID()).replace(/-/g,"")}catch{}return ot||(ot=[1e7]+1e3+4e3+8e3+1e11),ot.replace(/[018]/g,e=>(e^(16*ct()&15)>>e/4).toString(16))}function lt(e){return e.exception?.values?.[0]}function pt(e){const{message:t,event_id:n}=e;if(t)return t;const r=lt(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ht(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function ft(e,t){const n=lt(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}}function mt(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{Xe(e,"__sentry_captured__",!0)}catch{}return!1}const yt="?",gt=/\(error: (.*)\)/,_t=/captureMessage|captureException/;function vt(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{const s=[],i=e.split("\n");for(let e=n;e<i.length;e++){let n=i[e];n.length>1024&&(n=n.slice(0,1024));const o=gt.test(n)?n.replace(gt,"$1"):n;if(!o.includes("Error: ")){for(const e of t){const t=e(o);if(t){s.push(t);break}}if(s.length>=50+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(bt(t).function||"")&&t.pop(),t.reverse(),_t.test(bt(t).function||"")&&(t.pop(),_t.test(bt(t).function||"")&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||bt(t).filename,function:e.function||yt}))}(s.slice(r))}}function bt(e){return e[e.length-1]||{}}const wt="<anonymous>";function St(e){try{return e&&"function"==typeof e&&e.name||wt}catch{return wt}}function xt(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function kt(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function Et(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function zt(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{Be(r)?n.push(kt(r)):n.push(String(r))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Ot(e,t,n=!1){return!!Fe(e)&&(Re(t,"RegExp")?t.test(e):Fe(t)?n?e===t:e.includes(t):"function"==typeof t&&t(e))}function $t(e,t=[],n=!1){return t.some(t=>Ot(e,t,n))}const It=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],Tt=(e={})=>{let t;return{name:"EventFilters",setup(n){const r=n.getOptions();t=At(e,r)},processEvent(n,r,s){if(!t){const n=s.getOptions();t=At(e,n)}return function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(!t?.length)return!1;const n=e.transaction;return!!n&&$t(n,t)}(e,t.ignoreTransactions))return he&&Oe(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${pt(e)}`),!0}else{if(function(e,t){return!!t?.length&&Ce(e).some(e=>$t(e,t))}(e,t.ignoreErrors))return he&&Oe(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${pt(e)}`),!0;if(function(e){return!!e.exception?.values?.length&&(!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return he&&Oe(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${pt(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=Ct(e);return!!n&&$t(n,t)}(e,t.denyUrls))return he&&Oe(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${pt(e)}.\nUrl: ${Ct(e)}`),!0;if(!function(e,t){if(!t?.length)return!0;const n=Ct(e);return!n||$t(n,t)}(e,t.allowUrls))return he&&Oe(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${pt(e)}.\nUrl: ${Ct(e)}`),!0}return!1}(n,t)?null:n}}},Pt=(e={})=>({...Tt(e),name:"InboundFilters"});function At(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:It],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Ct(e){try{const t=[...e.exception?.values??[]].reverse().find(e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length),n=t?.stacktrace?.frames;return n?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch{return he&&$e(`Cannot extract url for event ${pt(e)}`),null}}function Nt(){return ut()/1e3}let jt;function Rt(){return(jt??(jt=function(){const{performance:e}=me;if(!e?.now||!e.timeOrigin)return Nt;const t=e.timeOrigin;return()=>(t+at(()=>e.now()))/1e3}()))()}function Zt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Rt(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:dt()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Dt(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&0===Object.keys(t).length)return e;const r={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=Dt(r[e],t[e],n-1));return r}function Ft(){return dt()}function Mt(){return dt().substring(16)}const Ut="_sentrySpan";function Lt(e,t){t?Xe(e,Ut,t):delete e[Ut]}function qt(e){return e[Ut]}class Jt{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ft(),sampleRand:ct()}}clone(){const e=new Jt;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,Lt(e,qt(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Zt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,n=t instanceof Jt?t.getScopeData():Le(t)?e:void 0,{tags:r,attributes:s,extra:i,user:o,contexts:a,level:c,fingerprint:u=[],propagationContext:d,conversationId:l}=n||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...a},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),l&&(this._conversationId=l),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Lt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ft(),sampleRand:ct()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:Nt(),...e,message:e.message?Et(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:qt(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Dt(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t?.event_id||dt();if(!this._client)return he&&Oe("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n?.event_id||dt();if(!this._client)return he&&Oe("No client configured on scope - will not capture message!"),r;const s=n?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:s,...n,event_id:r},this),r}captureEvent(e,t){const n=e.event_id||t?.event_id||dt();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(he&&Oe("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const Qt=e=>e instanceof Promise&&!e[Bt],Bt=Symbol("chained PromiseLike");class Kt{constructor(e,t){let n,r;n=e||new Jt,r=t||new Jt,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(e){throw this._popScope(),e}return Je(n)?((e,t,n)=>{const r=e.then(e=>(t(),e),e=>{throw n(),e});return Qt(r)&&Qt(e)?r:((e,t)=>{let n=!1;for(const r in e){if(r in t)continue;n=!0;const s=e[r];"function"==typeof s?Object.defineProperty(t,r,{value:(...t)=>s.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=s}return n&&Object.assign(t,{[Bt]:!0}),t})(e,r)})(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1||!this._stack.pop())}}function Wt(){const e=ge(ye());return e.stack=e.stack||new Kt(_e("defaultCurrentScope",()=>new Jt),_e("defaultIsolationScope",()=>new Jt))}function Ht(e){return Wt().withScope(e)}function Vt(e,t){const n=Wt();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Gt(e){return Wt().withScope(()=>e(Wt().getIsolationScope()))}function Yt(e){const t=ge(e);return t.acs?t.acs:{withIsolationScope:Gt,withScope:Ht,withSetScope:Vt,withSetIsolationScope:(e,t)=>Gt(t),getCurrentScope:()=>Wt().getScope(),getIsolationScope:()=>Wt().getIsolationScope()}}let Xt;function en(){return Yt(ye()).getCurrentScope()}function tn(){return Yt(ye()).getIsolationScope()}function nn(){return en().getClient()}function rn(e){const t=void 0;const n=e.getPropagationContext(),{traceId:r,parentSpanId:s,propagationSpanId:i}=n,o={trace_id:r,span_id:i||Mt()};return s&&(o.parent_span_id=s),o}const sn=new WeakMap,on=()=>({name:"FunctionToString",setupOnce(){Xt=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=tt(this),n=sn.has(nn())&&void 0!==t?t:this;return Xt.apply(n,e)}}catch{}},setup(e){sn.set(e,!0)}}),an="sentry.profile_id",cn="sentry.exclusive_time";function un(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}}function dn(e){const t=e;return{scope:t._sentryScope,isolationScope:un(t._sentryIsolationScope)}}let ln=!1;function pn(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:yn(e).parent_span_id,i=dn(e).scope;return{parent_span_id:s,span_id:r?i?.getPropagationContext().propagationSpanId||Mt():t,trace_id:n}}function hn(e){return e&&e.length>0?e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:s})=>({span_id:e,trace_id:t,sampled:1===n,attributes:s,...r})):void 0}function fn(e){return"number"==typeof e?mn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?mn(e.getTime()):Rt()}function mn(e){return e>9999999999?e/1e3:e}function yn(e){if(function(e){return"function"==typeof e.getSpanJSON}(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(e)){const{attributes:r,startTime:s,name:i,endTime:o,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:gn(e),start_timestamp:fn(s),timestamp:fn(o)||void 0,status:vn(a),op:r["sentry.op"],origin:r["sentry.origin"],links:hn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function gn(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function vn(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"internal_error"}const bn=function(e){return e._sentryRootSpan||e};function wn(){ln||(we(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),ln=!0)}const Sn=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!kn(e,t)&&!!xn(e,t))))}(e,t)||!!function(e,t){const n=En(t),r=En(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!kn(e,t)&&!!xn(e,t)))}(e,t))}(t,e))return he&&Oe("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function xn(e,t){let n=xt(e),r=xt(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],s=n[e];if(t.filename!==s.filename||t.lineno!==s.lineno||t.colno!==s.colno||t.function!==s.function)return!1}return!0}function kn(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch{return!1}}function En(e){return e.exception?.values?.[0]}const zn="production",On=/^o(\d+)\./,$n=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function In(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${o}`}function Tn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Pn(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=function(e){const t=e.match(On);return t?.[1]}(n)),r}function An(e,t=100,n=1/0){try{return Nn("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Cn(e,t=3,n=102400){const r=An(e,t);return s=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(s))>n?Cn(e,t-1,n):r;var s}function Nn(e,t,n=1/0,r=1/0,s=function(){const e=new WeakSet;return[function(t){return!!e.has(t)||(e.add(t),!1)},function(t){e.delete(t)}]}()){const[i,o]=s;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const a=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof globalThis&&t===globalThis)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(Be(t))return kt(t);if(Le(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n)return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${St(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}var n}(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const c="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===c)return a.replace("object ","");if(i(t))return"[Circular ~]";const u=t;if(u&&"function"==typeof u.toJSON)try{return Nn("",u.toJSON(),c-1,r,s)}catch{}const d=Array.isArray(t)?[]:{};let l=0;const p=nt(t);for(const e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(l>=r){d[e]="[MaxProperties ~]";break}const t=p[e];d[e]=Nn(e,t,c-1,r,s),l++}return o(t),d}function jn(e,t=[]){return[e,t]}function Rn(e,t){const[n,r]=e;return[n,[...r,t]]}function Zn(e,t){const n=e[1];for(const e of n)if(t(e,e[0].type))return!0;return!1}function Dn(e){const t=ge(me);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function Fn(e){const[t,n]=e;let r=JSON.stringify(t);function s(e){"string"==typeof r?r="string"==typeof e?r+e:[Dn(r),e]:r.push("string"==typeof e?Dn(e):e)}for(const e of n){const[t,n]=e;if(s(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)s(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(An(n))}s(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(r)}function Mn(e){const t="string"==typeof e.data?Dn(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Un={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function Ln(e){return function(e){return e in Un}(e)?Un[e]:e}function qn(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Jn(e,t){const n=t??function(e){return Qn().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=In(r)),jn(s,[(i=e,[{type:"log",item_count:i.length,content_type:"application/vnd.sentry.items.log+json"},{items:i}])]);var i}(n,r._metadata,r.tunnel,e.getDsn());Qn().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function Qn(){return _e("clientToLogBufferMap",()=>new WeakMap)}function Bn(e,t){const n=t??function(e){return Kn().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=In(r)),jn(s,[(i=e,[{type:"trace_metric",item_count:i.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:i}])]);var i}(n,r._metadata,r.tunnel,e.getDsn());Kn().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Kn(){return _e("clientToMetricBufferMap",()=>new WeakMap)}function Wn(e){return e.split(",").map(e=>{const t=e.indexOf("=");return-1===t?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function Hn(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s={environment:n.environment||zn,release:n.release,public_key:r,trace_id:e,org_id:Pn(t)};return t.emit("createDsc",s),s}function Vn(e){const t=nn();if(!t)return{};const n=bn(e),r=yn(n),s=r.data,i=n.spanContext().traceState,o=i?.get("sentry.sample_rate")??s["sentry.sample_rate"]??s["sentry.previous_trace_sample_rate"];function a(e){return"number"!=typeof o&&"string"!=typeof o||(e.sample_rate=`${o}`),e}const c=n._frozenDsc;if(c)return a(c);const u=i?.get("sentry.dsc"),d=u&&function(e){const t=function(e){if(e&&(Fe(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{const n=Wn(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Wn(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>(t.startsWith("sentry-")&&(e[t.slice(7)]=n),e),{});return Object.keys(n).length>0?n:void 0}(u);if(d)return a(d);const l=Hn(e.spanContext().traceId,t),p=s["sentry.source"]??s["sentry.span.source"],h=r.description;return"url"!==p&&h&&(l.transaction=h),function(){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=nn()?.getOptions();return!(!e||null==e.tracesSampleRate&&!e.tracesSampler)}()&&(l.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return 1===t}(n)),l.sample_rand=i?.get("sentry.sample_rand")??dn(n).scope?.getPropagationContext().sampleRand.toString()),a(l),t.emit("createDsc",l,n),l}function Gn(e){return new Xn(t=>{t(e)})}function Yn(e){return new Xn((t,n)=>{n(e)})}class Xn{constructor(e){this._state=0,this._handlers=[],this._runExecutor(e)}then(e,t){return new Xn((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new Xn((t,n)=>{let r,s;return this.then(t=>{s=!1,r=t,e&&e()},t=>{s=!0,r=t,e&&e()}).then(()=>{s?n(r):t(r)})})}_executeHandlers(){if(0===this._state)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(1===this._state&&e[1](this._value),2===this._state&&e[2](this._value),e[0]=!0)})}_runExecutor(e){const t=(e,t)=>{0===this._state&&(Je(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(1,e)},r=e=>{t(2,e)};try{e(n,r)}catch(e){r(e)}}}function er(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}const tr=Symbol.for("SentryBufferFullError");function nr(e=100){const t=new Set;function n(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(r){if(!(t.size<e))return Yn(tr);const s=r();return t.add(s),s.then(()=>n(s),()=>n(s)),s},drain:function(e){if(!t.size)return Gn(!0);const n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;const r=[n,new Promise(t=>er(setTimeout(()=>t(!1),e)))];return Promise.race(r)}}}function rr(e,t,n=nr(e.bufferSize||64)){let r={};return{send:function(s){const i=[];if(Zn(s,(t,n)=>{const s=Ln(n);!function(e,t,n=ut()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,s)?i.push(t):e.recordDroppedEvent("ratelimit_backoff",s)}),0===i.length)return Promise.resolve({});const o=jn(s[0],i),a=t=>{!function(e,t){return Zn(e,(e,n)=>t.includes(n))}(o,["client_report"])?Zn(o,(n,r)=>{e.recordDroppedEvent(t,Ln(r))}):he&&Oe(`Dropping client report. Will not send outcomes (reason: ${t}).`)};return n.add(()=>t({body:Fn(o)}).then(e=>413===e.statusCode?(he&&$e("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),a("send_error"),e):(he&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Oe(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=ut()){const s={...e},i=n?.["x-sentry-rate-limits"],o=n?.["retry-after"];if(i)for(const e of i.trim().split(",")){const[t,n,,,i]=e.split(":",5),o=parseInt(t,10),a=1e3*(isNaN(o)?60:o);if(n)for(const e of n.split(";"))"metric_bucket"===e&&i&&!i.split(";").includes("custom")||(s[e]=r+a);else s.all=r+a}else o?s.all=r+function(e,t=ut()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(o,r):429===t&&(s.all=r+6e4);return s}(r,e),e),e=>{throw a("network_error"),he&&$e("Encountered error running transport request:",e),e})).then(e=>e,e=>{if(e===tr)return he&&$e("Skipped sending event because buffer is full."),a("queue_overflow"),Promise.resolve({});throw e})},flush:e=>n.drain(e)}}function sr(e,t,n,r=0){try{const s=ir(t,n,e,r);return Je(s)?s:Gn(s)}catch(e){return Yn(e)}}function ir(e,t,n,r){const s=n[r];if(!e||!s)return e;const i=s({...e},t);return he&&null===i&&ze(`Event processor "${s.id||"?"}" dropped event`),Je(i)?i.then(e=>ir(e,t,n,r+1)):ir(i,t,n,r+1)}let or,ar,cr,ur;function dr(e,t){const{extra:n,tags:r,attributes:s,user:i,contexts:o,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:d,eventProcessors:l,attachments:p,propagationContext:h,transactionName:f,span:m}=t;lr(e,"extra",n),lr(e,"tags",r),lr(e,"attributes",s),lr(e,"user",i),lr(e,"contexts",o),e.sdkProcessingMetadata=Dt(e.sdkProcessingMetadata,c,2),a&&(e.level=a),f&&(e.transactionName=f),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...h}}function lr(e,t,n){e[t]=Dt(e[t],n,1)}function pr(e,t){const n=_e("globalScope",()=>new Jt).getScopeData();return e&&dr(n,e.getScopeData()),t&&dr(n,t.getScopeData()),n}function hr(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||dt(),timestamp:t.timestamp||Nt()},u=n.integrations||e.integrations.map(e=>e.name);!function(e,t){const{environment:n,release:r,dist:s,maxValueLength:i}=t;e.environment=e.environment||n||zn,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s);const o=e.request;o?.url&&i&&(o.url=Et(o.url,i)),i&&e.exception?.values?.forEach(e=>{e.value&&(e.value=Et(e.value,i))})}(c,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(c,u),s&&s.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=function(e){const t=me._sentryDebugIds,n=me._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],s=n?Object.keys(n):[];if(ur&&r.length===ar&&s.length===cr)return ur;ar=r.length,cr=s.length,ur={},or||(or={});const i=(t,n)=>{for(const r of t){const t=n[r],s=or?.[r];if(s&&ur&&t)ur[s[0]]=t,or&&(or[r]=[s[0],t]);else if(t){const n=e(r);for(let e=n.length-1;e>=0;e--){const s=n[e],i=s?.filename;if(i&&ur&&or){ur[i]=t,or[r]=[i,t];break}}}}};return t&&i(r,t),n&&i(s,n),ur}(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}(c,e.stackParser);const d=function(e,t){if(!t)return e;const n=e?e.clone():new Jt;return n.update(t),n}(r,n.captureContext);n.mechanism&&ft(c,n.mechanism);const l=s?s.getEventProcessors():[],p=pr(i,d),h=[...n.attachments||[],...p.attachments];h.length&&(n.attachments=h),function(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;!function(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),o&&(e.level=o),a&&"transaction"!==e.type&&(e.transaction=a)}(e,t),r&&function(e,t){e.contexts={trace:pn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Vn(t),...e.sdkProcessingMetadata};const n=yn(bn(t)).description;n&&!e.transaction&&"transaction"===e.type&&(e.transaction=n)}(e,r),function(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,s),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,i)}(c,p);const f=[...l,...p.eventProcessors];return(n.data&&!0===n.data.__sentry__?Gn(c):sr(f,c,n)).then(e=>(e&&function(e){const t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof o&&o>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:An(e.data,t,n)}}))},...e.user&&{user:An(e.user,t,n)},...e.contexts&&{contexts:An(e.contexts,t,n)},...e.extra&&{extra:An(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=An(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:An(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=An(e.contexts.flags,3,n)),r}(e,o,a):e))}const fr=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function mr(e){ze(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function yr(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(_r(n)){if(Ot(e.description,n))return he&&mr(e),!0;continue}if(!n.name&&!n.op)continue;const t=!n.name||Ot(e.description,n.name),r=!n.op||e.op&&Ot(e.op,n.op);if(t&&r)return he&&mr(e),!0}return!1}function gr(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function _r(e){return"string"==typeof e||e instanceof RegExp}const vr="Not capturing exception because it's already been captured.",br="Discarded session because of missing or non-string release",wr=Symbol.for("SentryInternalError"),Sr=Symbol.for("SentryDoNotSendEventError");function xr(e){return{message:e,[wr]:!0}}function kr(e){return{message:e,[Sr]:!0}}function Er(e){return!!e&&"object"==typeof e&&wr in e}function zr(e){return!!e&&"object"==typeof e&&Sr in e}function Or(e,t,n,r,s){let i,o=0,a=!1;e.on(n,()=>{o=0,clearTimeout(i),a=!1}),e.on(t,t=>{o+=r(t),o>=8e5?s(e):a||(a=!0,i=er(setTimeout(()=>{s(e)},5e3)))}),e.on("flush",()=>{s(e)})}class $r{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=nr(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=$n.exec(e);if(!t)return void we(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});const[n,r,s="",i="",o="",a=""]=t.slice(1);let c="",u=a;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return Tn({host:i,pass:s,path:c,projectId:u,port:o,protocol:n,publicKey:r})}(e):Tn(e);if(t&&function(e){if(!he)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&($e(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&($e(`Invalid Sentry Dsn: Invalid port ${t}`),1):($e(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):($e(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):he&&Oe("No DSN provided, client will not send events."),this._dsn){const s=(t=this._dsn,n=e.tunnel,r=e._metadata?e._metadata.sdk:void 0,n||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(t)}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(t,r)}`);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:s})}var t,n,r;this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Or(this,"afterCaptureLog","flushLogs",Cr,Jn),(this._options.enableMetrics??this._options._experiments?.enableMetrics??1)&&Or(this,"afterCaptureMetric","flushMetrics",Ar,Bn)}captureException(e,t,n){const r=dt();if(mt(e))return he&&ze(vr),r;const s={event_id:r,...t};return this._process(()=>this.eventFromException(e,s).then(e=>this._captureEvent(e,s,n)).then(e=>e),"error"),s.event_id}captureMessage(e,t,n,r){const s={event_id:dt(),...n},i=Me(e)?e:String(e),o=Ue(e),a=o?this.eventFromMessage(i,t,s):this.eventFromException(e,s);return this._process(()=>a.then(e=>this._captureEvent(e,s,r)),o?"unknown":"error"),s.event_id}captureEvent(e,t,n){const r=dt();if(t?.originalException&&mt(t.originalException))return he&&ze(vr),r;const s={event_id:r,...t},i=e.sdkProcessingMetadata||{},o=i.capturedSpanScope,a=i.capturedSpanIsolationScope,c=Ir(e.type);return this._process(()=>this._captureEvent(e,s,o||n,a),c),s.event_id}captureSession(e){this.sendSession(e),Zt(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(!t)return!0;this.emit("flush");const n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){Jn(this);const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),Ae(this,e,this._integrations),t||Pe(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){const s=qn(n),i=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){if(!t)return e;const n=e.sdk||{};e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0}}(e,n?.sdk);const o=function(e,t,n,r){const s=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:In(r)},...s&&{trace:s}}}(e,s,r,t);return delete e.sdkProcessingMetadata,jn(o,[[{type:i},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Rn(n,Mn(e));this.sendEnvelope(n).then(t=>this.emit("afterSendEvent",e,t))}sendSession(e){const{release:t,environment:n=zn}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(he&&Oe(br));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(he&&Oe(br));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=function(e,t,n,r){const s=qn(n);return jn({sent_at:(new Date).toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:In(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){const r=`${e}:${t}`;he&&ze(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return he&&$e("Error while sending envelope:",e),{}}return he&&$e("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&Ae(e,t,n)}),n}(this,e),Pe(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const s=t.exception?.values;if(s){r=!0,n=!1;for(const e of s)if(!1===e.mechanism?.handled){n=!0;break}}const i="ok"===e.status;(i&&0===e.errors||i&&n)&&(Zt(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const s=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i?.length&&(t.integrations=i),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),hr(s,e,t,n,this,r).then(e=>{if(null===e)return e;this.emit("postprocessEvent",e,t),e.contexts={trace:{...e.contexts?.trace,...rn(n)},...e.contexts};const r=function(e,t){const n=t.getPropagationContext();return n.dsc||Hn(n.traceId,e)}(this,n);return e.sdkProcessingMetadata={dynamicSamplingContext:r,...e.sdkProcessingMetadata},e})}_captureEvent(e,t={},n=en(),r=tn()){return he&&Tr(e)&&ze(`Captured error event \`${Ce(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{he&&(zr(e)?ze(e.message):Er(e)?Oe(e.message):Oe(e))})}_processEvent(e,t,n,r){const s=this.getOptions(),{sampleRate:i}=s,o=Pr(e),a=Tr(e),c=`before send for type \`${e.type||"error"}\``,u=void 0===i?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}(i);if(a&&"number"==typeof u&&ct()>u)return this.recordDroppedEvent("sample_rate","error"),Yn(kr(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const d=Ir(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(null===e)throw this.recordDroppedEvent("event_processor",d),kr("An event processor returned `null`, will not send event.");if(!0===t.data?.__sentry__)return e;const n=function(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,ignoreSpans:o}=t,a=!((c=t.beforeSendSpan)&&"function"==typeof c&&"_streamed"in c&&c._streamed)&&t.beforeSendSpan;var c;let u=n;if(Tr(u)&&s)return s(u,r);if(Pr(u)){if(a||o){const t=function(e){const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:a}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o?.[an],exclusive_time:o?.[cn],measurements:e.measurements,is_segment:!0}}(u);if(o?.length&&yr(t,o))return null;if(a){const e=a(t);e?u=Dt(n,{type:"transaction",timestamp:(d=e).timestamp,start_timestamp:d.start_timestamp,transaction:d.description,contexts:{trace:{trace_id:d.trace_id,span_id:d.span_id,parent_span_id:d.parent_span_id,op:d.op,status:d.status,origin:d.origin,data:{...d.data,...d.profile_id&&{[an]:d.profile_id},...d.exclusive_time&&{[cn]:d.exclusive_time}}}},measurements:d.measurements}):wn()}if(u.spans){const t=[],n=u.spans;for(const e of n)if(o?.length&&yr(e,o))gr(n,e);else if(a){const n=a(e);n?t.push(n):(wn(),t.push(e))}else t.push(e);const r=u.spans.length-t.length;r&&e.recordDroppedEvent("before_send","span",r),u.spans=t}}if(i){if(u.spans){const e=u.spans.length;u.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return i(u,r)}}var d;return u}(this,s,e,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Je(e))return e.then(e=>{if(!Le(e)&&null!==e)throw xr(n);return e},e=>{throw xr(`${t} rejected with ${e}`)});if(!Le(e)&&null!==e)throw xr(n);return e}(n,c)}).then(s=>{if(null===s){if(this.recordDroppedEvent("before_send",d),o){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw kr(`${c} returned \`null\`, will not send event.`)}const i=n.getSession()||r.getSession();if(a&&i&&this._updateSessionFromEvent(i,s),o){const e=(s.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(s.spans?s.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const u=s.transaction_info;if(o&&u&&s.transaction!==e.transaction){const e="custom";s.transaction_info={...u,source:e}}return this.sendEvent(s,t),s}).then(null,e=>{if(zr(e)||Er(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),xr(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===tr&&this.recordDroppedEvent("queue_overflow",t),e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){he&&ze("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(he&&ze("No outcomes to send"));if(!this._dsn)return void(he&&ze("No dsn provided, will not send outcomes"));he&&ze("Sending outcomes:",e);const t=(n=e,jn((r=this._options.tunnel&&In(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:Nt(),discarded_events:n}]]));var n,r;this.sendEnvelope(t)}}function Ir(e){return"replay_event"===e?"replay":e||"error"}function Tr(e){return void 0===e.type}function Pr(e){return"transaction"===e.type}function Ar(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+Nr(e.attributes)}function Cr(e){let t=0;return e.message&&(t+=2*e.message.length),t+Nr(e.attributes)}function Nr(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*jr(e[0]):Ue(e)?t+=jr(e):t+=100}),t}function jr(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}function Rr(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}function Zr(e){return function(e){return je(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function Dr(e,t){const n=Mr(e,t),r={type:qr(t),value:Jr(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Fr(e,t){return{exception:{values:[Dr(e,t)]}}}function Mr(e,t){const n=t.stacktrace||t.stack||"",r=function(e){return e&&Ur.test(e.message)?1:0}(t),s=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);try{return e(n,r,s)}catch{}return[]}const Ur=/Minified React error #\d+;/i;function Lr(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function qr(e){const t=e?.name;return!t&&Lr(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Jr(e){const t=e?.message;return Lr(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?Zr(t.error):Zr(e):"No error message"}function Qr(e,t,n,r,s){let i;if(Ze(t)&&t.error)return Fr(e,t.error);if(De(t)||Re(t,"DOMException")){const s=t;if("stack"in t)i=Fr(e,t);else{const t=s.name||(De(s)?"DOMError":"DOMException"),o=s.message?`${t}: ${s.message}`:t;i=Br(e,o,n,r),ht(i,o)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return je(t)?Fr(e,t):Le(t)||qe(t)?(i=function(e,t,n,r){const s=nn(),i=s?.getOptions().normalizeDepth,o=(a=t,Object.values(a).find(e=>e instanceof Error));var a;const c={__serialized__:Cn(t,i)};if(o)return{exception:{values:[Dr(e,o)]},extra:c};const u={exception:{values:[{type:qe(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Kr(t,{isUnhandledRejection:r})}]},extra:c};if(n){const t=Mr(e,n);t.length&&(u.exception.values[0].stacktrace={frames:t})}return u}(e,t,n,s),ft(i,{synthetic:!0}),i):(i=Br(e,t,n,r),ht(i,`${t}`,void 0),ft(i,{synthetic:!0}),i)}function Br(e,t,n,r){const s={};if(r&&n){const r=Mr(e,n);r.length&&(s.exception={values:[{value:t,stacktrace:{frames:r}}]}),ft(s,{synthetic:!0})}if(Me(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return s.logentry={message:e,params:n},s}return s.message=t,s}function Kr(e,{isUnhandledRejection:t}){const n=function(e){const t=Object.keys(nt(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}(e),r=t?"promise rejection":"exception";return Ze(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:qe(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Wr(e,t){return en().captureEvent(e,t)}function Hr(e){const t=tn(),{user:n}=pr(t,en()),{userAgent:r}=me.navigator||{},s=function(e){const t=Rt(),n={sid:dt(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return{sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}(n)};return e&&Zt(n,e),n}({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return"ok"===i?.status&&Zt(i,{status:"exited"}),Vr(),t.setSession(s),s}function Vr(){const e=tn(),t=en().getSession()||e.getSession();t&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),Zt(e,t)}(t),Gr(),e.setSession()}function Gr(){const e=tn(),t=nn(),n=e.getSession();n&&t&&t.captureSession(n)}function Yr(e=!1){e?Vr():Gr()}const Xr=me;let es=0;function ts(){return es>0}function ns(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(tt(e))return e}catch{return e}const n=function(...n){try{const r=n.map(e=>ns(e,t));return e.apply(this,r)}catch(e){throw es++,setTimeout(()=>{es--}),function(...e){const t=Yt(ye());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}(r=>{var s;r.addEventProcessor(e=>(t.mechanism&&(ht(e,void 0,void 0),ft(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),s=e,en().captureException(s,function(e){if(e)return function(e){return e instanceof Jt||"function"==typeof e}(e)||function(e){return Object.keys(e).some(e=>fr.includes(e))}(e)?{captureContext:e}:e}(void 0))}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}et(n,e),Xe(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}class rs extends $r{constructor(e){const t=(n=e,{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:Xr.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...n});var n;!function(e,t,n=[t],r="npm"){const s=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${t}`,s.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:fe})),s.version=fe)}(t,"browser",["browser"],Xr.SENTRY_SDK_SOURCE||"npm"),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?"auto":"never",...t._metadata.sdk.settings}),super(t);const{sendDefaultPii:r,sendClientReports:s,enableLogs:i,_experiments:o,enableMetrics:a}=this._options,c=a??o?.enableMetrics??!0;Xr.document&&(s||i||c)&&Xr.document.addEventListener("visibilitychange",()=>{"hidden"===Xr.document.visibilityState&&(s&&this._flushOutcomes(),i&&Jn(this),c&&Bn(this))}),r&&this.on("beforeSendSession",Rr)}eventFromException(e,t){return function(e,t,n,r){const s=Qr(e,t,n?.syntheticException||void 0,r);return ft(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),Gn(s)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,s){const i=Br(e,t,r?.syntheticException||void 0,s);return i.level=n,r?.event_id&&(i.event_id=r.event_id),Gn(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}}const ss={},is={};function os(e,t){ss[e]=ss[e]||[],ss[e].push(t)}function as(e,t){if(!is[e]){is[e]=!0;try{t()}catch(t){he&&$e(`Error while instrumenting ${e}`,t)}}}function cs(e,t){const n=e&&ss[e];if(n)for(const r of n)try{r(t)}catch(t){he&&$e(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${St(r)}\nError:`,t)}}function us(){"console"in me&&ve.forEach(function(e){e in me.console&&Ye(me.console,e,function(t){return be[e]=t,function(...t){cs("console",{args:t,level:e});const n=be[e];n?.apply(me.console,t)}})})}const ds=me;function ls(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function ps(e,t=!1){t&&!function(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in ds))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}())return!1;if(ls(ds.fetch))return!0;let e=!1;const t=ds.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=ls(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){he&&Oe("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}()||Ye(me,"fetch",function(t){return function(...n){const r=new Error,{method:s,url:i}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:fs(t),method:hs(n,"method")?String(n.method).toUpperCase():Ke(t)&&hs(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:fs(t),method:hs(t,"method")?String(t.method).toUpperCase():"GET"}}(n),o={args:n,fetchData:{method:s,url:i},startTimestamp:1e3*Rt(),virtualError:r,headers:ms(n)};return e||cs("fetch",{...o}),t.apply(me,n).then(async t=>(e?e(t):cs("fetch",{...o,endTimestamp:1e3*Rt(),response:t}),t),e=>{cs("fetch",{...o,endTimestamp:1e3*Rt(),error:e}),je(e)&&void 0===e.stack&&(e.stack=r.stack,Xe(e,"framesToPop",1));const t=nn(),n=t?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==n&&e instanceof TypeError&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const t=new URL(o.fetchData.url).host;"always"===n?e.message=`${e.message} (${t})`:Xe(e,"__sentry_fetch_url_host__",t)}catch{}throw e})}})}function hs(e,t){return!!e&&"object"==typeof e&&!!e[t]}function fs(e){return"string"==typeof e?e:e?hs(e,"url")?e.url:e.toString?e.toString():"":""}function ms(e){const[t,n]=e;try{if("object"==typeof n&&null!==n&&"headers"in n&&n.headers)return new Headers(n.headers);if(Ke(t))return new Headers(t.headers)}catch{}}const ys=100;function gs(e,t){const n=nn(),r=tn();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=ys}=n.getOptions();if(i<=0)return;const o={timestamp:Nt(),...e},a=s?we(()=>s(o,t)):o;null!==a&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}function _s(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}function vs(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const bs=me;let ws,Ss,xs;function ks(){if(!bs.document)return;const e=cs.bind(null,"dom"),t=Es(e,!0);bs.document.addEventListener("click",t,!1),bs.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=bs,r=n[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Ye(r,"addEventListener",function(t){return function(n,r,s){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},i=r[n]=r[n]||{refCount:0};if(!i.handler){const r=Es(e);i.handler=r,t.call(this,n,r,s)}i.refCount++}catch{}return t.call(this,n,r,s)}}),Ye(r,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},s=n[t];s&&(s.refCount--,s.refCount<=0&&(e.call(this,t,s.handler,r),s.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function Es(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;Xe(n,"_sentryCaptured",!0),r&&!r._sentryId&&Xe(r,"_sentryId",dt());const s="keypress"===n.type?"input":n.type;(function(e){if(e.type!==Ss)return!1;try{if(!e.target||e.target._sentryId!==xs)return!1}catch{}return!0})(n)||(e({event:n,name:s,global:t}),Ss=n.type,xs=r?r._sentryId:void 0),clearTimeout(ws),ws=bs.setTimeout(()=>{xs=void 0,Ss=void 0},1e3)}}const zs="__sentry_xhr_v3__";function Os(){if(!bs.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,s=1e3*Rt(),i=Fe(n[0])?n[0].toUpperCase():void 0,o=function(e){if(Fe(e))return e;try{return e.toString()}catch{}}(n[1]);if(!i||!o)return e.apply(t,n);t[zs]={method:i,url:o,request_headers:{}},"POST"===i&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const a=()=>{const e=t[zs];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}cs("xhr",{endTimestamp:1e3*Rt(),startTimestamp:s,xhr:t,virtualError:r})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(a(),e.apply(t,n))}):t.addEventListener("readystatechange",a),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,s]=n,i=t[zs];return i&&Fe(r)&&Fe(s)&&(i.request_headers[r.toLowerCase()]=s),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[zs];return r?(void 0!==n[0]&&(r.body=n[0]),cs("xhr",{startTimestamp:1e3*Rt(),xhr:t}),e.apply(t,n)):e.apply(t,n)}})}let $s;function Is(e){const t="history";os(t,e),as(t,Ts)}function Ts(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=$s,s=function(e){try{return new URL(e,bs.location.origin).toString()}catch{return e}}(String(n));if($s=s,r===s)return e.apply(this,t);cs("history",{from:r,to:s})}return e.apply(this,t)}}bs.addEventListener("popstate",()=>{const e=bs.location.href,t=$s;$s=e,t!==e&&cs("history",{from:t,to:e})}),"history"in ds&&ds.history&&(Ye(bs.history,"pushState",e),Ye(bs.history,"replaceState",e))}const Ps="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,As=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console";os(t,e),as(t,us)}(function(e){return function(t){if(nn()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:(r=t.level,"warn"===r?"warning":["fatal","error","warning","log","info","debug"].includes(r)?r:"log"),message:zt(t.args," ")};var r;if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${zt(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}gs(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(nn()!==e)return;let r,s,i="object"==typeof t?t.serializeAttribute:void 0,o="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;o&&o>1024&&(Ps&&Oe(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=1024),"string"==typeof i&&(i=[i]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=He(t,{keyAttrs:i,maxStringLength:o}),s=function(e,t=5){if(!We.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}(t)}catch{r="<unknown>"}if(0===r.length)return;const a={category:`ui.${n.name}`,message:r};s&&(a.data={"ui.component_name":s}),gs(a,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),os("dom",n),as("dom",ks)),t.xhr&&function(e){os("xhr",e),as("xhr",Os)}(function(e){return function(t){if(nn()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,s=t.xhr[zs];if(!n||!r||!s)return;const{method:i,url:o,status_code:a,body:c}=s,u={method:i,url:o,status_code:a},d={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},l={category:"xhr",data:u,type:"http",level:_s(a)};e.emit("beforeOutgoingRequestBreadcrumb",l,d),gs(l,d)}}(e)),t.fetch&&function(e){const t="fetch";os(t,e),as(t,()=>ps(void 0,void 0))}(function(e){return function(t){if(nn()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const s={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},i={category:"fetch",data:t.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),gs(i,s)}else{const s=t.response,i={...t.fetchData,status_code:s?.status},o={input:t.args,response:s,startTimestamp:n,endTimestamp:r},a={category:"fetch",data:i,type:"http",level:_s(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,o),gs(a,o)}}}(e)),t.history&&Is(function(e){return function(t){if(nn()!==e)return;let n=t.from,r=t.to;const s=vs(Xr.location.href);let i=n?vs(n):void 0;const o=vs(r);i?.path||(i=s),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),s.protocol===i.protocol&&s.host===i.host&&(n=i.relative),gs({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){nn()===e&&gs({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:pt(t)},{event:t})}}(e))}}},Cs="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),Ns=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&Ye(Xr,"setTimeout",js),t.setInterval&&Ye(Xr,"setInterval",js),t.requestAnimationFrame&&Ye(Xr,"requestAnimationFrame",Rs),t.XMLHttpRequest&&"XMLHttpRequest"in Xr&&Ye(XMLHttpRequest.prototype,"send",Zs);const e=t.eventTarget;e&&(Array.isArray(e)?e:Cs).forEach(e=>function(e,t){const n=Xr,r=n[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Ye(r,"addEventListener",function(n){return function(r,s,i){try{"function"==typeof s.handleEvent&&(s.handleEvent=ns(s.handleEvent,{mechanism:{data:{handler:St(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&function(e,t,n){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,n)}(this,r,s),n.apply(this,[r,ns(s,{mechanism:{data:{handler:St(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),i])}}),Ye(r,"removeEventListener",function(e){return function(t,n,r){try{const s=n.__sentry_wrapped__;s&&e.call(this,t,s,r)}catch{}return e.call(this,t,n,r)}}))}(e,t))}}};function js(e){return function(...t){const n=t[0];return t[0]=ns(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${St(e)}`}}),e.apply(this,t)}}function Rs(e){return function(t){return e.apply(this,[ns(t,{mechanism:{data:{handler:St(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Zs(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Ye(n,e,function(t){const n={mechanism:{data:{handler:St(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=tt(t);return r&&(n.mechanism.data.handler=St(r)),ns(t,n)})}),e.apply(this,t)}}const Ds=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===Xr.document)return void(Ps&&Oe("Using the `browserSessionIntegration` in non-browser environments is not supported."));Hr({ignoreDuration:!0}),Yr();const e=tn();let n=e.getUser();e.addScopeListener(e=>{const t=e.getUser();n?.id===t?.id&&n?.ip_address===t?.ip_address||(Yr(),n=t)}),"route"===t&&Is(({from:e,to:t})=>{e!==t&&(Hr({ignoreDuration:!0}),Yr())})}}};function Fs(){try{const e=Xr.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}let Ms=null;function Us(){Ms=me.onerror,me.onerror=function(e,t,n,r,s){return cs("error",{column:r,error:s,line:n,msg:e,url:t}),!!Ms&&Ms.apply(this,arguments)},me.onerror.__SENTRY_INSTRUMENTED__=!0}let Ls=null;function qs(){Ls=me.onunhandledrejection,me.onunhandledrejection=function(e){return cs("unhandledrejection",e),!Ls||Ls.apply(this,arguments)},me.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Js=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(){const t="error";os(t,t=>{const{stackParser:n,attachStacktrace:r}=Bs();if(nn()!==e||ts())return;const{msg:s,url:i,line:o,column:a,error:c}=t,u=function(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[];return 0===c.length&&c.push({colno:r,lineno:n,filename:Ks(t)??Ge(),function:yt,in_app:!0}),e}(Qr(n,c||s,void 0,r,!1),i,o,a);u.level="error",Wr(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})}),as(t,Us)}()}(e),Qs("onerror")),t.onunhandledrejection&&(function(e){!function(){const t="unhandledrejection";os(t,t=>{const{stackParser:n,attachStacktrace:r}=Bs();if(nn()!==e||ts())return;const s=function(e){if(Ue(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t),i=Ue(s)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`}]}}:Qr(n,s,void 0,r,!0);i.level="error",Wr(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})}),as(t,qs)}()}(e),Qs("onunhandledrejection"))}}};function Qs(e){Ps&&ze(`Global Handler attached: ${e}`)}function Bs(){const e=nn();return e?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Ks(e){if(Fe(e)&&0!==e.length)return e.startsWith("data:")?`<${function(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=e.includes(";base64,"),i=e.indexOf(",");let o="";if(t&&-1!==i){const t=e.slice(i+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${s?",base64":""}${o?`,${o}`:""}`}return e}(e,!1)}>`:e}function Ws(e,t,n,r,s,i){if(!s.exception?.values||!i||!Qe(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=Hs(e,t,r,i.originalException,n,s.exception.values,o,0))}function Hs(e,t,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if(Qe(r[s],Error)){Gs(o,a,r);const i=e(t,r[s]),u=c.length;Ys(i,s,u,a),c=Hs(e,t,n,r[s],s,[i,...c],i,u)}return Vs(r)&&r.errors.forEach((i,u)=>{if(Qe(i,Error)){Gs(o,a,r);const d=e(t,i),l=c.length;Ys(d,`errors[${u}]`,l,a),c=Hs(e,t,n,i,s,[d,...c],d,l)}}),c}function Vs(e){return Array.isArray(e.errors)}function Gs(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Vs(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ys(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}const Xs=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,s){Ws(Dr,s.getOptions().stackParser,n,t,e,r)}}};function ei(e,t,n,r){const s={filename:e,function:"<anonymous>"===t?yt:t,in_app:!0};return void 0!==n&&(s.lineno=n),void 0!==r&&(s.colno=r),s}const ti=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ni=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ri=/\((\S*)(?::(\d+))(?::(\d+))\)/,si=/at (.+?) ?\(data:(.+?),/,ii=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,oi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ai=vt([30,e=>{const t=e.match(si);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=ti.exec(e);if(n){const[,e,t,r]=n;return ei(e,yt,+t,+r)}const r=ni.exec(e);if(r){if(0===r[2]?.indexOf("eval")){const e=ri.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}const[e,t]=ci(r[1]||yt,r[2]);return ei(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],[50,e=>{const t=ii.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=oi.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||yt;return[n,e]=ci(n,e),ei(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),ci=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:yt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},ui="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,di={};function li(e,t=function(e){const t=di[e];if(t)return t;let n=bs[e];if(ls(n))return di[e]=n.bind(bs);const r=bs.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const s=t.contentWindow;s?.[e]&&(n=s[e]),r.head.removeChild(t)}catch(t){ui&&Oe(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n?di[e]=n.bind(bs):n}("fetch")){let n=0,r=0;return rr(e,async function(s){const i=s.body.length;n+=i,r++;const o={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")}}}catch(e){throw di.fetch=void 0,e}finally{n-=i,r--}},nr(e.bufferSize||40))}function pi(e,t,n){try{const r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],s={};for(const t of Object.keys(e)){if(-1!==r.indexOf(t))continue;const i=e[t];s[t]=je(i)||"string"==typeof i?n?Et(`${i}`,n):`${i}`:i}if(t&&void 0!==e.cause)if(je(e.cause)){const t=e.cause.name||e.cause.constructor.name;s.cause={[t]:pi(e.cause,!1,n)}}else s.cause=e.cause;if("function"==typeof e.toJSON){const t=e.toJSON();for(const e of Object.keys(t)){const n=t[e];s[e]=je(n)?n.toString():n}}return s}catch(e){he&&$e("Unable to extract extra data from the Error object:",e)}return null}const hi="string"==typeof window.JAAK_VERSION&&window.JAAK_VERSION.length>0?window.JAAK_VERSION:null;!function(e={}){const t=!e.skipBrowserExtensionCheck&&!!function(){if(void 0===Xr.window)return!1;const e=Xr;if(e.nw)return!1;const t=e.chrome||e.browser;if(!t?.runtime?.id)return!1;const n=Ge();return!(Xr===Xr.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}()&&(Ps&&we(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0);let n=null==e.defaultIntegrations?[Pt(),on(),{name:"ConversationId",setup(e){e.on("spanStart",e=>{const t=en().getScopeData(),n=tn().getScopeData(),r=t.conversationId||n.conversationId;if(r){const{op:t,data:n,description:s}=yn(e);if(!t?.startsWith("gen_ai.")&&!n["ai.operationId"]&&!s?.startsWith("ai."))return;e.setAttribute("gen_ai.conversation.id",r)}})}},Ns(),As(),Js(),Xs(),Sn(),{name:"HttpContext",preprocessEvent(e){if(!Xr.navigator&&!Xr.location&&!Xr.document)return;const t=function(){const e=Ge(),{referrer:t}=Xr.document||{},{userAgent:n}=Xr.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}},{name:"CultureContext",preprocessEvent(e){const t=Fs();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=Fs();t&&(e.attributes={"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar,...e.attributes})}},Ds()]:e.defaultIntegrations;const r={...e,enabled:!t&&e.enabled,stackParser:(s=e.stackParser||ai,Array.isArray(s)?vt(...s):s),integrations:Te({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||li};var s;!function(e,t){!0===t.debug&&(he?Ee():we(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),en().update(t.initialScope);const n=new e(t);(function(e){en().setClient(e)})(n),n.init()}(rs,r)}({dsn:"https://bd3b645ba0f80fff939178d86353467c@o4507568947200000.ingest.de.sentry.io/4511292185641040",environment:window.JAAK_SENTRY_ENV,release:null===hi?void 0:`jaak-for-woocommerce@${hi}`,tracesSampleRate:0,sendDefaultPii:!0,normalizeDepth:10,normalizeMaxBreadth:5e3,integrations:[((e={})=>{const{depth:t=3,captureErrorCause:n=!0}=e;return{name:"ExtraErrorData",processEvent(e,r,s){const{maxValueLength:i}=s.getOptions();return function(e,t={},n,r,s){if(!t.originalException||!je(t.originalException))return e;const i=t.originalException.name||t.originalException.constructor.name,o=pi(t.originalException,r,s);if(o){const t={...e.contexts},r=An(o,n);return Le(r)&&(Xe(r,"__sentry_skip_normalization__",!0),t[i]=r),{...e,contexts:t}}return e}(e,r,t,n,i)}}})()],initialScope:{...window.JAAK_WP_USER?{user:window.JAAK_WP_USER}:{},tags:{wp_site_url:window.WORDPRESS_SITE_URL,wp_site_url_hostname:function(e){if("string"!=typeof e||0===e.length)return null;try{return new URL(e).hostname}catch{return null}}(window.WORDPRESS_SITE_URL),jaak_version:hi,wp_version:"string"==typeof window.JAAK_WP_VERSION?window.JAAK_WP_VERSION:null,wc_version:"string"==typeof window.JAAK_WC_VERSION?window.JAAK_WC_VERSION:null,php_version:"string"==typeof window.JAAK_PHP_VERSION?window.JAAK_PHP_VERSION:null}}});var fi=(e,t,n)=>((e,t,n={})=>{let r=`${e}=${t}`;if(e.startsWith("__Secure-")&&!n.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(e.startsWith("__Host-")){if(!n.secure)throw new Error("__Host- Cookie must have Secure attributes");if("/"!==n.path)throw new Error('__Host- Cookie must have Path attributes with "/"');if(n.domain)throw new Error("__Host- Cookie must not have Domain attributes")}for(const e of["domain","path"])if(n[e]&&/[;\r\n]/.test(n[e]))throw new Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&"number"==typeof n.maxAge&&n.maxAge>=0){if(n.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+="; Max-Age="+(0|n.maxAge)}if(n.domain&&"host"!==n.prefix&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r})(e,t=encodeURIComponent(t),n);Error;var mi=(e,t)=>{for(const[n,r]of Object.entries(t)){const t=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(t,r?`/${r}`:"")}return e},yi=e=>{const t=new URLSearchParams;for(const[n,r]of Object.entries(e))if(void 0!==r)if(Array.isArray(r))for(const e of r)t.append(n,e);else t.set(n,r);return t},gi=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,"/"):e.replace(/\/index(?=\?|$)/,"");function _i(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function vi(e,t){if(!_i(e)&&!_i(t))return t;const n={...e};for(const e in t){const r=t[e];_i(n[e])&&_i(r)?n[e]=vi(n[e],r):n[e]=r}return n}var bi=(e,t)=>new Proxy(()=>{},{get(n,r){if("string"==typeof r&&"then"!==r)return bi(e,[...t,r])},apply:(n,r,s)=>e({path:t,args:s})}),wi=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){const t=new FormData;for(const[n,r]of Object.entries(e.form))if(void 0!==r)if(Array.isArray(r))for(const e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType="application/json"),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase();const r={...e?.header,..."function"==typeof t?.headers?await t.headers():t?.headers};if(e?.cookie){const t=[];for(const[n,r]of Object.entries(e.cookie))t.push(fi(n,r,{path:"/"}));r.Cookie=t.join(",")}this.cType&&(r["Content-Type"]=this.cType);const s=new Headers(r??void 0);let i=this.url;i=gi(i),i=mi(i,this.pathParams),this.queryParams&&(i=i+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const o=!("GET"===n||"HEAD"===n);return(t?.fetch||fetch)(i,{body:o?this.rBody:void 0,method:n,headers:s,...t?.init})}},Si=(e,t)=>bi(function n(r){const s=t?.buildSearchParams??yi,i=[...r.path],o=i.slice(-3).reverse();if("toString"===o[0])return"name"===o[1]?o[2]||"":n.toString();if("valueOf"===o[0])return"name"===o[1]?o[2]||"":n;let a="";if(/^\$/.test(o[0])){const e=i.pop();e&&(a=e.replace(/^\$/,""))}const c=i.join("/"),u=((e,t)=>(e=e.replace(/\/+$/,""),(e+="/")+t.replace(/^\/+/,"")))(e,c);if("url"===a||"path"===a){let t=u;return r.args[0]&&(r.args[0].param&&(t=mi(u,r.args[0].param)),r.args[0].query&&(t=t+"?"+s(r.args[0].query).toString())),t=gi(t),"url"===a?new URL(t):t.slice(e.replace(/\/+$/,"").length).replace(/^\/?/,"/")}if("ws"===a){const e=(r.args[0]&&r.args[0].param?mi(u,r.args[0].param):u).replace(/^http/,"ws"),n=new URL(e),s=r.args[0]?.query;return s&&Object.entries(s).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>void 0!==t?.webSocket&&"function"==typeof t.webSocket?t.webSocket(...e):new WebSocket(...e))(n.toString())}const d=new wi(u,a,{buildSearchParams:s});if(a){t??={};const e=vi(t,{...r.args[1]});return d.fetch(r.args[0],e)}return d},[]);function xi(e,t){if(!e)throw new Error(t)}class ki extends Error{#K=Symbol("GeneralException");constructor({type:e,title:t="Error",detail:n,context:r}){super(e),this.name="GeneralException",this.type=e,this.title=t,this.detail=n,this.context=r}}function Ei(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const s=o.prototype,i=Object.keys(s);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=s[t].bind(n))}}const s=n?.Parent??Object;class i extends s{}function o(e){var t;const s=n?.Parent?new i:this;r(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}Object.freeze({status:"aborted"}),Symbol("zod_brand");class zi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Oi extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const $i={};function Ii(e){return e&&Object.assign($i,e),$i}function Ti(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function Pi(e,t="|"){return e.map(e=>Gi(e)).join(t)}function Ai(e,t){return"bigint"==typeof t?t.toString():t}function Ci(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ni(e){return null==e}function ji(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ri=Symbol("evaluating");function Zi(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ri)return void 0===r&&(r=Ri,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Di(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Fi(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Mi(e){return JSON.stringify(e)}const Ui="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Li(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const qi=Ci(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ji(e){if(!1===Li(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==Li(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Qi(e){return Ji(e)?{...e}:Array.isArray(e)?[...e]:e}const Bi=new Set(["string","number","symbol"]),Ki=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Wi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hi(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Vi(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function Gi(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}const Yi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Xi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function eo(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function to(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function no(e){return"string"==typeof e?e:e?.message}function ro(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=no(e.inst?._zod.def?.error?.(e))??no(t?.error?.(e))??no(n.customError?.(e))??no(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function so(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function io(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function oo(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const ao=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ai,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},co=Ei("$ZodError",ao),uo=Ei("$ZodError",ao,{Parent:Error}),lo=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new zi;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ro(e,i,Ii())));throw Ui(t,s?.callee),t}return o.value},po=lo(uo),ho=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ro(e,i,Ii())));throw Ui(t,s?.callee),t}return o.value},fo=ho(uo),mo=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new zi;return i.issues.length?{success:!1,error:new(e??co)(i.issues.map(e=>ro(e,s,Ii())))}:{success:!0,data:i.value}},yo=mo(uo),go=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>ro(e,s,Ii())))}:{success:!0,data:i.value}},_o=go(uo),vo=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lo(e)(t,n,s)},bo=e=>(t,n,r)=>lo(e)(t,n,r),wo=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ho(e)(t,n,s)},So=e=>async(t,n,r)=>ho(e)(t,n,r),xo=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return mo(e)(t,n,s)},ko=e=>(t,n,r)=>mo(e)(t,n,r),Eo=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return go(e)(t,n,s)},zo=e=>async(t,n,r)=>go(e)(t,n,r),Oo=/^[cC][^\s-]{8,}$/,$o=/^[0-9a-z]+$/,Io=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,To=/^[0-9a-vA-V]{20}$/,Po=/^[A-Za-z0-9]{27}$/,Ao=/^[a-zA-Z0-9_-]{21}$/,Co=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,No=/^[-+]?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)?)??$/,jo=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ro=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Zo=Ro(4),Do=Ro(6),Fo=Ro(7),Mo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Uo=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Lo=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qo=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Jo=qo,Qo=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Bo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ko(){return new RegExp(Bo,"u")}const Wo=/^(?:(?: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])$/,Ho=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Vo=e=>{const t=Wi(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Go=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ea=/^[A-Za-z0-9_-]*$/,ta=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,na=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ra=/^\+[1-9]\d{6,14}$/,sa="(?:(?:\\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])))",ia=new RegExp(`^${sa}$`);function oa(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function aa(e){return new RegExp(`^${oa(e)}$`)}function ca(e){const t=oa({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${sa}T(?:${r})$`)}const ua=e=>new RegExp(`^${e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*"}$`),da=/^-?\d+n?$/,la=/^-?\d+$/,pa=/^-?\d+(?:\.\d+)?$/,ha=/^(?:true|false)$/i,fa=/^null$/i,ma=/^undefined$/i,ya=/^[^A-Z]*$/,ga=/^[^a-z]*$/,_a=/^[0-9a-fA-F]*$/;function va(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ba(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const wa=/^[0-9a-fA-F]{32}$/,Sa=va(22,"=="),xa=ba(22),ka=/^[0-9a-fA-F]{40}$/,Ea=va(27,"="),za=ba(27),Oa=/^[0-9a-fA-F]{64}$/,$a=va(43,"="),Ia=ba(43),Ta=/^[0-9a-fA-F]{96}$/,Pa=va(64,""),Aa=ba(64),Ca=/^[0-9a-fA-F]{128}$/,Na=va(86,"=="),ja=ba(86),Ra=Ei("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Za={number:"number",bigint:"bigint",object:"date"},Da=Ei("$ZodCheckLessThan",(e,t)=>{Ra.init(e,t);const n=Za[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fa=Ei("$ZodCheckGreaterThan",(e,t)=>{Ra.init(e,t);const n=Za[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ma=Ei("$ZodCheckMultipleOf",(e,t)=>{Ra.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(0===s&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(s=Number.parseInt(e[1]))}const i=n>s?n:s;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ua=Ei("$ZodCheckNumberFormat",(e,t)=>{Ra.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=Yi[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=s,r.maximum=i,n&&(r.pattern=la)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a))return void o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),La=Ei("$ZodCheckBigIntFormat",(e,t)=>{Ra.init(e,t);const[n,r]=Xi[t.format];e._zod.onattach.push(e=>{const s=e._zod.bag;s.format=t.format,s.minimum=n,s.maximum=r}),e._zod.check=s=>{const i=s.value;i<n&&s.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&s.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),qa=Ei("$ZodCheckMaxSize",(e,t)=>{var n;Ra.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;r.size<=t.maximum||n.issues.push({origin:so(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ja=Ei("$ZodCheckMinSize",(e,t)=>{var n;Ra.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;r.size>=t.minimum||n.issues.push({origin:so(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Qa=Ei("$ZodCheckSizeEquals",(e,t)=>{var n;Ra.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{const r=n.value,s=r.size;if(s===t.size)return;const i=s>t.size;n.issues.push({origin:so(r),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ba=Ei("$ZodCheckMaxLength",(e,t)=>{var n;Ra.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const s=io(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ka=Ei("$ZodCheckMinLength",(e,t)=>{var n;Ra.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const s=io(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wa=Ei("$ZodCheckLengthEquals",(e,t)=>{var n;Ra.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,s=r.length;if(s===t.length)return;const i=io(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ha=Ei("$ZodCheckStringFormat",(e,t)=>{var n,r;Ra.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Va=Ei("$ZodCheckRegex",(e,t)=>{Ha.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ga=Ei("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ya),Ha.init(e,t)}),Ya=Ei("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ga),Ha.init(e,t)}),Xa=Ei("$ZodCheckIncludes",(e,t)=>{Ra.init(e,t);const n=Wi(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ec=Ei("$ZodCheckStartsWith",(e,t)=>{Ra.init(e,t);const n=new RegExp(`^${Wi(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),tc=Ei("$ZodCheckEndsWith",(e,t)=>{Ra.init(e,t);const n=new RegExp(`.*${Wi(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function nc(e,t,n){e.issues.length&&t.issues.push(...to(n,e.issues))}const rc=Ei("$ZodCheckProperty",(e,t)=>{Ra.init(e,t),e._zod.check=e=>{const n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>nc(n,e,t.property));nc(n,e,t.property)}}),sc=Ei("$ZodCheckMimeType",(e,t)=>{Ra.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),ic=Ei("$ZodCheckOverwrite",(e,t)=>{Ra.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class oc{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>`  ${e}`)].join("\n"))}}const ac={major:4,minor:3,patch:6},cc=Ei("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ac;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,s=eo(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&!1===n?.async)throw new zi;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(s||(s=eo(e,t)))});else{if(e.issues.length===t)continue;s||(s=eo(e,t))}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(eo(n))return n.aborted=!0,n;const o=t(s,r,i);if(o instanceof Promise){if(!1===i.async)throw new zi;return o.then(t=>e._zod.parse(t,i))}return e._zod.parse(o,i)};e._zod.run=(s,i)=>{if(i.skipChecks)return e._zod.parse(s,i);if("backward"===i.direction){const t=e._zod.parse({value:s.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,s,i)):n(t,s,i)}const o=e._zod.parse(s,i);if(o instanceof Promise){if(!1===i.async)throw new zi;return o.then(e=>t(e,r,i))}return t(o,r,i)}}Zi(e,"~standard",()=>({validate:t=>{try{const n=yo(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return _o(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),uc=Ei("$ZodString",(e,t)=>{cc.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ua(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),dc=Ei("$ZodStringFormat",(e,t)=>{Ha.init(e,t),uc.init(e,t)}),lc=Ei("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=jo),dc.init(e,t)}),pc=Ei("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ro(e))}else t.pattern??(t.pattern=Ro());dc.init(e,t)}),hc=Ei("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Mo),dc.init(e,t)}),fc=Ei("$ZodURL",(e,t)=>{dc.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=s.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),mc=Ei("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ko()),dc.init(e,t)}),yc=Ei("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ao),dc.init(e,t)}),gc=Ei("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Oo),dc.init(e,t)}),_c=Ei("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=$o),dc.init(e,t)}),vc=Ei("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Io),dc.init(e,t)}),bc=Ei("$ZodXID",(e,t)=>{t.pattern??(t.pattern=To),dc.init(e,t)}),wc=Ei("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Po),dc.init(e,t)}),Sc=Ei("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ca(t)),dc.init(e,t)}),xc=Ei("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ia),dc.init(e,t)}),kc=Ei("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=aa(t)),dc.init(e,t)}),Ec=Ei("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Co),dc.init(e,t)}),zc=Ei("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wo),dc.init(e,t),e._zod.bag.format="ipv4"}),Oc=Ei("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ho),dc.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),$c=Ei("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Vo(t.delimiter)),dc.init(e,t),e._zod.bag.format="mac"}),Ic=Ei("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Go),dc.init(e,t)}),Tc=Ei("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yo),dc.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Pc(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Ac=Ei("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Xo),dc.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Pc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Cc=Ei("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ea),dc.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!ea.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Pc(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Nc=Ei("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ra),dc.init(e,t)}),jc=Ei("$ZodJWT",(e,t)=>{dc.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&"JWT"!==s?.typ||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Rc=Ei("$ZodCustomStringFormat",(e,t)=>{dc.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Zc=Ei("$ZodNumber",(e,t)=>{cc.init(e,t),e._zod.pattern=e._zod.bag.pattern??pa,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const s=n.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),Dc=Ei("$ZodNumberFormat",(e,t)=>{Ua.init(e,t),Zc.init(e,t)}),Fc=Ei("$ZodBoolean",(e,t)=>{cc.init(e,t),e._zod.pattern=ha,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const s=n.value;return"boolean"==typeof s||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Mc=Ei("$ZodBigInt",(e,t)=>{cc.init(e,t),e._zod.pattern=da,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Uc=Ei("$ZodBigIntFormat",(e,t)=>{La.init(e,t),Mc.init(e,t)}),Lc=Ei("$ZodSymbol",(e,t)=>{cc.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return"symbol"==typeof r||t.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),t}}),qc=Ei("$ZodUndefined",(e,t)=>{cc.init(e,t),e._zod.pattern=ma,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}}),Jc=Ei("$ZodNull",(e,t)=>{cc.init(e,t),e._zod.pattern=fa,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),Qc=Ei("$ZodAny",(e,t)=>{cc.init(e,t),e._zod.parse=e=>e}),Bc=Ei("$ZodUnknown",(e,t)=>{cc.init(e,t),e._zod.parse=e=>e}),Kc=Ei("$ZodNever",(e,t)=>{cc.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),Wc=Ei("$ZodVoid",(e,t)=>{cc.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}}),Hc=Ei("$ZodDate",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const s=n.value,i=s instanceof Date;return i&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...i?{received:"Invalid Date"}:{},inst:e}),n}});function Vc(e,t,n){e.issues.length&&t.issues.push(...to(n,e.issues)),t.value[n]=e.value}const Gc=Ei("$ZodArray",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let e=0;e<s.length;e++){const o=s[e],a=t.element._zod.run({value:o,issues:[]},r);a instanceof Promise?i.push(a.then(t=>Vc(t,n,e))):Vc(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function Yc(e,t,n,r,s){if(e.issues.length){if(s&&!(n in r))return;t.issues.push(...to(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Xc(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function eu(e,t,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,u=c.def.type,d="optional"===c.optout;for(const s in t){if(a.has(s))continue;if("never"===u){o.push(s);continue}const i=c.run({value:t[s],issues:[]},r);i instanceof Promise?e.push(i.then(e=>Yc(e,n,s,t,d))):Yc(i,n,s,t,d)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const tu=Ei("$ZodObject",(e,t)=>{cc.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=Ci(()=>Xc(t));Zi(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const s=Li,i=t.catchall;let o;e._zod.parse=(t,n)=>{o??(o=r.value);const a=t.value;if(!s(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=o.shape;for(const e of o.keys){const r=u[e],s="optional"===r._zod.optout,i=r._zod.run({value:a[e],issues:[]},n);i instanceof Promise?c.push(i.then(n=>Yc(n,t,e,a,s))):Yc(i,t,e,a,s)}return i?eu(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),nu=Ei("$ZodObjectJIT",(e,t)=>{tu.init(e,t);const n=e._zod.parse,r=Ci(()=>Xc(t));let s;const i=Li,o=!$i.jitless,a=o&&qi.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=r.value);const p=d.value;return i(p)?o&&a&&!1===l?.async&&!0!==l.jitless?(s||(s=(e=>{const t=new oc(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Mi(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of n.keys)i[e]="key_"+o++;t.write("const newResult = {};");for(const r of n.keys){const n=i[r],o=Mi(r),a=e[r],c="optional"===a?._zod?.optout;t.write(`const ${n} = ${s(r)};`),c?t.write(`\n        if (${n}.issues.length) {\n          if (${o} in input) {\n            payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n              ...iss,\n              path: iss.path ? [${o}, ...iss.path] : [${o}]\n            })));\n          }\n        }\n        \n        if (${n}.value === undefined) {\n          if (${o} in input) {\n            newResult[${o}] = undefined;\n          }\n        } else {\n          newResult[${o}] = ${n}.value;\n        }\n        \n      `):t.write(`\n        if (${n}.issues.length) {\n          payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n            ...iss,\n            path: iss.path ? [${o}, ...iss.path] : [${o}]\n          })));\n        }\n        \n        if (${n}.value === undefined) {\n          if (${o} in input) {\n            newResult[${o}] = undefined;\n          }\n        } else {\n          newResult[${o}] = ${n}.value;\n        }\n        \n      `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=s(d,l),c?eu([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function ru(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const s=e.filter(e=>!eo(e));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ro(e,r,Ii())))}),t)}const su=Ei("$ZodUnion",(e,t)=>{cc.init(e,t),Zi(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Zi(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Zi(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Zi(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>ji(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>ru(t,s,e,i)):ru(a,s,e,i)}});function iu(e,t,n,r){const s=e.filter(e=>0===e.issues.length);return 1===s.length?(t.value=s[0].value,t):(0===s.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ro(e,r,Ii())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}const ou=Ei("$ZodXor",(e,t)=>{su.init(e,t),t.inclusive=!1;const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);t instanceof Promise?(a.push(t),o=!0):a.push(t)}return o?Promise.all(a).then(t=>iu(t,s,e,i)):iu(a,s,e,i)}}),au=Ei("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,su.init(e,t);const n=e._zod.parse;Zi(e._zod,"propValues",()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(const r of n)e[t].add(r)}}return e});const r=Ci(()=>{const e=t.options,n=new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(s,i)=>{const o=s.value;if(!Li(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const a=r.value.get(o?.[t.discriminator]);return a?a._zod.run(s,i):t.unionFallback?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),s)}}),cu=Ei("$ZodIntersection",(e,t)=>{cc.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,s=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([t,n])=>du(e,t,n)):du(e,s,i)}});function uu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Ji(e)&&Ji(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),s={...e,...t};for(const n of r){const r=uu(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=uu(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function du(e,t,n){const r=new Map;let s;for(const n of t.issues)if("unrecognized_keys"===n.code){s??(s=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const i=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&s&&e.issues.push({...s,keys:i}),eo(e))return e;const o=uu(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const lu=Ei("$ZodTuple",(e,t)=>{cc.init(e,t);const n=t.items;e._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const o=[],a=[...n].reverse().findIndex(e=>"optional"!==e._zod.optin),c=-1===a?0:n.length-a;if(!t.rest){const t=i.length>n.length,s=i.length<c-1;if(t||s)return r.issues.push({...t?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),r}let u=-1;for(const e of n){if(u++,u>=i.length&&u>=c)continue;const t=e._zod.run({value:i[u],issues:[]},s);t instanceof Promise?o.push(t.then(e=>pu(e,r,u))):pu(t,r,u)}if(t.rest){const e=i.slice(n.length);for(const n of e){u++;const e=t.rest._zod.run({value:n,issues:[]},s);e instanceof Promise?o.push(e.then(e=>pu(e,r,u))):pu(e,r,u)}}return o.length?Promise.all(o).then(()=>r):r}});function pu(e,t,n){e.issues.length&&t.issues.push(...to(n,e.issues)),t.value[n]=e.value}const hu=Ei("$ZodRecord",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Ji(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const e of o)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){a.add("number"==typeof e?e.toString():e);const o=t.valueType._zod.run({value:s[e],issues:[]},r);o instanceof Promise?i.push(o.then(t=>{t.issues.length&&n.issues.push(...to(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...to(e,o.issues)),n.value[e]=o.value)}let c;for(const e in s)a.has(e)||(c=c??[],c.push(e));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c})}else{n.value={};for(const o of Reflect.ownKeys(s)){if("__proto__"===o)continue;let a=t.keyType._zod.run({value:o,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof o&&pa.test(o)&&a.issues.length){const e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(a=e)}if(a.issues.length){"loose"===t.mode?n.value[o]=s[o]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>ro(e,r,Ii())),input:o,path:[o],inst:e});continue}const c=t.valueType._zod.run({value:s[o],issues:[]},r);c instanceof Promise?i.push(c.then(e=>{e.issues.length&&n.issues.push(...to(o,e.issues)),n.value[a.value]=e.value})):(c.issues.length&&n.issues.push(...to(o,c.issues)),n.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>n):n}}),fu=Ei("$ZodMap",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!(s instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:s,inst:e}),n;const i=[];n.value=new Map;for(const[o,a]of s){const c=t.keyType._zod.run({value:o,issues:[]},r),u=t.valueType._zod.run({value:a,issues:[]},r);c instanceof Promise||u instanceof Promise?i.push(Promise.all([c,u]).then(([t,i])=>{mu(t,i,n,o,s,e,r)})):mu(c,u,n,o,s,e,r)}return i.length?Promise.all(i).then(()=>n):n}});function mu(e,t,n,r,s,i,o){e.issues.length&&(Bi.has(typeof r)?n.issues.push(...to(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:s,inst:i,issues:e.issues.map(e=>ro(e,o,Ii()))})),t.issues.length&&(Bi.has(typeof r)?n.issues.push(...to(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:s,inst:i,key:r,issues:t.issues.map(e=>ro(e,o,Ii()))})),n.value.set(e.value,t.value)}const yu=Ei("$ZodSet",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!(s instanceof Set))return n.issues.push({input:s,inst:e,expected:"set",code:"invalid_type"}),n;const i=[];n.value=new Set;for(const e of s){const s=t.valueType._zod.run({value:e,issues:[]},r);s instanceof Promise?i.push(s.then(e=>gu(e,n))):gu(s,n)}return i.length?Promise.all(i).then(()=>n):n}});function gu(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const _u=Ei("$ZodEnum",(e,t)=>{cc.init(e,t);const n=Ti(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Bi.has(typeof e)).map(e=>"string"==typeof e?Wi(e):e.toString()).join("|")})$`),e._zod.parse=(t,s)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),vu=Ei("$ZodLiteral",(e,t)=>{if(cc.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?Wi(e):e?Wi(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),bu=Ei("$ZodFile",(e,t)=>{cc.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}}),wu=Ei("$ZodTransform",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Oi(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(e=>(n.value=e,n));if(s instanceof Promise)throw new zi;return n.value=s,n}});function Su(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const xu=Ei("$ZodOptional",(e,t)=>{cc.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Zi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Zi(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ji(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Su(t,e.value)):Su(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),ku=Ei("$ZodExactOptional",(e,t)=>{xu.init(e,t),Zi(e._zod,"values",()=>t.innerType._zod.values),Zi(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Eu=Ei("$ZodNullable",(e,t)=>{cc.init(e,t),Zi(e._zod,"optin",()=>t.innerType._zod.optin),Zi(e._zod,"optout",()=>t.innerType._zod.optout),Zi(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ji(e.source)}|null)$`):void 0}),Zi(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),zu=Ei("$ZodDefault",(e,t)=>{cc.init(e,t),e._zod.optin="optional",Zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ou(e,t)):Ou(r,t)}});function Ou(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const $u=Ei("$ZodPrefault",(e,t)=>{cc.init(e,t),e._zod.optin="optional",Zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Iu=Ei("$ZodNonOptional",(e,t)=>{cc.init(e,t),Zi(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(t=>Tu(t,e)):Tu(s,e)}});function Tu(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Pu=Ei("$ZodSuccess",(e,t)=>{cc.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new Oi("ZodSuccess");const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}}),Au=Ei("$ZodCatch",(e,t)=>{cc.init(e,t),Zi(e._zod,"optin",()=>t.innerType._zod.optin),Zi(e._zod,"optout",()=>t.innerType._zod.optout),Zi(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ro(e,n,Ii()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ro(e,n,Ii()))},input:e.value}),e.issues=[]),e)}}),Cu=Ei("$ZodNaN",(e,t)=>{cc.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),Nu=Ei("$ZodPipe",(e,t)=>{cc.init(e,t),Zi(e._zod,"values",()=>t.in._zod.values),Zi(e._zod,"optin",()=>t.in._zod.optin),Zi(e._zod,"optout",()=>t.out._zod.optout),Zi(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ju(e,t.in,n)):ju(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ju(e,t.out,n)):ju(r,t.out,n)}});function ju(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ru=Ei("$ZodCodec",(e,t)=>{cc.init(e,t),Zi(e._zod,"values",()=>t.in._zod.values),Zi(e._zod,"optin",()=>t.in._zod.optin),Zi(e._zod,"optout",()=>t.out._zod.optout),Zi(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Zu(e,t,n)):Zu(r,t,n)}{const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Zu(e,t,n)):Zu(r,t,n)}}});function Zu(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){const r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Du(e,r,t.out,n)):Du(e,r,t.out,n)}{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Du(e,r,t.in,n)):Du(e,r,t.in,n)}}function Du(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const Fu=Ei("$ZodReadonly",(e,t)=>{cc.init(e,t),Zi(e._zod,"propValues",()=>t.innerType._zod.propValues),Zi(e._zod,"values",()=>t.innerType._zod.values),Zi(e._zod,"optin",()=>t.innerType?._zod?.optin),Zi(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Mu):Mu(r)}});function Mu(e){return e.value=Object.freeze(e.value),e}const Uu=Ei("$ZodTemplateLiteral",(e,t)=>{cc.init(e,t);const n=[];for(const e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);const t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${e._zod.traits}`);const r=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(r,s))}else{if(null!==e&&!Ki.has(typeof e))throw new Error(`Invalid template literal part: ${e}`);n.push(Wi(`${e}`))}e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>"string"!=typeof n.value?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),Lu=Ei("$ZodFunction",(e,t)=>(cc.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw new Error("implement() must be called with a function");return function(...n){const r=e._def.input?po(e._def.input,n):n,s=Reflect.apply(t,this,r);return e._def.output?po(e._def.output,s):s}},e.implementAsync=t=>{if("function"!=typeof t)throw new Error("implementAsync() must be called with a function");return async function(...n){const r=e._def.input?await fo(e._def.input,n):n,s=await Reflect.apply(t,this,r);return e._def.output?await fo(e._def.output,s):s}},e._zod.parse=(t,n)=>{if("function"!=typeof t.value)return t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}),t;const r=e._def.output&&"promise"===e._def.output._zod.def.type;return t.value=r?e.implementAsync(t.value):e.implement(t.value),t},e.input=(...t)=>{const n=e.constructor;return Array.isArray(t[0])?new n({type:"function",input:new lu({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}):new n({type:"function",input:t[0],output:e._def.output})},e.output=t=>new(0,e.constructor)({type:"function",input:e._def.input,output:t}),e)),qu=Ei("$ZodPromise",(e,t)=>{cc.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Ju=Ei("$ZodLazy",(e,t)=>{cc.init(e,t),Zi(e._zod,"innerType",()=>t.getter()),Zi(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Zi(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Zi(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Zi(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Qu=Ei("$ZodCustom",(e,t)=>{Ra.init(e,t),cc.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(t=>Bu(t,n,r,e));Bu(s,n,r,e)}});function Bu(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(oo(e))}}var Ku;Symbol("ZodOutput"),Symbol("ZodInput");(Ku=globalThis).__zod_globalRegistry??(Ku.__zod_globalRegistry=new class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const Wu=globalThis.__zod_globalRegistry;function Hu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Vi(t)})}function Vu(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Vi(t)})}function Gu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Vi(t)})}function Yu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Vi(t)})}function Xu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Vi(t)})}function ed(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Vi(t)})}function td(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Vi(t)})}function nd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Vi(t)})}function rd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Vi(t)})}function sd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Vi(t)})}function id(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Vi(t)})}function od(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Vi(t)})}function ad(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Vi(t)})}function cd(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Vi(t)})}function ud(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Vi(t)})}function dd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Vi(t)})}function ld(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Vi(t)})}function pd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Vi(t)})}function hd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Vi(t)})}function fd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Vi(t)})}function md(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Vi(t)})}function yd(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Vi(t)})}function gd(e,t){return new Da({check:"less_than",...Vi(t),value:e,inclusive:!1})}function _d(e,t){return new Da({check:"less_than",...Vi(t),value:e,inclusive:!0})}function vd(e,t){return new Fa({check:"greater_than",...Vi(t),value:e,inclusive:!1})}function bd(e,t){return new Fa({check:"greater_than",...Vi(t),value:e,inclusive:!0})}function wd(e){return vd(0,e)}function Sd(e){return gd(0,e)}function xd(e){return _d(0,e)}function kd(e){return bd(0,e)}function Ed(e,t){return new Ma({check:"multiple_of",...Vi(t),value:e})}function zd(e,t){return new qa({check:"max_size",...Vi(t),maximum:e})}function Od(e,t){return new Ja({check:"min_size",...Vi(t),minimum:e})}function $d(e,t){return new Qa({check:"size_equals",...Vi(t),size:e})}function Id(e,t){return new Ba({check:"max_length",...Vi(t),maximum:e})}function Td(e,t){return new Ka({check:"min_length",...Vi(t),minimum:e})}function Pd(e,t){return new Wa({check:"length_equals",...Vi(t),length:e})}function Ad(e,t){return new Va({check:"string_format",format:"regex",...Vi(t),pattern:e})}function Cd(e){return new Ga({check:"string_format",format:"lowercase",...Vi(e)})}function Nd(e){return new Ya({check:"string_format",format:"uppercase",...Vi(e)})}function jd(e,t){return new Xa({check:"string_format",format:"includes",...Vi(t),includes:e})}function Rd(e,t){return new ec({check:"string_format",format:"starts_with",...Vi(t),prefix:e})}function Zd(e,t){return new tc({check:"string_format",format:"ends_with",...Vi(t),suffix:e})}function Dd(e,t,n){return new rc({check:"property",property:e,schema:t,...Vi(n)})}function Fd(e,t){return new sc({check:"mime_type",mime:e,...Vi(t)})}function Md(e){return new ic({check:"overwrite",tx:e})}function Ud(e){return Md(t=>t.normalize(e))}function Ld(){return Md(e=>e.trim())}function qd(){return Md(e=>e.toLowerCase())}function Jd(){return Md(e=>e.toUpperCase())}function Qd(){return Md(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))}function Bd(e,t,n,r={}){const s=Vi(r),i={...Vi(r),check:"string_format",type:"string",format:t,fn:"function"==typeof n?n:e=>n.test(e),...s};return n instanceof RegExp&&(i.pattern=n),new e(i)}function Kd(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Wu,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Wd(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{const n=o.schema,i=t.processors[s.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(o.ref||(o.ref=i),Wd(i,t,r),t.seen.get(i).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),"input"===t.io&&Gd(e)&&(delete o.schema.examples,delete o.schema.default),"input"===t.io&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Hd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}const s=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:s,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,s=e.external.uri??(e=>e);if(n)return{ref:s(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${s("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const s=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:s+i}})(t);r.def={...r.schema},i&&(r.defId=i);const o=r.schema;for(const e in o)delete o[e];o.$ref=s};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){s(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){s(n);continue}}const i=e.metadataRegistry.get(n[0])?.id;(i||r.cycle||r.count>1&&"ref"===e.reused)&&s(n)}}function Vd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const s=n.def??n.schema,i={...s},o=n.ref;if(n.ref=null,o){r(o);const n=e.seen.get(o),a=n.schema;if(!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(s,a):(s.allOf=s.allOf??[],s.allOf.push(a)),Object.assign(s,i),t._zod.parent===o)for(const e in s)"$ref"!==e&&"allOf"!==e&&(e in i||delete s[e]);if(a.$ref&&n.def)for(const e in s)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(s[e])===JSON.stringify(n.def[e])&&delete s[e]}const a=t._zod.parent;if(a&&a!==o){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(s.$ref=t.schema.$ref,t.def))for(const e in s)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(s[e])===JSON.stringify(t.def[e])&&delete s[e]}e.override({zodSchema:t,jsonSchema:s,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const s={};if("draft-2020-12"===e.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?s.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(n)}Object.assign(s,n.def??n.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?s.$defs=i:s.definitions=i);try{const n=JSON.parse(JSON.stringify(s));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Yd(t,"input",e.processors),output:Yd(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function Gd(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return Gd(r.element,n);if("set"===r.type)return Gd(r.valueType,n);if("lazy"===r.type)return Gd(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return Gd(r.innerType,n);if("intersection"===r.type)return Gd(r.left,n)||Gd(r.right,n);if("record"===r.type||"map"===r.type)return Gd(r.keyType,n)||Gd(r.valueType,n);if("pipe"===r.type)return Gd(r.in,n)||Gd(r.out,n);if("object"===r.type){for(const e in r.shape)if(Gd(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(Gd(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(Gd(e,n))return!0;return!(!r.rest||!Gd(r.rest,n))}return!1}const Yd=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=Kd({...s??{},target:i,io:t,processors:n});return Wd(e,o),Hd(o,e),Vd(o,e)},Xd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},el=(e,t,n,r)=>{const s=e._zod.def,i=!1===s.inclusive,o=s.options.map((e,n)=>Wd(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=o:n.anyOf=o},tl=(e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType},nl=Ei("ZodISODateTime",(e,t)=>{Sc.init(e,t),$l.init(e,t)});function rl(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Vi(t)})}(nl,e)}const sl=Ei("ZodISODate",(e,t)=>{xc.init(e,t),$l.init(e,t)});function il(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Vi(t)})}(sl,e)}const ol=Ei("ZodISOTime",(e,t)=>{kc.init(e,t),$l.init(e,t)});function al(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Vi(t)})}(ol,e)}const cl=Ei("ZodISODuration",(e,t)=>{Ec.init(e,t),$l.init(e,t)});function ul(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Vi(t)})}(cl,e)}const dl=(e,t)=>{co.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>r({issues:e}));else if("invalid_key"===s.code)r({issues:s.issues});else if("invalid_element"===s.code)r({issues:s.issues});else if(0===s.path.length)n._errors.push(t(s));else{let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ai,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ai,2)}},isEmpty:{get:()=>0===e.issues.length}})},ll=(Ei("ZodError",dl),Ei("ZodError",dl,{Parent:Error})),pl=lo(ll),hl=ho(ll),fl=mo(ll),ml=go(ll),yl=vo(ll),gl=bo(ll),_l=wo(ll),vl=So(ll),bl=xo(ll),wl=ko(ll),Sl=Eo(ll),xl=zo(ll),kl=Ei("ZodType",(e,t)=>(cc.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Yd(e,"input"),output:Yd(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=Kd({...n,processors:t});return Wd(e,r),Hd(r,e),Vd(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Fi(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Hi(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>pl(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>fl(e,t,n),e.parseAsync=async(t,n)=>hl(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ml(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>yl(e,t,n),e.decode=(t,n)=>gl(e,t,n),e.encodeAsync=async(t,n)=>_l(e,t,n),e.decodeAsync=async(t,n)=>vl(e,t,n),e.safeEncode=(t,n)=>bl(e,t,n),e.safeDecode=(t,n)=>wl(e,t,n),e.safeEncodeAsync=async(t,n)=>Sl(e,t,n),e.safeDecodeAsync=async(t,n)=>xl(e,t,n),e.refine=(t,n)=>e.check(_f(t,n)),e.superRefine=t=>e.check(vf(t)),e.overwrite=t=>e.check(Md(t)),e.optional=()=>Rh(e),e.exactOptional=()=>Dh(e),e.nullable=()=>Mh(e),e.nullish=()=>Rh(Mh(e)),e.nonoptional=t=>Kh(e,t),e.array=()=>nh(e),e.or=t=>uh([e,t]),e.and=t=>mh(e,t),e.transform=t=>tf(e,Nh(t)),e.default=t=>qh(e,t),e.prefault=t=>Qh(e,t),e.catch=t=>Gh(e,t),e.pipe=t=>tf(e,t),e.readonly=()=>of(e),e.describe=t=>{const n=e.clone();return Wu.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Wu.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Wu.get(e);const n=e.clone();return Wu.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),El=Ei("_ZodString",(e,t)=>{uc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:s,maximum:i,format:o,patterns:a,contentEncoding:c}=e._zod.bag;if("number"==typeof s&&(r.minLength=s),"number"==typeof i&&(r.maxLength=i),o&&(r.format=Xd[o]??o,""===r.format&&delete r.format,"time"===o&&delete r.format),c&&(r.contentEncoding=c),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Ad(...t)),e.includes=(...t)=>e.check(jd(...t)),e.startsWith=(...t)=>e.check(Rd(...t)),e.endsWith=(...t)=>e.check(Zd(...t)),e.min=(...t)=>e.check(Td(...t)),e.max=(...t)=>e.check(Id(...t)),e.length=(...t)=>e.check(Pd(...t)),e.nonempty=(...t)=>e.check(Td(1,...t)),e.lowercase=t=>e.check(Cd(t)),e.uppercase=t=>e.check(Nd(t)),e.trim=()=>e.check(Ld()),e.normalize=(...t)=>e.check(Ud(...t)),e.toLowerCase=()=>e.check(qd()),e.toUpperCase=()=>e.check(Jd()),e.slugify=()=>e.check(Qd())}),zl=Ei("ZodString",(e,t)=>{uc.init(e,t),El.init(e,t),e.email=t=>e.check(Hu(Il,t)),e.url=t=>e.check(td(Dl,t)),e.jwt=t=>e.check(yd(gp,t)),e.emoji=t=>e.check(nd(Ul,t)),e.guid=t=>e.check(Vu(Pl,t)),e.uuid=t=>e.check(Gu(Cl,t)),e.uuidv4=t=>e.check(Yu(Cl,t)),e.uuidv6=t=>e.check(Xu(Cl,t)),e.uuidv7=t=>e.check(ed(Cl,t)),e.nanoid=t=>e.check(rd(ql,t)),e.guid=t=>e.check(Vu(Pl,t)),e.cuid=t=>e.check(sd(Ql,t)),e.cuid2=t=>e.check(id(Kl,t)),e.ulid=t=>e.check(od(Hl,t)),e.base64=t=>e.check(hd(lp,t)),e.base64url=t=>e.check(fd(hp,t)),e.xid=t=>e.check(ad(Gl,t)),e.ksuid=t=>e.check(cd(Xl,t)),e.ipv4=t=>e.check(ud(tp,t)),e.ipv6=t=>e.check(dd(ip,t)),e.cidrv4=t=>e.check(ld(ap,t)),e.cidrv6=t=>e.check(pd(up,t)),e.e164=t=>e.check(md(mp,t)),e.datetime=t=>e.check(rl(t)),e.date=t=>e.check(il(t)),e.time=t=>e.check(al(t)),e.duration=t=>e.check(ul(t))});function Ol(e){return function(e,t){return new e({type:"string",...Vi(t)})}(zl,e)}const $l=Ei("ZodStringFormat",(e,t)=>{dc.init(e,t),El.init(e,t)}),Il=Ei("ZodEmail",(e,t)=>{hc.init(e,t),$l.init(e,t)});function Tl(e){return Hu(Il,e)}const Pl=Ei("ZodGUID",(e,t)=>{lc.init(e,t),$l.init(e,t)});function Al(e){return Vu(Pl,e)}const Cl=Ei("ZodUUID",(e,t)=>{pc.init(e,t),$l.init(e,t)});function Nl(e){return Gu(Cl,e)}function jl(e){return Yu(Cl,e)}function Rl(e){return Xu(Cl,e)}function Zl(e){return ed(Cl,e)}const Dl=Ei("ZodURL",(e,t)=>{fc.init(e,t),$l.init(e,t)});function Fl(e){return td(Dl,e)}function Ml(e){return td(Dl,{protocol:/^https?$/,hostname:na,...Vi(e)})}const Ul=Ei("ZodEmoji",(e,t)=>{mc.init(e,t),$l.init(e,t)});function Ll(e){return nd(Ul,e)}const ql=Ei("ZodNanoID",(e,t)=>{yc.init(e,t),$l.init(e,t)});function Jl(e){return rd(ql,e)}const Ql=Ei("ZodCUID",(e,t)=>{gc.init(e,t),$l.init(e,t)});function Bl(e){return sd(Ql,e)}const Kl=Ei("ZodCUID2",(e,t)=>{_c.init(e,t),$l.init(e,t)});function Wl(e){return id(Kl,e)}const Hl=Ei("ZodULID",(e,t)=>{vc.init(e,t),$l.init(e,t)});function Vl(e){return od(Hl,e)}const Gl=Ei("ZodXID",(e,t)=>{bc.init(e,t),$l.init(e,t)});function Yl(e){return ad(Gl,e)}const Xl=Ei("ZodKSUID",(e,t)=>{wc.init(e,t),$l.init(e,t)});function ep(e){return cd(Xl,e)}const tp=Ei("ZodIPv4",(e,t)=>{zc.init(e,t),$l.init(e,t)});function np(e){return ud(tp,e)}const rp=Ei("ZodMAC",(e,t)=>{$c.init(e,t),$l.init(e,t)});function sp(e){return function(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Vi(t)})}(rp,e)}const ip=Ei("ZodIPv6",(e,t)=>{Oc.init(e,t),$l.init(e,t)});function op(e){return dd(ip,e)}const ap=Ei("ZodCIDRv4",(e,t)=>{Ic.init(e,t),$l.init(e,t)});function cp(e){return ld(ap,e)}const up=Ei("ZodCIDRv6",(e,t)=>{Tc.init(e,t),$l.init(e,t)});function dp(e){return pd(up,e)}const lp=Ei("ZodBase64",(e,t)=>{Ac.init(e,t),$l.init(e,t)});function pp(e){return hd(lp,e)}const hp=Ei("ZodBase64URL",(e,t)=>{Cc.init(e,t),$l.init(e,t)});function fp(e){return fd(hp,e)}const mp=Ei("ZodE164",(e,t)=>{Nc.init(e,t),$l.init(e,t)});function yp(e){return md(mp,e)}const gp=Ei("ZodJWT",(e,t)=>{jc.init(e,t),$l.init(e,t)});function _p(e){return yd(gp,e)}const vp=Ei("ZodCustomStringFormat",(e,t)=>{Rc.init(e,t),$l.init(e,t)});function bp(e,t,n={}){return Bd(vp,e,t,n)}function wp(e){return Bd(vp,"hostname",ta,e)}function Sp(e){return Bd(vp,"hex",_a,e)}function xp(e,n){const r=`${e}_${n?.enc??"hex"}`,s=t[r];if(!s)throw new Error(`Unrecognized hash format: ${r}`);return Bd(vp,r,s,n)}const kp=Ei("ZodNumber",(e,t)=>{Zc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:s,maximum:i,format:o,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;"string"==typeof o&&o.includes("int")?r.type="integer":r.type="number","number"==typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u),"number"==typeof s&&(r.minimum=s,"number"==typeof u&&"draft-04"!==t.target&&(u>=s?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c),"number"==typeof i&&(r.maximum=i,"number"==typeof c&&"draft-04"!==t.target&&(c<=i?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(vd(t,n)),e.gte=(t,n)=>e.check(bd(t,n)),e.min=(t,n)=>e.check(bd(t,n)),e.lt=(t,n)=>e.check(gd(t,n)),e.lte=(t,n)=>e.check(_d(t,n)),e.max=(t,n)=>e.check(_d(t,n)),e.int=t=>e.check(Op(t)),e.safe=t=>e.check(Op(t)),e.positive=t=>e.check(vd(0,t)),e.nonnegative=t=>e.check(bd(0,t)),e.negative=t=>e.check(gd(0,t)),e.nonpositive=t=>e.check(_d(0,t)),e.multipleOf=(t,n)=>e.check(Ed(t,n)),e.step=(t,n)=>e.check(Ed(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ep(e){return function(e,t){return new e({type:"number",checks:[],...Vi(t)})}(kp,e)}const zp=Ei("ZodNumberFormat",(e,t)=>{Dc.init(e,t),kp.init(e,t)});function Op(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Vi(t)})}(zp,e)}function $p(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Vi(t)})}(zp,e)}function Ip(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Vi(t)})}(zp,e)}function Tp(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Vi(t)})}(zp,e)}function Pp(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Vi(t)})}(zp,e)}const Ap=Ei("ZodBoolean",(e,t)=>{Fc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function Cp(e){return function(e,t){return new e({type:"boolean",...Vi(t)})}(Ap,e)}const Np=Ei("ZodBigInt",(e,t)=>{Mc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema")})(0,e),e.gte=(t,n)=>e.check(bd(t,n)),e.min=(t,n)=>e.check(bd(t,n)),e.gt=(t,n)=>e.check(vd(t,n)),e.gte=(t,n)=>e.check(bd(t,n)),e.min=(t,n)=>e.check(bd(t,n)),e.lt=(t,n)=>e.check(gd(t,n)),e.lte=(t,n)=>e.check(_d(t,n)),e.max=(t,n)=>e.check(_d(t,n)),e.positive=t=>e.check(vd(BigInt(0),t)),e.negative=t=>e.check(gd(BigInt(0),t)),e.nonpositive=t=>e.check(_d(BigInt(0),t)),e.nonnegative=t=>e.check(bd(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Ed(t,n));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function jp(e){return function(e,t){return new e({type:"bigint",...Vi(t)})}(Np,e)}const Rp=Ei("ZodBigIntFormat",(e,t)=>{Uc.init(e,t),Np.init(e,t)});function Zp(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Vi(t)})}(Rp,e)}function Dp(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Vi(t)})}(Rp,e)}const Fp=Ei("ZodSymbol",(e,t)=>{Lc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema")})(0,e)});function Mp(e){return function(e,t){return new e({type:"symbol",...Vi(t)})}(Fp,e)}const Up=Ei("ZodUndefined",(e,t)=>{qc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema")})(0,e)});function Lp(e){return function(e,t){return new e({type:"undefined",...Vi(t)})}(Up,e)}const qp=Ei("ZodNull",(e,t)=>{Jc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{"openapi-3.0"===t.target?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"})(0,e,t)});function Jp(e){return function(e,t){return new e({type:"null",...Vi(t)})}(qp,e)}const Qp=Ei("ZodAny",(e,t)=>{Qc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Bp(){return new Qp({type:"any"})}const Kp=Ei("ZodUnknown",(e,t)=>{Bc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Wp(){return new Kp({type:"unknown"})}const Hp=Ei("ZodNever",(e,t)=>{Kc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function Vp(e){return function(e,t){return new e({type:"never",...Vi(t)})}(Hp,e)}const Gp=Ei("ZodVoid",(e,t)=>{Wc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Void cannot be represented in JSON Schema")})(0,e)});function Yp(e){return function(e,t){return new e({type:"void",...Vi(t)})}(Gp,e)}const Xp=Ei("ZodDate",(e,t)=>{Hc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Date cannot be represented in JSON Schema")})(0,e),e.min=(t,n)=>e.check(bd(t,n)),e.max=(t,n)=>e.check(_d(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function eh(e){return function(e,t){return new e({type:"date",...Vi(t)})}(Xp,e)}const th=Ei("ZodArray",(e,t)=>{Gc.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;"number"==typeof o&&(s.minItems=o),"number"==typeof a&&(s.maxItems=a),s.type="array",s.items=Wd(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Td(t,n)),e.nonempty=t=>e.check(Td(1,t)),e.max=(t,n)=>e.check(Id(t,n)),e.length=(t,n)=>e.check(Pd(t,n)),e.unwrap=()=>e.element});function nh(e,t){return function(e,t,n){return new e({type:"array",element:t,...Vi(n)})}(th,e,t)}function rh(e){const t=e._zod.def.shape;return Oh(Object.keys(t))}const sh=Ei("ZodObject",(e,t)=>{nu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const e in o)s.properties[e]=Wd(o[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));c.size>0&&(s.required=Array.from(c)),"never"===i.catchall?._zod.def.type?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=Wd(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(s.additionalProperties=!1)})(e,t,n,r),Zi(e,"shape",()=>t.shape),e.keyof=()=>Oh(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Wp()}),e.loose=()=>e.clone({...e._zod.def,catchall:Wp()}),e.strict=()=>e.clone({...e._zod.def,catchall:Vp()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Ji(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Fi(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Di(this,"shape",n),n}});return Hi(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Ji(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Fi(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Di(this,"shape",n),n}});return Hi(e,n)}(e,t),e.merge=t=>function(e,t){const n=Fi(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Di(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Hi(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Hi(e,Fi(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Di(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Fi(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Di(this,"shape",r),r},checks:[]});return Hi(e,s)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Fi(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)s[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Di(this,"shape",s),s},checks:[]});return Hi(t,s)}(jh,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Fi(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in s))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)s[t]=new e({type:"nonoptional",innerType:r[t]});return Di(this,"shape",s),s}});return Hi(t,r)}(Bh,e,t[0])});function ih(e,t){const n={type:"object",shape:e??{},...Vi(t)};return new sh(n)}function oh(e,t){return new sh({type:"object",shape:e,catchall:Vp(),...Vi(t)})}function ah(e,t){return new sh({type:"object",shape:e,catchall:Wp(),...Vi(t)})}const ch=Ei("ZodUnion",(e,t)=>{su.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,n,r),e.options=t.options});function uh(e,t){return new ch({type:"union",options:e,...Vi(t)})}const dh=Ei("ZodXor",(e,t)=>{ch.init(e,t),ou.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,n,r),e.options=t.options});function lh(e,t){return new dh({type:"union",options:e,inclusive:!1,...Vi(t)})}const ph=Ei("ZodDiscriminatedUnion",(e,t)=>{ch.init(e,t),au.init(e,t)});function hh(e,t,n){return new ph({type:"union",options:t,discriminator:e,...Vi(n)})}const fh=Ei("ZodIntersection",(e,t)=>{cu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i=Wd(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=Wd(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,c=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=c})(e,t,n,r)});function mh(e,t){return new fh({type:"intersection",left:e,right:t})}const yh=Ei("ZodTuple",(e,t)=>{lu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="array";const o="draft-2020-12"===t.target?"prefixItems":"items",a="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",c=i.items.map((e,n)=>Wd(e,t,{...r,path:[...r.path,o,n]})),u=i.rest?Wd(i.rest,t,{...r,path:[...r.path,a,..."openapi-3.0"===t.target?[i.items.length]:[]]}):null;"draft-2020-12"===t.target?(s.prefixItems=c,u&&(s.items=u)):"openapi-3.0"===t.target?(s.items={anyOf:c},u&&s.items.anyOf.push(u),s.minItems=c.length,u||(s.maxItems=c.length)):(s.items=c,u&&(s.additionalItems=u));const{minimum:d,maximum:l}=e._zod.bag;"number"==typeof d&&(s.minItems=d),"number"==typeof l&&(s.maxItems=l)})(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function gh(e,t,n){const r=t instanceof cc;return new yh({type:"tuple",items:e,rest:r?t:null,...Vi(r?n:t)})}const _h=Ei("ZodRecord",(e,t)=>{hu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,a=o._zod.bag,c=a?.patterns;if("loose"===i.mode&&c&&c.size>0){const e=Wd(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const t of c)s.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(s.propertyNames=Wd(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=Wd(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=o._zod.values;if(u){const e=[...u].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(s.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function vh(e,t,n){return new _h({type:"record",keyType:e,valueType:t,...Vi(n)})}function bh(e,t,n){const r=Hi(e);return r._zod.values=void 0,new _h({type:"record",keyType:r,valueType:t,...Vi(n)})}function wh(e,t,n){return new _h({type:"record",keyType:e,valueType:t,mode:"loose",...Vi(n)})}const Sh=Ei("ZodMap",(e,t)=>{fu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Map cannot be represented in JSON Schema")})(0,e),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(Od(...t)),e.nonempty=t=>e.check(Od(1,t)),e.max=(...t)=>e.check(zd(...t)),e.size=(...t)=>e.check($d(...t))});function xh(e,t,n){return new Sh({type:"map",keyType:e,valueType:t,...Vi(n)})}const kh=Ei("ZodSet",(e,t)=>{yu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Set cannot be represented in JSON Schema")})(0,e),e.min=(...t)=>e.check(Od(...t)),e.nonempty=t=>e.check(Od(1,t)),e.max=(...t)=>e.check(zd(...t)),e.size=(...t)=>e.check($d(...t))});function Eh(e,t){return new kh({type:"set",valueType:e,...Vi(t)})}const zh=Ei("ZodEnum",(e,t)=>{_u.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=Ti(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const s={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);s[r]=t.entries[r]}return new zh({...t,checks:[],...Vi(r),entries:s})},e.exclude=(e,r)=>{const s={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete s[t]}return new zh({...t,checks:[],...Vi(r),entries:s})}});function Oh(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new zh({type:"enum",entries:n,...Vi(t)})}function $h(e,t){return new zh({type:"enum",entries:e,...Vi(t)})}const Ih=Ei("ZodLiteral",(e,t)=>{vu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,s=[];for(const e of r.values)if(void 0===e){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(e))}else s.push(e);if(0===s.length);else if(1===s.length){const e=s[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else s.every(e=>"number"==typeof e)&&(n.type="number"),s.every(e=>"string"==typeof e)&&(n.type="string"),s.every(e=>"boolean"==typeof e)&&(n.type="boolean"),s.every(e=>null===e)&&(n.type="null"),n.enum=s})(e,t,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Th(e,t){return new Ih({type:"literal",values:Array.isArray(e)?e:[e],...Vi(t)})}const Ph=Ei("ZodFile",(e,t)=>{bu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:o,mime:a}=e._zod.bag;void 0!==i&&(s.minLength=i),void 0!==o&&(s.maxLength=o),a?1===a.length?(s.contentMediaType=a[0],Object.assign(r,s)):(Object.assign(r,s),r.anyOf=a.map(e=>({contentMediaType:e}))):Object.assign(r,s)})(e,0,n),e.min=(t,n)=>e.check(Od(t,n)),e.max=(t,n)=>e.check(zd(t,n)),e.mime=(t,n)=>e.check(Fd(Array.isArray(t)?t:[t],n))});function Ah(e){return function(e,t){return new e({type:"file",...Vi(t)})}(Ph,e)}const Ch=Ei("ZodTransform",(e,t)=>{wu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Oi(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(oo(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(oo(t))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)}});function Nh(e){return new Ch({type:"transform",transform:e})}const jh=Ei("ZodOptional",(e,t)=>{xu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tl(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Rh(e){return new jh({type:"optional",innerType:e})}const Zh=Ei("ZodExactOptional",(e,t)=>{ku.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tl(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Dh(e){return new Zh({type:"optional",innerType:e})}const Fh=Ei("ZodNullable",(e,t)=>{Eu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i=Wd(s.innerType,t,r),o=t.seen.get(e);"openapi-3.0"===t.target?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mh(e){return new Fh({type:"nullable",innerType:e})}function Uh(e){return Rh(Mh(e))}const Lh=Ei("ZodDefault",(e,t)=>{zu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qh(e,t){return new Lh({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():Qi(t)}})}const Jh=Ei("ZodPrefault",(e,t)=>{$u.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qh(e,t){return new Jh({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():Qi(t)}})}const Bh=Ei("ZodNonOptional",(e,t)=>{Iu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Kh(e,t){return new Bh({type:"nonoptional",innerType:e,...Vi(t)})}const Wh=Ei("ZodSuccess",(e,t)=>{Pu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t),e.unwrap=()=>e._zod.def.innerType});function Hh(e){return new Wh({type:"success",innerType:e})}const Vh=Ei("ZodCatch",(e,t)=>{Au.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;let i;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Gh(e,t){return new Vh({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}const Yh=Ei("ZodNaN",(e,t)=>{Cu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema")})(0,e)});function Xh(e){return function(e,t){return new e({type:"nan",...Vi(t)})}(Yh,e)}const ef=Ei("ZodPipe",(e,t)=>{Nu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i="input"===t.io?"transform"===s.in._zod.def.type?s.out:s.in:s.out;Wd(i,t,r),t.seen.get(e).ref=i})(e,t,0,r),e.in=t.in,e.out=t.out});function tf(e,t){return new ef({type:"pipe",in:e,out:t})}const nf=Ei("ZodCodec",(e,t)=>{ef.init(e,t),Ru.init(e,t)});function rf(e,t,n){return new nf({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const sf=Ei("ZodReadonly",(e,t)=>{Fu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function of(e){return new sf({type:"readonly",innerType:e})}const af=Ei("ZodTemplateLiteral",(e,t)=>{Uu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=s.source})(e,0,n)});function cf(e,t){return new af({type:"template_literal",parts:e,...Vi(t)})}const uf=Ei("ZodLazy",(e,t)=>{Ju.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.innerType;Wd(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.unwrap=()=>e._zod.def.getter()});function df(e){return new uf({type:"lazy",getter:e})}const lf=Ei("ZodPromise",(e,t)=>{qu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function pf(e){return new lf({type:"promise",innerType:e})}const hf=Ei("ZodFunction",(e,t)=>{Lu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Function types cannot be represented in JSON Schema")})(0,e)});function ff(e){return new hf({type:"function",input:Array.isArray(e?.input)?gh(e?.input):e?.input??nh(Wp()),output:e?.output??Wp()})}const mf=Ei("ZodCustom",(e,t)=>{Qu.init(e,t),kl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});function yf(e){const t=new Ra({check:"custom"});return t._zod.check=e,t}function gf(e,t){return function(e,t,n){const r=Vi(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}(mf,e??(()=>!0),t)}function _f(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Vi(n)})}(mf,e,t)}function vf(e){return function(e){const t=function(e){const t=new Ra({check:"custom",...Vi(void 0)});return t._zod.check=e,t}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(oo(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(oo(r))}},e(n.value,n)));return t}(e)}const bf=function(e){const t=new Ra({check:"describe"});return t._zod.onattach=[t=>{const n=Wu.get(t)??{};Wu.add(t,{...n,description:e})}],t._zod.check=()=>{},t},wf=function(e){const t=new Ra({check:"meta"});return t._zod.onattach=[t=>{const n=Wu.get(t)??{};Wu.add(t,{...n,...e})}],t._zod.check=()=>{},t};function Sf(e,t={}){const n=new mf({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...Vi(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}const xf=(...e)=>function(e,t){const n=Vi(t);let r=n.truthy??["true","1","yes","on","y","enabled"],s=n.falsy??["false","0","no","off","n","disabled"];"sensitive"!==n.case&&(r=r.map(e=>"string"==typeof e?e.toLowerCase():e),s=s.map(e=>"string"==typeof e?e.toLowerCase():e));const i=new Set(r),o=new Set(s),a=e.Codec??Ru,c=e.Boolean??Fc,u=new a({type:"pipe",in:new(e.String??uc)({type:"string",error:n.error}),out:new c({type:"boolean",error:n.error}),transform:(e,t)=>{let r=e;return"sensitive"!==n.case&&(r=r.toLowerCase()),!!i.has(r)||!o.has(r)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...o],input:t.value,inst:u,continue:!1}),{})},reverseTransform:(e,t)=>!0===e?r[0]||"true":s[0]||"false",error:n.error});return u}({Codec:nf,Boolean:Ap,String:zl},...e);function kf(e){const t=df(()=>uh([Ol(e),Ep(),Cp(),Jp(),nh(t),vh(Ol(),t)]));return t}function Ef(e,t){return tf(Nh(e),t)}var zf;function Of(e){if("KW"!==e.country)throw new Error("The shipping address is not in Kuwait. Only Kuwaiti shipping addresses are supported.")}function $f(e,t){const n=e[t];return Of(n),{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:n.city,province:n.state.length>0?n.state:null,address_line_1:n.address_1,address_line_2:n.address_2.length>0?n.address_2:null},name:Cf(e)}}function If(e,t){const n=e[t];return Of(n),{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:[n.state,n.city].filter(e=>e.length>0).join(" --- "),province:null,address_line_1:n.address_1,address_line_2:n.address_2.length>0?n.address_2:null},name:Cf(e)}}function Tf(e,t){const n=e[t];Of(n);const r=Af(e,"_billing_piece")??"",s=Af(e,"_billing_name"),i=`BLOCK_FIELD: ${r} --- STREET_FIELD: ${n.postcode} --- HOUSE_FIELD: ${n.address_1} --- FLOOR_APT_FIELD: ${n.address_2}`;return{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:n.city,province:n.state.length>0?n.state:null,address_line_1:i,address_line_2:null},name:"string"==typeof s&&s.length>0?s:Cf(e)}}function Pf(e,t){const n=Af(e,"governorate")??"",r=["area1","area2","area3","area4","area5","area6"].map(t=>Af(e,t)??"").filter(e=>e.length>0),s=Af(e,"block")??"",i=Af(e,"street")??"",o=Af(e,"house")??"";return{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:r.join(" --- "),province:n.length>0?n:null,address_line_1:`BLOCK_FIELD: ${s} --- STREET_FIELD: ${i} --- HOUSE_FIELD: ${o}`,address_line_2:null},name:Cf(e)}}function Af(e,t){const n=e.meta_data.find(e=>e.key===t);return n&&"string"==typeof n.value?n.value:null}function Cf(e){const t=Nf(e.shipping.first_name,e.shipping.last_name);if(t.length>0)return t;const n=Nf(e.billing.first_name,e.billing.last_name);return n.length>0?n:(console.warn(`Order ${e.id} is missing customer name in both shipping address and billing address.`),"")}function Nf(e,t){const n=e.trim(),r=t.trim();return 0===n.length?"":r.length>0?`${n} ${r}`:n}zf||(zf={}),new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]),Ii({localeError:(()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(t){return e[t]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return e=>{switch(e.code){case"invalid_type":{const t=r[e.expected]??e.expected,n=function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(null===e)return"null";if(Array.isArray(e))return"array";const t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return t}(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case"invalid_value":return 1===e.values.length?`Invalid input: expected ${Gi(e.values[0])}`:`Invalid option: expected one of ${Pi(e.values,"|")}`;case"too_big":{const n=e.inclusive?"<=":"<",r=t(e.origin);return r?`Too big: expected ${e.origin??"value"} to have ${n}${e.maximum.toString()} ${r.unit??"elements"}`:`Too big: expected ${e.origin??"value"} to be ${n}${e.maximum.toString()}`}case"too_small":{const n=e.inclusive?">=":">",r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case"invalid_format":{const t=e;return"starts_with"===t.format?`Invalid string: must start with "${t.prefix}"`:"ends_with"===t.format?`Invalid string: must end with "${t.suffix}"`:"includes"===t.format?`Invalid string: must include "${t.includes}"`:"regex"===t.format?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${Pi(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`}}})()});const jf=ih({id:Ep(),order_key:Ol(),billing:ih({first_name:Ol(),last_name:Ol(),address_1:Ol(),address_2:Ol(),city:Ol(),state:Ol(),postcode:Ol(),country:Ol(),email:uh([Tl().trim(),Th("").transform(e=>e||null)]),phone:Ol()}),shipping:ih({first_name:Ol(),last_name:Ol(),company:Ol(),address_1:Ol(),address_2:Ol(),city:Ol(),state:Ol(),postcode:Ol(),country:Ol(),phone:Ol()}),meta_data:nh(ih({key:Ol(),value:Wp()})).default([])}),Rf=window.WORDPRESS_SITE_URL;xi("string"==typeof Rf&&Rf.length>0,"WORDPRESS_SITE_URL is not defined");const Zf=new URL(Rf).hostname,Df=window.JAAK_WORDPRESS_REST_ROOT;xi("string"==typeof Df&&Df.length>0,"JAAK_WORDPRESS_REST_ROOT is not defined");const Ff=window.JAAK_SITE_BASE_URL;xi("string"==typeof Ff&&Ff.length>0,"SITE_BASE_URL is not defined");const Mf=function(e,t){const n=function(e,t){if("string"!=typeof e||0===e.length)throw new Error(`${t} is missing or not a string.`);try{new URL(e)}catch{throw new Error(`${t} is not a valid URL: ${e}`)}return e}(e,"API_ROOT_URL");return Si(n,t).api}(Df,{headers:{"X-WP-Nonce":"string"==typeof window.wp_api_settings?.nonce?window.wp_api_settings.nonce:""}});async function Uf(e){console.debug(`Fetching WooCommerce orders: ${e.join(", ")}`);const t=`${Df}/orders`,n=window.wp_api_settings?.nonce;xi("string"==typeof n&&n.length>0,"WP Nonce is not defined");const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":n},credentials:"include",body:JSON.stringify({order_ids:e})});if(!r.ok)throw new ki({type:"api_error",title:"Failed to fetch orders from WordPress",detail:`${r.status} ${r.statusText}`});const s=await r.json();Wr({level:"debug",message:"[jaak-for-woocommerce] Raw order data from WordPress REST API",extra:{requested_order_ids:e,raw_response:s}});const i=nh(jf).parse(s);return console.debug(`Fetched ${i.length} order(s)`),i}function Lf(){const e=`${window.WORDPRESS_SITE_URL}/wp-admin/admin.php?page=wc-settings&tab=integration&section=jaak`;return(0,X.jsxs)("div",{className:"rounded border border-yellow-200 bg-yellow-50 px-4 py-3 text-yellow-800",children:[(0,X.jsxs)("p",{className:"text-sm",children:[(0,X.jsx)("strong",{children:"Configuration Required:"})," ","Jaak plugin is not configured. Please add your API key in the plugin settings to use this feature."]}),(0,X.jsx)("p",{className:"mt-2 text-sm",children:(0,X.jsx)("a",{href:e,className:"font-medium text-yellow-900 underline hover:text-yellow-700",children:"Go to Settings →"})})]})}function qf({error:e}){return e instanceof ki&&"unauthorized"===e.type?(0,X.jsxs)("div",{className:"rounded border border-yellow-200 bg-yellow-50 px-4 py-3 text-yellow-800",children:[(0,X.jsx)("p",{className:"text-sm font-semibold",children:e.title}),"string"==typeof e.detail&&e.detail.length>0&&(0,X.jsx)("p",{className:"mt-1 text-sm",children:e.detail})]}):e instanceof ki?(0,X.jsxs)("div",{className:"rounded border border-red-200 bg-red-50 px-4 py-3 text-red-800",children:[(0,X.jsx)("p",{className:"text-sm font-semibold",children:e.title}),"string"==typeof e.detail&&e.detail.length>0&&(0,X.jsxs)("details",{className:"mt-2",children:[(0,X.jsx)("summary",{className:"cursor-pointer text-xs",children:"Show error details"}),(0,X.jsx)("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap text-xs",children:e.detail})]})]}):(0,X.jsx)("div",{className:"rounded border border-red-200 bg-red-50 px-4 py-3 text-red-800",children:(0,X.jsxs)("p",{className:"text-sm",children:[e.name,": ",e.message]})})}function Jf({order_ids:e,on_close:t}){const n=function(e,t,n){const r=Y.useContext(de),s=Y.useContext(ue),i=te(n),o=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const u=i.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,n=e=>"static"===e?e:Math.max(e??t,t),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>n(r(...e)):n(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(o),((e,t,n)=>{const r=n?.state.error&&"function"==typeof e.throwOnError?I(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))})(o,s,u),(e=>{Y.useEffect(()=>{e.clearReset()},[e])})(s);const d=!i.getQueryCache().get(o.queryHash),[l]=Y.useState(()=>new t(i,o)),p=l.getOptimisticResult(o),h=!r&&!1!==e.subscribed;if(Y.useSyncExternalStore(Y.useCallback(e=>{const t=h?l.subscribe(P.batchCalls(e)):c;return l.updateResult(),t},[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Y.useEffect(()=>{l.setOptions(o)},[o,l]),((e,t)=>e?.suspense&&t.isPending)(o,p))throw le(o,l,s);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&void 0===e.data||I(n,[e.error,r])))({result:p,errorResetBoundary:s,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw p.error;if(i.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!a&&((e,t)=>e.isLoading&&e.isFetching&&!t)(p,r)){const e=d?le(o,l,s):u?.promise;e?.catch(c).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?p:l.trackResult(p)}({queryKey:["bulk-tasks",...e],queryFn:async()=>async function(e){console.debug(`Getting tasks for order keys: ${e.join(", ")}`);const t=await Mf.tasks.$get({query:{external_id:e}});if(401===t.status||403===t.status)throw new ki({type:"unauthorized",title:"Authentication Failed",detail:"Please check your API key configuration."});if(400===t.status){const e=await t.json();throw console.error("Bad request response data:",e),new ki({type:"bad_request",title:"Bad Request",detail:JSON.stringify(e,null,2)})}const n=(await t.json()).data;if(console.debug(`Got ${n.length} task(s)`),n[0])return n;if(0===n.length)return null;throw new Error("No tasks found")}((await Uf(e)).map(e=>e.order_key))},se,void 0);const r=function(e){const t=te(void 0),[n]=Y.useState(()=>new pe(t,e));Y.useEffect(()=>{n.setOptions(e)},[n,e]);const r=Y.useSyncExternalStore(Y.useCallback(e=>n.subscribe(P.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=Y.useCallback((e,t)=>{n.mutate(e,t).catch(c)},[n]);if(r.error&&I(n.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:s,mutateAsync:r.mutate}}({mutationFn:async()=>async function(e){console.debug(`Creating tasks for order IDs: ${e.join(", ")}`);const t=await Uf(e);console.debug(`Submitting tasks for ${t.length} order(s)`);const n=t.map(e=>function(e){const t=e.shipping.address_1.length>0?"shipping":"billing",n=!0===window.JAAK_IS_FORCE_DEFAULT_ADDRESS_PARSER,{parser:r,parser_name:s}=function(e,t={}){if(!0===t.force_default_address_parser)return{parser:$f,parser_name:"default_parser"};const n=e.toLowerCase();return n.endsWith("eitkw.com")?{parser:If,parser_name:"eit_parser"}:n.endsWith("gbc-kwt.com")?{parser:Tf,parser_name:"gbc_parser"}:n.endsWith("somedaykw.com")?{parser:Pf,parser_name:"someday_parser"}:{parser:$f,parser_name:"default_parser"}}(Zf,{force_default_address_parser:n}),i=r(e,t);return function(e,t){Wr({level:"debug",message:"[jaak-for-woocommerce] Order fields parsed",extra:{order_id:e.id,parser_name:t.parser_name,is_force_default_address_parser:t.is_force_default_address_parser,source_address_key:t.source_address_key,parsed_destination:t.parsed_order.destination,parsed_name:t.parsed_order.name}})}(e,{parser_name:s,source_address_key:t,parsed_order:i,is_force_default_address_parser:n}),{external_id:e.order_key,external_ref:e.id.toString(),external_url:`${Rf}/wp-admin/post.php?post=${e.id}&action=edit`,woocommerce_shop_domain:Rf,destination:i.destination,email:e.billing.email,phone:e.shipping.phone||e.billing.phone,name:i.name}}(e)),r=await Mf.tasks.$post({json:n});if(401===r.status||403===r.status)throw new ki({type:"unauthorized",title:"Authentication Failed",detail:"Please check your API key configuration."});if(!r.ok){let e="Failed to create tasks";try{const t=await r.json();e=JSON.stringify(t,null,2)}catch(e){console.error("Failed to parse error response:",e)}throw new ki({type:"bad_request",title:"Failed to create tasks",detail:e})}}(e),onSuccess:()=>{t()}});return!0===window.JAAK_IS_CONFIGURED?n.isPending?(0,X.jsx)("div",{className:"w-full max-w-2xl rounded-lg bg-white p-6 shadow-xl",children:(0,X.jsxs)("div",{className:"flex items-center justify-center",children:[(0,X.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-b-2 border-blue-600"}),(0,X.jsx)("span",{className:"ms-2",children:"Loading..."})]})}):(0,X.jsxs)("div",{className:"w-full max-w-2xl rounded-lg bg-white p-6 shadow-xl",children:[(0,X.jsx)("h2",{className:"mb-4 text-xl font-bold",children:"Send Orders to Jaak"}),(0,X.jsxs)("p",{className:"mb-2 font-semibold",children:["Do you want to send ",e.length," selected order(s) to Jaak?"]}),(0,X.jsx)("p",{className:"mb-4 text-sm italic text-gray-600",children:"Note that it may take a moment until all orders are available on your Jaak dashboard."}),n.isError&&(0,X.jsx)("div",{className:"mb-4",children:(0,X.jsx)(qf,{error:n.error})}),r.isError&&(0,X.jsx)("div",{className:"mb-4",children:(0,X.jsx)(qf,{error:r.error})}),n.data&&n.data.length>0&&(0,X.jsxs)("div",{className:"mb-4 rounded border border-blue-200 bg-blue-50 p-4",children:[(0,X.jsx)("p",{className:"mb-2 font-semibold",children:"Some selected orders already exist in Jaak:"}),(0,X.jsx)("ul",{className:"list-inside list-disc space-y-1",children:n.data.sort((e,t)=>"string"!=typeof e.external_ref||"string"!=typeof t.external_ref?0:t.external_ref.localeCompare(e.external_ref)).map(e=>(0,X.jsxs)("li",{className:"text-sm",children:["Order ",e.external_ref," already exists in Jaak (",(0,X.jsx)("a",{href:`${Ff}/tasks/${e.id}`,target:"_blank",rel:"noopener",className:"text-blue-600 hover:underline",children:"link"}),")"]},e.id))})]}),(0,X.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,X.jsx)("button",{type:"button",onClick:t,className:"rounded-md border border-gray-300 px-4 py-2 text-gray-700 hover:bg-gray-50",children:"Cancel"}),(0,X.jsx)("button",{type:"button",onClick:()=>r.mutate(),disabled:r.isPending,className:`rounded-md px-4 py-2 text-white ${r.isError?"bg-red-600 hover:bg-red-700":"bg-blue-600 hover:bg-blue-700"} disabled:cursor-not-allowed disabled:bg-gray-400`,children:r.isPending?"Sending...":"Send to Jaak"})]}),(0,X.jsx)("div",{className:"mt-4 text-end",children:(0,X.jsx)("a",{href:`${Ff}/docs`,target:"_blank",rel:"noopener",className:"text-sm text-blue-600 hover:underline",children:"Help"})})]}):(0,X.jsxs)("div",{className:"w-full max-w-2xl rounded-lg bg-white p-6 shadow-xl",children:[(0,X.jsx)("h2",{className:"mb-4 text-xl font-bold",children:"Send Orders to Jaak"}),(0,X.jsx)(Lf,{}),(0,X.jsx)("div",{className:"mt-4 flex justify-end",children:(0,X.jsx)("button",{type:"button",onClick:t,className:"rounded-md border border-gray-300 px-4 py-2 text-gray-700 hover:bg-gray-50",children:"Close"})})]})}const Qf=new class{#W;#g;#p;#H;#V;#G;#Y;#X;constructor(e={}){this.#W=e.queryCache||new Q,this.#g=e.mutationCache||new K,this.#p=e.defaultOptions||{},this.#H=new Map,this.#V=new Map,this.#G=0}mount(){this.#G++,1===this.#G&&(this.#Y=C.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#W.onFocus())}),this.#X=N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#W.onOnline())}))}unmount(){this.#G--,0===this.#G&&(this.#Y?.(),this.#Y=void 0,this.#X?.(),this.#X=void 0)}isFetching(e){return this.#W.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#g.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#W.build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(l(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#W.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#W.get(r.queryHash),i=s?.state.data,o=function(e,t){return"function"==typeof e?e(t):e}(t,i);if(void 0!==o)return this.#W.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return P.batch(()=>this.#W.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state}removeQueries(e){const t=this.#W;P.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const n=this.#W;return P.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=P.batch(()=>this.#W.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(c).catch(c)}invalidateQueries(e,t={}){return P.batch(()=>(this.#W.findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=P.batch(()=>this.#W.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(c)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(r).then(c)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=this.#W.build(this,t);return n.isStaleByTime(l(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(c).catch(c)}fetchInfiniteQuery(e){return e.behavior=H(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(c).catch(c)}ensureInfiniteQueryData(e){return e.behavior=H(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return N.isOnline()?this.#g.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#W}getMutationCache(){return this.#g}getDefaultOptions(){return this.#p}setDefaultOptions(e){this.#p=e}setQueryDefaults(e,t){this.#H.set(y(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#H.values()],n={};return t.forEach(t=>{g(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#V.set(y(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#V.values()],n={};return t.forEach(t=>{g(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#p.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=m(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===O&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#p.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#W.clear(),this.#g.clear()}};document.addEventListener("DOMContentLoaded",()=>{console.log("[Jaak] Bulk action script loaded");const e=document.getElementById("jaak-bulk-action-root");if(!e)return void console.log("[Jaak] Bulk action root not found");console.log("[Jaak] Bulk action root found:",e);const t=document.querySelector('select[name="action"]'),n=document.querySelector("#doaction");t&&n?(console.log("[Jaak] Bulk action controls found, adding event listener"),n.addEventListener("click",n=>{const r=t.value;if(console.log("[Jaak] Bulk action clicked:",r),"jaak_send_to_jaak"===r){n.preventDefault();const t=document.querySelectorAll('input[name="post[]"]:checked, input[name="id[]"]:checked'),r=Array.from(t).map(e=>Number.parseInt(e.value,10));if(console.log("[Jaak] Selected order IDs:",r),0===r.length)return void alert("Please select at least one order.");e.style.display="flex",console.log("[Jaak] Rendering bulk action modal");const s=(0,re.createRoot)(e);s.render((0,X.jsx)(ne,{client:Qf,children:(0,X.jsx)(Jf,{order_ids:r,on_close:()=>{console.log("[Jaak] Closing modal"),s.unmount(),e.style.display="none"}})}))}})):console.log("[Jaak] Bulk action controls not found")})})();
  • jaak-for-woocommerce/trunk/dist/metabox.asset.php

    r3657295 r3735564  
    1 <?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-element'), 'version' => 'e1897c8e21a0ff8dcd68');
     1<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-element'), 'version' => 'a37008905bc374b07bd6');
  • jaak-for-woocommerce/trunk/dist/metabox.js

    r3657295 r3735564  
    1 (()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{base64:()=>Yo,base64url:()=>Xo,bigint:()=>ua,boolean:()=>pa,browserEmail:()=>Jo,cidrv4:()=>Ho,cidrv6:()=>Go,cuid:()=>zo,cuid2:()=>Oo,date:()=>sa,datetime:()=>aa,domain:()=>ta,duration:()=>Ro,e164:()=>na,email:()=>Fo,emoji:()=>Ko,extendedDuration:()=>No,guid:()=>Ao,hex:()=>ga,hostname:()=>ea,html5Email:()=>Uo,idnEmail:()=>qo,integer:()=>da,ipv4:()=>Bo,ipv6:()=>Wo,ksuid:()=>To,lowercase:()=>ma,mac:()=>Vo,md5_base64:()=>wa,md5_base64url:()=>Sa,md5_hex:()=>ba,nanoid:()=>Po,null:()=>ha,number:()=>la,rfc5322Email:()=>Mo,sha1_base64:()=>Ea,sha1_base64url:()=>ka,sha1_hex:()=>xa,sha256_base64:()=>Oa,sha256_base64url:()=>$a,sha256_hex:()=>za,sha384_base64:()=>Ta,sha384_base64url:()=>Pa,sha384_hex:()=>Ia,sha512_base64:()=>Na,sha512_base64url:()=>Aa,sha512_hex:()=>Ra,string:()=>ca,time:()=>oa,ulid:()=>$o,undefined:()=>fa,unicodeEmail:()=>Lo,uppercase:()=>ya,uuid:()=>jo,uuid4:()=>Co,uuid6:()=>Do,uuid7:()=>Zo,xid:()=>Io});var n={};e.r(n),e.d(n,{endsWith:()=>Cd,gt:()=>_d,gte:()=>vd,includes:()=>Ad,length:()=>Td,lowercase:()=>Rd,lt:()=>yd,lte:()=>gd,maxLength:()=>$d,maxSize:()=>kd,mime:()=>Zd,minLength:()=>Id,minSize:()=>zd,multipleOf:()=>Ed,negative:()=>wd,nonnegative:()=>xd,nonpositive:()=>Sd,normalize:()=>Ud,overwrite:()=>Fd,positive:()=>bd,property:()=>Dd,regex:()=>Pd,size:()=>Od,slugify:()=>Jd,startsWith:()=>jd,toLowerCase:()=>Ld,toUpperCase:()=>qd,trim:()=>Md,uppercase:()=>Nd});var r={};e.r(r),e.d(r,{ZodISODate:()=>rl,ZodISODateTime:()=>tl,ZodISODuration:()=>al,ZodISOTime:()=>il,date:()=>sl,datetime:()=>nl,duration:()=>cl,time:()=>ol});var s={};e.r(s),e.d(s,{ZodAny:()=>Jp,ZodArray:()=>eh,ZodBase64:()=>dp,ZodBase64URL:()=>pp,ZodBigInt:()=>Np,ZodBigIntFormat:()=>jp,ZodBoolean:()=>Pp,ZodCIDRv4:()=>op,ZodCIDRv6:()=>cp,ZodCUID:()=>Jl,ZodCUID2:()=>Kl,ZodCatch:()=>Vh,ZodCodec:()=>tf,ZodCustom:()=>ff,ZodCustomStringFormat:()=>_p,ZodDate:()=>Yp,ZodDefault:()=>Mh,ZodDiscriminatedUnion:()=>lh,ZodE164:()=>fp,ZodEmail:()=>$l,ZodEmoji:()=>Ul,ZodEnum:()=>kh,ZodExactOptional:()=>Ch,ZodFile:()=>Th,ZodFunction:()=>pf,ZodGUID:()=>Tl,ZodIPv4:()=>ep,ZodIPv6:()=>sp,ZodIntersection:()=>hh,ZodJWT:()=>yp,ZodKSUID:()=>Yl,ZodLazy:()=>cf,ZodLiteral:()=>$h,ZodMAC:()=>np,ZodMap:()=>wh,ZodNaN:()=>Gh,ZodNanoID:()=>Ll,ZodNever:()=>Wp,ZodNonOptional:()=>Qh,ZodNull:()=>Lp,ZodNullable:()=>Zh,ZodNumber:()=>xp,ZodNumberFormat:()=>kp,ZodObject:()=>rh,ZodOptional:()=>Ah,ZodPipe:()=>Xh,ZodPrefault:()=>qh,ZodPromise:()=>df,ZodReadonly:()=>rf,ZodRecord:()=>gh,ZodSet:()=>xh,ZodString:()=>kl,ZodStringFormat:()=>Ol,ZodSuccess:()=>Bh,ZodSymbol:()=>Zp,ZodTemplateLiteral:()=>of,ZodTransform:()=>Rh,ZodTuple:()=>mh,ZodType:()=>xl,ZodULID:()=>Wl,ZodURL:()=>Dl,ZodUUID:()=>Rl,ZodUndefined:()=>Up,ZodUnion:()=>ah,ZodUnknown:()=>Kp,ZodVoid:()=>Hp,ZodXID:()=>Hl,ZodXor:()=>uh,_ZodString:()=>El,_default:()=>Lh,_function:()=>hf,any:()=>Qp,array:()=>th,base64:()=>lp,base64url:()=>hp,bigint:()=>Ap,boolean:()=>Rp,catch:()=>Hh,check:()=>mf,cidrv4:()=>ap,cidrv6:()=>up,codec:()=>nf,cuid:()=>Ql,cuid2:()=>Bl,custom:()=>yf,date:()=>Xp,describe:()=>vf,discriminatedUnion:()=>ph,e164:()=>mp,email:()=>Il,emoji:()=>Ml,enum:()=>zh,exactOptional:()=>Dh,file:()=>Ph,float32:()=>Op,float64:()=>$p,function:()=>hf,guid:()=>Pl,hash:()=>Sp,hex:()=>wp,hostname:()=>bp,httpUrl:()=>Fl,instanceof:()=>wf,int:()=>zp,int32:()=>Ip,int64:()=>Cp,intersection:()=>fh,ipv4:()=>tp,ipv6:()=>ip,json:()=>xf,jwt:()=>gp,keyof:()=>nh,ksuid:()=>Xl,lazy:()=>uf,literal:()=>Ih,looseObject:()=>oh,looseRecord:()=>bh,mac:()=>rp,map:()=>Sh,meta:()=>bf,nan:()=>Yh,nanoid:()=>ql,nativeEnum:()=>Oh,never:()=>Vp,nonoptional:()=>Kh,null:()=>qp,nullable:()=>Fh,nullish:()=>Uh,number:()=>Ep,object:()=>sh,optional:()=>jh,partialRecord:()=>vh,pipe:()=>ef,prefault:()=>Jh,preprocess:()=>Ef,promise:()=>lf,readonly:()=>sf,record:()=>_h,refine:()=>gf,set:()=>Eh,strictObject:()=>ih,string:()=>zl,stringFormat:()=>vp,stringbool:()=>Sf,success:()=>Wh,superRefine:()=>_f,symbol:()=>Fp,templateLiteral:()=>af,transform:()=>Nh,tuple:()=>yh,uint32:()=>Tp,uint64:()=>Dp,ulid:()=>Vl,undefined:()=>Mp,union:()=>ch,unknown:()=>Bp,url:()=>Zl,uuid:()=>Nl,uuidv4:()=>Al,uuidv6:()=>jl,uuidv7:()=>Cl,void:()=>Gp,xid:()=>Gl,xor:()=>dh});var i={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o=new class{#e=i;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},a="undefined"==typeof window||"Deno"in globalThis;function c(){}function u(e){return"number"==typeof e&&e>=0&&e!==1/0}function d(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function p(e,t){return"function"==typeof e?e(t):e}function h(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o)if(r){if(t.queryHash!==m(o,t.options))return!1}else if(!g(t.queryKey,o))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function f(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(y(t.options.mutationKey)!==y(i))return!1}else if(!g(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function m(e,t){return(t?.queryKeyHashFn||y)(e)}function y(e){return JSON.stringify(e,(e,t)=>S(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function g(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(n=>g(e[n],t[n]))}var _=Object.prototype.hasOwnProperty;function v(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=w(e)&&w(t);if(!(r||S(e)&&S(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),o=i.length,a=r?new Array(o):{};let c=0;for(let u=0;u<o;u++){const o=r?u:i[u],d=e[o],l=t[o];if(d===l){a[o]=d,(r?u<s:_.call(e,o))&&c++;continue}if(null===d||null===l||"object"!=typeof d||"object"!=typeof l){a[o]=l;continue}const p=v(d,l,n+1);a[o]=p,p===d&&c++}return s===o&&c===s?e:a}function b(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function S(e){if(!x(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!x(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?v(e,t):t}function k(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function z(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var O=Symbol();function $(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==O?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function I(e,t){return"function"==typeof e?e(...t):!!e}var T=function(e){setTimeout(e,0)},P=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},s=T;const i=r=>{t?e.push(r):s(()=>{n(r)})};return{batch:i=>{let o;t++;try{o=i()}finally{t--,t||(()=>{const t=e;e=[],t.length&&s(()=>{r(()=>{t.forEach(e=>{n(e)})})})})()}return o},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{s=e}}}(),R=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},N=new class extends R{#n;#r;#s;constructor(){super(),this.#s=e=>{if(!a&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#n!==e&&(this.#n=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#n?this.#n:"hidden"!==globalThis.document?.visibilityState}},A=new class extends R{#i=!0;#r;#s;constructor(){super(),this.#s=e=>{if(!a&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#i!==e&&(this.#i=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#i}};function j(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}function C(e){return Math.min(1e3*2**e,3e4)}function D(e){return"online"!==(e??"online")||A.isOnline()}var Z=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function F(e){let t,n=!1,r=0;const s=j(),i=()=>"pending"!==s.status,c=()=>N.isFocused()&&("always"===e.networkMode||A.isOnline())&&e.canRun(),u=()=>D(e.networkMode)&&e.canRun(),d=e=>{i()||(t?.(),s.resolve(e))},l=e=>{i()||(t?.(),s.reject(e))},p=()=>new Promise(n=>{t=e=>{(i()||c())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,i()||e.onContinue?.()}),h=()=>{if(i())return;let t;const s=0===r?e.initialPromise:void 0;try{t=s??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(d).catch(t=>{if(i())return;const s=e.retry??(a?0:3),u=e.retryDelay??C,d="function"==typeof u?u(r,t):u,f=!0===s||"number"==typeof s&&r<s||"function"==typeof s&&s(r,t);var m;!n&&f?(r++,e.onFail?.(r,t),(m=d,new Promise(e=>{o.setTimeout(e,m)})).then(()=>c()?void 0:p()).then(()=>{n?l(t):h()})):l(t)})};return{promise:s,status:()=>s.status,cancel:t=>{if(!i()){const n=new Z(t);l(n),e.onCancel?.(n)}},continue:()=>(t?.(),s),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:u,start:()=>(u()?h():p().then(h),s)}}var U=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),u(this.gcTime)&&(this.#o=o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a?1/0:3e5))}clearGcTimeout(){this.#o&&(o.clearTimeout(this.#o),this.#o=void 0)}},M=class extends U{#a;#c;#u;#d;#l;#p;#h;constructor(e){super(),this.#h=!1,this.#p=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#d=e.client,this.#u=this.#d.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=J(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(e){if(this.options={...this.#p,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=J(this.options);void 0!==e.data&&(this.setState(q(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){const n=E(this.state.data,e,this.options);return this.#f({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#l?.promise;return this.#l?.cancel(e),t?t.then(c).catch(c):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#a)}isActive(){return this.observers.some(e=>!1!==p(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===O||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===l(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!d(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#l&&(this.#h?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#l?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,n.signal)})},s=()=>{const e=$(this.options,t),n=(()=>{const e={client:this.#d,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#h=!1,this.options.persister?this.options.persister(e,n,this):e(n)},i=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#d,state:this.state,fetchFn:s};return r(e),e})();this.options.behavior?.onFetch(i,this),this.#c=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===i.fetchOptions?.meta||this.#f({type:"fetch",meta:i.fetchOptions?.meta}),this.#l=F({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:e=>{e instanceof Z&&e.revert&&this.setState({...this.#c,fetchStatus:"idle"}),n.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const e=await this.#l.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Z){if(e.silent)return this.#l.promise;if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#f({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...L(t.data,this.options),fetchMeta:e.meta??null};case"success":const n={...t,...q(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=e.manual?n:void 0,n;case"error":const r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function L(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:D(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function q(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function J(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Q=class extends R{constructor(e={}){super(),this.config=e,this.#m=new Map}#m;build(e,t,n){const r=t.queryKey,s=t.queryHash??m(r,t);let i=this.get(s);return i||(i=new M({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#m.has(e.queryHash)||(this.#m.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#m.get(e.queryHash);t&&(e.destroy(),t===e&&this.#m.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){P.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#m.get(e)}getAll(){return[...this.#m.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>h(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>h(e,t)):t}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){P.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){P.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},K=class extends U{#d;#y;#g;#l;constructor(e){super(),this.#d=e.client,this.mutationId=e.mutationId,this.#g=e.mutationCache,this.#y=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#y.includes(e)||(this.#y.push(e),this.clearGcTimeout(),this.#g.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#y=this.#y.filter(t=>t!==e),this.scheduleGc(),this.#g.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#y.length||("pending"===this.state.status?this.scheduleGc():this.#g.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#f({type:"continue"})},n={client:this.#d,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=F({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#g.canRun(this)});const r="pending"===this.state.status,s=!this.#l.canStart();try{if(r)t();else{this.#f({type:"pending",variables:e,isPaused:s}),this.#g.config.onMutate&&await this.#g.config.onMutate(e,this,n);const t=await(this.options.onMutate?.(e,n));t!==this.state.context&&this.#f({type:"pending",context:t,variables:e,isPaused:s})}const i=await this.#l.start();return await(this.#g.config.onSuccess?.(i,e,this.state.context,this,n)),await(this.options.onSuccess?.(i,e,this.state.context,n)),await(this.#g.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n)),await(this.options.onSettled?.(i,null,e,this.state.context,n)),this.#f({type:"success",data:i}),i}catch(t){try{await(this.#g.config.onError?.(t,e,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onError?.(t,e,this.state.context,n))}catch(e){Promise.reject(e)}try{await(this.#g.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onSettled?.(void 0,t,e,this.state.context,n))}catch(e){Promise.reject(e)}throw this.#f({type:"error",error:t}),t}finally{this.#g.runNext(this)}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),P.batch(()=>{this.#y.forEach(t=>{t.onMutationUpdate(e)}),this.#g.notify({mutation:this,type:"updated",action:e})})}},B=class extends R{constructor(e={}){super(),this.config=e,this.#_=new Set,this.#v=new Map,this.#b=0}#_;#v;#b;build(e,t,n){const r=new K({client:e,mutationCache:this,mutationId:++this.#b,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#_.add(e);const t=W(e);if("string"==typeof t){const n=this.#v.get(t);n?n.push(e):this.#v.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#_.delete(e)){const t=W(e);if("string"==typeof t){const n=this.#v.get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#v.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=W(e);if("string"==typeof t){const n=this.#v.get(t),r=n?.find(e=>"pending"===e.state.status);return!r||r===e}return!0}runNext(e){const t=W(e);if("string"==typeof t){const n=this.#v.get(t)?.find(t=>t!==e&&t.state.isPaused);return n?.continue()??Promise.resolve()}return Promise.resolve()}clear(){P.batch(()=>{this.#_.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#_.clear(),this.#v.clear()})}getAll(){return Array.from(this.#_)}find(e){const t={exact:!0,...e};return this.getAll().find(e=>f(t,e))}findAll(e={}){return this.getAll().filter(t=>f(e,t))}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return P.batch(()=>Promise.all(e.map(e=>e.continue().catch(c))))}};function W(e){return e.options.scope?.id}function V(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let n=!1;const u=e=>{!function(e,n,r){let s,i=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t.signal,i||(i=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)})}(e,0,()=>n=!0)},d=$(t.options,t.fetchOptions),l=async(e,r,s)=>{if(n)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);const i=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:s?"backward":"forward",meta:t.options.meta};return u(e),e})(),o=await d(i),{maxPages:a}=t.options,c=s?z:k;return{pages:c(e.pages,o,a),pageParams:c(e.pageParams,r,a)}};if(s&&i.length){const e="backward"===s,t={pages:i,pageParams:o},n=(e?G:H)(r,t);a=await l(t,n,e)}else{const t=e??i.length;do{const e=0===c?o[0]??r.initialPageParam:H(r,a);if(c>0&&null==e)break;a=await l(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function H(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function G(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}const Y=window.React,X=window.ReactJSXRuntime;var ee=Y.createContext(void 0),te=e=>{const t=Y.useContext(ee);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ne=({client:e,children:t})=>(Y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,X.jsx)(ee.Provider,{value:e,children:t}));const re=window.wp.element;var se=class extends R{constructor(e,t){super(),this.options=t,this.#d=e,this.#w=null,this.#S=j(),this.bindMethods(),this.setOptions(t)}#d;#x=void 0;#E=void 0;#k=void 0;#z;#O;#S;#w;#$;#I;#T;#P;#R;#N;#A=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#x.addObserver(this),ie(this.#x,this.options)?this.#j():this.updateResult(),this.#C())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oe(this.#x,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oe(this.#x,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#D(),this.#Z(),this.#x.removeObserver(this)}setOptions(e){const t=this.options,n=this.#x;if(this.options=this.#d.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof p(this.options.enabled,this.#x))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#F(),this.#x.setOptions(this.options),t._defaulted&&!b(this.options,t)&&this.#d.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#x,observer:this});const r=this.hasListeners();r&&ae(this.#x,n,this.options,t)&&this.#j(),this.updateResult(),!r||this.#x===n&&p(this.options.enabled,this.#x)===p(t.enabled,this.#x)&&l(this.options.staleTime,this.#x)===l(t.staleTime,this.#x)||this.#U();const s=this.#M();!r||this.#x===n&&p(this.options.enabled,this.#x)===p(t.enabled,this.#x)&&s===this.#N||this.#L(s)}getOptimisticResult(e){const t=this.#d.getQueryCache().build(this.#d,e),n=this.createResult(t,e);return r=n,!b(this.getCurrentResult(),r)&&(this.#k=n,this.#O=this.options,this.#z=this.#x.state),n;var r}getCurrentResult(){return this.#k}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#S.status||this.#S.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(e){this.#A.add(e)}getCurrentQuery(){return this.#x}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#d.defaultQueryOptions(e),n=this.#d.getQueryCache().build(this.#d,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#j({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#k))}#j(e){this.#F();let t=this.#x.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#U(){this.#D();const e=l(this.options.staleTime,this.#x);if(a||this.#k.isStale||!u(e))return;const t=d(this.#k.dataUpdatedAt,e)+1;this.#P=o.setTimeout(()=>{this.#k.isStale||this.updateResult()},t)}#M(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#x):this.options.refetchInterval)??!1}#L(e){this.#Z(),this.#N=e,!a&&!1!==p(this.options.enabled,this.#x)&&u(this.#N)&&0!==this.#N&&(this.#R=o.setInterval(()=>{(this.options.refetchIntervalInBackground||N.isFocused())&&this.#j()},this.#N))}#C(){this.#U(),this.#L(this.#M())}#D(){this.#P&&(o.clearTimeout(this.#P),this.#P=void 0)}#Z(){this.#R&&(o.clearInterval(this.#R),this.#R=void 0)}createResult(e,t){const n=this.#x,r=this.options,s=this.#k,i=this.#z,o=this.#O,a=e!==n?e.state:this.#E,{state:c}=e;let u,d={...c},l=!1;if(t._optimisticResults){const s=this.hasListeners(),i=!s&&ie(e,t),o=s&&ae(e,n,t,r);(i||o)&&(d={...d,...L(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:f,status:m}=d;u=d.data;let y=!1;if(void 0!==t.placeholderData&&void 0===u&&"pending"===m){let e;s?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=s.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#T?.state.data,this.#T):t.placeholderData,void 0!==e&&(m="success",u=E(s?.data,e,t),l=!0)}if(t.select&&void 0!==u&&!y)if(s&&u===i?.data&&t.select===this.#$)u=this.#I;else try{this.#$=t.select,u=t.select(u),u=E(s?.data,u,t),this.#I=u,this.#w=null}catch(e){this.#w=e}this.#w&&(h=this.#w,u=this.#I,f=Date.now(),m="error");const g="fetching"===d.fetchStatus,_="pending"===m,v="error"===m,b=_&&g,w=void 0!==u,S={status:m,fetchStatus:d.fetchStatus,isPending:_,isSuccess:"success"===m,isError:v,isInitialLoading:b,isLoading:b,data:u,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:f,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>a.dataUpdateCount||d.errorUpdateCount>a.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!w,isPaused:"paused"===d.fetchStatus,isPlaceholderData:l,isRefetchError:v&&w,isStale:ce(e,t),refetch:this.refetch,promise:this.#S,isEnabled:!1!==p(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==S.data,r="error"===S.status&&!t,s=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},i=()=>{const e=this.#S=S.promise=j();s(e)},o=this.#S;switch(o.status){case"pending":e.queryHash===n.queryHash&&s(o);break;case"fulfilled":(r||S.data!==o.value)&&i();break;case"rejected":r&&S.error===o.reason||i()}}return S}updateResult(){const e=this.#k,t=this.createResult(this.#x,this.options);this.#z=this.#x.state,this.#O=this.options,void 0!==this.#z.data&&(this.#T=this.#x),b(t,e)||(this.#k=t,this.#q({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!this.#A.size)return!0;const r=new Set(n??this.#A);return this.options.throwOnError&&r.add("error"),Object.keys(this.#k).some(t=>{const n=t;return this.#k[n]!==e[n]&&r.has(n)})})()}))}#F(){const e=this.#d.getQueryCache().build(this.#d,this.options);if(e===this.#x)return;const t=this.#x;this.#x=e,this.#E=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#C()}#q(e){P.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#k)}),this.#d.getQueryCache().notify({query:this.#x,type:"observerResultsUpdated"})})}};function ie(e,t){return function(e,t){return!1!==p(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&oe(e,t,t.refetchOnMount)}function oe(e,t,n){if(!1!==p(t.enabled,e)&&"static"!==l(t.staleTime,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&ce(e,t)}return!1}function ae(e,t,n,r){return(e!==t||!1===p(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&ce(e,n)}function ce(e,t){return!1!==p(t.enabled,e)&&e.isStaleByTime(l(t.staleTime,e))}var ue=Y.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),de=Y.createContext(!1),le=(de.Provider,(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()}));var pe=class extends R{#d;#k=void 0;#J;#Q;constructor(e,t){super(),this.#d=e,this.setOptions(t),this.bindMethods(),this.#K()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#d.defaultMutationOptions(e),b(this.options,t)||this.#d.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this}),t?.mutationKey&&this.options.mutationKey&&y(t.mutationKey)!==y(this.options.mutationKey)?this.reset():"pending"===this.#J?.state.status&&this.#J.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#J?.removeObserver(this)}onMutationUpdate(e){this.#K(),this.#q(e)}getCurrentResult(){return this.#k}reset(){this.#J?.removeObserver(this),this.#J=void 0,this.#K(),this.#q()}mutate(e,t){return this.#Q=t,this.#J?.removeObserver(this),this.#J=this.#d.getMutationCache().build(this.#d,this.options),this.#J.addObserver(this),this.#J.execute(e)}#K(){const e=this.#J?.state??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};this.#k={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#q(e){P.batch(()=>{if(this.#Q&&this.hasListeners()){const t=this.#k.variables,n=this.#k.context,r={client:this.#d,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===e?.type){try{this.#Q.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if("error"===e?.type){try{this.#Q.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#k)})})}};const he="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,fe="10.50.0",me=globalThis;function ye(){return ge(me),me}function ge(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||fe,t[fe]=t[fe]||{}}function _e(e,t,n=me){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[fe]=r[fe]||{};return s[e]||(s[e]=t())}const ve=["debug","info","warn","error","log","assert","trace"],be={};function we(e){if(!("console"in me))return e();const t=me.console,n={},r=Object.keys(be);r.forEach(e=>{const r=be[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function Se(){return Ee().enabled}function xe(e,...t){he&&Se()&&we(()=>{me.console[e](`Sentry Logger [${e}]:`,...t)})}function Ee(){return he?_e("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const ke=function(){Ee().enabled=!0},ze=function(...e){xe("log",...e)},Oe=function(...e){xe("warn",...e)},$e=function(...e){xe("error",...e)},Ie=[];function Te(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;if(t.forEach(e=>{e.isDefaultInstance=!0}),Array.isArray(n))r=[...t,...n];else if("function"==typeof n){const e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return function(e){const t={};return e.forEach(e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(r)}function Pe(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Re(e,t,n){if(n[t.name])he&&ze(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,Ie.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),Ie.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}["processSpan","processSegmentSpan"].forEach(n=>{const r=t[n];"function"==typeof r&&e.on(n,n=>r.call(t,n,e))}),he&&ze(`Integration installed: ${t.name}`)}}function Ne(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}const Ae=Object.prototype.toString;function je(e){switch(Ae.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Qe(e,Error)}}function Ce(e,t){return Ae.call(e)===`[object ${t}]`}function De(e){return Ce(e,"ErrorEvent")}function Ze(e){return Ce(e,"DOMError")}function Fe(e){return Ce(e,"String")}function Ue(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Me(e){return null===e||Ue(e)||"object"!=typeof e&&"function"!=typeof e}function Le(e){return Ce(e,"Object")}function qe(e){return"undefined"!=typeof Event&&Qe(e,Event)}function Je(e){return Boolean(e?.then&&"function"==typeof e.then)}function Qe(e,t){try{return e instanceof t}catch{return!1}}function Ke(e){return!("object"!=typeof e||null===e||!(e.__isVue||e._isVue||e.__v_isVNode))}function Be(e){return"undefined"!=typeof Request&&Qe(e,Request)}const We=me;function Ve(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,o=0;const a=" > ",c=a.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&i++<r&&(u=He(n,d),!("html"===u||i>1&&o+s.length*c+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function He(e,t){const n=e,r=[];if(!n?.tagName)return"";if(We.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(s?.length)s.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const e=n.className;if(e&&Fe(e)){const t=e.split(/\s+/);for(const e of t)r.push(`.${e}`)}}for(const e of["aria-label","type","name","title","alt"]){const t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join("")}function Ge(){try{return We.document.location.href}catch{return""}}function Ye(e,t,n){if(!(t in e))return;const r=e[t];if("function"!=typeof r)return;const s=n(r);"function"==typeof s&&et(s,r);try{e[t]=s}catch{he&&ze(`Failed to replace method "${t}" in object`,e)}}function Xe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{he&&ze(`Failed to add non-enumerable property "${t}" to object`,e)}}function et(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Xe(e,"__sentry_original__",t)}catch{}}function tt(e){return e.__sentry_original__}function nt(e){if(je(e))return{message:e.message,name:e.name,stack:e.stack,...st(e)};if(qe(e)){const t={type:e.type,target:rt(e.target),currentTarget:rt(e.currentTarget),...st(e)};return"undefined"!=typeof CustomEvent&&Qe(e,CustomEvent)&&(t.detail=e.detail),t}return e}function rt(e){try{return"undefined"!=typeof Element&&Qe(e,Element)?Ve(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function st(e){return"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e)):{}}let it,ot;function at(e){if(void 0!==it)return it?it(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=me;return t in n&&"function"==typeof n[t]?(it=n[t],it(e)):(it=null,e())}function ct(){return at(()=>Math.random())}function ut(){return at(()=>Date.now())}function dt(e=function(){const e=me;return e.crypto||e.msCrypto}()){try{if(e?.randomUUID)return at(()=>e.randomUUID()).replace(/-/g,"")}catch{}return ot||(ot=[1e7]+1e3+4e3+8e3+1e11),ot.replace(/[018]/g,e=>(e^(16*ct()&15)>>e/4).toString(16))}function lt(e){return e.exception?.values?.[0]}function pt(e){const{message:t,event_id:n}=e;if(t)return t;const r=lt(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ht(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function ft(e,t){const n=lt(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}}function mt(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{Xe(e,"__sentry_captured__",!0)}catch{}return!1}const yt="?",gt=/\(error: (.*)\)/,_t=/captureMessage|captureException/;function vt(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{const s=[],i=e.split("\n");for(let e=n;e<i.length;e++){let n=i[e];n.length>1024&&(n=n.slice(0,1024));const o=gt.test(n)?n.replace(gt,"$1"):n;if(!o.includes("Error: ")){for(const e of t){const t=e(o);if(t){s.push(t);break}}if(s.length>=50+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(bt(t).function||"")&&t.pop(),t.reverse(),_t.test(bt(t).function||"")&&(t.pop(),_t.test(bt(t).function||"")&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||bt(t).filename,function:e.function||yt}))}(s.slice(r))}}function bt(e){return e[e.length-1]||{}}const wt="<anonymous>";function St(e){try{return e&&"function"==typeof e&&e.name||wt}catch{return wt}}function xt(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function Et(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function kt(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function zt(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{Ke(r)?n.push(Et(r)):n.push(String(r))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Ot(e,t,n=!1){return!!Fe(e)&&(Ce(t,"RegExp")?t.test(e):Fe(t)?n?e===t:e.includes(t):"function"==typeof t&&t(e))}function $t(e,t=[],n=!1){return t.some(t=>Ot(e,t,n))}const It=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],Tt=(e={})=>{let t;return{name:"EventFilters",setup(n){const r=n.getOptions();t=Rt(e,r)},processEvent(n,r,s){if(!t){const n=s.getOptions();t=Rt(e,n)}return function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(!t?.length)return!1;const n=e.transaction;return!!n&&$t(n,t)}(e,t.ignoreTransactions))return he&&Oe(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${pt(e)}`),!0}else{if(function(e,t){return!!t?.length&&Ne(e).some(e=>$t(e,t))}(e,t.ignoreErrors))return he&&Oe(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${pt(e)}`),!0;if(function(e){return!!e.exception?.values?.length&&(!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return he&&Oe(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${pt(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=Nt(e);return!!n&&$t(n,t)}(e,t.denyUrls))return he&&Oe(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${pt(e)}.\nUrl: ${Nt(e)}`),!0;if(!function(e,t){if(!t?.length)return!0;const n=Nt(e);return!n||$t(n,t)}(e,t.allowUrls))return he&&Oe(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${pt(e)}.\nUrl: ${Nt(e)}`),!0}return!1}(n,t)?null:n}}},Pt=(e={})=>({...Tt(e),name:"InboundFilters"});function Rt(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:It],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Nt(e){try{const t=[...e.exception?.values??[]].reverse().find(e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length),n=t?.stacktrace?.frames;return n?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch{return he&&$e(`Cannot extract url for event ${pt(e)}`),null}}function At(){return ut()/1e3}let jt;function Ct(){return(jt??(jt=function(){const{performance:e}=me;if(!e?.now||!e.timeOrigin)return At;const t=e.timeOrigin;return()=>(t+at(()=>e.now()))/1e3}()))()}function Dt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Ct(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:dt()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Zt(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&0===Object.keys(t).length)return e;const r={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=Zt(r[e],t[e],n-1));return r}function Ft(){return dt()}function Ut(){return dt().substring(16)}const Mt="_sentrySpan";function Lt(e,t){t?Xe(e,Mt,t):delete e[Mt]}function qt(e){return e[Mt]}class Jt{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ft(),sampleRand:ct()}}clone(){const e=new Jt;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,Lt(e,qt(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Dt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,n=t instanceof Jt?t.getScopeData():Le(t)?e:void 0,{tags:r,attributes:s,extra:i,user:o,contexts:a,level:c,fingerprint:u=[],propagationContext:d,conversationId:l}=n||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...a},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),l&&(this._conversationId=l),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Lt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ft(),sampleRand:ct()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:At(),...e,message:e.message?kt(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:qt(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Zt(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t?.event_id||dt();if(!this._client)return he&&Oe("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n?.event_id||dt();if(!this._client)return he&&Oe("No client configured on scope - will not capture message!"),r;const s=n?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:s,...n,event_id:r},this),r}captureEvent(e,t){const n=e.event_id||t?.event_id||dt();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(he&&Oe("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const Qt=e=>e instanceof Promise&&!e[Kt],Kt=Symbol("chained PromiseLike");class Bt{constructor(e,t){let n,r;n=e||new Jt,r=t||new Jt,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(e){throw this._popScope(),e}return Je(n)?((e,t,n)=>{const r=e.then(e=>(t(),e),e=>{throw n(),e});return Qt(r)&&Qt(e)?r:((e,t)=>{let n=!1;for(const r in e){if(r in t)continue;n=!0;const s=e[r];"function"==typeof s?Object.defineProperty(t,r,{value:(...t)=>s.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=s}return n&&Object.assign(t,{[Kt]:!0}),t})(e,r)})(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1||!this._stack.pop())}}function Wt(){const e=ge(ye());return e.stack=e.stack||new Bt(_e("defaultCurrentScope",()=>new Jt),_e("defaultIsolationScope",()=>new Jt))}function Vt(e){return Wt().withScope(e)}function Ht(e,t){const n=Wt();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Gt(e){return Wt().withScope(()=>e(Wt().getIsolationScope()))}function Yt(e){const t=ge(e);return t.acs?t.acs:{withIsolationScope:Gt,withScope:Vt,withSetScope:Ht,withSetIsolationScope:(e,t)=>Gt(t),getCurrentScope:()=>Wt().getScope(),getIsolationScope:()=>Wt().getIsolationScope()}}let Xt;function en(){return Yt(ye()).getCurrentScope()}function tn(){return Yt(ye()).getIsolationScope()}function nn(){return en().getClient()}function rn(e){const t=void 0;const n=e.getPropagationContext(),{traceId:r,parentSpanId:s,propagationSpanId:i}=n,o={trace_id:r,span_id:i||Ut()};return s&&(o.parent_span_id=s),o}const sn=new WeakMap,on=()=>({name:"FunctionToString",setupOnce(){Xt=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=tt(this),n=sn.has(nn())&&void 0!==t?t:this;return Xt.apply(n,e)}}catch{}},setup(e){sn.set(e,!0)}}),an="sentry.profile_id",cn="sentry.exclusive_time";function un(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}}function dn(e){const t=e;return{scope:t._sentryScope,isolationScope:un(t._sentryIsolationScope)}}let ln=!1;function pn(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:yn(e).parent_span_id,i=dn(e).scope;return{parent_span_id:s,span_id:r?i?.getPropagationContext().propagationSpanId||Ut():t,trace_id:n}}function hn(e){return e&&e.length>0?e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:s})=>({span_id:e,trace_id:t,sampled:1===n,attributes:s,...r})):void 0}function fn(e){return"number"==typeof e?mn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?mn(e.getTime()):Ct()}function mn(e){return e>9999999999?e/1e3:e}function yn(e){if(function(e){return"function"==typeof e.getSpanJSON}(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(e)){const{attributes:r,startTime:s,name:i,endTime:o,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:gn(e),start_timestamp:fn(s),timestamp:fn(o)||void 0,status:vn(a),op:r["sentry.op"],origin:r["sentry.origin"],links:hn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function gn(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function vn(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"internal_error"}const bn=function(e){return e._sentryRootSpan||e};function wn(){ln||(we(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),ln=!0)}const Sn=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!En(e,t)&&!!xn(e,t))))}(e,t)||!!function(e,t){const n=kn(t),r=kn(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!En(e,t)&&!!xn(e,t)))}(e,t))}(t,e))return he&&Oe("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function xn(e,t){let n=xt(e),r=xt(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],s=n[e];if(t.filename!==s.filename||t.lineno!==s.lineno||t.colno!==s.colno||t.function!==s.function)return!1}return!0}function En(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch{return!1}}function kn(e){return e.exception?.values?.[0]}const zn="production",On=/^o(\d+)\./,$n=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function In(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${o}`}function Tn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Pn(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=function(e){const t=e.match(On);return t?.[1]}(n)),r}function Rn(e,t=100,n=1/0){try{return An("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Nn(e,t=3,n=102400){const r=Rn(e,t);return s=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(s))>n?Nn(e,t-1,n):r;var s}function An(e,t,n=1/0,r=1/0,s=function(){const e=new WeakSet;return[function(t){return!!e.has(t)||(e.add(t),!1)},function(t){e.delete(t)}]}()){const[i,o]=s;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const a=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof globalThis&&t===globalThis)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(Ke(t))return Et(t);if(Le(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n)return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${St(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}var n}(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const c="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===c)return a.replace("object ","");if(i(t))return"[Circular ~]";const u=t;if(u&&"function"==typeof u.toJSON)try{return An("",u.toJSON(),c-1,r,s)}catch{}const d=Array.isArray(t)?[]:{};let l=0;const p=nt(t);for(const e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(l>=r){d[e]="[MaxProperties ~]";break}const t=p[e];d[e]=An(e,t,c-1,r,s),l++}return o(t),d}function jn(e,t=[]){return[e,t]}function Cn(e,t){const[n,r]=e;return[n,[...r,t]]}function Dn(e,t){const n=e[1];for(const e of n)if(t(e,e[0].type))return!0;return!1}function Zn(e){const t=ge(me);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function Fn(e){const[t,n]=e;let r=JSON.stringify(t);function s(e){"string"==typeof r?r="string"==typeof e?r+e:[Zn(r),e]:r.push("string"==typeof e?Zn(e):e)}for(const e of n){const[t,n]=e;if(s(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)s(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(Rn(n))}s(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(r)}function Un(e){const t="string"==typeof e.data?Zn(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Mn={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function Ln(e){return function(e){return e in Mn}(e)?Mn[e]:e}function qn(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Jn(e,t){const n=t??function(e){return Qn().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=In(r)),jn(s,[(i=e,[{type:"log",item_count:i.length,content_type:"application/vnd.sentry.items.log+json"},{items:i}])]);var i}(n,r._metadata,r.tunnel,e.getDsn());Qn().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function Qn(){return _e("clientToLogBufferMap",()=>new WeakMap)}function Kn(e,t){const n=t??function(e){return Bn().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=In(r)),jn(s,[(i=e,[{type:"trace_metric",item_count:i.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:i}])]);var i}(n,r._metadata,r.tunnel,e.getDsn());Bn().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Bn(){return _e("clientToMetricBufferMap",()=>new WeakMap)}function Wn(e){return e.split(",").map(e=>{const t=e.indexOf("=");return-1===t?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function Vn(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s={environment:n.environment||zn,release:n.release,public_key:r,trace_id:e,org_id:Pn(t)};return t.emit("createDsc",s),s}function Hn(e){const t=nn();if(!t)return{};const n=bn(e),r=yn(n),s=r.data,i=n.spanContext().traceState,o=i?.get("sentry.sample_rate")??s["sentry.sample_rate"]??s["sentry.previous_trace_sample_rate"];function a(e){return"number"!=typeof o&&"string"!=typeof o||(e.sample_rate=`${o}`),e}const c=n._frozenDsc;if(c)return a(c);const u=i?.get("sentry.dsc"),d=u&&function(e){const t=function(e){if(e&&(Fe(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{const n=Wn(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Wn(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>(t.startsWith("sentry-")&&(e[t.slice(7)]=n),e),{});return Object.keys(n).length>0?n:void 0}(u);if(d)return a(d);const l=Vn(e.spanContext().traceId,t),p=s["sentry.source"]??s["sentry.span.source"],h=r.description;return"url"!==p&&h&&(l.transaction=h),function(){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=nn()?.getOptions();return!(!e||null==e.tracesSampleRate&&!e.tracesSampler)}()&&(l.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return 1===t}(n)),l.sample_rand=i?.get("sentry.sample_rand")??dn(n).scope?.getPropagationContext().sampleRand.toString()),a(l),t.emit("createDsc",l,n),l}function Gn(e){return new Xn(t=>{t(e)})}function Yn(e){return new Xn((t,n)=>{n(e)})}class Xn{constructor(e){this._state=0,this._handlers=[],this._runExecutor(e)}then(e,t){return new Xn((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new Xn((t,n)=>{let r,s;return this.then(t=>{s=!1,r=t,e&&e()},t=>{s=!0,r=t,e&&e()}).then(()=>{s?n(r):t(r)})})}_executeHandlers(){if(0===this._state)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(1===this._state&&e[1](this._value),2===this._state&&e[2](this._value),e[0]=!0)})}_runExecutor(e){const t=(e,t)=>{0===this._state&&(Je(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(1,e)},r=e=>{t(2,e)};try{e(n,r)}catch(e){r(e)}}}function er(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}const tr=Symbol.for("SentryBufferFullError");function nr(e=100){const t=new Set;function n(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(r){if(!(t.size<e))return Yn(tr);const s=r();return t.add(s),s.then(()=>n(s),()=>n(s)),s},drain:function(e){if(!t.size)return Gn(!0);const n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;const r=[n,new Promise(t=>er(setTimeout(()=>t(!1),e)))];return Promise.race(r)}}}function rr(e,t,n=nr(e.bufferSize||64)){let r={};return{send:function(s){const i=[];if(Dn(s,(t,n)=>{const s=Ln(n);!function(e,t,n=ut()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,s)?i.push(t):e.recordDroppedEvent("ratelimit_backoff",s)}),0===i.length)return Promise.resolve({});const o=jn(s[0],i),a=t=>{!function(e,t){return Dn(e,(e,n)=>t.includes(n))}(o,["client_report"])?Dn(o,(n,r)=>{e.recordDroppedEvent(t,Ln(r))}):he&&Oe(`Dropping client report. Will not send outcomes (reason: ${t}).`)};return n.add(()=>t({body:Fn(o)}).then(e=>413===e.statusCode?(he&&$e("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),a("send_error"),e):(he&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Oe(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=ut()){const s={...e},i=n?.["x-sentry-rate-limits"],o=n?.["retry-after"];if(i)for(const e of i.trim().split(",")){const[t,n,,,i]=e.split(":",5),o=parseInt(t,10),a=1e3*(isNaN(o)?60:o);if(n)for(const e of n.split(";"))"metric_bucket"===e&&i&&!i.split(";").includes("custom")||(s[e]=r+a);else s.all=r+a}else o?s.all=r+function(e,t=ut()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(o,r):429===t&&(s.all=r+6e4);return s}(r,e),e),e=>{throw a("network_error"),he&&$e("Encountered error running transport request:",e),e})).then(e=>e,e=>{if(e===tr)return he&&$e("Skipped sending event because buffer is full."),a("queue_overflow"),Promise.resolve({});throw e})},flush:e=>n.drain(e)}}function sr(e,t,n,r=0){try{const s=ir(t,n,e,r);return Je(s)?s:Gn(s)}catch(e){return Yn(e)}}function ir(e,t,n,r){const s=n[r];if(!e||!s)return e;const i=s({...e},t);return he&&null===i&&ze(`Event processor "${s.id||"?"}" dropped event`),Je(i)?i.then(e=>ir(e,t,n,r+1)):ir(i,t,n,r+1)}let or,ar,cr,ur;function dr(e,t){const{extra:n,tags:r,attributes:s,user:i,contexts:o,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:d,eventProcessors:l,attachments:p,propagationContext:h,transactionName:f,span:m}=t;lr(e,"extra",n),lr(e,"tags",r),lr(e,"attributes",s),lr(e,"user",i),lr(e,"contexts",o),e.sdkProcessingMetadata=Zt(e.sdkProcessingMetadata,c,2),a&&(e.level=a),f&&(e.transactionName=f),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...h}}function lr(e,t,n){e[t]=Zt(e[t],n,1)}function pr(e,t){const n=_e("globalScope",()=>new Jt).getScopeData();return e&&dr(n,e.getScopeData()),t&&dr(n,t.getScopeData()),n}function hr(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||dt(),timestamp:t.timestamp||At()},u=n.integrations||e.integrations.map(e=>e.name);!function(e,t){const{environment:n,release:r,dist:s,maxValueLength:i}=t;e.environment=e.environment||n||zn,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s);const o=e.request;o?.url&&i&&(o.url=kt(o.url,i)),i&&e.exception?.values?.forEach(e=>{e.value&&(e.value=kt(e.value,i))})}(c,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(c,u),s&&s.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=function(e){const t=me._sentryDebugIds,n=me._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],s=n?Object.keys(n):[];if(ur&&r.length===ar&&s.length===cr)return ur;ar=r.length,cr=s.length,ur={},or||(or={});const i=(t,n)=>{for(const r of t){const t=n[r],s=or?.[r];if(s&&ur&&t)ur[s[0]]=t,or&&(or[r]=[s[0],t]);else if(t){const n=e(r);for(let e=n.length-1;e>=0;e--){const s=n[e],i=s?.filename;if(i&&ur&&or){ur[i]=t,or[r]=[i,t];break}}}}};return t&&i(r,t),n&&i(s,n),ur}(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}(c,e.stackParser);const d=function(e,t){if(!t)return e;const n=e?e.clone():new Jt;return n.update(t),n}(r,n.captureContext);n.mechanism&&ft(c,n.mechanism);const l=s?s.getEventProcessors():[],p=pr(i,d),h=[...n.attachments||[],...p.attachments];h.length&&(n.attachments=h),function(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;!function(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),o&&(e.level=o),a&&"transaction"!==e.type&&(e.transaction=a)}(e,t),r&&function(e,t){e.contexts={trace:pn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Hn(t),...e.sdkProcessingMetadata};const n=yn(bn(t)).description;n&&!e.transaction&&"transaction"===e.type&&(e.transaction=n)}(e,r),function(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,s),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,i)}(c,p);const f=[...l,...p.eventProcessors];return(n.data&&!0===n.data.__sentry__?Gn(c):sr(f,c,n)).then(e=>(e&&function(e){const t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof o&&o>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Rn(e.data,t,n)}}))},...e.user&&{user:Rn(e.user,t,n)},...e.contexts&&{contexts:Rn(e.contexts,t,n)},...e.extra&&{extra:Rn(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Rn(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:Rn(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Rn(e.contexts.flags,3,n)),r}(e,o,a):e))}const fr=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function mr(e){ze(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function yr(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(_r(n)){if(Ot(e.description,n))return he&&mr(e),!0;continue}if(!n.name&&!n.op)continue;const t=!n.name||Ot(e.description,n.name),r=!n.op||e.op&&Ot(e.op,n.op);if(t&&r)return he&&mr(e),!0}return!1}function gr(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function _r(e){return"string"==typeof e||e instanceof RegExp}const vr="Not capturing exception because it's already been captured.",br="Discarded session because of missing or non-string release",wr=Symbol.for("SentryInternalError"),Sr=Symbol.for("SentryDoNotSendEventError");function xr(e){return{message:e,[wr]:!0}}function Er(e){return{message:e,[Sr]:!0}}function kr(e){return!!e&&"object"==typeof e&&wr in e}function zr(e){return!!e&&"object"==typeof e&&Sr in e}function Or(e,t,n,r,s){let i,o=0,a=!1;e.on(n,()=>{o=0,clearTimeout(i),a=!1}),e.on(t,t=>{o+=r(t),o>=8e5?s(e):a||(a=!0,i=er(setTimeout(()=>{s(e)},5e3)))}),e.on("flush",()=>{s(e)})}class $r{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=nr(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=$n.exec(e);if(!t)return void we(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});const[n,r,s="",i="",o="",a=""]=t.slice(1);let c="",u=a;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return Tn({host:i,pass:s,path:c,projectId:u,port:o,protocol:n,publicKey:r})}(e):Tn(e);if(t&&function(e){if(!he)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&($e(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&($e(`Invalid Sentry Dsn: Invalid port ${t}`),1):($e(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):($e(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):he&&Oe("No DSN provided, client will not send events."),this._dsn){const s=(t=this._dsn,n=e.tunnel,r=e._metadata?e._metadata.sdk:void 0,n||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(t)}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(t,r)}`);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:s})}var t,n,r;this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Or(this,"afterCaptureLog","flushLogs",Nr,Jn),(this._options.enableMetrics??this._options._experiments?.enableMetrics??1)&&Or(this,"afterCaptureMetric","flushMetrics",Rr,Kn)}captureException(e,t,n){const r=dt();if(mt(e))return he&&ze(vr),r;const s={event_id:r,...t};return this._process(()=>this.eventFromException(e,s).then(e=>this._captureEvent(e,s,n)).then(e=>e),"error"),s.event_id}captureMessage(e,t,n,r){const s={event_id:dt(),...n},i=Ue(e)?e:String(e),o=Me(e),a=o?this.eventFromMessage(i,t,s):this.eventFromException(e,s);return this._process(()=>a.then(e=>this._captureEvent(e,s,r)),o?"unknown":"error"),s.event_id}captureEvent(e,t,n){const r=dt();if(t?.originalException&&mt(t.originalException))return he&&ze(vr),r;const s={event_id:r,...t},i=e.sdkProcessingMetadata||{},o=i.capturedSpanScope,a=i.capturedSpanIsolationScope,c=Ir(e.type);return this._process(()=>this._captureEvent(e,s,o||n,a),c),s.event_id}captureSession(e){this.sendSession(e),Dt(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(!t)return!0;this.emit("flush");const n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){Jn(this);const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),Re(this,e,this._integrations),t||Pe(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){const s=qn(n),i=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){if(!t)return e;const n=e.sdk||{};e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0}}(e,n?.sdk);const o=function(e,t,n,r){const s=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:In(r)},...s&&{trace:s}}}(e,s,r,t);return delete e.sdkProcessingMetadata,jn(o,[[{type:i},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Cn(n,Un(e));this.sendEnvelope(n).then(t=>this.emit("afterSendEvent",e,t))}sendSession(e){const{release:t,environment:n=zn}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(he&&Oe(br));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(he&&Oe(br));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=function(e,t,n,r){const s=qn(n);return jn({sent_at:(new Date).toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:In(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){const r=`${e}:${t}`;he&&ze(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return he&&$e("Error while sending envelope:",e),{}}return he&&$e("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&Re(e,t,n)}),n}(this,e),Pe(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const s=t.exception?.values;if(s){r=!0,n=!1;for(const e of s)if(!1===e.mechanism?.handled){n=!0;break}}const i="ok"===e.status;(i&&0===e.errors||i&&n)&&(Dt(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const s=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i?.length&&(t.integrations=i),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),hr(s,e,t,n,this,r).then(e=>{if(null===e)return e;this.emit("postprocessEvent",e,t),e.contexts={trace:{...e.contexts?.trace,...rn(n)},...e.contexts};const r=function(e,t){const n=t.getPropagationContext();return n.dsc||Vn(n.traceId,e)}(this,n);return e.sdkProcessingMetadata={dynamicSamplingContext:r,...e.sdkProcessingMetadata},e})}_captureEvent(e,t={},n=en(),r=tn()){return he&&Tr(e)&&ze(`Captured error event \`${Ne(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{he&&(zr(e)?ze(e.message):kr(e)?Oe(e.message):Oe(e))})}_processEvent(e,t,n,r){const s=this.getOptions(),{sampleRate:i}=s,o=Pr(e),a=Tr(e),c=`before send for type \`${e.type||"error"}\``,u=void 0===i?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}(i);if(a&&"number"==typeof u&&ct()>u)return this.recordDroppedEvent("sample_rate","error"),Yn(Er(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const d=Ir(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(null===e)throw this.recordDroppedEvent("event_processor",d),Er("An event processor returned `null`, will not send event.");if(!0===t.data?.__sentry__)return e;const n=function(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,ignoreSpans:o}=t,a=!((c=t.beforeSendSpan)&&"function"==typeof c&&"_streamed"in c&&c._streamed)&&t.beforeSendSpan;var c;let u=n;if(Tr(u)&&s)return s(u,r);if(Pr(u)){if(a||o){const t=function(e){const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:a}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o?.[an],exclusive_time:o?.[cn],measurements:e.measurements,is_segment:!0}}(u);if(o?.length&&yr(t,o))return null;if(a){const e=a(t);e?u=Zt(n,{type:"transaction",timestamp:(d=e).timestamp,start_timestamp:d.start_timestamp,transaction:d.description,contexts:{trace:{trace_id:d.trace_id,span_id:d.span_id,parent_span_id:d.parent_span_id,op:d.op,status:d.status,origin:d.origin,data:{...d.data,...d.profile_id&&{[an]:d.profile_id},...d.exclusive_time&&{[cn]:d.exclusive_time}}}},measurements:d.measurements}):wn()}if(u.spans){const t=[],n=u.spans;for(const e of n)if(o?.length&&yr(e,o))gr(n,e);else if(a){const n=a(e);n?t.push(n):(wn(),t.push(e))}else t.push(e);const r=u.spans.length-t.length;r&&e.recordDroppedEvent("before_send","span",r),u.spans=t}}if(i){if(u.spans){const e=u.spans.length;u.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return i(u,r)}}var d;return u}(this,s,e,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Je(e))return e.then(e=>{if(!Le(e)&&null!==e)throw xr(n);return e},e=>{throw xr(`${t} rejected with ${e}`)});if(!Le(e)&&null!==e)throw xr(n);return e}(n,c)}).then(s=>{if(null===s){if(this.recordDroppedEvent("before_send",d),o){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw Er(`${c} returned \`null\`, will not send event.`)}const i=n.getSession()||r.getSession();if(a&&i&&this._updateSessionFromEvent(i,s),o){const e=(s.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(s.spans?s.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const u=s.transaction_info;if(o&&u&&s.transaction!==e.transaction){const e="custom";s.transaction_info={...u,source:e}}return this.sendEvent(s,t),s}).then(null,e=>{if(zr(e)||kr(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),xr(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===tr&&this.recordDroppedEvent("queue_overflow",t),e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){he&&ze("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(he&&ze("No outcomes to send"));if(!this._dsn)return void(he&&ze("No dsn provided, will not send outcomes"));he&&ze("Sending outcomes:",e);const t=(n=e,jn((r=this._options.tunnel&&In(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:At(),discarded_events:n}]]));var n,r;this.sendEnvelope(t)}}function Ir(e){return"replay_event"===e?"replay":e||"error"}function Tr(e){return void 0===e.type}function Pr(e){return"transaction"===e.type}function Rr(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+Ar(e.attributes)}function Nr(e){let t=0;return e.message&&(t+=2*e.message.length),t+Ar(e.attributes)}function Ar(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*jr(e[0]):Me(e)?t+=jr(e):t+=100}),t}function jr(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}function Cr(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}function Dr(e){return function(e){return je(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function Zr(e,t){const n=Ur(e,t),r={type:qr(t),value:Jr(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Fr(e,t){return{exception:{values:[Zr(e,t)]}}}function Ur(e,t){const n=t.stacktrace||t.stack||"",r=function(e){return e&&Mr.test(e.message)?1:0}(t),s=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);try{return e(n,r,s)}catch{}return[]}const Mr=/Minified React error #\d+;/i;function Lr(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function qr(e){const t=e?.name;return!t&&Lr(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Jr(e){const t=e?.message;return Lr(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?Dr(t.error):Dr(e):"No error message"}function Qr(e,t,n,r,s){let i;if(De(t)&&t.error)return Fr(e,t.error);if(Ze(t)||Ce(t,"DOMException")){const s=t;if("stack"in t)i=Fr(e,t);else{const t=s.name||(Ze(s)?"DOMError":"DOMException"),o=s.message?`${t}: ${s.message}`:t;i=Kr(e,o,n,r),ht(i,o)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return je(t)?Fr(e,t):Le(t)||qe(t)?(i=function(e,t,n,r){const s=nn(),i=s?.getOptions().normalizeDepth,o=(a=t,Object.values(a).find(e=>e instanceof Error));var a;const c={__serialized__:Nn(t,i)};if(o)return{exception:{values:[Zr(e,o)]},extra:c};const u={exception:{values:[{type:qe(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Br(t,{isUnhandledRejection:r})}]},extra:c};if(n){const t=Ur(e,n);t.length&&(u.exception.values[0].stacktrace={frames:t})}return u}(e,t,n,s),ft(i,{synthetic:!0}),i):(i=Kr(e,t,n,r),ht(i,`${t}`,void 0),ft(i,{synthetic:!0}),i)}function Kr(e,t,n,r){const s={};if(r&&n){const r=Ur(e,n);r.length&&(s.exception={values:[{value:t,stacktrace:{frames:r}}]}),ft(s,{synthetic:!0})}if(Ue(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return s.logentry={message:e,params:n},s}return s.message=t,s}function Br(e,{isUnhandledRejection:t}){const n=function(e){const t=Object.keys(nt(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}(e),r=t?"promise rejection":"exception";return De(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:qe(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Wr(e,t){return en().captureEvent(e,t)}function Vr(e){const t=tn(),{user:n}=pr(t,en()),{userAgent:r}=me.navigator||{},s=function(e){const t=Ct(),n={sid:dt(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return{sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}(n)};return e&&Dt(n,e),n}({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return"ok"===i?.status&&Dt(i,{status:"exited"}),Hr(),t.setSession(s),s}function Hr(){const e=tn(),t=en().getSession()||e.getSession();t&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),Dt(e,t)}(t),Gr(),e.setSession()}function Gr(){const e=tn(),t=nn(),n=e.getSession();n&&t&&t.captureSession(n)}function Yr(e=!1){e?Hr():Gr()}const Xr=me;let es=0;function ts(){return es>0}function ns(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(tt(e))return e}catch{return e}const n=function(...n){try{const r=n.map(e=>ns(e,t));return e.apply(this,r)}catch(e){throw es++,setTimeout(()=>{es--}),function(...e){const t=Yt(ye());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}(r=>{var s;r.addEventProcessor(e=>(t.mechanism&&(ht(e,void 0,void 0),ft(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),s=e,en().captureException(s,function(e){if(e)return function(e){return e instanceof Jt||"function"==typeof e}(e)||function(e){return Object.keys(e).some(e=>fr.includes(e))}(e)?{captureContext:e}:e}(void 0))}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}et(n,e),Xe(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}class rs extends $r{constructor(e){const t=(n=e,{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:Xr.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...n});var n;!function(e,t,n=[t],r="npm"){const s=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${t}`,s.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:fe})),s.version=fe)}(t,"browser",["browser"],Xr.SENTRY_SDK_SOURCE||"npm"),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?"auto":"never",...t._metadata.sdk.settings}),super(t);const{sendDefaultPii:r,sendClientReports:s,enableLogs:i,_experiments:o,enableMetrics:a}=this._options,c=a??o?.enableMetrics??!0;Xr.document&&(s||i||c)&&Xr.document.addEventListener("visibilitychange",()=>{"hidden"===Xr.document.visibilityState&&(s&&this._flushOutcomes(),i&&Jn(this),c&&Kn(this))}),r&&this.on("beforeSendSession",Cr)}eventFromException(e,t){return function(e,t,n,r){const s=Qr(e,t,n?.syntheticException||void 0,r);return ft(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),Gn(s)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,s){const i=Kr(e,t,r?.syntheticException||void 0,s);return i.level=n,r?.event_id&&(i.event_id=r.event_id),Gn(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}}const ss={},is={};function os(e,t){ss[e]=ss[e]||[],ss[e].push(t)}function as(e,t){if(!is[e]){is[e]=!0;try{t()}catch(t){he&&$e(`Error while instrumenting ${e}`,t)}}}function cs(e,t){const n=e&&ss[e];if(n)for(const r of n)try{r(t)}catch(t){he&&$e(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${St(r)}\nError:`,t)}}function us(){"console"in me&&ve.forEach(function(e){e in me.console&&Ye(me.console,e,function(t){return be[e]=t,function(...t){cs("console",{args:t,level:e});const n=be[e];n?.apply(me.console,t)}})})}const ds=me;function ls(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function ps(e,t=!1){t&&!function(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in ds))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}())return!1;if(ls(ds.fetch))return!0;let e=!1;const t=ds.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=ls(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){he&&Oe("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}()||Ye(me,"fetch",function(t){return function(...n){const r=new Error,{method:s,url:i}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:fs(t),method:hs(n,"method")?String(n.method).toUpperCase():Be(t)&&hs(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:fs(t),method:hs(t,"method")?String(t.method).toUpperCase():"GET"}}(n),o={args:n,fetchData:{method:s,url:i},startTimestamp:1e3*Ct(),virtualError:r,headers:ms(n)};return e||cs("fetch",{...o}),t.apply(me,n).then(async t=>(e?e(t):cs("fetch",{...o,endTimestamp:1e3*Ct(),response:t}),t),e=>{cs("fetch",{...o,endTimestamp:1e3*Ct(),error:e}),je(e)&&void 0===e.stack&&(e.stack=r.stack,Xe(e,"framesToPop",1));const t=nn(),n=t?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==n&&e instanceof TypeError&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const t=new URL(o.fetchData.url).host;"always"===n?e.message=`${e.message} (${t})`:Xe(e,"__sentry_fetch_url_host__",t)}catch{}throw e})}})}function hs(e,t){return!!e&&"object"==typeof e&&!!e[t]}function fs(e){return"string"==typeof e?e:e?hs(e,"url")?e.url:e.toString?e.toString():"":""}function ms(e){const[t,n]=e;try{if("object"==typeof n&&null!==n&&"headers"in n&&n.headers)return new Headers(n.headers);if(Be(t))return new Headers(t.headers)}catch{}}const ys=100;function gs(e,t){const n=nn(),r=tn();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=ys}=n.getOptions();if(i<=0)return;const o={timestamp:At(),...e},a=s?we(()=>s(o,t)):o;null!==a&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}function _s(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}function vs(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const bs=me;let ws,Ss,xs;function Es(){if(!bs.document)return;const e=cs.bind(null,"dom"),t=ks(e,!0);bs.document.addEventListener("click",t,!1),bs.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=bs,r=n[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Ye(r,"addEventListener",function(t){return function(n,r,s){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},i=r[n]=r[n]||{refCount:0};if(!i.handler){const r=ks(e);i.handler=r,t.call(this,n,r,s)}i.refCount++}catch{}return t.call(this,n,r,s)}}),Ye(r,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},s=n[t];s&&(s.refCount--,s.refCount<=0&&(e.call(this,t,s.handler,r),s.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function ks(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;Xe(n,"_sentryCaptured",!0),r&&!r._sentryId&&Xe(r,"_sentryId",dt());const s="keypress"===n.type?"input":n.type;(function(e){if(e.type!==Ss)return!1;try{if(!e.target||e.target._sentryId!==xs)return!1}catch{}return!0})(n)||(e({event:n,name:s,global:t}),Ss=n.type,xs=r?r._sentryId:void 0),clearTimeout(ws),ws=bs.setTimeout(()=>{xs=void 0,Ss=void 0},1e3)}}const zs="__sentry_xhr_v3__";function Os(){if(!bs.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,s=1e3*Ct(),i=Fe(n[0])?n[0].toUpperCase():void 0,o=function(e){if(Fe(e))return e;try{return e.toString()}catch{}}(n[1]);if(!i||!o)return e.apply(t,n);t[zs]={method:i,url:o,request_headers:{}},"POST"===i&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const a=()=>{const e=t[zs];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}cs("xhr",{endTimestamp:1e3*Ct(),startTimestamp:s,xhr:t,virtualError:r})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(a(),e.apply(t,n))}):t.addEventListener("readystatechange",a),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,s]=n,i=t[zs];return i&&Fe(r)&&Fe(s)&&(i.request_headers[r.toLowerCase()]=s),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[zs];return r?(void 0!==n[0]&&(r.body=n[0]),cs("xhr",{startTimestamp:1e3*Ct(),xhr:t}),e.apply(t,n)):e.apply(t,n)}})}let $s;function Is(e){const t="history";os(t,e),as(t,Ts)}function Ts(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=$s,s=function(e){try{return new URL(e,bs.location.origin).toString()}catch{return e}}(String(n));if($s=s,r===s)return e.apply(this,t);cs("history",{from:r,to:s})}return e.apply(this,t)}}bs.addEventListener("popstate",()=>{const e=bs.location.href,t=$s;$s=e,t!==e&&cs("history",{from:t,to:e})}),"history"in ds&&ds.history&&(Ye(bs.history,"pushState",e),Ye(bs.history,"replaceState",e))}const Ps="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Rs=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console";os(t,e),as(t,us)}(function(e){return function(t){if(nn()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:(r=t.level,"warn"===r?"warning":["fatal","error","warning","log","info","debug"].includes(r)?r:"log"),message:zt(t.args," ")};var r;if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${zt(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}gs(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(nn()!==e)return;let r,s,i="object"==typeof t?t.serializeAttribute:void 0,o="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;o&&o>1024&&(Ps&&Oe(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=1024),"string"==typeof i&&(i=[i]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=Ve(t,{keyAttrs:i,maxStringLength:o}),s=function(e,t=5){if(!We.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}(t)}catch{r="<unknown>"}if(0===r.length)return;const a={category:`ui.${n.name}`,message:r};s&&(a.data={"ui.component_name":s}),gs(a,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),os("dom",n),as("dom",Es)),t.xhr&&function(e){os("xhr",e),as("xhr",Os)}(function(e){return function(t){if(nn()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,s=t.xhr[zs];if(!n||!r||!s)return;const{method:i,url:o,status_code:a,body:c}=s,u={method:i,url:o,status_code:a},d={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},l={category:"xhr",data:u,type:"http",level:_s(a)};e.emit("beforeOutgoingRequestBreadcrumb",l,d),gs(l,d)}}(e)),t.fetch&&function(e){const t="fetch";os(t,e),as(t,()=>ps(void 0,void 0))}(function(e){return function(t){if(nn()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const s={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},i={category:"fetch",data:t.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),gs(i,s)}else{const s=t.response,i={...t.fetchData,status_code:s?.status},o={input:t.args,response:s,startTimestamp:n,endTimestamp:r},a={category:"fetch",data:i,type:"http",level:_s(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,o),gs(a,o)}}}(e)),t.history&&Is(function(e){return function(t){if(nn()!==e)return;let n=t.from,r=t.to;const s=vs(Xr.location.href);let i=n?vs(n):void 0;const o=vs(r);i?.path||(i=s),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),s.protocol===i.protocol&&s.host===i.host&&(n=i.relative),gs({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){nn()===e&&gs({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:pt(t)},{event:t})}}(e))}}},Ns="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),As=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&Ye(Xr,"setTimeout",js),t.setInterval&&Ye(Xr,"setInterval",js),t.requestAnimationFrame&&Ye(Xr,"requestAnimationFrame",Cs),t.XMLHttpRequest&&"XMLHttpRequest"in Xr&&Ye(XMLHttpRequest.prototype,"send",Ds);const e=t.eventTarget;e&&(Array.isArray(e)?e:Ns).forEach(e=>function(e,t){const n=Xr,r=n[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Ye(r,"addEventListener",function(n){return function(r,s,i){try{"function"==typeof s.handleEvent&&(s.handleEvent=ns(s.handleEvent,{mechanism:{data:{handler:St(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&function(e,t,n){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,n)}(this,r,s),n.apply(this,[r,ns(s,{mechanism:{data:{handler:St(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),i])}}),Ye(r,"removeEventListener",function(e){return function(t,n,r){try{const s=n.__sentry_wrapped__;s&&e.call(this,t,s,r)}catch{}return e.call(this,t,n,r)}}))}(e,t))}}};function js(e){return function(...t){const n=t[0];return t[0]=ns(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${St(e)}`}}),e.apply(this,t)}}function Cs(e){return function(t){return e.apply(this,[ns(t,{mechanism:{data:{handler:St(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Ds(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Ye(n,e,function(t){const n={mechanism:{data:{handler:St(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=tt(t);return r&&(n.mechanism.data.handler=St(r)),ns(t,n)})}),e.apply(this,t)}}const Zs=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===Xr.document)return void(Ps&&Oe("Using the `browserSessionIntegration` in non-browser environments is not supported."));Vr({ignoreDuration:!0}),Yr();const e=tn();let n=e.getUser();e.addScopeListener(e=>{const t=e.getUser();n?.id===t?.id&&n?.ip_address===t?.ip_address||(Yr(),n=t)}),"route"===t&&Is(({from:e,to:t})=>{e!==t&&(Vr({ignoreDuration:!0}),Yr())})}}};function Fs(){try{const e=Xr.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}let Us=null;function Ms(){Us=me.onerror,me.onerror=function(e,t,n,r,s){return cs("error",{column:r,error:s,line:n,msg:e,url:t}),!!Us&&Us.apply(this,arguments)},me.onerror.__SENTRY_INSTRUMENTED__=!0}let Ls=null;function qs(){Ls=me.onunhandledrejection,me.onunhandledrejection=function(e){return cs("unhandledrejection",e),!Ls||Ls.apply(this,arguments)},me.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Js=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(){const t="error";os(t,t=>{const{stackParser:n,attachStacktrace:r}=Ks();if(nn()!==e||ts())return;const{msg:s,url:i,line:o,column:a,error:c}=t,u=function(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[];return 0===c.length&&c.push({colno:r,lineno:n,filename:Bs(t)??Ge(),function:yt,in_app:!0}),e}(Qr(n,c||s,void 0,r,!1),i,o,a);u.level="error",Wr(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})}),as(t,Ms)}()}(e),Qs("onerror")),t.onunhandledrejection&&(function(e){!function(){const t="unhandledrejection";os(t,t=>{const{stackParser:n,attachStacktrace:r}=Ks();if(nn()!==e||ts())return;const s=function(e){if(Me(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t),i=Me(s)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`}]}}:Qr(n,s,void 0,r,!0);i.level="error",Wr(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})}),as(t,qs)}()}(e),Qs("onunhandledrejection"))}}};function Qs(e){Ps&&ze(`Global Handler attached: ${e}`)}function Ks(){const e=nn();return e?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Bs(e){if(Fe(e)&&0!==e.length)return e.startsWith("data:")?`<${function(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=e.includes(";base64,"),i=e.indexOf(",");let o="";if(t&&-1!==i){const t=e.slice(i+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${s?",base64":""}${o?`,${o}`:""}`}return e}(e,!1)}>`:e}function Ws(e,t,n,r,s,i){if(!s.exception?.values||!i||!Qe(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=Vs(e,t,r,i.originalException,n,s.exception.values,o,0))}function Vs(e,t,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if(Qe(r[s],Error)){Gs(o,a,r);const i=e(t,r[s]),u=c.length;Ys(i,s,u,a),c=Vs(e,t,n,r[s],s,[i,...c],i,u)}return Hs(r)&&r.errors.forEach((i,u)=>{if(Qe(i,Error)){Gs(o,a,r);const d=e(t,i),l=c.length;Ys(d,`errors[${u}]`,l,a),c=Vs(e,t,n,i,s,[d,...c],d,l)}}),c}function Hs(e){return Array.isArray(e.errors)}function Gs(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Hs(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ys(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}const Xs=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,s){Ws(Zr,s.getOptions().stackParser,n,t,e,r)}}};function ei(e,t,n,r){const s={filename:e,function:"<anonymous>"===t?yt:t,in_app:!0};return void 0!==n&&(s.lineno=n),void 0!==r&&(s.colno=r),s}const ti=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ni=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ri=/\((\S*)(?::(\d+))(?::(\d+))\)/,si=/at (.+?) ?\(data:(.+?),/,ii=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,oi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ai=vt([30,e=>{const t=e.match(si);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=ti.exec(e);if(n){const[,e,t,r]=n;return ei(e,yt,+t,+r)}const r=ni.exec(e);if(r){if(0===r[2]?.indexOf("eval")){const e=ri.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}const[e,t]=ci(r[1]||yt,r[2]);return ei(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],[50,e=>{const t=ii.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=oi.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||yt;return[n,e]=ci(n,e),ei(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),ci=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:yt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},ui="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,di={};function li(e,t=function(e){const t=di[e];if(t)return t;let n=bs[e];if(ls(n))return di[e]=n.bind(bs);const r=bs.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const s=t.contentWindow;s?.[e]&&(n=s[e]),r.head.removeChild(t)}catch(t){ui&&Oe(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n?di[e]=n.bind(bs):n}("fetch")){let n=0,r=0;return rr(e,async function(s){const i=s.body.length;n+=i,r++;const o={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")}}}catch(e){throw di.fetch=void 0,e}finally{n-=i,r--}},nr(e.bufferSize||40))}const pi="string"==typeof window.JAAK_VERSION&&window.JAAK_VERSION.length>0?window.JAAK_VERSION:null;!function(e={}){const t=!e.skipBrowserExtensionCheck&&!!function(){if(void 0===Xr.window)return!1;const e=Xr;if(e.nw)return!1;const t=e.chrome||e.browser;if(!t?.runtime?.id)return!1;const n=Ge();return!(Xr===Xr.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}()&&(Ps&&we(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0);let n=null==e.defaultIntegrations?[Pt(),on(),{name:"ConversationId",setup(e){e.on("spanStart",e=>{const t=en().getScopeData(),n=tn().getScopeData(),r=t.conversationId||n.conversationId;if(r){const{op:t,data:n,description:s}=yn(e);if(!t?.startsWith("gen_ai.")&&!n["ai.operationId"]&&!s?.startsWith("ai."))return;e.setAttribute("gen_ai.conversation.id",r)}})}},As(),Rs(),Js(),Xs(),Sn(),{name:"HttpContext",preprocessEvent(e){if(!Xr.navigator&&!Xr.location&&!Xr.document)return;const t=function(){const e=Ge(),{referrer:t}=Xr.document||{},{userAgent:n}=Xr.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}},{name:"CultureContext",preprocessEvent(e){const t=Fs();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=Fs();t&&(e.attributes={"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar,...e.attributes})}},Zs()]:e.defaultIntegrations;const r={...e,enabled:!t&&e.enabled,stackParser:(s=e.stackParser||ai,Array.isArray(s)?vt(...s):s),integrations:Te({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||li};var s;!function(e,t){!0===t.debug&&(he?ke():we(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),en().update(t.initialScope);const n=new e(t);(function(e){en().setClient(e)})(n),n.init()}(rs,r)}({dsn:"https://bd3b645ba0f80fff939178d86353467c@o4507568947200000.ingest.de.sentry.io/4511292185641040",environment:window.JAAK_SENTRY_ENV,release:null===pi?void 0:`jaak-for-woocommerce@${pi}`,tracesSampleRate:0,sendDefaultPii:!0,normalizeDepth:10,normalizeMaxBreadth:5e3,initialScope:{...window.JAAK_WP_USER?{user:window.JAAK_WP_USER}:{},tags:{wp_site_url:window.WORDPRESS_SITE_URL,wp_site_url_hostname:function(e){if("string"!=typeof e||0===e.length)return null;try{return new URL(e).hostname}catch{return null}}(window.WORDPRESS_SITE_URL),jaak_version:pi,wp_version:"string"==typeof window.JAAK_WP_VERSION?window.JAAK_WP_VERSION:null,wc_version:"string"==typeof window.JAAK_WC_VERSION?window.JAAK_WC_VERSION:null,php_version:"string"==typeof window.JAAK_PHP_VERSION?window.JAAK_PHP_VERSION:null}}});var hi=(e,t,n)=>((e,t,n={})=>{let r=`${e}=${t}`;if(e.startsWith("__Secure-")&&!n.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(e.startsWith("__Host-")){if(!n.secure)throw new Error("__Host- Cookie must have Secure attributes");if("/"!==n.path)throw new Error('__Host- Cookie must have Path attributes with "/"');if(n.domain)throw new Error("__Host- Cookie must not have Domain attributes")}for(const e of["domain","path"])if(n[e]&&/[;\r\n]/.test(n[e]))throw new Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&"number"==typeof n.maxAge&&n.maxAge>=0){if(n.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+="; Max-Age="+(0|n.maxAge)}if(n.domain&&"host"!==n.prefix&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r})(e,t=encodeURIComponent(t),n);Error;var fi=(e,t)=>{for(const[n,r]of Object.entries(t)){const t=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(t,r?`/${r}`:"")}return e},mi=e=>{const t=new URLSearchParams;for(const[n,r]of Object.entries(e))if(void 0!==r)if(Array.isArray(r))for(const e of r)t.append(n,e);else t.set(n,r);return t},yi=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,"/"):e.replace(/\/index(?=\?|$)/,"");function gi(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function _i(e,t){if(!gi(e)&&!gi(t))return t;const n={...e};for(const e in t){const r=t[e];gi(n[e])&&gi(r)?n[e]=_i(n[e],r):n[e]=r}return n}var vi=(e,t)=>new Proxy(()=>{},{get(n,r){if("string"==typeof r&&"then"!==r)return vi(e,[...t,r])},apply:(n,r,s)=>e({path:t,args:s})}),bi=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){const t=new FormData;for(const[n,r]of Object.entries(e.form))if(void 0!==r)if(Array.isArray(r))for(const e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType="application/json"),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase();const r={...e?.header,..."function"==typeof t?.headers?await t.headers():t?.headers};if(e?.cookie){const t=[];for(const[n,r]of Object.entries(e.cookie))t.push(hi(n,r,{path:"/"}));r.Cookie=t.join(",")}this.cType&&(r["Content-Type"]=this.cType);const s=new Headers(r??void 0);let i=this.url;i=yi(i),i=fi(i,this.pathParams),this.queryParams&&(i=i+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const o=!("GET"===n||"HEAD"===n);return(t?.fetch||fetch)(i,{body:o?this.rBody:void 0,method:n,headers:s,...t?.init})}},wi=(e,t)=>vi(function n(r){const s=t?.buildSearchParams??mi,i=[...r.path],o=i.slice(-3).reverse();if("toString"===o[0])return"name"===o[1]?o[2]||"":n.toString();if("valueOf"===o[0])return"name"===o[1]?o[2]||"":n;let a="";if(/^\$/.test(o[0])){const e=i.pop();e&&(a=e.replace(/^\$/,""))}const c=i.join("/"),u=((e,t)=>(e=e.replace(/\/+$/,""),(e+="/")+t.replace(/^\/+/,"")))(e,c);if("url"===a||"path"===a){let t=u;return r.args[0]&&(r.args[0].param&&(t=fi(u,r.args[0].param)),r.args[0].query&&(t=t+"?"+s(r.args[0].query).toString())),t=yi(t),"url"===a?new URL(t):t.slice(e.replace(/\/+$/,"").length).replace(/^\/?/,"/")}if("ws"===a){const e=(r.args[0]&&r.args[0].param?fi(u,r.args[0].param):u).replace(/^http/,"ws"),n=new URL(e),s=r.args[0]?.query;return s&&Object.entries(s).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>void 0!==t?.webSocket&&"function"==typeof t.webSocket?t.webSocket(...e):new WebSocket(...e))(n.toString())}const d=new bi(u,a,{buildSearchParams:s});if(a){t??={};const e=_i(t,{...r.args[1]});return d.fetch(r.args[0],e)}return d},[]);function Si(e,t){if(!e)throw new Error(t)}class xi extends Error{#B=Symbol("GeneralException");constructor({type:e,title:t="Error",detail:n,context:r}){super(e),this.name="GeneralException",this.type=e,this.title=t,this.detail=n,this.context=r}}function Ei(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const s=o.prototype,i=Object.keys(s);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=s[t].bind(n))}}const s=n?.Parent??Object;class i extends s{}function o(e){var t;const s=n?.Parent?new i:this;r(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}Object.freeze({status:"aborted"}),Symbol("zod_brand");class ki extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class zi extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Oi={};function $i(e){return e&&Object.assign(Oi,e),Oi}function Ii(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function Ti(e,t="|"){return e.map(e=>Hi(e)).join(t)}function Pi(e,t){return"bigint"==typeof t?t.toString():t}function Ri(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ni(e){return null==e}function Ai(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const ji=Symbol("evaluating");function Ci(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ji)return void 0===r&&(r=ji,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Di(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Zi(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Fi(e){return JSON.stringify(e)}const Ui="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Mi(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Li=Ri(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function qi(e){if(!1===Mi(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==Mi(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Ji(e){return qi(e)?{...e}:Array.isArray(e)?[...e]:e}const Qi=new Set(["string","number","symbol"]),Ki=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Bi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wi(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Vi(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function Hi(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}const Gi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Yi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Xi(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function eo(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function to(e){return"string"==typeof e?e:e?.message}function no(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=to(e.inst?._zod.def?.error?.(e))??to(t?.error?.(e))??to(n.customError?.(e))??to(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function ro(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function so(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function io(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const oo=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Pi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ao=Ei("$ZodError",oo),co=Ei("$ZodError",oo,{Parent:Error}),uo=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new ki;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>no(e,i,$i())));throw Ui(t,s?.callee),t}return o.value},lo=uo(co),po=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>no(e,i,$i())));throw Ui(t,s?.callee),t}return o.value},ho=po(co),fo=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new ki;return i.issues.length?{success:!1,error:new(e??ao)(i.issues.map(e=>no(e,s,$i())))}:{success:!0,data:i.value}},mo=fo(co),yo=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>no(e,s,$i())))}:{success:!0,data:i.value}},go=yo(co),_o=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return uo(e)(t,n,s)},vo=e=>(t,n,r)=>uo(e)(t,n,r),bo=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return po(e)(t,n,s)},wo=e=>async(t,n,r)=>po(e)(t,n,r),So=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return fo(e)(t,n,s)},xo=e=>(t,n,r)=>fo(e)(t,n,r),Eo=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yo(e)(t,n,s)},ko=e=>async(t,n,r)=>yo(e)(t,n,r),zo=/^[cC][^\s-]{8,}$/,Oo=/^[0-9a-z]+$/,$o=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Io=/^[0-9a-vA-V]{20}$/,To=/^[A-Za-z0-9]{27}$/,Po=/^[a-zA-Z0-9_-]{21}$/,Ro=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,No=/^[-+]?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)?)??$/,Ao=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,jo=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Co=jo(4),Do=jo(6),Zo=jo(7),Fo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Uo=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Mo=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Lo=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,qo=Lo,Jo=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Qo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ko(){return new RegExp(Qo,"u")}const Bo=/^(?:(?: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])$/,Wo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Vo=e=>{const t=Bi(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Ho=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Go=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Yo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Xo=/^[A-Za-z0-9_-]*$/,ea=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ta=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,na=/^\+[1-9]\d{6,14}$/,ra="(?:(?:\\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])))",sa=new RegExp(`^${ra}$`);function ia(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function oa(e){return new RegExp(`^${ia(e)}$`)}function aa(e){const t=ia({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${ra}T(?:${r})$`)}const ca=e=>new RegExp(`^${e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*"}$`),ua=/^-?\d+n?$/,da=/^-?\d+$/,la=/^-?\d+(?:\.\d+)?$/,pa=/^(?:true|false)$/i,ha=/^null$/i,fa=/^undefined$/i,ma=/^[^A-Z]*$/,ya=/^[^a-z]*$/,ga=/^[0-9a-fA-F]*$/;function _a(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function va(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const ba=/^[0-9a-fA-F]{32}$/,wa=_a(22,"=="),Sa=va(22),xa=/^[0-9a-fA-F]{40}$/,Ea=_a(27,"="),ka=va(27),za=/^[0-9a-fA-F]{64}$/,Oa=_a(43,"="),$a=va(43),Ia=/^[0-9a-fA-F]{96}$/,Ta=_a(64,""),Pa=va(64),Ra=/^[0-9a-fA-F]{128}$/,Na=_a(86,"=="),Aa=va(86),ja=Ei("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ca={number:"number",bigint:"bigint",object:"date"},Da=Ei("$ZodCheckLessThan",(e,t)=>{ja.init(e,t);const n=Ca[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Za=Ei("$ZodCheckGreaterThan",(e,t)=>{ja.init(e,t);const n=Ca[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fa=Ei("$ZodCheckMultipleOf",(e,t)=>{ja.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(0===s&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(s=Number.parseInt(e[1]))}const i=n>s?n:s;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ua=Ei("$ZodCheckNumberFormat",(e,t)=>{ja.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=Gi[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=s,r.maximum=i,n&&(r.pattern=da)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a))return void o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Ma=Ei("$ZodCheckBigIntFormat",(e,t)=>{ja.init(e,t);const[n,r]=Yi[t.format];e._zod.onattach.push(e=>{const s=e._zod.bag;s.format=t.format,s.minimum=n,s.maximum=r}),e._zod.check=s=>{const i=s.value;i<n&&s.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&s.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),La=Ei("$ZodCheckMaxSize",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;r.size<=t.maximum||n.issues.push({origin:ro(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),qa=Ei("$ZodCheckMinSize",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;r.size>=t.minimum||n.issues.push({origin:ro(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ja=Ei("$ZodCheckSizeEquals",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{const r=n.value,s=r.size;if(s===t.size)return;const i=s>t.size;n.issues.push({origin:ro(r),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Qa=Ei("$ZodCheckMaxLength",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const s=so(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ka=Ei("$ZodCheckMinLength",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const s=so(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ba=Ei("$ZodCheckLengthEquals",(e,t)=>{var n;ja.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ni(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,s=r.length;if(s===t.length)return;const i=so(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Wa=Ei("$ZodCheckStringFormat",(e,t)=>{var n,r;ja.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Va=Ei("$ZodCheckRegex",(e,t)=>{Wa.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ha=Ei("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ma),Wa.init(e,t)}),Ga=Ei("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ya),Wa.init(e,t)}),Ya=Ei("$ZodCheckIncludes",(e,t)=>{ja.init(e,t);const n=Bi(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Xa=Ei("$ZodCheckStartsWith",(e,t)=>{ja.init(e,t);const n=new RegExp(`^${Bi(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ec=Ei("$ZodCheckEndsWith",(e,t)=>{ja.init(e,t);const n=new RegExp(`.*${Bi(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function tc(e,t,n){e.issues.length&&t.issues.push(...eo(n,e.issues))}const nc=Ei("$ZodCheckProperty",(e,t)=>{ja.init(e,t),e._zod.check=e=>{const n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>tc(n,e,t.property));tc(n,e,t.property)}}),rc=Ei("$ZodCheckMimeType",(e,t)=>{ja.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),sc=Ei("$ZodCheckOverwrite",(e,t)=>{ja.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class ic{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>`  ${e}`)].join("\n"))}}const oc={major:4,minor:3,patch:6},ac=Ei("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=oc;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,s=Xi(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&!1===n?.async)throw new ki;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(s||(s=Xi(e,t)))});else{if(e.issues.length===t)continue;s||(s=Xi(e,t))}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(Xi(n))return n.aborted=!0,n;const o=t(s,r,i);if(o instanceof Promise){if(!1===i.async)throw new ki;return o.then(t=>e._zod.parse(t,i))}return e._zod.parse(o,i)};e._zod.run=(s,i)=>{if(i.skipChecks)return e._zod.parse(s,i);if("backward"===i.direction){const t=e._zod.parse({value:s.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,s,i)):n(t,s,i)}const o=e._zod.parse(s,i);if(o instanceof Promise){if(!1===i.async)throw new ki;return o.then(e=>t(e,r,i))}return t(o,r,i)}}Ci(e,"~standard",()=>({validate:t=>{try{const n=mo(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return go(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),cc=Ei("$ZodString",(e,t)=>{ac.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ca(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),uc=Ei("$ZodStringFormat",(e,t)=>{Wa.init(e,t),cc.init(e,t)}),dc=Ei("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ao),uc.init(e,t)}),lc=Ei("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=jo(e))}else t.pattern??(t.pattern=jo());uc.init(e,t)}),pc=Ei("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Fo),uc.init(e,t)}),hc=Ei("$ZodURL",(e,t)=>{uc.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=s.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),fc=Ei("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ko()),uc.init(e,t)}),mc=Ei("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Po),uc.init(e,t)}),yc=Ei("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=zo),uc.init(e,t)}),gc=Ei("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Oo),uc.init(e,t)}),_c=Ei("$ZodULID",(e,t)=>{t.pattern??(t.pattern=$o),uc.init(e,t)}),vc=Ei("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Io),uc.init(e,t)}),bc=Ei("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=To),uc.init(e,t)}),wc=Ei("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=aa(t)),uc.init(e,t)}),Sc=Ei("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=sa),uc.init(e,t)}),xc=Ei("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=oa(t)),uc.init(e,t)}),Ec=Ei("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ro),uc.init(e,t)}),kc=Ei("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Bo),uc.init(e,t),e._zod.bag.format="ipv4"}),zc=Ei("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Wo),uc.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Oc=Ei("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Vo(t.delimiter)),uc.init(e,t),e._zod.bag.format="mac"}),$c=Ei("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ho),uc.init(e,t)}),Ic=Ei("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Go),uc.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Tc(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Pc=Ei("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Yo),uc.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Tc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Rc=Ei("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Xo),uc.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!Xo.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Tc(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Nc=Ei("$ZodE164",(e,t)=>{t.pattern??(t.pattern=na),uc.init(e,t)}),Ac=Ei("$ZodJWT",(e,t)=>{uc.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&"JWT"!==s?.typ||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),jc=Ei("$ZodCustomStringFormat",(e,t)=>{uc.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Cc=Ei("$ZodNumber",(e,t)=>{ac.init(e,t),e._zod.pattern=e._zod.bag.pattern??la,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const s=n.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),Dc=Ei("$ZodNumberFormat",(e,t)=>{Ua.init(e,t),Cc.init(e,t)}),Zc=Ei("$ZodBoolean",(e,t)=>{ac.init(e,t),e._zod.pattern=pa,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const s=n.value;return"boolean"==typeof s||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Fc=Ei("$ZodBigInt",(e,t)=>{ac.init(e,t),e._zod.pattern=ua,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Uc=Ei("$ZodBigIntFormat",(e,t)=>{Ma.init(e,t),Fc.init(e,t)}),Mc=Ei("$ZodSymbol",(e,t)=>{ac.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return"symbol"==typeof r||t.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),t}}),Lc=Ei("$ZodUndefined",(e,t)=>{ac.init(e,t),e._zod.pattern=fa,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}}),qc=Ei("$ZodNull",(e,t)=>{ac.init(e,t),e._zod.pattern=ha,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),Jc=Ei("$ZodAny",(e,t)=>{ac.init(e,t),e._zod.parse=e=>e}),Qc=Ei("$ZodUnknown",(e,t)=>{ac.init(e,t),e._zod.parse=e=>e}),Kc=Ei("$ZodNever",(e,t)=>{ac.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),Bc=Ei("$ZodVoid",(e,t)=>{ac.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}}),Wc=Ei("$ZodDate",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const s=n.value,i=s instanceof Date;return i&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...i?{received:"Invalid Date"}:{},inst:e}),n}});function Vc(e,t,n){e.issues.length&&t.issues.push(...eo(n,e.issues)),t.value[n]=e.value}const Hc=Ei("$ZodArray",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let e=0;e<s.length;e++){const o=s[e],a=t.element._zod.run({value:o,issues:[]},r);a instanceof Promise?i.push(a.then(t=>Vc(t,n,e))):Vc(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function Gc(e,t,n,r,s){if(e.issues.length){if(s&&!(n in r))return;t.issues.push(...eo(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Yc(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Xc(e,t,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,u=c.def.type,d="optional"===c.optout;for(const s in t){if(a.has(s))continue;if("never"===u){o.push(s);continue}const i=c.run({value:t[s],issues:[]},r);i instanceof Promise?e.push(i.then(e=>Gc(e,n,s,t,d))):Gc(i,n,s,t,d)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const eu=Ei("$ZodObject",(e,t)=>{ac.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=Ri(()=>Yc(t));Ci(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const s=Mi,i=t.catchall;let o;e._zod.parse=(t,n)=>{o??(o=r.value);const a=t.value;if(!s(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=o.shape;for(const e of o.keys){const r=u[e],s="optional"===r._zod.optout,i=r._zod.run({value:a[e],issues:[]},n);i instanceof Promise?c.push(i.then(n=>Gc(n,t,e,a,s))):Gc(i,t,e,a,s)}return i?Xc(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),tu=Ei("$ZodObjectJIT",(e,t)=>{eu.init(e,t);const n=e._zod.parse,r=Ri(()=>Yc(t));let s;const i=Mi,o=!Oi.jitless,a=o&&Li.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=r.value);const p=d.value;return i(p)?o&&a&&!1===l?.async&&!0!==l.jitless?(s||(s=(e=>{const t=new ic(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Fi(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of n.keys)i[e]="key_"+o++;t.write("const newResult = {};");for(const r of n.keys){const n=i[r],o=Fi(r),a=e[r],c="optional"===a?._zod?.optout;t.write(`const ${n} = ${s(r)};`),c?t.write(`\n        if (${n}.issues.length) {\n          if (${o} in input) {\n            payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n              ...iss,\n              path: iss.path ? [${o}, ...iss.path] : [${o}]\n            })));\n          }\n        }\n        \n        if (${n}.value === undefined) {\n          if (${o} in input) {\n            newResult[${o}] = undefined;\n          }\n        } else {\n          newResult[${o}] = ${n}.value;\n        }\n        \n      `):t.write(`\n        if (${n}.issues.length) {\n          payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n            ...iss,\n            path: iss.path ? [${o}, ...iss.path] : [${o}]\n          })));\n        }\n        \n        if (${n}.value === undefined) {\n          if (${o} in input) {\n            newResult[${o}] = undefined;\n          }\n        } else {\n          newResult[${o}] = ${n}.value;\n        }\n        \n      `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=s(d,l),c?Xc([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function nu(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const s=e.filter(e=>!Xi(e));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>no(e,r,$i())))}),t)}const ru=Ei("$ZodUnion",(e,t)=>{ac.init(e,t),Ci(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Ci(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Ci(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ci(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Ai(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>nu(t,s,e,i)):nu(a,s,e,i)}});function su(e,t,n,r){const s=e.filter(e=>0===e.issues.length);return 1===s.length?(t.value=s[0].value,t):(0===s.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>no(e,r,$i())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}const iu=Ei("$ZodXor",(e,t)=>{ru.init(e,t),t.inclusive=!1;const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);t instanceof Promise?(a.push(t),o=!0):a.push(t)}return o?Promise.all(a).then(t=>su(t,s,e,i)):su(a,s,e,i)}}),ou=Ei("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ru.init(e,t);const n=e._zod.parse;Ci(e._zod,"propValues",()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(const r of n)e[t].add(r)}}return e});const r=Ri(()=>{const e=t.options,n=new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(s,i)=>{const o=s.value;if(!Mi(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const a=r.value.get(o?.[t.discriminator]);return a?a._zod.run(s,i):t.unionFallback?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),s)}}),au=Ei("$ZodIntersection",(e,t)=>{ac.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,s=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([t,n])=>uu(e,t,n)):uu(e,s,i)}});function cu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(qi(e)&&qi(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),s={...e,...t};for(const n of r){const r=cu(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=cu(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function uu(e,t,n){const r=new Map;let s;for(const n of t.issues)if("unrecognized_keys"===n.code){s??(s=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const i=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&s&&e.issues.push({...s,keys:i}),Xi(e))return e;const o=cu(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const du=Ei("$ZodTuple",(e,t)=>{ac.init(e,t);const n=t.items;e._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const o=[],a=[...n].reverse().findIndex(e=>"optional"!==e._zod.optin),c=-1===a?0:n.length-a;if(!t.rest){const t=i.length>n.length,s=i.length<c-1;if(t||s)return r.issues.push({...t?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),r}let u=-1;for(const e of n){if(u++,u>=i.length&&u>=c)continue;const t=e._zod.run({value:i[u],issues:[]},s);t instanceof Promise?o.push(t.then(e=>lu(e,r,u))):lu(t,r,u)}if(t.rest){const e=i.slice(n.length);for(const n of e){u++;const e=t.rest._zod.run({value:n,issues:[]},s);e instanceof Promise?o.push(e.then(e=>lu(e,r,u))):lu(e,r,u)}}return o.length?Promise.all(o).then(()=>r):r}});function lu(e,t,n){e.issues.length&&t.issues.push(...eo(n,e.issues)),t.value[n]=e.value}const pu=Ei("$ZodRecord",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!qi(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const e of o)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){a.add("number"==typeof e?e.toString():e);const o=t.valueType._zod.run({value:s[e],issues:[]},r);o instanceof Promise?i.push(o.then(t=>{t.issues.length&&n.issues.push(...eo(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...eo(e,o.issues)),n.value[e]=o.value)}let c;for(const e in s)a.has(e)||(c=c??[],c.push(e));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c})}else{n.value={};for(const o of Reflect.ownKeys(s)){if("__proto__"===o)continue;let a=t.keyType._zod.run({value:o,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof o&&la.test(o)&&a.issues.length){const e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(a=e)}if(a.issues.length){"loose"===t.mode?n.value[o]=s[o]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>no(e,r,$i())),input:o,path:[o],inst:e});continue}const c=t.valueType._zod.run({value:s[o],issues:[]},r);c instanceof Promise?i.push(c.then(e=>{e.issues.length&&n.issues.push(...eo(o,e.issues)),n.value[a.value]=e.value})):(c.issues.length&&n.issues.push(...eo(o,c.issues)),n.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>n):n}}),hu=Ei("$ZodMap",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!(s instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:s,inst:e}),n;const i=[];n.value=new Map;for(const[o,a]of s){const c=t.keyType._zod.run({value:o,issues:[]},r),u=t.valueType._zod.run({value:a,issues:[]},r);c instanceof Promise||u instanceof Promise?i.push(Promise.all([c,u]).then(([t,i])=>{fu(t,i,n,o,s,e,r)})):fu(c,u,n,o,s,e,r)}return i.length?Promise.all(i).then(()=>n):n}});function fu(e,t,n,r,s,i,o){e.issues.length&&(Qi.has(typeof r)?n.issues.push(...eo(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:s,inst:i,issues:e.issues.map(e=>no(e,o,$i()))})),t.issues.length&&(Qi.has(typeof r)?n.issues.push(...eo(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:s,inst:i,key:r,issues:t.issues.map(e=>no(e,o,$i()))})),n.value.set(e.value,t.value)}const mu=Ei("$ZodSet",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!(s instanceof Set))return n.issues.push({input:s,inst:e,expected:"set",code:"invalid_type"}),n;const i=[];n.value=new Set;for(const e of s){const s=t.valueType._zod.run({value:e,issues:[]},r);s instanceof Promise?i.push(s.then(e=>yu(e,n))):yu(s,n)}return i.length?Promise.all(i).then(()=>n):n}});function yu(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const gu=Ei("$ZodEnum",(e,t)=>{ac.init(e,t);const n=Ii(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Qi.has(typeof e)).map(e=>"string"==typeof e?Bi(e):e.toString()).join("|")})$`),e._zod.parse=(t,s)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),_u=Ei("$ZodLiteral",(e,t)=>{if(ac.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?Bi(e):e?Bi(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),vu=Ei("$ZodFile",(e,t)=>{ac.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}}),bu=Ei("$ZodTransform",(e,t)=>{ac.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new zi(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(e=>(n.value=e,n));if(s instanceof Promise)throw new ki;return n.value=s,n}});function wu(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Su=Ei("$ZodOptional",(e,t)=>{ac.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ci(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ci(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ai(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>wu(t,e.value)):wu(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),xu=Ei("$ZodExactOptional",(e,t)=>{Su.init(e,t),Ci(e._zod,"values",()=>t.innerType._zod.values),Ci(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Eu=Ei("$ZodNullable",(e,t)=>{ac.init(e,t),Ci(e._zod,"optin",()=>t.innerType._zod.optin),Ci(e._zod,"optout",()=>t.innerType._zod.optout),Ci(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ai(e.source)}|null)$`):void 0}),Ci(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),ku=Ei("$ZodDefault",(e,t)=>{ac.init(e,t),e._zod.optin="optional",Ci(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>zu(e,t)):zu(r,t)}});function zu(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Ou=Ei("$ZodPrefault",(e,t)=>{ac.init(e,t),e._zod.optin="optional",Ci(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),$u=Ei("$ZodNonOptional",(e,t)=>{ac.init(e,t),Ci(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(t=>Iu(t,e)):Iu(s,e)}});function Iu(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Tu=Ei("$ZodSuccess",(e,t)=>{ac.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new zi("ZodSuccess");const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}}),Pu=Ei("$ZodCatch",(e,t)=>{ac.init(e,t),Ci(e._zod,"optin",()=>t.innerType._zod.optin),Ci(e._zod,"optout",()=>t.innerType._zod.optout),Ci(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>no(e,n,$i()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>no(e,n,$i()))},input:e.value}),e.issues=[]),e)}}),Ru=Ei("$ZodNaN",(e,t)=>{ac.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),Nu=Ei("$ZodPipe",(e,t)=>{ac.init(e,t),Ci(e._zod,"values",()=>t.in._zod.values),Ci(e._zod,"optin",()=>t.in._zod.optin),Ci(e._zod,"optout",()=>t.out._zod.optout),Ci(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Au(e,t.in,n)):Au(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Au(e,t.out,n)):Au(r,t.out,n)}});function Au(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ju=Ei("$ZodCodec",(e,t)=>{ac.init(e,t),Ci(e._zod,"values",()=>t.in._zod.values),Ci(e._zod,"optin",()=>t.in._zod.optin),Ci(e._zod,"optout",()=>t.out._zod.optout),Ci(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Cu(e,t,n)):Cu(r,t,n)}{const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Cu(e,t,n)):Cu(r,t,n)}}});function Cu(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){const r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Du(e,r,t.out,n)):Du(e,r,t.out,n)}{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Du(e,r,t.in,n)):Du(e,r,t.in,n)}}function Du(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const Zu=Ei("$ZodReadonly",(e,t)=>{ac.init(e,t),Ci(e._zod,"propValues",()=>t.innerType._zod.propValues),Ci(e._zod,"values",()=>t.innerType._zod.values),Ci(e._zod,"optin",()=>t.innerType?._zod?.optin),Ci(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Fu):Fu(r)}});function Fu(e){return e.value=Object.freeze(e.value),e}const Uu=Ei("$ZodTemplateLiteral",(e,t)=>{ac.init(e,t);const n=[];for(const e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);const t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${e._zod.traits}`);const r=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(r,s))}else{if(null!==e&&!Ki.has(typeof e))throw new Error(`Invalid template literal part: ${e}`);n.push(Bi(`${e}`))}e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>"string"!=typeof n.value?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),Mu=Ei("$ZodFunction",(e,t)=>(ac.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw new Error("implement() must be called with a function");return function(...n){const r=e._def.input?lo(e._def.input,n):n,s=Reflect.apply(t,this,r);return e._def.output?lo(e._def.output,s):s}},e.implementAsync=t=>{if("function"!=typeof t)throw new Error("implementAsync() must be called with a function");return async function(...n){const r=e._def.input?await ho(e._def.input,n):n,s=await Reflect.apply(t,this,r);return e._def.output?await ho(e._def.output,s):s}},e._zod.parse=(t,n)=>{if("function"!=typeof t.value)return t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}),t;const r=e._def.output&&"promise"===e._def.output._zod.def.type;return t.value=r?e.implementAsync(t.value):e.implement(t.value),t},e.input=(...t)=>{const n=e.constructor;return Array.isArray(t[0])?new n({type:"function",input:new du({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}):new n({type:"function",input:t[0],output:e._def.output})},e.output=t=>new(0,e.constructor)({type:"function",input:e._def.input,output:t}),e)),Lu=Ei("$ZodPromise",(e,t)=>{ac.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),qu=Ei("$ZodLazy",(e,t)=>{ac.init(e,t),Ci(e._zod,"innerType",()=>t.getter()),Ci(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ci(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ci(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ci(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Ju=Ei("$ZodCustom",(e,t)=>{ja.init(e,t),ac.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(t=>Qu(t,n,r,e));Qu(s,n,r,e)}});function Qu(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(io(e))}}var Ku;Symbol("ZodOutput"),Symbol("ZodInput");(Ku=globalThis).__zod_globalRegistry??(Ku.__zod_globalRegistry=new class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const Bu=globalThis.__zod_globalRegistry;function Wu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Vi(t)})}function Vu(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Vi(t)})}function Hu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Vi(t)})}function Gu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Vi(t)})}function Yu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Vi(t)})}function Xu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Vi(t)})}function ed(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Vi(t)})}function td(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Vi(t)})}function nd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Vi(t)})}function rd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Vi(t)})}function sd(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Vi(t)})}function id(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Vi(t)})}function od(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Vi(t)})}function ad(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Vi(t)})}function cd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Vi(t)})}function ud(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Vi(t)})}function dd(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Vi(t)})}function ld(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Vi(t)})}function pd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Vi(t)})}function hd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Vi(t)})}function fd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Vi(t)})}function md(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Vi(t)})}function yd(e,t){return new Da({check:"less_than",...Vi(t),value:e,inclusive:!1})}function gd(e,t){return new Da({check:"less_than",...Vi(t),value:e,inclusive:!0})}function _d(e,t){return new Za({check:"greater_than",...Vi(t),value:e,inclusive:!1})}function vd(e,t){return new Za({check:"greater_than",...Vi(t),value:e,inclusive:!0})}function bd(e){return _d(0,e)}function wd(e){return yd(0,e)}function Sd(e){return gd(0,e)}function xd(e){return vd(0,e)}function Ed(e,t){return new Fa({check:"multiple_of",...Vi(t),value:e})}function kd(e,t){return new La({check:"max_size",...Vi(t),maximum:e})}function zd(e,t){return new qa({check:"min_size",...Vi(t),minimum:e})}function Od(e,t){return new Ja({check:"size_equals",...Vi(t),size:e})}function $d(e,t){return new Qa({check:"max_length",...Vi(t),maximum:e})}function Id(e,t){return new Ka({check:"min_length",...Vi(t),minimum:e})}function Td(e,t){return new Ba({check:"length_equals",...Vi(t),length:e})}function Pd(e,t){return new Va({check:"string_format",format:"regex",...Vi(t),pattern:e})}function Rd(e){return new Ha({check:"string_format",format:"lowercase",...Vi(e)})}function Nd(e){return new Ga({check:"string_format",format:"uppercase",...Vi(e)})}function Ad(e,t){return new Ya({check:"string_format",format:"includes",...Vi(t),includes:e})}function jd(e,t){return new Xa({check:"string_format",format:"starts_with",...Vi(t),prefix:e})}function Cd(e,t){return new ec({check:"string_format",format:"ends_with",...Vi(t),suffix:e})}function Dd(e,t,n){return new nc({check:"property",property:e,schema:t,...Vi(n)})}function Zd(e,t){return new rc({check:"mime_type",mime:e,...Vi(t)})}function Fd(e){return new sc({check:"overwrite",tx:e})}function Ud(e){return Fd(t=>t.normalize(e))}function Md(){return Fd(e=>e.trim())}function Ld(){return Fd(e=>e.toLowerCase())}function qd(){return Fd(e=>e.toUpperCase())}function Jd(){return Fd(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))}function Qd(e,t,n,r={}){const s=Vi(r),i={...Vi(r),check:"string_format",type:"string",format:t,fn:"function"==typeof n?n:e=>n.test(e),...s};return n instanceof RegExp&&(i.pattern=n),new e(i)}function Kd(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Bu,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Bd(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{const n=o.schema,i=t.processors[s.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(o.ref||(o.ref=i),Bd(i,t,r),t.seen.get(i).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),"input"===t.io&&Hd(e)&&(delete o.schema.examples,delete o.schema.default),"input"===t.io&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Wd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}const s=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:s,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,s=e.external.uri??(e=>e);if(n)return{ref:s(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${s("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const s=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:s+i}})(t);r.def={...r.schema},i&&(r.defId=i);const o=r.schema;for(const e in o)delete o[e];o.$ref=s};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){s(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){s(n);continue}}const i=e.metadataRegistry.get(n[0])?.id;(i||r.cycle||r.count>1&&"ref"===e.reused)&&s(n)}}function Vd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const s=n.def??n.schema,i={...s},o=n.ref;if(n.ref=null,o){r(o);const n=e.seen.get(o),a=n.schema;if(!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(s,a):(s.allOf=s.allOf??[],s.allOf.push(a)),Object.assign(s,i),t._zod.parent===o)for(const e in s)"$ref"!==e&&"allOf"!==e&&(e in i||delete s[e]);if(a.$ref&&n.def)for(const e in s)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(s[e])===JSON.stringify(n.def[e])&&delete s[e]}const a=t._zod.parent;if(a&&a!==o){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(s.$ref=t.schema.$ref,t.def))for(const e in s)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(s[e])===JSON.stringify(t.def[e])&&delete s[e]}e.override({zodSchema:t,jsonSchema:s,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const s={};if("draft-2020-12"===e.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?s.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(n)}Object.assign(s,n.def??n.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?s.$defs=i:s.definitions=i);try{const n=JSON.parse(JSON.stringify(s));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Gd(t,"input",e.processors),output:Gd(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function Hd(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return Hd(r.element,n);if("set"===r.type)return Hd(r.valueType,n);if("lazy"===r.type)return Hd(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return Hd(r.innerType,n);if("intersection"===r.type)return Hd(r.left,n)||Hd(r.right,n);if("record"===r.type||"map"===r.type)return Hd(r.keyType,n)||Hd(r.valueType,n);if("pipe"===r.type)return Hd(r.in,n)||Hd(r.out,n);if("object"===r.type){for(const e in r.shape)if(Hd(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(Hd(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(Hd(e,n))return!0;return!(!r.rest||!Hd(r.rest,n))}return!1}const Gd=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=Kd({...s??{},target:i,io:t,processors:n});return Bd(e,o),Wd(o,e),Vd(o,e)},Yd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Xd=(e,t,n,r)=>{const s=e._zod.def,i=!1===s.inclusive,o=s.options.map((e,n)=>Bd(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=o:n.anyOf=o},el=(e,t,n,r)=>{const s=e._zod.def;Bd(s.innerType,t,r),t.seen.get(e).ref=s.innerType},tl=Ei("ZodISODateTime",(e,t)=>{wc.init(e,t),Ol.init(e,t)});function nl(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Vi(t)})}(tl,e)}const rl=Ei("ZodISODate",(e,t)=>{Sc.init(e,t),Ol.init(e,t)});function sl(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Vi(t)})}(rl,e)}const il=Ei("ZodISOTime",(e,t)=>{xc.init(e,t),Ol.init(e,t)});function ol(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Vi(t)})}(il,e)}const al=Ei("ZodISODuration",(e,t)=>{Ec.init(e,t),Ol.init(e,t)});function cl(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Vi(t)})}(al,e)}const ul=(e,t)=>{ao.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>r({issues:e}));else if("invalid_key"===s.code)r({issues:s.issues});else if("invalid_element"===s.code)r({issues:s.issues});else if(0===s.path.length)n._errors.push(t(s));else{let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Pi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Pi,2)}},isEmpty:{get:()=>0===e.issues.length}})},dl=(Ei("ZodError",ul),Ei("ZodError",ul,{Parent:Error})),ll=uo(dl),pl=po(dl),hl=fo(dl),fl=yo(dl),ml=_o(dl),yl=vo(dl),gl=bo(dl),_l=wo(dl),vl=So(dl),bl=xo(dl),wl=Eo(dl),Sl=ko(dl),xl=Ei("ZodType",(e,t)=>(ac.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Gd(e,"input"),output:Gd(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=Kd({...n,processors:t});return Bd(e,r),Wd(r,e),Vd(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Zi(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Wi(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>ll(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>hl(e,t,n),e.parseAsync=async(t,n)=>pl(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>fl(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ml(e,t,n),e.decode=(t,n)=>yl(e,t,n),e.encodeAsync=async(t,n)=>gl(e,t,n),e.decodeAsync=async(t,n)=>_l(e,t,n),e.safeEncode=(t,n)=>vl(e,t,n),e.safeDecode=(t,n)=>bl(e,t,n),e.safeEncodeAsync=async(t,n)=>wl(e,t,n),e.safeDecodeAsync=async(t,n)=>Sl(e,t,n),e.refine=(t,n)=>e.check(gf(t,n)),e.superRefine=t=>e.check(_f(t)),e.overwrite=t=>e.check(Fd(t)),e.optional=()=>jh(e),e.exactOptional=()=>Dh(e),e.nullable=()=>Fh(e),e.nullish=()=>jh(Fh(e)),e.nonoptional=t=>Kh(e,t),e.array=()=>th(e),e.or=t=>ch([e,t]),e.and=t=>fh(e,t),e.transform=t=>ef(e,Nh(t)),e.default=t=>Lh(e,t),e.prefault=t=>Jh(e,t),e.catch=t=>Hh(e,t),e.pipe=t=>ef(e,t),e.readonly=()=>sf(e),e.describe=t=>{const n=e.clone();return Bu.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Bu.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Bu.get(e);const n=e.clone();return Bu.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),El=Ei("_ZodString",(e,t)=>{cc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:s,maximum:i,format:o,patterns:a,contentEncoding:c}=e._zod.bag;if("number"==typeof s&&(r.minLength=s),"number"==typeof i&&(r.maxLength=i),o&&(r.format=Yd[o]??o,""===r.format&&delete r.format,"time"===o&&delete r.format),c&&(r.contentEncoding=c),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Pd(...t)),e.includes=(...t)=>e.check(Ad(...t)),e.startsWith=(...t)=>e.check(jd(...t)),e.endsWith=(...t)=>e.check(Cd(...t)),e.min=(...t)=>e.check(Id(...t)),e.max=(...t)=>e.check($d(...t)),e.length=(...t)=>e.check(Td(...t)),e.nonempty=(...t)=>e.check(Id(1,...t)),e.lowercase=t=>e.check(Rd(t)),e.uppercase=t=>e.check(Nd(t)),e.trim=()=>e.check(Md()),e.normalize=(...t)=>e.check(Ud(...t)),e.toLowerCase=()=>e.check(Ld()),e.toUpperCase=()=>e.check(qd()),e.slugify=()=>e.check(Jd())}),kl=Ei("ZodString",(e,t)=>{cc.init(e,t),El.init(e,t),e.email=t=>e.check(Wu($l,t)),e.url=t=>e.check(ed(Dl,t)),e.jwt=t=>e.check(md(yp,t)),e.emoji=t=>e.check(td(Ul,t)),e.guid=t=>e.check(Vu(Tl,t)),e.uuid=t=>e.check(Hu(Rl,t)),e.uuidv4=t=>e.check(Gu(Rl,t)),e.uuidv6=t=>e.check(Yu(Rl,t)),e.uuidv7=t=>e.check(Xu(Rl,t)),e.nanoid=t=>e.check(nd(Ll,t)),e.guid=t=>e.check(Vu(Tl,t)),e.cuid=t=>e.check(rd(Jl,t)),e.cuid2=t=>e.check(sd(Kl,t)),e.ulid=t=>e.check(id(Wl,t)),e.base64=t=>e.check(pd(dp,t)),e.base64url=t=>e.check(hd(pp,t)),e.xid=t=>e.check(od(Hl,t)),e.ksuid=t=>e.check(ad(Yl,t)),e.ipv4=t=>e.check(cd(ep,t)),e.ipv6=t=>e.check(ud(sp,t)),e.cidrv4=t=>e.check(dd(op,t)),e.cidrv6=t=>e.check(ld(cp,t)),e.e164=t=>e.check(fd(fp,t)),e.datetime=t=>e.check(nl(t)),e.date=t=>e.check(sl(t)),e.time=t=>e.check(ol(t)),e.duration=t=>e.check(cl(t))});function zl(e){return function(e,t){return new e({type:"string",...Vi(t)})}(kl,e)}const Ol=Ei("ZodStringFormat",(e,t)=>{uc.init(e,t),El.init(e,t)}),$l=Ei("ZodEmail",(e,t)=>{pc.init(e,t),Ol.init(e,t)});function Il(e){return Wu($l,e)}const Tl=Ei("ZodGUID",(e,t)=>{dc.init(e,t),Ol.init(e,t)});function Pl(e){return Vu(Tl,e)}const Rl=Ei("ZodUUID",(e,t)=>{lc.init(e,t),Ol.init(e,t)});function Nl(e){return Hu(Rl,e)}function Al(e){return Gu(Rl,e)}function jl(e){return Yu(Rl,e)}function Cl(e){return Xu(Rl,e)}const Dl=Ei("ZodURL",(e,t)=>{hc.init(e,t),Ol.init(e,t)});function Zl(e){return ed(Dl,e)}function Fl(e){return ed(Dl,{protocol:/^https?$/,hostname:ta,...Vi(e)})}const Ul=Ei("ZodEmoji",(e,t)=>{fc.init(e,t),Ol.init(e,t)});function Ml(e){return td(Ul,e)}const Ll=Ei("ZodNanoID",(e,t)=>{mc.init(e,t),Ol.init(e,t)});function ql(e){return nd(Ll,e)}const Jl=Ei("ZodCUID",(e,t)=>{yc.init(e,t),Ol.init(e,t)});function Ql(e){return rd(Jl,e)}const Kl=Ei("ZodCUID2",(e,t)=>{gc.init(e,t),Ol.init(e,t)});function Bl(e){return sd(Kl,e)}const Wl=Ei("ZodULID",(e,t)=>{_c.init(e,t),Ol.init(e,t)});function Vl(e){return id(Wl,e)}const Hl=Ei("ZodXID",(e,t)=>{vc.init(e,t),Ol.init(e,t)});function Gl(e){return od(Hl,e)}const Yl=Ei("ZodKSUID",(e,t)=>{bc.init(e,t),Ol.init(e,t)});function Xl(e){return ad(Yl,e)}const ep=Ei("ZodIPv4",(e,t)=>{kc.init(e,t),Ol.init(e,t)});function tp(e){return cd(ep,e)}const np=Ei("ZodMAC",(e,t)=>{Oc.init(e,t),Ol.init(e,t)});function rp(e){return function(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Vi(t)})}(np,e)}const sp=Ei("ZodIPv6",(e,t)=>{zc.init(e,t),Ol.init(e,t)});function ip(e){return ud(sp,e)}const op=Ei("ZodCIDRv4",(e,t)=>{$c.init(e,t),Ol.init(e,t)});function ap(e){return dd(op,e)}const cp=Ei("ZodCIDRv6",(e,t)=>{Ic.init(e,t),Ol.init(e,t)});function up(e){return ld(cp,e)}const dp=Ei("ZodBase64",(e,t)=>{Pc.init(e,t),Ol.init(e,t)});function lp(e){return pd(dp,e)}const pp=Ei("ZodBase64URL",(e,t)=>{Rc.init(e,t),Ol.init(e,t)});function hp(e){return hd(pp,e)}const fp=Ei("ZodE164",(e,t)=>{Nc.init(e,t),Ol.init(e,t)});function mp(e){return fd(fp,e)}const yp=Ei("ZodJWT",(e,t)=>{Ac.init(e,t),Ol.init(e,t)});function gp(e){return md(yp,e)}const _p=Ei("ZodCustomStringFormat",(e,t)=>{jc.init(e,t),Ol.init(e,t)});function vp(e,t,n={}){return Qd(_p,e,t,n)}function bp(e){return Qd(_p,"hostname",ea,e)}function wp(e){return Qd(_p,"hex",ga,e)}function Sp(e,n){const r=`${e}_${n?.enc??"hex"}`,s=t[r];if(!s)throw new Error(`Unrecognized hash format: ${r}`);return Qd(_p,r,s,n)}const xp=Ei("ZodNumber",(e,t)=>{Cc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:s,maximum:i,format:o,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;"string"==typeof o&&o.includes("int")?r.type="integer":r.type="number","number"==typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u),"number"==typeof s&&(r.minimum=s,"number"==typeof u&&"draft-04"!==t.target&&(u>=s?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c),"number"==typeof i&&(r.maximum=i,"number"==typeof c&&"draft-04"!==t.target&&(c<=i?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(_d(t,n)),e.gte=(t,n)=>e.check(vd(t,n)),e.min=(t,n)=>e.check(vd(t,n)),e.lt=(t,n)=>e.check(yd(t,n)),e.lte=(t,n)=>e.check(gd(t,n)),e.max=(t,n)=>e.check(gd(t,n)),e.int=t=>e.check(zp(t)),e.safe=t=>e.check(zp(t)),e.positive=t=>e.check(_d(0,t)),e.nonnegative=t=>e.check(vd(0,t)),e.negative=t=>e.check(yd(0,t)),e.nonpositive=t=>e.check(gd(0,t)),e.multipleOf=(t,n)=>e.check(Ed(t,n)),e.step=(t,n)=>e.check(Ed(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ep(e){return function(e,t){return new e({type:"number",checks:[],...Vi(t)})}(xp,e)}const kp=Ei("ZodNumberFormat",(e,t)=>{Dc.init(e,t),xp.init(e,t)});function zp(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Vi(t)})}(kp,e)}function Op(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Vi(t)})}(kp,e)}function $p(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Vi(t)})}(kp,e)}function Ip(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Vi(t)})}(kp,e)}function Tp(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Vi(t)})}(kp,e)}const Pp=Ei("ZodBoolean",(e,t)=>{Zc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function Rp(e){return function(e,t){return new e({type:"boolean",...Vi(t)})}(Pp,e)}const Np=Ei("ZodBigInt",(e,t)=>{Fc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema")})(0,e),e.gte=(t,n)=>e.check(vd(t,n)),e.min=(t,n)=>e.check(vd(t,n)),e.gt=(t,n)=>e.check(_d(t,n)),e.gte=(t,n)=>e.check(vd(t,n)),e.min=(t,n)=>e.check(vd(t,n)),e.lt=(t,n)=>e.check(yd(t,n)),e.lte=(t,n)=>e.check(gd(t,n)),e.max=(t,n)=>e.check(gd(t,n)),e.positive=t=>e.check(_d(BigInt(0),t)),e.negative=t=>e.check(yd(BigInt(0),t)),e.nonpositive=t=>e.check(gd(BigInt(0),t)),e.nonnegative=t=>e.check(vd(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Ed(t,n));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Ap(e){return function(e,t){return new e({type:"bigint",...Vi(t)})}(Np,e)}const jp=Ei("ZodBigIntFormat",(e,t)=>{Uc.init(e,t),Np.init(e,t)});function Cp(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Vi(t)})}(jp,e)}function Dp(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Vi(t)})}(jp,e)}const Zp=Ei("ZodSymbol",(e,t)=>{Mc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema")})(0,e)});function Fp(e){return function(e,t){return new e({type:"symbol",...Vi(t)})}(Zp,e)}const Up=Ei("ZodUndefined",(e,t)=>{Lc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema")})(0,e)});function Mp(e){return function(e,t){return new e({type:"undefined",...Vi(t)})}(Up,e)}const Lp=Ei("ZodNull",(e,t)=>{qc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{"openapi-3.0"===t.target?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"})(0,e,t)});function qp(e){return function(e,t){return new e({type:"null",...Vi(t)})}(Lp,e)}const Jp=Ei("ZodAny",(e,t)=>{Jc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Qp(){return new Jp({type:"any"})}const Kp=Ei("ZodUnknown",(e,t)=>{Qc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Bp(){return new Kp({type:"unknown"})}const Wp=Ei("ZodNever",(e,t)=>{Kc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function Vp(e){return function(e,t){return new e({type:"never",...Vi(t)})}(Wp,e)}const Hp=Ei("ZodVoid",(e,t)=>{Bc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Void cannot be represented in JSON Schema")})(0,e)});function Gp(e){return function(e,t){return new e({type:"void",...Vi(t)})}(Hp,e)}const Yp=Ei("ZodDate",(e,t)=>{Wc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Date cannot be represented in JSON Schema")})(0,e),e.min=(t,n)=>e.check(vd(t,n)),e.max=(t,n)=>e.check(gd(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Xp(e){return function(e,t){return new e({type:"date",...Vi(t)})}(Yp,e)}const eh=Ei("ZodArray",(e,t)=>{Hc.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;"number"==typeof o&&(s.minItems=o),"number"==typeof a&&(s.maxItems=a),s.type="array",s.items=Bd(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Id(t,n)),e.nonempty=t=>e.check(Id(1,t)),e.max=(t,n)=>e.check($d(t,n)),e.length=(t,n)=>e.check(Td(t,n)),e.unwrap=()=>e.element});function th(e,t){return function(e,t,n){return new e({type:"array",element:t,...Vi(n)})}(eh,e,t)}function nh(e){const t=e._zod.def.shape;return zh(Object.keys(t))}const rh=Ei("ZodObject",(e,t)=>{tu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const e in o)s.properties[e]=Bd(o[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));c.size>0&&(s.required=Array.from(c)),"never"===i.catchall?._zod.def.type?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=Bd(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(s.additionalProperties=!1)})(e,t,n,r),Ci(e,"shape",()=>t.shape),e.keyof=()=>zh(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Bp()}),e.loose=()=>e.clone({...e._zod.def,catchall:Bp()}),e.strict=()=>e.clone({...e._zod.def,catchall:Vp()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!qi(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Zi(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Di(this,"shape",n),n}});return Wi(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!qi(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Zi(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Di(this,"shape",n),n}});return Wi(e,n)}(e,t),e.merge=t=>function(e,t){const n=Zi(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Di(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Wi(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Wi(e,Zi(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Di(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Zi(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Di(this,"shape",r),r},checks:[]});return Wi(e,s)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Zi(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)s[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Di(this,"shape",s),s},checks:[]});return Wi(t,s)}(Ah,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Zi(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in s))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)s[t]=new e({type:"nonoptional",innerType:r[t]});return Di(this,"shape",s),s}});return Wi(t,r)}(Qh,e,t[0])});function sh(e,t){const n={type:"object",shape:e??{},...Vi(t)};return new rh(n)}function ih(e,t){return new rh({type:"object",shape:e,catchall:Vp(),...Vi(t)})}function oh(e,t){return new rh({type:"object",shape:e,catchall:Bp(),...Vi(t)})}const ah=Ei("ZodUnion",(e,t)=>{ru.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xd(e,t,n,r),e.options=t.options});function ch(e,t){return new ah({type:"union",options:e,...Vi(t)})}const uh=Ei("ZodXor",(e,t)=>{ah.init(e,t),iu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xd(e,t,n,r),e.options=t.options});function dh(e,t){return new uh({type:"union",options:e,inclusive:!1,...Vi(t)})}const lh=Ei("ZodDiscriminatedUnion",(e,t)=>{ah.init(e,t),ou.init(e,t)});function ph(e,t,n){return new lh({type:"union",options:t,discriminator:e,...Vi(n)})}const hh=Ei("ZodIntersection",(e,t)=>{au.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i=Bd(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=Bd(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,c=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=c})(e,t,n,r)});function fh(e,t){return new hh({type:"intersection",left:e,right:t})}const mh=Ei("ZodTuple",(e,t)=>{du.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="array";const o="draft-2020-12"===t.target?"prefixItems":"items",a="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",c=i.items.map((e,n)=>Bd(e,t,{...r,path:[...r.path,o,n]})),u=i.rest?Bd(i.rest,t,{...r,path:[...r.path,a,..."openapi-3.0"===t.target?[i.items.length]:[]]}):null;"draft-2020-12"===t.target?(s.prefixItems=c,u&&(s.items=u)):"openapi-3.0"===t.target?(s.items={anyOf:c},u&&s.items.anyOf.push(u),s.minItems=c.length,u||(s.maxItems=c.length)):(s.items=c,u&&(s.additionalItems=u));const{minimum:d,maximum:l}=e._zod.bag;"number"==typeof d&&(s.minItems=d),"number"==typeof l&&(s.maxItems=l)})(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function yh(e,t,n){const r=t instanceof ac;return new mh({type:"tuple",items:e,rest:r?t:null,...Vi(r?n:t)})}const gh=Ei("ZodRecord",(e,t)=>{pu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,a=o._zod.bag,c=a?.patterns;if("loose"===i.mode&&c&&c.size>0){const e=Bd(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const t of c)s.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(s.propertyNames=Bd(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=Bd(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=o._zod.values;if(u){const e=[...u].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(s.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function _h(e,t,n){return new gh({type:"record",keyType:e,valueType:t,...Vi(n)})}function vh(e,t,n){const r=Wi(e);return r._zod.values=void 0,new gh({type:"record",keyType:r,valueType:t,...Vi(n)})}function bh(e,t,n){return new gh({type:"record",keyType:e,valueType:t,mode:"loose",...Vi(n)})}const wh=Ei("ZodMap",(e,t)=>{hu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Map cannot be represented in JSON Schema")})(0,e),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(zd(...t)),e.nonempty=t=>e.check(zd(1,t)),e.max=(...t)=>e.check(kd(...t)),e.size=(...t)=>e.check(Od(...t))});function Sh(e,t,n){return new wh({type:"map",keyType:e,valueType:t,...Vi(n)})}const xh=Ei("ZodSet",(e,t)=>{mu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Set cannot be represented in JSON Schema")})(0,e),e.min=(...t)=>e.check(zd(...t)),e.nonempty=t=>e.check(zd(1,t)),e.max=(...t)=>e.check(kd(...t)),e.size=(...t)=>e.check(Od(...t))});function Eh(e,t){return new xh({type:"set",valueType:e,...Vi(t)})}const kh=Ei("ZodEnum",(e,t)=>{gu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=Ii(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const s={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);s[r]=t.entries[r]}return new kh({...t,checks:[],...Vi(r),entries:s})},e.exclude=(e,r)=>{const s={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete s[t]}return new kh({...t,checks:[],...Vi(r),entries:s})}});function zh(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new kh({type:"enum",entries:n,...Vi(t)})}function Oh(e,t){return new kh({type:"enum",entries:e,...Vi(t)})}const $h=Ei("ZodLiteral",(e,t)=>{_u.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,s=[];for(const e of r.values)if(void 0===e){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(e))}else s.push(e);if(0===s.length);else if(1===s.length){const e=s[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else s.every(e=>"number"==typeof e)&&(n.type="number"),s.every(e=>"string"==typeof e)&&(n.type="string"),s.every(e=>"boolean"==typeof e)&&(n.type="boolean"),s.every(e=>null===e)&&(n.type="null"),n.enum=s})(e,t,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Ih(e,t){return new $h({type:"literal",values:Array.isArray(e)?e:[e],...Vi(t)})}const Th=Ei("ZodFile",(e,t)=>{vu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:o,mime:a}=e._zod.bag;void 0!==i&&(s.minLength=i),void 0!==o&&(s.maxLength=o),a?1===a.length?(s.contentMediaType=a[0],Object.assign(r,s)):(Object.assign(r,s),r.anyOf=a.map(e=>({contentMediaType:e}))):Object.assign(r,s)})(e,0,n),e.min=(t,n)=>e.check(zd(t,n)),e.max=(t,n)=>e.check(kd(t,n)),e.mime=(t,n)=>e.check(Zd(Array.isArray(t)?t:[t],n))});function Ph(e){return function(e,t){return new e({type:"file",...Vi(t)})}(Th,e)}const Rh=Ei("ZodTransform",(e,t)=>{bu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new zi(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(io(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(io(t))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)}});function Nh(e){return new Rh({type:"transform",transform:e})}const Ah=Ei("ZodOptional",(e,t)=>{Su.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function jh(e){return new Ah({type:"optional",innerType:e})}const Ch=Ei("ZodExactOptional",(e,t)=>{xu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Dh(e){return new Ch({type:"optional",innerType:e})}const Zh=Ei("ZodNullable",(e,t)=>{Eu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i=Bd(s.innerType,t,r),o=t.seen.get(e);"openapi-3.0"===t.target?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fh(e){return new Zh({type:"nullable",innerType:e})}function Uh(e){return jh(Fh(e))}const Mh=Ei("ZodDefault",(e,t)=>{ku.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Bd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Lh(e,t){return new Mh({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():Ji(t)}})}const qh=Ei("ZodPrefault",(e,t)=>{Ou.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Bd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jh(e,t){return new qh({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():Ji(t)}})}const Qh=Ei("ZodNonOptional",(e,t)=>{$u.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Bd(s.innerType,t,r),t.seen.get(e).ref=s.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Kh(e,t){return new Qh({type:"nonoptional",innerType:e,...Vi(t)})}const Bh=Ei("ZodSuccess",(e,t)=>{Tu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t),e.unwrap=()=>e._zod.def.innerType});function Wh(e){return new Bh({type:"success",innerType:e})}const Vh=Ei("ZodCatch",(e,t)=>{Pu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;let i;Bd(s.innerType,t,r),t.seen.get(e).ref=s.innerType;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Hh(e,t){return new Vh({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}const Gh=Ei("ZodNaN",(e,t)=>{Ru.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema")})(0,e)});function Yh(e){return function(e,t){return new e({type:"nan",...Vi(t)})}(Gh,e)}const Xh=Ei("ZodPipe",(e,t)=>{Nu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i="input"===t.io?"transform"===s.in._zod.def.type?s.out:s.in:s.out;Bd(i,t,r),t.seen.get(e).ref=i})(e,t,0,r),e.in=t.in,e.out=t.out});function ef(e,t){return new Xh({type:"pipe",in:e,out:t})}const tf=Ei("ZodCodec",(e,t)=>{Xh.init(e,t),ju.init(e,t)});function nf(e,t,n){return new tf({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const rf=Ei("ZodReadonly",(e,t)=>{Zu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Bd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sf(e){return new rf({type:"readonly",innerType:e})}const of=Ei("ZodTemplateLiteral",(e,t)=>{Uu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=s.source})(e,0,n)});function af(e,t){return new of({type:"template_literal",parts:e,...Vi(t)})}const cf=Ei("ZodLazy",(e,t)=>{qu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.innerType;Bd(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.unwrap=()=>e._zod.def.getter()});function uf(e){return new cf({type:"lazy",getter:e})}const df=Ei("ZodPromise",(e,t)=>{Lu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Bd(s.innerType,t,r),t.seen.get(e).ref=s.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function lf(e){return new df({type:"promise",innerType:e})}const pf=Ei("ZodFunction",(e,t)=>{Mu.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Function types cannot be represented in JSON Schema")})(0,e)});function hf(e){return new pf({type:"function",input:Array.isArray(e?.input)?yh(e?.input):e?.input??th(Bp()),output:e?.output??Bp()})}const ff=Ei("ZodCustom",(e,t)=>{Ju.init(e,t),xl.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});function mf(e){const t=new ja({check:"custom"});return t._zod.check=e,t}function yf(e,t){return function(e,t,n){const r=Vi(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}(ff,e??(()=>!0),t)}function gf(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Vi(n)})}(ff,e,t)}function _f(e){return function(e){const t=function(e){const t=new ja({check:"custom",...Vi(void 0)});return t._zod.check=e,t}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(io(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(io(r))}},e(n.value,n)));return t}(e)}const vf=function(e){const t=new ja({check:"describe"});return t._zod.onattach=[t=>{const n=Bu.get(t)??{};Bu.add(t,{...n,description:e})}],t._zod.check=()=>{},t},bf=function(e){const t=new ja({check:"meta"});return t._zod.onattach=[t=>{const n=Bu.get(t)??{};Bu.add(t,{...n,...e})}],t._zod.check=()=>{},t};function wf(e,t={}){const n=new ff({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...Vi(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}const Sf=(...e)=>function(e,t){const n=Vi(t);let r=n.truthy??["true","1","yes","on","y","enabled"],s=n.falsy??["false","0","no","off","n","disabled"];"sensitive"!==n.case&&(r=r.map(e=>"string"==typeof e?e.toLowerCase():e),s=s.map(e=>"string"==typeof e?e.toLowerCase():e));const i=new Set(r),o=new Set(s),a=e.Codec??ju,c=e.Boolean??Zc,u=new a({type:"pipe",in:new(e.String??cc)({type:"string",error:n.error}),out:new c({type:"boolean",error:n.error}),transform:(e,t)=>{let r=e;return"sensitive"!==n.case&&(r=r.toLowerCase()),!!i.has(r)||!o.has(r)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...o],input:t.value,inst:u,continue:!1}),{})},reverseTransform:(e,t)=>!0===e?r[0]||"true":s[0]||"false",error:n.error});return u}({Codec:tf,Boolean:Pp,String:kl},...e);function xf(e){const t=uf(()=>ch([zl(e),Ep(),Rp(),qp(),th(t),_h(zl(),t)]));return t}function Ef(e,t){return ef(Nh(e),t)}var kf;function zf(e){if("KW"!==e.country)throw new Error("The shipping address is not in Kuwait. Only Kuwaiti shipping addresses are supported.")}function Of(e,t){const n=e[t];return zf(n),{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:n.city,province:n.state.length>0?n.state:null,address_line_1:n.address_1,address_line_2:n.address_2.length>0?n.address_2:null},name:Rf(e)}}function $f(e,t){const n=e[t];return zf(n),{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:[n.state,n.city].filter(e=>e.length>0).join(" --- "),province:null,address_line_1:n.address_1,address_line_2:n.address_2.length>0?n.address_2:null},name:Rf(e)}}function If(e,t){const n=e[t];zf(n);const r=Pf(e,"_billing_piece")??"",s=Pf(e,"_billing_name"),i=`BLOCK_FIELD: ${r} --- STREET_FIELD: ${n.postcode} --- HOUSE_FIELD: ${n.address_1} --- FLOOR_APT_FIELD: ${n.address_2}`;return{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:n.city,province:n.state.length>0?n.state:null,address_line_1:i,address_line_2:null},name:"string"==typeof s&&s.length>0?s:Rf(e)}}function Tf(e,t){const n=Pf(e,"governorate")??"",r=["area1","area2","area3","area4","area5","area6"].map(t=>Pf(e,t)??"").filter(e=>e.length>0),s=Pf(e,"block")??"",i=Pf(e,"street")??"",o=Pf(e,"house")??"";return{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:r.join(" --- "),province:n.length>0?n:null,address_line_1:`BLOCK_FIELD: ${s} --- STREET_FIELD: ${i} --- HOUSE_FIELD: ${o}`,address_line_2:null},name:Rf(e)}}function Pf(e,t){const n=e.meta_data.find(e=>e.key===t);return n&&"string"==typeof n.value?n.value:null}function Rf(e){const t=Nf(e.shipping.first_name,e.shipping.last_name);if(t.length>0)return t;const n=Nf(e.billing.first_name,e.billing.last_name);return n.length>0?n:(console.warn(`Order ${e.id} is missing customer name in both shipping address and billing address.`),"")}function Nf(e,t){const n=e.trim(),r=t.trim();return 0===n.length?"":r.length>0?`${n} ${r}`:n}kf||(kf={}),new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]),$i({localeError:(()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(t){return e[t]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return e=>{switch(e.code){case"invalid_type":{const t=r[e.expected]??e.expected,n=function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(null===e)return"null";if(Array.isArray(e))return"array";const t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return t}(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case"invalid_value":return 1===e.values.length?`Invalid input: expected ${Hi(e.values[0])}`:`Invalid option: expected one of ${Ti(e.values,"|")}`;case"too_big":{const n=e.inclusive?"<=":"<",r=t(e.origin);return r?`Too big: expected ${e.origin??"value"} to have ${n}${e.maximum.toString()} ${r.unit??"elements"}`:`Too big: expected ${e.origin??"value"} to be ${n}${e.maximum.toString()}`}case"too_small":{const n=e.inclusive?">=":">",r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case"invalid_format":{const t=e;return"starts_with"===t.format?`Invalid string: must start with "${t.prefix}"`:"ends_with"===t.format?`Invalid string: must end with "${t.suffix}"`:"includes"===t.format?`Invalid string: must include "${t.includes}"`:"regex"===t.format?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${Ti(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`}}})()});const Af=sh({id:Ep(),order_key:zl(),billing:sh({first_name:zl(),last_name:zl(),address_1:zl(),address_2:zl(),city:zl(),state:zl(),postcode:zl(),country:zl(),email:ch([Il().trim(),Ih("").transform(e=>e||null)]),phone:zl()}),shipping:sh({first_name:zl(),last_name:zl(),company:zl(),address_1:zl(),address_2:zl(),city:zl(),state:zl(),postcode:zl(),country:zl(),phone:zl()}),meta_data:th(sh({key:zl(),value:Bp()})).default([])}),jf=window.WORDPRESS_SITE_URL;Si("string"==typeof jf&&jf.length>0,"WORDPRESS_SITE_URL is not defined");const Cf=new URL(jf).hostname,Df=window.JAAK_WORDPRESS_REST_ROOT;Si("string"==typeof Df&&Df.length>0,"JAAK_WORDPRESS_REST_ROOT is not defined");const Zf=window.JAAK_SITE_BASE_URL;Si("string"==typeof Zf&&Zf.length>0,"SITE_BASE_URL is not defined");const Ff=function(e,t){const n=function(e,t){if("string"!=typeof e||0===e.length)throw new Error(`${t} is missing or not a string.`);try{new URL(e)}catch{throw new Error(`${t} is not a valid URL: ${e}`)}return e}(e,"API_ROOT_URL");return wi(n,t).api}(Df,{headers:{"X-WP-Nonce":"string"==typeof window.wp_api_settings?.nonce?window.wp_api_settings.nonce:""}});function Uf(){return(0,X.jsx)("div",{className:"inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600"})}function Mf({on_click:e,children:t,disabled:n=!1,loading:r=!1,variant:s="primary"}){return(0,X.jsxs)("button",{onClick:e,disabled:n||r,className:`px-4 py-2 rounded font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-2 ${{primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-200 text-gray-800 hover:bg-gray-300"}[s]}`,type:"button",children:[r&&(0,X.jsx)(Uf,{}),t]})}function Lf(){const e=`${window.WORDPRESS_SITE_URL}/wp-admin/admin.php?page=wc-settings&tab=integration&section=jaak`;return(0,X.jsxs)("div",{className:"rounded border border-yellow-200 bg-yellow-50 px-4 py-3 text-yellow-800",children:[(0,X.jsxs)("p",{className:"text-sm",children:[(0,X.jsx)("strong",{children:"Configuration Required:"})," ","Jaak plugin is not configured. Please add your API key in the plugin settings to use this feature."]}),(0,X.jsx)("p",{className:"mt-2 text-sm",children:(0,X.jsx)("a",{href:e,className:"font-medium text-yellow-900 underline hover:text-yellow-700",children:"Go to Settings →"})})]})}function qf({error:e}){return e instanceof xi&&"unauthorized"===e.type?(0,X.jsxs)("div",{className:"rounded border border-yellow-200 bg-yellow-50 px-4 py-3 text-yellow-800",children:[(0,X.jsx)("p",{className:"text-sm font-semibold",children:e.title}),"string"==typeof e.detail&&e.detail.length>0&&(0,X.jsx)("p",{className:"mt-1 text-sm",children:e.detail})]}):e instanceof xi?(0,X.jsxs)("div",{className:"rounded border border-red-200 bg-red-50 px-4 py-3 text-red-800",children:[(0,X.jsx)("p",{className:"text-sm font-semibold",children:e.title}),"string"==typeof e.detail&&e.detail.length>0&&(0,X.jsxs)("details",{className:"mt-2",children:[(0,X.jsx)("summary",{className:"cursor-pointer text-xs",children:"Show error details"}),(0,X.jsx)("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap text-xs",children:e.detail})]})]}):(0,X.jsx)("div",{className:"rounded border border-red-200 bg-red-50 px-4 py-3 text-red-800",children:(0,X.jsxs)("p",{className:"text-sm",children:[e.name,": ",e.message]})})}const Jf={PAUSED:"Waiting for merchant to accept shipping rate.",PENDING:"Task has been accepted but does not yet have a driver assigned.",PICKUP:"Driver is assigned and moving towards the pickup.",DROPOFF:"Driver is moving towards the dropoff.",DELIVERED:"Driver has completed the delivery.",CANCELLED:"Delivery has been cancelled.",RETURN:"Driver is returning to the merchant.",RETURN_COMPLETE:"Driver has completed the return."},Qf={PAUSED:"bg-blue-100 text-blue-800",PENDING:"bg-blue-100 text-blue-800",PICKUP:"bg-green-100 text-green-800",DROPOFF:"bg-green-100 text-green-800",DELIVERED:"bg-green-100 text-green-800",CANCELLED:"bg-red-100 text-red-800",RETURN:"bg-red-100 text-red-800",RETURN_COMPLETE:"bg-red-100 text-red-800"},Kf={PAUSED:"bg-blue-100 text-blue-800",PENDING:"bg-blue-100 text-blue-800",PICKUP:"bg-blue-100 text-blue-800",DROPOFF:"bg-green-100 text-green-800",DELIVERED:"bg-green-100 text-green-800",CANCELLED:"bg-red-100 text-red-800",RETURN:"bg-red-100 text-red-800",RETURN_COMPLETE:"bg-red-100 text-red-800"},Bf={PAUSED:"bg-blue-100 text-blue-800",PENDING:"bg-blue-100 text-blue-800",PICKUP:"bg-blue-100 text-blue-800",DROPOFF:"bg-blue-100 text-blue-800",DELIVERED:"bg-green-100 text-green-800",CANCELLED:"bg-red-100 text-red-800",RETURN:"bg-red-100 text-red-800",RETURN_COMPLETE:"bg-red-100 text-red-800"},Wf={month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0};function Vf({task:e}){const t=e.status,n=e.stops.find(e=>"PICKUP"===e.kind)?.finalized_at,r=e.stops.find(e=>"DROPOFF"===e.kind)?.finalized_at,s=`${Zf}/tasks/${e.id}`;return(0,X.jsxs)("div",{className:"space-y-4",children:[(0,X.jsx)("div",{className:"flex justify-center pb-4",children:"PAUSED"!==e.status?(0,X.jsx)("a",{href:s,target:"_blank",className:"inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",rel:"noopener",children:"View Details"}):(0,X.jsx)("a",{href:`${Zf}/plan`,target:"_blank",rel:"noopener",className:"inline-flex items-center rounded-md border border-transparent bg-blue-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-blue-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"View Shipping Rate"})}),(0,X.jsxs)("div",{className:"flex items-start justify-around pb-4",children:[(0,X.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,X.jsx)("div",{className:"text-2xl",children:"👤"}),(0,X.jsx)("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${Qf[t]||"bg-gray-100 text-gray-800"}`,children:"1. Assign driver"}),(0,X.jsx)("div",{className:"h-5",children:" "})]}),(0,X.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,X.jsx)("div",{className:"text-2xl",children:"📦"}),(0,X.jsx)("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${Kf[t]||"bg-gray-100 text-gray-800"}`,children:"2. Pickup"}),(0,X.jsx)("div",{className:"h-5 text-xs font-light text-gray-500",children:"string"==typeof n?new Date(n).toLocaleString("en-US",Wf):" "})]}),(0,X.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,X.jsx)("div",{className:"text-2xl",children:"🚚"}),(0,X.jsx)("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${Bf[t]||"bg-gray-100 text-gray-800"}`,children:"3. Dropoff"}),(0,X.jsx)("div",{className:"h-5 text-xs font-light text-gray-500",children:"string"==typeof r?new Date(r).toLocaleString("en-US",Wf):" "})]})]}),(0,X.jsxs)("div",{className:"ps-6",children:[(0,X.jsxs)("span",{className:"text-sm font-normal italic text-gray-700",children:["Status: ",Jf[t]]})," ",(0,X.jsx)("a",{href:s,target:"_blank",className:"text-sm text-blue-600 underline hover:text-blue-800",rel:"noopener",children:"See task details."})]})]})}function Hf({order_id:e,order_key:t}){const n=te(),r=(s={queryKey:["tasks",t],queryFn:async()=>async function(e){console.debug(`Getting tasks for order keys: ${e.join(", ")}`);const t=await Ff.tasks.$get({query:{external_id:e}});if(401===t.status||403===t.status)throw new xi({type:"unauthorized",title:"Authentication Failed",detail:"Please check your API key configuration."});if(400===t.status){const e=await t.json();throw console.error("Bad request response data:",e),new xi({type:"bad_request",title:"Bad Request",detail:JSON.stringify(e,null,2)})}const n=(await t.json()).data;if(console.debug(`Got ${n.length} task(s)`),n[0])return n;if(0===n.length)return null;throw new Error("No tasks found")}([t]),refetchOnWindowFocus:!0},function(e,t,n){const r=Y.useContext(de),s=Y.useContext(ue),i=te(n),o=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const u=i.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,n=e=>"static"===e?e:Math.max(e??t,t),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>n(r(...e)):n(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(o),((e,t,n)=>{const r=n?.state.error&&"function"==typeof e.throwOnError?I(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))})(o,s,u),(e=>{Y.useEffect(()=>{e.clearReset()},[e])})(s);const d=!i.getQueryCache().get(o.queryHash),[l]=Y.useState(()=>new t(i,o)),p=l.getOptimisticResult(o),h=!r&&!1!==e.subscribed;if(Y.useSyncExternalStore(Y.useCallback(e=>{const t=h?l.subscribe(P.batchCalls(e)):c;return l.updateResult(),t},[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Y.useEffect(()=>{l.setOptions(o)},[o,l]),((e,t)=>e?.suspense&&t.isPending)(o,p))throw le(o,l,s);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&void 0===e.data||I(n,[e.error,r])))({result:p,errorResetBoundary:s,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw p.error;if(i.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!a&&((e,t)=>e.isLoading&&e.isFetching&&!t)(p,r)){const e=d?le(o,l,s):u?.promise;e?.catch(c).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?p:l.trackResult(p)}(s,se,void 0));var s;const i=function(e){const t=te(void 0),[n]=Y.useState(()=>new pe(t,e));Y.useEffect(()=>{n.setOptions(e)},[n,e]);const r=Y.useSyncExternalStore(Y.useCallback(e=>n.subscribe(P.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=Y.useCallback((e,t)=>{n.mutate(e,t).catch(c)},[n]);if(r.error&&I(n.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:s,mutateAsync:r.mutate}}({mutationFn:async()=>async function(e){console.debug(`Creating tasks for order IDs: ${e.join(", ")}`);const t=await async function(e){console.debug(`Fetching WooCommerce orders: ${e.join(", ")}`);const t=`${Df}/orders`,n=window.wp_api_settings?.nonce;Si("string"==typeof n&&n.length>0,"WP Nonce is not defined");const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":n},credentials:"include",body:JSON.stringify({order_ids:e})});if(!r.ok)throw new xi({type:"api_error",title:"Failed to fetch orders from WordPress",detail:`${r.status} ${r.statusText}`});const s=await r.json();Wr({level:"debug",message:"[jaak-for-woocommerce] Raw order data from WordPress REST API",extra:{requested_order_ids:e,raw_response:s}});const i=th(Af).parse(s);return console.debug(`Fetched ${i.length} order(s)`),i}(e);console.debug(`Submitting tasks for ${t.length} order(s)`);const n=t.map(e=>function(e){const t=e.shipping.address_1.length>0?"shipping":"billing",n=!0===window.JAAK_IS_FORCE_DEFAULT_ADDRESS_PARSER,{parser:r,parser_name:s}=function(e,t={}){if(!0===t.force_default_address_parser)return{parser:Of,parser_name:"default_parser"};const n=e.toLowerCase();return n.endsWith("eitkw.com")?{parser:$f,parser_name:"eit_parser"}:n.endsWith("gbc-kwt.com")?{parser:If,parser_name:"gbc_parser"}:n.endsWith("somedaykw.com")?{parser:Tf,parser_name:"someday_parser"}:{parser:Of,parser_name:"default_parser"}}(Cf,{force_default_address_parser:n}),i=r(e,t);return function(e,t){Wr({level:"debug",message:"[jaak-for-woocommerce] Order fields parsed",extra:{order_id:e.id,parser_name:t.parser_name,is_force_default_address_parser:t.is_force_default_address_parser,source_address_key:t.source_address_key,parsed_destination:t.parsed_order.destination,parsed_name:t.parsed_order.name}})}(e,{parser_name:s,source_address_key:t,parsed_order:i,is_force_default_address_parser:n}),{external_id:e.order_key,external_ref:e.id.toString(),external_url:`${jf}/wp-admin/post.php?post=${e.id}&action=edit`,woocommerce_shop_domain:jf,destination:i.destination,email:e.billing.email,phone:e.shipping.phone||e.billing.phone,name:i.name}}(e)),r=await Ff.tasks.$post({json:n});if(401===r.status||403===r.status)throw new xi({type:"unauthorized",title:"Authentication Failed",detail:"Please check your API key configuration."});if(!r.ok){let e="Failed to create tasks";try{const t=await r.json();e=JSON.stringify(t,null,2)}catch(e){console.error("Failed to parse error response:",e)}throw new xi({type:"bad_request",title:"Failed to create tasks",detail:e})}}([e]),onSuccess:async()=>{await n.invalidateQueries({queryKey:["tasks",t]})}});if(!0!==window.JAAK_IS_CONFIGURED)return(0,X.jsx)("div",{className:"space-y-3",children:(0,X.jsx)(Lf,{})});const o=r.data;return r.isPending?(0,X.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:[(0,X.jsx)(Uf,{}),(0,X.jsx)("span",{className:"text-gray-600",children:"Loading"})]}):(0,X.jsxs)("div",{className:"space-y-3",children:[r.isError&&(0,X.jsx)(qf,{error:r.error}),i.isError&&(0,X.jsx)(qf,{error:i.error}),o?.map(e=>(0,X.jsx)("div",{className:"pb-4",children:(0,X.jsx)(Vf,{task:e})},e.id)),(!o||o.length<1)&&(0,X.jsx)("div",{className:"flex justify-center",children:(0,X.jsx)(Mf,{on_click:()=>i.mutate(),loading:i.isPending,disabled:i.isPending,children:"Send to Jaak"})}),(0,X.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,X.jsxs)(Mf,{on_click:async()=>r.refetch(),disabled:r.isFetching,variant:"secondary",children:["Updated: ",new Date(r.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})]})}),o&&o.length>=1&&(0,X.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,X.jsx)(Mf,{on_click:()=>i.mutate(),disabled:i.isPending,variant:"secondary",children:"Send order to Jaak (again)"})})]})}const Gf=new class{#W;#g;#p;#V;#H;#G;#Y;#X;constructor(e={}){this.#W=e.queryCache||new Q,this.#g=e.mutationCache||new B,this.#p=e.defaultOptions||{},this.#V=new Map,this.#H=new Map,this.#G=0}mount(){this.#G++,1===this.#G&&(this.#Y=N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#W.onFocus())}),this.#X=A.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#W.onOnline())}))}unmount(){this.#G--,0===this.#G&&(this.#Y?.(),this.#Y=void 0,this.#X?.(),this.#X=void 0)}isFetching(e){return this.#W.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#g.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#W.build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(l(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#W.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#W.get(r.queryHash),i=s?.state.data,o=function(e,t){return"function"==typeof e?e(t):e}(t,i);if(void 0!==o)return this.#W.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return P.batch(()=>this.#W.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state}removeQueries(e){const t=this.#W;P.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const n=this.#W;return P.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=P.batch(()=>this.#W.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(c).catch(c)}invalidateQueries(e,t={}){return P.batch(()=>(this.#W.findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=P.batch(()=>this.#W.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(c)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(r).then(c)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=this.#W.build(this,t);return n.isStaleByTime(l(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(c).catch(c)}fetchInfiniteQuery(e){return e.behavior=V(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(c).catch(c)}ensureInfiniteQueryData(e){return e.behavior=V(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return A.isOnline()?this.#g.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#W}getMutationCache(){return this.#g}getDefaultOptions(){return this.#p}setDefaultOptions(e){this.#p=e}setQueryDefaults(e,t){this.#V.set(y(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#V.values()],n={};return t.forEach(t=>{g(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#H.set(y(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#H.values()],n={};return t.forEach(t=>{g(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#p.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=m(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===O&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#p.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#W.clear(),this.#g.clear()}},Yf=document.getElementById("jaak-metabox-root");if(Yf){const e=Yf.getAttribute("data-order-id"),t=Yf.getAttribute("data-order-key");if("string"!=typeof e||"string"!=typeof t)throw new Error("Order ID and Order Key are required to render the Jaak Meta Box.");const n=Number.parseInt(e,10);(0,re.createRoot)(Yf).render((0,X.jsx)(ne,{client:Gf,children:(0,X.jsx)(Hf,{order_id:n,order_key:t})}))}})();
     1(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{base64:()=>Xo,base64url:()=>ea,bigint:()=>da,boolean:()=>ha,browserEmail:()=>Qo,cidrv4:()=>Go,cidrv6:()=>Yo,cuid:()=>Oo,cuid2:()=>$o,date:()=>ia,datetime:()=>ca,domain:()=>na,duration:()=>Ro,e164:()=>ra,email:()=>Fo,emoji:()=>Bo,extendedDuration:()=>Ao,guid:()=>jo,hex:()=>_a,hostname:()=>ta,html5Email:()=>Mo,idnEmail:()=>Jo,integer:()=>la,ipv4:()=>Wo,ipv6:()=>Vo,ksuid:()=>Po,lowercase:()=>ya,mac:()=>Ho,md5_base64:()=>Sa,md5_base64url:()=>xa,md5_hex:()=>wa,nanoid:()=>No,null:()=>fa,number:()=>pa,rfc5322Email:()=>Lo,sha1_base64:()=>ka,sha1_base64url:()=>za,sha1_hex:()=>Ea,sha256_base64:()=>$a,sha256_base64url:()=>Ia,sha256_hex:()=>Oa,sha384_base64:()=>Pa,sha384_base64url:()=>Na,sha384_hex:()=>Ta,sha512_base64:()=>Aa,sha512_base64url:()=>ja,sha512_hex:()=>Ra,string:()=>ua,time:()=>aa,ulid:()=>Io,undefined:()=>ma,unicodeEmail:()=>qo,uppercase:()=>ga,uuid:()=>Co,uuid4:()=>Do,uuid6:()=>Zo,uuid7:()=>Uo,xid:()=>To});var n={};e.r(n),e.d(n,{endsWith:()=>Dd,gt:()=>vd,gte:()=>bd,includes:()=>jd,length:()=>Pd,lowercase:()=>Rd,lt:()=>gd,lte:()=>_d,maxLength:()=>Id,maxSize:()=>zd,mime:()=>Ud,minLength:()=>Td,minSize:()=>Od,multipleOf:()=>kd,negative:()=>Sd,nonnegative:()=>Ed,nonpositive:()=>xd,normalize:()=>Md,overwrite:()=>Fd,positive:()=>wd,property:()=>Zd,regex:()=>Nd,size:()=>$d,slugify:()=>Qd,startsWith:()=>Cd,toLowerCase:()=>qd,toUpperCase:()=>Jd,trim:()=>Ld,uppercase:()=>Ad});var r={};e.r(r),e.d(r,{ZodISODate:()=>sl,ZodISODateTime:()=>nl,ZodISODuration:()=>cl,ZodISOTime:()=>ol,date:()=>il,datetime:()=>rl,duration:()=>ul,time:()=>al});var s={};e.r(s),e.d(s,{ZodAny:()=>Qp,ZodArray:()=>th,ZodBase64:()=>lp,ZodBase64URL:()=>hp,ZodBigInt:()=>Ap,ZodBigIntFormat:()=>Cp,ZodBoolean:()=>Np,ZodCIDRv4:()=>ap,ZodCIDRv6:()=>up,ZodCUID:()=>Ql,ZodCUID2:()=>Bl,ZodCatch:()=>Hh,ZodCodec:()=>nf,ZodCustom:()=>mf,ZodCustomStringFormat:()=>vp,ZodDate:()=>Xp,ZodDefault:()=>Lh,ZodDiscriminatedUnion:()=>ph,ZodE164:()=>mp,ZodEmail:()=>Il,ZodEmoji:()=>Ml,ZodEnum:()=>zh,ZodExactOptional:()=>Dh,ZodFile:()=>Ph,ZodFunction:()=>hf,ZodGUID:()=>Pl,ZodIPv4:()=>tp,ZodIPv6:()=>ip,ZodIntersection:()=>fh,ZodJWT:()=>gp,ZodKSUID:()=>Xl,ZodLazy:()=>uf,ZodLiteral:()=>Ih,ZodMAC:()=>rp,ZodMap:()=>Sh,ZodNaN:()=>Yh,ZodNanoID:()=>ql,ZodNever:()=>Vp,ZodNonOptional:()=>Kh,ZodNull:()=>qp,ZodNullable:()=>Uh,ZodNumber:()=>Ep,ZodNumberFormat:()=>zp,ZodObject:()=>sh,ZodOptional:()=>jh,ZodPipe:()=>ef,ZodPrefault:()=>Jh,ZodPromise:()=>lf,ZodReadonly:()=>sf,ZodRecord:()=>_h,ZodSet:()=>Eh,ZodString:()=>zl,ZodStringFormat:()=>$l,ZodSuccess:()=>Wh,ZodSymbol:()=>Up,ZodTemplateLiteral:()=>af,ZodTransform:()=>Rh,ZodTuple:()=>yh,ZodType:()=>El,ZodULID:()=>Vl,ZodURL:()=>Zl,ZodUUID:()=>Rl,ZodUndefined:()=>Mp,ZodUnion:()=>ch,ZodUnknown:()=>Bp,ZodVoid:()=>Gp,ZodXID:()=>Gl,ZodXor:()=>dh,_ZodString:()=>kl,_default:()=>qh,_function:()=>ff,any:()=>Kp,array:()=>nh,base64:()=>pp,base64url:()=>fp,bigint:()=>jp,boolean:()=>Rp,catch:()=>Gh,check:()=>yf,cidrv4:()=>cp,cidrv6:()=>dp,codec:()=>rf,cuid:()=>Kl,cuid2:()=>Wl,custom:()=>gf,date:()=>eh,describe:()=>bf,discriminatedUnion:()=>hh,e164:()=>yp,email:()=>Tl,emoji:()=>Ll,enum:()=>Oh,exactOptional:()=>Zh,file:()=>Nh,float32:()=>$p,float64:()=>Ip,function:()=>ff,guid:()=>Nl,hash:()=>xp,hex:()=>Sp,hostname:()=>wp,httpUrl:()=>Fl,instanceof:()=>Sf,int:()=>Op,int32:()=>Tp,int64:()=>Dp,intersection:()=>mh,ipv4:()=>np,ipv6:()=>op,json:()=>Ef,jwt:()=>_p,keyof:()=>rh,ksuid:()=>ep,lazy:()=>df,literal:()=>Th,looseObject:()=>ah,looseRecord:()=>wh,mac:()=>sp,map:()=>xh,meta:()=>wf,nan:()=>Xh,nanoid:()=>Jl,nativeEnum:()=>$h,never:()=>Hp,nonoptional:()=>Bh,null:()=>Jp,nullable:()=>Fh,nullish:()=>Mh,number:()=>kp,object:()=>ih,optional:()=>Ch,partialRecord:()=>bh,pipe:()=>tf,prefault:()=>Qh,preprocess:()=>kf,promise:()=>pf,readonly:()=>of,record:()=>vh,refine:()=>_f,set:()=>kh,strictObject:()=>oh,string:()=>Ol,stringFormat:()=>bp,stringbool:()=>xf,success:()=>Vh,superRefine:()=>vf,symbol:()=>Fp,templateLiteral:()=>cf,transform:()=>Ah,tuple:()=>gh,uint32:()=>Pp,uint64:()=>Zp,ulid:()=>Hl,undefined:()=>Lp,union:()=>uh,unknown:()=>Wp,url:()=>Ul,uuid:()=>Al,uuidv4:()=>jl,uuidv6:()=>Cl,uuidv7:()=>Dl,void:()=>Yp,xid:()=>Yl,xor:()=>lh});var i={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},o=new class{#e=i;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},a="undefined"==typeof window||"Deno"in globalThis;function c(){}function u(e){return"number"==typeof e&&e>=0&&e!==1/0}function d(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function p(e,t){return"function"==typeof e?e(t):e}function h(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o)if(r){if(t.queryHash!==m(o,t.options))return!1}else if(!g(t.queryKey,o))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function f(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(y(t.options.mutationKey)!==y(i))return!1}else if(!g(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function m(e,t){return(t?.queryKeyHashFn||y)(e)}function y(e){return JSON.stringify(e,(e,t)=>S(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function g(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(n=>g(e[n],t[n]))}var _=Object.prototype.hasOwnProperty;function v(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=w(e)&&w(t);if(!(r||S(e)&&S(t)))return t;const s=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),o=i.length,a=r?new Array(o):{};let c=0;for(let u=0;u<o;u++){const o=r?u:i[u],d=e[o],l=t[o];if(d===l){a[o]=d,(r?u<s:_.call(e,o))&&c++;continue}if(null===d||null===l||"object"!=typeof d||"object"!=typeof l){a[o]=l;continue}const p=v(d,l,n+1);a[o]=p,p===d&&c++}return s===o&&c===s?e:a}function b(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function S(e){if(!x(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!x(n)&&!!n.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?v(e,t):t}function k(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function z(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var O=Symbol();function $(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==O?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))}function I(e,t){return"function"==typeof e?e(...t):!!e}var T=function(e){setTimeout(e,0)},P=function(){let e=[],t=0,n=e=>{e()},r=e=>{e()},s=T;const i=r=>{t?e.push(r):s(()=>{n(r)})};return{batch:i=>{let o;t++;try{o=i()}finally{t--,t||(()=>{const t=e;e=[],t.length&&s(()=>{r(()=>{t.forEach(e=>{n(e)})})})})()}return o},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{s=e}}}(),N=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},R=new class extends N{#n;#r;#s;constructor(){super(),this.#s=e=>{if(!a&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#n!==e&&(this.#n=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#n?this.#n:"hidden"!==globalThis.document?.visibilityState}},A=new class extends N{#i=!0;#r;#s;constructor(){super(),this.#s=e=>{if(!a&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#i!==e&&(this.#i=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#i}};function j(){let e,t;const n=new Promise((n,r)=>{e=n,t=r});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},n.reject=e=>{r({status:"rejected",reason:e}),t(e)},n}function C(e){return Math.min(1e3*2**e,3e4)}function D(e){return"online"!==(e??"online")||A.isOnline()}var Z=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function U(e){let t,n=!1,r=0;const s=j(),i=()=>"pending"!==s.status,c=()=>R.isFocused()&&("always"===e.networkMode||A.isOnline())&&e.canRun(),u=()=>D(e.networkMode)&&e.canRun(),d=e=>{i()||(t?.(),s.resolve(e))},l=e=>{i()||(t?.(),s.reject(e))},p=()=>new Promise(n=>{t=e=>{(i()||c())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,i()||e.onContinue?.()}),h=()=>{if(i())return;let t;const s=0===r?e.initialPromise:void 0;try{t=s??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(d).catch(t=>{if(i())return;const s=e.retry??(a?0:3),u=e.retryDelay??C,d="function"==typeof u?u(r,t):u,f=!0===s||"number"==typeof s&&r<s||"function"==typeof s&&s(r,t);var m;!n&&f?(r++,e.onFail?.(r,t),(m=d,new Promise(e=>{o.setTimeout(e,m)})).then(()=>c()?void 0:p()).then(()=>{n?l(t):h()})):l(t)})};return{promise:s,status:()=>s.status,cancel:t=>{if(!i()){const n=new Z(t);l(n),e.onCancel?.(n)}},continue:()=>(t?.(),s),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:u,start:()=>(u()?h():p().then(h),s)}}var F=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),u(this.gcTime)&&(this.#o=o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a?1/0:3e5))}clearGcTimeout(){this.#o&&(o.clearTimeout(this.#o),this.#o=void 0)}},M=class extends F{#a;#c;#u;#d;#l;#p;#h;constructor(e){super(),this.#h=!1,this.#p=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#d=e.client,this.#u=this.#d.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=J(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(e){if(this.options={...this.#p,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=J(this.options);void 0!==e.data&&(this.setState(q(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){const n=E(this.state.data,e,this.options);return this.#f({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#l?.promise;return this.#l?.cancel(e),t?t.then(c).catch(c):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#a)}isActive(){return this.observers.some(e=>!1!==p(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===O||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===l(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!d(this.state.dataUpdatedAt,e))}onFocus(){const e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){const e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#l&&(this.#h?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#l?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,n.signal)})},s=()=>{const e=$(this.options,t),n=(()=>{const e={client:this.#d,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#h=!1,this.options.persister?this.options.persister(e,n,this):e(n)},i=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#d,state:this.state,fetchFn:s};return r(e),e})();this.options.behavior?.onFetch(i,this),this.#c=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===i.fetchOptions?.meta||this.#f({type:"fetch",meta:i.fetchOptions?.meta}),this.#l=U({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:e=>{e instanceof Z&&e.revert&&this.setState({...this.#c,fetchStatus:"idle"}),n.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const e=await this.#l.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Z){if(e.silent)return this.#l.promise;if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#f({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...L(t.data,this.options),fetchMeta:e.meta??null};case"success":const n={...t,...q(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=e.manual?n:void 0,n;case"error":const r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),P.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function L(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:D(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function q(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function J(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,r=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Q=class extends N{constructor(e={}){super(),this.config=e,this.#m=new Map}#m;build(e,t,n){const r=t.queryKey,s=t.queryHash??m(r,t);let i=this.get(s);return i||(i=new M({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#m.has(e.queryHash)||(this.#m.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#m.get(e.queryHash);t&&(e.destroy(),t===e&&this.#m.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){P.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#m.get(e)}getAll(){return[...this.#m.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(e=>h(t,e))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>h(e,t)):t}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){P.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){P.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},K=class extends F{#d;#y;#g;#l;constructor(e){super(),this.#d=e.client,this.mutationId=e.mutationId,this.#g=e.mutationCache,this.#y=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#y.includes(e)||(this.#y.push(e),this.clearGcTimeout(),this.#g.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#y=this.#y.filter(t=>t!==e),this.scheduleGc(),this.#g.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#y.length||("pending"===this.state.status?this.scheduleGc():this.#g.remove(this))}continue(){return this.#l?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#f({type:"continue"})},n={client:this.#d,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#l=U({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#g.canRun(this)});const r="pending"===this.state.status,s=!this.#l.canStart();try{if(r)t();else{this.#f({type:"pending",variables:e,isPaused:s}),this.#g.config.onMutate&&await this.#g.config.onMutate(e,this,n);const t=await(this.options.onMutate?.(e,n));t!==this.state.context&&this.#f({type:"pending",context:t,variables:e,isPaused:s})}const i=await this.#l.start();return await(this.#g.config.onSuccess?.(i,e,this.state.context,this,n)),await(this.options.onSuccess?.(i,e,this.state.context,n)),await(this.#g.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n)),await(this.options.onSettled?.(i,null,e,this.state.context,n)),this.#f({type:"success",data:i}),i}catch(t){try{await(this.#g.config.onError?.(t,e,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onError?.(t,e,this.state.context,n))}catch(e){Promise.reject(e)}try{await(this.#g.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n))}catch(e){Promise.reject(e)}try{await(this.options.onSettled?.(void 0,t,e,this.state.context,n))}catch(e){Promise.reject(e)}throw this.#f({type:"error",error:t}),t}finally{this.#g.runNext(this)}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),P.batch(()=>{this.#y.forEach(t=>{t.onMutationUpdate(e)}),this.#g.notify({mutation:this,type:"updated",action:e})})}},B=class extends N{constructor(e={}){super(),this.config=e,this.#_=new Set,this.#v=new Map,this.#b=0}#_;#v;#b;build(e,t,n){const r=new K({client:e,mutationCache:this,mutationId:++this.#b,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#_.add(e);const t=W(e);if("string"==typeof t){const n=this.#v.get(t);n?n.push(e):this.#v.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#_.delete(e)){const t=W(e);if("string"==typeof t){const n=this.#v.get(t);if(n)if(n.length>1){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}else n[0]===e&&this.#v.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=W(e);if("string"==typeof t){const n=this.#v.get(t),r=n?.find(e=>"pending"===e.state.status);return!r||r===e}return!0}runNext(e){const t=W(e);if("string"==typeof t){const n=this.#v.get(t)?.find(t=>t!==e&&t.state.isPaused);return n?.continue()??Promise.resolve()}return Promise.resolve()}clear(){P.batch(()=>{this.#_.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#_.clear(),this.#v.clear()})}getAll(){return Array.from(this.#_)}find(e){const t={exact:!0,...e};return this.getAll().find(e=>f(t,e))}findAll(e={}){return this.getAll().filter(t=>f(e,t))}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return P.batch(()=>Promise.all(e.map(e=>e.continue().catch(c))))}};function W(e){return e.options.scope?.id}function V(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let n=!1;const u=e=>{!function(e,n,r){let s,i=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t.signal,i||(i=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)})}(e,0,()=>n=!0)},d=$(t.options,t.fetchOptions),l=async(e,r,s)=>{if(n)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);const i=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:s?"backward":"forward",meta:t.options.meta};return u(e),e})(),o=await d(i),{maxPages:a}=t.options,c=s?z:k;return{pages:c(e.pages,o,a),pageParams:c(e.pageParams,r,a)}};if(s&&i.length){const e="backward"===s,t={pages:i,pageParams:o},n=(e?G:H)(r,t);a=await l(t,n,e)}else{const t=e??i.length;do{const e=0===c?o[0]??r.initialPageParam:H(r,a);if(c>0&&null==e)break;a=await l(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function H(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function G(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}const Y=window.React,X=window.ReactJSXRuntime;var ee=Y.createContext(void 0),te=e=>{const t=Y.useContext(ee);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ne=({client:e,children:t})=>(Y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,X.jsx)(ee.Provider,{value:e,children:t}));const re=window.wp.element;var se=class extends N{constructor(e,t){super(),this.options=t,this.#d=e,this.#w=null,this.#S=j(),this.bindMethods(),this.setOptions(t)}#d;#x=void 0;#E=void 0;#k=void 0;#z;#O;#S;#w;#$;#I;#T;#P;#N;#R;#A=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#x.addObserver(this),ie(this.#x,this.options)?this.#j():this.updateResult(),this.#C())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oe(this.#x,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oe(this.#x,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#D(),this.#Z(),this.#x.removeObserver(this)}setOptions(e){const t=this.options,n=this.#x;if(this.options=this.#d.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof p(this.options.enabled,this.#x))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#U(),this.#x.setOptions(this.options),t._defaulted&&!b(this.options,t)&&this.#d.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#x,observer:this});const r=this.hasListeners();r&&ae(this.#x,n,this.options,t)&&this.#j(),this.updateResult(),!r||this.#x===n&&p(this.options.enabled,this.#x)===p(t.enabled,this.#x)&&l(this.options.staleTime,this.#x)===l(t.staleTime,this.#x)||this.#F();const s=this.#M();!r||this.#x===n&&p(this.options.enabled,this.#x)===p(t.enabled,this.#x)&&s===this.#R||this.#L(s)}getOptimisticResult(e){const t=this.#d.getQueryCache().build(this.#d,e),n=this.createResult(t,e);return r=n,!b(this.getCurrentResult(),r)&&(this.#k=n,this.#O=this.options,this.#z=this.#x.state),n;var r}getCurrentResult(){return this.#k}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),"promise"===n&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#S.status||this.#S.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,n))})}trackProp(e){this.#A.add(e)}getCurrentQuery(){return this.#x}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#d.defaultQueryOptions(e),n=this.#d.getQueryCache().build(this.#d,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#j({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#k))}#j(e){this.#U();let t=this.#x.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#F(){this.#D();const e=l(this.options.staleTime,this.#x);if(a||this.#k.isStale||!u(e))return;const t=d(this.#k.dataUpdatedAt,e)+1;this.#P=o.setTimeout(()=>{this.#k.isStale||this.updateResult()},t)}#M(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#x):this.options.refetchInterval)??!1}#L(e){this.#Z(),this.#R=e,!a&&!1!==p(this.options.enabled,this.#x)&&u(this.#R)&&0!==this.#R&&(this.#N=o.setInterval(()=>{(this.options.refetchIntervalInBackground||R.isFocused())&&this.#j()},this.#R))}#C(){this.#F(),this.#L(this.#M())}#D(){this.#P&&(o.clearTimeout(this.#P),this.#P=void 0)}#Z(){this.#N&&(o.clearInterval(this.#N),this.#N=void 0)}createResult(e,t){const n=this.#x,r=this.options,s=this.#k,i=this.#z,o=this.#O,a=e!==n?e.state:this.#E,{state:c}=e;let u,d={...c},l=!1;if(t._optimisticResults){const s=this.hasListeners(),i=!s&&ie(e,t),o=s&&ae(e,n,t,r);(i||o)&&(d={...d,...L(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let{error:h,errorUpdatedAt:f,status:m}=d;u=d.data;let y=!1;if(void 0!==t.placeholderData&&void 0===u&&"pending"===m){let e;s?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=s.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#T?.state.data,this.#T):t.placeholderData,void 0!==e&&(m="success",u=E(s?.data,e,t),l=!0)}if(t.select&&void 0!==u&&!y)if(s&&u===i?.data&&t.select===this.#$)u=this.#I;else try{this.#$=t.select,u=t.select(u),u=E(s?.data,u,t),this.#I=u,this.#w=null}catch(e){this.#w=e}this.#w&&(h=this.#w,u=this.#I,f=Date.now(),m="error");const g="fetching"===d.fetchStatus,_="pending"===m,v="error"===m,b=_&&g,w=void 0!==u,S={status:m,fetchStatus:d.fetchStatus,isPending:_,isSuccess:"success"===m,isError:v,isInitialLoading:b,isLoading:b,data:u,dataUpdatedAt:d.dataUpdatedAt,error:h,errorUpdatedAt:f,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>a.dataUpdateCount||d.errorUpdateCount>a.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!w,isPaused:"paused"===d.fetchStatus,isPlaceholderData:l,isRefetchError:v&&w,isStale:ce(e,t),refetch:this.refetch,promise:this.#S,isEnabled:!1!==p(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==S.data,r="error"===S.status&&!t,s=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},i=()=>{const e=this.#S=S.promise=j();s(e)},o=this.#S;switch(o.status){case"pending":e.queryHash===n.queryHash&&s(o);break;case"fulfilled":(r||S.data!==o.value)&&i();break;case"rejected":r&&S.error===o.reason||i()}}return S}updateResult(){const e=this.#k,t=this.createResult(this.#x,this.options);this.#z=this.#x.state,this.#O=this.options,void 0!==this.#z.data&&(this.#T=this.#x),b(t,e)||(this.#k=t,this.#q({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,n="function"==typeof t?t():t;if("all"===n||!n&&!this.#A.size)return!0;const r=new Set(n??this.#A);return this.options.throwOnError&&r.add("error"),Object.keys(this.#k).some(t=>{const n=t;return this.#k[n]!==e[n]&&r.has(n)})})()}))}#U(){const e=this.#d.getQueryCache().build(this.#d,this.options);if(e===this.#x)return;const t=this.#x;this.#x=e,this.#E=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#C()}#q(e){P.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#k)}),this.#d.getQueryCache().notify({query:this.#x,type:"observerResultsUpdated"})})}};function ie(e,t){return function(e,t){return!1!==p(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&oe(e,t,t.refetchOnMount)}function oe(e,t,n){if(!1!==p(t.enabled,e)&&"static"!==l(t.staleTime,e)){const r="function"==typeof n?n(e):n;return"always"===r||!1!==r&&ce(e,t)}return!1}function ae(e,t,n,r){return(e!==t||!1===p(r.enabled,e))&&(!n.suspense||"error"!==e.state.status)&&ce(e,n)}function ce(e,t){return!1!==p(t.enabled,e)&&e.isStaleByTime(l(t.staleTime,e))}var ue=Y.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),de=Y.createContext(!1),le=(de.Provider,(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()}));var pe=class extends N{#d;#k=void 0;#J;#Q;constructor(e,t){super(),this.#d=e,this.setOptions(t),this.bindMethods(),this.#K()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#d.defaultMutationOptions(e),b(this.options,t)||this.#d.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#J,observer:this}),t?.mutationKey&&this.options.mutationKey&&y(t.mutationKey)!==y(this.options.mutationKey)?this.reset():"pending"===this.#J?.state.status&&this.#J.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#J?.removeObserver(this)}onMutationUpdate(e){this.#K(),this.#q(e)}getCurrentResult(){return this.#k}reset(){this.#J?.removeObserver(this),this.#J=void 0,this.#K(),this.#q()}mutate(e,t){return this.#Q=t,this.#J?.removeObserver(this),this.#J=this.#d.getMutationCache().build(this.#d,this.options),this.#J.addObserver(this),this.#J.execute(e)}#K(){const e=this.#J?.state??{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};this.#k={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#q(e){P.batch(()=>{if(this.#Q&&this.hasListeners()){const t=this.#k.variables,n=this.#k.context,r={client:this.#d,meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===e?.type){try{this.#Q.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if("error"===e?.type){try{this.#Q.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#Q.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#k)})})}};const he="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,fe="10.50.0",me=globalThis;function ye(){return ge(me),me}function ge(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||fe,t[fe]=t[fe]||{}}function _e(e,t,n=me){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[fe]=r[fe]||{};return s[e]||(s[e]=t())}const ve=["debug","info","warn","error","log","assert","trace"],be={};function we(e){if(!("console"in me))return e();const t=me.console,n={},r=Object.keys(be);r.forEach(e=>{const r=be[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function Se(){return Ee().enabled}function xe(e,...t){he&&Se()&&we(()=>{me.console[e](`Sentry Logger [${e}]:`,...t)})}function Ee(){return he?_e("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const ke=function(){Ee().enabled=!0},ze=function(...e){xe("log",...e)},Oe=function(...e){xe("warn",...e)},$e=function(...e){xe("error",...e)},Ie=[];function Te(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;if(t.forEach(e=>{e.isDefaultInstance=!0}),Array.isArray(n))r=[...t,...n];else if("function"==typeof n){const e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return function(e){const t={};return e.forEach(e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(r)}function Pe(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Ne(e,t,n){if(n[t.name])he&&ze(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,Ie.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),Ie.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}["processSpan","processSegmentSpan"].forEach(n=>{const r=t[n];"function"==typeof r&&e.on(n,n=>r.call(t,n,e))}),he&&ze(`Integration installed: ${t.name}`)}}function Re(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}const Ae=Object.prototype.toString;function je(e){switch(Ae.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Qe(e,Error)}}function Ce(e,t){return Ae.call(e)===`[object ${t}]`}function De(e){return Ce(e,"ErrorEvent")}function Ze(e){return Ce(e,"DOMError")}function Ue(e){return Ce(e,"String")}function Fe(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Me(e){return null===e||Fe(e)||"object"!=typeof e&&"function"!=typeof e}function Le(e){return Ce(e,"Object")}function qe(e){return"undefined"!=typeof Event&&Qe(e,Event)}function Je(e){return Boolean(e?.then&&"function"==typeof e.then)}function Qe(e,t){try{return e instanceof t}catch{return!1}}function Ke(e){return!("object"!=typeof e||null===e||!(e.__isVue||e._isVue||e.__v_isVNode))}function Be(e){return"undefined"!=typeof Request&&Qe(e,Request)}const We=me;function Ve(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,o=0;const a=" > ",c=a.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&i++<r&&(u=He(n,d),!("html"===u||i>1&&o+s.length*c+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function He(e,t){const n=e,r=[];if(!n?.tagName)return"";if(We.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(s?.length)s.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const e=n.className;if(e&&Ue(e)){const t=e.split(/\s+/);for(const e of t)r.push(`.${e}`)}}for(const e of["aria-label","type","name","title","alt"]){const t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join("")}function Ge(){try{return We.document.location.href}catch{return""}}function Ye(e,t,n){if(!(t in e))return;const r=e[t];if("function"!=typeof r)return;const s=n(r);"function"==typeof s&&et(s,r);try{e[t]=s}catch{he&&ze(`Failed to replace method "${t}" in object`,e)}}function Xe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{he&&ze(`Failed to add non-enumerable property "${t}" to object`,e)}}function et(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Xe(e,"__sentry_original__",t)}catch{}}function tt(e){return e.__sentry_original__}function nt(e){if(je(e))return{message:e.message,name:e.name,stack:e.stack,...st(e)};if(qe(e)){const t={type:e.type,target:rt(e.target),currentTarget:rt(e.currentTarget),...st(e)};return"undefined"!=typeof CustomEvent&&Qe(e,CustomEvent)&&(t.detail=e.detail),t}return e}function rt(e){try{return"undefined"!=typeof Element&&Qe(e,Element)?Ve(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function st(e){return"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e)):{}}let it,ot;function at(e){if(void 0!==it)return it?it(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=me;return t in n&&"function"==typeof n[t]?(it=n[t],it(e)):(it=null,e())}function ct(){return at(()=>Math.random())}function ut(){return at(()=>Date.now())}function dt(e=function(){const e=me;return e.crypto||e.msCrypto}()){try{if(e?.randomUUID)return at(()=>e.randomUUID()).replace(/-/g,"")}catch{}return ot||(ot=[1e7]+1e3+4e3+8e3+1e11),ot.replace(/[018]/g,e=>(e^(16*ct()&15)>>e/4).toString(16))}function lt(e){return e.exception?.values?.[0]}function pt(e){const{message:t,event_id:n}=e;if(t)return t;const r=lt(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ht(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function ft(e,t){const n=lt(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r?.data,...t.data};n.mechanism.data=e}}function mt(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{Xe(e,"__sentry_captured__",!0)}catch{}return!1}const yt="?",gt=/\(error: (.*)\)/,_t=/captureMessage|captureException/;function vt(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{const s=[],i=e.split("\n");for(let e=n;e<i.length;e++){let n=i[e];n.length>1024&&(n=n.slice(0,1024));const o=gt.test(n)?n.replace(gt,"$1"):n;if(!o.includes("Error: ")){for(const e of t){const t=e(o);if(t){s.push(t);break}}if(s.length>=50+r)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(bt(t).function||"")&&t.pop(),t.reverse(),_t.test(bt(t).function||"")&&(t.pop(),_t.test(bt(t).function||"")&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||bt(t).filename,function:e.function||yt}))}(s.slice(r))}}function bt(e){return e[e.length-1]||{}}const wt="<anonymous>";function St(e){try{return e&&"function"==typeof e&&e.name||wt}catch{return wt}}function xt(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function Et(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function kt(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function zt(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{Ke(r)?n.push(Et(r)):n.push(String(r))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Ot(e,t,n=!1){return!!Ue(e)&&(Ce(t,"RegExp")?t.test(e):Ue(t)?n?e===t:e.includes(t):"function"==typeof t&&t(e))}function $t(e,t=[],n=!1){return t.some(t=>Ot(e,t,n))}const It=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],Tt=(e={})=>{let t;return{name:"EventFilters",setup(n){const r=n.getOptions();t=Nt(e,r)},processEvent(n,r,s){if(!t){const n=s.getOptions();t=Nt(e,n)}return function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(!t?.length)return!1;const n=e.transaction;return!!n&&$t(n,t)}(e,t.ignoreTransactions))return he&&Oe(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${pt(e)}`),!0}else{if(function(e,t){return!!t?.length&&Re(e).some(e=>$t(e,t))}(e,t.ignoreErrors))return he&&Oe(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${pt(e)}`),!0;if(function(e){return!!e.exception?.values?.length&&(!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return he&&Oe(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${pt(e)}`),!0;if(function(e,t){if(!t?.length)return!1;const n=Rt(e);return!!n&&$t(n,t)}(e,t.denyUrls))return he&&Oe(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${pt(e)}.\nUrl: ${Rt(e)}`),!0;if(!function(e,t){if(!t?.length)return!0;const n=Rt(e);return!n||$t(n,t)}(e,t.allowUrls))return he&&Oe(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${pt(e)}.\nUrl: ${Rt(e)}`),!0}return!1}(n,t)?null:n}}},Pt=(e={})=>({...Tt(e),name:"InboundFilters"});function Nt(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:It],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Rt(e){try{const t=[...e.exception?.values??[]].reverse().find(e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length),n=t?.stacktrace?.frames;return n?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(n):null}catch{return he&&$e(`Cannot extract url for event ${pt(e)}`),null}}function At(){return ut()/1e3}let jt;function Ct(){return(jt??(jt=function(){const{performance:e}=me;if(!e?.now||!e.timeOrigin)return At;const t=e.timeOrigin;return()=>(t+at(()=>e.now()))/1e3}()))()}function Dt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Ct(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:dt()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Zt(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&0===Object.keys(t).length)return e;const r={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=Zt(r[e],t[e],n-1));return r}function Ut(){return dt()}function Ft(){return dt().substring(16)}const Mt="_sentrySpan";function Lt(e,t){t?Xe(e,Mt,t):delete e[Mt]}function qt(e){return e[Mt]}class Jt{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ut(),sampleRand:ct()}}clone(){const e=new Jt;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,Lt(e,qt(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Dt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,n=t instanceof Jt?t.getScopeData():Le(t)?e:void 0,{tags:r,attributes:s,extra:i,user:o,contexts:a,level:c,fingerprint:u=[],propagationContext:d,conversationId:l}=n||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...a},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),l&&(this._conversationId=l),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Lt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ut(),sampleRand:ct()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:At(),...e,message:e.message?kt(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:qt(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Zt(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t?.event_id||dt();if(!this._client)return he&&Oe("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n?.event_id||dt();if(!this._client)return he&&Oe("No client configured on scope - will not capture message!"),r;const s=n?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:s,...n,event_id:r},this),r}captureEvent(e,t){const n=e.event_id||t?.event_id||dt();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(he&&Oe("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const Qt=e=>e instanceof Promise&&!e[Kt],Kt=Symbol("chained PromiseLike");class Bt{constructor(e,t){let n,r;n=e||new Jt,r=t||new Jt,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(e){throw this._popScope(),e}return Je(n)?((e,t,n)=>{const r=e.then(e=>(t(),e),e=>{throw n(),e});return Qt(r)&&Qt(e)?r:((e,t)=>{let n=!1;for(const r in e){if(r in t)continue;n=!0;const s=e[r];"function"==typeof s?Object.defineProperty(t,r,{value:(...t)=>s.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=s}return n&&Object.assign(t,{[Kt]:!0}),t})(e,r)})(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1||!this._stack.pop())}}function Wt(){const e=ge(ye());return e.stack=e.stack||new Bt(_e("defaultCurrentScope",()=>new Jt),_e("defaultIsolationScope",()=>new Jt))}function Vt(e){return Wt().withScope(e)}function Ht(e,t){const n=Wt();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Gt(e){return Wt().withScope(()=>e(Wt().getIsolationScope()))}function Yt(e){const t=ge(e);return t.acs?t.acs:{withIsolationScope:Gt,withScope:Vt,withSetScope:Ht,withSetIsolationScope:(e,t)=>Gt(t),getCurrentScope:()=>Wt().getScope(),getIsolationScope:()=>Wt().getIsolationScope()}}let Xt;function en(){return Yt(ye()).getCurrentScope()}function tn(){return Yt(ye()).getIsolationScope()}function nn(){return en().getClient()}function rn(e){const t=void 0;const n=e.getPropagationContext(),{traceId:r,parentSpanId:s,propagationSpanId:i}=n,o={trace_id:r,span_id:i||Ft()};return s&&(o.parent_span_id=s),o}const sn=new WeakMap,on=()=>({name:"FunctionToString",setupOnce(){Xt=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=tt(this),n=sn.has(nn())&&void 0!==t?t:this;return Xt.apply(n,e)}}catch{}},setup(e){sn.set(e,!0)}}),an="sentry.profile_id",cn="sentry.exclusive_time";function un(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}}function dn(e){const t=e;return{scope:t._sentryScope,isolationScope:un(t._sentryIsolationScope)}}let ln=!1;function pn(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:yn(e).parent_span_id,i=dn(e).scope;return{parent_span_id:s,span_id:r?i?.getPropagationContext().propagationSpanId||Ft():t,trace_id:n}}function hn(e){return e&&e.length>0?e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:s})=>({span_id:e,trace_id:t,sampled:1===n,attributes:s,...r})):void 0}function fn(e){return"number"==typeof e?mn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?mn(e.getTime()):Ct()}function mn(e){return e>9999999999?e/1e3:e}function yn(e){if(function(e){return"function"==typeof e.getSpanJSON}(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(e)){const{attributes:r,startTime:s,name:i,endTime:o,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:gn(e),start_timestamp:fn(s),timestamp:fn(o)||void 0,status:vn(a),op:r["sentry.op"],origin:r["sentry.origin"],links:hn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function gn(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function vn(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"internal_error"}const bn=function(e){return e._sentryRootSpan||e};function wn(){ln||(we(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),ln=!0)}const Sn=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!En(e,t)&&!!xn(e,t))))}(e,t)||!!function(e,t){const n=kn(t),r=kn(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!En(e,t)&&!!xn(e,t)))}(e,t))}(t,e))return he&&Oe("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function xn(e,t){let n=xt(e),r=xt(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],s=n[e];if(t.filename!==s.filename||t.lineno!==s.lineno||t.colno!==s.colno||t.function!==s.function)return!1}return!0}function En(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch{return!1}}function kn(e){return e.exception?.values?.[0]}const zn="production",On=/^o(\d+)\./,$n=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function In(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${o}`}function Tn(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Pn(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=function(e){const t=e.match(On);return t?.[1]}(n)),r}function Nn(e,t=100,n=1/0){try{return An("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Rn(e,t=3,n=102400){const r=Nn(e,t);return s=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(s))>n?Rn(e,t-1,n):r;var s}function An(e,t,n=1/0,r=1/0,s=function(){const e=new WeakSet;return[function(t){return!!e.has(t)||(e.add(t),!1)},function(t){e.delete(t)}]}()){const[i,o]=s;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const a=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof globalThis&&t===globalThis)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(Ke(t))return Et(t);if(Le(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n)return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${St(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}var n}(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const c="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===c)return a.replace("object ","");if(i(t))return"[Circular ~]";const u=t;if(u&&"function"==typeof u.toJSON)try{return An("",u.toJSON(),c-1,r,s)}catch{}const d=Array.isArray(t)?[]:{};let l=0;const p=nt(t);for(const e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(l>=r){d[e]="[MaxProperties ~]";break}const t=p[e];d[e]=An(e,t,c-1,r,s),l++}return o(t),d}function jn(e,t=[]){return[e,t]}function Cn(e,t){const[n,r]=e;return[n,[...r,t]]}function Dn(e,t){const n=e[1];for(const e of n)if(t(e,e[0].type))return!0;return!1}function Zn(e){const t=ge(me);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function Un(e){const[t,n]=e;let r=JSON.stringify(t);function s(e){"string"==typeof r?r="string"==typeof e?r+e:[Zn(r),e]:r.push("string"==typeof e?Zn(e):e)}for(const e of n){const[t,n]=e;if(s(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)s(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(Nn(n))}s(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(r)}function Fn(e){const t="string"==typeof e.data?Zn(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const Mn={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function Ln(e){return function(e){return e in Mn}(e)?Mn[e]:e}function qn(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function Jn(e,t){const n=t??function(e){return Qn().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=In(r)),jn(s,[(i=e,[{type:"log",item_count:i.length,content_type:"application/vnd.sentry.items.log+json"},{items:i}])]);var i}(n,r._metadata,r.tunnel,e.getDsn());Qn().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function Qn(){return _e("clientToLogBufferMap",()=>new WeakMap)}function Kn(e,t){const n=t??function(e){return Bn().get(e)}(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=In(r)),jn(s,[(i=e,[{type:"trace_metric",item_count:i.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:i}])]);var i}(n,r._metadata,r.tunnel,e.getDsn());Bn().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function Bn(){return _e("clientToMetricBufferMap",()=>new WeakMap)}function Wn(e){return e.split(",").map(e=>{const t=e.indexOf("=");return-1===t?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function Vn(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s={environment:n.environment||zn,release:n.release,public_key:r,trace_id:e,org_id:Pn(t)};return t.emit("createDsc",s),s}function Hn(e){const t=nn();if(!t)return{};const n=bn(e),r=yn(n),s=r.data,i=n.spanContext().traceState,o=i?.get("sentry.sample_rate")??s["sentry.sample_rate"]??s["sentry.previous_trace_sample_rate"];function a(e){return"number"!=typeof o&&"string"!=typeof o||(e.sample_rate=`${o}`),e}const c=n._frozenDsc;if(c)return a(c);const u=i?.get("sentry.dsc"),d=u&&function(e){const t=function(e){if(e&&(Ue(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{const n=Wn(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Wn(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>(t.startsWith("sentry-")&&(e[t.slice(7)]=n),e),{});return Object.keys(n).length>0?n:void 0}(u);if(d)return a(d);const l=Vn(e.spanContext().traceId,t),p=s["sentry.source"]??s["sentry.span.source"],h=r.description;return"url"!==p&&h&&(l.transaction=h),function(){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const e=nn()?.getOptions();return!(!e||null==e.tracesSampleRate&&!e.tracesSampler)}()&&(l.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return 1===t}(n)),l.sample_rand=i?.get("sentry.sample_rand")??dn(n).scope?.getPropagationContext().sampleRand.toString()),a(l),t.emit("createDsc",l,n),l}function Gn(e){return new Xn(t=>{t(e)})}function Yn(e){return new Xn((t,n)=>{n(e)})}class Xn{constructor(e){this._state=0,this._handlers=[],this._runExecutor(e)}then(e,t){return new Xn((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new Xn((t,n)=>{let r,s;return this.then(t=>{s=!1,r=t,e&&e()},t=>{s=!0,r=t,e&&e()}).then(()=>{s?n(r):t(r)})})}_executeHandlers(){if(0===this._state)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(1===this._state&&e[1](this._value),2===this._state&&e[2](this._value),e[0]=!0)})}_runExecutor(e){const t=(e,t)=>{0===this._state&&(Je(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(1,e)},r=e=>{t(2,e)};try{e(n,r)}catch(e){r(e)}}}function er(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}const tr=Symbol.for("SentryBufferFullError");function nr(e=100){const t=new Set;function n(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(r){if(!(t.size<e))return Yn(tr);const s=r();return t.add(s),s.then(()=>n(s),()=>n(s)),s},drain:function(e){if(!t.size)return Gn(!0);const n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;const r=[n,new Promise(t=>er(setTimeout(()=>t(!1),e)))];return Promise.race(r)}}}function rr(e,t,n=nr(e.bufferSize||64)){let r={};return{send:function(s){const i=[];if(Dn(s,(t,n)=>{const s=Ln(n);!function(e,t,n=ut()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,s)?i.push(t):e.recordDroppedEvent("ratelimit_backoff",s)}),0===i.length)return Promise.resolve({});const o=jn(s[0],i),a=t=>{!function(e,t){return Dn(e,(e,n)=>t.includes(n))}(o,["client_report"])?Dn(o,(n,r)=>{e.recordDroppedEvent(t,Ln(r))}):he&&Oe(`Dropping client report. Will not send outcomes (reason: ${t}).`)};return n.add(()=>t({body:Un(o)}).then(e=>413===e.statusCode?(he&&$e("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),a("send_error"),e):(he&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Oe(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=ut()){const s={...e},i=n?.["x-sentry-rate-limits"],o=n?.["retry-after"];if(i)for(const e of i.trim().split(",")){const[t,n,,,i]=e.split(":",5),o=parseInt(t,10),a=1e3*(isNaN(o)?60:o);if(n)for(const e of n.split(";"))"metric_bucket"===e&&i&&!i.split(";").includes("custom")||(s[e]=r+a);else s.all=r+a}else o?s.all=r+function(e,t=ut()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(o,r):429===t&&(s.all=r+6e4);return s}(r,e),e),e=>{throw a("network_error"),he&&$e("Encountered error running transport request:",e),e})).then(e=>e,e=>{if(e===tr)return he&&$e("Skipped sending event because buffer is full."),a("queue_overflow"),Promise.resolve({});throw e})},flush:e=>n.drain(e)}}function sr(e,t,n,r=0){try{const s=ir(t,n,e,r);return Je(s)?s:Gn(s)}catch(e){return Yn(e)}}function ir(e,t,n,r){const s=n[r];if(!e||!s)return e;const i=s({...e},t);return he&&null===i&&ze(`Event processor "${s.id||"?"}" dropped event`),Je(i)?i.then(e=>ir(e,t,n,r+1)):ir(i,t,n,r+1)}let or,ar,cr,ur;function dr(e,t){const{extra:n,tags:r,attributes:s,user:i,contexts:o,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:d,eventProcessors:l,attachments:p,propagationContext:h,transactionName:f,span:m}=t;lr(e,"extra",n),lr(e,"tags",r),lr(e,"attributes",s),lr(e,"user",i),lr(e,"contexts",o),e.sdkProcessingMetadata=Zt(e.sdkProcessingMetadata,c,2),a&&(e.level=a),f&&(e.transactionName=f),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...h}}function lr(e,t,n){e[t]=Zt(e[t],n,1)}function pr(e,t){const n=_e("globalScope",()=>new Jt).getScopeData();return e&&dr(n,e.getScopeData()),t&&dr(n,t.getScopeData()),n}function hr(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||dt(),timestamp:t.timestamp||At()},u=n.integrations||e.integrations.map(e=>e.name);!function(e,t){const{environment:n,release:r,dist:s,maxValueLength:i}=t;e.environment=e.environment||n||zn,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s);const o=e.request;o?.url&&i&&(o.url=kt(o.url,i)),i&&e.exception?.values?.forEach(e=>{e.value&&(e.value=kt(e.value,i))})}(c,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(c,u),s&&s.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){const n=function(e){const t=me._sentryDebugIds,n=me._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],s=n?Object.keys(n):[];if(ur&&r.length===ar&&s.length===cr)return ur;ar=r.length,cr=s.length,ur={},or||(or={});const i=(t,n)=>{for(const r of t){const t=n[r],s=or?.[r];if(s&&ur&&t)ur[s[0]]=t,or&&(or[r]=[s[0],t]);else if(t){const n=e(r);for(let e=n.length-1;e>=0;e--){const s=n[e],i=s?.filename;if(i&&ur&&or){ur[i]=t,or[r]=[i,t];break}}}}};return t&&i(r,t),n&&i(s,n),ur}(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}(c,e.stackParser);const d=function(e,t){if(!t)return e;const n=e?e.clone():new Jt;return n.update(t),n}(r,n.captureContext);n.mechanism&&ft(c,n.mechanism);const l=s?s.getEventProcessors():[],p=pr(i,d),h=[...n.attachments||[],...p.attachments];h.length&&(n.attachments=h),function(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;!function(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),o&&(e.level=o),a&&"transaction"!==e.type&&(e.transaction=a)}(e,t),r&&function(e,t){e.contexts={trace:pn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Hn(t),...e.sdkProcessingMetadata};const n=yn(bn(t)).description;n&&!e.transaction&&"transaction"===e.type&&(e.transaction=n)}(e,r),function(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,s),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,i)}(c,p);const f=[...l,...p.eventProcessors];return(n.data&&!0===n.data.__sentry__?Gn(c):sr(f,c,n)).then(e=>(e&&function(e){const t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:"sourcemap",code_file:e,debug_id:t})})}(e),"number"==typeof o&&o>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Nn(e.data,t,n)}}))},...e.user&&{user:Nn(e.user,t,n)},...e.contexts&&{contexts:Nn(e.contexts,t,n)},...e.extra&&{extra:Nn(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Nn(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:Nn(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Nn(e.contexts.flags,3,n)),r}(e,o,a):e))}const fr=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function mr(e){ze(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function yr(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(_r(n)){if(Ot(e.description,n))return he&&mr(e),!0;continue}if(!n.name&&!n.op)continue;const t=!n.name||Ot(e.description,n.name),r=!n.op||e.op&&Ot(e.op,n.op);if(t&&r)return he&&mr(e),!0}return!1}function gr(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function _r(e){return"string"==typeof e||e instanceof RegExp}const vr="Not capturing exception because it's already been captured.",br="Discarded session because of missing or non-string release",wr=Symbol.for("SentryInternalError"),Sr=Symbol.for("SentryDoNotSendEventError");function xr(e){return{message:e,[wr]:!0}}function Er(e){return{message:e,[Sr]:!0}}function kr(e){return!!e&&"object"==typeof e&&wr in e}function zr(e){return!!e&&"object"==typeof e&&Sr in e}function Or(e,t,n,r,s){let i,o=0,a=!1;e.on(n,()=>{o=0,clearTimeout(i),a=!1}),e.on(t,t=>{o+=r(t),o>=8e5?s(e):a||(a=!0,i=er(setTimeout(()=>{s(e)},5e3)))}),e.on("flush",()=>{s(e)})}class $r{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=nr(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=$n.exec(e);if(!t)return void we(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});const[n,r,s="",i="",o="",a=""]=t.slice(1);let c="",u=a;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const e=u.match(/^\d+/);e&&(u=e[0])}return Tn({host:i,pass:s,path:c,projectId:u,port:o,protocol:n,publicKey:r})}(e):Tn(e);if(t&&function(e){if(!he)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&($e(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&($e(`Invalid Sentry Dsn: Invalid port ${t}`),1):($e(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):($e(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):he&&Oe("No DSN provided, client will not send events."),this._dsn){const s=(t=this._dsn,n=e.tunnel,r=e._metadata?e._metadata.sdk:void 0,n||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(t)}?${function(e,t){const n={sentry_version:"7"};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(t,r)}`);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:s})}var t,n,r;this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Or(this,"afterCaptureLog","flushLogs",Rr,Jn),(this._options.enableMetrics??this._options._experiments?.enableMetrics??1)&&Or(this,"afterCaptureMetric","flushMetrics",Nr,Kn)}captureException(e,t,n){const r=dt();if(mt(e))return he&&ze(vr),r;const s={event_id:r,...t};return this._process(()=>this.eventFromException(e,s).then(e=>this._captureEvent(e,s,n)).then(e=>e),"error"),s.event_id}captureMessage(e,t,n,r){const s={event_id:dt(),...n},i=Fe(e)?e:String(e),o=Me(e),a=o?this.eventFromMessage(i,t,s):this.eventFromException(e,s);return this._process(()=>a.then(e=>this._captureEvent(e,s,r)),o?"unknown":"error"),s.event_id}captureEvent(e,t,n){const r=dt();if(t?.originalException&&mt(t.originalException))return he&&ze(vr),r;const s={event_id:r,...t},i=e.sdkProcessingMetadata||{},o=i.capturedSpanScope,a=i.capturedSpanIsolationScope,c=Ir(e.type);return this._process(()=>this._captureEvent(e,s,o||n,a),c),s.event_id}captureSession(e){this.sendSession(e),Dt(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(!t)return!0;this.emit("flush");const n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){Jn(this);const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),Ne(this,e,this._integrations),t||Pe(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){const s=qn(n),i=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){if(!t)return e;const n=e.sdk||{};e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0}}(e,n?.sdk);const o=function(e,t,n,r){const s=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:In(r)},...s&&{trace:s}}}(e,s,r,t);return delete e.sdkProcessingMetadata,jn(o,[[{type:i},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=Cn(n,Fn(e));this.sendEnvelope(n).then(t=>this.emit("afterSendEvent",e,t))}sendSession(e){const{release:t,environment:n=zn}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(he&&Oe(br));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(he&&Oe(br));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=function(e,t,n,r){const s=qn(n);return jn({sent_at:(new Date).toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:In(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){const r=`${e}:${t}`;he&&ze(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){const n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return he&&$e("Error while sending envelope:",e),{}}return he&&$e("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t?.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&Ne(e,t,n)}),n}(this,e),Pe(this,e)}_updateSessionFromEvent(e,t){let n="fatal"===t.level,r=!1;const s=t.exception?.values;if(s){r=!0,n=!1;for(const e of s)if(!1===e.mechanism?.handled){n=!0;break}}const i="ok"===e.status;(i&&0===e.errors||i&&n)&&(Dt(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const s=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&i?.length&&(t.integrations=i),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),hr(s,e,t,n,this,r).then(e=>{if(null===e)return e;this.emit("postprocessEvent",e,t),e.contexts={trace:{...e.contexts?.trace,...rn(n)},...e.contexts};const r=function(e,t){const n=t.getPropagationContext();return n.dsc||Vn(n.traceId,e)}(this,n);return e.sdkProcessingMetadata={dynamicSamplingContext:r,...e.sdkProcessingMetadata},e})}_captureEvent(e,t={},n=en(),r=tn()){return he&&Tr(e)&&ze(`Captured error event \`${Re(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{he&&(zr(e)?ze(e.message):kr(e)?Oe(e.message):Oe(e))})}_processEvent(e,t,n,r){const s=this.getOptions(),{sampleRate:i}=s,o=Pr(e),a=Tr(e),c=`before send for type \`${e.type||"error"}\``,u=void 0===i?void 0:function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}(i);if(a&&"number"==typeof u&&ct()>u)return this.recordDroppedEvent("sample_rate","error"),Yn(Er(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const d=Ir(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(null===e)throw this.recordDroppedEvent("event_processor",d),Er("An event processor returned `null`, will not send event.");if(!0===t.data?.__sentry__)return e;const n=function(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,ignoreSpans:o}=t,a=!((c=t.beforeSendSpan)&&"function"==typeof c&&"_streamed"in c&&c._streamed)&&t.beforeSendSpan;var c;let u=n;if(Tr(u)&&s)return s(u,r);if(Pr(u)){if(a||o){const t=function(e){const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:a}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o?.[an],exclusive_time:o?.[cn],measurements:e.measurements,is_segment:!0}}(u);if(o?.length&&yr(t,o))return null;if(a){const e=a(t);e?u=Zt(n,{type:"transaction",timestamp:(d=e).timestamp,start_timestamp:d.start_timestamp,transaction:d.description,contexts:{trace:{trace_id:d.trace_id,span_id:d.span_id,parent_span_id:d.parent_span_id,op:d.op,status:d.status,origin:d.origin,data:{...d.data,...d.profile_id&&{[an]:d.profile_id},...d.exclusive_time&&{[cn]:d.exclusive_time}}}},measurements:d.measurements}):wn()}if(u.spans){const t=[],n=u.spans;for(const e of n)if(o?.length&&yr(e,o))gr(n,e);else if(a){const n=a(e);n?t.push(n):(wn(),t.push(e))}else t.push(e);const r=u.spans.length-t.length;r&&e.recordDroppedEvent("before_send","span",r),u.spans=t}}if(i){if(u.spans){const e=u.spans.length;u.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return i(u,r)}}var d;return u}(this,s,e,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Je(e))return e.then(e=>{if(!Le(e)&&null!==e)throw xr(n);return e},e=>{throw xr(`${t} rejected with ${e}`)});if(!Le(e)&&null!==e)throw xr(n);return e}(n,c)}).then(s=>{if(null===s){if(this.recordDroppedEvent("before_send",d),o){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw Er(`${c} returned \`null\`, will not send event.`)}const i=n.getSession()||r.getSession();if(a&&i&&this._updateSessionFromEvent(i,s),o){const e=(s.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(s.spans?s.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const u=s.transaction_info;if(o&&u&&s.transaction!==e.transaction){const e="custom";s.transaction_info={...u,source:e}}return this.sendEvent(s,t),s}).then(null,e=>{if(zr(e)||kr(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),xr(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===tr&&this.recordDroppedEvent("queue_overflow",t),e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{const[n,r]=e.split(":");return{reason:n,category:r,quantity:t}})}_flushOutcomes(){he&&ze("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(he&&ze("No outcomes to send"));if(!this._dsn)return void(he&&ze("No dsn provided, will not send outcomes"));he&&ze("Sending outcomes:",e);const t=(n=e,jn((r=this._options.tunnel&&In(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:At(),discarded_events:n}]]));var n,r;this.sendEnvelope(t)}}function Ir(e){return"replay_event"===e?"replay":e||"error"}function Tr(e){return void 0===e.type}function Pr(e){return"transaction"===e.type}function Nr(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+Ar(e.attributes)}function Rr(e){let t=0;return e.message&&(t+=2*e.message.length),t+Ar(e.attributes)}function Ar(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*jr(e[0]):Me(e)?t+=jr(e):t+=100}),t}function jr(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}function Cr(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}function Dr(e){return function(e){return je(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function Zr(e,t){const n=Fr(e,t),r={type:qr(t),value:Jr(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Ur(e,t){return{exception:{values:[Zr(e,t)]}}}function Fr(e,t){const n=t.stacktrace||t.stack||"",r=function(e){return e&&Mr.test(e.message)?1:0}(t),s=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);try{return e(n,r,s)}catch{}return[]}const Mr=/Minified React error #\d+;/i;function Lr(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function qr(e){const t=e?.name;return!t&&Lr(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Jr(e){const t=e?.message;return Lr(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?Dr(t.error):Dr(e):"No error message"}function Qr(e,t,n,r,s){let i;if(De(t)&&t.error)return Ur(e,t.error);if(Ze(t)||Ce(t,"DOMException")){const s=t;if("stack"in t)i=Ur(e,t);else{const t=s.name||(Ze(s)?"DOMError":"DOMException"),o=s.message?`${t}: ${s.message}`:t;i=Kr(e,o,n,r),ht(i,o)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return je(t)?Ur(e,t):Le(t)||qe(t)?(i=function(e,t,n,r){const s=nn(),i=s?.getOptions().normalizeDepth,o=(a=t,Object.values(a).find(e=>e instanceof Error));var a;const c={__serialized__:Rn(t,i)};if(o)return{exception:{values:[Zr(e,o)]},extra:c};const u={exception:{values:[{type:qe(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Br(t,{isUnhandledRejection:r})}]},extra:c};if(n){const t=Fr(e,n);t.length&&(u.exception.values[0].stacktrace={frames:t})}return u}(e,t,n,s),ft(i,{synthetic:!0}),i):(i=Kr(e,t,n,r),ht(i,`${t}`,void 0),ft(i,{synthetic:!0}),i)}function Kr(e,t,n,r){const s={};if(r&&n){const r=Fr(e,n);r.length&&(s.exception={values:[{value:t,stacktrace:{frames:r}}]}),ft(s,{synthetic:!0})}if(Fe(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return s.logentry={message:e,params:n},s}return s.message=t,s}function Br(e,{isUnhandledRejection:t}){const n=function(e){const t=Object.keys(nt(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}(e),r=t?"promise rejection":"exception";return De(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:qe(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Wr(e,t){return en().captureEvent(e,t)}function Vr(e){const t=tn(),{user:n}=pr(t,en()),{userAgent:r}=me.navigator||{},s=function(e){const t=Ct(),n={sid:dt(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return{sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}(n)};return e&&Dt(n,e),n}({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return"ok"===i?.status&&Dt(i,{status:"exited"}),Hr(),t.setSession(s),s}function Hr(){const e=tn(),t=en().getSession()||e.getSession();t&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),Dt(e,t)}(t),Gr(),e.setSession()}function Gr(){const e=tn(),t=nn(),n=e.getSession();n&&t&&t.captureSession(n)}function Yr(e=!1){e?Hr():Gr()}const Xr=me;let es=0;function ts(){return es>0}function ns(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(tt(e))return e}catch{return e}const n=function(...n){try{const r=n.map(e=>ns(e,t));return e.apply(this,r)}catch(e){throw es++,setTimeout(()=>{es--}),function(...e){const t=Yt(ye());if(2===e.length){const[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}t.withScope(e[0])}(r=>{var s;r.addEventProcessor(e=>(t.mechanism&&(ht(e,void 0,void 0),ft(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),s=e,en().captureException(s,function(e){if(e)return function(e){return e instanceof Jt||"function"==typeof e}(e)||function(e){return Object.keys(e).some(e=>fr.includes(e))}(e)?{captureContext:e}:e}(void 0))}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}et(n,e),Xe(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}class rs extends $r{constructor(e){const t=(n=e,{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:Xr.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...n});var n;!function(e,t,n=[t],r="npm"){const s=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${t}`,s.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:fe})),s.version=fe)}(t,"browser",["browser"],Xr.SENTRY_SDK_SOURCE||"npm"),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?"auto":"never",...t._metadata.sdk.settings}),super(t);const{sendDefaultPii:r,sendClientReports:s,enableLogs:i,_experiments:o,enableMetrics:a}=this._options,c=a??o?.enableMetrics??!0;Xr.document&&(s||i||c)&&Xr.document.addEventListener("visibilitychange",()=>{"hidden"===Xr.document.visibilityState&&(s&&this._flushOutcomes(),i&&Jn(this),c&&Kn(this))}),r&&this.on("beforeSendSession",Cr)}eventFromException(e,t){return function(e,t,n,r){const s=Qr(e,t,n?.syntheticException||void 0,r);return ft(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),Gn(s)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,s){const i=Kr(e,t,r?.syntheticException||void 0,s);return i.level=n,r?.event_id&&(i.event_id=r.event_id),Gn(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}}const ss={},is={};function os(e,t){ss[e]=ss[e]||[],ss[e].push(t)}function as(e,t){if(!is[e]){is[e]=!0;try{t()}catch(t){he&&$e(`Error while instrumenting ${e}`,t)}}}function cs(e,t){const n=e&&ss[e];if(n)for(const r of n)try{r(t)}catch(t){he&&$e(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${St(r)}\nError:`,t)}}function us(){"console"in me&&ve.forEach(function(e){e in me.console&&Ye(me.console,e,function(t){return be[e]=t,function(...t){cs("console",{args:t,level:e});const n=be[e];n?.apply(me.console,t)}})})}const ds=me;function ls(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function ps(e,t=!1){t&&!function(){if("string"==typeof EdgeRuntime)return!0;if(!function(){if(!("fetch"in ds))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}())return!1;if(ls(ds.fetch))return!0;let e=!1;const t=ds.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=ls(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){he&&Oe("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}()||Ye(me,"fetch",function(t){return function(...n){const r=new Error,{method:s,url:i}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:fs(t),method:hs(n,"method")?String(n.method).toUpperCase():Be(t)&&hs(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:fs(t),method:hs(t,"method")?String(t.method).toUpperCase():"GET"}}(n),o={args:n,fetchData:{method:s,url:i},startTimestamp:1e3*Ct(),virtualError:r,headers:ms(n)};return e||cs("fetch",{...o}),t.apply(me,n).then(async t=>(e?e(t):cs("fetch",{...o,endTimestamp:1e3*Ct(),response:t}),t),e=>{cs("fetch",{...o,endTimestamp:1e3*Ct(),error:e}),je(e)&&void 0===e.stack&&(e.stack=r.stack,Xe(e,"framesToPop",1));const t=nn(),n=t?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==n&&e instanceof TypeError&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const t=new URL(o.fetchData.url).host;"always"===n?e.message=`${e.message} (${t})`:Xe(e,"__sentry_fetch_url_host__",t)}catch{}throw e})}})}function hs(e,t){return!!e&&"object"==typeof e&&!!e[t]}function fs(e){return"string"==typeof e?e:e?hs(e,"url")?e.url:e.toString?e.toString():"":""}function ms(e){const[t,n]=e;try{if("object"==typeof n&&null!==n&&"headers"in n&&n.headers)return new Headers(n.headers);if(Be(t))return new Headers(t.headers)}catch{}}const ys=100;function gs(e,t){const n=nn(),r=tn();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=ys}=n.getOptions();if(i<=0)return;const o={timestamp:At(),...e},a=s?we(()=>s(o,t)):o;null!==a&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}function _s(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}function vs(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const bs=me;let ws,Ss,xs;function Es(){if(!bs.document)return;const e=cs.bind(null,"dom"),t=ks(e,!0);bs.document.addEventListener("click",t,!1),bs.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=bs,r=n[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Ye(r,"addEventListener",function(t){return function(n,r,s){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},i=r[n]=r[n]||{refCount:0};if(!i.handler){const r=ks(e);i.handler=r,t.call(this,n,r,s)}i.refCount++}catch{}return t.call(this,n,r,s)}}),Ye(r,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},s=n[t];s&&(s.refCount--,s.refCount<=0&&(e.call(this,t,s.handler,r),s.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function ks(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;Xe(n,"_sentryCaptured",!0),r&&!r._sentryId&&Xe(r,"_sentryId",dt());const s="keypress"===n.type?"input":n.type;(function(e){if(e.type!==Ss)return!1;try{if(!e.target||e.target._sentryId!==xs)return!1}catch{}return!0})(n)||(e({event:n,name:s,global:t}),Ss=n.type,xs=r?r._sentryId:void 0),clearTimeout(ws),ws=bs.setTimeout(()=>{xs=void 0,Ss=void 0},1e3)}}const zs="__sentry_xhr_v3__";function Os(){if(!bs.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,s=1e3*Ct(),i=Ue(n[0])?n[0].toUpperCase():void 0,o=function(e){if(Ue(e))return e;try{return e.toString()}catch{}}(n[1]);if(!i||!o)return e.apply(t,n);t[zs]={method:i,url:o,request_headers:{}},"POST"===i&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const a=()=>{const e=t[zs];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}cs("xhr",{endTimestamp:1e3*Ct(),startTimestamp:s,xhr:t,virtualError:r})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(a(),e.apply(t,n))}):t.addEventListener("readystatechange",a),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,s]=n,i=t[zs];return i&&Ue(r)&&Ue(s)&&(i.request_headers[r.toLowerCase()]=s),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[zs];return r?(void 0!==n[0]&&(r.body=n[0]),cs("xhr",{startTimestamp:1e3*Ct(),xhr:t}),e.apply(t,n)):e.apply(t,n)}})}let $s;function Is(e){const t="history";os(t,e),as(t,Ts)}function Ts(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=$s,s=function(e){try{return new URL(e,bs.location.origin).toString()}catch{return e}}(String(n));if($s=s,r===s)return e.apply(this,t);cs("history",{from:r,to:s})}return e.apply(this,t)}}bs.addEventListener("popstate",()=>{const e=bs.location.href,t=$s;$s=e,t!==e&&cs("history",{from:t,to:e})}),"history"in ds&&ds.history&&(Ye(bs.history,"pushState",e),Ye(bs.history,"replaceState",e))}const Ps="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ns=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:"Breadcrumbs",setup(e){var n;t.console&&function(e){const t="console";os(t,e),as(t,us)}(function(e){return function(t){if(nn()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:(r=t.level,"warn"===r?"warning":["fatal","error","warning","log","info","debug"].includes(r)?r:"log"),message:zt(t.args," ")};var r;if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${zt(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}gs(n,{input:t.args,level:t.level})}}(e)),t.dom&&(n=function(e,t){return function(n){if(nn()!==e)return;let r,s,i="object"==typeof t?t.serializeAttribute:void 0,o="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;o&&o>1024&&(Ps&&Oe(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=1024),"string"==typeof i&&(i=[i]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=Ve(t,{keyAttrs:i,maxStringLength:o}),s=function(e,t=5){if(!We.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}(t)}catch{r="<unknown>"}if(0===r.length)return;const a={category:`ui.${n.name}`,message:r};s&&(a.data={"ui.component_name":s}),gs(a,{event:n.event,name:n.name,global:n.global})}}(e,t.dom),os("dom",n),as("dom",Es)),t.xhr&&function(e){os("xhr",e),as("xhr",Os)}(function(e){return function(t){if(nn()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,s=t.xhr[zs];if(!n||!r||!s)return;const{method:i,url:o,status_code:a,body:c}=s,u={method:i,url:o,status_code:a},d={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},l={category:"xhr",data:u,type:"http",level:_s(a)};e.emit("beforeOutgoingRequestBreadcrumb",l,d),gs(l,d)}}(e)),t.fetch&&function(e){const t="fetch";os(t,e),as(t,()=>ps(void 0,void 0))}(function(e){return function(t){if(nn()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const s={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},i={category:"fetch",data:t.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),gs(i,s)}else{const s=t.response,i={...t.fetchData,status_code:s?.status},o={input:t.args,response:s,startTimestamp:n,endTimestamp:r},a={category:"fetch",data:i,type:"http",level:_s(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,o),gs(a,o)}}}(e)),t.history&&Is(function(e){return function(t){if(nn()!==e)return;let n=t.from,r=t.to;const s=vs(Xr.location.href);let i=n?vs(n):void 0;const o=vs(r);i?.path||(i=s),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),s.protocol===i.protocol&&s.host===i.host&&(n=i.relative),gs({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on("beforeSendEvent",function(e){return function(t){nn()===e&&gs({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:pt(t)},{event:t})}}(e))}}},Rs="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),As=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:"BrowserApiErrors",setupOnce(){t.setTimeout&&Ye(Xr,"setTimeout",js),t.setInterval&&Ye(Xr,"setInterval",js),t.requestAnimationFrame&&Ye(Xr,"requestAnimationFrame",Cs),t.XMLHttpRequest&&"XMLHttpRequest"in Xr&&Ye(XMLHttpRequest.prototype,"send",Ds);const e=t.eventTarget;e&&(Array.isArray(e)?e:Rs).forEach(e=>function(e,t){const n=Xr,r=n[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Ye(r,"addEventListener",function(n){return function(r,s,i){try{"function"==typeof s.handleEvent&&(s.handleEvent=ns(s.handleEvent,{mechanism:{data:{handler:St(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&function(e,t,n){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,n)}(this,r,s),n.apply(this,[r,ns(s,{mechanism:{data:{handler:St(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),i])}}),Ye(r,"removeEventListener",function(e){return function(t,n,r){try{const s=n.__sentry_wrapped__;s&&e.call(this,t,s,r)}catch{}return e.call(this,t,n,r)}}))}(e,t))}}};function js(e){return function(...t){const n=t[0];return t[0]=ns(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${St(e)}`}}),e.apply(this,t)}}function Cs(e){return function(t){return e.apply(this,[ns(t,{mechanism:{data:{handler:St(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Ds(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Ye(n,e,function(t){const n={mechanism:{data:{handler:St(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=tt(t);return r&&(n.mechanism.data.handler=St(r)),ns(t,n)})}),e.apply(this,t)}}const Zs=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===Xr.document)return void(Ps&&Oe("Using the `browserSessionIntegration` in non-browser environments is not supported."));Vr({ignoreDuration:!0}),Yr();const e=tn();let n=e.getUser();e.addScopeListener(e=>{const t=e.getUser();n?.id===t?.id&&n?.ip_address===t?.ip_address||(Yr(),n=t)}),"route"===t&&Is(({from:e,to:t})=>{e!==t&&(Vr({ignoreDuration:!0}),Yr())})}}};function Us(){try{const e=Xr.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}let Fs=null;function Ms(){Fs=me.onerror,me.onerror=function(e,t,n,r,s){return cs("error",{column:r,error:s,line:n,msg:e,url:t}),!!Fs&&Fs.apply(this,arguments)},me.onerror.__SENTRY_INSTRUMENTED__=!0}let Ls=null;function qs(){Ls=me.onunhandledrejection,me.onunhandledrejection=function(e){return cs("unhandledrejection",e),!Ls||Ls.apply(this,arguments)},me.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Js=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(){const t="error";os(t,t=>{const{stackParser:n,attachStacktrace:r}=Ks();if(nn()!==e||ts())return;const{msg:s,url:i,line:o,column:a,error:c}=t,u=function(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[];return 0===c.length&&c.push({colno:r,lineno:n,filename:Bs(t)??Ge(),function:yt,in_app:!0}),e}(Qr(n,c||s,void 0,r,!1),i,o,a);u.level="error",Wr(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})}),as(t,Ms)}()}(e),Qs("onerror")),t.onunhandledrejection&&(function(e){!function(){const t="unhandledrejection";os(t,t=>{const{stackParser:n,attachStacktrace:r}=Ks();if(nn()!==e||ts())return;const s=function(e){if(Me(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}(t),i=Me(s)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`}]}}:Qr(n,s,void 0,r,!0);i.level="error",Wr(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})}),as(t,qs)}()}(e),Qs("onunhandledrejection"))}}};function Qs(e){Ps&&ze(`Global Handler attached: ${e}`)}function Ks(){const e=nn();return e?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Bs(e){if(Ue(e)&&0!==e.length)return e.startsWith("data:")?`<${function(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=e.includes(";base64,"),i=e.indexOf(",");let o="";if(t&&-1!==i){const t=e.slice(i+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${s?",base64":""}${o?`,${o}`:""}`}return e}(e,!1)}>`:e}function Ws(e,t,n,r,s,i){if(!s.exception?.values||!i||!Qe(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=Vs(e,t,r,i.originalException,n,s.exception.values,o,0))}function Vs(e,t,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if(Qe(r[s],Error)){Gs(o,a,r);const i=e(t,r[s]),u=c.length;Ys(i,s,u,a),c=Vs(e,t,n,r[s],s,[i,...c],i,u)}return Hs(r)&&r.errors.forEach((i,u)=>{if(Qe(i,Error)){Gs(o,a,r);const d=e(t,i),l=c.length;Ys(d,`errors[${u}]`,l,a),c=Vs(e,t,n,i,s,[d,...c],d,l)}}),c}function Hs(e){return Array.isArray(e.errors)}function Gs(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Hs(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ys(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}const Xs=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,s){Ws(Zr,s.getOptions().stackParser,n,t,e,r)}}};function ei(e,t,n,r){const s={filename:e,function:"<anonymous>"===t?yt:t,in_app:!0};return void 0!==n&&(s.lineno=n),void 0!==r&&(s.colno=r),s}const ti=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ni=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ri=/\((\S*)(?::(\d+))(?::(\d+))\)/,si=/at (.+?) ?\(data:(.+?),/,ii=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,oi=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ai=vt([30,e=>{const t=e.match(si);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=ti.exec(e);if(n){const[,e,t,r]=n;return ei(e,yt,+t,+r)}const r=ni.exec(e);if(r){if(0===r[2]?.indexOf("eval")){const e=ri.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}const[e,t]=ci(r[1]||yt,r[2]);return ei(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],[50,e=>{const t=ii.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=oi.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||yt;return[n,e]=ci(n,e),ei(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),ci=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:yt,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},ui="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,di={};function li(e,t=function(e){const t=di[e];if(t)return t;let n=bs[e];if(ls(n))return di[e]=n.bind(bs);const r=bs.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const s=t.contentWindow;s?.[e]&&(n=s[e]),r.head.removeChild(t)}catch(t){ui&&Oe(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n?di[e]=n.bind(bs):n}("fetch")){let n=0,r=0;return rr(e,async function(s){const i=s.body.length;n+=i,r++;const o={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")}}}catch(e){throw di.fetch=void 0,e}finally{n-=i,r--}},nr(e.bufferSize||40))}function pi(e,t,n){try{const r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],s={};for(const t of Object.keys(e)){if(-1!==r.indexOf(t))continue;const i=e[t];s[t]=je(i)||"string"==typeof i?n?kt(`${i}`,n):`${i}`:i}if(t&&void 0!==e.cause)if(je(e.cause)){const t=e.cause.name||e.cause.constructor.name;s.cause={[t]:pi(e.cause,!1,n)}}else s.cause=e.cause;if("function"==typeof e.toJSON){const t=e.toJSON();for(const e of Object.keys(t)){const n=t[e];s[e]=je(n)?n.toString():n}}return s}catch(e){he&&$e("Unable to extract extra data from the Error object:",e)}return null}const hi="string"==typeof window.JAAK_VERSION&&window.JAAK_VERSION.length>0?window.JAAK_VERSION:null;!function(e={}){const t=!e.skipBrowserExtensionCheck&&!!function(){if(void 0===Xr.window)return!1;const e=Xr;if(e.nw)return!1;const t=e.chrome||e.browser;if(!t?.runtime?.id)return!1;const n=Ge();return!(Xr===Xr.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}()&&(Ps&&we(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0);let n=null==e.defaultIntegrations?[Pt(),on(),{name:"ConversationId",setup(e){e.on("spanStart",e=>{const t=en().getScopeData(),n=tn().getScopeData(),r=t.conversationId||n.conversationId;if(r){const{op:t,data:n,description:s}=yn(e);if(!t?.startsWith("gen_ai.")&&!n["ai.operationId"]&&!s?.startsWith("ai."))return;e.setAttribute("gen_ai.conversation.id",r)}})}},As(),Ns(),Js(),Xs(),Sn(),{name:"HttpContext",preprocessEvent(e){if(!Xr.navigator&&!Xr.location&&!Xr.document)return;const t=function(){const e=Ge(),{referrer:t}=Xr.document||{},{userAgent:n}=Xr.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}},{name:"CultureContext",preprocessEvent(e){const t=Us();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=Us();t&&(e.attributes={"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar,...e.attributes})}},Zs()]:e.defaultIntegrations;const r={...e,enabled:!t&&e.enabled,stackParser:(s=e.stackParser||ai,Array.isArray(s)?vt(...s):s),integrations:Te({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||li};var s;!function(e,t){!0===t.debug&&(he?ke():we(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),en().update(t.initialScope);const n=new e(t);(function(e){en().setClient(e)})(n),n.init()}(rs,r)}({dsn:"https://bd3b645ba0f80fff939178d86353467c@o4507568947200000.ingest.de.sentry.io/4511292185641040",environment:window.JAAK_SENTRY_ENV,release:null===hi?void 0:`jaak-for-woocommerce@${hi}`,tracesSampleRate:0,sendDefaultPii:!0,normalizeDepth:10,normalizeMaxBreadth:5e3,integrations:[((e={})=>{const{depth:t=3,captureErrorCause:n=!0}=e;return{name:"ExtraErrorData",processEvent(e,r,s){const{maxValueLength:i}=s.getOptions();return function(e,t={},n,r,s){if(!t.originalException||!je(t.originalException))return e;const i=t.originalException.name||t.originalException.constructor.name,o=pi(t.originalException,r,s);if(o){const t={...e.contexts},r=Nn(o,n);return Le(r)&&(Xe(r,"__sentry_skip_normalization__",!0),t[i]=r),{...e,contexts:t}}return e}(e,r,t,n,i)}}})()],initialScope:{...window.JAAK_WP_USER?{user:window.JAAK_WP_USER}:{},tags:{wp_site_url:window.WORDPRESS_SITE_URL,wp_site_url_hostname:function(e){if("string"!=typeof e||0===e.length)return null;try{return new URL(e).hostname}catch{return null}}(window.WORDPRESS_SITE_URL),jaak_version:hi,wp_version:"string"==typeof window.JAAK_WP_VERSION?window.JAAK_WP_VERSION:null,wc_version:"string"==typeof window.JAAK_WC_VERSION?window.JAAK_WC_VERSION:null,php_version:"string"==typeof window.JAAK_PHP_VERSION?window.JAAK_PHP_VERSION:null}}});var fi=(e,t,n)=>((e,t,n={})=>{let r=`${e}=${t}`;if(e.startsWith("__Secure-")&&!n.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(e.startsWith("__Host-")){if(!n.secure)throw new Error("__Host- Cookie must have Secure attributes");if("/"!==n.path)throw new Error('__Host- Cookie must have Path attributes with "/"');if(n.domain)throw new Error("__Host- Cookie must not have Domain attributes")}for(const e of["domain","path"])if(n[e]&&/[;\r\n]/.test(n[e]))throw new Error(`${e} must not contain ";", "\\r", or "\\n"`);if(n&&"number"==typeof n.maxAge&&n.maxAge>=0){if(n.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+="; Max-Age="+(0|n.maxAge)}if(n.domain&&"host"!==n.prefix&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r})(e,t=encodeURIComponent(t),n);Error;var mi=(e,t)=>{for(const[n,r]of Object.entries(t)){const t=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(t,r?`/${r}`:"")}return e},yi=e=>{const t=new URLSearchParams;for(const[n,r]of Object.entries(e))if(void 0!==r)if(Array.isArray(r))for(const e of r)t.append(n,e);else t.set(n,r);return t},gi=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,"/"):e.replace(/\/index(?=\?|$)/,"");function _i(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function vi(e,t){if(!_i(e)&&!_i(t))return t;const n={...e};for(const e in t){const r=t[e];_i(n[e])&&_i(r)?n[e]=vi(n[e],r):n[e]=r}return n}var bi=(e,t)=>new Proxy(()=>{},{get(n,r){if("string"==typeof r&&"then"!==r)return bi(e,[...t,r])},apply:(n,r,s)=>e({path:t,args:s})}),wi=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){const t=new FormData;for(const[n,r]of Object.entries(e.form))if(void 0!==r)if(Array.isArray(r))for(const e of r)t.append(n,e);else t.append(n,r);this.rBody=t}e.json&&(this.rBody=JSON.stringify(e.json),this.cType="application/json"),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase();const r={...e?.header,..."function"==typeof t?.headers?await t.headers():t?.headers};if(e?.cookie){const t=[];for(const[n,r]of Object.entries(e.cookie))t.push(fi(n,r,{path:"/"}));r.Cookie=t.join(",")}this.cType&&(r["Content-Type"]=this.cType);const s=new Headers(r??void 0);let i=this.url;i=gi(i),i=mi(i,this.pathParams),this.queryParams&&(i=i+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const o=!("GET"===n||"HEAD"===n);return(t?.fetch||fetch)(i,{body:o?this.rBody:void 0,method:n,headers:s,...t?.init})}},Si=(e,t)=>bi(function n(r){const s=t?.buildSearchParams??yi,i=[...r.path],o=i.slice(-3).reverse();if("toString"===o[0])return"name"===o[1]?o[2]||"":n.toString();if("valueOf"===o[0])return"name"===o[1]?o[2]||"":n;let a="";if(/^\$/.test(o[0])){const e=i.pop();e&&(a=e.replace(/^\$/,""))}const c=i.join("/"),u=((e,t)=>(e=e.replace(/\/+$/,""),(e+="/")+t.replace(/^\/+/,"")))(e,c);if("url"===a||"path"===a){let t=u;return r.args[0]&&(r.args[0].param&&(t=mi(u,r.args[0].param)),r.args[0].query&&(t=t+"?"+s(r.args[0].query).toString())),t=gi(t),"url"===a?new URL(t):t.slice(e.replace(/\/+$/,"").length).replace(/^\/?/,"/")}if("ws"===a){const e=(r.args[0]&&r.args[0].param?mi(u,r.args[0].param):u).replace(/^http/,"ws"),n=new URL(e),s=r.args[0]?.query;return s&&Object.entries(s).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>n.searchParams.append(e,t)):n.searchParams.set(e,t)}),((...e)=>void 0!==t?.webSocket&&"function"==typeof t.webSocket?t.webSocket(...e):new WebSocket(...e))(n.toString())}const d=new wi(u,a,{buildSearchParams:s});if(a){t??={};const e=vi(t,{...r.args[1]});return d.fetch(r.args[0],e)}return d},[]);function xi(e,t){if(!e)throw new Error(t)}class Ei extends Error{#B=Symbol("GeneralException");constructor({type:e,title:t="Error",detail:n,context:r}){super(e),this.name="GeneralException",this.type=e,this.title=t,this.detail=n,this.context=r}}function ki(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const s=o.prototype,i=Object.keys(s);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=s[t].bind(n))}}const s=n?.Parent??Object;class i extends s{}function o(e){var t;const s=n?.Parent?new i:this;r(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}Object.freeze({status:"aborted"}),Symbol("zod_brand");class zi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Oi extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const $i={};function Ii(e){return e&&Object.assign($i,e),$i}function Ti(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function Pi(e,t="|"){return e.map(e=>Gi(e)).join(t)}function Ni(e,t){return"bigint"==typeof t?t.toString():t}function Ri(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ai(e){return null==e}function ji(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Ci=Symbol("evaluating");function Di(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ci)return void 0===r&&(r=Ci,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Zi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ui(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Fi(e){return JSON.stringify(e)}const Mi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Li(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const qi=Ri(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ji(e){if(!1===Li(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==Li(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Qi(e){return Ji(e)?{...e}:Array.isArray(e)?[...e]:e}const Ki=new Set(["string","number","symbol"]),Bi=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Wi(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vi(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function Hi(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function Gi(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}const Yi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Xi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function eo(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function to(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function no(e){return"string"==typeof e?e:e?.message}function ro(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=no(e.inst?._zod.def?.error?.(e))??no(t?.error?.(e))??no(n.customError?.(e))??no(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function so(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function io(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function oo(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const ao=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ni,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},co=ki("$ZodError",ao),uo=ki("$ZodError",ao,{Parent:Error}),lo=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new zi;if(o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ro(e,i,Ii())));throw Mi(t,s?.callee),t}return o.value},po=lo(uo),ho=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(s?.Err??e)(o.issues.map(e=>ro(e,i,Ii())));throw Mi(t,s?.callee),t}return o.value},fo=ho(uo),mo=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new zi;return i.issues.length?{success:!1,error:new(e??co)(i.issues.map(e=>ro(e,s,Ii())))}:{success:!0,data:i.value}},yo=mo(uo),go=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>ro(e,s,Ii())))}:{success:!0,data:i.value}},_o=go(uo),vo=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return lo(e)(t,n,s)},bo=e=>(t,n,r)=>lo(e)(t,n,r),wo=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ho(e)(t,n,s)},So=e=>async(t,n,r)=>ho(e)(t,n,r),xo=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return mo(e)(t,n,s)},Eo=e=>(t,n,r)=>mo(e)(t,n,r),ko=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return go(e)(t,n,s)},zo=e=>async(t,n,r)=>go(e)(t,n,r),Oo=/^[cC][^\s-]{8,}$/,$o=/^[0-9a-z]+$/,Io=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,To=/^[0-9a-vA-V]{20}$/,Po=/^[A-Za-z0-9]{27}$/,No=/^[a-zA-Z0-9_-]{21}$/,Ro=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ao=/^[-+]?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)?)??$/,jo=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Co=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Do=Co(4),Zo=Co(6),Uo=Co(7),Fo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mo=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Lo=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qo=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Jo=qo,Qo=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ko="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Bo(){return new RegExp(Ko,"u")}const Wo=/^(?:(?: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])$/,Vo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ho=e=>{const t=Wi(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Go=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Yo=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ea=/^[A-Za-z0-9_-]*$/,ta=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,na=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ra=/^\+[1-9]\d{6,14}$/,sa="(?:(?:\\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])))",ia=new RegExp(`^${sa}$`);function oa(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function aa(e){return new RegExp(`^${oa(e)}$`)}function ca(e){const t=oa({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${sa}T(?:${r})$`)}const ua=e=>new RegExp(`^${e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*"}$`),da=/^-?\d+n?$/,la=/^-?\d+$/,pa=/^-?\d+(?:\.\d+)?$/,ha=/^(?:true|false)$/i,fa=/^null$/i,ma=/^undefined$/i,ya=/^[^A-Z]*$/,ga=/^[^a-z]*$/,_a=/^[0-9a-fA-F]*$/;function va(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ba(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const wa=/^[0-9a-fA-F]{32}$/,Sa=va(22,"=="),xa=ba(22),Ea=/^[0-9a-fA-F]{40}$/,ka=va(27,"="),za=ba(27),Oa=/^[0-9a-fA-F]{64}$/,$a=va(43,"="),Ia=ba(43),Ta=/^[0-9a-fA-F]{96}$/,Pa=va(64,""),Na=ba(64),Ra=/^[0-9a-fA-F]{128}$/,Aa=va(86,"=="),ja=ba(86),Ca=ki("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Da={number:"number",bigint:"bigint",object:"date"},Za=ki("$ZodCheckLessThan",(e,t)=>{Ca.init(e,t);const n=Da[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ua=ki("$ZodCheckGreaterThan",(e,t)=>{Ca.init(e,t);const n=Da[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fa=ki("$ZodCheckMultipleOf",(e,t)=>{Ca.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let s=(r.split(".")[1]||"").length;if(0===s&&/\d?e-\d?/.test(r)){const e=r.match(/\d?e-(\d?)/);e?.[1]&&(s=Number.parseInt(e[1]))}const i=n>s?n:s;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ma=ki("$ZodCheckNumberFormat",(e,t)=>{Ca.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[s,i]=Yi[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=s,r.maximum=i,n&&(r.pattern=la)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a))return void o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<s&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),La=ki("$ZodCheckBigIntFormat",(e,t)=>{Ca.init(e,t);const[n,r]=Xi[t.format];e._zod.onattach.push(e=>{const s=e._zod.bag;s.format=t.format,s.minimum=n,s.maximum=r}),e._zod.check=s=>{const i=s.value;i<n&&s.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&s.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),qa=ki("$ZodCheckMaxSize",(e,t)=>{var n;Ca.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ai(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;r.size<=t.maximum||n.issues.push({origin:so(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ja=ki("$ZodCheckMinSize",(e,t)=>{var n;Ca.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ai(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;r.size>=t.minimum||n.issues.push({origin:so(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Qa=ki("$ZodCheckSizeEquals",(e,t)=>{var n;Ca.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ai(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{const r=n.value,s=r.size;if(s===t.size)return;const i=s>t.size;n.issues.push({origin:so(r),...i?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ka=ki("$ZodCheckMaxLength",(e,t)=>{var n;Ca.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ai(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const s=io(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ba=ki("$ZodCheckMinLength",(e,t)=>{var n;Ca.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ai(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const s=io(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Wa=ki("$ZodCheckLengthEquals",(e,t)=>{var n;Ca.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ai(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,s=r.length;if(s===t.length)return;const i=io(r),o=s>t.length;n.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Va=ki("$ZodCheckStringFormat",(e,t)=>{var n,r;Ca.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ha=ki("$ZodCheckRegex",(e,t)=>{Va.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ga=ki("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ya),Va.init(e,t)}),Ya=ki("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ga),Va.init(e,t)}),Xa=ki("$ZodCheckIncludes",(e,t)=>{Ca.init(e,t);const n=Wi(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ec=ki("$ZodCheckStartsWith",(e,t)=>{Ca.init(e,t);const n=new RegExp(`^${Wi(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),tc=ki("$ZodCheckEndsWith",(e,t)=>{Ca.init(e,t);const n=new RegExp(`.*${Wi(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function nc(e,t,n){e.issues.length&&t.issues.push(...to(n,e.issues))}const rc=ki("$ZodCheckProperty",(e,t)=>{Ca.init(e,t),e._zod.check=e=>{const n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>nc(n,e,t.property));nc(n,e,t.property)}}),sc=ki("$ZodCheckMimeType",(e,t)=>{Ca.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),ic=ki("$ZodCheckOverwrite",(e,t)=>{Ca.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class oc{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>`  ${e}`)].join("\n"))}}const ac={major:4,minor:3,patch:6},cc=ki("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ac;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,s=eo(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&!1===n?.async)throw new zi;if(r||o instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(s||(s=eo(e,t)))});else{if(e.issues.length===t)continue;s||(s=eo(e,t))}}return r?r.then(()=>e):e},n=(n,s,i)=>{if(eo(n))return n.aborted=!0,n;const o=t(s,r,i);if(o instanceof Promise){if(!1===i.async)throw new zi;return o.then(t=>e._zod.parse(t,i))}return e._zod.parse(o,i)};e._zod.run=(s,i)=>{if(i.skipChecks)return e._zod.parse(s,i);if("backward"===i.direction){const t=e._zod.parse({value:s.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,s,i)):n(t,s,i)}const o=e._zod.parse(s,i);if(o instanceof Promise){if(!1===i.async)throw new zi;return o.then(e=>t(e,r,i))}return t(o,r,i)}}Di(e,"~standard",()=>({validate:t=>{try{const n=yo(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return _o(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),uc=ki("$ZodString",(e,t)=>{cc.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ua(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),dc=ki("$ZodStringFormat",(e,t)=>{Va.init(e,t),uc.init(e,t)}),lc=ki("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=jo),dc.init(e,t)}),pc=ki("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Co(e))}else t.pattern??(t.pattern=Co());dc.init(e,t)}),hc=ki("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Fo),dc.init(e,t)}),fc=ki("$ZodURL",(e,t)=>{dc.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=s.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),mc=ki("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Bo()),dc.init(e,t)}),yc=ki("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=No),dc.init(e,t)}),gc=ki("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Oo),dc.init(e,t)}),_c=ki("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=$o),dc.init(e,t)}),vc=ki("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Io),dc.init(e,t)}),bc=ki("$ZodXID",(e,t)=>{t.pattern??(t.pattern=To),dc.init(e,t)}),wc=ki("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Po),dc.init(e,t)}),Sc=ki("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ca(t)),dc.init(e,t)}),xc=ki("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ia),dc.init(e,t)}),Ec=ki("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=aa(t)),dc.init(e,t)}),kc=ki("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ro),dc.init(e,t)}),zc=ki("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wo),dc.init(e,t),e._zod.bag.format="ipv4"}),Oc=ki("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Vo),dc.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),$c=ki("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Ho(t.delimiter)),dc.init(e,t),e._zod.bag.format="mac"}),Ic=ki("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Go),dc.init(e,t)}),Tc=ki("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yo),dc.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Pc(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Nc=ki("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Xo),dc.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Pc(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Rc=ki("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ea),dc.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!ea.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Pc(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ac=ki("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ra),dc.init(e,t)}),jc=ki("$ZodJWT",(e,t)=>{dc.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&"JWT"!==s?.typ||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Cc=ki("$ZodCustomStringFormat",(e,t)=>{dc.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Dc=ki("$ZodNumber",(e,t)=>{cc.init(e,t),e._zod.pattern=e._zod.bag.pattern??pa,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const s=n.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return n;const i="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...i?{received:i}:{}}),n}}),Zc=ki("$ZodNumberFormat",(e,t)=>{Ma.init(e,t),Dc.init(e,t)}),Uc=ki("$ZodBoolean",(e,t)=>{cc.init(e,t),e._zod.pattern=ha,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const s=n.value;return"boolean"==typeof s||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),Fc=ki("$ZodBigInt",(e,t)=>{cc.init(e,t),e._zod.pattern=da,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Mc=ki("$ZodBigIntFormat",(e,t)=>{La.init(e,t),Fc.init(e,t)}),Lc=ki("$ZodSymbol",(e,t)=>{cc.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return"symbol"==typeof r||t.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),t}}),qc=ki("$ZodUndefined",(e,t)=>{cc.init(e,t),e._zod.pattern=ma,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}}),Jc=ki("$ZodNull",(e,t)=>{cc.init(e,t),e._zod.pattern=fa,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),Qc=ki("$ZodAny",(e,t)=>{cc.init(e,t),e._zod.parse=e=>e}),Kc=ki("$ZodUnknown",(e,t)=>{cc.init(e,t),e._zod.parse=e=>e}),Bc=ki("$ZodNever",(e,t)=>{cc.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),Wc=ki("$ZodVoid",(e,t)=>{cc.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}}),Vc=ki("$ZodDate",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const s=n.value,i=s instanceof Date;return i&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...i?{received:"Invalid Date"}:{},inst:e}),n}});function Hc(e,t,n){e.issues.length&&t.issues.push(...to(n,e.issues)),t.value[n]=e.value}const Gc=ki("$ZodArray",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const i=[];for(let e=0;e<s.length;e++){const o=s[e],a=t.element._zod.run({value:o,issues:[]},r);a instanceof Promise?i.push(a.then(t=>Hc(t,n,e))):Hc(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function Yc(e,t,n,r,s){if(e.issues.length){if(s&&!(n in r))return;t.issues.push(...to(n,e.issues))}void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Xc(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function eu(e,t,n,r,s,i){const o=[],a=s.keySet,c=s.catchall._zod,u=c.def.type,d="optional"===c.optout;for(const s in t){if(a.has(s))continue;if("never"===u){o.push(s);continue}const i=c.run({value:t[s],issues:[]},r);i instanceof Promise?e.push(i.then(e=>Yc(e,n,s,t,d))):Yc(i,n,s,t,d)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const tu=ki("$ZodObject",(e,t)=>{cc.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=Ri(()=>Xc(t));Di(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const s=Li,i=t.catchall;let o;e._zod.parse=(t,n)=>{o??(o=r.value);const a=t.value;if(!s(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=o.shape;for(const e of o.keys){const r=u[e],s="optional"===r._zod.optout,i=r._zod.run({value:a[e],issues:[]},n);i instanceof Promise?c.push(i.then(n=>Yc(n,t,e,a,s))):Yc(i,t,e,a,s)}return i?eu(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}}),nu=ki("$ZodObjectJIT",(e,t)=>{tu.init(e,t);const n=e._zod.parse,r=Ri(()=>Xc(t));let s;const i=Li,o=!$i.jitless,a=o&&qi.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=r.value);const p=d.value;return i(p)?o&&a&&!1===l?.async&&!0!==l.jitless?(s||(s=(e=>{const t=new oc(["shape","payload","ctx"]),n=r.value,s=e=>{const t=Fi(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of n.keys)i[e]="key_"+o++;t.write("const newResult = {};");for(const r of n.keys){const n=i[r],o=Fi(r),a=e[r],c="optional"===a?._zod?.optout;t.write(`const ${n} = ${s(r)};`),c?t.write(`\n        if (${n}.issues.length) {\n          if (${o} in input) {\n            payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n              ...iss,\n              path: iss.path ? [${o}, ...iss.path] : [${o}]\n            })));\n          }\n        }\n        \n        if (${n}.value === undefined) {\n          if (${o} in input) {\n            newResult[${o}] = undefined;\n          }\n        } else {\n          newResult[${o}] = ${n}.value;\n        }\n        \n      `):t.write(`\n        if (${n}.issues.length) {\n          payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n            ...iss,\n            path: iss.path ? [${o}, ...iss.path] : [${o}]\n          })));\n        }\n        \n        if (${n}.value === undefined) {\n          if (${o} in input) {\n            newResult[${o}] = undefined;\n          }\n        } else {\n          newResult[${o}] = ${n}.value;\n        }\n        \n      `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=s(d,l),c?eu([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function ru(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const s=e.filter(e=>!eo(e));return 1===s.length?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ro(e,r,Ii())))}),t)}const su=ki("$ZodUnion",(e,t)=>{cc.init(e,t),Di(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Di(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Di(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Di(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>ji(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>ru(t,s,e,i)):ru(a,s,e,i)}});function iu(e,t,n,r){const s=e.filter(e=>0===e.issues.length);return 1===s.length?(t.value=s[0].value,t):(0===s.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ro(e,r,Ii())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}const ou=ki("$ZodXor",(e,t)=>{su.init(e,t),t.inclusive=!1;const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:s.value,issues:[]},i);t instanceof Promise?(a.push(t),o=!0):a.push(t)}return o?Promise.all(a).then(t=>iu(t,s,e,i)):iu(a,s,e,i)}}),au=ki("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,su.init(e,t);const n=e._zod.parse;Di(e._zod,"propValues",()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(const r of n)e[t].add(r)}}return e});const r=Ri(()=>{const e=t.options,n=new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(s,i)=>{const o=s.value;if(!Li(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const a=r.value.get(o?.[t.discriminator]);return a?a._zod.run(s,i):t.unionFallback?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),s)}}),cu=ki("$ZodIntersection",(e,t)=>{cc.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,s=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([t,n])=>du(e,t,n)):du(e,s,i)}});function uu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Ji(e)&&Ji(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),s={...e,...t};for(const n of r){const r=uu(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};s[n]=r.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=uu(e[r],t[r]);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function du(e,t,n){const r=new Map;let s;for(const n of t.issues)if("unrecognized_keys"===n.code){s??(s=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const i=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&s&&e.issues.push({...s,keys:i}),eo(e))return e;const o=uu(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const lu=ki("$ZodTuple",(e,t)=>{cc.init(e,t);const n=t.items;e._zod.parse=(r,s)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const o=[],a=[...n].reverse().findIndex(e=>"optional"!==e._zod.optin),c=-1===a?0:n.length-a;if(!t.rest){const t=i.length>n.length,s=i.length<c-1;if(t||s)return r.issues.push({...t?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),r}let u=-1;for(const e of n){if(u++,u>=i.length&&u>=c)continue;const t=e._zod.run({value:i[u],issues:[]},s);t instanceof Promise?o.push(t.then(e=>pu(e,r,u))):pu(t,r,u)}if(t.rest){const e=i.slice(n.length);for(const n of e){u++;const e=t.rest._zod.run({value:n,issues:[]},s);e instanceof Promise?o.push(e.then(e=>pu(e,r,u))):pu(e,r,u)}}return o.length?Promise.all(o).then(()=>r):r}});function pu(e,t,n){e.issues.length&&t.issues.push(...to(n,e.issues)),t.value[n]=e.value}const hu=ki("$ZodRecord",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Ji(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],o=t.keyType._zod.values;if(o){n.value={};const a=new Set;for(const e of o)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){a.add("number"==typeof e?e.toString():e);const o=t.valueType._zod.run({value:s[e],issues:[]},r);o instanceof Promise?i.push(o.then(t=>{t.issues.length&&n.issues.push(...to(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...to(e,o.issues)),n.value[e]=o.value)}let c;for(const e in s)a.has(e)||(c=c??[],c.push(e));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c})}else{n.value={};for(const o of Reflect.ownKeys(s)){if("__proto__"===o)continue;let a=t.keyType._zod.run({value:o,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof o&&pa.test(o)&&a.issues.length){const e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(a=e)}if(a.issues.length){"loose"===t.mode?n.value[o]=s[o]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>ro(e,r,Ii())),input:o,path:[o],inst:e});continue}const c=t.valueType._zod.run({value:s[o],issues:[]},r);c instanceof Promise?i.push(c.then(e=>{e.issues.length&&n.issues.push(...to(o,e.issues)),n.value[a.value]=e.value})):(c.issues.length&&n.issues.push(...to(o,c.issues)),n.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>n):n}}),fu=ki("$ZodMap",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!(s instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:s,inst:e}),n;const i=[];n.value=new Map;for(const[o,a]of s){const c=t.keyType._zod.run({value:o,issues:[]},r),u=t.valueType._zod.run({value:a,issues:[]},r);c instanceof Promise||u instanceof Promise?i.push(Promise.all([c,u]).then(([t,i])=>{mu(t,i,n,o,s,e,r)})):mu(c,u,n,o,s,e,r)}return i.length?Promise.all(i).then(()=>n):n}});function mu(e,t,n,r,s,i,o){e.issues.length&&(Ki.has(typeof r)?n.issues.push(...to(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:s,inst:i,issues:e.issues.map(e=>ro(e,o,Ii()))})),t.issues.length&&(Ki.has(typeof r)?n.issues.push(...to(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:s,inst:i,key:r,issues:t.issues.map(e=>ro(e,o,Ii()))})),n.value.set(e.value,t.value)}const yu=ki("$ZodSet",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!(s instanceof Set))return n.issues.push({input:s,inst:e,expected:"set",code:"invalid_type"}),n;const i=[];n.value=new Set;for(const e of s){const s=t.valueType._zod.run({value:e,issues:[]},r);s instanceof Promise?i.push(s.then(e=>gu(e,n))):gu(s,n)}return i.length?Promise.all(i).then(()=>n):n}});function gu(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const _u=ki("$ZodEnum",(e,t)=>{cc.init(e,t);const n=Ti(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>Ki.has(typeof e)).map(e=>"string"==typeof e?Wi(e):e.toString()).join("|")})$`),e._zod.parse=(t,s)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),vu=ki("$ZodLiteral",(e,t)=>{if(cc.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?Wi(e):e?Wi(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),bu=ki("$ZodFile",(e,t)=>{cc.init(e,t),e._zod.parse=(t,n)=>{const r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}}),wu=ki("$ZodTransform",(e,t)=>{cc.init(e,t),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Oi(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(e=>(n.value=e,n));if(s instanceof Promise)throw new zi;return n.value=s,n}});function Su(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const xu=ki("$ZodOptional",(e,t)=>{cc.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Di(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Di(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ji(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Su(t,e.value)):Su(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Eu=ki("$ZodExactOptional",(e,t)=>{xu.init(e,t),Di(e._zod,"values",()=>t.innerType._zod.values),Di(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ku=ki("$ZodNullable",(e,t)=>{cc.init(e,t),Di(e._zod,"optin",()=>t.innerType._zod.optin),Di(e._zod,"optout",()=>t.innerType._zod.optout),Di(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ji(e.source)}|null)$`):void 0}),Di(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),zu=ki("$ZodDefault",(e,t)=>{cc.init(e,t),e._zod.optin="optional",Di(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Ou(e,t)):Ou(r,t)}});function Ou(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const $u=ki("$ZodPrefault",(e,t)=>{cc.init(e,t),e._zod.optin="optional",Di(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Iu=ki("$ZodNonOptional",(e,t)=>{cc.init(e,t),Di(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(t=>Tu(t,e)):Tu(s,e)}});function Tu(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Pu=ki("$ZodSuccess",(e,t)=>{cc.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new Oi("ZodSuccess");const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}}),Nu=ki("$ZodCatch",(e,t)=>{cc.init(e,t),Di(e._zod,"optin",()=>t.innerType._zod.optin),Di(e._zod,"optout",()=>t.innerType._zod.optout),Di(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ro(e,n,Ii()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ro(e,n,Ii()))},input:e.value}),e.issues=[]),e)}}),Ru=ki("$ZodNaN",(e,t)=>{cc.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),Au=ki("$ZodPipe",(e,t)=>{cc.init(e,t),Di(e._zod,"values",()=>t.in._zod.values),Di(e._zod,"optin",()=>t.in._zod.optin),Di(e._zod,"optout",()=>t.out._zod.optout),Di(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ju(e,t.in,n)):ju(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ju(e,t.out,n)):ju(r,t.out,n)}});function ju(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Cu=ki("$ZodCodec",(e,t)=>{cc.init(e,t),Di(e._zod,"values",()=>t.in._zod.values),Di(e._zod,"optin",()=>t.in._zod.optin),Di(e._zod,"optout",()=>t.out._zod.optout),Di(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Du(e,t,n)):Du(r,t,n)}{const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Du(e,t,n)):Du(r,t,n)}}});function Du(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){const r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Zu(e,r,t.out,n)):Zu(e,r,t.out,n)}{const r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Zu(e,r,t.in,n)):Zu(e,r,t.in,n)}}function Zu(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const Uu=ki("$ZodReadonly",(e,t)=>{cc.init(e,t),Di(e._zod,"propValues",()=>t.innerType._zod.propValues),Di(e._zod,"values",()=>t.innerType._zod.values),Di(e._zod,"optin",()=>t.innerType?._zod?.optin),Di(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Fu):Fu(r)}});function Fu(e){return e.value=Object.freeze(e.value),e}const Mu=ki("$ZodTemplateLiteral",(e,t)=>{cc.init(e,t);const n=[];for(const e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);const t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${e._zod.traits}`);const r=t.startsWith("^")?1:0,s=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(r,s))}else{if(null!==e&&!Bi.has(typeof e))throw new Error(`Invalid template literal part: ${e}`);n.push(Wi(`${e}`))}e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>"string"!=typeof n.value?(n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}),n):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),n)}),Lu=ki("$ZodFunction",(e,t)=>(cc.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw new Error("implement() must be called with a function");return function(...n){const r=e._def.input?po(e._def.input,n):n,s=Reflect.apply(t,this,r);return e._def.output?po(e._def.output,s):s}},e.implementAsync=t=>{if("function"!=typeof t)throw new Error("implementAsync() must be called with a function");return async function(...n){const r=e._def.input?await fo(e._def.input,n):n,s=await Reflect.apply(t,this,r);return e._def.output?await fo(e._def.output,s):s}},e._zod.parse=(t,n)=>{if("function"!=typeof t.value)return t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}),t;const r=e._def.output&&"promise"===e._def.output._zod.def.type;return t.value=r?e.implementAsync(t.value):e.implement(t.value),t},e.input=(...t)=>{const n=e.constructor;return Array.isArray(t[0])?new n({type:"function",input:new lu({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}):new n({type:"function",input:t[0],output:e._def.output})},e.output=t=>new(0,e.constructor)({type:"function",input:e._def.input,output:t}),e)),qu=ki("$ZodPromise",(e,t)=>{cc.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Ju=ki("$ZodLazy",(e,t)=>{cc.init(e,t),Di(e._zod,"innerType",()=>t.getter()),Di(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Di(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Di(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Di(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Qu=ki("$ZodCustom",(e,t)=>{Ca.init(e,t),cc.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(t=>Ku(t,n,r,e));Ku(s,n,r,e)}});function Ku(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(oo(e))}}var Bu;Symbol("ZodOutput"),Symbol("ZodInput");(Bu=globalThis).__zod_globalRegistry??(Bu.__zod_globalRegistry=new class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});const Wu=globalThis.__zod_globalRegistry;function Vu(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Hi(t)})}function Hu(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Hi(t)})}function Gu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Hi(t)})}function Yu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Hi(t)})}function Xu(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Hi(t)})}function ed(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Hi(t)})}function td(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Hi(t)})}function nd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Hi(t)})}function rd(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Hi(t)})}function sd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Hi(t)})}function id(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Hi(t)})}function od(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Hi(t)})}function ad(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Hi(t)})}function cd(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Hi(t)})}function ud(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Hi(t)})}function dd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Hi(t)})}function ld(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Hi(t)})}function pd(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Hi(t)})}function hd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Hi(t)})}function fd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Hi(t)})}function md(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Hi(t)})}function yd(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Hi(t)})}function gd(e,t){return new Za({check:"less_than",...Hi(t),value:e,inclusive:!1})}function _d(e,t){return new Za({check:"less_than",...Hi(t),value:e,inclusive:!0})}function vd(e,t){return new Ua({check:"greater_than",...Hi(t),value:e,inclusive:!1})}function bd(e,t){return new Ua({check:"greater_than",...Hi(t),value:e,inclusive:!0})}function wd(e){return vd(0,e)}function Sd(e){return gd(0,e)}function xd(e){return _d(0,e)}function Ed(e){return bd(0,e)}function kd(e,t){return new Fa({check:"multiple_of",...Hi(t),value:e})}function zd(e,t){return new qa({check:"max_size",...Hi(t),maximum:e})}function Od(e,t){return new Ja({check:"min_size",...Hi(t),minimum:e})}function $d(e,t){return new Qa({check:"size_equals",...Hi(t),size:e})}function Id(e,t){return new Ka({check:"max_length",...Hi(t),maximum:e})}function Td(e,t){return new Ba({check:"min_length",...Hi(t),minimum:e})}function Pd(e,t){return new Wa({check:"length_equals",...Hi(t),length:e})}function Nd(e,t){return new Ha({check:"string_format",format:"regex",...Hi(t),pattern:e})}function Rd(e){return new Ga({check:"string_format",format:"lowercase",...Hi(e)})}function Ad(e){return new Ya({check:"string_format",format:"uppercase",...Hi(e)})}function jd(e,t){return new Xa({check:"string_format",format:"includes",...Hi(t),includes:e})}function Cd(e,t){return new ec({check:"string_format",format:"starts_with",...Hi(t),prefix:e})}function Dd(e,t){return new tc({check:"string_format",format:"ends_with",...Hi(t),suffix:e})}function Zd(e,t,n){return new rc({check:"property",property:e,schema:t,...Hi(n)})}function Ud(e,t){return new sc({check:"mime_type",mime:e,...Hi(t)})}function Fd(e){return new ic({check:"overwrite",tx:e})}function Md(e){return Fd(t=>t.normalize(e))}function Ld(){return Fd(e=>e.trim())}function qd(){return Fd(e=>e.toLowerCase())}function Jd(){return Fd(e=>e.toUpperCase())}function Qd(){return Fd(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))}function Kd(e,t,n,r={}){const s=Hi(r),i={...Hi(r),check:"string_format",type:"string",format:t,fn:"function"==typeof n?n:e=>n.test(e),...s};return n instanceof RegExp&&(i.pattern=n),new e(i)}function Bd(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Wu,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Wd(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{const n=o.schema,i=t.processors[s.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(o.ref||(o.ref=i),Wd(i,t,r),t.seen.get(i).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),"input"===t.io&&Gd(e)&&(delete o.schema.examples,delete o.schema.default),"input"===t.io&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Vd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}const s=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:s,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,s=e.external.uri??(e=>e);if(n)return{ref:s(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${s("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const s=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:s+i}})(t);r.def={...r.schema},i&&(r.defId=i);const o=r.schema;for(const e in o)delete o[e];o.$ref=s};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const r=n[1];if(t===n[0]){s(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){s(n);continue}}const i=e.metadataRegistry.get(n[0])?.id;(i||r.cycle||r.count>1&&"ref"===e.reused)&&s(n)}}function Hd(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const s=n.def??n.schema,i={...s},o=n.ref;if(n.ref=null,o){r(o);const n=e.seen.get(o),a=n.schema;if(!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(s,a):(s.allOf=s.allOf??[],s.allOf.push(a)),Object.assign(s,i),t._zod.parent===o)for(const e in s)"$ref"!==e&&"allOf"!==e&&(e in i||delete s[e]);if(a.$ref&&n.def)for(const e in s)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(s[e])===JSON.stringify(n.def[e])&&delete s[e]}const a=t._zod.parent;if(a&&a!==o){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(s.$ref=t.schema.$ref,t.def))for(const e in s)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(s[e])===JSON.stringify(t.def[e])&&delete s[e]}e.override({zodSchema:t,jsonSchema:s,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const s={};if("draft-2020-12"===e.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?s.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(n)}Object.assign(s,n.def??n.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?s.$defs=i:s.definitions=i);try{const n=JSON.parse(JSON.stringify(s));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Yd(t,"input",e.processors),output:Yd(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function Gd(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return Gd(r.element,n);if("set"===r.type)return Gd(r.valueType,n);if("lazy"===r.type)return Gd(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return Gd(r.innerType,n);if("intersection"===r.type)return Gd(r.left,n)||Gd(r.right,n);if("record"===r.type||"map"===r.type)return Gd(r.keyType,n)||Gd(r.valueType,n);if("pipe"===r.type)return Gd(r.in,n)||Gd(r.out,n);if("object"===r.type){for(const e in r.shape)if(Gd(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(Gd(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(Gd(e,n))return!0;return!(!r.rest||!Gd(r.rest,n))}return!1}const Yd=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=Bd({...s??{},target:i,io:t,processors:n});return Wd(e,o),Vd(o,e),Hd(o,e)},Xd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},el=(e,t,n,r)=>{const s=e._zod.def,i=!1===s.inclusive,o=s.options.map((e,n)=>Wd(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=o:n.anyOf=o},tl=(e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType},nl=ki("ZodISODateTime",(e,t)=>{Sc.init(e,t),$l.init(e,t)});function rl(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Hi(t)})}(nl,e)}const sl=ki("ZodISODate",(e,t)=>{xc.init(e,t),$l.init(e,t)});function il(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Hi(t)})}(sl,e)}const ol=ki("ZodISOTime",(e,t)=>{Ec.init(e,t),$l.init(e,t)});function al(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Hi(t)})}(ol,e)}const cl=ki("ZodISODuration",(e,t)=>{kc.init(e,t),$l.init(e,t)});function ul(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Hi(t)})}(cl,e)}const dl=(e,t)=>{co.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>r({issues:e}));else if("invalid_key"===s.code)r({issues:s.issues});else if("invalid_element"===s.code)r({issues:s.issues});else if(0===s.path.length)n._errors.push(t(s));else{let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Ni,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ni,2)}},isEmpty:{get:()=>0===e.issues.length}})},ll=(ki("ZodError",dl),ki("ZodError",dl,{Parent:Error})),pl=lo(ll),hl=ho(ll),fl=mo(ll),ml=go(ll),yl=vo(ll),gl=bo(ll),_l=wo(ll),vl=So(ll),bl=xo(ll),wl=Eo(ll),Sl=ko(ll),xl=zo(ll),El=ki("ZodType",(e,t)=>(cc.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Yd(e,"input"),output:Yd(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=Bd({...n,processors:t});return Wd(e,r),Vd(r,e),Hd(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ui(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Vi(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>pl(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>fl(e,t,n),e.parseAsync=async(t,n)=>hl(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ml(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>yl(e,t,n),e.decode=(t,n)=>gl(e,t,n),e.encodeAsync=async(t,n)=>_l(e,t,n),e.decodeAsync=async(t,n)=>vl(e,t,n),e.safeEncode=(t,n)=>bl(e,t,n),e.safeDecode=(t,n)=>wl(e,t,n),e.safeEncodeAsync=async(t,n)=>Sl(e,t,n),e.safeDecodeAsync=async(t,n)=>xl(e,t,n),e.refine=(t,n)=>e.check(_f(t,n)),e.superRefine=t=>e.check(vf(t)),e.overwrite=t=>e.check(Fd(t)),e.optional=()=>Ch(e),e.exactOptional=()=>Zh(e),e.nullable=()=>Fh(e),e.nullish=()=>Ch(Fh(e)),e.nonoptional=t=>Bh(e,t),e.array=()=>nh(e),e.or=t=>uh([e,t]),e.and=t=>mh(e,t),e.transform=t=>tf(e,Ah(t)),e.default=t=>qh(e,t),e.prefault=t=>Qh(e,t),e.catch=t=>Gh(e,t),e.pipe=t=>tf(e,t),e.readonly=()=>of(e),e.describe=t=>{const n=e.clone();return Wu.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Wu.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Wu.get(e);const n=e.clone();return Wu.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),kl=ki("_ZodString",(e,t)=>{uc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:s,maximum:i,format:o,patterns:a,contentEncoding:c}=e._zod.bag;if("number"==typeof s&&(r.minLength=s),"number"==typeof i&&(r.maxLength=i),o&&(r.format=Xd[o]??o,""===r.format&&delete r.format,"time"===o&&delete r.format),c&&(r.contentEncoding=c),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Nd(...t)),e.includes=(...t)=>e.check(jd(...t)),e.startsWith=(...t)=>e.check(Cd(...t)),e.endsWith=(...t)=>e.check(Dd(...t)),e.min=(...t)=>e.check(Td(...t)),e.max=(...t)=>e.check(Id(...t)),e.length=(...t)=>e.check(Pd(...t)),e.nonempty=(...t)=>e.check(Td(1,...t)),e.lowercase=t=>e.check(Rd(t)),e.uppercase=t=>e.check(Ad(t)),e.trim=()=>e.check(Ld()),e.normalize=(...t)=>e.check(Md(...t)),e.toLowerCase=()=>e.check(qd()),e.toUpperCase=()=>e.check(Jd()),e.slugify=()=>e.check(Qd())}),zl=ki("ZodString",(e,t)=>{uc.init(e,t),kl.init(e,t),e.email=t=>e.check(Vu(Il,t)),e.url=t=>e.check(td(Zl,t)),e.jwt=t=>e.check(yd(gp,t)),e.emoji=t=>e.check(nd(Ml,t)),e.guid=t=>e.check(Hu(Pl,t)),e.uuid=t=>e.check(Gu(Rl,t)),e.uuidv4=t=>e.check(Yu(Rl,t)),e.uuidv6=t=>e.check(Xu(Rl,t)),e.uuidv7=t=>e.check(ed(Rl,t)),e.nanoid=t=>e.check(rd(ql,t)),e.guid=t=>e.check(Hu(Pl,t)),e.cuid=t=>e.check(sd(Ql,t)),e.cuid2=t=>e.check(id(Bl,t)),e.ulid=t=>e.check(od(Vl,t)),e.base64=t=>e.check(hd(lp,t)),e.base64url=t=>e.check(fd(hp,t)),e.xid=t=>e.check(ad(Gl,t)),e.ksuid=t=>e.check(cd(Xl,t)),e.ipv4=t=>e.check(ud(tp,t)),e.ipv6=t=>e.check(dd(ip,t)),e.cidrv4=t=>e.check(ld(ap,t)),e.cidrv6=t=>e.check(pd(up,t)),e.e164=t=>e.check(md(mp,t)),e.datetime=t=>e.check(rl(t)),e.date=t=>e.check(il(t)),e.time=t=>e.check(al(t)),e.duration=t=>e.check(ul(t))});function Ol(e){return function(e,t){return new e({type:"string",...Hi(t)})}(zl,e)}const $l=ki("ZodStringFormat",(e,t)=>{dc.init(e,t),kl.init(e,t)}),Il=ki("ZodEmail",(e,t)=>{hc.init(e,t),$l.init(e,t)});function Tl(e){return Vu(Il,e)}const Pl=ki("ZodGUID",(e,t)=>{lc.init(e,t),$l.init(e,t)});function Nl(e){return Hu(Pl,e)}const Rl=ki("ZodUUID",(e,t)=>{pc.init(e,t),$l.init(e,t)});function Al(e){return Gu(Rl,e)}function jl(e){return Yu(Rl,e)}function Cl(e){return Xu(Rl,e)}function Dl(e){return ed(Rl,e)}const Zl=ki("ZodURL",(e,t)=>{fc.init(e,t),$l.init(e,t)});function Ul(e){return td(Zl,e)}function Fl(e){return td(Zl,{protocol:/^https?$/,hostname:na,...Hi(e)})}const Ml=ki("ZodEmoji",(e,t)=>{mc.init(e,t),$l.init(e,t)});function Ll(e){return nd(Ml,e)}const ql=ki("ZodNanoID",(e,t)=>{yc.init(e,t),$l.init(e,t)});function Jl(e){return rd(ql,e)}const Ql=ki("ZodCUID",(e,t)=>{gc.init(e,t),$l.init(e,t)});function Kl(e){return sd(Ql,e)}const Bl=ki("ZodCUID2",(e,t)=>{_c.init(e,t),$l.init(e,t)});function Wl(e){return id(Bl,e)}const Vl=ki("ZodULID",(e,t)=>{vc.init(e,t),$l.init(e,t)});function Hl(e){return od(Vl,e)}const Gl=ki("ZodXID",(e,t)=>{bc.init(e,t),$l.init(e,t)});function Yl(e){return ad(Gl,e)}const Xl=ki("ZodKSUID",(e,t)=>{wc.init(e,t),$l.init(e,t)});function ep(e){return cd(Xl,e)}const tp=ki("ZodIPv4",(e,t)=>{zc.init(e,t),$l.init(e,t)});function np(e){return ud(tp,e)}const rp=ki("ZodMAC",(e,t)=>{$c.init(e,t),$l.init(e,t)});function sp(e){return function(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...Hi(t)})}(rp,e)}const ip=ki("ZodIPv6",(e,t)=>{Oc.init(e,t),$l.init(e,t)});function op(e){return dd(ip,e)}const ap=ki("ZodCIDRv4",(e,t)=>{Ic.init(e,t),$l.init(e,t)});function cp(e){return ld(ap,e)}const up=ki("ZodCIDRv6",(e,t)=>{Tc.init(e,t),$l.init(e,t)});function dp(e){return pd(up,e)}const lp=ki("ZodBase64",(e,t)=>{Nc.init(e,t),$l.init(e,t)});function pp(e){return hd(lp,e)}const hp=ki("ZodBase64URL",(e,t)=>{Rc.init(e,t),$l.init(e,t)});function fp(e){return fd(hp,e)}const mp=ki("ZodE164",(e,t)=>{Ac.init(e,t),$l.init(e,t)});function yp(e){return md(mp,e)}const gp=ki("ZodJWT",(e,t)=>{jc.init(e,t),$l.init(e,t)});function _p(e){return yd(gp,e)}const vp=ki("ZodCustomStringFormat",(e,t)=>{Cc.init(e,t),$l.init(e,t)});function bp(e,t,n={}){return Kd(vp,e,t,n)}function wp(e){return Kd(vp,"hostname",ta,e)}function Sp(e){return Kd(vp,"hex",_a,e)}function xp(e,n){const r=`${e}_${n?.enc??"hex"}`,s=t[r];if(!s)throw new Error(`Unrecognized hash format: ${r}`);return Kd(vp,r,s,n)}const Ep=ki("ZodNumber",(e,t)=>{Dc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:s,maximum:i,format:o,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u}=e._zod.bag;"string"==typeof o&&o.includes("int")?r.type="integer":r.type="number","number"==typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.minimum=u,r.exclusiveMinimum=!0):r.exclusiveMinimum=u),"number"==typeof s&&(r.minimum=s,"number"==typeof u&&"draft-04"!==t.target&&(u>=s?delete r.minimum:delete r.exclusiveMinimum)),"number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c),"number"==typeof i&&(r.maximum=i,"number"==typeof c&&"draft-04"!==t.target&&(c<=i?delete r.maximum:delete r.exclusiveMaximum)),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(vd(t,n)),e.gte=(t,n)=>e.check(bd(t,n)),e.min=(t,n)=>e.check(bd(t,n)),e.lt=(t,n)=>e.check(gd(t,n)),e.lte=(t,n)=>e.check(_d(t,n)),e.max=(t,n)=>e.check(_d(t,n)),e.int=t=>e.check(Op(t)),e.safe=t=>e.check(Op(t)),e.positive=t=>e.check(vd(0,t)),e.nonnegative=t=>e.check(bd(0,t)),e.negative=t=>e.check(gd(0,t)),e.nonpositive=t=>e.check(_d(0,t)),e.multipleOf=(t,n)=>e.check(kd(t,n)),e.step=(t,n)=>e.check(kd(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function kp(e){return function(e,t){return new e({type:"number",checks:[],...Hi(t)})}(Ep,e)}const zp=ki("ZodNumberFormat",(e,t)=>{Zc.init(e,t),Ep.init(e,t)});function Op(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Hi(t)})}(zp,e)}function $p(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...Hi(t)})}(zp,e)}function Ip(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...Hi(t)})}(zp,e)}function Tp(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...Hi(t)})}(zp,e)}function Pp(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...Hi(t)})}(zp,e)}const Np=ki("ZodBoolean",(e,t)=>{Uc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function Rp(e){return function(e,t){return new e({type:"boolean",...Hi(t)})}(Np,e)}const Ap=ki("ZodBigInt",(e,t)=>{Fc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema")})(0,e),e.gte=(t,n)=>e.check(bd(t,n)),e.min=(t,n)=>e.check(bd(t,n)),e.gt=(t,n)=>e.check(vd(t,n)),e.gte=(t,n)=>e.check(bd(t,n)),e.min=(t,n)=>e.check(bd(t,n)),e.lt=(t,n)=>e.check(gd(t,n)),e.lte=(t,n)=>e.check(_d(t,n)),e.max=(t,n)=>e.check(_d(t,n)),e.positive=t=>e.check(vd(BigInt(0),t)),e.negative=t=>e.check(gd(BigInt(0),t)),e.nonpositive=t=>e.check(_d(BigInt(0),t)),e.nonnegative=t=>e.check(bd(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(kd(t,n));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function jp(e){return function(e,t){return new e({type:"bigint",...Hi(t)})}(Ap,e)}const Cp=ki("ZodBigIntFormat",(e,t)=>{Mc.init(e,t),Ap.init(e,t)});function Dp(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Hi(t)})}(Cp,e)}function Zp(e){return function(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Hi(t)})}(Cp,e)}const Up=ki("ZodSymbol",(e,t)=>{Lc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema")})(0,e)});function Fp(e){return function(e,t){return new e({type:"symbol",...Hi(t)})}(Up,e)}const Mp=ki("ZodUndefined",(e,t)=>{qc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema")})(0,e)});function Lp(e){return function(e,t){return new e({type:"undefined",...Hi(t)})}(Mp,e)}const qp=ki("ZodNull",(e,t)=>{Jc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{"openapi-3.0"===t.target?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"})(0,e,t)});function Jp(e){return function(e,t){return new e({type:"null",...Hi(t)})}(qp,e)}const Qp=ki("ZodAny",(e,t)=>{Qc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Kp(){return new Qp({type:"any"})}const Bp=ki("ZodUnknown",(e,t)=>{Kc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Wp(){return new Bp({type:"unknown"})}const Vp=ki("ZodNever",(e,t)=>{Bc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function Hp(e){return function(e,t){return new e({type:"never",...Hi(t)})}(Vp,e)}const Gp=ki("ZodVoid",(e,t)=>{Wc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Void cannot be represented in JSON Schema")})(0,e)});function Yp(e){return function(e,t){return new e({type:"void",...Hi(t)})}(Gp,e)}const Xp=ki("ZodDate",(e,t)=>{Vc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Date cannot be represented in JSON Schema")})(0,e),e.min=(t,n)=>e.check(bd(t,n)),e.max=(t,n)=>e.check(_d(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function eh(e){return function(e,t){return new e({type:"date",...Hi(t)})}(Xp,e)}const th=ki("ZodArray",(e,t)=>{Gc.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;"number"==typeof o&&(s.minItems=o),"number"==typeof a&&(s.maxItems=a),s.type="array",s.items=Wd(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Td(t,n)),e.nonempty=t=>e.check(Td(1,t)),e.max=(t,n)=>e.check(Id(t,n)),e.length=(t,n)=>e.check(Pd(t,n)),e.unwrap=()=>e.element});function nh(e,t){return function(e,t,n){return new e({type:"array",element:t,...Hi(n)})}(th,e,t)}function rh(e){const t=e._zod.def.shape;return Oh(Object.keys(t))}const sh=ki("ZodObject",(e,t)=>{nu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const e in o)s.properties[e]=Wd(o[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));c.size>0&&(s.required=Array.from(c)),"never"===i.catchall?._zod.def.type?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=Wd(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(s.additionalProperties=!1)})(e,t,n,r),Di(e,"shape",()=>t.shape),e.keyof=()=>Oh(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Wp()}),e.loose=()=>e.clone({...e._zod.def,catchall:Wp()}),e.strict=()=>e.clone({...e._zod.def,catchall:Hp()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Ji(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Ui(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Zi(this,"shape",n),n}});return Vi(e,r)}(e,t),e.safeExtend=t=>function(e,t){if(!Ji(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ui(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Zi(this,"shape",n),n}});return Vi(e,n)}(e,t),e.merge=t=>function(e,t){const n=Ui(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Zi(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Vi(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Vi(e,Ui(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Zi(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Ui(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Zi(this,"shape",r),r},checks:[]});return Vi(e,s)}(e,t),e.partial=(...t)=>function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Ui(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)s[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Zi(this,"shape",s),s},checks:[]});return Vi(t,s)}(jh,e,t[0]),e.required=(...t)=>function(e,t,n){const r=Ui(t._zod.def,{get shape(){const r=t._zod.def.shape,s={...r};if(n)for(const t in n){if(!(t in s))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(s[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)s[t]=new e({type:"nonoptional",innerType:r[t]});return Zi(this,"shape",s),s}});return Vi(t,r)}(Kh,e,t[0])});function ih(e,t){const n={type:"object",shape:e??{},...Hi(t)};return new sh(n)}function oh(e,t){return new sh({type:"object",shape:e,catchall:Hp(),...Hi(t)})}function ah(e,t){return new sh({type:"object",shape:e,catchall:Wp(),...Hi(t)})}const ch=ki("ZodUnion",(e,t)=>{su.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,n,r),e.options=t.options});function uh(e,t){return new ch({type:"union",options:e,...Hi(t)})}const dh=ki("ZodXor",(e,t)=>{ch.init(e,t),ou.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,n,r),e.options=t.options});function lh(e,t){return new dh({type:"union",options:e,inclusive:!1,...Hi(t)})}const ph=ki("ZodDiscriminatedUnion",(e,t)=>{ch.init(e,t),au.init(e,t)});function hh(e,t,n){return new ph({type:"union",options:t,discriminator:e,...Hi(n)})}const fh=ki("ZodIntersection",(e,t)=>{cu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i=Wd(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=Wd(s.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,c=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=c})(e,t,n,r)});function mh(e,t){return new fh({type:"intersection",left:e,right:t})}const yh=ki("ZodTuple",(e,t)=>{lu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="array";const o="draft-2020-12"===t.target?"prefixItems":"items",a="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",c=i.items.map((e,n)=>Wd(e,t,{...r,path:[...r.path,o,n]})),u=i.rest?Wd(i.rest,t,{...r,path:[...r.path,a,..."openapi-3.0"===t.target?[i.items.length]:[]]}):null;"draft-2020-12"===t.target?(s.prefixItems=c,u&&(s.items=u)):"openapi-3.0"===t.target?(s.items={anyOf:c},u&&s.items.anyOf.push(u),s.minItems=c.length,u||(s.maxItems=c.length)):(s.items=c,u&&(s.additionalItems=u));const{minimum:d,maximum:l}=e._zod.bag;"number"==typeof d&&(s.minItems=d),"number"==typeof l&&(s.maxItems=l)})(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function gh(e,t,n){const r=t instanceof cc;return new yh({type:"tuple",items:e,rest:r?t:null,...Hi(r?n:t)})}const _h=ki("ZodRecord",(e,t)=>{hu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,a=o._zod.bag,c=a?.patterns;if("loose"===i.mode&&c&&c.size>0){const e=Wd(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const t of c)s.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(s.propertyNames=Wd(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=Wd(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=o._zod.values;if(u){const e=[...u].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(s.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function vh(e,t,n){return new _h({type:"record",keyType:e,valueType:t,...Hi(n)})}function bh(e,t,n){const r=Vi(e);return r._zod.values=void 0,new _h({type:"record",keyType:r,valueType:t,...Hi(n)})}function wh(e,t,n){return new _h({type:"record",keyType:e,valueType:t,mode:"loose",...Hi(n)})}const Sh=ki("ZodMap",(e,t)=>{fu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Map cannot be represented in JSON Schema")})(0,e),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(Od(...t)),e.nonempty=t=>e.check(Od(1,t)),e.max=(...t)=>e.check(zd(...t)),e.size=(...t)=>e.check($d(...t))});function xh(e,t,n){return new Sh({type:"map",keyType:e,valueType:t,...Hi(n)})}const Eh=ki("ZodSet",(e,t)=>{yu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Set cannot be represented in JSON Schema")})(0,e),e.min=(...t)=>e.check(Od(...t)),e.nonempty=t=>e.check(Od(1,t)),e.max=(...t)=>e.check(zd(...t)),e.size=(...t)=>e.check($d(...t))});function kh(e,t){return new Eh({type:"set",valueType:e,...Hi(t)})}const zh=ki("ZodEnum",(e,t)=>{_u.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=Ti(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const s={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);s[r]=t.entries[r]}return new zh({...t,checks:[],...Hi(r),entries:s})},e.exclude=(e,r)=>{const s={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete s[t]}return new zh({...t,checks:[],...Hi(r),entries:s})}});function Oh(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new zh({type:"enum",entries:n,...Hi(t)})}function $h(e,t){return new zh({type:"enum",entries:e,...Hi(t)})}const Ih=ki("ZodLiteral",(e,t)=>{vu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,s=[];for(const e of r.values)if(void 0===e){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(e))}else s.push(e);if(0===s.length);else if(1===s.length){const e=s[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else s.every(e=>"number"==typeof e)&&(n.type="number"),s.every(e=>"string"==typeof e)&&(n.type="string"),s.every(e=>"boolean"==typeof e)&&(n.type="boolean"),s.every(e=>null===e)&&(n.type="null"),n.enum=s})(e,t,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Th(e,t){return new Ih({type:"literal",values:Array.isArray(e)?e:[e],...Hi(t)})}const Ph=ki("ZodFile",(e,t)=>{bu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:o,mime:a}=e._zod.bag;void 0!==i&&(s.minLength=i),void 0!==o&&(s.maxLength=o),a?1===a.length?(s.contentMediaType=a[0],Object.assign(r,s)):(Object.assign(r,s),r.anyOf=a.map(e=>({contentMediaType:e}))):Object.assign(r,s)})(e,0,n),e.min=(t,n)=>e.check(Od(t,n)),e.max=(t,n)=>e.check(zd(t,n)),e.mime=(t,n)=>e.check(Ud(Array.isArray(t)?t:[t],n))});function Nh(e){return function(e,t){return new e({type:"file",...Hi(t)})}(Ph,e)}const Rh=ki("ZodTransform",(e,t)=>{wu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new Oi(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(oo(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(oo(t))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(e=>(n.value=e,n)):(n.value=s,n)}});function Ah(e){return new Rh({type:"transform",transform:e})}const jh=ki("ZodOptional",(e,t)=>{xu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tl(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Ch(e){return new jh({type:"optional",innerType:e})}const Dh=ki("ZodExactOptional",(e,t)=>{Eu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tl(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Zh(e){return new Dh({type:"optional",innerType:e})}const Uh=ki("ZodNullable",(e,t)=>{ku.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i=Wd(s.innerType,t,r),o=t.seen.get(e);"openapi-3.0"===t.target?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fh(e){return new Uh({type:"nullable",innerType:e})}function Mh(e){return Ch(Fh(e))}const Lh=ki("ZodDefault",(e,t)=>{zu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function qh(e,t){return new Lh({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():Qi(t)}})}const Jh=ki("ZodPrefault",(e,t)=>{$u.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qh(e,t){return new Jh({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():Qi(t)}})}const Kh=ki("ZodNonOptional",(e,t)=>{Iu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Bh(e,t){return new Kh({type:"nonoptional",innerType:e,...Hi(t)})}const Wh=ki("ZodSuccess",(e,t)=>{Pu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t),e.unwrap=()=>e._zod.def.innerType});function Vh(e){return new Wh({type:"success",innerType:e})}const Hh=ki("ZodCatch",(e,t)=>{Nu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;let i;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType;try{i=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Gh(e,t){return new Hh({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}const Yh=ki("ZodNaN",(e,t)=>{Ru.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema")})(0,e)});function Xh(e){return function(e,t){return new e({type:"nan",...Hi(t)})}(Yh,e)}const ef=ki("ZodPipe",(e,t)=>{Au.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def,i="input"===t.io?"transform"===s.in._zod.def.type?s.out:s.in:s.out;Wd(i,t,r),t.seen.get(e).ref=i})(e,t,0,r),e.in=t.in,e.out=t.out});function tf(e,t){return new ef({type:"pipe",in:e,out:t})}const nf=ki("ZodCodec",(e,t)=>{ef.init(e,t),Cu.init(e,t)});function rf(e,t,n){return new nf({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const sf=ki("ZodReadonly",(e,t)=>{Uu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function of(e){return new sf({type:"readonly",innerType:e})}const af=ki("ZodTemplateLiteral",(e,t)=>{Mu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=s.source})(e,0,n)});function cf(e,t){return new af({type:"template_literal",parts:e,...Hi(t)})}const uf=ki("ZodLazy",(e,t)=>{Ju.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.innerType;Wd(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.unwrap=()=>e._zod.def.getter()});function df(e){return new uf({type:"lazy",getter:e})}const lf=ki("ZodPromise",(e,t)=>{qu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const s=e._zod.def;Wd(s.innerType,t,r),t.seen.get(e).ref=s.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function pf(e){return new lf({type:"promise",innerType:e})}const hf=ki("ZodFunction",(e,t)=>{Lu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Function types cannot be represented in JSON Schema")})(0,e)});function ff(e){return new hf({type:"function",input:Array.isArray(e?.input)?gh(e?.input):e?.input??nh(Wp()),output:e?.output??Wp()})}const mf=ki("ZodCustom",(e,t)=>{Qu.init(e,t),El.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});function yf(e){const t=new Ca({check:"custom"});return t._zod.check=e,t}function gf(e,t){return function(e,t,n){const r=Hi(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}(mf,e??(()=>!0),t)}function _f(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Hi(n)})}(mf,e,t)}function vf(e){return function(e){const t=function(e){const t=new Ca({check:"custom",...Hi(void 0)});return t._zod.check=e,t}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(oo(e,n.value,t._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(oo(r))}},e(n.value,n)));return t}(e)}const bf=function(e){const t=new Ca({check:"describe"});return t._zod.onattach=[t=>{const n=Wu.get(t)??{};Wu.add(t,{...n,description:e})}],t._zod.check=()=>{},t},wf=function(e){const t=new Ca({check:"meta"});return t._zod.onattach=[t=>{const n=Wu.get(t)??{};Wu.add(t,{...n,...e})}],t._zod.check=()=>{},t};function Sf(e,t={}){const n=new mf({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...Hi(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}const xf=(...e)=>function(e,t){const n=Hi(t);let r=n.truthy??["true","1","yes","on","y","enabled"],s=n.falsy??["false","0","no","off","n","disabled"];"sensitive"!==n.case&&(r=r.map(e=>"string"==typeof e?e.toLowerCase():e),s=s.map(e=>"string"==typeof e?e.toLowerCase():e));const i=new Set(r),o=new Set(s),a=e.Codec??Cu,c=e.Boolean??Uc,u=new a({type:"pipe",in:new(e.String??uc)({type:"string",error:n.error}),out:new c({type:"boolean",error:n.error}),transform:(e,t)=>{let r=e;return"sensitive"!==n.case&&(r=r.toLowerCase()),!!i.has(r)||!o.has(r)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...o],input:t.value,inst:u,continue:!1}),{})},reverseTransform:(e,t)=>!0===e?r[0]||"true":s[0]||"false",error:n.error});return u}({Codec:nf,Boolean:Np,String:zl},...e);function Ef(e){const t=df(()=>uh([Ol(e),kp(),Rp(),Jp(),nh(t),vh(Ol(),t)]));return t}function kf(e,t){return tf(Ah(e),t)}var zf;function Of(e){if("KW"!==e.country)throw new Error("The shipping address is not in Kuwait. Only Kuwaiti shipping addresses are supported.")}function $f(e,t){const n=e[t];return Of(n),{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:n.city,province:n.state.length>0?n.state:null,address_line_1:n.address_1,address_line_2:n.address_2.length>0?n.address_2:null},name:Rf(e)}}function If(e,t){const n=e[t];return Of(n),{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:[n.state,n.city].filter(e=>e.length>0).join(" --- "),province:null,address_line_1:n.address_1,address_line_2:n.address_2.length>0?n.address_2:null},name:Rf(e)}}function Tf(e,t){const n=e[t];Of(n);const r=Nf(e,"_billing_piece")??"",s=Nf(e,"_billing_name"),i=`BLOCK_FIELD: ${r} --- STREET_FIELD: ${n.postcode} --- HOUSE_FIELD: ${n.address_1} --- FLOOR_APT_FIELD: ${n.address_2}`;return{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:n.city,province:n.state.length>0?n.state:null,address_line_1:i,address_line_2:null},name:"string"==typeof s&&s.length>0?s:Rf(e)}}function Pf(e,t){const n=Nf(e,"governorate")??"",r=["area1","area2","area3","area4","area5","area6"].map(t=>Nf(e,t)??"").filter(e=>e.length>0),s=Nf(e,"block")??"",i=Nf(e,"street")??"",o=Nf(e,"house")??"";return{destination:{kind:"UNSTRUCTURED",country:"Kuwait",city:r.join(" --- "),province:n.length>0?n:null,address_line_1:`BLOCK_FIELD: ${s} --- STREET_FIELD: ${i} --- HOUSE_FIELD: ${o}`,address_line_2:null},name:Rf(e)}}function Nf(e,t){const n=e.meta_data.find(e=>e.key===t);return n&&"string"==typeof n.value?n.value:null}function Rf(e){const t=Af(e.shipping.first_name,e.shipping.last_name);if(t.length>0)return t;const n=Af(e.billing.first_name,e.billing.last_name);return n.length>0?n:(console.warn(`Order ${e.id} is missing customer name in both shipping address and billing address.`),"")}function Af(e,t){const n=e.trim(),r=t.trim();return 0===n.length?"":r.length>0?`${n} ${r}`:n}zf||(zf={}),new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]),Ii({localeError:(()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(t){return e[t]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return e=>{switch(e.code){case"invalid_type":{const t=r[e.expected]??e.expected,n=function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(null===e)return"null";if(Array.isArray(e))return"array";const t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return t}(e.input);return`Invalid input: expected ${t}, received ${r[n]??n}`}case"invalid_value":return 1===e.values.length?`Invalid input: expected ${Gi(e.values[0])}`:`Invalid option: expected one of ${Pi(e.values,"|")}`;case"too_big":{const n=e.inclusive?"<=":"<",r=t(e.origin);return r?`Too big: expected ${e.origin??"value"} to have ${n}${e.maximum.toString()} ${r.unit??"elements"}`:`Too big: expected ${e.origin??"value"} to be ${n}${e.maximum.toString()}`}case"too_small":{const n=e.inclusive?">=":">",r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case"invalid_format":{const t=e;return"starts_with"===t.format?`Invalid string: must start with "${t.prefix}"`:"ends_with"===t.format?`Invalid string: must end with "${t.suffix}"`:"includes"===t.format?`Invalid string: must include "${t.includes}"`:"regex"===t.format?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${Pi(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`}}})()});const jf=ih({id:kp(),order_key:Ol(),billing:ih({first_name:Ol(),last_name:Ol(),address_1:Ol(),address_2:Ol(),city:Ol(),state:Ol(),postcode:Ol(),country:Ol(),email:uh([Tl().trim(),Th("").transform(e=>e||null)]),phone:Ol()}),shipping:ih({first_name:Ol(),last_name:Ol(),company:Ol(),address_1:Ol(),address_2:Ol(),city:Ol(),state:Ol(),postcode:Ol(),country:Ol(),phone:Ol()}),meta_data:nh(ih({key:Ol(),value:Wp()})).default([])}),Cf=window.WORDPRESS_SITE_URL;xi("string"==typeof Cf&&Cf.length>0,"WORDPRESS_SITE_URL is not defined");const Df=new URL(Cf).hostname,Zf=window.JAAK_WORDPRESS_REST_ROOT;xi("string"==typeof Zf&&Zf.length>0,"JAAK_WORDPRESS_REST_ROOT is not defined");const Uf=window.JAAK_SITE_BASE_URL;xi("string"==typeof Uf&&Uf.length>0,"SITE_BASE_URL is not defined");const Ff=function(e,t){const n=function(e,t){if("string"!=typeof e||0===e.length)throw new Error(`${t} is missing or not a string.`);try{new URL(e)}catch{throw new Error(`${t} is not a valid URL: ${e}`)}return e}(e,"API_ROOT_URL");return Si(n,t).api}(Zf,{headers:{"X-WP-Nonce":"string"==typeof window.wp_api_settings?.nonce?window.wp_api_settings.nonce:""}});function Mf(){return(0,X.jsx)("div",{className:"inline-block h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600"})}function Lf({on_click:e,children:t,disabled:n=!1,loading:r=!1,variant:s="primary"}){return(0,X.jsxs)("button",{onClick:e,disabled:n||r,className:`px-4 py-2 rounded font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center gap-2 ${{primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-200 text-gray-800 hover:bg-gray-300"}[s]}`,type:"button",children:[r&&(0,X.jsx)(Mf,{}),t]})}function qf(){const e=`${window.WORDPRESS_SITE_URL}/wp-admin/admin.php?page=wc-settings&tab=integration&section=jaak`;return(0,X.jsxs)("div",{className:"rounded border border-yellow-200 bg-yellow-50 px-4 py-3 text-yellow-800",children:[(0,X.jsxs)("p",{className:"text-sm",children:[(0,X.jsx)("strong",{children:"Configuration Required:"})," ","Jaak plugin is not configured. Please add your API key in the plugin settings to use this feature."]}),(0,X.jsx)("p",{className:"mt-2 text-sm",children:(0,X.jsx)("a",{href:e,className:"font-medium text-yellow-900 underline hover:text-yellow-700",children:"Go to Settings →"})})]})}function Jf({error:e}){return e instanceof Ei&&"unauthorized"===e.type?(0,X.jsxs)("div",{className:"rounded border border-yellow-200 bg-yellow-50 px-4 py-3 text-yellow-800",children:[(0,X.jsx)("p",{className:"text-sm font-semibold",children:e.title}),"string"==typeof e.detail&&e.detail.length>0&&(0,X.jsx)("p",{className:"mt-1 text-sm",children:e.detail})]}):e instanceof Ei?(0,X.jsxs)("div",{className:"rounded border border-red-200 bg-red-50 px-4 py-3 text-red-800",children:[(0,X.jsx)("p",{className:"text-sm font-semibold",children:e.title}),"string"==typeof e.detail&&e.detail.length>0&&(0,X.jsxs)("details",{className:"mt-2",children:[(0,X.jsx)("summary",{className:"cursor-pointer text-xs",children:"Show error details"}),(0,X.jsx)("pre",{className:"mt-1 overflow-x-auto whitespace-pre-wrap text-xs",children:e.detail})]})]}):(0,X.jsx)("div",{className:"rounded border border-red-200 bg-red-50 px-4 py-3 text-red-800",children:(0,X.jsxs)("p",{className:"text-sm",children:[e.name,": ",e.message]})})}const Qf={PAUSED:"Waiting for merchant to accept shipping rate.",PENDING:"Driver is being assigned. Driver not assigned yet.",PICKUP:"Driver is assigned and moving towards the pickup.",DROPOFF:"Driver is moving towards the dropoff.",DELIVERED:"Driver has completed the delivery.",CANCELLED:"Delivery has been cancelled.",RETURN:"Driver is returning to the merchant.",RETURN_COMPLETE:"Driver has completed the return."},Kf={PAUSED:"bg-blue-100 text-blue-800",PENDING:"bg-blue-100 text-blue-800",PICKUP:"bg-green-100 text-green-800",DROPOFF:"bg-green-100 text-green-800",DELIVERED:"bg-green-100 text-green-800",CANCELLED:"bg-red-100 text-red-800",RETURN:"bg-red-100 text-red-800",RETURN_COMPLETE:"bg-red-100 text-red-800"},Bf={PAUSED:"bg-blue-100 text-blue-800",PENDING:"bg-blue-100 text-blue-800",PICKUP:"bg-blue-100 text-blue-800",DROPOFF:"bg-green-100 text-green-800",DELIVERED:"bg-green-100 text-green-800",CANCELLED:"bg-red-100 text-red-800",RETURN:"bg-red-100 text-red-800",RETURN_COMPLETE:"bg-red-100 text-red-800"},Wf={PAUSED:"bg-blue-100 text-blue-800",PENDING:"bg-blue-100 text-blue-800",PICKUP:"bg-blue-100 text-blue-800",DROPOFF:"bg-blue-100 text-blue-800",DELIVERED:"bg-green-100 text-green-800",CANCELLED:"bg-red-100 text-red-800",RETURN:"bg-red-100 text-red-800",RETURN_COMPLETE:"bg-red-100 text-red-800"},Vf={month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0};function Hf({task:e}){const t=e.status,n=e.stops.find(e=>"PICKUP"===e.kind)?.finalized_at,r=e.stops.find(e=>"DROPOFF"===e.kind)?.finalized_at,s=`${Uf}/tasks/${e.id}`;return(0,X.jsxs)("div",{className:"space-y-4",children:[(0,X.jsx)("div",{className:"flex justify-center pb-4",children:"PAUSED"!==e.status?(0,X.jsx)("a",{href:s,target:"_blank",className:"inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",rel:"noopener",children:"View Details"}):(0,X.jsx)("a",{href:`${Uf}/plan`,target:"_blank",rel:"noopener",className:"inline-flex items-center rounded-md border border-transparent bg-blue-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-blue-700 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"View Shipping Rate"})}),(0,X.jsxs)("div",{className:"flex items-start justify-around pb-4",children:[(0,X.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,X.jsx)("div",{className:"text-2xl",children:"👤"}),(0,X.jsx)("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${Kf[t]||"bg-gray-100 text-gray-800"}`,children:"1. Assign driver"}),(0,X.jsx)("div",{className:"h-5",children:" "})]}),(0,X.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,X.jsx)("div",{className:"text-2xl",children:"📦"}),(0,X.jsx)("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${Bf[t]||"bg-gray-100 text-gray-800"}`,children:"2. Pickup"}),(0,X.jsx)("div",{className:"h-5 text-xs font-light text-gray-500",children:"string"==typeof n?new Date(n).toLocaleString("en-US",Vf):" "})]}),(0,X.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,X.jsx)("div",{className:"text-2xl",children:"🚚"}),(0,X.jsx)("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${Wf[t]||"bg-gray-100 text-gray-800"}`,children:"3. Dropoff"}),(0,X.jsx)("div",{className:"h-5 text-xs font-light text-gray-500",children:"string"==typeof r?new Date(r).toLocaleString("en-US",Vf):" "})]})]}),(0,X.jsxs)("div",{className:"ps-6",children:[(0,X.jsxs)("span",{className:"text-sm font-normal italic text-gray-700",children:["Status: ",Qf[t]]})," ",(0,X.jsx)("a",{href:s,target:"_blank",className:"text-sm text-blue-600 underline hover:text-blue-800",rel:"noopener",children:"See task details."})]})]})}function Gf({order_id:e,order_key:t}){const n=te(),r=(s={queryKey:["tasks",t],queryFn:async()=>async function(e){console.debug(`Getting tasks for order keys: ${e.join(", ")}`);const t=await Ff.tasks.$get({query:{external_id:e}});if(401===t.status||403===t.status)throw new Ei({type:"unauthorized",title:"Authentication Failed",detail:"Please check your API key configuration."});if(400===t.status){const e=await t.json();throw console.error("Bad request response data:",e),new Ei({type:"bad_request",title:"Bad Request",detail:JSON.stringify(e,null,2)})}const n=(await t.json()).data;if(console.debug(`Got ${n.length} task(s)`),n[0])return n;if(0===n.length)return null;throw new Error("No tasks found")}([t]),refetchOnWindowFocus:!0},function(e,t,n){const r=Y.useContext(de),s=Y.useContext(ue),i=te(n),o=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const u=i.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,n=e=>"static"===e?e:Math.max(e??t,t),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>n(r(...e)):n(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(o),((e,t,n)=>{const r=n?.state.error&&"function"==typeof e.throwOnError?I(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))})(o,s,u),(e=>{Y.useEffect(()=>{e.clearReset()},[e])})(s);const d=!i.getQueryCache().get(o.queryHash),[l]=Y.useState(()=>new t(i,o)),p=l.getOptimisticResult(o),h=!r&&!1!==e.subscribed;if(Y.useSyncExternalStore(Y.useCallback(e=>{const t=h?l.subscribe(P.batchCalls(e)):c;return l.updateResult(),t},[l,h]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),Y.useEffect(()=>{l.setOptions(o)},[o,l]),((e,t)=>e?.suspense&&t.isPending)(o,p))throw le(o,l,s);if((({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&void 0===e.data||I(n,[e.error,r])))({result:p,errorResetBoundary:s,throwOnError:o.throwOnError,query:u,suspense:o.suspense}))throw p.error;if(i.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!a&&((e,t)=>e.isLoading&&e.isFetching&&!t)(p,r)){const e=d?le(o,l,s):u?.promise;e?.catch(c).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?p:l.trackResult(p)}(s,se,void 0));var s;const i=function(e){const t=te(void 0),[n]=Y.useState(()=>new pe(t,e));Y.useEffect(()=>{n.setOptions(e)},[n,e]);const r=Y.useSyncExternalStore(Y.useCallback(e=>n.subscribe(P.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=Y.useCallback((e,t)=>{n.mutate(e,t).catch(c)},[n]);if(r.error&&I(n.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:s,mutateAsync:r.mutate}}({mutationFn:async()=>async function(e){console.debug(`Creating tasks for order IDs: ${e.join(", ")}`);const t=await async function(e){console.debug(`Fetching WooCommerce orders: ${e.join(", ")}`);const t=`${Zf}/orders`,n=window.wp_api_settings?.nonce;xi("string"==typeof n&&n.length>0,"WP Nonce is not defined");const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":n},credentials:"include",body:JSON.stringify({order_ids:e})});if(!r.ok)throw new Ei({type:"api_error",title:"Failed to fetch orders from WordPress",detail:`${r.status} ${r.statusText}`});const s=await r.json();Wr({level:"debug",message:"[jaak-for-woocommerce] Raw order data from WordPress REST API",extra:{requested_order_ids:e,raw_response:s}});const i=nh(jf).parse(s);return console.debug(`Fetched ${i.length} order(s)`),i}(e);console.debug(`Submitting tasks for ${t.length} order(s)`);const n=t.map(e=>function(e){const t=e.shipping.address_1.length>0?"shipping":"billing",n=!0===window.JAAK_IS_FORCE_DEFAULT_ADDRESS_PARSER,{parser:r,parser_name:s}=function(e,t={}){if(!0===t.force_default_address_parser)return{parser:$f,parser_name:"default_parser"};const n=e.toLowerCase();return n.endsWith("eitkw.com")?{parser:If,parser_name:"eit_parser"}:n.endsWith("gbc-kwt.com")?{parser:Tf,parser_name:"gbc_parser"}:n.endsWith("somedaykw.com")?{parser:Pf,parser_name:"someday_parser"}:{parser:$f,parser_name:"default_parser"}}(Df,{force_default_address_parser:n}),i=r(e,t);return function(e,t){Wr({level:"debug",message:"[jaak-for-woocommerce] Order fields parsed",extra:{order_id:e.id,parser_name:t.parser_name,is_force_default_address_parser:t.is_force_default_address_parser,source_address_key:t.source_address_key,parsed_destination:t.parsed_order.destination,parsed_name:t.parsed_order.name}})}(e,{parser_name:s,source_address_key:t,parsed_order:i,is_force_default_address_parser:n}),{external_id:e.order_key,external_ref:e.id.toString(),external_url:`${Cf}/wp-admin/post.php?post=${e.id}&action=edit`,woocommerce_shop_domain:Cf,destination:i.destination,email:e.billing.email,phone:e.shipping.phone||e.billing.phone,name:i.name}}(e)),r=await Ff.tasks.$post({json:n});if(401===r.status||403===r.status)throw new Ei({type:"unauthorized",title:"Authentication Failed",detail:"Please check your API key configuration."});if(!r.ok){let e="Failed to create tasks";try{const t=await r.json();e=JSON.stringify(t,null,2)}catch(e){console.error("Failed to parse error response:",e)}throw new Ei({type:"bad_request",title:"Failed to create tasks",detail:e})}}([e]),onSuccess:async()=>{await n.invalidateQueries({queryKey:["tasks",t]})}});if(!0!==window.JAAK_IS_CONFIGURED)return(0,X.jsx)("div",{className:"space-y-3",children:(0,X.jsx)(qf,{})});const o=r.data;return r.isPending?(0,X.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:[(0,X.jsx)(Mf,{}),(0,X.jsx)("span",{className:"text-gray-600",children:"Loading"})]}):(0,X.jsxs)("div",{className:"space-y-3",children:[r.isError&&(0,X.jsx)(Jf,{error:r.error}),i.isError&&(0,X.jsx)(Jf,{error:i.error}),o?.map(e=>(0,X.jsx)("div",{className:"pb-4",children:(0,X.jsx)(Hf,{task:e})},e.id)),(!o||o.length<1)&&(0,X.jsx)("div",{className:"flex justify-center",children:(0,X.jsx)(Lf,{on_click:()=>i.mutate(),loading:i.isPending,disabled:i.isPending,children:"Send to Jaak"})}),(0,X.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,X.jsxs)(Lf,{on_click:async()=>r.refetch(),disabled:r.isFetching,variant:"secondary",children:["Updated: ",new Date(r.dataUpdatedAt).toLocaleTimeString("en-US",{hour:"numeric",minute:"numeric",second:"numeric",hour12:!0})]})}),o&&o.length>=1&&(0,X.jsx)("div",{className:"flex items-center justify-end gap-2",children:(0,X.jsx)(Lf,{on_click:()=>i.mutate(),disabled:i.isPending,variant:"secondary",children:"Send order to Jaak (again)"})})]})}const Yf=new class{#W;#g;#p;#V;#H;#G;#Y;#X;constructor(e={}){this.#W=e.queryCache||new Q,this.#g=e.mutationCache||new B,this.#p=e.defaultOptions||{},this.#V=new Map,this.#H=new Map,this.#G=0}mount(){this.#G++,1===this.#G&&(this.#Y=R.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#W.onFocus())}),this.#X=A.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#W.onOnline())}))}unmount(){this.#G--,0===this.#G&&(this.#Y?.(),this.#Y=void 0,this.#X?.(),this.#X=void 0)}isFetching(e){return this.#W.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#g.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#W.build(this,t),r=n.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(l(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#W.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#W.get(r.queryHash),i=s?.state.data,o=function(e,t){return"function"==typeof e?e(t):e}(t,i);if(void 0!==o)return this.#W.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return P.batch(()=>this.#W.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state}removeQueries(e){const t=this.#W;P.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const n=this.#W;return P.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=P.batch(()=>this.#W.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(c).catch(c)}invalidateQueries(e,t={}){return P.batch(()=>(this.#W.findAll(e).forEach(e=>{e.invalidate()}),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=P.batch(()=>this.#W.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(c)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(r).then(c)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const n=this.#W.build(this,t);return n.isStaleByTime(l(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(c).catch(c)}fetchInfiniteQuery(e){return e.behavior=V(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(c).catch(c)}ensureInfiniteQueryData(e){return e.behavior=V(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return A.isOnline()?this.#g.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#W}getMutationCache(){return this.#g}getDefaultOptions(){return this.#p}setDefaultOptions(e){this.#p=e}setQueryDefaults(e,t){this.#V.set(y(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#V.values()],n={};return t.forEach(t=>{g(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#H.set(y(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#H.values()],n={};return t.forEach(t=>{g(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#p.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=m(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===O&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#p.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#W.clear(),this.#g.clear()}},Xf=document.getElementById("jaak-metabox-root");if(Xf){const e=Xf.getAttribute("data-order-id"),t=Xf.getAttribute("data-order-key");if("string"!=typeof e||"string"!=typeof t)throw new Error("Order ID and Order Key are required to render the Jaak Meta Box.");const n=Number.parseInt(e,10);(0,re.createRoot)(Xf).render((0,X.jsx)(ne,{client:Yf,children:(0,X.jsx)(Gf,{order_id:n,order_key:t})}))}})();
  • jaak-for-woocommerce/trunk/jaak-for-woocommerce.php

    r3657295 r3735564  
    44 * Plugin URI: https://jaaknow.com
    55 * Description: WooCommerce extension for Jaak
    6  * Version: 1.5.0
     6 * Version: 1.6.0
    77 * Developer: Jaak
    88 * Developer URI: https://jaaknow.com
    … …  
    2828
    2929// Plugin constants
    30 define( 'JAAK_VERSION', '1.5.0' );
     30define( 'JAAK_VERSION', '1.6.0' );
    3131define( 'JAAK_FILE', __FILE__ );
    3232define( 'JAAK_DIR', plugin_dir_path( __FILE__ ) );
  • jaak-for-woocommerce/trunk/readme.txt

    r3657295 r3735564  
    33Tags:                 woocommerce, shipping, delivery, logistics, jaak
    44Tested up to:         6.9
    5 Stable tag:           1.5.0
     5Stable tag:           1.6.0
    66Requires PHP:         7.4
    77Requires at least:    5.2
    … …  
    3030More info is available on the [Jaak](https://jaaknow.com/site/en/docs/#connect-woocommerce-store) website.
    3131
     32بالعربية: [كيف أربط متجر ووكومرس؟](https://jaaknow.com/site/ar/docs/#connect-woocommerce-store)
     33
    3234https://www.youtube.com/watch?v=6UFWRYm100s
    3335
    … …  
    4042
    4143== Changelog ==
     44
     45= 1.6.0 =
     46* Include plugin version in API requests.
    4247
    4348= 1.5.0 =
  • jaak-for-woocommerce/trunk/src/frontend/sentry.ts

    r3516589 r3735564  
    2323        normalizeDepth: 10,
    2424        normalizeMaxBreadth: 5000,
     25        integrations: [
     26                Sentry.extraErrorDataIntegration(),
     27        ],
    2528        initialScope: {
    2629                // `user` is omitted when there's no WP user (e.g. logged-out edge case)
  • jaak-for-woocommerce/trunk/src/php/API/Proxy_Controller.php

    r3485290 r3735564  
    156156                                'method'  => $method,
    157157                                'headers' => array(
    158                                         'Authorization' => 'Bearer ' . $this->config_service->get_jaak_api_key(),
    159                                         'Content-Type'  => 'application/json',
     158                                        'Authorization'       => 'Bearer ' . $this->config_service->get_jaak_api_key(),
     159                                        'Content-Type'        => 'application/json',
     160                                        'Jaak-Client-Name'    => 'jaak-for-woocommerce',
     161                                        'Jaak-Client-Version' => JAAK_VERSION,
    160162                                ),
    161163                                'body'    => $body,
  • jaak-for-woocommerce/trunk/src/php/Services/Jaak_Api_Service.php

    r3439879 r3735564  
    149149
    150150                return array(
    151                         'Authorization' => 'Bearer ' . $jaak_api_key,
    152                         'Content-Type'  => 'application/json',
     151                        'Authorization'       => 'Bearer ' . $jaak_api_key,
     152                        'Content-Type'        => 'application/json',
     153                        'Jaak-Client-Name'    => 'jaak-for-woocommerce',
     154                        'Jaak-Client-Version' => JAAK_VERSION,
    153155                );
    154156        }
Note: See TracChangeset for help on using the changeset viewer.