var app = (function () { 'use strict'; function unwrapExports (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var internal = createCommonjsModule(function (module, exports) { Object.defineProperty(exports, '__esModule', { value: true }); function noop() {} const identity = x => x; function assign(tar, src) { for (const k in src) tar[k] = src[k]; return tar; } function is_promise(value) { return value && typeof value.then === 'function'; } function add_location(element, file, line, column, char) { element.__svelte_meta = { loc: { file, line, column, char } }; } function run(fn) { return fn(); } function blank_object() { return Object.create(null); } function run_all(fns) { fns.forEach(run); } function is_function(thing) { return typeof thing === 'function'; } function safe_not_equal(a, b) { return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); } function not_equal(a, b) { return a != a ? b == b : a !== b; } function validate_store(store, name) { if (!store || typeof store.subscribe !== 'function') { throw new Error(`'${name}' is not a store with a 'subscribe' method`); } } function subscribe(component, store, callback) { const unsub = store.subscribe(callback); component.$$.on_destroy.push(unsub.unsubscribe ? () => unsub.unsubscribe() : unsub); } function create_slot(definition, ctx, fn) { if (definition) { const slot_ctx = get_slot_context(definition, ctx, fn); return definition[0](slot_ctx); } } function get_slot_context(definition, ctx, fn) { return definition[1] ? assign({}, assign(ctx.$$scope.ctx, definition[1](fn ? fn(ctx) : {}))) : ctx.$$scope.ctx; } function get_slot_changes(definition, ctx, changed, fn) { return definition[1] ? assign({}, assign(ctx.$$scope.changed || {}, definition[1](fn ? fn(changed) : {}))) : ctx.$$scope.changed || {}; } function exclude_internal_props(props) { const result = {}; for (const k in props) if (k[0] !== '$') result[k] = props[k]; return result; } const tasks = new Set(); let running = false; function run_tasks() { tasks.forEach(task => { if (!task[0](window.performance.now())) { tasks.delete(task); task[1](); } }); running = tasks.size > 0; if (running) requestAnimationFrame(run_tasks); } function clear_loops() { // for testing... tasks.forEach(task => tasks.delete(task)); running = false; } function loop(fn) { let task; if (!running) { running = true; requestAnimationFrame(run_tasks); } return { promise: new Promise(fulfil => { tasks.add(task = [fn, fulfil]); }), abort() { tasks.delete(task); } }; } function append(target, node) { target.appendChild(node); } function insert(target, node, anchor) { target.insertBefore(node, anchor); } function detach(node) { node.parentNode.removeChild(node); } function detach_between(before, after) { while (before.nextSibling && before.nextSibling !== after) { before.parentNode.removeChild(before.nextSibling); } } function detach_before(after) { while (after.previousSibling) { after.parentNode.removeChild(after.previousSibling); } } function detach_after(before) { while (before.nextSibling) { before.parentNode.removeChild(before.nextSibling); } } function destroy_each(iterations, detaching) { for (let i = 0; i < iterations.length; i += 1) { if (iterations[i]) iterations[i].d(detaching); } } function element(name) { return document.createElement(name); } function svg_element(name) { return document.createElementNS('http://www.w3.org/2000/svg', name); } function text(data) { return document.createTextNode(data); } function space() { return text(' '); } function empty() { return text(''); } function listen(node, event, handler, options) { node.addEventListener(event, handler, options); return () => node.removeEventListener(event, handler, options); } function prevent_default(fn) { return function(event) { event.preventDefault(); return fn.call(this, event); }; } function stop_propagation(fn) { return function(event) { event.stopPropagation(); return fn.call(this, event); }; } function attr(node, attribute, value) { if (value == null) node.removeAttribute(attribute); else node.setAttribute(attribute, value); } function set_attributes(node, attributes) { for (const key in attributes) { if (key === 'style') { node.style.cssText = attributes[key]; } else if (key in node) { node[key] = attributes[key]; } else { attr(node, key, attributes[key]); } } } function set_custom_element_data(node, prop, value) { if (prop in node) { node[prop] = value; } else { attr(node, prop, value); } } function xlink_attr(node, attribute, value) { node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value); } function get_binding_group_value(group) { const value = []; for (let i = 0; i < group.length; i += 1) { if (group[i].checked) value.push(group[i].__value); } return value; } function to_number(value) { return value === '' ? undefined : +value; } function time_ranges_to_array(ranges) { const array = []; for (let i = 0; i < ranges.length; i += 1) { array.push({ start: ranges.start(i), end: ranges.end(i) }); } return array; } function children(element) { return Array.from(element.childNodes); } function claim_element(nodes, name, attributes, svg) { for (let i = 0; i < nodes.length; i += 1) { const node = nodes[i]; if (node.nodeName === name) { for (let j = 0; j < node.attributes.length; j += 1) { const attribute = node.attributes[j]; if (!attributes[attribute.name]) node.removeAttribute(attribute.name); } return nodes.splice(i, 1)[0]; // TODO strip unwanted attributes } } return svg ? svg_element(name) : element(name); } function claim_text(nodes, data) { for (let i = 0; i < nodes.length; i += 1) { const node = nodes[i]; if (node.nodeType === 3) { node.data = data; return nodes.splice(i, 1)[0]; } } return text(data); } function set_data(text, data) { data = '' + data; if (text.data !== data) text.data = data; } function set_input_type(input, type) { try { input.type = type; } catch (e) { // do nothing } } function set_style(node, key, value) { node.style.setProperty(key, value); } function select_option(select, value) { for (let i = 0; i < select.options.length; i += 1) { const option = select.options[i]; if (option.__value === value) { option.selected = true; return; } } } function select_options(select, value) { for (let i = 0; i < select.options.length; i += 1) { const option = select.options[i]; option.selected = ~value.indexOf(option.__value); } } function select_value(select) { const selected_option = select.querySelector(':checked') || select.options[0]; return selected_option && selected_option.__value; } function select_multiple_value(select) { return [].map.call(select.querySelectorAll(':checked'), option => option.__value); } function add_resize_listener(element, fn) { if (getComputedStyle(element).position === 'static') { element.style.position = 'relative'; } const object = document.createElement('object'); object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;'); object.type = 'text/html'; let win; object.onload = () => { win = object.contentDocument.defaultView; win.addEventListener('resize', fn); }; if (/Trident/.test(navigator.userAgent)) { element.appendChild(object); object.data = 'about:blank'; } else { object.data = 'about:blank'; element.appendChild(object); } return { cancel: () => { win && win.removeEventListener && win.removeEventListener('resize', fn); element.removeChild(object); } }; } function toggle_class(element, name, toggle) { element.classList[toggle ? 'add' : 'remove'](name); } function custom_event(type, detail) { const e = document.createEvent('CustomEvent'); e.initCustomEvent(type, false, false, detail); return e; } let stylesheet; let active = 0; let current_rules = {}; // https://github.com/darkskyapp/string-hash/blob/master/index.js function hash(str) { let hash = 5381; let i = str.length; while (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i); return hash >>> 0; } function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) { const step = 16.666 / duration; let keyframes = '{\n'; for (let p = 0; p <= 1; p += step) { const t = a + (b - a) * ease(p); keyframes += p * 100 + `%{${fn(t, 1 - t)}}\n`; } const rule = keyframes + `100% {${fn(b, 1 - b)}}\n}`; const name = `__svelte_${hash(rule)}_${uid}`; if (!current_rules[name]) { if (!stylesheet) { const style = element('style'); document.head.appendChild(style); stylesheet = style.sheet; } current_rules[name] = true; stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length); } const animation = node.style.animation || ''; node.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`; active += 1; return name; } function delete_rule(node, name) { node.style.animation = (node.style.animation || '') .split(', ') .filter(name ? anim => anim.indexOf(name) < 0 // remove specific animation : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations ) .join(', '); if (name && !--active) clear_rules(); } function clear_rules() { requestAnimationFrame(() => { if (active) return; let i = stylesheet.cssRules.length; while (i--) stylesheet.deleteRule(i); current_rules = {}; }); } function create_animation(node, from, fn, params) { if (!from) return noop; const to = node.getBoundingClientRect(); if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom) return noop; const { delay = 0, duration = 300, easing = identity, start: start_time = window.performance.now() + delay, end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params); let running = true; let started = false; let name; const css_text = node.style.cssText; function start() { if (css) { if (delay) node.style.cssText = css_text; // TODO create delayed animation instead? name = create_rule(node, 0, 1, duration, 0, easing, css); } started = true; } function stop() { if (css) delete_rule(node, name); running = false; } loop(now => { if (!started && now >= start_time) { start(); } if (started && now >= end) { tick(1, 0); stop(); } if (!running) { return false; } if (started) { const p = now - start_time; const t = 0 + 1 * easing(p / duration); tick(t, 1 - t); } return true; }); if (delay) { if (css) node.style.cssText += css(0, 1); } else { start(); } tick(0, 1); return stop; } function fix_position(node) { const style = getComputedStyle(node); if (style.position !== 'absolute' && style.position !== 'fixed') { const { width, height } = style; const a = node.getBoundingClientRect(); node.style.position = 'absolute'; node.style.width = width; node.style.height = height; const b = node.getBoundingClientRect(); if (a.left !== b.left || a.top !== b.top) { const style = getComputedStyle(node); const transform = style.transform === 'none' ? '' : style.transform; node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`; } } } function set_current_component(component) { exports.current_component = component; } function get_current_component() { if (!exports.current_component) throw new Error(`Function called outside component initialization`); return exports.current_component; } function beforeUpdate(fn) { get_current_component().$$.before_render.push(fn); } function onMount(fn) { get_current_component().$$.on_mount.push(fn); } function afterUpdate(fn) { get_current_component().$$.after_render.push(fn); } function onDestroy(fn) { get_current_component().$$.on_destroy.push(fn); } function createEventDispatcher() { const component = exports.current_component; return (type, detail) => { const callbacks = component.$$.callbacks[type]; if (callbacks) { // TODO are there situations where events could be dispatched // in a server (non-DOM) environment? const event = custom_event(type, detail); callbacks.slice().forEach(fn => { fn.call(component, event); }); } }; } function setContext(key, context) { get_current_component().$$.context.set(key, context); } function getContext(key) { return get_current_component().$$.context.get(key); } // TODO figure out if we still want to support // shorthand events, or if we want to implement // a real bubbling mechanism function bubble(component, event) { const callbacks = component.$$.callbacks[event.type]; if (callbacks) { callbacks.slice().forEach(fn => fn(event)); } } const dirty_components = []; const intros = { enabled: false }; const resolved_promise = Promise.resolve(); let update_scheduled = false; const binding_callbacks = []; const render_callbacks = []; const flush_callbacks = []; function schedule_update() { if (!update_scheduled) { update_scheduled = true; resolved_promise.then(flush); } } function tick() { schedule_update(); return resolved_promise; } function add_binding_callback(fn) { binding_callbacks.push(fn); } function add_render_callback(fn) { render_callbacks.push(fn); } function add_flush_callback(fn) { flush_callbacks.push(fn); } function flush() { const seen_callbacks = new Set(); do { // first, call beforeUpdate functions // and update components while (dirty_components.length) { const component = dirty_components.shift(); set_current_component(component); update(component.$$); } while (binding_callbacks.length) binding_callbacks.shift()(); // then, once components are updated, call // afterUpdate functions. This may cause // subsequent updates... while (render_callbacks.length) { const callback = render_callbacks.pop(); if (!seen_callbacks.has(callback)) { callback(); // ...so guard against infinite loops seen_callbacks.add(callback); } } } while (dirty_components.length); while (flush_callbacks.length) { flush_callbacks.pop()(); } update_scheduled = false; } function update($$) { if ($$.fragment) { $$.update($$.dirty); run_all($$.before_render); $$.fragment.p($$.dirty, $$.ctx); $$.dirty = null; $$.after_render.forEach(add_render_callback); } } let promise; function wait() { if (!promise) { promise = Promise.resolve(); promise.then(() => { promise = null; }); } return promise; } function dispatch(node, direction, kind) { node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`)); } let outros; function group_outros() { outros = { remaining: 0, callbacks: [] }; } function check_outros() { if (!outros.remaining) { run_all(outros.callbacks); } } function on_outro(callback) { outros.callbacks.push(callback); } function create_in_transition(node, fn, params) { let config = fn(node, params); let running = false; let animation_name; let task; let uid = 0; function cleanup() { if (animation_name) delete_rule(node, animation_name); } function go() { const { delay = 0, duration = 300, easing = identity, tick: tick$$1 = noop, css } = config; if (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++); tick$$1(0, 1); const start_time = window.performance.now() + delay; const end_time = start_time + duration; if (task) task.abort(); running = true; task = loop(now => { if (running) { if (now >= end_time) { tick$$1(1, 0); cleanup(); return running = false; } if (now >= start_time) { const t = easing((now - start_time) / duration); tick$$1(t, 1 - t); } } return running; }); } let started = false; return { start() { if (started) return; delete_rule(node); if (typeof config === 'function') { config = config(); wait().then(go); } else { go(); } }, invalidate() { started = false; }, end() { if (running) { cleanup(); running = false; } } }; } function create_out_transition(node, fn, params) { let config = fn(node, params); let running = true; let animation_name; const group = outros; group.remaining += 1; function go() { const { delay = 0, duration = 300, easing = identity, tick: tick$$1 = noop, css } = config; if (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css); const start_time = window.performance.now() + delay; const end_time = start_time + duration; loop(now => { if (running) { if (now >= end_time) { tick$$1(0, 1); if (!--group.remaining) { // this will result in `end()` being called, // so we don't need to clean up here run_all(group.callbacks); } return false; } if (now >= start_time) { const t = easing((now - start_time) / duration); tick$$1(1 - t, t); } } return running; }); } if (typeof config === 'function') { wait().then(() => { config = config(); go(); }); } else { go(); } return { end(reset) { if (reset && config.tick) { config.tick(1, 0); } if (running) { if (animation_name) delete_rule(node, animation_name); running = false; } } }; } function create_bidirectional_transition(node, fn, params, intro) { let config = fn(node, params); let t = intro ? 0 : 1; let running_program = null; let pending_program = null; let animation_name = null; function clear_animation() { if (animation_name) delete_rule(node, animation_name); } function init(program, duration) { const d = program.b - t; duration *= Math.abs(d); return { a: t, b: program.b, d, duration, start: program.start, end: program.start + duration, group: program.group }; } function go(b) { const { delay = 0, duration = 300, easing = identity, tick: tick$$1 = noop, css } = config; const program = { start: window.performance.now() + delay, b }; if (!b) { program.group = outros; outros.remaining += 1; } if (running_program) { pending_program = program; } else { // if this is an intro, and there's a delay, we need to do // an initial tick and/or apply CSS animation immediately if (css) { clear_animation(); animation_name = create_rule(node, t, b, duration, delay, easing, css); } if (b) tick$$1(0, 1); running_program = init(program, duration); add_render_callback(() => dispatch(node, b, 'start')); loop(now => { if (pending_program && now > pending_program.start) { running_program = init(pending_program, duration); pending_program = null; dispatch(node, running_program.b, 'start'); if (css) { clear_animation(); animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css); } } if (running_program) { if (now >= running_program.end) { tick$$1(t = running_program.b, 1 - t); dispatch(node, running_program.b, 'end'); if (!pending_program) { // we're done if (running_program.b) { // intro — we can tidy up immediately clear_animation(); } else { // outro — needs to be coordinated if (!--running_program.group.remaining) run_all(running_program.group.callbacks); } } running_program = null; } else if (now >= running_program.start) { const p = now - running_program.start; t = running_program.a + running_program.d * easing(p / running_program.duration); tick$$1(t, 1 - t); } } return !!(running_program || pending_program); }); } } return { run(b) { if (typeof config === 'function') { wait().then(() => { config = config(); go(b); }); } else { go(b); } }, end() { clear_animation(); running_program = pending_program = null; } }; } function handle_promise(promise, info) { const token = info.token = {}; function update(type, index, key, value) { if (info.token !== token) return; info.resolved = key && { [key]: value }; const child_ctx = assign(assign({}, info.ctx), info.resolved); const block = type && (info.current = type)(child_ctx); if (info.block) { if (info.blocks) { info.blocks.forEach((block, i) => { if (i !== index && block) { group_outros(); on_outro(() => { block.d(1); info.blocks[i] = null; }); block.o(1); check_outros(); } }); } else { info.block.d(1); } block.c(); if (block.i) block.i(1); block.m(info.mount(), info.anchor); flush(); } info.block = block; if (info.blocks) info.blocks[index] = block; } if (is_promise(promise)) { promise.then(value => { update(info.then, 1, info.value, value); }, error => { update(info.catch, 2, info.error, error); }); // if we previously had a then/catch block, destroy it if (info.current !== info.pending) { update(info.pending, 0); return true; } } else { if (info.current !== info.then) { update(info.then, 1, info.value, promise); return true; } info.resolved = { [info.value]: promise }; } } function destroy_block(block, lookup) { block.d(1); lookup.delete(block.key); } function outro_and_destroy_block(block, lookup) { on_outro(() => { destroy_block(block, lookup); }); block.o(1); } function fix_and_outro_and_destroy_block(block, lookup) { block.f(); outro_and_destroy_block(block, lookup); } function update_keyed_each(old_blocks, changed, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) { let o = old_blocks.length; let n = list.length; let i = o; const old_indexes = {}; while (i--) old_indexes[old_blocks[i].key] = i; const new_blocks = []; const new_lookup = new Map(); const deltas = new Map(); i = n; while (i--) { const child_ctx = get_context(ctx, list, i); const key = get_key(child_ctx); let block = lookup.get(key); if (!block) { block = create_each_block(key, child_ctx); block.c(); } else if (dynamic) { block.p(changed, child_ctx); } new_lookup.set(key, new_blocks[i] = block); if (key in old_indexes) deltas.set(key, Math.abs(i - old_indexes[key])); } const will_move = new Set(); const did_move = new Set(); function insert(block) { if (block.i) block.i(1); block.m(node, next); lookup.set(block.key, block); next = block.first; n--; } while (o && n) { const new_block = new_blocks[n - 1]; const old_block = old_blocks[o - 1]; const new_key = new_block.key; const old_key = old_block.key; if (new_block === old_block) { // do nothing next = new_block.first; o--; n--; } else if (!new_lookup.has(old_key)) { // remove old block destroy(old_block, lookup); o--; } else if (!lookup.has(new_key) || will_move.has(new_key)) { insert(new_block); } else if (did_move.has(old_key)) { o--; } else if (deltas.get(new_key) > deltas.get(old_key)) { did_move.add(new_key); insert(new_block); } else { will_move.add(old_key); o--; } } while (o--) { const old_block = old_blocks[o]; if (!new_lookup.has(old_block.key)) destroy(old_block, lookup); } while (n) insert(new_blocks[n - 1]); return new_blocks; } function measure(blocks) { const rects = {}; let i = blocks.length; while (i--) rects[blocks[i].key] = blocks[i].node.getBoundingClientRect(); return rects; } function get_spread_update(levels, updates) { const update = {}; const to_null_out = {}; const accounted_for = {}; let i = levels.length; while (i--) { const o = levels[i]; const n = updates[i]; if (n) { for (const key in o) { if (!(key in n)) to_null_out[key] = 1; } for (const key in n) { if (!accounted_for[key]) { update[key] = n[key]; accounted_for[key] = 1; } } levels[i] = n; } else { for (const key in o) { accounted_for[key] = 1; } } } for (const key in to_null_out) { if (!(key in update)) update[key] = undefined; } return update; } const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u; // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 // https://infra.spec.whatwg.org/#noncharacter function spread(args) { const attributes = Object.assign({}, ...args); let str = ''; Object.keys(attributes).forEach(name => { if (invalid_attribute_name_character.test(name)) return; const value = attributes[name]; if (value === undefined) return; if (value === true) str += " " + name; const escaped = String(value) .replace(/"/g, '"') .replace(/'/g, '''); str += " " + name + "=" + JSON.stringify(escaped); }); return str; } const escaped = { '"': '"', "'": ''', '&': '&', '<': '<', '>': '>' }; function escape(html) { return String(html).replace(/["'&<>]/g, match => escaped[match]); } function each(items, fn) { let str = ''; for (let i = 0; i < items.length; i += 1) { str += fn(items[i], i); } return str; } const missing_component = { $$render: () => '' }; function validate_component(component, name) { if (!component || !component.$$render) { if (name === 'svelte:component') name += ' this={...}'; 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`); } return component; } function debug(file, line, column, values) { console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console console.log(values); // eslint-disable-line no-console return ''; } let on_destroy; function create_ssr_component(fn) { function $$render(result, props, bindings, slots) { const parent_component = exports.current_component; const $$ = { on_destroy, context: new Map(parent_component ? parent_component.$$.context : []), // these will be immediately discarded on_mount: [], before_render: [], after_render: [], callbacks: blank_object() }; set_current_component({ $$ }); const html = fn(result, props, bindings, slots); set_current_component(parent_component); return html; } return { render: (props = {}, options = {}) => { on_destroy = []; const result = { head: '', css: new Set() }; const html = $$render(result, props, {}, options); run_all(on_destroy); return { html, css: { code: Array.from(result.css).map(css => css.code).join('\n'), map: null // TODO }, head: result.head }; }, $$render }; } function get_store_value(store) { let value; store.subscribe(_ => value = _)(); return value; } function bind(component, name, callback) { if (component.$$.props.indexOf(name) === -1) return; component.$$.bound[name] = callback; callback(component.$$.ctx[name]); } function mount_component(component, target, anchor) { const { fragment, on_mount, on_destroy, after_render } = component.$$; fragment.m(target, anchor); // onMount happens after the initial afterUpdate. Because // afterUpdate callbacks happen in reverse order (inner first) // we schedule onMount callbacks before afterUpdate callbacks add_render_callback(() => { const new_on_destroy = on_mount.map(run).filter(is_function); if (on_destroy) { on_destroy.push(...new_on_destroy); } else { // Edge case - component was destroyed immediately, // most likely as a result of a binding initialising run_all(new_on_destroy); } component.$$.on_mount = []; }); after_render.forEach(add_render_callback); } function destroy(component, detaching) { if (component.$$) { run_all(component.$$.on_destroy); component.$$.fragment.d(detaching); // TODO null out other refs, including component.$$ (but need to // preserve final state?) component.$$.on_destroy = component.$$.fragment = null; component.$$.ctx = {}; } } function make_dirty(component, key) { if (!component.$$.dirty) { dirty_components.push(component); schedule_update(); component.$$.dirty = {}; } component.$$.dirty[key] = true; } function init(component, options, instance, create_fragment, not_equal$$1, prop_names) { const parent_component = exports.current_component; set_current_component(component); const props = options.props || {}; const $$ = component.$$ = { fragment: null, ctx: null, // state props: prop_names, update: noop, not_equal: not_equal$$1, bound: blank_object(), // lifecycle on_mount: [], on_destroy: [], before_render: [], after_render: [], context: new Map(parent_component ? parent_component.$$.context : []), // everything else callbacks: blank_object(), dirty: null }; let ready = false; $$.ctx = instance ? instance(component, props, (key, value) => { if ($$.ctx && not_equal$$1($$.ctx[key], $$.ctx[key] = value)) { if ($$.bound[key]) $$.bound[key](value); if (ready) make_dirty(component, key); } }) : props; $$.update(); ready = true; run_all($$.before_render); $$.fragment = create_fragment($$.ctx); if (options.target) { if (options.hydrate) { $$.fragment.l(children(options.target)); } else { $$.fragment.c(); } if (options.intro && component.$$.fragment.i) component.$$.fragment.i(); mount_component(component, options.target, options.anchor); flush(); } set_current_component(parent_component); } if (typeof HTMLElement !== 'undefined') { exports.SvelteElement = class extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { for (const key in this.$$.slotted) { this.appendChild(this.$$.slotted[key]); } } attributeChangedCallback(attr$$1, oldValue, newValue) { this[attr$$1] = newValue; } $destroy() { destroy(this, true); this.$destroy = noop; } $on(type, callback) { // TODO should this delegate to addEventListener? const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); callbacks.push(callback); return () => { const index = callbacks.indexOf(callback); if (index !== -1) callbacks.splice(index, 1); }; } $set() { // overridden by instance, if it has props } }; } class SvelteComponent { $destroy() { destroy(this, true); this.$destroy = noop; } $on(type, callback) { const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); callbacks.push(callback); return () => { const index = callbacks.indexOf(callback); if (index !== -1) callbacks.splice(index, 1); }; } $set() { // overridden by instance, if it has props } } class SvelteComponentDev extends SvelteComponent { constructor(options) { if (!options || (!options.target && !options.$$inline)) { throw new Error(`'target' is a required option`); } super(); } $destroy() { super.$destroy(); this.$destroy = () => { console.warn(`Component was already destroyed`); // eslint-disable-line no-console }; } } exports.create_animation = create_animation; exports.fix_position = fix_position; exports.handle_promise = handle_promise; exports.append = append; exports.insert = insert; exports.detach = detach; exports.detach_between = detach_between; exports.detach_before = detach_before; exports.detach_after = detach_after; exports.destroy_each = destroy_each; exports.element = element; exports.svg_element = svg_element; exports.text = text; exports.space = space; exports.empty = empty; exports.listen = listen; exports.prevent_default = prevent_default; exports.stop_propagation = stop_propagation; exports.attr = attr; exports.set_attributes = set_attributes; exports.set_custom_element_data = set_custom_element_data; exports.xlink_attr = xlink_attr; exports.get_binding_group_value = get_binding_group_value; exports.to_number = to_number; exports.time_ranges_to_array = time_ranges_to_array; exports.children = children; exports.claim_element = claim_element; exports.claim_text = claim_text; exports.set_data = set_data; exports.set_input_type = set_input_type; exports.set_style = set_style; exports.select_option = select_option; exports.select_options = select_options; exports.select_value = select_value; exports.select_multiple_value = select_multiple_value; exports.add_resize_listener = add_resize_listener; exports.toggle_class = toggle_class; exports.custom_event = custom_event; exports.destroy_block = destroy_block; exports.outro_and_destroy_block = outro_and_destroy_block; exports.fix_and_outro_and_destroy_block = fix_and_outro_and_destroy_block; exports.update_keyed_each = update_keyed_each; exports.measure = measure; exports.set_current_component = set_current_component; exports.beforeUpdate = beforeUpdate; exports.onMount = onMount; exports.afterUpdate = afterUpdate; exports.onDestroy = onDestroy; exports.createEventDispatcher = createEventDispatcher; exports.setContext = setContext; exports.getContext = getContext; exports.bubble = bubble; exports.clear_loops = clear_loops; exports.loop = loop; exports.dirty_components = dirty_components; exports.intros = intros; exports.schedule_update = schedule_update; exports.tick = tick; exports.add_binding_callback = add_binding_callback; exports.add_render_callback = add_render_callback; exports.add_flush_callback = add_flush_callback; exports.flush = flush; exports.get_spread_update = get_spread_update; exports.invalid_attribute_name_character = invalid_attribute_name_character; exports.spread = spread; exports.escaped = escaped; exports.escape = escape; exports.each = each; exports.missing_component = missing_component; exports.validate_component = validate_component; exports.debug = debug; exports.create_ssr_component = create_ssr_component; exports.get_store_value = get_store_value; exports.group_outros = group_outros; exports.check_outros = check_outros; exports.on_outro = on_outro; exports.create_in_transition = create_in_transition; exports.create_out_transition = create_out_transition; exports.create_bidirectional_transition = create_bidirectional_transition; exports.noop = noop; exports.identity = identity; exports.assign = assign; exports.is_promise = is_promise; exports.add_location = add_location; exports.run = run; exports.blank_object = blank_object; exports.run_all = run_all; exports.is_function = is_function; exports.safe_not_equal = safe_not_equal; exports.not_equal = not_equal; exports.validate_store = validate_store; exports.subscribe = subscribe; exports.create_slot = create_slot; exports.get_slot_context = get_slot_context; exports.get_slot_changes = get_slot_changes; exports.exclude_internal_props = exclude_internal_props; exports.bind = bind; exports.mount_component = mount_component; exports.init = init; exports.SvelteComponent = SvelteComponent; exports.SvelteComponentDev = SvelteComponentDev; }); unwrapExports(internal); var internal_1 = internal.current_component; var internal_2 = internal.SvelteElement; var internal_3 = internal.create_animation; var internal_4 = internal.fix_position; var internal_5 = internal.handle_promise; var internal_6 = internal.append; var internal_7 = internal.insert; var internal_8 = internal.detach; var internal_9 = internal.detach_between; var internal_10 = internal.detach_before; var internal_11 = internal.detach_after; var internal_12 = internal.destroy_each; var internal_13 = internal.element; var internal_14 = internal.svg_element; var internal_15 = internal.text; var internal_16 = internal.space; var internal_17 = internal.empty; var internal_18 = internal.listen; var internal_19 = internal.prevent_default; var internal_20 = internal.stop_propagation; var internal_21 = internal.attr; var internal_22 = internal.set_attributes; var internal_23 = internal.set_custom_element_data; var internal_24 = internal.xlink_attr; var internal_25 = internal.get_binding_group_value; var internal_26 = internal.to_number; var internal_27 = internal.time_ranges_to_array; var internal_28 = internal.children; var internal_29 = internal.claim_element; var internal_30 = internal.claim_text; var internal_31 = internal.set_data; var internal_32 = internal.set_input_type; var internal_33 = internal.set_style; var internal_34 = internal.select_option; var internal_35 = internal.select_options; var internal_36 = internal.select_value; var internal_37 = internal.select_multiple_value; var internal_38 = internal.add_resize_listener; var internal_39 = internal.toggle_class; var internal_40 = internal.custom_event; var internal_41 = internal.destroy_block; var internal_42 = internal.outro_and_destroy_block; var internal_43 = internal.fix_and_outro_and_destroy_block; var internal_44 = internal.update_keyed_each; var internal_45 = internal.measure; var internal_46 = internal.set_current_component; var internal_47 = internal.beforeUpdate; var internal_48 = internal.onMount; var internal_49 = internal.afterUpdate; var internal_50 = internal.onDestroy; var internal_51 = internal.createEventDispatcher; var internal_52 = internal.setContext; var internal_53 = internal.getContext; var internal_54 = internal.bubble; var internal_55 = internal.clear_loops; var internal_56 = internal.loop; var internal_57 = internal.dirty_components; var internal_58 = internal.intros; var internal_59 = internal.schedule_update; var internal_60 = internal.tick; var internal_61 = internal.add_binding_callback; var internal_62 = internal.add_render_callback; var internal_63 = internal.add_flush_callback; var internal_64 = internal.flush; var internal_65 = internal.get_spread_update; var internal_66 = internal.invalid_attribute_name_character; var internal_67 = internal.spread; var internal_68 = internal.escaped; var internal_69 = internal.escape; var internal_70 = internal.each; var internal_71 = internal.missing_component; var internal_72 = internal.validate_component; var internal_73 = internal.debug; var internal_74 = internal.create_ssr_component; var internal_75 = internal.get_store_value; var internal_76 = internal.group_outros; var internal_77 = internal.check_outros; var internal_78 = internal.on_outro; var internal_79 = internal.create_in_transition; var internal_80 = internal.create_out_transition; var internal_81 = internal.create_bidirectional_transition; var internal_82 = internal.noop; var internal_83 = internal.identity; var internal_84 = internal.assign; var internal_85 = internal.is_promise; var internal_86 = internal.add_location; var internal_87 = internal.run; var internal_88 = internal.blank_object; var internal_89 = internal.run_all; var internal_90 = internal.is_function; var internal_91 = internal.safe_not_equal; var internal_92 = internal.not_equal; var internal_93 = internal.validate_store; var internal_94 = internal.subscribe; var internal_95 = internal.create_slot; var internal_96 = internal.get_slot_context; var internal_97 = internal.get_slot_changes; var internal_98 = internal.exclude_internal_props; var internal_99 = internal.bind; var internal_100 = internal.mount_component; var internal_101 = internal.init; var internal_102 = internal.SvelteComponent; var internal_103 = internal.SvelteComponentDev; /* src/User/Pages/Box.svelte generated by Svelte v3.1.0 */ const file = "src/User/Pages/Box.svelte"; function create_fragment(ctx) { var div, current; const default_slot_1 = ctx.$$slots.default; const default_slot = internal_95(default_slot_1, ctx, null); return { c: function create() { div = internal_13("div"); if (default_slot) default_slot.c(); div.className = "box svelte-yv48ir"; internal_86(div, file, 33, 0, 624); }, l: function claim(nodes) { if (default_slot) default_slot.l(div_nodes); throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); }, m: function mount(target, anchor) { internal_7(target, div, anchor); if (default_slot) { default_slot.m(div, null); } current = true; }, p: function update(changed, ctx) { if (default_slot && default_slot.p && changed.$$scope) { default_slot.p(internal_97(default_slot_1, ctx, changed,), internal_96(default_slot_1, ctx, null)); } }, i: function intro(local) { if (current) return; if (default_slot && default_slot.i) default_slot.i(local); current = true; }, o: function outro(local) { if (default_slot && default_slot.o) default_slot.o(local); current = false; }, d: function destroy(detaching) { if (detaching) { internal_8(div); } if (default_slot) default_slot.d(detaching); } }; } function instance($$self, $$props, $$invalidate) { let { $$slots = {}, $$scope } = $$props; $$self.$set = $$props => { if ('$$scope' in $$props) $$invalidate('$$scope', $$scope = $$props.$$scope); }; return { $$slots, $$scope }; } class Box extends internal_103 { constructor(options) { super(options); internal_101(this, options, instance, create_fragment, internal_91, []); } } var easing = createCommonjsModule(function (module, exports) { Object.defineProperty(exports, '__esModule', { value: true }); /* Adapted from https://github.com/mattdesl Distributed under MIT License https://github.com/mattdesl/eases/blob/master/LICENSE.md */ function backInOut(t) { var s = 1.70158 * 1.525; if ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s)); return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2); } function backIn(t) { var s = 1.70158; return t * t * ((s + 1) * t - s); } function backOut(t) { var s = 1.70158; return --t * t * ((s + 1) * t + s) + 1; } function bounceOut(t) { var a = 4.0 / 11.0; var b = 8.0 / 11.0; var c = 9.0 / 10.0; var ca = 4356.0 / 361.0; var cb = 35442.0 / 1805.0; var cc = 16061.0 / 1805.0; var t2 = t * t; return t < a ? 7.5625 * t2 : t < b ? 9.075 * t2 - 9.9 * t + 3.4 : t < c ? ca * t2 - cb * t + cc : 10.8 * t * t - 20.52 * t + 10.72; } function bounceInOut(t) { return t < 0.5 ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0)) : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5; } function bounceIn(t) { return 1.0 - bounceOut(1.0 - t); } function circInOut(t) { if ((t *= 2) < 1) return -0.5 * (Math.sqrt(1 - t * t) - 1); return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1); } function circIn(t) { return 1.0 - Math.sqrt(1.0 - t * t); } function circOut(t) { return Math.sqrt(1 - --t * t); } function cubicInOut(t) { return t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0; } function cubicIn(t) { return t * t * t; } function cubicOut(t) { var f = t - 1.0; return f * f * f + 1.0; } function elasticInOut(t) { return t < 0.5 ? 0.5 * Math.sin(((+13.0 * Math.PI) / 2) * 2.0 * t) * Math.pow(2.0, 10.0 * (2.0 * t - 1.0)) : 0.5 * Math.sin(((-13.0 * Math.PI) / 2) * (2.0 * t - 1.0 + 1.0)) * Math.pow(2.0, -10.0 * (2.0 * t - 1.0)) + 1.0; } function elasticIn(t) { return Math.sin((13.0 * t * Math.PI) / 2) * Math.pow(2.0, 10.0 * (t - 1.0)); } function elasticOut(t) { return ( Math.sin((-13.0 * (t + 1.0) * Math.PI) / 2) * Math.pow(2.0, -10.0 * t) + 1.0 ); } function expoInOut(t) { return t === 0.0 || t === 1.0 ? t : t < 0.5 ? +0.5 * Math.pow(2.0, 20.0 * t - 10.0) : -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0; } function expoIn(t) { return t === 0.0 ? t : Math.pow(2.0, 10.0 * (t - 1.0)); } function expoOut(t) { return t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t); } function quadInOut(t) { t /= 0.5; if (t < 1) return 0.5 * t * t; t--; return -0.5 * (t * (t - 2) - 1); } function quadIn(t) { return t * t; } function quadOut(t) { return -t * (t - 2.0); } function quartInOut(t) { return t < 0.5 ? +8.0 * Math.pow(t, 4.0) : -8.0 * Math.pow(t - 1.0, 4.0) + 1.0; } function quartIn(t) { return Math.pow(t, 4.0); } function quartOut(t) { return Math.pow(t - 1.0, 3.0) * (1.0 - t) + 1.0; } function quintInOut(t) { if ((t *= 2) < 1) return 0.5 * t * t * t * t * t; return 0.5 * ((t -= 2) * t * t * t * t + 2); } function quintIn(t) { return t * t * t * t * t; } function quintOut(t) { return --t * t * t * t * t + 1; } function sineInOut(t) { return -0.5 * (Math.cos(Math.PI * t) - 1); } function sineIn(t) { var v = Math.cos(t * Math.PI * 0.5); if (Math.abs(v) < 1e-14) return 1; else return 1 - v; } function sineOut(t) { return Math.sin((t * Math.PI) / 2); } exports.linear = internal.identity; exports.backInOut = backInOut; exports.backIn = backIn; exports.backOut = backOut; exports.bounceOut = bounceOut; exports.bounceInOut = bounceInOut; exports.bounceIn = bounceIn; exports.circInOut = circInOut; exports.circIn = circIn; exports.circOut = circOut; exports.cubicInOut = cubicInOut; exports.cubicIn = cubicIn; exports.cubicOut = cubicOut; exports.elasticInOut = elasticInOut; exports.elasticIn = elasticIn; exports.elasticOut = elasticOut; exports.expoInOut = expoInOut; exports.expoIn = expoIn; exports.expoOut = expoOut; exports.quadInOut = quadInOut; exports.quadIn = quadIn; exports.quadOut = quadOut; exports.quartInOut = quartInOut; exports.quartIn = quartIn; exports.quartOut = quartOut; exports.quintInOut = quintInOut; exports.quintIn = quintIn; exports.quintOut = quintOut; exports.sineInOut = sineInOut; exports.sineIn = sineIn; exports.sineOut = sineOut; }); unwrapExports(easing); var easing_1 = easing.linear; var easing_2 = easing.backInOut; var easing_3 = easing.backIn; var easing_4 = easing.backOut; var easing_5 = easing.bounceOut; var easing_6 = easing.bounceInOut; var easing_7 = easing.bounceIn; var easing_8 = easing.circInOut; var easing_9 = easing.circIn; var easing_10 = easing.circOut; var easing_11 = easing.cubicInOut; var easing_12 = easing.cubicIn; var easing_13 = easing.cubicOut; var easing_14 = easing.elasticInOut; var easing_15 = easing.elasticIn; var easing_16 = easing.elasticOut; var easing_17 = easing.expoInOut; var easing_18 = easing.expoIn; var easing_19 = easing.expoOut; var easing_20 = easing.quadInOut; var easing_21 = easing.quadIn; var easing_22 = easing.quadOut; var easing_23 = easing.quartInOut; var easing_24 = easing.quartIn; var easing_25 = easing.quartOut; var easing_26 = easing.quintInOut; var easing_27 = easing.quintIn; var easing_28 = easing.quintOut; var easing_29 = easing.sineInOut; var easing_30 = easing.sineIn; var easing_31 = easing.sineOut; var transition = createCommonjsModule(function (module, exports) { Object.defineProperty(exports, '__esModule', { value: true }); function fade(node, { delay = 0, duration = 400 }) { const o = +getComputedStyle(node).opacity; return { delay, duration, css: t => `opacity: ${t * o}` }; } function fly(node, { delay = 0, duration = 400, easing: easing$$1 = easing.cubicOut, x = 0, y = 0, opacity = 0 }) { const style = getComputedStyle(node); const target_opacity = +style.opacity; const transform = style.transform === 'none' ? '' : style.transform; const od = target_opacity * (1 - opacity); return { delay, duration, easing: easing$$1, css: (t, u) => ` transform: ${transform} translate(${(1 - t) * x}px, ${(1 - t) * y}px); opacity: ${target_opacity - (od * u)}` }; } function slide(node, { delay = 0, duration = 400, easing: easing$$1 = easing.cubicOut }) { const style = getComputedStyle(node); const opacity = +style.opacity; const height = parseFloat(style.height); const padding_top = parseFloat(style.paddingTop); const padding_bottom = parseFloat(style.paddingBottom); const margin_top = parseFloat(style.marginTop); const margin_bottom = parseFloat(style.marginBottom); const border_top_width = parseFloat(style.borderTopWidth); const border_bottom_width = parseFloat(style.borderBottomWidth); return { delay, duration, easing: easing$$1, css: t => `overflow: hidden;` + `opacity: ${Math.min(t * 20, 1) * opacity};` + `height: ${t * height}px;` + `padding-top: ${t * padding_top}px;` + `padding-bottom: ${t * padding_bottom}px;` + `margin-top: ${t * margin_top}px;` + `margin-bottom: ${t * margin_bottom}px;` + `border-top-width: ${t * border_top_width}px;` + `border-bottom-width: ${t * border_bottom_width}px;` }; } function scale(node, { delay = 0, duration = 400, easing: easing$$1 = easing.cubicOut, start = 0, opacity = 0 }) { const style = getComputedStyle(node); const target_opacity = +style.opacity; const transform = style.transform === 'none' ? '' : style.transform; const sd = 1 - start; const od = target_opacity * (1 - opacity); return { delay, duration, easing: easing$$1, css: (t, u) => ` transform: ${transform} scale(${1 - (sd * u)}); opacity: ${target_opacity - (od * u)} ` }; } function draw(node, { delay = 0, speed, duration, easing: easing$$1 = easing.cubicInOut }) { const len = node.getTotalLength(); if (duration === undefined) { if (speed === undefined) { duration = 800; } else { duration = len / speed; } } else if (typeof duration === 'function') { duration = duration(len); } return { delay, duration, easing: easing$$1, css: (t, u) => `stroke-dasharray: ${t * len} ${u * len}` }; } function crossfade({ fallback, ...defaults }) { const to_receive = new Map(); const to_send = new Map(); function crossfade(from, node, params) { const { delay = 0, duration = d => Math.sqrt(d) * 30, easing: easing$$1 = easing.cubicOut } = internal.assign(internal.assign({}, defaults), params); const to = node.getBoundingClientRect(); const dx = from.left - to.left; const dy = from.top - to.top; const d = Math.sqrt(dx * dx + dy * dy); const style = getComputedStyle(node); const transform = style.transform === 'none' ? '' : style.transform; const opacity = +style.opacity; return { delay, duration: internal.is_function(duration) ? duration(d) : duration, easing: easing$$1, css: (t, u) => ` opacity: ${t * opacity}; transform: ${transform} translate(${u * dx}px,${u * dy}px); ` }; } function transition(items, counterparts, intro) { return (node, params) => { items.set(params.key, { rect: node.getBoundingClientRect() }); return () => { if (counterparts.has(params.key)) { const { rect } = counterparts.get(params.key); counterparts.delete(params.key); return crossfade(rect, node, params); } // if the node is disappearing altogether // (i.e. wasn't claimed by the other list) // then we need to supply an outro items.delete(params.key); return fallback && fallback(node, params, intro); }; }; } return [ transition(to_send, to_receive, false), transition(to_receive, to_send, true) ]; } exports.fade = fade; exports.fly = fly; exports.slide = slide; exports.scale = scale; exports.draw = draw; exports.crossfade = crossfade; }); unwrapExports(transition); var transition_1 = transition.fade; var transition_2 = transition.fly; var transition_3 = transition.slide; var transition_4 = transition.scale; var transition_5 = transition.draw; var transition_6 = transition.crossfade; /* src/User/Pages/NextIcon.svelte generated by Svelte v3.1.0 */ const file$1 = "src/User/Pages/NextIcon.svelte"; function create_fragment$1(ctx) { var svg, g1, g0, polygon, svg_style_value; return { c: function create() { svg = internal_14("svg"); g1 = internal_14("g"); g0 = internal_14("g"); polygon = internal_14("polygon"); internal_21(polygon, "points", "27.051,17 9.905,0 8.417,1.414 24.674,17.707 8.363,34 9.914,35.414 27.051,18.414 \t\t"); internal_86(polygon, file$1, 9, 9, 358); internal_86(g0, file$1, 8, 6, 345); internal_86(g1, file$1, 7, 3, 335); internal_21(svg, "style", svg_style_value = `enable-background:new 0 0 35.414 35.414; transform: rotate(${ctx.rotation}deg); transition: all .4s;`); internal_21(svg, "version", "1.1"); internal_21(svg, "id", "Capa_1"); internal_21(svg, "xmlns", "http://www.w3.org/2000/svg"); internal_21(svg, "xmlns:xlink", "http://www.w3.org/1999/xlink"); internal_21(svg, "x", "0px"); internal_21(svg, "y", "0px"); internal_21(svg, "viewBox", "0 0 35.414 35.414"); internal_21(svg, "xml:space", "preserve"); internal_86(svg, file$1, 4, 0, 44); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); }, m: function mount(target, anchor) { internal_7(target, svg, anchor); internal_6(svg, g1); internal_6(g1, g0); internal_6(g0, polygon); }, p: function update(changed, ctx) { if ((changed.rotation) && svg_style_value !== (svg_style_value = `enable-background:new 0 0 35.414 35.414; transform: rotate(${ctx.rotation}deg); transition: all .4s;`)) { internal_21(svg, "style", svg_style_value); } }, i: internal_82, o: internal_82, d: function destroy(detaching) { if (detaching) { internal_8(svg); } } }; } function instance$1($$self, $$props, $$invalidate) { let { rotation } = $$props; $$self.$set = $$props => { if ('rotation' in $$props) $$invalidate('rotation', rotation = $$props.rotation); }; return { rotation }; } class NextIcon extends internal_103 { constructor(options) { super(options); internal_101(this, options, instance$1, create_fragment$1, internal_91, ["rotation"]); const { ctx } = this.$$; const props = options.props || {}; if (ctx.rotation === undefined && !('rotation' in props)) { console.warn(" was created without expected prop 'rotation'"); } } get rotation() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set rotation(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } } /* src/User/Pages/BoxItem.svelte generated by Svelte v3.1.0 */ const file$2 = "src/User/Pages/BoxItem.svelte"; function get_each_context(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.v = list[i]; child_ctx.i = i; return child_ctx; } // (85:12) {:else} function create_else_block(ctx) { var t; return { c: function create() { t = internal_15(ctx.value); }, m: function mount(target, anchor) { internal_7(target, t, anchor); }, p: function update(changed, ctx) { if (changed.value) { internal_31(t, ctx.value); } }, d: function destroy(detaching) { if (detaching) { internal_8(t); } } }; } // (78:12) {#if Array.isArray(value)} function create_if_block_1(ctx) { var each_1_anchor; var each_value = ctx.value; var each_blocks = []; for (var i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); } return { c: function create() { for (var i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } each_1_anchor = internal_17(); }, m: function mount(target, anchor) { for (var i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(target, anchor); } internal_7(target, each_1_anchor, anchor); }, p: function update(changed, ctx) { if (changed.value) { each_value = ctx.value; for (var i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(changed, child_ctx); } else { each_blocks[i] = create_each_block(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value.length; } }, d: function destroy(detaching) { internal_12(each_blocks, detaching); if (detaching) { internal_8(each_1_anchor); } } }; } // (81:18) {#if i < value.length - 1} function create_if_block_2(ctx) { var br; return { c: function create() { br = internal_13("br"); internal_86(br, file$2, 81, 18, 1615); }, m: function mount(target, anchor) { internal_7(target, br, anchor); }, d: function destroy(detaching) { if (detaching) { internal_8(br); } } }; } // (79:15) {#each value as v, i} function create_each_block(ctx) { var t0_value = ctx.v, t0, t1, if_block_anchor; var if_block = (ctx.i < ctx.value.length - 1) && create_if_block_2(ctx); return { c: function create() { t0 = internal_15(t0_value); t1 = internal_16(); if (if_block) if_block.c(); if_block_anchor = internal_17(); }, m: function mount(target, anchor) { internal_7(target, t0, anchor); internal_7(target, t1, anchor); if (if_block) if_block.m(target, anchor); internal_7(target, if_block_anchor, anchor); }, p: function update(changed, ctx) { if ((changed.value) && t0_value !== (t0_value = ctx.v)) { internal_31(t0, t0_value); } if (ctx.i < ctx.value.length - 1) { if (!if_block) { if_block = create_if_block_2(ctx); if_block.c(); if_block.m(if_block_anchor.parentNode, if_block_anchor); } } else if (if_block) { if_block.d(1); if_block = null; } }, d: function destroy(detaching) { if (detaching) { internal_8(t0); internal_8(t1); } if (if_block) if_block.d(detaching); if (detaching) { internal_8(if_block_anchor); } } }; } // (92:3) {#if open} function create_if_block(ctx) { var div, div_transition, current; const default_slot_1 = ctx.$$slots.default; const default_slot = internal_95(default_slot_1, ctx, null); return { c: function create() { div = internal_13("div"); if (default_slot) default_slot.c(); div.className = "body svelte-1h07xvd"; internal_86(div, file$2, 92, 6, 1834); }, l: function claim(nodes) { if (default_slot) default_slot.l(div_nodes); }, m: function mount(target, anchor) { internal_7(target, div, anchor); if (default_slot) { default_slot.m(div, null); } current = true; }, p: function update(changed, ctx) { if (default_slot && default_slot.p && changed.$$scope) { default_slot.p(internal_97(default_slot_1, ctx, changed,), internal_96(default_slot_1, ctx, null)); } }, i: function intro(local) { if (current) return; if (default_slot && default_slot.i) default_slot.i(local); internal_62(() => { if (!div_transition) div_transition = internal_81(div, transition_3, {}, true); div_transition.run(1); }); current = true; }, o: function outro(local) { if (default_slot && default_slot.o) default_slot.o(local); if (!div_transition) div_transition = internal_81(div, transition_3, {}, false); div_transition.run(0); current = false; }, d: function destroy(detaching) { if (detaching) { internal_8(div); } if (default_slot) default_slot.d(detaching); if (detaching) { if (div_transition) div_transition.end(); } } }; } function create_fragment$2(ctx) { var div4, div3, div2, div0, t0, t1, div1, t2, t3, current, dispose; function select_block_type(ctx) { if (Array.isArray(ctx.value)) return create_if_block_1; return create_else_block; } var current_block_type = select_block_type(ctx); var if_block0 = current_block_type(ctx); var nexticon = new NextIcon({ props: { rotation: ctx.open ? -90 : 90 }, $$inline: true }); var if_block1 = (ctx.open) && create_if_block(ctx); return { c: function create() { div4 = internal_13("div"); div3 = internal_13("div"); div2 = internal_13("div"); div0 = internal_13("div"); t0 = internal_15(ctx.name); t1 = internal_16(); div1 = internal_13("div"); if_block0.c(); t2 = internal_16(); nexticon.$$.fragment.c(); t3 = internal_16(); if (if_block1) if_block1.c(); div0.className = "svelte-1h07xvd"; internal_86(div0, file$2, 75, 9, 1421); div1.className = "svelte-1h07xvd"; internal_86(div1, file$2, 76, 9, 1448); div2.className = "values svelte-1h07xvd"; internal_86(div2, file$2, 74, 6, 1391); div3.className = "container svelte-1h07xvd"; internal_86(div3, file$2, 73, 3, 1335); div4.className = "root svelte-1h07xvd"; internal_39(div4, "highlight-element", ctx.highlight); internal_86(div4, file$2, 72, 0, 1277); dispose = internal_18(div3, "click", ctx.click_handler); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); }, m: function mount(target, anchor) { internal_7(target, div4, anchor); internal_6(div4, div3); internal_6(div3, div2); internal_6(div2, div0); internal_6(div0, t0); internal_6(div2, t1); internal_6(div2, div1); if_block0.m(div1, null); internal_6(div3, t2); internal_100(nexticon, div3, null); internal_6(div4, t3); if (if_block1) if_block1.m(div4, null); current = true; }, p: function update(changed, ctx) { if (!current || changed.name) { internal_31(t0, ctx.name); } if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block0) { if_block0.p(changed, ctx); } else { if_block0.d(1); if_block0 = current_block_type(ctx); if (if_block0) { if_block0.c(); if_block0.m(div1, null); } } var nexticon_changes = {}; if (changed.open) nexticon_changes.rotation = ctx.open ? -90 : 90; nexticon.$set(nexticon_changes); if (ctx.open) { if (if_block1) { if_block1.p(changed, ctx); if_block1.i(1); } else { if_block1 = create_if_block(ctx); if_block1.c(); if_block1.i(1); if_block1.m(div4, null); } } else if (if_block1) { internal_76(); internal_78(() => { if_block1.d(1); if_block1 = null; }); if_block1.o(1); internal_77(); } if (changed.highlight) { internal_39(div4, "highlight-element", ctx.highlight); } }, i: function intro(local) { if (current) return; nexticon.$$.fragment.i(local); if (if_block1) if_block1.i(); current = true; }, o: function outro(local) { nexticon.$$.fragment.o(local); if (if_block1) if_block1.o(); current = false; }, d: function destroy(detaching) { if (detaching) { internal_8(div4); } if_block0.d(); nexticon.$destroy(); if (if_block1) if_block1.d(); dispose(); } }; } function instance$2($$self, $$props, $$invalidate) { let { name, value, open = false, highlight = false } = $$props; let { $$slots = {}, $$scope } = $$props; function click_handler() { const $$result = open=!open; $$invalidate('open', open); return $$result; } $$self.$set = $$props => { if ('name' in $$props) $$invalidate('name', name = $$props.name); if ('value' in $$props) $$invalidate('value', value = $$props.value); if ('open' in $$props) $$invalidate('open', open = $$props.open); if ('highlight' in $$props) $$invalidate('highlight', highlight = $$props.highlight); if ('$$scope' in $$props) $$invalidate('$$scope', $$scope = $$props.$$scope); }; return { name, value, open, highlight, click_handler, $$slots, $$scope }; } class BoxItem extends internal_103 { constructor(options) { super(options); internal_101(this, options, instance$2, create_fragment$2, internal_91, ["name", "value", "open", "highlight"]); const { ctx } = this.$$; const props = options.props || {}; if (ctx.name === undefined && !('name' in props)) { console.warn(" was created without expected prop 'name'"); } if (ctx.value === undefined && !('value' in props)) { console.warn(" was created without expected prop 'value'"); } if (ctx.open === undefined && !('open' in props)) { console.warn(" was created without expected prop 'open'"); } if (ctx.highlight === undefined && !('highlight' in props)) { console.warn(" was created without expected prop 'highlight'"); } } get name() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set name(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get value() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set value(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get open() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set open(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get highlight() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set highlight(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } } /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ function __awaiter(thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } function getCookie(cname) { var name = cname + "="; var dc = decodeURIComponent(document.cookie); var ca = dc.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } //# sourceMappingURL=cookie.js.map // const baseURL = "https://auth.stamm.me"; var baseURL = "http://localhost:3000"; function request(endpoint, parameters, method, body, authInParam) { if (parameters === void 0) { parameters = {}; } if (method === void 0) { method = "GET"; } if (authInParam === void 0) { authInParam = false; } return __awaiter(this, void 0, void 0, function () { var pairs, key, url; return __generator(this, function (_a) { pairs = []; if (authInParam) { parameters.login = getCookie("login"); parameters.special = getCookie("special"); } for (key in parameters) { pairs.push(key + "=" + parameters[key]); } url = endpoint; if (pairs.length > 0) { url += "?" + pairs.join("&"); } return [2 /*return*/, fetch(baseURL + url, { method: method, body: JSON.stringify(body), credentials: "same-origin", headers: { 'content-type': 'application/json' }, }).then(function (e) { if (e.status !== 200) throw new Error(e.statusText); return e.json(); }).then(function (data) { if (data.error) { if (data.additional && data.additional.auth) { var state = btoa(window.location.pathname + window.location.hash); // window.location.href = `/login?state=${state}&base64=true`; } return Promise.reject(new Error(data.error)); } return data; })]; }); }); } //# sourceMappingURL=request.js.map /* src/User/Pages/Account.svelte generated by Svelte v3.1.0 */ const file$3 = "src/User/Pages/Account.svelte"; // (132:3) {#if error} function create_if_block$1(ctx) { var p, t; return { c: function create() { p = internal_13("p"); t = internal_15(ctx.error); p.className = "error svelte-1lc4uv"; internal_86(p, file$3, 132, 6, 2550); }, m: function mount(target, anchor) { internal_7(target, p, anchor); internal_6(p, t); }, p: function update(changed, ctx) { if (changed.error) { internal_31(t, ctx.error); } }, d: function destroy(detaching) { if (detaching) { internal_8(p); } } }; } // (135:3) function create_default_slot_3(ctx) { var div1, div0, input, t0, span0, t1, span1, t2, label, t4, button, dispose; return { c: function create() { div1 = internal_13("div"); div0 = internal_13("div"); input = internal_13("input"); t0 = internal_16(); span0 = internal_13("span"); t1 = internal_16(); span1 = internal_13("span"); t2 = internal_16(); label = internal_13("label"); label.textContent = "Name"; t4 = internal_16(); button = internal_13("button"); button.textContent = "Save"; internal_21(input, "type", "text"); input.autocomplete = "username"; internal_86(input, file$3, 137, 12, 2712); span0.className = "highlight"; internal_86(span0, file$3, 138, 12, 2786); span1.className = "bar"; internal_86(span1, file$3, 139, 12, 2830); internal_86(label, file$3, 140, 12, 2868); div0.className = "floating group svelte-1lc4uv"; internal_86(div0, file$3, 136, 9, 2671); button.className = "btn svelte-1lc4uv"; internal_86(button, file$3, 142, 9, 2913); div1.className = "input-container svelte-1lc4uv"; internal_86(div1, file$3, 135, 6, 2632); dispose = [ internal_18(input, "input", ctx.input_input_handler), internal_18(button, "click", ctx.saveName) ]; }, m: function mount(target, anchor) { internal_7(target, div1, anchor); internal_6(div1, div0); internal_6(div0, input); input.value = ctx.name; internal_6(div0, t0); internal_6(div0, span0); internal_6(div0, t1); internal_6(div0, span1); internal_6(div0, t2); internal_6(div0, label); internal_6(div1, t4); internal_6(div1, button); }, p: function update(changed, ctx) { if (changed.name && (input.value !== ctx.name)) input.value = ctx.name; }, d: function destroy(detaching) { if (detaching) { internal_8(div1); } internal_89(dispose); } }; } // (146:3) function create_default_slot_2(ctx) { var div1, div0, select, option0, option1, option2, t_3, button, dispose; return { c: function create() { div1 = internal_13("div"); div0 = internal_13("div"); select = internal_13("select"); option0 = internal_13("option"); option0.textContent = "Male"; option1 = internal_13("option"); option1.textContent = "Female"; option2 = internal_13("option"); option2.textContent = "Other"; t_3 = internal_16(); button = internal_13("button"); button.textContent = "Save"; option0.__value = 1; option0.value = option0.__value; option0.className = "svelte-1lc4uv"; internal_86(option0, file$3, 149, 15, 3171); option1.__value = 2; option1.value = option1.__value; option1.className = "svelte-1lc4uv"; internal_86(option1, file$3, 150, 15, 3218); option2.__value = 3; option2.value = option2.__value; option2.className = "svelte-1lc4uv"; internal_86(option2, file$3, 151, 15, 3267); if (ctx.gender === void 0) internal_62(() => ctx.select_change_handler.call(select)); select.className = "svelte-1lc4uv"; internal_86(select, file$3, 148, 12, 3127); div0.className = "select-wrapper svelte-1lc4uv"; internal_86(div0, file$3, 147, 9, 3086); button.className = "btn svelte-1lc4uv"; internal_86(button, file$3, 154, 9, 3347); div1.className = "input-container svelte-1lc4uv"; internal_86(div1, file$3, 146, 6, 3047); dispose = [ internal_18(select, "change", ctx.select_change_handler), internal_18(button, "click", ctx.saveGender) ]; }, m: function mount(target, anchor) { internal_7(target, div1, anchor); internal_6(div1, div0); internal_6(div0, select); internal_6(select, option0); internal_6(select, option1); internal_6(select, option2); internal_34(select, ctx.gender); internal_6(div1, t_3); internal_6(div1, button); }, p: function update(changed, ctx) { if (changed.gender) internal_34(select, ctx.gender); }, d: function destroy(detaching) { if (detaching) { internal_8(div1); } internal_89(dispose); } }; } // (130:0) function create_default_slot_1(ctx) { var h1, t1, t2, t3, t4, t5, current; var if_block = (ctx.error) && create_if_block$1(ctx); var boxitem0 = new BoxItem({ props: { name: "Name", value: ctx.name, $$slots: { default: [create_default_slot_3] }, $$scope: { ctx } }, $$inline: true }); var boxitem1 = new BoxItem({ props: { name: "Gender", value: ctx.genderHuman, $$slots: { default: [create_default_slot_2] }, $$scope: { ctx } }, $$inline: true }); var boxitem2 = new BoxItem({ props: { name: "Birthday", value: ctx.birthday }, $$inline: true }); var boxitem3 = new BoxItem({ props: { name: "Password", value: "******" }, $$inline: true }); return { c: function create() { h1 = internal_13("h1"); h1.textContent = "Profile"; t1 = internal_16(); if (if_block) if_block.c(); t2 = internal_16(); boxitem0.$$.fragment.c(); t3 = internal_16(); boxitem1.$$.fragment.c(); t4 = internal_16(); boxitem2.$$.fragment.c(); t5 = internal_16(); boxitem3.$$.fragment.c(); h1.className = "svelte-1lc4uv"; internal_86(h1, file$3, 130, 3, 2512); }, m: function mount(target, anchor) { internal_7(target, h1, anchor); internal_7(target, t1, anchor); if (if_block) if_block.m(target, anchor); internal_7(target, t2, anchor); internal_100(boxitem0, target, anchor); internal_7(target, t3, anchor); internal_100(boxitem1, target, anchor); internal_7(target, t4, anchor); internal_100(boxitem2, target, anchor); internal_7(target, t5, anchor); internal_100(boxitem3, target, anchor); current = true; }, p: function update(changed, ctx) { if (ctx.error) { if (if_block) { if_block.p(changed, ctx); } else { if_block = create_if_block$1(ctx); if_block.c(); if_block.m(t2.parentNode, t2); } } else if (if_block) { if_block.d(1); if_block = null; } var boxitem0_changes = {}; if (changed.name) boxitem0_changes.value = ctx.name; if (changed.$$scope || changed.name) boxitem0_changes.$$scope = { changed, ctx }; boxitem0.$set(boxitem0_changes); var boxitem1_changes = {}; if (changed.genderHuman) boxitem1_changes.value = ctx.genderHuman; if (changed.$$scope || changed.gender) boxitem1_changes.$$scope = { changed, ctx }; boxitem1.$set(boxitem1_changes); var boxitem2_changes = {}; if (changed.birthday) boxitem2_changes.value = ctx.birthday; boxitem2.$set(boxitem2_changes); }, i: function intro(local) { if (current) return; boxitem0.$$.fragment.i(local); boxitem1.$$.fragment.i(local); boxitem2.$$.fragment.i(local); boxitem3.$$.fragment.i(local); current = true; }, o: function outro(local) { boxitem0.$$.fragment.o(local); boxitem1.$$.fragment.o(local); boxitem2.$$.fragment.o(local); boxitem3.$$.fragment.o(local); current = false; }, d: function destroy(detaching) { if (detaching) { internal_8(h1); internal_8(t1); } if (if_block) if_block.d(detaching); if (detaching) { internal_8(t2); } boxitem0.$destroy(detaching); if (detaching) { internal_8(t3); } boxitem1.$destroy(detaching); if (detaching) { internal_8(t4); } boxitem2.$destroy(detaching); if (detaching) { internal_8(t5); } boxitem3.$destroy(detaching); } }; } // (162:0) function create_default_slot(ctx) { var h1, t1, t2, current; var boxitem0 = new BoxItem({ props: { name: "E-Mail", value: ctx.email }, $$inline: true }); var boxitem1 = new BoxItem({ props: { name: "Phone", value: ctx.phone }, $$inline: true }); return { c: function create() { h1 = internal_13("h1"); h1.textContent = "Contact"; t1 = internal_16(); boxitem0.$$.fragment.c(); t2 = internal_16(); boxitem1.$$.fragment.c(); h1.className = "svelte-1lc4uv"; internal_86(h1, file$3, 162, 3, 3541); }, m: function mount(target, anchor) { internal_7(target, h1, anchor); internal_7(target, t1, anchor); internal_100(boxitem0, target, anchor); internal_7(target, t2, anchor); internal_100(boxitem1, target, anchor); current = true; }, p: function update(changed, ctx) { var boxitem0_changes = {}; if (changed.email) boxitem0_changes.value = ctx.email; boxitem0.$set(boxitem0_changes); var boxitem1_changes = {}; if (changed.phone) boxitem1_changes.value = ctx.phone; boxitem1.$set(boxitem1_changes); }, i: function intro(local) { if (current) return; boxitem0.$$.fragment.i(local); boxitem1.$$.fragment.i(local); current = true; }, o: function outro(local) { boxitem0.$$.fragment.o(local); boxitem1.$$.fragment.o(local); current = false; }, d: function destroy(detaching) { if (detaching) { internal_8(h1); internal_8(t1); } boxitem0.$destroy(detaching); if (detaching) { internal_8(t2); } boxitem1.$destroy(detaching); } }; } function create_fragment$3(ctx) { var t, current; var box0 = new Box({ props: { $$slots: { default: [create_default_slot_1] }, $$scope: { ctx } }, $$inline: true }); var box1 = new Box({ props: { $$slots: { default: [create_default_slot] }, $$scope: { ctx } }, $$inline: true }); return { c: function create() { box0.$$.fragment.c(); t = internal_16(); box1.$$.fragment.c(); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); }, m: function mount(target, anchor) { internal_100(box0, target, anchor); internal_7(target, t, anchor); internal_100(box1, target, anchor); current = true; }, p: function update(changed, ctx) { var box0_changes = {}; if (changed.$$scope || changed.birthday || changed.genderHuman || changed.gender || changed.name || changed.error) box0_changes.$$scope = { changed, ctx }; box0.$set(box0_changes); var box1_changes = {}; if (changed.$$scope) box1_changes.$$scope = { changed, ctx }; box1.$set(box1_changes); }, i: function intro(local) { if (current) return; box0.$$.fragment.i(local); box1.$$.fragment.i(local); current = true; }, o: function outro(local) { box0.$$.fragment.o(local); box1.$$.fragment.o(local); current = false; }, d: function destroy(detaching) { box0.$destroy(detaching); if (detaching) { internal_8(t); } box1.$destroy(detaching); } }; } async function loadContact() { } function instance$3($$self, $$props, $$invalidate) { let { loading = false } = $$props; let error = undefined; const genderMap = new Map(); genderMap.set(0, "None"); genderMap.set(1, "Male"); genderMap.set(2, "Female"); genderMap.set(3, "Other"); let name = ""; let gender = 0; let birthday = undefined; async function saveName() { //TODO: implement await load(); } async function saveGender() { //TODO: implement await load(); } async function loadProfile() { try { let { user } = await request("/api/user/account", {}, "GET", undefined, true); $$invalidate('name', name = user.name); // username = user.username; $$invalidate('gender', gender = user.gender); $$invalidate('birthday', birthday = user.birthday ? new Date(user.birthday).toLocaleDateString() : undefined); } catch (err) { console.error(err); $$invalidate('error', error = err.message); } } let email = ["mail@fabianstamm.de", "fabian.stamm.koe@gmail.com"]; let phone = ["+1 1233 123123123", "+21 1233 123 123 1"]; async function load() { $$invalidate('loading', loading = true); await Promise.all([ loadProfile(), loadContact() ]); $$invalidate('loading', loading = false); } load(); function input_input_handler() { name = this.value; $$invalidate('name', name); } function select_change_handler() { gender = internal_36(this); $$invalidate('gender', gender); } $$self.$set = $$props => { if ('loading' in $$props) $$invalidate('loading', loading = $$props.loading); }; let genderHuman; $$self.$$.update = ($$dirty = { gender: 1 }) => { if ($$dirty.gender) { $$invalidate('genderHuman', genderHuman = genderMap.get(gender) || "ERROR"); } }; return { loading, error, name, gender, birthday, saveName, saveGender, email, phone, genderHuman, input_input_handler, select_change_handler }; } class Account extends internal_103 { constructor(options) { super(options); internal_101(this, options, instance$3, create_fragment$3, internal_91, ["loading"]); const { ctx } = this.$$; const props = options.props || {}; if (ctx.loading === undefined && !('loading' in props)) { console.warn(" was created without expected prop 'loading'"); } } get loading() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set loading(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } } /* src/User/Pages/Security.svelte generated by Svelte v3.1.0 */ const file$4 = "src/User/Pages/Security.svelte"; function get_each_context$1(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.t = list[i]; return child_ctx; } // (28:0) function create_default_slot_2$1(ctx) { var h1; return { c: function create() { h1 = internal_13("h1"); h1.textContent = "Two Factor"; h1.className = "svelte-hfyfkx"; internal_86(h1, file$4, 28, 3, 595); }, m: function mount(target, anchor) { internal_7(target, h1, anchor); }, d: function destroy(detaching) { if (detaching) { internal_8(h1); } } }; } // (65:3) {:else} function create_else_block$1(ctx) { var span; return { c: function create() { span = internal_13("span"); span.textContent = "No Tokens"; span.className = "svelte-hfyfkx"; internal_86(span, file$4, 65, 3, 1887); }, m: function mount(target, anchor) { internal_7(target, span, anchor); }, d: function destroy(detaching) { if (detaching) { internal_8(span); } } }; } // (62:3) function create_default_slot_1$1(ctx) { var button, t_1, dispose; function click_handler() { return ctx.click_handler(ctx); } return { c: function create() { button = internal_13("button"); button.textContent = "Revoke"; t_1 = internal_16(); button.className = "btn svelte-hfyfkx"; internal_33(button, "background", "var(--error)"); internal_86(button, file$4, 62, 6, 1762); dispose = internal_18(button, "click", click_handler); }, m: function mount(target, anchor) { internal_7(target, button, anchor); internal_7(target, t_1, anchor); }, p: function update(changed, new_ctx) { ctx = new_ctx; }, d: function destroy(detaching) { if (detaching) { internal_8(button); internal_8(t_1); } dispose(); } }; } // (61:3) {#each token as t} function create_each_block$1(ctx) { var current; var boxitem = new BoxItem({ props: { name: ctx.t.browser, value: ctx.t.ip, highlight: ctx.t.isthis, $$slots: { default: [create_default_slot_1$1] }, $$scope: { ctx } }, $$inline: true }); return { c: function create() { boxitem.$$.fragment.c(); }, m: function mount(target, anchor) { internal_100(boxitem, target, anchor); current = true; }, p: function update(changed, ctx) { var boxitem_changes = {}; if (changed.token) boxitem_changes.name = ctx.t.browser; if (changed.token) boxitem_changes.value = ctx.t.ip; if (changed.token) boxitem_changes.highlight = ctx.t.isthis; if (changed.$$scope) boxitem_changes.$$scope = { changed, ctx }; boxitem.$set(boxitem_changes); }, i: function intro(local) { if (current) return; boxitem.$$.fragment.i(local); current = true; }, o: function outro(local) { boxitem.$$.fragment.o(local); current = false; }, d: function destroy(detaching) { boxitem.$destroy(detaching); } }; } // (58:0) function create_default_slot$1(ctx) { var h1, t_1, each_1_anchor, current; var each_value = ctx.token; var each_blocks = []; for (var i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i)); } function outro_block(i, detaching, local) { if (each_blocks[i]) { if (detaching) { internal_78(() => { each_blocks[i].d(detaching); each_blocks[i] = null; }); } each_blocks[i].o(local); } } var each_1_else = null; if (!each_value.length) { each_1_else = create_else_block$1(ctx); each_1_else.c(); } return { c: function create() { h1 = internal_13("h1"); h1.textContent = "Anmeldungen"; t_1 = internal_16(); for (var i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } each_1_anchor = internal_17(); h1.className = "svelte-hfyfkx"; internal_86(h1, file$4, 58, 3, 1648); }, m: function mount(target, anchor) { internal_7(target, h1, anchor); internal_7(target, t_1, anchor); for (var i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(target, anchor); } internal_7(target, each_1_anchor, anchor); if (each_1_else) { each_1_else.m(target, null); } current = true; }, p: function update(changed, ctx) { if (changed.token) { each_value = ctx.token; for (var i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context$1(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(changed, child_ctx); each_blocks[i].i(1); } else { each_blocks[i] = create_each_block$1(child_ctx); each_blocks[i].c(); each_blocks[i].i(1); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } } internal_76(); for (; i < each_blocks.length; i += 1) outro_block(i, 1, 1); internal_77(); } if (each_value.length) { if (each_1_else) { each_1_else.d(1); each_1_else = null; } } else if (!each_1_else) { each_1_else = create_else_block$1(ctx); each_1_else.c(); each_1_else.m(each_1_anchor.parentNode, each_1_anchor); } }, i: function intro(local) { if (current) return; for (var i = 0; i < each_value.length; i += 1) each_blocks[i].i(); current = true; }, o: function outro(local) { each_blocks = each_blocks.filter(Boolean); for (let i = 0; i < each_blocks.length; i += 1) outro_block(i, 0); current = false; }, d: function destroy(detaching) { if (detaching) { internal_8(h1); internal_8(t_1); } internal_12(each_blocks, detaching); if (detaching) { internal_8(each_1_anchor); } if (each_1_else) each_1_else.d(detaching); } }; } function create_fragment$4(ctx) { var t, current; var box0 = new Box({ props: { $$slots: { default: [create_default_slot_2$1] }, $$scope: { ctx } }, $$inline: true }); var box1 = new Box({ props: { $$slots: { default: [create_default_slot$1] }, $$scope: { ctx } }, $$inline: true }); return { c: function create() { box0.$$.fragment.c(); t = internal_16(); box1.$$.fragment.c(); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); }, m: function mount(target, anchor) { internal_100(box0, target, anchor); internal_7(target, t, anchor); internal_100(box1, target, anchor); current = true; }, p: function update(changed, ctx) { var box0_changes = {}; if (changed.$$scope) box0_changes.$$scope = { changed, ctx }; box0.$set(box0_changes); var box1_changes = {}; if (changed.$$scope || changed.token) box1_changes.$$scope = { changed, ctx }; box1.$set(box1_changes); }, i: function intro(local) { if (current) return; box0.$$.fragment.i(local); box1.$$.fragment.i(local); current = true; }, o: function outro(local) { box0.$$.fragment.o(local); box1.$$.fragment.o(local); current = false; }, d: function destroy(detaching) { box0.$destroy(detaching); if (detaching) { internal_8(t); } box1.$destroy(detaching); } }; } function instance$4($$self, $$props, $$invalidate) { let { loading = false } = $$props; let token = []; async function revoke(id) { let res = await request("/api/user/token/" + id, undefined, "DELETE", undefined, true); load(); } async function load() { $$invalidate('loading', loading = true); let res = await request("/api/user/token", undefined, undefined, undefined, true); $$invalidate('token', token = res.token); $$invalidate('loading', loading = false); } load(); function click_handler({ t }) { return revoke(t.id); } $$self.$set = $$props => { if ('loading' in $$props) $$invalidate('loading', loading = $$props.loading); }; return { loading, token, revoke, click_handler }; } class Security extends internal_103 { constructor(options) { super(options); internal_101(this, options, instance$4, create_fragment$4, internal_91, ["loading"]); const { ctx } = this.$$; const props = options.props || {}; if (ctx.loading === undefined && !('loading' in props)) { console.warn(" was created without expected prop 'loading'"); } } get loading() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set loading(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } } /* src/User/NavigationBar.svelte generated by Svelte v3.1.0 */ const file$5 = "src/User/NavigationBar.svelte"; function get_each_context$2(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.page = list[i]; return child_ctx; } // (39:0) {#each pages as page} function create_each_block$2(ctx) { var div1, div0, img, img_src_value, t0, h3, t1_value = ctx.page.title, t1, t2, dispose; function click_handler() { return ctx.click_handler(ctx); } return { c: function create() { div1 = internal_13("div"); div0 = internal_13("div"); img = internal_13("img"); t0 = internal_16(); h3 = internal_13("h3"); t1 = internal_15(t1_value); t2 = internal_16(); img.src = img_src_value = ctx.page.icon; img.className = "svelte-zltjsn"; internal_86(img, file$5, 40, 24, 777); div0.className = "icon svelte-zltjsn"; internal_86(div0, file$5, 40, 6, 759); h3.className = "title svelte-zltjsn"; internal_86(h3, file$5, 41, 6, 813); div1.className = "container svelte-zltjsn"; internal_86(div1, file$5, 39, 3, 698); dispose = internal_18(div1, "click", click_handler); }, m: function mount(target, anchor) { internal_7(target, div1, anchor); internal_6(div1, div0); internal_6(div0, img); internal_6(div1, t0); internal_6(div1, h3); internal_6(h3, t1); internal_6(div1, t2); }, p: function update(changed, new_ctx) { ctx = new_ctx; if ((changed.pages) && img_src_value !== (img_src_value = ctx.page.icon)) { img.src = img_src_value; } if ((changed.pages) && t1_value !== (t1_value = ctx.page.title)) { internal_31(t1, t1_value); } }, d: function destroy(detaching) { if (detaching) { internal_8(div1); } dispose(); } }; } function create_fragment$5(ctx) { var each_1_anchor; var each_value = ctx.pages; var each_blocks = []; for (var i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i)); } return { c: function create() { for (var i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } each_1_anchor = internal_17(); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); }, m: function mount(target, anchor) { for (var i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(target, anchor); } internal_7(target, each_1_anchor, anchor); }, p: function update(changed, ctx) { if (changed.pages) { each_value = ctx.pages; for (var i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context$2(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(changed, child_ctx); } else { each_blocks[i] = create_each_block$2(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value.length; } }, i: internal_82, o: internal_82, d: function destroy(detaching) { internal_12(each_blocks, detaching); if (detaching) { internal_8(each_1_anchor); } } }; } function instance$5($$self, $$props, $$invalidate) { let { open, pages = [] } = $$props; function click_handler({ page }) { return open(page.id); } $$self.$set = $$props => { if ('open' in $$props) $$invalidate('open', open = $$props.open); if ('pages' in $$props) $$invalidate('pages', pages = $$props.pages); }; return { open, pages, click_handler }; } class NavigationBar extends internal_103 { constructor(options) { super(options); internal_101(this, options, instance$5, create_fragment$5, internal_91, ["open", "pages"]); const { ctx } = this.$$; const props = options.props || {}; if (ctx.open === undefined && !('open' in props)) { console.warn(" was created without expected prop 'open'"); } if (ctx.pages === undefined && !('pages' in props)) { console.warn(" was created without expected prop 'pages'"); } } get open() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set open(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } get pages() { throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); } set pages(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } } /* src/User/App.svelte generated by Svelte v3.1.0 */ const file$6 = "src/User/App.svelte"; // (63:9) {#if sidebar_button} function create_if_block_3(ctx) { var button, svg, path, dispose; return { c: function create() { button = internal_13("button"); svg = internal_14("svg"); path = internal_14("path"); internal_21(path, "d", "M4,10h24c1.104,0,2-0.896,2-2s-0.896-2-2-2H4C2.896,6,2,6.896,2,8S2.896,10,4,10z M28,14H4c-1.104,0-2,0.896-2,2 s0.896,2,2,2h24c1.104,0,2-0.896,2-2S29.104,14,28,14z M28,22H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h24c1.104,0,2-0.896,2-2 S29.104,22,28,22z"); internal_21(path, "class", "svelte-1ee89l3"); internal_86(path, file$6, 64, 217, 1744); internal_21(svg, "id", "Layer_1"); internal_33(svg, "enable-background", "new 0 0 32 32"); internal_21(svg, "version", "1.1"); internal_21(svg, "viewBox", "0 0 32 32"); internal_21(svg, "width", "32px"); internal_21(svg, "xml:space", "preserve"); internal_21(svg, "xmlns", "http://www.w3.org/2000/svg"); internal_21(svg, "xmlns:xlink", "http://www.w3.org/1999/xlink"); internal_21(svg, "class", "svelte-1ee89l3"); internal_86(svg, file$6, 64, 12, 1539); button.className = "svelte-1ee89l3"; internal_86(button, file$6, 63, 9, 1470); dispose = internal_18(button, "click", ctx.click_handler); }, m: function mount(target, anchor) { internal_7(target, button, anchor); internal_6(button, svg); internal_6(svg, path); }, d: function destroy(detaching) { if (detaching) { internal_8(button); } dispose(); } }; } // (76:42) function create_if_block_2$1(ctx) { var updating_loading, current; function securitypage_loading_binding(value) { ctx.securitypage_loading_binding.call(null, value); updating_loading = true; internal_63(() => updating_loading = false); } let securitypage_props = {}; if (ctx.loading !== void 0) { securitypage_props.loading = ctx.loading; } var securitypage = new Security({ props: securitypage_props, $$inline: true }); internal_61(() => internal_99(securitypage, 'loading', securitypage_loading_binding)); return { c: function create() { securitypage.$$.fragment.c(); }, m: function mount(target, anchor) { internal_100(securitypage, target, anchor); current = true; }, p: function update(changed, ctx) { var securitypage_changes = {}; if (!updating_loading && changed.loading) { securitypage_changes.loading = ctx.loading; } securitypage.$set(securitypage_changes); }, i: function intro(local) { if (current) return; securitypage.$$.fragment.i(local); current = true; }, o: function outro(local) { securitypage.$$.fragment.o(local); current = false; }, d: function destroy(detaching) { securitypage.$destroy(detaching); } }; } // (74:9) {#if page.id === "account"} function create_if_block_1$1(ctx) { var updating_loading, current; function accountpage_loading_binding(value) { ctx.accountpage_loading_binding.call(null, value); updating_loading = true; internal_63(() => updating_loading = false); } let accountpage_props = {}; if (ctx.loading !== void 0) { accountpage_props.loading = ctx.loading; } var accountpage = new Account({ props: accountpage_props, $$inline: true }); internal_61(() => internal_99(accountpage, 'loading', accountpage_loading_binding)); return { c: function create() { accountpage.$$.fragment.c(); }, m: function mount(target, anchor) { internal_100(accountpage, target, anchor); current = true; }, p: function update(changed, ctx) { var accountpage_changes = {}; if (!updating_loading && changed.loading) { accountpage_changes.loading = ctx.loading; } accountpage.$set(accountpage_changes); }, i: function intro(local) { if (current) return; accountpage.$$.fragment.i(local); current = true; }, o: function outro(local) { accountpage.$$.fragment.o(local); current = false; }, d: function destroy(detaching) { accountpage.$destroy(detaching); } }; } // (84:0) {#if loading} function create_if_block$2(ctx) { var div2, div1, div0; return { c: function create() { div2 = internal_13("div"); div1 = internal_13("div"); div0 = internal_13("div"); div0.className = "loader svelte-1ee89l3"; internal_86(div0, file$6, 86, 6, 2568); div1.className = "loader_box svelte-1ee89l3"; internal_86(div1, file$6, 85, 3, 2537); div2.className = "loader_container svelte-1ee89l3"; internal_86(div2, file$6, 84, 0, 2503); }, m: function mount(target, anchor) { internal_7(target, div2, anchor); internal_6(div2, div1); internal_6(div1, div0); }, d: function destroy(detaching) { if (detaching) { internal_8(div2); } } }; } function create_fragment$6(ctx) { var div5, div4, div0, t0, h1, t1_value = ctx.page.title, t1, t2, div1, t3, div2, current_block_type_index, if_block1, t4, div3, t5, if_block2_anchor, current; var if_block0 = (ctx.sidebar_button) && create_if_block_3(ctx); var navigationbar = new NavigationBar({ props: { open: ctx.setPage, pages: ctx.pages }, $$inline: true }); var if_block_creators = [ create_if_block_1$1, create_if_block_2$1 ]; var if_blocks = []; function select_block_type(ctx) { if (ctx.page.id === "account") return 0; if (ctx.page.id === "security") return 1; return -1; } if (~(current_block_type_index = select_block_type(ctx))) { if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); } var if_block2 = (ctx.loading) && create_if_block$2(ctx); return { c: function create() { div5 = internal_13("div"); div4 = internal_13("div"); div0 = internal_13("div"); if (if_block0) if_block0.c(); t0 = internal_16(); h1 = internal_13("h1"); t1 = internal_15(t1_value); t2 = internal_16(); div1 = internal_13("div"); navigationbar.$$.fragment.c(); t3 = internal_16(); div2 = internal_13("div"); if (if_block1) if_block1.c(); t4 = internal_16(); div3 = internal_13("div"); t5 = internal_16(); if (if_block2) if_block2.c(); if_block2_anchor = internal_17(); h1.className = "svelte-1ee89l3"; internal_86(h1, file$6, 67, 6, 2049); div0.className = "header svelte-1ee89l3"; internal_86(div0, file$6, 61, 6, 1410); div1.className = "sidebar svelte-1ee89l3"; internal_39(div1, "sidebar-visible", ctx.sidebar_active); internal_86(div1, file$6, 69, 6, 2090); div2.className = "content svelte-1ee89l3"; internal_86(div2, file$6, 72, 6, 2226); div3.className = "footer svelte-1ee89l3"; internal_86(div3, file$6, 79, 6, 2444); div4.className = "container svelte-1ee89l3"; internal_86(div4, file$6, 60, 3, 1380); div5.className = "root svelte-1ee89l3"; internal_39(div5, "loading", ctx.loading); internal_86(div5, file$6, 59, 0, 1344); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); }, m: function mount(target, anchor) { internal_7(target, div5, anchor); internal_6(div5, div4); internal_6(div4, div0); if (if_block0) if_block0.m(div0, null); internal_6(div0, t0); internal_6(div0, h1); internal_6(h1, t1); internal_6(div4, t2); internal_6(div4, div1); internal_100(navigationbar, div1, null); internal_6(div4, t3); internal_6(div4, div2); if (~current_block_type_index) if_blocks[current_block_type_index].m(div2, null); internal_6(div4, t4); internal_6(div4, div3); internal_7(target, t5, anchor); if (if_block2) if_block2.m(target, anchor); internal_7(target, if_block2_anchor, anchor); current = true; }, p: function update(changed, ctx) { if (ctx.sidebar_button) { if (!if_block0) { if_block0 = create_if_block_3(ctx); if_block0.c(); if_block0.m(div0, t0); } } else if (if_block0) { if_block0.d(1); if_block0 = null; } if ((!current || changed.page) && t1_value !== (t1_value = ctx.page.title)) { internal_31(t1, t1_value); } var navigationbar_changes = {}; if (changed.setPage) navigationbar_changes.open = ctx.setPage; if (changed.pages) navigationbar_changes.pages = ctx.pages; navigationbar.$set(navigationbar_changes); if (changed.sidebar_active) { internal_39(div1, "sidebar-visible", ctx.sidebar_active); } var previous_block_index = current_block_type_index; current_block_type_index = select_block_type(ctx); if (current_block_type_index === previous_block_index) { if (~current_block_type_index) if_blocks[current_block_type_index].p(changed, ctx); } else { if (if_block1) { internal_76(); internal_78(() => { if_blocks[previous_block_index].d(1); if_blocks[previous_block_index] = null; }); if_block1.o(1); internal_77(); } if (~current_block_type_index) { if_block1 = if_blocks[current_block_type_index]; if (!if_block1) { if_block1 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); if_block1.c(); } if_block1.i(1); if_block1.m(div2, null); } else { if_block1 = null; } } if (changed.loading) { internal_39(div5, "loading", ctx.loading); } if (ctx.loading) { if (!if_block2) { if_block2 = create_if_block$2(ctx); if_block2.c(); if_block2.m(if_block2_anchor.parentNode, if_block2_anchor); } } else if (if_block2) { if_block2.d(1); if_block2 = null; } }, i: function intro(local) { if (current) return; navigationbar.$$.fragment.i(local); if (if_block1) if_block1.i(); current = true; }, o: function outro(local) { navigationbar.$$.fragment.o(local); if (if_block1) if_block1.o(); current = false; }, d: function destroy(detaching) { if (detaching) { internal_8(div5); } if (if_block0) if_block0.d(); navigationbar.$destroy(); if (~current_block_type_index) if_blocks[current_block_type_index].d(); if (detaching) { internal_8(t5); } if (if_block2) if_block2.d(detaching); if (detaching) { internal_8(if_block2_anchor); } } }; } function instance$6($$self, $$props, $$invalidate) { const pages = [{ id: "account", title: "Account", icon: "", component: Account }, { id: "security", title: "Security", icon: "", component: Security } ]; function getPage() { let pageid = window.location.hash.slice(1); return pages.find(e => e.id === pageid) || pages[0]; } let page = getPage(); window.addEventListener("hashchange", () => { $$invalidate('page', page = getPage()); }); // $: title = pages.find(e => e.id === page).title; const mq = window.matchMedia("(min-width: 45rem)"); let sidebar_button = !mq.matches; mq.addEventListener("change", (ev) => { $$invalidate('sidebar_button', sidebar_button = !ev.matches); }); let sidebar_active = false; function setPage(pageid) { let pg = pages.find(e => e.id === pageid); if (!pg) { throw new Error("Invalid Page " + pageid); } else { let url = new URL(window.location.href); url.hash = pg.id; window.history.pushState({}, pg.title, url); $$invalidate('page', page = getPage()); } $$invalidate('sidebar_active', sidebar_active = false); } let loading = true; function click_handler() { const $$result = sidebar_active = !sidebar_active; $$invalidate('sidebar_active', sidebar_active); return $$result; } function accountpage_loading_binding(value) { loading = value; $$invalidate('loading', loading); } function securitypage_loading_binding(value) { loading = value; $$invalidate('loading', loading); } return { pages, page, sidebar_button, sidebar_active, setPage, loading, click_handler, accountpage_loading_binding, securitypage_loading_binding }; } class App extends internal_103 { constructor(options) { super(options); internal_101(this, options, instance$6, create_fragment$6, internal_91, []); } } var app = new App({ target: document.getElementById("content") }); return app; }()); //# sourceMappingURL=bundle.js.map