@session-services/web-elements 0.1.30 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/session-services-elements.cjs.js +1 -1
  3. package/dist/cjs/session-services-ticketing.cjs.entry.js +1645 -22994
  4. package/dist/collection/components/session-services-ticketing/bot-detection.js +83 -0
  5. package/dist/collection/components/session-services-ticketing/bot-detection.test.js +74 -0
  6. package/dist/collection/components/session-services-ticketing/session-services-ticketing.css +164 -36
  7. package/dist/collection/components/session-services-ticketing/session-services-ticketing.js +697 -219
  8. package/dist/collection/components/session-services-ticketing/session-services-ticketing.logic.js +25 -4
  9. package/dist/collection/components/session-services-ticketing/session-services-ticketing.logic.test.js +19 -2
  10. package/dist/collection/components/session-services-ticketing/session-services-ticketing.test.js +540 -19
  11. package/dist/components/session-services-ticketing.js +1 -1
  12. package/dist/esm/loader.js +1 -1
  13. package/dist/esm/session-services-elements.js +1 -1
  14. package/dist/esm/session-services-ticketing.entry.js +1645 -22994
  15. package/dist/session-services-elements/p-d7264f6b.entry.js +1 -0
  16. package/dist/session-services-elements/session-services-elements.esm.js +1 -1
  17. package/dist/types/components/session-services-ticketing/bot-detection.d.ts +13 -0
  18. package/dist/types/components/session-services-ticketing/bot-detection.test.d.ts +1 -0
  19. package/dist/types/components/session-services-ticketing/session-services-ticketing.d.ts +52 -5
  20. package/dist/types/components/session-services-ticketing/session-services-ticketing.logic.d.ts +8 -1
  21. package/package.json +4 -4
  22. package/dist/session-services-elements/p-4dd3f723.entry.js +0 -1
@@ -1 +1 @@
1
- import{p as e,b as o}from"./p-DhbVMqIT.js";export{s as setNonce}from"./p-DhbVMqIT.js";import{g as t}from"./p-DQuL1Twl.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((async e=>(await t(),o([["p-8483ca88",[[513,"session-services-formatted-text",{text:[1],theme:[1],currentTheme:[32],segments:[32]},null,{text:[{textChanged:0}],theme:[{themeChanged:0}]}]]],["p-4dd3f723",[[513,"session-services-ticketing",{tenantId:[1,"tenant-id"],eventId:[1,"event-id"],apiUrl:[1,"api-url"],locale:[1],returnUrl:[1,"return-url"],couponCode:[1,"coupon-code"],initialAdmissionPrices:[1,"initial-admission-prices"],initialPreviewQuote:[1,"initial-preview-quote"],passcode:[1],stickyCheckout:[4,"sticky-checkout"],theme:[1],enableAnalytics:[4,"enable-analytics"],debugAnalytics:[4,"debug-analytics"],event:[32],selectedItems:[32],quote:[32],previewQuote:[32],loading:[32],error:[32],quoteLoading:[32],previewLoading:[32],quoteError:[32],couponError:[32],couponInput:[32],appliedCouponCode:[32],passcodeInput:[32],activePasscode:[32],passcodeDenied:[32],selectionPrompt:[32],checkoutLoading:[32],currentTheme:[32],openModalAdmissionId:[32]},null,{tenantId:[{propsChanged:0}],eventId:[{propsChanged:0}],apiUrl:[{propsChanged:0}],passcode:[{propsChanged:0}],couponCode:[{couponCodeChanged:0}],initialAdmissionPrices:[{couponCodeChanged:0}],initialPreviewQuote:[{couponCodeChanged:0}],theme:[{themeChanged:0}]}]]]],e))));
1
+ import{p as e,b as o}from"./p-DhbVMqIT.js";export{s as setNonce}from"./p-DhbVMqIT.js";import{g as n}from"./p-DQuL1Twl.js";(()=>{const o=import.meta.url,n={};return""!==o&&(n.resourcesUrl=new URL(".",o).href),e(n)})().then((async e=>(await n(),o([["p-8483ca88",[[513,"session-services-formatted-text",{text:[1],theme:[1],currentTheme:[32],segments:[32]},null,{text:[{textChanged:0}],theme:[{themeChanged:0}]}]]],["p-d7264f6b",[[513,"session-services-ticketing",{tenantId:[1,"tenant-id"],eventId:[1,"event-id"],apiUrl:[1,"api-url"],locale:[1],returnUrl:[1,"return-url"],couponCode:[1,"coupon-code"],initialAdmissionPrices:[1,"initial-admission-prices"],initialPreviewQuote:[1,"initial-preview-quote"],passcode:[1],stickyCheckout:[4,"sticky-checkout"],theme:[1],enableAnalytics:[4,"enable-analytics"],debugAnalytics:[4,"debug-analytics"],event:[32],selectedItems:[32],quote:[32],previewQuote:[32],initialLoading:[32],eventLoading:[32],retryLoading:[32],passcodeLoading:[32],error:[32],errorKind:[32],refreshError:[32],quoteLoading:[32],previewLoading:[32],quoteError:[32],couponError:[32],couponInput:[32],appliedCouponCode:[32],passcodeInput:[32],activePasscode:[32],passcodeDenied:[32],selectionPrompt:[32],checkoutLoading:[32],checkoutError:[32],currentTheme:[32],openModalAdmissionId:[32],verificationRequired:[32]},null,{tenantId:[{propsChanged:0}],eventId:[{propsChanged:0}],apiUrl:[{propsChanged:0}],passcode:[{propsChanged:0}],couponCode:[{couponCodeChanged:0}],initialAdmissionPrices:[{couponCodeChanged:0}],initialPreviewQuote:[{couponCodeChanged:0}],theme:[{themeChanged:0}]}]]]],e))));
@@ -0,0 +1,13 @@
1
+ export type BotSignal = "automation-user-agent" | "chromedriver" | "phantomjs" | "playwright" | "puppeteer" | "selenium" | "webdriver";
2
+ export type BotDetection = {
3
+ bot: boolean;
4
+ signals: BotSignal[];
5
+ };
6
+ export type BotEnvironment = {
7
+ globals: object;
8
+ root: Pick<Element, "hasAttribute">;
9
+ userAgent: string;
10
+ webdriver: boolean;
11
+ };
12
+ export declare function detectBot(env?: BotEnvironment): BotDetection;
13
+ export declare function isProductionApi(apiUrl: string): boolean;
@@ -9,6 +9,7 @@ export type AnalyticsEventSkipped = {
9
9
  promoterId?: string;
10
10
  teamId?: string;
11
11
  };
12
+ type ErrorKind = "configuration" | "not_found" | "access" | "transient";
12
13
  export declare class SessionsTicketing {
13
14
  host: HTMLElement;
14
15
  tenantId: string;
@@ -32,8 +33,13 @@ export declare class SessionsTicketing {
32
33
  selectedItems: Map<SelectionKey, number>;
33
34
  quote: OrderQuote | null;
34
35
  previewQuote: OrderQuote | null;
35
- loading: boolean;
36
+ initialLoading: boolean;
37
+ eventLoading: boolean;
38
+ retryLoading: boolean;
39
+ passcodeLoading: boolean;
36
40
  error: string | null;
41
+ errorKind: ErrorKind | null;
42
+ refreshError: string | null;
37
43
  quoteLoading: boolean;
38
44
  previewLoading: boolean;
39
45
  quoteError: string | null;
@@ -45,8 +51,10 @@ export declare class SessionsTicketing {
45
51
  passcodeDenied: boolean;
46
52
  selectionPrompt: boolean;
47
53
  checkoutLoading: boolean;
54
+ checkoutError: string | null;
48
55
  currentTheme: "light" | "dark";
49
56
  openModalAdmissionId: string | null;
57
+ verificationRequired: boolean;
50
58
  checkoutInit: EventEmitter<{
51
59
  orderId?: string;
52
60
  checkoutUrl?: string;
@@ -61,15 +69,41 @@ export declare class SessionsTicketing {
61
69
  private mediaQueryList?;
62
70
  private requestId;
63
71
  private previewRequestId;
72
+ private eventRequestId;
73
+ private checkoutRequestId;
74
+ private couponRequestId;
75
+ private initializeId;
76
+ private initialSettled;
77
+ private active;
78
+ private trackedIdentity?;
79
+ private quoteRevision?;
80
+ private checkoutIdempotencyKeys;
81
+ private eventController?;
82
+ private quoteController?;
83
+ private previewController?;
84
+ private checkoutController?;
85
+ private couponController?;
64
86
  private quoteTimer?;
65
87
  private promptTimer?;
66
- componentWillLoad(): Promise<void>;
67
- propsChanged(): Promise<void>;
68
- couponCodeChanged(): Promise<void>;
88
+ private botBypassed;
89
+ private modalTrigger?;
90
+ private modalFocusPending;
91
+ private modalRestorePending;
92
+ connectedCallback(): void;
93
+ componentWillLoad(): void;
94
+ componentDidRender(): void;
95
+ propsChanged(): void;
96
+ couponCodeChanged(): void;
69
97
  themeChanged(): void;
70
98
  disconnectedCallback(): void;
71
99
  private handleDiscountQueryChange;
100
+ private continueAfterVerification;
101
+ private startInitialization;
102
+ private handleInitializationError;
72
103
  private initializeComponent;
104
+ private handleLoadedEvent;
105
+ private finishInitialLoad;
106
+ private invalidateRequests;
73
107
  private setInitialCoupon;
74
108
  private initialCouponCode;
75
109
  private parsedInitialPreviewQuote;
@@ -86,6 +120,7 @@ export declare class SessionsTicketing {
86
120
  private getLowestPrice;
87
121
  private getAdmissionListProducts;
88
122
  private loadEventData;
123
+ private isEventRequestCurrent;
89
124
  private pruneSelectedItems;
90
125
  private trackLoadedEvent;
91
126
  private setupAnalytics;
@@ -101,12 +136,15 @@ export declare class SessionsTicketing {
101
136
  private updateQuote;
102
137
  private scheduleQuoteUpdate;
103
138
  private clearQuoteTimer;
139
+ private invalidateQuote;
104
140
  private clearPromptTimer;
105
141
  private promptTicketSelection;
106
142
  private getQuoteRequestItems;
107
143
  private fetchCartQuote;
108
144
  private applyQuote;
109
145
  private handleQuoteError;
146
+ private quoteRevisionFor;
147
+ private currentQuoteRevision;
110
148
  private updatePreviewQuote;
111
149
  private fetchPreviewQuote;
112
150
  private handleCouponInput;
@@ -116,7 +154,8 @@ export declare class SessionsTicketing {
116
154
  private applyCartCoupon;
117
155
  private applyPreviewCoupon;
118
156
  private removeCartCoupon;
119
- private handleCouponError;
157
+ private isCouponOperationCurrent;
158
+ private isPreviewCouponOperationCurrent;
120
159
  private setCouponError;
121
160
  private trackCouponEntered;
122
161
  private trackCouponApplied;
@@ -124,7 +163,10 @@ export declare class SessionsTicketing {
124
163
  private trackCouponRemoved;
125
164
  private handlePasscodeInput;
126
165
  private submitPasscode;
166
+ private retryEventLoad;
127
167
  private initiateCheckout;
168
+ private getCheckoutIdempotencyKey;
169
+ private isCheckoutRequestCurrent;
128
170
  private trackCheckoutStarted;
129
171
  private trackExternalTicketClick;
130
172
  private getCheckoutItems;
@@ -140,6 +182,7 @@ export declare class SessionsTicketing {
140
182
  private getQuoteAdmission;
141
183
  private getQuoteSection;
142
184
  private formatDateTimeRange;
185
+ private dateFormatter;
143
186
  private formatPriceValue;
144
187
  private handleQuantityDecrease;
145
188
  private handleQuantityIncrease;
@@ -170,6 +213,8 @@ export declare class SessionsTicketing {
170
213
  private renderSectionWithAdmissions;
171
214
  private renderLoadingState;
172
215
  private renderErrorState;
216
+ private renderUpdatingState;
217
+ private renderVerificationState;
173
218
  private renderPasscodeState;
174
219
  private renderNotFoundState;
175
220
  private renderCouponPanel;
@@ -191,6 +236,7 @@ export declare class SessionsTicketing {
191
236
  private renderDoorAlert;
192
237
  private loadingView;
193
238
  private errorView;
239
+ private verificationView;
194
240
  private missingEventView;
195
241
  private pendingView;
196
242
  private renderReadyState;
@@ -198,3 +244,4 @@ export declare class SessionsTicketing {
198
244
  private renderUnavailableState;
199
245
  render(): any;
200
246
  }
247
+ export {};
@@ -75,6 +75,9 @@ export declare function visibleAdmissions(event: DetailedEvent, mode: TicketingM
75
75
  base: number;
76
76
  booking: number;
77
77
  currency: "AUD" | "AED" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BZD" | "CAD" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HUF" | "IDR" | "ILS" | "INR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MNT" | "MOP" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RWF" | "SAR" | "SBD" | "SCR" | "SEK" | "SGD" | "SHP" | "SLE" | "SRD" | "SVC" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "ZAR" | "ZMW" | "ZWL";
78
+ override?: {
79
+ booking: number;
80
+ };
78
81
  };
79
82
  visibility: "ALWAYS" | "HIDDEN" | "AFTER_ADMISSION";
80
83
  teamId: string;
@@ -96,6 +99,7 @@ export declare function topLevelTicketItems(sections: Section[], admissions: Adm
96
99
  export declare function getAdmissionDisplayState(input: {
97
100
  admission: Admission;
98
101
  event: DetailedEvent;
102
+ locale?: string;
99
103
  section?: Section;
100
104
  sectionSoldOut?: boolean;
101
105
  }): AdmissionDisplayState;
@@ -136,6 +140,9 @@ export declare function quoteItemsBySelection(quote: OrderQuote | null): Map<str
136
140
  base: number;
137
141
  booking: number;
138
142
  currency: "AUD" | "AED" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BZD" | "CAD" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HUF" | "IDR" | "ILS" | "INR" | "ISK" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MNT" | "MOP" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RWF" | "SAR" | "SBD" | "SCR" | "SEK" | "SGD" | "SHP" | "SLE" | "SRD" | "SVC" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "ZAR" | "ZMW" | "ZWL";
143
+ override?: {
144
+ booking: number;
145
+ };
139
146
  };
140
147
  visibility: "ALWAYS" | "HIDDEN" | "AFTER_ADMISSION";
141
148
  teamId: string;
@@ -158,7 +165,7 @@ export declare function quoteItemsBySelection(quote: OrderQuote | null): Map<str
158
165
  capacity: number;
159
166
  limit: number;
160
167
  order: number;
161
- visibility: "ALWAYS" | "STACKED" | "HIDDEN";
168
+ visibility: "ALWAYS" | "HIDDEN" | "STACKED";
162
169
  location: {
163
170
  createdAt: string;
164
171
  updatedAt: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@session-services/web-elements",
3
3
  "private": false,
4
- "version": "0.1.30",
4
+ "version": "0.1.31",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/types/components.d.ts",
@@ -158,9 +158,9 @@
158
158
  "rollup-plugin-esbuild": "^6.2.1",
159
159
  "typescript": "~6.0.3",
160
160
  "vitest": "4.1.8",
161
- "@session-services/utils": "0.1.18",
162
- "@session-services/sdk": "0.1.30",
163
- "@session-services/tsconfig": "0.1.0"
161
+ "@session-services/sdk": "0.1.31",
162
+ "@session-services/tsconfig": "0.1.0",
163
+ "@session-services/utils": "0.1.18"
164
164
  },
165
165
  "scripts": {
166
166
  "build": "stencil build",