@gomusdev/web-components 0.0.8 → 0.0.9
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/README.md +6 -0
- package/dist-js/gomus-webcomponents.iife.js +1251 -234
- package/package.json +14 -13
|
@@ -11,7 +11,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
12
|
(function() {
|
|
13
13
|
"use strict";
|
|
14
|
-
var _a, _previous, _callbacks, _pending, _deferred, _neutered, _async_effects, _boundary_async_effects, _render_effects, _effects, _block_effects, _dirty_effects, _maybe_dirty_effects, _Batch_instances, traverse_effect_tree_fn, defer_effects_fn, commit_fn, _events, _instance, _data, _fetchStatus, _Shop_instances, defaultApiParams_get, _canFetch, _ensureFetch, _mode, _filters, _eventId, _museumIds, _exhibitionIds, _ticketIds, _selectedDate, _selectedTimeslot, _selectedTickets, _ticketList, _document, _subscribe, _name, _key, _root, _variant, _prefix, _visibleMonths, _months, _weekdays, _initialPlaceholderYear, _defaultYears, _CalendarRootState_instances, setupInitialFocusEffect_fn, setupAccessibleHeadingEffect_fn, setupFormatterEffect_fn, _isNextButtonDisabled, _isPrevButtonDisabled, _isInvalid, _headingValue, _fullCalendarLabel, isMultipleSelectionValid_fn, _snippetProps, _props, _props2, _cellDate, _isUnavailable, _isDateToday, _isOutsideMonth, _isOutsideVisibleMonths, _isDisabled, _isFocusedDate, _isSelectedDate, _labelText, _snippetProps2, _ariaDisabled, _sharedDataAttrs, _props3, _tabindex, _snippetProps3, _props4, _isDisabled2, _props5, _isDisabled3, _props6, _props7, _props8, _props9, _props10, _props11, _props12, _startAt, _selected,
|
|
14
|
+
var _a, _previous, _callbacks, _pending, _deferred, _neutered, _async_effects, _boundary_async_effects, _render_effects, _effects, _block_effects, _dirty_effects, _maybe_dirty_effects, _Batch_instances, traverse_effect_tree_fn, defer_effects_fn, commit_fn, _events, _instance, _data, _fetchStatus, _Shop_instances, defaultApiParams_get, _canFetch, _ensureFetch, _items, _total, _b, _mode, _filters, _eventId, _museumIds, _exhibitionIds, _ticketIds, _selectedDate, _selectedTimeslot, _selectedTickets, _ticketList, _total2, _document, _subscribe, _name, _key, _root, _variant, _prefix, _visibleMonths, _months, _weekdays, _initialPlaceholderYear, _defaultYears, _CalendarRootState_instances, setupInitialFocusEffect_fn, setupAccessibleHeadingEffect_fn, setupFormatterEffect_fn, _isNextButtonDisabled, _isPrevButtonDisabled, _isInvalid, _headingValue, _fullCalendarLabel, isMultipleSelectionValid_fn, _snippetProps, _props, _props2, _cellDate, _isUnavailable, _isDateToday, _isOutsideMonth, _isOutsideVisibleMonths, _isDisabled, _isFocusedDate, _isSelectedDate, _labelText, _snippetProps2, _ariaDisabled, _sharedDataAttrs, _props3, _tabindex, _snippetProps3, _props4, _isDisabled2, _props5, _isDisabled3, _props6, _props7, _props8, _props9, _props10, _props11, _props12, _startAt, _selected, _c, _details, _params, _ticketSelectionDetails, _d, _ticketSelectionDetails2, _e, _ticketSelectionDetails3;
|
|
15
15
|
const PUBLIC_VERSION = "5";
|
|
16
16
|
if (typeof window !== "undefined") {
|
|
17
17
|
((_a = window.__svelte ?? (window.__svelte = {})).v ?? (_a.v = /* @__PURE__ */ new Set())).add(PUBLIC_VERSION);
|
|
@@ -22,6 +22,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
22
22
|
const EACH_IS_ANIMATED = 1 << 3;
|
|
23
23
|
const EACH_ITEM_IMMUTABLE = 1 << 4;
|
|
24
24
|
const PROPS_IS_IMMUTABLE = 1;
|
|
25
|
+
const PROPS_IS_RUNES = 1 << 1;
|
|
25
26
|
const PROPS_IS_UPDATED = 1 << 2;
|
|
26
27
|
const PROPS_IS_BINDABLE = 1 << 3;
|
|
27
28
|
const PROPS_IS_LAZY_INITIAL = 1 << 4;
|
|
@@ -51,6 +52,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
51
52
|
}
|
|
52
53
|
const noop$1 = () => {
|
|
53
54
|
};
|
|
55
|
+
function run(fn) {
|
|
56
|
+
return fn();
|
|
57
|
+
}
|
|
54
58
|
function run_all(arr) {
|
|
55
59
|
for (var i = 0; i < arr.length; i++) {
|
|
56
60
|
arr[i]();
|
|
@@ -250,7 +254,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
250
254
|
function safe_equals(value) {
|
|
251
255
|
return !safe_not_equal(value, this.v);
|
|
252
256
|
}
|
|
257
|
+
let legacy_mode_flag = false;
|
|
253
258
|
let tracing_mode_flag = false;
|
|
259
|
+
function enable_legacy_mode_flag() {
|
|
260
|
+
legacy_mode_flag = true;
|
|
261
|
+
}
|
|
254
262
|
const empty = [];
|
|
255
263
|
function snapshot(value, skip_warning = false) {
|
|
256
264
|
return clone(value, /* @__PURE__ */ new Map(), "", empty);
|
|
@@ -360,7 +368,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
360
368
|
e: null,
|
|
361
369
|
s: props,
|
|
362
370
|
x: null,
|
|
363
|
-
l: null
|
|
371
|
+
l: legacy_mode_flag && !runes ? { s: null, u: null, $: [] } : null
|
|
364
372
|
};
|
|
365
373
|
}
|
|
366
374
|
function pop(component2) {
|
|
@@ -383,7 +391,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
383
391
|
{};
|
|
384
392
|
}
|
|
385
393
|
function is_runes() {
|
|
386
|
-
return
|
|
394
|
+
return !legacy_mode_flag || component_context !== null && component_context.l === null;
|
|
387
395
|
}
|
|
388
396
|
function get_or_init_context_map(name) {
|
|
389
397
|
if (component_context === null) {
|
|
@@ -703,7 +711,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
703
711
|
}
|
|
704
712
|
}
|
|
705
713
|
function flatten(sync, async, fn) {
|
|
706
|
-
const d = derived;
|
|
714
|
+
const d = is_runes() ? derived : derived_safe_equal;
|
|
707
715
|
if (async.length === 0) {
|
|
708
716
|
fn(sync.map(d));
|
|
709
717
|
return;
|
|
@@ -1199,10 +1207,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1199
1207
|
}
|
|
1200
1208
|
// @__NO_SIDE_EFFECTS__
|
|
1201
1209
|
function mutable_source(initial_value, immutable = false, trackable = true) {
|
|
1210
|
+
var _a2;
|
|
1202
1211
|
const s = source(initial_value);
|
|
1203
1212
|
if (!immutable) {
|
|
1204
1213
|
s.equals = safe_equals;
|
|
1205
1214
|
}
|
|
1215
|
+
if (legacy_mode_flag && trackable && component_context !== null && component_context.l !== null) {
|
|
1216
|
+
((_a2 = component_context.l).s ?? (_a2.s = [])).push(s);
|
|
1217
|
+
}
|
|
1206
1218
|
return s;
|
|
1207
1219
|
}
|
|
1208
1220
|
function set(source2, value, should_proxy = false) {
|
|
@@ -1236,7 +1248,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1236
1248
|
}
|
|
1237
1249
|
source2.wv = increment_write_version();
|
|
1238
1250
|
mark_reactions(source2, DIRTY$1);
|
|
1239
|
-
if (active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
|
|
1251
|
+
if (is_runes() && active_effect !== null && (active_effect.f & CLEAN) !== 0 && (active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT)) === 0) {
|
|
1240
1252
|
if (untracked_writes === null) {
|
|
1241
1253
|
set_untracked_writes([source2]);
|
|
1242
1254
|
} else {
|
|
@@ -1252,10 +1264,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1252
1264
|
function mark_reactions(signal, status) {
|
|
1253
1265
|
var reactions = signal.reactions;
|
|
1254
1266
|
if (reactions === null) return;
|
|
1267
|
+
var runes = is_runes();
|
|
1255
1268
|
var length = reactions.length;
|
|
1256
1269
|
for (var i = 0; i < length; i++) {
|
|
1257
1270
|
var reaction = reactions[i];
|
|
1258
1271
|
var flags = reaction.f;
|
|
1272
|
+
if (!runes && reaction === active_effect) continue;
|
|
1259
1273
|
var not_dirty = (flags & DIRTY$1) === 0;
|
|
1260
1274
|
if (not_dirty) {
|
|
1261
1275
|
set_signal_status(reaction, status);
|
|
@@ -2338,6 +2352,49 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2338
2352
|
function set_signal_status(signal, status) {
|
|
2339
2353
|
signal.f = signal.f & STATUS_MASK | status;
|
|
2340
2354
|
}
|
|
2355
|
+
function deep_read_state(value) {
|
|
2356
|
+
if (typeof value !== "object" || !value || value instanceof EventTarget) {
|
|
2357
|
+
return;
|
|
2358
|
+
}
|
|
2359
|
+
if (STATE_SYMBOL in value) {
|
|
2360
|
+
deep_read(value);
|
|
2361
|
+
} else if (!Array.isArray(value)) {
|
|
2362
|
+
for (let key in value) {
|
|
2363
|
+
const prop2 = value[key];
|
|
2364
|
+
if (typeof prop2 === "object" && prop2 && STATE_SYMBOL in prop2) {
|
|
2365
|
+
deep_read(prop2);
|
|
2366
|
+
}
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
function deep_read(value, visited = /* @__PURE__ */ new Set()) {
|
|
2371
|
+
if (typeof value === "object" && value !== null && // We don't want to traverse DOM elements
|
|
2372
|
+
!(value instanceof EventTarget) && !visited.has(value)) {
|
|
2373
|
+
visited.add(value);
|
|
2374
|
+
if (value instanceof Date) {
|
|
2375
|
+
value.getTime();
|
|
2376
|
+
}
|
|
2377
|
+
for (let key in value) {
|
|
2378
|
+
try {
|
|
2379
|
+
deep_read(value[key], visited);
|
|
2380
|
+
} catch (e) {
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
const proto = get_prototype_of(value);
|
|
2384
|
+
if (proto !== Object.prototype && proto !== Array.prototype && proto !== Map.prototype && proto !== Set.prototype && proto !== Date.prototype) {
|
|
2385
|
+
const descriptors = get_descriptors(proto);
|
|
2386
|
+
for (let key in descriptors) {
|
|
2387
|
+
const get2 = descriptors[key].get;
|
|
2388
|
+
if (get2) {
|
|
2389
|
+
try {
|
|
2390
|
+
get2.call(value);
|
|
2391
|
+
} catch (e) {
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2341
2398
|
const all_registered_events = /* @__PURE__ */ new Set();
|
|
2342
2399
|
const root_event_handles = /* @__PURE__ */ new Set();
|
|
2343
2400
|
function create_event(event_name, dom, handler, options = {}) {
|
|
@@ -2793,7 +2850,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2793
2850
|
if (component_context === null) {
|
|
2794
2851
|
lifecycle_outside_component();
|
|
2795
2852
|
}
|
|
2796
|
-
{
|
|
2853
|
+
if (legacy_mode_flag && component_context.l !== null) {
|
|
2854
|
+
init_update_callbacks(component_context).m.push(fn);
|
|
2855
|
+
} else {
|
|
2797
2856
|
user_effect(() => {
|
|
2798
2857
|
const cleanup = untrack(fn);
|
|
2799
2858
|
if (typeof cleanup === "function") return (
|
|
@@ -2803,6 +2862,13 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2803
2862
|
});
|
|
2804
2863
|
}
|
|
2805
2864
|
}
|
|
2865
|
+
function init_update_callbacks(context) {
|
|
2866
|
+
var l = (
|
|
2867
|
+
/** @type {ComponentContextLegacy} */
|
|
2868
|
+
context.l
|
|
2869
|
+
);
|
|
2870
|
+
return l.u ?? (l.u = { a: [], b: [], m: [] });
|
|
2871
|
+
}
|
|
2806
2872
|
function createAttachmentKey() {
|
|
2807
2873
|
return Symbol(ATTACHMENT_KEY);
|
|
2808
2874
|
}
|
|
@@ -3091,7 +3157,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3091
3157
|
}
|
|
3092
3158
|
}
|
|
3093
3159
|
function reconcile(each_effect, array, state2, offscreen_items, anchor, render_fn, flags, get_key, get_collection) {
|
|
3094
|
-
var _a2, _b2, _c2,
|
|
3160
|
+
var _a2, _b2, _c2, _d2;
|
|
3095
3161
|
var is_animated = (flags & EACH_IS_ANIMATED) !== 0;
|
|
3096
3162
|
var should_update = (flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)) !== 0;
|
|
3097
3163
|
var length = array.length;
|
|
@@ -3232,7 +3298,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3232
3298
|
(_c2 = to_destroy[i].a) == null ? void 0 : _c2.measure();
|
|
3233
3299
|
}
|
|
3234
3300
|
for (i = 0; i < destroy_length; i += 1) {
|
|
3235
|
-
(
|
|
3301
|
+
(_d2 = to_destroy[i].a) == null ? void 0 : _d2.fix();
|
|
3236
3302
|
}
|
|
3237
3303
|
}
|
|
3238
3304
|
pause_effects(state2, to_destroy, controlled_anchor);
|
|
@@ -3750,6 +3816,16 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3750
3816
|
queue_idle_task(remove_defaults);
|
|
3751
3817
|
add_form_reset_listener();
|
|
3752
3818
|
}
|
|
3819
|
+
function set_value(element, value) {
|
|
3820
|
+
var attributes = get_attributes(element);
|
|
3821
|
+
if (attributes.value === (attributes.value = // treat null and undefined the same for the initial value
|
|
3822
|
+
value ?? void 0) || // @ts-expect-error
|
|
3823
|
+
// `progress` elements always need their value set when it's `0`
|
|
3824
|
+
element.value === value && (value !== 0 || element.nodeName !== "PROGRESS")) {
|
|
3825
|
+
return;
|
|
3826
|
+
}
|
|
3827
|
+
element.value = value ?? "";
|
|
3828
|
+
}
|
|
3753
3829
|
function set_selected(element, selected) {
|
|
3754
3830
|
if (selected) {
|
|
3755
3831
|
if (!element.hasAttribute("selected")) {
|
|
@@ -4094,6 +4170,63 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4094
4170
|
});
|
|
4095
4171
|
return element_or_component;
|
|
4096
4172
|
}
|
|
4173
|
+
function init(immutable = false) {
|
|
4174
|
+
const context = (
|
|
4175
|
+
/** @type {ComponentContextLegacy} */
|
|
4176
|
+
component_context
|
|
4177
|
+
);
|
|
4178
|
+
const callbacks = context.l.u;
|
|
4179
|
+
if (!callbacks) return;
|
|
4180
|
+
let props = () => deep_read_state(context.s);
|
|
4181
|
+
if (immutable) {
|
|
4182
|
+
let version = 0;
|
|
4183
|
+
let prev = (
|
|
4184
|
+
/** @type {Record<string, any>} */
|
|
4185
|
+
{}
|
|
4186
|
+
);
|
|
4187
|
+
const d = /* @__PURE__ */ derived(() => {
|
|
4188
|
+
let changed = false;
|
|
4189
|
+
const props2 = context.s;
|
|
4190
|
+
for (const key in props2) {
|
|
4191
|
+
if (props2[key] !== prev[key]) {
|
|
4192
|
+
prev[key] = props2[key];
|
|
4193
|
+
changed = true;
|
|
4194
|
+
}
|
|
4195
|
+
}
|
|
4196
|
+
if (changed) version++;
|
|
4197
|
+
return version;
|
|
4198
|
+
});
|
|
4199
|
+
props = () => get(d);
|
|
4200
|
+
}
|
|
4201
|
+
if (callbacks.b.length) {
|
|
4202
|
+
user_pre_effect(() => {
|
|
4203
|
+
observe_all(context, props);
|
|
4204
|
+
run_all(callbacks.b);
|
|
4205
|
+
});
|
|
4206
|
+
}
|
|
4207
|
+
user_effect(() => {
|
|
4208
|
+
const fns = untrack(() => callbacks.m.map(run));
|
|
4209
|
+
return () => {
|
|
4210
|
+
for (const fn of fns) {
|
|
4211
|
+
if (typeof fn === "function") {
|
|
4212
|
+
fn();
|
|
4213
|
+
}
|
|
4214
|
+
}
|
|
4215
|
+
};
|
|
4216
|
+
});
|
|
4217
|
+
if (callbacks.a.length) {
|
|
4218
|
+
user_effect(() => {
|
|
4219
|
+
observe_all(context, props);
|
|
4220
|
+
run_all(callbacks.a);
|
|
4221
|
+
});
|
|
4222
|
+
}
|
|
4223
|
+
}
|
|
4224
|
+
function observe_all(context, props) {
|
|
4225
|
+
if (context.l.s) {
|
|
4226
|
+
for (const signal of context.l.s) get(signal);
|
|
4227
|
+
}
|
|
4228
|
+
props();
|
|
4229
|
+
}
|
|
4097
4230
|
let is_store_binding = false;
|
|
4098
4231
|
function capture_store_binding(fn) {
|
|
4099
4232
|
var previous_is_store_binding = is_store_binding;
|
|
@@ -4201,6 +4334,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4201
4334
|
}
|
|
4202
4335
|
function prop(props, key, flags, fallback) {
|
|
4203
4336
|
var _a2;
|
|
4337
|
+
var runes = !legacy_mode_flag || (flags & PROPS_IS_RUNES) !== 0;
|
|
4204
4338
|
var bindable = (flags & PROPS_IS_BINDABLE) !== 0;
|
|
4205
4339
|
var lazy = (flags & PROPS_IS_LAZY_INITIAL) !== 0;
|
|
4206
4340
|
var fallback_value = (
|
|
@@ -4240,12 +4374,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4240
4374
|
if (initial_value === void 0 && fallback !== void 0) {
|
|
4241
4375
|
initial_value = get_fallback();
|
|
4242
4376
|
if (setter) {
|
|
4243
|
-
props_invalid_value();
|
|
4377
|
+
if (runes) props_invalid_value();
|
|
4244
4378
|
setter(initial_value);
|
|
4245
4379
|
}
|
|
4246
4380
|
}
|
|
4247
4381
|
var getter;
|
|
4248
|
-
{
|
|
4382
|
+
if (runes) {
|
|
4249
4383
|
getter = () => {
|
|
4250
4384
|
var value = (
|
|
4251
4385
|
/** @type {V} */
|
|
@@ -4255,8 +4389,20 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4255
4389
|
fallback_dirty = true;
|
|
4256
4390
|
return value;
|
|
4257
4391
|
};
|
|
4392
|
+
} else {
|
|
4393
|
+
getter = () => {
|
|
4394
|
+
var value = (
|
|
4395
|
+
/** @type {V} */
|
|
4396
|
+
props[key]
|
|
4397
|
+
);
|
|
4398
|
+
if (value !== void 0) {
|
|
4399
|
+
fallback_value = /** @type {V} */
|
|
4400
|
+
void 0;
|
|
4401
|
+
}
|
|
4402
|
+
return value === void 0 ? fallback_value : value;
|
|
4403
|
+
};
|
|
4258
4404
|
}
|
|
4259
|
-
if ((flags & PROPS_IS_UPDATED) === 0) {
|
|
4405
|
+
if (runes && (flags & PROPS_IS_UPDATED) === 0) {
|
|
4260
4406
|
return getter;
|
|
4261
4407
|
}
|
|
4262
4408
|
if (setter) {
|
|
@@ -4265,7 +4411,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4265
4411
|
/** @type {() => V} */
|
|
4266
4412
|
function(value, mutation) {
|
|
4267
4413
|
if (arguments.length > 0) {
|
|
4268
|
-
if (!mutation || legacy_parent || is_store_sub) {
|
|
4414
|
+
if (!runes || !mutation || legacy_parent || is_store_sub) {
|
|
4269
4415
|
setter(mutation ? getter() : value);
|
|
4270
4416
|
}
|
|
4271
4417
|
return value;
|
|
@@ -4288,7 +4434,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4288
4434
|
/** @type {() => V} */
|
|
4289
4435
|
function(value, mutation) {
|
|
4290
4436
|
if (arguments.length > 0) {
|
|
4291
|
-
const new_value = mutation ? get(d) : bindable ? proxy(value) : value;
|
|
4437
|
+
const new_value = mutation ? get(d) : runes && bindable ? proxy(value) : value;
|
|
4292
4438
|
set(d, new_value);
|
|
4293
4439
|
overridden = true;
|
|
4294
4440
|
if (fallback_value !== void 0) {
|
|
@@ -4789,10 +4935,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4789
4935
|
function wait(ms) {
|
|
4790
4936
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
4791
4937
|
}
|
|
4792
|
-
const defaultErrorConfig = {
|
|
4938
|
+
const defaultErrorConfig$1 = {
|
|
4793
4939
|
withStackTrace: false
|
|
4794
4940
|
};
|
|
4795
|
-
const createNeverThrowError = (message, result, config = defaultErrorConfig) => {
|
|
4941
|
+
const createNeverThrowError$1 = (message, result, config = defaultErrorConfig$1) => {
|
|
4796
4942
|
const data = result.isOk() ? { type: "Ok", value: result.value } : { type: "Err", value: result.error };
|
|
4797
4943
|
const maybeStack = config.withStackTrace ? new Error().stack : void 0;
|
|
4798
4944
|
return {
|
|
@@ -4801,7 +4947,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4801
4947
|
stack: maybeStack
|
|
4802
4948
|
};
|
|
4803
4949
|
};
|
|
4804
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
4950
|
+
function __awaiter$1(thisArg, _arguments, P, generator) {
|
|
4805
4951
|
function adopt(value) {
|
|
4806
4952
|
return value instanceof P ? value : new P(function(resolve) {
|
|
4807
4953
|
resolve(value);
|
|
@@ -4828,7 +4974,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4828
4974
|
step((generator = generator.apply(thisArg, [])).next());
|
|
4829
4975
|
});
|
|
4830
4976
|
}
|
|
4831
|
-
function __values(o) {
|
|
4977
|
+
function __values$1(o) {
|
|
4832
4978
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4833
4979
|
if (m) return m.call(o);
|
|
4834
4980
|
if (o && typeof o.length === "number") return {
|
|
@@ -4839,10 +4985,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4839
4985
|
};
|
|
4840
4986
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
4841
4987
|
}
|
|
4842
|
-
function __await(v) {
|
|
4843
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
4988
|
+
function __await$1(v) {
|
|
4989
|
+
return this instanceof __await$1 ? (this.v = v, this) : new __await$1(v);
|
|
4844
4990
|
}
|
|
4845
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
4991
|
+
function __asyncGenerator$1(thisArg, _arguments, generator) {
|
|
4846
4992
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
4847
4993
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
4848
4994
|
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
@@ -4863,7 +5009,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4863
5009
|
}
|
|
4864
5010
|
}
|
|
4865
5011
|
function step(r2) {
|
|
4866
|
-
r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
|
|
5012
|
+
r2.value instanceof __await$1 ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
|
|
4867
5013
|
}
|
|
4868
5014
|
function fulfill(value) {
|
|
4869
5015
|
resume("next", value);
|
|
@@ -4875,7 +5021,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4875
5021
|
if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
|
|
4876
5022
|
}
|
|
4877
5023
|
}
|
|
4878
|
-
function __asyncDelegator(o) {
|
|
5024
|
+
function __asyncDelegator$1(o) {
|
|
4879
5025
|
var i, p;
|
|
4880
5026
|
return i = {}, verb("next"), verb("throw", function(e) {
|
|
4881
5027
|
throw e;
|
|
@@ -4884,14 +5030,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4884
5030
|
}, i;
|
|
4885
5031
|
function verb(n, f) {
|
|
4886
5032
|
i[n] = o[n] ? function(v) {
|
|
4887
|
-
return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v;
|
|
5033
|
+
return (p = !p) ? { value: __await$1(o[n](v)), done: n === "return" } : f ? f(v) : v;
|
|
4888
5034
|
} : f;
|
|
4889
5035
|
}
|
|
4890
5036
|
}
|
|
4891
|
-
function __asyncValues(o) {
|
|
5037
|
+
function __asyncValues$1(o) {
|
|
4892
5038
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
4893
5039
|
var m = o[Symbol.asyncIterator], i;
|
|
4894
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
5040
|
+
return m ? m.call(o) : (o = typeof __values$1 === "function" ? __values$1(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
4895
5041
|
return this;
|
|
4896
5042
|
}, i);
|
|
4897
5043
|
function verb(n) {
|
|
@@ -4907,93 +5053,93 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
4907
5053
|
}, reject);
|
|
4908
5054
|
}
|
|
4909
5055
|
}
|
|
4910
|
-
|
|
5056
|
+
let ResultAsync$1 = class ResultAsync2 {
|
|
4911
5057
|
constructor(res) {
|
|
4912
5058
|
this._promise = res;
|
|
4913
5059
|
}
|
|
4914
5060
|
static fromSafePromise(promise) {
|
|
4915
|
-
const newPromise = promise.then((value) => new Ok(value));
|
|
4916
|
-
return new
|
|
5061
|
+
const newPromise = promise.then((value) => new Ok$1(value));
|
|
5062
|
+
return new ResultAsync2(newPromise);
|
|
4917
5063
|
}
|
|
4918
5064
|
static fromPromise(promise, errorFn) {
|
|
4919
|
-
const newPromise = promise.then((value) => new Ok(value)).catch((e) => new Err(errorFn(e)));
|
|
4920
|
-
return new
|
|
5065
|
+
const newPromise = promise.then((value) => new Ok$1(value)).catch((e) => new Err$1(errorFn(e)));
|
|
5066
|
+
return new ResultAsync2(newPromise);
|
|
4921
5067
|
}
|
|
4922
5068
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4923
5069
|
static fromThrowable(fn, errorFn) {
|
|
4924
5070
|
return (...args) => {
|
|
4925
|
-
return new
|
|
5071
|
+
return new ResultAsync2((() => __awaiter$1(this, void 0, void 0, function* () {
|
|
4926
5072
|
try {
|
|
4927
|
-
return new Ok(yield fn(...args));
|
|
5073
|
+
return new Ok$1(yield fn(...args));
|
|
4928
5074
|
} catch (error) {
|
|
4929
|
-
return new Err(errorFn ? errorFn(error) : error);
|
|
5075
|
+
return new Err$1(errorFn ? errorFn(error) : error);
|
|
4930
5076
|
}
|
|
4931
5077
|
}))());
|
|
4932
5078
|
};
|
|
4933
5079
|
}
|
|
4934
5080
|
static combine(asyncResultList) {
|
|
4935
|
-
return combineResultAsyncList(asyncResultList);
|
|
5081
|
+
return combineResultAsyncList$1(asyncResultList);
|
|
4936
5082
|
}
|
|
4937
5083
|
static combineWithAllErrors(asyncResultList) {
|
|
4938
|
-
return combineResultAsyncListWithAllErrors(asyncResultList);
|
|
5084
|
+
return combineResultAsyncListWithAllErrors$1(asyncResultList);
|
|
4939
5085
|
}
|
|
4940
5086
|
map(f) {
|
|
4941
|
-
return new
|
|
5087
|
+
return new ResultAsync2(this._promise.then((res) => __awaiter$1(this, void 0, void 0, function* () {
|
|
4942
5088
|
if (res.isErr()) {
|
|
4943
|
-
return new Err(res.error);
|
|
5089
|
+
return new Err$1(res.error);
|
|
4944
5090
|
}
|
|
4945
|
-
return new Ok(yield f(res.value));
|
|
5091
|
+
return new Ok$1(yield f(res.value));
|
|
4946
5092
|
})));
|
|
4947
5093
|
}
|
|
4948
5094
|
andThrough(f) {
|
|
4949
|
-
return new
|
|
5095
|
+
return new ResultAsync2(this._promise.then((res) => __awaiter$1(this, void 0, void 0, function* () {
|
|
4950
5096
|
if (res.isErr()) {
|
|
4951
|
-
return new Err(res.error);
|
|
5097
|
+
return new Err$1(res.error);
|
|
4952
5098
|
}
|
|
4953
5099
|
const newRes = yield f(res.value);
|
|
4954
5100
|
if (newRes.isErr()) {
|
|
4955
|
-
return new Err(newRes.error);
|
|
5101
|
+
return new Err$1(newRes.error);
|
|
4956
5102
|
}
|
|
4957
|
-
return new Ok(res.value);
|
|
5103
|
+
return new Ok$1(res.value);
|
|
4958
5104
|
})));
|
|
4959
5105
|
}
|
|
4960
5106
|
andTee(f) {
|
|
4961
|
-
return new
|
|
5107
|
+
return new ResultAsync2(this._promise.then((res) => __awaiter$1(this, void 0, void 0, function* () {
|
|
4962
5108
|
if (res.isErr()) {
|
|
4963
|
-
return new Err(res.error);
|
|
5109
|
+
return new Err$1(res.error);
|
|
4964
5110
|
}
|
|
4965
5111
|
try {
|
|
4966
5112
|
yield f(res.value);
|
|
4967
5113
|
} catch (e) {
|
|
4968
5114
|
}
|
|
4969
|
-
return new Ok(res.value);
|
|
5115
|
+
return new Ok$1(res.value);
|
|
4970
5116
|
})));
|
|
4971
5117
|
}
|
|
4972
5118
|
mapErr(f) {
|
|
4973
|
-
return new
|
|
5119
|
+
return new ResultAsync2(this._promise.then((res) => __awaiter$1(this, void 0, void 0, function* () {
|
|
4974
5120
|
if (res.isOk()) {
|
|
4975
|
-
return new Ok(res.value);
|
|
5121
|
+
return new Ok$1(res.value);
|
|
4976
5122
|
}
|
|
4977
|
-
return new Err(yield f(res.error));
|
|
5123
|
+
return new Err$1(yield f(res.error));
|
|
4978
5124
|
})));
|
|
4979
5125
|
}
|
|
4980
5126
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
4981
5127
|
andThen(f) {
|
|
4982
|
-
return new
|
|
5128
|
+
return new ResultAsync2(this._promise.then((res) => {
|
|
4983
5129
|
if (res.isErr()) {
|
|
4984
|
-
return new Err(res.error);
|
|
5130
|
+
return new Err$1(res.error);
|
|
4985
5131
|
}
|
|
4986
5132
|
const newValue = f(res.value);
|
|
4987
|
-
return newValue instanceof
|
|
5133
|
+
return newValue instanceof ResultAsync2 ? newValue._promise : newValue;
|
|
4988
5134
|
}));
|
|
4989
5135
|
}
|
|
4990
5136
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
4991
5137
|
orElse(f) {
|
|
4992
|
-
return new
|
|
5138
|
+
return new ResultAsync2(this._promise.then((res) => __awaiter$1(this, void 0, void 0, function* () {
|
|
4993
5139
|
if (res.isErr()) {
|
|
4994
5140
|
return f(res.error);
|
|
4995
5141
|
}
|
|
4996
|
-
return new Ok(res.value);
|
|
5142
|
+
return new Ok$1(res.value);
|
|
4997
5143
|
})));
|
|
4998
5144
|
}
|
|
4999
5145
|
match(ok2, _err) {
|
|
@@ -5006,21 +5152,21 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5006
5152
|
* Emulates Rust's `?` operator in `safeTry`'s body. See also `safeTry`.
|
|
5007
5153
|
*/
|
|
5008
5154
|
safeUnwrap() {
|
|
5009
|
-
return __asyncGenerator(this, arguments, function* safeUnwrap_1() {
|
|
5010
|
-
return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(yield __await(this._promise.then((res) => res.safeUnwrap()))))));
|
|
5155
|
+
return __asyncGenerator$1(this, arguments, function* safeUnwrap_1() {
|
|
5156
|
+
return yield __await$1(yield __await$1(yield* __asyncDelegator$1(__asyncValues$1(yield __await$1(this._promise.then((res) => res.safeUnwrap()))))));
|
|
5011
5157
|
});
|
|
5012
5158
|
}
|
|
5013
5159
|
// Makes ResultAsync implement PromiseLike<Result>
|
|
5014
5160
|
then(successCallback, failureCallback) {
|
|
5015
5161
|
return this._promise.then(successCallback, failureCallback);
|
|
5016
5162
|
}
|
|
5017
|
-
}
|
|
5018
|
-
const errAsync = (err2) => new ResultAsync(Promise.resolve(new Err(err2)));
|
|
5019
|
-
const combineResultList = (resultList) => {
|
|
5020
|
-
let acc = ok([]);
|
|
5163
|
+
};
|
|
5164
|
+
const errAsync$1 = (err2) => new ResultAsync$1(Promise.resolve(new Err$1(err2)));
|
|
5165
|
+
const combineResultList$1 = (resultList) => {
|
|
5166
|
+
let acc = ok$1([]);
|
|
5021
5167
|
for (const result of resultList) {
|
|
5022
5168
|
if (result.isErr()) {
|
|
5023
|
-
acc = err(result.error);
|
|
5169
|
+
acc = err$1(result.error);
|
|
5024
5170
|
break;
|
|
5025
5171
|
} else {
|
|
5026
5172
|
acc.map((list) => list.push(result.value));
|
|
@@ -5028,48 +5174,48 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5028
5174
|
}
|
|
5029
5175
|
return acc;
|
|
5030
5176
|
};
|
|
5031
|
-
const combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
|
|
5032
|
-
const combineResultListWithAllErrors = (resultList) => {
|
|
5033
|
-
let acc = ok([]);
|
|
5177
|
+
const combineResultAsyncList$1 = (asyncResultList) => ResultAsync$1.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList$1);
|
|
5178
|
+
const combineResultListWithAllErrors$1 = (resultList) => {
|
|
5179
|
+
let acc = ok$1([]);
|
|
5034
5180
|
for (const result of resultList) {
|
|
5035
5181
|
if (result.isErr() && acc.isErr()) {
|
|
5036
5182
|
acc.error.push(result.error);
|
|
5037
5183
|
} else if (result.isErr() && acc.isOk()) {
|
|
5038
|
-
acc = err([result.error]);
|
|
5184
|
+
acc = err$1([result.error]);
|
|
5039
5185
|
} else if (result.isOk() && acc.isOk()) {
|
|
5040
5186
|
acc.value.push(result.value);
|
|
5041
5187
|
}
|
|
5042
5188
|
}
|
|
5043
5189
|
return acc;
|
|
5044
5190
|
};
|
|
5045
|
-
const combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
|
|
5046
|
-
var Result;
|
|
5191
|
+
const combineResultAsyncListWithAllErrors$1 = (asyncResultList) => ResultAsync$1.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors$1);
|
|
5192
|
+
var Result$1;
|
|
5047
5193
|
(function(Result2) {
|
|
5048
5194
|
function fromThrowable(fn, errorFn) {
|
|
5049
5195
|
return (...args) => {
|
|
5050
5196
|
try {
|
|
5051
5197
|
const result = fn(...args);
|
|
5052
|
-
return ok(result);
|
|
5198
|
+
return ok$1(result);
|
|
5053
5199
|
} catch (e) {
|
|
5054
|
-
return err(errorFn ? errorFn(e) : e);
|
|
5200
|
+
return err$1(errorFn ? errorFn(e) : e);
|
|
5055
5201
|
}
|
|
5056
5202
|
};
|
|
5057
5203
|
}
|
|
5058
5204
|
Result2.fromThrowable = fromThrowable;
|
|
5059
5205
|
function combine(resultList) {
|
|
5060
|
-
return combineResultList(resultList);
|
|
5206
|
+
return combineResultList$1(resultList);
|
|
5061
5207
|
}
|
|
5062
5208
|
Result2.combine = combine;
|
|
5063
5209
|
function combineWithAllErrors(resultList) {
|
|
5064
|
-
return combineResultListWithAllErrors(resultList);
|
|
5210
|
+
return combineResultListWithAllErrors$1(resultList);
|
|
5065
5211
|
}
|
|
5066
5212
|
Result2.combineWithAllErrors = combineWithAllErrors;
|
|
5067
|
-
})(Result || (Result = {}));
|
|
5068
|
-
const ok = (value) => new Ok(value);
|
|
5069
|
-
function err(err2) {
|
|
5070
|
-
return new Err(err2);
|
|
5213
|
+
})(Result$1 || (Result$1 = {}));
|
|
5214
|
+
const ok$1 = (value) => new Ok$1(value);
|
|
5215
|
+
function err$1(err2) {
|
|
5216
|
+
return new Err$1(err2);
|
|
5071
5217
|
}
|
|
5072
|
-
class Ok {
|
|
5218
|
+
let Ok$1 = class Ok {
|
|
5073
5219
|
constructor(value) {
|
|
5074
5220
|
this.value = value;
|
|
5075
5221
|
}
|
|
@@ -5080,11 +5226,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5080
5226
|
return !this.isOk();
|
|
5081
5227
|
}
|
|
5082
5228
|
map(f) {
|
|
5083
|
-
return ok(f(this.value));
|
|
5229
|
+
return ok$1(f(this.value));
|
|
5084
5230
|
}
|
|
5085
5231
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5086
5232
|
mapErr(_f) {
|
|
5087
|
-
return ok(this.value);
|
|
5233
|
+
return ok$1(this.value);
|
|
5088
5234
|
}
|
|
5089
5235
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
5090
5236
|
andThen(f) {
|
|
@@ -5099,11 +5245,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5099
5245
|
f(this.value);
|
|
5100
5246
|
} catch (e) {
|
|
5101
5247
|
}
|
|
5102
|
-
return ok(this.value);
|
|
5248
|
+
return ok$1(this.value);
|
|
5103
5249
|
}
|
|
5104
5250
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
5105
5251
|
orElse(_f) {
|
|
5106
|
-
return ok(this.value);
|
|
5252
|
+
return ok$1(this.value);
|
|
5107
5253
|
}
|
|
5108
5254
|
asyncAndThen(f) {
|
|
5109
5255
|
return f(this.value);
|
|
@@ -5113,7 +5259,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5113
5259
|
return f(this.value).map(() => this.value);
|
|
5114
5260
|
}
|
|
5115
5261
|
asyncMap(f) {
|
|
5116
|
-
return ResultAsync.fromSafePromise(f(this.value));
|
|
5262
|
+
return ResultAsync$1.fromSafePromise(f(this.value));
|
|
5117
5263
|
}
|
|
5118
5264
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5119
5265
|
unwrapOr(_v) {
|
|
@@ -5133,10 +5279,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5133
5279
|
return this.value;
|
|
5134
5280
|
}
|
|
5135
5281
|
_unsafeUnwrapErr(config) {
|
|
5136
|
-
throw createNeverThrowError("Called `_unsafeUnwrapErr` on an Ok", this, config);
|
|
5282
|
+
throw createNeverThrowError$1("Called `_unsafeUnwrapErr` on an Ok", this, config);
|
|
5137
5283
|
}
|
|
5138
|
-
}
|
|
5139
|
-
class Err {
|
|
5284
|
+
};
|
|
5285
|
+
let Err$1 = class Err {
|
|
5140
5286
|
constructor(error) {
|
|
5141
5287
|
this.error = error;
|
|
5142
5288
|
}
|
|
@@ -5148,20 +5294,20 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5148
5294
|
}
|
|
5149
5295
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5150
5296
|
map(_f) {
|
|
5151
|
-
return err(this.error);
|
|
5297
|
+
return err$1(this.error);
|
|
5152
5298
|
}
|
|
5153
5299
|
mapErr(f) {
|
|
5154
|
-
return err(f(this.error));
|
|
5300
|
+
return err$1(f(this.error));
|
|
5155
5301
|
}
|
|
5156
5302
|
andThrough(_f) {
|
|
5157
|
-
return err(this.error);
|
|
5303
|
+
return err$1(this.error);
|
|
5158
5304
|
}
|
|
5159
5305
|
andTee(_f) {
|
|
5160
|
-
return err(this.error);
|
|
5306
|
+
return err$1(this.error);
|
|
5161
5307
|
}
|
|
5162
5308
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
5163
5309
|
andThen(_f) {
|
|
5164
|
-
return err(this.error);
|
|
5310
|
+
return err$1(this.error);
|
|
5165
5311
|
}
|
|
5166
5312
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
5167
5313
|
orElse(f) {
|
|
@@ -5169,14 +5315,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5169
5315
|
}
|
|
5170
5316
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5171
5317
|
asyncAndThen(_f) {
|
|
5172
|
-
return errAsync(this.error);
|
|
5318
|
+
return errAsync$1(this.error);
|
|
5173
5319
|
}
|
|
5174
5320
|
asyncAndThrough(_f) {
|
|
5175
|
-
return errAsync(this.error);
|
|
5321
|
+
return errAsync$1(this.error);
|
|
5176
5322
|
}
|
|
5177
5323
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5178
5324
|
asyncMap(_f) {
|
|
5179
|
-
return errAsync(this.error);
|
|
5325
|
+
return errAsync$1(this.error);
|
|
5180
5326
|
}
|
|
5181
5327
|
unwrapOr(v) {
|
|
5182
5328
|
return v;
|
|
@@ -5187,18 +5333,18 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5187
5333
|
safeUnwrap() {
|
|
5188
5334
|
const error = this.error;
|
|
5189
5335
|
return function* () {
|
|
5190
|
-
yield err(error);
|
|
5336
|
+
yield err$1(error);
|
|
5191
5337
|
throw new Error("Do not use this generator out of `safeTry`");
|
|
5192
5338
|
}();
|
|
5193
5339
|
}
|
|
5194
5340
|
_unsafeUnwrap(config) {
|
|
5195
|
-
throw createNeverThrowError("Called `_unsafeUnwrap` on an Err", this, config);
|
|
5341
|
+
throw createNeverThrowError$1("Called `_unsafeUnwrap` on an Err", this, config);
|
|
5196
5342
|
}
|
|
5197
5343
|
_unsafeUnwrapErr(_) {
|
|
5198
5344
|
return this.error;
|
|
5199
5345
|
}
|
|
5200
|
-
}
|
|
5201
|
-
Result.fromThrowable;
|
|
5346
|
+
};
|
|
5347
|
+
Result$1.fromThrowable;
|
|
5202
5348
|
const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
5203
5349
|
function randomID() {
|
|
5204
5350
|
return Math.random().toString(36).slice(2, 11);
|
|
@@ -5226,7 +5372,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5226
5372
|
querySerializer: requestQuerySerializer,
|
|
5227
5373
|
bodySerializer = globalBodySerializer ?? defaultBodySerializer,
|
|
5228
5374
|
body,
|
|
5229
|
-
...
|
|
5375
|
+
...init2
|
|
5230
5376
|
} = fetchOptions || {};
|
|
5231
5377
|
if (localBaseUrl) {
|
|
5232
5378
|
baseUrl = removeTrailingSlash(localBaseUrl);
|
|
@@ -5249,16 +5395,16 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5249
5395
|
const requestInit = {
|
|
5250
5396
|
redirect: "follow",
|
|
5251
5397
|
...baseOptions,
|
|
5252
|
-
...
|
|
5398
|
+
...init2,
|
|
5253
5399
|
body: serializedBody,
|
|
5254
5400
|
headers: mergeHeaders(defaultHeaders, baseHeaders, headers, params.header)
|
|
5255
5401
|
};
|
|
5256
5402
|
let id;
|
|
5257
5403
|
let options;
|
|
5258
5404
|
let request = new CustomRequest(createFinalURL(schemaPath, { baseUrl, params, querySerializer }), requestInit);
|
|
5259
|
-
for (const key in
|
|
5405
|
+
for (const key in init2) {
|
|
5260
5406
|
if (!(key in request)) {
|
|
5261
|
-
request[key] =
|
|
5407
|
+
request[key] = init2[key];
|
|
5262
5408
|
}
|
|
5263
5409
|
}
|
|
5264
5410
|
if (middlewares.length) {
|
|
@@ -5328,36 +5474,36 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
5328
5474
|
}
|
|
5329
5475
|
return {
|
|
5330
5476
|
/** Call a GET endpoint */
|
|
5331
|
-
GET(url,
|
|
5332
|
-
return coreFetch(url, { ...
|
|
5477
|
+
GET(url, init2) {
|
|
5478
|
+
return coreFetch(url, { ...init2, method: "GET" });
|
|
5333
5479
|
},
|
|
5334
5480
|
/** Call a PUT endpoint */
|
|
5335
|
-
PUT(url,
|
|
5336
|
-
return coreFetch(url, { ...
|
|
5481
|
+
PUT(url, init2) {
|
|
5482
|
+
return coreFetch(url, { ...init2, method: "PUT" });
|
|
5337
5483
|
},
|
|
5338
5484
|
/** Call a POST endpoint */
|
|
5339
|
-
POST(url,
|
|
5340
|
-
return coreFetch(url, { ...
|
|
5485
|
+
POST(url, init2) {
|
|
5486
|
+
return coreFetch(url, { ...init2, method: "POST" });
|
|
5341
5487
|
},
|
|
5342
5488
|
/** Call a DELETE endpoint */
|
|
5343
|
-
DELETE(url,
|
|
5344
|
-
return coreFetch(url, { ...
|
|
5489
|
+
DELETE(url, init2) {
|
|
5490
|
+
return coreFetch(url, { ...init2, method: "DELETE" });
|
|
5345
5491
|
},
|
|
5346
5492
|
/** Call a OPTIONS endpoint */
|
|
5347
|
-
OPTIONS(url,
|
|
5348
|
-
return coreFetch(url, { ...
|
|
5493
|
+
OPTIONS(url, init2) {
|
|
5494
|
+
return coreFetch(url, { ...init2, method: "OPTIONS" });
|
|
5349
5495
|
},
|
|
5350
5496
|
/** Call a HEAD endpoint */
|
|
5351
|
-
HEAD(url,
|
|
5352
|
-
return coreFetch(url, { ...
|
|
5497
|
+
HEAD(url, init2) {
|
|
5498
|
+
return coreFetch(url, { ...init2, method: "HEAD" });
|
|
5353
5499
|
},
|
|
5354
5500
|
/** Call a PATCH endpoint */
|
|
5355
|
-
PATCH(url,
|
|
5356
|
-
return coreFetch(url, { ...
|
|
5501
|
+
PATCH(url, init2) {
|
|
5502
|
+
return coreFetch(url, { ...init2, method: "PATCH" });
|
|
5357
5503
|
},
|
|
5358
5504
|
/** Call a TRACE endpoint */
|
|
5359
|
-
TRACE(url,
|
|
5360
|
-
return coreFetch(url, { ...
|
|
5505
|
+
TRACE(url, init2) {
|
|
5506
|
+
return coreFetch(url, { ...init2, method: "TRACE" });
|
|
5361
5507
|
},
|
|
5362
5508
|
/** Register middleware */
|
|
5363
5509
|
use(...middleware) {
|
|
@@ -7824,11 +7970,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
7824
7970
|
unknownKeys: "strict",
|
|
7825
7971
|
...message !== void 0 ? {
|
|
7826
7972
|
errorMap: (issue, ctx) => {
|
|
7827
|
-
var _a2, _b2, _c2,
|
|
7973
|
+
var _a2, _b2, _c2, _d2;
|
|
7828
7974
|
const defaultError = (_c2 = (_b2 = (_a2 = this._def).errorMap) === null || _b2 === void 0 ? void 0 : _b2.call(_a2, issue, ctx).message) !== null && _c2 !== void 0 ? _c2 : ctx.defaultError;
|
|
7829
7975
|
if (issue.code === "unrecognized_keys")
|
|
7830
7976
|
return {
|
|
7831
|
-
message: (
|
|
7977
|
+
message: (_d2 = errorUtil.errToObj(message).message) !== null && _d2 !== void 0 ? _d2 : defaultError
|
|
7832
7978
|
};
|
|
7833
7979
|
return {
|
|
7834
7980
|
message: defaultError
|
|
@@ -10313,6 +10459,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
10313
10459
|
if (m[8]) date.offset = $fae977aafc393c5c$var$parseNumber(m[8], -23, 23) * 36e5 + $fae977aafc393c5c$var$parseNumber((_m_ = m[9]) !== null && _m_ !== void 0 ? _m_ : "0", 0, 59) * 6e4;
|
|
10314
10460
|
return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
|
|
10315
10461
|
}
|
|
10462
|
+
function $fae977aafc393c5c$export$8e384432362ed0f0(value) {
|
|
10463
|
+
return $fae977aafc393c5c$export$5adfdab05168c219(value, $14e0f24ef4ac5c92$export$aa8b41735afcabd2());
|
|
10464
|
+
}
|
|
10316
10465
|
function $fae977aafc393c5c$var$parseNumber(value, min, max) {
|
|
10317
10466
|
let val = Number(value);
|
|
10318
10467
|
if (val < min || val > max) throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max}`);
|
|
@@ -10711,7 +10860,18 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
10711
10860
|
function formatTime(value) {
|
|
10712
10861
|
return $11d87f3f76e88657$export$d33f79e3ffc3dc83($fae977aafc393c5c$export$5adfdab05168c219(value, "Europe/Berlin")).toString().slice(0, -3);
|
|
10713
10862
|
}
|
|
10714
|
-
function
|
|
10863
|
+
function formatDate(isoDateString, options = {
|
|
10864
|
+
weekday: "long",
|
|
10865
|
+
year: "numeric",
|
|
10866
|
+
month: "long",
|
|
10867
|
+
day: "numeric"
|
|
10868
|
+
}, locale = "de") {
|
|
10869
|
+
options = {
|
|
10870
|
+
...options
|
|
10871
|
+
};
|
|
10872
|
+
return new Date(isoDateString).toLocaleDateString(locale, options);
|
|
10873
|
+
}
|
|
10874
|
+
function formatCurrency$1(priceCents) {
|
|
10715
10875
|
if (priceCents === void 0) {
|
|
10716
10876
|
throw Error("priceCents is required");
|
|
10717
10877
|
}
|
|
@@ -10804,7 +10964,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
10804
10964
|
} else {
|
|
10805
10965
|
this.priceCents = ticketObject.price_cents * (1 + this.vatPct / 100);
|
|
10806
10966
|
}
|
|
10807
|
-
this.priceFormatted = formatCurrency(this.priceCents);
|
|
10967
|
+
this.priceFormatted = formatCurrency$1(this.priceCents);
|
|
10808
10968
|
this.quantity = quantity || 0;
|
|
10809
10969
|
this.minQuantity = ticketObject.min_persons;
|
|
10810
10970
|
this.maxPersons = ticketObject.max_persons;
|
|
@@ -10857,7 +11017,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
10857
11017
|
}
|
|
10858
11018
|
updateTotalPrices() {
|
|
10859
11019
|
this.totalPriceCents = this.quantity * this.priceCents;
|
|
10860
|
-
this.totalPriceFormatted = formatCurrency(this.totalPriceCents);
|
|
11020
|
+
this.totalPriceFormatted = formatCurrency$1(this.totalPriceCents);
|
|
10861
11021
|
}
|
|
10862
11022
|
}
|
|
10863
11023
|
function initGomusTickets(tickets) {
|
|
@@ -10901,7 +11061,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
10901
11061
|
} else {
|
|
10902
11062
|
this.priceCents = ticketObject.price_cents * (1 + this.vatPct / 100);
|
|
10903
11063
|
}
|
|
10904
|
-
this.priceFormatted = formatCurrency(this.priceCents);
|
|
11064
|
+
this.priceFormatted = formatCurrency$1(this.priceCents);
|
|
10905
11065
|
this.quantity = quantity || 0;
|
|
10906
11066
|
this.minQuantity = ticketObject.min_persons;
|
|
10907
11067
|
this.maxPersons = ticketObject.max_persons;
|
|
@@ -10917,7 +11077,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
10917
11077
|
}
|
|
10918
11078
|
updateTotalPrices() {
|
|
10919
11079
|
this.totalPriceCents = this.quantity * this.priceCents;
|
|
10920
|
-
this.totalPriceFormatted = formatCurrency(this.totalPriceCents);
|
|
11080
|
+
this.totalPriceFormatted = formatCurrency$1(this.totalPriceCents);
|
|
10921
11081
|
}
|
|
10922
11082
|
}
|
|
10923
11083
|
function initAnnualTickets(tickets) {
|
|
@@ -11209,45 +11369,669 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11209
11369
|
}
|
|
11210
11370
|
};
|
|
11211
11371
|
}
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
11226
|
-
return
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
set(__privateGet(this, _mode), value, true);
|
|
11372
|
+
const defaultErrorConfig = {
|
|
11373
|
+
withStackTrace: false
|
|
11374
|
+
};
|
|
11375
|
+
const createNeverThrowError = (message, result, config = defaultErrorConfig) => {
|
|
11376
|
+
const data = result.isOk() ? { type: "Ok", value: result.value } : { type: "Err", value: result.error };
|
|
11377
|
+
const maybeStack = config.withStackTrace ? new Error().stack : void 0;
|
|
11378
|
+
return {
|
|
11379
|
+
data,
|
|
11380
|
+
message,
|
|
11381
|
+
stack: maybeStack
|
|
11382
|
+
};
|
|
11383
|
+
};
|
|
11384
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
11385
|
+
function adopt(value) {
|
|
11386
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
11387
|
+
resolve(value);
|
|
11388
|
+
});
|
|
11230
11389
|
}
|
|
11231
|
-
|
|
11232
|
-
|
|
11390
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
11391
|
+
function fulfilled(value) {
|
|
11392
|
+
try {
|
|
11393
|
+
step(generator.next(value));
|
|
11394
|
+
} catch (e) {
|
|
11395
|
+
reject(e);
|
|
11396
|
+
}
|
|
11397
|
+
}
|
|
11398
|
+
function rejected(value) {
|
|
11399
|
+
try {
|
|
11400
|
+
step(generator["throw"](value));
|
|
11401
|
+
} catch (e) {
|
|
11402
|
+
reject(e);
|
|
11403
|
+
}
|
|
11404
|
+
}
|
|
11405
|
+
function step(result) {
|
|
11406
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
11407
|
+
}
|
|
11408
|
+
step((generator = generator.apply(thisArg, [])).next());
|
|
11409
|
+
});
|
|
11410
|
+
}
|
|
11411
|
+
function __values(o) {
|
|
11412
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
11413
|
+
if (m) return m.call(o);
|
|
11414
|
+
if (o && typeof o.length === "number") return {
|
|
11415
|
+
next: function() {
|
|
11416
|
+
if (o && i >= o.length) o = void 0;
|
|
11417
|
+
return { value: o && o[i++], done: !o };
|
|
11418
|
+
}
|
|
11419
|
+
};
|
|
11420
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11421
|
+
}
|
|
11422
|
+
function __await(v) {
|
|
11423
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
11424
|
+
}
|
|
11425
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
11426
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
11427
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
11428
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
|
11429
|
+
return this;
|
|
11430
|
+
}, i;
|
|
11431
|
+
function awaitReturn(f) {
|
|
11432
|
+
return function(v) {
|
|
11433
|
+
return Promise.resolve(v).then(f, reject);
|
|
11434
|
+
};
|
|
11233
11435
|
}
|
|
11234
|
-
|
|
11235
|
-
|
|
11436
|
+
function verb(n, f) {
|
|
11437
|
+
if (g[n]) {
|
|
11438
|
+
i[n] = function(v) {
|
|
11439
|
+
return new Promise(function(a, b) {
|
|
11440
|
+
q.push([n, v, a, b]) > 1 || resume(n, v);
|
|
11441
|
+
});
|
|
11442
|
+
};
|
|
11443
|
+
if (f) i[n] = f(i[n]);
|
|
11444
|
+
}
|
|
11236
11445
|
}
|
|
11237
|
-
|
|
11238
|
-
|
|
11446
|
+
function resume(n, v) {
|
|
11447
|
+
try {
|
|
11448
|
+
step(g[n](v));
|
|
11449
|
+
} catch (e) {
|
|
11450
|
+
settle(q[0][3], e);
|
|
11451
|
+
}
|
|
11239
11452
|
}
|
|
11240
|
-
|
|
11241
|
-
|
|
11453
|
+
function step(r2) {
|
|
11454
|
+
r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
|
|
11242
11455
|
}
|
|
11243
|
-
|
|
11244
|
-
|
|
11456
|
+
function fulfill(value) {
|
|
11457
|
+
resume("next", value);
|
|
11245
11458
|
}
|
|
11246
|
-
|
|
11247
|
-
|
|
11459
|
+
function reject(value) {
|
|
11460
|
+
resume("throw", value);
|
|
11248
11461
|
}
|
|
11249
|
-
|
|
11250
|
-
|
|
11462
|
+
function settle(f, v) {
|
|
11463
|
+
if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
|
|
11464
|
+
}
|
|
11465
|
+
}
|
|
11466
|
+
function __asyncDelegator(o) {
|
|
11467
|
+
var i, p;
|
|
11468
|
+
return i = {}, verb("next"), verb("throw", function(e) {
|
|
11469
|
+
throw e;
|
|
11470
|
+
}), verb("return"), i[Symbol.iterator] = function() {
|
|
11471
|
+
return this;
|
|
11472
|
+
}, i;
|
|
11473
|
+
function verb(n, f) {
|
|
11474
|
+
i[n] = o[n] ? function(v) {
|
|
11475
|
+
return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v;
|
|
11476
|
+
} : f;
|
|
11477
|
+
}
|
|
11478
|
+
}
|
|
11479
|
+
function __asyncValues(o) {
|
|
11480
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
11481
|
+
var m = o[Symbol.asyncIterator], i;
|
|
11482
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
11483
|
+
return this;
|
|
11484
|
+
}, i);
|
|
11485
|
+
function verb(n) {
|
|
11486
|
+
i[n] = o[n] && function(v) {
|
|
11487
|
+
return new Promise(function(resolve, reject) {
|
|
11488
|
+
v = o[n](v), settle(resolve, reject, v.done, v.value);
|
|
11489
|
+
});
|
|
11490
|
+
};
|
|
11491
|
+
}
|
|
11492
|
+
function settle(resolve, reject, d, v) {
|
|
11493
|
+
Promise.resolve(v).then(function(v2) {
|
|
11494
|
+
resolve({ value: v2, done: d });
|
|
11495
|
+
}, reject);
|
|
11496
|
+
}
|
|
11497
|
+
}
|
|
11498
|
+
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
11499
|
+
var e = new Error(message);
|
|
11500
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
11501
|
+
};
|
|
11502
|
+
class ResultAsync {
|
|
11503
|
+
constructor(res) {
|
|
11504
|
+
this._promise = res;
|
|
11505
|
+
}
|
|
11506
|
+
static fromSafePromise(promise) {
|
|
11507
|
+
const newPromise = promise.then((value) => new Ok(value));
|
|
11508
|
+
return new ResultAsync(newPromise);
|
|
11509
|
+
}
|
|
11510
|
+
static fromPromise(promise, errorFn) {
|
|
11511
|
+
const newPromise = promise.then((value) => new Ok(value)).catch((e) => new Err(errorFn(e)));
|
|
11512
|
+
return new ResultAsync(newPromise);
|
|
11513
|
+
}
|
|
11514
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11515
|
+
static fromThrowable(fn, errorFn) {
|
|
11516
|
+
return (...args) => {
|
|
11517
|
+
return new ResultAsync((() => __awaiter(this, void 0, void 0, function* () {
|
|
11518
|
+
try {
|
|
11519
|
+
return new Ok(yield fn(...args));
|
|
11520
|
+
} catch (error) {
|
|
11521
|
+
return new Err(errorFn ? errorFn(error) : error);
|
|
11522
|
+
}
|
|
11523
|
+
}))());
|
|
11524
|
+
};
|
|
11525
|
+
}
|
|
11526
|
+
static combine(asyncResultList) {
|
|
11527
|
+
return combineResultAsyncList(asyncResultList);
|
|
11528
|
+
}
|
|
11529
|
+
static combineWithAllErrors(asyncResultList) {
|
|
11530
|
+
return combineResultAsyncListWithAllErrors(asyncResultList);
|
|
11531
|
+
}
|
|
11532
|
+
map(f) {
|
|
11533
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
11534
|
+
if (res.isErr()) {
|
|
11535
|
+
return new Err(res.error);
|
|
11536
|
+
}
|
|
11537
|
+
return new Ok(yield f(res.value));
|
|
11538
|
+
})));
|
|
11539
|
+
}
|
|
11540
|
+
andThrough(f) {
|
|
11541
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
11542
|
+
if (res.isErr()) {
|
|
11543
|
+
return new Err(res.error);
|
|
11544
|
+
}
|
|
11545
|
+
const newRes = yield f(res.value);
|
|
11546
|
+
if (newRes.isErr()) {
|
|
11547
|
+
return new Err(newRes.error);
|
|
11548
|
+
}
|
|
11549
|
+
return new Ok(res.value);
|
|
11550
|
+
})));
|
|
11551
|
+
}
|
|
11552
|
+
andTee(f) {
|
|
11553
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
11554
|
+
if (res.isErr()) {
|
|
11555
|
+
return new Err(res.error);
|
|
11556
|
+
}
|
|
11557
|
+
try {
|
|
11558
|
+
yield f(res.value);
|
|
11559
|
+
} catch (e) {
|
|
11560
|
+
}
|
|
11561
|
+
return new Ok(res.value);
|
|
11562
|
+
})));
|
|
11563
|
+
}
|
|
11564
|
+
orTee(f) {
|
|
11565
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
11566
|
+
if (res.isOk()) {
|
|
11567
|
+
return new Ok(res.value);
|
|
11568
|
+
}
|
|
11569
|
+
try {
|
|
11570
|
+
yield f(res.error);
|
|
11571
|
+
} catch (e) {
|
|
11572
|
+
}
|
|
11573
|
+
return new Err(res.error);
|
|
11574
|
+
})));
|
|
11575
|
+
}
|
|
11576
|
+
mapErr(f) {
|
|
11577
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
11578
|
+
if (res.isOk()) {
|
|
11579
|
+
return new Ok(res.value);
|
|
11580
|
+
}
|
|
11581
|
+
return new Err(yield f(res.error));
|
|
11582
|
+
})));
|
|
11583
|
+
}
|
|
11584
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
11585
|
+
andThen(f) {
|
|
11586
|
+
return new ResultAsync(this._promise.then((res) => {
|
|
11587
|
+
if (res.isErr()) {
|
|
11588
|
+
return new Err(res.error);
|
|
11589
|
+
}
|
|
11590
|
+
const newValue = f(res.value);
|
|
11591
|
+
return newValue instanceof ResultAsync ? newValue._promise : newValue;
|
|
11592
|
+
}));
|
|
11593
|
+
}
|
|
11594
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
11595
|
+
orElse(f) {
|
|
11596
|
+
return new ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
|
|
11597
|
+
if (res.isErr()) {
|
|
11598
|
+
return f(res.error);
|
|
11599
|
+
}
|
|
11600
|
+
return new Ok(res.value);
|
|
11601
|
+
})));
|
|
11602
|
+
}
|
|
11603
|
+
match(ok2, _err) {
|
|
11604
|
+
return this._promise.then((res) => res.match(ok2, _err));
|
|
11605
|
+
}
|
|
11606
|
+
unwrapOr(t) {
|
|
11607
|
+
return this._promise.then((res) => res.unwrapOr(t));
|
|
11608
|
+
}
|
|
11609
|
+
/**
|
|
11610
|
+
* @deprecated will be removed in 9.0.0.
|
|
11611
|
+
*
|
|
11612
|
+
* You can use `safeTry` without this method.
|
|
11613
|
+
* @example
|
|
11614
|
+
* ```typescript
|
|
11615
|
+
* safeTry(async function* () {
|
|
11616
|
+
* const okValue = yield* yourResult
|
|
11617
|
+
* })
|
|
11618
|
+
* ```
|
|
11619
|
+
* Emulates Rust's `?` operator in `safeTry`'s body. See also `safeTry`.
|
|
11620
|
+
*/
|
|
11621
|
+
safeUnwrap() {
|
|
11622
|
+
return __asyncGenerator(this, arguments, function* safeUnwrap_1() {
|
|
11623
|
+
return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(yield __await(this._promise.then((res) => res.safeUnwrap()))))));
|
|
11624
|
+
});
|
|
11625
|
+
}
|
|
11626
|
+
// Makes ResultAsync implement PromiseLike<Result>
|
|
11627
|
+
then(successCallback, failureCallback) {
|
|
11628
|
+
return this._promise.then(successCallback, failureCallback);
|
|
11629
|
+
}
|
|
11630
|
+
[Symbol.asyncIterator]() {
|
|
11631
|
+
return __asyncGenerator(this, arguments, function* _a2() {
|
|
11632
|
+
const result = yield __await(this._promise);
|
|
11633
|
+
if (result.isErr()) {
|
|
11634
|
+
yield yield __await(errAsync(result.error));
|
|
11635
|
+
}
|
|
11636
|
+
return yield __await(result.value);
|
|
11637
|
+
});
|
|
11638
|
+
}
|
|
11639
|
+
}
|
|
11640
|
+
function errAsync(err2) {
|
|
11641
|
+
return new ResultAsync(Promise.resolve(new Err(err2)));
|
|
11642
|
+
}
|
|
11643
|
+
const combineResultList = (resultList) => {
|
|
11644
|
+
let acc = ok([]);
|
|
11645
|
+
for (const result of resultList) {
|
|
11646
|
+
if (result.isErr()) {
|
|
11647
|
+
acc = err(result.error);
|
|
11648
|
+
break;
|
|
11649
|
+
} else {
|
|
11650
|
+
acc.map((list) => list.push(result.value));
|
|
11651
|
+
}
|
|
11652
|
+
}
|
|
11653
|
+
return acc;
|
|
11654
|
+
};
|
|
11655
|
+
const combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
|
|
11656
|
+
const combineResultListWithAllErrors = (resultList) => {
|
|
11657
|
+
let acc = ok([]);
|
|
11658
|
+
for (const result of resultList) {
|
|
11659
|
+
if (result.isErr() && acc.isErr()) {
|
|
11660
|
+
acc.error.push(result.error);
|
|
11661
|
+
} else if (result.isErr() && acc.isOk()) {
|
|
11662
|
+
acc = err([result.error]);
|
|
11663
|
+
} else if (result.isOk() && acc.isOk()) {
|
|
11664
|
+
acc.value.push(result.value);
|
|
11665
|
+
}
|
|
11666
|
+
}
|
|
11667
|
+
return acc;
|
|
11668
|
+
};
|
|
11669
|
+
const combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
|
|
11670
|
+
var Result;
|
|
11671
|
+
(function(Result2) {
|
|
11672
|
+
function fromThrowable(fn, errorFn) {
|
|
11673
|
+
return (...args) => {
|
|
11674
|
+
try {
|
|
11675
|
+
const result = fn(...args);
|
|
11676
|
+
return ok(result);
|
|
11677
|
+
} catch (e) {
|
|
11678
|
+
return err(errorFn ? errorFn(e) : e);
|
|
11679
|
+
}
|
|
11680
|
+
};
|
|
11681
|
+
}
|
|
11682
|
+
Result2.fromThrowable = fromThrowable;
|
|
11683
|
+
function combine(resultList) {
|
|
11684
|
+
return combineResultList(resultList);
|
|
11685
|
+
}
|
|
11686
|
+
Result2.combine = combine;
|
|
11687
|
+
function combineWithAllErrors(resultList) {
|
|
11688
|
+
return combineResultListWithAllErrors(resultList);
|
|
11689
|
+
}
|
|
11690
|
+
Result2.combineWithAllErrors = combineWithAllErrors;
|
|
11691
|
+
})(Result || (Result = {}));
|
|
11692
|
+
function ok(value) {
|
|
11693
|
+
return new Ok(value);
|
|
11694
|
+
}
|
|
11695
|
+
function err(err2) {
|
|
11696
|
+
return new Err(err2);
|
|
11697
|
+
}
|
|
11698
|
+
class Ok {
|
|
11699
|
+
constructor(value) {
|
|
11700
|
+
this.value = value;
|
|
11701
|
+
}
|
|
11702
|
+
isOk() {
|
|
11703
|
+
return true;
|
|
11704
|
+
}
|
|
11705
|
+
isErr() {
|
|
11706
|
+
return !this.isOk();
|
|
11707
|
+
}
|
|
11708
|
+
map(f) {
|
|
11709
|
+
return ok(f(this.value));
|
|
11710
|
+
}
|
|
11711
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11712
|
+
mapErr(_f) {
|
|
11713
|
+
return ok(this.value);
|
|
11714
|
+
}
|
|
11715
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
11716
|
+
andThen(f) {
|
|
11717
|
+
return f(this.value);
|
|
11718
|
+
}
|
|
11719
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
11720
|
+
andThrough(f) {
|
|
11721
|
+
return f(this.value).map((_value) => this.value);
|
|
11722
|
+
}
|
|
11723
|
+
andTee(f) {
|
|
11724
|
+
try {
|
|
11725
|
+
f(this.value);
|
|
11726
|
+
} catch (e) {
|
|
11727
|
+
}
|
|
11728
|
+
return ok(this.value);
|
|
11729
|
+
}
|
|
11730
|
+
orTee(_f) {
|
|
11731
|
+
return ok(this.value);
|
|
11732
|
+
}
|
|
11733
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
11734
|
+
orElse(_f) {
|
|
11735
|
+
return ok(this.value);
|
|
11736
|
+
}
|
|
11737
|
+
asyncAndThen(f) {
|
|
11738
|
+
return f(this.value);
|
|
11739
|
+
}
|
|
11740
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
11741
|
+
asyncAndThrough(f) {
|
|
11742
|
+
return f(this.value).map(() => this.value);
|
|
11743
|
+
}
|
|
11744
|
+
asyncMap(f) {
|
|
11745
|
+
return ResultAsync.fromSafePromise(f(this.value));
|
|
11746
|
+
}
|
|
11747
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11748
|
+
unwrapOr(_v) {
|
|
11749
|
+
return this.value;
|
|
11750
|
+
}
|
|
11751
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11752
|
+
match(ok2, _err) {
|
|
11753
|
+
return ok2(this.value);
|
|
11754
|
+
}
|
|
11755
|
+
safeUnwrap() {
|
|
11756
|
+
const value = this.value;
|
|
11757
|
+
return function* () {
|
|
11758
|
+
return value;
|
|
11759
|
+
}();
|
|
11760
|
+
}
|
|
11761
|
+
_unsafeUnwrap(_) {
|
|
11762
|
+
return this.value;
|
|
11763
|
+
}
|
|
11764
|
+
_unsafeUnwrapErr(config) {
|
|
11765
|
+
throw createNeverThrowError("Called `_unsafeUnwrapErr` on an Ok", this, config);
|
|
11766
|
+
}
|
|
11767
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias, require-yield
|
|
11768
|
+
*[Symbol.iterator]() {
|
|
11769
|
+
return this.value;
|
|
11770
|
+
}
|
|
11771
|
+
}
|
|
11772
|
+
class Err {
|
|
11773
|
+
constructor(error) {
|
|
11774
|
+
this.error = error;
|
|
11775
|
+
}
|
|
11776
|
+
isOk() {
|
|
11777
|
+
return false;
|
|
11778
|
+
}
|
|
11779
|
+
isErr() {
|
|
11780
|
+
return !this.isOk();
|
|
11781
|
+
}
|
|
11782
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11783
|
+
map(_f) {
|
|
11784
|
+
return err(this.error);
|
|
11785
|
+
}
|
|
11786
|
+
mapErr(f) {
|
|
11787
|
+
return err(f(this.error));
|
|
11788
|
+
}
|
|
11789
|
+
andThrough(_f) {
|
|
11790
|
+
return err(this.error);
|
|
11791
|
+
}
|
|
11792
|
+
andTee(_f) {
|
|
11793
|
+
return err(this.error);
|
|
11794
|
+
}
|
|
11795
|
+
orTee(f) {
|
|
11796
|
+
try {
|
|
11797
|
+
f(this.error);
|
|
11798
|
+
} catch (e) {
|
|
11799
|
+
}
|
|
11800
|
+
return err(this.error);
|
|
11801
|
+
}
|
|
11802
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
11803
|
+
andThen(_f) {
|
|
11804
|
+
return err(this.error);
|
|
11805
|
+
}
|
|
11806
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
|
|
11807
|
+
orElse(f) {
|
|
11808
|
+
return f(this.error);
|
|
11809
|
+
}
|
|
11810
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11811
|
+
asyncAndThen(_f) {
|
|
11812
|
+
return errAsync(this.error);
|
|
11813
|
+
}
|
|
11814
|
+
asyncAndThrough(_f) {
|
|
11815
|
+
return errAsync(this.error);
|
|
11816
|
+
}
|
|
11817
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
11818
|
+
asyncMap(_f) {
|
|
11819
|
+
return errAsync(this.error);
|
|
11820
|
+
}
|
|
11821
|
+
unwrapOr(v) {
|
|
11822
|
+
return v;
|
|
11823
|
+
}
|
|
11824
|
+
match(_ok, err2) {
|
|
11825
|
+
return err2(this.error);
|
|
11826
|
+
}
|
|
11827
|
+
safeUnwrap() {
|
|
11828
|
+
const error = this.error;
|
|
11829
|
+
return function* () {
|
|
11830
|
+
yield err(error);
|
|
11831
|
+
throw new Error("Do not use this generator out of `safeTry`");
|
|
11832
|
+
}();
|
|
11833
|
+
}
|
|
11834
|
+
_unsafeUnwrap(config) {
|
|
11835
|
+
throw createNeverThrowError("Called `_unsafeUnwrap` on an Err", this, config);
|
|
11836
|
+
}
|
|
11837
|
+
_unsafeUnwrapErr(_) {
|
|
11838
|
+
return this.error;
|
|
11839
|
+
}
|
|
11840
|
+
*[Symbol.iterator]() {
|
|
11841
|
+
const self = this;
|
|
11842
|
+
yield self;
|
|
11843
|
+
return self;
|
|
11844
|
+
}
|
|
11845
|
+
}
|
|
11846
|
+
Result.fromThrowable;
|
|
11847
|
+
function getCartItems() {
|
|
11848
|
+
const storedItemsJson = localStorage.getItem("go-cart");
|
|
11849
|
+
if (!storedItemsJson) return [];
|
|
11850
|
+
const nowDate = $14e0f24ef4ac5c92$export$461939dd4422153($14e0f24ef4ac5c92$export$aa8b41735afcabd2());
|
|
11851
|
+
const safeJsonParse = Result.fromThrowable(JSON.parse, () => []);
|
|
11852
|
+
const storedCartItems = safeJsonParse(storedItemsJson).unwrapOr([]);
|
|
11853
|
+
const items = [];
|
|
11854
|
+
storedCartItems.forEach((cartItem) => {
|
|
11855
|
+
switch (cartItem.type) {
|
|
11856
|
+
case "Ticket":
|
|
11857
|
+
if (!inTheFuture(cartItem.attributes.time, nowDate)) {
|
|
11858
|
+
return;
|
|
11859
|
+
}
|
|
11860
|
+
items.push(
|
|
11861
|
+
new CartItem(
|
|
11862
|
+
new GomusTicket(cartItem.item.ticketObject, 0, cartItem.item.selectedTime, cartItem.attributes.quantity),
|
|
11863
|
+
cartItem.type
|
|
11864
|
+
)
|
|
11865
|
+
);
|
|
11866
|
+
break;
|
|
11867
|
+
}
|
|
11868
|
+
});
|
|
11869
|
+
return items;
|
|
11870
|
+
}
|
|
11871
|
+
function inTheFuture(time, now2) {
|
|
11872
|
+
const parsed = $fae977aafc393c5c$export$8e384432362ed0f0(time);
|
|
11873
|
+
return now2.compare(parsed) <= 0;
|
|
11874
|
+
}
|
|
11875
|
+
function formatCurrency(priceCents) {
|
|
11876
|
+
if (priceCents === void 0) {
|
|
11877
|
+
return 0;
|
|
11878
|
+
}
|
|
11879
|
+
return new Intl.NumberFormat("de-DE", {
|
|
11880
|
+
style: "currency",
|
|
11881
|
+
currency: "EUR"
|
|
11882
|
+
}).format(priceCents / 100);
|
|
11883
|
+
}
|
|
11884
|
+
const byteToHex = [];
|
|
11885
|
+
for (let i = 0; i < 256; ++i) {
|
|
11886
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
|
11887
|
+
}
|
|
11888
|
+
function unsafeStringify(arr, offset = 0) {
|
|
11889
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
11890
|
+
}
|
|
11891
|
+
let getRandomValues;
|
|
11892
|
+
const rnds8 = new Uint8Array(16);
|
|
11893
|
+
function rng() {
|
|
11894
|
+
if (!getRandomValues) {
|
|
11895
|
+
if (typeof crypto === "undefined" || !crypto.getRandomValues) {
|
|
11896
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
11897
|
+
}
|
|
11898
|
+
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
11899
|
+
}
|
|
11900
|
+
return getRandomValues(rnds8);
|
|
11901
|
+
}
|
|
11902
|
+
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
11903
|
+
const native = { randomUUID };
|
|
11904
|
+
function _v4(options, buf, offset) {
|
|
11905
|
+
var _a2;
|
|
11906
|
+
options = options || {};
|
|
11907
|
+
const rnds = options.random ?? ((_a2 = options.rng) == null ? void 0 : _a2.call(options)) ?? rng();
|
|
11908
|
+
if (rnds.length < 16) {
|
|
11909
|
+
throw new Error("Random bytes length must be >= 16");
|
|
11910
|
+
}
|
|
11911
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
11912
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
11913
|
+
return unsafeStringify(rnds);
|
|
11914
|
+
}
|
|
11915
|
+
function v4(options, buf, offset) {
|
|
11916
|
+
if (native.randomUUID && true && !options) {
|
|
11917
|
+
return native.randomUUID();
|
|
11918
|
+
}
|
|
11919
|
+
return _v4(options);
|
|
11920
|
+
}
|
|
11921
|
+
class CartItem {
|
|
11922
|
+
constructor(ticket, type) {
|
|
11923
|
+
__publicField(this, "type");
|
|
11924
|
+
__publicField(this, "attributes");
|
|
11925
|
+
__publicField(this, "item");
|
|
11926
|
+
__publicField(this, "updatedAt");
|
|
11927
|
+
__publicField(this, "uuid");
|
|
11928
|
+
this.type = type;
|
|
11929
|
+
this.item = ticket;
|
|
11930
|
+
this.attributes = {
|
|
11931
|
+
id: ticket.id,
|
|
11932
|
+
quantity: ticket.quantity,
|
|
11933
|
+
time: ticket.selectedTime
|
|
11934
|
+
};
|
|
11935
|
+
this.updatedAt = $14e0f24ef4ac5c92$export$461939dd4422153($14e0f24ef4ac5c92$export$aa8b41735afcabd2());
|
|
11936
|
+
this.uuid = v4();
|
|
11937
|
+
}
|
|
11938
|
+
updateQuantity(quantity) {
|
|
11939
|
+
this.item.quantity = quantity;
|
|
11940
|
+
this.attributes.quantity = quantity;
|
|
11941
|
+
this.updatedAt = $14e0f24ef4ac5c92$export$461939dd4422153($14e0f24ef4ac5c92$export$aa8b41735afcabd2());
|
|
11942
|
+
}
|
|
11943
|
+
}
|
|
11944
|
+
let Cart$1 = (_b = class {
|
|
11945
|
+
constructor() {
|
|
11946
|
+
__privateAdd(this, _items, /* @__PURE__ */ state(proxy(getCartItems())));
|
|
11947
|
+
__privateAdd(this, _total, /* @__PURE__ */ user_derived(() => formatCurrency(Math.max(0, this.items.reduce((prev, cur) => prev + cur.item.totalPriceCents, 0)))));
|
|
11948
|
+
}
|
|
11949
|
+
get items() {
|
|
11950
|
+
return get(__privateGet(this, _items));
|
|
11951
|
+
}
|
|
11952
|
+
set items(value) {
|
|
11953
|
+
set(__privateGet(this, _items), value, true);
|
|
11954
|
+
}
|
|
11955
|
+
get total() {
|
|
11956
|
+
return get(__privateGet(this, _total));
|
|
11957
|
+
}
|
|
11958
|
+
set total(value) {
|
|
11959
|
+
set(__privateGet(this, _total), value);
|
|
11960
|
+
}
|
|
11961
|
+
deleteItem(item) {
|
|
11962
|
+
if (this.items.length == 0) {
|
|
11963
|
+
return;
|
|
11964
|
+
}
|
|
11965
|
+
const newItems = this.items.filter((i) => item != i);
|
|
11966
|
+
this.items = newItems;
|
|
11967
|
+
this.setLocalStorage();
|
|
11968
|
+
}
|
|
11969
|
+
updateCartItem(item, quantity) {
|
|
11970
|
+
const updated = this.items.map((i) => {
|
|
11971
|
+
debugger;
|
|
11972
|
+
if (i === item) {
|
|
11973
|
+
i.updateQuantity(quantity);
|
|
11974
|
+
return i;
|
|
11975
|
+
} else {
|
|
11976
|
+
return i;
|
|
11977
|
+
}
|
|
11978
|
+
});
|
|
11979
|
+
console.log("quantity: ", updated[0].attributes.quantity);
|
|
11980
|
+
this.items = updated;
|
|
11981
|
+
this.setLocalStorage();
|
|
11982
|
+
}
|
|
11983
|
+
addToCart(items, url) {
|
|
11984
|
+
this.items = this.items.concat(items);
|
|
11985
|
+
this.setLocalStorage();
|
|
11986
|
+
if (url) {
|
|
11987
|
+
window.location.href = url;
|
|
11988
|
+
}
|
|
11989
|
+
}
|
|
11990
|
+
setLocalStorage() {
|
|
11991
|
+
localStorage.setItem("go-cart", JSON.stringify(this.items));
|
|
11992
|
+
}
|
|
11993
|
+
}, _items = new WeakMap(), _total = new WeakMap(), _b);
|
|
11994
|
+
const cart = new Cart$1();
|
|
11995
|
+
class TicketSelectionDetails {
|
|
11996
|
+
constructor() {
|
|
11997
|
+
__privateAdd(this, _mode, /* @__PURE__ */ state());
|
|
11998
|
+
__privateAdd(this, _filters, /* @__PURE__ */ state());
|
|
11999
|
+
__privateAdd(this, _eventId, /* @__PURE__ */ state());
|
|
12000
|
+
__privateAdd(this, _museumIds, /* @__PURE__ */ state());
|
|
12001
|
+
__privateAdd(this, _exhibitionIds, /* @__PURE__ */ state());
|
|
12002
|
+
__privateAdd(this, _ticketIds, /* @__PURE__ */ state());
|
|
12003
|
+
__privateAdd(this, _selectedDate, /* @__PURE__ */ state());
|
|
12004
|
+
__privateAdd(this, _selectedTimeslot, /* @__PURE__ */ state());
|
|
12005
|
+
__privateAdd(this, _selectedTickets, /* @__PURE__ */ state(proxy([])));
|
|
12006
|
+
__privateAdd(this, _ticketList, /* @__PURE__ */ state(proxy([])));
|
|
12007
|
+
__privateAdd(this, _total2, /* @__PURE__ */ user_derived(() => formatCurrency(Math.max(0, this.ticketList.reduce((prev, cur) => prev + cur.totalPriceCents, 0)))));
|
|
12008
|
+
}
|
|
12009
|
+
get mode() {
|
|
12010
|
+
return get(__privateGet(this, _mode));
|
|
12011
|
+
}
|
|
12012
|
+
set mode(value) {
|
|
12013
|
+
set(__privateGet(this, _mode), value, true);
|
|
12014
|
+
}
|
|
12015
|
+
get filters() {
|
|
12016
|
+
return get(__privateGet(this, _filters));
|
|
12017
|
+
}
|
|
12018
|
+
set filters(value) {
|
|
12019
|
+
set(__privateGet(this, _filters), value, true);
|
|
12020
|
+
}
|
|
12021
|
+
get eventId() {
|
|
12022
|
+
return get(__privateGet(this, _eventId));
|
|
12023
|
+
}
|
|
12024
|
+
set eventId(value) {
|
|
12025
|
+
set(__privateGet(this, _eventId), value, true);
|
|
12026
|
+
}
|
|
12027
|
+
get museumIds() {
|
|
12028
|
+
return get(__privateGet(this, _museumIds));
|
|
12029
|
+
}
|
|
12030
|
+
set museumIds(value) {
|
|
12031
|
+
set(__privateGet(this, _museumIds), value, true);
|
|
12032
|
+
}
|
|
12033
|
+
get exhibitionIds() {
|
|
12034
|
+
return get(__privateGet(this, _exhibitionIds));
|
|
11251
12035
|
}
|
|
11252
12036
|
set exhibitionIds(value) {
|
|
11253
12037
|
set(__privateGet(this, _exhibitionIds), value, true);
|
|
@@ -11282,6 +12066,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11282
12066
|
set ticketList(value) {
|
|
11283
12067
|
set(__privateGet(this, _ticketList), value, true);
|
|
11284
12068
|
}
|
|
12069
|
+
get total() {
|
|
12070
|
+
return get(__privateGet(this, _total2));
|
|
12071
|
+
}
|
|
12072
|
+
set total(value) {
|
|
12073
|
+
set(__privateGet(this, _total2), value);
|
|
12074
|
+
}
|
|
11285
12075
|
get selectedClasses() {
|
|
11286
12076
|
return [
|
|
11287
12077
|
this.selectedDate && "is-date-selected",
|
|
@@ -11300,6 +12090,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
11300
12090
|
_selectedTimeslot = new WeakMap();
|
|
11301
12091
|
_selectedTickets = new WeakMap();
|
|
11302
12092
|
_ticketList = new WeakMap();
|
|
12093
|
+
_total2 = new WeakMap();
|
|
11303
12094
|
const KEY = "go-ticket-selection";
|
|
11304
12095
|
const setTicketSelectionDetails = createSetDetails(KEY);
|
|
11305
12096
|
const getTicketSelectionDetails = createGetDetails(KEY);
|
|
@@ -13275,8 +14066,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
13275
14066
|
});
|
|
13276
14067
|
}
|
|
13277
14068
|
handleCellClick(_, date) {
|
|
13278
|
-
var _a2, _b2, _c2,
|
|
13279
|
-
if (this.opts.readonly.current || ((_b2 = (_a2 = this.opts.isDateDisabled).current) == null ? void 0 : _b2.call(_a2, date)) || ((
|
|
14069
|
+
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
14070
|
+
if (this.opts.readonly.current || ((_b2 = (_a2 = this.opts.isDateDisabled).current) == null ? void 0 : _b2.call(_a2, date)) || ((_d2 = (_c2 = this.opts.isDateUnavailable).current) == null ? void 0 : _d2.call(_c2, date))) {
|
|
13280
14071
|
return;
|
|
13281
14072
|
}
|
|
13282
14073
|
const prev = this.opts.value.current;
|
|
@@ -13294,7 +14085,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
13294
14085
|
}
|
|
13295
14086
|
this.opts.value.current = getDateWithPreviousTime(next2, prev);
|
|
13296
14087
|
if (next2 !== void 0) {
|
|
13297
|
-
(_f = (
|
|
14088
|
+
(_f = (_e2 = this.opts.onDateSelect) == null ? void 0 : _e2.current) == null ? void 0 : _f.call(_e2);
|
|
13298
14089
|
}
|
|
13299
14090
|
}
|
|
13300
14091
|
}
|
|
@@ -13903,7 +14694,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
13903
14694
|
};
|
|
13904
14695
|
_props12 = new WeakMap();
|
|
13905
14696
|
let CalendarHeaderState = _CalendarHeaderState;
|
|
13906
|
-
var root_2$
|
|
14697
|
+
var root_2$h = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
13907
14698
|
function Calendar$2($$anchor, $$props) {
|
|
13908
14699
|
push($$props, true);
|
|
13909
14700
|
let child$1 = prop($$props, "child", 7), children = prop($$props, "children", 7), id = prop($$props, "id", 23, useId), ref = prop($$props, "ref", 15, null), value = prop($$props, "value", 15), onValueChange = prop($$props, "onValueChange", 7, noop), placeholder = prop($$props, "placeholder", 15), onPlaceholderChange = prop($$props, "onPlaceholderChange", 7, noop), weekdayFormat = prop($$props, "weekdayFormat", 7, "narrow"), weekStartsOn = prop($$props, "weekStartsOn", 7), pagedNavigation = prop($$props, "pagedNavigation", 7, false), isDateDisabled = prop($$props, "isDateDisabled", 7, () => false), isDateUnavailable = prop($$props, "isDateUnavailable", 7, () => false), fixedWeeks = prop($$props, "fixedWeeks", 7, false), numberOfMonths = prop($$props, "numberOfMonths", 7, 1), locale = prop($$props, "locale", 7), calendarLabel = prop($$props, "calendarLabel", 7, "Event"), disabled = prop($$props, "disabled", 7, false), readonly = prop($$props, "readonly", 7, false), minValue = prop($$props, "minValue", 7, void 0), maxValue = prop($$props, "maxValue", 7, void 0), preventDeselect = prop($$props, "preventDeselect", 7, false), type = prop($$props, "type", 7), disableDaysOutsideMonth = prop($$props, "disableDaysOutsideMonth", 7, true), initialFocus = prop($$props, "initialFocus", 7, false), maxDays = prop($$props, "maxDays", 7), monthFormat = prop($$props, "monthFormat", 7, "long"), yearFormat = prop($$props, "yearFormat", 7, "numeric"), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
@@ -14004,7 +14795,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14004
14795
|
append($$anchor2, fragment_1);
|
|
14005
14796
|
};
|
|
14006
14797
|
var alternate = ($$anchor2) => {
|
|
14007
|
-
var div = root_2$
|
|
14798
|
+
var div = root_2$h();
|
|
14008
14799
|
attribute_effect(div, () => ({ ...get(mergedProps) }));
|
|
14009
14800
|
var node_2 = child(div);
|
|
14010
14801
|
snippet(node_2, () => children() ?? noop$1, () => rootState.snippetProps);
|
|
@@ -14252,7 +15043,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14252
15043
|
[],
|
|
14253
15044
|
true
|
|
14254
15045
|
);
|
|
14255
|
-
var root_2$
|
|
15046
|
+
var root_2$g = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
14256
15047
|
function Calendar_day($$anchor, $$props) {
|
|
14257
15048
|
const uid = props_id();
|
|
14258
15049
|
push($$props, true);
|
|
@@ -14284,7 +15075,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14284
15075
|
append($$anchor2, fragment_1);
|
|
14285
15076
|
};
|
|
14286
15077
|
var alternate_1 = ($$anchor2) => {
|
|
14287
|
-
var div = root_2$
|
|
15078
|
+
var div = root_2$g();
|
|
14288
15079
|
attribute_effect(div, () => ({ ...get(mergedProps) }));
|
|
14289
15080
|
var node_2 = child(div);
|
|
14290
15081
|
{
|
|
@@ -14345,7 +15136,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14345
15136
|
});
|
|
14346
15137
|
}
|
|
14347
15138
|
create_custom_element(Calendar_day, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
14348
|
-
var root_2$
|
|
15139
|
+
var root_2$f = /* @__PURE__ */ from_html(`<table><!></table>`);
|
|
14349
15140
|
function Calendar_grid($$anchor, $$props) {
|
|
14350
15141
|
const uid = props_id();
|
|
14351
15142
|
push($$props, true);
|
|
@@ -14374,7 +15165,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14374
15165
|
append($$anchor2, fragment_1);
|
|
14375
15166
|
};
|
|
14376
15167
|
var alternate = ($$anchor2) => {
|
|
14377
|
-
var table = root_2$
|
|
15168
|
+
var table = root_2$f();
|
|
14378
15169
|
attribute_effect(table, () => ({ ...get(mergedProps) }));
|
|
14379
15170
|
var node_2 = child(table);
|
|
14380
15171
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -14419,7 +15210,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14419
15210
|
});
|
|
14420
15211
|
}
|
|
14421
15212
|
create_custom_element(Calendar_grid, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
14422
|
-
var root_2$
|
|
15213
|
+
var root_2$e = /* @__PURE__ */ from_html(`<tbody><!></tbody>`);
|
|
14423
15214
|
function Calendar_grid_body($$anchor, $$props) {
|
|
14424
15215
|
const uid = props_id();
|
|
14425
15216
|
push($$props, true);
|
|
@@ -14448,7 +15239,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14448
15239
|
append($$anchor2, fragment_1);
|
|
14449
15240
|
};
|
|
14450
15241
|
var alternate = ($$anchor2) => {
|
|
14451
|
-
var tbody = root_2$
|
|
15242
|
+
var tbody = root_2$e();
|
|
14452
15243
|
attribute_effect(tbody, () => ({ ...get(mergedProps) }));
|
|
14453
15244
|
var node_2 = child(tbody);
|
|
14454
15245
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -14493,7 +15284,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14493
15284
|
});
|
|
14494
15285
|
}
|
|
14495
15286
|
create_custom_element(Calendar_grid_body, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
14496
|
-
var root_2$
|
|
15287
|
+
var root_2$d = /* @__PURE__ */ from_html(`<td><!></td>`);
|
|
14497
15288
|
function Calendar_cell($$anchor, $$props) {
|
|
14498
15289
|
const uid = props_id();
|
|
14499
15290
|
push($$props, true);
|
|
@@ -14529,7 +15320,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14529
15320
|
append($$anchor2, fragment_1);
|
|
14530
15321
|
};
|
|
14531
15322
|
var alternate = ($$anchor2) => {
|
|
14532
|
-
var td = root_2$
|
|
15323
|
+
var td = root_2$d();
|
|
14533
15324
|
attribute_effect(td, () => ({ ...get(mergedProps) }));
|
|
14534
15325
|
var node_2 = child(td);
|
|
14535
15326
|
snippet(node_2, () => children() ?? noop$1, () => cellState.snippetProps);
|
|
@@ -14601,7 +15392,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14601
15392
|
[],
|
|
14602
15393
|
true
|
|
14603
15394
|
);
|
|
14604
|
-
var root_2$
|
|
15395
|
+
var root_2$c = /* @__PURE__ */ from_html(`<thead><!></thead>`);
|
|
14605
15396
|
function Calendar_grid_head($$anchor, $$props) {
|
|
14606
15397
|
const uid = props_id();
|
|
14607
15398
|
push($$props, true);
|
|
@@ -14630,7 +15421,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14630
15421
|
append($$anchor2, fragment_1);
|
|
14631
15422
|
};
|
|
14632
15423
|
var alternate = ($$anchor2) => {
|
|
14633
|
-
var thead = root_2$
|
|
15424
|
+
var thead = root_2$c();
|
|
14634
15425
|
attribute_effect(thead, () => ({ ...get(mergedProps) }));
|
|
14635
15426
|
var node_2 = child(thead);
|
|
14636
15427
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -14675,7 +15466,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14675
15466
|
});
|
|
14676
15467
|
}
|
|
14677
15468
|
create_custom_element(Calendar_grid_head, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
14678
|
-
var root_2$
|
|
15469
|
+
var root_2$b = /* @__PURE__ */ from_html(`<th><!></th>`);
|
|
14679
15470
|
function Calendar_head_cell($$anchor, $$props) {
|
|
14680
15471
|
const uid = props_id();
|
|
14681
15472
|
push($$props, true);
|
|
@@ -14704,7 +15495,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14704
15495
|
append($$anchor2, fragment_1);
|
|
14705
15496
|
};
|
|
14706
15497
|
var alternate = ($$anchor2) => {
|
|
14707
|
-
var th = root_2$
|
|
15498
|
+
var th = root_2$b();
|
|
14708
15499
|
attribute_effect(th, () => ({ ...get(mergedProps) }));
|
|
14709
15500
|
var node_2 = child(th);
|
|
14710
15501
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -14749,7 +15540,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14749
15540
|
});
|
|
14750
15541
|
}
|
|
14751
15542
|
create_custom_element(Calendar_head_cell, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
14752
|
-
var root_2$
|
|
15543
|
+
var root_2$a = /* @__PURE__ */ from_html(`<tr><!></tr>`);
|
|
14753
15544
|
function Calendar_grid_row($$anchor, $$props) {
|
|
14754
15545
|
const uid = props_id();
|
|
14755
15546
|
push($$props, true);
|
|
@@ -14778,7 +15569,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14778
15569
|
append($$anchor2, fragment_1);
|
|
14779
15570
|
};
|
|
14780
15571
|
var alternate = ($$anchor2) => {
|
|
14781
|
-
var tr = root_2$
|
|
15572
|
+
var tr = root_2$a();
|
|
14782
15573
|
attribute_effect(tr, () => ({ ...get(mergedProps) }));
|
|
14783
15574
|
var node_2 = child(tr);
|
|
14784
15575
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -14823,7 +15614,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14823
15614
|
});
|
|
14824
15615
|
}
|
|
14825
15616
|
create_custom_element(Calendar_grid_row, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
14826
|
-
var root_2$
|
|
15617
|
+
var root_2$9 = /* @__PURE__ */ from_html(`<header><!></header>`);
|
|
14827
15618
|
function Calendar_header($$anchor, $$props) {
|
|
14828
15619
|
const uid = props_id();
|
|
14829
15620
|
push($$props, true);
|
|
@@ -14852,7 +15643,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14852
15643
|
append($$anchor2, fragment_1);
|
|
14853
15644
|
};
|
|
14854
15645
|
var alternate = ($$anchor2) => {
|
|
14855
|
-
var header = root_2$
|
|
15646
|
+
var header = root_2$9();
|
|
14856
15647
|
attribute_effect(header, () => ({ ...get(mergedProps) }));
|
|
14857
15648
|
var node_2 = child(header);
|
|
14858
15649
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -14897,7 +15688,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14897
15688
|
});
|
|
14898
15689
|
}
|
|
14899
15690
|
create_custom_element(Calendar_header, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
14900
|
-
var root_2$
|
|
15691
|
+
var root_2$8 = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
14901
15692
|
function Calendar_heading($$anchor, $$props) {
|
|
14902
15693
|
const uid = props_id();
|
|
14903
15694
|
push($$props, true);
|
|
@@ -14929,7 +15720,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14929
15720
|
append($$anchor2, fragment_1);
|
|
14930
15721
|
};
|
|
14931
15722
|
var alternate_1 = ($$anchor2) => {
|
|
14932
|
-
var div = root_2$
|
|
15723
|
+
var div = root_2$8();
|
|
14933
15724
|
attribute_effect(div, () => ({ ...get(mergedProps) }));
|
|
14934
15725
|
var node_2 = child(div);
|
|
14935
15726
|
{
|
|
@@ -14990,7 +15781,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
14990
15781
|
});
|
|
14991
15782
|
}
|
|
14992
15783
|
create_custom_element(Calendar_heading, { children: {}, child: {}, ref: {}, id: {} }, [], [], true);
|
|
14993
|
-
var root_2$
|
|
15784
|
+
var root_2$7 = /* @__PURE__ */ from_html(`<button><!></button>`);
|
|
14994
15785
|
function Calendar_next_button($$anchor, $$props) {
|
|
14995
15786
|
const uid = props_id();
|
|
14996
15787
|
push($$props, true);
|
|
@@ -15020,7 +15811,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15020
15811
|
append($$anchor2, fragment_1);
|
|
15021
15812
|
};
|
|
15022
15813
|
var alternate = ($$anchor2) => {
|
|
15023
|
-
var button = root_2$
|
|
15814
|
+
var button = root_2$7();
|
|
15024
15815
|
attribute_effect(button, () => ({ ...get(mergedProps) }));
|
|
15025
15816
|
var node_2 = child(button);
|
|
15026
15817
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -15072,7 +15863,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15072
15863
|
});
|
|
15073
15864
|
}
|
|
15074
15865
|
create_custom_element(Calendar_next_button, { children: {}, child: {}, id: {}, ref: {}, tabindex: {} }, [], [], true);
|
|
15075
|
-
var root_2$
|
|
15866
|
+
var root_2$6 = /* @__PURE__ */ from_html(`<button><!></button>`);
|
|
15076
15867
|
function Calendar_prev_button($$anchor, $$props) {
|
|
15077
15868
|
const uid = props_id();
|
|
15078
15869
|
push($$props, true);
|
|
@@ -15102,7 +15893,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15102
15893
|
append($$anchor2, fragment_1);
|
|
15103
15894
|
};
|
|
15104
15895
|
var alternate = ($$anchor2) => {
|
|
15105
|
-
var button = root_2$
|
|
15896
|
+
var button = root_2$6();
|
|
15106
15897
|
attribute_effect(button, () => ({ ...get(mergedProps) }));
|
|
15107
15898
|
var node_2 = child(button);
|
|
15108
15899
|
snippet(node_2, () => children() ?? noop$1);
|
|
@@ -15154,7 +15945,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15154
15945
|
});
|
|
15155
15946
|
}
|
|
15156
15947
|
create_custom_element(Calendar_prev_button, { children: {}, child: {}, id: {}, ref: {}, tabindex: {} }, [], [], true);
|
|
15157
|
-
|
|
15948
|
+
enable_legacy_mode_flag();
|
|
15949
|
+
let Calendar$1 = (_c = class {
|
|
15158
15950
|
constructor() {
|
|
15159
15951
|
__privateAdd(this, _startAt, /* @__PURE__ */ state(proxy($14e0f24ef4ac5c92$export$d0bdf45af03a6ea3($14e0f24ef4ac5c92$export$aa8b41735afcabd2()))));
|
|
15160
15952
|
__privateAdd(this, _selected, /* @__PURE__ */ state(void 0));
|
|
@@ -15180,19 +15972,19 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15180
15972
|
}
|
|
15181
15973
|
return false;
|
|
15182
15974
|
}
|
|
15183
|
-
}, _startAt = new WeakMap(), _selected = new WeakMap(),
|
|
15975
|
+
}, _startAt = new WeakMap(), _selected = new WeakMap(), _c);
|
|
15184
15976
|
class TicketsCalendar extends Calendar$1 {
|
|
15185
15977
|
constructor() {
|
|
15186
15978
|
super(...arguments);
|
|
15187
15979
|
__privateAdd(this, _details, /* @__PURE__ */ state());
|
|
15188
15980
|
__privateAdd(this, _params, /* @__PURE__ */ user_derived(() => {
|
|
15189
|
-
var _a2, _b2, _c2,
|
|
15981
|
+
var _a2, _b2, _c2, _d2;
|
|
15190
15982
|
return {
|
|
15191
15983
|
by_bookable: true,
|
|
15192
15984
|
"by_ticket_types[]": (_a2 = this.details) == null ? void 0 : _a2.filters,
|
|
15193
15985
|
"by_ticket_ids[]": (_b2 = this.details) == null ? void 0 : _b2.ticketIds,
|
|
15194
15986
|
"by_museum_ids[]": (_c2 = this.details) == null ? void 0 : _c2.museumIds,
|
|
15195
|
-
"by_exhibition_ids[]": (
|
|
15987
|
+
"by_exhibition_ids[]": (_d2 = this.details) == null ? void 0 : _d2.exhibitionIds,
|
|
15196
15988
|
start_at: this.startAt.set({ day: 1 }).toString(),
|
|
15197
15989
|
end_at: this.startAt.add({ months: 1 }).set({ day: 7 }).toString()
|
|
15198
15990
|
};
|
|
@@ -15218,12 +16010,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15218
16010
|
_details = new WeakMap();
|
|
15219
16011
|
_params = new WeakMap();
|
|
15220
16012
|
const ticketsCalendar = new TicketsCalendar();
|
|
15221
|
-
var root_3$
|
|
16013
|
+
var root_3$2 = /* @__PURE__ */ from_html(`<!> <!> <!>`, 1);
|
|
15222
16014
|
var root_11 = /* @__PURE__ */ from_html(`<div> </div>`);
|
|
15223
16015
|
var root_17 = /* @__PURE__ */ from_html(`<div></div> `, 1);
|
|
15224
16016
|
var root_7 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
15225
|
-
var root_2$
|
|
15226
|
-
var root_1$
|
|
16017
|
+
var root_2$5 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
16018
|
+
var root_1$5 = /* @__PURE__ */ from_html(`<div data-calendar-wrapper=""><!></div>`);
|
|
15227
16019
|
function CalendarUI($$anchor, $$props) {
|
|
15228
16020
|
push($$props, true);
|
|
15229
16021
|
let calendarClass = prop($$props, "calendarClass", 7);
|
|
@@ -15235,18 +16027,18 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15235
16027
|
bubbles: true
|
|
15236
16028
|
}));
|
|
15237
16029
|
});
|
|
15238
|
-
var div = root_1$
|
|
16030
|
+
var div = root_1$5();
|
|
15239
16031
|
var node = child(div);
|
|
15240
16032
|
{
|
|
15241
16033
|
const children = ($$anchor2, $$arg0) => {
|
|
15242
16034
|
let months = () => $$arg0 == null ? void 0 : $$arg0().months;
|
|
15243
16035
|
let weekdays = () => $$arg0 == null ? void 0 : $$arg0().weekdays;
|
|
15244
|
-
var fragment = root_2$
|
|
16036
|
+
var fragment = root_2$5();
|
|
15245
16037
|
var node_1 = first_child(fragment);
|
|
15246
16038
|
component(node_1, () => Calendar_header, ($$anchor3, Calendar_Header) => {
|
|
15247
16039
|
Calendar_Header($$anchor3, {
|
|
15248
16040
|
children: ($$anchor4, $$slotProps) => {
|
|
15249
|
-
var fragment_1 = root_3$
|
|
16041
|
+
var fragment_1 = root_3$2();
|
|
15250
16042
|
var node_2 = first_child(fragment_1);
|
|
15251
16043
|
component(node_2, () => Calendar_prev_button, ($$anchor5, Calendar_PrevButton) => {
|
|
15252
16044
|
Calendar_PrevButton($$anchor5, {
|
|
@@ -15435,7 +16227,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15435
16227
|
});
|
|
15436
16228
|
}
|
|
15437
16229
|
create_custom_element(CalendarUI, { calendarClass: {} }, [], ["details"], true);
|
|
15438
|
-
var root$
|
|
16230
|
+
var root$4 = /* @__PURE__ */ from_html(`<div data-calendar-wrapper=""><!></div>`);
|
|
15439
16231
|
function Calendar($$anchor, $$props) {
|
|
15440
16232
|
push($$props, true);
|
|
15441
16233
|
let ticketSelectionDetails = /* @__PURE__ */ state(void 0);
|
|
@@ -15451,7 +16243,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15451
16243
|
if (get(ticketSelectionDetails)) get(ticketSelectionDetails).selectedDate = e.detail.selected;
|
|
15452
16244
|
});
|
|
15453
16245
|
});
|
|
15454
|
-
var div = root$
|
|
16246
|
+
var div = root$4();
|
|
15455
16247
|
var node = child(div);
|
|
15456
16248
|
{
|
|
15457
16249
|
var consequent = ($$anchor2) => {
|
|
@@ -15521,7 +16313,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15521
16313
|
const quotaSlots = filterSlots(ticketSlots, quotas);
|
|
15522
16314
|
return combineSlots(quotaSlots);
|
|
15523
16315
|
}
|
|
15524
|
-
let Details$
|
|
16316
|
+
let Details$2 = (_d = class {
|
|
15525
16317
|
constructor() {
|
|
15526
16318
|
__privateAdd(this, _ticketSelectionDetails, /* @__PURE__ */ state());
|
|
15527
16319
|
}
|
|
@@ -15532,12 +16324,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15532
16324
|
set(__privateGet(this, _ticketSelectionDetails), value, true);
|
|
15533
16325
|
}
|
|
15534
16326
|
get timeslots() {
|
|
15535
|
-
var _a2, _b2, _c2,
|
|
16327
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
15536
16328
|
const date = (_a2 = this.ticketSelectionDetails) == null ? void 0 : _a2.selectedDate;
|
|
15537
16329
|
const ticketTypes = (_b2 = this.ticketSelectionDetails) == null ? void 0 : _b2.filters;
|
|
15538
16330
|
const museumIds = (_c2 = this.ticketSelectionDetails) == null ? void 0 : _c2.museumIds;
|
|
15539
|
-
const exhibitionIds = (
|
|
15540
|
-
const ticketIds = (
|
|
16331
|
+
const exhibitionIds = (_d2 = this.ticketSelectionDetails) == null ? void 0 : _d2.exhibitionIds;
|
|
16332
|
+
const ticketIds = (_e2 = this.ticketSelectionDetails) == null ? void 0 : _e2.ticketIds;
|
|
15541
16333
|
if (!date) return [];
|
|
15542
16334
|
const result = snapshot(shop.ticketsAndQuotas({
|
|
15543
16335
|
by_bookable: true,
|
|
@@ -15546,19 +16338,18 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15546
16338
|
"by_ticket_types[]": ticketTypes,
|
|
15547
16339
|
"by_museum_ids[]": museumIds,
|
|
15548
16340
|
"by_exhibition_ids[]": exhibitionIds,
|
|
15549
|
-
"by_ticket_ids[]": ticketIds
|
|
15550
|
-
locale: shop.locale
|
|
16341
|
+
"by_ticket_ids[]": ticketIds
|
|
15551
16342
|
}));
|
|
15552
16343
|
if (!result) return [];
|
|
15553
16344
|
return generateAvailableTimeSlots(result.tickets, result.quotas);
|
|
15554
16345
|
}
|
|
15555
|
-
}, _ticketSelectionDetails = new WeakMap(),
|
|
15556
|
-
var root_2$
|
|
15557
|
-
var root_1$
|
|
16346
|
+
}, _ticketSelectionDetails = new WeakMap(), _d);
|
|
16347
|
+
var root_2$4 = /* @__PURE__ */ from_html(`<li><label> <input type="radio" name="timeslot"/></label></li>`);
|
|
16348
|
+
var root_1$4 = /* @__PURE__ */ from_html(`<ul data-testid="timeslots" data-go-timeslots=""></ul>`);
|
|
15558
16349
|
function Timeslots($$anchor, $$props) {
|
|
15559
16350
|
push($$props, true);
|
|
15560
16351
|
const binding_group = [];
|
|
15561
|
-
const details = new Details$
|
|
16352
|
+
const details = new Details$2();
|
|
15562
16353
|
onMount(() => {
|
|
15563
16354
|
details.ticketSelectionDetails = getTicketSelectionDetails($$props.$$host);
|
|
15564
16355
|
});
|
|
@@ -15573,9 +16364,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15573
16364
|
var node = first_child(fragment);
|
|
15574
16365
|
{
|
|
15575
16366
|
var consequent = ($$anchor2) => {
|
|
15576
|
-
var ul = root_1$
|
|
16367
|
+
var ul = root_1$4();
|
|
15577
16368
|
each(ul, 20, () => details.timeslots, (timeslot) => timeslot, ($$anchor3, timeslot) => {
|
|
15578
|
-
var li = root_2$
|
|
16369
|
+
var li = root_2$4();
|
|
15579
16370
|
var label = child(li);
|
|
15580
16371
|
var text2 = child(label);
|
|
15581
16372
|
var input = sibling(text2);
|
|
@@ -15616,8 +16407,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15616
16407
|
}
|
|
15617
16408
|
delegate(["change"]);
|
|
15618
16409
|
customElements.define("go-timeslots", create_custom_element(Timeslots, {}, [], ["details"], false));
|
|
15619
|
-
var root_2$
|
|
15620
|
-
var root = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
16410
|
+
var root_2$3 = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
16411
|
+
var root$3 = /* @__PURE__ */ from_html(`<!> <!>`, 1);
|
|
15621
16412
|
function Wrapper($$anchor, $$props) {
|
|
15622
16413
|
push($$props, true);
|
|
15623
16414
|
let host = prop($$props, "host", 7), children = prop($$props, "children", 7), restProps = /* @__PURE__ */ rest_props($$props, [
|
|
@@ -15633,7 +16424,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15633
16424
|
host().setAttribute(prop2, restProps[prop2]);
|
|
15634
16425
|
}
|
|
15635
16426
|
}
|
|
15636
|
-
var fragment = root();
|
|
16427
|
+
var fragment = root$3();
|
|
15637
16428
|
var node = first_child(fragment);
|
|
15638
16429
|
{
|
|
15639
16430
|
var consequent = ($$anchor2) => {
|
|
@@ -15649,7 +16440,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15649
16440
|
var node_2 = sibling(node, 2);
|
|
15650
16441
|
{
|
|
15651
16442
|
var consequent_1 = ($$anchor2) => {
|
|
15652
|
-
var div = root_2$
|
|
16443
|
+
var div = root_2$3();
|
|
15653
16444
|
attribute_effect(div, () => ({ ...restProps }));
|
|
15654
16445
|
var node_3 = child(div);
|
|
15655
16446
|
snippet(node_3, children);
|
|
@@ -15777,17 +16568,17 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15777
16568
|
{
|
|
15778
16569
|
mode: { attribute: "mode", reflect: true, type: "String" },
|
|
15779
16570
|
eventId: { attribute: "event-id", reflect: true, type: "Number" },
|
|
16571
|
+
ticketIds: { attribute: "ticket-ids", reflect: true, type: "String" },
|
|
15780
16572
|
filter: {},
|
|
15781
16573
|
children: {},
|
|
15782
16574
|
museumIds: {},
|
|
15783
|
-
exhibitionIds: {}
|
|
15784
|
-
ticketIds: {}
|
|
16575
|
+
exhibitionIds: {}
|
|
15785
16576
|
},
|
|
15786
16577
|
[],
|
|
15787
16578
|
["details"],
|
|
15788
16579
|
false
|
|
15789
16580
|
));
|
|
15790
|
-
|
|
16581
|
+
let Details$1 = (_e = class {
|
|
15791
16582
|
constructor() {
|
|
15792
16583
|
__privateAdd(this, _ticketSelectionDetails2, /* @__PURE__ */ state());
|
|
15793
16584
|
}
|
|
@@ -15798,13 +16589,13 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15798
16589
|
set(__privateGet(this, _ticketSelectionDetails2), value, true);
|
|
15799
16590
|
}
|
|
15800
16591
|
get tickets() {
|
|
15801
|
-
var _a2, _b2, _c2,
|
|
16592
|
+
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
15802
16593
|
const date = (_a2 = this.ticketSelectionDetails) == null ? void 0 : _a2.selectedDate;
|
|
15803
16594
|
const ticketTypes = (_b2 = this.ticketSelectionDetails) == null ? void 0 : _b2.filters;
|
|
15804
16595
|
const museumIds = (_c2 = this.ticketSelectionDetails) == null ? void 0 : _c2.museumIds;
|
|
15805
|
-
const exhibitionIds = (
|
|
15806
|
-
const ticketIds = (
|
|
15807
|
-
if (!date &&
|
|
16596
|
+
const exhibitionIds = (_d2 = this.ticketSelectionDetails) == null ? void 0 : _d2.exhibitionIds;
|
|
16597
|
+
const ticketIds = (_e2 = this.ticketSelectionDetails) == null ? void 0 : _e2.ticketIds;
|
|
16598
|
+
if (!date && !((_f = this.ticketSelectionDetails) == null ? void 0 : _f.selectedTimeslot) && (ticketTypes == null ? void 0 : ticketTypes.includes("time_slot"))) return [];
|
|
15808
16599
|
const result = snapshot(shop.ticketsAndQuotas({
|
|
15809
16600
|
by_bookable: true,
|
|
15810
16601
|
valid_at: date == null ? void 0 : date.toString(),
|
|
@@ -15812,8 +16603,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15812
16603
|
"by_ticket_types[]": ticketTypes,
|
|
15813
16604
|
"by_museum_ids[]": museumIds,
|
|
15814
16605
|
"by_exhibition_ids[]": exhibitionIds,
|
|
15815
|
-
"by_ticket_ids[]": ticketIds
|
|
15816
|
-
locale: shop.locale
|
|
16606
|
+
"by_ticket_ids[]": ticketIds
|
|
15817
16607
|
}));
|
|
15818
16608
|
if (!result) return [];
|
|
15819
16609
|
return initGomusTickets(result.tickets);
|
|
@@ -15827,27 +16617,37 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15827
16617
|
by_bookable: true,
|
|
15828
16618
|
// @ts-ignore
|
|
15829
16619
|
"by_ticket_types[]": ticketTypes,
|
|
15830
|
-
"by_ticket_ids[]": ticketIds
|
|
15831
|
-
locale: shop.locale
|
|
16620
|
+
"by_ticket_ids[]": ticketIds
|
|
15832
16621
|
}));
|
|
15833
16622
|
if (!result) return [];
|
|
15834
16623
|
return initAnnualTickets(result.tickets);
|
|
15835
16624
|
}
|
|
15836
|
-
|
|
15837
|
-
|
|
15838
|
-
|
|
15839
|
-
|
|
16625
|
+
updateSelectedTickets(ticket, quantity) {
|
|
16626
|
+
var _a2, _b2, _c2;
|
|
16627
|
+
const index2 = this.tickets.findIndex((t) => t.id == ticket.id);
|
|
16628
|
+
const duplicate = this.tickets[index2];
|
|
16629
|
+
duplicate.quantity = quantity;
|
|
16630
|
+
if (ticket.type == "time_slot") {
|
|
16631
|
+
duplicate.selectedTime = ((_a2 = this.ticketSelectionDetails) == null ? void 0 : _a2.selectedTimeslot) || "";
|
|
16632
|
+
} else if (ticket.type == "normal") {
|
|
16633
|
+
duplicate.selectedTime = $11d87f3f76e88657$export$84c95a83c799e074((_b2 = this.ticketSelectionDetails) == null ? void 0 : _b2.selectedDate, "Europe/Berlin").toString().slice(0, -15);
|
|
16634
|
+
}
|
|
16635
|
+
this.ticketSelectionDetails.ticketList = (_c2 = this.ticketSelectionDetails) == null ? void 0 : _c2.ticketList.concat(duplicate);
|
|
16636
|
+
}
|
|
16637
|
+
}, _ticketSelectionDetails2 = new WeakMap(), _e);
|
|
16638
|
+
var root_2$2 = /* @__PURE__ */ from_html(`<option> </option>`);
|
|
16639
|
+
var root_1$3 = /* @__PURE__ */ from_html(`<tr><td><select></select></td><td><p> </p> <!></td><td> </td></tr>`);
|
|
15840
16640
|
function Annual($$anchor, $$props) {
|
|
15841
16641
|
push($$props, true);
|
|
15842
16642
|
let details = prop($$props, "details", 7);
|
|
15843
16643
|
var fragment = comment();
|
|
15844
16644
|
var node = first_child(fragment);
|
|
15845
16645
|
each(node, 16, () => Object.values(details().annualTickets), (ticket) => ticket, ($$anchor2, ticket) => {
|
|
15846
|
-
var tr = root_1$
|
|
16646
|
+
var tr = root_1$3();
|
|
15847
16647
|
var td = child(tr);
|
|
15848
16648
|
var select = child(td);
|
|
15849
16649
|
each(select, 21, () => ticket.quantityOptions, index, ($$anchor3, quantity) => {
|
|
15850
|
-
var option = root_2$
|
|
16650
|
+
var option = root_2$2();
|
|
15851
16651
|
var text2 = child(option, true);
|
|
15852
16652
|
reset(option);
|
|
15853
16653
|
var option_value = {};
|
|
@@ -15895,8 +16695,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15895
16695
|
});
|
|
15896
16696
|
}
|
|
15897
16697
|
create_custom_element(Annual, { details: {} }, [], [], true);
|
|
15898
|
-
var
|
|
15899
|
-
|
|
16698
|
+
var on_change = (e, details, ticket) => {
|
|
16699
|
+
var _a2;
|
|
16700
|
+
return details().updateSelectedTickets(ticket, parseInt((_a2 = e == null ? void 0 : e.target) == null ? void 0 : _a2.value));
|
|
16701
|
+
};
|
|
16702
|
+
var root_3$1 = /* @__PURE__ */ from_html(`<option> </option>`);
|
|
16703
|
+
var root_2$1 = /* @__PURE__ */ from_html(`<tr><td><select></select></td><td><p> </p> <!></td><td> </td></tr>`);
|
|
15900
16704
|
function Timeslot($$anchor, $$props) {
|
|
15901
16705
|
push($$props, true);
|
|
15902
16706
|
let details = prop($$props, "details", 7);
|
|
@@ -15915,12 +16719,13 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15915
16719
|
var node_1 = first_child(fragment_1);
|
|
15916
16720
|
{
|
|
15917
16721
|
var consequent = ($$anchor3) => {
|
|
15918
|
-
var tr = root_2();
|
|
16722
|
+
var tr = root_2$1();
|
|
15919
16723
|
let classes;
|
|
15920
16724
|
var td = child(tr);
|
|
15921
16725
|
var select = child(td);
|
|
16726
|
+
select.__change = [on_change, details, ticket];
|
|
15922
16727
|
each(select, 21, () => ticket.quantityOptions, index, ($$anchor4, quantity) => {
|
|
15923
|
-
var option = root_3();
|
|
16728
|
+
var option = root_3$1();
|
|
15924
16729
|
var text2 = child(option, true);
|
|
15925
16730
|
reset(option);
|
|
15926
16731
|
var option_value = {};
|
|
@@ -15977,11 +16782,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15977
16782
|
}
|
|
15978
16783
|
});
|
|
15979
16784
|
}
|
|
16785
|
+
delegate(["change"]);
|
|
15980
16786
|
create_custom_element(Timeslot, { details: {} }, [], [], true);
|
|
15981
|
-
var root_1 = /* @__PURE__ */ from_html(`<table><thead><tr><th scope="col">Quantity</th><th scope="col">Ticket</th><th scope="col">Price</th></tr></thead><tbody><!></tbody></table>`);
|
|
16787
|
+
var root_1$2 = /* @__PURE__ */ from_html(`<table><thead><tr><th scope="col">Quantity</th><th scope="col">Ticket</th><th scope="col">Price</th></tr></thead><tbody><!></tbody></table>`);
|
|
15982
16788
|
function Tickets($$anchor, $$props) {
|
|
15983
16789
|
push($$props, true);
|
|
15984
|
-
const details = new Details();
|
|
16790
|
+
const details = new Details$1();
|
|
15985
16791
|
onMount(() => {
|
|
15986
16792
|
details.ticketSelectionDetails = getTicketSelectionDetails($$props.$$host);
|
|
15987
16793
|
});
|
|
@@ -15989,7 +16795,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
15989
16795
|
var node = first_child(fragment);
|
|
15990
16796
|
{
|
|
15991
16797
|
var consequent_1 = ($$anchor2) => {
|
|
15992
|
-
var table = root_1();
|
|
16798
|
+
var table = root_1$2();
|
|
15993
16799
|
var tbody = sibling(child(table));
|
|
15994
16800
|
var node_1 = child(tbody);
|
|
15995
16801
|
{
|
|
@@ -16018,11 +16824,222 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
16018
16824
|
append($$anchor2, table);
|
|
16019
16825
|
};
|
|
16020
16826
|
if_block(node, ($$render) => {
|
|
16021
|
-
|
|
16827
|
+
var _a2;
|
|
16828
|
+
if (details.ticketSelectionDetails && details.ticketSelectionDetails.selectedTimeslot || ((_a2 = details.ticketSelectionDetails) == null ? void 0 : _a2.selectedDate)) $$render(consequent_1);
|
|
16022
16829
|
});
|
|
16023
16830
|
}
|
|
16024
16831
|
append($$anchor, fragment);
|
|
16025
16832
|
return pop({ details });
|
|
16026
16833
|
}
|
|
16027
16834
|
customElements.define("go-tickets", create_custom_element(Tickets, {}, [], ["details"], false));
|
|
16835
|
+
var root_2 = /* @__PURE__ */ from_html(`<span> </span>`);
|
|
16836
|
+
var root_1$1 = /* @__PURE__ */ from_html(`<span> </span> <!>`, 1);
|
|
16837
|
+
var on_click = (_, cartItem) => cart.deleteItem(cartItem());
|
|
16838
|
+
var root_3 = /* @__PURE__ */ from_html(`<button>x</button>`);
|
|
16839
|
+
var root$2 = /* @__PURE__ */ from_html(`<tr><td><p> <!></p></td><td> </td><td><div><input readonly=""/></div></td><td><!></td><td> </td></tr>`);
|
|
16840
|
+
function Ticket($$anchor, $$props) {
|
|
16841
|
+
push($$props, true);
|
|
16842
|
+
let cartItem = prop($$props, "cartItem", 7), readonly = prop($$props, "readonly", 7, false);
|
|
16843
|
+
var tr = root$2();
|
|
16844
|
+
var td = child(tr);
|
|
16845
|
+
var p = child(td);
|
|
16846
|
+
var text2 = child(p);
|
|
16847
|
+
var node = sibling(text2);
|
|
16848
|
+
{
|
|
16849
|
+
var consequent_1 = ($$anchor2) => {
|
|
16850
|
+
var fragment = root_1$1();
|
|
16851
|
+
var span = first_child(fragment);
|
|
16852
|
+
var text_1 = child(span, true);
|
|
16853
|
+
reset(span);
|
|
16854
|
+
var node_1 = sibling(span, 2);
|
|
16855
|
+
{
|
|
16856
|
+
var consequent = ($$anchor3) => {
|
|
16857
|
+
var span_1 = root_2();
|
|
16858
|
+
var text_2 = child(span_1, true);
|
|
16859
|
+
reset(span_1);
|
|
16860
|
+
template_effect(($0) => set_text(text_2, $0), [() => formatTime(cartItem().attributes.time)]);
|
|
16861
|
+
append($$anchor3, span_1);
|
|
16862
|
+
};
|
|
16863
|
+
if_block(node_1, ($$render) => {
|
|
16864
|
+
if (cartItem().item.type == "time_slot") $$render(consequent);
|
|
16865
|
+
});
|
|
16866
|
+
}
|
|
16867
|
+
template_effect(($0) => set_text(text_1, $0), [
|
|
16868
|
+
() => formatDate(cartItem().attributes.time, { month: "numeric", day: "numeric" }, shop.locale)
|
|
16869
|
+
]);
|
|
16870
|
+
append($$anchor2, fragment);
|
|
16871
|
+
};
|
|
16872
|
+
if_block(node, ($$render) => {
|
|
16873
|
+
if (cartItem().attributes.time) $$render(consequent_1);
|
|
16874
|
+
});
|
|
16875
|
+
}
|
|
16876
|
+
reset(p);
|
|
16877
|
+
reset(td);
|
|
16878
|
+
var td_1 = sibling(td);
|
|
16879
|
+
var text_3 = child(td_1, true);
|
|
16880
|
+
reset(td_1);
|
|
16881
|
+
var td_2 = sibling(td_1);
|
|
16882
|
+
var div = child(td_2);
|
|
16883
|
+
var input = child(div);
|
|
16884
|
+
remove_input_defaults(input);
|
|
16885
|
+
reset(div);
|
|
16886
|
+
reset(td_2);
|
|
16887
|
+
var td_3 = sibling(td_2);
|
|
16888
|
+
var node_2 = child(td_3);
|
|
16889
|
+
{
|
|
16890
|
+
var consequent_2 = ($$anchor2) => {
|
|
16891
|
+
var button = root_3();
|
|
16892
|
+
button.__click = [on_click, cartItem];
|
|
16893
|
+
append($$anchor2, button);
|
|
16894
|
+
};
|
|
16895
|
+
if_block(node_2, ($$render) => {
|
|
16896
|
+
if (!readonly()) $$render(consequent_2);
|
|
16897
|
+
});
|
|
16898
|
+
}
|
|
16899
|
+
reset(td_3);
|
|
16900
|
+
var td_4 = sibling(td_3);
|
|
16901
|
+
var text_4 = child(td_4, true);
|
|
16902
|
+
reset(td_4);
|
|
16903
|
+
reset(tr);
|
|
16904
|
+
template_effect(() => {
|
|
16905
|
+
set_text(text2, `${cartItem().item.title ?? ""} `);
|
|
16906
|
+
set_text(text_3, cartItem().item.priceFormatted);
|
|
16907
|
+
set_value(input, cartItem().attributes.quantity);
|
|
16908
|
+
set_text(text_4, cartItem().item.totalPriceFormatted);
|
|
16909
|
+
});
|
|
16910
|
+
append($$anchor, tr);
|
|
16911
|
+
return pop({
|
|
16912
|
+
get cartItem() {
|
|
16913
|
+
return cartItem();
|
|
16914
|
+
},
|
|
16915
|
+
set cartItem($$value) {
|
|
16916
|
+
cartItem($$value);
|
|
16917
|
+
flushSync();
|
|
16918
|
+
},
|
|
16919
|
+
get readonly() {
|
|
16920
|
+
return readonly();
|
|
16921
|
+
},
|
|
16922
|
+
set readonly($$value = false) {
|
|
16923
|
+
readonly($$value);
|
|
16924
|
+
flushSync();
|
|
16925
|
+
}
|
|
16926
|
+
});
|
|
16927
|
+
}
|
|
16928
|
+
delegate(["click"]);
|
|
16929
|
+
create_custom_element(Ticket, { cartItem: {}, readonly: {} }, [], [], true);
|
|
16930
|
+
var root_1 = /* @__PURE__ */ from_html(`<table><thead><tr><th>Artikel</th><th>Preis</th><th>Anzahl</th><th></th><th>Gesamt</th></tr></thead><tbody></tbody><tfoot><tr><td colspan="3"></td><td>Total</td><td> </td></tr></tfoot></table>`);
|
|
16931
|
+
var root_4 = /* @__PURE__ */ from_html(`<div></div>`);
|
|
16932
|
+
var root$1 = /* @__PURE__ */ from_html(`<div><!></div>`);
|
|
16933
|
+
function Cart($$anchor, $$props) {
|
|
16934
|
+
push($$props, false);
|
|
16935
|
+
init();
|
|
16936
|
+
var div = root$1();
|
|
16937
|
+
var node = child(div);
|
|
16938
|
+
{
|
|
16939
|
+
var consequent_1 = ($$anchor2) => {
|
|
16940
|
+
var table = root_1();
|
|
16941
|
+
var tbody = sibling(child(table));
|
|
16942
|
+
each(tbody, 5, () => cart.items, (cartItem) => cartItem.uuid, ($$anchor3, cartItem) => {
|
|
16943
|
+
var fragment = comment();
|
|
16944
|
+
var node_1 = first_child(fragment);
|
|
16945
|
+
{
|
|
16946
|
+
var consequent = ($$anchor4) => {
|
|
16947
|
+
Ticket($$anchor4, {
|
|
16948
|
+
get cartItem() {
|
|
16949
|
+
return get(cartItem);
|
|
16950
|
+
}
|
|
16951
|
+
});
|
|
16952
|
+
};
|
|
16953
|
+
if_block(node_1, ($$render) => {
|
|
16954
|
+
if (get(cartItem).type === "Ticket") $$render(consequent);
|
|
16955
|
+
});
|
|
16956
|
+
}
|
|
16957
|
+
append($$anchor3, fragment);
|
|
16958
|
+
});
|
|
16959
|
+
reset(tbody);
|
|
16960
|
+
var tfoot = sibling(tbody);
|
|
16961
|
+
var tr = child(tfoot);
|
|
16962
|
+
var td = sibling(child(tr), 2);
|
|
16963
|
+
var text2 = child(td, true);
|
|
16964
|
+
reset(td);
|
|
16965
|
+
reset(tr);
|
|
16966
|
+
reset(tfoot);
|
|
16967
|
+
reset(table);
|
|
16968
|
+
template_effect(() => set_text(text2, cart.total));
|
|
16969
|
+
append($$anchor2, table);
|
|
16970
|
+
};
|
|
16971
|
+
var alternate = ($$anchor2) => {
|
|
16972
|
+
var div_1 = root_4();
|
|
16973
|
+
append($$anchor2, div_1);
|
|
16974
|
+
};
|
|
16975
|
+
if_block(node, ($$render) => {
|
|
16976
|
+
if (cart.items.length > 0) $$render(consequent_1);
|
|
16977
|
+
else $$render(alternate, false);
|
|
16978
|
+
});
|
|
16979
|
+
}
|
|
16980
|
+
reset(div);
|
|
16981
|
+
append($$anchor, div);
|
|
16982
|
+
pop();
|
|
16983
|
+
}
|
|
16984
|
+
customElements.define("go-cart", create_custom_element(Cart, {}, [], [], false));
|
|
16985
|
+
class Details {
|
|
16986
|
+
constructor() {
|
|
16987
|
+
__privateAdd(this, _ticketSelectionDetails3, /* @__PURE__ */ state());
|
|
16988
|
+
}
|
|
16989
|
+
get ticketSelectionDetails() {
|
|
16990
|
+
return get(__privateGet(this, _ticketSelectionDetails3));
|
|
16991
|
+
}
|
|
16992
|
+
set ticketSelectionDetails(value) {
|
|
16993
|
+
set(__privateGet(this, _ticketSelectionDetails3), value, true);
|
|
16994
|
+
}
|
|
16995
|
+
addToCart(cart2, url = void 0) {
|
|
16996
|
+
var _a2;
|
|
16997
|
+
if (!cart2) {
|
|
16998
|
+
console.error("cart not found");
|
|
16999
|
+
return;
|
|
17000
|
+
}
|
|
17001
|
+
const items = ((_a2 = this.ticketSelectionDetails) == null ? void 0 : _a2.ticketList.map((t) => new CartItem(t, "Ticket"))) || [];
|
|
17002
|
+
cart2.addToCart(items, url);
|
|
17003
|
+
this.ticketSelectionDetails.ticketList = [];
|
|
17004
|
+
}
|
|
17005
|
+
}
|
|
17006
|
+
_ticketSelectionDetails3 = new WeakMap();
|
|
17007
|
+
var root = /* @__PURE__ */ from_html(`<div><button> </button></div>`);
|
|
17008
|
+
function CheckoutButton($$anchor, $$props) {
|
|
17009
|
+
push($$props, true);
|
|
17010
|
+
let url = prop($$props, "url", 7), text2 = prop($$props, "text", 7, "");
|
|
17011
|
+
const details = new Details();
|
|
17012
|
+
details.ticketSelectionDetails = getTicketSelectionDetails($$props.$$host);
|
|
17013
|
+
var div = root();
|
|
17014
|
+
var button = child(div);
|
|
17015
|
+
button.__click = () => details.addToCart(cart, url());
|
|
17016
|
+
var text_1 = child(button, true);
|
|
17017
|
+
reset(button);
|
|
17018
|
+
reset(div);
|
|
17019
|
+
template_effect(() => {
|
|
17020
|
+
var _a2;
|
|
17021
|
+
button.disabled = ((_a2 = details.ticketSelectionDetails) == null ? void 0 : _a2.ticketList) && details.ticketSelectionDetails.ticketList.length == 0;
|
|
17022
|
+
set_text(text_1, text2());
|
|
17023
|
+
});
|
|
17024
|
+
append($$anchor, div);
|
|
17025
|
+
return pop({
|
|
17026
|
+
details,
|
|
17027
|
+
get url() {
|
|
17028
|
+
return url();
|
|
17029
|
+
},
|
|
17030
|
+
set url($$value) {
|
|
17031
|
+
url($$value);
|
|
17032
|
+
flushSync();
|
|
17033
|
+
},
|
|
17034
|
+
get text() {
|
|
17035
|
+
return text2();
|
|
17036
|
+
},
|
|
17037
|
+
set text($$value = "") {
|
|
17038
|
+
text2($$value);
|
|
17039
|
+
flushSync();
|
|
17040
|
+
}
|
|
17041
|
+
});
|
|
17042
|
+
}
|
|
17043
|
+
delegate(["click"]);
|
|
17044
|
+
customElements.define("go-checkout-button", create_custom_element(CheckoutButton, { url: {}, text: {} }, [], ["details"], false));
|
|
16028
17045
|
})();
|