@gomusdev/web-components 1.39.5 → 1.41.0
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-js/components/ticketSelection/TicketSelectionDetails.svelte.d.ts +2 -0
- package/dist-js/components/ticketSelection/subcomponents/timeslots/lib/lib.svelte.d.ts +1 -0
- package/dist-js/config/{defaultConfig.d.ts → configStore.svelte.d.ts} +12 -1
- package/dist-js/entry.d.ts +0 -0
- package/dist-js/go/go.d.ts +16 -0
- package/dist-js/go/go.spec.d.ts +1 -0
- package/dist-js/go/snippet.d.ts +1 -0
- package/dist-js/gomus-webcomponents.iife.js +86 -28
- package/dist-js/gomus-webcomponents.js +86 -28
- package/package.json +8 -4
- package/dist-js/config/config.d.ts +0 -8
- /package/dist-js/config/{config.spec.d.ts → configStore.spec.d.ts} +0 -0
- /package/dist-js/{go.svelte.d.ts → go/go.e2e.unit.spec.d.ts} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Cart } from '../../lib/models/cart/cart.svelte.ts';
|
|
2
2
|
import { SegmentDetails } from './subcomponents/tickets/subcomponents/segment/SegmentDetails.svelte.ts';
|
|
3
|
+
import { Details as TimeslotDetails } from './subcomponents/timeslots/lib/lib.svelte.ts';
|
|
3
4
|
import { CalendarDate } from '@internationalized/date';
|
|
4
5
|
export type TicketSelectionMode = 'ticket' | 'event' | 'tour';
|
|
5
6
|
export declare const validTicketSelectionFilters: readonly ["timeslot", "day", "annual", "event:scaled-price", "event:ticket", "events:scaled-price"];
|
|
@@ -18,6 +19,7 @@ export declare class TicketSelectionDetails {
|
|
|
18
19
|
selectedTime: string | undefined;
|
|
19
20
|
ticketSegments: SegmentDetails[];
|
|
20
21
|
preCarts: Cart[];
|
|
22
|
+
timeslotDetails: TimeslotDetails | undefined;
|
|
21
23
|
addTicketSegment(ticketGroup: SegmentDetails): void;
|
|
22
24
|
get isTimeslotsVisible(): boolean;
|
|
23
25
|
get isTicketsVisible(): boolean | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FieldInit } from '../components/forms/lib/Field.svelte.ts';
|
|
2
2
|
import { ShopUrls } from '../lib/helpers/urls.ts';
|
|
3
|
-
export declare const defaultConfig: Required<ConfigOptions>;
|
|
4
3
|
export type FormConfig = {
|
|
5
4
|
fields?: {
|
|
6
5
|
key: string;
|
|
@@ -15,3 +14,15 @@ export type ConfigOptions = {
|
|
|
15
14
|
forms?: Record<string, FormConfig>;
|
|
16
15
|
fields?: Record<string, FieldInit>;
|
|
17
16
|
};
|
|
17
|
+
declare class ConfigStoreSvelte {
|
|
18
|
+
private defaultConfig;
|
|
19
|
+
private override;
|
|
20
|
+
private options;
|
|
21
|
+
constructor();
|
|
22
|
+
private update;
|
|
23
|
+
get config(): {};
|
|
24
|
+
define(options: ConfigOptions): this;
|
|
25
|
+
default(options: ConfigOptions): this;
|
|
26
|
+
}
|
|
27
|
+
export declare const configStore: ConfigStoreSvelte;
|
|
28
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Command = {
|
|
2
|
+
method: 'load' | 'config' | 'init';
|
|
3
|
+
options: Record<string, unknown>;
|
|
4
|
+
};
|
|
5
|
+
export declare function initGo(window: {
|
|
6
|
+
go?: any;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
export declare const go: {
|
|
9
|
+
loaded: boolean;
|
|
10
|
+
config: (options: Record<string, unknown>) => void;
|
|
11
|
+
init: (options: {
|
|
12
|
+
shop: string;
|
|
13
|
+
api: string;
|
|
14
|
+
locale: string;
|
|
15
|
+
}) => Promise<void>;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -12313,7 +12313,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
12313
12313
|
return url;
|
|
12314
12314
|
}
|
|
12315
12315
|
function client(publicApiUrl, shopUrl) {
|
|
12316
|
-
return createClient({ baseUrl:
|
|
12316
|
+
return createClient({ baseUrl: publicApiUrl, headers: { "X-Shop-Url": shopUrl } });
|
|
12317
12317
|
}
|
|
12318
12318
|
const CALENDAR_ENDPOINT = "/api/v4/calendar";
|
|
12319
12319
|
const TICKETS_CALENDAR_ENDPOINT = "/api/v4/tickets/calendar";
|
|
@@ -12725,7 +12725,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
12725
12725
|
}
|
|
12726
12726
|
};
|
|
12727
12727
|
}
|
|
12728
|
-
|
|
12728
|
+
let defaultConfig = {
|
|
12729
12729
|
urls: {},
|
|
12730
12730
|
navigateTo: (url) => {
|
|
12731
12731
|
window.location.assign(url);
|
|
@@ -12733,18 +12733,39 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
12733
12733
|
forms: {},
|
|
12734
12734
|
fields: {}
|
|
12735
12735
|
};
|
|
12736
|
-
class
|
|
12737
|
-
|
|
12736
|
+
class ConfigStoreSvelte {
|
|
12737
|
+
defaultConfig = assign(defaultConfig, window.customOptions);
|
|
12738
|
+
override = this.defaultConfig;
|
|
12739
|
+
#options = /* @__PURE__ */ state(proxy({}));
|
|
12740
|
+
get options() {
|
|
12741
|
+
return get$2(this.#options);
|
|
12742
|
+
}
|
|
12743
|
+
set options(value) {
|
|
12744
|
+
set(this.#options, value, true);
|
|
12745
|
+
}
|
|
12746
|
+
constructor() {
|
|
12747
|
+
this.update();
|
|
12748
|
+
}
|
|
12749
|
+
update() {
|
|
12750
|
+
this.options = assign(this.defaultConfig, this.override);
|
|
12751
|
+
}
|
|
12738
12752
|
get config() {
|
|
12739
|
-
return
|
|
12753
|
+
return this.options;
|
|
12754
|
+
}
|
|
12755
|
+
define(options) {
|
|
12756
|
+
console.log("ConfigStore.define", options);
|
|
12757
|
+
this.override = assign(this.override, options);
|
|
12758
|
+
this.update();
|
|
12759
|
+
return this;
|
|
12740
12760
|
}
|
|
12741
|
-
|
|
12742
|
-
|
|
12761
|
+
default(options) {
|
|
12762
|
+
console.log("ConfigStore.default", options);
|
|
12763
|
+
this.defaultConfig = assign(this.defaultConfig, options);
|
|
12764
|
+
this.update();
|
|
12743
12765
|
return this;
|
|
12744
12766
|
}
|
|
12745
12767
|
}
|
|
12746
|
-
const
|
|
12747
|
-
window.go = go;
|
|
12768
|
+
const configStore = new ConfigStoreSvelte();
|
|
12748
12769
|
class PersonalizationDetails {
|
|
12749
12770
|
#token = /* @__PURE__ */ state();
|
|
12750
12771
|
get token() {
|
|
@@ -12771,8 +12792,8 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
|
|
|
12771
12792
|
if (this.ticketSaleId) return snapshot(this.order?.ticket_sales.find((ts) => ts.id == this.ticketSaleId));
|
|
12772
12793
|
}
|
|
12773
12794
|
goToPersonalization(ticketSale) {
|
|
12774
|
-
if (
|
|
12775
|
-
return
|
|
12795
|
+
if (configStore.config.urls.annualTicketPersonalizationForm) {
|
|
12796
|
+
return configStore.config.urls.annualTicketPersonalizationForm(this.token, ticketSale.id);
|
|
12776
12797
|
} else {
|
|
12777
12798
|
return shop.urls.annualTicketPersonalizationForm(this.token, ticketSale.id);
|
|
12778
12799
|
}
|
|
@@ -16080,20 +16101,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16080
16101
|
}
|
|
16081
16102
|
const _Forms = class _Forms {
|
|
16082
16103
|
static defineForm(options) {
|
|
16083
|
-
|
|
16104
|
+
configStore.default({
|
|
16084
16105
|
forms: {
|
|
16085
16106
|
[options.id]: { fields: options.fields, submitLabel: options.submitLabel }
|
|
16086
16107
|
}
|
|
16087
16108
|
});
|
|
16088
16109
|
}
|
|
16089
16110
|
static defineFields(fields) {
|
|
16090
|
-
|
|
16111
|
+
configStore.default({ fields });
|
|
16091
16112
|
}
|
|
16092
16113
|
static setRequiredApiKeys(formId, requiredApiKeys) {
|
|
16093
16114
|
__privateGet(_Forms, _requiredApiKeysMap)[formId] = requiredApiKeys;
|
|
16094
16115
|
}
|
|
16095
16116
|
static getFormOptions(formId) {
|
|
16096
|
-
return
|
|
16117
|
+
return configStore.config.forms[formId];
|
|
16097
16118
|
}
|
|
16098
16119
|
static createField(key, required) {
|
|
16099
16120
|
const init2 = _Forms.getFieldInit(key);
|
|
@@ -16106,7 +16127,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16106
16127
|
return formFields(formId);
|
|
16107
16128
|
}
|
|
16108
16129
|
static getFieldInit(key) {
|
|
16109
|
-
return
|
|
16130
|
+
return configStore.config.fields[key];
|
|
16110
16131
|
}
|
|
16111
16132
|
};
|
|
16112
16133
|
_requiredApiKeysMap = new WeakMap();
|
|
@@ -16114,7 +16135,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16114
16135
|
_Forms.defineFields(allFields);
|
|
16115
16136
|
let Forms = _Forms;
|
|
16116
16137
|
function formFields(formId) {
|
|
16117
|
-
const definition =
|
|
16138
|
+
const definition = configStore.config.forms[formId];
|
|
16118
16139
|
if (!definition) {
|
|
16119
16140
|
throw new Error(`(formFields) Form ${formId} not found`);
|
|
16120
16141
|
}
|
|
@@ -16189,12 +16210,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16189
16210
|
form.details.apiErrors = [result.error.error];
|
|
16190
16211
|
return;
|
|
16191
16212
|
}
|
|
16192
|
-
const beforeSubmit =
|
|
16213
|
+
const beforeSubmit = configStore.config.forms.personalization?.beforeSubmit;
|
|
16193
16214
|
if (beforeSubmit) {
|
|
16194
16215
|
beforeSubmit(body);
|
|
16195
16216
|
}
|
|
16196
|
-
if (
|
|
16197
|
-
|
|
16217
|
+
if (configStore.config.urls.annualTicketPersonalizationFormSubmit?.()) {
|
|
16218
|
+
configStore.config.navigateTo(configStore.config.urls.annualTicketPersonalizationFormSubmit());
|
|
16198
16219
|
}
|
|
16199
16220
|
}
|
|
16200
16221
|
let templateForm = null;
|
|
@@ -16945,12 +16966,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16945
16966
|
form.details.apiErrors = checkout.error;
|
|
16946
16967
|
return;
|
|
16947
16968
|
}
|
|
16948
|
-
const beforeSubmit =
|
|
16969
|
+
const beforeSubmit = configStore.config.forms.checkoutGuest?.beforeSubmit;
|
|
16949
16970
|
if (beforeSubmit) {
|
|
16950
16971
|
await beforeSubmit(form.details.formData);
|
|
16951
16972
|
}
|
|
16952
16973
|
const paymentUrl = checkout.data.meta.payment_url;
|
|
16953
|
-
|
|
16974
|
+
configStore.config.navigateTo?.(paymentUrl);
|
|
16954
16975
|
});
|
|
16955
16976
|
});
|
|
16956
16977
|
var $$exports = {
|
|
@@ -31352,6 +31373,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31352
31373
|
set preCarts(value) {
|
|
31353
31374
|
set(this.#preCarts, value);
|
|
31354
31375
|
}
|
|
31376
|
+
#timeslotDetails = /* @__PURE__ */ state();
|
|
31377
|
+
get timeslotDetails() {
|
|
31378
|
+
return get$2(this.#timeslotDetails);
|
|
31379
|
+
}
|
|
31380
|
+
set timeslotDetails(value) {
|
|
31381
|
+
set(this.#timeslotDetails, value, true);
|
|
31382
|
+
}
|
|
31355
31383
|
addTicketSegment(ticketGroup) {
|
|
31356
31384
|
this.ticketSegments.push(ticketGroup);
|
|
31357
31385
|
}
|
|
@@ -31565,7 +31593,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31565
31593
|
function Link($$anchor, $$props) {
|
|
31566
31594
|
push($$props, true);
|
|
31567
31595
|
const to = prop($$props, "to", 7);
|
|
31568
|
-
const href = /* @__PURE__ */ user_derived(() =>
|
|
31596
|
+
const href = /* @__PURE__ */ user_derived(() => configStore.config.urls[to()]);
|
|
31569
31597
|
const a2 = wrapInElement($$props.$$host, "a");
|
|
31570
31598
|
user_effect(() => {
|
|
31571
31599
|
if (!get$2(href)) {
|
|
@@ -31577,11 +31605,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31577
31605
|
});
|
|
31578
31606
|
a2.addEventListener("click", (e) => {
|
|
31579
31607
|
e.preventDefault();
|
|
31580
|
-
if (!
|
|
31608
|
+
if (!configStore.config.urls[to()]) {
|
|
31581
31609
|
console.warn(`[go-link] No URL found for route "${to()}". You can define it with go.config.urls.${to()} = () => 'https://example.com/my-route'`);
|
|
31582
31610
|
return;
|
|
31583
31611
|
}
|
|
31584
|
-
|
|
31612
|
+
configStore.config.navigateTo(configStore.config.urls[to()]());
|
|
31585
31613
|
});
|
|
31586
31614
|
var $$exports = {
|
|
31587
31615
|
get to() {
|
|
@@ -31620,8 +31648,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
31620
31648
|
return `${shop.apiUrl}/api/v4/orders/${this.order.id}/events/${item.attributes.id}.pdf?locale=${shop.locale}&token=${this.token}`;
|
|
31621
31649
|
case "Ticket":
|
|
31622
31650
|
if (item.attributes.ticket_type === "annual" && !item.attributes.is_voucher) {
|
|
31623
|
-
if (
|
|
31624
|
-
return
|
|
31651
|
+
if (configStore.config.urls.annualTicketPersonalizationList?.()) {
|
|
31652
|
+
return configStore.config.urls.annualTicketPersonalizationList(this.token);
|
|
31625
31653
|
} else {
|
|
31626
31654
|
return shop.urls?.annualTicketPersonalizationList(this.token);
|
|
31627
31655
|
}
|
|
@@ -32914,6 +32942,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
32914
32942
|
constructor(tsdWrapper) {
|
|
32915
32943
|
if (!tsdWrapper) return;
|
|
32916
32944
|
this.#tsd = /* @__PURE__ */ user_derived(() => tsdWrapper.value);
|
|
32945
|
+
if (this.tsd) this.tsd.timeslotDetails = this;
|
|
32946
|
+
}
|
|
32947
|
+
get boockedOutCount() {
|
|
32948
|
+
return this.timeslots.filter((t) => t.capacity == 0).length;
|
|
32917
32949
|
}
|
|
32918
32950
|
get timeslots() {
|
|
32919
32951
|
const tsd = this.tsd;
|
|
@@ -33421,8 +33453,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
33421
33453
|
});
|
|
33422
33454
|
shop.cart.addItems(newItems);
|
|
33423
33455
|
preCarts.forEach((pc) => pc.items.forEach((i) => i.quantity = 0));
|
|
33424
|
-
if (
|
|
33425
|
-
|
|
33456
|
+
if (configStore.config.urls.cart) {
|
|
33457
|
+
configStore.config.navigateTo(configStore.config.urls.cart());
|
|
33426
33458
|
}
|
|
33427
33459
|
}
|
|
33428
33460
|
anyTicketsSelected() {
|
|
@@ -33559,4 +33591,30 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
33559
33591
|
pop();
|
|
33560
33592
|
}
|
|
33561
33593
|
customElements.define("go-profile-overview", create_custom_element(Overview, {}, [], []));
|
|
33594
|
+
async function initGo(window2) {
|
|
33595
|
+
const stub = window2.go;
|
|
33596
|
+
let q = stub && stub._queue || [];
|
|
33597
|
+
console.log(q);
|
|
33598
|
+
for (const command of q) {
|
|
33599
|
+
try {
|
|
33600
|
+
await go[command.method](command.options);
|
|
33601
|
+
} catch (e) {
|
|
33602
|
+
console.error(e);
|
|
33603
|
+
}
|
|
33604
|
+
}
|
|
33605
|
+
window2.go = go;
|
|
33606
|
+
if (stub) stub._queue = null;
|
|
33607
|
+
}
|
|
33608
|
+
const go = {
|
|
33609
|
+
loaded: true,
|
|
33610
|
+
config: (options) => {
|
|
33611
|
+
configStore.define(options);
|
|
33612
|
+
},
|
|
33613
|
+
init: async (options) => {
|
|
33614
|
+
await shop.load("https://" + options.api, options.shop, options.locale);
|
|
33615
|
+
}
|
|
33616
|
+
};
|
|
33617
|
+
(async () => {
|
|
33618
|
+
await initGo(window);
|
|
33619
|
+
})();
|
|
33562
33620
|
})();
|
|
@@ -12313,7 +12313,7 @@ function removeTrailingSlash(url) {
|
|
|
12313
12313
|
return url;
|
|
12314
12314
|
}
|
|
12315
12315
|
function client(publicApiUrl, shopUrl) {
|
|
12316
|
-
return createClient({ baseUrl:
|
|
12316
|
+
return createClient({ baseUrl: publicApiUrl, headers: { "X-Shop-Url": shopUrl } });
|
|
12317
12317
|
}
|
|
12318
12318
|
const CALENDAR_ENDPOINT = "/api/v4/calendar";
|
|
12319
12319
|
const TICKETS_CALENDAR_ENDPOINT = "/api/v4/tickets/calendar";
|
|
@@ -12725,7 +12725,7 @@ function createGetDetails(KEY2) {
|
|
|
12725
12725
|
}
|
|
12726
12726
|
};
|
|
12727
12727
|
}
|
|
12728
|
-
|
|
12728
|
+
let defaultConfig = {
|
|
12729
12729
|
urls: {},
|
|
12730
12730
|
navigateTo: (url) => {
|
|
12731
12731
|
window.location.assign(url);
|
|
@@ -12733,18 +12733,39 @@ const defaultConfig = {
|
|
|
12733
12733
|
forms: {},
|
|
12734
12734
|
fields: {}
|
|
12735
12735
|
};
|
|
12736
|
-
class
|
|
12737
|
-
|
|
12736
|
+
class ConfigStoreSvelte {
|
|
12737
|
+
defaultConfig = assign(defaultConfig, window.customOptions);
|
|
12738
|
+
override = this.defaultConfig;
|
|
12739
|
+
#options = /* @__PURE__ */ state(proxy({}));
|
|
12740
|
+
get options() {
|
|
12741
|
+
return get$2(this.#options);
|
|
12742
|
+
}
|
|
12743
|
+
set options(value) {
|
|
12744
|
+
set(this.#options, value, true);
|
|
12745
|
+
}
|
|
12746
|
+
constructor() {
|
|
12747
|
+
this.update();
|
|
12748
|
+
}
|
|
12749
|
+
update() {
|
|
12750
|
+
this.options = assign(this.defaultConfig, this.override);
|
|
12751
|
+
}
|
|
12738
12752
|
get config() {
|
|
12739
|
-
return
|
|
12753
|
+
return this.options;
|
|
12754
|
+
}
|
|
12755
|
+
define(options) {
|
|
12756
|
+
console.log("ConfigStore.define", options);
|
|
12757
|
+
this.override = assign(this.override, options);
|
|
12758
|
+
this.update();
|
|
12759
|
+
return this;
|
|
12740
12760
|
}
|
|
12741
|
-
|
|
12742
|
-
|
|
12761
|
+
default(options) {
|
|
12762
|
+
console.log("ConfigStore.default", options);
|
|
12763
|
+
this.defaultConfig = assign(this.defaultConfig, options);
|
|
12764
|
+
this.update();
|
|
12743
12765
|
return this;
|
|
12744
12766
|
}
|
|
12745
12767
|
}
|
|
12746
|
-
const
|
|
12747
|
-
window.go = go;
|
|
12768
|
+
const configStore = new ConfigStoreSvelte();
|
|
12748
12769
|
class PersonalizationDetails {
|
|
12749
12770
|
#token = /* @__PURE__ */ state();
|
|
12750
12771
|
get token() {
|
|
@@ -12771,8 +12792,8 @@ class PersonalizationDetails {
|
|
|
12771
12792
|
if (this.ticketSaleId) return snapshot(this.order?.ticket_sales.find((ts) => ts.id == this.ticketSaleId));
|
|
12772
12793
|
}
|
|
12773
12794
|
goToPersonalization(ticketSale) {
|
|
12774
|
-
if (
|
|
12775
|
-
return
|
|
12795
|
+
if (configStore.config.urls.annualTicketPersonalizationForm) {
|
|
12796
|
+
return configStore.config.urls.annualTicketPersonalizationForm(this.token, ticketSale.id);
|
|
12776
12797
|
} else {
|
|
12777
12798
|
return shop.urls.annualTicketPersonalizationForm(this.token, ticketSale.id);
|
|
12778
12799
|
}
|
|
@@ -16080,20 +16101,20 @@ function validateField(field) {
|
|
|
16080
16101
|
}
|
|
16081
16102
|
const _Forms = class _Forms {
|
|
16082
16103
|
static defineForm(options) {
|
|
16083
|
-
|
|
16104
|
+
configStore.default({
|
|
16084
16105
|
forms: {
|
|
16085
16106
|
[options.id]: { fields: options.fields, submitLabel: options.submitLabel }
|
|
16086
16107
|
}
|
|
16087
16108
|
});
|
|
16088
16109
|
}
|
|
16089
16110
|
static defineFields(fields) {
|
|
16090
|
-
|
|
16111
|
+
configStore.default({ fields });
|
|
16091
16112
|
}
|
|
16092
16113
|
static setRequiredApiKeys(formId, requiredApiKeys) {
|
|
16093
16114
|
__privateGet(_Forms, _requiredApiKeysMap)[formId] = requiredApiKeys;
|
|
16094
16115
|
}
|
|
16095
16116
|
static getFormOptions(formId) {
|
|
16096
|
-
return
|
|
16117
|
+
return configStore.config.forms[formId];
|
|
16097
16118
|
}
|
|
16098
16119
|
static createField(key, required) {
|
|
16099
16120
|
const init2 = _Forms.getFieldInit(key);
|
|
@@ -16106,7 +16127,7 @@ const _Forms = class _Forms {
|
|
|
16106
16127
|
return formFields(formId);
|
|
16107
16128
|
}
|
|
16108
16129
|
static getFieldInit(key) {
|
|
16109
|
-
return
|
|
16130
|
+
return configStore.config.fields[key];
|
|
16110
16131
|
}
|
|
16111
16132
|
};
|
|
16112
16133
|
_requiredApiKeysMap = new WeakMap();
|
|
@@ -16114,7 +16135,7 @@ __privateAdd(_Forms, _requiredApiKeysMap, {});
|
|
|
16114
16135
|
_Forms.defineFields(allFields);
|
|
16115
16136
|
let Forms = _Forms;
|
|
16116
16137
|
function formFields(formId) {
|
|
16117
|
-
const definition =
|
|
16138
|
+
const definition = configStore.config.forms[formId];
|
|
16118
16139
|
if (!definition) {
|
|
16119
16140
|
throw new Error(`(formFields) Form ${formId} not found`);
|
|
16120
16141
|
}
|
|
@@ -16189,12 +16210,12 @@ function AnnualTicketPersonalizationForm($$anchor, $$props) {
|
|
|
16189
16210
|
form.details.apiErrors = [result.error.error];
|
|
16190
16211
|
return;
|
|
16191
16212
|
}
|
|
16192
|
-
const beforeSubmit =
|
|
16213
|
+
const beforeSubmit = configStore.config.forms.personalization?.beforeSubmit;
|
|
16193
16214
|
if (beforeSubmit) {
|
|
16194
16215
|
beforeSubmit(body);
|
|
16195
16216
|
}
|
|
16196
|
-
if (
|
|
16197
|
-
|
|
16217
|
+
if (configStore.config.urls.annualTicketPersonalizationFormSubmit?.()) {
|
|
16218
|
+
configStore.config.navigateTo(configStore.config.urls.annualTicketPersonalizationFormSubmit());
|
|
16198
16219
|
}
|
|
16199
16220
|
}
|
|
16200
16221
|
let templateForm = null;
|
|
@@ -16945,12 +16966,12 @@ function CheckoutForm($$anchor, $$props) {
|
|
|
16945
16966
|
form.details.apiErrors = checkout.error;
|
|
16946
16967
|
return;
|
|
16947
16968
|
}
|
|
16948
|
-
const beforeSubmit =
|
|
16969
|
+
const beforeSubmit = configStore.config.forms.checkoutGuest?.beforeSubmit;
|
|
16949
16970
|
if (beforeSubmit) {
|
|
16950
16971
|
await beforeSubmit(form.details.formData);
|
|
16951
16972
|
}
|
|
16952
16973
|
const paymentUrl = checkout.data.meta.payment_url;
|
|
16953
|
-
|
|
16974
|
+
configStore.config.navigateTo?.(paymentUrl);
|
|
16954
16975
|
});
|
|
16955
16976
|
});
|
|
16956
16977
|
var $$exports = {
|
|
@@ -31352,6 +31373,13 @@ class TicketSelectionDetails {
|
|
|
31352
31373
|
set preCarts(value) {
|
|
31353
31374
|
set(this.#preCarts, value);
|
|
31354
31375
|
}
|
|
31376
|
+
#timeslotDetails = /* @__PURE__ */ state();
|
|
31377
|
+
get timeslotDetails() {
|
|
31378
|
+
return get$2(this.#timeslotDetails);
|
|
31379
|
+
}
|
|
31380
|
+
set timeslotDetails(value) {
|
|
31381
|
+
set(this.#timeslotDetails, value, true);
|
|
31382
|
+
}
|
|
31355
31383
|
addTicketSegment(ticketGroup) {
|
|
31356
31384
|
this.ticketSegments.push(ticketGroup);
|
|
31357
31385
|
}
|
|
@@ -31565,7 +31593,7 @@ customElements.define("go-init", create_custom_element(
|
|
|
31565
31593
|
function Link($$anchor, $$props) {
|
|
31566
31594
|
push($$props, true);
|
|
31567
31595
|
const to = prop($$props, "to", 7);
|
|
31568
|
-
const href = /* @__PURE__ */ user_derived(() =>
|
|
31596
|
+
const href = /* @__PURE__ */ user_derived(() => configStore.config.urls[to()]);
|
|
31569
31597
|
const a2 = wrapInElement($$props.$$host, "a");
|
|
31570
31598
|
user_effect(() => {
|
|
31571
31599
|
if (!get$2(href)) {
|
|
@@ -31577,11 +31605,11 @@ function Link($$anchor, $$props) {
|
|
|
31577
31605
|
});
|
|
31578
31606
|
a2.addEventListener("click", (e) => {
|
|
31579
31607
|
e.preventDefault();
|
|
31580
|
-
if (!
|
|
31608
|
+
if (!configStore.config.urls[to()]) {
|
|
31581
31609
|
console.warn(`[go-link] No URL found for route "${to()}". You can define it with go.config.urls.${to()} = () => 'https://example.com/my-route'`);
|
|
31582
31610
|
return;
|
|
31583
31611
|
}
|
|
31584
|
-
|
|
31612
|
+
configStore.config.navigateTo(configStore.config.urls[to()]());
|
|
31585
31613
|
});
|
|
31586
31614
|
var $$exports = {
|
|
31587
31615
|
get to() {
|
|
@@ -31620,8 +31648,8 @@ class OrderDetails {
|
|
|
31620
31648
|
return `${shop.apiUrl}/api/v4/orders/${this.order.id}/events/${item.attributes.id}.pdf?locale=${shop.locale}&token=${this.token}`;
|
|
31621
31649
|
case "Ticket":
|
|
31622
31650
|
if (item.attributes.ticket_type === "annual" && !item.attributes.is_voucher) {
|
|
31623
|
-
if (
|
|
31624
|
-
return
|
|
31651
|
+
if (configStore.config.urls.annualTicketPersonalizationList?.()) {
|
|
31652
|
+
return configStore.config.urls.annualTicketPersonalizationList(this.token);
|
|
31625
31653
|
} else {
|
|
31626
31654
|
return shop.urls?.annualTicketPersonalizationList(this.token);
|
|
31627
31655
|
}
|
|
@@ -32914,6 +32942,10 @@ let Details$2 = class Details {
|
|
|
32914
32942
|
constructor(tsdWrapper) {
|
|
32915
32943
|
if (!tsdWrapper) return;
|
|
32916
32944
|
this.#tsd = /* @__PURE__ */ user_derived(() => tsdWrapper.value);
|
|
32945
|
+
if (this.tsd) this.tsd.timeslotDetails = this;
|
|
32946
|
+
}
|
|
32947
|
+
get boockedOutCount() {
|
|
32948
|
+
return this.timeslots.filter((t) => t.capacity == 0).length;
|
|
32917
32949
|
}
|
|
32918
32950
|
get timeslots() {
|
|
32919
32951
|
const tsd = this.tsd;
|
|
@@ -33421,8 +33453,8 @@ let Details$1 = class Details2 {
|
|
|
33421
33453
|
});
|
|
33422
33454
|
shop.cart.addItems(newItems);
|
|
33423
33455
|
preCarts.forEach((pc) => pc.items.forEach((i) => i.quantity = 0));
|
|
33424
|
-
if (
|
|
33425
|
-
|
|
33456
|
+
if (configStore.config.urls.cart) {
|
|
33457
|
+
configStore.config.navigateTo(configStore.config.urls.cart());
|
|
33426
33458
|
}
|
|
33427
33459
|
}
|
|
33428
33460
|
anyTicketsSelected() {
|
|
@@ -33559,3 +33591,29 @@ function Overview($$anchor, $$props) {
|
|
|
33559
33591
|
pop();
|
|
33560
33592
|
}
|
|
33561
33593
|
customElements.define("go-profile-overview", create_custom_element(Overview, {}, [], []));
|
|
33594
|
+
async function initGo(window2) {
|
|
33595
|
+
const stub = window2.go;
|
|
33596
|
+
let q = stub && stub._queue || [];
|
|
33597
|
+
console.log(q);
|
|
33598
|
+
for (const command of q) {
|
|
33599
|
+
try {
|
|
33600
|
+
await go[command.method](command.options);
|
|
33601
|
+
} catch (e) {
|
|
33602
|
+
console.error(e);
|
|
33603
|
+
}
|
|
33604
|
+
}
|
|
33605
|
+
window2.go = go;
|
|
33606
|
+
if (stub) stub._queue = null;
|
|
33607
|
+
}
|
|
33608
|
+
const go = {
|
|
33609
|
+
loaded: true,
|
|
33610
|
+
config: (options) => {
|
|
33611
|
+
configStore.define(options);
|
|
33612
|
+
},
|
|
33613
|
+
init: async (options) => {
|
|
33614
|
+
await shop.load("https://" + options.api, options.shop, options.locale);
|
|
33615
|
+
}
|
|
33616
|
+
};
|
|
33617
|
+
(async () => {
|
|
33618
|
+
await initGo(window);
|
|
33619
|
+
})();
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "Giantmonkey GmbH"
|
|
5
5
|
},
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.41.0",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "./dist-js/gomus-webcomponents.iife.js",
|
|
10
10
|
"module": "./dist-js/gomus-webcomponents.iife.js",
|
|
@@ -26,9 +26,13 @@
|
|
|
26
26
|
"build:standard-components": "pnpm vite -c vite.standard-components.config.ts build; cp dist-js/standard-components.js ../../../gomus-shop/src/assets/javascript",
|
|
27
27
|
"open-test": "vite build && vite --open src/test.html",
|
|
28
28
|
"=== E 2 E ===": "",
|
|
29
|
-
"e2e": "npx playwright test",
|
|
30
|
-
"e2e:
|
|
31
|
-
"e2e:
|
|
29
|
+
"e2e:static": "vite build && npx playwright test --config=playwright-static.config.ts",
|
|
30
|
+
"e2e:static:no-build": "npx playwright test --config=playwright-static.config.ts",
|
|
31
|
+
"e2e:static:ui": "npx playwright test --config=playwright-static.config.ts --ui",
|
|
32
|
+
"----------------": "-",
|
|
33
|
+
"e2e:storybook": "npx playwright test --config=playwright-storybook.config.ts",
|
|
34
|
+
"e2e:storybook:ui": "npx playwright test --ui --config=playwright-storybook.config.ts",
|
|
35
|
+
"e2e:storybook:headed": "npx playwright test --headed --config=playwright-storybook.config.ts",
|
|
32
36
|
"=== S T O R Y B O O K ===": "",
|
|
33
37
|
"chromatic": "npx chromatic --project-token=chpt_36bb239517e3c45 --allow-console-errors",
|
|
34
38
|
"storybook": "storybook dev",
|
|
File without changes
|
|
File without changes
|