1"use strict"; 2(self["webpackChunk"] = self["webpackChunk"] || []).push([[622],{ 3 4/***/ 60930: 5/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 6 7/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8/* harmony export */ BCw: () => (/* binding */ append), 9/* harmony export */ CFu: () => (/* binding */ attr), 10/* harmony export */ Dnk: () => (/* binding */ binding_callbacks), 11/* harmony export */ GYV: () => (/* binding */ check_outros), 12/* harmony export */ Hbl: () => (/* binding */ destroy_component), 13/* harmony export */ Iex: () => (/* binding */ empty), 14/* harmony export */ KTR: () => (/* binding */ listen), 15/* harmony export */ N0i: () => (/* binding */ create_component), 16/* harmony export */ ND4: () => (/* binding */ element), 17/* harmony export */ QQy: () => (/* binding */ svg_element), 18/* harmony export */ Qq7: () => (/* binding */ text), 19/* harmony export */ Rc2: () => (/* binding */ onMount), 20/* harmony export */ Tn8: () => (/* binding */ transition_out), 21/* harmony export */ TsN: () => (/* binding */ init), 22/* harmony export */ V44: () => (/* binding */ group_outros), 23/* harmony export */ YoD: () => (/* binding */ detach), 24/* harmony export */ Yry: () => (/* binding */ insert), 25/* harmony export */ c7F: () => (/* binding */ transition_in), 26/* harmony export */ f0G: () => (/* binding */ xlink_attr), 27/* harmony export */ gtX: () => (/* binding */ afterUpdate), 28/* harmony export */ hgi: () => (/* binding */ set_style), 29/* harmony export */ jXN: () => (/* binding */ safe_not_equal), 30/* harmony export */ lQ1: () => (/* binding */ noop), 31/* harmony export */ mq_: () => (/* binding */ src_url_equal), 32/* harmony export */ ppq: () => (/* binding */ destroy_each), 33/* harmony export */ r7T: () => (/* binding */ SvelteComponent), 34/* harmony export */ wSR: () => (/* binding */ mount_component), 35/* harmony export */ xem: () => (/* binding */ space) 36/* harmony export */ }); 37/* unused harmony exports HtmlTag, HtmlTagHydration, ResizeObserverSingleton, SvelteComponentDev, SvelteComponentTyped, SvelteElement, action_destroyer, add_attribute, add_classes, add_flush_callback, add_iframe_resize_listener, add_location, add_render_callback, add_styles, add_transform, append_dev, append_empty_stylesheet, append_hydration, append_hydration_dev, append_styles, assign, attr_dev, attribute_to_object, beforeUpdate, bind, blank_object, bubble, children, claim_comment, claim_component, claim_element, claim_html_tag, claim_space, claim_svg_element, claim_text, clear_loops, comment, component_subscribe, compute_rest_props, compute_slots, construct_svelte_component, construct_svelte_component_dev, contenteditable_truthy_values, createEventDispatcher, create_animation, create_bidirectional_transition, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element_is, end_hydrating, escape, escape_attribute_value, escape_object, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, flush_render_callbacks, getAllContexts, getContext, get_all_dirty_from_scope, get_binding_group_value, get_current_component, get_custom_elements_slots, get_root_for_style, get_slot_changes, get_spread_object, get_spread_update, get_store_value, globals, handle_promise, hasContext, has_prop, head_selector, identity, init_binding_group, init_binding_group_dynamic, insert_dev, insert_hydration, insert_hydration_dev, intros, invalid_attribute_name_character, is_client, is_crossorigin, is_empty, is_function, is_promise, is_void, listen_dev, loop, loop_guard, merge_ssr_styles, missing_component, not_equal, now, null_to_empty, object_without_properties, onDestroy, once, outro_and_destroy_block, prevent_default, prop_dev, query_selector_all, raf, resize_observer_border_box, resize_observer_content_box, resize_observer_device_pixel_content_box, run, run_all, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_custom_element_data_map, set_data, set_data_contenteditable, set_data_contenteditable_dev, set_data_dev, set_data_maybe_contenteditable, set_data_maybe_contenteditable_dev, set_dynamic_element_data, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_svg_attributes, split_css_unit, spread, start_hydrating, stop_immediate_propagation, stop_propagation, subscribe, tick, time_ranges_to_array, to_number, toggle_class, trusted, update_await_block_branch, update_keyed_each, update_slot, update_slot_base, validate_component, validate_dynamic_element, validate_each_argument, validate_each_keys, validate_slots, validate_store, validate_void_dynamic_element */ 38function noop() { }
39const identity = x => x; 40function assign(tar, src) { 41 // @ts-ignore 42 for (const k in src) 43 tar[k] = src[k]; 44 return tar; 45} 46// Adapted from https://github.com/then/is-promise/blob/master/index.js 47// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE 48function is_promise(value) { 49 return !!value && (typeof value === 'object' || typeof value === 'function') && typeof value.then === 'function'; 50} 51function add_location(element, file, line, column, char) { 52 element.__svelte_meta = { 53 loc: { file, line, column, char } 54 }; 55} 56function run(fn) { 57 return fn(); 58} 59function blank_object() { 60 return Object.create(null); 61} 62function run_all(fns) { 63 fns.forEach(run); 64} 65function is_function(thing) { 66 return typeof thing === 'function'; 67} 68function safe_not_equal(a, b) { 69 return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); 70} 71let src_url_equal_anchor; 72function src_url_equal(element_src, url) { 73 if (!src_url_equal_anchor) { 74 src_url_equal_anchor = document.createElement('a'); 75 } 76 src_url_equal_anchor.href = url; 77 return element_src === src_url_equal_anchor.href; 78} 79function not_equal(a, b) { 80 return a != a ? b == b : a !== b; 81} 82function is_empty(obj) { 83 return Object.keys(obj).length === 0; 84} 85function validate_store(store, name) { 86 if (store != null && typeof store.subscribe !== 'function') { 87 throw new Error(`'${name}' is not a store with a 'subscribe' method`); 88 } 89} 90function subscribe(store, ...callbacks) { 91 if (store == null) { 92 return noop; 93 } 94 const unsub = store.subscribe(...callbacks); 95 return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub; 96} 97function get_store_value(store) { 98 let value; 99 subscribe(store, _ => value = _)(); 100 return value; 101} 102function component_subscribe(component, store, callback) { 103 component.$$.on_destroy.push(subscribe(store, callback)); 104} 105function create_slot(definition, ctx, $$scope, fn) { 106 if (definition) { 107 const slot_ctx = get_slot_context(definition, ctx, $$scope, fn); 108 return definition[0](slot_ctx); 109 } 110} 111function get_slot_context(definition, ctx, $$scope, fn) { 112 return definition[1] && fn 113 ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) 114 : $$scope.ctx; 115} 116function get_slot_changes(definition, $$scope, dirty, fn) { 117 if (definition[2] && fn) { 118 const lets = definition[2](fn(dirty)); 119 if ($$scope.dirty === undefined) { 120 return lets; 121 } 122 if (typeof lets === 'object') { 123 const merged = []; 124 const len = Math.max($$scope.dirty.length, lets.length); 125 for (let i = 0; i < len; i += 1) { 126 merged[i] = $$scope.dirty[i] | lets[i]; 127 } 128 return merged; 129 } 130 return $$scope.dirty | lets; 131 } 132 return $$scope.dirty; 133} 134function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) { 135 if (slot_changes) { 136 const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn); 137 slot.p(slot_context, slot_changes); 138 } 139} 140function update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) { 141 const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn); 142 update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn); 143} 144function get_all_dirty_from_scope($$scope) { 145 if ($$scope.ctx.length > 32) { 146 const dirty = []; 147 const length = $$scope.ctx.length / 32; 148 for (let i = 0; i < length; i++) { 149 dirty[i] = -1; 150 } 151 return dirty; 152 } 153 return -1; 154} 155function exclude_internal_props(props) { 156 const result = {}; 157 for (const k in props) 158 if (k[0] !== '$') 159 result[k] = props[k]; 160 return result; 161} 162function compute_rest_props(props, keys) { 163 const rest = {}; 164 keys = new Set(keys); 165 for (const k in props) 166 if (!keys.has(k) && k[0] !== '$') 167 rest[k] = props[k]; 168 return rest; 169} 170function compute_slots(slots) { 171 const result = {}; 172 for (const key in slots) { 173 result[key] = true; 174 } 175 return result; 176} 177function once(fn) { 178 let ran = false;
179 return function (...args) { 180 if (ran) 181 return; 182 ran = true; 183 fn.call(this, ...args); 184 }; 185} 186function null_to_empty(value) { 187 return value == null ? '' : value; 188} 189function set_store_value(store, ret, value) { 190 store.set(value); 191 return ret; 192} 193const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); 194function action_destroyer(action_result) { 195 return action_result && is_function(action_result.destroy) ? action_result.destroy : noop; 196} 197function split_css_unit(value) { 198 const split = typeof value === 'string' && value.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/); 199 return split ? [parseFloat(split[1]), split[2] || 'px'] : [value, 'px']; 200} 201const contenteditable_truthy_values = (/* unused pure expression or super */ null && (['', true, 1, 'true', 'contenteditable'])); 202 203const is_client = typeof window !== 'undefined'; 204let now = (/* unused pure expression or super */ null && (is_client 205 ? () => window.performance.now() 206 : () => Date.now())); 207let raf = (/* unused pure expression or super */ null && (is_client ? cb => requestAnimationFrame(cb) : noop)); 208// used internally for testing 209function set_now(fn) { 210 now = fn; 211} 212function set_raf(fn) { 213 raf = fn; 214} 215 216const tasks = new Set(); 217function run_tasks(now) { 218 tasks.forEach(task => { 219 if (!task.c(now)) { 220 tasks.delete(task); 221 task.f(); 222 } 223 }); 224 if (tasks.size !== 0) 225 raf(run_tasks); 226} 227/** 228 * For testing purposes only! 229 */ 230function clear_loops() { 231 tasks.clear(); 232} 233/** 234 * Creates a new task that runs on each raf frame 235 * until it returns a falsy value or is aborted 236 */ 237function loop(callback) { 238 let task; 239 if (tasks.size === 0) 240 raf(run_tasks); 241 return { 242 promise: new Promise(fulfill => { 243 tasks.add(task = { c: callback, f: fulfill }); 244 }), 245 abort() { 246 tasks.delete(task); 247 } 248 }; 249} 250 251const globals = (typeof window !== 'undefined' 252 ? window 253 : typeof globalThis !== 'undefined' 254 ? globalThis 255 : global); 256 257/** 258 * Resize observer singleton. 259 * One listener per element only! 260 * https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ 261 */ 262class ResizeObserverSingleton { 263 constructor(options) { 264 this.options = options; 265 this._listeners = 'WeakMap' in globals ? new WeakMap() : undefined; 266 } 267 observe(element, listener) { 268 this._listeners.set(element, listener); 269 this._getObserver().observe(element, this.options); 270 return () => { 271 this._listeners.delete(element); 272 this._observer.unobserve(element); // this line can probably be removed 273 }; 274 } 275 _getObserver() { 276 var _a; 277 return (_a = this._observer) !== null && _a !== void 0 ? _a : (this._observer = new ResizeObserver((entries) => { 278 var _a; 279 for (const entry of entries) { 280 ResizeObserverSingleton.entries.set(entry.target, entry); 281 (_a = this._listeners.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry); 282 } 283 })); 284 } 285} 286// Needs to be written like this to pass the tree-shake-test 287ResizeObserverSingleton.entries = 'WeakMap' in globals ? new WeakMap() : undefined; 288 289// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM 290// at the end of hydration without touching the remaining nodes. 291let is_hydrating = false; 292function start_hydrating() { 293 is_hydrating = true; 294} 295function end_hydrating() { 296 is_hydrating = false; 297} 298function upper_bound(low, high, key, value) { 299 // Return first index of value larger than input value in the range [low, high) 300 while (low < high) { 301 const mid = low + ((high - low) >> 1); 302 if (key(mid) <= value) { 303 low = mid + 1; 304 } 305 else { 306 high = mid; 307 } 308 } 309 return low; 310} 311function init_hydrate(target) { 312 if (target.hydrate_init) 313 return; 314 target.hydrate_init = true; 315 // We know that all children have claim_order values since the unclaimed have been detached if target is not <head>
316 let children = target.childNodes; 317 // If target is <head>, there may be children without claim_order 318 if (target.nodeName === 'HEAD') { 319 const myChildren = []; 320 for (let i = 0; i < children.length; i++) { 321 const node = children[i]; 322 if (node.claim_order !== undefined) { 323 myChildren.push(node); 324 } 325 } 326 children = myChildren; 327 } 328 /* 329 * Reorder claimed children optimally. 330 * We can reorder claimed children optimally by finding the longest subsequence of 331 * nodes that are already claimed in order and only moving the rest. The longest 332 * subsequence of nodes that are claimed in order can be found by 333 * computing the longest increasing subsequence of .claim_order values. 334 * 335 * This algorithm is optimal in generating the least amount of reorder operations 336 * possible. 337 * 338 * Proof: 339 * We know that, given a set of reordering operations, the nodes that do not move 340 * always form an increasing subsequence, since they do not move among each other 341 * meaning that they must be already ordered among each other. Thus, the maximal 342 * set of nodes that do not move form a longest increasing subsequence. 343 */ 344 // Compute longest increasing subsequence 345 // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j 346 const m = new Int32Array(children.length + 1); 347 // Predecessor indices + 1 348 const p = new Int32Array(children.length); 349 m[0] = -1; 350 let longest = 0; 351 for (let i = 0; i < children.length; i++) { 352 const current = children[i].claim_order; 353 // Find the largest subsequence length such that it ends in a value less than our current value 354 // upper_bound returns first greater value, so we subtract one 355 // with fast path for when we are on the current longest subsequence 356 const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1; 357 p[i] = m[seqLen] + 1; 358 const newLen = seqLen + 1; 359 // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence. 360 m[newLen] = i; 361 longest = Math.max(newLen, longest); 362 } 363 // The longest increasing subsequence of nodes (initially reversed) 364 const lis = []; 365 // The rest of the nodes, nodes that will be moved 366 const toMove = []; 367 let last = children.length - 1; 368 for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) { 369 lis.push(children[cur - 1]); 370 for (; last >= cur; last--) { 371 toMove.push(children[last]); 372 } 373 last--; 374 } 375 for (; last >= 0; last--) { 376 toMove.push(children[last]); 377 } 378 lis.reverse(); 379 // We sort the nodes being moved to guarantee that their insertion order matches the claim order 380 toMove.sort((a, b) => a.claim_order - b.claim_order); 381 // Finally, we move the nodes 382 for (let i = 0, j = 0; i < toMove.length; i++) { 383 while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) { 384 j++; 385 } 386 const anchor = j < lis.length ? lis[j] : null; 387 target.insertBefore(toMove[i], anchor); 388 } 389} 390function append(target, node) { 391 target.appendChild(node); 392} 393function append_styles(target, style_sheet_id, styles) { 394 const append_styles_to = get_root_for_style(target); 395 if (!append_styles_to.getElementById(style_sheet_id)) { 396 const style = element('style'); 397 style.id = style_sheet_id; 398 style.textContent = styles; 399 append_stylesheet(append_styles_to, style); 400 } 401} 402function get_root_for_style(node) { 403 if (!node) 404 return document; 405 const root = node.getRootNode ? node.getRootNode() : node.ownerDocument; 406 if (root && root.host) { 407 return root; 408 } 409 return node.ownerDocument; 410} 411function append_empty_stylesheet(node) { 412 const style_element = element('style'); 413 append_stylesheet(get_root_for_style(node), style_element); 414 return style_element.sheet; 415} 416function append_stylesheet(node, style) { 417 append(node.head || node, style); 418 return style.sheet; 419} 420function append_hydration(target, node) { 421 if (is_hydrating) { 422 init_hydrate(target); 423 if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) { 424 target.actual_end_child = target.firstChild; 425 } 426 // Skip nodes of undefined ordering 427 while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) { 428 target.actual_end_child = target.actual_end_child.nextSibling; 429 } 430 if (node !== target.actual_end_child) { 431 // We only insert if the ordering of this node should be modified or the parent node is not target 432 if (node.claim_order !== undefined || node.parentNode !== target) { 433 target.insertBefore(node, target.actual_end_child); 434 } 435 } 436 else { 437 target.actual_end_child = node.nextSibling; 438 } 439 } 440 else if (node.parentNode !== target || node.nextSibling !== null) { 441 target.appendChild(node); 442 } 443} 444function insert(target, node, anchor) { 445 target.insertBefore(node, anchor || null); 446} 447function insert_hydration(target, node, anchor) { 448 if (is_hydrating && !anchor) { 449 append_hydration(target, node); 450 } 451 else if (node.parentNode !== target || node.nextSibling != anchor) { 452 target.insertBefore(node, anchor || null); 453 } 454} 455function detach(node) { 456 if (node.parentNode) { 457 node.parentNode.removeChild(node); 458 } 459} 460function destroy_each(iterations, detaching) { 461 for (let i = 0; i < iterations.length; i += 1) { 462 if (iterations[i]) 463 iterations[i].d(detaching); 464 } 465} 466function element(name) { 467 return document.createElement(name); 468} 469function element_is(name, is) { 470 return document.createElement(name, { is }); 471} 472function object_without_properties(obj, exclude) { 473 const target = {}; 474 for (const k in obj) { 475 if (has_prop(obj, k) 476 // @ts-ignore 477 && exclude.indexOf(k) === -1) { 478 // @ts-ignore 479 target[k] = obj[k]; 480 } 481 } 482 return target; 483}
484function svg_element(name) { 485 return document.createElementNS('http://www.w3.org/2000/svg', name); 486} 487function text(data) { 488 return document.createTextNode(data); 489} 490function space() { 491 return text(' '); 492} 493function empty() { 494 return text(''); 495} 496function comment(content) { 497 return document.createComment(content); 498} 499function listen(node, event, handler, options) { 500 node.addEventListener(event, handler, options); 501 return () => node.removeEventListener(event, handler, options); 502} 503function prevent_default(fn) { 504 return function (event) { 505 event.preventDefault(); 506 // @ts-ignore 507 return fn.call(this, event); 508 }; 509} 510function stop_propagation(fn) { 511 return function (event) { 512 event.stopPropagation(); 513 // @ts-ignore 514 return fn.call(this, event); 515 }; 516} 517function stop_immediate_propagation(fn) { 518 return function (event) { 519 event.stopImmediatePropagation(); 520 // @ts-ignore 521 return fn.call(this, event); 522 }; 523} 524function self(fn) { 525 return function (event) { 526 // @ts-ignore 527 if (event.target === this) 528 fn.call(this, event); 529 }; 530} 531function trusted(fn) { 532 return function (event) { 533 // @ts-ignore 534 if (event.isTrusted) 535 fn.call(this, event); 536 }; 537} 538function attr(node, attribute, value) { 539 if (value == null) 540 node.removeAttribute(attribute); 541 else if (node.getAttribute(attribute) !== value) 542 node.setAttribute(attribute, value); 543} 544/** 545 * List of attributes that should always be set through the attr method, 546 * because updating them through the property setter doesn't work reliably. 547 * In the example of `width`/`height`, the problem is that the setter only 548 * accepts numeric values, but the attribute can also be set to a string like `50%`. 549 * If this list becomes too big, rethink this approach. 550 */ 551const always_set_through_set_attribute = (/* unused pure expression or super */ null && (['width', 'height'])); 552function set_attributes(node, attributes) { 553 // @ts-ignore 554 const descriptors = Object.getOwnPropertyDescriptors(node.__proto__); 555 for (const key in attributes) { 556 if (attributes[key] == null) { 557 node.removeAttribute(key); 558 } 559 else if (key === 'style') { 560 node.style.cssText = attributes[key]; 561 } 562 else if (key === '__value') { 563 node.value = node[key] = attributes[key]; 564 } 565 else if (descriptors[key] && descriptors[key].set && always_set_through_set_attribute.indexOf(key) === -1) { 566 node[key] = attributes[key]; 567 } 568 else { 569 attr(node, key, attributes[key]); 570 } 571 } 572} 573function set_svg_attributes(node, attributes) { 574 for (const key in attributes) { 575 attr(node, key, attributes[key]); 576 } 577} 578function set_custom_element_data_map(node, data_map) { 579 Object.keys(data_map).forEach((key) => { 580 set_custom_element_data(node, key, data_map[key]); 581 }); 582} 583function set_custom_element_data(node, prop, value) { 584 if (prop in node) { 585 node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value; 586 } 587 else { 588 attr(node, prop, value); 589 } 590} 591function set_dynamic_element_data(tag) { 592 return (/-/.test(tag)) ? set_custom_element_data_map : set_attributes; 593} 594function xlink_attr(node, attribute, value) { 595 node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value); 596} 597function get_binding_group_value(group, __value, checked) { 598 const value = new Set(); 599 for (let i = 0; i < group.length; i += 1) { 600 if (group[i].checked) 601 value.add(group[i].__value); 602 } 603 if (!checked) { 604 value.delete(__value); 605 } 606 return Array.from(value); 607} 608function init_binding_group(group) { 609 let _inputs; 610 return { 611 /* push */ p(...inputs) { 612 _inputs = inputs; 613 _inputs.forEach(input => group.push(input)); 614 }, 615 /* remove */ r() { 616 _inputs.forEach(input => group.splice(group.indexOf(input), 1)); 617 } 618 }; 619} 620function init_binding_group_dynamic(group, indexes) { 621 let _group = get_binding_group(group); 622 let _inputs; 623 function get_binding_group(group) { 624 for (let i = 0; i < indexes.length; i++) { 625 group = group[indexes[i]] = group[indexes[i]] || []; 626 } 627 return group; 628 } 629 function push() {
630 _inputs.forEach(input => _group.push(input)); 631 } 632 function remove() { 633 _inputs.forEach(input => _group.splice(_group.indexOf(input), 1)); 634 } 635 return { 636 /* update */ u(new_indexes) { 637 indexes = new_indexes; 638 const new_group = get_binding_group(group); 639 if (new_group !== _group) { 640 remove(); 641 _group = new_group; 642 push(); 643 } 644 }, 645 /* push */ p(...inputs) { 646 _inputs = inputs; 647 push(); 648 }, 649 /* remove */ r: remove 650 }; 651} 652function to_number(value) { 653 return value === '' ? null : +value; 654} 655function time_ranges_to_array(ranges) { 656 const array = []; 657 for (let i = 0; i < ranges.length; i += 1) { 658 array.push({ start: ranges.start(i), end: ranges.end(i) }); 659 } 660 return array; 661} 662function children(element) { 663 return Array.from(element.childNodes); 664} 665function init_claim_info(nodes) { 666 if (nodes.claim_info === undefined) { 667 nodes.claim_info = { last_index: 0, total_claimed: 0 }; 668 } 669} 670function claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) { 671 // Try to find nodes in an order such that we lengthen the longest increasing subsequence 672 init_claim_info(nodes); 673 const resultNode = (() => { 674 // We first try to find an element after the previous one 675 for (let i = nodes.claim_info.last_index; i < nodes.length; i++) { 676 const node = nodes[i]; 677 if (predicate(node)) { 678 const replacement = processNode(node); 679 if (replacement === undefined) { 680 nodes.splice(i, 1); 681 } 682 else { 683 nodes[i] = replacement; 684 } 685 if (!dontUpdateLastIndex) { 686 nodes.claim_info.last_index = i; 687 } 688 return node; 689 } 690 } 691 // Otherwise, we try to find one before 692 // We iterate in reverse so that we don't go too far back 693 for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) { 694 const node = nodes[i]; 695 if (predicate(node)) { 696 const replacement = processNode(node); 697 if (replacement === undefined) { 698 nodes.splice(i, 1); 699 } 700 else { 701 nodes[i] = replacement; 702 } 703 if (!dontUpdateLastIndex) { 704 nodes.claim_info.last_index = i; 705 } 706 else if (replacement === undefined) { 707 // Since we spliced before the last_index, we decrease it 708 nodes.claim_info.last_index--; 709 } 710 return node; 711 } 712 } 713 // If we can't find any matching node, we create a new one 714 return createNode(); 715 })(); 716 resultNode.claim_order = nodes.claim_info.total_claimed; 717 nodes.claim_info.total_claimed += 1; 718 return resultNode; 719} 720function claim_element_base(nodes, name, attributes, create_element) { 721 return claim_node(nodes, (node) => node.nodeName === name, (node) => { 722 const remove = []; 723 for (let j = 0; j < node.attributes.length; j++) { 724 const attribute = node.attributes[j]; 725 if (!attributes[attribute.name]) { 726 remove.push(attribute.name); 727 } 728 } 729 remove.forEach(v => node.removeAttribute(v)); 730 return undefined; 731 }, () => create_element(name)); 732} 733function claim_element(nodes, name, attributes) { 734 return claim_element_base(nodes, name, attributes, element); 735} 736function claim_svg_element(nodes, name, attributes) { 737 return claim_element_base(nodes, name, attributes, svg_element); 738} 739function claim_text(nodes, data) { 740 return claim_node(nodes, (node) => node.nodeType === 3, (node) => { 741 const dataStr = '' + data; 742 if (node.data.startsWith(dataStr)) { 743 if (node.data.length !== dataStr.length) { 744 return node.splitText(dataStr.length); 745 } 746 } 747 else { 748 node.data = dataStr; 749 } 750 }, () => text(data), true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements 751 ); 752} 753function claim_space(nodes) { 754 return claim_text(nodes, ' '); 755} 756function claim_comment(nodes, data) { 757 return claim_node(nodes, (node) => node.nodeType === 8, (node) => { 758 node.data = '' + data; 759 return undefined; 760 }, () => comment(data), true); 761} 762function find_comment(nodes, text, start) { 763 for (let i = start; i < nodes.length; i += 1) { 764 const node = nodes[i]; 765 if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) { 766 return i; 767 } 768 } 769 return nodes.length; 770} 771function claim_html_tag(nodes, is_svg) { 772 // find html opening tag 773 const start_index = find_comment(nodes, 'HTML_TAG_START', 0); 774 const end_index = find_comment(nodes, 'HTML_TAG_END', start_index); 775 if (start_index === end_index) { 776 return new HtmlTagHydration(undefined, is_svg); 777 } 778 init_claim_info(nodes); 779 const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1); 780 detach(html_tag_nodes[0]); 781 detach(html_tag_nodes[html_tag_nodes.length - 1]); 782 const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1); 783 for (const n of claimed_nodes) { 784 n.claim_order = nodes.claim_info.total_claimed; 785 nodes.claim_info.total_claimed += 1; 786 } 787 return new HtmlTagHydration(claimed_nodes, is_svg); 788} 789function set_data(text, data) { 790 data = '' + data; 791 if (text.data === data) 792 return; 793 text.data = data; 794} 795function set_data_contenteditable(text, data) { 796 data = '' + data; 797 if (text.wholeText === data) 798 return; 799 text.data = data; 800} 801function set_data_maybe_contenteditable(text, data, attr_value) {
802 if (~contenteditable_truthy_values.indexOf(attr_value)) { 803 set_data_contenteditable(text, data); 804 } 805 else { 806 set_data(text, data); 807 } 808} 809function set_input_value(input, value) { 810 input.value = value == null ? '' : value; 811} 812function set_input_type(input, type) { 813 try { 814 input.type = type; 815 } 816 catch (e) { 817 // do nothing 818 } 819} 820function set_style(node, key, value, important) { 821 if (value == null) { 822 node.style.removeProperty(key); 823 } 824 else { 825 node.style.setProperty(key, value, important ? 'important' : ''); 826 } 827} 828function select_option(select, value, mounting) { 829 for (let i = 0; i < select.options.length; i += 1) { 830 const option = select.options[i]; 831 if (option.__value === value) { 832 option.selected = true; 833 return; 834 } 835 } 836 if (!mounting || value !== undefined) { 837 select.selectedIndex = -1; // no option should be selected 838 } 839} 840function select_options(select, value) { 841 for (let i = 0; i < select.options.length; i += 1) { 842 const option = select.options[i]; 843 option.selected = ~value.indexOf(option.__value); 844 } 845} 846function select_value(select) { 847 const selected_option = select.querySelector(':checked'); 848 return selected_option && selected_option.__value; 849} 850function select_multiple_value(select) { 851 return [].map.call(select.querySelectorAll(':checked'), option => option.__value); 852} 853// unfortunately this can't be a constant as that wouldn't be tree-shakeable 854// so we cache the result instead 855let crossorigin; 856function is_crossorigin() { 857 if (crossorigin === undefined) { 858 crossorigin = false; 859 try { 860 if (typeof window !== 'undefined' && window.parent) { 861 void window.parent.document; 862 } 863 } 864 catch (error) { 865 crossorigin = true; 866 } 867 } 868 return crossorigin; 869} 870function add_iframe_resize_listener(node, fn) { 871 const computed_style = getComputedStyle(node); 872 if (computed_style.position === 'static') { 873 node.style.position = 'relative'; 874 } 875 const iframe = element('iframe'); 876 iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' + 877 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;'); 878 iframe.setAttribute('aria-hidden', 'true'); 879 iframe.tabIndex = -1; 880 const crossorigin = is_crossorigin(); 881 let unsubscribe; 882 if (crossorigin) { 883 iframe.src = "data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>"; 884 unsubscribe = listen(window, 'message', (event) => { 885 if (event.source === iframe.contentWindow) 886 fn(); 887 }); 888 } 889 else { 890 iframe.src = 'about:blank'; 891 iframe.onload = () => { 892 unsubscribe = listen(iframe.contentWindow, 'resize', fn); 893 // make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous) 894 // see https://github.com/sveltejs/svelte/issues/4233 895 fn(); 896 }; 897 } 898 append(node, iframe); 899 return () => { 900 if (crossorigin) { 901 unsubscribe(); 902 } 903 else if (unsubscribe && iframe.contentWindow) { 904 unsubscribe(); 905 } 906 detach(iframe); 907 }; 908} 909const resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'content-box' }); 910const resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'border-box' }); 911const resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'device-pixel-content-box' }); 912function toggle_class(element, name, toggle) { 913 element.classList[toggle ? 'add' : 'remove'](name); 914} 915function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) { 916 const e = document.createEvent('CustomEvent'); 917 e.initCustomEvent(type, bubbles, cancelable, detail); 918 return e; 919} 920function query_selector_all(selector, parent = document.body) { 921 return Array.from(parent.querySelectorAll(selector)); 922} 923function head_selector(nodeId, head) { 924 const result = []; 925 let started = 0; 926 for (const node of head.childNodes) { 927 if (node.nodeType === 8 /* comment node */) { 928 const comment = node.textContent.trim(); 929 if (comment === `HEAD_${nodeId}_END`) { 930 started -= 1; 931 result.push(node); 932 } 933 else if (comment === `HEAD_${nodeId}_START`) { 934 started += 1; 935 result.push(node); 936 } 937 } 938 else if (started > 0) { 939 result.push(node); 940 } 941 } 942 return result; 943} 944class HtmlTag { 945 constructor(is_svg = false) { 946 this.is_svg = false;
947 this.is_svg = is_svg; 948 this.e = this.n = null; 949 } 950 c(html) { 951 this.h(html); 952 } 953 m(html, target, anchor = null) { 954 if (!this.e) { 955 if (this.is_svg) 956 this.e = svg_element(target.nodeName); 957 /** #7364 target for <template> may be provided as #document-fragment(11) */ 958 else 959 this.e = element((target.nodeType === 11 ? 'TEMPLATE' : target.nodeName)); 960 this.t = target.tagName !== 'TEMPLATE' ? target : target.content; 961 this.c(html); 962 } 963 this.i(anchor); 964 } 965 h(html) { 966 this.e.innerHTML = html; 967 this.n = Array.from(this.e.nodeName === 'TEMPLATE' ? this.e.content.childNodes : this.e.childNodes); 968 } 969 i(anchor) { 970 for (let i = 0; i < this.n.length; i += 1) { 971 insert(this.t, this.n[i], anchor); 972 } 973 } 974 p(html) { 975 this.d(); 976 this.h(html); 977 this.i(this.a); 978 } 979 d() { 980 this.n.forEach(detach); 981 } 982} 983class HtmlTagHydration extends HtmlTag { 984 constructor(claimed_nodes, is_svg = false) { 985 super(is_svg); 986 this.e = this.n = null; 987 this.l = claimed_nodes; 988 } 989 c(html) { 990 if (this.l) { 991 this.n = this.l; 992 } 993 else { 994 super.c(html); 995 } 996 } 997 i(anchor) { 998 for (let i = 0; i < this.n.length; i += 1) { 999 insert_hydration(this.t, this.n[i], anchor); 1000 } 1001 } 1002} 1003function attribute_to_object(attributes) { 1004 const result = {}; 1005 for (const attribute of attributes) { 1006 result[attribute.name] = attribute.value; 1007 } 1008 return result; 1009} 1010function get_custom_elements_slots(element) { 1011 const result = {}; 1012 element.childNodes.forEach((node) => { 1013 result[node.slot || 'default'] = true; 1014 }); 1015 return result; 1016} 1017function construct_svelte_component(component, props) { 1018 return new component(props); 1019} 1020 1021// we need to store the information for multiple documents because a Svelte application could also contain iframes 1022// https://github.com/sveltejs/svelte/issues/3624 1023const managed_styles = new Map(); 1024let active = 0; 1025// https://github.com/darkskyapp/string-hash/blob/master/index.js 1026function hash(str) { 1027 let hash = 5381; 1028 let i = str.length; 1029 while (i--) 1030 hash = ((hash << 5) - hash) ^ str.charCodeAt(i); 1031 return hash >>> 0; 1032} 1033function create_style_information(doc, node) { 1034 const info = { stylesheet: append_empty_stylesheet(node), rules: {} }; 1035 managed_styles.set(doc, info); 1036 return info; 1037} 1038function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) { 1039 const step = 16.666 / duration; 1040 let keyframes = '{\n'; 1041 for (let p = 0; p <= 1; p += step) { 1042 const t = a + (b - a) * ease(p); 1043 keyframes += p * 100 + `%{${fn(t, 1 - t)}}\n`; 1044 } 1045 const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`; 1046 const name = `__svelte_${hash(rule)}_${uid}`; 1047 const doc = get_root_for_style(node); 1048 const { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node); 1049 if (!rules[name]) { 1050 rules[name] = true; 1051 stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length); 1052 } 1053 const animation = node.style.animation || ''; 1054 node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`; 1055 active += 1; 1056 return name; 1057} 1058function delete_rule(node, name) { 1059 const previous = (node.style.animation || '').split(', '); 1060 const next = previous.filter(name 1061 ? anim => anim.indexOf(name) < 0 // remove specific animation 1062 : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations 1063 ); 1064 const deleted = previous.length - next.length; 1065 if (deleted) { 1066 node.style.animation = next.join(', '); 1067 active -= deleted; 1068 if (!active) 1069 clear_rules(); 1070 } 1071} 1072function clear_rules() { 1073 raf(() => { 1074 if (active) 1075 return; 1076 managed_styles.forEach(info => { 1077 const { ownerNode } = info.stylesheet; 1078 // there is no ownerNode if it runs on jsdom. 1079 if (ownerNode) 1080 detach(ownerNode); 1081 }); 1082 managed_styles.clear(); 1083 }); 1084} 1085 1086function create_animation(node, from, fn, params) { 1087 if (!from) 1088 return noop; 1089 const to = node.getBoundingClientRect(); 1090 if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom) 1091 return noop;
vendor: 4,814 bytes, lines 1092-1224
1092 const { delay = 0, duration = 300, easing = identity, 1093 // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation? 1094 start: start_time = now() + delay, 1095 // @ts-ignore todo: 1096 end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params); 1097 let running = true; 1098 let started = false; 1099 let name; 1100 function start() { 1101 if (css) { 1102 name = create_rule(node, 0, 1, duration, delay, easing, css); 1103 } 1104 if (!delay) { 1105 started = true; 1106 } 1107 } 1108 function stop() { 1109 if (css) 1110 delete_rule(node, name); 1111 running = false; 1112 } 1113 loop(now => { 1114 if (!started && now >= start_time) { 1115 started = true; 1116 } 1117 if (started && now >= end) { 1118 tick(1, 0); 1119 stop(); 1120 } 1121 if (!running) { 1122 return false; 1123 } 1124 if (started) { 1125 const p = now - start_time; 1126 const t = 0 + 1 * easing(p / duration); 1127 tick(t, 1 - t); 1128 } 1129 return true; 1130 }); 1131 start(); 1132 tick(0, 1); 1133 return stop; 1134} 1135function fix_position(node) { 1136 const style = getComputedStyle(node); 1137 if (style.position !== 'absolute' && style.position !== 'fixed') { 1138 const { width, height } = style; 1139 const a = node.getBoundingClientRect(); 1140 node.style.position = 'absolute'; 1141 node.style.width = width; 1142 node.style.height = height; 1143 add_transform(node, a); 1144 } 1145} 1146function add_transform(node, a) { 1147 const b = node.getBoundingClientRect(); 1148 if (a.left !== b.left || a.top !== b.top) { 1149 const style = getComputedStyle(node); 1150 const transform = style.transform === 'none' ? '' : style.transform; 1151 node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`; 1152 } 1153} 1154 1155let current_component; 1156function set_current_component(component) { 1157 current_component = component; 1158} 1159function get_current_component() { 1160 if (!current_component) 1161 throw new Error('Function called outside component initialization'); 1162 return current_component; 1163} 1164/** 1165 * Schedules a callback to run immediately before the component is updated after any state change. 1166 * 1167 * The first time the callback runs will be before the initial `onMount` 1168 * 1169 * https://svelte.dev/docs#run-time-svelte-beforeupdate 1170 */ 1171function beforeUpdate(fn) { 1172 get_current_component().$$.before_update.push(fn); 1173} 1174/** 1175 * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM. 1176 * It must be called during the component's initialisation (but doesn't need to live *inside* the component; 1177 * it can be called from an external module). 1178 * 1179 * `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api). 1180 * 1181 * https://svelte.dev/docs#run-time-svelte-onmount 1182 */ 1183function onMount(fn) { 1184 get_current_component().$$.on_mount.push(fn); 1185} 1186/** 1187 * Schedules a callback to run immediately after the component has been updated. 1188 * 1189 * The first time the callback runs will be after the initial `onMount` 1190 */ 1191function afterUpdate(fn) { 1192 get_current_component().$$.after_update.push(fn); 1193} 1194/** 1195 * Schedules a callback to run immediately before the component is unmounted. 1196 * 1197 * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the 1198 * only one that runs inside a server-side component. 1199 * 1200 * https://svelte.dev/docs#run-time-svelte-ondestroy 1201 */ 1202function onDestroy(fn) { 1203 get_current_component().$$.on_destroy.push(fn); 1204} 1205/** 1206 * Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname). 1207 * Event dispatchers are functions that can take two arguments: `name` and `detail`. 1208 * 1209 * Component events created with `createEventDispatcher` create a 1210 * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent). 1211 * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture). 1212 * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail) 1213 * property and can contain any type of data. 1214 * 1215 * https://svelte.dev/docs#run-time-svelte-createeventdispatcher 1216 */ 1217function createEventDispatcher() { 1218 const component = get_current_component(); 1219 return (type, detail, { cancelable = false } = {}) => { 1220 const callbacks = component.$$.callbacks[type]; 1221 if (callbacks) { 1222 // TODO are there situations where events could be dispatched 1223 // in a server (non-DOM) environment? 1224 const event = custom_event(type, detail, { cancelable });
1225 callbacks.slice().forEach(fn => { 1226 fn.call(component, event); 1227 }); 1228 return !event.defaultPrevented; 1229 } 1230 return true; 1231 }; 1232} 1233/** 1234 * Associates an arbitrary `context` object with the current component and the specified `key` 1235 * and returns that object. The context is then available to children of the component 1236 * (including slotted content) with `getContext`. 1237 * 1238 * Like lifecycle functions, this must be called during component initialisation. 1239 * 1240 * https://svelte.dev/docs#run-time-svelte-setcontext 1241 */ 1242function setContext(key, context) { 1243 get_current_component().$$.context.set(key, context); 1244 return context; 1245} 1246/** 1247 * Retrieves the context that belongs to the closest parent component with the specified `key`. 1248 * Must be called during component initialisation. 1249 * 1250 * https://svelte.dev/docs#run-time-svelte-getcontext 1251 */ 1252function getContext(key) { 1253 return get_current_component().$$.context.get(key); 1254} 1255/** 1256 * Retrieves the whole context map that belongs to the closest parent component. 1257 * Must be called during component initialisation. Useful, for example, if you 1258 * programmatically create a component and want to pass the existing context to it. 1259 * 1260 * https://svelte.dev/docs#run-time-svelte-getallcontexts 1261 */ 1262function getAllContexts() { 1263 return get_current_component().$$.context; 1264} 1265/** 1266 * Checks whether a given `key` has been set in the context of a parent component. 1267 * Must be called during component initialisation. 1268 * 1269 * https://svelte.dev/docs#run-time-svelte-hascontext 1270 */ 1271function hasContext(key) { 1272 return get_current_component().$$.context.has(key); 1273} 1274// TODO figure out if we still want to support 1275// shorthand events, or if we want to implement 1276// a real bubbling mechanism 1277function bubble(component, event) { 1278 const callbacks = component.$$.callbacks[event.type]; 1279 if (callbacks) { 1280 // @ts-ignore 1281 callbacks.slice().forEach(fn => fn.call(this, event)); 1282 } 1283} 1284 1285const dirty_components = []; 1286const intros = { enabled: false }; 1287const binding_callbacks = []; 1288let render_callbacks = []; 1289const flush_callbacks = []; 1290const resolved_promise = /* @__PURE__ */ Promise.resolve(); 1291let update_scheduled = false; 1292function schedule_update() { 1293 if (!update_scheduled) { 1294 update_scheduled = true; 1295 resolved_promise.then(flush); 1296 } 1297} 1298function tick() { 1299 schedule_update(); 1300 return resolved_promise; 1301} 1302function add_render_callback(fn) { 1303 render_callbacks.push(fn); 1304} 1305function add_flush_callback(fn) { 1306 flush_callbacks.push(fn); 1307} 1308// flush() calls callbacks in this order: 1309// 1. All beforeUpdate callbacks, in order: parents before children 1310// 2. All bind:this callbacks, in reverse order: children before parents. 1311// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT 1312// for afterUpdates called during the initial onMount, which are called in 1313// reverse order: children before parents. 1314// Since callbacks might update component values, which could trigger another 1315// call to flush(), the following steps guard against this: 1316// 1. During beforeUpdate, any updated components will be added to the 1317// dirty_components array and will cause a reentrant call to flush(). Because 1318// the flush index is kept outside the function, the reentrant call will pick 1319// up where the earlier call left off and go through all dirty components. The 1320// current_component value is saved and restored so that the reentrant call will 1321// not interfere with the "parent" flush() call. 1322// 2. bind:this callbacks cannot trigger new flush() calls. 1323// 3. During afterUpdate, any updated components will NOT have their afterUpdate 1324// callback called a second time; the seen_callbacks set, outside the flush() 1325// function, guarantees this behavior. 1326const seen_callbacks = new Set(); 1327let flushidx = 0; // Do *not* move this inside the flush() function 1328function flush() { 1329 // Do not reenter flush while dirty components are updated, as this can 1330 // result in an infinite loop. Instead, let the inner flush handle it. 1331 // Reentrancy is ok afterwards for bindings etc. 1332 if (flushidx !== 0) { 1333 return; 1334 } 1335 const saved_component = current_component; 1336 do { 1337 // first, call beforeUpdate functions 1338 // and update components 1339 try { 1340 while (flushidx < dirty_components.length) { 1341 const component = dirty_components[flushidx]; 1342 flushidx++; 1343 set_current_component(component); 1344 update(component.$$); 1345 } 1346 } 1347 catch (e) { 1348 // reset dirty state to not end up in a deadlocked state and then rethrow 1349 dirty_components.length = 0; 1350 flushidx = 0; 1351 throw e; 1352 } 1353 set_current_component(null); 1354 dirty_components.length = 0; 1355 flushidx = 0; 1356 while (binding_callbacks.length) 1357 binding_callbacks.pop()(); 1358 // then, once components are updated, call 1359 // afterUpdate functions. This may cause 1360 // subsequent updates... 1361 for (let i = 0; i < render_callbacks.length; i += 1) { 1362 const callback = render_callbacks[i]; 1363 if (!seen_callbacks.has(callback)) { 1364 // ...so guard against infinite loops 1365 seen_callbacks.add(callback); 1366 callback(); 1367 } 1368 } 1369 render_callbacks.length = 0; 1370 }
vendor: 4,155 bytes, lines 1370-1524
1370 while (dirty_components.length); 1371 while (flush_callbacks.length) { 1372 flush_callbacks.pop()(); 1373 } 1374 update_scheduled = false; 1375 seen_callbacks.clear(); 1376 set_current_component(saved_component); 1377} 1378function update($$) { 1379 if ($$.fragment !== null) { 1380 $$.update(); 1381 run_all($$.before_update); 1382 const dirty = $$.dirty; 1383 $$.dirty = [-1]; 1384 $$.fragment && $$.fragment.p($$.ctx, dirty); 1385 $$.after_update.forEach(add_render_callback); 1386 } 1387} 1388/** 1389 * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`. 1390 */ 1391function flush_render_callbacks(fns) { 1392 const filtered = []; 1393 const targets = []; 1394 render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)); 1395 targets.forEach((c) => c()); 1396 render_callbacks = filtered; 1397} 1398 1399let promise; 1400function wait() { 1401 if (!promise) { 1402 promise = Promise.resolve(); 1403 promise.then(() => { 1404 promise = null; 1405 }); 1406 } 1407 return promise; 1408} 1409function dispatch(node, direction, kind) { 1410 node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`)); 1411} 1412const outroing = new Set(); 1413let outros; 1414function group_outros() { 1415 outros = { 1416 r: 0, 1417 c: [], 1418 p: outros // parent group 1419 }; 1420} 1421function check_outros() { 1422 if (!outros.r) { 1423 run_all(outros.c); 1424 } 1425 outros = outros.p; 1426} 1427function transition_in(block, local) { 1428 if (block && block.i) { 1429 outroing.delete(block); 1430 block.i(local); 1431 } 1432} 1433function transition_out(block, local, detach, callback) { 1434 if (block && block.o) { 1435 if (outroing.has(block)) 1436 return; 1437 outroing.add(block); 1438 outros.c.push(() => { 1439 outroing.delete(block); 1440 if (callback) { 1441 if (detach) 1442 block.d(1); 1443 callback(); 1444 } 1445 }); 1446 block.o(local); 1447 } 1448 else if (callback) { 1449 callback(); 1450 } 1451} 1452const null_transition = { duration: 0 }; 1453function create_in_transition(node, fn, params) { 1454 const options = { direction: 'in' }; 1455 let config = fn(node, params, options); 1456 let running = false; 1457 let animation_name; 1458 let task; 1459 let uid = 0; 1460 function cleanup() { 1461 if (animation_name) 1462 delete_rule(node, animation_name); 1463 } 1464 function go() { 1465 const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition; 1466 if (css) 1467 animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++); 1468 tick(0, 1); 1469 const start_time = now() + delay; 1470 const end_time = start_time + duration; 1471 if (task) 1472 task.abort(); 1473 running = true; 1474 add_render_callback(() => dispatch(node, true, 'start')); 1475 task = loop(now => { 1476 if (running) { 1477 if (now >= end_time) { 1478 tick(1, 0); 1479 dispatch(node, true, 'end'); 1480 cleanup(); 1481 return running = false; 1482 } 1483 if (now >= start_time) { 1484 const t = easing((now - start_time) / duration); 1485 tick(t, 1 - t); 1486 } 1487 } 1488 return running; 1489 }); 1490 } 1491 let started = false; 1492 return { 1493 start() { 1494 if (started) 1495 return; 1496 started = true; 1497 delete_rule(node); 1498 if (is_function(config)) { 1499 config = config(options); 1500 wait().then(go); 1501 } 1502 else { 1503 go(); 1504 } 1505 }, 1506 invalidate() { 1507 started = false; 1508 }, 1509 end() { 1510 if (running) { 1511 cleanup(); 1512 running = false; 1513 } 1514 } 1515 }; 1516} 1517function create_out_transition(node, fn, params) { 1518 const options = { direction: 'out' }; 1519 let config = fn(node, params, options); 1520 let running = true; 1521 let animation_name; 1522 const group = outros; 1523 group.r += 1; 1524 function go() {
1525 const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition; 1526 if (css) 1527 animation_name = create_rule(node, 1, 0, duration, delay, easing, css); 1528 const start_time = now() + delay; 1529 const end_time = start_time + duration; 1530 add_render_callback(() => dispatch(node, false, 'start')); 1531 loop(now => { 1532 if (running) { 1533 if (now >= end_time) { 1534 tick(0, 1); 1535 dispatch(node, false, 'end'); 1536 if (!--group.r) { 1537 // this will result in `end()` being called, 1538 // so we don't need to clean up here 1539 run_all(group.c); 1540 } 1541 return false; 1542 } 1543 if (now >= start_time) { 1544 const t = easing((now - start_time) / duration); 1545 tick(1 - t, t); 1546 } 1547 } 1548 return running; 1549 }); 1550 } 1551 if (is_function(config)) { 1552 wait().then(() => { 1553 // @ts-ignore 1554 config = config(options); 1555 go(); 1556 }); 1557 } 1558 else { 1559 go(); 1560 } 1561 return { 1562 end(reset) { 1563 if (reset && config.tick) { 1564 config.tick(1, 0); 1565 } 1566 if (running) { 1567 if (animation_name) 1568 delete_rule(node, animation_name); 1569 running = false; 1570 } 1571 } 1572 }; 1573} 1574function create_bidirectional_transition(node, fn, params, intro) { 1575 const options = { direction: 'both' }; 1576 let config = fn(node, params, options); 1577 let t = intro ? 0 : 1; 1578 let running_program = null; 1579 let pending_program = null; 1580 let animation_name = null; 1581 function clear_animation() { 1582 if (animation_name) 1583 delete_rule(node, animation_name); 1584 } 1585 function init(program, duration) { 1586 const d = (program.b - t); 1587 duration *= Math.abs(d); 1588 return { 1589 a: t, 1590 b: program.b, 1591 d, 1592 duration, 1593 start: program.start, 1594 end: program.start + duration, 1595 group: program.group 1596 }; 1597 } 1598 function go(b) { 1599 const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition; 1600 const program = { 1601 start: now() + delay, 1602 b 1603 }; 1604 if (!b) { 1605 // @ts-ignore todo: improve typings 1606 program.group = outros; 1607 outros.r += 1; 1608 } 1609 if (running_program || pending_program) { 1610 pending_program = program; 1611 } 1612 else { 1613 // if this is an intro, and there's a delay, we need to do 1614 // an initial tick and/or apply CSS animation immediately 1615 if (css) { 1616 clear_animation(); 1617 animation_name = create_rule(node, t, b, duration, delay, easing, css); 1618 } 1619 if (b) 1620 tick(0, 1); 1621 running_program = init(program, duration); 1622 add_render_callback(() => dispatch(node, b, 'start')); 1623 loop(now => { 1624 if (pending_program && now > pending_program.start) { 1625 running_program = init(pending_program, duration); 1626 pending_program = null; 1627 dispatch(node, running_program.b, 'start'); 1628 if (css) { 1629 clear_animation(); 1630 animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css); 1631 } 1632 } 1633 if (running_program) { 1634 if (now >= running_program.end) { 1635 tick(t = running_program.b, 1 - t); 1636 dispatch(node, running_program.b, 'end'); 1637 if (!pending_program) { 1638 // we're done 1639 if (running_program.b) { 1640 // intro — we can tidy up immediately 1641 clear_animation(); 1642 } 1643 else { 1644 // outro — needs to be coordinated 1645 if (!--running_program.group.r) 1646 run_all(running_program.group.c); 1647 } 1648 } 1649 running_program = null; 1650 } 1651 else if (now >= running_program.start) { 1652 const p = now - running_program.start; 1653 t = running_program.a + running_program.d * easing(p / running_program.duration); 1654 tick(t, 1 - t); 1655 } 1656 } 1657 return !!(running_program || pending_program); 1658 }); 1659 } 1660 } 1661 return { 1662 run(b) { 1663 if (is_function(config)) { 1664 wait().then(() => { 1665 // @ts-ignore 1666 config = config(options); 1667 go(b); 1668 }); 1669 } 1670 else { 1671 go(b); 1672 } 1673 }, 1674 end() { 1675 clear_animation(); 1676 running_program = pending_program = null; 1677 } 1678 }; 1679} 1680 1681function handle_promise(promise, info) { 1682 const token = info.token = {}; 1683 function update(type, index, key, value) { 1684 if (info.token !== token) 1685 return; 1686 info.resolved = value; 1687 let child_ctx = info.ctx; 1688 if (key !== undefined) { 1689 child_ctx = child_ctx.slice(); 1690 child_ctx[key] = value; 1691 } 1692 const block = type && (info.current = type)(child_ctx); 1693 let needs_flush = false;
1694 if (info.block) { 1695 if (info.blocks) { 1696 info.blocks.forEach((block, i) => { 1697 if (i !== index && block) { 1698 group_outros(); 1699 transition_out(block, 1, 1, () => { 1700 if (info.blocks[i] === block) { 1701 info.blocks[i] = null; 1702 } 1703 }); 1704 check_outros(); 1705 } 1706 }); 1707 } 1708 else { 1709 info.block.d(1); 1710 } 1711 block.c(); 1712 transition_in(block, 1); 1713 block.m(info.mount(), info.anchor); 1714 needs_flush = true; 1715 } 1716 info.block = block; 1717 if (info.blocks) 1718 info.blocks[index] = block; 1719 if (needs_flush) { 1720 flush(); 1721 } 1722 } 1723 if (is_promise(promise)) { 1724 const current_component = get_current_component(); 1725 promise.then(value => { 1726 set_current_component(current_component); 1727 update(info.then, 1, info.value, value); 1728 set_current_component(null); 1729 }, error => { 1730 set_current_component(current_component); 1731 update(info.catch, 2, info.error, error); 1732 set_current_component(null); 1733 if (!info.hasCatch) { 1734 throw error; 1735 } 1736 }); 1737 // if we previously had a then/catch block, destroy it 1738 if (info.current !== info.pending) { 1739 update(info.pending, 0); 1740 return true; 1741 } 1742 } 1743 else { 1744 if (info.current !== info.then) { 1745 update(info.then, 1, info.value, promise); 1746 return true; 1747 } 1748 info.resolved = promise; 1749 } 1750} 1751function update_await_block_branch(info, ctx, dirty) { 1752 const child_ctx = ctx.slice(); 1753 const { resolved } = info; 1754 if (info.current === info.then) { 1755 child_ctx[info.value] = resolved; 1756 } 1757 if (info.current === info.catch) { 1758 child_ctx[info.error] = resolved; 1759 } 1760 info.block.p(child_ctx, dirty); 1761} 1762 1763function destroy_block(block, lookup) { 1764 block.d(1); 1765 lookup.delete(block.key); 1766} 1767function outro_and_destroy_block(block, lookup) { 1768 transition_out(block, 1, 1, () => { 1769 lookup.delete(block.key); 1770 }); 1771} 1772function fix_and_destroy_block(block, lookup) { 1773 block.f(); 1774 destroy_block(block, lookup); 1775} 1776function fix_and_outro_and_destroy_block(block, lookup) { 1777 block.f(); 1778 outro_and_destroy_block(block, lookup); 1779} 1780function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) { 1781 let o = old_blocks.length; 1782 let n = list.length; 1783 let i = o; 1784 const old_indexes = {}; 1785 while (i--) 1786 old_indexes[old_blocks[i].key] = i; 1787 const new_blocks = []; 1788 const new_lookup = new Map(); 1789 const deltas = new Map(); 1790 const updates = []; 1791 i = n; 1792 while (i--) { 1793 const child_ctx = get_context(ctx, list, i); 1794 const key = get_key(child_ctx); 1795 let block = lookup.get(key); 1796 if (!block) { 1797 block = create_each_block(key, child_ctx); 1798 block.c(); 1799 } 1800 else if (dynamic) { 1801 // defer updates until all the DOM shuffling is done 1802 updates.push(() => block.p(child_ctx, dirty)); 1803 } 1804 new_lookup.set(key, new_blocks[i] = block); 1805 if (key in old_indexes) 1806 deltas.set(key, Math.abs(i - old_indexes[key])); 1807 } 1808 const will_move = new Set(); 1809 const did_move = new Set(); 1810 function insert(block) { 1811 transition_in(block, 1); 1812 block.m(node, next); 1813 lookup.set(block.key, block); 1814 next = block.first; 1815 n--; 1816 } 1817 while (o && n) { 1818 const new_block = new_blocks[n - 1]; 1819 const old_block = old_blocks[o - 1]; 1820 const new_key = new_block.key; 1821 const old_key = old_block.key; 1822 if (new_block === old_block) { 1823 // do nothing 1824 next = new_block.first; 1825 o--; 1826 n--; 1827 } 1828 else if (!new_lookup.has(old_key)) { 1829 // remove old block 1830 destroy(old_block, lookup); 1831 o--; 1832 } 1833 else if (!lookup.has(new_key) || will_move.has(new_key)) { 1834 insert(new_block); 1835 } 1836 else if (did_move.has(old_key)) { 1837 o--; 1838 } 1839 else if (deltas.get(new_key) > deltas.get(old_key)) { 1840 did_move.add(new_key); 1841 insert(new_block); 1842 } 1843 else { 1844 will_move.add(old_key); 1845 o--; 1846 } 1847 } 1848 while (o--) { 1849 const old_block = old_blocks[o]; 1850 if (!new_lookup.has(old_block.key)) 1851 destroy(old_block, lookup); 1852 } 1853 while (n) 1854 insert(new_blocks[n - 1]); 1855 run_all(updates); 1856 return new_blocks; 1857} 1858function validate_each_keys(ctx, list, get_context, get_key) {
1859 const keys = new Set(); 1860 for (let i = 0; i < list.length; i++) { 1861 const key = get_key(get_context(ctx, list, i)); 1862 if (keys.has(key)) { 1863 throw new Error('Cannot have duplicate keys in a keyed each'); 1864 } 1865 keys.add(key); 1866 } 1867} 1868 1869function get_spread_update(levels, updates) { 1870 const update = {}; 1871 const to_null_out = {}; 1872 const accounted_for = { $$scope: 1 }; 1873 let i = levels.length; 1874 while (i--) { 1875 const o = levels[i]; 1876 const n = updates[i]; 1877 if (n) { 1878 for (const key in o) { 1879 if (!(key in n)) 1880 to_null_out[key] = 1; 1881 } 1882 for (const key in n) { 1883 if (!accounted_for[key]) { 1884 update[key] = n[key]; 1885 accounted_for[key] = 1; 1886 } 1887 } 1888 levels[i] = n; 1889 } 1890 else { 1891 for (const key in o) { 1892 accounted_for[key] = 1; 1893 } 1894 } 1895 } 1896 for (const key in to_null_out) { 1897 if (!(key in update)) 1898 update[key] = undefined; 1899 } 1900 return update; 1901} 1902function get_spread_object(spread_props) { 1903 return typeof spread_props === 'object' && spread_props !== null ? spread_props : {}; 1904} 1905 1906const _boolean_attributes = [ 1907 'allowfullscreen', 1908 'allowpaymentrequest', 1909 'async', 1910 'autofocus', 1911 'autoplay', 1912 'checked', 1913 'controls', 1914 'default', 1915 'defer', 1916 'disabled', 1917 'formnovalidate', 1918 'hidden', 1919 'inert', 1920 'ismap', 1921 'loop', 1922 'multiple', 1923 'muted', 1924 'nomodule', 1925 'novalidate', 1926 'open', 1927 'playsinline', 1928 'readonly', 1929 'required', 1930 'reversed', 1931 'selected' 1932]; 1933/** 1934 * List of HTML boolean attributes (e.g. `<input disabled>`). 1935 * Source: https://html.spec.whatwg.org/multipage/indices.html 1936 */ 1937const boolean_attributes = new Set([..._boolean_attributes]); 1938 1939/** regex of all html void element names */ 1940const void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/; 1941function is_void(name) { 1942 return void_element_names.test(name) || name.toLowerCase() === '!doctype'; 1943} 1944 1945const 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; 1946// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 1947// https://infra.spec.whatwg.org/#noncharacter 1948function spread(args, attrs_to_add) { 1949 const attributes = Object.assign({}, ...args); 1950 if (attrs_to_add) { 1951 const classes_to_add = attrs_to_add.classes; 1952 const styles_to_add = attrs_to_add.styles; 1953 if (classes_to_add) { 1954 if (attributes.class == null) { 1955 attributes.class = classes_to_add; 1956 } 1957 else { 1958 attributes.class += ' ' + classes_to_add; 1959 } 1960 } 1961 if (styles_to_add) { 1962 if (attributes.style == null) { 1963 attributes.style = style_object_to_string(styles_to_add); 1964 } 1965 else { 1966 attributes.style = style_object_to_string(merge_ssr_styles(attributes.style, styles_to_add)); 1967 } 1968 } 1969 } 1970 let str = ''; 1971 Object.keys(attributes).forEach(name => { 1972 if (invalid_attribute_name_character.test(name)) 1973 return; 1974 const value = attributes[name]; 1975 if (value === true) 1976 str += ' ' + name; 1977 else if (boolean_attributes.has(name.toLowerCase())) { 1978 if (value) 1979 str += ' ' + name; 1980 } 1981 else if (value != null) { 1982 str += ` ${name}="${value}"`; 1983 } 1984 }); 1985 return str; 1986} 1987function merge_ssr_styles(style_attribute, style_directive) { 1988 const style_object = {}; 1989 for (const individual_style of style_attribute.split(';')) { 1990 const colon_index = individual_style.indexOf(':'); 1991 const name = individual_style.slice(0, colon_index).trim(); 1992 const value = individual_style.slice(colon_index + 1).trim(); 1993 if (!name) 1994 continue; 1995 style_object[name] = value; 1996 } 1997 for (const name in style_directive) { 1998 const value = style_directive[name]; 1999 if (value) { 2000 style_object[name] = value; 2001 } 2002 else { 2003 delete style_object[name]; 2004 } 2005 } 2006 return style_object; 2007} 2008const ATTR_REGEX = /[&"]/g; 2009const CONTENT_REGEX = /[&<]/g; 2010/** 2011 * Note: this method is performance sensitive and has been optimized 2012 * https://github.com/sveltejs/svelte/pull/5701 2013 */ 2014function escape(value, is_attr = false) { 2015 const str = String(value); 2016 const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX; 2017 pattern.lastIndex = 0; 2018 let escaped = ''; 2019 let last = 0; 2020 while (pattern.test(str)) { 2021 const i = pattern.lastIndex - 1; 2022 const ch = str[i]; 2023 escaped += str.substring(last, i) + (ch === '&' ? '&' : (ch === '"' ? '"' : '<')); 2024 last = i + 1; 2025 } 2026 return escaped + str.substring(last); 2027} 2028function escape_attribute_value(value) { 2029 // keep booleans, null, and undefined for the sake of `spread` 2030 const should_escape = typeof value === 'string' || (value && typeof value === 'object'); 2031 return should_escape ? escape(value, true) : value; 2032} 2033function escape_object(obj) { 2034 const result = {}; 2035 for (const key in obj) { 2036 result[key] = escape_attribute_value(obj[key]); 2037 } 2038 return result; 2039} 2040function each(items, fn) { 2041 let str = ''; 2042 for (let i = 0; i < items.length; i += 1) { 2043 str += fn(items[i], i); 2044 } 2045 return str; 2046} 2047const missing_component = { 2048 $$render: () => '' 2049}; 2050function validate_component(component, name) { 2051 if (!component || !component.$$render) { 2052 if (name === 'svelte:component') 2053 name += ' this={...}'; 2054 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
2054imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`); 2055 } 2056 return component; 2057} 2058function debug(file, line, column, values) { 2059 console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console 2060 console.log(values); // eslint-disable-line no-console 2061 return ''; 2062} 2063let on_destroy; 2064function create_ssr_component(fn) { 2065 function $$render(result, props, bindings, slots, context) { 2066 const parent_component = current_component; 2067 const $$ = { 2068 on_destroy, 2069 context: new Map(context || (parent_component ? parent_component.$$.context : [])), 2070 // these will be immediately discarded 2071 on_mount: [], 2072 before_update: [], 2073 after_update: [], 2074 callbacks: blank_object() 2075 }; 2076 set_current_component({ $$ }); 2077 const html = fn(result, props, bindings, slots); 2078 set_current_component(parent_component); 2079 return html; 2080 } 2081 return { 2082 render: (props = {}, { $$slots = {}, context = new Map() } = {}) => { 2083 on_destroy = []; 2084 const result = { title: '', head: '', css: new Set() }; 2085 const html = $$render(result, props, {}, $$slots, context); 2086 run_all(on_destroy); 2087 return { 2088 html, 2089 css: { 2090 code: Array.from(result.css).map(css => css.code).join('\n'), 2091 map: null // TODO 2092 }, 2093 head: result.title + result.head 2094 }; 2095 }, 2096 $$render 2097 }; 2098} 2099function add_attribute(name, value, boolean) { 2100 if (value == null || (boolean && !value)) 2101 return ''; 2102 const assignment = (boolean && value === true) ? '' : `="${escape(value, true)}"`; 2103 return ` ${name}${assignment}`; 2104} 2105function add_classes(classes) { 2106 return classes ? ` class="${classes}"` : ''; 2107} 2108function style_object_to_string(style_object) { 2109 return Object.keys(style_object) 2110 .filter(key => style_object[key]) 2111 .map(key => `${key}: ${escape_attribute_value(style_object[key])};`) 2112 .join(' '); 2113} 2114function add_styles(style_object) { 2115 const styles = style_object_to_string(style_object); 2116 return styles ? ` style="${styles}"` : ''; 2117} 2118 2119function bind(component, name, callback) { 2120 const index = component.$$.props[name]; 2121 if (index !== undefined) { 2122 component.$$.bound[index] = callback; 2123 callback(component.$$.ctx[index]); 2124 } 2125} 2126function create_component(block) { 2127 block && block.c(); 2128} 2129function claim_component(block, parent_nodes) { 2130 block && block.l(parent_nodes); 2131} 2132function mount_component(component, target, anchor, customElement) { 2133 const { fragment, after_update } = component.$$; 2134 fragment && fragment.m(target, anchor); 2135 if (!customElement) { 2136 // onMount happens before the initial afterUpdate 2137 add_render_callback(() => { 2138 const new_on_destroy = component.$$.on_mount.map(run).filter(is_function); 2139 // if the component was destroyed immediately 2140 // it will update the `$$.on_destroy` reference to `null`. 2141 // the destructured on_destroy may still reference to the old array 2142 if (component.$$.on_destroy) { 2143 component.$$.on_destroy.push(...new_on_destroy); 2144 } 2145 else { 2146 // Edge case - component was destroyed immediately, 2147 // most likely as a result of a binding initialising 2148 run_all(new_on_destroy); 2149 } 2150 component.$$.on_mount = []; 2151 }); 2152 } 2153 after_update.forEach(add_render_callback); 2154} 2155function destroy_component(component, detaching) { 2156 const $$ = component.$$; 2157 if ($$.fragment !== null) { 2158 flush_render_callbacks($$.after_update); 2159 run_all($$.on_destroy); 2160 $$.fragment && $$.fragment.d(detaching); 2161 // TODO null out other refs, including component.$$ (but need to 2162 // preserve final state?) 2163 $$.on_destroy = $$.fragment = null; 2164 $$.ctx = []; 2165 } 2166} 2167function make_dirty(component, i) { 2168 if (component.$$.dirty[0] === -1) { 2169 dirty_components.push(component); 2170 schedule_update(); 2171 component.$$.dirty.fill(0); 2172 } 2173 component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31)); 2174} 2175function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) { 2176 const parent_component = current_component; 2177 set_current_component(component); 2178 const $$ = component.$$ = { 2179 fragment: null, 2180 ctx: [], 2181 // state 2182 props,
2183 update: noop, 2184 not_equal, 2185 bound: blank_object(), 2186 // lifecycle 2187 on_mount: [], 2188 on_destroy: [], 2189 on_disconnect: [], 2190 before_update: [], 2191 after_update: [], 2192 context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), 2193 // everything else 2194 callbacks: blank_object(), 2195 dirty, 2196 skip_bound: false, 2197 root: options.target || parent_component.$$.root 2198 }; 2199 append_styles && append_styles($$.root); 2200 let ready = false; 2201 $$.ctx = instance 2202 ? instance(component, options.props || {}, (i, ret, ...rest) => { 2203 const value = rest.length ? rest[0] : ret; 2204 if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { 2205 if (!$$.skip_bound && $$.bound[i]) 2206 $$.bound[i](value); 2207 if (ready) 2208 make_dirty(component, i); 2209 } 2210 return ret; 2211 }) 2212 : []; 2213 $$.update(); 2214 ready = true; 2215 run_all($$.before_update); 2216 // `false` as a special case of no DOM component 2217 $$.fragment = create_fragment ? create_fragment($$.ctx) : false; 2218 if (options.target) { 2219 if (options.hydrate) { 2220 start_hydrating(); 2221 const nodes = children(options.target); 2222 // eslint-disable-next-line @typescript-eslint/no-non-null-assertion 2223 $$.fragment && $$.fragment.l(nodes); 2224 nodes.forEach(detach); 2225 } 2226 else { 2227 // eslint-disable-next-line @typescript-eslint/no-non-null-assertion 2228 $$.fragment && $$.fragment.c(); 2229 } 2230 if (options.intro) 2231 transition_in(component.$$.fragment); 2232 mount_component(component, options.target, options.anchor, options.customElement); 2233 end_hydrating(); 2234 flush(); 2235 } 2236 set_current_component(parent_component); 2237} 2238let SvelteElement; 2239if (typeof HTMLElement === 'function') { 2240 SvelteElement = class extends HTMLElement { 2241 constructor() { 2242 super(); 2243 this.attachShadow({ mode: 'open' }); 2244 } 2245 connectedCallback() { 2246 const { on_mount } = this.$$; 2247 this.$$.on_disconnect = on_mount.map(run).filter(is_function); 2248 // @ts-ignore todo: improve typings 2249 for (const key in this.$$.slotted) { 2250 // @ts-ignore todo: improve typings 2251 this.appendChild(this.$$.slotted[key]); 2252 } 2253 } 2254 attributeChangedCallback(attr, _oldValue, newValue) { 2255 this[attr] = newValue; 2256 } 2257 disconnectedCallback() { 2258 run_all(this.$$.on_disconnect); 2259 } 2260 $destroy() { 2261 destroy_component(this, 1); 2262 this.$destroy = noop; 2263 } 2264 $on(type, callback) { 2265 // TODO should this delegate to addEventListener? 2266 if (!is_function(callback)) { 2267 return noop; 2268 } 2269 const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); 2270 callbacks.push(callback); 2271 return () => { 2272 const index = callbacks.indexOf(callback); 2273 if (index !== -1) 2274 callbacks.splice(index, 1); 2275 }; 2276 } 2277 $set($$props) { 2278 if (this.$$set && !is_empty($$props)) { 2279 this.$$.skip_bound = true; 2280 this.$$set($$props); 2281 this.$$.skip_bound = false; 2282 } 2283 } 2284 }; 2285} 2286/** 2287 * Base class for Svelte components. Used when dev=false. 2288 */ 2289class SvelteComponent { 2290 $destroy() { 2291 destroy_component(this, 1); 2292 this.$destroy = noop; 2293 } 2294 $on(type, callback) { 2295 if (!is_function(callback)) { 2296 return noop; 2297 } 2298 const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); 2299 callbacks.push(callback); 2300 return () => { 2301 const index = callbacks.indexOf(callback); 2302 if (index !== -1) 2303 callbacks.splice(index, 1); 2304 }; 2305 } 2306 $set($$props) {
2307 if (this.$$set && !is_empty($$props)) { 2308 this.$$.skip_bound = true; 2309 this.$$set($$props); 2310 this.$$.skip_bound = false; 2311 } 2312 } 2313} 2314 2315function dispatch_dev(type, detail) { 2316 document.dispatchEvent(custom_event(type, Object.assign({ version: '3.59.2' }, detail), { bubbles: true })); 2317} 2318function append_dev(target, node) { 2319 dispatch_dev('SvelteDOMInsert', { target, node }); 2320 append(target, node); 2321} 2322function append_hydration_dev(target, node) { 2323 dispatch_dev('SvelteDOMInsert', { target, node }); 2324 append_hydration(target, node); 2325} 2326function insert_dev(target, node, anchor) { 2327 dispatch_dev('SvelteDOMInsert', { target, node, anchor }); 2328 insert(target, node, anchor); 2329} 2330function insert_hydration_dev(target, node, anchor) { 2331 dispatch_dev('SvelteDOMInsert', { target, node, anchor }); 2332 insert_hydration(target, node, anchor); 2333} 2334function detach_dev(node) { 2335 dispatch_dev('SvelteDOMRemove', { node }); 2336 detach(node); 2337} 2338function detach_between_dev(before, after) { 2339 while (before.nextSibling && before.nextSibling !== after) { 2340 detach_dev(before.nextSibling); 2341 } 2342} 2343function detach_before_dev(after) { 2344 while (after.previousSibling) { 2345 detach_dev(after.previousSibling); 2346 } 2347} 2348function detach_after_dev(before) { 2349 while (before.nextSibling) { 2350 detach_dev(before.nextSibling); 2351 } 2352} 2353function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation, has_stop_immediate_propagation) { 2354 const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : []; 2355 if (has_prevent_default) 2356 modifiers.push('preventDefault'); 2357 if (has_stop_propagation) 2358 modifiers.push('stopPropagation'); 2359 if (has_stop_immediate_propagation) 2360 modifiers.push('stopImmediatePropagation'); 2361 dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers }); 2362 const dispose = listen(node, event, handler, options); 2363 return () => { 2364 dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers }); 2365 dispose(); 2366 }; 2367} 2368function attr_dev(node, attribute, value) { 2369 attr(node, attribute, value); 2370 if (value == null) 2371 dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute }); 2372 else 2373 dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value }); 2374} 2375function prop_dev(node, property, value) { 2376 node[property] = value; 2377 dispatch_dev('SvelteDOMSetProperty', { node, property, value }); 2378} 2379function dataset_dev(node, property, value) { 2380 node.dataset[property] = value; 2381 dispatch_dev('SvelteDOMSetDataset', { node, property, value }); 2382} 2383function set_data_dev(text, data) { 2384 data = '' + data; 2385 if (text.data === data) 2386 return; 2387 dispatch_dev('SvelteDOMSetData', { node: text, data }); 2388 text.data = data; 2389} 2390function set_data_contenteditable_dev(text, data) { 2391 data = '' + data; 2392 if (text.wholeText === data) 2393 return; 2394 dispatch_dev('SvelteDOMSetData', { node: text, data }); 2395 text.data = data; 2396} 2397function set_data_maybe_contenteditable_dev(text, data, attr_value) { 2398 if (~contenteditable_truthy_values.indexOf(attr_value)) { 2399 set_data_contenteditable_dev(text, data); 2400 } 2401 else { 2402 set_data_dev(text, data); 2403 } 2404} 2405function validate_each_argument(arg) { 2406 if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) { 2407 let msg = '{#each} only iterates over array-like objects.'; 2408 if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) { 2409 msg += ' You can use a spread to convert this iterable into an array.'; 2410 } 2411 throw new Error(msg); 2412 } 2413} 2414function validate_slots(name, slot, keys) { 2415 for (const slot_key of Object.keys(slot)) { 2416 if (!~keys.indexOf(slot_key)) { 2417 console.warn(`<${name}> received an unexpected slot "${slot_key}".`); 2418 } 2419 } 2420} 2421function validate_dynamic_element(tag) { 2422 const is_string = typeof tag === 'string'; 2423 if (tag && !is_string) { 2424 throw new Error('<svelte:element> expects "this" attribute to be a string.'); 2425 } 2426} 2427function validate_void_dynamic_element(tag) { 2428 if (tag && is_void(tag)) { 2429 console.warn(`<svelte:element this="${tag}"> is self-closing and cannot have content.`); 2430 } 2431} 2432function construct_svelte_component_dev(component, props) { 2433 const error_message = 'this={...} of <svelte:component> should specify a Svelte component.'; 2434 try { 2435 const instance = new component(props); 2436 if (!instance.$$ || !instance.$set || !instance.$on || !instance.$destroy) { 2437 throw new Error(error_message); 2438 } 2439 return instance; 2440 } 2441 catch (err) { 2442 const { message } = err; 2443 if (typeof message === 'string' && message.indexOf('is not a constructor') !== -1) { 2444 throw new Error(error_message); 2445 } 2446 else { 2447 throw err; 2448 } 2449 } 2450} 2451/** 2452 * Base class for Svelte components with some minor dev-enhancements. Used when dev=true. 2453 */ 2454class SvelteComponentDev extends SvelteComponent { 2455 constructor(options) { 2456 if (!options || (!options.target && !options.$$inline)) { 2457 throw new Error("'target' is a required option"); 2458 } 2459 super(); 2460 } 2461 $destroy() {
2462 super.$destroy(); 2463 this.$destroy = () => { 2464 console.warn('Component was already destroyed'); // eslint-disable-line no-console 2465 }; 2466 } 2467 $capture_state() { } 2468 $inject_state() { } 2469} 2470/** 2471 * Base class to create strongly typed Svelte components. 2472 * This only exists for typing purposes and should be used in `.d.ts` files. 2473 * 2474 * ### Example: 2475 * 2476 * You have component library on npm called `component-library`, from which 2477 * you export a component called `MyComponent`. For Svelte+TypeScript users, 2478 * you want to provide typings. Therefore you create a `index.d.ts`: 2479 * ```ts 2480 * import { SvelteComponentTyped } from "svelte"; 2481 * export class MyComponent extends SvelteComponentTyped<{foo: string}> {} 2482 * ``` 2483 * Typing this makes it possible for IDEs like VS Code with the Svelte extension 2484 * to provide intellisense and to use the component like this in a Svelte file 2485 * with TypeScript: 2486 * ```svelte 2487 * <script lang="ts"> 2488 * import { MyComponent } from "component-library"; 2489 * </script> 2490 * <MyComponent foo={'bar'} /> 2491 * ``` 2492 * 2493 * #### Why not make this part of `SvelteComponent(Dev)`? 2494 * Because 2495 * ```ts 2496 * class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {} 2497 * const component: typeof SvelteComponent = ASubclassOfSvelteComponent; 2498 * ``` 2499 * will throw a type error, so we need to separate the more strictly typed class. 2500 */ 2501class SvelteComponentTyped extends SvelteComponentDev { 2502 constructor(options) { 2503 super(options); 2504 } 2505} 2506function loop_guard(timeout) { 2507 const start = Date.now(); 2508 return () => { 2509 if (Date.now() - start > timeout) { 2510 throw new Error('Infinite loop detected'); 2511 } 2512 }; 2513} 2514 2515 2516 2517 2518/***/ }) 2519 2520}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.