@everymatrix/player-account-modal 0.0.188 → 0.0.192

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.
@@ -1,847 +1,2 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
- typeof define === 'function' && define.amd ? define(factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.app = factory());
5
- }(this, (function () { 'use strict';
6
-
7
- function noop() { }
8
- const identity = x => x;
9
- function add_location(element, file, line, column, char) {
10
- element.__svelte_meta = {
11
- loc: { file, line, column, char }
12
- };
13
- }
14
- function run(fn) {
15
- return fn();
16
- }
17
- function blank_object() {
18
- return Object.create(null);
19
- }
20
- function run_all(fns) {
21
- fns.forEach(run);
22
- }
23
- function is_function(thing) {
24
- return typeof thing === 'function';
25
- }
26
- function safe_not_equal(a, b) {
27
- return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
28
- }
29
- function is_empty(obj) {
30
- return Object.keys(obj).length === 0;
31
- }
32
-
33
- const is_client = typeof window !== 'undefined';
34
- let now = is_client
35
- ? () => window.performance.now()
36
- : () => Date.now();
37
- let raf = is_client ? cb => requestAnimationFrame(cb) : noop;
38
-
39
- const tasks = new Set();
40
- function run_tasks(now) {
41
- tasks.forEach(task => {
42
- if (!task.c(now)) {
43
- tasks.delete(task);
44
- task.f();
45
- }
46
- });
47
- if (tasks.size !== 0)
48
- raf(run_tasks);
49
- }
50
- /**
51
- * Creates a new task that runs on each raf frame
52
- * until it returns a falsy value or is aborted
53
- */
54
- function loop(callback) {
55
- let task;
56
- if (tasks.size === 0)
57
- raf(run_tasks);
58
- return {
59
- promise: new Promise(fulfill => {
60
- tasks.add(task = { c: callback, f: fulfill });
61
- }),
62
- abort() {
63
- tasks.delete(task);
64
- }
65
- };
66
- }
67
-
68
- function append(target, node) {
69
- target.appendChild(node);
70
- }
71
- function insert(target, node, anchor) {
72
- target.insertBefore(node, anchor || null);
73
- }
74
- function detach(node) {
75
- node.parentNode.removeChild(node);
76
- }
77
- function element(name) {
78
- return document.createElement(name);
79
- }
80
- function attr(node, attribute, value) {
81
- if (value == null)
82
- node.removeAttribute(attribute);
83
- else if (node.getAttribute(attribute) !== value)
84
- node.setAttribute(attribute, value);
85
- }
86
- function children(element) {
87
- return Array.from(element.childNodes);
88
- }
89
- function custom_event(type, detail) {
90
- const e = document.createEvent('CustomEvent');
91
- e.initCustomEvent(type, false, false, detail);
92
- return e;
93
- }
94
- function attribute_to_object(attributes) {
95
- const result = {};
96
- for (const attribute of attributes) {
97
- result[attribute.name] = attribute.value;
98
- }
99
- return result;
100
- }
101
-
102
- const active_docs = new Set();
103
- let active = 0;
104
- // https://github.com/darkskyapp/string-hash/blob/master/index.js
105
- function hash(str) {
106
- let hash = 5381;
107
- let i = str.length;
108
- while (i--)
109
- hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
110
- return hash >>> 0;
111
- }
112
- function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {
113
- const step = 16.666 / duration;
114
- let keyframes = '{\n';
115
- for (let p = 0; p <= 1; p += step) {
116
- const t = a + (b - a) * ease(p);
117
- keyframes += p * 100 + `%{${fn(t, 1 - t)}}\n`;
118
- }
119
- const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`;
120
- const name = `__svelte_${hash(rule)}_${uid}`;
121
- const doc = node.ownerDocument;
122
- active_docs.add(doc);
123
- const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = doc.head.appendChild(element('style')).sheet);
124
- const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {});
125
- if (!current_rules[name]) {
126
- current_rules[name] = true;
127
- stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);
128
- }
129
- const animation = node.style.animation || '';
130
- node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`;
131
- active += 1;
132
- return name;
133
- }
134
- function delete_rule(node, name) {
135
- const previous = (node.style.animation || '').split(', ');
136
- const next = previous.filter(name
137
- ? anim => anim.indexOf(name) < 0 // remove specific animation
138
- : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations
139
- );
140
- const deleted = previous.length - next.length;
141
- if (deleted) {
142
- node.style.animation = next.join(', ');
143
- active -= deleted;
144
- if (!active)
145
- clear_rules();
146
- }
147
- }
148
- function clear_rules() {
149
- raf(() => {
150
- if (active)
151
- return;
152
- active_docs.forEach(doc => {
153
- const stylesheet = doc.__svelte_stylesheet;
154
- let i = stylesheet.cssRules.length;
155
- while (i--)
156
- stylesheet.deleteRule(i);
157
- doc.__svelte_rules = {};
158
- });
159
- active_docs.clear();
160
- });
161
- }
162
-
163
- let current_component;
164
- function set_current_component(component) {
165
- current_component = component;
166
- }
167
- function get_current_component() {
168
- if (!current_component)
169
- throw new Error('Function called outside component initialization');
170
- return current_component;
171
- }
172
- function onMount(fn) {
173
- get_current_component().$$.on_mount.push(fn);
174
- }
175
-
176
- const dirty_components = [];
177
- const binding_callbacks = [];
178
- const render_callbacks = [];
179
- const flush_callbacks = [];
180
- const resolved_promise = Promise.resolve();
181
- let update_scheduled = false;
182
- function schedule_update() {
183
- if (!update_scheduled) {
184
- update_scheduled = true;
185
- resolved_promise.then(flush);
186
- }
187
- }
188
- function add_render_callback(fn) {
189
- render_callbacks.push(fn);
190
- }
191
- let flushing = false;
192
- const seen_callbacks = new Set();
193
- function flush() {
194
- if (flushing)
195
- return;
196
- flushing = true;
197
- do {
198
- // first, call beforeUpdate functions
199
- // and update components
200
- for (let i = 0; i < dirty_components.length; i += 1) {
201
- const component = dirty_components[i];
202
- set_current_component(component);
203
- update(component.$$);
204
- }
205
- set_current_component(null);
206
- dirty_components.length = 0;
207
- while (binding_callbacks.length)
208
- binding_callbacks.pop()();
209
- // then, once components are updated, call
210
- // afterUpdate functions. This may cause
211
- // subsequent updates...
212
- for (let i = 0; i < render_callbacks.length; i += 1) {
213
- const callback = render_callbacks[i];
214
- if (!seen_callbacks.has(callback)) {
215
- // ...so guard against infinite loops
216
- seen_callbacks.add(callback);
217
- callback();
218
- }
219
- }
220
- render_callbacks.length = 0;
221
- } while (dirty_components.length);
222
- while (flush_callbacks.length) {
223
- flush_callbacks.pop()();
224
- }
225
- update_scheduled = false;
226
- flushing = false;
227
- seen_callbacks.clear();
228
- }
229
- function update($$) {
230
- if ($$.fragment !== null) {
231
- $$.update();
232
- run_all($$.before_update);
233
- const dirty = $$.dirty;
234
- $$.dirty = [-1];
235
- $$.fragment && $$.fragment.p($$.ctx, dirty);
236
- $$.after_update.forEach(add_render_callback);
237
- }
238
- }
239
-
240
- let promise;
241
- function wait() {
242
- if (!promise) {
243
- promise = Promise.resolve();
244
- promise.then(() => {
245
- promise = null;
246
- });
247
- }
248
- return promise;
249
- }
250
- function dispatch(node, direction, kind) {
251
- node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));
252
- }
253
- const outroing = new Set();
254
- let outros;
255
- function group_outros() {
256
- outros = {
257
- r: 0,
258
- c: [],
259
- p: outros // parent group
260
- };
261
- }
262
- function check_outros() {
263
- if (!outros.r) {
264
- run_all(outros.c);
265
- }
266
- outros = outros.p;
267
- }
268
- function transition_in(block, local) {
269
- if (block && block.i) {
270
- outroing.delete(block);
271
- block.i(local);
272
- }
273
- }
274
- function transition_out(block, local, detach, callback) {
275
- if (block && block.o) {
276
- if (outroing.has(block))
277
- return;
278
- outroing.add(block);
279
- outros.c.push(() => {
280
- outroing.delete(block);
281
- if (callback) {
282
- if (detach)
283
- block.d(1);
284
- callback();
285
- }
286
- });
287
- block.o(local);
288
- }
289
- }
290
- const null_transition = { duration: 0 };
291
- function create_bidirectional_transition(node, fn, params, intro) {
292
- let config = fn(node, params);
293
- let t = intro ? 0 : 1;
294
- let running_program = null;
295
- let pending_program = null;
296
- let animation_name = null;
297
- function clear_animation() {
298
- if (animation_name)
299
- delete_rule(node, animation_name);
300
- }
301
- function init(program, duration) {
302
- const d = program.b - t;
303
- duration *= Math.abs(d);
304
- return {
305
- a: t,
306
- b: program.b,
307
- d,
308
- duration,
309
- start: program.start,
310
- end: program.start + duration,
311
- group: program.group
312
- };
313
- }
314
- function go(b) {
315
- const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
316
- const program = {
317
- start: now() + delay,
318
- b
319
- };
320
- if (!b) {
321
- // @ts-ignore todo: improve typings
322
- program.group = outros;
323
- outros.r += 1;
324
- }
325
- if (running_program || pending_program) {
326
- pending_program = program;
327
- }
328
- else {
329
- // if this is an intro, and there's a delay, we need to do
330
- // an initial tick and/or apply CSS animation immediately
331
- if (css) {
332
- clear_animation();
333
- animation_name = create_rule(node, t, b, duration, delay, easing, css);
334
- }
335
- if (b)
336
- tick(0, 1);
337
- running_program = init(program, duration);
338
- add_render_callback(() => dispatch(node, b, 'start'));
339
- loop(now => {
340
- if (pending_program && now > pending_program.start) {
341
- running_program = init(pending_program, duration);
342
- pending_program = null;
343
- dispatch(node, running_program.b, 'start');
344
- if (css) {
345
- clear_animation();
346
- animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);
347
- }
348
- }
349
- if (running_program) {
350
- if (now >= running_program.end) {
351
- tick(t = running_program.b, 1 - t);
352
- dispatch(node, running_program.b, 'end');
353
- if (!pending_program) {
354
- // we're done
355
- if (running_program.b) {
356
- // intro — we can tidy up immediately
357
- clear_animation();
358
- }
359
- else {
360
- // outro — needs to be coordinated
361
- if (!--running_program.group.r)
362
- run_all(running_program.group.c);
363
- }
364
- }
365
- running_program = null;
366
- }
367
- else if (now >= running_program.start) {
368
- const p = now - running_program.start;
369
- t = running_program.a + running_program.d * easing(p / running_program.duration);
370
- tick(t, 1 - t);
371
- }
372
- }
373
- return !!(running_program || pending_program);
374
- });
375
- }
376
- }
377
- return {
378
- run(b) {
379
- if (is_function(config)) {
380
- wait().then(() => {
381
- // @ts-ignore
382
- config = config();
383
- go(b);
384
- });
385
- }
386
- else {
387
- go(b);
388
- }
389
- },
390
- end() {
391
- clear_animation();
392
- running_program = pending_program = null;
393
- }
394
- };
395
- }
396
- function mount_component(component, target, anchor, customElement) {
397
- const { fragment, on_mount, on_destroy, after_update } = component.$$;
398
- fragment && fragment.m(target, anchor);
399
- if (!customElement) {
400
- // onMount happens before the initial afterUpdate
401
- add_render_callback(() => {
402
- const new_on_destroy = on_mount.map(run).filter(is_function);
403
- if (on_destroy) {
404
- on_destroy.push(...new_on_destroy);
405
- }
406
- else {
407
- // Edge case - component was destroyed immediately,
408
- // most likely as a result of a binding initialising
409
- run_all(new_on_destroy);
410
- }
411
- component.$$.on_mount = [];
412
- });
413
- }
414
- after_update.forEach(add_render_callback);
415
- }
416
- function destroy_component(component, detaching) {
417
- const $$ = component.$$;
418
- if ($$.fragment !== null) {
419
- run_all($$.on_destroy);
420
- $$.fragment && $$.fragment.d(detaching);
421
- // TODO null out other refs, including component.$$ (but need to
422
- // preserve final state?)
423
- $$.on_destroy = $$.fragment = null;
424
- $$.ctx = [];
425
- }
426
- }
427
- function make_dirty(component, i) {
428
- if (component.$$.dirty[0] === -1) {
429
- dirty_components.push(component);
430
- schedule_update();
431
- component.$$.dirty.fill(0);
432
- }
433
- component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
434
- }
435
- function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
436
- const parent_component = current_component;
437
- set_current_component(component);
438
- const $$ = component.$$ = {
439
- fragment: null,
440
- ctx: null,
441
- // state
442
- props,
443
- update: noop,
444
- not_equal,
445
- bound: blank_object(),
446
- // lifecycle
447
- on_mount: [],
448
- on_destroy: [],
449
- on_disconnect: [],
450
- before_update: [],
451
- after_update: [],
452
- context: new Map(parent_component ? parent_component.$$.context : options.context || []),
453
- // everything else
454
- callbacks: blank_object(),
455
- dirty,
456
- skip_bound: false
457
- };
458
- let ready = false;
459
- $$.ctx = instance
460
- ? instance(component, options.props || {}, (i, ret, ...rest) => {
461
- const value = rest.length ? rest[0] : ret;
462
- if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
463
- if (!$$.skip_bound && $$.bound[i])
464
- $$.bound[i](value);
465
- if (ready)
466
- make_dirty(component, i);
467
- }
468
- return ret;
469
- })
470
- : [];
471
- $$.update();
472
- ready = true;
473
- run_all($$.before_update);
474
- // `false` as a special case of no DOM component
475
- $$.fragment = create_fragment ? create_fragment($$.ctx) : false;
476
- if (options.target) {
477
- if (options.hydrate) {
478
- const nodes = children(options.target);
479
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
480
- $$.fragment && $$.fragment.l(nodes);
481
- nodes.forEach(detach);
482
- }
483
- else {
484
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
485
- $$.fragment && $$.fragment.c();
486
- }
487
- if (options.intro)
488
- transition_in(component.$$.fragment);
489
- mount_component(component, options.target, options.anchor, options.customElement);
490
- flush();
491
- }
492
- set_current_component(parent_component);
493
- }
494
- let SvelteElement;
495
- if (typeof HTMLElement === 'function') {
496
- SvelteElement = class extends HTMLElement {
497
- constructor() {
498
- super();
499
- this.attachShadow({ mode: 'open' });
500
- }
501
- connectedCallback() {
502
- const { on_mount } = this.$$;
503
- this.$$.on_disconnect = on_mount.map(run).filter(is_function);
504
- // @ts-ignore todo: improve typings
505
- for (const key in this.$$.slotted) {
506
- // @ts-ignore todo: improve typings
507
- this.appendChild(this.$$.slotted[key]);
508
- }
509
- }
510
- attributeChangedCallback(attr, _oldValue, newValue) {
511
- this[attr] = newValue;
512
- }
513
- disconnectedCallback() {
514
- run_all(this.$$.on_disconnect);
515
- }
516
- $destroy() {
517
- destroy_component(this, 1);
518
- this.$destroy = noop;
519
- }
520
- $on(type, callback) {
521
- // TODO should this delegate to addEventListener?
522
- const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
523
- callbacks.push(callback);
524
- return () => {
525
- const index = callbacks.indexOf(callback);
526
- if (index !== -1)
527
- callbacks.splice(index, 1);
528
- };
529
- }
530
- $set($$props) {
531
- if (this.$$set && !is_empty($$props)) {
532
- this.$$.skip_bound = true;
533
- this.$$set($$props);
534
- this.$$.skip_bound = false;
535
- }
536
- }
537
- };
538
- }
539
-
540
- function dispatch_dev(type, detail) {
541
- document.dispatchEvent(custom_event(type, Object.assign({ version: '3.37.0' }, detail)));
542
- }
543
- function append_dev(target, node) {
544
- dispatch_dev('SvelteDOMInsert', { target, node });
545
- append(target, node);
546
- }
547
- function insert_dev(target, node, anchor) {
548
- dispatch_dev('SvelteDOMInsert', { target, node, anchor });
549
- insert(target, node, anchor);
550
- }
551
- function detach_dev(node) {
552
- dispatch_dev('SvelteDOMRemove', { node });
553
- detach(node);
554
- }
555
- function attr_dev(node, attribute, value) {
556
- attr(node, attribute, value);
557
- if (value == null)
558
- dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });
559
- else
560
- dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });
561
- }
562
- function validate_slots(name, slot, keys) {
563
- for (const slot_key of Object.keys(slot)) {
564
- if (!~keys.indexOf(slot_key)) {
565
- console.warn(`<${name}> received an unexpected slot "${slot_key}".`);
566
- }
567
- }
568
- }
569
-
570
- function fade(node, { delay = 0, duration = 400, easing = identity } = {}) {
571
- const o = +getComputedStyle(node).opacity;
572
- return {
573
- delay,
574
- duration,
575
- easing,
576
- css: t => `opacity: ${t * o}`
577
- };
578
- }
579
-
580
- /* src/PlayerAccountModal.svelte generated by Svelte v3.37.0 */
581
- const file = "src/PlayerAccountModal.svelte";
582
-
583
- // (31:2) {#if show}
584
- function create_if_block(ctx) {
585
- let div1;
586
- let div0;
587
- let slot;
588
- let div1_transition;
589
- let current;
590
-
591
- const block = {
592
- c: function create() {
593
- div1 = element("div");
594
- div0 = element("div");
595
- slot = element("slot");
596
- add_location(slot, file, 38, 8, 1042);
597
- attr_dev(div0, "class", "ModalContainer");
598
- add_location(div0, file, 37, 6, 1005);
599
- attr_dev(div1, "class", "ModalWindow");
600
- attr_dev(div1, "id", "Modal");
601
- add_location(div1, file, 31, 4, 859);
602
- },
603
- m: function mount(target, anchor) {
604
- insert_dev(target, div1, anchor);
605
- append_dev(div1, div0);
606
- append_dev(div0, slot);
607
- /*div1_binding*/ ctx[3](div1);
608
- current = true;
609
- },
610
- p: function update(new_ctx, dirty) {
611
- ctx = new_ctx;
612
- },
613
- i: function intro(local) {
614
- if (current) return;
615
-
616
- add_render_callback(() => {
617
- if (!div1_transition) div1_transition = create_bidirectional_transition(div1, fade, { transitionDuration: /*duration*/ ctx[1] }, true);
618
- div1_transition.run(1);
619
- });
620
-
621
- current = true;
622
- },
623
- o: function outro(local) {
624
- if (!div1_transition) div1_transition = create_bidirectional_transition(div1, fade, { transitionDuration: /*duration*/ ctx[1] }, false);
625
- div1_transition.run(0);
626
- current = false;
627
- },
628
- d: function destroy(detaching) {
629
- if (detaching) detach_dev(div1);
630
- /*div1_binding*/ ctx[3](null);
631
- if (detaching && div1_transition) div1_transition.end();
632
- }
633
- };
634
-
635
- dispatch_dev("SvelteRegisterBlock", {
636
- block,
637
- id: create_if_block.name,
638
- type: "if",
639
- source: "(31:2) {#if show}",
640
- ctx
641
- });
642
-
643
- return block;
644
- }
645
-
646
- function create_fragment(ctx) {
647
- let div;
648
- let current;
649
- let if_block = /*show*/ ctx[0] && create_if_block(ctx);
650
-
651
- const block = {
652
- c: function create() {
653
- div = element("div");
654
- if (if_block) if_block.c();
655
- this.c = noop;
656
- add_location(div, file, 29, 0, 836);
657
- },
658
- l: function claim(nodes) {
659
- throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
660
- },
661
- m: function mount(target, anchor) {
662
- insert_dev(target, div, anchor);
663
- if (if_block) if_block.m(div, null);
664
- current = true;
665
- },
666
- p: function update(ctx, [dirty]) {
667
- if (/*show*/ ctx[0]) {
668
- if (if_block) {
669
- if_block.p(ctx, dirty);
670
-
671
- if (dirty & /*show*/ 1) {
672
- transition_in(if_block, 1);
673
- }
674
- } else {
675
- if_block = create_if_block(ctx);
676
- if_block.c();
677
- transition_in(if_block, 1);
678
- if_block.m(div, null);
679
- }
680
- } else if (if_block) {
681
- group_outros();
682
-
683
- transition_out(if_block, 1, 1, () => {
684
- if_block = null;
685
- });
686
-
687
- check_outros();
688
- }
689
- },
690
- i: function intro(local) {
691
- if (current) return;
692
- transition_in(if_block);
693
- current = true;
694
- },
695
- o: function outro(local) {
696
- transition_out(if_block);
697
- current = false;
698
- },
699
- d: function destroy(detaching) {
700
- if (detaching) detach_dev(div);
701
- if (if_block) if_block.d();
702
- }
703
- };
704
-
705
- dispatch_dev("SvelteRegisterBlock", {
706
- block,
707
- id: create_fragment.name,
708
- type: "component",
709
- source: "",
710
- ctx
711
- });
712
-
713
- return block;
714
- }
715
-
716
- function instance($$self, $$props, $$invalidate) {
717
- let { $$slots: slots = {}, $$scope } = $$props;
718
- validate_slots("undefined", slots, []);
719
- let { show = false } = $$props;
720
- let { duration = 350 } = $$props;
721
- let modalElement;
722
-
723
- const close = () => {
724
- $$invalidate(0, show = false);
725
- window.postMessage({ type: "ModalClosed" }, window.location.href);
726
- window.postMessage({ type: "EnableScroll" }, window.location.href);
727
- };
728
-
729
- const messageHandler = e => {
730
- if (e.data.type == "ModalClosed") {
731
- $$invalidate(0, show = false);
732
- }
733
-
734
- if (e.data.type === "ShowLimitsConfirmationModal") {
735
- $$invalidate(0, show = true);
736
- window.postMessage({ type: "DisableScroll" }, window.location.href);
737
- }
738
- };
739
-
740
- onMount(() => {
741
- window.addEventListener("message", messageHandler, false);
742
-
743
- return () => {
744
- window.removeEventListener("message", messageHandler);
745
- };
746
- });
747
-
748
- const writable_props = ["show", "duration"];
749
-
750
- Object.keys($$props).forEach(key => {
751
- if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<undefined> was created with unknown prop '${key}'`);
752
- });
753
-
754
- function div1_binding($$value) {
755
- binding_callbacks[$$value ? "unshift" : "push"](() => {
756
- modalElement = $$value;
757
- $$invalidate(2, modalElement);
758
- });
759
- }
760
-
761
- $$self.$$set = $$props => {
762
- if ("show" in $$props) $$invalidate(0, show = $$props.show);
763
- if ("duration" in $$props) $$invalidate(1, duration = $$props.duration);
764
- };
765
-
766
- $$self.$capture_state = () => ({
767
- onMount,
768
- fade,
769
- show,
770
- duration,
771
- modalElement,
772
- close,
773
- messageHandler
774
- });
775
-
776
- $$self.$inject_state = $$props => {
777
- if ("show" in $$props) $$invalidate(0, show = $$props.show);
778
- if ("duration" in $$props) $$invalidate(1, duration = $$props.duration);
779
- if ("modalElement" in $$props) $$invalidate(2, modalElement = $$props.modalElement);
780
- };
781
-
782
- if ($$props && "$$inject" in $$props) {
783
- $$self.$inject_state($$props.$$inject);
784
- }
785
-
786
- return [show, duration, modalElement, div1_binding];
787
- }
788
-
789
- class PlayerAccountModal extends SvelteElement {
790
- constructor(options) {
791
- super();
792
- this.shadowRoot.innerHTML = `<style>*,*::before,*::after{margin:0;padding:0;box-sizing:border-box;font-family:'Helvetica Neue', 'Helvetica', sans-serif}.ModalWindow{display:flex;position:fixed;align-items:center;justify-content:center;width:100%;height:100%;z-index:10;top:0;left:0;background-color:rgba(0, 0, 0, 0.9)}</style>`;
793
-
794
- init(
795
- this,
796
- {
797
- target: this.shadowRoot,
798
- props: attribute_to_object(this.attributes),
799
- customElement: true
800
- },
801
- instance,
802
- create_fragment,
803
- safe_not_equal,
804
- { show: 0, duration: 1 }
805
- );
806
-
807
- if (options) {
808
- if (options.target) {
809
- insert_dev(options.target, this, options.anchor);
810
- }
811
-
812
- if (options.props) {
813
- this.$set(options.props);
814
- flush();
815
- }
816
- }
817
- }
818
-
819
- static get observedAttributes() {
820
- return ["show", "duration"];
821
- }
822
-
823
- get show() {
824
- return this.$$.ctx[0];
825
- }
826
-
827
- set show(show) {
828
- this.$set({ show });
829
- flush();
830
- }
831
-
832
- get duration() {
833
- return this.$$.ctx[1];
834
- }
835
-
836
- set duration(duration) {
837
- this.$set({ duration });
838
- flush();
839
- }
840
- }
841
-
842
- !customElements.get('player-account-modal') && customElements.define('player-account-modal', PlayerAccountModal);
843
-
844
- return PlayerAccountModal;
845
-
846
- })));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).app=e()}(this,function(){"use strict";function m(){}const $=t=>t;function c(t){return t()}function d(){return Object.create(null)}function g(t){t.forEach(c)}function y(t){return"function"==typeof t}function e(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}var t="undefined"!=typeof window;let b=t?()=>window.performance.now():()=>Date.now(),_=t?t=>requestAnimationFrame(t):m;const w=new Set;function v(e){w.forEach(t=>{t.c(e)||(w.delete(t),t.f())}),0!==w.size&&_(v)}function r(t,e,n){t.insertBefore(e,n||null)}function f(t){t.parentNode.removeChild(t)}function x(t){return document.createElement(t)}function i(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const E=new Set;let h,k=0;function C(t,e,n,o,s,r,i,a=0){var l=16.666/o;let u="{\n";for(let t=0;t<=1;t+=l){const o=e+(n-e)*r(t);u+=100*t+`%{${i(o,1-o)}}\n`}const c=u+`100% {${i(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(c)}_${a}`,f=t.ownerDocument;E.add(f);const h=f.__svelte_stylesheet||(f.__svelte_stylesheet=f.head.appendChild(x("style")).sheet),p=f.__svelte_rules||(f.__svelte_rules={});p[d]||(p[d]=!0,h.insertRule(`@keyframes ${d} ${c}`,h.cssRules.length));a=t.style.animation||"";return t.style.animation=`${a?`${a}, `:""}${d} ${o}ms linear ${s}ms 1 both`,k+=1,d}function p(t){h=t}const M=[],a=[],o=[],s=[],S=Promise.resolve();let A=!1;function L(t){o.push(t)}let l=!1;const u=new Set;function j(){if(!l){l=!0;do{for(let t=0;t<M.length;t+=1){var e=M[t];p(e),function(t){{var e;null!==t.fragment&&(t.update(),g(t.before_update),e=t.dirty,t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(L))}}(e.$$)}for(p(null),M.length=0;a.length;)a.pop()();for(let t=0;t<o.length;t+=1){const n=o[t];u.has(n)||(u.add(n),n())}}while(o.length=0,M.length);for(;s.length;)s.pop()();A=!1,l=!1,u.clear()}}let H;function R(t,e,n){t.dispatchEvent(function(t){const e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,void 0),e}(`${e?"intro":"outro"}${n}`))}const T=new Set;let z;function D(t,e){t&&t.i&&(T.delete(t),t.i(e))}function O(t,e,n,o){t&&t.o&&(T.has(t)||(T.add(t),z.c.push(()=>{T.delete(t),o&&(n&&t.d(1),o())}),t.o(e)))}const N={duration:0};function P(a,t,e,n){let l=t(a,e),u=n?0:1,c=null,d=null,f=null;function h(){f&&function(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),s=n.length-o.length;s&&(t.style.animation=o.join(", "),k-=s,k||_(()=>{k||(E.forEach(t=>{const e=t.__svelte_stylesheet;let n=e.cssRules.length;for(;n--;)e.deleteRule(n);t.__svelte_rules={}}),E.clear())}))}(a,f)}function p(t,e){var n=t.b-u;return e*=Math.abs(n),{a:u,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function o(t){const{delay:e=0,duration:n=300,easing:o=$,tick:s=m,css:r}=l||N,i={start:b()+e,b:t};t||(i.group=z,z.r+=1),c||d?d=i:(r&&(h(),f=C(a,u,t,n,e,o,r)),t&&s(0,1),c=p(i,n),L(()=>R(a,t,"start")),function(e){let n;0===w.size&&_(v),new Promise(t=>{w.add(n={c:e,f:t})})}(t=>{return d&&t>d.start&&(c=p(d,n),d=null,R(a,c.b,"start"),r&&(h(),f=C(a,u,c.b,c.duration,0,o,l.css))),c&&(t>=c.end?(s(u=c.b,1-u),R(a,c.b,"end"),d||(c.b?h():--c.group.r||g(c.group.c)),c=null):t>=c.start&&(t=t-c.start,u=c.a+c.d*o(t/c.duration),s(u,1-u))),!(!c&&!d)}))}return{run(t){y(l)?(H||(H=Promise.resolve(),H.then(()=>{H=null})),H.then(()=>{l=l(),o(t)})):o(t)},end(){h(),c=d=null}}}function n(o,t,e,n,s,r,i=[-1]){var a=h;p(o);const l=o.$$={fragment:null,ctx:null,props:r,update:m,not_equal:s,bound:d(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:t.context||[]),callbacks:d(),dirty:i,skip_bound:!1};let u=!1;if(l.ctx=e?e(o,t.props||{},(t,e,...n)=>{n=n.length?n[0]:e;return l.ctx&&s(l.ctx[t],l.ctx[t]=n)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](n),u&&(n=t,-1===(t=o).$$.dirty[0]&&(M.push(t),A||(A=!0,S.then(j)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31)),e}):[],l.update(),u=!0,g(l.before_update),l.fragment=!!n&&n(l.ctx),t.target){if(t.hydrate){const m=(n=t.target,Array.from(n.childNodes));l.fragment&&l.fragment.l(m),m.forEach(f)}else l.fragment&&l.fragment.c();t.intro&&D(o.$$.fragment),function(e,t,n,o){const{fragment:s,on_mount:r,on_destroy:i,after_update:a}=e.$$;s&&s.m(t,n),o||L(()=>{var t=r.map(c).filter(y);i?i.push(...t):g(t),e.$$.on_mount=[]}),a.forEach(L)}(o,t.target,t.anchor,t.customElement),j()}p(a)}let q;function F(t,{delay:e=0,duration:n=400,easing:o=$}={}){const s=+getComputedStyle(t).opacity;return{delay:e,duration:n,easing:o,css:t=>"opacity: "+t*s}}function W(n){let o,e,s;return{c(){o=x("div"),o.innerHTML='<div class="ModalContainer"><slot></slot></div>',i(o,"class","ModalWindow"),i(o,"id","Modal")},m(t,e){r(t,o,e),n[3](o),s=!0},p(t,e){n=t},i(t){s||(L(()=>{e=e||P(o,F,{transitionDuration:n[1]},!0),e.run(1)}),s=!0)},o(t){e=e||P(o,F,{transitionDuration:n[1]},!1),e.run(0),s=!1},d(t){t&&f(o),n[3](null),t&&e&&e.end()}}}function B(t){let n,o,s=t[0]&&W(t);return{c(){n=x("div"),s&&s.c(),this.c=m},m(t,e){r(t,n,e),s&&s.m(n,null),o=!0},p(t,[e]){t[0]?s?(s.p(t,e),1&e&&D(s,1)):(s=W(t),s.c(),D(s,1),s.m(n,null)):s&&(z={r:0,c:[],p:z},O(s,1,1,()=>{s=null}),z.r||g(z.c),z=z.p)},i(t){o||(D(s),o=!0)},o(t){O(s),o=!1},d(t){t&&f(n),s&&s.d()}}}function G(t,e,n){let o,{show:s=!1}=e,{duration:r=350}=e;const i=t=>{"ModalClosed"==t.data.type&&n(0,s=!1),"ShowLimitsConfirmationModal"===t.data.type&&(n(0,s=!0),window.postMessage({type:"DisableScroll"},window.location.href))};return e=()=>(window.addEventListener("message",i,!1),()=>{window.removeEventListener("message",i)}),function(){if(!h)throw new Error("Function called outside component initialization");return h}().$$.on_mount.push(e),t.$$set=t=>{"show"in t&&n(0,s=t.show),"duration"in t&&n(1,r=t.duration)},[s,r,void 0,function(t){a[t?"unshift":"push"](()=>{o=t,n(2,o)})}]}"function"==typeof HTMLElement&&(q=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(c).filter(y);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){g(this.$$.on_disconnect)}$destroy(){!function(t){const e=t.$$;null!==e.fragment&&(g(e.on_destroy),e.fragment&&e.fragment.d(1),e.on_destroy=e.fragment=null,e.ctx=[])}(this),this.$destroy=m}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{var t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&0!==Object.keys(t).length&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});class I extends q{constructor(t){super(),this.shadowRoot.innerHTML="<style>*,*::before,*::after{margin:0;padding:0;box-sizing:border-box;font-family:'Helvetica Neue', 'Helvetica', sans-serif}.ModalWindow{display:flex;position:fixed;align-items:center;justify-content:center;width:100%;height:100%;z-index:10;top:0;left:0;background-color:rgba(0, 0, 0, 0.9)}</style>",n(this,{target:this.shadowRoot,props:function(t){const e={};for(const n of t)e[n.name]=n.value;return e}(this.attributes),customElement:!0},G,B,e,{show:0,duration:1}),t&&(t.target&&r(t.target,this,t.anchor),t.props&&(this.$set(t.props),j()))}static get observedAttributes(){return["show","duration"]}get show(){return this.$$.ctx[0]}set show(t){this.$set({show:t}),j()}get duration(){return this.$$.ctx[1]}set duration(t){this.$set({duration:t}),j()}}return customElements.get("player-account-modal")||customElements.define("player-account-modal",I),I});
847
2
  //# sourceMappingURL=player-account-modal.js.map