1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 | function noop() { }
|
6 | const identity = x => x;
|
7 | function assign(tar, src) {
|
8 |
|
9 | for (const k in src)
|
10 | tar[k] = src[k];
|
11 | return tar;
|
12 | }
|
13 | function is_promise(value) {
|
14 | return value && typeof value === 'object' && typeof value.then === 'function';
|
15 | }
|
16 | function add_location(element, file, line, column, char) {
|
17 | element.__svelte_meta = {
|
18 | loc: { file, line, column, char }
|
19 | };
|
20 | }
|
21 | function run(fn) {
|
22 | return fn();
|
23 | }
|
24 | function blank_object() {
|
25 | return Object.create(null);
|
26 | }
|
27 | function run_all(fns) {
|
28 | fns.forEach(run);
|
29 | }
|
30 | function is_function(thing) {
|
31 | return typeof thing === 'function';
|
32 | }
|
33 | function safe_not_equal(a, b) {
|
34 | return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
35 | }
|
36 | function not_equal(a, b) {
|
37 | return a != a ? b == b : a !== b;
|
38 | }
|
39 | function is_empty(obj) {
|
40 | return Object.keys(obj).length === 0;
|
41 | }
|
42 | function validate_store(store, name) {
|
43 | if (store != null && typeof store.subscribe !== 'function') {
|
44 | throw new Error(`'${name}' is not a store with a 'subscribe' method`);
|
45 | }
|
46 | }
|
47 | function subscribe(store, ...callbacks) {
|
48 | if (store == null) {
|
49 | return noop;
|
50 | }
|
51 | const unsub = store.subscribe(...callbacks);
|
52 | return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
53 | }
|
54 | function get_store_value(store) {
|
55 | let value;
|
56 | subscribe(store, _ => value = _)();
|
57 | return value;
|
58 | }
|
59 | function component_subscribe(component, store, callback) {
|
60 | component.$$.on_destroy.push(subscribe(store, callback));
|
61 | }
|
62 | function create_slot(definition, ctx, $$scope, fn) {
|
63 | if (definition) {
|
64 | const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
|
65 | return definition[0](slot_ctx);
|
66 | }
|
67 | }
|
68 | function get_slot_context(definition, ctx, $$scope, fn) {
|
69 | return definition[1] && fn
|
70 | ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))
|
71 | : $$scope.ctx;
|
72 | }
|
73 | function get_slot_changes(definition, $$scope, dirty, fn) {
|
74 | if (definition[2] && fn) {
|
75 | const lets = definition[2](fn(dirty));
|
76 | if ($$scope.dirty === undefined) {
|
77 | return lets;
|
78 | }
|
79 | if (typeof lets === 'object') {
|
80 | const merged = [];
|
81 | const len = Math.max($$scope.dirty.length, lets.length);
|
82 | for (let i = 0; i < len; i += 1) {
|
83 | merged[i] = $$scope.dirty[i] | lets[i];
|
84 | }
|
85 | return merged;
|
86 | }
|
87 | return $$scope.dirty | lets;
|
88 | }
|
89 | return $$scope.dirty;
|
90 | }
|
91 | function update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {
|
92 | const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);
|
93 | if (slot_changes) {
|
94 | const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
|
95 | slot.p(slot_context, slot_changes);
|
96 | }
|
97 | }
|
98 | function exclude_internal_props(props) {
|
99 | const result = {};
|
100 | for (const k in props)
|
101 | if (k[0] !== '$')
|
102 | result[k] = props[k];
|
103 | return result;
|
104 | }
|
105 | function compute_rest_props(props, keys) {
|
106 | const rest = {};
|
107 | keys = new Set(keys);
|
108 | for (const k in props)
|
109 | if (!keys.has(k) && k[0] !== '$')
|
110 | rest[k] = props[k];
|
111 | return rest;
|
112 | }
|
113 | function once(fn) {
|
114 | let ran = false;
|
115 | return function (...args) {
|
116 | if (ran)
|
117 | return;
|
118 | ran = true;
|
119 | fn.call(this, ...args);
|
120 | };
|
121 | }
|
122 | function null_to_empty(value) {
|
123 | return value == null ? '' : value;
|
124 | }
|
125 | function set_store_value(store, ret, value = ret) {
|
126 | store.set(value);
|
127 | return ret;
|
128 | }
|
129 | const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
130 | function action_destroyer(action_result) {
|
131 | return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
|
132 | }
|
133 |
|
134 | const is_client = typeof window !== 'undefined';
|
135 | exports.now = is_client
|
136 | ? () => window.performance.now()
|
137 | : () => Date.now();
|
138 | exports.raf = is_client ? cb => requestAnimationFrame(cb) : noop;
|
139 |
|
140 | function set_now(fn) {
|
141 | exports.now = fn;
|
142 | }
|
143 | function set_raf(fn) {
|
144 | exports.raf = fn;
|
145 | }
|
146 |
|
147 | const tasks = new Set();
|
148 | function run_tasks(now) {
|
149 | tasks.forEach(task => {
|
150 | if (!task.c(now)) {
|
151 | tasks.delete(task);
|
152 | task.f();
|
153 | }
|
154 | });
|
155 | if (tasks.size !== 0)
|
156 | exports.raf(run_tasks);
|
157 | }
|
158 |
|
159 |
|
160 |
|
161 | function clear_loops() {
|
162 | tasks.clear();
|
163 | }
|
164 |
|
165 |
|
166 |
|
167 |
|
168 | function loop(callback) {
|
169 | let task;
|
170 | if (tasks.size === 0)
|
171 | exports.raf(run_tasks);
|
172 | return {
|
173 | promise: new Promise(fulfill => {
|
174 | tasks.add(task = { c: callback, f: fulfill });
|
175 | }),
|
176 | abort() {
|
177 | tasks.delete(task);
|
178 | }
|
179 | };
|
180 | }
|
181 |
|
182 | function append(target, node) {
|
183 | target.appendChild(node);
|
184 | }
|
185 | function insert(target, node, anchor) {
|
186 | target.insertBefore(node, anchor || null);
|
187 | }
|
188 | function detach(node) {
|
189 | node.parentNode.removeChild(node);
|
190 | }
|
191 | function destroy_each(iterations, detaching) {
|
192 | for (let i = 0; i < iterations.length; i += 1) {
|
193 | if (iterations[i])
|
194 | iterations[i].d(detaching);
|
195 | }
|
196 | }
|
197 | function element(name) {
|
198 | return document.createElement(name);
|
199 | }
|
200 | function element_is(name, is) {
|
201 | return document.createElement(name, { is });
|
202 | }
|
203 | function object_without_properties(obj, exclude) {
|
204 | const target = {};
|
205 | for (const k in obj) {
|
206 | if (has_prop(obj, k)
|
207 |
|
208 | && exclude.indexOf(k) === -1) {
|
209 |
|
210 | target[k] = obj[k];
|
211 | }
|
212 | }
|
213 | return target;
|
214 | }
|
215 | function svg_element(name) {
|
216 | return document.createElementNS('http://www.w3.org/2000/svg', name);
|
217 | }
|
218 | function text(data) {
|
219 | return document.createTextNode(data);
|
220 | }
|
221 | function space() {
|
222 | return text(' ');
|
223 | }
|
224 | function empty() {
|
225 | return text('');
|
226 | }
|
227 | function listen(node, event, handler, options) {
|
228 | node.addEventListener(event, handler, options);
|
229 | return () => node.removeEventListener(event, handler, options);
|
230 | }
|
231 | function prevent_default(fn) {
|
232 | return function (event) {
|
233 | event.preventDefault();
|
234 |
|
235 | return fn.call(this, event);
|
236 | };
|
237 | }
|
238 | function stop_propagation(fn) {
|
239 | return function (event) {
|
240 | event.stopPropagation();
|
241 |
|
242 | return fn.call(this, event);
|
243 | };
|
244 | }
|
245 | function self(fn) {
|
246 | return function (event) {
|
247 |
|
248 | if (event.target === this)
|
249 | fn.call(this, event);
|
250 | };
|
251 | }
|
252 | function attr(node, attribute, value) {
|
253 | if (value == null)
|
254 | node.removeAttribute(attribute);
|
255 | else if (node.getAttribute(attribute) !== value)
|
256 | node.setAttribute(attribute, value);
|
257 | }
|
258 | function set_attributes(node, attributes) {
|
259 |
|
260 | const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);
|
261 | for (const key in attributes) {
|
262 | if (attributes[key] == null) {
|
263 | node.removeAttribute(key);
|
264 | }
|
265 | else if (key === 'style') {
|
266 | node.style.cssText = attributes[key];
|
267 | }
|
268 | else if (key === '__value') {
|
269 | node.value = node[key] = attributes[key];
|
270 | }
|
271 | else if (descriptors[key] && descriptors[key].set) {
|
272 | node[key] = attributes[key];
|
273 | }
|
274 | else {
|
275 | attr(node, key, attributes[key]);
|
276 | }
|
277 | }
|
278 | }
|
279 | function set_svg_attributes(node, attributes) {
|
280 | for (const key in attributes) {
|
281 | attr(node, key, attributes[key]);
|
282 | }
|
283 | }
|
284 | function set_custom_element_data(node, prop, value) {
|
285 | if (prop in node) {
|
286 | node[prop] = value;
|
287 | }
|
288 | else {
|
289 | attr(node, prop, value);
|
290 | }
|
291 | }
|
292 | function xlink_attr(node, attribute, value) {
|
293 | node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);
|
294 | }
|
295 | function get_binding_group_value(group, __value, checked) {
|
296 | const value = new Set();
|
297 | for (let i = 0; i < group.length; i += 1) {
|
298 | if (group[i].checked)
|
299 | value.add(group[i].__value);
|
300 | }
|
301 | if (!checked) {
|
302 | value.delete(__value);
|
303 | }
|
304 | return Array.from(value);
|
305 | }
|
306 | function to_number(value) {
|
307 | return value === '' ? undefined : +value;
|
308 | }
|
309 | function time_ranges_to_array(ranges) {
|
310 | const array = [];
|
311 | for (let i = 0; i < ranges.length; i += 1) {
|
312 | array.push({ start: ranges.start(i), end: ranges.end(i) });
|
313 | }
|
314 | return array;
|
315 | }
|
316 | function children(element) {
|
317 | return Array.from(element.childNodes);
|
318 | }
|
319 | function claim_element(nodes, name, attributes, svg) {
|
320 | for (let i = 0; i < nodes.length; i += 1) {
|
321 | const node = nodes[i];
|
322 | if (node.nodeName === name) {
|
323 | let j = 0;
|
324 | const remove = [];
|
325 | while (j < node.attributes.length) {
|
326 | const attribute = node.attributes[j++];
|
327 | if (!attributes[attribute.name]) {
|
328 | remove.push(attribute.name);
|
329 | }
|
330 | }
|
331 | for (let k = 0; k < remove.length; k++) {
|
332 | node.removeAttribute(remove[k]);
|
333 | }
|
334 | return nodes.splice(i, 1)[0];
|
335 | }
|
336 | }
|
337 | return svg ? svg_element(name) : element(name);
|
338 | }
|
339 | function claim_text(nodes, data) {
|
340 | for (let i = 0; i < nodes.length; i += 1) {
|
341 | const node = nodes[i];
|
342 | if (node.nodeType === 3) {
|
343 | node.data = '' + data;
|
344 | return nodes.splice(i, 1)[0];
|
345 | }
|
346 | }
|
347 | return text(data);
|
348 | }
|
349 | function claim_space(nodes) {
|
350 | return claim_text(nodes, ' ');
|
351 | }
|
352 | function set_data(text, data) {
|
353 | data = '' + data;
|
354 | if (text.wholeText !== data)
|
355 | text.data = data;
|
356 | }
|
357 | function set_input_value(input, value) {
|
358 | input.value = value == null ? '' : value;
|
359 | }
|
360 | function set_input_type(input, type) {
|
361 | try {
|
362 | input.type = type;
|
363 | }
|
364 | catch (e) {
|
365 |
|
366 | }
|
367 | }
|
368 | function set_style(node, key, value, important) {
|
369 | node.style.setProperty(key, value, important ? 'important' : '');
|
370 | }
|
371 | function select_option(select, value) {
|
372 | for (let i = 0; i < select.options.length; i += 1) {
|
373 | const option = select.options[i];
|
374 | if (option.__value === value) {
|
375 | option.selected = true;
|
376 | return;
|
377 | }
|
378 | }
|
379 | }
|
380 | function select_options(select, value) {
|
381 | for (let i = 0; i < select.options.length; i += 1) {
|
382 | const option = select.options[i];
|
383 | option.selected = ~value.indexOf(option.__value);
|
384 | }
|
385 | }
|
386 | function select_value(select) {
|
387 | const selected_option = select.querySelector(':checked') || select.options[0];
|
388 | return selected_option && selected_option.__value;
|
389 | }
|
390 | function select_multiple_value(select) {
|
391 | return [].map.call(select.querySelectorAll(':checked'), option => option.__value);
|
392 | }
|
393 |
|
394 |
|
395 | let crossorigin;
|
396 | function is_crossorigin() {
|
397 | if (crossorigin === undefined) {
|
398 | crossorigin = false;
|
399 | try {
|
400 | if (typeof window !== 'undefined' && window.parent) {
|
401 | void window.parent.document;
|
402 | }
|
403 | }
|
404 | catch (error) {
|
405 | crossorigin = true;
|
406 | }
|
407 | }
|
408 | return crossorigin;
|
409 | }
|
410 | function add_resize_listener(node, fn) {
|
411 | const computed_style = getComputedStyle(node);
|
412 | const z_index = (parseInt(computed_style.zIndex) || 0) - 1;
|
413 | if (computed_style.position === 'static') {
|
414 | node.style.position = 'relative';
|
415 | }
|
416 | const iframe = element('iframe');
|
417 | iframe.setAttribute('style', `display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ` +
|
418 | `overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: ${z_index};`);
|
419 | iframe.setAttribute('aria-hidden', 'true');
|
420 | iframe.tabIndex = -1;
|
421 | const crossorigin = is_crossorigin();
|
422 | let unsubscribe;
|
423 | if (crossorigin) {
|
424 | iframe.src = `data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>`;
|
425 | unsubscribe = listen(window, 'message', (event) => {
|
426 | if (event.source === iframe.contentWindow)
|
427 | fn();
|
428 | });
|
429 | }
|
430 | else {
|
431 | iframe.src = 'about:blank';
|
432 | iframe.onload = () => {
|
433 | unsubscribe = listen(iframe.contentWindow, 'resize', fn);
|
434 | };
|
435 | }
|
436 | append(node, iframe);
|
437 | return () => {
|
438 | if (crossorigin) {
|
439 | unsubscribe();
|
440 | }
|
441 | else if (unsubscribe && iframe.contentWindow) {
|
442 | unsubscribe();
|
443 | }
|
444 | detach(iframe);
|
445 | };
|
446 | }
|
447 | function toggle_class(element, name, toggle) {
|
448 | element.classList[toggle ? 'add' : 'remove'](name);
|
449 | }
|
450 | function custom_event(type, detail) {
|
451 | const e = document.createEvent('CustomEvent');
|
452 | e.initCustomEvent(type, false, false, detail);
|
453 | return e;
|
454 | }
|
455 | function query_selector_all(selector, parent = document.body) {
|
456 | return Array.from(parent.querySelectorAll(selector));
|
457 | }
|
458 | class HtmlTag {
|
459 | constructor(anchor = null) {
|
460 | this.a = anchor;
|
461 | this.e = this.n = null;
|
462 | }
|
463 | m(html, target, anchor = null) {
|
464 | if (!this.e) {
|
465 | this.e = element(target.nodeName);
|
466 | this.t = target;
|
467 | this.h(html);
|
468 | }
|
469 | this.i(anchor);
|
470 | }
|
471 | h(html) {
|
472 | this.e.innerHTML = html;
|
473 | this.n = Array.from(this.e.childNodes);
|
474 | }
|
475 | i(anchor) {
|
476 | for (let i = 0; i < this.n.length; i += 1) {
|
477 | insert(this.t, this.n[i], anchor);
|
478 | }
|
479 | }
|
480 | p(html) {
|
481 | this.d();
|
482 | this.h(html);
|
483 | this.i(this.a);
|
484 | }
|
485 | d() {
|
486 | this.n.forEach(detach);
|
487 | }
|
488 | }
|
489 |
|
490 | const active_docs = new Set();
|
491 | let active = 0;
|
492 |
|
493 | function hash(str) {
|
494 | let hash = 5381;
|
495 | let i = str.length;
|
496 | while (i--)
|
497 | hash = ((hash << 5) - hash) ^ str.charCodeAt(i);
|
498 | return hash >>> 0;
|
499 | }
|
500 | function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {
|
501 | const step = 16.666 / duration;
|
502 | let keyframes = '{\n';
|
503 | for (let p = 0; p <= 1; p += step) {
|
504 | const t = a + (b - a) * ease(p);
|
505 | keyframes += p * 100 + `%{${fn(t, 1 - t)}}\n`;
|
506 | }
|
507 | const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`;
|
508 | const name = `__svelte_${hash(rule)}_${uid}`;
|
509 | const doc = node.ownerDocument;
|
510 | active_docs.add(doc);
|
511 | const stylesheet = doc.__svelte_stylesheet || (doc.__svelte_stylesheet = doc.head.appendChild(element('style')).sheet);
|
512 | const current_rules = doc.__svelte_rules || (doc.__svelte_rules = {});
|
513 | if (!current_rules[name]) {
|
514 | current_rules[name] = true;
|
515 | stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);
|
516 | }
|
517 | const animation = node.style.animation || '';
|
518 | node.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;
|
519 | active += 1;
|
520 | return name;
|
521 | }
|
522 | function delete_rule(node, name) {
|
523 | const previous = (node.style.animation || '').split(', ');
|
524 | const next = previous.filter(name
|
525 | ? anim => anim.indexOf(name) < 0
|
526 | : anim => anim.indexOf('__svelte') === -1
|
527 | );
|
528 | const deleted = previous.length - next.length;
|
529 | if (deleted) {
|
530 | node.style.animation = next.join(', ');
|
531 | active -= deleted;
|
532 | if (!active)
|
533 | clear_rules();
|
534 | }
|
535 | }
|
536 | function clear_rules() {
|
537 | exports.raf(() => {
|
538 | if (active)
|
539 | return;
|
540 | active_docs.forEach(doc => {
|
541 | const stylesheet = doc.__svelte_stylesheet;
|
542 | let i = stylesheet.cssRules.length;
|
543 | while (i--)
|
544 | stylesheet.deleteRule(i);
|
545 | doc.__svelte_rules = {};
|
546 | });
|
547 | active_docs.clear();
|
548 | });
|
549 | }
|
550 |
|
551 | function create_animation(node, from, fn, params) {
|
552 | if (!from)
|
553 | return noop;
|
554 | const to = node.getBoundingClientRect();
|
555 | if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)
|
556 | return noop;
|
557 | const { delay = 0, duration = 300, easing = identity,
|
558 |
|
559 | start: start_time = exports.now() + delay,
|
560 |
|
561 | end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);
|
562 | let running = true;
|
563 | let started = false;
|
564 | let name;
|
565 | function start() {
|
566 | if (css) {
|
567 | name = create_rule(node, 0, 1, duration, delay, easing, css);
|
568 | }
|
569 | if (!delay) {
|
570 | started = true;
|
571 | }
|
572 | }
|
573 | function stop() {
|
574 | if (css)
|
575 | delete_rule(node, name);
|
576 | running = false;
|
577 | }
|
578 | loop(now => {
|
579 | if (!started && now >= start_time) {
|
580 | started = true;
|
581 | }
|
582 | if (started && now >= end) {
|
583 | tick(1, 0);
|
584 | stop();
|
585 | }
|
586 | if (!running) {
|
587 | return false;
|
588 | }
|
589 | if (started) {
|
590 | const p = now - start_time;
|
591 | const t = 0 + 1 * easing(p / duration);
|
592 | tick(t, 1 - t);
|
593 | }
|
594 | return true;
|
595 | });
|
596 | start();
|
597 | tick(0, 1);
|
598 | return stop;
|
599 | }
|
600 | function fix_position(node) {
|
601 | const style = getComputedStyle(node);
|
602 | if (style.position !== 'absolute' && style.position !== 'fixed') {
|
603 | const { width, height } = style;
|
604 | const a = node.getBoundingClientRect();
|
605 | node.style.position = 'absolute';
|
606 | node.style.width = width;
|
607 | node.style.height = height;
|
608 | add_transform(node, a);
|
609 | }
|
610 | }
|
611 | function add_transform(node, a) {
|
612 | const b = node.getBoundingClientRect();
|
613 | if (a.left !== b.left || a.top !== b.top) {
|
614 | const style = getComputedStyle(node);
|
615 | const transform = style.transform === 'none' ? '' : style.transform;
|
616 | node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;
|
617 | }
|
618 | }
|
619 |
|
620 | function set_current_component(component) {
|
621 | exports.current_component = component;
|
622 | }
|
623 | function get_current_component() {
|
624 | if (!exports.current_component)
|
625 | throw new Error(`Function called outside component initialization`);
|
626 | return exports.current_component;
|
627 | }
|
628 | function beforeUpdate(fn) {
|
629 | get_current_component().$$.before_update.push(fn);
|
630 | }
|
631 | function onMount(fn) {
|
632 | get_current_component().$$.on_mount.push(fn);
|
633 | }
|
634 | function afterUpdate(fn) {
|
635 | get_current_component().$$.after_update.push(fn);
|
636 | }
|
637 | function onDestroy(fn) {
|
638 | get_current_component().$$.on_destroy.push(fn);
|
639 | }
|
640 | function createEventDispatcher() {
|
641 | const component = get_current_component();
|
642 | return (type, detail) => {
|
643 | const callbacks = component.$$.callbacks[type];
|
644 | if (callbacks) {
|
645 |
|
646 |
|
647 | const event = custom_event(type, detail);
|
648 | callbacks.slice().forEach(fn => {
|
649 | fn.call(component, event);
|
650 | });
|
651 | }
|
652 | };
|
653 | }
|
654 | function setContext(key, context) {
|
655 | get_current_component().$$.context.set(key, context);
|
656 | }
|
657 | function getContext(key) {
|
658 | return get_current_component().$$.context.get(key);
|
659 | }
|
660 |
|
661 |
|
662 |
|
663 | function bubble(component, event) {
|
664 | const callbacks = component.$$.callbacks[event.type];
|
665 | if (callbacks) {
|
666 | callbacks.slice().forEach(fn => fn(event));
|
667 | }
|
668 | }
|
669 |
|
670 | const dirty_components = [];
|
671 | const intros = { enabled: false };
|
672 | const binding_callbacks = [];
|
673 | const render_callbacks = [];
|
674 | const flush_callbacks = [];
|
675 | const resolved_promise = Promise.resolve();
|
676 | let update_scheduled = false;
|
677 | function schedule_update() {
|
678 | if (!update_scheduled) {
|
679 | update_scheduled = true;
|
680 | resolved_promise.then(flush);
|
681 | }
|
682 | }
|
683 | function tick() {
|
684 | schedule_update();
|
685 | return resolved_promise;
|
686 | }
|
687 | function add_render_callback(fn) {
|
688 | render_callbacks.push(fn);
|
689 | }
|
690 | function add_flush_callback(fn) {
|
691 | flush_callbacks.push(fn);
|
692 | }
|
693 | let flushing = false;
|
694 | const seen_callbacks = new Set();
|
695 | function flush() {
|
696 | if (flushing)
|
697 | return;
|
698 | flushing = true;
|
699 | do {
|
700 |
|
701 |
|
702 | for (let i = 0; i < dirty_components.length; i += 1) {
|
703 | const component = dirty_components[i];
|
704 | set_current_component(component);
|
705 | update(component.$$);
|
706 | }
|
707 | dirty_components.length = 0;
|
708 | while (binding_callbacks.length)
|
709 | binding_callbacks.pop()();
|
710 |
|
711 |
|
712 |
|
713 | for (let i = 0; i < render_callbacks.length; i += 1) {
|
714 | const callback = render_callbacks[i];
|
715 | if (!seen_callbacks.has(callback)) {
|
716 |
|
717 | seen_callbacks.add(callback);
|
718 | callback();
|
719 | }
|
720 | }
|
721 | render_callbacks.length = 0;
|
722 | } while (dirty_components.length);
|
723 | while (flush_callbacks.length) {
|
724 | flush_callbacks.pop()();
|
725 | }
|
726 | update_scheduled = false;
|
727 | flushing = false;
|
728 | seen_callbacks.clear();
|
729 | }
|
730 | function update($$) {
|
731 | if ($$.fragment !== null) {
|
732 | $$.update();
|
733 | run_all($$.before_update);
|
734 | const dirty = $$.dirty;
|
735 | $$.dirty = [-1];
|
736 | $$.fragment && $$.fragment.p($$.ctx, dirty);
|
737 | $$.after_update.forEach(add_render_callback);
|
738 | }
|
739 | }
|
740 |
|
741 | let promise;
|
742 | function wait() {
|
743 | if (!promise) {
|
744 | promise = Promise.resolve();
|
745 | promise.then(() => {
|
746 | promise = null;
|
747 | });
|
748 | }
|
749 | return promise;
|
750 | }
|
751 | function dispatch(node, direction, kind) {
|
752 | node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));
|
753 | }
|
754 | const outroing = new Set();
|
755 | let outros;
|
756 | function group_outros() {
|
757 | outros = {
|
758 | r: 0,
|
759 | c: [],
|
760 | p: outros
|
761 | };
|
762 | }
|
763 | function check_outros() {
|
764 | if (!outros.r) {
|
765 | run_all(outros.c);
|
766 | }
|
767 | outros = outros.p;
|
768 | }
|
769 | function transition_in(block, local) {
|
770 | if (block && block.i) {
|
771 | outroing.delete(block);
|
772 | block.i(local);
|
773 | }
|
774 | }
|
775 | function transition_out(block, local, detach, callback) {
|
776 | if (block && block.o) {
|
777 | if (outroing.has(block))
|
778 | return;
|
779 | outroing.add(block);
|
780 | outros.c.push(() => {
|
781 | outroing.delete(block);
|
782 | if (callback) {
|
783 | if (detach)
|
784 | block.d(1);
|
785 | callback();
|
786 | }
|
787 | });
|
788 | block.o(local);
|
789 | }
|
790 | }
|
791 | const null_transition = { duration: 0 };
|
792 | function create_in_transition(node, fn, params) {
|
793 | let config = fn(node, params);
|
794 | let running = false;
|
795 | let animation_name;
|
796 | let task;
|
797 | let uid = 0;
|
798 | function cleanup() {
|
799 | if (animation_name)
|
800 | delete_rule(node, animation_name);
|
801 | }
|
802 | function go() {
|
803 | const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
|
804 | if (css)
|
805 | animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);
|
806 | tick(0, 1);
|
807 | const start_time = exports.now() + delay;
|
808 | const end_time = start_time + duration;
|
809 | if (task)
|
810 | task.abort();
|
811 | running = true;
|
812 | add_render_callback(() => dispatch(node, true, 'start'));
|
813 | task = loop(now => {
|
814 | if (running) {
|
815 | if (now >= end_time) {
|
816 | tick(1, 0);
|
817 | dispatch(node, true, 'end');
|
818 | cleanup();
|
819 | return running = false;
|
820 | }
|
821 | if (now >= start_time) {
|
822 | const t = easing((now - start_time) / duration);
|
823 | tick(t, 1 - t);
|
824 | }
|
825 | }
|
826 | return running;
|
827 | });
|
828 | }
|
829 | let started = false;
|
830 | return {
|
831 | start() {
|
832 | if (started)
|
833 | return;
|
834 | delete_rule(node);
|
835 | if (is_function(config)) {
|
836 | config = config();
|
837 | wait().then(go);
|
838 | }
|
839 | else {
|
840 | go();
|
841 | }
|
842 | },
|
843 | invalidate() {
|
844 | started = false;
|
845 | },
|
846 | end() {
|
847 | if (running) {
|
848 | cleanup();
|
849 | running = false;
|
850 | }
|
851 | }
|
852 | };
|
853 | }
|
854 | function create_out_transition(node, fn, params) {
|
855 | let config = fn(node, params);
|
856 | let running = true;
|
857 | let animation_name;
|
858 | const group = outros;
|
859 | group.r += 1;
|
860 | function go() {
|
861 | const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
|
862 | if (css)
|
863 | animation_name = create_rule(node, 1, 0, duration, delay, easing, css);
|
864 | const start_time = exports.now() + delay;
|
865 | const end_time = start_time + duration;
|
866 | add_render_callback(() => dispatch(node, false, 'start'));
|
867 | loop(now => {
|
868 | if (running) {
|
869 | if (now >= end_time) {
|
870 | tick(0, 1);
|
871 | dispatch(node, false, 'end');
|
872 | if (!--group.r) {
|
873 |
|
874 |
|
875 | run_all(group.c);
|
876 | }
|
877 | return false;
|
878 | }
|
879 | if (now >= start_time) {
|
880 | const t = easing((now - start_time) / duration);
|
881 | tick(1 - t, t);
|
882 | }
|
883 | }
|
884 | return running;
|
885 | });
|
886 | }
|
887 | if (is_function(config)) {
|
888 | wait().then(() => {
|
889 |
|
890 | config = config();
|
891 | go();
|
892 | });
|
893 | }
|
894 | else {
|
895 | go();
|
896 | }
|
897 | return {
|
898 | end(reset) {
|
899 | if (reset && config.tick) {
|
900 | config.tick(1, 0);
|
901 | }
|
902 | if (running) {
|
903 | if (animation_name)
|
904 | delete_rule(node, animation_name);
|
905 | running = false;
|
906 | }
|
907 | }
|
908 | };
|
909 | }
|
910 | function create_bidirectional_transition(node, fn, params, intro) {
|
911 | let config = fn(node, params);
|
912 | let t = intro ? 0 : 1;
|
913 | let running_program = null;
|
914 | let pending_program = null;
|
915 | let animation_name = null;
|
916 | function clear_animation() {
|
917 | if (animation_name)
|
918 | delete_rule(node, animation_name);
|
919 | }
|
920 | function init(program, duration) {
|
921 | const d = program.b - t;
|
922 | duration *= Math.abs(d);
|
923 | return {
|
924 | a: t,
|
925 | b: program.b,
|
926 | d,
|
927 | duration,
|
928 | start: program.start,
|
929 | end: program.start + duration,
|
930 | group: program.group
|
931 | };
|
932 | }
|
933 | function go(b) {
|
934 | const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;
|
935 | const program = {
|
936 | start: exports.now() + delay,
|
937 | b
|
938 | };
|
939 | if (!b) {
|
940 |
|
941 | program.group = outros;
|
942 | outros.r += 1;
|
943 | }
|
944 | if (running_program) {
|
945 | pending_program = program;
|
946 | }
|
947 | else {
|
948 |
|
949 |
|
950 | if (css) {
|
951 | clear_animation();
|
952 | animation_name = create_rule(node, t, b, duration, delay, easing, css);
|
953 | }
|
954 | if (b)
|
955 | tick(0, 1);
|
956 | running_program = init(program, duration);
|
957 | add_render_callback(() => dispatch(node, b, 'start'));
|
958 | loop(now => {
|
959 | if (pending_program && now > pending_program.start) {
|
960 | running_program = init(pending_program, duration);
|
961 | pending_program = null;
|
962 | dispatch(node, running_program.b, 'start');
|
963 | if (css) {
|
964 | clear_animation();
|
965 | animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);
|
966 | }
|
967 | }
|
968 | if (running_program) {
|
969 | if (now >= running_program.end) {
|
970 | tick(t = running_program.b, 1 - t);
|
971 | dispatch(node, running_program.b, 'end');
|
972 | if (!pending_program) {
|
973 |
|
974 | if (running_program.b) {
|
975 |
|
976 | clear_animation();
|
977 | }
|
978 | else {
|
979 |
|
980 | if (!--running_program.group.r)
|
981 | run_all(running_program.group.c);
|
982 | }
|
983 | }
|
984 | running_program = null;
|
985 | }
|
986 | else if (now >= running_program.start) {
|
987 | const p = now - running_program.start;
|
988 | t = running_program.a + running_program.d * easing(p / running_program.duration);
|
989 | tick(t, 1 - t);
|
990 | }
|
991 | }
|
992 | return !!(running_program || pending_program);
|
993 | });
|
994 | }
|
995 | }
|
996 | return {
|
997 | run(b) {
|
998 | if (is_function(config)) {
|
999 | wait().then(() => {
|
1000 |
|
1001 | config = config();
|
1002 | go(b);
|
1003 | });
|
1004 | }
|
1005 | else {
|
1006 | go(b);
|
1007 | }
|
1008 | },
|
1009 | end() {
|
1010 | clear_animation();
|
1011 | running_program = pending_program = null;
|
1012 | }
|
1013 | };
|
1014 | }
|
1015 |
|
1016 | function handle_promise(promise, info) {
|
1017 | const token = info.token = {};
|
1018 | function update(type, index, key, value) {
|
1019 | if (info.token !== token)
|
1020 | return;
|
1021 | info.resolved = value;
|
1022 | let child_ctx = info.ctx;
|
1023 | if (key !== undefined) {
|
1024 | child_ctx = child_ctx.slice();
|
1025 | child_ctx[key] = value;
|
1026 | }
|
1027 | const block = type && (info.current = type)(child_ctx);
|
1028 | let needs_flush = false;
|
1029 | if (info.block) {
|
1030 | if (info.blocks) {
|
1031 | info.blocks.forEach((block, i) => {
|
1032 | if (i !== index && block) {
|
1033 | group_outros();
|
1034 | transition_out(block, 1, 1, () => {
|
1035 | info.blocks[i] = null;
|
1036 | });
|
1037 | check_outros();
|
1038 | }
|
1039 | });
|
1040 | }
|
1041 | else {
|
1042 | info.block.d(1);
|
1043 | }
|
1044 | block.c();
|
1045 | transition_in(block, 1);
|
1046 | block.m(info.mount(), info.anchor);
|
1047 | needs_flush = true;
|
1048 | }
|
1049 | info.block = block;
|
1050 | if (info.blocks)
|
1051 | info.blocks[index] = block;
|
1052 | if (needs_flush) {
|
1053 | flush();
|
1054 | }
|
1055 | }
|
1056 | if (is_promise(promise)) {
|
1057 | const current_component = get_current_component();
|
1058 | promise.then(value => {
|
1059 | set_current_component(current_component);
|
1060 | update(info.then, 1, info.value, value);
|
1061 | set_current_component(null);
|
1062 | }, error => {
|
1063 | set_current_component(current_component);
|
1064 | update(info.catch, 2, info.error, error);
|
1065 | set_current_component(null);
|
1066 | });
|
1067 |
|
1068 | if (info.current !== info.pending) {
|
1069 | update(info.pending, 0);
|
1070 | return true;
|
1071 | }
|
1072 | }
|
1073 | else {
|
1074 | if (info.current !== info.then) {
|
1075 | update(info.then, 1, info.value, promise);
|
1076 | return true;
|
1077 | }
|
1078 | info.resolved = promise;
|
1079 | }
|
1080 | }
|
1081 |
|
1082 | const globals = (typeof window !== 'undefined'
|
1083 | ? window
|
1084 | : typeof globalThis !== 'undefined'
|
1085 | ? globalThis
|
1086 | : global);
|
1087 |
|
1088 | function destroy_block(block, lookup) {
|
1089 | block.d(1);
|
1090 | lookup.delete(block.key);
|
1091 | }
|
1092 | function outro_and_destroy_block(block, lookup) {
|
1093 | transition_out(block, 1, 1, () => {
|
1094 | lookup.delete(block.key);
|
1095 | });
|
1096 | }
|
1097 | function fix_and_destroy_block(block, lookup) {
|
1098 | block.f();
|
1099 | destroy_block(block, lookup);
|
1100 | }
|
1101 | function fix_and_outro_and_destroy_block(block, lookup) {
|
1102 | block.f();
|
1103 | outro_and_destroy_block(block, lookup);
|
1104 | }
|
1105 | function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {
|
1106 | let o = old_blocks.length;
|
1107 | let n = list.length;
|
1108 | let i = o;
|
1109 | const old_indexes = {};
|
1110 | while (i--)
|
1111 | old_indexes[old_blocks[i].key] = i;
|
1112 | const new_blocks = [];
|
1113 | const new_lookup = new Map();
|
1114 | const deltas = new Map();
|
1115 | i = n;
|
1116 | while (i--) {
|
1117 | const child_ctx = get_context(ctx, list, i);
|
1118 | const key = get_key(child_ctx);
|
1119 | let block = lookup.get(key);
|
1120 | if (!block) {
|
1121 | block = create_each_block(key, child_ctx);
|
1122 | block.c();
|
1123 | }
|
1124 | else if (dynamic) {
|
1125 | block.p(child_ctx, dirty);
|
1126 | }
|
1127 | new_lookup.set(key, new_blocks[i] = block);
|
1128 | if (key in old_indexes)
|
1129 | deltas.set(key, Math.abs(i - old_indexes[key]));
|
1130 | }
|
1131 | const will_move = new Set();
|
1132 | const did_move = new Set();
|
1133 | function insert(block) {
|
1134 | transition_in(block, 1);
|
1135 | block.m(node, next);
|
1136 | lookup.set(block.key, block);
|
1137 | next = block.first;
|
1138 | n--;
|
1139 | }
|
1140 | while (o && n) {
|
1141 | const new_block = new_blocks[n - 1];
|
1142 | const old_block = old_blocks[o - 1];
|
1143 | const new_key = new_block.key;
|
1144 | const old_key = old_block.key;
|
1145 | if (new_block === old_block) {
|
1146 |
|
1147 | next = new_block.first;
|
1148 | o--;
|
1149 | n--;
|
1150 | }
|
1151 | else if (!new_lookup.has(old_key)) {
|
1152 |
|
1153 | destroy(old_block, lookup);
|
1154 | o--;
|
1155 | }
|
1156 | else if (!lookup.has(new_key) || will_move.has(new_key)) {
|
1157 | insert(new_block);
|
1158 | }
|
1159 | else if (did_move.has(old_key)) {
|
1160 | o--;
|
1161 | }
|
1162 | else if (deltas.get(new_key) > deltas.get(old_key)) {
|
1163 | did_move.add(new_key);
|
1164 | insert(new_block);
|
1165 | }
|
1166 | else {
|
1167 | will_move.add(old_key);
|
1168 | o--;
|
1169 | }
|
1170 | }
|
1171 | while (o--) {
|
1172 | const old_block = old_blocks[o];
|
1173 | if (!new_lookup.has(old_block.key))
|
1174 | destroy(old_block, lookup);
|
1175 | }
|
1176 | while (n)
|
1177 | insert(new_blocks[n - 1]);
|
1178 | return new_blocks;
|
1179 | }
|
1180 | function validate_each_keys(ctx, list, get_context, get_key) {
|
1181 | const keys = new Set();
|
1182 | for (let i = 0; i < list.length; i++) {
|
1183 | const key = get_key(get_context(ctx, list, i));
|
1184 | if (keys.has(key)) {
|
1185 | throw new Error(`Cannot have duplicate keys in a keyed each`);
|
1186 | }
|
1187 | keys.add(key);
|
1188 | }
|
1189 | }
|
1190 |
|
1191 | function get_spread_update(levels, updates) {
|
1192 | const update = {};
|
1193 | const to_null_out = {};
|
1194 | const accounted_for = { $$scope: 1 };
|
1195 | let i = levels.length;
|
1196 | while (i--) {
|
1197 | const o = levels[i];
|
1198 | const n = updates[i];
|
1199 | if (n) {
|
1200 | for (const key in o) {
|
1201 | if (!(key in n))
|
1202 | to_null_out[key] = 1;
|
1203 | }
|
1204 | for (const key in n) {
|
1205 | if (!accounted_for[key]) {
|
1206 | update[key] = n[key];
|
1207 | accounted_for[key] = 1;
|
1208 | }
|
1209 | }
|
1210 | levels[i] = n;
|
1211 | }
|
1212 | else {
|
1213 | for (const key in o) {
|
1214 | accounted_for[key] = 1;
|
1215 | }
|
1216 | }
|
1217 | }
|
1218 | for (const key in to_null_out) {
|
1219 | if (!(key in update))
|
1220 | update[key] = undefined;
|
1221 | }
|
1222 | return update;
|
1223 | }
|
1224 | function get_spread_object(spread_props) {
|
1225 | return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};
|
1226 | }
|
1227 |
|
1228 |
|
1229 | const boolean_attributes = new Set([
|
1230 | 'allowfullscreen',
|
1231 | 'allowpaymentrequest',
|
1232 | 'async',
|
1233 | 'autofocus',
|
1234 | 'autoplay',
|
1235 | 'checked',
|
1236 | 'controls',
|
1237 | 'default',
|
1238 | 'defer',
|
1239 | 'disabled',
|
1240 | 'formnovalidate',
|
1241 | 'hidden',
|
1242 | 'ismap',
|
1243 | 'loop',
|
1244 | 'multiple',
|
1245 | 'muted',
|
1246 | 'nomodule',
|
1247 | 'novalidate',
|
1248 | 'open',
|
1249 | 'playsinline',
|
1250 | 'readonly',
|
1251 | 'required',
|
1252 | 'reversed',
|
1253 | 'selected'
|
1254 | ]);
|
1255 |
|
1256 | const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
|
1257 |
|
1258 |
|
1259 | function spread(args, classes_to_add) {
|
1260 | const attributes = Object.assign({}, ...args);
|
1261 | if (classes_to_add) {
|
1262 | if (attributes.class == null) {
|
1263 | attributes.class = classes_to_add;
|
1264 | }
|
1265 | else {
|
1266 | attributes.class += ' ' + classes_to_add;
|
1267 | }
|
1268 | }
|
1269 | let str = '';
|
1270 | Object.keys(attributes).forEach(name => {
|
1271 | if (invalid_attribute_name_character.test(name))
|
1272 | return;
|
1273 | const value = attributes[name];
|
1274 | if (value === true)
|
1275 | str += " " + name;
|
1276 | else if (boolean_attributes.has(name.toLowerCase())) {
|
1277 | if (value)
|
1278 | str += " " + name;
|
1279 | }
|
1280 | else if (value != null) {
|
1281 | str += ` ${name}="${String(value).replace(/"/g, '"').replace(/'/g, ''')}"`;
|
1282 | }
|
1283 | });
|
1284 | return str;
|
1285 | }
|
1286 | const escaped = {
|
1287 | '"': '"',
|
1288 | "'": ''',
|
1289 | '&': '&',
|
1290 | '<': '<',
|
1291 | '>': '>'
|
1292 | };
|
1293 | function escape(html) {
|
1294 | return String(html).replace(/["'&<>]/g, match => escaped[match]);
|
1295 | }
|
1296 | function each(items, fn) {
|
1297 | let str = '';
|
1298 | for (let i = 0; i < items.length; i += 1) {
|
1299 | str += fn(items[i], i);
|
1300 | }
|
1301 | return str;
|
1302 | }
|
1303 | const missing_component = {
|
1304 | $$render: () => ''
|
1305 | };
|
1306 | function validate_component(component, name) {
|
1307 | if (!component || !component.$$render) {
|
1308 | if (name === 'svelte:component')
|
1309 | name += ' this={...}';
|
1310 | throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);
|
1311 | }
|
1312 | return component;
|
1313 | }
|
1314 | function debug(file, line, column, values) {
|
1315 | console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`);
|
1316 | console.log(values);
|
1317 | return '';
|
1318 | }
|
1319 | let on_destroy;
|
1320 | function create_ssr_component(fn) {
|
1321 | function $$render(result, props, bindings, slots) {
|
1322 | const parent_component = exports.current_component;
|
1323 | const $$ = {
|
1324 | on_destroy,
|
1325 | context: new Map(parent_component ? parent_component.$$.context : []),
|
1326 |
|
1327 | on_mount: [],
|
1328 | before_update: [],
|
1329 | after_update: [],
|
1330 | callbacks: blank_object()
|
1331 | };
|
1332 | set_current_component({ $$ });
|
1333 | const html = fn(result, props, bindings, slots);
|
1334 | set_current_component(parent_component);
|
1335 | return html;
|
1336 | }
|
1337 | return {
|
1338 | render: (props = {}, options = {}) => {
|
1339 | on_destroy = [];
|
1340 | const result = { title: '', head: '', css: new Set() };
|
1341 | const html = $$render(result, props, {}, options);
|
1342 | run_all(on_destroy);
|
1343 | return {
|
1344 | html,
|
1345 | css: {
|
1346 | code: Array.from(result.css).map(css => css.code).join('\n'),
|
1347 | map: null
|
1348 | },
|
1349 | head: result.title + result.head
|
1350 | };
|
1351 | },
|
1352 | $$render
|
1353 | };
|
1354 | }
|
1355 | function add_attribute(name, value, boolean) {
|
1356 | if (value == null || (boolean && !value))
|
1357 | return '';
|
1358 | return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `"${value}"`}`}`;
|
1359 | }
|
1360 | function add_classes(classes) {
|
1361 | return classes ? ` class="${classes}"` : ``;
|
1362 | }
|
1363 |
|
1364 | function bind(component, name, callback) {
|
1365 | const index = component.$$.props[name];
|
1366 | if (index !== undefined) {
|
1367 | component.$$.bound[index] = callback;
|
1368 | callback(component.$$.ctx[index]);
|
1369 | }
|
1370 | }
|
1371 | function create_component(block) {
|
1372 | block && block.c();
|
1373 | }
|
1374 | function claim_component(block, parent_nodes) {
|
1375 | block && block.l(parent_nodes);
|
1376 | }
|
1377 | function mount_component(component, target, anchor) {
|
1378 | const { fragment, on_mount, on_destroy, after_update } = component.$$;
|
1379 | fragment && fragment.m(target, anchor);
|
1380 |
|
1381 | add_render_callback(() => {
|
1382 | const new_on_destroy = on_mount.map(run).filter(is_function);
|
1383 | if (on_destroy) {
|
1384 | on_destroy.push(...new_on_destroy);
|
1385 | }
|
1386 | else {
|
1387 |
|
1388 |
|
1389 | run_all(new_on_destroy);
|
1390 | }
|
1391 | component.$$.on_mount = [];
|
1392 | });
|
1393 | after_update.forEach(add_render_callback);
|
1394 | }
|
1395 | function destroy_component(component, detaching) {
|
1396 | const $$ = component.$$;
|
1397 | if ($$.fragment !== null) {
|
1398 | run_all($$.on_destroy);
|
1399 | $$.fragment && $$.fragment.d(detaching);
|
1400 |
|
1401 |
|
1402 | $$.on_destroy = $$.fragment = null;
|
1403 | $$.ctx = [];
|
1404 | }
|
1405 | }
|
1406 | function make_dirty(component, i) {
|
1407 | if (component.$$.dirty[0] === -1) {
|
1408 | dirty_components.push(component);
|
1409 | schedule_update();
|
1410 | component.$$.dirty.fill(0);
|
1411 | }
|
1412 | component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
|
1413 | }
|
1414 | function init(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) {
|
1415 | const parent_component = exports.current_component;
|
1416 | set_current_component(component);
|
1417 | const prop_values = options.props || {};
|
1418 | const $$ = component.$$ = {
|
1419 | fragment: null,
|
1420 | ctx: null,
|
1421 |
|
1422 | props,
|
1423 | update: noop,
|
1424 | not_equal,
|
1425 | bound: blank_object(),
|
1426 |
|
1427 | on_mount: [],
|
1428 | on_destroy: [],
|
1429 | before_update: [],
|
1430 | after_update: [],
|
1431 | context: new Map(parent_component ? parent_component.$$.context : []),
|
1432 |
|
1433 | callbacks: blank_object(),
|
1434 | dirty,
|
1435 | skip_bound: false
|
1436 | };
|
1437 | let ready = false;
|
1438 | $$.ctx = instance
|
1439 | ? instance(component, prop_values, (i, ret, ...rest) => {
|
1440 | const value = rest.length ? rest[0] : ret;
|
1441 | if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
1442 | if (!$$.skip_bound && $$.bound[i])
|
1443 | $$.bound[i](value);
|
1444 | if (ready)
|
1445 | make_dirty(component, i);
|
1446 | }
|
1447 | return ret;
|
1448 | })
|
1449 | : [];
|
1450 | $$.update();
|
1451 | ready = true;
|
1452 | run_all($$.before_update);
|
1453 |
|
1454 | $$.fragment = create_fragment ? create_fragment($$.ctx) : false;
|
1455 | if (options.target) {
|
1456 | if (options.hydrate) {
|
1457 | const nodes = children(options.target);
|
1458 |
|
1459 | $$.fragment && $$.fragment.l(nodes);
|
1460 | nodes.forEach(detach);
|
1461 | }
|
1462 | else {
|
1463 |
|
1464 | $$.fragment && $$.fragment.c();
|
1465 | }
|
1466 | if (options.intro)
|
1467 | transition_in(component.$$.fragment);
|
1468 | mount_component(component, options.target, options.anchor);
|
1469 | flush();
|
1470 | }
|
1471 | set_current_component(parent_component);
|
1472 | }
|
1473 | if (typeof HTMLElement === 'function') {
|
1474 | exports.SvelteElement = class extends HTMLElement {
|
1475 | constructor() {
|
1476 | super();
|
1477 | this.attachShadow({ mode: 'open' });
|
1478 | }
|
1479 | connectedCallback() {
|
1480 |
|
1481 | for (const key in this.$$.slotted) {
|
1482 |
|
1483 | this.appendChild(this.$$.slotted[key]);
|
1484 | }
|
1485 | }
|
1486 | attributeChangedCallback(attr, _oldValue, newValue) {
|
1487 | this[attr] = newValue;
|
1488 | }
|
1489 | $destroy() {
|
1490 | destroy_component(this, 1);
|
1491 | this.$destroy = noop;
|
1492 | }
|
1493 | $on(type, callback) {
|
1494 |
|
1495 | const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
|
1496 | callbacks.push(callback);
|
1497 | return () => {
|
1498 | const index = callbacks.indexOf(callback);
|
1499 | if (index !== -1)
|
1500 | callbacks.splice(index, 1);
|
1501 | };
|
1502 | }
|
1503 | $set($$props) {
|
1504 | if (this.$$set && !is_empty($$props)) {
|
1505 | this.$$.skip_bound = true;
|
1506 | this.$$set($$props);
|
1507 | this.$$.skip_bound = false;
|
1508 | }
|
1509 | }
|
1510 | };
|
1511 | }
|
1512 | class SvelteComponent {
|
1513 | $destroy() {
|
1514 | destroy_component(this, 1);
|
1515 | this.$destroy = noop;
|
1516 | }
|
1517 | $on(type, callback) {
|
1518 | const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
|
1519 | callbacks.push(callback);
|
1520 | return () => {
|
1521 | const index = callbacks.indexOf(callback);
|
1522 | if (index !== -1)
|
1523 | callbacks.splice(index, 1);
|
1524 | };
|
1525 | }
|
1526 | $set($$props) {
|
1527 | if (this.$$set && !is_empty($$props)) {
|
1528 | this.$$.skip_bound = true;
|
1529 | this.$$set($$props);
|
1530 | this.$$.skip_bound = false;
|
1531 | }
|
1532 | }
|
1533 | }
|
1534 |
|
1535 | function dispatch_dev(type, detail) {
|
1536 | document.dispatchEvent(custom_event(type, Object.assign({ version: '3.24.1' }, detail)));
|
1537 | }
|
1538 | function append_dev(target, node) {
|
1539 | dispatch_dev("SvelteDOMInsert", { target, node });
|
1540 | append(target, node);
|
1541 | }
|
1542 | function insert_dev(target, node, anchor) {
|
1543 | dispatch_dev("SvelteDOMInsert", { target, node, anchor });
|
1544 | insert(target, node, anchor);
|
1545 | }
|
1546 | function detach_dev(node) {
|
1547 | dispatch_dev("SvelteDOMRemove", { node });
|
1548 | detach(node);
|
1549 | }
|
1550 | function detach_between_dev(before, after) {
|
1551 | while (before.nextSibling && before.nextSibling !== after) {
|
1552 | detach_dev(before.nextSibling);
|
1553 | }
|
1554 | }
|
1555 | function detach_before_dev(after) {
|
1556 | while (after.previousSibling) {
|
1557 | detach_dev(after.previousSibling);
|
1558 | }
|
1559 | }
|
1560 | function detach_after_dev(before) {
|
1561 | while (before.nextSibling) {
|
1562 | detach_dev(before.nextSibling);
|
1563 | }
|
1564 | }
|
1565 | function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
|
1566 | const modifiers = options === true ? ["capture"] : options ? Array.from(Object.keys(options)) : [];
|
1567 | if (has_prevent_default)
|
1568 | modifiers.push('preventDefault');
|
1569 | if (has_stop_propagation)
|
1570 | modifiers.push('stopPropagation');
|
1571 | dispatch_dev("SvelteDOMAddEventListener", { node, event, handler, modifiers });
|
1572 | const dispose = listen(node, event, handler, options);
|
1573 | return () => {
|
1574 | dispatch_dev("SvelteDOMRemoveEventListener", { node, event, handler, modifiers });
|
1575 | dispose();
|
1576 | };
|
1577 | }
|
1578 | function attr_dev(node, attribute, value) {
|
1579 | attr(node, attribute, value);
|
1580 | if (value == null)
|
1581 | dispatch_dev("SvelteDOMRemoveAttribute", { node, attribute });
|
1582 | else
|
1583 | dispatch_dev("SvelteDOMSetAttribute", { node, attribute, value });
|
1584 | }
|
1585 | function prop_dev(node, property, value) {
|
1586 | node[property] = value;
|
1587 | dispatch_dev("SvelteDOMSetProperty", { node, property, value });
|
1588 | }
|
1589 | function dataset_dev(node, property, value) {
|
1590 | node.dataset[property] = value;
|
1591 | dispatch_dev("SvelteDOMSetDataset", { node, property, value });
|
1592 | }
|
1593 | function set_data_dev(text, data) {
|
1594 | data = '' + data;
|
1595 | if (text.wholeText === data)
|
1596 | return;
|
1597 | dispatch_dev("SvelteDOMSetData", { node: text, data });
|
1598 | text.data = data;
|
1599 | }
|
1600 | function validate_each_argument(arg) {
|
1601 | if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
|
1602 | let msg = '{#each} only iterates over array-like objects.';
|
1603 | if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
|
1604 | msg += ' You can use a spread to convert this iterable into an array.';
|
1605 | }
|
1606 | throw new Error(msg);
|
1607 | }
|
1608 | }
|
1609 | function validate_slots(name, slot, keys) {
|
1610 | for (const slot_key of Object.keys(slot)) {
|
1611 | if (!~keys.indexOf(slot_key)) {
|
1612 | console.warn(`<${name}> received an unexpected slot "${slot_key}".`);
|
1613 | }
|
1614 | }
|
1615 | }
|
1616 | class SvelteComponentDev extends SvelteComponent {
|
1617 | constructor(options) {
|
1618 | if (!options || (!options.target && !options.$$inline)) {
|
1619 | throw new Error(`'target' is a required option`);
|
1620 | }
|
1621 | super();
|
1622 | }
|
1623 | $destroy() {
|
1624 | super.$destroy();
|
1625 | this.$destroy = () => {
|
1626 | console.warn(`Component was already destroyed`);
|
1627 | };
|
1628 | }
|
1629 | $capture_state() { }
|
1630 | $inject_state() { }
|
1631 | }
|
1632 | function loop_guard(timeout) {
|
1633 | const start = Date.now();
|
1634 | return () => {
|
1635 | if (Date.now() - start > timeout) {
|
1636 | throw new Error(`Infinite loop detected`);
|
1637 | }
|
1638 | };
|
1639 | }
|
1640 |
|
1641 | exports.HtmlTag = HtmlTag;
|
1642 | exports.SvelteComponent = SvelteComponent;
|
1643 | exports.SvelteComponentDev = SvelteComponentDev;
|
1644 | exports.action_destroyer = action_destroyer;
|
1645 | exports.add_attribute = add_attribute;
|
1646 | exports.add_classes = add_classes;
|
1647 | exports.add_flush_callback = add_flush_callback;
|
1648 | exports.add_location = add_location;
|
1649 | exports.add_render_callback = add_render_callback;
|
1650 | exports.add_resize_listener = add_resize_listener;
|
1651 | exports.add_transform = add_transform;
|
1652 | exports.afterUpdate = afterUpdate;
|
1653 | exports.append = append;
|
1654 | exports.append_dev = append_dev;
|
1655 | exports.assign = assign;
|
1656 | exports.attr = attr;
|
1657 | exports.attr_dev = attr_dev;
|
1658 | exports.beforeUpdate = beforeUpdate;
|
1659 | exports.bind = bind;
|
1660 | exports.binding_callbacks = binding_callbacks;
|
1661 | exports.blank_object = blank_object;
|
1662 | exports.bubble = bubble;
|
1663 | exports.check_outros = check_outros;
|
1664 | exports.children = children;
|
1665 | exports.claim_component = claim_component;
|
1666 | exports.claim_element = claim_element;
|
1667 | exports.claim_space = claim_space;
|
1668 | exports.claim_text = claim_text;
|
1669 | exports.clear_loops = clear_loops;
|
1670 | exports.component_subscribe = component_subscribe;
|
1671 | exports.compute_rest_props = compute_rest_props;
|
1672 | exports.createEventDispatcher = createEventDispatcher;
|
1673 | exports.create_animation = create_animation;
|
1674 | exports.create_bidirectional_transition = create_bidirectional_transition;
|
1675 | exports.create_component = create_component;
|
1676 | exports.create_in_transition = create_in_transition;
|
1677 | exports.create_out_transition = create_out_transition;
|
1678 | exports.create_slot = create_slot;
|
1679 | exports.create_ssr_component = create_ssr_component;
|
1680 | exports.custom_event = custom_event;
|
1681 | exports.dataset_dev = dataset_dev;
|
1682 | exports.debug = debug;
|
1683 | exports.destroy_block = destroy_block;
|
1684 | exports.destroy_component = destroy_component;
|
1685 | exports.destroy_each = destroy_each;
|
1686 | exports.detach = detach;
|
1687 | exports.detach_after_dev = detach_after_dev;
|
1688 | exports.detach_before_dev = detach_before_dev;
|
1689 | exports.detach_between_dev = detach_between_dev;
|
1690 | exports.detach_dev = detach_dev;
|
1691 | exports.dirty_components = dirty_components;
|
1692 | exports.dispatch_dev = dispatch_dev;
|
1693 | exports.each = each;
|
1694 | exports.element = element;
|
1695 | exports.element_is = element_is;
|
1696 | exports.empty = empty;
|
1697 | exports.escape = escape;
|
1698 | exports.escaped = escaped;
|
1699 | exports.exclude_internal_props = exclude_internal_props;
|
1700 | exports.fix_and_destroy_block = fix_and_destroy_block;
|
1701 | exports.fix_and_outro_and_destroy_block = fix_and_outro_and_destroy_block;
|
1702 | exports.fix_position = fix_position;
|
1703 | exports.flush = flush;
|
1704 | exports.getContext = getContext;
|
1705 | exports.get_binding_group_value = get_binding_group_value;
|
1706 | exports.get_current_component = get_current_component;
|
1707 | exports.get_slot_changes = get_slot_changes;
|
1708 | exports.get_slot_context = get_slot_context;
|
1709 | exports.get_spread_object = get_spread_object;
|
1710 | exports.get_spread_update = get_spread_update;
|
1711 | exports.get_store_value = get_store_value;
|
1712 | exports.globals = globals;
|
1713 | exports.group_outros = group_outros;
|
1714 | exports.handle_promise = handle_promise;
|
1715 | exports.has_prop = has_prop;
|
1716 | exports.identity = identity;
|
1717 | exports.init = init;
|
1718 | exports.insert = insert;
|
1719 | exports.insert_dev = insert_dev;
|
1720 | exports.intros = intros;
|
1721 | exports.invalid_attribute_name_character = invalid_attribute_name_character;
|
1722 | exports.is_client = is_client;
|
1723 | exports.is_crossorigin = is_crossorigin;
|
1724 | exports.is_empty = is_empty;
|
1725 | exports.is_function = is_function;
|
1726 | exports.is_promise = is_promise;
|
1727 | exports.listen = listen;
|
1728 | exports.listen_dev = listen_dev;
|
1729 | exports.loop = loop;
|
1730 | exports.loop_guard = loop_guard;
|
1731 | exports.missing_component = missing_component;
|
1732 | exports.mount_component = mount_component;
|
1733 | exports.noop = noop;
|
1734 | exports.not_equal = not_equal;
|
1735 | exports.null_to_empty = null_to_empty;
|
1736 | exports.object_without_properties = object_without_properties;
|
1737 | exports.onDestroy = onDestroy;
|
1738 | exports.onMount = onMount;
|
1739 | exports.once = once;
|
1740 | exports.outro_and_destroy_block = outro_and_destroy_block;
|
1741 | exports.prevent_default = prevent_default;
|
1742 | exports.prop_dev = prop_dev;
|
1743 | exports.query_selector_all = query_selector_all;
|
1744 | exports.run = run;
|
1745 | exports.run_all = run_all;
|
1746 | exports.safe_not_equal = safe_not_equal;
|
1747 | exports.schedule_update = schedule_update;
|
1748 | exports.select_multiple_value = select_multiple_value;
|
1749 | exports.select_option = select_option;
|
1750 | exports.select_options = select_options;
|
1751 | exports.select_value = select_value;
|
1752 | exports.self = self;
|
1753 | exports.setContext = setContext;
|
1754 | exports.set_attributes = set_attributes;
|
1755 | exports.set_current_component = set_current_component;
|
1756 | exports.set_custom_element_data = set_custom_element_data;
|
1757 | exports.set_data = set_data;
|
1758 | exports.set_data_dev = set_data_dev;
|
1759 | exports.set_input_type = set_input_type;
|
1760 | exports.set_input_value = set_input_value;
|
1761 | exports.set_now = set_now;
|
1762 | exports.set_raf = set_raf;
|
1763 | exports.set_store_value = set_store_value;
|
1764 | exports.set_style = set_style;
|
1765 | exports.set_svg_attributes = set_svg_attributes;
|
1766 | exports.space = space;
|
1767 | exports.spread = spread;
|
1768 | exports.stop_propagation = stop_propagation;
|
1769 | exports.subscribe = subscribe;
|
1770 | exports.svg_element = svg_element;
|
1771 | exports.text = text;
|
1772 | exports.tick = tick;
|
1773 | exports.time_ranges_to_array = time_ranges_to_array;
|
1774 | exports.to_number = to_number;
|
1775 | exports.toggle_class = toggle_class;
|
1776 | exports.transition_in = transition_in;
|
1777 | exports.transition_out = transition_out;
|
1778 | exports.update_keyed_each = update_keyed_each;
|
1779 | exports.update_slot = update_slot;
|
1780 | exports.validate_component = validate_component;
|
1781 | exports.validate_each_argument = validate_each_argument;
|
1782 | exports.validate_each_keys = validate_each_keys;
|
1783 | exports.validate_slots = validate_slots;
|
1784 | exports.validate_store = validate_store;
|
1785 | exports.xlink_attr = xlink_attr;
|