@everymatrix/player-elevate-optin 0.0.0-stage → 0.0.1

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 (58) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-0dc5272e.js +1196 -0
  3. package/dist/cjs/index.cjs.js +10 -0
  4. package/dist/cjs/loader.cjs.js +15 -0
  5. package/dist/cjs/player-elevate-optin-d65e764f.js +280 -0
  6. package/dist/cjs/player-elevate-optin.cjs.entry.js +10 -0
  7. package/dist/cjs/player-elevate-optin.cjs.js +25 -0
  8. package/dist/collection/collection-manifest.json +12 -0
  9. package/dist/collection/components/player-elevate-optin/index.js +1 -0
  10. package/dist/collection/components/player-elevate-optin/player-elevate-optin.css +205 -0
  11. package/dist/collection/components/player-elevate-optin/player-elevate-optin.js +338 -0
  12. package/dist/collection/index.js +1 -0
  13. package/dist/collection/utils/locale.utils.js +56 -0
  14. package/dist/collection/utils/utils.js +3 -0
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/index-06b994f3.js +1170 -0
  17. package/dist/esm/index.js +2 -0
  18. package/dist/esm/loader.js +11 -0
  19. package/dist/esm/player-elevate-optin-6b9e7727.js +278 -0
  20. package/dist/esm/player-elevate-optin.entry.js +2 -0
  21. package/dist/esm/player-elevate-optin.js +20 -0
  22. package/dist/index.cjs.js +1 -0
  23. package/dist/index.js +1 -0
  24. package/dist/player-elevate-optin/app-globals-0f993ce5.js +1 -0
  25. package/dist/player-elevate-optin/index-06b994f3.js +2 -0
  26. package/dist/player-elevate-optin/index.esm.js +1 -0
  27. package/dist/player-elevate-optin/player-elevate-optin-6b9e7727.js +1 -0
  28. package/dist/player-elevate-optin/player-elevate-optin.entry.js +1 -0
  29. package/dist/player-elevate-optin/player-elevate-optin.esm.js +1 -0
  30. package/dist/stencil.config.dev.js +19 -0
  31. package/dist/stencil.config.js +19 -0
  32. package/dist/storybook/main.js +43 -0
  33. package/dist/storybook/preview.js +9 -0
  34. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-optin/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  35. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-optin/.stencil/packages/stencil/player-elevate-optin/stencil.config.d.ts +2 -0
  36. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-optin/.stencil/packages/stencil/player-elevate-optin/stencil.config.dev.d.ts +2 -0
  37. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-optin/.stencil/packages/stencil/player-elevate-optin/storybook/main.d.ts +3 -0
  38. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-optin/.stencil/packages/stencil/player-elevate-optin/storybook/preview.d.ts +70 -0
  39. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-optin/.stencil/tools/plugins/index.d.ts +4 -0
  40. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-optin/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
  41. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-optin/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  42. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-optin/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  43. package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/player-elevate-optin/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  44. package/dist/types/components/player-elevate-optin/index.d.ts +1 -0
  45. package/dist/types/components/player-elevate-optin/player-elevate-optin.d.ts +27 -0
  46. package/dist/types/components.d.ts +45 -0
  47. package/dist/types/index.d.ts +1 -0
  48. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  49. package/dist/types/utils/locale.utils.d.ts +10 -0
  50. package/dist/types/utils/utils.d.ts +1 -0
  51. package/loader/cdn.js +1 -0
  52. package/loader/index.cjs.js +1 -0
  53. package/loader/index.d.ts +24 -0
  54. package/loader/index.es2017.js +1 -0
  55. package/loader/index.js +2 -0
  56. package/loader/package.json +11 -0
  57. package/package.json +24 -3
  58. package/README.md +0 -3
@@ -0,0 +1,2 @@
1
+ export { P as PlayerElevateOptin } from './player-elevate-optin-6b9e7727.js';
2
+ import './index-06b994f3.js';
@@ -0,0 +1,11 @@
1
+ import { b as bootstrapLazy } from './index-06b994f3.js';
2
+ export { s as setNonce } from './index-06b994f3.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ const defineCustomElements = async (win, options) => {
6
+ if (typeof window === 'undefined') return undefined;
7
+ await globalScripts();
8
+ return bootstrapLazy([["player-elevate-optin",[[1,"player-elevate-optin",{"endpoint":[1],"session":[1],"language":[1],"enableOptIn":[4,"enable-opt-in"],"openOptIn":[32],"openOptOut":[32],"terms":[32],"playerOptIn":[32],"openShopRestriction":[32],"pendingShopItem":[32],"submitting":[32]},[[8,"message","handleMessage"]]]]]], options);
9
+ };
10
+
11
+ export { defineCustomElements };
@@ -0,0 +1,278 @@
1
+ import { r as registerInstance, h } from './index-06b994f3.js';
2
+
3
+ const DEFAULT_LANGUAGE = 'en';
4
+ const TRANSLATIONS = {
5
+ en: {
6
+ joinLoyaltyProgram: 'JOIN THE LOYALTY PROGRAM',
7
+ readTermsAndConditions: 'Read Terms & Conditions',
8
+ maybeLater: 'MAYBE LATER',
9
+ optIn: 'OPT IN',
10
+ optOut: 'OPT OUT',
11
+ optInRedeemTitle: 'OPT IN AND REDEEM YOUR GIFT',
12
+ optInRedeemDescription: 'You are not enrolled in the Loyalty programme. Opt in now to join the programme and redeem this gift.',
13
+ optInRakebackTitle: 'OPT IN AND CLAIM YOUR RAKEBACK',
14
+ optInRakebackDescription: 'You are not enrolled in the Loyalty programme. Opt in now to join the programme and claim this rakeback.',
15
+ optOutTitle: 'NEXT STEPS TO OPT OUT',
16
+ optOutDescription: 'Please contact the support team to opt out of the Loyalty Programme.',
17
+ okay: 'OKAY',
18
+ loyaltyEnrollSuccess: 'Congratulations! You are now enrolled in the Loyalty Programme.',
19
+ loyaltyEnrollFailed: 'Unable to enroll in the Loyalty Programme. Please try again later.',
20
+ optInNotAvailable: 'Opt-in is not available for this loyalty program.',
21
+ processing: 'Processing...',
22
+ },
23
+ 'zh-hk': {
24
+ joinLoyaltyProgram: '加入忠誠計劃',
25
+ readTermsAndConditions: '閱讀條款及細則',
26
+ maybeLater: '稍後再說',
27
+ optIn: '立即加入',
28
+ optOut: '退出',
29
+ okay: '確定',
30
+ },
31
+ };
32
+ const translate = (key, customLang) => {
33
+ var _a, _b;
34
+ const lang = customLang && TRANSLATIONS[customLang]
35
+ ? customLang
36
+ : DEFAULT_LANGUAGE;
37
+ return (((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) ||
38
+ ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]) ||
39
+ key);
40
+ };
41
+
42
+ const playerElevateOptinCss = ":host{display:block}.Overlay{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;background:var(--emw--color-gray-transparency-20, rgba(21, 43, 48, 0.5019607843))}.GradientContainer{position:relative;width:420px;max-width:calc(100vw - 32px);height:auto;padding:0;box-sizing:border-box;border-radius:16px;background:var(--emw--color-gray-transparency-20, rgba(21, 43, 48, 0.5019607843));border:1px solid var(--emw--color-background-secondary, rgba(26, 214, 92, 0.5019607843))}.Modal{width:100%;height:auto;padding:28px 32px;box-sizing:border-box;background:var(--emw--color-primary, rgba(21, 43, 48, 0.5019607843));border-radius:16px;display:flex;flex-direction:column;align-items:center}.CloseButton{position:absolute;top:12px;right:12px;width:32px;height:32px;border-radius:50%;border:0;background:var(--lumo-tint-10pct, rgba(255, 255, 255, 0.15));color:var(--emw--color-white, #FFFFFF);font-size:22px;cursor:pointer}.Icon{margin-bottom:12px;font-size:28px;color:var(--emw--color-white, #FFFFFF)}.TermsLink{margin:0 0 20px;display:inline-flex;align-items:center;gap:6px;text-decoration:underline;color:var(--emw--color-primary)}.TermsLink svg{display:block;flex-shrink:0}.Divider{width:100%;height:1px;background:var(--lumo-tint-10pct, rgba(255, 255, 255, 0.15))}.GamificationButtonIcon{fill:var(--emw--color-white, #FFFFFF)}.Title{width:100%;margin:0 0 20px;font-size:22px;font-weight:700;line-height:28px;text-transform:none;text-align:center;color:var(--emw--color-white, #FFFFFF)}.Description{width:100%;max-width:340px;margin:0;padding:18px 0;text-align:center;font-size:16px;line-height:24px;color:var(--emw--color-white, #FFFFFF);border-top:1px solid var(--emw--color-black-15, rgba(255, 255, 255, 0.15));border-bottom:1px solid var(--emw--color-black-15, rgba(255, 255, 255, 0.15))}.TermsTitle{width:100%;margin:0 0 20px;margin-top:24px;font-size:22px;font-weight:700;line-height:28px;text-transform:none;text-align:center;color:var(--emw--color-white, #FFFFFF)}.TermsDescription,.ComplianceDescription,.OptOutDescription{color:var(--emw--color-white, #FFFFFF);text-align:center;font-size:14px}.Modal a{color:var(--emw--color-white, #FFFFFF);margin-top:8px}.Actions{width:100%;display:flex;gap:12px;justify-content:space-between;margin-top:22px}.SecondaryButton{flex:1;min-width:0;height:44px;border:1px solid var(--emw--color-white, #FFFFFF);border-radius:6px;background:transparent;color:var(--emw--color-white, #FFFFFF);font-weight:700;cursor:pointer}.PrimaryButton{flex:1;min-width:0;height:44px;border:none;border-radius:6px;background:var(--emw--color-white, #FFFFFF);color:var(--emw--button-typography-contrast, rgba(21, 43, 48, 0.5019607843));font-weight:700;cursor:pointer}.SuccessMessage{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);background:var(--emw--color-gray-transparency-20, rgba(21, 43, 48, 0.5019607843));color:var(--emw--color-white, #FFFFFF);padding:24px;border-radius:12px;z-index:100000}.ActionsSingle{justify-content:center}.OkayButton{flex:0 1 calc(50% - 6px);width:calc(50% - 6px);max-width:calc(50% - 6px)}@media (max-width: 768px){.Overlay{align-items:center;padding:16px;box-sizing:border-box}.GradientContainer{width:100%;max-width:350px}.Modal{width:100%;padding:24px}.Actions{width:100%}.Actions button{flex:1}}";
43
+ const PlayerElevateOptinStyle0 = playerElevateOptinCss;
44
+
45
+ const PlayerElevateOptin = class {
46
+ constructor(hostRef) {
47
+ registerInstance(this, hostRef);
48
+ this.endpoint = undefined;
49
+ this.session = undefined;
50
+ this.language = "en";
51
+ this.enableOptIn = false;
52
+ this.openOptIn = false;
53
+ this.openOptOut = false;
54
+ this.terms = {
55
+ url: '',
56
+ description: '',
57
+ complianceUrl: '',
58
+ complianceDescription: '',
59
+ };
60
+ this.playerOptIn = null;
61
+ this.openShopRestriction = false;
62
+ this.pendingShopItem = null;
63
+ this.submitting = false;
64
+ }
65
+ async handleMessage(event) {
66
+ var _a, _b, _c;
67
+ if (event.origin !== window.location.origin)
68
+ return;
69
+ if (!this.enableOptIn)
70
+ return;
71
+ switch ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) {
72
+ case "BEE_OPT_IN_CLICKED":
73
+ if (this.playerOptIn) {
74
+ return;
75
+ }
76
+ this.openOptIn = true;
77
+ this.openOptOut = false;
78
+ break;
79
+ case "BEE_OPT_OUT_CLICKED":
80
+ this.openOptOut = true;
81
+ this.openOptIn = false;
82
+ break;
83
+ case 'BEE_REDEEM_CLICKED':
84
+ if (!((_b = event.data) === null || _b === void 0 ? void 0 : _b.shopItem))
85
+ return;
86
+ this.pendingShopItem = (_c = event.data) === null || _c === void 0 ? void 0 : _c.shopItem;
87
+ if (this.playerOptIn === null) {
88
+ await this.loadPlayerInfo();
89
+ }
90
+ if (this.playerOptIn === false) {
91
+ this.openShopRestriction = true;
92
+ }
93
+ else if (this.playerOptIn === true) {
94
+ this.continuePendingRedeem();
95
+ }
96
+ else {
97
+ console.error('Unable to verify player opt-in status');
98
+ }
99
+ break;
100
+ }
101
+ }
102
+ continuePendingRedeem() {
103
+ if (!this.pendingShopItem) {
104
+ return;
105
+ }
106
+ window.postMessage({
107
+ type: 'BEERedeemConfirm',
108
+ shopItem: this.pendingShopItem,
109
+ }, window.location.origin);
110
+ this.pendingShopItem = null;
111
+ }
112
+ async handleOptIn() {
113
+ if (this.submitting) {
114
+ return;
115
+ }
116
+ this.submitting = true;
117
+ try {
118
+ const response = await fetch(`${this.endpoint}/v1/elevate/optIn`, {
119
+ method: "PUT",
120
+ headers: {
121
+ "X-Sessionid": this.session,
122
+ "Content-Type": "application/json",
123
+ },
124
+ });
125
+ const result = await response.json();
126
+ if (!response.ok || !result.success) {
127
+ await this.loadPlayerInfo();
128
+ if (this.playerOptIn === true) {
129
+ this.openOptIn = false;
130
+ this.openShopRestriction = false;
131
+ this.continuePendingRedeem();
132
+ window.postMessage({
133
+ type: 'userUpdateOptLoyaltySuccess',
134
+ data: {
135
+ type: 'success',
136
+ message: translate('loyaltyEnrollSuccess', this.language),
137
+ config: {
138
+ timeOut: 3000,
139
+ },
140
+ },
141
+ }, window.location.origin);
142
+ return;
143
+ }
144
+ const message = result.errorCode === 6016
145
+ ? translate('optInNotAvailable', this.language)
146
+ : translate('loyaltyEnrollFailed', this.language);
147
+ window.postMessage({
148
+ type: 'WidgetNotification',
149
+ data: {
150
+ type: 'error',
151
+ message,
152
+ },
153
+ }, window.location.origin);
154
+ return;
155
+ }
156
+ this.playerOptIn = true;
157
+ this.openOptIn = false;
158
+ this.continuePendingRedeem();
159
+ window.postMessage({
160
+ type: "userUpdateOptLoyaltySuccess",
161
+ data: {
162
+ type: "success",
163
+ message: translate('loyaltyEnrollSuccess', this.language),
164
+ config: {
165
+ timeOut: 3000,
166
+ },
167
+ },
168
+ }, window.location.origin);
169
+ }
170
+ catch (error) {
171
+ console.error('Failed to opt in', error);
172
+ window.postMessage({
173
+ type: 'WidgetNotification',
174
+ data: {
175
+ type: 'error',
176
+ message: translate('loyaltyEnrollFailed', this.language),
177
+ },
178
+ }, window.location.origin);
179
+ }
180
+ finally {
181
+ this.submitting = false;
182
+ }
183
+ }
184
+ async loadPlayerInfo() {
185
+ var _a;
186
+ try {
187
+ const url = new URL(`${this.endpoint}/v1/elevate/playerInfo?language=${this.language}`);
188
+ const response = await fetch(url.href, {
189
+ method: "GET",
190
+ headers: {
191
+ "X-Sessionid": this.session,
192
+ "Content-Type": "application/json",
193
+ },
194
+ });
195
+ const result = await response.json();
196
+ if (!result.success)
197
+ return;
198
+ this.playerOptIn = ((_a = result.data) === null || _a === void 0 ? void 0 : _a.optIn) === true;
199
+ }
200
+ catch (error) {
201
+ console.error('Failed to load PlayerInfo', error);
202
+ }
203
+ }
204
+ async loadTerms() {
205
+ var _a, _b, _c, _d;
206
+ try {
207
+ const response = await fetch(`${this.endpoint}/v1/elevate/optIn/terms?language=${this.language}`);
208
+ const result = await response.json();
209
+ if (!result.success) {
210
+ return;
211
+ }
212
+ this.terms = {
213
+ url: ((_a = result.data) === null || _a === void 0 ? void 0 : _a.url) || '',
214
+ description: ((_b = result.data) === null || _b === void 0 ? void 0 : _b.description) || '',
215
+ complianceUrl: ((_c = result.data) === null || _c === void 0 ? void 0 : _c.complianceUrl) || '',
216
+ complianceDescription: ((_d = result.data) === null || _d === void 0 ? void 0 : _d.complianceDesc) || '',
217
+ };
218
+ window.postMessage({
219
+ type: 'BEE_OPT_IN_TERMS_LOADED',
220
+ terms: this.terms,
221
+ }, window.location.origin);
222
+ }
223
+ catch (error) {
224
+ console.error('Failed to load opt-in terms', error);
225
+ }
226
+ }
227
+ async componentWillLoad() {
228
+ if (!this.enableOptIn) {
229
+ return;
230
+ }
231
+ if (!this.endpoint || !this.session) {
232
+ return;
233
+ }
234
+ const storageKey = `player-elevate-optin-shown-${this.session}`;
235
+ let alreadyShown = null;
236
+ try {
237
+ alreadyShown = localStorage.getItem(storageKey);
238
+ }
239
+ catch (error) {
240
+ console.error('Failed to access localStorage', error);
241
+ }
242
+ await Promise.all([
243
+ this.loadTerms(),
244
+ alreadyShown ? Promise.resolve() : this.loadPlayerInfo(),
245
+ ]);
246
+ if (!alreadyShown && this.playerOptIn === false) {
247
+ this.openOptIn = true;
248
+ try {
249
+ localStorage.setItem(storageKey, 'true');
250
+ }
251
+ catch (error) {
252
+ console.error('Failed to write localStorage', error);
253
+ }
254
+ }
255
+ }
256
+ render() {
257
+ if (!this.enableOptIn) {
258
+ return null;
259
+ }
260
+ if (!this.openOptIn && !this.openOptOut && !this.openShopRestriction) {
261
+ return null;
262
+ }
263
+ return (h("div", { class: "Overlay" }, this.openOptIn && (h("div", { class: "GradientContainer" }, h("button", { class: "CloseButton", onClick: () => (this.openOptIn = false) }, "X"), h("div", { class: "Modal" }, h("h2", { class: "TermsTitle" }, translate('joinLoyaltyProgram', this.language)), h("div", { class: "Divider" }), this.terms.description && (h("p", { class: "TermsDescription" }, this.terms.description)), this.terms.complianceDescription && (h("p", { class: "ComplianceDescription" }, this.terms.complianceDescription)), this.terms.complianceUrl && (h("a", { href: this.terms.complianceUrl, target: "_blank", rel: "noopener noreferrer", class: "TermsLink" }, translate('readTermsAndConditions', this.language), h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, h("g", { transform: "translate(0 1)" }, h("path", { d: "M14 3h7v7" }), h("path", { d: "M10 14L21 3" }), h("path", { d: "M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5" }))))), h("div", { class: "Divider" }), h("div", { class: "Actions" }, h("button", { class: "SecondaryButton", onClick: () => (this.openOptIn = false) }, translate('maybeLater', this.language)), h("button", { class: "PrimaryButton", disabled: this.submitting, onClick: () => this.handleOptIn() }, this.submitting
264
+ ? translate('processing', this.language)
265
+ : translate('optIn', this.language)))))), this.openShopRestriction && (h("div", { class: "GradientContainer" }, h("button", { class: "CloseButton", onClick: () => {
266
+ this.openShopRestriction = false;
267
+ this.pendingShopItem = null;
268
+ } }, "X"), h("div", { class: "Modal" }, h("div", { class: "Icon" }, h("svg", { class: "GamificationButtonIcon", width: "24", height: "24", viewBox: "0 0 22 23", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.46429 2.19354C7.21442 2.19354 6.97106 2.2977 6.78878 2.48928C6.6059 2.6815 6.50001 2.94609 6.50001 3.2258C6.50001 3.50552 6.6059 3.77011 6.78878 3.96232C6.97106 4.15391 7.21442 4.25806 7.46429 4.25806H9.63425C9.56187 4.08118 9.47857 3.89797 9.38356 3.7164C8.89769 2.78793 8.27398 2.19354 7.46429 2.19354ZM10 6.32258V9.41935L2.60001 9.41935C2.30348 9.41935 2.14122 9.41855 2.02464 9.40871C2.02 9.40832 2.0156 9.40793 2.01145 9.40753C2.01107 9.40325 2.01069 9.39871 2.01031 9.39392C2.00078 9.27358 2.00001 9.10609 2.00001 8.8V6.94193C2.00001 6.63584 2.00078 6.46835 2.01031 6.348C2.01069 6.34321 2.01107 6.33868 2.01145 6.33439C2.0156 6.334 2.02 6.3336 2.02464 6.33321C2.14122 6.32338 2.30348 6.32258 2.60001 6.32258H10ZM4.66953 4.25806C4.55822 3.92911 4.50001 3.58027 4.50001 3.2258C4.50001 2.41043 4.80802 1.62479 5.36188 1.04266C5.91635 0.459899 6.67224 0.129028 7.46429 0.129028C9.259 0.129028 10.3725 1.38679 11 2.47456C11.6275 1.38679 12.741 0.129028 14.5357 0.129028C15.3278 0.129028 16.0837 0.459899 16.6381 1.04266C17.192 1.62479 17.5 2.41043 17.5 3.2258C17.5 3.58027 17.4418 3.92911 17.3305 4.25806L19.4319 4.25806C19.6843 4.25803 19.9301 4.258 20.1382 4.27555C20.3668 4.29483 20.6366 4.34032 20.908 4.48308C21.2843 4.68101 21.5903 4.99684 21.782 5.38531C21.9203 5.66549 21.9644 5.94392 21.9831 6.17989C22.0001 6.39476 22 6.64847 22 6.90899V8.83294C22 9.09346 22.0001 9.34717 21.9831 9.56204C21.9644 9.79801 21.9203 10.0764 21.782 10.3566C21.5903 10.7451 21.2843 11.0609 20.908 11.2588C20.6366 11.4016 20.3668 11.4471 20.1382 11.4664C20.0938 11.4701 20.0476 11.4731 20 11.4754V18.543C20 19.0872 20 19.5566 19.9694 19.9433C19.9371 20.3513 19.8658 20.7573 19.673 21.1478C19.3854 21.7305 18.9265 22.2043 18.362 22.5012C17.9836 22.7002 17.5904 22.7738 17.195 22.8071C16.8205 22.8387 16.3657 22.8387 15.8386 22.8387H11.0014C11.0009 22.8387 11.0005 22.8387 11 22.8387C10.9995 22.8387 10.9991 22.8387 10.9986 22.8387H6.16144C5.6343 22.8387 5.17954 22.8387 4.80498 22.8071C4.40963 22.7738 4.01641 22.7002 3.63803 22.5012C3.07355 22.2043 2.6146 21.7305 2.32699 21.1478C2.13419 20.7572 2.06288 20.3513 2.03057 19.9432C1.99997 19.5566 1.99999 19.0872 2 18.543L2.00001 11.4754C1.95241 11.4731 1.90624 11.4701 1.86178 11.4664C1.63318 11.4471 1.36345 11.4016 1.09202 11.2588C0.715701 11.0609 0.409739 10.7451 0.217992 10.3566C0.0796947 10.0764 0.0356271 9.79801 0.0169504 9.56204C-5.6861e-05 9.34717 -2.74161e-05 9.09345 2.50544e-06 8.83292L5.24726e-06 6.94193C5.24726e-06 6.93095 3.93595e-06 6.91997 2.62465e-06 6.909C-2.72969e-05 6.64848 -5.67418e-05 6.39476 0.0169505 6.17989C0.0356274 5.94392 0.079695 5.66549 0.217992 5.38531C0.409739 4.99684 0.7157 4.68101 1.09202 4.48308C1.36345 4.34032 1.63318 4.29483 1.86178 4.27555C2.06993 4.258 2.31573 4.25803 2.56811 4.25806C2.57873 4.25806 2.58936 4.25806 2.60001 4.25806H4.66953ZM4.00001 11.4839V18.5032C4.00001 19.0984 4.00078 19.4827 4.02393 19.7751C4.04613 20.0556 4.08381 20.1595 4.109 20.2106C4.20487 20.4048 4.35785 20.5627 4.54601 20.6617C4.59546 20.6877 4.69618 20.7266 4.96784 20.7495C5.25118 20.7734 5.62345 20.7742 6.20001 20.7742H10V11.4839H4.00001ZM12 11.4839V20.7742H15.8C16.3766 20.7742 16.7488 20.7734 17.0322 20.7495C17.3038 20.7266 17.4046 20.6877 17.454 20.6617C17.6422 20.5627 17.7951 20.4048 17.891 20.2106C17.9162 20.1595 17.9539 20.0556 17.9761 19.7751C17.9992 19.4827 18 19.0984 18 18.5032V11.4839H12ZM19.4 9.41935C19.6965 9.41935 19.8588 9.41855 19.9754 9.40871C19.98 9.40832 19.9844 9.40792 19.9886 9.40752C19.9889 9.40324 19.9893 9.39871 19.9897 9.39392C19.9992 9.27358 20 9.10609 20 8.8V6.94193C20 6.63584 19.9992 6.46835 19.9897 6.34801C19.9893 6.34322 19.9889 6.33868 19.9885 6.33439C19.9844 6.334 19.98 6.3336 19.9754 6.33321C19.8588 6.32338 19.6965 6.32258 19.4 6.32258H12V9.41935H19.4ZM14.5357 4.25806C14.7856 4.25806 15.0289 4.15391 15.2112 3.96232C15.3941 3.77011 15.5 3.50552 15.5 3.2258C15.5 2.94609 15.3941 2.6815 15.2112 2.48928C15.0289 2.2977 14.7856 2.19354 14.5357 2.19354C13.726 2.19354 13.1023 2.78793 12.6165 3.7164C12.5214 3.89797 12.4381 4.08118 12.3658 4.25806H14.5357Z" }))), h("h2", { class: "Title" }, translate('optInRedeemTitle', this.language)), h("div", { class: "Divider" }), h("p", { class: "Description" }, translate('optInRedeemDescription', this.language)), h("div", { class: "Divider" }), h("div", { class: "Actions" }, h("button", { class: "SecondaryButton", onClick: () => {
269
+ this.openShopRestriction = false;
270
+ this.pendingShopItem = null;
271
+ } }, translate('maybeLater', this.language)), h("button", { class: "PrimaryButton", disabled: this.submitting, onClick: () => this.handleOptIn() }, this.submitting
272
+ ? translate('processing', this.language)
273
+ : translate('optIn', this.language)))))), this.openOptOut && (h("div", { class: "GradientContainer" }, h("button", { class: "CloseButton", onClick: () => (this.openOptOut = false) }, "X"), h("div", { class: "Modal" }, h("div", { class: "Icon" }, h("svg", { width: "24", height: "24", viewBox: "0 0 80 80", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { cx: "40", cy: "40", r: "34", stroke: "currentColor", "stroke-width": "8" }), h("circle", { cx: "40", cy: "24", r: "4", fill: "currentColor" }), h("path", { d: "M40 34V56", stroke: "currentColor", "stroke-width": "8", "stroke-linecap": "round" }))), h("h2", { class: "Title" }, translate('optOutTitle', this.language)), h("div", { class: "Divider" }), h("p", { class: "OptOutDescription" }, translate('optOutDescription', this.language)), h("div", { class: "Divider" }), h("div", { class: "Actions" }, h("button", { class: "PrimaryButton", onClick: () => (this.openOptOut = false) }, translate('okay', this.language))))))));
274
+ }
275
+ };
276
+ PlayerElevateOptin.style = PlayerElevateOptinStyle0;
277
+
278
+ export { PlayerElevateOptin as P };
@@ -0,0 +1,2 @@
1
+ export { P as player_elevate_optin } from './player-elevate-optin-6b9e7727.js';
2
+ import './index-06b994f3.js';
@@ -0,0 +1,20 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-06b994f3.js';
2
+ export { s as setNonce } from './index-06b994f3.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
7
+ */
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
15
+ };
16
+
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["player-elevate-optin",[[1,"player-elevate-optin",{"endpoint":[1],"session":[1],"language":[1],"enableOptIn":[4,"enable-opt-in"],"openOptIn":[32],"openOptOut":[32],"terms":[32],"playerOptIn":[32],"openShopRestriction":[32],"pendingShopItem":[32],"submitting":[32]},[[8,"message","handleMessage"]]]]]], options);
20
+ });
@@ -0,0 +1 @@
1
+ module.exports = require('./cjs/index.cjs.js');
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './esm/index.js';
@@ -0,0 +1 @@
1
+ const o=()=>{};export{o as g}
@@ -0,0 +1,2 @@
1
+ var t=Object.defineProperty,e=new WeakMap,n=t=>e.get(t),o=(t,n)=>e.set(n.t=t,n),l=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),r=new Map,i=new Map,c="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="undefined"!=typeof window?window:{},a=u.document||{head:{}},f={o:0,l:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},h=t=>Promise.resolve(t),p=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),m=!1,d=[],w=[],y=(t,e)=>n=>{t.push(n),m||(m=!0,e&&4&f.o?b($):f.raf($))},v=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},$=()=>{v(d),v(w),(m=d.length>0)&&f.raf($)},b=t=>h().then(t),g=y(w,!0),S={},j=t=>"object"==(t=typeof t)||"function"===t;function O(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})({},{err:()=>E,map:()=>C,ok:()=>k,unwrap:()=>P,unwrapErr:()=>R});var k=t=>({isOk:!0,isErr:!1,value:t}),E=t=>({isOk:!1,isErr:!0,value:t});function C(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>k(t))):k(n)}if(t.isErr)return E(t.value);throw"should never get here"}var M,x,P=t=>{if(t.isOk)return t.value;throw t.value},R=t=>{if(t.isErr)return t.value;throw t.value},T=(t,e,...n)=>{let o=null,l=!1,s=!1;const r=[],i=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?i(o):null!=o&&"boolean"!=typeof o&&((l="function"!=typeof t&&!j(o))&&(o+=""),l&&s?r[r.length-1].i+=o:r.push(l?A(null,o):o),s=l)};if(i(n),e){const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}const c=A(t,null);return c.u=e,r.length>0&&(c.h=r),c},A=(t,e)=>({o:0,p:t,i:e,m:null,h:null,u:null}),L={},N=new WeakMap,U=t=>"sc-"+t.v,W=(t,e,n,o,s,r)=>{if(n!==o){let i=l(t,e),c=e.toLowerCase();if("class"===e){const e=t.classList,l=H(n),s=H(o);e.remove(...l.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!l.includes(t))))}else if(i||"o"!==e[0]||"n"!==e[1]){const l=j(o);if((i||l&&null!==o)&&!s)try{if(t.tagName.includes("-"))t[e]=o;else{const l=null==o?"":o;"list"===e?i=!1:null!=n&&t[e]==l||(t[e]=l)}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!i||4&r||s)&&!l&&t.setAttribute(e,o=!0===o?"":o)}else if(e="-"===e[2]?e.slice(3):l(u,c)?c.slice(2):c[2]+e.slice(3),n||o){const l=e.endsWith(q);e=e.replace(D,""),n&&f.rel(t,e,n,l),o&&f.ael(t,e,o,l)}}},F=/\s/,H=t=>t?t.split(F):[],q="Capture",D=RegExp(q+"$"),G=(t,e,n)=>{const o=11===e.m.nodeType&&e.m.host?e.m.host:e.m,l=t&&t.u||S,s=e.u||S;for(const t of V(Object.keys(l)))t in s||W(o,t,l[t],void 0,n,e.o);for(const t of V(Object.keys(s)))W(o,t,l[t],s[t],n,e.o)};function V(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var _=!1,z=(t,e,n)=>{const o=e.h[n];let l,s,r=0;if(null!==o.i)l=o.m=a.createTextNode(o.i);else{if(_||(_="svg"===o.p),l=o.m=a.createElementNS(_?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",o.p),_&&"foreignObject"===o.p&&(_=!1),G(null,o,_),null!=M&&l["s-si"]!==M&&l.classList.add(l["s-si"]=M),o.h)for(r=0;r<o.h.length;++r)s=z(t,o,r),s&&l.appendChild(s);"svg"===o.p?_=!1:"foreignObject"===l.tagName&&(_=!0)}return l["s-hn"]=x,l},B=(t,e,n,o,l,s)=>{let r,i=t;for(i.shadowRoot&&i.tagName===x&&(i=i.shadowRoot);l<=s;++l)o[l]&&(r=z(null,n,l),r&&(o[l].m=r,Q(i,r,e)))},I=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.m;t&&t.remove()}}},J=(t,e)=>t.p===e.p,K=(t,e,n=!1)=>{const o=e.m=t.m,l=t.h,s=e.h,r=e.p,i=e.i;null===i?(G(t,e,_="svg"===r||"foreignObject"!==r&&_),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,r=0,i=0,c=e.length-1,u=e[0],a=e[c],f=o.length-1,h=o[0],p=o[f];for(;r<=c&&i<=f;)null==u?u=e[++r]:null==a?a=e[--c]:null==h?h=o[++i]:null==p?p=o[--f]:J(u,h)?(K(u,h,l),u=e[++r],h=o[++i]):J(a,p)?(K(a,p,l),a=e[--c],p=o[--f]):J(u,p)?(K(u,p,l),Q(t,u.m,a.m.nextSibling),u=e[++r],p=o[--f]):J(a,h)?(K(a,h,l),Q(t,a.m,u.m),a=e[--c],h=o[++i]):(s=z(e&&e[i],n,i),h=o[++i],s&&Q(u.m.parentNode,s,u.m));r>c?B(t,null==o[f+1]?null:o[f+1].m,n,o,i,f):i>f&&I(e,r,c)})(o,l,e,s,n):null!==s?(null!==t.i&&(o.textContent=""),B(o,null,e,s,0,s.length-1)):null!==l&&I(l,0,l.length-1),_&&"svg"===r&&(_=!1)):t.i!==i&&(o.data=i)},Q=(t,e,n)=>null==t?void 0:t.insertBefore(e,n),X=(t,e)=>{e&&!t.$&&e["s-p"]&&e["s-p"].push(new Promise((e=>t.$=e)))},Y=(t,e)=>{if(t.o|=16,!(4&t.o))return X(t,t.S),g((()=>Z(t,e)));t.o|=512},Z=(t,e)=>{const n=t.t;if(!n)throw Error(`Can't render component <${t.$hostElement$.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return e&&(t.o|=256,t.j&&(t.j.map((([t,e])=>rt(n,t,e))),t.j=void 0),o=rt(n,"componentWillLoad")),tt(o,(()=>nt(t,n,e)))},tt=(t,e)=>et(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),et=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,nt=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.O,n=t.$hostElement$,o=e.o,l=((t,e)=>{var n;const o=U(e),l=i.get(o);if(t=11===t.nodeType?t:a,l)if("string"==typeof l){let s,r=N.get(t=t.head||t);if(r||N.set(t,r=new Set),!r.has(o)){{s=a.createElement("style"),s.innerHTML=l;const e=null!=(n=f.k)?n:O(a);null!=e&&s.setAttribute("nonce",e),t.insertBefore(s,t.querySelector("link"))}4&e.o&&(s.innerHTML+=c),r&&r.add(o)}}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);ot(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>lt(t);0===e.length?n():(Promise.all(e).then(n),t.o|=4,e.length=0)}},ot=(t,e,n,o)=>{try{e=e.render(),t.o&=-17,t.o|=2,((t,e,n=!1)=>{const o=t.$hostElement$,l=t.O,s=t.C||A(null,null),r=(t=>t&&t.p===L)(e)?e:T(null,null,e);if(x=o.tagName,n&&r.u)for(const t of Object.keys(r.u))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(r.u[t]=o[t]);r.p=null,r.o|=4,t.C=r,r.m=s.m=o.shadowRoot||o,M=o["s-sc"],K(s,r,n)})(t,e,o)}catch(e){s(e,t.$hostElement$)}return null},lt=t=>{const e=t.$hostElement$,n=t.S;64&t.o||(t.o|=64,it(e),t.M(e),n||st()),t.$&&(t.$(),t.$=void 0),512&t.o&&b((()=>Y(t,!1))),t.o&=-517},st=()=>{it(a.documentElement),b((()=>(t=>{const e=f.ce("appload",{detail:{namespace:"player-elevate-optin"}});return t.dispatchEvent(e),e})(u)))},rt=(t,e,n)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t)}},it=t=>t.classList.add("hydrated"),ct=(t,e,o)=>{var l,s;const r=t.prototype;if(e.P){const i=Object.entries(null!=(l=e.P)?l:{});if(i.map((([t,[l]])=>{(31&l||2&o&&32&l)&&Object.defineProperty(r,t,{get(){return((t,e)=>n(this).R.get(e))(0,t)},set(o){((t,e,o,l)=>{const s=n(t);if(!s)throw Error(`Couldn't find host element for "${l.v}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const r=s.R.get(e),i=s.o,c=s.t;o=((t,e)=>null==t||j(t)?t:4&e?"false"!==t&&(""===t||!!t):1&e?t+"":t)(o,l.P[e][0]),8&i&&void 0!==r||o===r||Number.isNaN(r)&&Number.isNaN(o)||(s.R.set(e,o),c&&2==(18&i)&&Y(s,!1))})(this,t,o,e)},configurable:!0,enumerable:!0})})),1&o){const o=new Map;r.attributeChangedCallback=function(t,l,s){f.jmp((()=>{var i;const c=o.get(t);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(r.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const o=n(this),r=null==o?void 0:o.o;if(r&&!(8&r)&&128&r&&s!==l){const n=o.t,r=null==(i=e.T)?void 0:i[t];null==r||r.forEach((e=>{null!=n[e]&&n[e].call(n,s,l,t)}))}return}}this[c]=(null!==s||"boolean"!=typeof this[c])&&s}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=e.T)?s:{}),...i.filter((([t,e])=>15&e[0])).map((([t,e])=>{const n=e[1]||t;return o.set(n,t),n}))]))}}return t},ut=(t,o={})=>{var l;const h=[],m=o.exclude||[],d=u.customElements,w=a.head,y=w.querySelector("meta[charset]"),v=a.createElement("style"),$=[];let b,g=!0;Object.assign(f,o),f.l=new URL(o.resourcesUrl||"./",a.baseURI).href;let S=!1;if(t.map((t=>{t[1].map((o=>{const l={o:o[0],v:o[1],P:o[2],A:o[3]};4&l.o&&(S=!0),l.P=o[2],l.A=o[3];const c=l.v,u=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,n)=>{const o={o:0,$hostElement$:t,O:n,R:new Map};o.L=new Promise((t=>o.M=t)),t["s-p"]=[],t["s-rc"]=[],e.set(t,o)})(t=this,l),1&l.o)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${l.v}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){const t=n(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,at(this,t,l.A)),b&&(clearTimeout(b),b=null),g?$.push(this):f.jmp((()=>(t=>{if(!(1&f.o)){const e=n(t),o=e.O,l=()=>{};if(1&e.o)at(t,e,o.A),(null==e?void 0:e.t)||(null==e?void 0:e.L)&&e.L.then((()=>{}));else{e.o|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){X(e,e.S=n);break}}o.P&&Object.entries(o.P).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;if(!(32&e.o)){if(e.o|=32,n.N){const t=(t=>{const e=t.v.replace(/-/g,"_"),n=t.N;if(!n)return;const o=r.get(n);return o?o[e]:import(`./${n}.entry.js`).then((t=>(r.set(n,t),t[e])),s)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n);if(t&&"then"in t){const e=()=>{};o=await t,e()}else o=t;if(!o)throw Error(`Constructor for "${n.v}#${e.U}" was not found`);o.isProxied||(ct(o,n,2),o.isProxied=!0);const l=()=>{};e.o|=8;try{new o(e)}catch(t){s(t)}e.o&=-9,l()}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.o|=128));if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=U(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);p&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,i.set(t,o)})(e,t,!!(1&n.o)),o()}}}const l=e.S,c=()=>Y(e,!0);l&&l["s-rc"]?l["s-rc"].push(c):c()})(t,e,o)}l()}})(this)))}disconnectedCallback(){f.jmp((()=>(async()=>{if(!(1&f.o)){const t=n(this);t.W&&(t.W.map((t=>t())),t.W=void 0),(null==t?void 0:t.t)||(null==t?void 0:t.L)&&t.L.then((()=>{}))}})()))}componentOnReady(){return n(this).L}};l.N=t[0],m.includes(c)||d.get(c)||(h.push(c),d.define(c,ct(u,l,1)))}))})),h.length>0&&(S&&(v.textContent+=c),v.textContent+=h.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",v.innerHTML.length)){v.setAttribute("data-styles","");const t=null!=(l=f.k)?l:O(a);null!=t&&v.setAttribute("nonce",t),w.insertBefore(v,y?y.nextSibling:w.firstChild)}g=!1,$.length?$.map((t=>t.connectedCallback())):f.jmp((()=>b=setTimeout(st,30)))},at=(t,e,n)=>{n&&n.map((([n,o,l])=>{const s=ht(t,n),r=ft(e,l),i=pt(n);f.ael(s,o,r,i),(e.W=e.W||[]).push((()=>f.rel(s,o,r,i)))}))},ft=(t,e)=>n=>{var o;try{256&t.o?null==(o=t.t)||o[e](n):(t.j=t.j||[]).push([e,n])}catch(t){s(t)}},ht=(t,e)=>8&e?u:t,pt=t=>({passive:!!(1&t),capture:!!(2&t)}),mt=t=>f.k=t;export{ut as b,T as h,h as p,o as r,mt as s}
@@ -0,0 +1 @@
1
+ export{P as PlayerElevateOptin}from"./player-elevate-optin-6b9e7727.js";import"./index-06b994f3.js";
@@ -0,0 +1 @@
1
+ import{r as t,h as i}from"./index-06b994f3.js";const o={en:{joinLoyaltyProgram:"JOIN THE LOYALTY PROGRAM",readTermsAndConditions:"Read Terms & Conditions",maybeLater:"MAYBE LATER",optIn:"OPT IN",optOut:"OPT OUT",optInRedeemTitle:"OPT IN AND REDEEM YOUR GIFT",optInRedeemDescription:"You are not enrolled in the Loyalty programme. Opt in now to join the programme and redeem this gift.",optInRakebackTitle:"OPT IN AND CLAIM YOUR RAKEBACK",optInRakebackDescription:"You are not enrolled in the Loyalty programme. Opt in now to join the programme and claim this rakeback.",optOutTitle:"NEXT STEPS TO OPT OUT",optOutDescription:"Please contact the support team to opt out of the Loyalty Programme.",okay:"OKAY",loyaltyEnrollSuccess:"Congratulations! You are now enrolled in the Loyalty Programme.",loyaltyEnrollFailed:"Unable to enroll in the Loyalty Programme. Please try again later.",optInNotAvailable:"Opt-in is not available for this loyalty program.",processing:"Processing..."},"zh-hk":{joinLoyaltyProgram:"加入忠誠計劃",readTermsAndConditions:"閱讀條款及細則",maybeLater:"稍後再說",optIn:"立即加入",optOut:"退出",okay:"確定"}},e=(t,i)=>{var e,r;return(null===(e=o[i&&o[i]?i:"en"])||void 0===e?void 0:e[t])||(null===(r=o.en)||void 0===r?void 0:r[t])||t},r=class{constructor(i){t(this,i),this.endpoint=void 0,this.session=void 0,this.language="en",this.enableOptIn=!1,this.openOptIn=!1,this.openOptOut=!1,this.terms={url:"",description:"",complianceUrl:"",complianceDescription:""},this.playerOptIn=null,this.openShopRestriction=!1,this.pendingShopItem=null,this.submitting=!1}async handleMessage(t){var i,o,e;if(t.origin===window.location.origin&&this.enableOptIn)switch(null===(i=t.data)||void 0===i?void 0:i.type){case"BEE_OPT_IN_CLICKED":if(this.playerOptIn)return;this.openOptIn=!0,this.openOptOut=!1;break;case"BEE_OPT_OUT_CLICKED":this.openOptOut=!0,this.openOptIn=!1;break;case"BEE_REDEEM_CLICKED":if(!(null===(o=t.data)||void 0===o?void 0:o.shopItem))return;this.pendingShopItem=null===(e=t.data)||void 0===e?void 0:e.shopItem,null===this.playerOptIn&&await this.loadPlayerInfo(),!1===this.playerOptIn?this.openShopRestriction=!0:!0===this.playerOptIn?this.continuePendingRedeem():console.error("Unable to verify player opt-in status")}}continuePendingRedeem(){this.pendingShopItem&&(window.postMessage({type:"BEERedeemConfirm",shopItem:this.pendingShopItem},window.location.origin),this.pendingShopItem=null)}async handleOptIn(){if(!this.submitting){this.submitting=!0;try{const t=await fetch(`${this.endpoint}/v1/elevate/optIn`,{method:"PUT",headers:{"X-Sessionid":this.session,"Content-Type":"application/json"}}),i=await t.json();if(!t.ok||!i.success){if(await this.loadPlayerInfo(),!0===this.playerOptIn)return this.openOptIn=!1,this.openShopRestriction=!1,this.continuePendingRedeem(),void window.postMessage({type:"userUpdateOptLoyaltySuccess",data:{type:"success",message:e("loyaltyEnrollSuccess",this.language),config:{timeOut:3e3}}},window.location.origin);const t=e(6016===i.errorCode?"optInNotAvailable":"loyaltyEnrollFailed",this.language);return void window.postMessage({type:"WidgetNotification",data:{type:"error",message:t}},window.location.origin)}this.playerOptIn=!0,this.openOptIn=!1,this.continuePendingRedeem(),window.postMessage({type:"userUpdateOptLoyaltySuccess",data:{type:"success",message:e("loyaltyEnrollSuccess",this.language),config:{timeOut:3e3}}},window.location.origin)}catch(t){console.error("Failed to opt in",t),window.postMessage({type:"WidgetNotification",data:{type:"error",message:e("loyaltyEnrollFailed",this.language)}},window.location.origin)}finally{this.submitting=!1}}}async loadPlayerInfo(){var t;try{const i=new URL(`${this.endpoint}/v1/elevate/playerInfo?language=${this.language}`),o=await fetch(i.href,{method:"GET",headers:{"X-Sessionid":this.session,"Content-Type":"application/json"}}),e=await o.json();if(!e.success)return;this.playerOptIn=!0===(null===(t=e.data)||void 0===t?void 0:t.optIn)}catch(t){console.error("Failed to load PlayerInfo",t)}}async loadTerms(){var t,i,o,e;try{const r=await fetch(`${this.endpoint}/v1/elevate/optIn/terms?language=${this.language}`),n=await r.json();if(!n.success)return;this.terms={url:(null===(t=n.data)||void 0===t?void 0:t.url)||"",description:(null===(i=n.data)||void 0===i?void 0:i.description)||"",complianceUrl:(null===(o=n.data)||void 0===o?void 0:o.complianceUrl)||"",complianceDescription:(null===(e=n.data)||void 0===e?void 0:e.complianceDesc)||""},window.postMessage({type:"BEE_OPT_IN_TERMS_LOADED",terms:this.terms},window.location.origin)}catch(t){console.error("Failed to load opt-in terms",t)}}async componentWillLoad(){if(!this.enableOptIn)return;if(!this.endpoint||!this.session)return;const t=`player-elevate-optin-shown-${this.session}`;let i=null;try{i=localStorage.getItem(t)}catch(t){console.error("Failed to access localStorage",t)}if(await Promise.all([this.loadTerms(),i?Promise.resolve():this.loadPlayerInfo()]),!i&&!1===this.playerOptIn){this.openOptIn=!0;try{localStorage.setItem(t,"true")}catch(t){console.error("Failed to write localStorage",t)}}}render(){return this.enableOptIn&&(this.openOptIn||this.openOptOut||this.openShopRestriction)?i("div",{class:"Overlay"},this.openOptIn&&i("div",{class:"GradientContainer"},i("button",{class:"CloseButton",onClick:()=>this.openOptIn=!1},"X"),i("div",{class:"Modal"},i("h2",{class:"TermsTitle"},e("joinLoyaltyProgram",this.language)),i("div",{class:"Divider"}),this.terms.description&&i("p",{class:"TermsDescription"},this.terms.description),this.terms.complianceDescription&&i("p",{class:"ComplianceDescription"},this.terms.complianceDescription),this.terms.complianceUrl&&i("a",{href:this.terms.complianceUrl,target:"_blank",rel:"noopener noreferrer",class:"TermsLink"},e("readTermsAndConditions",this.language),i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},i("g",{transform:"translate(0 1)"},i("path",{d:"M14 3h7v7"}),i("path",{d:"M10 14L21 3"}),i("path",{d:"M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5"})))),i("div",{class:"Divider"}),i("div",{class:"Actions"},i("button",{class:"SecondaryButton",onClick:()=>this.openOptIn=!1},e("maybeLater",this.language)),i("button",{class:"PrimaryButton",disabled:this.submitting,onClick:()=>this.handleOptIn()},e(this.submitting?"processing":"optIn",this.language))))),this.openShopRestriction&&i("div",{class:"GradientContainer"},i("button",{class:"CloseButton",onClick:()=>{this.openShopRestriction=!1,this.pendingShopItem=null}},"X"),i("div",{class:"Modal"},i("div",{class:"Icon"},i("svg",{class:"GamificationButtonIcon",width:"24",height:"24",viewBox:"0 0 22 23",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.46429 2.19354C7.21442 2.19354 6.97106 2.2977 6.78878 2.48928C6.6059 2.6815 6.50001 2.94609 6.50001 3.2258C6.50001 3.50552 6.6059 3.77011 6.78878 3.96232C6.97106 4.15391 7.21442 4.25806 7.46429 4.25806H9.63425C9.56187 4.08118 9.47857 3.89797 9.38356 3.7164C8.89769 2.78793 8.27398 2.19354 7.46429 2.19354ZM10 6.32258V9.41935L2.60001 9.41935C2.30348 9.41935 2.14122 9.41855 2.02464 9.40871C2.02 9.40832 2.0156 9.40793 2.01145 9.40753C2.01107 9.40325 2.01069 9.39871 2.01031 9.39392C2.00078 9.27358 2.00001 9.10609 2.00001 8.8V6.94193C2.00001 6.63584 2.00078 6.46835 2.01031 6.348C2.01069 6.34321 2.01107 6.33868 2.01145 6.33439C2.0156 6.334 2.02 6.3336 2.02464 6.33321C2.14122 6.32338 2.30348 6.32258 2.60001 6.32258H10ZM4.66953 4.25806C4.55822 3.92911 4.50001 3.58027 4.50001 3.2258C4.50001 2.41043 4.80802 1.62479 5.36188 1.04266C5.91635 0.459899 6.67224 0.129028 7.46429 0.129028C9.259 0.129028 10.3725 1.38679 11 2.47456C11.6275 1.38679 12.741 0.129028 14.5357 0.129028C15.3278 0.129028 16.0837 0.459899 16.6381 1.04266C17.192 1.62479 17.5 2.41043 17.5 3.2258C17.5 3.58027 17.4418 3.92911 17.3305 4.25806L19.4319 4.25806C19.6843 4.25803 19.9301 4.258 20.1382 4.27555C20.3668 4.29483 20.6366 4.34032 20.908 4.48308C21.2843 4.68101 21.5903 4.99684 21.782 5.38531C21.9203 5.66549 21.9644 5.94392 21.9831 6.17989C22.0001 6.39476 22 6.64847 22 6.90899V8.83294C22 9.09346 22.0001 9.34717 21.9831 9.56204C21.9644 9.79801 21.9203 10.0764 21.782 10.3566C21.5903 10.7451 21.2843 11.0609 20.908 11.2588C20.6366 11.4016 20.3668 11.4471 20.1382 11.4664C20.0938 11.4701 20.0476 11.4731 20 11.4754V18.543C20 19.0872 20 19.5566 19.9694 19.9433C19.9371 20.3513 19.8658 20.7573 19.673 21.1478C19.3854 21.7305 18.9265 22.2043 18.362 22.5012C17.9836 22.7002 17.5904 22.7738 17.195 22.8071C16.8205 22.8387 16.3657 22.8387 15.8386 22.8387H11.0014C11.0009 22.8387 11.0005 22.8387 11 22.8387C10.9995 22.8387 10.9991 22.8387 10.9986 22.8387H6.16144C5.6343 22.8387 5.17954 22.8387 4.80498 22.8071C4.40963 22.7738 4.01641 22.7002 3.63803 22.5012C3.07355 22.2043 2.6146 21.7305 2.32699 21.1478C2.13419 20.7572 2.06288 20.3513 2.03057 19.9432C1.99997 19.5566 1.99999 19.0872 2 18.543L2.00001 11.4754C1.95241 11.4731 1.90624 11.4701 1.86178 11.4664C1.63318 11.4471 1.36345 11.4016 1.09202 11.2588C0.715701 11.0609 0.409739 10.7451 0.217992 10.3566C0.0796947 10.0764 0.0356271 9.79801 0.0169504 9.56204C-5.6861e-05 9.34717 -2.74161e-05 9.09345 2.50544e-06 8.83292L5.24726e-06 6.94193C5.24726e-06 6.93095 3.93595e-06 6.91997 2.62465e-06 6.909C-2.72969e-05 6.64848 -5.67418e-05 6.39476 0.0169505 6.17989C0.0356274 5.94392 0.079695 5.66549 0.217992 5.38531C0.409739 4.99684 0.7157 4.68101 1.09202 4.48308C1.36345 4.34032 1.63318 4.29483 1.86178 4.27555C2.06993 4.258 2.31573 4.25803 2.56811 4.25806C2.57873 4.25806 2.58936 4.25806 2.60001 4.25806H4.66953ZM4.00001 11.4839V18.5032C4.00001 19.0984 4.00078 19.4827 4.02393 19.7751C4.04613 20.0556 4.08381 20.1595 4.109 20.2106C4.20487 20.4048 4.35785 20.5627 4.54601 20.6617C4.59546 20.6877 4.69618 20.7266 4.96784 20.7495C5.25118 20.7734 5.62345 20.7742 6.20001 20.7742H10V11.4839H4.00001ZM12 11.4839V20.7742H15.8C16.3766 20.7742 16.7488 20.7734 17.0322 20.7495C17.3038 20.7266 17.4046 20.6877 17.454 20.6617C17.6422 20.5627 17.7951 20.4048 17.891 20.2106C17.9162 20.1595 17.9539 20.0556 17.9761 19.7751C17.9992 19.4827 18 19.0984 18 18.5032V11.4839H12ZM19.4 9.41935C19.6965 9.41935 19.8588 9.41855 19.9754 9.40871C19.98 9.40832 19.9844 9.40792 19.9886 9.40752C19.9889 9.40324 19.9893 9.39871 19.9897 9.39392C19.9992 9.27358 20 9.10609 20 8.8V6.94193C20 6.63584 19.9992 6.46835 19.9897 6.34801C19.9893 6.34322 19.9889 6.33868 19.9885 6.33439C19.9844 6.334 19.98 6.3336 19.9754 6.33321C19.8588 6.32338 19.6965 6.32258 19.4 6.32258H12V9.41935H19.4ZM14.5357 4.25806C14.7856 4.25806 15.0289 4.15391 15.2112 3.96232C15.3941 3.77011 15.5 3.50552 15.5 3.2258C15.5 2.94609 15.3941 2.6815 15.2112 2.48928C15.0289 2.2977 14.7856 2.19354 14.5357 2.19354C13.726 2.19354 13.1023 2.78793 12.6165 3.7164C12.5214 3.89797 12.4381 4.08118 12.3658 4.25806H14.5357Z"}))),i("h2",{class:"Title"},e("optInRedeemTitle",this.language)),i("div",{class:"Divider"}),i("p",{class:"Description"},e("optInRedeemDescription",this.language)),i("div",{class:"Divider"}),i("div",{class:"Actions"},i("button",{class:"SecondaryButton",onClick:()=>{this.openShopRestriction=!1,this.pendingShopItem=null}},e("maybeLater",this.language)),i("button",{class:"PrimaryButton",disabled:this.submitting,onClick:()=>this.handleOptIn()},e(this.submitting?"processing":"optIn",this.language))))),this.openOptOut&&i("div",{class:"GradientContainer"},i("button",{class:"CloseButton",onClick:()=>this.openOptOut=!1},"X"),i("div",{class:"Modal"},i("div",{class:"Icon"},i("svg",{width:"24",height:"24",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("circle",{cx:"40",cy:"40",r:"34",stroke:"currentColor","stroke-width":"8"}),i("circle",{cx:"40",cy:"24",r:"4",fill:"currentColor"}),i("path",{d:"M40 34V56",stroke:"currentColor","stroke-width":"8","stroke-linecap":"round"}))),i("h2",{class:"Title"},e("optOutTitle",this.language)),i("div",{class:"Divider"}),i("p",{class:"OptOutDescription"},e("optOutDescription",this.language)),i("div",{class:"Divider"}),i("div",{class:"Actions"},i("button",{class:"PrimaryButton",onClick:()=>this.openOptOut=!1},e("okay",this.language)))))):null}};r.style=":host{display:block}.Overlay{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;background:var(--emw--color-gray-transparency-20, rgba(21, 43, 48, 0.5019607843))}.GradientContainer{position:relative;width:420px;max-width:calc(100vw - 32px);height:auto;padding:0;box-sizing:border-box;border-radius:16px;background:var(--emw--color-gray-transparency-20, rgba(21, 43, 48, 0.5019607843));border:1px solid var(--emw--color-background-secondary, rgba(26, 214, 92, 0.5019607843))}.Modal{width:100%;height:auto;padding:28px 32px;box-sizing:border-box;background:var(--emw--color-primary, rgba(21, 43, 48, 0.5019607843));border-radius:16px;display:flex;flex-direction:column;align-items:center}.CloseButton{position:absolute;top:12px;right:12px;width:32px;height:32px;border-radius:50%;border:0;background:var(--lumo-tint-10pct, rgba(255, 255, 255, 0.15));color:var(--emw--color-white, #FFFFFF);font-size:22px;cursor:pointer}.Icon{margin-bottom:12px;font-size:28px;color:var(--emw--color-white, #FFFFFF)}.TermsLink{margin:0 0 20px;display:inline-flex;align-items:center;gap:6px;text-decoration:underline;color:var(--emw--color-primary)}.TermsLink svg{display:block;flex-shrink:0}.Divider{width:100%;height:1px;background:var(--lumo-tint-10pct, rgba(255, 255, 255, 0.15))}.GamificationButtonIcon{fill:var(--emw--color-white, #FFFFFF)}.Title{width:100%;margin:0 0 20px;font-size:22px;font-weight:700;line-height:28px;text-transform:none;text-align:center;color:var(--emw--color-white, #FFFFFF)}.Description{width:100%;max-width:340px;margin:0;padding:18px 0;text-align:center;font-size:16px;line-height:24px;color:var(--emw--color-white, #FFFFFF);border-top:1px solid var(--emw--color-black-15, rgba(255, 255, 255, 0.15));border-bottom:1px solid var(--emw--color-black-15, rgba(255, 255, 255, 0.15))}.TermsTitle{width:100%;margin:0 0 20px;margin-top:24px;font-size:22px;font-weight:700;line-height:28px;text-transform:none;text-align:center;color:var(--emw--color-white, #FFFFFF)}.TermsDescription,.ComplianceDescription,.OptOutDescription{color:var(--emw--color-white, #FFFFFF);text-align:center;font-size:14px}.Modal a{color:var(--emw--color-white, #FFFFFF);margin-top:8px}.Actions{width:100%;display:flex;gap:12px;justify-content:space-between;margin-top:22px}.SecondaryButton{flex:1;min-width:0;height:44px;border:1px solid var(--emw--color-white, #FFFFFF);border-radius:6px;background:transparent;color:var(--emw--color-white, #FFFFFF);font-weight:700;cursor:pointer}.PrimaryButton{flex:1;min-width:0;height:44px;border:none;border-radius:6px;background:var(--emw--color-white, #FFFFFF);color:var(--emw--button-typography-contrast, rgba(21, 43, 48, 0.5019607843));font-weight:700;cursor:pointer}.SuccessMessage{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);background:var(--emw--color-gray-transparency-20, rgba(21, 43, 48, 0.5019607843));color:var(--emw--color-white, #FFFFFF);padding:24px;border-radius:12px;z-index:100000}.ActionsSingle{justify-content:center}.OkayButton{flex:0 1 calc(50% - 6px);width:calc(50% - 6px);max-width:calc(50% - 6px)}@media (max-width: 768px){.Overlay{align-items:center;padding:16px;box-sizing:border-box}.GradientContainer{width:100%;max-width:350px}.Modal{width:100%;padding:24px}.Actions{width:100%}.Actions button{flex:1}}";export{r as P}
@@ -0,0 +1 @@
1
+ export{P as player_elevate_optin}from"./player-elevate-optin-6b9e7727.js";import"./index-06b994f3.js";
@@ -0,0 +1 @@
1
+ import{p as e,b as n}from"./index-06b994f3.js";export{s as setNonce}from"./index-06b994f3.js";import{g as t}from"./app-globals-0f993ce5.js";(()=>{const n=import.meta.url,t={};return""!==n&&(t.resourcesUrl=new URL(".",n).href),e(t)})().then((async e=>(await t(),n([["player-elevate-optin",[[1,"player-elevate-optin",{endpoint:[1],session:[1],language:[1],enableOptIn:[4,"enable-opt-in"],openOptIn:[32],openOptOut:[32],terms:[32],playerOptIn:[32],openShopRestriction:[32],pendingShopItem:[32],submitting:[32]},[[8,"message","handleMessage"]]]]]],e))));
@@ -0,0 +1,19 @@
1
+ import { sass } from "@stencil/sass";
2
+ export const config = {
3
+ namespace: 'player-elevate-optin',
4
+ taskQueue: 'async',
5
+ sourceMap: false,
6
+ minifyJs: true,
7
+ extras: {
8
+ experimentalImportInjection: true
9
+ },
10
+ plugins: [sass()],
11
+ outputTargets: [
12
+ {
13
+ type: 'www'
14
+ },
15
+ {
16
+ type: 'docs-readme'
17
+ }
18
+ ]
19
+ };
@@ -0,0 +1,19 @@
1
+ import { cleanPackageJsonStencil } from "../../../tools/plugins";
2
+ import { sass } from "@stencil/sass";
3
+ export const config = {
4
+ namespace: 'player-elevate-optin',
5
+ taskQueue: 'async',
6
+ sourceMap: false,
7
+ minifyJs: true,
8
+ hashFileNames: false,
9
+ extras: {
10
+ experimentalImportInjection: true
11
+ },
12
+ plugins: [cleanPackageJsonStencil(), sass()],
13
+ outputTargets: [
14
+ {
15
+ type: 'dist',
16
+ esmLoaderPath: '../loader'
17
+ }
18
+ ]
19
+ };
@@ -0,0 +1,43 @@
1
+ import path from "path";
2
+ import { getStoryFiles, detectUsedPackages, parseTsConfig, exec, filterParsedPathsByUsedPackages } from "../../../../libs/common/src/storybook/storybook-utils";
3
+ const config = {
4
+ stories: ['../**/*.@(mdx|stories.@(js|ts|tsx))'],
5
+ addons: ['@storybook/addon-essentials', '@storybook/addon-interactions', 'storybook-dark-mode'],
6
+ docs: {
7
+ defaultName: 'Documentation',
8
+ autodocs: 'tag'
9
+ },
10
+ framework: {
11
+ name: '@storybook/web-components-vite',
12
+ options: {}
13
+ },
14
+ // Async viteFinal to build dependent packages before finalizing configuration.
15
+ viteFinal: async (config) => {
16
+ const storyFiles = getStoryFiles(path.resolve(__dirname, '../'));
17
+ const usedPackages = detectUsedPackages(storyFiles);
18
+ const buildPromises = usedPackages.map(async (pkg) => {
19
+ try {
20
+ console.log(`Building package ${pkg}...`);
21
+ const { stdout, stderr } = await exec(`nx run ${pkg}:build`);
22
+ console.log(`Built package ${pkg}: ${stdout}`);
23
+ if (stderr) {
24
+ console.error(`Build warning/error for package ${pkg}: ${stderr}`);
25
+ }
26
+ }
27
+ catch (error) {
28
+ console.error(`Error building package ${pkg}:`, error);
29
+ }
30
+ });
31
+ await Promise.all(buildPromises);
32
+ const parsedPaths = parseTsConfig() || {};
33
+ const filteredParsedPaths = filterParsedPathsByUsedPackages(parsedPaths, usedPackages);
34
+ return Object.assign(Object.assign({}, config), { resolve: {
35
+ alias: Object.assign({}, filteredParsedPaths)
36
+ }, define: {
37
+ process: {
38
+ env: {}
39
+ }
40
+ } });
41
+ }
42
+ };
43
+ export default config;
@@ -0,0 +1,9 @@
1
+ import { themes } from "@storybook/theming";
2
+ export const parameters = {
3
+ darkMode: {
4
+ dark: Object.assign(Object.assign({}, themes.dark), { appBg: 'black' }),
5
+ light: Object.assign(Object.assign({}, themes.normal), { appBg: 'green' }),
6
+ current: 'light',
7
+ stylePreview: true
8
+ }
9
+ };
@@ -0,0 +1,39 @@
1
+ /// <reference types="node" />
2
+ import { exec as execCallback } from 'child_process';
3
+ export declare const exec: typeof execCallback.__promisify__;
4
+ /**
5
+ * Recursively retrieves all story files (.stories.ts/.stories.tsx) in a directory.
6
+ * @param dir The directory to search.
7
+ * @returns Array of story file paths.
8
+ */
9
+ export declare const getStoryFiles: (dir: string) => string[];
10
+ /**
11
+ * Detects which internal packages are used in the provided story files.
12
+ * It looks at every import that starts with the given package alias prefix,
13
+ * then extracts the package name (the segment immediately following the prefix).
14
+ *
15
+ * @param stories Array of story file paths.
16
+ * @returns Array of unique package names (e.g. ['foo', 'bar']).
17
+ */
18
+ export declare const detectUsedPackages: (stories: string[]) => string[];
19
+ /**
20
+ * Extracts all import paths from a file using the TypeScript compiler API.
21
+ * @param filePath The file path to parse.
22
+ * @returns Array of import strings.
23
+ */
24
+ export declare const extractImports: (filePath: string) => string[];
25
+ /**
26
+ * Parses the tsconfig paths and resolves them to absolute paths.
27
+ * @param tsconfigPath The path to the tsconfig file.
28
+ * @returns An object mapping alias keys to absolute paths.
29
+ */
30
+ export declare const parseTsConfig: () => Record<string, string> | null;
31
+ /**
32
+ * Filters the parsed tsconfig alias mapping to only include keys that correspond
33
+ * to the used packages.
34
+ *
35
+ * @param parsedPaths The full alias mapping from tsconfig.
36
+ * @param usedPackages Array of package names that are used (e.g. ['foo', 'bar']).
37
+ * @returns Filtered alias mapping.
38
+ */
39
+ export declare const filterParsedPathsByUsedPackages: (parsedPaths: Record<string, string>, usedPackages: string[]) => Record<string, string>;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1,3 @@
1
+ import type { StorybookConfig } from '@storybook/web-components-vite';
2
+ declare const config: StorybookConfig;
3
+ export default config;