blackmagic-esp32-s2/components/svelte-portal/public/build/bundle.js.map

1 line
168 KiB
Plaintext

{"version":3,"file":"bundle.js","sources":["../../node_modules/svelte/internal/index.mjs","../../src/lib/Api.svelte","../../src/lib/WebSocket.svelte","../../src/lib/terminal.js","../../src/lib/Button.svelte","../../src/lib/Popup.svelte","../../src/lib/Spinner.svelte","../../src/lib/SpinnerBig.svelte","../../src/lib/Grid.svelte","../../src/lib/Value.svelte","../../src/lib/Input.svelte","../../node_modules/stringview/StringView.mjs","../../src/lib/Select.svelte","../../src/lib/UartTerminal.svelte","../../src/lib/ButtonInline.svelte","../../src/tabs/TabWiFi.svelte","../../src/tabs/TabSys.svelte","../../src/tabs/TabPS.svelte","../../src/lib/Reload.svelte","../../src/lib/Indicator.svelte","../../src/App.svelte","../../src/main.js"],"sourcesContent":["function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\nfunction is_promise(value) {\n return !!value && (typeof value === 'object' || typeof value === 'function') && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nlet src_url_equal_anchor;\nfunction src_url_equal(element_src, url) {\n if (!src_url_equal_anchor) {\n src_url_equal_anchor = document.createElement('a');\n }\n src_url_equal_anchor.href = url;\n return element_src === src_url_equal_anchor.href;\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\nfunction get_all_dirty_from_scope($$scope) {\n if ($$scope.ctx.length > 32) {\n const dirty = [];\n const length = $$scope.ctx.length / 32;\n for (let i = 0; i < length; i++) {\n dirty[i] = -1;\n }\n return dirty;\n }\n return -1;\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\nfunction split_css_unit(value) {\n const split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n return split ? [parseFloat(split[1]), split[2] || 'px'] : [value, 'px'];\n}\nconst contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\n/**\n * Resize observer singleton.\n * One listener per element only!\n * https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ\n */\nclass ResizeObserverSingleton {\n constructor(options) {\n this.options = options;\n this._listeners = 'WeakMap' in globals ? new WeakMap() : undefined;\n }\n observe(element, listener) {\n this._listeners.set(element, listener);\n this._getObserver().observe(element, this.options);\n return () => {\n this._listeners.delete(element);\n this._observer.unobserve(element); // this line can probably be removed\n };\n }\n _getObserver() {\n var _a;\n return (_a = this._observer) !== null && _a !== void 0 ? _a : (this._observer = new ResizeObserver((entries) => {\n var _a;\n for (const entry of entries) {\n ResizeObserverSingleton.entries.set(entry.target, entry);\n (_a = this._listeners.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry);\n }\n }));\n }\n}\n// Needs to be written like this to pass the tree-shake-test\nResizeObserverSingleton.entries = 'WeakMap' in globals ? new WeakMap() : undefined;\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\nfunction start_hydrating() {\n is_hydrating = true;\n}\nfunction end_hydrating() {\n is_hydrating = false;\n}\nfunction upper_bound(low, high, key, value) {\n // Return first index of value larger than input value in the range [low, high)\n while (low < high) {\n const mid = low + ((high - low) >> 1);\n if (key(mid) <= value) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n return low;\n}\nfunction init_hydrate(target) {\n if (target.hydrate_init)\n return;\n target.hydrate_init = true;\n // We know that all children have claim_order values since the unclaimed have been detached if target is not <head>\n let children = target.childNodes;\n // If target is <head>, there may be children without claim_order\n if (target.nodeName === 'HEAD') {\n const myChildren = [];\n for (let i = 0; i < children.length; i++) {\n const node = children[i];\n if (node.claim_order !== undefined) {\n myChildren.push(node);\n }\n }\n children = myChildren;\n }\n /*\n * Reorder claimed children optimally.\n * We can reorder claimed children optimally by finding the longest subsequence of\n * nodes that are already claimed in order and only moving the rest. The longest\n * subsequence of nodes that are claimed in order can be found by\n * computing the longest increasing subsequence of .claim_order values.\n *\n * This algorithm is optimal in generating the least amount of reorder operations\n * possible.\n *\n * Proof:\n * We know that, given a set of reordering operations, the nodes that do not move\n * always form an increasing subsequence, since they do not move among each other\n * meaning that they must be already ordered among each other. Thus, the maximal\n * set of nodes that do not move form a longest increasing subsequence.\n */\n // Compute longest increasing subsequence\n // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n const m = new Int32Array(children.length + 1);\n // Predecessor indices + 1\n const p = new Int32Array(children.length);\n m[0] = -1;\n let longest = 0;\n for (let i = 0; i < children.length; i++) {\n const current = children[i].claim_order;\n // Find the largest subsequence length such that it ends in a value less than our current value\n // upper_bound returns first greater value, so we subtract one\n // with fast path for when we are on the current longest subsequence\n const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;\n p[i] = m[seqLen] + 1;\n const newLen = seqLen + 1;\n // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n m[newLen] = i;\n longest = Math.max(newLen, longest);\n }\n // The longest increasing subsequence of nodes (initially reversed)\n const lis = [];\n // The rest of the nodes, nodes that will be moved\n const toMove = [];\n let last = children.length - 1;\n for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n lis.push(children[cur - 1]);\n for (; last >= cur; last--) {\n toMove.push(children[last]);\n }\n last--;\n }\n for (; last >= 0; last--) {\n toMove.push(children[last]);\n }\n lis.reverse();\n // We sort the nodes being moved to guarantee that their insertion order matches the claim order\n toMove.sort((a, b) => a.claim_order - b.claim_order);\n // Finally, we move the nodes\n for (let i = 0, j = 0; i < toMove.length; i++) {\n while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {\n j++;\n }\n const anchor = j < lis.length ? lis[j] : null;\n target.insertBefore(toMove[i], anchor);\n }\n}\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction append_styles(target, style_sheet_id, styles) {\n const append_styles_to = get_root_for_style(target);\n if (!append_styles_to.getElementById(style_sheet_id)) {\n const style = element('style');\n style.id = style_sheet_id;\n style.textContent = styles;\n append_stylesheet(append_styles_to, style);\n }\n}\nfunction get_root_for_style(node) {\n if (!node)\n return document;\n const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n if (root && root.host) {\n return root;\n }\n return node.ownerDocument;\n}\nfunction append_empty_stylesheet(node) {\n const style_element = element('style');\n append_stylesheet(get_root_for_style(node), style_element);\n return style_element.sheet;\n}\nfunction append_stylesheet(node, style) {\n append(node.head || node, style);\n return style.sheet;\n}\nfunction append_hydration(target, node) {\n if (is_hydrating) {\n init_hydrate(target);\n if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) {\n target.actual_end_child = target.firstChild;\n }\n // Skip nodes of undefined ordering\n while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {\n target.actual_end_child = target.actual_end_child.nextSibling;\n }\n if (node !== target.actual_end_child) {\n // We only insert if the ordering of this node should be modified or the parent node is not target\n if (node.claim_order !== undefined || node.parentNode !== target) {\n target.insertBefore(node, target.actual_end_child);\n }\n }\n else {\n target.actual_end_child = node.nextSibling;\n }\n }\n else if (node.parentNode !== target || node.nextSibling !== null) {\n target.appendChild(node);\n }\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction insert_hydration(target, node, anchor) {\n if (is_hydrating && !anchor) {\n append_hydration(target, node);\n }\n else if (node.parentNode !== target || node.nextSibling != anchor) {\n target.insertBefore(node, anchor || null);\n }\n}\nfunction detach(node) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction comment(content) {\n return document.createComment(content);\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_immediate_propagation(fn) {\n return function (event) {\n event.stopImmediatePropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction trusted(fn) {\n return function (event) {\n // @ts-ignore\n if (event.isTrusted)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set && always_set_through_set_attribute.indexOf(key) === -1) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data_map(node, data_map) {\n Object.keys(data_map).forEach((key) => {\n set_custom_element_data(node, key, data_map[key]);\n });\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction set_dynamic_element_data(tag) {\n return (/-/.test(tag)) ? set_custom_element_data_map : set_attributes;\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction init_binding_group(group) {\n let _inputs;\n return {\n /* push */ p(...inputs) {\n _inputs = inputs;\n _inputs.forEach(input => group.push(input));\n },\n /* remove */ r() {\n _inputs.forEach(input => group.splice(group.indexOf(input), 1));\n }\n };\n}\nfunction init_binding_group_dynamic(group, indexes) {\n let _group = get_binding_group(group);\n let _inputs;\n function get_binding_group(group) {\n for (let i = 0; i < indexes.length; i++) {\n group = group[indexes[i]] = group[indexes[i]] || [];\n }\n return group;\n }\n function push() {\n _inputs.forEach(input => _group.push(input));\n }\n function remove() {\n _inputs.forEach(input => _group.splice(_group.indexOf(input), 1));\n }\n return {\n /* update */ u(new_indexes) {\n indexes = new_indexes;\n const new_group = get_binding_group(group);\n if (new_group !== _group) {\n remove();\n _group = new_group;\n push();\n }\n },\n /* push */ p(...inputs) {\n _inputs = inputs;\n push();\n },\n /* remove */ r: remove\n };\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction init_claim_info(nodes) {\n if (nodes.claim_info === undefined) {\n nodes.claim_info = { last_index: 0, total_claimed: 0 };\n }\n}\nfunction claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {\n // Try to find nodes in an order such that we lengthen the longest increasing subsequence\n init_claim_info(nodes);\n const resultNode = (() => {\n // We first try to find an element after the previous one\n for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n return node;\n }\n }\n // Otherwise, we try to find one before\n // We iterate in reverse so that we don't go too far back\n for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n else if (replacement === undefined) {\n // Since we spliced before the last_index, we decrease it\n nodes.claim_info.last_index--;\n }\n return node;\n }\n }\n // If we can't find any matching node, we create a new one\n return createNode();\n })();\n resultNode.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n return resultNode;\n}\nfunction claim_element_base(nodes, name, attributes, create_element) {\n return claim_node(nodes, (node) => node.nodeName === name, (node) => {\n const remove = [];\n for (let j = 0; j < node.attributes.length; j++) {\n const attribute = node.attributes[j];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n remove.forEach(v => node.removeAttribute(v));\n return undefined;\n }, () => create_element(name));\n}\nfunction claim_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, element);\n}\nfunction claim_svg_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, svg_element);\n}\nfunction claim_text(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 3, (node) => {\n const dataStr = '' + data;\n if (node.data.startsWith(dataStr)) {\n if (node.data.length !== dataStr.length) {\n return node.splitText(dataStr.length);\n }\n }\n else {\n node.data = dataStr;\n }\n }, () => 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\n );\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction claim_comment(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 8, (node) => {\n node.data = '' + data;\n return undefined;\n }, () => comment(data), true);\n}\nfunction find_comment(nodes, text, start) {\n for (let i = start; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n return i;\n }\n }\n return nodes.length;\n}\nfunction claim_html_tag(nodes, is_svg) {\n // find html opening tag\n const start_index = find_comment(nodes, 'HTML_TAG_START', 0);\n const end_index = find_comment(nodes, 'HTML_TAG_END', start_index);\n if (start_index === end_index) {\n return new HtmlTagHydration(undefined, is_svg);\n }\n init_claim_info(nodes);\n const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n detach(html_tag_nodes[0]);\n detach(html_tag_nodes[html_tag_nodes.length - 1]);\n const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n for (const n of claimed_nodes) {\n n.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n }\n return new HtmlTagHydration(claimed_nodes, is_svg);\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n text.data = data;\n}\nfunction set_data_contenteditable(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n text.data = data;\n}\nfunction set_data_maybe_contenteditable(text, data, attr_value) {\n if (~contenteditable_truthy_values.indexOf(attr_value)) {\n set_data_contenteditable(text, data);\n }\n else {\n set_data(text, data);\n }\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n if (value == null) {\n node.style.removeProperty(key);\n }\n else {\n node.style.setProperty(key, value, important ? 'important' : '');\n }\n}\nfunction select_option(select, value, mounting) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n if (!mounting || value !== undefined) {\n select.selectedIndex = -1; // no option should be selected\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked');\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_iframe_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}</script>\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n // make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n // see https://github.com/sveltejs/svelte/issues/4233\n fn();\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nconst resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'content-box' });\nconst resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'border-box' });\nconst resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'device-pixel-content-box' });\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, bubbles, cancelable, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nfunction head_selector(nodeId, head) {\n const result = [];\n let started = 0;\n for (const node of head.childNodes) {\n if (node.nodeType === 8 /* comment node */) {\n const comment = node.textContent.trim();\n if (comment === `HEAD_${nodeId}_END`) {\n started -= 1;\n result.push(node);\n }\n else if (comment === `HEAD_${nodeId}_START`) {\n started += 1;\n result.push(node);\n }\n }\n else if (started > 0) {\n result.push(node);\n }\n }\n return result;\n}\nclass HtmlTag {\n constructor(is_svg = false) {\n this.is_svg = false;\n this.is_svg = is_svg;\n this.e = this.n = null;\n }\n c(html) {\n this.h(html);\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n if (this.is_svg)\n this.e = svg_element(target.nodeName);\n /** #7364 target for <template> may be provided as #document-fragment(11) */\n else\n this.e = element((target.nodeType === 11 ? 'TEMPLATE' : target.nodeName));\n this.t = target.tagName !== 'TEMPLATE' ? target : target.content;\n this.c(html);\n }\n this.i(anchor);\n }\n h(html) {\n this.e.innerHTML = html;\n this.n = Array.from(this.e.nodeName === 'TEMPLATE' ? this.e.content.childNodes : this.e.childNodes);\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert(this.t, this.n[i], anchor);\n }\n }\n p(html) {\n this.d();\n this.h(html);\n this.i(this.a);\n }\n d() {\n this.n.forEach(detach);\n }\n}\nclass HtmlTagHydration extends HtmlTag {\n constructor(claimed_nodes, is_svg = false) {\n super(is_svg);\n this.e = this.n = null;\n this.l = claimed_nodes;\n }\n c(html) {\n if (this.l) {\n this.n = this.l;\n }\n else {\n super.c(html);\n }\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert_hydration(this.t, this.n[i], anchor);\n }\n }\n}\nfunction attribute_to_object(attributes) {\n const result = {};\n for (const attribute of attributes) {\n result[attribute.name] = attribute.value;\n }\n return result;\n}\nfunction get_custom_elements_slots(element) {\n const result = {};\n element.childNodes.forEach((node) => {\n result[node.slot || 'default'] = true;\n });\n return result;\n}\nfunction construct_svelte_component(component, props) {\n return new component(props);\n}\n\n// we need to store the information for multiple documents because a Svelte application could also contain iframes\n// https://github.com/sveltejs/svelte/issues/3624\nconst managed_styles = new Map();\nlet active = 0;\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i--)\n hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n return hash >>> 0;\n}\nfunction create_style_information(doc, node) {\n const info = { stylesheet: append_empty_stylesheet(node), rules: {} };\n managed_styles.set(doc, info);\n return info;\n}\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = '{\\n';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `__svelte_${hash(rule)}_${uid}`;\n const doc = get_root_for_style(node);\n const { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node);\n if (!rules[name]) {\n rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || '';\n node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n const previous = (node.style.animation || '').split(', ');\n const next = previous.filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n );\n const deleted = previous.length - next.length;\n if (deleted) {\n node.style.animation = next.join(', ');\n active -= deleted;\n if (!active)\n clear_rules();\n }\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n managed_styles.forEach(info => {\n const { ownerNode } = info.stylesheet;\n // there is no ownerNode if it runs on jsdom.\n if (ownerNode)\n detach(ownerNode);\n });\n managed_styles.clear();\n });\n}\n\nfunction create_animation(node, from, fn, params) {\n if (!from)\n return noop;\n const to = node.getBoundingClientRect();\n if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)\n return noop;\n const { delay = 0, duration = 300, easing = identity, \n // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n start: start_time = now() + delay, \n // @ts-ignore todo:\n end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);\n let running = true;\n let started = false;\n let name;\n function start() {\n if (css) {\n name = create_rule(node, 0, 1, duration, delay, easing, css);\n }\n if (!delay) {\n started = true;\n }\n }\n function stop() {\n if (css)\n delete_rule(node, name);\n running = false;\n }\n loop(now => {\n if (!started && now >= start_time) {\n started = true;\n }\n if (started && now >= end) {\n tick(1, 0);\n stop();\n }\n if (!running) {\n return false;\n }\n if (started) {\n const p = now - start_time;\n const t = 0 + 1 * easing(p / duration);\n tick(t, 1 - t);\n }\n return true;\n });\n start();\n tick(0, 1);\n return stop;\n}\nfunction fix_position(node) {\n const style = getComputedStyle(node);\n if (style.position !== 'absolute' && style.position !== 'fixed') {\n const { width, height } = style;\n const a = node.getBoundingClientRect();\n node.style.position = 'absolute';\n node.style.width = width;\n node.style.height = height;\n add_transform(node, a);\n }\n}\nfunction add_transform(node, a) {\n const b = node.getBoundingClientRect();\n if (a.left !== b.left || a.top !== b.top) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n }\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error('Function called outside component initialization');\n return current_component;\n}\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`\n *\n * https://svelte.dev/docs#run-time-svelte-beforeupdate\n */\nfunction beforeUpdate(fn) {\n get_current_component().$$.before_update.push(fn);\n}\n/**\n * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.\n * It must be called during the component's initialisation (but doesn't need to live *inside* the component;\n * it can be called from an external module).\n *\n * `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).\n *\n * https://svelte.dev/docs#run-time-svelte-onmount\n */\nfunction onMount(fn) {\n get_current_component().$$.on_mount.push(fn);\n}\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`\n */\nfunction afterUpdate(fn) {\n get_current_component().$$.after_update.push(fn);\n}\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * https://svelte.dev/docs#run-time-svelte-ondestroy\n */\nfunction onDestroy(fn) {\n get_current_component().$$.on_destroy.push(fn);\n}\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * https://svelte.dev/docs#run-time-svelte-createeventdispatcher\n */\nfunction createEventDispatcher() {\n const component = get_current_component();\n return (type, detail, { cancelable = false } = {}) => {\n const callbacks = component.$$.callbacks[type];\n if (callbacks) {\n // TODO are there situations where events could be dispatched\n // in a server (non-DOM) environment?\n const event = custom_event(type, detail, { cancelable });\n callbacks.slice().forEach(fn => {\n fn.call(component, event);\n });\n return !event.defaultPrevented;\n }\n return true;\n };\n}\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-setcontext\n */\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n return context;\n}\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-getcontext\n */\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * https://svelte.dev/docs#run-time-svelte-getallcontexts\n */\nfunction getAllContexts() {\n return get_current_component().$$.context;\n}\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-hascontext\n */\nfunction hasContext(key) {\n return get_current_component().$$.context.has(key);\n}\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n const callbacks = component.$$.callbacks[event.type];\n if (callbacks) {\n // @ts-ignore\n callbacks.slice().forEach(fn => fn.call(this, event));\n }\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\nconst binding_callbacks = [];\nlet render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = /* @__PURE__ */ Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nfunction add_flush_callback(fn) {\n flush_callbacks.push(fn);\n}\n// flush() calls callbacks in this order:\n// 1. All beforeUpdate callbacks, in order: parents before children\n// 2. All bind:this callbacks, in reverse order: children before parents.\n// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT\n// for afterUpdates called during the initial onMount, which are called in\n// reverse order: children before parents.\n// Since callbacks might update component values, which could trigger another\n// call to flush(), the following steps guard against this:\n// 1. During beforeUpdate, any updated components will be added to the\n// dirty_components array and will cause a reentrant call to flush(). Because\n// the flush index is kept outside the function, the reentrant call will pick\n// up where the earlier call left off and go through all dirty components. The\n// current_component value is saved and restored so that the reentrant call will\n// not interfere with the \"parent\" flush() call.\n// 2. bind:this callbacks cannot trigger new flush() calls.\n// 3. During afterUpdate, any updated components will NOT have their afterUpdate\n// callback called a second time; the seen_callbacks set, outside the flush()\n// function, guarantees this behavior.\nconst seen_callbacks = new Set();\nlet flushidx = 0; // Do *not* move this inside the flush() function\nfunction flush() {\n // Do not reenter flush while dirty components are updated, as this can\n // result in an infinite loop. Instead, let the inner flush handle it.\n // Reentrancy is ok afterwards for bindings etc.\n if (flushidx !== 0) {\n return;\n }\n const saved_component = current_component;\n do {\n // first, call beforeUpdate functions\n // and update components\n try {\n while (flushidx < dirty_components.length) {\n const component = dirty_components[flushidx];\n flushidx++;\n set_current_component(component);\n update(component.$$);\n }\n }\n catch (e) {\n // reset dirty state to not end up in a deadlocked state and then rethrow\n dirty_components.length = 0;\n flushidx = 0;\n throw e;\n }\n set_current_component(null);\n dirty_components.length = 0;\n flushidx = 0;\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n callback();\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n seen_callbacks.clear();\n set_current_component(saved_component);\n}\nfunction update($$) {\n if ($$.fragment !== null) {\n $$.update();\n run_all($$.before_update);\n const dirty = $$.dirty;\n $$.dirty = [-1];\n $$.fragment && $$.fragment.p($$.ctx, dirty);\n $$.after_update.forEach(add_render_callback);\n }\n}\n/**\n * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.\n */\nfunction flush_render_callbacks(fns) {\n const filtered = [];\n const targets = [];\n render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));\n targets.forEach((c) => c());\n render_callbacks = filtered;\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n else if (callback) {\n callback();\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n const options = { direction: 'in' };\n let config = fn(node, params, options);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, 'start'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, 'end');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n started = true;\n delete_rule(node);\n if (is_function(config)) {\n config = config(options);\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n const options = { direction: 'out' };\n let config = fn(node, params, options);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, 'start'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, 'end');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don't need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config(options);\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_bidirectional_transition(node, fn, params, intro) {\n const options = { direction: 'both' };\n let config = fn(node, params, options);\n let t = intro ? 0 : 1;\n let running_program = null;\n let pending_program = null;\n let animation_name = null;\n function clear_animation() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function init(program, duration) {\n const d = (program.b - t);\n duration *= Math.abs(d);\n return {\n a: t,\n b: program.b,\n d,\n duration,\n start: program.start,\n end: program.start + duration,\n group: program.group\n };\n }\n function go(b) {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n const program = {\n start: now() + delay,\n b\n };\n if (!b) {\n // @ts-ignore todo: improve typings\n program.group = outros;\n outros.r += 1;\n }\n if (running_program || pending_program) {\n pending_program = program;\n }\n else {\n // if this is an intro, and there's a delay, we need to do\n // an initial tick and/or apply CSS animation immediately\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, b, duration, delay, easing, css);\n }\n if (b)\n tick(0, 1);\n running_program = init(program, duration);\n add_render_callback(() => dispatch(node, b, 'start'));\n loop(now => {\n if (pending_program && now > pending_program.start) {\n running_program = init(pending_program, duration);\n pending_program = null;\n dispatch(node, running_program.b, 'start');\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n }\n }\n if (running_program) {\n if (now >= running_program.end) {\n tick(t = running_program.b, 1 - t);\n dispatch(node, running_program.b, 'end');\n if (!pending_program) {\n // we're done\n if (running_program.b) {\n // intro — we can tidy up immediately\n clear_animation();\n }\n else {\n // outro — needs to be coordinated\n if (!--running_program.group.r)\n run_all(running_program.group.c);\n }\n }\n running_program = null;\n }\n else if (now >= running_program.start) {\n const p = now - running_program.start;\n t = running_program.a + running_program.d * easing(p / running_program.duration);\n tick(t, 1 - t);\n }\n }\n return !!(running_program || pending_program);\n });\n }\n }\n return {\n run(b) {\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config(options);\n go(b);\n });\n }\n else {\n go(b);\n }\n },\n end() {\n clear_animation();\n running_program = pending_program = null;\n }\n };\n}\n\nfunction handle_promise(promise, info) {\n const token = info.token = {};\n function update(type, index, key, value) {\n if (info.token !== token)\n return;\n info.resolved = value;\n let child_ctx = info.ctx;\n if (key !== undefined) {\n child_ctx = child_ctx.slice();\n child_ctx[key] = value;\n }\n const block = type && (info.current = type)(child_ctx);\n let needs_flush = false;\n if (info.block) {\n if (info.blocks) {\n info.blocks.forEach((block, i) => {\n if (i !== index && block) {\n group_outros();\n transition_out(block, 1, 1, () => {\n if (info.blocks[i] === block) {\n info.blocks[i] = null;\n }\n });\n check_outros();\n }\n });\n }\n else {\n info.block.d(1);\n }\n block.c();\n transition_in(block, 1);\n block.m(info.mount(), info.anchor);\n needs_flush = true;\n }\n info.block = block;\n if (info.blocks)\n info.blocks[index] = block;\n if (needs_flush) {\n flush();\n }\n }\n if (is_promise(promise)) {\n const current_component = get_current_component();\n promise.then(value => {\n set_current_component(current_component);\n update(info.then, 1, info.value, value);\n set_current_component(null);\n }, error => {\n set_current_component(current_component);\n update(info.catch, 2, info.error, error);\n set_current_component(null);\n if (!info.hasCatch) {\n throw error;\n }\n });\n // if we previously had a then/catch block, destroy it\n if (info.current !== info.pending) {\n update(info.pending, 0);\n return true;\n }\n }\n else {\n if (info.current !== info.then) {\n update(info.then, 1, info.value, promise);\n return true;\n }\n info.resolved = promise;\n }\n}\nfunction update_await_block_branch(info, ctx, dirty) {\n const child_ctx = ctx.slice();\n const { resolved } = info;\n if (info.current === info.then) {\n child_ctx[info.value] = resolved;\n }\n if (info.current === info.catch) {\n child_ctx[info.error] = resolved;\n }\n info.block.p(child_ctx, dirty);\n}\n\nfunction destroy_block(block, lookup) {\n block.d(1);\n lookup.delete(block.key);\n}\nfunction outro_and_destroy_block(block, lookup) {\n transition_out(block, 1, 1, () => {\n lookup.delete(block.key);\n });\n}\nfunction fix_and_destroy_block(block, lookup) {\n block.f();\n destroy_block(block, lookup);\n}\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n block.f();\n outro_and_destroy_block(block, lookup);\n}\nfunction update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n let o = old_blocks.length;\n let n = list.length;\n let i = o;\n const old_indexes = {};\n while (i--)\n old_indexes[old_blocks[i].key] = i;\n const new_blocks = [];\n const new_lookup = new Map();\n const deltas = new Map();\n const updates = [];\n i = n;\n while (i--) {\n const child_ctx = get_context(ctx, list, i);\n const key = get_key(child_ctx);\n let block = lookup.get(key);\n if (!block) {\n block = create_each_block(key, child_ctx);\n block.c();\n }\n else if (dynamic) {\n // defer updates until all the DOM shuffling is done\n updates.push(() => block.p(child_ctx, dirty));\n }\n new_lookup.set(key, new_blocks[i] = block);\n if (key in old_indexes)\n deltas.set(key, Math.abs(i - old_indexes[key]));\n }\n const will_move = new Set();\n const did_move = new Set();\n function insert(block) {\n transition_in(block, 1);\n block.m(node, next);\n lookup.set(block.key, block);\n next = block.first;\n n--;\n }\n while (o && n) {\n const new_block = new_blocks[n - 1];\n const old_block = old_blocks[o - 1];\n const new_key = new_block.key;\n const old_key = old_block.key;\n if (new_block === old_block) {\n // do nothing\n next = new_block.first;\n o--;\n n--;\n }\n else if (!new_lookup.has(old_key)) {\n // remove old block\n destroy(old_block, lookup);\n o--;\n }\n else if (!lookup.has(new_key) || will_move.has(new_key)) {\n insert(new_block);\n }\n else if (did_move.has(old_key)) {\n o--;\n }\n else if (deltas.get(new_key) > deltas.get(old_key)) {\n did_move.add(new_key);\n insert(new_block);\n }\n else {\n will_move.add(old_key);\n o--;\n }\n }\n while (o--) {\n const old_block = old_blocks[o];\n if (!new_lookup.has(old_block.key))\n destroy(old_block, lookup);\n }\n while (n)\n insert(new_blocks[n - 1]);\n run_all(updates);\n return new_blocks;\n}\nfunction validate_each_keys(ctx, list, get_context, get_key) {\n const keys = new Set();\n for (let i = 0; i < list.length; i++) {\n const key = get_key(get_context(ctx, list, i));\n if (keys.has(key)) {\n throw new Error('Cannot have duplicate keys in a keyed each');\n }\n keys.add(key);\n }\n}\n\nfunction get_spread_update(levels, updates) {\n const update = {};\n const to_null_out = {};\n const accounted_for = { $$scope: 1 };\n let i = levels.length;\n while (i--) {\n const o = levels[i];\n const n = updates[i];\n if (n) {\n for (const key in o) {\n if (!(key in n))\n to_null_out[key] = 1;\n }\n for (const key in n) {\n if (!accounted_for[key]) {\n update[key] = n[key];\n accounted_for[key] = 1;\n }\n }\n levels[i] = n;\n }\n else {\n for (const key in o) {\n accounted_for[key] = 1;\n }\n }\n }\n for (const key in to_null_out) {\n if (!(key in update))\n update[key] = undefined;\n }\n return update;\n}\nfunction get_spread_object(spread_props) {\n return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n\nconst _boolean_attributes = [\n 'allowfullscreen',\n 'allowpaymentrequest',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'inert',\n 'ismap',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected'\n];\n/**\n * List of HTML boolean attributes (e.g. `<input disabled>`).\n * Source: https://html.spec.whatwg.org/multipage/indices.html\n */\nconst boolean_attributes = new Set([..._boolean_attributes]);\n\n/** regex of all html void element names */\nconst void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;\nfunction is_void(name) {\n return void_element_names.test(name) || name.toLowerCase() === '!doctype';\n}\n\nconst 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;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\nfunction spread(args, attrs_to_add) {\n const attributes = Object.assign({}, ...args);\n if (attrs_to_add) {\n const classes_to_add = attrs_to_add.classes;\n const styles_to_add = attrs_to_add.styles;\n if (classes_to_add) {\n if (attributes.class == null) {\n attributes.class = classes_to_add;\n }\n else {\n attributes.class += ' ' + classes_to_add;\n }\n }\n if (styles_to_add) {\n if (attributes.style == null) {\n attributes.style = style_object_to_string(styles_to_add);\n }\n else {\n attributes.style = style_object_to_string(merge_ssr_styles(attributes.style, styles_to_add));\n }\n }\n }\n let str = '';\n Object.keys(attributes).forEach(name => {\n if (invalid_attribute_name_character.test(name))\n return;\n const value = attributes[name];\n if (value === true)\n str += ' ' + name;\n else if (boolean_attributes.has(name.toLowerCase())) {\n if (value)\n str += ' ' + name;\n }\n else if (value != null) {\n str += ` ${name}=\"${value}\"`;\n }\n });\n return str;\n}\nfunction merge_ssr_styles(style_attribute, style_directive) {\n const style_object = {};\n for (const individual_style of style_attribute.split(';')) {\n const colon_index = individual_style.indexOf(':');\n const name = individual_style.slice(0, colon_index).trim();\n const value = individual_style.slice(colon_index + 1).trim();\n if (!name)\n continue;\n style_object[name] = value;\n }\n for (const name in style_directive) {\n const value = style_directive[name];\n if (value) {\n style_object[name] = value;\n }\n else {\n delete style_object[name];\n }\n }\n return style_object;\n}\nconst ATTR_REGEX = /[&\"]/g;\nconst CONTENT_REGEX = /[&<]/g;\n/**\n * Note: this method is performance sensitive and has been optimized\n * https://github.com/sveltejs/svelte/pull/5701\n */\nfunction escape(value, is_attr = false) {\n const str = String(value);\n const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;\n pattern.lastIndex = 0;\n let escaped = '';\n let last = 0;\n while (pattern.test(str)) {\n const i = pattern.lastIndex - 1;\n const ch = str[i];\n escaped += str.substring(last, i) + (ch === '&' ? '&amp;' : (ch === '\"' ? '&quot;' : '&lt;'));\n last = i + 1;\n }\n return escaped + str.substring(last);\n}\nfunction escape_attribute_value(value) {\n // keep booleans, null, and undefined for the sake of `spread`\n const should_escape = typeof value === 'string' || (value && typeof value === 'object');\n return should_escape ? escape(value, true) : value;\n}\nfunction escape_object(obj) {\n const result = {};\n for (const key in obj) {\n result[key] = escape_attribute_value(obj[key]);\n }\n return result;\n}\nfunction each(items, fn) {\n let str = '';\n for (let i = 0; i < items.length; i += 1) {\n str += fn(items[i], i);\n }\n return str;\n}\nconst missing_component = {\n $$render: () => ''\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === 'svelte:component')\n name += ' this={...}';\n 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. Otherwise you may need to fix a <${name}>.`);\n }\n return component;\n}\nfunction debug(file, line, column, values) {\n console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n console.log(values); // eslint-disable-line no-console\n return '';\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots, context) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(context || (parent_component ? parent_component.$$.context : [])),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, { $$slots = {}, context = new Map() } = {}) => {\n on_destroy = [];\n const result = { title: '', head: '', css: new Set() };\n const html = $$render(result, props, {}, $$slots, context);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map(css => css.code).join('\\n'),\n map: null // TODO\n },\n head: result.title + result.head\n };\n },\n $$render\n };\n}\nfunction add_attribute(name, value, boolean) {\n if (value == null || (boolean && !value))\n return '';\n const assignment = (boolean && value === true) ? '' : `=\"${escape(value, true)}\"`;\n return ` ${name}${assignment}`;\n}\nfunction add_classes(classes) {\n return classes ? ` class=\"${classes}\"` : '';\n}\nfunction style_object_to_string(style_object) {\n return Object.keys(style_object)\n .filter(key => style_object[key])\n .map(key => `${key}: ${escape_attribute_value(style_object[key])};`)\n .join(' ');\n}\nfunction add_styles(style_object) {\n const styles = style_object_to_string(style_object);\n return styles ? ` style=\"${styles}\"` : '';\n}\n\nfunction bind(component, name, callback) {\n const index = component.$$.props[name];\n if (index !== undefined) {\n component.$$.bound[index] = callback;\n callback(component.$$.ctx[index]);\n }\n}\nfunction create_component(block) {\n block && block.c();\n}\nfunction claim_component(block, parent_nodes) {\n block && block.l(parent_nodes);\n}\nfunction mount_component(component, target, anchor, customElement) {\n const { fragment, after_update } = component.$$;\n fragment && fragment.m(target, anchor);\n if (!customElement) {\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);\n // if the component was destroyed immediately\n // it will update the `$$.on_destroy` reference to `null`.\n // the destructured on_destroy may still reference to the old array\n if (component.$$.on_destroy) {\n component.$$.on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n }\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n const $$ = component.$$;\n if ($$.fragment !== null) {\n flush_render_callbacks($$.after_update);\n run_all($$.on_destroy);\n $$.fragment && $$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n $$.on_destroy = $$.fragment = null;\n $$.ctx = [];\n }\n}\nfunction make_dirty(component, i) {\n if (component.$$.dirty[0] === -1) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty.fill(0);\n }\n component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));\n}\nfunction init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {\n const parent_component = current_component;\n set_current_component(component);\n const $$ = component.$$ = {\n fragment: null,\n ctx: [],\n // state\n props,\n update: noop,\n not_equal,\n bound: blank_object(),\n // lifecycle\n on_mount: [],\n on_destroy: [],\n on_disconnect: [],\n before_update: [],\n after_update: [],\n context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),\n // everything else\n callbacks: blank_object(),\n dirty,\n skip_bound: false,\n root: options.target || parent_component.$$.root\n };\n append_styles && append_styles($$.root);\n let ready = false;\n $$.ctx = instance\n ? instance(component, options.props || {}, (i, ret, ...rest) => {\n const value = rest.length ? rest[0] : ret;\n if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {\n if (!$$.skip_bound && $$.bound[i])\n $$.bound[i](value);\n if (ready)\n make_dirty(component, i);\n }\n return ret;\n })\n : [];\n $$.update();\n ready = true;\n run_all($$.before_update);\n // `false` as a special case of no DOM component\n $$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n if (options.target) {\n if (options.hydrate) {\n start_hydrating();\n const nodes = children(options.target);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.l(nodes);\n nodes.forEach(detach);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.c();\n }\n if (options.intro)\n transition_in(component.$$.fragment);\n mount_component(component, options.target, options.anchor, options.customElement);\n end_hydrating();\n flush();\n }\n set_current_component(parent_component);\n}\nlet SvelteElement;\nif (typeof HTMLElement === 'function') {\n SvelteElement = class extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n connectedCallback() {\n const { on_mount } = this.$$;\n this.$$.on_disconnect = on_mount.map(run).filter(is_function);\n // @ts-ignore todo: improve typings\n for (const key in this.$$.slotted) {\n // @ts-ignore todo: improve typings\n this.appendChild(this.$$.slotted[key]);\n }\n }\n attributeChangedCallback(attr, _oldValue, newValue) {\n this[attr] = newValue;\n }\n disconnectedCallback() {\n run_all(this.$$.on_disconnect);\n }\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n // TODO should this delegate to addEventListener?\n if (!is_function(callback)) {\n return noop;\n }\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n };\n}\n/**\n * Base class for Svelte components. Used when dev=false.\n */\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n if (!is_function(callback)) {\n return noop;\n }\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n}\n\nfunction dispatch_dev(type, detail) {\n document.dispatchEvent(custom_event(type, Object.assign({ version: '3.59.2' }, detail), { bubbles: true }));\n}\nfunction append_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append(target, node);\n}\nfunction append_hydration_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append_hydration(target, node);\n}\nfunction insert_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert(target, node, anchor);\n}\nfunction insert_hydration_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert_hydration(target, node, anchor);\n}\nfunction detach_dev(node) {\n dispatch_dev('SvelteDOMRemove', { node });\n detach(node);\n}\nfunction detach_between_dev(before, after) {\n while (before.nextSibling && before.nextSibling !== after) {\n detach_dev(before.nextSibling);\n }\n}\nfunction detach_before_dev(after) {\n while (after.previousSibling) {\n detach_dev(after.previousSibling);\n }\n}\nfunction detach_after_dev(before) {\n while (before.nextSibling) {\n detach_dev(before.nextSibling);\n }\n}\nfunction listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation, has_stop_immediate_propagation) {\n const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];\n if (has_prevent_default)\n modifiers.push('preventDefault');\n if (has_stop_propagation)\n modifiers.push('stopPropagation');\n if (has_stop_immediate_propagation)\n modifiers.push('stopImmediatePropagation');\n dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });\n const dispose = listen(node, event, handler, options);\n return () => {\n dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });\n dispose();\n };\n}\nfunction attr_dev(node, attribute, value) {\n attr(node, attribute, value);\n if (value == null)\n dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });\n else\n dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });\n}\nfunction prop_dev(node, property, value) {\n node[property] = value;\n dispatch_dev('SvelteDOMSetProperty', { node, property, value });\n}\nfunction dataset_dev(node, property, value) {\n node.dataset[property] = value;\n dispatch_dev('SvelteDOMSetDataset', { node, property, value });\n}\nfunction set_data_dev(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n dispatch_dev('SvelteDOMSetData', { node: text, data });\n text.data = data;\n}\nfunction set_data_contenteditable_dev(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n dispatch_dev('SvelteDOMSetData', { node: text, data });\n text.data = data;\n}\nfunction set_data_maybe_contenteditable_dev(text, data, attr_value) {\n if (~contenteditable_truthy_values.indexOf(attr_value)) {\n set_data_contenteditable_dev(text, data);\n }\n else {\n set_data_dev(text, data);\n }\n}\nfunction validate_each_argument(arg) {\n if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {\n let msg = '{#each} only iterates over array-like objects.';\n if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {\n msg += ' You can use a spread to convert this iterable into an array.';\n }\n throw new Error(msg);\n }\n}\nfunction validate_slots(name, slot, keys) {\n for (const slot_key of Object.keys(slot)) {\n if (!~keys.indexOf(slot_key)) {\n console.warn(`<${name}> received an unexpected slot \"${slot_key}\".`);\n }\n }\n}\nfunction validate_dynamic_element(tag) {\n const is_string = typeof tag === 'string';\n if (tag && !is_string) {\n throw new Error('<svelte:element> expects \"this\" attribute to be a string.');\n }\n}\nfunction validate_void_dynamic_element(tag) {\n if (tag && is_void(tag)) {\n console.warn(`<svelte:element this=\"${tag}\"> is self-closing and cannot have content.`);\n }\n}\nfunction construct_svelte_component_dev(component, props) {\n const error_message = 'this={...} of <svelte:component> should specify a Svelte component.';\n try {\n const instance = new component(props);\n if (!instance.$$ || !instance.$set || !instance.$on || !instance.$destroy) {\n throw new Error(error_message);\n }\n return instance;\n }\n catch (err) {\n const { message } = err;\n if (typeof message === 'string' && message.indexOf('is not a constructor') !== -1) {\n throw new Error(error_message);\n }\n else {\n throw err;\n }\n }\n}\n/**\n * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.\n */\nclass SvelteComponentDev extends SvelteComponent {\n constructor(options) {\n if (!options || (!options.target && !options.$$inline)) {\n throw new Error(\"'target' is a required option\");\n }\n super();\n }\n $destroy() {\n super.$destroy();\n this.$destroy = () => {\n console.warn('Component was already destroyed'); // eslint-disable-line no-console\n };\n }\n $capture_state() { }\n $inject_state() { }\n}\n/**\n * Base class to create strongly typed Svelte components.\n * This only exists for typing purposes and should be used in `.d.ts` files.\n *\n * ### Example:\n *\n * You have component library on npm called `component-library`, from which\n * you export a component called `MyComponent`. For Svelte+TypeScript users,\n * you want to provide typings. Therefore you create a `index.d.ts`:\n * ```ts\n * import { SvelteComponentTyped } from \"svelte\";\n * export class MyComponent extends SvelteComponentTyped<{foo: string}> {}\n * ```\n * Typing this makes it possible for IDEs like VS Code with the Svelte extension\n * to provide intellisense and to use the component like this in a Svelte file\n * with TypeScript:\n * ```svelte\n * <script lang=\"ts\">\n * \timport { MyComponent } from \"component-library\";\n * </script>\n * <MyComponent foo={'bar'} />\n * ```\n *\n * #### Why not make this part of `SvelteComponent(Dev)`?\n * Because\n * ```ts\n * class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}\n * const component: typeof SvelteComponent = ASubclassOfSvelteComponent;\n * ```\n * will throw a type error, so we need to separate the more strictly typed class.\n */\nclass SvelteComponentTyped extends SvelteComponentDev {\n constructor(options) {\n super(options);\n }\n}\nfunction loop_guard(timeout) {\n const start = Date.now();\n return () => {\n if (Date.now() - start > timeout) {\n throw new Error('Infinite loop detected');\n }\n };\n}\n\nexport { HtmlTag, HtmlTagHydration, ResizeObserverSingleton, SvelteComponent, 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, afterUpdate, append, append_dev, append_empty_stylesheet, append_hydration, append_hydration_dev, append_styles, assign, attr, attr_dev, attribute_to_object, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, 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_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, 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, group_outros, handle_promise, hasContext, has_prop, head_selector, identity, init, init_binding_group, init_binding_group_dynamic, insert, 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, listen_dev, loop, loop_guard, merge_ssr_styles, 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, resize_observer_border_box, resize_observer_content_box, resize_observer_device_pixel_content_box, 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_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_style, set_svg_attributes, space, split_css_unit, spread, src_url_equal, start_hydrating, stop_immediate_propagation, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, 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, xlink_attr };\n","<script context=\"module\">\n let server = \"\";\n\n if (development_mode) {\n server = \"http://172.30.1.83\";\n }\n\n export const api = {\n server: server,\n dev_mode: development_mode,\n post: async function (api, data) {\n const res = await fetch(this.server + api, {\n method: \"POST\",\n body: JSON.stringify(data),\n });\n\n const json = await res.json();\n return json;\n },\n get: async function (api) {\n const res = await fetch(this.server + api, {\n method: \"GET\",\n });\n\n const json = await res.json();\n return json;\n },\n };\n</script>\n","<script>\n import { api } from \"./Api.svelte\";\n import { onMount, onDestroy } from \"svelte\";\n\n export let receive = () => {};\n export const send = send_data;\n\n function cleanup_server() {\n let url = api.server;\n if (url == \"\") {\n url = window.location.host;\n }\n url = url.replaceAll(\"http://\", \"\");\n url = url.replaceAll(\"https://\", \"\");\n return url;\n }\n\n let gateway = `ws://${cleanup_server()}/api/v1/uart/websocket`;\n let websocket;\n\n function send_data(data) {\n websocket.send(data);\n }\n\n function on_open(event) {}\n\n function on_close(event) {\n setTimeout(init, 1000);\n }\n\n function process(array) {\n receive(array);\n }\n\n function on_message(event) {\n let data = event.data;\n\n var fileReader = new FileReader();\n fileReader.onload = function (event) {\n process(new Uint8Array(event.target.result));\n };\n\n if (data instanceof Blob) {\n fileReader.readAsArrayBuffer(data);\n }\n }\n\n function init() {\n websocket = new WebSocket(gateway);\n websocket.onopen = on_open;\n websocket.onclose = on_close;\n websocket.onmessage = on_message;\n }\n\n function destroy() {\n websocket.onclose = function () {};\n websocket.close();\n }\n\n onMount(() => {\n init();\n });\n\n onDestroy(() => {\n destroy();\n });\n</script>\n","const escSeq = {\n \"7\": null,\n \"8\": null,\n \"[20h\": null,\n \"[?1h\": null,\n \"[?3h\": null,\n \"[?4h\": null,\n \"[?5h\": null,\n \"[?6h\": null,\n \"[?7h\": null,\n \"[?8h\": null,\n \"[?9h\": null,\n \"[20l\": null,\n \"[?1l\": null,\n \"[?2l\": null,\n \"[?3l\": null,\n \"[?4l\": null,\n \"[?5l\": null,\n \"[?6l\": null,\n \"[?7l\": null,\n \"[?8l\": null,\n \"[?9l\": null,\n \"=\": null,\n \">\": null,\n \"(A\": null,\n \")A\": null,\n \"(B\": null,\n \")B\": null,\n \"(0\": null,\n \")0\": null,\n \"(1\": null,\n \")1\": null,\n \"(2\": null,\n \")2\": null,\n \"N\": null,\n \"O\": null,\n // \"[m\": function (state) { if (state.spanCount > 0) {state.output +=\n // '</span>'; state.spanCount--;} }, \"[0m\": function (state) { if\n // (state.spanCount > 0) {state.output += '</span>'; state.spanCount--;} },\n // \"[1m\": { 'class': 'bold' }, \"[2m\": { 'class': 'light' }, \"[4m\": {\n // 'class': 'underline' }, \"[5m\": { 'class': 'blink' }, \"[7m\": { 'class':\n // 'reverse' }, \"[8m\": { 'class': 'invisible' },\n \"[;r\": null,\n \"[A\": null,\n \"[B\": null,\n \"[C\": null,\n \"[D\": null,\n \"[H\": null,\n \"[;H\": null,\n \"[f\": null,\n \"[;f\": null,\n \"D\": null,\n \"M\": null,\n \"E\": null,\n \"H\": null,\n \"[g\": null,\n \"[0g\": null,\n \"[3g\": null,\n \"#3\": null,\n \"#4\": null,\n \"#5\": null,\n \"#6\": null,\n \"[K\": null,\n \"[0K\": null,\n \"[1K\": null,\n \"[2K\": null,\n \"[J\": null,\n \"[0J\": null,\n \"[1J\": null,\n \"[2J\": null,\n \"5n\": null,\n \"0n\": null,\n \"3n\": null,\n \"6n\": null,\n \";R\": null,\n \"[c\": null,\n \"[0c\": null,\n \"[?1;0c\": null,\n \"c\": null,\n \"#8\": null,\n \"[2;1y\": null,\n \"[2;2y\": null,\n \"[2;9y\": null,\n \"[2;10y\": null,\n \"[0q\": null,\n \"[1q\": null,\n \"[2q\": null,\n \"[3q\": null,\n \"[4q\": null\n}\n\nconst modeClasses = {\n '1': 'bold',\n '2': 'light',\n '3': 'underline',\n '4': 'blink',\n '5': 'reverse',\n '6': 'invisible'\n}\n\nconst modeStyles = {\n\n '30': 'color: black',\n '31': 'color: red',\n '32': 'color: green',\n '33': 'color: yellow',\n '34': 'color: blue',\n '35': 'color: magenta',\n '36': 'color: cyan',\n '37': 'color: white',\n\n '40': 'background-color: black',\n '41': 'background-color: red',\n '42': 'background-color: green',\n '43': 'background-color: yellow',\n '44': 'background-color: blue',\n '45': 'background-color: magenta',\n '46': 'background-color: cyan',\n '47': 'background-color: white'\n}\n\nfunction processModes(escapeTxt, state) {\n var modes = escapeTxt.substring(1, escapeTxt.length - 1);\n\n if (modes.length > 0) {\n modes = modes.split(';');\n for (let i = 0; i < modes.length; i++) {\n if (modeClasses[modes[i]]) {\n state\n .classes\n .push(modeClasses[modes[i]]);\n } else if (modeStyles[modes[i]]) {\n state\n .styles\n .push(modeStyles[modes[i]]);\n } else if (modes[i] === '0') {\n if (state.spanCount > 0) {\n state.output += '</span>';\n state.spanCount--;\n }\n }\n }\n } else {\n if (state.spanCount > 0) {\n state.output += '</span>';\n state.spanCount--;\n }\n }\n}\n\nfunction isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}\n\nfunction isDigit(str) {\n return str.length === 1 && str.match(/[0-9]/i);\n}\n\nfunction processEscape(escapeTxt, state) {\n if (escapeTxt.startsWith('[') && escapeTxt.endsWith('m')) {\n processModes(escapeTxt, state);\n } else {\n const entry = escSeq[escapeTxt];\n if (entry && entry !== null) {\n if (typeof entry === 'object') {\n if (entry.class) {\n state\n .classes\n .push(entry.class);\n }\n if (entry.style) {\n state\n .styles\n .push(entry.stye);\n }\n } else if (typeof entry === 'function') {\n entry(state);\n }\n }\n }\n}\n\nexport default function parseTerminal(text) {\n\n var escapeTxt = '';\n\n var state = {\n output: '',\n spanCount: 0,\n classes: [],\n styles: []\n }\n\n for (let i = 0; i < text.length; i++) {\n let character = text.charAt(i);\n\n if (character === '\\u001b') {\n escapeTxt = text.charAt(++i);\n if (escapeTxt === '[') {\n // process until character\n do {\n character = text.charAt(++i)\n escapeTxt += character;\n } while (!isLetter(character) && i < text.length);\n } else if (escapeTxt === '#') {\n // process until digit\n do {\n character = text.charAt(++i)\n escapeTxt += character;\n } while (!isDigit(character) && i < text.length);\n } else if (escapeTxt === '(' || escapeTxt === ')') {\n // process another char\n escapeTxt += text.charAt(++i);\n } else {\n // that's the escape\n }\n\n processEscape(escapeTxt, state);\n\n } else {\n if (state.classes.length > 0 || state.styles.length > 0) {\n state.output += `<span \n class=\"${state.classes.join(' ')}\"\n style=\"${state.styles.join(';')}\n \">`;\n state.classes = [];\n state.styles = [];\n state.spanCount++;\n }\n\n if (character === ' ') {\n state.output += '&nbsp;';\n } else {\n state.output += character;\n }\n }\n }\n\n // replace single &nbsp; enclosed with non &nbsp; characters with spaces\n state.output = state\n .output\n .replace(/&nbsp;([^&]+)&nbsp;/g, ' $1 ');\n\n // return first space to &nbsp;\n if (state.output.startsWith(' ')) {\n state.output = '&nbsp;' + state.output.substring(1);\n }\n\n\n for (let i = 0; i < state.spanCount; i++) {\n state.output += '</span>';\n }\n\n return state.output;\n}\n","<script>\n export let value = \"Value\";\n //export let click;\n\n let left = \"\";\n let right = \"\";\n let timer = null;\n\n function reset_brace() {\n left = \"[\";\n right = \"]\";\n }\n\n function set_brace() {\n left = \">\";\n right = \"<\";\n }\n\n function timer_click() {\n if (left == \"[\") {\n set_brace();\n } else {\n reset_brace();\n }\n }\n\n function mouseenter() {\n if (timer == null) {\n timer = setInterval(timer_click, 400);\n }\n set_brace();\n }\n\n function mouseleave() {\n if (timer != null) {\n clearInterval(timer);\n timer = null;\n }\n reset_brace();\n }\n\n reset_brace();\n</script>\n\n<input\n type=\"button\"\n value={left + value + right}\n class=\"button-css\"\n on:mouseenter={mouseenter}\n on:mouseleave={mouseleave}\n on:click\n/>\n\n<style>\n .button-css {\n background-color: black;\n color: white;\n font-size: 28px;\n font-family: \"DOS\", monospace;\n line-height: 1;\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n border: 0;\n padding: 5px 10px;\n display: inline-block;\n max-width: 100%;\n }\n\n .button-css:hover {\n background: rgb(255, 255, 255);\n color: #000000;\n }\n</style>\n","<script>\n let closed = true;\n\n export function close() {\n closed = true;\n }\n\n export function show() {\n closed = false;\n }\n</script>\n\n{#if !closed}\n <popup-wrapper>\n <popup-body>\n <popup-content>\n <popup-close on:click={close} on:keypress={close}>X</popup-close>\n <popup-border>\n <slot />\n </popup-border>\n </popup-content>\n </popup-body>\n </popup-wrapper>\n{/if}\n\n<style>\n popup-wrapper {\n background-color: rgba(0, 0, 0, 0.863);\n width: 100%;\n height: 100%;\n display: table;\n table-layout: fixed;\n z-index: 999;\n overflow: auto;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n\n popup-body {\n margin: auto;\n display: table-cell;\n text-align: center;\n vertical-align: middle;\n width: 100%;\n }\n\n popup-content {\n background-color: #ffa21c;\n display: inline-block;\n outline: none;\n position: relative;\n text-align: initial;\n max-width: 100vw;\n }\n\n popup-border {\n display: block;\n border: 4px dashed #000;\n margin: 10px;\n padding: 10px;\n }\n\n popup-close {\n background-color: #000;\n display: inline-block;\n color: #ffa21c;\n position: absolute;\n width: 24px;\n right: 0px;\n top: 0px;\n text-align: center;\n }\n popup-close:hover {\n background-color: #fff;\n color: #000;\n }\n</style>\n","<script>\n</script>\n\n<spinner />\n\n<style>\n @keyframes spinner-animation {\n 0% {\n content: \"|\";\n }\n 25% {\n content: \"/\";\n }\n 50% {\n content: \"-\";\n }\n 75% {\n content: \"\\\\\";\n }\n 100% {\n content: \"|\";\n }\n }\n\n spinner::after {\n display: inline-block;\n animation: spinner-animation 0.6s linear infinite alternate;\n content: \"|\";\n }\n</style>\n","<script>\n import { onMount } from \"svelte\";\n\n const items = [\n [\n [\".\", \"o\", \"O\", \" \"],\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n ],\n [\n [\" \", \".\", \"o\", \"O\"],\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n ],\n [\n [\" \", \" \", \".\", \"o\"],\n [\" \", \" \", \" \", \"O\"],\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n ],\n [\n [\" \", \" \", \" \", \".\"],\n [\" \", \" \", \" \", \"o\"],\n [\" \", \" \", \" \", \"O\"],\n [\" \", \" \", \" \", \" \"],\n ],\n [\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \".\"],\n [\" \", \" \", \" \", \"o\"],\n [\" \", \" \", \" \", \"O\"],\n ],\n [\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \".\"],\n [\" \", \" \", \"O\", \"o\"],\n ],\n [\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n [\" \", \"O\", \"o\", \".\"],\n ],\n [\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n [\"O\", \"o\", \".\", \" \"],\n ],\n [\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n [\"O\", \" \", \" \", \" \"],\n [\"o\", \".\", \" \", \" \"],\n ],\n [\n [\" \", \" \", \" \", \" \"],\n [\"O\", \" \", \" \", \" \"],\n [\"o\", \" \", \" \", \" \"],\n [\".\", \" \", \" \", \" \"],\n ],\n [\n [\"O\", \" \", \" \", \" \"],\n [\"o\", \" \", \" \", \" \"],\n [\".\", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n ],\n [\n [\"o\", \"O\", \" \", \" \"],\n [\".\", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n [\" \", \" \", \" \", \" \"],\n ],\n ];\n\n let index = 0;\n let text_pointer = items[index];\n\n function timer_tick() {\n index++;\n if (index >= items.length) index = 0;\n text_pointer = items[index];\n }\n\n onMount(() => setInterval(timer_tick, 100));\n</script>\n\n<div>\n {#each text_pointer as text_line}\n {#each text_line as text, i}\n {#if text == \" \"}&nbsp;{:else}{text}{/if}\n {#if i < 3}&nbsp;{/if}\n {/each}\n <br />\n {/each}\n</div>\n","<div class=\"grid\">\n <slot />\n</div>\n\n<style>\n .grid {\n display: inline-grid;\n grid-template-columns: auto auto;\n }\n\n :global(.grid > div) {\n margin-top: 10px;\n }\n\n @media (max-width: 520px) {\n .grid {\n grid-template-columns: auto;\n width: 100%;\n }\n }\n</style>\n","<script>\n export let name = \"Name\";\n export let splitter = false;\n export let selectable = false;\n</script>\n\n{#if !splitter}\n <div class=\"value-name\">{name}:</div>\n <div class=\"value {selectable ? 'selectable' : ''}\"><slot /></div>\n{:else}\n <div class=\"value-name splitter\">{name}</div>\n <div class=\"value mobile-hidden\">&nbsp;<slot /></div>\n{/if}\n\n<style>\n .value {\n display: inline-flex;\n }\n\n .value-name {\n text-align: right;\n }\n\n @media (max-width: 520px) {\n .value-name {\n text-align: left;\n }\n\n .splitter {\n background-color: #000;\n width: 100%;\n color: #ffa21d;\n text-align: center;\n }\n }\n</style>\n","<script>\n export let value = \"\";\n export let type = \"text\";\n export let input = undefined;\n\n export function set_value(new_value) {\n value = new_value;\n }\n\n export function get_value() {\n return value;\n }\n\n function text_input() {\n this.size = this.value.length > 3 ? this.value.length : 3;\n value = this.value;\n if (input != undefined) {\n input(value);\n }\n }\n</script>\n\n<input\n autocorrect=\"off\"\n autocapitalize=\"none\"\n autocomplete=\"off\"\n {type}\n {value}\n size={(value + \"\").length > 3 ? (value + \"\").length : 3}\n on:input={text_input}\n/>\n\n<style>\n input {\n display: inline-block;\n color: #000;\n font-size: 28px;\n font-family: \"DOS\", monospace;\n line-height: 1;\n box-sizing: border-box;\n margin: 0;\n border: 0;\n border-bottom: 4px solid #000;\n padding: 0 5px 0 5px;\n box-shadow: none;\n border-radius: 0;\n -moz-appearance: none;\n -webkit-appearance: none;\n appearance: none;\n background-color: #ffa21c;\n height: 32px;\n }\n\n input:focus-visible,\n input:hover {\n outline: 0;\n background-color: white;\n }\n\n @media (max-width: 520px) {\n input {\n max-width: 100%;\n }\n }\n</style>\n","const encodingUtf8 = \"UTF-8\";\nconst encodingAscii = \"ASCII\";\n\nconst defaultEncoding = encodingUtf8;\nconst replacementChar = 0xFFFD;\n\nconst createUtf8Char = function(charCode, arr){\n\tif(charCode < 0x80){\n\t\t//Treat ASCII differently since it doesn't begin with 0x80\n\t\tarr.push(charCode);\n\t}else{\n\t\tconst limits = [0x7F, 0x07FF, 0xFFFF, 0x1FFFFF];\n\t\tlet i = 0;\n\t\twhile(true){\n\t\t\ti++;\n\t\t\t\n\t\t\tif(i === limits.length){\n\t\t\t\tconsole.error(\"UTF-8 Write - attempted to encode illegally high code point - \" + charCode);\n\t\t\t\tcreateUtf8Char(replacementChar, arr);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(charCode <= limits[i]){\n\t\t\t\t//We have enough bits in 'i+1' bytes to encode this character\n\t\t\t\ti += 1;\n\n\t\t\t\tlet aByte = 0;\n\t\t\t\tlet j;\n\t\t\t\t//add i bits of length indicator\n\t\t\t\tfor(j = 0; j < i; j++){\n\t\t\t\t\taByte <<= 1;\n\t\t\t\t\taByte |= 1;\n\t\t\t\t}\n\t\t\t\t//Shift length indicator to MSB\n\t\t\t\taByte <<= (8 - i);\n\t\t\t\t//Add 8 - (i + 1) bits of code point to fill the first byte\n\t\t\t\taByte |= (charCode >> (6 * (i - 1)));\n\t\t\t\tarr.push(aByte);\n\t\t\t\t//Fist byte already processed, start at 1 rather than 0\n\t\t\t\tfor(j = 1; j < i; j++){\n\t\t\t\t\t//Continuation flag\n\t\t\t\t\taByte = 0x80;\n\t\t\t\t\t//6 bits of code point\n\t\t\t\t\taByte |= (charCode >> (6 * (i - (j + 1)))) & 0xBF;\n\t\t\t\t\tarr.push(aByte);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\n\nconst utf8ReadChar = function(charStruct, buf, readPos, maxBytes){\n\tconst firstByte = buf.getUint8(readPos);\n\tcharStruct.bytesRead = 1;\n\tcharStruct.charVal = 0;\n\tif(firstByte & 0x80){\n\t\tlet numBytes = 0;\n\t\tlet aByte = firstByte;\n\t\twhile(aByte & 0x80){\n\t\t\tnumBytes++;\n\t\t\taByte <<= 1;\n\t\t}\n\t\tif(numBytes === 1){\n\t\t\tconsole.error(\"UTF-8 read - found continuation byte at beginning of character\");\n\t\t\tcharStruct.charVal = replacementChar;\n\t\t\treturn;\n\t\t}\n\t\tif(numBytes > maxBytes){\n\t\t\tconsole.error(\"UTF-8 read - attempted to read \" + numBytes + \" byte character, \" + (maxBytes - numBytes) + \" bytes past end of buffer\");\n\t\t\tcharStruct.charVal = replacementChar;\n\t\t\treturn;\n\t\t}\n\t\t//2 bytes means 3 bits reserved for UTF8 byte encoding, 5 bytes remaining for codepoint, and so on\n\t\tcharStruct.charVal = firstByte & (0xFF >> (numBytes + 1));\n\t\tfor(let i = 1; i < numBytes; i++){\n\t\t\taByte = buf.getUint8(readPos + i);\n\t\t\t//0xC0 should isolate the continuation flag which should be 0x80\n\t\t\tif((aByte & 0xC0) !== 0x80){\n\t\t\t\tconsole.error(\"UTF-8 read - attempted to read \" + numBytes + \" byte character, found non-continuation at byte \" + i);\n\t\t\t\tcharStruct.charVal = replacementChar;\n\t\t\t\t//Wikipedia (awesomely reliable source of information /sarcasm) suggests\n\t\t\t\t// parsers should replace first byte of invalid sequence and continue\n\t\t\t\tcharStruct.bytesRead = 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcharStruct.charVal <<= 6;\n\t\t\t//0x3F is the mask to remove the continuation flag\n\t\t\tcharStruct.charVal |= (aByte & 0x3F);\n\n\t\t\tif(i === 1){\n\t\t\t\tconst rshift = (8 - (numBytes + 1)) - 1;\n\t\t\t\tif((charStruct.charVal >> rshift) === 0){\n\t\t\t\t\tconsole.error(\"UTF-8 read - found overlong encoding\");\n\t\t\t\t\tcharStruct.charVal = replacementChar;\n\t\t\t\t\tcharStruct.bytesRead = 1;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcharStruct.bytesRead++;\n\t\t}\n\t\tif(charStruct.charVal > 0x10FFFF){\n\t\t\tconsole.error(\"UTF-8 read - found illegally high code point \" + charStruct.charVal);\n\t\t\tcharStruct.charVal = replacementChar;\n\t\t\tcharStruct.bytesRead = 1;\n\t\t\treturn;\n\t\t}\n\n\t}else{\n\t\tcharStruct.charVal = firstByte;\n\t}\n};\n\nconst writeStringUtf8 = function(str){\n\tconst arr = [];\n\tfor(let i = 0; i < str.length; i++){\n\t\tcreateUtf8Char(str.charCodeAt(i), arr);\n\t}\n\treturn arr;\n};\n\nconst writeStringAscii = function(str){\n\tconst arr = [];\n\tfor(let i = 0; i < str.length; i++){\n\t\tlet chr = str.charCodeAt(i);\n\t\tif(chr > 255){\n\t\t\tchr = \"?\".charCodeAt(0);\n\t\t}\n\t\tarr.push(chr);\n\t}\n\treturn arr;\n};\n\nconst readStringUtf8 = function(buf, byteOffset, bytesToRead, terminator){\n\tconst nullTerm = (typeof bytesToRead === \"undefined\");\n\tlet readPos = byteOffset || 0;\n\tif(!nullTerm && readPos + bytesToRead > buf.byteLength){\n\t\tthrow new Error(\"Attempted to read \" + ((readPos + bytesToRead) - buf.byteLength) + \" bytes past end of buffer\");\n\t}\n\tconst str = [];\n\tconst charStruct = {};\n\twhile(readPos < buf.byteLength && (nullTerm || bytesToRead > (readPos - byteOffset))){\n\t\tutf8ReadChar(charStruct, buf, readPos, nullTerm ? buf.byteLength - (readPos + byteOffset) : (bytesToRead - (readPos - byteOffset)));\n\t\treadPos += charStruct.bytesRead;\n\t\tif(nullTerm && charStruct.charVal === terminator){\n\t\t\tbreak;\n\t\t}\n\t\tstr.push(String.fromCharCode(charStruct.charVal));\n\t}\n\treturn {\n\t\tstr: str.join(\"\"),\n\t\tbyteLength: (readPos - byteOffset)\n\t};\n};\n\nconst readStringAscii = function(buf, byteOffset, bytesToRead, terminator){\n\tconst str = [];\n\tlet byteLength = 0;\n\tbyteOffset = byteOffset || 0;\n\tlet nullTerm = false;\n\tif(typeof bytesToRead === \"undefined\"){\n\t\tnullTerm = true;\n\t\tbytesToRead = buf.byteLength - buf.byteOffset;\n\t}\n\tfor(let i = 0; i < bytesToRead; i++){\n\t\tconst charCode = buf.getUint8(i + byteOffset);\n\t\tbyteLength++;\n\t\tif(nullTerm && charCode === terminator){\n\t\t\tbreak;\n\t\t}\n\t\tstr.push(String.fromCharCode(charCode));\n\t}\n\treturn {\n\t\tstr: str.join(\"\"), \n\t\tbyteLength: byteLength\n\t};\n};\n\nclass StringView {\n\n\t#readString = new Map([\n\t\t[encodingAscii, readStringAscii],\n\t\t[encodingUtf8, readStringUtf8],\n\t]);\n\t#writeString = new Map([\n\t\t[encodingAscii, writeStringAscii],\n\t\t[encodingUtf8, writeStringUtf8],\n\t]);\n\n\t#checkEncoding(encoding){\n\t\tif(typeof encoding === \"undefined\"){\n\t\t\tencoding = defaultEncoding;\n\t\t}\n\t\tif(!this.#writeString.has(encoding)){\n\t\t\tthrow new Error(\"Unknown string encoding '\" + encoding + \"'\");\n\t\t}\n\t\treturn encoding;\n\t}\n\n\taddStringCodec(encoding, reader, writer){\n\t\tthis.#readString.put(encoding, reader);\n\t\tthis.#writeString.put(encoding, writer);\n\t}\n\n\tstringByteLength(str, encoding){\n\t\tencoding = this.#checkEncoding(encoding);\t\n\t\treturn this.#writeString.get(encoding)(str).length;\n\t}\n\n\tgetString(dataView, byteOffset, byteLength, encoding){\n\t\treturn this.getStringData(dataView, byteOffset, byteLength, encoding).str;\n\t}\n\n\tgetStringData(dataView, byteOffset, byteLength, encoding){\n\t\tencoding = this.#checkEncoding(encoding);\n\t\tif(!byteLength){\n\t\t\tbyteLength = dataView.byteLength - byteOffset;\n\t\t}\n\t\treturn this.#readString.get(encoding)(dataView, byteOffset, byteLength);\n\t}\n\n\tgetStringNT(dataView, byteOffset, encoding, terminator = 0) {\n\t\treturn this.getStringDataNT(dataView, byteOffset, encoding, terminator).str;\n\t}\n\n\tgetStringDataNT(dataView, byteOffset, encoding, terminator = 0) {\n\t\tencoding = this.#checkEncoding(encoding);\n\t\treturn this.#readString.get(encoding)(dataView, byteOffset, undefined, terminator);\n\t}\n\t\n\tsetString(dataView, byteOffset, value, encoding){\n\t\tencoding = this.#checkEncoding(encoding);\n\t\tconst arr = this.#writeString.get(encoding)(value);\n\t\tlet i;\n\t\tfor(i = 0; i < arr.length && byteOffset + i < dataView.byteLength; i++){\n\t\t\tdataView.setUint8(byteOffset + i, arr[i]);\n\t\t}\n\t\treturn i;\n\t}\n\t\n\tsetStringNT(dataView, byteOffset, value, encoding){\n\t\tlet bytesWritten = this.setString(dataView, byteOffset, value, encoding);\n\t\tif(byteOffset + bytesWritten >= dataView.byteLength){\n\t\t\t//Incomplete string write, or written up against end of buffer\n\t\t\t//Pull back 1 byte to put null term in\n\t\t\tbytesWritten -= 1;\n\t\t}\n\t\tdataView.setUint8(byteOffset + bytesWritten, 0);\n\t\treturn bytesWritten + 1;\n\t}\n}\n\nexport default new StringView();\n","<script>\n export let items = [];\n export let value = \"\";\n\n export function get_value() {\n return value;\n }\n\n function on_change() {\n value = this.value;\n }\n</script>\n\n<select bind:value on:change={on_change}>\n {#each items as item}\n <option value={item.value}>\n {item.text}\n </option>\n {/each}\n</select>\n\n<style>\n select {\n display: inline-block;\n color: #000;\n font-size: 28px;\n font-family: \"DOS\", monospace;\n line-height: 1;\n box-sizing: border-box;\n margin: 0;\n border: 0;\n border-bottom: 4px solid #000;\n padding: 0 5px 0 5px;\n box-shadow: none;\n border-radius: 0;\n -moz-appearance: none;\n -webkit-appearance: none;\n appearance: none;\n background-color: #ffa21c;\n }\n\n select::-ms-expand {\n display: none;\n }\n select:hover {\n background: rgb(255, 255, 255);\n color: #000000;\n }\n select:focus {\n box-shadow: none;\n outline: none;\n background: rgb(255, 255, 255);\n color: #000000;\n }\n select option {\n font-weight: normal;\n }\n\n @media (max-width: 520px) {\n select {\n width: 100%;\n }\n }\n</style>\n","<script>\n import { onMount } from \"svelte\";\n import parseTerminal from \"./terminal.js\";\n import Button from \"./Button.svelte\";\n import Popup from \"./Popup.svelte\";\n import Spinner from \"./Spinner.svelte\";\n import SpinnerBig from \"./SpinnerBig.svelte\";\n import { api } from \"../lib/Api.svelte\";\n import Grid from \"./Grid.svelte\";\n import Value from \"./Value.svelte\";\n import Input from \"./Input.svelte\";\n import StringView from \"stringview/StringView\";\n import Select from \"./Select.svelte\";\n\n let bytes = new Uint8Array(0);\n\n function cat_arrays(a, b) {\n var c = new a.constructor(a.length + b.length);\n c.set(a, 0);\n c.set(b, a.length);\n return c;\n }\n\n export const push = (data) => {\n bytes = cat_arrays(bytes, data);\n process_bytes();\n };\n\n export let on_mount = () => {};\n export let send = () => {};\n\n let ready = {\n lines: [],\n last: \"\",\n };\n\n const line_empty_to_br = (line) => {\n if (line.trim() == \"\") {\n return \"<br>\";\n } else {\n return line;\n }\n };\n\n const process_bytes = () => {\n // convert to DataView\n const data_view = new DataView(\n bytes.buffer,\n bytes.byteOffset,\n bytes.byteLength\n );\n\n const encoding = \"ASCII\";\n const eol = \"\\n\";\n const eol_code = eol.charCodeAt(0);\n\n // find last EOL\n const last_eol = bytes.lastIndexOf(eol_code);\n\n if (last_eol != -1) {\n // decode bytes from 0 to last_eol\n const decoded = StringView.getString(\n data_view,\n 0,\n last_eol,\n encoding\n );\n\n // split by EOL\n let lines = decoded.split(eol);\n\n // parse and push lines\n lines = lines.map((line) => parseTerminal(line));\n ready.lines.push(...lines);\n\n // remove processed bytes\n bytes = bytes.subarray(last_eol + 1);\n }\n\n // decode last line\n if (bytes.length > 0) {\n const last_string = StringView.getString(\n data_view,\n 0,\n bytes.length,\n encoding\n );\n ready.last = parseTerminal(last_string);\n } else {\n ready.last = \"\";\n }\n };\n\n onMount(() => {\n on_mount();\n });\n\n const scrollToBottom = (node) => {\n const scroll = () =>\n node.scroll({\n top: node.scrollHeight,\n behavior: \"instant\",\n });\n scroll();\n\n return { update: scroll };\n };\n\n let popup = {\n text: \"\",\n self: null,\n };\n\n let config = {\n popup: null,\n bit_rate: null,\n stop_bits: null,\n parity: null,\n data_bits: null,\n };\n\n async function config_apply() {\n popup.text = \"\";\n popup.self.show();\n popup = popup;\n config.popup.close();\n\n await api\n .post(\"/api/v1/uart/set_config\", {\n bit_rate: parseInt(config.bit_rate.get_value()),\n stop_bits: parseInt(config.stop_bits.get_value()),\n parity: parseInt(config.parity.get_value()),\n data_bits: parseInt(config.data_bits.get_value()),\n })\n .then((json) => {\n if (json.error) {\n popup.text = json.error;\n } else {\n popup.text = \"Saved!\";\n }\n });\n }\n\n let tx = {\n popup: null,\n data: \"\",\n eol: \"\\\\r\\\\n\",\n };\n\n async function uart_send() {\n tx.popup.close();\n let eol = tx.eol.replaceAll(\"\\\\r\", \"\\r\").replaceAll(\"\\\\n\", \"\\n\");\n let data = tx.data + eol;\n\n // split data to chunks of 1k bytes\n let chunks = [];\n while (data.length > 0) {\n chunks.push(data.slice(0, 1024));\n data = data.slice(1024);\n }\n\n for (let chunk of chunks) {\n send(chunk);\n }\n }\n</script>\n\n<div class=\"terminal-wrapper\">\n <div class=\"terminal selectable\" use:scrollToBottom={ready}>\n <div class=\"line\">\n {#each ready.lines as line}\n {@html line}<br />\n {/each}\n </div>\n {#if ready.last}\n <div class=\"line\">\n {@html ready.last}<span class=\"cursor\">_</span>\n </div>\n {/if}\n </div>\n <div class=\"config\">\n <Button value=\"S\" on:click={tx.popup.show} />\n <Button value=\"#\" on:click={config.popup.show} />\n </div>\n <Popup bind:this={config.popup}>\n {#await api.get(\"/api/v1/uart/get_config\", {})}\n <SpinnerBig />\n {:then json}\n <div>UART config</div>\n <Grid>\n <Value name=\"Rate\">\n <Input\n type=\"number\"\n value={json.bit_rate}\n bind:this={config.bit_rate}\n />\n </Value>\n <Value name=\"Stop\">\n <Select\n bind:this={config.stop_bits}\n items={[\n { text: \"1\", value: \"0\" },\n { text: \"1.5\", value: \"1\" },\n { text: \"2\", value: \"2\" },\n ]}\n value={json.stop_bits.toString()}\n />\n </Value>\n <Value name=\"Prty\">\n <Select\n bind:this={config.parity}\n items={[\n { text: \"None\", value: \"0\" },\n { text: \"Odd\", value: \"1\" },\n { text: \"Even\", value: \"2\" },\n ]}\n value={json.parity.toString()}\n />\n </Value>\n <Value name=\"Data\">\n <Select\n bind:this={config.data_bits}\n items={[\n { text: \"5\", value: \"5\" },\n { text: \"6\", value: \"6\" },\n { text: \"7\", value: \"7\" },\n { text: \"8\", value: \"8\" },\n ]}\n value={json.data_bits.toString()}\n />\n </Value>\n </Grid>\n <div style=\"margin-top: 10px; text-align: center;\">\n <Button value=\"Save\" on:click={config_apply} />\n </div>\n {:catch error}\n <error>{error.message}</error>\n {/await}\n </Popup>\n\n <Popup bind:this={popup.self}>\n {#if popup.text != \"\"}\n {popup.text}\n {:else}\n <Spinner />\n {/if}\n </Popup>\n\n <Popup bind:this={tx.popup}>\n <Grid>\n <Value name=\"Data\">\n <Input value={tx.data} input={(data) => (tx.data = data)} /><br\n />\n </Value>\n <Value name=\"EOL\">\n <Input value={tx.eol} input={(data) => (tx.eol = data)} />\n </Value>\n </Grid>\n <div style=\"margin-top: 10px; text-align: center;\">\n <Button value=\"Send\" on:click={uart_send} />\n </div>\n </Popup>\n</div>\n\n<style>\n @keyframes blink {\n 0% {\n opacity: 1;\n }\n 49% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n 99% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n .cursor {\n animation: blink 1s infinite;\n }\n\n .line {\n display: block;\n }\n\n .terminal-wrapper {\n position: relative;\n height: 100%;\n }\n\n .terminal {\n height: 100%;\n font-size: 18px;\n overflow-y: scroll;\n overflow-x: clip;\n white-space: wrap;\n }\n\n .config {\n position: absolute;\n top: 0;\n right: 0;\n }\n\n :global(.terminal.bold) {\n font-weight: bold;\n }\n\n :global(.terminal.underline) {\n text-decoration: underline;\n }\n\n :global(.terminal.blink) {\n animation: blink 1s infinite;\n }\n\n :global(.terminal.invisible) {\n display: none;\n }\n\n :global(.terminal-wrapper select) {\n width: 100%;\n }\n</style>\n","<script>\n export let value = \"Value\";\n export let style = \"black\";\n</script>\n\n<input type=\"button\" {value} class=\"button {style}\" on:click />\n\n<style>\n .button {\n box-sizing: border-box;\n display: inline-block;\n font-size: 28px;\n font-family: \"DOS\", monospace;\n line-height: 1;\n border: 0;\n padding: 0 5px 0 5px;\n box-shadow: none;\n border-radius: 0;\n max-width: 100%;\n }\n\n .black {\n color: white;\n background-color: black;\n border-bottom: 4px solid #000;\n }\n\n .black:hover {\n background: #fff;\n color: #000;\n }\n\n .normal {\n color: #000;\n background-color: #ffa21c;\n border-bottom: 4px solid #ffa21c;\n }\n\n .normal:hover {\n background: #000;\n color: #fff;\n }\n</style>\n","<script>\n import { api } from \"../lib/Api.svelte\";\n import Input from \"../lib/Input.svelte\";\n import Spinner from \"../lib/Spinner.svelte\";\n import SpinnerBig from \"../lib/SpinnerBig.svelte\";\n import Button from \"../lib/Button.svelte\";\n import ButtonInline from \"../lib/ButtonInline.svelte\";\n import Select from \"../lib/Select.svelte\";\n import Popup from \"../lib/Popup.svelte\";\n import Value from \"../lib/Value.svelte\";\n import Grid from \"../lib/Grid.svelte\";\n\n let mode_select;\n let usb_mode_select;\n let ap_ssid_input;\n let ap_pass_input;\n let sta_ssid_input;\n let sta_pass_input;\n let hostname_input;\n let popup_select_net;\n\n let popup = {\n text: \"\",\n self: null,\n };\n\n async function reboot_board() {\n api.post(\"/api/v1/system/reboot\", {});\n popup.text = \"Rebooted\";\n popup.self.show();\n }\n\n async function save_settings() {\n popup.text = \"\";\n popup.self.show();\n popup = popup;\n\n await api\n .post(\"/api/v1/wifi/set_credentials\", {\n wifi_mode: mode_select.get_value(),\n usb_mode: usb_mode_select.get_value(),\n ap_ssid: ap_ssid_input.get_value(),\n ap_pass: ap_pass_input.get_value(),\n sta_ssid: sta_ssid_input.get_value(),\n sta_pass: sta_pass_input.get_value(),\n hostname: hostname_input.get_value(),\n })\n .then((json) => {\n if (json.error) {\n popup.text = json.error;\n } else {\n popup.text = \"Saved!\";\n }\n });\n }\n</script>\n\n<Grid>\n {#await api.get(\"/api/v1/wifi/get_credentials\")}\n <Value name=\"Mode\"><Spinner /></Value>\n <Value name=\"STA\" splitter={true}>(join another network)</Value>\n <Value name=\"SSID\"><Spinner /></Value>\n <Value name=\"Pass\"><Spinner /></Value>\n <Value name=\"AP\" splitter={true}>(own access point)</Value>\n <Value name=\"SSID\"><Spinner /></Value>\n <Value name=\"Pass\"><Spinner /></Value>\n <Value name=\"Hostname\"><Spinner /></Value>\n <Value name=\"USB mode\"><Spinner /></Value>\n {:then json}\n <Value name=\"Mode\">\n <Select\n bind:this={mode_select}\n items={[\n { text: \"STA (join another network)\", value: \"STA\" },\n { text: \"AP (own access point)\", value: \"AP\" },\n { text: \"Disabled (do not use WiFi)\", value: \"Disabled\" },\n ]}\n value={json.wifi_mode}\n />\n </Value>\n\n <Value name=\"STA\" splitter={true}>(join another network)</Value>\n\n <Value name=\"SSID\">\n <Input value={json.sta_ssid} bind:this={sta_ssid_input} />\n <ButtonInline value=\"+\" on:click={popup_select_net.show} />\n </Value>\n\n <Value name=\"Pass\">\n <Input value={json.sta_pass} bind:this={sta_pass_input} />\n </Value>\n\n <Value name=\"AP\" splitter={true}>(own access point)</Value>\n\n <Value name=\"SSID\">\n <Input value={json.ap_ssid} bind:this={ap_ssid_input} />\n </Value>\n\n <Value name=\"Pass\">\n <Input value={json.ap_pass} bind:this={ap_pass_input} />\n </Value>\n\n <Value name=\"Hostname\">\n <Input value={json.hostname} bind:this={hostname_input} />\n </Value>\n\n <Value name=\"USB mode\">\n <Select\n bind:this={usb_mode_select}\n items={[\n { text: \"BlackMagicProbe\", value: \"BM\" },\n { text: \"DapLink\", value: \"DAP\" },\n ]}\n value={json.usb_mode}\n />\n </Value>\n {:catch error}\n <error>{error.message}</error>\n {/await}\n</Grid>\n\n<div style=\"margin-top: 10px;\">\n <Button value=\"SAVE\" on:click={save_settings} />\n <Button value=\"REBOOT\" on:click={reboot_board} />\n</div>\n\n<Popup bind:this={popup_select_net}>\n {#await api.get(\"/api/v1/wifi/list\", {})}\n <div>Nets: <SpinnerBig /></div>\n {:then json}\n <div>Nets:</div>\n {#each json.net_list as net}\n <div>\n <ButtonInline\n style=\"normal\"\n value=\"[{net.ssid} {net.channel}ch {net.rssi}dBm {net.auth}]\"\n on:click={() => {\n popup_select_net.close();\n sta_ssid_input.set_value(net.ssid);\n }}\n />\n </div>\n {/each}\n {:catch error}\n <error>{error.message}</error>\n {/await}\n</Popup>\n\n<Popup bind:this={popup.self}>\n {#if popup.text != \"\"}\n {popup.text}\n {:else}\n <Spinner />\n {/if}\n</Popup>\n","<script>\n import { api } from \"../lib/Api.svelte\";\n import Grid from \"../lib/Grid.svelte\";\n import Spinner from \"../lib/Spinner.svelte\";\n import Value from \"../lib/Value.svelte\";\n\n function print_mac(mac_array) {\n let str = \"\";\n for (let index = 0; index < mac_array.length; index++) {\n str += mac_array[index].toString(16).padStart(2, \"0\");\n if (index < mac_array.length - 1) {\n str += \":\";\n }\n }\n return str;\n }\n\n function print_ip(ip_addr) {\n var byteArray = [0, 0, 0, 0];\n\n for (var index = 0; index < byteArray.length; index++) {\n var byte = ip_addr & 0xff;\n byteArray[index] = byte;\n ip_addr = ip_addr >> 8;\n }\n\n return byteArray.join(\".\");\n }\n</script>\n\n<!-- \n\"firmware_commit\":\t\"03b806d\",\n\"firmware_branch\":\t\"zlo/2630-logs-over-wifi\",\n\"firmware_branch_num\":\t\"157\",\n\"firmware_version\":\t\"0.1.1\",\n\"firmware_build_date\":\t\"22-09-2023\", \n-->\n<Grid>\n {#await api.get(\"/api/v1/system/info\")}\n <Value name=\"IP\"><Spinner /></Value>\n <Value name=\"Mac\"><Spinner /></Value>\n <Value name=\"IDF ver\"><Spinner /></Value>\n <Value name=\"Model\"><Spinner /></Value>\n\n <Value name=\"Heap\" splitter={true}>info</Value>\n <Value name=\"Min free\"><Spinner /></Value>\n <Value name=\"Free\"><Spinner /></Value>\n <Value name=\"Alloc\"><Spinner /></Value>\n <Value name=\"Max block\"><Spinner /></Value>\n\n <Value name=\"PSRAM\" splitter={true}>info</Value>\n <Value name=\"Min free\"><Spinner /></Value>\n <Value name=\"Free\"><Spinner /></Value>\n <Value name=\"Alloc\"><Spinner /></Value>\n <Value name=\"Max block\"><Spinner /></Value>\n {:then json}\n <Value name=\"IP\" selectable=\"true\">{print_ip(json.ip)}</Value>\n <Value name=\"Mac\">{print_mac(json.mac)}</Value>\n <Value name=\"IDF ver\">{json.idf_version}</Value>\n <Value name=\"FW commit\">\n {json.firmware_branch}#{json.firmware_commit}\n </Value>\n <Value name=\"FW ver\">\n {json.firmware_version}/{json.firmware_branch_num}/{json.firmware_build_date}\n </Value>\n <Value name=\"Model\">\n {json.model}.{json.revision}\n {json.cores}-core\n </Value>\n\n <Value name=\"Heap\" splitter={true}>info</Value>\n <Value name=\"Min free\">{json.heap.minimum_free_bytes}</Value>\n <Value name=\"Free\">{json.heap.total_free_bytes}</Value>\n <Value name=\"Alloc\">{json.heap.total_allocated_bytes}</Value>\n <Value name=\"Max block\">{json.heap.largest_free_block}</Value>\n\n <Value name=\"PSRAM\" splitter={true}>info</Value>\n <Value name=\"Min free\">{json.psram_heap.minimum_free_bytes}</Value>\n <Value name=\"Free\">{json.psram_heap.total_free_bytes}</Value>\n <Value name=\"Alloc\">{json.psram_heap.total_allocated_bytes}</Value>\n <Value name=\"Max block\">{json.psram_heap.largest_free_block}</Value>\n {:catch error}\n <error>{error.message}</error>\n {/await}\n</Grid>\n","<script>\n import { api } from \"../lib/Api.svelte\";\n import Spinner from \"../lib/Spinner.svelte\";\n</script>\n\n{#await api.get(\"/api/v1/system/tasks\")}\n <task-list>\n <span><Spinner /></span>\n <span><Spinner /></span>\n <span><Spinner /></span>\n <span><Spinner /></span>\n <span><Spinner /></span>\n </task-list>\n{:then json}\n <task-list>\n <span class=\"mobile-hidden\">Name</span>\n <span class=\"mobile-hidden\">State</span>\n <span class=\"mobile-hidden\">Handle</span>\n <span class=\"mobile-hidden\">Stack base</span>\n <span class=\"mobile-hidden\">WMRK</span>\n {#each json.list.sort(function (a, b) {\n return a.number - b.number;\n }) as task}\n <span>{task.name}</span>\n <span>{task.state}</span>\n <span>{task.handle.toString(16).toUpperCase()}</span>\n <span>{task.stack_base.toString(16).toUpperCase()}</span>\n <span>{task.watermark}</span>\n {/each}\n </task-list>\n{:catch error}\n <error>{error.message}</error>\n{/await}\n\n<style>\n task-list {\n display: inline-grid;\n grid-template-columns: auto auto auto auto auto;\n width: 100%;\n }\n\n @media (max-width: 768px) {\n task-list {\n grid-template-columns: auto auto auto auto;\n }\n\n task-list > span:nth-child(5n + 3) {\n display: none;\n }\n }\n\n @media (max-width: 600px) {\n task-list {\n grid-template-columns: auto auto auto;\n }\n\n task-list > span:nth-child(5n + 4) {\n display: none;\n }\n }\n\n @media (max-width: 520px) {\n task-list {\n grid-template-columns: auto;\n text-align: center;\n }\n\n task-list > span:nth-child(5n + 1) {\n padding-top: 10px;\n }\n\n task-list > span:nth-child(5n + 5) {\n border-bottom: 4px dashed #000;\n }\n }\n</style>\n","<script>\n import { api } from \"./Api.svelte\";\n import Button from \"./Button.svelte\";\n</script>\n\n{#if api.dev_mode}\n <div style=\"position: fixed; bottom: 0; right: 0;\">\n <Button\n value=\"RELOAD\"\n on:click={() => {\n location.reload();\n }}\n />\n </div>\n{/if}\n","<script>\n let active = false;\n let timer = undefined;\n\n export function activate() {\n active = true;\n\n if (timer != undefined) {\n clearTimeout(timer);\n }\n\n timer = setTimeout(() => {\n active = false;\n }, 100);\n }\n</script>\n\n<div class=\"indicatior\" class:active>U</div>\n\n<style>\n .indicatior {\n position: fixed;\n top: 0;\n right: 0;\n background-color: green;\n color: white;\n padding: 4px;\n visibility: hidden;\n pointer-events: none;\n }\n\n .indicatior.active {\n visibility: visible;\n }\n</style>\n","<script>\n import WebSocket from \"./lib/WebSocket.svelte\";\n import UartTerminal from \"./lib/UartTerminal.svelte\";\n import TabWiFi from \"./tabs/TabWiFi.svelte\";\n import TabSys from \"./tabs/TabSys.svelte\";\n import TabPs from \"./tabs/TabPS.svelte\";\n import Reload from \"./lib/Reload.svelte\";\n import Indicator from \"./lib/Indicator.svelte\";\n import { onMount } from \"svelte\";\n\n let current_tab = \"WiFi\";\n if (localStorage.getItem(\"current_tab\") != null) {\n current_tab = localStorage.getItem(\"current_tab\");\n }\n\n function change_tab(tab) {\n current_tab = tab;\n localStorage.setItem(\"current_tab\", current_tab);\n }\n\n let uart_history_array = [];\n function uart_history_array_get() {\n return uart_history_array;\n }\n\n function uart_history_array_put(data) {\n uart_history_array.push(data);\n }\n\n let uart_indicatior = undefined;\n let uart_terminal = undefined;\n let web_socket = undefined;\n\n function receive_uart(data) {\n uart_indicatior.activate();\n uart_history_array_put(data);\n if (uart_terminal != undefined) {\n uart_terminal.push(data);\n }\n }\n\n function uart_on_mount() {\n let uart_data = uart_history_array_get();\n for (let i = 0; i < uart_data.length; i++) {\n uart_terminal.push(uart_data[i]);\n }\n }\n\n function uart_send(data) {\n web_socket.send(data);\n }\n\n const tabs = [\"WiFi\", \"SYS\", \"PS\", \"UART\"];\n\n // ugly hack for terminal height on mobile devices\n const appHeight = () => {\n const doc = document.documentElement;\n doc.style.setProperty(\"--app-height\", `${window.innerHeight}px`);\n };\n\n onMount(() => {\n appHeight();\n window.addEventListener(\"resize\", appHeight);\n window.addEventListener(\"orientationchange\", function () {\n appHeight();\n });\n });\n</script>\n\n<main>\n <tabs>\n {#each tabs as tab}\n <tab\n class:selected={current_tab == tab}\n on:click={() => {\n change_tab(tab);\n }}\n on:keypress={() => {\n change_tab(tab);\n }}\n >\n {tab}\n </tab>\n {/each}\n </tabs>\n\n <tabs-content class:uart-terminal={current_tab == tabs[3]}>\n {#if current_tab == tabs[0]}\n <tab-content>\n <TabWiFi />\n </tab-content>\n {:else if current_tab == tabs[1]}\n <tab-content>\n <TabSys />\n </tab-content>\n {:else if current_tab == tabs[2]}\n <tab-content>\n <TabPs />\n </tab-content>\n {:else if current_tab == tabs[3]}\n <tab-content class=\"uart-terminal\">\n <UartTerminal\n bind:this={uart_terminal}\n on_mount={uart_on_mount}\n send={uart_send}\n />\n </tab-content>\n {/if}\n </tabs-content>\n\n <Indicator bind:this={uart_indicatior} />\n <WebSocket bind:this={web_socket} receive={receive_uart} />\n <Reload />\n</main>\n\n<style>\n main {\n border: 4px dashed #000;\n margin: 10px auto;\n padding: 10px;\n max-width: 800px;\n overflow: hidden;\n }\n\n * {\n -moz-user-select: none;\n -o-user-select: none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n :global(.selectable) {\n -moz-user-select: text;\n -o-user-select: text;\n -khtml-user-select: text;\n -webkit-user-select: text;\n -ms-user-select: text;\n user-select: text;\n }\n\n :global(error) {\n padding: 5px 10px;\n background-color: rgb(255, 0, 0);\n color: black;\n }\n\n @font-face {\n font-family: \"DOS\";\n src: url(\"../assets/ega8.otf\") format(\"opentype\");\n font-weight: normal;\n font-style: normal;\n -webkit-font-kerning: none;\n font-kerning: none;\n font-synthesis: none;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-variant-numeric: tabular-nums;\n }\n\n :global(body) {\n padding: 0;\n margin: 0;\n background-color: #ffa21c;\n color: #000;\n font-size: 28px;\n font-family: \"DOS\", monospace;\n line-height: 1;\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n\n tabs-content.uart-terminal {\n height: calc(var(--app-height) - 105px);\n }\n\n @media (max-width: 520px) {\n :global(.mobile-hidden) {\n display: none !important;\n }\n main {\n margin: 0;\n }\n\n tabs-content.uart-terminal {\n height: calc(var(--app-height) - 85px);\n }\n }\n\n tabs {\n border-bottom: 4px dashed #000;\n width: 100%;\n display: block;\n }\n\n tab {\n margin-right: 10px;\n padding: 5px 10px;\n margin-bottom: 5px;\n display: inline-block;\n }\n\n tab:last-child {\n margin-right: 0;\n }\n\n tab:hover,\n tab.selected:hover {\n background: rgb(255, 255, 255);\n color: #000000;\n }\n\n tab.selected {\n background-color: black;\n color: white;\n }\n\n tabs-content {\n display: block;\n margin-top: 10px;\n }\n\n tab-content {\n display: block;\n }\n\n tab-content.uart-terminal {\n height: 100%;\n }\n</style>\n","import App from './App.svelte';\n\nconst app = new App({\n\ttarget: document.body,\n});\n\nexport default app;"],"names":["noop","run","fn","blank_object","Object","create","run_all","fns","forEach","is_function","thing","safe_not_equal","a","b","create_slot","definition","ctx","$$scope","slot_ctx","get_slot_context","tar","src","k","assign","slice","get_slot_changes","dirty","lets","undefined","merged","len","Math","max","length","i","update_slot_base","slot","slot_definition","slot_changes","get_slot_context_fn","slot_context","p","get_all_dirty_from_scope","append","target","node","appendChild","insert","anchor","insertBefore","detach","parentNode","removeChild","destroy_each","iterations","detaching","d","element","name","document","createElement","text","data","createTextNode","space","empty","listen","event","handler","options","addEventListener","removeEventListener","attr","attribute","value","removeAttribute","getAttribute","setAttribute","set_custom_element_data","prop","set_data","set_style","key","important","style","removeProperty","setProperty","select_option","select","mounting","option","__value","selected","selectedIndex","toggle_class","toggle","classList","HtmlTag","constructor","is_svg","this","e","n","c","html","h","m","nodeName","createElementNS","nodeType","t","tagName","content","innerHTML","Array","from","childNodes","current_component","set_current_component","component","get_current_component","Error","onMount","$$","on_mount","push","bubble","callbacks","type","call","dirty_components","binding_callbacks","render_callbacks","flush_callbacks","resolved_promise","Promise","resolve","update_scheduled","add_render_callback","seen_callbacks","Set","flushidx","flush","saved_component","update","pop","callback","has","add","clear","fragment","before_update","after_update","outroing","outros","group_outros","r","check_outros","transition_in","block","local","delete","transition_out","o","handle_promise","promise","info","token","index","resolved","child_ctx","current","needs_flush","blocks","mount","then","error","catch","hasCatch","pending","update_await_block_branch","create_component","mount_component","customElement","new_on_destroy","map","filter","on_destroy","destroy_component","filtered","targets","indexOf","flush_render_callbacks","make_dirty","fill","init","instance","create_fragment","not_equal","props","append_styles","parent_component","bound","on_disconnect","context","Map","skip_bound","root","ready","ret","rest","hydrate","nodes","children","l","intro","SvelteComponent","$destroy","$on","splice","$set","$$props","obj","$$set","keys","api","server","dev_mode","post","res","fetch","method","body","JSON","stringify","json","get","on_open","receive","send","websocket","gateway","url","window","location","host","replaceAll","cleanup_server","on_close","setTimeout","on_message","fileReader","FileReader","onload","array","Uint8Array","result","Blob","readAsArrayBuffer","WebSocket","onopen","onclose","onmessage","close","escSeq","N","O","D","M","E","H","modeClasses","modeStyles","isDigit","str","match","processEscape","escapeTxt","state","startsWith","endsWith","modes","substring","split","classes","styles","spanCount","output","processModes","entry","class","stye","parseTerminal","character","charAt","join","replace","left","right","timer","reset_brace","set_brace","timer_click","setInterval","clearInterval","closed","items","text_pointer","timer_tick","splitter","selectable","input","size","new_value","encodingUtf8","encodingAscii","defaultEncoding","replacementChar","createUtf8Char","charCode","arr","limits","console","j","aByte","utf8ReadChar","charStruct","buf","readPos","maxBytes","firstByte","getUint8","bytesRead","charVal","numBytes","rshift","writeStringUtf8","charCodeAt","writeStringAscii","chr","readStringUtf8","byteOffset","bytesToRead","terminator","nullTerm","byteLength","String","fromCharCode","readStringAscii","readString","writeString","checkEncoding","encoding","addStringCodec","reader","writer","put","stringByteLength","getString","dataView","getStringData","getStringNT","getStringDataNT","setString","setUint8","setStringNT","bytesWritten","selected_option","querySelector","last","message","bit_rate","stop_bits","toString","parity","data_bits","eol","lines","popup","show","action_result","destroy","bytes","process_bytes","data_view","DataView","buffer","eol_code","last_eol","lastIndexOf","StringView","line","subarray","last_string","self","config","tx","scroll","top","scrollHeight","behavior","parseInt","get_value","chunks","chunk","set","wifi_mode","sta_ssid","sta_pass","ap_ssid","ap_pass","hostname","usb_mode","net_list","ssid","channel","rssi","auth","mode_select","usb_mode_select","ap_ssid_input","ap_pass_input","sta_ssid_input","sta_pass_input","hostname_input","popup_select_net","set_value","net","ip_addr","byteArray","byte","print_ip","ip","mac_array","padStart","print_mac","mac","idf_version","firmware_branch","firmware_commit","firmware_version","firmware_branch_num","firmware_build_date","model","revision","cores","heap","minimum_free_bytes","total_free_bytes","total_allocated_bytes","largest_free_block","psram_heap","list","sort","handle","toUpperCase","stack_base","watermark","number","reload","active","clearTimeout","current_tab","change_tab","tab","localStorage","setItem","getItem","uart_indicatior","uart_terminal","web_socket","uart_history_array","appHeight","documentElement","innerHeight","activate","uart_history_array_put","uart_data"],"mappings":"gCAAA,SAASA,KAkBT,SAASC,EAAIC,GACT,OAAOA,GACX,CACA,SAASC,IACL,OAAOC,OAAOC,OAAO,KACzB,CACA,SAASC,E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