@bookitive/js 0.2.4 → 0.2.5
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/index.d.ts +56 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ interface DtoAPIError {
|
|
|
54
54
|
msg?: string;
|
|
55
55
|
/**
|
|
56
56
|
* Timestamp is when the error was produced (RFC 3339).
|
|
57
|
+
* @format date-time
|
|
57
58
|
* @example "2026-06-20T18:00:00Z"
|
|
58
59
|
*/
|
|
59
60
|
timestamp?: string;
|
|
@@ -88,6 +89,12 @@ interface DtoPublicAvailability {
|
|
|
88
89
|
* @example ["1810000000000000502"]
|
|
89
90
|
*/
|
|
90
91
|
reservedSeats?: string[];
|
|
92
|
+
/**
|
|
93
|
+
* ShowReserved mirrors the event's "share reserved status" setting, so
|
|
94
|
+
* clients can hide the reserved legend/state entirely when it is off.
|
|
95
|
+
* @example true
|
|
96
|
+
*/
|
|
97
|
+
showReserved?: boolean;
|
|
91
98
|
/** TicketTypeRemaining maps a ticket type id to its remaining capacity. */
|
|
92
99
|
ticketTypeRemaining?: Record<string, number>;
|
|
93
100
|
/**
|
|
@@ -169,6 +176,7 @@ interface DtoPublicEventInfo {
|
|
|
169
176
|
currency?: string;
|
|
170
177
|
/**
|
|
171
178
|
* EndTime is when the event ends (RFC 3339), when known.
|
|
179
|
+
* @format date-time
|
|
172
180
|
* @example "2026-06-20T23:00:00Z"
|
|
173
181
|
*/
|
|
174
182
|
endTime?: string;
|
|
@@ -182,6 +190,11 @@ interface DtoPublicEventInfo {
|
|
|
182
190
|
* @example "Výstaviště Praha"
|
|
183
191
|
*/
|
|
184
192
|
locationName?: string;
|
|
193
|
+
/**
|
|
194
|
+
* MarketingOptinEnabled: the organizer collects a marketing opt-in at
|
|
195
|
+
* checkout — the UI renders the consent checkbox (M1).
|
|
196
|
+
*/
|
|
197
|
+
marketingOptinEnabled?: boolean;
|
|
185
198
|
/**
|
|
186
199
|
* Name is the event's public display name.
|
|
187
200
|
* @example "Rockfest 2026"
|
|
@@ -199,9 +212,17 @@ interface DtoPublicEventInfo {
|
|
|
199
212
|
slug?: string;
|
|
200
213
|
/**
|
|
201
214
|
* StartTime is when doors/the event begins (RFC 3339).
|
|
215
|
+
* @format date-time
|
|
202
216
|
* @example "2026-06-20T18:00:00Z"
|
|
203
217
|
*/
|
|
204
218
|
startTime?: string;
|
|
219
|
+
/**
|
|
220
|
+
* Timezone is the event's IANA zone. StartTime (and every other schedule
|
|
221
|
+
* timestamp here) is an absolute instant; this is the wall clock it means
|
|
222
|
+
* at the venue, and what a buyer should be shown wherever they are.
|
|
223
|
+
* @example "Europe/Prague"
|
|
224
|
+
*/
|
|
225
|
+
timezone?: string;
|
|
205
226
|
/** WaitlistEnabled: sold-out ticket types accept waitlist signups (RFC 0008). */
|
|
206
227
|
waitlistEnabled?: boolean;
|
|
207
228
|
}
|
|
@@ -348,6 +369,7 @@ interface DtoPublicOrder {
|
|
|
348
369
|
discountCents?: number;
|
|
349
370
|
/**
|
|
350
371
|
* ExpiresAt is when the held seats and this order expire (RFC 3339).
|
|
372
|
+
* @format date-time
|
|
351
373
|
* @example "2026-06-20T18:15:00Z"
|
|
352
374
|
*/
|
|
353
375
|
expiresAt?: string;
|
|
@@ -449,6 +471,14 @@ interface DtoPublicOrderRequest {
|
|
|
449
471
|
* @uniqueItems false
|
|
450
472
|
*/
|
|
451
473
|
items: DtoPublicOrderItem[];
|
|
474
|
+
/**
|
|
475
|
+
* MarketingConsent mirrors the checkout's marketing opt-in checkbox. Only
|
|
476
|
+
* send true when the buyer explicitly ticked a consent box you showed
|
|
477
|
+
* them — the value is stored as consent evidence and honoured only when
|
|
478
|
+
* the organizer's opt-in setting is enabled.
|
|
479
|
+
* @example true
|
|
480
|
+
*/
|
|
481
|
+
marketingConsent?: boolean;
|
|
452
482
|
/**
|
|
453
483
|
* VerificationToken is the single-use token from the verify/check endpoint,
|
|
454
484
|
* required when the event demands a verified phone number.
|
|
@@ -539,6 +569,11 @@ interface DtoPublicSeat {
|
|
|
539
569
|
* @example "L12-3"
|
|
540
570
|
*/
|
|
541
571
|
code?: string;
|
|
572
|
+
/**
|
|
573
|
+
* Geom is editor-owned free-form chair geometry (polygon/oval); opaque,
|
|
574
|
+
* absent = default circle.
|
|
575
|
+
*/
|
|
576
|
+
geom?: object;
|
|
542
577
|
/**
|
|
543
578
|
* ID is the seat's stable id; availability and orders reference it.
|
|
544
579
|
* @example "1810000000000000501"
|
|
@@ -631,6 +666,16 @@ interface DtoPublicSection {
|
|
|
631
666
|
y?: number;
|
|
632
667
|
}
|
|
633
668
|
interface DtoPublicTable {
|
|
669
|
+
/**
|
|
670
|
+
* Bodies is editor-owned free-form geometry (polygon/oval table bodies; an
|
|
671
|
+
* array → composite tables). Opaque; absent for primitive tables.
|
|
672
|
+
*/
|
|
673
|
+
bodies?: object;
|
|
674
|
+
/**
|
|
675
|
+
* CornerRadius is the corner rounding of a rect table body, in canvas units.
|
|
676
|
+
* @example 5
|
|
677
|
+
*/
|
|
678
|
+
cornerRadius?: number;
|
|
634
679
|
/**
|
|
635
680
|
* Curve is the arc for row tables, in degrees (0 = straight row).
|
|
636
681
|
* @example 0
|
|
@@ -662,10 +707,10 @@ interface DtoPublicTable {
|
|
|
662
707
|
*/
|
|
663
708
|
rotation?: number;
|
|
664
709
|
/**
|
|
665
|
-
* Shape is the table outline: "round", "rect", or "
|
|
710
|
+
* Shape is the table outline: "round", "rect", "row", "poly", or "oval".
|
|
666
711
|
* @example "round"
|
|
667
712
|
*/
|
|
668
|
-
shape?: 'round' | 'rect' | 'row';
|
|
713
|
+
shape?: 'round' | 'rect' | 'row' | 'poly' | 'oval';
|
|
669
714
|
/**
|
|
670
715
|
* Sides is the seat count per edge for rect tables [top,right,bottom,left].
|
|
671
716
|
* @uniqueItems false
|
|
@@ -757,6 +802,7 @@ interface DtoPublicTicketType {
|
|
|
757
802
|
/**
|
|
758
803
|
* PriceChangesAt is the next scheduled price boundary (RFC 3339) — the widget
|
|
759
804
|
* can count down "early bird ends in …"; absent when the price won't change.
|
|
805
|
+
* @format date-time
|
|
760
806
|
* @example "2026-06-01T00:00:00Z"
|
|
761
807
|
*/
|
|
762
808
|
priceChangesAt?: string;
|
|
@@ -786,6 +832,7 @@ interface DtoPublicTicketType {
|
|
|
786
832
|
pros?: string[];
|
|
787
833
|
/**
|
|
788
834
|
* SaleEndTime is when this type stops selling (RFC 3339), if scheduled.
|
|
835
|
+
* @format date-time
|
|
789
836
|
* @example "2026-06-20T16:00:00Z"
|
|
790
837
|
*/
|
|
791
838
|
saleEndTime?: string;
|
|
@@ -793,6 +840,7 @@ interface DtoPublicTicketType {
|
|
|
793
840
|
salePaused?: boolean;
|
|
794
841
|
/**
|
|
795
842
|
* SaleStartTime is when this type goes on sale (RFC 3339), if scheduled.
|
|
843
|
+
* @format date-time
|
|
796
844
|
* @example "2026-01-15T10:00:00Z"
|
|
797
845
|
*/
|
|
798
846
|
saleStartTime?: string;
|
|
@@ -800,6 +848,7 @@ interface DtoPublicTicketType {
|
|
|
800
848
|
interface DtoPublicVerification {
|
|
801
849
|
/**
|
|
802
850
|
* ExpiresAt is when the token stops being accepted (RFC 3339).
|
|
851
|
+
* @format date-time
|
|
803
852
|
* @example "2026-06-20T18:30:00Z"
|
|
804
853
|
*/
|
|
805
854
|
expiresAt?: string;
|
|
@@ -912,7 +961,12 @@ interface ResponseAPIError {
|
|
|
912
961
|
fields?: Record<string, string>;
|
|
913
962
|
/** @example "see fields" */
|
|
914
963
|
msg: string;
|
|
964
|
+
/**
|
|
965
|
+
* @format date-time
|
|
966
|
+
* @example "2026-09-13T18:45:12Z"
|
|
967
|
+
*/
|
|
915
968
|
timestamp?: string;
|
|
969
|
+
/** @example "2b9c1f0e-6d4a-4a1b-9e0f-3c5d7a8b9c0d" */
|
|
916
970
|
traceId?: string;
|
|
917
971
|
type: ResponseType;
|
|
918
972
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/generated/api.ts","../src/live.ts","../src/fingerprint.ts","../src/client.ts","../src/checkoutErrors.ts"],"sourcesContent":["/* eslint-disable */\n/* tslint:disable */\n// @ts-nocheck\n/*\n * ---------------------------------------------------------------\n * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##\n * ## ##\n * ## AUTHOR: acacode ##\n * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##\n * ---------------------------------------------------------------\n */\n\n/** @example \"VALIDATION_FAILED\" */\nexport enum ResponseType {\n\tErrInvalidPayload = 'INVALID_PAYLOAD',\n\tErrValidationFailed = 'VALIDATION_FAILED',\n\tErrNotFound = 'NOT_FOUND',\n\tErrNotImplemented = 'NOT_IMPLEMENTED',\n\tErrConflict = 'CONFLICT',\n\tErrInternal = 'INTERNAL_ERROR',\n\tErrUnauthorized = 'UNAUTHORIZED',\n\tErrForbidden = 'FORBIDDEN',\n\tErrVerificationRequired = 'VERIFICATION_REQUIRED',\n\tErrMissingOrganizationID = 'MISSING_ORGANIZATION_ID',\n\tErrMissingUserID = 'MISSING_USER_ID',\n\tErrPerOrderLimits = 'PER_ORDER_LIMITS',\n\tErrPerCustomerLimit = 'PER_CUSTOMER_LIMIT',\n\tErrSoldOut = 'SOLD_OUT',\n\tErrSeatsTaken = 'SEATS_TAKEN',\n\tErrCapacityFull = 'CAPACITY_FULL',\n\tErrSaleWindow = 'SALE_WINDOW',\n\tErrSalesPaused = 'SALES_PAUSED',\n\tErrTicketTypePaused = 'TICKET_TYPE_PAUSED',\n\tErrNotOnSale = 'NOT_ON_SALE',\n\tErrDiscountInvalid = 'DISCOUNT_INVALID',\n\tErrDiscountExhausted = 'DISCOUNT_EXHAUSTED',\n\tErrVerificationInvalid = 'VERIFICATION_INVALID',\n\tErrAttendeesRequired = 'ATTENDEES_REQUIRED',\n\tErrTransferLocked = 'TRANSFER_LOCKED',\n\tErrTransferCodeRequired = 'TRANSFER_CODE_REQUIRED',\n\tErrTransferCodeInvalid = 'TRANSFER_CODE_INVALID',\n\tErrTooManyRequests = 'TOO_MANY_REQUESTS',\n}\n\n/**\n * Type is the stable, machine-readable error code.\n * @example \"CONFLICT\"\n */\nexport enum DtoErrorCode {\n\tErrInvalidPayload = 'INVALID_PAYLOAD',\n\tErrValidationFailed = 'VALIDATION_FAILED',\n\tErrNotFound = 'NOT_FOUND',\n\tErrConflict = 'CONFLICT',\n\tErrForbidden = 'FORBIDDEN',\n\tErrVerificationRequired = 'VERIFICATION_REQUIRED',\n\tErrInternal = 'INTERNAL_ERROR',\n}\n\nexport interface DtoAPIError {\n\t/** Data carries optional structured context for the error. */\n\tdata?: any;\n\t/** Fields maps a request field to a validation message, when applicable. */\n\tfields?: Record<string, string>;\n\t/**\n\t * Msg is a human-readable description of what went wrong.\n\t * @example \"seat is no longer available\"\n\t */\n\tmsg?: string;\n\t/**\n\t * Timestamp is when the error was produced (RFC 3339).\n\t * @example \"2026-06-20T18:00:00Z\"\n\t */\n\ttimestamp?: string;\n\t/**\n\t * TraceID identifies this request in our logs; include it in support asks.\n\t * @example \"01JABCDoftraceZ\"\n\t */\n\ttraceId?: string;\n\t/** Type is the stable, machine-readable error code. */\n\ttype?: DtoErrorCode;\n}\n\nexport interface DtoPublicAvailability {\n\t/** GARemaining maps a standing area id to its remaining capacity. */\n\tgaRemaining?: Record<string, number>;\n\t/**\n\t * LowStockThreshold is where \"low stock\" begins for this event — clients\n\t * show the low-stock line when remaining ≤ threshold. 0 = signal off.\n\t * @example 10\n\t */\n\tlowStockThreshold?: number;\n\t/**\n\t * RecentOrders counts orders placed in the last 30 minutes — a live\n\t * activity signal for urgency UI. Always 0 when the event disabled the\n\t * social-proof signal; clients choose their display threshold.\n\t * @example 4\n\t */\n\trecentOrders?: number;\n\t/**\n\t * ReservedSeats marks which unavailable seats are merely reserved and may\n\t * free up again — present only when the event shares reserved status.\n\t * @uniqueItems false\n\t * @example [\"1810000000000000502\"]\n\t */\n\treservedSeats?: string[];\n\t/** TicketTypeRemaining maps a ticket type id to its remaining capacity. */\n\tticketTypeRemaining?: Record<string, number>;\n\t/**\n\t * UnavailableSeats lists the ids of seats that cannot currently be bought.\n\t * @uniqueItems false\n\t * @example [\"1810000000000000501\",\"1810000000000000502\"]\n\t */\n\tunavailableSeats?: string[];\n}\n\n/** CheckoutTheme customises the hosted checkout; null = Bookitive defaults. */\nexport interface DtoPublicCheckoutTheme {\n\t/**\n\t * ButtonLabel overrides the submit button text.\n\t * @example \"Objednat\"\n\t */\n\tbuttonLabel?: string;\n\t/**\n\t * FontFamily is an allowlisted font key (self-hosted by Bookitive).\n\t * @example \"inter\"\n\t */\n\tfontFamily?: string;\n\t/**\n\t * Mode is the colour scheme: \"light\" or \"dark\".\n\t * @example \"light\"\n\t */\n\tmode?: 'light' | 'dark';\n\t/**\n\t * Radius is the corner radius for fields and buttons.\n\t * @example \"12px\"\n\t */\n\tradius?: string;\n}\n\nexport interface DtoPublicDiscount {\n\t/**\n\t * Code is the normalized (uppercase) promo code.\n\t * @example \"EARLYBIRD\"\n\t */\n\tcode?: string;\n\t/**\n\t * Kind is how the discount applies: \"percent\" of the items subtotal, or a\n\t * \"fixed\" amount in the event currency's minor units.\n\t * @example \"percent\"\n\t */\n\tkind?: 'percent' | 'fixed';\n\t/**\n\t * Value is 1-100 for percent, minor units for fixed.\n\t * @example 10\n\t */\n\tvalue?: number;\n}\n\nexport interface DtoPublicEvent {\n\t/** Event is the event's public identity: name, times, venue, currency. */\n\tevent?: DtoPublicEventInfo;\n\t/**\n\t * Floors lets a host page render its floor tabs without loading the full\n\t * seating payload; ids match the seating endpoint's floors.\n\t * @uniqueItems false\n\t */\n\tfloors?: DtoPublicFloorInfo[];\n\t/** Org is the organizer's public branding (name, logo, accent colour). */\n\torg?: DtoPublicOrg;\n\t/**\n\t * Protection describes the anti-scalping requirements a buyer must satisfy\n\t * at checkout (verified phone, named tickets). All-false when unprotected.\n\t */\n\tprotection?: DtoPublicProtection;\n\t/**\n\t * TicketTypes are the sellable ticket categories with prices and limits.\n\t * @uniqueItems false\n\t */\n\tticketTypes?: DtoPublicTicketType[];\n}\n\n/** Event is the event's public identity: name, times, venue, currency. */\nexport interface DtoPublicEventInfo {\n\t/**\n\t * Currency is the ISO 4217 code all prices are quoted in.\n\t * @example \"CZK\"\n\t */\n\tcurrency?: string;\n\t/**\n\t * EndTime is when the event ends (RFC 3339), when known.\n\t * @example \"2026-06-20T23:00:00Z\"\n\t */\n\tendTime?: string;\n\t/**\n\t * HoldTTLSeconds is how long a checkout holds selected seats before expiry.\n\t * @example 900\n\t */\n\tholdTtlSeconds?: number;\n\t/**\n\t * LocationName is the venue's display name, when set.\n\t * @example \"Výstaviště Praha\"\n\t */\n\tlocationName?: string;\n\t/**\n\t * Name is the event's public display name.\n\t * @example \"Rockfest 2026\"\n\t */\n\tname?: string;\n\t/**\n\t * SalesPaused: the organizer temporarily stopped all sales — the page\n\t * should say so instead of offering a checkout.\n\t */\n\tsalesPaused?: boolean;\n\t/**\n\t * Slug is the event's URL identifier (the {eventSlug} path parameter).\n\t * @example \"rockfest-2026\"\n\t */\n\tslug?: string;\n\t/**\n\t * StartTime is when doors/the event begins (RFC 3339).\n\t * @example \"2026-06-20T18:00:00Z\"\n\t */\n\tstartTime?: string;\n\t/** WaitlistEnabled: sold-out ticket types accept waitlist signups (RFC 0008). */\n\twaitlistEnabled?: boolean;\n}\n\nexport interface DtoPublicFloor {\n\t/**\n\t * Cons are short caveats for this floor, shown alongside the pros.\n\t * @uniqueItems false\n\t * @example [\"Standing only\"]\n\t */\n\tcons?: string[];\n\t/**\n\t * Description is optional customer-facing copy shown on the floor's tab.\n\t * @example \"Standing area in front of the main stage\"\n\t */\n\tdescription?: string;\n\t/**\n\t * ID is the floor's stable id; it matches PublicFloorInfo.id.\n\t * @example \"1810000000000000101\"\n\t */\n\tid?: string;\n\t/**\n\t * Mode is \"single\" (one open space) or \"sections\" (subdivided blocks).\n\t * @example \"sections\"\n\t */\n\tmode?: 'single' | 'sections';\n\t/**\n\t * Name is the floor's display label.\n\t * @example \"Ground floor\"\n\t */\n\tname?: string;\n\t/**\n\t * Position is the 1-based tab order among the event's floors.\n\t * @example 1\n\t */\n\tposition?: number;\n\t/**\n\t * Pros are short selling points for this floor, shown as a checklist.\n\t * @uniqueItems false\n\t * @example [\"Closest to the stage\",\"Great atmosphere\"]\n\t */\n\tpros?: string[];\n\t/**\n\t * Sections are the floor's blocks; a single-mode floor has exactly one.\n\t * @uniqueItems false\n\t */\n\tsections?: DtoPublicSection[];\n}\n\nexport interface DtoPublicFloorInfo {\n\t/**\n\t * Cons are short caveats for this floor, shown alongside the pros.\n\t * @uniqueItems false\n\t * @example [\"Standing only\"]\n\t */\n\tcons?: string[];\n\t/**\n\t * Description is optional customer-facing copy shown on the floor's tab.\n\t * @example \"Standing area in front of the main stage\"\n\t */\n\tdescription?: string;\n\t/**\n\t * ID is the floor's stable id; it matches a floor in the seating endpoint.\n\t * @example \"1810000000000000101\"\n\t */\n\tid?: string;\n\t/**\n\t * Mode is \"single\" (one open space) or \"sections\" (subdivided blocks).\n\t * @example \"sections\"\n\t */\n\tmode?: 'single' | 'sections';\n\t/**\n\t * Name is the floor's display label.\n\t * @example \"Ground floor\"\n\t */\n\tname?: string;\n\t/**\n\t * Position is the 1-based tab order among the event's floors.\n\t * @example 1\n\t */\n\tposition?: number;\n\t/**\n\t * Pros are short selling points for this floor, shown as a checklist.\n\t * @uniqueItems false\n\t * @example [\"Closest to the stage\",\"Great atmosphere\"]\n\t */\n\tpros?: string[];\n}\n\nexport interface DtoPublicGAArea {\n\t/**\n\t * Capacity is the total number of standing tickets this area can sell.\n\t * @example 500\n\t */\n\tcapacity?: number;\n\t/**\n\t * H is the area's height on the floor canvas.\n\t * @example 200\n\t */\n\th?: number;\n\t/**\n\t * ID is the standing area's stable id, referenced by availability/orders.\n\t * @example \"1810000000000000601\"\n\t */\n\tid?: string;\n\t/**\n\t * Label is the standing area's display name.\n\t * @example \"Pit\"\n\t */\n\tlabel?: string;\n\t/**\n\t * Rotation is the area's rotation in degrees.\n\t * @example 0\n\t */\n\trotation?: number;\n\t/**\n\t * TicketTypeID is the standing ticket type mapped to this area, when priced.\n\t * @example \"1810000000000000201\"\n\t */\n\tticketTypeId?: string;\n\t/**\n\t * W is the area's width on the floor canvas.\n\t * @example 600\n\t */\n\tw?: number;\n\t/**\n\t * X is the area's left offset on the floor canvas.\n\t * @example 100\n\t */\n\tx?: number;\n\t/**\n\t * Y is the area's top offset on the floor canvas.\n\t * @example 400\n\t */\n\ty?: number;\n}\n\nexport interface DtoPublicOrder {\n\t/**\n\t * Currency is the ISO 4217 code the total is quoted in.\n\t * @example \"CZK\"\n\t */\n\tcurrency?: string;\n\t/**\n\t * DiscountCents is what the redeemed promo code took off the total.\n\t * @example 14900\n\t */\n\tdiscountCents?: number;\n\t/**\n\t * ExpiresAt is when the held seats and this order expire (RFC 3339).\n\t * @example \"2026-06-20T18:15:00Z\"\n\t */\n\texpiresAt?: string;\n\t/** Payment carries the bank-transfer instructions for pending orders. */\n\tpayment?: DtoPublicPaymentDetail;\n\t/**\n\t * Reference is the order's human-facing reference (also the payment symbol).\n\t * @example \"RF26-000142\"\n\t */\n\treference?: string;\n\t/**\n\t * Status is the order lifecycle state at creation time. pending_review means\n\t * the order is held for organizer approval (RFC 0004 risk \"hold\" action).\n\t * @example \"pending\"\n\t */\n\tstatus?: 'pending' | 'pending_review' | 'paid' | 'cancelled' | 'expired';\n\t/**\n\t * TotalCents is the amount due in the event currency's minor units.\n\t * @example 149000\n\t */\n\ttotalCents?: number;\n}\n\n/** Customer is the buyer's contact details. */\nexport interface DtoPublicOrderCustomer {\n\t/**\n\t * Email is where the payment instructions and tickets are sent.\n\t * @example \"jana@example.com\"\n\t */\n\temail: string;\n\t/**\n\t * Name is the buyer's full name.\n\t * @maxLength 200\n\t * @example \"Jana Nováková\"\n\t */\n\tname: string;\n\t/**\n\t * Phone is an optional contact number.\n\t * @maxLength 50\n\t * @example \"+420123456789\"\n\t */\n\tphone?: string;\n}\n\nexport interface DtoPublicOrderItem {\n\t/**\n\t * Attendees carries one full name per admitted person when the event\n\t * requires named tickets — exactly Quantity names, in ticket order.\n\t * @uniqueItems false\n\t * @example [\"Jana Nováková\"]\n\t */\n\tattendees?: string[];\n\t/**\n\t * GAAreaID is the standing area's id for standing ticket types.\n\t * @example \"1810000000000000601\"\n\t */\n\tgaAreaId?: string;\n\t/**\n\t * Quantity is how many to buy — always 1 for a seat, 1+ for standing.\n\t * @min 1\n\t * @example 1\n\t */\n\tquantity: number;\n\t/**\n\t * SeatID is the chosen seat's id for seated ticket types.\n\t * @example \"1810000000000000501\"\n\t */\n\tseatId?: string;\n\t/**\n\t * TicketTypeID is the ticket type being bought (from the event endpoint).\n\t * @example \"1810000000000000201\"\n\t */\n\tticketTypeId: string;\n}\n\nexport interface DtoPublicOrderRequest {\n\t/**\n\t * CaptchaToken is the client-side captcha solution, verified server-side.\n\t * @example \"03AGdBq26…\"\n\t */\n\tcaptchaToken?: string;\n\t/** Customer is the buyer's contact details. */\n\tcustomer: DtoPublicOrderCustomer;\n\t/**\n\t * DiscountCode redeems a promo code (case-insensitive); the discount is\n\t * applied to the items subtotal and enforced against the code's limits.\n\t * @minLength 2\n\t * @maxLength 40\n\t * @example \"EARLYBIRD\"\n\t */\n\tdiscountCode?: string;\n\t/**\n\t * Fingerprint is a stable hash of the buyer's browser, computed client-side\n\t * and forwarded for device-velocity risk scoring (RFC 0004); optional.\n\t * @maxLength 128\n\t * @example \"a1b2c3d4e5f6\"\n\t */\n\tfingerprint?: string;\n\t/**\n\t * Items are the order lines; at least one is required.\n\t * @minItems 1\n\t * @uniqueItems false\n\t */\n\titems: DtoPublicOrderItem[];\n\t/**\n\t * VerificationToken is the single-use token from the verify/check endpoint,\n\t * required when the event demands a verified phone number.\n\t * @example \"3q2p8Zk1…\"\n\t */\n\tverificationToken?: string;\n\t/**\n\t * WaitlistClaimToken authorizes buying an offered quantity of a sold-out\n\t * type (RFC 0008); single-use, consumed with the order.\n\t */\n\twaitlistClaimToken?: string;\n}\n\n/** Org is the organizer's public branding (name, logo, accent colour). */\nexport interface DtoPublicOrg {\n\t/**\n\t * AccentColor is the organizer's brand colour as a hex string, if set.\n\t * @example \"#E5482F\"\n\t */\n\taccentColor?: string;\n\t/** CheckoutTheme customises the hosted checkout; null = Bookitive defaults. */\n\tcheckoutTheme?: DtoPublicCheckoutTheme;\n\t/**\n\t * LogoURL is an absolute URL to the organizer's logo, if set.\n\t * @example \"https://cdn.bookitive.com/orgs/rockfest/logo.png\"\n\t */\n\tlogoUrl?: string;\n\t/**\n\t * Name is the organizer's public display name.\n\t * @example \"Rockfest Productions\"\n\t */\n\tname?: string;\n\t/**\n\t * PrivacyURL is the organizer's own privacy policy.\n\t * @example \"https://rockfest.cz/ochrana-osobnich-udaju\"\n\t */\n\tprivacyUrl?: string;\n\t/**\n\t * Slug is the organizer's URL identifier (the {orgSlug} path parameter).\n\t * @example \"rockfest\"\n\t */\n\tslug?: string;\n\t/**\n\t * TermsURL is the organizer's own terms of sale — the organizer is the\n\t * seller, so the checkout links these next to Bookitive's buyer notice.\n\t * @example \"https://rockfest.cz/obchodni-podminky\"\n\t */\n\ttermsUrl?: string;\n}\n\n/** Payment carries the bank-transfer instructions for pending orders. */\nexport interface DtoPublicPaymentDetail {\n\t/**\n\t * BankAccount is the organizer's free-form payment destination.\n\t * @example \"123456789/0100\"\n\t */\n\tbankAccount?: string;\n\t/**\n\t * VariableSymbol identifies the payment — it equals the order reference.\n\t * @example \"26000142\"\n\t */\n\tvariableSymbol?: string;\n}\n\n/**\n * Protection describes the anti-scalping requirements a buyer must satisfy\n * at checkout (verified phone, named tickets). All-false when unprotected.\n */\nexport interface DtoPublicProtection {\n\t/**\n\t * PhonePrefixes is the allowlist of accepted international dialling codes\n\t * (e.g. \"+420\"). Only meaningful when RequireVerifiedPhone is set.\n\t * @uniqueItems false\n\t * @example [\"+420\",\"+421\"]\n\t */\n\tphonePrefixes?: string[];\n\t/**\n\t * RequireAttendeeNames demands one attendee name per admitted person.\n\t * @example false\n\t */\n\trequireAttendeeNames?: boolean;\n\t/**\n\t * RequireVerifiedPhone gates checkout behind SMS phone verification.\n\t * @example true\n\t */\n\trequireVerifiedPhone?: boolean;\n}\n\nexport interface DtoPublicSeat {\n\t/**\n\t * Code is the human-facing seat label (section prefix + table + seat).\n\t * @example \"L12-3\"\n\t */\n\tcode?: string;\n\t/**\n\t * ID is the seat's stable id; availability and orders reference it.\n\t * @example \"1810000000000000501\"\n\t */\n\tid?: string;\n\t/**\n\t * TableID is the owning table's id, when the seat belongs to a table.\n\t * @example \"1810000000000000401\"\n\t */\n\ttableId?: string;\n\t/**\n\t * TicketTypeID is the ticket type mapped to this seat, when priced.\n\t * @example \"1810000000000000201\"\n\t */\n\tticketTypeId?: string;\n\t/**\n\t * X is the seat centre's x on the floor canvas.\n\t * @example 245\n\t */\n\tx?: number;\n\t/**\n\t * Y is the seat centre's y on the floor canvas.\n\t * @example 158\n\t */\n\ty?: number;\n}\n\nexport interface DtoPublicSeating {\n\t/**\n\t * Floors are the chart's floors in tab order, each with its geometry.\n\t * @uniqueItems false\n\t */\n\tfloors?: DtoPublicFloor[];\n}\n\nexport interface DtoPublicSection {\n\t/** Decorations is opaque visual scenery (stage, walls, doors) — never sold. */\n\tdecorations?: object;\n\t/**\n\t * GAAreas are the standing areas (sold by quantity) in this section.\n\t * @uniqueItems false\n\t */\n\tgaAreas?: DtoPublicGAArea[];\n\t/**\n\t * H is the section's height on the floor canvas, if sized.\n\t * @example 300\n\t */\n\th?: number;\n\t/**\n\t * ID is the section's stable id.\n\t * @example \"1810000000000000301\"\n\t */\n\tid?: string;\n\t/**\n\t * Name is the section's display label.\n\t * @example \"Left block\"\n\t */\n\tname?: string;\n\t/** Polygon is the section's outline as an array of {x,y} points, if shaped. */\n\tpolygon?: object;\n\t/**\n\t * Prefix is prepended to seat codes in this section (e.g. \"L\" → \"L12-3\").\n\t * @example \"L\"\n\t */\n\tprefix?: string;\n\t/**\n\t * Seats are the individually sellable seats in this section.\n\t * @uniqueItems false\n\t */\n\tseats?: DtoPublicSeat[];\n\t/** Settings is opaque render config (chair gap/size, label typography). */\n\tsettings?: object;\n\t/**\n\t * Tables are the seated tables in this section.\n\t * @uniqueItems false\n\t */\n\ttables?: DtoPublicTable[];\n\t/**\n\t * W is the section's width on the floor canvas, if sized.\n\t * @example 400\n\t */\n\tw?: number;\n\t/**\n\t * X is the section's left offset on the floor canvas, if positioned.\n\t * @example 120\n\t */\n\tx?: number;\n\t/**\n\t * Y is the section's top offset on the floor canvas, if positioned.\n\t * @example 80\n\t */\n\ty?: number;\n}\n\nexport interface DtoPublicTable {\n\t/**\n\t * Curve is the arc for row tables, in degrees (0 = straight row).\n\t * @example 0\n\t */\n\tcurve?: number;\n\t/**\n\t * H is the height for rect tables, in canvas units.\n\t * @example 60\n\t */\n\th?: number;\n\t/**\n\t * ID is the table's stable id, referenced by PublicSeat.tableId.\n\t * @example \"1810000000000000401\"\n\t */\n\tid?: string;\n\t/**\n\t * Number is the table's display number within its section.\n\t * @example 12\n\t */\n\tnumber?: number;\n\t/**\n\t * Radius is the radius for round tables, in canvas units.\n\t * @example 45\n\t */\n\tradius?: number;\n\t/**\n\t * Rotation is the table's rotation in degrees.\n\t * @example 0\n\t */\n\trotation?: number;\n\t/**\n\t * Shape is the table outline: \"round\", \"rect\", or \"row\".\n\t * @example \"round\"\n\t */\n\tshape?: 'round' | 'rect' | 'row';\n\t/**\n\t * Sides is the seat count per edge for rect tables [top,right,bottom,left].\n\t * @uniqueItems false\n\t */\n\tsides?: number[];\n\t/**\n\t * Spacing is the gap between seats on a row table, in canvas units.\n\t * @example 24\n\t */\n\tspacing?: number;\n\t/**\n\t * W is the width for rect tables, in canvas units.\n\t * @example 120\n\t */\n\tw?: number;\n\t/**\n\t * X is the table centre's x on the floor canvas.\n\t * @example 240.5\n\t */\n\tx?: number;\n\t/**\n\t * Y is the table centre's y on the floor canvas.\n\t * @example 160\n\t */\n\ty?: number;\n}\n\nexport interface DtoPublicTicketType {\n\t/**\n\t * BasePriceCents is the regular price, present only when a scheduled phase is\n\t * currently active and differs from it — so the widget can show \"was €X\".\n\t * @example 179000\n\t */\n\tbasePriceCents?: number;\n\t/**\n\t * Color is the swatch used to tint seats/areas of this type, as hex.\n\t * @example \"#E5482F\"\n\t */\n\tcolor?: string;\n\t/**\n\t * Cons are short caveats for this ticket type, shown alongside the pros.\n\t * @uniqueItems false\n\t * @example [\"No seating\"]\n\t */\n\tcons?: string[];\n\t/**\n\t * Description is optional customer-facing copy for this ticket type.\n\t * @example \"Front-stage standing with a dedicated bar\"\n\t */\n\tdescription?: string;\n\t/**\n\t * ID is the ticket type's stable id, referenced by order items and seats.\n\t * @example \"1810000000000000201\"\n\t */\n\tid?: string;\n\t/**\n\t * Kind is \"seated\" (maps to a seat) or \"standing\" (sold by quantity).\n\t * @example \"standing\"\n\t */\n\tkind?: 'seated' | 'standing';\n\t/**\n\t * MaxPerCustomer caps how many of this type one verified buyer may hold\n\t * across orders (anti-scalping); absent when unlimited.\n\t * @example 4\n\t */\n\tmaxPerCustomer?: number;\n\t/**\n\t * MaxPerOrder caps how many of this type a single order may contain.\n\t * @example 6\n\t */\n\tmaxPerOrder?: number;\n\t/**\n\t * MinPerOrder appears only when it is a real constraint (> 1) — the\n\t * limit applies to orders that include this type at all.\n\t * @example 1\n\t */\n\tminPerOrder?: number;\n\t/**\n\t * Name is the ticket type's display label.\n\t * @example \"VIP\"\n\t */\n\tname?: string;\n\t/**\n\t * PriceCents is the EFFECTIVE unit price right now, in the event currency's\n\t * minor units — the base price, or an active scheduled phase's price (RFC\n\t * 0005). This is what the buyer pays.\n\t * @example 149000\n\t */\n\tpriceCents?: number;\n\t/**\n\t * PriceChangesAt is the next scheduled price boundary (RFC 3339) — the widget\n\t * can count down \"early bird ends in …\"; absent when the price won't change.\n\t * @example \"2026-06-01T00:00:00Z\"\n\t */\n\tpriceChangesAt?: string;\n\t/**\n\t * PricePhaseDescription is the active phase's optional organizer-authored\n\t * copy, shown in the widget's phase info popover.\n\t * @example \"Launch price for the first hundred fans.\"\n\t */\n\tpricePhaseDescription?: string;\n\t/**\n\t * PricePhaseName is the active phase's label (e.g. \"Early bird\"), if any.\n\t * @example \"Early bird\"\n\t */\n\tpricePhaseName?: string;\n\t/**\n\t * PricePhaseRemaining is how many tickets are left at the active phase's\n\t * price before its quantity cap (RFC 0005) — the \"12 left at early bird\"\n\t * urgency; absent when the active phase has no quantity cap.\n\t * @example 12\n\t */\n\tpricePhaseRemaining?: number;\n\t/**\n\t * Pros are short selling points for this ticket type, shown as a checklist.\n\t * @uniqueItems false\n\t * @example [\"Best view\",\"Dedicated bar\",\"Fast-track entry\"]\n\t */\n\tpros?: string[];\n\t/**\n\t * SaleEndTime is when this type stops selling (RFC 3339), if scheduled.\n\t * @example \"2026-06-20T16:00:00Z\"\n\t */\n\tsaleEndTime?: string;\n\t/** SalePaused: the organizer temporarily paused sales of this type. */\n\tsalePaused?: boolean;\n\t/**\n\t * SaleStartTime is when this type goes on sale (RFC 3339), if scheduled.\n\t * @example \"2026-01-15T10:00:00Z\"\n\t */\n\tsaleStartTime?: string;\n}\n\nexport interface DtoPublicVerification {\n\t/**\n\t * ExpiresAt is when the token stops being accepted (RFC 3339).\n\t * @example \"2026-06-20T18:30:00Z\"\n\t */\n\texpiresAt?: string;\n\t/**\n\t * Phone is the normalized number the token certifies.\n\t * @example \"+420777123456\"\n\t */\n\tphone?: string;\n\t/**\n\t * VerificationToken is consumed by exactly one order for this event.\n\t * @example \"5Yx…\"\n\t */\n\tverificationToken?: string;\n}\n\nexport interface DtoPublicVerifyCheckRequest {\n\t/**\n\t * Code is the OTP from the SMS.\n\t * @minLength 4\n\t * @maxLength 10\n\t * @example \"123456\"\n\t */\n\tcode: string;\n\t/**\n\t * @minLength 8\n\t * @maxLength 20\n\t * @example \"+420777123456\"\n\t */\n\tphone: string;\n}\n\nexport interface DtoPublicVerifyStartRequest {\n\t/**\n\t * CaptchaToken is the client-side captcha solution, verified server-side.\n\t * @example \"03AGdBq26…\"\n\t */\n\tcaptchaToken?: string;\n\t/**\n\t * Phone in international E.164 format.\n\t * @minLength 8\n\t * @maxLength 20\n\t * @example \"+420777123456\"\n\t */\n\tphone: string;\n}\n\nexport interface DtoPublicWaitlistClaim {\n\t/** @example \"anna@example.com\" */\n\temail?: string;\n\t/** @example \"Anna Nováková\" */\n\tname?: string;\n\tofferExpiresAt?: string;\n\t/** @example 2 */\n\tquantity?: number;\n\t/** @example \"734559411483578369\" */\n\tticketTypeId?: string;\n}\n\nexport interface DtoPublicWaitlistEntry {\n\t/** ClaimToken completes the purchase while the offer is active. */\n\tclaimToken?: string;\n\teventName?: string;\n\teventSlug?: string;\n\tofferExpiresAt?: string;\n\t/** OfferedQuantity and OfferExpiresAt are present while an offer is active. */\n\tofferedQuantity?: number;\n\t/** OfferedTicketTypeName labels the offer (\"2× VIP\"). */\n\tofferedTicketTypeName?: string;\n\t/** Event identity for the manage page's back link. */\n\torgSlug?: string;\n\t/**\n\t * Quantity still wanted.\n\t * @example 2\n\t */\n\tquantity?: number;\n\t/**\n\t * Status: waiting | offered | claimed | left | expired.\n\t * @example \"waiting\"\n\t */\n\tstatus?: string;\n\t/**\n\t * TicketTypeNames the entry waits for; empty = any type.\n\t * @uniqueItems false\n\t */\n\tticketTypeNames?: string[];\n}\n\nexport interface PublichandlerPayloadWaitlistJoin {\n\t/** @maxLength 200 */\n\temail: string;\n\t/**\n\t * FullOnly: only offer the complete quantity; partial releases go to the\n\t * next person in line.\n\t */\n\tfullOnly?: boolean;\n\t/**\n\t * @minLength 2\n\t * @maxLength 100\n\t */\n\tname?: string;\n\t/**\n\t * @min 1\n\t * @max 10\n\t */\n\tquantity: number;\n\t/**\n\t * TicketTypeIds: the set to wait for; empty/omitted = any type.\n\t * @maxItems 20\n\t * @uniqueItems false\n\t */\n\tticketTypeIds?: string[];\n}\n\nexport interface ResponseAPIError {\n\tdata?: any;\n\tfields?: Record<string, string>;\n\t/** @example \"see fields\" */\n\tmsg: string;\n\ttimestamp?: string;\n\ttraceId?: string;\n\ttype: ResponseType;\n}\n\nexport type ResponseAPIResponseEmpty = object;\n","// Live availability over websocket: {\"event\":\"startstate\"|\"seat\", data}.\n// Startstate re-fires on every reconnect, so consumers treat it as the\n// resync point and apply deltas on top.\nimport type { DtoPublicAvailability } from './generated/api';\n\n/** One seat changing state. \"reserved\" appears only when the event shares\n * reserved status publicly — a reserved seat may free up again. */\nexport interface SeatDelta {\n\tseatId: string;\n\ttaken: boolean;\n\tstatus: 'free' | 'reserved' | 'taken';\n}\n\nexport interface LiveHandlers {\n\t/** Full snapshot — on connect and on every reconnect. */\n\tonStartstate?: (availability: DtoPublicAvailability) => void;\n\t/** One seat changed. */\n\tonSeat?: (delta: SeatDelta) => void;\n\t/** Connection state changes (drive a \"live\" indicator if you like). */\n\tonConnectionChange?: (connected: boolean) => void;\n}\n\nconst INITIAL_BACKOFF_MS = 1000;\nconst MAX_BACKOFF_MS = 15000;\n\nexport class LiveSubscription {\n\t#url: string;\n\t#handlers: LiveHandlers;\n\t#ws: WebSocket | null = null;\n\t#backoff = INITIAL_BACKOFF_MS;\n\t#retry: ReturnType<typeof setTimeout> | null = null;\n\t#closed = false;\n\n\tconstructor(url: string, handlers: LiveHandlers) {\n\t\tthis.#url = url.replace(/^http/, 'ws');\n\t\tthis.#handlers = handlers;\n\t\tthis.#connect();\n\t}\n\n\tclose(): void {\n\t\tthis.#closed = true;\n\t\tif (this.#retry) clearTimeout(this.#retry);\n\t\tthis.#ws?.close();\n\t}\n\n\t#connect(): void {\n\t\tif (this.#closed) return;\n\t\tconst ws = new WebSocket(this.#url);\n\t\tthis.#ws = ws;\n\t\tws.onopen = () => {\n\t\t\tthis.#backoff = INITIAL_BACKOFF_MS;\n\t\t\tthis.#handlers.onConnectionChange?.(true);\n\t\t};\n\t\tws.onmessage = (event) => {\n\t\t\tlet message: { event?: string; data?: unknown };\n\t\t\ttry {\n\t\t\t\tmessage = JSON.parse(event.data as string);\n\t\t\t} catch {\n\t\t\t\treturn; // ignore malformed / non-JSON frames rather than throwing\n\t\t\t}\n\t\t\tif (message.event === 'startstate') {\n\t\t\t\tthis.#handlers.onStartstate?.(message.data as DtoPublicAvailability);\n\t\t\t} else if (message.event === 'seat') {\n\t\t\t\tthis.#handlers.onSeat?.(message.data as SeatDelta);\n\t\t\t}\n\t\t};\n\t\tws.onclose = () => {\n\t\t\tthis.#handlers.onConnectionChange?.(false);\n\t\t\tif (this.#closed) return;\n\t\t\t// Equal-jitter backoff: reconnect somewhere in [backoff/2, backoff) so a\n\t\t\t// mass disconnect doesn't produce a synchronized reconnect thundering herd.\n\t\t\tconst delay = this.#backoff / 2 + Math.random() * (this.#backoff / 2);\n\t\t\tthis.#retry = setTimeout(() => this.#connect(), delay);\n\t\t\tthis.#backoff = Math.min(this.#backoff * 2, MAX_BACKOFF_MS);\n\t\t};\n\t}\n}\n","// A lightweight, dependency-free browser device fingerprint for the anti-scalping\n// device_velocity signal (RFC 0004). It is intentionally coarse and privacy-light:\n// a stable-ish hash of a handful of ambient browser/screen traits, NOT a unique\n// per-user identifier. Its only job is to make one machine placing many orders —\n// even behind rotated emails/phones/proxies — cluster together server-side.\n//\n// It never throws and returns undefined off the browser (SSR) or when the traits\n// are unavailable, so callers can attach it opportunistically.\n\n// djb2 — a tiny, fast string hash; hex output keeps the value short + opaque.\nfunction hash(input: string): string {\n\tlet h = 5381;\n\tfor (let i = 0; i < input.length; i++) {\n\t\th = (h * 33) ^ input.charCodeAt(i);\n\t}\n\t// >>> 0 coerces to an unsigned 32-bit int before hex encoding.\n\treturn (h >>> 0).toString(16).padStart(8, '0');\n}\n\n/**\n * Compute a coarse device fingerprint for the current browser, or undefined when\n * not in a browser / when the ambient traits can't be read. Combines a few stable\n * traits (UA, language, platform, screen geometry, timezone, hardware hints) into\n * one short hash. Deliberately best-effort — two different browsers on the same\n * machine hash differently, which is fine: it only needs to cluster reuse.\n */\nexport function deviceFingerprint(): string | undefined {\n\ttry {\n\t\tif (typeof navigator === 'undefined' || typeof screen === 'undefined') return undefined;\n\t\tconst nav = navigator as Navigator & { deviceMemory?: number };\n\t\tconst traits = [\n\t\t\tnav.userAgent,\n\t\t\tnav.language,\n\t\t\t(nav.languages ?? []).join(','),\n\t\t\tnav.platform,\n\t\t\tnav.hardwareConcurrency,\n\t\t\tnav.deviceMemory,\n\t\t\tscreen.width,\n\t\t\tscreen.height,\n\t\t\tscreen.colorDepth,\n\t\t\t// Timezone offset is stable per machine locale and cheap to read.\n\t\t\tnew Date().getTimezoneOffset(),\n\t\t\tIntl.DateTimeFormat().resolvedOptions().timeZone,\n\t\t];\n\t\treturn hash(traits.map((t) => String(t ?? '')).join('|'));\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n","// The typed core of @bookitive/js: a thin fetch wrapper over the public\n// checkout API, addressed by org + event slug. All response and payload types\n// are generated from the backend's public swagger — they cannot drift.\nimport { DtoErrorCode } from './generated/api';\nimport type {\n\tDtoAPIError,\n\tDtoPublicAvailability,\n\tDtoPublicDiscount,\n\tDtoPublicEvent,\n\tDtoPublicOrder,\n\tDtoPublicOrderRequest,\n\tDtoPublicSeating,\n\tDtoPublicVerification,\n\tDtoPublicWaitlistEntry,\n\tPublichandlerPayloadWaitlistJoin,\n} from './generated/api';\nimport { LiveSubscription, type LiveHandlers } from './live';\nimport { deviceFingerprint } from './fingerprint';\n\nexport interface BookitiveClientOptions {\n\t/** API origin, e.g. \"https://api.bookitive.com\" (no trailing slash). */\n\tbaseUrl: string;\n\t/** Organization slug — the {org} in events.bookitive.com/{org}/{event}. */\n\torg: string;\n\t/** Event slug. */\n\tevent: string;\n\t/** Custom fetch (SSR frameworks pass their own). Defaults to global fetch. */\n\tfetch?: typeof fetch;\n}\n\n/** API failure with the backend's error envelope attached. */\nexport class BookitiveError extends Error {\n\treadonly status: number;\n\t/** The backend error code (e.g. DtoErrorCode.ErrConflict), or \"UNKNOWN\" when\n\t * the response carried no JSON envelope. */\n\treadonly type: DtoErrorCode | 'UNKNOWN';\n\t/** Structured detail for some codes (e.g. PER_ORDER_LIMITS carries\n\t * ticketType/min/max/requested) — feeds checkoutErrorMessage(). */\n\treadonly fields?: Record<string, string>;\n\n\tconstructor(status: number, body: DtoAPIError | undefined, fallback: string) {\n\t\tsuper(body?.msg ?? fallback);\n\t\tthis.name = 'BookitiveError';\n\t\tthis.status = status;\n\t\tthis.type = body?.type ?? 'UNKNOWN';\n\t\tthis.fields = body?.fields;\n\t}\n\n\t/** The selection raced another buyer — refresh availability and reselect. */\n\tget isConflict(): boolean {\n\t\treturn this.type === DtoErrorCode.ErrConflict || this.status === 409;\n\t}\n}\n\nexport class BookitiveClient {\n\treadonly #base: string;\n\treadonly #fetch: typeof fetch;\n\n\tconstructor(options: BookitiveClientOptions) {\n\t\tthis.#base = `${options.baseUrl.replace(/\\/$/, '')}/public/v1/orgs/${encodeURIComponent(\n\t\t\toptions.org\n\t\t)}/events/${encodeURIComponent(options.event)}`;\n\t\t// bind, or a browser's fetch throws \"Illegal invocation\" when called\n\t\t// detached from window\n\t\tthis.#fetch = options.fetch ?? ((...args) => fetch(...args));\n\t}\n\n\t/** Event identity, org branding, priced ticket types, and floor tabs. */\n\tevent(): Promise<DtoPublicEvent> {\n\t\treturn this.#get<DtoPublicEvent>('');\n\t}\n\n\t/** Static chart geometry: floors → sections → tables, seats, GA areas. */\n\tseating(): Promise<DtoPublicSeating> {\n\t\treturn this.#get<DtoPublicSeating>('/seating');\n\t}\n\n\t/** Live sellability snapshot (poll it, or use live() for push updates). */\n\tavailability(): Promise<DtoPublicAvailability> {\n\t\treturn this.#get<DtoPublicAvailability>('/availability');\n\t}\n\n\t/**\n\t * Previews a promo code: what applying it would do. Throws a\n\t * BookitiveError with status 404 for unknown/paused/out-of-window codes\n\t * and 409 (error.isConflict) when the code is fully redeemed. The order\n\t * endpoint re-validates on submit.\n\t */\n\tdiscount(code: string): Promise<DtoPublicDiscount> {\n\t\treturn this.#get<DtoPublicDiscount>(`/discount?code=${encodeURIComponent(code)}`);\n\t}\n\n\t/**\n\t * Places a bank-transfer reservation: seats are held atomically for the\n\t * event's hold TTL and payment instructions are emailed (and returned).\n\t * A 409 (error.isConflict) means a seat was just taken — refresh and\n\t * reselect.\n\t */\n\tasync checkout(order: DtoPublicOrderRequest): Promise<DtoPublicOrder> {\n\t\t// Attach a coarse device fingerprint for the anti-scalping device_velocity\n\t\t// signal (RFC 0004) unless the caller already supplied one. Best-effort:\n\t\t// undefined off the browser or when traits are unavailable.\n\t\tconst body: DtoPublicOrderRequest =\n\t\t\torder.fingerprint === undefined ? { ...order, fingerprint: deviceFingerprint() } : order;\n\t\tconst res = await this.#fetch(`${this.#base}/orders`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tbody: JSON.stringify(body),\n\t\t});\n\t\treturn this.#parse<DtoPublicOrder>(res, 'checkout failed');\n\t}\n\n\t/**\n\t * Sends a one-time code by SMS for events that require a verified phone\n\t * (event.protection.requireVerifiedPhone). Captcha-gated like checkout, so\n\t * pass a captcha token minted on the Bookitive origin. Throws a\n\t * BookitiveError: 400 (bad/disallowed number), 403 (captcha/blocked), or\n\t * 429 (cooldown/rate limit — back off and let the buyer retry).\n\t */\n\tasync verifyStart(phone: string, captchaToken?: string): Promise<void> {\n\t\tconst res = await this.#fetch(`${this.#base}/verify/start`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tbody: JSON.stringify({ phone, captchaToken }),\n\t\t});\n\t\tawait this.#parse<void>(res, 'failed to send verification code');\n\t}\n\n\t/**\n\t * Validates the SMS code and returns a single-use verificationToken (valid\n\t * ~30 min) to pass as order.verificationToken. Throws a BookitiveError:\n\t * 400 (wrong code), 410 (expired — resend), or 429 (too many attempts).\n\t */\n\tverifyCheck(phone: string, code: string): Promise<DtoPublicVerification> {\n\t\treturn this.#post<DtoPublicVerification>('/verify/check', { phone, code });\n\t}\n\n\t/**\n\t * Queues the buyer for a sold-out ticket type (RFC 0008); omit\n\t * ticketTypeId to wait for any type. Throws a BookitiveError: 400 while\n\t * the wanted quantity is still openly buyable, 409 (error.isConflict)\n\t * when this email is already waiting for the type.\n\t */\n\tjoinWaitlist(req: PublichandlerPayloadWaitlistJoin): Promise<DtoPublicWaitlistEntry> {\n\t\treturn this.#post<DtoPublicWaitlistEntry>('/waitlist', req);\n\t}\n\n\t/**\n\t * Subscribes to live availability over websocket: `startstate` fires with\n\t * the full snapshot on every (re)connect, then `seat` deltas stream in.\n\t * Reconnects automatically with backoff; call close() when done.\n\t */\n\tlive(handlers: LiveHandlers): LiveSubscription {\n\t\treturn new LiveSubscription(`${this.#base}/live`, handlers);\n\t}\n\n\tasync #get<T>(path: string): Promise<T> {\n\t\tconst res = await this.#fetch(`${this.#base}${path}`);\n\t\treturn this.#parse<T>(res, `request failed: ${path || '/'}`);\n\t}\n\n\tasync #post<T>(path: string, body: unknown): Promise<T> {\n\t\tconst res = await this.#fetch(`${this.#base}${path}`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tbody: JSON.stringify(body),\n\t\t});\n\t\treturn this.#parse<T>(res, `request failed: ${path}`);\n\t}\n\n\tasync #parse<T>(res: Response, fallback: string): Promise<T> {\n\t\tif (!res.ok) {\n\t\t\tlet body: DtoAPIError | undefined;\n\t\t\ttry {\n\t\t\t\tbody = (await res.json()) as DtoAPIError;\n\t\t\t} catch {\n\t\t\t\t// non-JSON error body — the fallback message covers it\n\t\t\t}\n\t\t\tthrow new BookitiveError(res.status, body, fallback);\n\t\t}\n\t\t// 204/205 never carry a body. Otherwise read the text and parse only\n\t\t// when it's non-empty — this avoids res.headers.get('content-length'),\n\t\t// which throws under SvelteKit's SSR fetch (response headers aren't\n\t\t// serialized by default) and would otherwise 500 any server-side load.\n\t\tif (res.status === 204 || res.status === 205) {\n\t\t\treturn undefined as T;\n\t\t}\n\t\tconst text = await res.text();\n\t\treturn (text ? JSON.parse(text) : undefined) as T;\n\t}\n}\n","// Buyer-facing texts for the public order API's error codes. The backend's\n// `msg` is an English developer string and must never reach a buyer; hosts\n// call checkoutErrorMessage() and fall back to their own generic copy when it\n// returns undefined (unknown code, network failure, plain Error).\nimport { BookitiveError } from './client';\n\ntype Lang = 'cs' | 'en';\ntype Message = string | ((fields: Record<string, string>) => string);\n\nconst MESSAGES: Record<Lang, Record<string, Message>> = {\n\tcs: {\n\t\tPER_ORDER_LIMITS: (f) =>\n\t\t\tf.min\n\t\t\t\t? `Vstupenek „${f.ticketType}“ je potřeba objednat alespoň ${f.min}.`\n\t\t\t\t: f.max\n\t\t\t\t\t? `Vstupenek „${f.ticketType}“ lze objednat nejvýše ${f.max} na jednu objednávku.`\n\t\t\t\t\t: 'Počet vstupenek je mimo povolený rozsah pro jednu objednávku.',\n\t\tPER_CUSTOMER_LIMIT:\n\t\t\t'Překročili jste maximální počet vstupenek na jednoho zákazníka pro tuto akci.',\n\t\tSOLD_OUT: 'Vybraný typ vstupenek je již vyprodaný.',\n\t\tSEATS_TAKEN: 'Některé z vybraných míst si právě zabral někdo jiný — vyberte prosím jiná.',\n\t\tCAPACITY_FULL: 'Kapacita vybrané zóny je již vyčerpaná.',\n\t\tSALE_WINDOW: 'Prodej tohoto typu vstupenek právě neprobíhá.',\n\t\tSALES_PAUSED: 'Pořadatel prodej vstupenek dočasně pozastavil. Zkuste to prosím později.',\n\t\tTICKET_TYPE_PAUSED: 'Prodej tohoto typu vstupenek je dočasně pozastaven.',\n\t\tNOT_ON_SALE: 'Prodej vstupenek na tuto akci právě neprobíhá.',\n\t\tDISCOUNT_INVALID: 'Zadaný slevový kód není platný.',\n\t\tDISCOUNT_EXHAUSTED: 'Zadaný slevový kód už byl vyčerpán.',\n\t\tVERIFICATION_INVALID: 'Ověření telefonu vypršelo — ověřte se prosím znovu.',\n\t\tATTENDEES_REQUIRED: 'Vyplňte prosím jméno pro každou vstupenku.',\n\t},\n\ten: {\n\t\tPER_ORDER_LIMITS: (f) =>\n\t\t\tf.min\n\t\t\t\t? `You need to order at least ${f.min} “${f.ticketType}” tickets.`\n\t\t\t\t: f.max\n\t\t\t\t\t? `You can order at most ${f.max} “${f.ticketType}” tickets per order.`\n\t\t\t\t\t: 'The ticket quantity is outside the allowed per-order range.',\n\t\tPER_CUSTOMER_LIMIT:\n\t\t\t'You have reached the maximum number of tickets per customer for this event.',\n\t\tSOLD_OUT: 'The selected ticket type is sold out.',\n\t\tSEATS_TAKEN: 'One of your seats was just taken — please pick another.',\n\t\tCAPACITY_FULL: 'The selected area is at full capacity.',\n\t\tSALE_WINDOW: 'This ticket type is not on sale right now.',\n\t\tSALES_PAUSED: 'The organizer has temporarily paused ticket sales. Please try again later.',\n\t\tTICKET_TYPE_PAUSED: 'Sales of this ticket type are temporarily paused.',\n\t\tNOT_ON_SALE: 'Tickets for this event are not on sale right now.',\n\t\tDISCOUNT_INVALID: 'That discount code is not valid.',\n\t\tDISCOUNT_EXHAUSTED: 'That discount code has been fully redeemed.',\n\t\tVERIFICATION_INVALID: 'Your phone verification expired — please verify again.',\n\t\tATTENDEES_REQUIRED: 'Please fill in a name for every ticket.',\n\t},\n};\n\n/**\n * Localized buyer-facing message for a checkout failure, or undefined when\n * the error carries no known code (caller shows its own generic text).\n * Accepts any BCP 47 locale; everything except Czech falls back to English.\n */\nexport function checkoutErrorMessage(err: unknown, locale?: string): string | undefined {\n\tif (!(err instanceof BookitiveError)) return undefined;\n\tconst lang: Lang = locale?.toLowerCase().startsWith('cs') ? 'cs' : 'en';\n\tconst entry = MESSAGES[lang][err.type];\n\tif (!entry) return undefined;\n\treturn typeof entry === 'function' ? entry(err.fields ?? {}) : entry;\n}\n"],"mappings":";AAaO,IAAK,eAAL,kBAAKA,kBAAL;AACN,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,yBAAsB;AACtB,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,uBAA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sBAAsB;AAAA,IACtB,oBAAoB;AAAA,EACrB;AAAA,EACA,IAAI;AAAA,IACH,kBAAkB,CAAC,MAClB,EAAE,MACC,8BAA8B,EAAE,GAAG,UAAK,EAAE,UAAU,oBACpD,EAAE,MACD,yBAAyB,EAAE,GAAG,UAAK,EAAE,UAAU,8BAC/C;AAAA,IACL,oBACC;AAAA,IACD,UAAU;AAAA,IACV,aAAa;AAAA,IACb,eAAe;AAAA,IACf,aAAa;AAAA,IACb,cAAc;AAAA,IACd,oBAAoB;AAAA,IACpB,aAAa;AAAA,IACb,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,sBAAsB;AAAA,IACtB,oBAAoB;AAAA,EACrB;AACD;AAOO,SAAS,qBAAqB,KAAc,QAAqC;AACvF,MAAI,EAAE,eAAe,gBAAiB,QAAO;AAC7C,QAAM,OAAa,QAAQ,YAAY,EAAE,WAAW,IAAI,IAAI,OAAO;AACnE,QAAM,QAAQ,SAAS,IAAI,EAAE,IAAI,IAAI;AACrC,MAAI,CAAC,MAAO,QAAO;AACnB,SAAO,OAAO,UAAU,aAAa,MAAM,IAAI,UAAU,CAAC,CAAC,IAAI;AAChE;","names":["ResponseType","DtoErrorCode"]}
|
|
1
|
+
{"version":3,"sources":["../src/generated/api.ts","../src/live.ts","../src/fingerprint.ts","../src/client.ts","../src/checkoutErrors.ts"],"sourcesContent":["/* eslint-disable */\n/* tslint:disable */\n// @ts-nocheck\n/*\n * ---------------------------------------------------------------\n * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##\n * ## ##\n * ## AUTHOR: acacode ##\n * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##\n * ---------------------------------------------------------------\n */\n\n/** @example \"VALIDATION_FAILED\" */\nexport enum ResponseType {\n\tErrInvalidPayload = 'INVALID_PAYLOAD',\n\tErrValidationFailed = 'VALIDATION_FAILED',\n\tErrNotFound = 'NOT_FOUND',\n\tErrNotImplemented = 'NOT_IMPLEMENTED',\n\tErrConflict = 'CONFLICT',\n\tErrInternal = 'INTERNAL_ERROR',\n\tErrUnauthorized = 'UNAUTHORIZED',\n\tErrForbidden = 'FORBIDDEN',\n\tErrVerificationRequired = 'VERIFICATION_REQUIRED',\n\tErrMissingOrganizationID = 'MISSING_ORGANIZATION_ID',\n\tErrMissingUserID = 'MISSING_USER_ID',\n\tErrPerOrderLimits = 'PER_ORDER_LIMITS',\n\tErrPerCustomerLimit = 'PER_CUSTOMER_LIMIT',\n\tErrSoldOut = 'SOLD_OUT',\n\tErrSeatsTaken = 'SEATS_TAKEN',\n\tErrCapacityFull = 'CAPACITY_FULL',\n\tErrSaleWindow = 'SALE_WINDOW',\n\tErrSalesPaused = 'SALES_PAUSED',\n\tErrTicketTypePaused = 'TICKET_TYPE_PAUSED',\n\tErrNotOnSale = 'NOT_ON_SALE',\n\tErrDiscountInvalid = 'DISCOUNT_INVALID',\n\tErrDiscountExhausted = 'DISCOUNT_EXHAUSTED',\n\tErrVerificationInvalid = 'VERIFICATION_INVALID',\n\tErrAttendeesRequired = 'ATTENDEES_REQUIRED',\n\tErrTransferLocked = 'TRANSFER_LOCKED',\n\tErrTransferCodeRequired = 'TRANSFER_CODE_REQUIRED',\n\tErrTransferCodeInvalid = 'TRANSFER_CODE_INVALID',\n\tErrTooManyRequests = 'TOO_MANY_REQUESTS',\n}\n\n/**\n * Type is the stable, machine-readable error code.\n * @example \"CONFLICT\"\n */\nexport enum DtoErrorCode {\n\tErrInvalidPayload = 'INVALID_PAYLOAD',\n\tErrValidationFailed = 'VALIDATION_FAILED',\n\tErrNotFound = 'NOT_FOUND',\n\tErrConflict = 'CONFLICT',\n\tErrForbidden = 'FORBIDDEN',\n\tErrVerificationRequired = 'VERIFICATION_REQUIRED',\n\tErrInternal = 'INTERNAL_ERROR',\n}\n\nexport interface DtoAPIError {\n\t/** Data carries optional structured context for the error. */\n\tdata?: any;\n\t/** Fields maps a request field to a validation message, when applicable. */\n\tfields?: Record<string, string>;\n\t/**\n\t * Msg is a human-readable description of what went wrong.\n\t * @example \"seat is no longer available\"\n\t */\n\tmsg?: string;\n\t/**\n\t * Timestamp is when the error was produced (RFC 3339).\n\t * @format date-time\n\t * @example \"2026-06-20T18:00:00Z\"\n\t */\n\ttimestamp?: string;\n\t/**\n\t * TraceID identifies this request in our logs; include it in support asks.\n\t * @example \"01JABCDoftraceZ\"\n\t */\n\ttraceId?: string;\n\t/** Type is the stable, machine-readable error code. */\n\ttype?: DtoErrorCode;\n}\n\nexport interface DtoPublicAvailability {\n\t/** GARemaining maps a standing area id to its remaining capacity. */\n\tgaRemaining?: Record<string, number>;\n\t/**\n\t * LowStockThreshold is where \"low stock\" begins for this event — clients\n\t * show the low-stock line when remaining ≤ threshold. 0 = signal off.\n\t * @example 10\n\t */\n\tlowStockThreshold?: number;\n\t/**\n\t * RecentOrders counts orders placed in the last 30 minutes — a live\n\t * activity signal for urgency UI. Always 0 when the event disabled the\n\t * social-proof signal; clients choose their display threshold.\n\t * @example 4\n\t */\n\trecentOrders?: number;\n\t/**\n\t * ReservedSeats marks which unavailable seats are merely reserved and may\n\t * free up again — present only when the event shares reserved status.\n\t * @uniqueItems false\n\t * @example [\"1810000000000000502\"]\n\t */\n\treservedSeats?: string[];\n\t/**\n\t * ShowReserved mirrors the event's \"share reserved status\" setting, so\n\t * clients can hide the reserved legend/state entirely when it is off.\n\t * @example true\n\t */\n\tshowReserved?: boolean;\n\t/** TicketTypeRemaining maps a ticket type id to its remaining capacity. */\n\tticketTypeRemaining?: Record<string, number>;\n\t/**\n\t * UnavailableSeats lists the ids of seats that cannot currently be bought.\n\t * @uniqueItems false\n\t * @example [\"1810000000000000501\",\"1810000000000000502\"]\n\t */\n\tunavailableSeats?: string[];\n}\n\n/** CheckoutTheme customises the hosted checkout; null = Bookitive defaults. */\nexport interface DtoPublicCheckoutTheme {\n\t/**\n\t * ButtonLabel overrides the submit button text.\n\t * @example \"Objednat\"\n\t */\n\tbuttonLabel?: string;\n\t/**\n\t * FontFamily is an allowlisted font key (self-hosted by Bookitive).\n\t * @example \"inter\"\n\t */\n\tfontFamily?: string;\n\t/**\n\t * Mode is the colour scheme: \"light\" or \"dark\".\n\t * @example \"light\"\n\t */\n\tmode?: 'light' | 'dark';\n\t/**\n\t * Radius is the corner radius for fields and buttons.\n\t * @example \"12px\"\n\t */\n\tradius?: string;\n}\n\nexport interface DtoPublicDiscount {\n\t/**\n\t * Code is the normalized (uppercase) promo code.\n\t * @example \"EARLYBIRD\"\n\t */\n\tcode?: string;\n\t/**\n\t * Kind is how the discount applies: \"percent\" of the items subtotal, or a\n\t * \"fixed\" amount in the event currency's minor units.\n\t * @example \"percent\"\n\t */\n\tkind?: 'percent' | 'fixed';\n\t/**\n\t * Value is 1-100 for percent, minor units for fixed.\n\t * @example 10\n\t */\n\tvalue?: number;\n}\n\nexport interface DtoPublicEvent {\n\t/** Event is the event's public identity: name, times, venue, currency. */\n\tevent?: DtoPublicEventInfo;\n\t/**\n\t * Floors lets a host page render its floor tabs without loading the full\n\t * seating payload; ids match the seating endpoint's floors.\n\t * @uniqueItems false\n\t */\n\tfloors?: DtoPublicFloorInfo[];\n\t/** Org is the organizer's public branding (name, logo, accent colour). */\n\torg?: DtoPublicOrg;\n\t/**\n\t * Protection describes the anti-scalping requirements a buyer must satisfy\n\t * at checkout (verified phone, named tickets). All-false when unprotected.\n\t */\n\tprotection?: DtoPublicProtection;\n\t/**\n\t * TicketTypes are the sellable ticket categories with prices and limits.\n\t * @uniqueItems false\n\t */\n\tticketTypes?: DtoPublicTicketType[];\n}\n\n/** Event is the event's public identity: name, times, venue, currency. */\nexport interface DtoPublicEventInfo {\n\t/**\n\t * Currency is the ISO 4217 code all prices are quoted in.\n\t * @example \"CZK\"\n\t */\n\tcurrency?: string;\n\t/**\n\t * EndTime is when the event ends (RFC 3339), when known.\n\t * @format date-time\n\t * @example \"2026-06-20T23:00:00Z\"\n\t */\n\tendTime?: string;\n\t/**\n\t * HoldTTLSeconds is how long a checkout holds selected seats before expiry.\n\t * @example 900\n\t */\n\tholdTtlSeconds?: number;\n\t/**\n\t * LocationName is the venue's display name, when set.\n\t * @example \"Výstaviště Praha\"\n\t */\n\tlocationName?: string;\n\t/**\n\t * MarketingOptinEnabled: the organizer collects a marketing opt-in at\n\t * checkout — the UI renders the consent checkbox (M1).\n\t */\n\tmarketingOptinEnabled?: boolean;\n\t/**\n\t * Name is the event's public display name.\n\t * @example \"Rockfest 2026\"\n\t */\n\tname?: string;\n\t/**\n\t * SalesPaused: the organizer temporarily stopped all sales — the page\n\t * should say so instead of offering a checkout.\n\t */\n\tsalesPaused?: boolean;\n\t/**\n\t * Slug is the event's URL identifier (the {eventSlug} path parameter).\n\t * @example \"rockfest-2026\"\n\t */\n\tslug?: string;\n\t/**\n\t * StartTime is when doors/the event begins (RFC 3339).\n\t * @format date-time\n\t * @example \"2026-06-20T18:00:00Z\"\n\t */\n\tstartTime?: string;\n\t/**\n\t * Timezone is the event's IANA zone. StartTime (and every other schedule\n\t * timestamp here) is an absolute instant; this is the wall clock it means\n\t * at the venue, and what a buyer should be shown wherever they are.\n\t * @example \"Europe/Prague\"\n\t */\n\ttimezone?: string;\n\t/** WaitlistEnabled: sold-out ticket types accept waitlist signups (RFC 0008). */\n\twaitlistEnabled?: boolean;\n}\n\nexport interface DtoPublicFloor {\n\t/**\n\t * Cons are short caveats for this floor, shown alongside the pros.\n\t * @uniqueItems false\n\t * @example [\"Standing only\"]\n\t */\n\tcons?: string[];\n\t/**\n\t * Description is optional customer-facing copy shown on the floor's tab.\n\t * @example \"Standing area in front of the main stage\"\n\t */\n\tdescription?: string;\n\t/**\n\t * ID is the floor's stable id; it matches PublicFloorInfo.id.\n\t * @example \"1810000000000000101\"\n\t */\n\tid?: string;\n\t/**\n\t * Mode is \"single\" (one open space) or \"sections\" (subdivided blocks).\n\t * @example \"sections\"\n\t */\n\tmode?: 'single' | 'sections';\n\t/**\n\t * Name is the floor's display label.\n\t * @example \"Ground floor\"\n\t */\n\tname?: string;\n\t/**\n\t * Position is the 1-based tab order among the event's floors.\n\t * @example 1\n\t */\n\tposition?: number;\n\t/**\n\t * Pros are short selling points for this floor, shown as a checklist.\n\t * @uniqueItems false\n\t * @example [\"Closest to the stage\",\"Great atmosphere\"]\n\t */\n\tpros?: string[];\n\t/**\n\t * Sections are the floor's blocks; a single-mode floor has exactly one.\n\t * @uniqueItems false\n\t */\n\tsections?: DtoPublicSection[];\n}\n\nexport interface DtoPublicFloorInfo {\n\t/**\n\t * Cons are short caveats for this floor, shown alongside the pros.\n\t * @uniqueItems false\n\t * @example [\"Standing only\"]\n\t */\n\tcons?: string[];\n\t/**\n\t * Description is optional customer-facing copy shown on the floor's tab.\n\t * @example \"Standing area in front of the main stage\"\n\t */\n\tdescription?: string;\n\t/**\n\t * ID is the floor's stable id; it matches a floor in the seating endpoint.\n\t * @example \"1810000000000000101\"\n\t */\n\tid?: string;\n\t/**\n\t * Mode is \"single\" (one open space) or \"sections\" (subdivided blocks).\n\t * @example \"sections\"\n\t */\n\tmode?: 'single' | 'sections';\n\t/**\n\t * Name is the floor's display label.\n\t * @example \"Ground floor\"\n\t */\n\tname?: string;\n\t/**\n\t * Position is the 1-based tab order among the event's floors.\n\t * @example 1\n\t */\n\tposition?: number;\n\t/**\n\t * Pros are short selling points for this floor, shown as a checklist.\n\t * @uniqueItems false\n\t * @example [\"Closest to the stage\",\"Great atmosphere\"]\n\t */\n\tpros?: string[];\n}\n\nexport interface DtoPublicGAArea {\n\t/**\n\t * Capacity is the total number of standing tickets this area can sell.\n\t * @example 500\n\t */\n\tcapacity?: number;\n\t/**\n\t * H is the area's height on the floor canvas.\n\t * @example 200\n\t */\n\th?: number;\n\t/**\n\t * ID is the standing area's stable id, referenced by availability/orders.\n\t * @example \"1810000000000000601\"\n\t */\n\tid?: string;\n\t/**\n\t * Label is the standing area's display name.\n\t * @example \"Pit\"\n\t */\n\tlabel?: string;\n\t/**\n\t * Rotation is the area's rotation in degrees.\n\t * @example 0\n\t */\n\trotation?: number;\n\t/**\n\t * TicketTypeID is the standing ticket type mapped to this area, when priced.\n\t * @example \"1810000000000000201\"\n\t */\n\tticketTypeId?: string;\n\t/**\n\t * W is the area's width on the floor canvas.\n\t * @example 600\n\t */\n\tw?: number;\n\t/**\n\t * X is the area's left offset on the floor canvas.\n\t * @example 100\n\t */\n\tx?: number;\n\t/**\n\t * Y is the area's top offset on the floor canvas.\n\t * @example 400\n\t */\n\ty?: number;\n}\n\nexport interface DtoPublicOrder {\n\t/**\n\t * Currency is the ISO 4217 code the total is quoted in.\n\t * @example \"CZK\"\n\t */\n\tcurrency?: string;\n\t/**\n\t * DiscountCents is what the redeemed promo code took off the total.\n\t * @example 14900\n\t */\n\tdiscountCents?: number;\n\t/**\n\t * ExpiresAt is when the held seats and this order expire (RFC 3339).\n\t * @format date-time\n\t * @example \"2026-06-20T18:15:00Z\"\n\t */\n\texpiresAt?: string;\n\t/** Payment carries the bank-transfer instructions for pending orders. */\n\tpayment?: DtoPublicPaymentDetail;\n\t/**\n\t * Reference is the order's human-facing reference (also the payment symbol).\n\t * @example \"RF26-000142\"\n\t */\n\treference?: string;\n\t/**\n\t * Status is the order lifecycle state at creation time. pending_review means\n\t * the order is held for organizer approval (RFC 0004 risk \"hold\" action).\n\t * @example \"pending\"\n\t */\n\tstatus?: 'pending' | 'pending_review' | 'paid' | 'cancelled' | 'expired';\n\t/**\n\t * TotalCents is the amount due in the event currency's minor units.\n\t * @example 149000\n\t */\n\ttotalCents?: number;\n}\n\n/** Customer is the buyer's contact details. */\nexport interface DtoPublicOrderCustomer {\n\t/**\n\t * Email is where the payment instructions and tickets are sent.\n\t * @example \"jana@example.com\"\n\t */\n\temail: string;\n\t/**\n\t * Name is the buyer's full name.\n\t * @maxLength 200\n\t * @example \"Jana Nováková\"\n\t */\n\tname: string;\n\t/**\n\t * Phone is an optional contact number.\n\t * @maxLength 50\n\t * @example \"+420123456789\"\n\t */\n\tphone?: string;\n}\n\nexport interface DtoPublicOrderItem {\n\t/**\n\t * Attendees carries one full name per admitted person when the event\n\t * requires named tickets — exactly Quantity names, in ticket order.\n\t * @uniqueItems false\n\t * @example [\"Jana Nováková\"]\n\t */\n\tattendees?: string[];\n\t/**\n\t * GAAreaID is the standing area's id for standing ticket types.\n\t * @example \"1810000000000000601\"\n\t */\n\tgaAreaId?: string;\n\t/**\n\t * Quantity is how many to buy — always 1 for a seat, 1+ for standing.\n\t * @min 1\n\t * @example 1\n\t */\n\tquantity: number;\n\t/**\n\t * SeatID is the chosen seat's id for seated ticket types.\n\t * @example \"1810000000000000501\"\n\t */\n\tseatId?: string;\n\t/**\n\t * TicketTypeID is the ticket type being bought (from the event endpoint).\n\t * @example \"1810000000000000201\"\n\t */\n\tticketTypeId: string;\n}\n\nexport interface DtoPublicOrderRequest {\n\t/**\n\t * CaptchaToken is the client-side captcha solution, verified server-side.\n\t * @example \"03AGdBq26…\"\n\t */\n\tcaptchaToken?: string;\n\t/** Customer is the buyer's contact details. */\n\tcustomer: DtoPublicOrderCustomer;\n\t/**\n\t * DiscountCode redeems a promo code (case-insensitive); the discount is\n\t * applied to the items subtotal and enforced against the code's limits.\n\t * @minLength 2\n\t * @maxLength 40\n\t * @example \"EARLYBIRD\"\n\t */\n\tdiscountCode?: string;\n\t/**\n\t * Fingerprint is a stable hash of the buyer's browser, computed client-side\n\t * and forwarded for device-velocity risk scoring (RFC 0004); optional.\n\t * @maxLength 128\n\t * @example \"a1b2c3d4e5f6\"\n\t */\n\tfingerprint?: string;\n\t/**\n\t * Items are the order lines; at least one is required.\n\t * @minItems 1\n\t * @uniqueItems false\n\t */\n\titems: DtoPublicOrderItem[];\n\t/**\n\t * MarketingConsent mirrors the checkout's marketing opt-in checkbox. Only\n\t * send true when the buyer explicitly ticked a consent box you showed\n\t * them — the value is stored as consent evidence and honoured only when\n\t * the organizer's opt-in setting is enabled.\n\t * @example true\n\t */\n\tmarketingConsent?: boolean;\n\t/**\n\t * VerificationToken is the single-use token from the verify/check endpoint,\n\t * required when the event demands a verified phone number.\n\t * @example \"3q2p8Zk1…\"\n\t */\n\tverificationToken?: string;\n\t/**\n\t * WaitlistClaimToken authorizes buying an offered quantity of a sold-out\n\t * type (RFC 0008); single-use, consumed with the order.\n\t */\n\twaitlistClaimToken?: string;\n}\n\n/** Org is the organizer's public branding (name, logo, accent colour). */\nexport interface DtoPublicOrg {\n\t/**\n\t * AccentColor is the organizer's brand colour as a hex string, if set.\n\t * @example \"#E5482F\"\n\t */\n\taccentColor?: string;\n\t/** CheckoutTheme customises the hosted checkout; null = Bookitive defaults. */\n\tcheckoutTheme?: DtoPublicCheckoutTheme;\n\t/**\n\t * LogoURL is an absolute URL to the organizer's logo, if set.\n\t * @example \"https://cdn.bookitive.com/orgs/rockfest/logo.png\"\n\t */\n\tlogoUrl?: string;\n\t/**\n\t * Name is the organizer's public display name.\n\t * @example \"Rockfest Productions\"\n\t */\n\tname?: string;\n\t/**\n\t * PrivacyURL is the organizer's own privacy policy.\n\t * @example \"https://rockfest.cz/ochrana-osobnich-udaju\"\n\t */\n\tprivacyUrl?: string;\n\t/**\n\t * Slug is the organizer's URL identifier (the {orgSlug} path parameter).\n\t * @example \"rockfest\"\n\t */\n\tslug?: string;\n\t/**\n\t * TermsURL is the organizer's own terms of sale — the organizer is the\n\t * seller, so the checkout links these next to Bookitive's buyer notice.\n\t * @example \"https://rockfest.cz/obchodni-podminky\"\n\t */\n\ttermsUrl?: string;\n}\n\n/** Payment carries the bank-transfer instructions for pending orders. */\nexport interface DtoPublicPaymentDetail {\n\t/**\n\t * BankAccount is the organizer's free-form payment destination.\n\t * @example \"123456789/0100\"\n\t */\n\tbankAccount?: string;\n\t/**\n\t * VariableSymbol identifies the payment — it equals the order reference.\n\t * @example \"26000142\"\n\t */\n\tvariableSymbol?: string;\n}\n\n/**\n * Protection describes the anti-scalping requirements a buyer must satisfy\n * at checkout (verified phone, named tickets). All-false when unprotected.\n */\nexport interface DtoPublicProtection {\n\t/**\n\t * PhonePrefixes is the allowlist of accepted international dialling codes\n\t * (e.g. \"+420\"). Only meaningful when RequireVerifiedPhone is set.\n\t * @uniqueItems false\n\t * @example [\"+420\",\"+421\"]\n\t */\n\tphonePrefixes?: string[];\n\t/**\n\t * RequireAttendeeNames demands one attendee name per admitted person.\n\t * @example false\n\t */\n\trequireAttendeeNames?: boolean;\n\t/**\n\t * RequireVerifiedPhone gates checkout behind SMS phone verification.\n\t * @example true\n\t */\n\trequireVerifiedPhone?: boolean;\n}\n\nexport interface DtoPublicSeat {\n\t/**\n\t * Code is the human-facing seat label (section prefix + table + seat).\n\t * @example \"L12-3\"\n\t */\n\tcode?: string;\n\t/**\n\t * Geom is editor-owned free-form chair geometry (polygon/oval); opaque,\n\t * absent = default circle.\n\t */\n\tgeom?: object;\n\t/**\n\t * ID is the seat's stable id; availability and orders reference it.\n\t * @example \"1810000000000000501\"\n\t */\n\tid?: string;\n\t/**\n\t * TableID is the owning table's id, when the seat belongs to a table.\n\t * @example \"1810000000000000401\"\n\t */\n\ttableId?: string;\n\t/**\n\t * TicketTypeID is the ticket type mapped to this seat, when priced.\n\t * @example \"1810000000000000201\"\n\t */\n\tticketTypeId?: string;\n\t/**\n\t * X is the seat centre's x on the floor canvas.\n\t * @example 245\n\t */\n\tx?: number;\n\t/**\n\t * Y is the seat centre's y on the floor canvas.\n\t * @example 158\n\t */\n\ty?: number;\n}\n\nexport interface DtoPublicSeating {\n\t/**\n\t * Floors are the chart's floors in tab order, each with its geometry.\n\t * @uniqueItems false\n\t */\n\tfloors?: DtoPublicFloor[];\n}\n\nexport interface DtoPublicSection {\n\t/** Decorations is opaque visual scenery (stage, walls, doors) — never sold. */\n\tdecorations?: object;\n\t/**\n\t * GAAreas are the standing areas (sold by quantity) in this section.\n\t * @uniqueItems false\n\t */\n\tgaAreas?: DtoPublicGAArea[];\n\t/**\n\t * H is the section's height on the floor canvas, if sized.\n\t * @example 300\n\t */\n\th?: number;\n\t/**\n\t * ID is the section's stable id.\n\t * @example \"1810000000000000301\"\n\t */\n\tid?: string;\n\t/**\n\t * Name is the section's display label.\n\t * @example \"Left block\"\n\t */\n\tname?: string;\n\t/** Polygon is the section's outline as an array of {x,y} points, if shaped. */\n\tpolygon?: object;\n\t/**\n\t * Prefix is prepended to seat codes in this section (e.g. \"L\" → \"L12-3\").\n\t * @example \"L\"\n\t */\n\tprefix?: string;\n\t/**\n\t * Seats are the individually sellable seats in this section.\n\t * @uniqueItems false\n\t */\n\tseats?: DtoPublicSeat[];\n\t/** Settings is opaque render config (chair gap/size, label typography). */\n\tsettings?: object;\n\t/**\n\t * Tables are the seated tables in this section.\n\t * @uniqueItems false\n\t */\n\ttables?: DtoPublicTable[];\n\t/**\n\t * W is the section's width on the floor canvas, if sized.\n\t * @example 400\n\t */\n\tw?: number;\n\t/**\n\t * X is the section's left offset on the floor canvas, if positioned.\n\t * @example 120\n\t */\n\tx?: number;\n\t/**\n\t * Y is the section's top offset on the floor canvas, if positioned.\n\t * @example 80\n\t */\n\ty?: number;\n}\n\nexport interface DtoPublicTable {\n\t/**\n\t * Bodies is editor-owned free-form geometry (polygon/oval table bodies; an\n\t * array → composite tables). Opaque; absent for primitive tables.\n\t */\n\tbodies?: object;\n\t/**\n\t * CornerRadius is the corner rounding of a rect table body, in canvas units.\n\t * @example 5\n\t */\n\tcornerRadius?: number;\n\t/**\n\t * Curve is the arc for row tables, in degrees (0 = straight row).\n\t * @example 0\n\t */\n\tcurve?: number;\n\t/**\n\t * H is the height for rect tables, in canvas units.\n\t * @example 60\n\t */\n\th?: number;\n\t/**\n\t * ID is the table's stable id, referenced by PublicSeat.tableId.\n\t * @example \"1810000000000000401\"\n\t */\n\tid?: string;\n\t/**\n\t * Number is the table's display number within its section.\n\t * @example 12\n\t */\n\tnumber?: number;\n\t/**\n\t * Radius is the radius for round tables, in canvas units.\n\t * @example 45\n\t */\n\tradius?: number;\n\t/**\n\t * Rotation is the table's rotation in degrees.\n\t * @example 0\n\t */\n\trotation?: number;\n\t/**\n\t * Shape is the table outline: \"round\", \"rect\", \"row\", \"poly\", or \"oval\".\n\t * @example \"round\"\n\t */\n\tshape?: 'round' | 'rect' | 'row' | 'poly' | 'oval';\n\t/**\n\t * Sides is the seat count per edge for rect tables [top,right,bottom,left].\n\t * @uniqueItems false\n\t */\n\tsides?: number[];\n\t/**\n\t * Spacing is the gap between seats on a row table, in canvas units.\n\t * @example 24\n\t */\n\tspacing?: number;\n\t/**\n\t * W is the width for rect tables, in canvas units.\n\t * @example 120\n\t */\n\tw?: number;\n\t/**\n\t * X is the table centre's x on the floor canvas.\n\t * @example 240.5\n\t */\n\tx?: number;\n\t/**\n\t * Y is the table centre's y on the floor canvas.\n\t * @example 160\n\t */\n\ty?: number;\n}\n\nexport interface DtoPublicTicketType {\n\t/**\n\t * BasePriceCents is the regular price, present only when a scheduled phase is\n\t * currently active and differs from it — so the widget can show \"was €X\".\n\t * @example 179000\n\t */\n\tbasePriceCents?: number;\n\t/**\n\t * Color is the swatch used to tint seats/areas of this type, as hex.\n\t * @example \"#E5482F\"\n\t */\n\tcolor?: string;\n\t/**\n\t * Cons are short caveats for this ticket type, shown alongside the pros.\n\t * @uniqueItems false\n\t * @example [\"No seating\"]\n\t */\n\tcons?: string[];\n\t/**\n\t * Description is optional customer-facing copy for this ticket type.\n\t * @example \"Front-stage standing with a dedicated bar\"\n\t */\n\tdescription?: string;\n\t/**\n\t * ID is the ticket type's stable id, referenced by order items and seats.\n\t * @example \"1810000000000000201\"\n\t */\n\tid?: string;\n\t/**\n\t * Kind is \"seated\" (maps to a seat) or \"standing\" (sold by quantity).\n\t * @example \"standing\"\n\t */\n\tkind?: 'seated' | 'standing';\n\t/**\n\t * MaxPerCustomer caps how many of this type one verified buyer may hold\n\t * across orders (anti-scalping); absent when unlimited.\n\t * @example 4\n\t */\n\tmaxPerCustomer?: number;\n\t/**\n\t * MaxPerOrder caps how many of this type a single order may contain.\n\t * @example 6\n\t */\n\tmaxPerOrder?: number;\n\t/**\n\t * MinPerOrder appears only when it is a real constraint (> 1) — the\n\t * limit applies to orders that include this type at all.\n\t * @example 1\n\t */\n\tminPerOrder?: number;\n\t/**\n\t * Name is the ticket type's display label.\n\t * @example \"VIP\"\n\t */\n\tname?: string;\n\t/**\n\t * PriceCents is the EFFECTIVE unit price right now, in the event currency's\n\t * minor units — the base price, or an active scheduled phase's price (RFC\n\t * 0005). This is what the buyer pays.\n\t * @example 149000\n\t */\n\tpriceCents?: number;\n\t/**\n\t * PriceChangesAt is the next scheduled price boundary (RFC 3339) — the widget\n\t * can count down \"early bird ends in …\"; absent when the price won't change.\n\t * @format date-time\n\t * @example \"2026-06-01T00:00:00Z\"\n\t */\n\tpriceChangesAt?: string;\n\t/**\n\t * PricePhaseDescription is the active phase's optional organizer-authored\n\t * copy, shown in the widget's phase info popover.\n\t * @example \"Launch price for the first hundred fans.\"\n\t */\n\tpricePhaseDescription?: string;\n\t/**\n\t * PricePhaseName is the active phase's label (e.g. \"Early bird\"), if any.\n\t * @example \"Early bird\"\n\t */\n\tpricePhaseName?: string;\n\t/**\n\t * PricePhaseRemaining is how many tickets are left at the active phase's\n\t * price before its quantity cap (RFC 0005) — the \"12 left at early bird\"\n\t * urgency; absent when the active phase has no quantity cap.\n\t * @example 12\n\t */\n\tpricePhaseRemaining?: number;\n\t/**\n\t * Pros are short selling points for this ticket type, shown as a checklist.\n\t * @uniqueItems false\n\t * @example [\"Best view\",\"Dedicated bar\",\"Fast-track entry\"]\n\t */\n\tpros?: string[];\n\t/**\n\t * SaleEndTime is when this type stops selling (RFC 3339), if scheduled.\n\t * @format date-time\n\t * @example \"2026-06-20T16:00:00Z\"\n\t */\n\tsaleEndTime?: string;\n\t/** SalePaused: the organizer temporarily paused sales of this type. */\n\tsalePaused?: boolean;\n\t/**\n\t * SaleStartTime is when this type goes on sale (RFC 3339), if scheduled.\n\t * @format date-time\n\t * @example \"2026-01-15T10:00:00Z\"\n\t */\n\tsaleStartTime?: string;\n}\n\nexport interface DtoPublicVerification {\n\t/**\n\t * ExpiresAt is when the token stops being accepted (RFC 3339).\n\t * @format date-time\n\t * @example \"2026-06-20T18:30:00Z\"\n\t */\n\texpiresAt?: string;\n\t/**\n\t * Phone is the normalized number the token certifies.\n\t * @example \"+420777123456\"\n\t */\n\tphone?: string;\n\t/**\n\t * VerificationToken is consumed by exactly one order for this event.\n\t * @example \"5Yx…\"\n\t */\n\tverificationToken?: string;\n}\n\nexport interface DtoPublicVerifyCheckRequest {\n\t/**\n\t * Code is the OTP from the SMS.\n\t * @minLength 4\n\t * @maxLength 10\n\t * @example \"123456\"\n\t */\n\tcode: string;\n\t/**\n\t * @minLength 8\n\t * @maxLength 20\n\t * @example \"+420777123456\"\n\t */\n\tphone: string;\n}\n\nexport interface DtoPublicVerifyStartRequest {\n\t/**\n\t * CaptchaToken is the client-side captcha solution, verified server-side.\n\t * @example \"03AGdBq26…\"\n\t */\n\tcaptchaToken?: string;\n\t/**\n\t * Phone in international E.164 format.\n\t * @minLength 8\n\t * @maxLength 20\n\t * @example \"+420777123456\"\n\t */\n\tphone: string;\n}\n\nexport interface DtoPublicWaitlistClaim {\n\t/** @example \"anna@example.com\" */\n\temail?: string;\n\t/** @example \"Anna Nováková\" */\n\tname?: string;\n\tofferExpiresAt?: string;\n\t/** @example 2 */\n\tquantity?: number;\n\t/** @example \"734559411483578369\" */\n\tticketTypeId?: string;\n}\n\nexport interface DtoPublicWaitlistEntry {\n\t/** ClaimToken completes the purchase while the offer is active. */\n\tclaimToken?: string;\n\teventName?: string;\n\teventSlug?: string;\n\tofferExpiresAt?: string;\n\t/** OfferedQuantity and OfferExpiresAt are present while an offer is active. */\n\tofferedQuantity?: number;\n\t/** OfferedTicketTypeName labels the offer (\"2× VIP\"). */\n\tofferedTicketTypeName?: string;\n\t/** Event identity for the manage page's back link. */\n\torgSlug?: string;\n\t/**\n\t * Quantity still wanted.\n\t * @example 2\n\t */\n\tquantity?: number;\n\t/**\n\t * Status: waiting | offered | claimed | left | expired.\n\t * @example \"waiting\"\n\t */\n\tstatus?: string;\n\t/**\n\t * TicketTypeNames the entry waits for; empty = any type.\n\t * @uniqueItems false\n\t */\n\tticketTypeNames?: string[];\n}\n\nexport interface PublichandlerPayloadWaitlistJoin {\n\t/** @maxLength 200 */\n\temail: string;\n\t/**\n\t * FullOnly: only offer the complete quantity; partial releases go to the\n\t * next person in line.\n\t */\n\tfullOnly?: boolean;\n\t/**\n\t * @minLength 2\n\t * @maxLength 100\n\t */\n\tname?: string;\n\t/**\n\t * @min 1\n\t * @max 10\n\t */\n\tquantity: number;\n\t/**\n\t * TicketTypeIds: the set to wait for; empty/omitted = any type.\n\t * @maxItems 20\n\t * @uniqueItems false\n\t */\n\tticketTypeIds?: string[];\n}\n\nexport interface ResponseAPIError {\n\tdata?: any;\n\tfields?: Record<string, string>;\n\t/** @example \"see fields\" */\n\tmsg: string;\n\t/**\n\t * @format date-time\n\t * @example \"2026-09-13T18:45:12Z\"\n\t */\n\ttimestamp?: string;\n\t/** @example \"2b9c1f0e-6d4a-4a1b-9e0f-3c5d7a8b9c0d\" */\n\ttraceId?: string;\n\ttype: ResponseType;\n}\n\nexport type ResponseAPIResponseEmpty = object;\n","// Live availability over websocket: {\"event\":\"startstate\"|\"seat\", data}.\n// Startstate re-fires on every reconnect, so consumers treat it as the\n// resync point and apply deltas on top.\nimport type { DtoPublicAvailability } from './generated/api';\n\n/** One seat changing state. \"reserved\" appears only when the event shares\n * reserved status publicly — a reserved seat may free up again. */\nexport interface SeatDelta {\n\tseatId: string;\n\ttaken: boolean;\n\tstatus: 'free' | 'reserved' | 'taken';\n}\n\nexport interface LiveHandlers {\n\t/** Full snapshot — on connect and on every reconnect. */\n\tonStartstate?: (availability: DtoPublicAvailability) => void;\n\t/** One seat changed. */\n\tonSeat?: (delta: SeatDelta) => void;\n\t/** Connection state changes (drive a \"live\" indicator if you like). */\n\tonConnectionChange?: (connected: boolean) => void;\n}\n\nconst INITIAL_BACKOFF_MS = 1000;\nconst MAX_BACKOFF_MS = 15000;\n\nexport class LiveSubscription {\n\t#url: string;\n\t#handlers: LiveHandlers;\n\t#ws: WebSocket | null = null;\n\t#backoff = INITIAL_BACKOFF_MS;\n\t#retry: ReturnType<typeof setTimeout> | null = null;\n\t#closed = false;\n\n\tconstructor(url: string, handlers: LiveHandlers) {\n\t\tthis.#url = url.replace(/^http/, 'ws');\n\t\tthis.#handlers = handlers;\n\t\tthis.#connect();\n\t}\n\n\tclose(): void {\n\t\tthis.#closed = true;\n\t\tif (this.#retry) clearTimeout(this.#retry);\n\t\tthis.#ws?.close();\n\t}\n\n\t#connect(): void {\n\t\tif (this.#closed) return;\n\t\tconst ws = new WebSocket(this.#url);\n\t\tthis.#ws = ws;\n\t\tws.onopen = () => {\n\t\t\tthis.#backoff = INITIAL_BACKOFF_MS;\n\t\t\tthis.#handlers.onConnectionChange?.(true);\n\t\t};\n\t\tws.onmessage = (event) => {\n\t\t\tlet message: { event?: string; data?: unknown };\n\t\t\ttry {\n\t\t\t\tmessage = JSON.parse(event.data as string);\n\t\t\t} catch {\n\t\t\t\treturn; // ignore malformed / non-JSON frames rather than throwing\n\t\t\t}\n\t\t\tif (message.event === 'startstate') {\n\t\t\t\tthis.#handlers.onStartstate?.(message.data as DtoPublicAvailability);\n\t\t\t} else if (message.event === 'seat') {\n\t\t\t\tthis.#handlers.onSeat?.(message.data as SeatDelta);\n\t\t\t}\n\t\t};\n\t\tws.onclose = () => {\n\t\t\tthis.#handlers.onConnectionChange?.(false);\n\t\t\tif (this.#closed) return;\n\t\t\t// Equal-jitter backoff: reconnect somewhere in [backoff/2, backoff) so a\n\t\t\t// mass disconnect doesn't produce a synchronized reconnect thundering herd.\n\t\t\tconst delay = this.#backoff / 2 + Math.random() * (this.#backoff / 2);\n\t\t\tthis.#retry = setTimeout(() => this.#connect(), delay);\n\t\t\tthis.#backoff = Math.min(this.#backoff * 2, MAX_BACKOFF_MS);\n\t\t};\n\t}\n}\n","// A lightweight, dependency-free browser device fingerprint for the anti-scalping\n// device_velocity signal (RFC 0004). It is intentionally coarse and privacy-light:\n// a stable-ish hash of a handful of ambient browser/screen traits, NOT a unique\n// per-user identifier. Its only job is to make one machine placing many orders —\n// even behind rotated emails/phones/proxies — cluster together server-side.\n//\n// It never throws and returns undefined off the browser (SSR) or when the traits\n// are unavailable, so callers can attach it opportunistically.\n\n// djb2 — a tiny, fast string hash; hex output keeps the value short + opaque.\nfunction hash(input: string): string {\n\tlet h = 5381;\n\tfor (let i = 0; i < input.length; i++) {\n\t\th = (h * 33) ^ input.charCodeAt(i);\n\t}\n\t// >>> 0 coerces to an unsigned 32-bit int before hex encoding.\n\treturn (h >>> 0).toString(16).padStart(8, '0');\n}\n\n/**\n * Compute a coarse device fingerprint for the current browser, or undefined when\n * not in a browser / when the ambient traits can't be read. Combines a few stable\n * traits (UA, language, platform, screen geometry, timezone, hardware hints) into\n * one short hash. Deliberately best-effort — two different browsers on the same\n * machine hash differently, which is fine: it only needs to cluster reuse.\n */\nexport function deviceFingerprint(): string | undefined {\n\ttry {\n\t\tif (typeof navigator === 'undefined' || typeof screen === 'undefined') return undefined;\n\t\tconst nav = navigator as Navigator & { deviceMemory?: number };\n\t\tconst traits = [\n\t\t\tnav.userAgent,\n\t\t\tnav.language,\n\t\t\t(nav.languages ?? []).join(','),\n\t\t\tnav.platform,\n\t\t\tnav.hardwareConcurrency,\n\t\t\tnav.deviceMemory,\n\t\t\tscreen.width,\n\t\t\tscreen.height,\n\t\t\tscreen.colorDepth,\n\t\t\t// Timezone offset is stable per machine locale and cheap to read.\n\t\t\tnew Date().getTimezoneOffset(),\n\t\t\tIntl.DateTimeFormat().resolvedOptions().timeZone,\n\t\t];\n\t\treturn hash(traits.map((t) => String(t ?? '')).join('|'));\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n","// The typed core of @bookitive/js: a thin fetch wrapper over the public\n// checkout API, addressed by org + event slug. All response and payload types\n// are generated from the backend's public swagger — they cannot drift.\nimport { DtoErrorCode } from './generated/api';\nimport type {\n\tDtoAPIError,\n\tDtoPublicAvailability,\n\tDtoPublicDiscount,\n\tDtoPublicEvent,\n\tDtoPublicOrder,\n\tDtoPublicOrderRequest,\n\tDtoPublicSeating,\n\tDtoPublicVerification,\n\tDtoPublicWaitlistEntry,\n\tPublichandlerPayloadWaitlistJoin,\n} from './generated/api';\nimport { LiveSubscription, type LiveHandlers } from './live';\nimport { deviceFingerprint } from './fingerprint';\n\nexport interface BookitiveClientOptions {\n\t/** API origin, e.g. \"https://api.bookitive.com\" (no trailing slash). */\n\tbaseUrl: string;\n\t/** Organization slug — the {org} in events.bookitive.com/{org}/{event}. */\n\torg: string;\n\t/** Event slug. */\n\tevent: string;\n\t/** Custom fetch (SSR frameworks pass their own). Defaults to global fetch. */\n\tfetch?: typeof fetch;\n}\n\n/** API failure with the backend's error envelope attached. */\nexport class BookitiveError extends Error {\n\treadonly status: number;\n\t/** The backend error code (e.g. DtoErrorCode.ErrConflict), or \"UNKNOWN\" when\n\t * the response carried no JSON envelope. */\n\treadonly type: DtoErrorCode | 'UNKNOWN';\n\t/** Structured detail for some codes (e.g. PER_ORDER_LIMITS carries\n\t * ticketType/min/max/requested) — feeds checkoutErrorMessage(). */\n\treadonly fields?: Record<string, string>;\n\n\tconstructor(status: number, body: DtoAPIError | undefined, fallback: string) {\n\t\tsuper(body?.msg ?? fallback);\n\t\tthis.name = 'BookitiveError';\n\t\tthis.status = status;\n\t\tthis.type = body?.type ?? 'UNKNOWN';\n\t\tthis.fields = body?.fields;\n\t}\n\n\t/** The selection raced another buyer — refresh availability and reselect. */\n\tget isConflict(): boolean {\n\t\treturn this.type === DtoErrorCode.ErrConflict || this.status === 409;\n\t}\n}\n\nexport class BookitiveClient {\n\treadonly #base: string;\n\treadonly #fetch: typeof fetch;\n\n\tconstructor(options: BookitiveClientOptions) {\n\t\tthis.#base = `${options.baseUrl.replace(/\\/$/, '')}/public/v1/orgs/${encodeURIComponent(\n\t\t\toptions.org\n\t\t)}/events/${encodeURIComponent(options.event)}`;\n\t\t// bind, or a browser's fetch throws \"Illegal invocation\" when called\n\t\t// detached from window\n\t\tthis.#fetch = options.fetch ?? ((...args) => fetch(...args));\n\t}\n\n\t/** Event identity, org branding, priced ticket types, and floor tabs. */\n\tevent(): Promise<DtoPublicEvent> {\n\t\treturn this.#get<DtoPublicEvent>('');\n\t}\n\n\t/** Static chart geometry: floors → sections → tables, seats, GA areas. */\n\tseating(): Promise<DtoPublicSeating> {\n\t\treturn this.#get<DtoPublicSeating>('/seating');\n\t}\n\n\t/** Live sellability snapshot (poll it, or use live() for push updates). */\n\tavailability(): Promise<DtoPublicAvailability> {\n\t\treturn this.#get<DtoPublicAvailability>('/availability');\n\t}\n\n\t/**\n\t * Previews a promo code: what applying it would do. Throws a\n\t * BookitiveError with status 404 for unknown/paused/out-of-window codes\n\t * and 409 (error.isConflict) when the code is fully redeemed. The order\n\t * endpoint re-validates on submit.\n\t */\n\tdiscount(code: string): Promise<DtoPublicDiscount> {\n\t\treturn this.#get<DtoPublicDiscount>(`/discount?code=${encodeURIComponent(code)}`);\n\t}\n\n\t/**\n\t * Places a bank-transfer reservation: seats are held atomically for the\n\t * event's hold TTL and payment instructions are emailed (and returned).\n\t * A 409 (error.isConflict) means a seat was just taken — refresh and\n\t * reselect.\n\t */\n\tasync checkout(order: DtoPublicOrderRequest): Promise<DtoPublicOrder> {\n\t\t// Attach a coarse device fingerprint for the anti-scalping device_velocity\n\t\t// signal (RFC 0004) unless the caller already supplied one. Best-effort:\n\t\t// undefined off the browser or when traits are unavailable.\n\t\tconst body: DtoPublicOrderRequest =\n\t\t\torder.fingerprint === undefined ? { ...order, fingerprint: deviceFingerprint() } : order;\n\t\tconst res = await this.#fetch(`${this.#base}/orders`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tbody: JSON.stringify(body),\n\t\t});\n\t\treturn this.#parse<DtoPublicOrder>(res, 'checkout failed');\n\t}\n\n\t/**\n\t * Sends a one-time code by SMS for events that require a verified phone\n\t * (event.protection.requireVerifiedPhone). Captcha-gated like checkout, so\n\t * pass a captcha token minted on the Bookitive origin. Throws a\n\t * BookitiveError: 400 (bad/disallowed number), 403 (captcha/blocked), or\n\t * 429 (cooldown/rate limit — back off and let the buyer retry).\n\t */\n\tasync verifyStart(phone: string, captchaToken?: string): Promise<void> {\n\t\tconst res = await this.#fetch(`${this.#base}/verify/start`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tbody: JSON.stringify({ phone, captchaToken }),\n\t\t});\n\t\tawait this.#parse<void>(res, 'failed to send verification code');\n\t}\n\n\t/**\n\t * Validates the SMS code and returns a single-use verificationToken (valid\n\t * ~30 min) to pass as order.verificationToken. Throws a BookitiveError:\n\t * 400 (wrong code), 410 (expired — resend), or 429 (too many attempts).\n\t */\n\tverifyCheck(phone: string, code: string): Promise<DtoPublicVerification> {\n\t\treturn this.#post<DtoPublicVerification>('/verify/check', { phone, code });\n\t}\n\n\t/**\n\t * Queues the buyer for a sold-out ticket type (RFC 0008); omit\n\t * ticketTypeId to wait for any type. Throws a BookitiveError: 400 while\n\t * the wanted quantity is still openly buyable, 409 (error.isConflict)\n\t * when this email is already waiting for the type.\n\t */\n\tjoinWaitlist(req: PublichandlerPayloadWaitlistJoin): Promise<DtoPublicWaitlistEntry> {\n\t\treturn this.#post<DtoPublicWaitlistEntry>('/waitlist', req);\n\t}\n\n\t/**\n\t * Subscribes to live availability over websocket: `startstate` fires with\n\t * the full snapshot on every (re)connect, then `seat` deltas stream in.\n\t * Reconnects automatically with backoff; call close() when done.\n\t */\n\tlive(handlers: LiveHandlers): LiveSubscription {\n\t\treturn new LiveSubscription(`${this.#base}/live`, handlers);\n\t}\n\n\tasync #get<T>(path: string): Promise<T> {\n\t\tconst res = await this.#fetch(`${this.#base}${path}`);\n\t\treturn this.#parse<T>(res, `request failed: ${path || '/'}`);\n\t}\n\n\tasync #post<T>(path: string, body: unknown): Promise<T> {\n\t\tconst res = await this.#fetch(`${this.#base}${path}`, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\tbody: JSON.stringify(body),\n\t\t});\n\t\treturn this.#parse<T>(res, `request failed: ${path}`);\n\t}\n\n\tasync #parse<T>(res: Response, fallback: string): Promise<T> {\n\t\tif (!res.ok) {\n\t\t\tlet body: DtoAPIError | undefined;\n\t\t\ttry {\n\t\t\t\tbody = (await res.json()) as DtoAPIError;\n\t\t\t} catch {\n\t\t\t\t// non-JSON error body — the fallback message covers it\n\t\t\t}\n\t\t\tthrow new BookitiveError(res.status, body, fallback);\n\t\t}\n\t\t// 204/205 never carry a body. Otherwise read the text and parse only\n\t\t// when it's non-empty — this avoids res.headers.get('content-length'),\n\t\t// which throws under SvelteKit's SSR fetch (response headers aren't\n\t\t// serialized by default) and would otherwise 500 any server-side load.\n\t\tif (res.status === 204 || res.status === 205) {\n\t\t\treturn undefined as T;\n\t\t}\n\t\tconst text = await res.text();\n\t\treturn (text ? JSON.parse(text) : undefined) as T;\n\t}\n}\n","// Buyer-facing texts for the public order API's error codes. The backend's\n// `msg` is an English developer string and must never reach a buyer; hosts\n// call checkoutErrorMessage() and fall back to their own generic copy when it\n// returns undefined (unknown code, network failure, plain Error).\nimport { BookitiveError } from './client';\n\ntype Lang = 'cs' | 'en';\ntype Message = string | ((fields: Record<string, string>) => string);\n\nconst MESSAGES: Record<Lang, Record<string, Message>> = {\n\tcs: {\n\t\tPER_ORDER_LIMITS: (f) =>\n\t\t\tf.min\n\t\t\t\t? `Vstupenek „${f.ticketType}“ je potřeba objednat alespoň ${f.min}.`\n\t\t\t\t: f.max\n\t\t\t\t\t? `Vstupenek „${f.ticketType}“ lze objednat nejvýše ${f.max} na jednu objednávku.`\n\t\t\t\t\t: 'Počet vstupenek je mimo povolený rozsah pro jednu objednávku.',\n\t\tPER_CUSTOMER_LIMIT:\n\t\t\t'Překročili jste maximální počet vstupenek na jednoho zákazníka pro tuto akci.',\n\t\tSOLD_OUT: 'Vybraný typ vstupenek je již vyprodaný.',\n\t\tSEATS_TAKEN: 'Některé z vybraných míst si právě zabral někdo jiný — vyberte prosím jiná.',\n\t\tCAPACITY_FULL: 'Kapacita vybrané zóny je již vyčerpaná.',\n\t\tSALE_WINDOW: 'Prodej tohoto typu vstupenek právě neprobíhá.',\n\t\tSALES_PAUSED: 'Pořadatel prodej vstupenek dočasně pozastavil. Zkuste to prosím později.',\n\t\tTICKET_TYPE_PAUSED: 'Prodej tohoto typu vstupenek je dočasně pozastaven.',\n\t\tNOT_ON_SALE: 'Prodej vstupenek na tuto akci právě neprobíhá.',\n\t\tDISCOUNT_INVALID: 'Zadaný slevový kód není platný.',\n\t\tDISCOUNT_EXHAUSTED: 'Zadaný slevový kód už byl vyčerpán.',\n\t\tVERIFICATION_INVALID: 'Ověření telefonu vypršelo — ověřte se prosím znovu.',\n\t\tATTENDEES_REQUIRED: 'Vyplňte prosím jméno pro každou vstupenku.',\n\t},\n\ten: {\n\t\tPER_ORDER_LIMITS: (f) =>\n\t\t\tf.min\n\t\t\t\t? `You need to order at least ${f.min} “${f.ticketType}” tickets.`\n\t\t\t\t: f.max\n\t\t\t\t\t? `You can order at most ${f.max} “${f.ticketType}” tickets per order.`\n\t\t\t\t\t: 'The ticket quantity is outside the allowed per-order range.',\n\t\tPER_CUSTOMER_LIMIT:\n\t\t\t'You have reached the maximum number of tickets per customer for this event.',\n\t\tSOLD_OUT: 'The selected ticket type is sold out.',\n\t\tSEATS_TAKEN: 'One of your seats was just taken — please pick another.',\n\t\tCAPACITY_FULL: 'The selected area is at full capacity.',\n\t\tSALE_WINDOW: 'This ticket type is not on sale right now.',\n\t\tSALES_PAUSED: 'The organizer has temporarily paused ticket sales. Please try again later.',\n\t\tTICKET_TYPE_PAUSED: 'Sales of this ticket type are temporarily paused.',\n\t\tNOT_ON_SALE: 'Tickets for this event are not on sale right now.',\n\t\tDISCOUNT_INVALID: 'That discount code is not valid.',\n\t\tDISCOUNT_EXHAUSTED: 'That discount code has been fully redeemed.',\n\t\tVERIFICATION_INVALID: 'Your phone verification expired — please verify again.',\n\t\tATTENDEES_REQUIRED: 'Please fill in a name for every ticket.',\n\t},\n};\n\n/**\n * Localized buyer-facing message for a checkout failure, or undefined when\n * the error carries no known code (caller shows its own generic text).\n * Accepts any BCP 47 locale; everything except Czech falls back to English.\n */\nexport function checkoutErrorMessage(err: unknown, locale?: string): string | undefined {\n\tif (!(err instanceof BookitiveError)) return undefined;\n\tconst lang: Lang = locale?.toLowerCase().startsWith('cs') ? 'cs' : 'en';\n\tconst entry = MESSAGES[lang][err.type];\n\tif (!entry) return undefined;\n\treturn typeof entry === 'function' ? entry(err.fields ?? {}) : entry;\n}\n"],"mappings":";AAaO,IAAK,eAAL,kBAAKA,kBAAL;AACN,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,yBAAsB;AACtB,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,qBAAkB;AAClB,EAAAA,cAAA,kBAAe;AACf,EAAAA,cAAA,6BAA0B;AAC1B,EAAAA,cAAA,8BAA2B;AAC3B,EAAAA,cAAA,sBAAmB;AACnB,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,yBAAsB;AACtB,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,mBAAgB;AAChB,EAAAA,cAAA,qBAAkB;AAClB,EAAAA,cAAA,mBAAgB;AAChB,EAAAA,cAAA,oBAAiB;AACjB,EAAAA,cAAA,yBAAsB;AACtB,EAAAA,cAAA,kBAAe;AACf,EAAAA,cAAA,wBAAqB;AACrB,EAAAA,cAAA,0BAAuB;AACvB,EAAAA,cAAA,4BAAyB;AACzB,EAAAA,cAAA,0BAAuB;AACvB,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,6BAA0B;AAC1B,EAAAA,cAAA,4BAAyB;AACzB,EAAAA,cAAA,wBAAqB;AA5BV,SAAAA;AAAA,GAAA;AAmCL,IAAK,eAAL,kBAAKC,kBA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