@roomstay/core 0.1.63-2 → 0.1.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},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={};let n,i,o,r,s;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>bo,AddGiftCardSchema:()=>vo,BaseGiftCardSchema:()=>go,DATE_FORMAT:()=>I,EAddonPricingType:()=>zo,EBookingFlow:()=>i,EBookingPaymentMethod:()=>o,EBookingStatus:()=>n,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>O,EGuaranteePolicyDepositMode:()=>w,EGuarantyPolicyPrepaymentType:()=>k,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,EPlanpayBookingStatus:()=>s,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>E,ERoomstayImageSize:()=>z,GuestProfile:()=>d,HttpMethod:()=>A,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>mo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>T,PurchaseGiftCardSchema:()=>_o,RefreshGiftCardTokenSchema:()=>yo,RegisterGiftCardAdminSchema:()=>Po,Reservation:()=>u,ReservedPackage:()=>N,RoundingType:()=>To,TotalCalculator:()=>Uo,calculateFeeAmount:()=>Io,calculateTotalForMemberBooking:()=>wo,getFeeOptionValidity:()=>Co,getFilteredBookingAddonFees:()=>Zo,getFilteredBookingFees:()=>xo,getFilteredBookingRateFees:()=>So,maxString:()=>ho,nameof:()=>Fo,preprocessDate:()=>co,preprocessNumber:()=>ao,requireEmail:()=>lo,requireFutureDate:()=>fo,requirePositiveAmount:()=>po,requireString:()=>uo,resizeRoomstayImageUrl:()=>jo,roundMoney:()=>No,subset:()=>Do,uppercaseString:()=>Lo,validateFormWithZod:()=>so}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(n||(n={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(i||(i={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(o||(o={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,w,k,E;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class T{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class N extends T{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(w||(w={})),function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(k||(k={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(E||(E={}));const I="DD/MM/YYYY";let A,O;function R(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(A||(A={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(O||(O={})),Object.freeze({status:"aborted"}),Symbol("zod_brand");class $ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class x extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const S={};function Z(e){return e&&Object.assign(S,e),S}const C=/^[cC][^\s-]{8,}$/,F=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,j=/^[0-9a-vA-V]{20}$/,U=/^[A-Za-z0-9]{27}$/,L=/^[a-zA-Z0-9_-]{21}$/,M=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,H=/^([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})$/,B=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)$/,G=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,V=/^(?:(?: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])$/,q=/^(([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})$/,Y=/^((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])$/,Q=/^(([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])$/,W=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,J=/^[A-Za-z0-9_-]*$/,K=/^(?=.{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])?)*\.?$/,X=/^\+(?:[0-9]){6,14}[0-9]$/,ee="(?:(?:\\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])))",te=new RegExp(`^${ee}$`);function ne(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+)?)?`}const ie=/^\d+$/,oe=/^-?\d+(?:\.\d+)?/i,re=/true|false/i,se=/^[^A-Z]*$/,ae=/^[^a-z]*$/;function ce(e,t){return"bigint"==typeof t?t.toString():t}function ue(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function de(e){return null==e}function le(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const pe=Symbol("evaluating");function fe(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==pe)return void 0===i&&(i=pe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function he(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function me(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ge(e){return JSON.stringify(e)}const ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ye=ue((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function Pe(e){if(!1===_e(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==_e(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ze(e){return Pe(e)?{...e}:e}const be=new Set(["string","number","symbol"]);function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ke(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Ee(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}new Set(["string","number","bigint","boolean","symbol","undefined"]);const Te={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]};function Ne(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 Ie(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ae(e){return"string"==typeof e?e:e?.message}function Oe(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ae(e.inst?._zod.def?.error?.(e))??Ae(t?.error?.(e))??Ae(n.customError?.(e))??Ae(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Re(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function $e(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const xe=R("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Se={number:"number",bigint:"bigint",object:"date"},Ze=R("$ZodCheckLessThan",((e,t)=>{xe.init(e,t);const n=Se[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ce=R("$ZodCheckGreaterThan",((e,t)=>{xe.init(e,t);const n=Se[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Fe=R("$ZodCheckMultipleOf",((e,t)=>{xe.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,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(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})}})),De=R("$ZodCheckNumberFormat",((e,t)=>{xe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Te[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=ie)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),je=R("$ZodCheckMaxLength",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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 i=n.value;if(i.length<=t.maximum)return;const o=Re(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ue=R("$ZodCheckMinLength",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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 i=n.value;if(i.length>=t.minimum)return;const o=Re(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Le=R("$ZodCheckLengthEquals",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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 i=n.value,o=i.length;if(o===t.length)return;const r=Re(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Me=R("$ZodCheckStringFormat",((e,t)=>{var n,i;xe.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})}):(i=e._zod).check??(i.check=()=>{})})),He=R("$ZodCheckRegex",((e,t)=>{Me.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})}})),Be=R("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=se),Me.init(e,t)})),Ge=R("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ae),Me.init(e,t)})),Ve=R("$ZodCheckIncludes",((e,t)=>{xe.init(e,t);const n=we(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),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})}})),qe=R("$ZodCheckStartsWith",((e,t)=>{xe.init(e,t);const n=new RegExp(`^${we(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})}})),Ye=R("$ZodCheckEndsWith",((e,t)=>{xe.init(e,t);const n=new RegExp(`.*${we(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})}})),Qe=R("$ZodCheckOverwrite",((e,t)=>{xe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class We{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))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Je=(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,ce,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ke=R("$ZodError",Je),Xe=R("$ZodError",Je,{Parent:Error}),et=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new $;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Oe(e,r,Z()))));throw ve(t,o?.callee),t}return s.value},tt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Oe(e,r,Z()))));throw ve(t,o?.callee),t}return s.value},nt=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new $;return r.issues.length?{success:!1,error:new(e??Ke)(r.issues.map((e=>Oe(e,o,Z()))))}:{success:!0,data:r.value}},it=nt(Xe),ot=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>Oe(e,o,Z()))))}:{success:!0,data:r.value}},rt=ot(Xe),st=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return et(e)(t,n,o)},at=e=>(t,n,i)=>et(e)(t,n,i),ct=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ut=e=>async(t,n,i)=>tt(e)(t,n,i),dt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},lt=e=>(t,n,i)=>nt(e)(t,n,i),pt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ot(e)(t,n,o)},ft=e=>async(t,n,i)=>ot(e)(t,n,i),ht={major:4,minor:1,patch:5},mt=R("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ht;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ne(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new $;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ne(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ne(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ne(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new $;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new $;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=it(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return rt(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),gt=R("$ZodString",((e,t)=>{var n;mt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),vt=R("$ZodStringFormat",((e,t)=>{Me.init(e,t),gt.init(e,t)})),_t=R("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=H),vt.init(e,t)})),yt=R("$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=B(e))}else t.pattern??(t.pattern=B());vt.init(e,t)})),Pt=R("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=G),vt.init(e,t)})),zt=R("$ZodURL",((e,t)=>{vt.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:K.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),bt=R("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),vt.init(e,t)})),wt=R("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=L),vt.init(e,t)})),kt=R("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=C),vt.init(e,t)})),Et=R("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=F),vt.init(e,t)})),Tt=R("$ZodULID",((e,t)=>{t.pattern??(t.pattern=D),vt.init(e,t)})),Nt=R("$ZodXID",((e,t)=>{t.pattern??(t.pattern=j),vt.init(e,t)})),It=R("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=U),vt.init(e,t)})),At=R("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ne({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${ee}T(?:${i})$`)}(t)),vt.init(e,t)})),Ot=R("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=te),vt.init(e,t)})),Rt=R("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ne(t)}$`)),vt.init(e,t)})),$t=R("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=M),vt.init(e,t)})),xt=R("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=V),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),St=R("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=q),vt.init(e,t),e._zod.onattach.push((e=>{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})}}})),Zt=R("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=Y),vt.init(e,t)})),Ct=R("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=Q),vt.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function Ft(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Dt=R("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=W),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Ft(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),jt=R("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=J),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!J.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Ft(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})}})),Ut=R("$ZodE164",((e,t)=>{t.pattern??(t.pattern=X),vt.init(e,t)})),Lt=R("$ZodJWT",((e,t)=>{vt.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.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})}})),Mt=R("$ZodNumber",((e,t)=>{mt.init(e,t),e._zod.pattern=e._zod.bag.pattern??oe,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Ht=R("$ZodNumber",((e,t)=>{De.init(e,t),Mt.init(e,t)})),Bt=R("$ZodBoolean",((e,t)=>{mt.init(e,t),e._zod.pattern=re,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Gt=R("$ZodUnknown",((e,t)=>{mt.init(e,t),e._zod.parse=e=>e})),Vt=R("$ZodNever",((e,t)=>{mt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),qt=R("$ZodDate",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function Yt(e,t,n){e.issues.length&&t.issues.push(...Ie(n,e.issues)),t.value[n]=e.value}const Qt=R("$ZodArray",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>Yt(t,n,e)))):Yt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Wt(e,t,n,i){e.issues.length&&t.issues.push(...Ie(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Jt(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=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Kt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Wt(e,n,o,t)))):Wt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const Xt=R("$ZodObject",((e,t)=>{mt.init(e,t);const n=ue((()=>Jt(t)));fe(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=_e,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Wt(n,t,e,a)))):Wt(n,t,e,a)}return o?Kt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),en=R("$ZodObjectJIT",((e,t)=>{Xt.init(e,t);const n=e._zod.parse,i=ue((()=>Jt(t)));let o;const r=_e,s=!S.jitless,a=s&&ye.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new We(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ge(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ge(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\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=o(d,l),c?Kt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function tn(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ne(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Oe(e,i,Z())))))}),t)}const nn=R("$ZodUnion",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),fe(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),fe(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),fe(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=>le(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>tn(t,o,e,r))):tn(a,o,e,r)}})),on=R("$ZodIntersection",((e,t)=>{mt.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>sn(e,t,n))):sn(e,o,r)}}));function rn(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(Pe(e)&&Pe(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=rn(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=rn(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function sn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ne(e))return e;const i=rn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const an=R("$ZodEnum",((e,t)=>{mt.init(e,t);const n=function(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))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>be.has(typeof e))).map((e=>"string"==typeof e?we(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),cn=R("$ZodTransform",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new x(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new $;return n.value=o,n}}));function un(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const dn=R("$ZodOptional",((e,t)=>{mt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",fe(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>un(t,e.value))):un(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),ln=R("$ZodNullable",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)}|null)$`):void 0})),fe(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)})),pn=R("$ZodDefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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 i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>fn(e,t))):fn(i,t)}}));function fn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const hn=R("$ZodPrefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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))})),mn=R("$ZodNonOptional",((e,t)=>{mt.init(e,t),fe(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,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>gn(t,e))):gn(o,e)}}));function gn(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 vn=R("$ZodCatch",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Oe(e,n,Z())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Oe(e,n,Z())))},input:e.value}),e.issues=[]),e)}})),_n=R("$ZodPipe",((e,t)=>{mt.init(e,t),fe(e._zod,"values",(()=>t.in._zod.values)),fe(e._zod,"optin",(()=>t.in._zod.optin)),fe(e._zod,"optout",(()=>t.out._zod.optout)),fe(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.in,n))):yn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.out,n))):yn(i,t.out,n)}}));function yn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Pn=R("$ZodReadonly",((e,t)=>{mt.init(e,t),fe(e._zod,"propValues",(()=>t.innerType._zod.propValues)),fe(e._zod,"values",(()=>t.innerType._zod.values)),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(zn):zn(i)}}));function zn(e){return e.value=Object.freeze(e.value),e}const bn=R("$ZodCustom",((e,t)=>{xe.init(e,t),mt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>wn(t,n,i,e)));wn(o,n,i,e)}}));function wn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push($e(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class kn{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,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 i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function En(){return new kn}const Tn=En();function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(t)})}function In(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(t)})}function An(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(t)})}function On(e,t){return new Ze({check:"less_than",...Ee(t),value:e,inclusive:!1})}function Rn(e,t){return new Ze({check:"less_than",...Ee(t),value:e,inclusive:!0})}function $n(e,t){return new Ce({check:"greater_than",...Ee(t),value:e,inclusive:!1})}function xn(e,t){return new Ce({check:"greater_than",...Ee(t),value:e,inclusive:!0})}function Sn(e,t){return new Fe({check:"multiple_of",...Ee(t),value:e})}function Zn(e,t){return new je({check:"max_length",...Ee(t),maximum:e})}function Cn(e,t){return new Ue({check:"min_length",...Ee(t),minimum:e})}function Fn(e,t){return new Le({check:"length_equals",...Ee(t),length:e})}function Dn(e){return new Qe({check:"overwrite",tx:e})}const jn=R("ZodISODateTime",((e,t)=>{At.init(e,t),ai.init(e,t)}));const Un=R("ZodISODate",((e,t)=>{Ot.init(e,t),ai.init(e,t)}));const Ln=R("ZodISOTime",((e,t)=>{Rt.init(e,t),ai.init(e,t)}));const Mn=R("ZodISODuration",((e,t)=>{$t.init(e,t),ai.init(e,t)}));const Hn=(e,t)=>{Ke.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ce,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ce,2)}},isEmpty:{get:()=>0===e.issues.length}})},Bn=(R("ZodError",Hn),R("ZodError",Hn,{Parent:Error})),Gn=et(Bn),Vn=tt(Bn),qn=nt(Bn),Yn=ot(Bn),Qn=st(Bn),Wn=at(Bn),Jn=ct(Bn),Kn=ut(Bn),Xn=dt(Bn),ei=lt(Bn),ti=pt(Bn),ni=ft(Bn),ii=R("ZodType",((e,t)=>(mt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>ke(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Gn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>qn(e,t,n),e.parseAsync=async(t,n)=>Vn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Yn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Qn(e,t,n),e.decode=(t,n)=>Wn(e,t,n),e.encodeAsync=async(t,n)=>Jn(e,t,n),e.decodeAsync=async(t,n)=>Kn(e,t,n),e.safeEncode=(t,n)=>Xn(e,t,n),e.safeDecode=(t,n)=>ei(e,t,n),e.safeEncodeAsync=async(t,n)=>ti(e,t,n),e.safeDecodeAsync=async(t,n)=>ni(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ee(n)})}(oo,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new xe({check:"custom",...Ee(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push($e(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push($e(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Dn(t)),e.optional=()=>Yi(e),e.nullable=()=>Wi(e),e.nullish=()=>Yi(Wi(e)),e.nonoptional=t=>function(e,t){return new Xi({type:"nonoptional",innerType:e,...Ee(t)})}(e,t),e.array=()=>ji(e),e.or=t=>function(e,t){return new Mi({type:"union",options:e,...Ee(t)})}([e,t]),e.and=t=>new Hi({type:"intersection",left:e,right:t}),e.transform=t=>no(e,Vi(t)),e.default=t=>{return n=t,new Ji({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.prefault=t=>{return n=t,new Ki({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.catch=t=>{return new eo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>no(e,t),e.readonly=()=>new io({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Tn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Tn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Tn.get(e);const n=e.clone();return Tn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),oi=R("_ZodString",((e,t)=>{gt.init(e,t),ii.init(e,t);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(function(e,t){return new He({check:"string_format",format:"regex",...Ee(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ve({check:"string_format",format:"includes",...Ee(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"starts_with",...Ee(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"ends_with",...Ee(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Cn(...t)),e.max=(...t)=>e.check(Zn(...t)),e.length=(...t)=>e.check(Fn(...t)),e.nonempty=(...t)=>e.check(Cn(1,...t)),e.lowercase=t=>e.check(function(e){return new Be({check:"string_format",format:"lowercase",...Ee(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Ge({check:"string_format",format:"uppercase",...Ee(e)})}(t)),e.trim=()=>e.check(Dn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Dn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Dn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Dn((e=>e.toUpperCase())))})),ri=R("ZodString",((e,t)=>{gt.init(e,t),oi.init(e,t),e.email=t=>e.check(Nn(ci,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(t)})}(pi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(t)})}(Ni,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(t)})}(fi,t)),e.guid=t=>e.check(In(di,t)),e.uuid=t=>e.check(An(li,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(t)})}(li,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(t)})}(li,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(t)})}(li,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(t)})}(hi,t)),e.guid=t=>e.check(In(di,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(t)})}(mi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(t)})}(gi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(t)})}(vi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(t)})}(ki,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(t)})}(Ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(t)})}(_i,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(t)})}(yi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(t)})}(Pi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(t)})}(zi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(t)})}(bi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(t)})}(wi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(t)})}(Ti,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(t)})}(jn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ee(t)})}(Un,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ee(t)})}(Ln,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ee(t)})}(Mn,e)}(t))}));function si(e){return function(e,t){return new e({type:"string",...Ee(t)})}(ri,e)}const ai=R("ZodStringFormat",((e,t)=>{vt.init(e,t),oi.init(e,t)})),ci=R("ZodEmail",((e,t)=>{Pt.init(e,t),ai.init(e,t)}));function ui(e){return Nn(ci,e)}const di=R("ZodGUID",((e,t)=>{_t.init(e,t),ai.init(e,t)})),li=R("ZodUUID",((e,t)=>{yt.init(e,t),ai.init(e,t)})),pi=R("ZodURL",((e,t)=>{zt.init(e,t),ai.init(e,t)})),fi=R("ZodEmoji",((e,t)=>{bt.init(e,t),ai.init(e,t)})),hi=R("ZodNanoID",((e,t)=>{wt.init(e,t),ai.init(e,t)})),mi=R("ZodCUID",((e,t)=>{kt.init(e,t),ai.init(e,t)})),gi=R("ZodCUID2",((e,t)=>{Et.init(e,t),ai.init(e,t)})),vi=R("ZodULID",((e,t)=>{Tt.init(e,t),ai.init(e,t)})),_i=R("ZodXID",((e,t)=>{Nt.init(e,t),ai.init(e,t)})),yi=R("ZodKSUID",((e,t)=>{It.init(e,t),ai.init(e,t)})),Pi=R("ZodIPv4",((e,t)=>{xt.init(e,t),ai.init(e,t)})),zi=R("ZodIPv6",((e,t)=>{St.init(e,t),ai.init(e,t)})),bi=R("ZodCIDRv4",((e,t)=>{Zt.init(e,t),ai.init(e,t)})),wi=R("ZodCIDRv6",((e,t)=>{Ct.init(e,t),ai.init(e,t)})),ki=R("ZodBase64",((e,t)=>{Dt.init(e,t),ai.init(e,t)})),Ei=R("ZodBase64URL",((e,t)=>{jt.init(e,t),ai.init(e,t)})),Ti=R("ZodE164",((e,t)=>{Ut.init(e,t),ai.init(e,t)})),Ni=R("ZodJWT",((e,t)=>{Lt.init(e,t),ai.init(e,t)})),Ii=R("ZodNumber",((e,t)=>{Mt.init(e,t),ii.init(e,t),e.gt=(t,n)=>e.check($n(t,n)),e.gte=(t,n)=>e.check(xn(t,n)),e.min=(t,n)=>e.check(xn(t,n)),e.lt=(t,n)=>e.check(On(t,n)),e.lte=(t,n)=>e.check(Rn(t,n)),e.max=(t,n)=>e.check(Rn(t,n)),e.int=t=>e.check(Ri(t)),e.safe=t=>e.check(Ri(t)),e.positive=t=>e.check($n(0,t)),e.nonnegative=t=>e.check(xn(0,t)),e.negative=t=>e.check(On(0,t)),e.nonpositive=t=>e.check(Rn(0,t)),e.multipleOf=(t,n)=>e.check(Sn(t,n)),e.step=(t,n)=>e.check(Sn(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 Ai(e){return function(e,t){return new e({type:"number",checks:[],...Ee(t)})}(Ii,e)}const Oi=R("ZodNumberFormat",((e,t)=>{Ht.init(e,t),Ii.init(e,t)}));function Ri(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(t)})}(Oi,e)}const $i=R("ZodBoolean",((e,t)=>{Bt.init(e,t),ii.init(e,t)}));const xi=R("ZodUnknown",((e,t)=>{Gt.init(e,t),ii.init(e,t)}));function Si(){return new xi({type:"unknown"})}const Zi=R("ZodNever",((e,t)=>{Vt.init(e,t),ii.init(e,t)}));function Ci(e){return function(e,t){return new e({type:"never",...Ee(t)})}(Zi,e)}const Fi=R("ZodDate",((e,t)=>{qt.init(e,t),ii.init(e,t),e.min=(t,n)=>e.check(xn(t,n)),e.max=(t,n)=>e.check(Rn(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}));const Di=R("ZodArray",((e,t)=>{Qt.init(e,t),ii.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Cn(t,n)),e.nonempty=t=>e.check(Cn(1,t)),e.max=(t,n)=>e.check(Zn(t,n)),e.length=(t,n)=>e.check(Fn(t,n)),e.unwrap=()=>e.element}));function ji(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ee(n)})}(Di,e,t)}const Ui=R("ZodObject",((e,t)=>{en.init(e,t),ii.init(e,t),fe(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Bi({type:"enum",entries:n,...Ee(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Si()}),e.loose=()=>e.clone({...e._zod.def,catchall:Si()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ci()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Pe(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:[]});return ke(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!Pe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:e._zod.def.checks};return ke(e,n)}(e,t),e.merge=t=>function(e,t){const n=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return he(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ke(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return ke(e,me(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return he(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=me(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return he(this,"shape",i),i},checks:[]});return ke(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=me(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return he(this,"shape",o),o},checks:[]});return ke(t,i)}(qi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=me(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return he(this,"shape",o),o},checks:[]});return ke(t,i)}(Xi,e,t[0])}));function Li(e,t){const n={type:"object",get shape(){var t;return he(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Ee(t)};return new Ui(n)}const Mi=R("ZodUnion",((e,t)=>{nn.init(e,t),ii.init(e,t),e.options=t.options}));const Hi=R("ZodIntersection",((e,t)=>{on.init(e,t),ii.init(e,t)})),Bi=R("ZodEnum",((e,t)=>{an.init(e,t),ii.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Bi({...t,checks:[],...Ee(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Bi({...t,checks:[],...Ee(i),entries:o})}}));const Gi=R("ZodTransform",((e,t)=>{cn.init(e,t),ii.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new x(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push($e(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push($e(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Vi(e){return new Gi({type:"transform",transform:e})}const qi=R("ZodOptional",((e,t)=>{dn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Yi(e){return new qi({type:"optional",innerType:e})}const Qi=R("ZodNullable",((e,t)=>{ln.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Wi(e){return new Qi({type:"nullable",innerType:e})}const Ji=R("ZodDefault",((e,t)=>{pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Ki=R("ZodPrefault",((e,t)=>{hn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Xi=R("ZodNonOptional",((e,t)=>{mn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=R("ZodCatch",((e,t)=>{vn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),to=R("ZodPipe",((e,t)=>{_n.init(e,t),ii.init(e,t),e.in=t.in,e.out=t.out}));function no(e,t){return new to({type:"pipe",in:e,out:t})}const io=R("ZodReadonly",((e,t)=>{Pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),oo=R("ZodCustom",((e,t)=>{bn.init(e,t),ii.init(e,t)}));function ro(e,t){return no(Vi(e),t)}function so(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const ao=e=>ro((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),co=e=>ro((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setHours(0,0,0,0),t):e}),e),uo=e=>si().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),lo=()=>ui("Invalid email address").min(1,"Required"),po=()=>ao(Ai("Valid amount required").positive("Positive amount required")),fo=()=>co(function(e){return function(e,t){return new e({type:"date",...Ee(t)})}(Fi,e)}("Valid date required").min(new Date,"Date must be in the future")),ho=e=>si().max(e,`Maximum length is ${e} characters`),mo=Li({address1:uo(100),address2:ho(100).optional(),city:uo(50),state:ho(50).optional(),postcode:ho(20).optional(),country:uo(50)}),go=Li({amount:po(),message:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),giverAddress:mo,cardHolder:uo(101),recipientFirstName:ho(50).nullish(),recipientLastName:ho(50).nullish(),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()}),vo=go.extend({expiry:fo(),notes:ho(500).nullish()}),_o=go.extend({companyId:Ai().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Ee(t)})}($i,e)}().default(!0),payment:Li({cardHolder:uo(30),cardNumberToken:uo(50),cardExpiry:uo(5),cardCvcToken:uo(50)}).optional()}),yo=Li({grant_type:si().readonly().default("refresh_token"),client_id:An(li,undefined),client_secret:si(),refresh_token:si(),scope:si().optional()});const Po=Li({email:ui(),firstName:si().max(100).optional(),lastName:si().max(100).optional(),phone:si().max(20).optional(),scopes:ji(si()).optional()});let zo;!function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(zo||(zo={}));const bo=[zo.PER_NIGHT,zo.PER_PERSON_PER_NIGHT,zo.PER_QUANTITY_NAME_PER_NIGHT,zo.PER_ROOM_QUANTITY_PER_NIGHT,zo.PER_PERSON_OCCUPANCY_PER_NIGHT,zo.PER_ADULT_OCCUPANCY_PER_NIGHT,zo.PER_CHILD_OCCUPANCY_PER_NIGHT,zo.PER_ALL_PERSONS_PER_NIGHT],wo=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t},ko=require("decimal.js");var Eo=e.n(ko);const To={UP:Eo().ROUND_UP,DOWN:Eo().ROUND_DOWN,CEIL:Eo().ROUND_CEIL,FLOOR:Eo().ROUND_FLOOR,HALF_UP:Eo().ROUND_HALF_UP,HALF_DOWN:Eo().ROUND_HALF_DOWN,HALF_EVEN:Eo().ROUND_HALF_EVEN,HALF_CEIL:Eo().ROUND_HALF_CEIL,HALF_FLOOR:Eo().ROUND_HALF_FLOOR},No=(e,t)=>{const{precision:n=2,rounding:i=To.HALF_UP}=t||{};return new(Eo())(e).toDecimalPlaces(n,i).toNumber()};function Io(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=No(n);switch(e.feeType){case O.PercentageOfBooking:if(o)return No(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return No(a/(1-t)*e.amount/(100+e.amount))}return No(a*(e.amount/100));case O.FixedChargePerRoom:case O.FixedChargePerBooking:return e.amount;case O.NightlyChargePerRoom:return No(e.amount*i);default:return 0}}const Ao=[O.FixedChargePerBooking],Oo=[O.PercentageOfBooking,O.FixedChargePerRoom,O.NightlyChargePerRoom],Ro=[O.PercentageOfBooking];function $o(e,t){return e.filter((e=>t.includes(e.feeType)))}function xo(e){return $o(e,Ao)}function So(e){return $o(e,Oo)}function Zo(e){return $o(e,Ro)}function Co(e){return{includeInRates:[O.PercentageOfBooking,O.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===O.PercentageOfBooking,appliesToAddons:e===O.PercentageOfBooking,includePreviousFeesInCalculation:e===O.PercentageOfBooking}}const Fo=e=>e,Do=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},jo=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Uo{}function Lo(e){return e.toUpperCase()}Uo.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===zo.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===zo.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return bo.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Uo.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Uo.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),bo.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),Uo.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Uo.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Uo.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=Uo.calculateReservationAddonTotal(o,t)?.total}})),No(n)},module.exports=t})();
1
+ (()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},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={};let n,i,o,r,s;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>I,AddGiftCardSchema:()=>mo,BaseGiftCardSchema:()=>ho,DATE_FORMAT:()=>E,EAddonPricingType:()=>N,EBookingFlow:()=>i,EBookingPaymentMethod:()=>o,EBookingStatus:()=>n,ECompanyProvider:()=>l,EDistanceUnitType:()=>g,EFeeType:()=>T,EGuaranteePolicyDepositMode:()=>z,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,EPlanpayBookingStatus:()=>s,ERMSDiscountType:()=>_,ERoomstayEventSource:()=>b,ERoomstayImageSize:()=>y,GuestProfile:()=>d,HttpMethod:()=>P,IAuxiliaryFilterType:()=>v,InternationalAddressSchema:()=>fo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>k,PurchaseGiftCardSchema:()=>vo,RefreshGiftCardTokenSchema:()=>go,RegisterGiftCardAdminSchema:()=>_o,Reservation:()=>u,ReservedPackage:()=>w,TotalCalculator:()=>Co,calculateFeeAmount:()=>ko,calculateTotalForMemberBooking:()=>yo,getFeeOptionValidity:()=>Oo,getFilteredBookingAddonFees:()=>Ao,getFilteredBookingFees:()=>Io,getFilteredBookingRateFees:()=>$o,maxString:()=>po,nameof:()=>Zo,preprocessDate:()=>so,preprocessNumber:()=>ro,requireEmail:()=>co,requireFutureDate:()=>lo,requirePositiveAmount:()=>uo,requireString:()=>ao,resizeRoomstayImageUrl:()=>Ro,roundMoney:()=>Po,subset:()=>xo,uppercaseString:()=>So,validateFormWithZod:()=>oo}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(n||(n={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(i||(i={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(o||(o={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,v,g,_,y,z,b,P;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(v||(v={})),function(e){e.Metric="metric",e.Imperial="imperial"}(g||(g={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(y||(y={}));class k{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class w extends k{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(z||(z={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(b||(b={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(P||(P={}));const E="DD/MM/YYYY";let T,N;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(T||(T={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(N||(N={}));const I=[N.PER_NIGHT,N.PER_PERSON_PER_NIGHT,N.PER_QUANTITY_NAME_PER_NIGHT,N.PER_ROOM_QUANTITY_PER_NIGHT,N.PER_PERSON_OCCUPANCY_PER_NIGHT,N.PER_ADULT_OCCUPANCY_PER_NIGHT,N.PER_CHILD_OCCUPANCY_PER_NIGHT,N.PER_ALL_PERSONS_PER_NIGHT];function $(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class A extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class O extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Z={};function x(e){return e&&Object.assign(Z,e),Z}const R=/^[cC][^\s-]{8,}$/,C=/^[0-9a-z]+$/,S=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,F=/^[0-9a-vA-V]{20}$/,D=/^[A-Za-z0-9]{27}$/,j=/^[a-zA-Z0-9_-]{21}$/,U=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,M=/^([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})$/,B=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)$/,L=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,G=/^(?:(?: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])$/,H=/^(([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})$/,V=/^((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])$/,Y=/^(([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])$/,q=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Q=/^[A-Za-z0-9_-]*$/,W=/^(?=.{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])?)*\.?$/,J=/^\+(?:[0-9]){6,14}[0-9]$/,K="(?:(?:\\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])))",X=new RegExp(`^${K}$`);function ee(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+)?)?`}const te=/^\d+$/,ne=/^-?\d+(?:\.\d+)?/i,ie=/true|false/i,oe=/^[^A-Z]*$/,re=/^[^a-z]*$/;function se(e,t){return"bigint"==typeof t?t.toString():t}function ae(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ce(e){return null==e}function ue(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const de=Symbol("evaluating");function le(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==de)return void 0===i&&(i=de,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function pe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fe(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function he(e){return JSON.stringify(e)}const me="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ve(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ge=ae((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function _e(e){if(!1===ve(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==ve(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ye(e){return _e(e)?{...e}:e}const ze=new Set(["string","number","symbol"]);function be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pe(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function ke(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}new Set(["string","number","bigint","boolean","symbol","undefined"]);const we={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]};function Ee(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 Te(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ne(e){return"string"==typeof e?e:e?.message}function Ie(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ne(e.inst?._zod.def?.error?.(e))??Ne(t?.error?.(e))??Ne(n.customError?.(e))??Ne(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function $e(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Ae(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Oe=$("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Ze={number:"number",bigint:"bigint",object:"date"},xe=$("$ZodCheckLessThan",((e,t)=>{Oe.init(e,t);const n=Ze[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Re=$("$ZodCheckGreaterThan",((e,t)=>{Oe.init(e,t);const n=Ze[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ce=$("$ZodCheckMultipleOf",((e,t)=>{Oe.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,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(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})}})),Se=$("$ZodCheckNumberFormat",((e,t)=>{Oe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=we[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=te)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),Fe=$("$ZodCheckMaxLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ce(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 i=n.value;if(i.length<=t.maximum)return;const o=$e(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),De=$("$ZodCheckMinLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ce(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 i=n.value;if(i.length>=t.minimum)return;const o=$e(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),je=$("$ZodCheckLengthEquals",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ce(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 i=n.value,o=i.length;if(o===t.length)return;const r=$e(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Ue=$("$ZodCheckStringFormat",((e,t)=>{var n,i;Oe.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})}):(i=e._zod).check??(i.check=()=>{})})),Me=$("$ZodCheckRegex",((e,t)=>{Ue.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})}})),Be=$("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=oe),Ue.init(e,t)})),Le=$("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=re),Ue.init(e,t)})),Ge=$("$ZodCheckIncludes",((e,t)=>{Oe.init(e,t);const n=be(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),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})}})),He=$("$ZodCheckStartsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`^${be(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})}})),Ve=$("$ZodCheckEndsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`.*${be(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})}})),Ye=$("$ZodCheckOverwrite",((e,t)=>{Oe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class qe{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))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Qe=(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,se,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},We=$("$ZodError",Qe),Je=$("$ZodError",Qe,{Parent:Error}),Ke=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new A;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Ie(e,r,x()))));throw me(t,o?.callee),t}return s.value},Xe=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Ie(e,r,x()))));throw me(t,o?.callee),t}return s.value},et=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new A;return r.issues.length?{success:!1,error:new(e??We)(r.issues.map((e=>Ie(e,o,x()))))}:{success:!0,data:r.value}},tt=et(Je),nt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>Ie(e,o,x()))))}:{success:!0,data:r.value}},it=nt(Je),ot=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,n,o)},rt=e=>(t,n,i)=>Ke(e)(t,n,i),st=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Xe(e)(t,n,o)},at=e=>async(t,n,i)=>Xe(e)(t,n,i),ct=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return et(e)(t,n,o)},ut=e=>(t,n,i)=>et(e)(t,n,i),dt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},lt=e=>async(t,n,i)=>nt(e)(t,n,i),pt={major:4,minor:1,patch:5},ft=$("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=pt;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ee(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new A;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ee(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ee(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ee(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new A;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new A;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=tt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return it(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),ht=$("$ZodString",((e,t)=>{var n;ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),mt=$("$ZodStringFormat",((e,t)=>{Ue.init(e,t),ht.init(e,t)})),vt=$("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=M),mt.init(e,t)})),gt=$("$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=B(e))}else t.pattern??(t.pattern=B());mt.init(e,t)})),_t=$("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=L),mt.init(e,t)})),yt=$("$ZodURL",((e,t)=>{mt.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:W.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),zt=$("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),mt.init(e,t)})),bt=$("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=j),mt.init(e,t)})),Pt=$("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=R),mt.init(e,t)})),kt=$("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=C),mt.init(e,t)})),wt=$("$ZodULID",((e,t)=>{t.pattern??(t.pattern=S),mt.init(e,t)})),Et=$("$ZodXID",((e,t)=>{t.pattern??(t.pattern=F),mt.init(e,t)})),Tt=$("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=D),mt.init(e,t)})),Nt=$("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ee({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${K}T(?:${i})$`)}(t)),mt.init(e,t)})),It=$("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=X),mt.init(e,t)})),$t=$("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ee(t)}$`)),mt.init(e,t)})),At=$("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=U),mt.init(e,t)})),Ot=$("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=G),mt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),Zt=$("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=H),mt.init(e,t),e._zod.onattach.push((e=>{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})}}})),xt=$("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=V),mt.init(e,t)})),Rt=$("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=Y),mt.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function Ct(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const St=$("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=q),mt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Ct(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Ft=$("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=Q),mt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!Q.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Ct(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})}})),Dt=$("$ZodE164",((e,t)=>{t.pattern??(t.pattern=J),mt.init(e,t)})),jt=$("$ZodJWT",((e,t)=>{mt.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.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})}})),Ut=$("$ZodNumber",((e,t)=>{ft.init(e,t),e._zod.pattern=e._zod.bag.pattern??ne,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Mt=$("$ZodNumber",((e,t)=>{Se.init(e,t),Ut.init(e,t)})),Bt=$("$ZodBoolean",((e,t)=>{ft.init(e,t),e._zod.pattern=ie,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Lt=$("$ZodUnknown",((e,t)=>{ft.init(e,t),e._zod.parse=e=>e})),Gt=$("$ZodNever",((e,t)=>{ft.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Ht=$("$ZodDate",((e,t)=>{ft.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function Vt(e,t,n){e.issues.length&&t.issues.push(...Te(n,e.issues)),t.value[n]=e.value}const Yt=$("$ZodArray",((e,t)=>{ft.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>Vt(t,n,e)))):Vt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function qt(e,t,n,i){e.issues.length&&t.issues.push(...Te(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Qt(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=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Wt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>qt(e,n,o,t)))):qt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const Jt=$("$ZodObject",((e,t)=>{ft.init(e,t);const n=ae((()=>Qt(t)));le(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=ve,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>qt(n,t,e,a)))):qt(n,t,e,a)}return o?Wt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),Kt=$("$ZodObjectJIT",((e,t)=>{Jt.init(e,t);const n=e._zod.parse,i=ae((()=>Qt(t)));let o;const r=ve,s=!Z.jitless,a=s&&ge.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new qe(["shape","payload","ctx"]),n=i.value,o=e=>{const t=he(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=he(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\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=o(d,l),c?Wt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function Xt(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ee(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Ie(e,i,x())))))}),t)}const en=$("$ZodUnion",((e,t)=>{ft.init(e,t),le(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),le(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),le(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),le(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=>ue(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>Xt(t,o,e,r))):Xt(a,o,e,r)}})),tn=$("$ZodIntersection",((e,t)=>{ft.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>on(e,t,n))):on(e,o,r)}}));function nn(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(_e(e)&&_e(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=nn(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=nn(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function on(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ee(e))return e;const i=nn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const rn=$("$ZodEnum",((e,t)=>{ft.init(e,t);const n=function(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))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>ze.has(typeof e))).map((e=>"string"==typeof e?be(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),sn=$("$ZodTransform",((e,t)=>{ft.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new A;return n.value=o,n}}));function an(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const cn=$("$ZodOptional",((e,t)=>{ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",le(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),le(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ue(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>an(t,e.value))):an(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),un=$("$ZodNullable",((e,t)=>{ft.init(e,t),le(e._zod,"optin",(()=>t.innerType._zod.optin)),le(e._zod,"optout",(()=>t.innerType._zod.optout)),le(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ue(e.source)}|null)$`):void 0})),le(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)})),dn=$("$ZodDefault",((e,t)=>{ft.init(e,t),e._zod.optin="optional",le(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 i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>ln(e,t))):ln(i,t)}}));function ln(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const pn=$("$ZodPrefault",((e,t)=>{ft.init(e,t),e._zod.optin="optional",le(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))})),fn=$("$ZodNonOptional",((e,t)=>{ft.init(e,t),le(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,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>hn(t,e))):hn(o,e)}}));function hn(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 mn=$("$ZodCatch",((e,t)=>{ft.init(e,t),le(e._zod,"optin",(()=>t.innerType._zod.optin)),le(e._zod,"optout",(()=>t.innerType._zod.optout)),le(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Ie(e,n,x())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Ie(e,n,x())))},input:e.value}),e.issues=[]),e)}})),vn=$("$ZodPipe",((e,t)=>{ft.init(e,t),le(e._zod,"values",(()=>t.in._zod.values)),le(e._zod,"optin",(()=>t.in._zod.optin)),le(e._zod,"optout",(()=>t.out._zod.optout)),le(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>gn(e,t.in,n))):gn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>gn(e,t.out,n))):gn(i,t.out,n)}}));function gn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const _n=$("$ZodReadonly",((e,t)=>{ft.init(e,t),le(e._zod,"propValues",(()=>t.innerType._zod.propValues)),le(e._zod,"values",(()=>t.innerType._zod.values)),le(e._zod,"optin",(()=>t.innerType._zod.optin)),le(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(yn):yn(i)}}));function yn(e){return e.value=Object.freeze(e.value),e}const zn=$("$ZodCustom",((e,t)=>{Oe.init(e,t),ft.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>bn(t,n,i,e)));bn(o,n,i,e)}}));function bn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(Ae(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class Pn{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,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 i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function kn(){return new Pn}const wn=kn();function En(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(t)})}function Tn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(t)})}function Nn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(t)})}function In(e,t){return new xe({check:"less_than",...ke(t),value:e,inclusive:!1})}function $n(e,t){return new xe({check:"less_than",...ke(t),value:e,inclusive:!0})}function An(e,t){return new Re({check:"greater_than",...ke(t),value:e,inclusive:!1})}function On(e,t){return new Re({check:"greater_than",...ke(t),value:e,inclusive:!0})}function Zn(e,t){return new Ce({check:"multiple_of",...ke(t),value:e})}function xn(e,t){return new Fe({check:"max_length",...ke(t),maximum:e})}function Rn(e,t){return new De({check:"min_length",...ke(t),minimum:e})}function Cn(e,t){return new je({check:"length_equals",...ke(t),length:e})}function Sn(e){return new Ye({check:"overwrite",tx:e})}const Fn=$("ZodISODateTime",((e,t)=>{Nt.init(e,t),ri.init(e,t)}));const Dn=$("ZodISODate",((e,t)=>{It.init(e,t),ri.init(e,t)}));const jn=$("ZodISOTime",((e,t)=>{$t.init(e,t),ri.init(e,t)}));const Un=$("ZodISODuration",((e,t)=>{At.init(e,t),ri.init(e,t)}));const Mn=(e,t)=>{We.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,se,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,se,2)}},isEmpty:{get:()=>0===e.issues.length}})},Bn=($("ZodError",Mn),$("ZodError",Mn,{Parent:Error})),Ln=Ke(Bn),Gn=Xe(Bn),Hn=et(Bn),Vn=nt(Bn),Yn=ot(Bn),qn=rt(Bn),Qn=st(Bn),Wn=at(Bn),Jn=ct(Bn),Kn=ut(Bn),Xn=dt(Bn),ei=lt(Bn),ti=$("ZodType",((e,t)=>(ft.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>Pe(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Ln(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Hn(e,t,n),e.parseAsync=async(t,n)=>Gn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Vn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Yn(e,t,n),e.decode=(t,n)=>qn(e,t,n),e.encodeAsync=async(t,n)=>Qn(e,t,n),e.decodeAsync=async(t,n)=>Wn(e,t,n),e.safeEncode=(t,n)=>Jn(e,t,n),e.safeDecode=(t,n)=>Kn(e,t,n),e.safeEncodeAsync=async(t,n)=>Xn(e,t,n),e.safeDecodeAsync=async(t,n)=>ei(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ke(n)})}(no,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Oe({check:"custom",...ke(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Ae(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Ae(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Sn(t)),e.optional=()=>Vi(e),e.nullable=()=>qi(e),e.nullish=()=>Vi(qi(e)),e.nonoptional=t=>function(e,t){return new Ji({type:"nonoptional",innerType:e,...ke(t)})}(e,t),e.array=()=>Fi(e),e.or=t=>function(e,t){return new Ui({type:"union",options:e,...ke(t)})}([e,t]),e.and=t=>new Mi({type:"intersection",left:e,right:t}),e.transform=t=>eo(e,Gi(t)),e.default=t=>{return n=t,new Qi({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ye(n)}});var n},e.prefault=t=>{return n=t,new Wi({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ye(n)}});var n},e.catch=t=>{return new Ki({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>eo(e,t),e.readonly=()=>new to({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return wn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>wn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return wn.get(e);const n=e.clone();return wn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),ni=$("_ZodString",((e,t)=>{ht.init(e,t),ti.init(e,t);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(function(e,t){return new Me({check:"string_format",format:"regex",...ke(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ge({check:"string_format",format:"includes",...ke(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new He({check:"string_format",format:"starts_with",...ke(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ve({check:"string_format",format:"ends_with",...ke(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Rn(...t)),e.max=(...t)=>e.check(xn(...t)),e.length=(...t)=>e.check(Cn(...t)),e.nonempty=(...t)=>e.check(Rn(1,...t)),e.lowercase=t=>e.check(function(e){return new Be({check:"string_format",format:"lowercase",...ke(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Le({check:"string_format",format:"uppercase",...ke(e)})}(t)),e.trim=()=>e.check(Sn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Sn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Sn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Sn((e=>e.toUpperCase())))})),ii=$("ZodString",((e,t)=>{ht.init(e,t),ni.init(e,t),e.email=t=>e.check(En(si,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(t)})}(di,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(t)})}(Ei,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(t)})}(li,t)),e.guid=t=>e.check(Tn(ci,t)),e.uuid=t=>e.check(Nn(ui,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(t)})}(ui,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(t)})}(ui,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(t)})}(ui,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(t)})}(pi,t)),e.guid=t=>e.check(Tn(ci,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(t)})}(fi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(t)})}(hi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(t)})}(mi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(t)})}(Pi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(t)})}(ki,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(t)})}(vi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(t)})}(gi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(t)})}(_i,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(t)})}(yi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(t)})}(zi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(t)})}(bi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(t)})}(wi,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(t)})}(Fn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...ke(t)})}(Dn,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(t)})}(jn,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...ke(t)})}(Un,e)}(t))}));function oi(e){return function(e,t){return new e({type:"string",...ke(t)})}(ii,e)}const ri=$("ZodStringFormat",((e,t)=>{mt.init(e,t),ni.init(e,t)})),si=$("ZodEmail",((e,t)=>{_t.init(e,t),ri.init(e,t)}));function ai(e){return En(si,e)}const ci=$("ZodGUID",((e,t)=>{vt.init(e,t),ri.init(e,t)})),ui=$("ZodUUID",((e,t)=>{gt.init(e,t),ri.init(e,t)})),di=$("ZodURL",((e,t)=>{yt.init(e,t),ri.init(e,t)})),li=$("ZodEmoji",((e,t)=>{zt.init(e,t),ri.init(e,t)})),pi=$("ZodNanoID",((e,t)=>{bt.init(e,t),ri.init(e,t)})),fi=$("ZodCUID",((e,t)=>{Pt.init(e,t),ri.init(e,t)})),hi=$("ZodCUID2",((e,t)=>{kt.init(e,t),ri.init(e,t)})),mi=$("ZodULID",((e,t)=>{wt.init(e,t),ri.init(e,t)})),vi=$("ZodXID",((e,t)=>{Et.init(e,t),ri.init(e,t)})),gi=$("ZodKSUID",((e,t)=>{Tt.init(e,t),ri.init(e,t)})),_i=$("ZodIPv4",((e,t)=>{Ot.init(e,t),ri.init(e,t)})),yi=$("ZodIPv6",((e,t)=>{Zt.init(e,t),ri.init(e,t)})),zi=$("ZodCIDRv4",((e,t)=>{xt.init(e,t),ri.init(e,t)})),bi=$("ZodCIDRv6",((e,t)=>{Rt.init(e,t),ri.init(e,t)})),Pi=$("ZodBase64",((e,t)=>{St.init(e,t),ri.init(e,t)})),ki=$("ZodBase64URL",((e,t)=>{Ft.init(e,t),ri.init(e,t)})),wi=$("ZodE164",((e,t)=>{Dt.init(e,t),ri.init(e,t)})),Ei=$("ZodJWT",((e,t)=>{jt.init(e,t),ri.init(e,t)})),Ti=$("ZodNumber",((e,t)=>{Ut.init(e,t),ti.init(e,t),e.gt=(t,n)=>e.check(An(t,n)),e.gte=(t,n)=>e.check(On(t,n)),e.min=(t,n)=>e.check(On(t,n)),e.lt=(t,n)=>e.check(In(t,n)),e.lte=(t,n)=>e.check($n(t,n)),e.max=(t,n)=>e.check($n(t,n)),e.int=t=>e.check($i(t)),e.safe=t=>e.check($i(t)),e.positive=t=>e.check(An(0,t)),e.nonnegative=t=>e.check(On(0,t)),e.negative=t=>e.check(In(0,t)),e.nonpositive=t=>e.check($n(0,t)),e.multipleOf=(t,n)=>e.check(Zn(t,n)),e.step=(t,n)=>e.check(Zn(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 Ni(e){return function(e,t){return new e({type:"number",checks:[],...ke(t)})}(Ti,e)}const Ii=$("ZodNumberFormat",((e,t)=>{Mt.init(e,t),Ti.init(e,t)}));function $i(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ke(t)})}(Ii,e)}const Ai=$("ZodBoolean",((e,t)=>{Bt.init(e,t),ti.init(e,t)}));const Oi=$("ZodUnknown",((e,t)=>{Lt.init(e,t),ti.init(e,t)}));function Zi(){return new Oi({type:"unknown"})}const xi=$("ZodNever",((e,t)=>{Gt.init(e,t),ti.init(e,t)}));function Ri(e){return function(e,t){return new e({type:"never",...ke(t)})}(xi,e)}const Ci=$("ZodDate",((e,t)=>{Ht.init(e,t),ti.init(e,t),e.min=(t,n)=>e.check(On(t,n)),e.max=(t,n)=>e.check($n(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}));const Si=$("ZodArray",((e,t)=>{Yt.init(e,t),ti.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Rn(t,n)),e.nonempty=t=>e.check(Rn(1,t)),e.max=(t,n)=>e.check(xn(t,n)),e.length=(t,n)=>e.check(Cn(t,n)),e.unwrap=()=>e.element}));function Fi(e,t){return function(e,t,n){return new e({type:"array",element:t,...ke(n)})}(Si,e,t)}const Di=$("ZodObject",((e,t)=>{Kt.init(e,t),ti.init(e,t),le(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Bi({type:"enum",entries:n,...ke(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Zi()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ri()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!_e(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=fe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return pe(this,"shape",n),n},checks:[]});return Pe(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!_e(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return pe(this,"shape",n),n},checks:e._zod.def.checks};return Pe(e,n)}(e,t),e.merge=t=>function(e,t){const n=fe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return pe(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Pe(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Pe(e,fe(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return pe(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=fe(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return pe(this,"shape",i),i},checks:[]});return Pe(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=fe(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return pe(this,"shape",o),o},checks:[]});return Pe(t,i)}(Hi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=fe(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return pe(this,"shape",o),o},checks:[]});return Pe(t,i)}(Ji,e,t[0])}));function ji(e,t){const n={type:"object",get shape(){var t;return pe(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...ke(t)};return new Di(n)}const Ui=$("ZodUnion",((e,t)=>{en.init(e,t),ti.init(e,t),e.options=t.options}));const Mi=$("ZodIntersection",((e,t)=>{tn.init(e,t),ti.init(e,t)})),Bi=$("ZodEnum",((e,t)=>{rn.init(e,t),ti.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Bi({...t,checks:[],...ke(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Bi({...t,checks:[],...ke(i),entries:o})}}));const Li=$("ZodTransform",((e,t)=>{sn.init(e,t),ti.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(Ae(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Ae(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Gi(e){return new Li({type:"transform",transform:e})}const Hi=$("ZodOptional",((e,t)=>{cn.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Vi(e){return new Hi({type:"optional",innerType:e})}const Yi=$("ZodNullable",((e,t)=>{un.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function qi(e){return new Yi({type:"nullable",innerType:e})}const Qi=$("ZodDefault",((e,t)=>{dn.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Wi=$("ZodPrefault",((e,t)=>{pn.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Ji=$("ZodNonOptional",((e,t)=>{fn.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Ki=$("ZodCatch",((e,t)=>{mn.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),Xi=$("ZodPipe",((e,t)=>{vn.init(e,t),ti.init(e,t),e.in=t.in,e.out=t.out}));function eo(e,t){return new Xi({type:"pipe",in:e,out:t})}const to=$("ZodReadonly",((e,t)=>{_n.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType})),no=$("ZodCustom",((e,t)=>{zn.init(e,t),ti.init(e,t)}));function io(e,t){return eo(Gi(e),t)}function oo(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const ro=e=>io((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),so=e=>io((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setHours(0,0,0,0),t):e}),e),ao=e=>oi().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),co=()=>ai("Invalid email address").min(1,"Required"),uo=()=>ro(Ni("Valid amount required").positive("Positive amount required")),lo=()=>so(function(e){return function(e,t){return new e({type:"date",...ke(t)})}(Ci,e)}("Valid date required").min(new Date,"Date must be in the future")),po=e=>oi().max(e,`Maximum length is ${e} characters`),fo=ji({address1:ao(100),address2:po(100).optional(),city:ao(50),state:po(50).optional(),postcode:po(20).optional(),country:ao(50)}),ho=ji({amount:uo(),message:po(500).nullish(),giverFirstName:ao(50),giverLastName:ao(50),giverEmail:co(),giverPhone:ao(31),giverAddress:fo,cardHolder:ao(101),recipientFirstName:po(50).nullish(),recipientLastName:po(50).nullish(),recipientEmail:ai("Invalid email address").nullish(),recipientPhone:po(31).nullish()}),mo=ho.extend({expiry:lo(),notes:po(500).nullish()}),vo=ho.extend({companyId:Ni().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...ke(t)})}(Ai,e)}().default(!0),payment:ji({cardHolder:ao(30),cardNumberToken:ao(50),cardExpiry:ao(5),cardCvcToken:ao(50)}).optional()}),go=ji({grant_type:oi().readonly().default("refresh_token"),client_id:Nn(ui,undefined),client_secret:oi(),refresh_token:oi(),scope:oi().optional()});const _o=ji({email:ai(),firstName:oi().max(100).optional(),lastName:oi().max(100).optional(),phone:oi().max(20).optional(),scopes:Fi(oi()).optional()}),yo=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t},zo=require("decimal.js");var bo=e.n(zo);const Po=e=>new(bo())(e).toDecimalPlaces(2).toNumber();function ko(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=Po(n);switch(e.feeType){case T.PercentageOfBooking:if(o)return Po(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return Po(a/(1-t)*e.amount/(100+e.amount))}return Po(a*(e.amount/100));case T.FixedChargePerRoom:case T.FixedChargePerBooking:return e.amount;case T.NightlyChargePerRoom:return Po(e.amount*i);default:return 0}}const wo=[T.FixedChargePerBooking],Eo=[T.PercentageOfBooking,T.FixedChargePerRoom,T.NightlyChargePerRoom],To=[T.PercentageOfBooking];function No(e,t){return e.filter((e=>t.includes(e.feeType)))}function Io(e){return No(e,wo)}function $o(e){return No(e,Eo)}function Ao(e){return No(e,To)}function Oo(e){return{includeInRates:[T.PercentageOfBooking,T.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===T.PercentageOfBooking,appliesToAddons:e===T.PercentageOfBooking,includePreviousFeesInCalculation:e===T.PercentageOfBooking}}const Zo=e=>e,xo=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Ro=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Co{}function So(e){return e.toUpperCase()}Co.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===N.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===N.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return I.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Co.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Co.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),I.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),Co.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Co.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Co.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=Co.calculateReservationAddonTotal(o,t)?.total}})),Po(n)},module.exports=t})();
@@ -1,6 +1,6 @@
1
1
  import { EGuaranteePolicyDepositMode } from '../Policies/EGuaranteePolicy.enum';
2
2
  import { IItemisedBookingFeeResponse } from '../Booking/Itinerary.types';
3
- import { Warning } from "../General/Warning.type";
3
+ import { Warning } from '../index.js';
4
4
  export type IAvailability = {
5
5
  roomTypes: {
6
6
  [roomTypeCode: string]: IRoomType;
@@ -26,7 +26,6 @@ export type IAvailability = {
26
26
  warnings: Warning<string>[];
27
27
  alternativeAvailability?: IAlternativeAvailability;
28
28
  promoCodeDetails?: IPromoCodeDetails | null;
29
- hasMinStayUpsellOpportunities?: boolean;
30
29
  };
31
30
  export type IAlternativeAvailability = {
32
31
  checkInDate: string;
@@ -69,8 +68,6 @@ export type IRatePlan = {
69
68
  };
70
69
  rateOverrides: IRateOverride[];
71
70
  nightsToDiscount?: number | null;
72
- minNightStayOverride?: number | null;
73
- isUpsellRate?: boolean;
74
71
  };
75
72
  export type IPromoCodeDetails = {
76
73
  code: string;
@@ -0,0 +1,14 @@
1
+ import { EHotelCardProcessor, EHotelCardProcessorInitData } from './IBookingPayment.type';
2
+ export type ICheckoutBrowserSession<T extends EHotelCardProcessor | undefined = EHotelCardProcessor> = {
3
+ browserSessionId: string;
4
+ checkoutSessionId: string;
5
+ rows: {}[];
6
+ /**
7
+ * ISO 8601 date string
8
+ */
9
+ expiry: string;
10
+ payment: {
11
+ processor: T;
12
+ data: EHotelCardProcessorInitData[T];
13
+ };
14
+ };
@@ -3,6 +3,5 @@ export declare enum ECompanyProvider {
3
3
  Availpro = "Availpro",
4
4
  RMS = "RMS",
5
5
  Siteminder = "Siteminder",
6
- Roomstay = "Roomstay",
7
- OHIP = "OHIP"
6
+ Roomstay = "Roomstay"
8
7
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Basic object to wrap a string that is de/encoded as JSON.
3
+ */
4
+ export type IJsonString = {
5
+ message: string;
6
+ };
@@ -51,4 +51,6 @@ export type IHotelReplica = {
51
51
  utcOffset: string;
52
52
  timeZone: string;
53
53
  weekdayStartsOn: EHotelWeekdayStartsOn;
54
+ preventRoomRateFiltersOnRedirect: boolean;
55
+ paidAdsCheckoutUrl: string;
54
56
  };
@@ -4,8 +4,3 @@ export declare enum EGuaranteePolicyDepositMode {
4
4
  FirstNight = "FirstNight",
5
5
  None = "None"
6
6
  }
7
- export declare enum EGuarantyPolicyPrepaymentType {
8
- FixedAmount = "fixed",
9
- Percentage = "percentage",
10
- Nights = "nights"
11
- }
@@ -43,19 +43,10 @@ export * from './Room/IRoomGroup.type';
43
43
  export * from './RMS/ERMSDiscountType.enum';
44
44
  export * from './RMS/IRMSPropertyDiscount.type';
45
45
  export * from './RMS/IRMSRequirement.type';
46
- export * from './RMS/ERMSSyncStrategy.enum';
47
- export * from './RMS/ERMSAuthSyncHistoryStatus.type';
48
- export * from './RMS/IRMSSyncResponse.type';
49
- /**
50
- * OHIP
51
- */
52
- export * from './OHIP/index';
53
46
  /**
54
47
  * Image
55
48
  */
56
49
  export * from './Image/IRoomstayImage.type';
57
- /** Maintenance */
58
- export * from './Maintenance/IMaintenanceStatus.type';
59
50
  /**
60
51
  * Member Details
61
52
  */
@@ -86,11 +77,11 @@ export * from './Events/IRoomstayEvent.type';
86
77
  /**
87
78
  * General
88
79
  */
89
- export * from './General/Format.types';
90
80
  export * from './General/HttpMethod.enum';
91
81
  export * from './General/IMessage.type';
92
- export * from './General/Pagination.types';
93
82
  export * from './General/Warning.type';
83
+ export * from './General/Pagination.types';
84
+ export * from './General/Format.types';
94
85
  /**
95
86
  * Media
96
87
  */
@@ -101,20 +92,10 @@ export * from './Media/IMedia.type';
101
92
  export * from './Fees/EFeeType.enum';
102
93
  export * from './Fees/IFee.type';
103
94
  export * from './Fees/IFeeConfigurationOptions.type';
104
- /**
105
- * Api
106
- */
107
- export * from './Api/Reservations.type';
108
- export * from './Api/RoomNightRate.type';
109
95
  /**
110
96
  * Analytics
111
97
  */
112
98
  export * from './Analytics/IBigQueryResults.type';
113
- /**
114
- * Gift Cards
115
- */
116
- export * from './GiftCards/GiftCard.types';
117
- export * from './GiftCards/GiftCardAuth.types';
118
99
  /**
119
100
  * Addons
120
101
  */
@@ -125,3 +106,8 @@ export * from './Addons/Addon.types';
125
106
  */
126
107
  export * from './Api/Reservations.type';
127
108
  export * from './Api/RoomNightRate.type';
109
+ /**
110
+ * Gift Cards
111
+ */
112
+ export * from './GiftCards/GiftCard.types';
113
+ export * from './GiftCards/GiftCardAuth.types';
@@ -1,11 +1,3 @@
1
- import Decimal from "decimal.js";
2
- export declare const RoundingType: {
3
- [key: string]: Decimal.Rounding;
4
- };
5
- interface RoundMoneyOptions {
6
- precision?: number;
7
- rounding?: Decimal.Rounding;
8
- }
9
1
  /**
10
2
  * Rounds a monetary amount to two decimal places.
11
3
  *
@@ -13,8 +5,6 @@ interface RoundMoneyOptions {
13
5
  * with some systems, such as RMS.
14
6
  *
15
7
  * @param amount a string or number to be rounded
16
- * @param options an object containing precision and rounding options
17
8
  * @returns the rounded amount as a number
18
9
  */
19
- export declare const roundMoney: (amount: string | number, options?: RoundMoneyOptions) => number;
20
- export {};
10
+ export declare const roundMoney: (amount: string | number) => number;
package/dist/web.js CHANGED
@@ -1 +1 @@
1
- define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var t={60:t=>{t.exports=e}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{let e,t,n,r,s;i.r(o),i.d(o,{ADDON_PER_NIGHT_TYPES:()=>bo,AddGiftCardSchema:()=>vo,BaseGiftCardSchema:()=>go,DATE_FORMAT:()=>I,EAddonPricingType:()=>zo,EBookingFlow:()=>t,EBookingPaymentMethod:()=>n,EBookingStatus:()=>e,ECompanyProvider:()=>l,EDistanceUnitType:()=>v,EFeeType:()=>O,EGuaranteePolicyDepositMode:()=>w,EGuarantyPolicyPrepaymentType:()=>k,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,EPlanpayBookingStatus:()=>s,ERMSAuthSyncHistoryStatus:()=>P,ERMSDiscountType:()=>_,ERMSSyncStrategy:()=>y,ERoomstayEventSource:()=>E,ERoomstayImageSize:()=>z,GuestProfile:()=>d,HttpMethod:()=>A,IAuxiliaryFilterType:()=>g,IMaintenanceStatusService:()=>b,InternationalAddressSchema:()=>mo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>T,PurchaseGiftCardSchema:()=>_o,RefreshGiftCardTokenSchema:()=>yo,RegisterGiftCardAdminSchema:()=>Po,Reservation:()=>u,ReservedPackage:()=>N,RoundingType:()=>To,TotalCalculator:()=>Uo,calculateFeeAmount:()=>Io,calculateTotalForMemberBooking:()=>wo,getFeeOptionValidity:()=>Co,getFilteredBookingAddonFees:()=>Zo,getFilteredBookingFees:()=>xo,getFilteredBookingRateFees:()=>So,maxString:()=>ho,nameof:()=>Fo,preprocessDate:()=>co,preprocessNumber:()=>ao,requireEmail:()=>lo,requireFutureDate:()=>fo,requirePositiveAmount:()=>po,requireString:()=>uo,resizeRoomstayImageUrl:()=>jo,roundMoney:()=>No,subset:()=>Do,uppercaseString:()=>Lo,validateFormWithZod:()=>so}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(e||(e={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(t||(t={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(n||(n={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,g,v,_,y,P,z,b,w,k,E;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay",e.OHIP="OHIP"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(g||(g={})),function(e){e.Metric="metric",e.Imperial="imperial"}(v||(v={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e.Hotel="hotel",e.HotelImages="hotelImages",e.Cancellation="cancellation",e.Room="room",e.Rates="rates",e.OneGuaranteePolicy="oneGuaranteePolicy",e.RoomRates="roomRates",e.RoomImages="roomImages",e.BookingSources="booking-sources",e.Areas="areas",e.Dwellings="dwellings",e.AreaDwellings="areaDwellings",e.ConvertDwellingConfigToAuxInput="convertDwellingConfigToAuxInput",e.Discounts="discounts",e.PropertyDiscounts="propertyDiscounts",e.RoomDiscounts="roomDiscounts",e.PropertySundries="propertySundries",e.PropertyFees="propertyFees",e.PropertyCards="property-cards",e.Countries="countries",e.Addons="addons",e.Requirements="requirements",e.RoomAddons="room-addons",e.ClientFacingPromoSync="clientFacingPromoSync",e.ClientFacingRoomSync="clientFacingRoomSync",e.ClientFacingRateSync="clientFacingRateSync",e.NewRateFetch="newRateFetch"}(y||(y={})),function(e){e.Success="success",e.Failure="failure",e.New="new",e.Queued="queued",e.InProgress="in_progress",e.RequireResume="require_resume"}(P||(P={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(z||(z={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(b||(b={}));class T{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class N extends T{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(w||(w={})),function(e){e.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(k||(k={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(E||(E={}));const I="DD/MM/YYYY";let A,O;function R(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(A||(A={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(O||(O={})),Object.freeze({status:"aborted"}),Symbol("zod_brand");class $ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class x extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const S={};function Z(e){return e&&Object.assign(S,e),S}const C=/^[cC][^\s-]{8,}$/,F=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,j=/^[0-9a-vA-V]{20}$/,U=/^[A-Za-z0-9]{27}$/,L=/^[a-zA-Z0-9_-]{21}$/,M=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,H=/^([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})$/,B=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)$/,G=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,V=/^(?:(?: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])$/,Y=/^(([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})$/,q=/^((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])$/,Q=/^(([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])$/,W=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,J=/^[A-Za-z0-9_-]*$/,K=/^(?=.{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])?)*\.?$/,X=/^\+(?:[0-9]){6,14}[0-9]$/,ee="(?:(?:\\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])))",te=new RegExp(`^${ee}$`);function ne(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+)?)?`}const ie=/^\d+$/,oe=/^-?\d+(?:\.\d+)?/i,re=/true|false/i,se=/^[^A-Z]*$/,ae=/^[^a-z]*$/;function ce(e,t){return"bigint"==typeof t?t.toString():t}function ue(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function de(e){return null==e}function le(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const pe=Symbol("evaluating");function fe(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==pe)return void 0===i&&(i=pe,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function he(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function me(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ge(e){return JSON.stringify(e)}const ve="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ye=ue((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function Pe(e){if(!1===_e(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==_e(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ze(e){return Pe(e)?{...e}:e}const be=new Set(["string","number","symbol"]);function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ke(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Ee(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}new Set(["string","number","bigint","boolean","symbol","undefined"]);const Te={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]};function Ne(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 Ie(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ae(e){return"string"==typeof e?e:e?.message}function Oe(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ae(e.inst?._zod.def?.error?.(e))??Ae(t?.error?.(e))??Ae(n.customError?.(e))??Ae(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Re(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function $e(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const xe=R("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Se={number:"number",bigint:"bigint",object:"date"},Ze=R("$ZodCheckLessThan",((e,t)=>{xe.init(e,t);const n=Se[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ce=R("$ZodCheckGreaterThan",((e,t)=>{xe.init(e,t);const n=Se[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Fe=R("$ZodCheckMultipleOf",((e,t)=>{xe.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,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(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})}})),De=R("$ZodCheckNumberFormat",((e,t)=>{xe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=Te[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=ie)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),je=R("$ZodCheckMaxLength",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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 i=n.value;if(i.length<=t.maximum)return;const o=Re(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Ue=R("$ZodCheckMinLength",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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 i=n.value;if(i.length>=t.minimum)return;const o=Re(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Le=R("$ZodCheckLengthEquals",((e,t)=>{var n;xe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!de(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 i=n.value,o=i.length;if(o===t.length)return;const r=Re(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Me=R("$ZodCheckStringFormat",((e,t)=>{var n,i;xe.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})}):(i=e._zod).check??(i.check=()=>{})})),He=R("$ZodCheckRegex",((e,t)=>{Me.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})}})),Be=R("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=se),Me.init(e,t)})),Ge=R("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ae),Me.init(e,t)})),Ve=R("$ZodCheckIncludes",((e,t)=>{xe.init(e,t);const n=we(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),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})}})),Ye=R("$ZodCheckStartsWith",((e,t)=>{xe.init(e,t);const n=new RegExp(`^${we(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})}})),qe=R("$ZodCheckEndsWith",((e,t)=>{xe.init(e,t);const n=new RegExp(`.*${we(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})}})),Qe=R("$ZodCheckOverwrite",((e,t)=>{xe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class We{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))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Je=(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,ce,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ke=R("$ZodError",Je),Xe=R("$ZodError",Je,{Parent:Error}),et=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new $;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Oe(e,r,Z()))));throw ve(t,o?.callee),t}return s.value},tt=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Oe(e,r,Z()))));throw ve(t,o?.callee),t}return s.value},nt=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new $;return r.issues.length?{success:!1,error:new(e??Ke)(r.issues.map((e=>Oe(e,o,Z()))))}:{success:!0,data:r.value}},it=nt(Xe),ot=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>Oe(e,o,Z()))))}:{success:!0,data:r.value}},rt=ot(Xe),st=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return et(e)(t,n,o)},at=e=>(t,n,i)=>et(e)(t,n,i),ct=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return tt(e)(t,n,o)},ut=e=>async(t,n,i)=>tt(e)(t,n,i),dt=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},lt=e=>(t,n,i)=>nt(e)(t,n,i),pt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return ot(e)(t,n,o)},ft=e=>async(t,n,i)=>ot(e)(t,n,i),ht={major:4,minor:1,patch:5},mt=R("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ht;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ne(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new $;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ne(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ne(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ne(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new $;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new $;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=it(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return rt(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),gt=R("$ZodString",((e,t)=>{var n;mt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),vt=R("$ZodStringFormat",((e,t)=>{Me.init(e,t),gt.init(e,t)})),_t=R("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=H),vt.init(e,t)})),yt=R("$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=B(e))}else t.pattern??(t.pattern=B());vt.init(e,t)})),Pt=R("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=G),vt.init(e,t)})),zt=R("$ZodURL",((e,t)=>{vt.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:K.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),bt=R("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),vt.init(e,t)})),wt=R("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=L),vt.init(e,t)})),kt=R("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=C),vt.init(e,t)})),Et=R("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=F),vt.init(e,t)})),Tt=R("$ZodULID",((e,t)=>{t.pattern??(t.pattern=D),vt.init(e,t)})),Nt=R("$ZodXID",((e,t)=>{t.pattern??(t.pattern=j),vt.init(e,t)})),It=R("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=U),vt.init(e,t)})),At=R("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ne({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${ee}T(?:${i})$`)}(t)),vt.init(e,t)})),Ot=R("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=te),vt.init(e,t)})),Rt=R("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ne(t)}$`)),vt.init(e,t)})),$t=R("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=M),vt.init(e,t)})),xt=R("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=V),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),St=R("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=Y),vt.init(e,t),e._zod.onattach.push((e=>{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})}}})),Zt=R("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=q),vt.init(e,t)})),Ct=R("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=Q),vt.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function Ft(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Dt=R("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=W),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Ft(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),jt=R("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=J),vt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!J.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Ft(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})}})),Ut=R("$ZodE164",((e,t)=>{t.pattern??(t.pattern=X),vt.init(e,t)})),Lt=R("$ZodJWT",((e,t)=>{vt.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.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})}})),Mt=R("$ZodNumber",((e,t)=>{mt.init(e,t),e._zod.pattern=e._zod.bag.pattern??oe,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Ht=R("$ZodNumber",((e,t)=>{De.init(e,t),Mt.init(e,t)})),Bt=R("$ZodBoolean",((e,t)=>{mt.init(e,t),e._zod.pattern=re,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Gt=R("$ZodUnknown",((e,t)=>{mt.init(e,t),e._zod.parse=e=>e})),Vt=R("$ZodNever",((e,t)=>{mt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Yt=R("$ZodDate",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function qt(e,t,n){e.issues.length&&t.issues.push(...Ie(n,e.issues)),t.value[n]=e.value}const Qt=R("$ZodArray",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>qt(t,n,e)))):qt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Wt(e,t,n,i){e.issues.length&&t.issues.push(...Ie(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function Jt(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=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Kt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Wt(e,n,o,t)))):Wt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const Xt=R("$ZodObject",((e,t)=>{mt.init(e,t);const n=ue((()=>Jt(t)));fe(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=_e,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Wt(n,t,e,a)))):Wt(n,t,e,a)}return o?Kt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),en=R("$ZodObjectJIT",((e,t)=>{Xt.init(e,t);const n=e._zod.parse,i=ue((()=>Jt(t)));let o;const r=_e,s=!S.jitless,a=s&&ye.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new We(["shape","payload","ctx"]),n=i.value,o=e=>{const t=ge(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=ge(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\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=o(d,l),c?Kt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function tn(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ne(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Oe(e,i,Z())))))}),t)}const nn=R("$ZodUnion",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),fe(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),fe(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),fe(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=>le(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>tn(t,o,e,r))):tn(a,o,e,r)}})),on=R("$ZodIntersection",((e,t)=>{mt.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>sn(e,t,n))):sn(e,o,r)}}));function rn(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(Pe(e)&&Pe(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=rn(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=rn(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function sn(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ne(e))return e;const i=rn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const an=R("$ZodEnum",((e,t)=>{mt.init(e,t);const n=function(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))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>be.has(typeof e))).map((e=>"string"==typeof e?we(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),cn=R("$ZodTransform",((e,t)=>{mt.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new x(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new $;return n.value=o,n}}));function un(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const dn=R("$ZodOptional",((e,t)=>{mt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",fe(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>un(t,e.value))):un(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),ln=R("$ZodNullable",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${le(e.source)}|null)$`):void 0})),fe(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)})),pn=R("$ZodDefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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 i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>fn(e,t))):fn(i,t)}}));function fn(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const hn=R("$ZodPrefault",((e,t)=>{mt.init(e,t),e._zod.optin="optional",fe(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))})),mn=R("$ZodNonOptional",((e,t)=>{mt.init(e,t),fe(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,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>gn(t,e))):gn(o,e)}}));function gn(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 vn=R("$ZodCatch",((e,t)=>{mt.init(e,t),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),fe(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Oe(e,n,Z())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Oe(e,n,Z())))},input:e.value}),e.issues=[]),e)}})),_n=R("$ZodPipe",((e,t)=>{mt.init(e,t),fe(e._zod,"values",(()=>t.in._zod.values)),fe(e._zod,"optin",(()=>t.in._zod.optin)),fe(e._zod,"optout",(()=>t.out._zod.optout)),fe(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.in,n))):yn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>yn(e,t.out,n))):yn(i,t.out,n)}}));function yn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Pn=R("$ZodReadonly",((e,t)=>{mt.init(e,t),fe(e._zod,"propValues",(()=>t.innerType._zod.propValues)),fe(e._zod,"values",(()=>t.innerType._zod.values)),fe(e._zod,"optin",(()=>t.innerType._zod.optin)),fe(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(zn):zn(i)}}));function zn(e){return e.value=Object.freeze(e.value),e}const bn=R("$ZodCustom",((e,t)=>{xe.init(e,t),mt.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>wn(t,n,i,e)));wn(o,n,i,e)}}));function wn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push($e(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class kn{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,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 i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function En(){return new kn}const Tn=En();function Nn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ee(t)})}function In(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(t)})}function An(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(t)})}function On(e,t){return new Ze({check:"less_than",...Ee(t),value:e,inclusive:!1})}function Rn(e,t){return new Ze({check:"less_than",...Ee(t),value:e,inclusive:!0})}function $n(e,t){return new Ce({check:"greater_than",...Ee(t),value:e,inclusive:!1})}function xn(e,t){return new Ce({check:"greater_than",...Ee(t),value:e,inclusive:!0})}function Sn(e,t){return new Fe({check:"multiple_of",...Ee(t),value:e})}function Zn(e,t){return new je({check:"max_length",...Ee(t),maximum:e})}function Cn(e,t){return new Ue({check:"min_length",...Ee(t),minimum:e})}function Fn(e,t){return new Le({check:"length_equals",...Ee(t),length:e})}function Dn(e){return new Qe({check:"overwrite",tx:e})}const jn=R("ZodISODateTime",((e,t)=>{At.init(e,t),ai.init(e,t)}));const Un=R("ZodISODate",((e,t)=>{Ot.init(e,t),ai.init(e,t)}));const Ln=R("ZodISOTime",((e,t)=>{Rt.init(e,t),ai.init(e,t)}));const Mn=R("ZodISODuration",((e,t)=>{$t.init(e,t),ai.init(e,t)}));const Hn=(e,t)=>{Ke.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ce,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ce,2)}},isEmpty:{get:()=>0===e.issues.length}})},Bn=(R("ZodError",Hn),R("ZodError",Hn,{Parent:Error})),Gn=et(Bn),Vn=tt(Bn),Yn=nt(Bn),qn=ot(Bn),Qn=st(Bn),Wn=at(Bn),Jn=ct(Bn),Kn=ut(Bn),Xn=dt(Bn),ei=lt(Bn),ti=pt(Bn),ni=ft(Bn),ii=R("ZodType",((e,t)=>(mt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>ke(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Gn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Yn(e,t,n),e.parseAsync=async(t,n)=>Vn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>qn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Qn(e,t,n),e.decode=(t,n)=>Wn(e,t,n),e.encodeAsync=async(t,n)=>Jn(e,t,n),e.decodeAsync=async(t,n)=>Kn(e,t,n),e.safeEncode=(t,n)=>Xn(e,t,n),e.safeDecode=(t,n)=>ei(e,t,n),e.safeEncodeAsync=async(t,n)=>ti(e,t,n),e.safeDecodeAsync=async(t,n)=>ni(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ee(n)})}(oo,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new xe({check:"custom",...Ee(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push($e(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push($e(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Dn(t)),e.optional=()=>qi(e),e.nullable=()=>Wi(e),e.nullish=()=>qi(Wi(e)),e.nonoptional=t=>function(e,t){return new Xi({type:"nonoptional",innerType:e,...Ee(t)})}(e,t),e.array=()=>ji(e),e.or=t=>function(e,t){return new Mi({type:"union",options:e,...Ee(t)})}([e,t]),e.and=t=>new Hi({type:"intersection",left:e,right:t}),e.transform=t=>no(e,Vi(t)),e.default=t=>{return n=t,new Ji({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.prefault=t=>{return n=t,new Ki({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ze(n)}});var n},e.catch=t=>{return new eo({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>no(e,t),e.readonly=()=>new io({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Tn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Tn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Tn.get(e);const n=e.clone();return Tn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),oi=R("_ZodString",((e,t)=>{gt.init(e,t),ii.init(e,t);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(function(e,t){return new He({check:"string_format",format:"regex",...Ee(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ve({check:"string_format",format:"includes",...Ee(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Ye({check:"string_format",format:"starts_with",...Ee(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new qe({check:"string_format",format:"ends_with",...Ee(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Cn(...t)),e.max=(...t)=>e.check(Zn(...t)),e.length=(...t)=>e.check(Fn(...t)),e.nonempty=(...t)=>e.check(Cn(1,...t)),e.lowercase=t=>e.check(function(e){return new Be({check:"string_format",format:"lowercase",...Ee(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Ge({check:"string_format",format:"uppercase",...Ee(e)})}(t)),e.trim=()=>e.check(Dn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Dn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Dn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Dn((e=>e.toUpperCase())))})),ri=R("ZodString",((e,t)=>{gt.init(e,t),oi.init(e,t),e.email=t=>e.check(Nn(ci,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ee(t)})}(pi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(t)})}(Ni,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(t)})}(fi,t)),e.guid=t=>e.check(In(di,t)),e.uuid=t=>e.check(An(li,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(t)})}(li,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(t)})}(li,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(t)})}(li,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(t)})}(hi,t)),e.guid=t=>e.check(In(di,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(t)})}(mi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(t)})}(gi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(t)})}(vi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(t)})}(ki,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(t)})}(Ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(t)})}(_i,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(t)})}(yi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(t)})}(Pi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(t)})}(zi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(t)})}(bi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(t)})}(wi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(t)})}(Ti,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(t)})}(jn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Ee(t)})}(Un,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ee(t)})}(Ln,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ee(t)})}(Mn,e)}(t))}));function si(e){return function(e,t){return new e({type:"string",...Ee(t)})}(ri,e)}const ai=R("ZodStringFormat",((e,t)=>{vt.init(e,t),oi.init(e,t)})),ci=R("ZodEmail",((e,t)=>{Pt.init(e,t),ai.init(e,t)}));function ui(e){return Nn(ci,e)}const di=R("ZodGUID",((e,t)=>{_t.init(e,t),ai.init(e,t)})),li=R("ZodUUID",((e,t)=>{yt.init(e,t),ai.init(e,t)})),pi=R("ZodURL",((e,t)=>{zt.init(e,t),ai.init(e,t)})),fi=R("ZodEmoji",((e,t)=>{bt.init(e,t),ai.init(e,t)})),hi=R("ZodNanoID",((e,t)=>{wt.init(e,t),ai.init(e,t)})),mi=R("ZodCUID",((e,t)=>{kt.init(e,t),ai.init(e,t)})),gi=R("ZodCUID2",((e,t)=>{Et.init(e,t),ai.init(e,t)})),vi=R("ZodULID",((e,t)=>{Tt.init(e,t),ai.init(e,t)})),_i=R("ZodXID",((e,t)=>{Nt.init(e,t),ai.init(e,t)})),yi=R("ZodKSUID",((e,t)=>{It.init(e,t),ai.init(e,t)})),Pi=R("ZodIPv4",((e,t)=>{xt.init(e,t),ai.init(e,t)})),zi=R("ZodIPv6",((e,t)=>{St.init(e,t),ai.init(e,t)})),bi=R("ZodCIDRv4",((e,t)=>{Zt.init(e,t),ai.init(e,t)})),wi=R("ZodCIDRv6",((e,t)=>{Ct.init(e,t),ai.init(e,t)})),ki=R("ZodBase64",((e,t)=>{Dt.init(e,t),ai.init(e,t)})),Ei=R("ZodBase64URL",((e,t)=>{jt.init(e,t),ai.init(e,t)})),Ti=R("ZodE164",((e,t)=>{Ut.init(e,t),ai.init(e,t)})),Ni=R("ZodJWT",((e,t)=>{Lt.init(e,t),ai.init(e,t)})),Ii=R("ZodNumber",((e,t)=>{Mt.init(e,t),ii.init(e,t),e.gt=(t,n)=>e.check($n(t,n)),e.gte=(t,n)=>e.check(xn(t,n)),e.min=(t,n)=>e.check(xn(t,n)),e.lt=(t,n)=>e.check(On(t,n)),e.lte=(t,n)=>e.check(Rn(t,n)),e.max=(t,n)=>e.check(Rn(t,n)),e.int=t=>e.check(Ri(t)),e.safe=t=>e.check(Ri(t)),e.positive=t=>e.check($n(0,t)),e.nonnegative=t=>e.check(xn(0,t)),e.negative=t=>e.check(On(0,t)),e.nonpositive=t=>e.check(Rn(0,t)),e.multipleOf=(t,n)=>e.check(Sn(t,n)),e.step=(t,n)=>e.check(Sn(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 Ai(e){return function(e,t){return new e({type:"number",checks:[],...Ee(t)})}(Ii,e)}const Oi=R("ZodNumberFormat",((e,t)=>{Ht.init(e,t),Ii.init(e,t)}));function Ri(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(t)})}(Oi,e)}const $i=R("ZodBoolean",((e,t)=>{Bt.init(e,t),ii.init(e,t)}));const xi=R("ZodUnknown",((e,t)=>{Gt.init(e,t),ii.init(e,t)}));function Si(){return new xi({type:"unknown"})}const Zi=R("ZodNever",((e,t)=>{Vt.init(e,t),ii.init(e,t)}));function Ci(e){return function(e,t){return new e({type:"never",...Ee(t)})}(Zi,e)}const Fi=R("ZodDate",((e,t)=>{Yt.init(e,t),ii.init(e,t),e.min=(t,n)=>e.check(xn(t,n)),e.max=(t,n)=>e.check(Rn(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}));const Di=R("ZodArray",((e,t)=>{Qt.init(e,t),ii.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Cn(t,n)),e.nonempty=t=>e.check(Cn(1,t)),e.max=(t,n)=>e.check(Zn(t,n)),e.length=(t,n)=>e.check(Fn(t,n)),e.unwrap=()=>e.element}));function ji(e,t){return function(e,t,n){return new e({type:"array",element:t,...Ee(n)})}(Di,e,t)}const Ui=R("ZodObject",((e,t)=>{en.init(e,t),ii.init(e,t),fe(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Bi({type:"enum",entries:n,...Ee(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Si()}),e.loose=()=>e.clone({...e._zod.def,catchall:Si()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ci()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Pe(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:[]});return ke(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!Pe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return he(this,"shape",n),n},checks:e._zod.def.checks};return ke(e,n)}(e,t),e.merge=t=>function(e,t){const n=me(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return he(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ke(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return ke(e,me(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return he(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=me(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return he(this,"shape",i),i},checks:[]});return ke(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=me(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return he(this,"shape",o),o},checks:[]});return ke(t,i)}(Yi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=me(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return he(this,"shape",o),o},checks:[]});return ke(t,i)}(Xi,e,t[0])}));function Li(e,t){const n={type:"object",get shape(){var t;return he(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...Ee(t)};return new Ui(n)}const Mi=R("ZodUnion",((e,t)=>{nn.init(e,t),ii.init(e,t),e.options=t.options}));const Hi=R("ZodIntersection",((e,t)=>{on.init(e,t),ii.init(e,t)})),Bi=R("ZodEnum",((e,t)=>{an.init(e,t),ii.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Bi({...t,checks:[],...Ee(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Bi({...t,checks:[],...Ee(i),entries:o})}}));const Gi=R("ZodTransform",((e,t)=>{cn.init(e,t),ii.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new x(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push($e(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push($e(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Vi(e){return new Gi({type:"transform",transform:e})}const Yi=R("ZodOptional",((e,t)=>{dn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function qi(e){return new Yi({type:"optional",innerType:e})}const Qi=R("ZodNullable",((e,t)=>{ln.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Wi(e){return new Qi({type:"nullable",innerType:e})}const Ji=R("ZodDefault",((e,t)=>{pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Ki=R("ZodPrefault",((e,t)=>{hn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Xi=R("ZodNonOptional",((e,t)=>{mn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),eo=R("ZodCatch",((e,t)=>{vn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),to=R("ZodPipe",((e,t)=>{_n.init(e,t),ii.init(e,t),e.in=t.in,e.out=t.out}));function no(e,t){return new to({type:"pipe",in:e,out:t})}const io=R("ZodReadonly",((e,t)=>{Pn.init(e,t),ii.init(e,t),e.unwrap=()=>e._zod.def.innerType})),oo=R("ZodCustom",((e,t)=>{bn.init(e,t),ii.init(e,t)}));function ro(e,t){return no(Vi(e),t)}function so(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const ao=e=>ro((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),co=e=>ro((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setHours(0,0,0,0),t):e}),e),uo=e=>si().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),lo=()=>ui("Invalid email address").min(1,"Required"),po=()=>ao(Ai("Valid amount required").positive("Positive amount required")),fo=()=>co(function(e){return function(e,t){return new e({type:"date",...Ee(t)})}(Fi,e)}("Valid date required").min(new Date,"Date must be in the future")),ho=e=>si().max(e,`Maximum length is ${e} characters`),mo=Li({address1:uo(100),address2:ho(100).optional(),city:uo(50),state:ho(50).optional(),postcode:ho(20).optional(),country:uo(50)}),go=Li({amount:po(),message:ho(500).nullish(),giverFirstName:uo(50),giverLastName:uo(50),giverEmail:lo(),giverPhone:uo(31),giverAddress:mo,cardHolder:uo(101),recipientFirstName:ho(50).nullish(),recipientLastName:ho(50).nullish(),recipientEmail:ui("Invalid email address").nullish(),recipientPhone:ho(31).nullish()}),vo=go.extend({expiry:fo(),notes:ho(500).nullish()}),_o=go.extend({companyId:Ai().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...Ee(t)})}($i,e)}().default(!0),payment:Li({cardHolder:uo(30),cardNumberToken:uo(50),cardExpiry:uo(5),cardCvcToken:uo(50)}).optional()}),yo=Li({grant_type:si().readonly().default("refresh_token"),client_id:An(li,undefined),client_secret:si(),refresh_token:si(),scope:si().optional()});const Po=Li({email:ui(),firstName:si().max(100).optional(),lastName:si().max(100).optional(),phone:si().max(20).optional(),scopes:ji(si()).optional()});let zo;!function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(zo||(zo={}));const bo=[zo.PER_NIGHT,zo.PER_PERSON_PER_NIGHT,zo.PER_QUANTITY_NAME_PER_NIGHT,zo.PER_ROOM_QUANTITY_PER_NIGHT,zo.PER_PERSON_OCCUPANCY_PER_NIGHT,zo.PER_ADULT_OCCUPANCY_PER_NIGHT,zo.PER_CHILD_OCCUPANCY_PER_NIGHT,zo.PER_ALL_PERSONS_PER_NIGHT],wo=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t};var ko=i(60),Eo=i.n(ko);const To={UP:Eo().ROUND_UP,DOWN:Eo().ROUND_DOWN,CEIL:Eo().ROUND_CEIL,FLOOR:Eo().ROUND_FLOOR,HALF_UP:Eo().ROUND_HALF_UP,HALF_DOWN:Eo().ROUND_HALF_DOWN,HALF_EVEN:Eo().ROUND_HALF_EVEN,HALF_CEIL:Eo().ROUND_HALF_CEIL,HALF_FLOOR:Eo().ROUND_HALF_FLOOR},No=(e,t)=>{const{precision:n=2,rounding:i=To.HALF_UP}=t||{};return new(Eo())(e).toDecimalPlaces(n,i).toNumber()};function Io(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=No(n);switch(e.feeType){case O.PercentageOfBooking:if(o)return No(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return No(a/(1-t)*e.amount/(100+e.amount))}return No(a*(e.amount/100));case O.FixedChargePerRoom:case O.FixedChargePerBooking:return e.amount;case O.NightlyChargePerRoom:return No(e.amount*i);default:return 0}}const Ao=[O.FixedChargePerBooking],Oo=[O.PercentageOfBooking,O.FixedChargePerRoom,O.NightlyChargePerRoom],Ro=[O.PercentageOfBooking];function $o(e,t){return e.filter((e=>t.includes(e.feeType)))}function xo(e){return $o(e,Ao)}function So(e){return $o(e,Oo)}function Zo(e){return $o(e,Ro)}function Co(e){return{includeInRates:[O.PercentageOfBooking,O.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===O.PercentageOfBooking,appliesToAddons:e===O.PercentageOfBooking,includePreviousFeesInCalculation:e===O.PercentageOfBooking}}const Fo=e=>e,Do=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},jo=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Uo{}function Lo(e){return e.toUpperCase()}Uo.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===zo.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===zo.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return bo.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Uo.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Uo.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),bo.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),Uo.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Uo.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Uo.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=Uo.calculateReservationAddonTotal(o,t)?.total}})),No(n)}})(),o})()));
1
+ define("@roomstay/core",["decimal.js"],(e=>(()=>{"use strict";var t={60:t=>{t.exports=e}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{let e,t,n,r,s;i.r(o),i.d(o,{ADDON_PER_NIGHT_TYPES:()=>I,AddGiftCardSchema:()=>mo,BaseGiftCardSchema:()=>ho,DATE_FORMAT:()=>E,EAddonPricingType:()=>N,EBookingFlow:()=>t,EBookingPaymentMethod:()=>n,EBookingStatus:()=>e,ECompanyProvider:()=>l,EDistanceUnitType:()=>g,EFeeType:()=>T,EGuaranteePolicyDepositMode:()=>z,EHotelCardProcessor:()=>r,EHotelPriceModel:()=>p,EHotelStateFieldConfiguration:()=>f,EHotelWeekdayStartsOn:()=>h,EIntegration:()=>m,EPlanpayBookingStatus:()=>s,ERMSDiscountType:()=>_,ERoomstayEventSource:()=>b,ERoomstayImageSize:()=>y,GuestProfile:()=>d,HttpMethod:()=>P,IAuxiliaryFilterType:()=>v,InternationalAddressSchema:()=>fo,ItineraryResponse:()=>c,PCIBookingCardProcessorTypes:()=>a,Package:()=>k,PurchaseGiftCardSchema:()=>vo,RefreshGiftCardTokenSchema:()=>go,RegisterGiftCardAdminSchema:()=>_o,Reservation:()=>u,ReservedPackage:()=>w,TotalCalculator:()=>Co,calculateFeeAmount:()=>ko,calculateTotalForMemberBooking:()=>yo,getFeeOptionValidity:()=>Oo,getFilteredBookingAddonFees:()=>Ao,getFilteredBookingFees:()=>Io,getFilteredBookingRateFees:()=>$o,maxString:()=>po,nameof:()=>xo,preprocessDate:()=>so,preprocessNumber:()=>ro,requireEmail:()=>co,requireFutureDate:()=>lo,requirePositiveAmount:()=>uo,requireString:()=>ao,resizeRoomstayImageUrl:()=>Ro,roundMoney:()=>Po,subset:()=>Zo,uppercaseString:()=>So,validateFormWithZod:()=>oo}),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(e||(e={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(t||(t={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard",e.TrueRewards="TrueRewards"}(n||(n={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.Mastercard="Mastercard"}(r||(r={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(s||(s={}));const a=[];class c{constructor(){this.roomstayId=void 0,this.itineraryNumber=void 0,this.total=void 0,this.hotelFrontendId=void 0,this.reservations=[],this.payment=void 0,this.feesSummary=void 0,this.itemisedFees=void 0,this.warnings=void 0}}class u{constructor(){this.reservationNumber=void 0,this.roomType=void 0,this.roomCode=void 0,this.rate=void 0,this.rateCode=void 0,this.images=void 0,this.guaranteePolicy=void 0,this.cancellationPolicy=void 0,this.checkInDate=void 0,this.checkOutDate=void 0,this.nights={},this.guestCounts={adults:1,children:0},this.guest=new d,this.paymentCard=void 0,this.paymentMethod=void 0,this.total=void 0,this.status=void 0,this.isCancelable=void 0,this.addons=void 0,this.comments=void 0,this.specialRequests=void 0,this.promoCode=void 0,this.guaranteePolicyLongDescription=void 0,this.cancellationPolicyLongDescription=void 0,this.itemisedFees=void 0}}class d{constructor(){this.title=void 0,this.firstName=void 0,this.middleName=void 0,this.lastName=void 0,this.nameSuffix=void 0,this.phone=void 0,this.email=void 0,this.address={},this.marketingOptIn=void 0,this.country=void 0}}let l,p,f,h,m,v,g,_,y,z,b,P;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay"}(l||(l={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(p||(p={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(f||(f={})),function(e){e.Monday="monday",e.Sunday="sunday"}(h||(h={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce",e.RAC="RAC"}(m||(m={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(v||(v={})),function(e){e.Metric="metric",e.Imperial="imperial"}(g||(g={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(_||(_={})),function(e){e[e.Icon=128]="Icon",e[e.Tiny=256]="Tiny",e[e.Small=512]="Small",e[e.Medium=768]="Medium",e[e.Large=1024]="Large",e[e.ExtraLarge=1600]="ExtraLarge"}(y||(y={}));class k{constructor(){this.ratePlanCode=void 0,this.name=void 0,this.description=void 0,this.inclusive=void 0,this.image=void 0,this.url=void 0,this.pricingType=void 0,this.quantity=void 0,this.category=void 0,this.cancelPenalty=void 0,this.guaranteeDescription=void 0,this.availability={}}}class w extends k{constructor(...e){super(...e),this.code=void 0,this.price=void 0,this.fees=void 0,this.itemisedFees=void 0,this.adultQuantity=void 0,this.childQuantity=void 0,this.adultPrice=void 0,this.childPrice=void 0,this.startDate=void 0,this.startTime=void 0,this.hideDatePicker=!1,this.order=void 0}}!function(e){e.Full="Full",e.Percentage="Percentage",e.FirstNight="FirstNight",e.None="None"}(z||(z={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(b||(b={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(P||(P={}));const E="DD/MM/YYYY";let T,N;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(T||(T={})),function(e){e.PER_STAY="Per stay",e.PER_NIGHT="Per night",e.PER_PERSON="Per person",e.PER_PERSON_PER_NIGHT="Per person per night",e.PER_ALL_PERSONS="Per all persons",e.PER_ALL_PERSONS_PER_NIGHT="Per all persons per night",e.PER_QUANTITY_NAME_PER_NIGHT="Per Quantity Name Per Night",e.PER_ROOM_QUANTITY_PER_NIGHT="Per Room Quantity Per Night",e.PER_PERSON_OCCUPANCY_PER_NIGHT="Per Person Occupancy Per Night",e.PER_ADULT_OCCUPANCY_PER_NIGHT="Per Adult Occupancy Per Night",e.PER_CHILD_OCCUPANCY_PER_NIGHT="Per Child Occupancy Per Night"}(N||(N={}));const I=[N.PER_NIGHT,N.PER_PERSON_PER_NIGHT,N.PER_QUANTITY_NAME_PER_NIGHT,N.PER_ROOM_QUANTITY_PER_NIGHT,N.PER_PERSON_OCCUPANCY_PER_NIGHT,N.PER_ADULT_OCCUPANCY_PER_NIGHT,N.PER_CHILD_OCCUPANCY_PER_NIGHT,N.PER_ALL_PERSONS_PER_NIGHT];function $(e,t,n){function i(n,i){var o;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(o=n._zod).traits??(o.traits=new Set),n._zod.traits.add(e),t(n,i);for(const e in s.prototype)e in n||Object.defineProperty(n,e,{value:s.prototype[e].bind(n)});n._zod.constr=s,n._zod.def=i}const o=n?.Parent??Object;class r extends o{}function s(e){var t;const o=n?.Parent?new r:this;i(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class A extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class O extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const x={};function Z(e){return e&&Object.assign(x,e),x}const R=/^[cC][^\s-]{8,}$/,C=/^[0-9a-z]+$/,S=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,F=/^[0-9a-vA-V]{20}$/,D=/^[A-Za-z0-9]{27}$/,j=/^[a-zA-Z0-9_-]{21}$/,U=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,M=/^([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})$/,B=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)$/,L=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,G=/^(?:(?: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])$/,H=/^(([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})$/,V=/^((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])$/,Y=/^(([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])$/,Q=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,q=/^[A-Za-z0-9_-]*$/,W=/^(?=.{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])?)*\.?$/,J=/^\+(?:[0-9]){6,14}[0-9]$/,K="(?:(?:\\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])))",X=new RegExp(`^${K}$`);function ee(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+)?)?`}const te=/^\d+$/,ne=/^-?\d+(?:\.\d+)?/i,ie=/true|false/i,oe=/^[^A-Z]*$/,re=/^[^a-z]*$/;function se(e,t){return"bigint"==typeof t?t.toString():t}function ae(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ce(e){return null==e}function ue(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const de=Symbol("evaluating");function le(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==de)return void 0===i&&(i=de,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function pe(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fe(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function he(e){return JSON.stringify(e)}const me="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ve(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ge=ae((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function _e(e){if(!1===ve(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==ve(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function ye(e){return _e(e)?{...e}:e}const ze=new Set(["string","number","symbol"]);function be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Pe(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function ke(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}new Set(["string","number","bigint","boolean","symbol","undefined"]);const we={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]};function Ee(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 Te(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function Ne(e){return"string"==typeof e?e:e?.message}function Ie(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=Ne(e.inst?._zod.def?.error?.(e))??Ne(t?.error?.(e))??Ne(n.customError?.(e))??Ne(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function $e(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Ae(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Oe=$("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),xe={number:"number",bigint:"bigint",object:"date"},Ze=$("$ZodCheckLessThan",((e,t)=>{Oe.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Re=$("$ZodCheckGreaterThan",((e,t)=>{Oe.init(e,t);const n=xe[typeof t.value];e._zod.onattach.push((e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)})),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ce=$("$ZodCheckMultipleOf",((e,t)=>{Oe.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,i=t.toString();let o=(i.split(".")[1]||"").length;if(0===o&&/\d?e-\d?/.test(i)){const e=i.match(/\d?e-(\d?)/);e?.[1]&&(o=Number.parseInt(e[1]))}const r=n>o?n:o;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}(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})}})),Se=$("$ZodCheckNumberFormat",((e,t)=>{Oe.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=we[t.format];e._zod.onattach.push((e=>{const i=e._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r,n&&(i.pattern=te)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>r&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:r,inst:e})}})),Fe=$("$ZodCheckMaxLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ce(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 i=n.value;if(i.length<=t.maximum)return;const o=$e(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),De=$("$ZodCheckMinLength",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ce(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 i=n.value;if(i.length>=t.minimum)return;const o=$e(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),je=$("$ZodCheckLengthEquals",((e,t)=>{var n;Oe.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!ce(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 i=n.value,o=i.length;if(o===t.length)return;const r=$e(i),s=o>t.length;n.issues.push({origin:r,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Ue=$("$ZodCheckStringFormat",((e,t)=>{var n,i;Oe.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})}):(i=e._zod).check??(i.check=()=>{})})),Me=$("$ZodCheckRegex",((e,t)=>{Ue.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})}})),Be=$("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=oe),Ue.init(e,t)})),Le=$("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=re),Ue.init(e,t)})),Ge=$("$ZodCheckIncludes",((e,t)=>{Oe.init(e,t);const n=be(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)})),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})}})),He=$("$ZodCheckStartsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`^${be(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})}})),Ve=$("$ZodCheckEndsWith",((e,t)=>{Oe.init(e,t);const n=new RegExp(`.*${be(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})}})),Ye=$("$ZodCheckOverwrite",((e,t)=>{Oe.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Qe{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))),i=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const qe=(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,se,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},We=$("$ZodError",qe),Je=$("$ZodError",qe,{Parent:Error}),Ke=e=>(t,n,i,o)=>{const r=i?Object.assign(i,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new A;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Ie(e,r,Z()))));throw me(t,o?.callee),t}return s.value},Xe=e=>async(t,n,i,o)=>{const r=i?Object.assign(i,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map((e=>Ie(e,r,Z()))));throw me(t,o?.callee),t}return s.value},et=e=>(t,n,i)=>{const o=i?{...i,async:!1}:{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new A;return r.issues.length?{success:!1,error:new(e??We)(r.issues.map((e=>Ie(e,o,Z()))))}:{success:!0,data:r.value}},tt=et(Je),nt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map((e=>Ie(e,o,Z()))))}:{success:!0,data:r.value}},it=nt(Je),ot=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,n,o)},rt=e=>(t,n,i)=>Ke(e)(t,n,i),st=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return Xe(e)(t,n,o)},at=e=>async(t,n,i)=>Xe(e)(t,n,i),ct=e=>(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return et(e)(t,n,o)},ut=e=>(t,n,i)=>et(e)(t,n,i),dt=e=>async(t,n,i)=>{const o=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return nt(e)(t,n,o)},lt=e=>async(t,n,i)=>nt(e)(t,n,i),pt={major:4,minor:1,patch:5},ft=$("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=pt;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let i,o=Ee(e);for(const r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=r._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new A;if(i||s instanceof Promise)i=(i??Promise.resolve()).then((async()=>{await s,e.issues.length!==t&&(o||(o=Ee(e,t)))}));else{if(e.issues.length===t)continue;o||(o=Ee(e,t))}}return i?i.then((()=>e)):e},n=(n,o,r)=>{if(Ee(n))return n.aborted=!0,n;const s=t(o,i,r);if(s instanceof Promise){if(!1===r.async)throw new A;return s.then((t=>e._zod.parse(t,r)))}return e._zod.parse(s,r)};e._zod.run=(o,r)=>{if(r.skipChecks)return e._zod.parse(o,r);if("backward"===r.direction){const t=e._zod.parse({value:o.value,issues:[]},{...r,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,o,r))):n(t,o,r)}const s=e._zod.parse(o,r);if(s instanceof Promise){if(!1===r.async)throw new A;return s.then((e=>t(e,i,r)))}return t(s,i,r)}}e["~standard"]={validate:t=>{try{const n=tt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return it(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),ht=$("$ZodString",((e,t)=>{var n;ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),mt=$("$ZodStringFormat",((e,t)=>{Ue.init(e,t),ht.init(e,t)})),vt=$("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=M),mt.init(e,t)})),gt=$("$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=B(e))}else t.pattern??(t.pattern=B());mt.init(e,t)})),_t=$("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=L),mt.init(e,t)})),yt=$("$ZodURL",((e,t)=>{mt.init(e,t),e._zod.check=n=>{try{const i=n.value.trim(),o=new URL(i);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:W.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:n.value=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),zt=$("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),mt.init(e,t)})),bt=$("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=j),mt.init(e,t)})),Pt=$("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=R),mt.init(e,t)})),kt=$("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=C),mt.init(e,t)})),wt=$("$ZodULID",((e,t)=>{t.pattern??(t.pattern=S),mt.init(e,t)})),Et=$("$ZodXID",((e,t)=>{t.pattern??(t.pattern=F),mt.init(e,t)})),Tt=$("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=D),mt.init(e,t)})),Nt=$("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ee({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${K}T(?:${i})$`)}(t)),mt.init(e,t)})),It=$("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=X),mt.init(e,t)})),$t=$("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ee(t)}$`)),mt.init(e,t)})),At=$("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=U),mt.init(e,t)})),Ot=$("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=G),mt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),xt=$("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=H),mt.init(e,t),e._zod.onattach.push((e=>{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})}}})),Zt=$("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=V),mt.init(e,t)})),Rt=$("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=Y),mt.init(e,t),e._zod.check=n=>{const[i,o]=n.value.split("/");try{if(!o)throw new Error;const e=Number(o);if(`${e}`!==o)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function Ct(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const St=$("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=Q),mt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{Ct(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Ft=$("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=q),mt.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64url"})),e._zod.check=n=>{(function(e){if(!q.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return Ct(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})}})),Dt=$("$ZodE164",((e,t)=>{t.pattern??(t.pattern=J),mt.init(e,t)})),jt=$("$ZodJWT",((e,t)=>{mt.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const o=JSON.parse(atob(i));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.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})}})),Ut=$("$ZodNumber",((e,t)=>{ft.init(e,t),e._zod.pattern=e._zod.bag.pattern??ne,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const r="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...r?{received:r}:{}}),n}})),Mt=$("$ZodNumber",((e,t)=>{Se.init(e,t),Ut.init(e,t)})),Bt=$("$ZodBoolean",((e,t)=>{ft.init(e,t),e._zod.pattern=ie,e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}})),Lt=$("$ZodUnknown",((e,t)=>{ft.init(e,t),e._zod.parse=e=>e})),Gt=$("$ZodNever",((e,t)=>{ft.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Ht=$("$ZodDate",((e,t)=>{ft.init(e,t),e._zod.parse=(n,i)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}const o=n.value,r=o instanceof Date;return r&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...r?{received:"Invalid Date"}:{},inst:e}),n}}));function Vt(e,t,n){e.issues.length&&t.issues.push(...Te(n,e.issues)),t.value[n]=e.value}const Yt=$("$ZodArray",((e,t)=>{ft.init(e,t),e._zod.parse=(n,i)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const r=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?r.push(a.then((t=>Vt(t,n,e)))):Vt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function Qt(e,t,n,i){e.issues.length&&t.issues.push(...Te(n,e.issues)),void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}function qt(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=(i=e.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Wt(e,t,n,i,o,r){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const o of Object.keys(t)){if(a.has(o))continue;if("never"===u){s.push(o);continue}const r=c.run({value:t[o],issues:[]},i);r instanceof Promise?e.push(r.then((e=>Qt(e,n,o,t)))):Qt(r,n,o,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:r}),e.length?Promise.all(e).then((()=>n)):n}const Jt=$("$ZodObject",((e,t)=>{ft.init(e,t);const n=ae((()=>qt(t)));le(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n}));const i=ve,o=t.catchall;let r;e._zod.parse=(t,s)=>{r??(r=n.value);const a=t.value;if(!i(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=r.shape;for(const e of r.keys){const n=u[e]._zod.run({value:a[e],issues:[]},s);n instanceof Promise?c.push(n.then((n=>Qt(n,t,e,a)))):Qt(n,t,e,a)}return o?Wt(c,a,t,s,n.value,e):c.length?Promise.all(c).then((()=>t)):t}})),Kt=$("$ZodObjectJIT",((e,t)=>{Jt.init(e,t);const n=e._zod.parse,i=ae((()=>qt(t)));let o;const r=ve,s=!x.jitless,a=s&&ge.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=i.value);const p=d.value;return r(p)?s&&a&&!1===l?.async&&!0!==l.jitless?(o||(o=(e=>{const t=new Qe(["shape","payload","ctx"]),n=i.value,o=e=>{const t=he(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let s=0;for(const e of n.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of n.keys){const n=r[e],i=he(e);t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\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=o(d,l),c?Wt([],p,d,l,u,e):d):n(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}}));function Xt(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter((e=>!Ee(e)));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Ie(e,i,Z())))))}),t)}const en=$("$ZodUnion",((e,t)=>{ft.init(e,t),le(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),le(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),le(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),le(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=>ue(e.source))).join("|")})$`)}}));const n=1===t.options.length,i=t.options[0]._zod.run;e._zod.parse=(o,r)=>{if(n)return i(o,r);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},r);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>Xt(t,o,e,r))):Xt(a,o,e,r)}})),tn=$("$ZodIntersection",((e,t)=>{ft.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},n),r=t.right._zod.run({value:i,issues:[]},n);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then((([t,n])=>on(e,t,n))):on(e,o,r)}}));function nn(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(_e(e)&&_e(t)){const n=Object.keys(t),i=Object.keys(e).filter((e=>-1!==n.indexOf(e))),o={...e,...t};for(const n of i){const i=nn(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let i=0;i<e.length;i++){const o=nn(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function on(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ee(e))return e;const i=nn(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const rn=$("$ZodEnum",((e,t)=>{ft.init(e,t);const n=function(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))}(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter((e=>ze.has(typeof e))).map((e=>"string"==typeof e?be(e):e.toString())).join("|")})$`),e._zod.parse=(t,o)=>{const r=t.value;return i.has(r)||t.issues.push({code:"invalid_value",values:n,input:r,inst:e}),t}})),sn=$("$ZodTransform",((e,t)=>{ft.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);const o=t.transform(n.value,n);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then((e=>(n.value=e,n)));if(o instanceof Promise)throw new A;return n.value=o,n}}));function an(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const cn=$("$ZodOptional",((e,t)=>{ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",le(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),le(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ue(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((t=>an(t,e.value))):an(i,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),un=$("$ZodNullable",((e,t)=>{ft.init(e,t),le(e._zod,"optin",(()=>t.innerType._zod.optin)),le(e._zod,"optout",(()=>t.innerType._zod.optout)),le(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ue(e.source)}|null)$`):void 0})),le(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)})),dn=$("$ZodDefault",((e,t)=>{ft.init(e,t),e._zod.optin="optional",le(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 i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((e=>ln(e,t))):ln(i,t)}}));function ln(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const pn=$("$ZodPrefault",((e,t)=>{ft.init(e,t),e._zod.optin="optional",le(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))})),fn=$("$ZodNonOptional",((e,t)=>{ft.init(e,t),le(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,i)=>{const o=t.innerType._zod.run(n,i);return o instanceof Promise?o.then((t=>hn(t,e))):hn(o,e)}}));function hn(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 mn=$("$ZodCatch",((e,t)=>{ft.init(e,t),le(e._zod,"optin",(()=>t.innerType._zod.optin)),le(e._zod,"optout",(()=>t.innerType._zod.optout)),le(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then((i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Ie(e,n,Z())))},input:e.value}),e.issues=[]),e))):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map((e=>Ie(e,n,Z())))},input:e.value}),e.issues=[]),e)}})),vn=$("$ZodPipe",((e,t)=>{ft.init(e,t),le(e._zod,"values",(()=>t.in._zod.values)),le(e._zod,"optin",(()=>t.in._zod.optin)),le(e._zod,"optout",(()=>t.out._zod.optout)),le(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then((e=>gn(e,t.in,n))):gn(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>gn(e,t.out,n))):gn(i,t.out,n)}}));function gn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const _n=$("$ZodReadonly",((e,t)=>{ft.init(e,t),le(e._zod,"propValues",(()=>t.innerType._zod.propValues)),le(e._zod,"values",(()=>t.innerType._zod.values)),le(e._zod,"optin",(()=>t.innerType._zod.optin)),le(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(yn):yn(i)}}));function yn(e){return e.value=Object.freeze(e.value),e}const zn=$("$ZodCustom",((e,t)=>{Oe.init(e,t),ft.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,o=t.fn(i);if(o instanceof Promise)return o.then((t=>bn(t,n,i,e)));bn(o,n,i,e)}}));function bn(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(Ae(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class Pn{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,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 i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function kn(){return new Pn}const wn=kn();function En(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(t)})}function Tn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(t)})}function Nn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(t)})}function In(e,t){return new Ze({check:"less_than",...ke(t),value:e,inclusive:!1})}function $n(e,t){return new Ze({check:"less_than",...ke(t),value:e,inclusive:!0})}function An(e,t){return new Re({check:"greater_than",...ke(t),value:e,inclusive:!1})}function On(e,t){return new Re({check:"greater_than",...ke(t),value:e,inclusive:!0})}function xn(e,t){return new Ce({check:"multiple_of",...ke(t),value:e})}function Zn(e,t){return new Fe({check:"max_length",...ke(t),maximum:e})}function Rn(e,t){return new De({check:"min_length",...ke(t),minimum:e})}function Cn(e,t){return new je({check:"length_equals",...ke(t),length:e})}function Sn(e){return new Ye({check:"overwrite",tx:e})}const Fn=$("ZodISODateTime",((e,t)=>{Nt.init(e,t),ri.init(e,t)}));const Dn=$("ZodISODate",((e,t)=>{It.init(e,t),ri.init(e,t)}));const jn=$("ZodISOTime",((e,t)=>{$t.init(e,t),ri.init(e,t)}));const Un=$("ZodISODuration",((e,t)=>{At.init(e,t),ri.init(e,t)}));const Mn=(e,t)=>{We.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},i={_errors:[]},o=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map((e=>o({issues:e})));else if("invalid_key"===t.code)o({issues:t.issues});else if("invalid_element"===t.code)o({issues:t.issues});else if(0===t.path.length)i._errors.push(n(t));else{let e=i,o=0;for(;o<t.path.length;){const i=t.path[o];o===t.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(n(t))):e[i]=e[i]||{_errors:[]},e=e[i],o++}}};return o(e),i}(e,t)},flatten:{value:t=>function(e,t=(e=>e.message)){const n={},i=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):i.push(t(o));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,se,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,se,2)}},isEmpty:{get:()=>0===e.issues.length}})},Bn=($("ZodError",Mn),$("ZodError",Mn,{Parent:Error})),Ln=Ke(Bn),Gn=Xe(Bn),Hn=et(Bn),Vn=nt(Bn),Yn=ot(Bn),Qn=rt(Bn),qn=st(Bn),Wn=at(Bn),Jn=ct(Bn),Kn=ut(Bn),Xn=dt(Bn),ei=lt(Bn),ti=$("ZodType",((e,t)=>(ft.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),e.clone=(t,n)=>Pe(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Ln(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Hn(e,t,n),e.parseAsync=async(t,n)=>Gn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Vn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Yn(e,t,n),e.decode=(t,n)=>Qn(e,t,n),e.encodeAsync=async(t,n)=>qn(e,t,n),e.decodeAsync=async(t,n)=>Wn(e,t,n),e.safeEncode=(t,n)=>Jn(e,t,n),e.safeDecode=(t,n)=>Kn(e,t,n),e.safeEncodeAsync=async(t,n)=>Xn(e,t,n),e.safeDecodeAsync=async(t,n)=>ei(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ke(n)})}(no,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e,t){const n=new Oe({check:"custom",...ke(void 0)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Ae(e,n.value,t._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Ae(i))}},e(n.value,n))));return t}(t)),e.overwrite=t=>e.check(Sn(t)),e.optional=()=>Vi(e),e.nullable=()=>Qi(e),e.nullish=()=>Vi(Qi(e)),e.nonoptional=t=>function(e,t){return new Ji({type:"nonoptional",innerType:e,...ke(t)})}(e,t),e.array=()=>Fi(e),e.or=t=>function(e,t){return new Ui({type:"union",options:e,...ke(t)})}([e,t]),e.and=t=>new Mi({type:"intersection",left:e,right:t}),e.transform=t=>eo(e,Gi(t)),e.default=t=>{return n=t,new qi({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():ye(n)}});var n},e.prefault=t=>{return n=t,new Wi({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():ye(n)}});var n},e.catch=t=>{return new Ki({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>eo(e,t),e.readonly=()=>new to({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return wn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>wn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return wn.get(e);const n=e.clone();return wn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),ni=$("_ZodString",((e,t)=>{ht.init(e,t),ti.init(e,t);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(function(e,t){return new Me({check:"string_format",format:"regex",...ke(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ge({check:"string_format",format:"includes",...ke(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new He({check:"string_format",format:"starts_with",...ke(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ve({check:"string_format",format:"ends_with",...ke(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Rn(...t)),e.max=(...t)=>e.check(Zn(...t)),e.length=(...t)=>e.check(Cn(...t)),e.nonempty=(...t)=>e.check(Rn(1,...t)),e.lowercase=t=>e.check(function(e){return new Be({check:"string_format",format:"lowercase",...ke(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Le({check:"string_format",format:"uppercase",...ke(e)})}(t)),e.trim=()=>e.check(Sn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return Sn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(Sn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(Sn((e=>e.toUpperCase())))})),ii=$("ZodString",((e,t)=>{ht.init(e,t),ni.init(e,t),e.email=t=>e.check(En(si,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(t)})}(di,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(t)})}(Ei,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(t)})}(li,t)),e.guid=t=>e.check(Tn(ci,t)),e.uuid=t=>e.check(Nn(ui,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(t)})}(ui,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(t)})}(ui,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(t)})}(ui,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(t)})}(pi,t)),e.guid=t=>e.check(Tn(ci,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(t)})}(fi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(t)})}(hi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(t)})}(mi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(t)})}(Pi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(t)})}(ki,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(t)})}(vi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(t)})}(gi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(t)})}(_i,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(t)})}(yi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(t)})}(zi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(t)})}(bi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(t)})}(wi,t)),e.datetime=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(t)})}(Fn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...ke(t)})}(Dn,e)}(t)),e.time=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(t)})}(jn,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...ke(t)})}(Un,e)}(t))}));function oi(e){return function(e,t){return new e({type:"string",...ke(t)})}(ii,e)}const ri=$("ZodStringFormat",((e,t)=>{mt.init(e,t),ni.init(e,t)})),si=$("ZodEmail",((e,t)=>{_t.init(e,t),ri.init(e,t)}));function ai(e){return En(si,e)}const ci=$("ZodGUID",((e,t)=>{vt.init(e,t),ri.init(e,t)})),ui=$("ZodUUID",((e,t)=>{gt.init(e,t),ri.init(e,t)})),di=$("ZodURL",((e,t)=>{yt.init(e,t),ri.init(e,t)})),li=$("ZodEmoji",((e,t)=>{zt.init(e,t),ri.init(e,t)})),pi=$("ZodNanoID",((e,t)=>{bt.init(e,t),ri.init(e,t)})),fi=$("ZodCUID",((e,t)=>{Pt.init(e,t),ri.init(e,t)})),hi=$("ZodCUID2",((e,t)=>{kt.init(e,t),ri.init(e,t)})),mi=$("ZodULID",((e,t)=>{wt.init(e,t),ri.init(e,t)})),vi=$("ZodXID",((e,t)=>{Et.init(e,t),ri.init(e,t)})),gi=$("ZodKSUID",((e,t)=>{Tt.init(e,t),ri.init(e,t)})),_i=$("ZodIPv4",((e,t)=>{Ot.init(e,t),ri.init(e,t)})),yi=$("ZodIPv6",((e,t)=>{xt.init(e,t),ri.init(e,t)})),zi=$("ZodCIDRv4",((e,t)=>{Zt.init(e,t),ri.init(e,t)})),bi=$("ZodCIDRv6",((e,t)=>{Rt.init(e,t),ri.init(e,t)})),Pi=$("ZodBase64",((e,t)=>{St.init(e,t),ri.init(e,t)})),ki=$("ZodBase64URL",((e,t)=>{Ft.init(e,t),ri.init(e,t)})),wi=$("ZodE164",((e,t)=>{Dt.init(e,t),ri.init(e,t)})),Ei=$("ZodJWT",((e,t)=>{jt.init(e,t),ri.init(e,t)})),Ti=$("ZodNumber",((e,t)=>{Ut.init(e,t),ti.init(e,t),e.gt=(t,n)=>e.check(An(t,n)),e.gte=(t,n)=>e.check(On(t,n)),e.min=(t,n)=>e.check(On(t,n)),e.lt=(t,n)=>e.check(In(t,n)),e.lte=(t,n)=>e.check($n(t,n)),e.max=(t,n)=>e.check($n(t,n)),e.int=t=>e.check($i(t)),e.safe=t=>e.check($i(t)),e.positive=t=>e.check(An(0,t)),e.nonnegative=t=>e.check(On(0,t)),e.negative=t=>e.check(In(0,t)),e.nonpositive=t=>e.check($n(0,t)),e.multipleOf=(t,n)=>e.check(xn(t,n)),e.step=(t,n)=>e.check(xn(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 Ni(e){return function(e,t){return new e({type:"number",checks:[],...ke(t)})}(Ti,e)}const Ii=$("ZodNumberFormat",((e,t)=>{Mt.init(e,t),Ti.init(e,t)}));function $i(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ke(t)})}(Ii,e)}const Ai=$("ZodBoolean",((e,t)=>{Bt.init(e,t),ti.init(e,t)}));const Oi=$("ZodUnknown",((e,t)=>{Lt.init(e,t),ti.init(e,t)}));function xi(){return new Oi({type:"unknown"})}const Zi=$("ZodNever",((e,t)=>{Gt.init(e,t),ti.init(e,t)}));function Ri(e){return function(e,t){return new e({type:"never",...ke(t)})}(Zi,e)}const Ci=$("ZodDate",((e,t)=>{Ht.init(e,t),ti.init(e,t),e.min=(t,n)=>e.check(On(t,n)),e.max=(t,n)=>e.check($n(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}));const Si=$("ZodArray",((e,t)=>{Yt.init(e,t),ti.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Rn(t,n)),e.nonempty=t=>e.check(Rn(1,t)),e.max=(t,n)=>e.check(Zn(t,n)),e.length=(t,n)=>e.check(Cn(t,n)),e.unwrap=()=>e.element}));function Fi(e,t){return function(e,t,n){return new e({type:"array",element:t,...ke(n)})}(Si,e,t)}const Di=$("ZodObject",((e,t)=>{Kt.init(e,t),ti.init(e,t),le(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Bi({type:"enum",entries:n,...ke(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xi()}),e.loose=()=>e.clone({...e._zod.def,catchall:xi()}),e.strict=()=>e.clone({...e._zod.def,catchall:Ri()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!_e(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=fe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return pe(this,"shape",n),n},checks:[]});return Pe(e,i)}(e,t),e.safeExtend=t=>function(e,t){if(!_e(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return pe(this,"shape",n),n},checks:e._zod.def.checks};return Pe(e,n)}(e,t),e.merge=t=>function(e,t){const n=fe(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return pe(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Pe(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def;return Pe(e,fe(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return pe(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,i=fe(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return pe(this,"shape",i),i},checks:[]});return Pe(e,i)}(e,t),e.partial=(...t)=>function(e,t,n){const i=fe(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)o[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return pe(this,"shape",o),o},checks:[]});return Pe(t,i)}(Hi,e,t[0]),e.required=(...t)=>function(e,t,n){const i=fe(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:i[t]}))}else for(const t in i)o[t]=new e({type:"nonoptional",innerType:i[t]});return pe(this,"shape",o),o},checks:[]});return Pe(t,i)}(Ji,e,t[0])}));function ji(e,t){const n={type:"object",get shape(){var t;return pe(this,"shape",e?(t=e,Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))):{}),this.shape},...ke(t)};return new Di(n)}const Ui=$("ZodUnion",((e,t)=>{en.init(e,t),ti.init(e,t),e.options=t.options}));const Mi=$("ZodIntersection",((e,t)=>{tn.init(e,t),ti.init(e,t)})),Bi=$("ZodEnum",((e,t)=>{rn.init(e,t),ti.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new Bi({...t,checks:[],...ke(i),entries:o})},e.exclude=(e,i)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Bi({...t,checks:[],...ke(i),entries:o})}}));const Li=$("ZodTransform",((e,t)=>{sn.init(e,t),ti.init(e,t),e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new O(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(Ae(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Ae(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function Gi(e){return new Li({type:"transform",transform:e})}const Hi=$("ZodOptional",((e,t)=>{cn.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Vi(e){return new Hi({type:"optional",innerType:e})}const Yi=$("ZodNullable",((e,t)=>{un.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function Qi(e){return new Yi({type:"nullable",innerType:e})}const qi=$("ZodDefault",((e,t)=>{dn.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Wi=$("ZodPrefault",((e,t)=>{pn.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Ji=$("ZodNonOptional",((e,t)=>{fn.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Ki=$("ZodCatch",((e,t)=>{mn.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),Xi=$("ZodPipe",((e,t)=>{vn.init(e,t),ti.init(e,t),e.in=t.in,e.out=t.out}));function eo(e,t){return new Xi({type:"pipe",in:e,out:t})}const to=$("ZodReadonly",((e,t)=>{_n.init(e,t),ti.init(e,t),e.unwrap=()=>e._zod.def.innerType})),no=$("ZodCustom",((e,t)=>{zn.init(e,t),ti.init(e,t)}));function io(e,t){return eo(Gi(e),t)}function oo(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");e.getFieldState(n)?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const ro=e=>io((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),so=e=>io((e=>{if(!e)return;let t;return"string"==typeof e&&(t=new Date(e)),e instanceof Date&&(t=e),t?(t.setHours(0,0,0,0),t):e}),e),ao=e=>oi().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),co=()=>ai("Invalid email address").min(1,"Required"),uo=()=>ro(Ni("Valid amount required").positive("Positive amount required")),lo=()=>so(function(e){return function(e,t){return new e({type:"date",...ke(t)})}(Ci,e)}("Valid date required").min(new Date,"Date must be in the future")),po=e=>oi().max(e,`Maximum length is ${e} characters`),fo=ji({address1:ao(100),address2:po(100).optional(),city:ao(50),state:po(50).optional(),postcode:po(20).optional(),country:ao(50)}),ho=ji({amount:uo(),message:po(500).nullish(),giverFirstName:ao(50),giverLastName:ao(50),giverEmail:co(),giverPhone:ao(31),giverAddress:fo,cardHolder:ao(101),recipientFirstName:po(50).nullish(),recipientLastName:po(50).nullish(),recipientEmail:ai("Invalid email address").nullish(),recipientPhone:po(31).nullish()}),mo=ho.extend({expiry:lo(),notes:po(500).nullish()}),vo=ho.extend({companyId:Ni().int().positive(),sendViaEmail:function(e){return function(e,t){return new e({type:"boolean",...ke(t)})}(Ai,e)}().default(!0),payment:ji({cardHolder:ao(30),cardNumberToken:ao(50),cardExpiry:ao(5),cardCvcToken:ao(50)}).optional()}),go=ji({grant_type:oi().readonly().default("refresh_token"),client_id:Nn(ui,undefined),client_secret:oi(),refresh_token:oi(),scope:oi().optional()});const _o=ji({email:ai(),firstName:oi().max(100).optional(),lastName:oi().max(100).optional(),phone:oi().max(20).optional(),scopes:Fi(oi()).optional()}),yo=e=>{let t=0;const n=Object.values(e.itinerary);for(const e of n){const n=Object.keys(e.nights);for(const i of n)t+=e.nights[i].total}return t};var zo=i(60),bo=i.n(zo);const Po=e=>new(bo())(e).toDecimalPlaces(2).toNumber();function ko(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=Po(n);switch(e.feeType){case T.PercentageOfBooking:if(o)return Po(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return Po(a/(1-t)*e.amount/(100+e.amount))}return Po(a*(e.amount/100));case T.FixedChargePerRoom:case T.FixedChargePerBooking:return e.amount;case T.NightlyChargePerRoom:return Po(e.amount*i);default:return 0}}const wo=[T.FixedChargePerBooking],Eo=[T.PercentageOfBooking,T.FixedChargePerRoom,T.NightlyChargePerRoom],To=[T.PercentageOfBooking];function No(e,t){return e.filter((e=>t.includes(e.feeType)))}function Io(e){return No(e,wo)}function $o(e){return No(e,Eo)}function Ao(e){return No(e,To)}function Oo(e){return{includeInRates:[T.PercentageOfBooking,T.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===T.PercentageOfBooking,appliesToAddons:e===T.PercentageOfBooking,includePreviousFeesInCalculation:e===T.PercentageOfBooking}}const xo=e=>e,Zo=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},Ro=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class Co{}function So(e){return e.toUpperCase()}Co.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===N.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===N.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(n*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(i=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(o=e.childQuantity*Number(e.childPrice));let r=n+i+o;return I.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},Co.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Co.calculateBaseAddonTotal(n,t);let o=0;return(n.fee||n.fees?.length)&&n.quantity?n.fees?.length?n.fees.forEach((e=>{o+=n.quantity*e.amount})):o=n.quantity*Number(n.fee):((n.adultFee||n.adultFees?.length)&&n.adultQuantity&&(n.adultFees?.length?n.adultFees.forEach((e=>{o+=n.adultQuantity*e.amount})):o+=n.adultQuantity??1*Number(n.adultFee)),(n.childFee||n.childFees?.length)&&n.childQuantity&&(n.childFees?.length?n.childFees.forEach((e=>{o+=n.childQuantity??1*e.amount})):o+=n.childQuantity*Number(n.childFee))),I.includes(n.pricingType)&&n.nights&&!t&&(o*=n.nights),{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),Co.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=Co.calculateBaseAddonTotal(n,t);let o=n.fees||0;n.itemisedFees?.length&&(o=n.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=n.itemisedFees?.length?i.addonTotal:i.addonTotal+o;return{price:e.price+i.indPrice,adultPrice:e.adultPrice+i.indAdultPrice,childPrice:e.childPrice+i.indChildPrice,totalFees:e.totalFees+o,total:e.total+i.addonTotal+o,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),Co.calculateTotalForReservation=(e,t=!1)=>{let n=0;return e.itemisedFees?.forEach((e=>{n+=e.amount})),e.reservations.forEach((e=>{n+=e.total.afterTax;const i=Object.keys(e.nights)?.length??0;if(n+=e.fees??0,e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=Co.calculateReservationAddonTotal(o,t)?.total}})),Po(n)}})(),o})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomstay/core",
3
- "version": "0.1.63-2",
3
+ "version": "0.1.63",
4
4
  "description": "Details shared between Roomstay libraries. Anything from Currency, to Generic types",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -1,24 +0,0 @@
1
- export type IDailyRevenue = {
2
- date: string;
3
- revenue: number;
4
- };
5
- export type IDailyRoomBreakdown = {
6
- date: string;
7
- roomName: string;
8
- purchases: number;
9
- };
10
- export type IRegionBreakdown = {
11
- country: string;
12
- region: string;
13
- purchases: number;
14
- revenue: number;
15
- };
16
- export type IBigQueryResponse = {
17
- purchases: number;
18
- cancellations: number;
19
- revenue: number;
20
- conversionRate: number;
21
- dailyRevenue: IDailyRevenue[];
22
- dailyRoomsBreakdown: IDailyRoomBreakdown[];
23
- regionBreakdown: IRegionBreakdown[];
24
- };
@@ -1,89 +0,0 @@
1
- import { EHotelCardProcessor } from './IBookingPayment.type';
2
- export declare enum ESplitPaymentState {
3
- INITIATED = "initiated",
4
- GIFTCARD_AUTHORIZED = "giftcard_authorized",
5
- CC_AUTHORIZED = "cc_authorized",
6
- CAPTURED = "captured",
7
- FAILED = "failed",
8
- ROLLED_BACK = "rolled_back"
9
- }
10
- export declare enum ESplitPaymentStatus {
11
- PENDING = "pending",
12
- AUTHORIZED = "authorized",
13
- CAPTURED = "captured",
14
- FAILED = "failed"
15
- }
16
- export interface IGiftCardPaymentDetails {
17
- amount: number;
18
- cardCode: string;
19
- authorizationId?: string;
20
- status: ESplitPaymentStatus;
21
- expiresAt?: Date;
22
- }
23
- export interface ICreditCardPaymentDetails {
24
- amount: number;
25
- processor: EHotelCardProcessor;
26
- authorizationId?: string;
27
- status: ESplitPaymentStatus;
28
- expiresAt?: Date;
29
- }
30
- export interface ISplitPayment {
31
- splitPaymentId: string;
32
- totalAmount: number;
33
- giftCard: IGiftCardPaymentDetails;
34
- creditCard: ICreditCardPaymentDetails;
35
- sessionState: ESplitPaymentState;
36
- createdAt: Date;
37
- updatedAt: Date;
38
- expiresAt: Date;
39
- }
40
- export interface ISplitPaymentSession {
41
- id: string;
42
- bookingId: number;
43
- companyId: number;
44
- hotelId: string;
45
- splitPayment: ISplitPayment;
46
- }
47
- export interface IInitiateSplitPaymentRequest {
48
- bookingId: number;
49
- giftCardCode: string;
50
- giftCardAmount: number;
51
- creditCardAmount: number;
52
- }
53
- export interface IInitiateSplitPaymentResponse {
54
- sessionId: string;
55
- giftCardAmount: number;
56
- creditCardAmount: number;
57
- expiresAt: Date;
58
- }
59
- export interface IAuthorizationResult {
60
- success: boolean;
61
- authorizationId?: string;
62
- expiresAt?: Date;
63
- error?: string;
64
- }
65
- export interface ICaptureResult {
66
- success: boolean;
67
- giftCardCaptured: boolean;
68
- creditCardCaptured: boolean;
69
- error?: string;
70
- }
71
- export interface ISplitPaymentCheckoutDetails {
72
- sessionId: string;
73
- currentStep: 'giftcard' | 'creditcard' | 'capture';
74
- giftCard: {
75
- amount: number;
76
- status: ESplitPaymentStatus;
77
- authorizationId?: string;
78
- expiresAt?: Date;
79
- };
80
- creditCard: {
81
- amount: number;
82
- status: ESplitPaymentStatus;
83
- processor?: EHotelCardProcessor;
84
- redirectUrl?: string;
85
- authorizationId?: string;
86
- expiresAt?: Date;
87
- };
88
- expiresAt: Date;
89
- }
@@ -1,6 +0,0 @@
1
- export interface IFeeOptions {
2
- includeInRates: boolean;
3
- alreadyIncludedInRates: boolean;
4
- appliesToAddons: boolean;
5
- includePreviousFeesInCalculation: boolean;
6
- }
@@ -1,8 +0,0 @@
1
- export declare enum ERMSAuthSyncHistoryStatus {
2
- Success = "success",
3
- Failure = "failure",
4
- New = "new",
5
- Queued = "queued",
6
- InProgress = "in_progress",
7
- RequireResume = "require_resume"
8
- }
@@ -1,38 +0,0 @@
1
- export declare enum ERMSSyncStrategy {
2
- /**
3
- * Super-admin granular sync strategies
4
- */
5
- Hotel = "hotel",
6
- HotelImages = "hotelImages",
7
- Cancellation = "cancellation",
8
- Room = "room",
9
- Rates = "rates",
10
- OneGuaranteePolicy = "oneGuaranteePolicy",
11
- RoomRates = "roomRates",
12
- RoomImages = "roomImages",
13
- BookingSources = "booking-sources",
14
- Areas = "areas",
15
- Dwellings = "dwellings",
16
- AreaDwellings = "areaDwellings",
17
- ConvertDwellingConfigToAuxInput = "convertDwellingConfigToAuxInput",
18
- Discounts = "discounts",
19
- PropertyDiscounts = "propertyDiscounts",
20
- RoomDiscounts = "roomDiscounts",
21
- PropertySundries = "propertySundries",
22
- PropertyFees = "propertyFees",
23
- PropertyCards = "property-cards",
24
- Countries = "countries",
25
- Addons = "addons",
26
- Requirements = "requirements",
27
- RoomAddons = "room-addons",
28
- /**
29
- * Client-facing sync strategies
30
- */
31
- ClientFacingPromoSync = "clientFacingPromoSync",
32
- ClientFacingRoomSync = "clientFacingRoomSync",
33
- ClientFacingRateSync = "clientFacingRateSync",
34
- /**
35
- * Other sync strategies
36
- */
37
- NewRateFetch = "newRateFetch"
38
- }
@@ -1,8 +0,0 @@
1
- import { ERMSAuthSyncHistoryStatus } from './ERMSAuthSyncHistoryStatus.type';
2
- export type IRMSSyncResponse = {
3
- id: number;
4
- status: ERMSAuthSyncHistoryStatus;
5
- additionalData: any;
6
- syncData: string | null;
7
- syncType: string;
8
- };
File without changes