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