@roomstay/core 0.1.53-3 → 0.1.53-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/index.d.ts +0 -0
  2. package/dist/node.js +1 -1
  3. package/dist/node.js.LICENSE.txt +7 -0
  4. package/dist/types/Addons/Addon.type.d.ts +24 -0
  5. package/dist/types/Booking/Booking.types.d.ts +7 -0
  6. package/dist/types/Booking/EBookingStatus.type.d.ts +7 -0
  7. package/dist/types/Booking/IBookingCreateErrorResponse.d.ts +11 -0
  8. package/dist/types/Booking/IBookingPayment.type.d.ts +1 -1
  9. package/dist/types/Booking/IBookingQuote.type.d.ts +0 -0
  10. package/dist/types/Booking/IBookingStatus.type.d.ts +5 -0
  11. package/dist/types/Booking/ICheckoutBrowserSession.type.d.ts +14 -0
  12. package/dist/types/Booking/ICommonQueryParameters.d.ts +3 -0
  13. package/dist/types/Booking/IConfirmBooking.type.d.ts +19 -0
  14. package/dist/types/Booking/IConfirmBookingRequest.d.ts +14 -0
  15. package/dist/types/Booking/IConfirmBookingRequest.type.d.ts +14 -0
  16. package/dist/types/Booking/IGetBooking.type.d.ts +7 -0
  17. package/dist/types/Booking/IItinerary.type.d.ts +99 -0
  18. package/dist/types/Booking/IItineraryResponse.d.ts +105 -0
  19. package/dist/types/Booking/IPackage.type.d.ts +89 -0
  20. package/dist/types/Booking/IPencilReservation.type.d.ts +16 -0
  21. package/dist/types/Booking/IPlaceBooking.type.d.ts +83 -0
  22. package/dist/types/Booking/IPrice.type.d.ts +7 -0
  23. package/dist/types/Booking/IRollbackBooking.type.d.ts +6 -0
  24. package/dist/types/Booking/Package.types.d.ts +89 -0
  25. package/dist/types/Company/ECompanyProvider.enum.d.ts +0 -0
  26. package/dist/types/Company/IAdminCompany.type.d.ts +0 -0
  27. package/dist/types/Company/IAdminCompanyUser.type.d.ts +0 -0
  28. package/dist/types/Events/IRoomstayEvent.type.d.ts +0 -0
  29. package/dist/types/General/Format.types.d.ts +1 -0
  30. package/dist/types/General/HttpMethod.enum.d.ts +0 -0
  31. package/dist/types/General/IJsonString.type.d.ts +6 -0
  32. package/dist/types/General/Pagination.types.d.ts +19 -0
  33. package/dist/types/GiftCards/GiftCard.types.d.ts +29 -0
  34. package/dist/types/GiftCards/GiftCardAuth.types.d.ts +31 -0
  35. package/dist/types/Hotel/EHotelPriceModel.enum.d.ts +0 -0
  36. package/dist/types/Hotel/EHotelWeekdayStartsOn.enum.d.ts +0 -0
  37. package/dist/types/Hotel/IAuxiliaryFilter.type.d.ts +0 -0
  38. package/dist/types/Hotel/IHotelColorScheme.type.d.ts +0 -0
  39. package/dist/types/Hotel/IHotelOverrides.type.d.ts +0 -0
  40. package/dist/types/Hotel/IHotelReplica.type.d.ts +0 -0
  41. package/dist/types/Hotel/IHotelService.type.d.ts +0 -0
  42. package/dist/types/Image/IRoomstayImage.type.d.ts +0 -0
  43. package/dist/types/Member/IRoomstayCognitoMember.type.d.ts +0 -0
  44. package/dist/types/Member/IRoomstayMember.type.d.ts +0 -0
  45. package/dist/types/Member/IRoomstayMemberBooking.type.d.ts +0 -0
  46. package/dist/types/Member/IRoomstayMemberBookingAddress.type.d.ts +0 -0
  47. package/dist/types/Member/IRoomstayMemberBookingItem.type.d.ts +0 -0
  48. package/dist/types/Member/IRoomstayMemberBookingProfile.type.d.ts +0 -0
  49. package/dist/types/Member/IRoomstayMemberCards.type.d.ts +0 -0
  50. package/dist/types/Member/ISession.type.d.ts +0 -0
  51. package/dist/types/Package/IPackage.type.d.ts +101 -0
  52. package/dist/types/Pagination.types.d.ts +11 -0
  53. package/dist/types/Policies/EGuaranteePolicy.enum.d.ts +0 -0
  54. package/dist/types/RMS/ERMSDiscountType.enum.d.ts +0 -0
  55. package/dist/types/RMS/IRMSPropertyDiscount.type.d.ts +0 -0
  56. package/dist/types/RMS/IRMSRequirement.type.d.ts +0 -0
  57. package/dist/types/Room/IRoomGroup.type.d.ts +0 -0
  58. package/dist/types/index.d.ts +10 -1
  59. package/dist/utils/bookingTotal.d.ts +0 -0
  60. package/dist/utils/index.d.ts +10 -9
  61. package/dist/utils/nameof.d.ts +2 -0
  62. package/dist/utils/roomstayImageResize.d.ts +0 -0
  63. package/dist/utils/uppercaseString.d.ts +0 -0
  64. package/dist/utils/zodUtils.d.ts +19 -0
  65. package/dist/web.js +1 -1
  66. package/dist/web.js.LICENSE.txt +7 -0
  67. package/package.json +8 -2
package/dist/index.d.ts CHANGED
File without changes
package/dist/node.js CHANGED
@@ -1 +1 @@
1
- (()=>{"use strict";var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},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 i,o,n,r,a,d;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>I,AddonPricingType:()=>f,EAddonPricingType:()=>i,EBookingFlow:()=>n,EBookingPaymentMethod:()=>r,EBookingStatus:()=>o,ECompanyProvider:()=>u,EDistanceUnitType:()=>E,EFeeType:()=>O,EGuarantyPolicyPrepaymentType:()=>T,EHotelCardProcessor:()=>a,EHotelPriceModel:()=>h,EHotelStateFieldConfiguration:()=>g,EHotelWeekdayStartsOn:()=>y,EIntegration:()=>R,EPlanpayBookingStatus:()=>d,ERMSDiscountType:()=>N,ERoomstayEventSource:()=>v,ERoomstayImageSize:()=>m,GuestProfile:()=>P,HttpMethod:()=>C,IAuxiliaryFilterType:()=>_,IMaintenanceStatusService:()=>p,ItineraryResponse:()=>s,PCIBookingCardProcessorTypes:()=>c,Package:()=>A,Reservation:()=>l,ReservedPackage:()=>F,RoundingType:()=>L,TotalCalculator:()=>V,calculateFeeAmount:()=>k,calculateTotalForMemberBooking:()=>S,getFeeOptionValidity:()=>w,getFilteredBookingAddonFees:()=>Y,getFilteredBookingFees:()=>M,getFilteredBookingRateFees:()=>x,nameof:()=>j,resizeRoomstayImageUrl:()=>W,roundMoney:()=>U,subset:()=>q,uppercaseString:()=>z}),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"}(i||(i={})),function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(o||(o={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(n||(n={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard"}(r||(r={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.CommWeb="CommWeb"}(a||(a={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(d||(d={}));const c=[];class s{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 l{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 P,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 P{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 u,h,g,y,R,_,E,N,m,p,T,v,C,O,f;!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay"}(u||(u={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(h||(h={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(g||(g={})),function(e){e.Monday="monday",e.Sunday="sunday"}(y||(y={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(R||(R={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(_||(_={})),function(e){e.Metric="metric",e.Imperial="imperial"}(E||(E={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(N||(N={})),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"}(m||(m={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(p||(p={}));class A{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 F extends A{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.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(T||(T={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(v||(v={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(C||(C={})),function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(O||(O={})),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"}(f||(f={}));const I=[f.PER_NIGHT,f.PER_PERSON_PER_NIGHT,f.PER_QUANTITY_NAME_PER_NIGHT,f.PER_ROOM_QUANTITY_PER_NIGHT,f.PER_PERSON_OCCUPANCY_PER_NIGHT,f.PER_ADULT_OCCUPANCY_PER_NIGHT,f.PER_CHILD_OCCUPANCY_PER_NIGHT,f.PER_ALL_PERSONS_PER_NIGHT],S=e=>{let t=0;const i=Object.values(e.itinerary);for(const e of i){const i=Object.keys(e.nights);for(const o of i)t+=e.nights[o].total}return t},H=require("decimal.js");var D=e.n(H);const L={UP:D().ROUND_UP,DOWN:D().ROUND_DOWN,CEIL:D().ROUND_CEIL,FLOOR:D().ROUND_FLOOR,HALF_UP:D().ROUND_HALF_UP,HALF_DOWN:D().ROUND_HALF_DOWN,HALF_EVEN:D().ROUND_HALF_EVEN,HALF_CEIL:D().ROUND_HALF_CEIL,HALF_FLOOR:D().ROUND_HALF_FLOOR},U=(e,t)=>{const{precision:i=2,rounding:o=L.HALF_UP}=t||{};return new(D())(e).toDecimalPlaces(i,o).toNumber()};function k(e,t={}){const{baseAmount:i=0,numberOfNights:o=1,feeIncludedInBaseAmount:n=!1,extractedFromRates:r=!1,removedPercentages:a=[]}=t,d=U(i);switch(e.feeType){case O.PercentageOfBooking:if(n)return U(d*e.amount/(100+e.amount));if(r){const t=a.reduce(((e,t)=>e+t/(100+t)),0);return U(d/(1-t)*e.amount/(100+e.amount))}return U(d*(e.amount/100));case O.FixedChargePerRoom:case O.FixedChargePerBooking:return e.amount;case O.NightlyChargePerRoom:return U(e.amount*o);default:return 0}}const G=[O.FixedChargePerBooking],B=[O.PercentageOfBooking,O.FixedChargePerRoom,O.NightlyChargePerRoom],b=[O.PercentageOfBooking];function Q(e,t){return e.filter((e=>t.includes(e.feeType)))}function M(e){return Q(e,G)}function x(e){return Q(e,B)}function Y(e){return Q(e,b)}function w(e){return{includeInRates:[O.PercentageOfBooking,O.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===O.PercentageOfBooking,appliesToAddons:e===O.PercentageOfBooking,includePreviousFeesInCalculation:e===O.PercentageOfBooking}}const j=e=>e,q=(e,t)=>{const i={};return t.forEach((t=>{t in e&&(i[t]=e[t])})),i},W=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class V{}function z(e){return e.toUpperCase()}V.calculateBaseAddonTotal=(e,t)=>{let i=0,o=0,n=0;e.price&&e.quantity&&(i=e.quantity*Number(e.price)),e.pricingType===f.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?i*=e.adultQuantity:e.pricingType===f.PER_CHILD_OCCUPANCY_PER_NIGHT&&e.childQuantity&&(i*=e.childQuantity),e.adultPrice&&e.adultQuantity&&(o=e.adultQuantity*Number(e.adultPrice)),e.childPrice&&e.childQuantity&&(n=e.childQuantity*Number(e.childPrice));let r=i+o+n;return I.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:i,indAdultPrice:o,indChildPrice:n,addonTotal:r}},V.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,i)=>{const o=V.calculateBaseAddonTotal(i,t);let n=0;return(i.fee||i.fees?.length)&&i.quantity?i.fees?.length?i.fees.forEach((e=>{n+=i.quantity*e.amount})):n=i.quantity*Number(i.fee):((i.adultFee||i.adultFees?.length)&&i.adultQuantity&&(i.adultFees?.length?i.adultFees.forEach((e=>{n+=i.adultQuantity*e.amount})):n+=i.adultQuantity??1*Number(i.adultFee)),(i.childFee||i.childFees?.length)&&i.childQuantity&&(i.childFees?.length?i.childFees.forEach((e=>{n+=i.childQuantity??1*e.amount})):n+=i.childQuantity*Number(i.childFee))),I.includes(i.pricingType)&&i.nights&&!t&&(n*=i.nights),{price:e.price+o.indPrice,adultPrice:e.adultPrice+o.indAdultPrice,childPrice:e.childPrice+o.indChildPrice,totalFees:e.totalFees+n,total:e.total+o.addonTotal+n}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0})),V.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,i)=>{const o=V.calculateBaseAddonTotal(i,t);let n=i.fees||0;i.itemisedFees?.length&&(n=i.itemisedFees.reduce(((e,t)=>e+t.amount),0));const r=i.itemisedFees?.length?o.addonTotal:o.addonTotal+n;return{price:e.price+o.indPrice,adultPrice:e.adultPrice+o.indAdultPrice,childPrice:e.childPrice+o.indChildPrice,totalFees:e.totalFees+n,total:e.total+o.addonTotal+n,displayPrice:e.displayPrice+r}}),{price:0,adultPrice:0,childPrice:0,totalFees:0,total:0,displayPrice:0})),V.calculateTotalForReservation=(e,t=!1)=>{let i=0;return e.itemisedFees?.forEach((e=>{i+=e.amount})),e.reservations.forEach((e=>{i+=e.total.afterTax;const o=Object.keys(e.nights)?.length??0;if(e.addons?.length){const n=(e.addons??[]).map((e=>({...e,nights:o})));i+=V.calculateReservationAddonTotal(n,t)?.total}})),U(i)},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;e.r(t),e.d(t,{ADDON_PER_NIGHT_TYPES:()=>A,AddGiftCardSchema:()=>Li,AddonPricingType:()=>R,DATE_FORMAT:()=>T,EAddonPricingType:()=>n,EBookingFlow:()=>u,EBookingPaymentMethod:()=>i,EBookingStatus:()=>a,ECompanyProvider:()=>c,EDistanceUnitType:()=>m,EFeeType:()=>I,EGuarantyPolicyPrepaymentType:()=>y,EHotelCardProcessor:()=>o,EHotelPriceModel:()=>d,EHotelStateFieldConfiguration:()=>l,EHotelWeekdayStartsOn:()=>p,EIntegration:()=>h,EPlanpayBookingStatus:()=>r,ERMSDiscountType:()=>v,ERoomstayEventSource:()=>P,ERoomstayImageSize:()=>_,GuestProfile:()=>w,HttpMethod:()=>z,IAuxiliaryFilterType:()=>f,IMaintenanceStatusService:()=>g,ItineraryResponse:()=>b,PCIBookingCardProcessorTypes:()=>s,Package:()=>E,RefreshGiftCardTokenSchema:()=>Hi,RegisterGiftCardAdminSchema:()=>Mi,Reservation:()=>k,ReservedPackage:()=>N,RoundingType:()=>Vi,TotalCalculator:()=>ao,calculateFeeAmount:()=>Qi,calculateTotalForMemberBooking:()=>Gi,getFeeOptionValidity:()=>io,getFilteredBookingAddonFees:()=>no,getFilteredBookingFees:()=>eo,getFilteredBookingRateFees:()=>to,maxString:()=>ji,nameof:()=>oo,preprocessDate:()=>xi,preprocessNumber:()=>Zi,requireEmail:()=>Fi,requireFutureDate:()=>Ui,requirePositiveAmount:()=>Di,requireString:()=>Si,resizeRoomstayImageUrl:()=>so,roundMoney:()=>Wi,subset:()=>ro,uppercaseString:()=>uo,validateFormWithZod:()=>Ci}),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={})),function(e){e.Card="Card",e.SavedCard="SavedCard",e.Planpay="Planpay",e.Adyen="Adyen",e.Afterpay="Afterpay",e.PCIBookingCard="PCIBookingCard"}(i||(i={})),function(e){e.Passthrough="Passthrough",e.Adyen="Adyen",e.Till="Till",e.RMSPay="RMSPay",e.Windcave="Windcave",e.CommWeb="CommWeb"}(o||(o={})),function(e){e.Unknown="unknown",e.Unpaid="unpaid",e.Accepted="accepted",e.Cancelled="cancelled",e.Refunded="refunded",e.Rejected="rejected"}(r||(r={}));const s=[];let a,u,c,d,l,p,h,f,m,v,_,g,y,P,z;!function(e){e.Pending="Pending",e.Processing="Processing",e.Committed="Committed",e.Cancelled="Cancelled",e.Reverted="Reverted"}(a||(a={})),function(e){e.Default="Default",e.PreCheckoutPencil="PreCheckoutPencil",e.PostCheckoutPencil="PostCheckoutPencil"}(u||(u={}));class b{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 k{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 w,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 w{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}}!function(e){e.Synxis="Synxis",e.Availpro="Availpro",e.RMS="RMS",e.Siteminder="Siteminder",e.Roomstay="Roomstay"}(c||(c={})),function(e){e.PerPerson="PerPerson",e.PerDay="PerDay",e.PerOccupancy="PerOccupancy"}(d||(d={})),function(e){e.NotIncluded="NotIncluded",e.Optional="Optional",e.Required="Required"}(l||(l={})),function(e){e.Monday="monday",e.Sunday="sunday"}(p||(p={})),function(e){e.Big4="Big4",e.RmsTop10="Top10",e.Top10="NewTop10",e.Gday="Gday",e.Salesforce="Salesforce"}(h||(h={})),function(e){e.AreaDwellingLength="AreaDwellingLength",e.AreaDwellingType="AreaDwellingType"}(f||(f={})),function(e){e.Metric="metric",e.Imperial="imperial"}(m||(m={})),function(e){e.Percentage="Percentage",e.Amount="Amount",e.Bogo="BOGO",e.NightlyRateOverride="NightlyRateOverride"}(v||(v={})),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"}(_||(_={})),function(e){e.Frontend="frontend",e.Hotel="hotel",e.Events="events"}(g||(g={}));class E{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 E{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.FixedAmount="fixed",e.Percentage="percentage",e.Nights="nights"}(y||(y={})),function(e){e.Eventbrite="eventbrite",e.ATDW="atdw"}(P||(P={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE",e.PATCH="PATCH",e.OPTIONS="OPTIONS",e.HEAD="HEAD"}(z||(z={}));const T="DD/MM/YYYY";let I,R;!function(e){e.PercentageOfBooking="PercentageOfBooking",e.FixedChargePerRoom="FixedChargePerRoom",e.NightlyChargePerRoom="NightlyChargePerRoom",e.FixedChargePerBooking="FixedChargePerBooking",e.DepositSurcharge="DepositSurcharge"}(I||(I={})),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"}(R||(R={}));const A=[R.PER_NIGHT,R.PER_PERSON_PER_NIGHT,R.PER_QUANTITY_NAME_PER_NIGHT,R.PER_ROOM_QUANTITY_PER_NIGHT,R.PER_PERSON_OCCUPANCY_PER_NIGHT,R.PER_ADULT_OCCUPANCY_PER_NIGHT,R.PER_CHILD_OCCUPANCY_PER_NIGHT,R.PER_ALL_PERSONS_PER_NIGHT];function O(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 $ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const C={};function Z(e){return e&&Object.assign(C,e),C}const x=/^[cC][^\s-]{8,}$/,S=/^[0-9a-z]+$/,F=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,D=/^[0-9a-vA-V]{20}$/,U=/^[A-Za-z0-9]{27}$/,j=/^[a-zA-Z0-9_-]{21}$/,L=/^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})$/,M=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)$/,G=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,B=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,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})$/,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])$/,W=/^(([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_-]*$/,J=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,K=/^\+(?:[0-9]){6,14}[0-9]$/,X="(?:(?:\\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])))",ee=new RegExp(`^${X}$`);function te(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 ne=/^\d+$/,ie=/^-?\d+(?:\.\d+)?/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 ue(e){return null==e}function ce(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function de(e,t,n){Object.defineProperty(e,t,{get(){{const i=n();return e[t]=i,i}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function le(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function pe(e){return JSON.stringify(e)}const he=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function fe(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const me=ae((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function ve(e){if(!1===fe(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==fe(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}const _e=new Set(["string","number","symbol"]);function ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function Pe(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 ze={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 be(e,t=0){for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function ke(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function we(e){return"string"==typeof e?e:e?.message}function Ee(e,t,n){const i={...e,path:e.path??[]};if(!e.message){const o=we(e.inst?._zod.def?.error?.(e))??we(t?.error?.(e))??we(n.customError?.(e))??we(n.localeError?.(e))??"Invalid input";i.message=o}return delete i.inst,delete i.continue,t?.reportInput||delete i.input,i}function Ne(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Te(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const Ie=O("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Re={number:"number",bigint:"bigint",object:"date"},Ae=O("$ZodCheckLessThan",((e,t)=>{Ie.init(e,t);const n=Re[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})}})),Oe=O("$ZodCheckGreaterThan",((e,t)=>{Ie.init(e,t);const n=Re[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})}})),$e=O("$ZodCheckMultipleOf",((e,t)=>{Ie.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().split(".")[1]||"").length,o=n>i?n:i;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}(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})}})),Ce=O("$ZodCheckNumberFormat",((e,t)=>{Ie.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[o,r]=ze[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=ne)})),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",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})}})),Ze=O("$ZodCheckMaxLength",((e,t)=>{Ie.init(e,t),e._zod.when=e=>{const t=e.value;return!ue(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=Ne(i);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),xe=O("$ZodCheckMinLength",((e,t)=>{Ie.init(e,t),e._zod.when=e=>{const t=e.value;return!ue(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=Ne(i);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}})),Se=O("$ZodCheckLengthEquals",((e,t)=>{Ie.init(e,t),e._zod.when=e=>{const t=e.value;return!ue(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=Ne(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})}})),Fe=O("$ZodCheckStringFormat",((e,t)=>{var n,i;Ie.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=()=>{})})),De=O("$ZodCheckRegex",((e,t)=>{Fe.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})}})),Ue=O("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=oe),Fe.init(e,t)})),je=O("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=re),Fe.init(e,t)})),Le=O("$ZodCheckIncludes",((e,t)=>{Ie.init(e,t);const n=ge(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=O("$ZodCheckStartsWith",((e,t)=>{Ie.init(e,t);const n=new RegExp(`^${ge(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})}})),Me=O("$ZodCheckEndsWith",((e,t)=>{Ie.init(e,t);const n=new RegExp(`.*${ge(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})}})),Ge=O("$ZodCheckOverwrite",((e,t)=>{Ie.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Be{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 Ye=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,se,2),enumerable:!0})},Ve=O("$ZodError",Ye),We=O("$ZodError",Ye,{Parent:Error}),Qe=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=>Ee(e,r,Z()))));throw he(t,o?.callee),t}return s.value},qe=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=>Ee(e,r,Z()))));throw he(t,o?.callee),t}return s.value},Je=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??Ve)(r.issues.map((e=>Ee(e,o,Z()))))}:{success:!0,data:r.value}},Ke=Je(We),Xe=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=>Ee(e,o,Z()))))}:{success:!0,data:r.value}},et=Xe(We),tt={major:4,minor:0,patch:0},nt=O("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=tt;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=be(e);for(const r of t){if(r._zod.when){if(!r._zod.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=be(e,t)))}));else{if(e.issues.length===t)continue;o||(o=be(e,t))}}return i?i.then((()=>e)):e};e._zod.run=(n,o)=>{const r=e._zod.parse(n,o);if(r instanceof Promise){if(!1===o.async)throw new $;return r.then((e=>t(e,i,o)))}return t(r,i,o)}}e["~standard"]={validate:t=>{try{const n=Ke(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return et(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1}})),it=O("$ZodString",((e,t)=>{var n;nt.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}})),ot=O("$ZodStringFormat",((e,t)=>{Fe.init(e,t),it.init(e,t)})),rt=O("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=H),ot.init(e,t)})),st=O("$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=M(e))}else t.pattern??(t.pattern=M());ot.init(e,t)})),at=O("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=G),ot.init(e,t)})),ut=O("$ZodURL",((e,t)=>{ot.init(e,t),e._zod.check=n=>{try{const i=n.value,o=new URL(i),r=o.href;return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:J.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(!i.endsWith("/")&&r.endsWith("/")?n.value=r.slice(0,-1):n.value=r)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),ct=O("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ot.init(e,t)})),dt=O("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=j),ot.init(e,t)})),lt=O("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=x),ot.init(e,t)})),pt=O("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=S),ot.init(e,t)})),ht=O("$ZodULID",((e,t)=>{t.pattern??(t.pattern=F),ot.init(e,t)})),ft=O("$ZodXID",((e,t)=>{t.pattern??(t.pattern=D),ot.init(e,t)})),mt=O("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=U),ot.init(e,t)})),vt=O("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=te({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${X}T(?:${i})$`)}(t)),ot.init(e,t)})),_t=O("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=ee),ot.init(e,t)})),gt=O("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${te(t)}$`)),ot.init(e,t)})),yt=O("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=L),ot.init(e,t)})),Pt=O("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=B),ot.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.format="ipv4"}))})),zt=O("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=Y),ot.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})}}})),bt=O("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=V),ot.init(e,t)})),kt=O("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=W),ot.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 wt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Et=O("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=Q),ot.init(e,t),e._zod.onattach.push((e=>{e._zod.bag.contentEncoding="base64"})),e._zod.check=n=>{wt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}})),Nt=O("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=q),ot.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 wt(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})}})),Tt=O("$ZodE164",((e,t)=>{t.pattern??(t.pattern=K),ot.init(e,t)})),It=O("$ZodJWT",((e,t)=>{ot.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})}})),Rt=O("$ZodNumber",((e,t)=>{nt.init(e,t),e._zod.pattern=e._zod.bag.pattern??ie,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}})),At=O("$ZodNumber",((e,t)=>{Ce.init(e,t),Rt.init(e,t)})),Ot=O("$ZodUnknown",((e,t)=>{nt.init(e,t),e._zod.parse=e=>e})),$t=O("$ZodNever",((e,t)=>{nt.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)})),Ct=O("$ZodDate",((e,t)=>{nt.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 Zt(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}const xt=O("$ZodArray",((e,t)=>{nt.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=>Zt(t,n,e)))):Zt(a,n,e)}return r.length?Promise.all(r).then((()=>n)):n}}));function St(e,t,n){e.issues.length&&t.issues.push(...ke(n,e.issues)),t.value[n]=e.value}function Ft(e,t,n,i){e.issues.length?void 0===i[n]?t.value[n]=n in i?void 0:e.value:t.issues.push(...ke(n,e.issues)):void 0===e.value?n in i&&(t.value[n]=void 0):t.value[n]=e.value}const Dt=O("$ZodObject",((e,t)=>{nt.init(e,t);const n=ae((()=>{const e=Object.keys(t.shape);for(const n of e)if(!(t.shape[n]instanceof nt))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(i=t.shape,Object.keys(i).filter((e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout)));var i;return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}}));let i;de(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 o=fe,r=!C.jitless,s=r&&me.value,a=t.catchall;let u;e._zod.parse=(c,d)=>{u??(u=n.value);const l=c.value;if(!o(l))return c.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),c;const p=[];if(r&&s&&!1===d?.async&&!0!==d.jitless)i||(i=(e=>{const t=new Be(["shape","payload","ctx"]),i=n.value,o=e=>{const t=pe(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 i.keys)r[e]="key_"+s++;t.write("const newResult = {}");for(const e of i.keys)if(i.optionalKeys.has(e)){const n=r[e];t.write(`const ${n} = ${o(e)};`);const i=pe(e);t.write(`\n if (${n}.issues.length) {\n if (input[${i}] === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${i} in input) newResult[${i}] = undefined;\n } else {\n newResult[${i}] = ${n}.value;\n }\n `)}else{const n=r[e];t.write(`const ${n} = ${o(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${pe(e)}, ...iss.path] : [${pe(e)}]\n })));`),t.write(`newResult[${pe(e)}] = ${n}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),c=i(c,d);else{c.value={};const e=u.shape;for(const t of u.keys){const n=e[t],i=n._zod.run({value:l[t],issues:[]},d),o="optional"===n._zod.optin&&"optional"===n._zod.optout;i instanceof Promise?p.push(i.then((e=>o?Ft(e,c,t,l):St(e,c,t)))):o?Ft(i,c,t,l):St(i,c,t)}}if(!a)return p.length?Promise.all(p).then((()=>c)):c;const h=[],f=u.keySet,m=a._zod,v=m.def.type;for(const e of Object.keys(l)){if(f.has(e))continue;if("never"===v){h.push(e);continue}const t=m.run({value:l[e],issues:[]},d);t instanceof Promise?p.push(t.then((t=>St(t,c,e)))):St(t,c,e)}return h.length&&c.issues.push({code:"unrecognized_keys",keys:h,input:l,inst:e}),p.length?Promise.all(p).then((()=>c)):c}}));function Ut(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>Ee(e,i,Z())))))}),t}const jt=O("$ZodUnion",((e,t)=>{nt.init(e,t),de(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),de(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),de(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),de(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=>ce(e.source))).join("|")})$`)}})),e._zod.parse=(n,i)=>{let o=!1;const r=[];for(const e of t.options){const t=e._zod.run({value:n.value,issues:[]},i);if(t instanceof Promise)r.push(t),o=!0;else{if(0===t.issues.length)return t;r.push(t)}}return o?Promise.all(r).then((t=>Ut(t,n,e,i))):Ut(r,n,e,i)}})),Lt=O("$ZodIntersection",((e,t)=>{nt.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])=>Mt(e,t,n))):Mt(e,o,r)}}));function Ht(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(ve(e)&&ve(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=Ht(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=Ht(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 Mt(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),be(e))return e;const i=Ht(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 Gt=O("$ZodEnum",((e,t)=>{nt.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);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter((e=>_e.has(typeof e))).map((e=>"string"==typeof e?ge(e):e.toString())).join("|")})$`),e._zod.parse=(t,i)=>{const o=t.value;return e._zod.values.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}})),Bt=O("$ZodTransform",((e,t)=>{nt.init(e,t),e._zod.parse=(e,n)=>{const i=t.transform(e.value,e);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then((t=>(e.value=t,e)));if(i instanceof Promise)throw new $;return e.value=i,e}})),Yt=O("$ZodOptional",((e,t)=>{nt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",de(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),de(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ce(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,n):void 0===e.value?e:t.innerType._zod.run(e,n)})),Vt=O("$ZodNullable",((e,t)=>{nt.init(e,t),de(e._zod,"optin",(()=>t.innerType._zod.optin)),de(e._zod,"optout",(()=>t.innerType._zod.optout)),de(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ce(e.source)}|null)$`):void 0})),de(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)})),Wt=O("$ZodDefault",((e,t)=>{nt.init(e,t),e._zod.optin="optional",de(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(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=>Qt(e,t))):Qt(i,t)}}));function Qt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const qt=O("$ZodPrefault",((e,t)=>{nt.init(e,t),e._zod.optin="optional",de(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),Jt=O("$ZodNonOptional",((e,t)=>{nt.init(e,t),de(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=>Kt(t,e))):Kt(o,e)}}));function Kt(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 Xt=O("$ZodCatch",((e,t)=>{nt.init(e,t),e._zod.optin="optional",de(e._zod,"optout",(()=>t.innerType._zod.optout)),de(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(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=>Ee(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=>Ee(e,n,Z())))},input:e.value}),e.issues=[]),e)}})),en=O("$ZodPipe",((e,t)=>{nt.init(e,t),de(e._zod,"values",(()=>t.in._zod.values)),de(e._zod,"optin",(()=>t.in._zod.optin)),de(e._zod,"optout",(()=>t.out._zod.optout)),e._zod.parse=(e,n)=>{const i=t.in._zod.run(e,n);return i instanceof Promise?i.then((e=>tn(e,t,n))):tn(i,t,n)}}));function tn(e,t,n){return be(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const nn=O("$ZodReadonly",((e,t)=>{nt.init(e,t),de(e._zod,"propValues",(()=>t.innerType._zod.propValues)),de(e._zod,"values",(()=>t.innerType._zod.values)),de(e._zod,"optin",(()=>t.innerType._zod.optin)),de(e._zod,"optout",(()=>t.innerType._zod.optout)),e._zod.parse=(e,n)=>{const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(on):on(i)}}));function on(e){return e.value=Object.freeze(e.value),e}const rn=O("$ZodCustom",((e,t)=>{Ie.init(e,t),nt.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=>sn(t,n,i,e)));sn(o,n,i,e)}}));function sn(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(Te(e))}}Symbol("ZodOutput"),Symbol("ZodInput");class an{constructor(){this._map=new WeakMap,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}remove(e){return this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function un(){return new an}const cn=un();function dn(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Pe(t)})}function ln(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Pe(t)})}function pn(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Pe(t)})}function hn(e,t){return new Ae({check:"less_than",...Pe(t),value:e,inclusive:!1})}function fn(e,t){return new Ae({check:"less_than",...Pe(t),value:e,inclusive:!0})}function mn(e,t){return new Oe({check:"greater_than",...Pe(t),value:e,inclusive:!1})}function vn(e,t){return new Oe({check:"greater_than",...Pe(t),value:e,inclusive:!0})}function _n(e,t){return new $e({check:"multiple_of",...Pe(t),value:e})}function gn(e,t){return new Ze({check:"max_length",...Pe(t),maximum:e})}function yn(e,t){return new xe({check:"min_length",...Pe(t),minimum:e})}function Pn(e,t){return new Se({check:"length_equals",...Pe(t),length:e})}function zn(e){return new Ge({check:"overwrite",tx:e})}const bn=O("ZodISODateTime",((e,t)=>{vt.init(e,t),Sn.init(e,t)}));const kn=O("ZodISODate",((e,t)=>{_t.init(e,t),Sn.init(e,t)}));const wn=O("ZodISOTime",((e,t)=>{gt.init(e,t),Sn.init(e,t)}));const En=O("ZodISODuration",((e,t)=>{yt.init(e,t),Sn.init(e,t)}));const Nn=(e,t)=>{Ve.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)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},Tn=(O("ZodError",Nn),O("ZodError",Nn,{Parent:Error})),In=Qe(Tn),Rn=qe(Tn),An=Je(Tn),On=Xe(Tn),$n=O("ZodType",((e,t)=>(nt.init(e,t),e.def=t,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)=>ye(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>In(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>An(e,t,n),e.parseAsync=async(t,n)=>Rn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>On(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Pe(n)})}(Oi,e,t)}(t,n)),e.superRefine=t=>e.check(function(e,t){const n=function(e,t){const n=new Ie({check:"custom",...Pe(undefined)});return n._zod.check=e,n}((t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(Te(e,t.value,n._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),t.issues.push(Te(i))}},e(t.value,t))));return n}(t)),e.overwrite=t=>e.check(zn(t)),e.optional=()=>zi(e),e.nullable=()=>ki(e),e.nullish=()=>zi(ki(e)),e.nonoptional=t=>function(e,t){return new Ni({type:"nonoptional",innerType:e,...Pe(t)})}(e,t),e.array=()=>pi(e),e.or=t=>function(e,t){return new mi({type:"union",options:e,...Pe(t)})}([e,t]),e.and=t=>new vi({type:"intersection",left:e,right:t}),e.transform=t=>Ri(e,yi(t)),e.default=t=>{return n=t,new wi({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.prefault=t=>{return n=t,new Ei({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.catch=t=>{return new Ti({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Ri(e,t),e.readonly=()=>new Ai({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return cn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>cn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return cn.get(e);const n=e.clone();return cn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e))),Cn=O("_ZodString",((e,t)=>{it.init(e,t),$n.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 De({check:"string_format",format:"regex",...Pe(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Le({check:"string_format",format:"includes",...Pe(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new He({check:"string_format",format:"starts_with",...Pe(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Me({check:"string_format",format:"ends_with",...Pe(t),suffix:e})}(...t)),e.min=(...t)=>e.check(yn(...t)),e.max=(...t)=>e.check(gn(...t)),e.length=(...t)=>e.check(Pn(...t)),e.nonempty=(...t)=>e.check(yn(1,...t)),e.lowercase=t=>e.check(function(e){return new Ue({check:"string_format",format:"lowercase",...Pe(e)})}(t)),e.uppercase=t=>e.check(function(e){return new je({check:"string_format",format:"uppercase",...Pe(e)})}(t)),e.trim=()=>e.check(zn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return zn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(zn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(zn((e=>e.toUpperCase())))})),Zn=O("ZodString",((e,t)=>{it.init(e,t),Cn.init(e,t),e.email=t=>e.check(dn(Fn,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Pe(t)})}(Ln,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Pe(t)})}(ni,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Pe(t)})}(Hn,t)),e.guid=t=>e.check(ln(Un,t)),e.uuid=t=>e.check(pn(jn,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Pe(t)})}(jn,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Pe(t)})}(jn,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Pe(t)})}(jn,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Pe(t)})}(Mn,t)),e.guid=t=>e.check(ln(Un,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Pe(t)})}(Gn,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Pe(t)})}(Bn,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Pe(t)})}(Yn,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Pe(t)})}(Xn,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Pe(t)})}(ei,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Pe(t)})}(Vn,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Pe(t)})}(Wn,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Pe(t)})}(Qn,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Pe(t)})}(qn,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Pe(t)})}(Jn,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Pe(t)})}(Kn,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Pe(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,...Pe(t)})}(bn,e)}(t)),e.date=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Pe(t)})}(kn,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,...Pe(t)})}(wn,e)}(t)),e.duration=t=>e.check(function(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Pe(t)})}(En,e)}(t))}));function xn(e){return function(e,t){return new e({type:"string",...Pe(t)})}(Zn,e)}const Sn=O("ZodStringFormat",((e,t)=>{ot.init(e,t),Cn.init(e,t)})),Fn=O("ZodEmail",((e,t)=>{at.init(e,t),Sn.init(e,t)}));function Dn(e){return dn(Fn,e)}const Un=O("ZodGUID",((e,t)=>{rt.init(e,t),Sn.init(e,t)})),jn=O("ZodUUID",((e,t)=>{st.init(e,t),Sn.init(e,t)})),Ln=O("ZodURL",((e,t)=>{ut.init(e,t),Sn.init(e,t)})),Hn=O("ZodEmoji",((e,t)=>{ct.init(e,t),Sn.init(e,t)})),Mn=O("ZodNanoID",((e,t)=>{dt.init(e,t),Sn.init(e,t)})),Gn=O("ZodCUID",((e,t)=>{lt.init(e,t),Sn.init(e,t)})),Bn=O("ZodCUID2",((e,t)=>{pt.init(e,t),Sn.init(e,t)})),Yn=O("ZodULID",((e,t)=>{ht.init(e,t),Sn.init(e,t)})),Vn=O("ZodXID",((e,t)=>{ft.init(e,t),Sn.init(e,t)})),Wn=O("ZodKSUID",((e,t)=>{mt.init(e,t),Sn.init(e,t)})),Qn=O("ZodIPv4",((e,t)=>{Pt.init(e,t),Sn.init(e,t)})),qn=O("ZodIPv6",((e,t)=>{zt.init(e,t),Sn.init(e,t)})),Jn=O("ZodCIDRv4",((e,t)=>{bt.init(e,t),Sn.init(e,t)})),Kn=O("ZodCIDRv6",((e,t)=>{kt.init(e,t),Sn.init(e,t)})),Xn=O("ZodBase64",((e,t)=>{Et.init(e,t),Sn.init(e,t)})),ei=O("ZodBase64URL",((e,t)=>{Nt.init(e,t),Sn.init(e,t)})),ti=O("ZodE164",((e,t)=>{Tt.init(e,t),Sn.init(e,t)})),ni=O("ZodJWT",((e,t)=>{It.init(e,t),Sn.init(e,t)})),ii=O("ZodNumber",((e,t)=>{Rt.init(e,t),$n.init(e,t),e.gt=(t,n)=>e.check(mn(t,n)),e.gte=(t,n)=>e.check(vn(t,n)),e.min=(t,n)=>e.check(vn(t,n)),e.lt=(t,n)=>e.check(hn(t,n)),e.lte=(t,n)=>e.check(fn(t,n)),e.max=(t,n)=>e.check(fn(t,n)),e.int=t=>e.check(ri(t)),e.safe=t=>e.check(ri(t)),e.positive=t=>e.check(mn(0,t)),e.nonnegative=t=>e.check(vn(0,t)),e.negative=t=>e.check(hn(0,t)),e.nonpositive=t=>e.check(fn(0,t)),e.multipleOf=(t,n)=>e.check(_n(t,n)),e.step=(t,n)=>e.check(_n(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}));const oi=O("ZodNumberFormat",((e,t)=>{At.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",...Pe(t)})}(oi,e)}const si=O("ZodUnknown",((e,t)=>{Ot.init(e,t),$n.init(e,t)}));function ai(){return new si({type:"unknown"})}const ui=O("ZodNever",((e,t)=>{$t.init(e,t),$n.init(e,t)}));function ci(e){return function(e,t){return new e({type:"never",...Pe(t)})}(ui,e)}const di=O("ZodDate",((e,t)=>{Ct.init(e,t),$n.init(e,t),e.min=(t,n)=>e.check(vn(t,n)),e.max=(t,n)=>e.check(fn(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 li=O("ZodArray",((e,t)=>{xt.init(e,t),$n.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(yn(t,n)),e.nonempty=t=>e.check(yn(1,t)),e.max=(t,n)=>e.check(gn(t,n)),e.length=(t,n)=>e.check(Pn(t,n)),e.unwrap=()=>e.element}));function pi(e,t){return function(e,t,n){return new e({type:"array",element:t,...Pe(n)})}(li,e,t)}const hi=O("ZodObject",((e,t)=>{Dt.init(e,t),$n.init(e,t),de(e,"shape",(()=>t.shape)),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new _i({type:"enum",entries:n,...Pe(void 0)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ai()}),e.loose=()=>e.clone({...e._zod.def,catchall:ai()}),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(!ve(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return le(this,"shape",n),n},checks:[]};return ye(e,n)}(e,t),e.merge=t=>{return i=t,ye(n=e,{...n._zod.def,get shape(){const e={...n._zod.def.shape,...i._zod.def.shape};return le(this,"shape",e),e},catchall:i._zod.def.catchall,checks:[]});var n,i},e.pick=t=>function(e,t){const n={},i=e._zod.def;for(const e in t){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=i.shape[e])}return ye(e,{...e._zod.def,shape:n,checks:[]})}(e,t),e.omit=t=>function(e,t){const n={...e._zod.def.shape},i=e._zod.def;for(const e in t){if(!(e in i.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return ye(e,{...e._zod.def,shape:n,checks:[]})}(e,t),e.partial=(...t)=>function(e,t,n){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 ye(t,{...t._zod.def,shape:o,checks:[]})}(Pi,e,t[0]),e.required=(...t)=>function(e,t,n){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 ye(t,{...t._zod.def,shape:o,checks:[]})}(Ni,e,t[0])}));function fi(e,t){const n={type:"object",get shape(){return le(this,"shape",{...e}),this.shape},...Pe(t)};return new hi(n)}const mi=O("ZodUnion",((e,t)=>{jt.init(e,t),$n.init(e,t),e.options=t.options}));const vi=O("ZodIntersection",((e,t)=>{Lt.init(e,t),$n.init(e,t)})),_i=O("ZodEnum",((e,t)=>{Gt.init(e,t),$n.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 _i({...t,checks:[],...Pe(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 _i({...t,checks:[],...Pe(i),entries:o})}})),gi=O("ZodTransform",((e,t)=>{Bt.init(e,t),$n.init(e,t),e._zod.parse=(n,i)=>{n.addIssue=i=>{if("string"==typeof i)n.issues.push(Te(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),t.continue??(t.continue=!0),n.issues.push(Te(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then((e=>(n.value=e,n))):(n.value=o,n)}}));function yi(e){return new gi({type:"transform",transform:e})}const Pi=O("ZodOptional",((e,t)=>{Yt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function zi(e){return new Pi({type:"optional",innerType:e})}const bi=O("ZodNullable",((e,t)=>{Vt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType}));function ki(e){return new bi({type:"nullable",innerType:e})}const wi=O("ZodDefault",((e,t)=>{Wt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap})),Ei=O("ZodPrefault",((e,t)=>{qt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Ni=O("ZodNonOptional",((e,t)=>{Jt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType})),Ti=O("ZodCatch",((e,t)=>{Xt.init(e,t),$n.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap})),Ii=O("ZodPipe",((e,t)=>{en.init(e,t),$n.init(e,t),e.in=t.in,e.out=t.out}));function Ri(e,t){return new Ii({type:"pipe",in:e,out:t})}const Ai=O("ZodReadonly",((e,t)=>{nn.init(e,t),$n.init(e,t)})),Oi=O("ZodCustom",((e,t)=>{rn.init(e,t),$n.init(e,t)}));function $i(e,t){return Ri(yi(e),t)}function Ci(e,t,n){const i=t.safeParse(n);return i.success?i.data:(i.error.issues.forEach((t=>{const n=t.path.join(".");n in e.getValues()?e.setError(n,{type:"manual",message:t.message}):e.setError("root",{type:"manual",message:t.message})})),null)}const Zi=e=>$i((e=>{if(e){if("string"==typeof e){const t=Number(e);return isNaN(t)?e:t}return e}}),e),xi=e=>$i((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),Si=e=>xn().min(1,{error:"Required"}).max(e,`Maximum length is ${e} characters`),Fi=()=>Dn("Invalid email address").min(1,"Required"),Di=()=>Zi(function(e){return function(e,t){return new e({type:"number",checks:[],...Pe(t)})}(ii,e)}("Valid amount required").positive("Positive amount required")),Ui=()=>xi(function(e){return function(e,t){return new e({type:"date",...Pe(t)})}(di,e)}("Valid date required").min(new Date,"Date must be in the future")),ji=e=>xn().max(e,`Maximum length is ${e} characters`),Li=fi({amount:Di(),expiry:Ui(),giverFirstName:Si(50),giverLastName:Si(50),giverEmail:Fi(),giverPhone:Si(31),cardHolder:Si(100),recipientEmail:Fi(),recipientPhone:ji(31).nullish(),notes:ji(500).nullish()}),Hi=fi({grant_type:xn().readonly().default("refresh_token"),client_id:pn(jn,undefined),client_secret:xn(),refresh_token:xn(),scope:xn().optional()});const Mi=fi({email:Dn(),firstName:xn().max(100).optional(),lastName:xn().max(100).optional(),phone:xn().max(20).optional(),scopes:pi(xn()).optional()}),Gi=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},Bi=require("decimal.js");var Yi=e.n(Bi);const Vi={UP:Yi().ROUND_UP,DOWN:Yi().ROUND_DOWN,CEIL:Yi().ROUND_CEIL,FLOOR:Yi().ROUND_FLOOR,HALF_UP:Yi().ROUND_HALF_UP,HALF_DOWN:Yi().ROUND_HALF_DOWN,HALF_EVEN:Yi().ROUND_HALF_EVEN,HALF_CEIL:Yi().ROUND_HALF_CEIL,HALF_FLOOR:Yi().ROUND_HALF_FLOOR},Wi=(e,t)=>{const{precision:n=2,rounding:i=Vi.HALF_UP}=t||{};return new(Yi())(e).toDecimalPlaces(n,i).toNumber()};function Qi(e,t={}){const{baseAmount:n=0,numberOfNights:i=1,feeIncludedInBaseAmount:o=!1,extractedFromRates:r=!1,removedPercentages:s=[]}=t,a=Wi(n);switch(e.feeType){case I.PercentageOfBooking:if(o)return Wi(a*e.amount/(100+e.amount));if(r){const t=s.reduce(((e,t)=>e+t/(100+t)),0);return Wi(a/(1-t)*e.amount/(100+e.amount))}return Wi(a*(e.amount/100));case I.FixedChargePerRoom:case I.FixedChargePerBooking:return e.amount;case I.NightlyChargePerRoom:return Wi(e.amount*i);default:return 0}}const qi=[I.FixedChargePerBooking],Ji=[I.PercentageOfBooking,I.FixedChargePerRoom,I.NightlyChargePerRoom],Ki=[I.PercentageOfBooking];function Xi(e,t){return e.filter((e=>t.includes(e.feeType)))}function eo(e){return Xi(e,qi)}function to(e){return Xi(e,Ji)}function no(e){return Xi(e,Ki)}function io(e){return{includeInRates:[I.PercentageOfBooking,I.NightlyChargePerRoom].includes(e),extractFeeFromRates:e===I.PercentageOfBooking,appliesToAddons:e===I.PercentageOfBooking,includePreviousFeesInCalculation:e===I.PercentageOfBooking}}const oo=e=>e,ro=(e,t)=>{const n={};return t.forEach((t=>{t in e&&(n[t]=e[t])})),n},so=(e,t)=>e.includes("cdn.app.roomstay.io")?e+"?w="+t:e;class ao{}function uo(e){return e.toUpperCase()}ao.calculateBaseAddonTotal=(e,t)=>{let n=0,i=0,o=0;e.price&&e.quantity&&(n=e.quantity*Number(e.price)),e.pricingType===R.PER_ADULT_OCCUPANCY_PER_NIGHT&&e.adultQuantity?n*=e.adultQuantity:e.pricingType===R.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 A.includes(e.pricingType)&&e.nights&&!t&&(r*=e.nights),{indPrice:n,indAdultPrice:i,indChildPrice:o,addonTotal:r}},ao.calculateBasketAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=ao.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))),A.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})),ao.calculateReservationAddonTotal=(e,t=!1)=>(Array.isArray(e)||(e=[e]),e.reduce(((e,n)=>{const i=ao.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})),ao.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(e.addons?.length){const o=(e.addons??[]).map((e=>({...e,nights:i})));n+=ao.calculateReservationAddonTotal(o,t)?.total}})),Wi(n)},module.exports=t})();
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * decimal.js v10.4.3
3
+ * An arbitrary-precision Decimal type for JavaScript.
4
+ * https://github.com/MikeMcl/decimal.js
5
+ * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
6
+ * MIT Licence
7
+ */
@@ -0,0 +1,24 @@
1
+ export declare enum EAddonPricingType {
2
+ PER_STAY = "Per stay",
3
+ PER_NIGHT = "Per night",
4
+ PER_PERSON = "Per person",
5
+ PER_PERSON_PER_NIGHT = "Per person per night",
6
+ PER_ALL_PERSONS = "Per all persons",
7
+ PER_ALL_PERSONS_PER_NIGHT = "Per all persons per night"
8
+ }
9
+ export type IAddonPriceDetails = {
10
+ adultPrice: number;
11
+ childPrice: number;
12
+ price: number;
13
+ adultFee: number;
14
+ childFee: number;
15
+ fee: number;
16
+ adultFees?: IAddonPriceDetailsFee[];
17
+ childFees?: IAddonPriceDetailsFee[];
18
+ fees?: IAddonPriceDetailsFee[];
19
+ pricingType: EAddonPricingType;
20
+ };
21
+ export type IAddonPriceDetailsFee = {
22
+ name: string;
23
+ amount: number;
24
+ };
@@ -0,0 +1,7 @@
1
+ export declare enum EBookingStatus {
2
+ Pending = "Pending",
3
+ Processing = "Processing",
4
+ Committed = "Committed",
5
+ Cancelled = "Cancelled",
6
+ Reverted = "Reverted"
7
+ }
@@ -0,0 +1,7 @@
1
+ export declare enum EBookingStatus {
2
+ Pending = "Pending",
3
+ Processing = "Processing",
4
+ Committed = "Committed",
5
+ Cancelled = "Cancelled",
6
+ Reverted = "Reverted"
7
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This is the response body that comes down if a booking fails anywhere in the booking flow.
3
+ *
4
+ * Object will contain a public message only, with partial reservation data to be able to attempt to "resume" the booking
5
+ */
6
+ export type IBookingCreateErrorResponse = {
7
+ canRetryPayment: boolean;
8
+ isPaymentTaken: boolean;
9
+ publicMessage: string;
10
+ roomstayId: string;
11
+ };
@@ -22,7 +22,7 @@ export declare enum EHotelCardProcessor {
22
22
  CommWeb = "CommWeb"
23
23
  }
24
24
  export declare enum EPlanpayBookingStatus {
25
- Unknown = "unknown",
25
+ Unknown = "unknown",// incase plan.deposit.status is unavailable
26
26
  Unpaid = "unpaid",
27
27
  Accepted = "accepted",
28
28
  Cancelled = "cancelled",
File without changes
@@ -0,0 +1,5 @@
1
+ export declare enum IBookingStatus {
2
+ Pending = "Pending",
3
+ Committed = "Committed",
4
+ Cancelled = "Cancelled"
5
+ }
@@ -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
+ };
@@ -0,0 +1,3 @@
1
+ export type ICommonQueryParameters = {
2
+ language?: string;
3
+ };
@@ -0,0 +1,19 @@
1
+ import { IRoomstayMemberJWTData } from '../Member/IRoomstayMemberJWTData.type';
2
+ import { ICommonQueryParameters } from './ICommonQueryParameters.type';
3
+ import { ItineraryResponse } from './Itinerary.types';
4
+ export type IConfirmBookingRequest = {
5
+ reservationIds: string[];
6
+ itineraryId: string;
7
+ planpayCheckoutId?: string;
8
+ paymentId?: string;
9
+ roomstayId?: string;
10
+ frontendMember?: IRoomstayMemberJWTData;
11
+ source?: 'External' | 'Frontend' | 'Admin';
12
+ isBlocking?: boolean;
13
+ } & ICommonQueryParameters;
14
+ export type IConfirmBookingResponse = ItineraryResponse;
15
+ export type ICancelBookingRequest = {
16
+ email?: string;
17
+ reservationId: string;
18
+ frontendMember?: IRoomstayMemberJWTData;
19
+ } & ICommonQueryParameters;
@@ -0,0 +1,14 @@
1
+ import { IRoomstayMemberJWTData } from 'types/Member/IRoomstayMemberJWTData.type';
2
+ import { ICommonQueryParameters } from './ICommonQueryParameters';
3
+ import { IItineraryResponse } from './IItineraryResponse';
4
+ export type IConfirmBookingRequest = {
5
+ reservationIds: string[];
6
+ itineraryId: string;
7
+ planpayCheckoutId?: string;
8
+ paymentId?: string;
9
+ roomstayId?: string;
10
+ frontendMember?: IRoomstayMemberJWTData;
11
+ source?: 'External' | 'Frontend' | 'Admin';
12
+ isBlocking?: boolean;
13
+ } & ICommonQueryParameters;
14
+ export type IConfirmBookingResponse = IItineraryResponse;
@@ -0,0 +1,14 @@
1
+ import { IRoomstayMemberJWTData } from 'types/Member/IRoomstayMemberJWTData.type';
2
+ import { ICommonQueryParameters } from './ICommonQueryParameters.type';
3
+ import { IItineraryResponse } from './IItinerary.type';
4
+ export type IConfirmBookingRequest = {
5
+ reservationIds: string[];
6
+ itineraryId: string;
7
+ planpayCheckoutId?: string;
8
+ paymentId?: string;
9
+ roomstayId?: string;
10
+ frontendMember?: IRoomstayMemberJWTData;
11
+ source?: 'External' | 'Frontend' | 'Admin';
12
+ isBlocking?: boolean;
13
+ } & ICommonQueryParameters;
14
+ export type IConfirmBookingResponse = IItineraryResponse;
@@ -0,0 +1,7 @@
1
+ import { ICommonQueryParameters } from './ICommonQueryParameters.type';
2
+ import { ItineraryResponse } from './Itinerary.types';
3
+ export type IGetBookingRequest = {
4
+ email?: string;
5
+ reservationId: string;
6
+ } & ICommonQueryParameters;
7
+ export type IGetBookingResponse = ItineraryResponse;
@@ -0,0 +1,99 @@
1
+ import { EBookingPaymentMethod } from './IBookingPayment.type';
2
+ import { IPrice } from './IPrice.type';
3
+ import { IReservedPackage } from '../Package/IPackage.type';
4
+ export type IItineraryResponse = {
5
+ roomstayId: string;
6
+ itineraryNumber?: string;
7
+ total?: IAmount;
8
+ hotelFrontendId?: string;
9
+ reservations: IReservation[];
10
+ payment?: {
11
+ planpay?: {
12
+ id: string;
13
+ checkoutWorkflow: ICheckoutWorkflowType;
14
+ };
15
+ external?: {
16
+ id: string;
17
+ redirectUrl: string;
18
+ };
19
+ };
20
+ feesSummary?: IItemisedBookingFeeResponse[];
21
+ itemisedFees?: IItemisedBookingFeeResponse[];
22
+ warnings?: string[];
23
+ };
24
+ export type IReservation = {
25
+ reservationNumber: string;
26
+ roomType: string;
27
+ roomCode: string;
28
+ rate: string;
29
+ rateCode?: string;
30
+ images: string[];
31
+ guaranteePolicy?: string;
32
+ cancellationPolicy?: string;
33
+ checkInDate: string;
34
+ checkOutDate: string;
35
+ nights: {
36
+ [date: string]: IPrice;
37
+ };
38
+ guestCounts: IGuestCounts;
39
+ guest: IGuestProfile;
40
+ paymentCard: {
41
+ type: string | undefined;
42
+ last4: string;
43
+ expiry: string;
44
+ name: string;
45
+ };
46
+ paymentMethod: EBookingPaymentMethod;
47
+ total: IAmount;
48
+ status: string;
49
+ isCancelable: boolean;
50
+ addons: IReservedPackage[] | undefined;
51
+ comments?: string[];
52
+ specialRequests?: string[];
53
+ promoCode?: string;
54
+ guaranteePolicyLongDescription?: string;
55
+ cancellationPolicyLongDescription?: string;
56
+ itemisedFees?: IItemisedBookingFeeResponse[];
57
+ };
58
+ export type IGuestProfile = {
59
+ title?: string;
60
+ firstName?: string;
61
+ middleName?: string;
62
+ lastName?: string;
63
+ nameSuffix?: string;
64
+ phone?: string;
65
+ email?: string;
66
+ address: IAddress;
67
+ marketingOptIn?: boolean;
68
+ country: string;
69
+ };
70
+ export type IGuestCounts = {
71
+ adults: number;
72
+ children: number;
73
+ };
74
+ export type IAddress = {
75
+ line1?: string;
76
+ line2?: string;
77
+ line3?: string;
78
+ city?: string;
79
+ postalCode?: string;
80
+ state?: string;
81
+ country?: string;
82
+ };
83
+ export type IAmount = {
84
+ beforeTax: number;
85
+ afterTax: number;
86
+ beforeFees?: number;
87
+ };
88
+ export type ICheckoutWorkflowType = {
89
+ sdkWidget: {
90
+ type: string;
91
+ id: string;
92
+ scriptUrl: string;
93
+ };
94
+ };
95
+ export type IItemisedBookingFeeResponse = {
96
+ name: string;
97
+ description?: string;
98
+ amount: number;
99
+ };
@@ -0,0 +1,105 @@
1
+ import { EBookingPaymentMethod } from './IBookingPayment.type';
2
+ import { IReservedPackage } from './Package.types';
3
+ export type IItineraryResponse = {
4
+ roomstayId: string;
5
+ itineraryNumber?: string;
6
+ total?: IAmount;
7
+ hotelFrontendId?: string;
8
+ reservations: IReservation[];
9
+ payment?: {
10
+ planpay?: {
11
+ id: string;
12
+ checkoutWorkflow: ICheckoutWorkflowType;
13
+ };
14
+ external?: {
15
+ id: string;
16
+ redirectUrl: string;
17
+ };
18
+ };
19
+ feesSummary?: IItemisedBookingFeeResponse[];
20
+ itemisedFees?: IItemisedBookingFeeResponse[];
21
+ warnings?: string[];
22
+ };
23
+ export type IReservation = {
24
+ reservationNumber: string;
25
+ roomType: string;
26
+ roomCode: string;
27
+ rate: string;
28
+ rateCode?: string;
29
+ images: string[];
30
+ guaranteePolicy?: string;
31
+ cancellationPolicy?: string;
32
+ checkInDate: string;
33
+ checkOutDate: string;
34
+ nights: {
35
+ [date: string]: IPrice;
36
+ };
37
+ guestCounts: IGuestCounts;
38
+ guest: IGuestProfile;
39
+ paymentCard: {
40
+ type: string | undefined;
41
+ last4: string;
42
+ expiry: string;
43
+ name: string;
44
+ };
45
+ paymentMethod: EBookingPaymentMethod;
46
+ total: IAmount;
47
+ status: string;
48
+ isCancelable: boolean;
49
+ addons: IReservedPackage[] | undefined;
50
+ comments?: string[];
51
+ specialRequests?: string[];
52
+ promoCode?: string;
53
+ guaranteePolicyLongDescription?: string;
54
+ cancellationPolicyLongDescription?: string;
55
+ itemisedFees?: IItemisedBookingFeeResponse[];
56
+ };
57
+ export type IGuestProfile = {
58
+ title?: string;
59
+ firstName?: string;
60
+ middleName?: string;
61
+ lastName?: string;
62
+ nameSuffix?: string;
63
+ phone?: string;
64
+ email?: string;
65
+ address: IAddress;
66
+ marketingOptIn?: boolean;
67
+ country: string;
68
+ };
69
+ export type IGuestCounts = {
70
+ adults: number;
71
+ children: number;
72
+ };
73
+ export type IAddress = {
74
+ line1?: string;
75
+ line2?: string;
76
+ line3?: string;
77
+ city?: string;
78
+ postalCode?: string;
79
+ state?: string;
80
+ country?: string;
81
+ };
82
+ export type IAmount = {
83
+ beforeTax: number;
84
+ afterTax: number;
85
+ beforeFees?: number;
86
+ };
87
+ export type IPrice = {
88
+ cost: number;
89
+ discount: number;
90
+ tax: number;
91
+ fee: number;
92
+ total: number;
93
+ };
94
+ export type ICheckoutWorkflowType = {
95
+ sdkWidget: {
96
+ type: string;
97
+ id: string;
98
+ scriptUrl: string;
99
+ };
100
+ };
101
+ export type IItemisedBookingFeeResponse = {
102
+ name: string;
103
+ description?: string;
104
+ amount: number;
105
+ };
@@ -0,0 +1,89 @@
1
+ import { IAddonPriceDetailsFee } from 'types/Addons/Addon.type';
2
+ import { IItemisedBookingFeeResponse } from './IItinerary.type';
3
+ export type IPackage = {
4
+ /**
5
+ * The SynXis CR RatePlan Code associated with the Package if the Package is restricted to certain RatePlans
6
+ */
7
+ ratePlanCode?: string;
8
+ name: string;
9
+ description: string;
10
+ /**
11
+ * Whether the price for this package is included in the room rate.
12
+ * (Always `false` unless the price is zero)
13
+ */
14
+ inclusive: boolean;
15
+ image: string[];
16
+ url?: string;
17
+ /**
18
+ * Defines how a service is priced.
19
+ * Values:
20
+ * Per Stay
21
+ * Per Night
22
+ * Per Person
23
+ * Per Person Per Night
24
+ */
25
+ pricingType: string;
26
+ /**
27
+ * Number of available items for sale.
28
+ */
29
+ quantity?: number;
30
+ category: string;
31
+ cancelPenalty?: string | null;
32
+ guaranteeDescription?: string | null;
33
+ availability: {
34
+ [date: string]: IPriceInfo;
35
+ };
36
+ };
37
+ export type IReservedPackage = IPackage & {
38
+ code?: string | undefined;
39
+ price?: number;
40
+ fees?: number;
41
+ itemisedFees?: IItemisedBookingFeeResponse[];
42
+ adultQuantity?: number;
43
+ childQuantity?: number;
44
+ adultPrice?: number;
45
+ childPrice?: number;
46
+ startDate?: string;
47
+ startTime?: string;
48
+ hideDatePicker?: boolean;
49
+ order?: number;
50
+ };
51
+ export type IPriceInfo = {
52
+ /**
53
+ * Number of available items for sale.
54
+ */
55
+ quantity: number;
56
+ /**
57
+ * Price per quantity
58
+ */
59
+ price?: number;
60
+ adultPrice?: number;
61
+ childPrice?: number;
62
+ fees?: IAddonPriceDetailsFee[];
63
+ adultFees?: IAddonPriceDetailsFee[];
64
+ childFees?: IAddonPriceDetailsFee[];
65
+ timeSlots?: ITimeSlot[];
66
+ };
67
+ export type ITimeSlot = {
68
+ /**
69
+ The start date and time when the package is available.
70
+ If the package applies during the whole stay, this node is not returned unless the time needs to be selected. In that case, the Start and End dates do not
71
+ include the date: @Start="T07:30:00" and @End="T17:30:00" and @Increment="00:60:00"
72
+ Type: DateTime
73
+ **/
74
+ startTime?: string;
75
+ /**
76
+ The end date / time when the package is available.
77
+ If the package component applies during the whole stay, this node is not returned unless the time needs to be selected. In that case, the Start and End dates
78
+ do not include the date: @Start="T07:30:00" and @End="T17:30:00" and @Increment="00:60:00"
79
+ Type: DateTime
80
+ */
81
+ endTime?: string;
82
+ /**
83
+ Used with @Start and @End. Indicates the interval when the package or service is available.
84
+ For example, a package with golf lessons from 7:30 am to 5:30 pm with instructions and available hourly has the TimeSpan attributes set as: @Start="2015-
85
+ 010-28T07:30:00" and @End="2015-10-28T17:30:00" and @Increment="00:60:00"
86
+ Type: Time
87
+ */
88
+ increment?: string;
89
+ };