function noop() { } function assign(tar, src) { // @ts-ignore for (const k in src) tar[k] = src[k]; return tar; } 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 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 null_to_empty(value) { return value == null ? '' : value; } function append(target, node) { target.appendChild(node); } function insert(target, node, anchor) { target.insertBefore(node, anchor || null); } function detach(node) { node.parentNode.removeChild(node); } 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 attr(node, attribute, value) { if (value == null) node.removeAttribute(attribute); else node.setAttribute(attribute, value); } 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 claim_space(nodes) { return claim_text(nodes, ' '); } function set_data(text, data) { data = '' + data; if (text.data !== data) text.data = data; } function set_input_value(input, value) { if (value != null || input.value) { input.value = value; } } function set_style(node, key, value, important) { node.style.setProperty(key, value, important ? 'important' : ''); } function toggle_class(element, name, toggle) { element.classList[toggle ? 'add' : 'remove'](name); } let current_component; function set_current_component(component) { current_component = component; } function get_current_component() { if (!current_component) throw new Error(`Function called outside component initialization`); return current_component; } function onMount(fn) { get_current_component().$$.on_mount.push(fn); } // 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 binding_callbacks = []; const render_callbacks = []; const flush_callbacks = []; const resolved_promise = Promise.resolve(); let update_scheduled = false; function schedule_update() { if (!update_scheduled) { update_scheduled = true; resolved_promise.then(flush); } } function add_render_callback(fn) { render_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.pop()(); // then, once components are updated, call // afterUpdate functions. This may cause // subsequent updates... for (let i = 0; i < render_callbacks.length; i += 1) { const callback = render_callbacks[i]; if (!seen_callbacks.has(callback)) { callback(); // ...so guard against infinite loops seen_callbacks.add(callback); } } render_callbacks.length = 0; } while (dirty_components.length); while (flush_callbacks.length) { flush_callbacks.pop()(); } update_scheduled = false; } function update($$) { if ($$.fragment) { $$.update($$.dirty); run_all($$.before_update); $$.fragment.p($$.dirty, $$.ctx); $$.dirty = null; $$.after_update.forEach(add_render_callback); } } const outroing = new Set(); let outros; function group_outros() { outros = { r: 0, c: [], p: outros // parent group }; } function check_outros() { if (!outros.r) { run_all(outros.c); } outros = outros.p; } function transition_in(block, local) { if (block && block.i) { outroing.delete(block); block.i(local); } } function transition_out(block, local, detach, callback) { if (block && block.o) { if (outroing.has(block)) return; outroing.add(block); outros.c.push(() => { outroing.delete(block); if (callback) { if (detach) block.d(1); callback(); } }); block.o(local); } } function mount_component(component, target, anchor) { const { fragment, on_mount, on_destroy, after_update } = component.$$; fragment.m(target, anchor); // onMount happens before the initial afterUpdate 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_update.forEach(add_render_callback); } function destroy_component(component, detaching) { if (component.$$.fragment) { 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 = blank_object(); } component.$$.dirty[key] = true; } function init(component, options, instance, create_fragment, not_equal, prop_names) { const parent_component = current_component; set_current_component(component); const props = options.props || {}; const $$ = component.$$ = { fragment: null, ctx: null, // state props: prop_names, update: noop, not_equal, bound: blank_object(), // lifecycle on_mount: [], on_destroy: [], before_update: [], after_update: [], context: new Map(parent_component ? parent_component.$$.context : []), // everything else callbacks: blank_object(), dirty: null }; let ready = false; $$.ctx = instance ? instance(component, props, (key, ret, value = ret) => { if ($$.ctx && not_equal($$.ctx[key], $$.ctx[key] = value)) { if ($$.bound[key]) $$.bound[key](value); if (ready) make_dirty(component, key); } return ret; }) : props; $$.update(); ready = true; run_all($$.before_update); $$.fragment = create_fragment($$.ctx); if (options.target) { if (options.hydrate) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion $$.fragment.l(children(options.target)); } else { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion $$.fragment.c(); } if (options.intro) transition_in(component.$$.fragment); mount_component(component, options.target, options.anchor); flush(); } set_current_component(parent_component); } let SvelteElement; if (typeof HTMLElement !== 'undefined') { SvelteElement = class extends HTMLElement { constructor() { super(); this.attachShadow({ mode: 'open' }); } connectedCallback() { // @ts-ignore todo: improve typings for (const key in this.$$.slotted) { // @ts-ignore todo: improve typings this.appendChild(this.$$.slotted[key]); } } attributeChangedCallback(attr, _oldValue, newValue) { this[attr] = newValue; } $destroy() { destroy_component(this, 1); 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_component(this, 1); 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 } } /* src\Button.svelte generated by Svelte v3.12.1 */ function add_css() { var style = element("style"); style.id = 'svelte-1q8lga0-style'; style.textContent = ".default.svelte-1q8lga0{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default.svelte-1q8lga0:active{background-color:#ddd}.default.svelte-1q8lga0:focus{border-color:#666}"; append(document.head, style); } // (30:4) {:else} function create_else_block(ctx) { var current; const default_slot_template = ctx.$$slots.default; const default_slot = create_slot(default_slot_template, ctx, null); return { c() { if (default_slot) default_slot.c(); }, l(nodes) { if (default_slot) default_slot.l(nodes); }, m(target, anchor) { if (default_slot) { default_slot.m(target, anchor); } current = true; }, p(changed, ctx) { if (default_slot && default_slot.p && changed.$$scope) { default_slot.p( get_slot_changes(default_slot_template, ctx, changed, null), get_slot_context(default_slot_template, ctx, null) ); } }, i(local) { if (current) return; transition_in(default_slot, local); current = true; }, o(local) { transition_out(default_slot, local); current = false; }, d(detaching) { if (default_slot) default_slot.d(detaching); } }; } // (28:26) function create_if_block_1(ctx) { var t; return { c() { t = text(ctx.contentText); }, l(nodes) { t = claim_text(nodes, ctx.contentText); }, m(target, anchor) { insert(target, t, anchor); }, p(changed, ctx) { if (changed.contentText) { set_data(t, ctx.contentText); } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(t); } } }; } // (25:4) {#if contentComponent && contentComponent._component} function create_if_block(ctx) { var div; return { c() { div = element("div"); }, l(nodes) { div = claim_element(nodes, "DIV", {}, false); var div_nodes = children(div); div_nodes.forEach(detach); }, m(target, anchor) { insert(target, div, anchor); ctx.div_binding(div); }, p: noop, i: noop, o: noop, d(detaching) { if (detaching) { detach(div); } ctx.div_binding(null); } }; } function create_fragment(ctx) { var button, current_block_type_index, if_block, button_class_value, current, dispose; var if_block_creators = [ create_if_block, create_if_block_1, create_else_block ]; var if_blocks = []; function select_block_type(changed, ctx) { if (ctx.contentComponent && ctx.contentComponent._component) return 0; if (ctx.contentText) return 1; return 2; } current_block_type_index = select_block_type(null, ctx); if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); return { c() { button = element("button"); if_block.c(); this.h(); }, l(nodes) { button = claim_element(nodes, "BUTTON", { class: true, disabled: true }, false); var button_nodes = children(button); if_block.l(button_nodes); button_nodes.forEach(detach); this.h(); }, h() { attr(button, "class", button_class_value = "" + null_to_empty(ctx.className) + " svelte-1q8lga0"); button.disabled = ctx.disabled; dispose = listen(button, "click", ctx.clickHandler); }, m(target, anchor) { insert(target, button, anchor); if_blocks[current_block_type_index].m(button, null); current = true; }, p(changed, ctx) { var previous_block_index = current_block_type_index; current_block_type_index = select_block_type(changed, ctx); if (current_block_type_index === previous_block_index) { if_blocks[current_block_type_index].p(changed, ctx); } else { group_outros(); transition_out(if_blocks[previous_block_index], 1, 1, () => { if_blocks[previous_block_index] = null; }); check_outros(); if_block = if_blocks[current_block_type_index]; if (!if_block) { if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); if_block.c(); } transition_in(if_block, 1); if_block.m(button, null); } if ((!current || changed.className) && button_class_value !== (button_class_value = "" + null_to_empty(ctx.className) + " svelte-1q8lga0")) { attr(button, "class", button_class_value); } if (!current || changed.disabled) { button.disabled = ctx.disabled; } }, i(local) { if (current) return; transition_in(if_block); current = true; }, o(local) { transition_out(if_block); current = false; }, d(detaching) { if (detaching) { detach(button); } if_blocks[current_block_type_index].d(); dispose(); } }; } function instance($$self, $$props, $$invalidate) { let { className = "default", disabled = false, contentText, contentComponent, onClick = () => {} } = $$props; let { _bb } = $$props; let contentComponentContainer; const clickHandler = () => { if(onClick) onClick(); }; let { $$slots = {}, $$scope } = $$props; function div_binding($$value) { binding_callbacks[$$value ? 'unshift' : 'push'](() => { $$invalidate('contentComponentContainer', contentComponentContainer = $$value); }); } $$self.$set = $$props => { if ('className' in $$props) $$invalidate('className', className = $$props.className); if ('disabled' in $$props) $$invalidate('disabled', disabled = $$props.disabled); if ('contentText' in $$props) $$invalidate('contentText', contentText = $$props.contentText); if ('contentComponent' in $$props) $$invalidate('contentComponent', contentComponent = $$props.contentComponent); if ('onClick' in $$props) $$invalidate('onClick', onClick = $$props.onClick); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); if ('$$scope' in $$props) $$invalidate('$$scope', $$scope = $$props.$$scope); }; $$self.$$.update = ($$dirty = { _bb: 1, contentComponentContainer: 1, contentComponent: 1 }) => { if ($$dirty._bb || $$dirty.contentComponentContainer || $$dirty.contentComponent) { { if(_bb && contentComponentContainer && contentComponent._component) _bb.initialiseComponent(contentComponent, contentComponentContainer); } } }; return { className, disabled, contentText, contentComponent, onClick, _bb, contentComponentContainer, clickHandler, div_binding, $$slots, $$scope }; } class Button extends SvelteComponent { constructor(options) { super(); if (!document.getElementById("svelte-1q8lga0-style")) add_css(); init(this, options, instance, create_fragment, safe_not_equal, ["className", "disabled", "contentText", "contentComponent", "onClick", "_bb"]); } } /* src\Textbox.svelte generated by Svelte v3.12.1 */ function add_css$1() { var style = element("style"); style.id = 'svelte-1ec4wqj-style'; style.textContent = ".default.svelte-1ec4wqj{width:100%;font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;width:100%}.default.svelte-1ec4wqj:disabled{color:#ccc}"; append(document.head, style); } // (32:0) {:else} function create_else_block$1(ctx) { var input, input_class_value; return { c() { input = element("input"); this.h(); }, l(nodes) { input = claim_element(nodes, "INPUT", { class: true, type: true, value: true }, false); var input_nodes = children(input); input_nodes.forEach(detach); this.h(); }, h() { attr(input, "class", input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj"); attr(input, "type", "text"); input.value = ctx.actualValue; }, m(target, anchor) { insert(target, input, anchor); }, p(changed, ctx) { if ((changed.className) && input_class_value !== (input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj")) { attr(input, "class", input_class_value); } if (changed.actualValue) { input.value = ctx.actualValue; } }, d(detaching) { if (detaching) { detach(input); } } }; } // (28:0) {#if hideValue} function create_if_block$1(ctx) { var input, input_class_value, dispose; return { c() { input = element("input"); this.h(); }, l(nodes) { input = claim_element(nodes, "INPUT", { class: true, type: true, value: true }, false); var input_nodes = children(input); input_nodes.forEach(detach); this.h(); }, h() { attr(input, "class", input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj"); attr(input, "type", "password"); input.value = ctx.actualValue; dispose = listen(input, "change", ctx.change_handler); }, m(target, anchor) { insert(target, input, anchor); }, p(changed, ctx) { if ((changed.className) && input_class_value !== (input_class_value = "" + null_to_empty(ctx.className) + " svelte-1ec4wqj")) { attr(input, "class", input_class_value); } if (changed.actualValue) { input.value = ctx.actualValue; } }, d(detaching) { if (detaching) { detach(input); } dispose(); } }; } function create_fragment$1(ctx) { var if_block_anchor; function select_block_type(changed, ctx) { if (ctx.hideValue) return create_if_block$1; return create_else_block$1; } var current_block_type = select_block_type(null, ctx); var if_block = current_block_type(ctx); return { c() { if_block.c(); if_block_anchor = empty(); }, l(nodes) { if_block.l(nodes); if_block_anchor = empty(); }, m(target, anchor) { if_block.m(target, anchor); insert(target, if_block_anchor, anchor); }, p(changed, ctx) { if (current_block_type === (current_block_type = select_block_type(changed, ctx)) && if_block) { if_block.p(changed, ctx); } else { if_block.d(1); if_block = current_block_type(ctx); if (if_block) { if_block.c(); if_block.m(if_block_anchor.parentNode, if_block_anchor); } } }, i: noop, o: noop, d(detaching) { if_block.d(detaching); if (detaching) { detach(if_block_anchor); } } }; } function instance$1($$self, $$props, $$invalidate) { let { value="", hideValue = false, className = "default", _bb } = $$props; let actualValue = ""; function change_handler(event) { bubble($$self, event); } $$self.$set = $$props => { if ('value' in $$props) $$invalidate('value', value = $$props.value); if ('hideValue' in $$props) $$invalidate('hideValue', hideValue = $$props.hideValue); if ('className' in $$props) $$invalidate('className', className = $$props.className); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; $$self.$$.update = ($$dirty = { _bb: 1, value: 1 }) => { if ($$dirty._bb || $$dirty.value) { { if(_bb && value._isstate) { _bb.store.subscribe(s => { $$invalidate('actualValue', actualValue = _bb.store.getValue(s, value)); }); } } } }; return { value, hideValue, className, _bb, actualValue, change_handler }; } class Textbox extends SvelteComponent { constructor(options) { super(); if (!document.getElementById("svelte-1ec4wqj-style")) add_css$1(); init(this, options, instance$1, create_fragment$1, safe_not_equal, ["value", "hideValue", "className", "_bb"]); } } /* src\Form.svelte generated by Svelte v3.12.1 */ function add_css$2() { var style = element("style"); style.id = 'svelte-m9d6ue-style'; style.textContent = ".form-root.svelte-m9d6ue{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-m9d6ue{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-m9d6ue{grid-column-start:control;padding:5px 10px}.overflow.svelte-m9d6ue{grid-column-start:overflow}.full-width.svelte-m9d6ue{width:100%}"; append(document.head, style); } function get_each_context(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.child = list[i]; child_ctx.index = i; return child_ctx; } // (30:4) {#each formControls as child, index} function create_each_block(ctx) { var div0, t0_value = ctx.labels[ctx.index] + "", t0, t1, div1, index = ctx.index; const assign_div1 = () => ctx.div1_binding(div1, index); const unassign_div1 = () => ctx.div1_binding(null, index); return { c() { div0 = element("div"); t0 = text(t0_value); t1 = space(); div1 = element("div"); this.h(); }, l(nodes) { div0 = claim_element(nodes, "DIV", { class: true }, false); var div0_nodes = children(div0); t0 = claim_text(div0_nodes, t0_value); div0_nodes.forEach(detach); t1 = claim_space(nodes); div1 = claim_element(nodes, "DIV", { class: true }, false); var div1_nodes = children(div1); div1_nodes.forEach(detach); this.h(); }, h() { attr(div0, "class", "label svelte-m9d6ue"); attr(div1, "class", "control svelte-m9d6ue"); }, m(target, anchor) { insert(target, div0, anchor); append(div0, t0); insert(target, t1, anchor); insert(target, div1, anchor); assign_div1(); }, p(changed, new_ctx) { ctx = new_ctx; if ((changed.labels) && t0_value !== (t0_value = ctx.labels[ctx.index] + "")) { set_data(t0, t0_value); } if (index !== ctx.index) { unassign_div1(); index = ctx.index; assign_div1(); } }, d(detaching) { if (detaching) { detach(div0); detach(t1); detach(div1); } unassign_div1(); } }; } function create_fragment$2(ctx) { var div, div_class_value; let each_value = ctx.formControls; let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); } return { c() { div = element("div"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } this.h(); }, l(nodes) { div = claim_element(nodes, "DIV", { class: true }, false); var div_nodes = children(div); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].l(div_nodes); } div_nodes.forEach(detach); this.h(); }, h() { attr(div, "class", div_class_value = "form-root " + ctx.containerClass + " svelte-m9d6ue"); }, m(target, anchor) { insert(target, div, anchor); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div, null); } }, p(changed, ctx) { if (changed.htmlElements || changed.labels || changed.formControls) { each_value = ctx.formControls; let i; for (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(div, null); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value.length; } if ((changed.containerClass) && div_class_value !== (div_class_value = "form-root " + ctx.containerClass + " svelte-m9d6ue")) { attr(div, "class", div_class_value); } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div); } destroy_each(each_blocks, detaching); } }; } function instance$2($$self, $$props, $$invalidate) { let { containerClass = "", formControls = [], _bb } = $$props; let htmlElements = {}; let labels = {}; function div1_binding($$value, index) { if (htmlElements[index] === $$value) return; binding_callbacks[$$value ? 'unshift' : 'push'](() => { htmlElements[index] = $$value; $$invalidate('htmlElements', htmlElements); }); } $$self.$set = $$props => { if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass); if ('formControls' in $$props) $$invalidate('formControls', formControls = $$props.formControls); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; $$self.$$.update = ($$dirty = { formControls: 1, _bb: 1, htmlElements: 1 }) => { if ($$dirty.formControls || $$dirty._bb || $$dirty.htmlElements) { { let cIndex = 0; for(let c of formControls) { $$invalidate('labels', labels[cIndex] = c.label, labels); cIndex++; } if(_bb && htmlElements) { for(let el in htmlElements) { _bb.initialiseComponent( formControls[el].control, htmlElements[el] ); } } } } }; return { containerClass, formControls, _bb, htmlElements, labels, div1_binding }; } class Form extends SvelteComponent { constructor(options) { super(); if (!document.getElementById("svelte-m9d6ue-style")) add_css$2(); init(this, options, instance$2, create_fragment$2, safe_not_equal, ["containerClass", "formControls", "_bb"]); } } /* src\Login.svelte generated by Svelte v3.12.1 */ function add_css$3() { var style = element("style"); style.id = 'svelte-crnq0a-style'; style.textContent = ".root.svelte-crnq0a{height:100%;display:grid;grid-template-columns:[left] 1fr [middle] auto [right] 1fr;grid-template-rows:[top] 1fr [center] auto [bottom] 1fr}.content.svelte-crnq0a{grid-column-start:middle;grid-row-start:center;width:400px}.logo-container.svelte-crnq0a{margin-bottom:20px\n}.logo-container.svelte-crnq0a>img.svelte-crnq0a{max-width:100%}.login-button-container.svelte-crnq0a{text-align:right;margin-top:20px}.incorrect-details-panel.svelte-crnq0a{margin-top:30px;padding:10px;border-style:solid;border-width:1px;border-color:maroon;border-radius:1px;text-align:center;color:maroon;background-color:mistyrose}.form-root.svelte-crnq0a{display:grid;grid-template-columns:[label] auto [control] 1fr}.label.svelte-crnq0a{grid-column-start:label;padding:5px 10px;vertical-align:middle}.control.svelte-crnq0a{grid-column-start:control;padding:5px 10px}.default-input.svelte-crnq0a{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;width:100%}.default-button.svelte-crnq0a{font-family:inherit;font-size:inherit;padding:0.4em;margin:0 0 0.5em 0;box-sizing:border-box;border:1px solid #ccc;border-radius:2px;color:#333;background-color:#f4f4f4;outline:none}.default-button.svelte-crnq0a:active{background-color:#ddd}.default-button.svelte-crnq0a:focus{border-color:#666}"; append(document.head, style); } // (57:8) {#if _logo} function create_if_block_1$1(ctx) { var div, img; return { c() { div = element("div"); img = element("img"); this.h(); }, l(nodes) { div = claim_element(nodes, "DIV", { class: true }, false); var div_nodes = children(div); img = claim_element(div_nodes, "IMG", { src: true, alt: true, class: true }, false); var img_nodes = children(img); img_nodes.forEach(detach); div_nodes.forEach(detach); this.h(); }, h() { attr(img, "src", ctx._logo); attr(img, "alt", "logo"); attr(img, "class", "svelte-crnq0a"); attr(div, "class", "logo-container svelte-crnq0a"); }, m(target, anchor) { insert(target, div, anchor); append(div, img); }, p(changed, ctx) { if (changed._logo) { attr(img, "src", ctx._logo); } }, d(detaching) { if (detaching) { detach(div); } } }; } // (86:8) {#if incorrect} function create_if_block$2(ctx) { var div, t; return { c() { div = element("div"); t = text("Incorrect username or password"); this.h(); }, l(nodes) { div = claim_element(nodes, "DIV", { class: true }, false); var div_nodes = children(div); t = claim_text(div_nodes, "Incorrect username or password"); div_nodes.forEach(detach); this.h(); }, h() { attr(div, "class", "incorrect-details-panel svelte-crnq0a"); }, m(target, anchor) { insert(target, div, anchor); append(div, t); }, d(detaching) { if (detaching) { detach(div); } } }; } function create_fragment$3(ctx) { var div7, div6, t0, div4, div0, t1, t2, div1, input0, input0_class_value, t3, div2, t4, t5, div3, input1, input1_class_value, t6, div5, button, t7, button_class_value, t8, dispose; var if_block0 = (ctx._logo) && create_if_block_1$1(ctx); var if_block1 = (ctx.incorrect) && create_if_block$2(); return { c() { div7 = element("div"); div6 = element("div"); if (if_block0) if_block0.c(); t0 = space(); div4 = element("div"); div0 = element("div"); t1 = text(ctx.usernameLabel); t2 = space(); div1 = element("div"); input0 = element("input"); t3 = space(); div2 = element("div"); t4 = text(ctx.passwordLabel); t5 = space(); div3 = element("div"); input1 = element("input"); t6 = space(); div5 = element("div"); button = element("button"); t7 = text(ctx.loginButtonLabel); t8 = space(); if (if_block1) if_block1.c(); this.h(); }, l(nodes) { div7 = claim_element(nodes, "DIV", { class: true }, false); var div7_nodes = children(div7); div6 = claim_element(div7_nodes, "DIV", { class: true }, false); var div6_nodes = children(div6); if (if_block0) if_block0.l(div6_nodes); t0 = claim_space(div6_nodes); div4 = claim_element(div6_nodes, "DIV", { class: true }, false); var div4_nodes = children(div4); div0 = claim_element(div4_nodes, "DIV", { class: true }, false); var div0_nodes = children(div0); t1 = claim_text(div0_nodes, ctx.usernameLabel); div0_nodes.forEach(detach); t2 = claim_space(div4_nodes); div1 = claim_element(div4_nodes, "DIV", { class: true }, false); var div1_nodes = children(div1); input0 = claim_element(div1_nodes, "INPUT", { type: true, class: true }, false); var input0_nodes = children(input0); input0_nodes.forEach(detach); div1_nodes.forEach(detach); t3 = claim_space(div4_nodes); div2 = claim_element(div4_nodes, "DIV", { class: true }, false); var div2_nodes = children(div2); t4 = claim_text(div2_nodes, ctx.passwordLabel); div2_nodes.forEach(detach); t5 = claim_space(div4_nodes); div3 = claim_element(div4_nodes, "DIV", { class: true }, false); var div3_nodes = children(div3); input1 = claim_element(div3_nodes, "INPUT", { type: true, class: true }, false); var input1_nodes = children(input1); input1_nodes.forEach(detach); div3_nodes.forEach(detach); div4_nodes.forEach(detach); t6 = claim_space(div6_nodes); div5 = claim_element(div6_nodes, "DIV", { class: true }, false); var div5_nodes = children(div5); button = claim_element(div5_nodes, "BUTTON", { disabled: true, class: true }, false); var button_nodes = children(button); t7 = claim_text(button_nodes, ctx.loginButtonLabel); button_nodes.forEach(detach); div5_nodes.forEach(detach); t8 = claim_space(div6_nodes); if (if_block1) if_block1.l(div6_nodes); div6_nodes.forEach(detach); div7_nodes.forEach(detach); this.h(); }, h() { attr(div0, "class", "label svelte-crnq0a"); attr(input0, "type", "text"); attr(input0, "class", input0_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a"); attr(div1, "class", "control svelte-crnq0a"); attr(div2, "class", "label svelte-crnq0a"); attr(input1, "type", "password"); attr(input1, "class", input1_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a"); attr(div3, "class", "control svelte-crnq0a"); attr(div4, "class", "form-root svelte-crnq0a"); button.disabled = ctx.busy; attr(button, "class", button_class_value = "" + null_to_empty(ctx._buttonClass) + " svelte-crnq0a"); attr(div5, "class", "login-button-container svelte-crnq0a"); attr(div6, "class", "content svelte-crnq0a"); attr(div7, "class", "root svelte-crnq0a"); dispose = [ listen(input0, "input", ctx.input0_input_handler), listen(input1, "input", ctx.input1_input_handler), listen(button, "click", ctx.login) ]; }, m(target, anchor) { insert(target, div7, anchor); append(div7, div6); if (if_block0) if_block0.m(div6, null); append(div6, t0); append(div6, div4); append(div4, div0); append(div0, t1); append(div4, t2); append(div4, div1); append(div1, input0); set_input_value(input0, ctx.username); append(div4, t3); append(div4, div2); append(div2, t4); append(div4, t5); append(div4, div3); append(div3, input1); set_input_value(input1, ctx.password); append(div6, t6); append(div6, div5); append(div5, button); append(button, t7); append(div6, t8); if (if_block1) if_block1.m(div6, null); }, p(changed, ctx) { if (ctx._logo) { if (if_block0) { if_block0.p(changed, ctx); } else { if_block0 = create_if_block_1$1(ctx); if_block0.c(); if_block0.m(div6, t0); } } else if (if_block0) { if_block0.d(1); if_block0 = null; } if (changed.usernameLabel) { set_data(t1, ctx.usernameLabel); } if (changed.username && (input0.value !== ctx.username)) set_input_value(input0, ctx.username); if ((changed._inputClass) && input0_class_value !== (input0_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a")) { attr(input0, "class", input0_class_value); } if (changed.passwordLabel) { set_data(t4, ctx.passwordLabel); } if (changed.password && (input1.value !== ctx.password)) set_input_value(input1, ctx.password); if ((changed._inputClass) && input1_class_value !== (input1_class_value = "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a")) { attr(input1, "class", input1_class_value); } if (changed.loginButtonLabel) { set_data(t7, ctx.loginButtonLabel); } if (changed.busy) { button.disabled = ctx.busy; } if ((changed._buttonClass) && button_class_value !== (button_class_value = "" + null_to_empty(ctx._buttonClass) + " svelte-crnq0a")) { attr(button, "class", button_class_value); } if (ctx.incorrect) { if (!if_block1) { if_block1 = create_if_block$2(); if_block1.c(); if_block1.m(div6, null); } } else if (if_block1) { if_block1.d(1); if_block1 = null; } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div7); } if (if_block0) if_block0.d(); if (if_block1) if_block1.d(); run_all(dispose); } }; } function instance$3($$self, $$props, $$invalidate) { let { usernameLabel = "Username", passwordLabel = "Password", loginButtonLabel = "Login", loginRedirect = "", logo = "", buttonClass = "", inputClass="", _bb } = $$props; let username = ""; let password = ""; let busy = false; let incorrect = false; let _logo = ""; let _buttonClass = ""; let _inputClass = ""; const login = () => { $$invalidate('busy', busy = true); _bb.api.post("/api/authenticate", {username, password}) .then(r => { $$invalidate('busy', busy = false); if(r.status === 200) { return r.json(); } else { $$invalidate('incorrect', incorrect = true); return; } }) .then(user => { if(user) { localStorage.setItem("budibase:user", user); location.reload(); } }); }; function input0_input_handler() { username = this.value; $$invalidate('username', username); } function input1_input_handler() { password = this.value; $$invalidate('password', password); } $$self.$set = $$props => { if ('usernameLabel' in $$props) $$invalidate('usernameLabel', usernameLabel = $$props.usernameLabel); if ('passwordLabel' in $$props) $$invalidate('passwordLabel', passwordLabel = $$props.passwordLabel); if ('loginButtonLabel' in $$props) $$invalidate('loginButtonLabel', loginButtonLabel = $$props.loginButtonLabel); if ('loginRedirect' in $$props) $$invalidate('loginRedirect', loginRedirect = $$props.loginRedirect); if ('logo' in $$props) $$invalidate('logo', logo = $$props.logo); if ('buttonClass' in $$props) $$invalidate('buttonClass', buttonClass = $$props.buttonClass); if ('inputClass' in $$props) $$invalidate('inputClass', inputClass = $$props.inputClass); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; $$self.$$.update = ($$dirty = { _bb: 1, logo: 1, buttonClass: 1, inputClass: 1 }) => { if ($$dirty._bb || $$dirty.logo || $$dirty.buttonClass || $$dirty.inputClass) { { $$invalidate('_logo', _logo = _bb.relativeUrl(logo)); $$invalidate('_buttonClass', _buttonClass = buttonClass || "default-button"); $$invalidate('_inputClass', _inputClass = inputClass || "default-input"); } } }; return { usernameLabel, passwordLabel, loginButtonLabel, loginRedirect, logo, buttonClass, inputClass, _bb, username, password, busy, incorrect, _logo, _buttonClass, _inputClass, login, input0_input_handler, input1_input_handler }; } class Login extends SvelteComponent { constructor(options) { super(); if (!document.getElementById("svelte-crnq0a-style")) add_css$3(); init(this, options, instance$3, create_fragment$3, safe_not_equal, ["usernameLabel", "passwordLabel", "loginButtonLabel", "loginRedirect", "logo", "buttonClass", "inputClass", "_bb"]); } } const buildStyle = (styles) => { let str = ""; for(let s in styles) { if(styles[s]) { str += `${s}: ${styles[s]}; `; } } return str; }; /* src\Grid.svelte generated by Svelte v3.12.1 */ function add_css$4() { var style = element("style"); style.id = 'svelte-10kw8to-style'; style.textContent = ".root.svelte-10kw8to{display:grid}"; append(document.head, style); } function get_each_context$1(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.child = list[i]; child_ctx.index = i; return child_ctx; } // (49:4) {#each children as child, index} function create_each_block$1(ctx) { var div, index = ctx.index, div_class_value, div_style_value; const assign_div = () => ctx.div_binding(div, index); const unassign_div = () => ctx.div_binding(null, index); return { c() { div = element("div"); this.h(); }, l(nodes) { div = claim_element(nodes, "DIV", { class: true, style: true }, false); var div_nodes = children(div); div_nodes.forEach(detach); this.h(); }, h() { attr(div, "class", div_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-10kw8to"); attr(div, "style", div_style_value = ctx.childStyle(ctx.child)); }, m(target, anchor) { insert(target, div, anchor); assign_div(); }, p(changed, new_ctx) { ctx = new_ctx; if (index !== ctx.index) { unassign_div(); index = ctx.index; assign_div(); } if ((changed.itemContainerClass) && div_class_value !== (div_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-10kw8to")) { attr(div, "class", div_class_value); } if ((changed.children) && div_style_value !== (div_style_value = ctx.childStyle(ctx.child))) { attr(div, "style", div_style_value); } }, d(detaching) { if (detaching) { detach(div); } unassign_div(); } }; } function create_fragment$4(ctx) { var div, div_class_value; let each_value = ctx.children; let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i)); } return { c() { div = element("div"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } this.h(); }, l(nodes) { div = claim_element(nodes, "DIV", { class: true, style: true }, false); var div_nodes = children(div); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].l(div_nodes); } div_nodes.forEach(detach); this.h(); }, h() { attr(div, "class", div_class_value = "root " + ctx.containerClass + " svelte-10kw8to"); set_style(div, "width", ctx.width); set_style(div, "height", ctx.height); set_style(div, "grid-template-columns", ctx.gridTemplateColumns); set_style(div, "grid-template-rows", ctx.gridTemplateRows); }, m(target, anchor) { insert(target, div, anchor); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div, null); } }, p(changed, ctx) { if (changed.itemContainerClass || changed.childStyle || changed.children || changed.htmlElements) { each_value = ctx.children; let i; for (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); } else { each_blocks[i] = create_each_block$1(child_ctx); each_blocks[i].c(); each_blocks[i].m(div, null); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value.length; } if ((changed.containerClass) && div_class_value !== (div_class_value = "root " + ctx.containerClass + " svelte-10kw8to")) { attr(div, "class", div_class_value); } if (changed.width) { set_style(div, "width", ctx.width); } if (changed.height) { set_style(div, "height", ctx.height); } if (changed.gridTemplateColumns) { set_style(div, "grid-template-columns", ctx.gridTemplateColumns); } if (changed.gridTemplateRows) { set_style(div, "grid-template-rows", ctx.gridTemplateRows); } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div); } destroy_each(each_blocks, detaching); } }; } function instance$4($$self, $$props, $$invalidate) { let { gridTemplateRows ="", gridTemplateColumns ="", children = [], width = "auto", height = "auto", containerClass="", itemContainerClass="", _bb } = $$props; let htmlElements = {}; const childStyle = child => buildStyle({ "grid-column-start": child.gridColumnStart, "grid-column-end": child.gridColumnEnd, "grid-column": child.gridColumn, "grid-row-start": child.gridRowStart, "grid-row-end": child.gridRowStart, "grid-row": child.gridRow, }); function div_binding($$value, index) { if (htmlElements[index] === $$value) return; binding_callbacks[$$value ? 'unshift' : 'push'](() => { htmlElements[index] = $$value; $$invalidate('htmlElements', htmlElements); }); } $$self.$set = $$props => { if ('gridTemplateRows' in $$props) $$invalidate('gridTemplateRows', gridTemplateRows = $$props.gridTemplateRows); if ('gridTemplateColumns' in $$props) $$invalidate('gridTemplateColumns', gridTemplateColumns = $$props.gridTemplateColumns); if ('children' in $$props) $$invalidate('children', children = $$props.children); if ('width' in $$props) $$invalidate('width', width = $$props.width); if ('height' in $$props) $$invalidate('height', height = $$props.height); if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass); if ('itemContainerClass' in $$props) $$invalidate('itemContainerClass', itemContainerClass = $$props.itemContainerClass); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; $$self.$$.update = ($$dirty = { _bb: 1, htmlElements: 1, children: 1 }) => { if ($$dirty._bb || $$dirty.htmlElements || $$dirty.children) { { if(_bb && htmlElements) { for(let el in htmlElements) { _bb.initialiseComponent( children[el].control, htmlElements[el] ); } } } } }; return { gridTemplateRows, gridTemplateColumns, children, width, height, containerClass, itemContainerClass, _bb, htmlElements, childStyle, div_binding }; } class Grid extends SvelteComponent { constructor(options) { super(); if (!document.getElementById("svelte-10kw8to-style")) add_css$4(); init(this, options, instance$4, create_fragment$4, safe_not_equal, ["gridTemplateRows", "gridTemplateColumns", "children", "width", "height", "containerClass", "itemContainerClass", "_bb"]); } } /* src\StackPanel.svelte generated by Svelte v3.12.1 */ function add_css$5() { var style = element("style"); style.id = 'svelte-osi0db-style'; style.textContent = ".horizontal.svelte-osi0db{display:inline-block}.vertical.svelte-osi0db{display:block}"; append(document.head, style); } function get_each_context$2(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.child = list[i]; child_ctx.index = i; return child_ctx; } // (32:4) {#each children as child, index} function create_each_block$2(ctx) { var div1, div0, index = ctx.index, div0_class_value, t, div1_class_value; const assign_div0 = () => ctx.div0_binding(div0, index); const unassign_div0 = () => ctx.div0_binding(null, index); return { c() { div1 = element("div"); div0 = element("div"); t = space(); this.h(); }, l(nodes) { div1 = claim_element(nodes, "DIV", { class: true }, false); var div1_nodes = children(div1); div0 = claim_element(div1_nodes, "DIV", { class: true }, false); var div0_nodes = children(div0); div0_nodes.forEach(detach); t = claim_space(div1_nodes); div1_nodes.forEach(detach); this.h(); }, h() { attr(div0, "class", div0_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db"); attr(div1, "class", div1_class_value = "" + null_to_empty(ctx.direction) + " svelte-osi0db"); }, m(target, anchor) { insert(target, div1, anchor); append(div1, div0); assign_div0(); append(div1, t); }, p(changed, new_ctx) { ctx = new_ctx; if (index !== ctx.index) { unassign_div0(); index = ctx.index; assign_div0(); } if ((changed.itemContainerClass) && div0_class_value !== (div0_class_value = "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db")) { attr(div0, "class", div0_class_value); } if ((changed.direction) && div1_class_value !== (div1_class_value = "" + null_to_empty(ctx.direction) + " svelte-osi0db")) { attr(div1, "class", div1_class_value); } }, d(detaching) { if (detaching) { detach(div1); } unassign_div0(); } }; } function create_fragment$5(ctx) { var div, div_class_value; let each_value = ctx.children; let each_blocks = []; for (let 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() { div = element("div"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } this.h(); }, l(nodes) { div = claim_element(nodes, "DIV", { class: true, style: true }, false); var div_nodes = children(div); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].l(div_nodes); } div_nodes.forEach(detach); this.h(); }, h() { attr(div, "class", div_class_value = "root " + ctx.containerClass + " svelte-osi0db"); set_style(div, "width", ctx.width); set_style(div, "height", ctx.height); }, m(target, anchor) { insert(target, div, anchor); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div, null); } }, p(changed, ctx) { if (changed.direction || changed.itemContainerClass || changed.htmlElements || changed.children) { each_value = ctx.children; let i; for (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(div, null); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value.length; } if ((changed.containerClass) && div_class_value !== (div_class_value = "root " + ctx.containerClass + " svelte-osi0db")) { attr(div, "class", div_class_value); } if (changed.width) { set_style(div, "width", ctx.width); } if (changed.height) { set_style(div, "height", ctx.height); } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div); } destroy_each(each_blocks, detaching); } }; } function instance$5($$self, $$props, $$invalidate) { let { direction = "horizontal", children = [], width = "auto", height = "auto", containerClass="", itemContainerClass="", _bb } = $$props; let htmlElements = {}; onMount(() => { if(_bb && htmlElements) { for(let el in htmlElements) { _bb.initialiseComponent( children[el].control, htmlElements[el] ); } } }); function div0_binding($$value, index) { if (htmlElements[index] === $$value) return; binding_callbacks[$$value ? 'unshift' : 'push'](() => { htmlElements[index] = $$value; $$invalidate('htmlElements', htmlElements); }); } $$self.$set = $$props => { if ('direction' in $$props) $$invalidate('direction', direction = $$props.direction); if ('children' in $$props) $$invalidate('children', children = $$props.children); if ('width' in $$props) $$invalidate('width', width = $$props.width); if ('height' in $$props) $$invalidate('height', height = $$props.height); if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass); if ('itemContainerClass' in $$props) $$invalidate('itemContainerClass', itemContainerClass = $$props.itemContainerClass); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; return { direction, children, width, height, containerClass, itemContainerClass, _bb, htmlElements, div0_binding }; } class StackPanel extends SvelteComponent { constructor(options) { super(); if (!document.getElementById("svelte-osi0db-style")) add_css$5(); init(this, options, instance$5, create_fragment$5, safe_not_equal, ["direction", "children", "width", "height", "containerClass", "itemContainerClass", "_bb"]); } } // https://github.com/kaisermann/svelte-css-vars var cssVars = (node, props) => { Object.entries(props).forEach(([key, value]) => { node.style.setProperty(`--${key}`, value); }); return { update(new_props) { Object.entries(new_props).forEach(([key, value]) => { node.style.setProperty(`--${key}`, value); delete props[key]; }); Object.keys(props).forEach(name => node.style.removeProperty(`--${name}`), ); props = new_props; }, }; }; /* src\Nav.svelte generated by Svelte v3.12.1 */ function add_css$6() { var style = element("style"); style.id = 'svelte-aihwli-style'; style.textContent = ".root.svelte-aihwli{height:100%;width:100%;grid-template-columns:[navbar] auto [content] 1fr;display:grid}.navbar.svelte-aihwli{grid-column:navbar;background:var(--navBarBackground);border:var(--navBarBorder);color:var(--navBarColor)}.navitem.svelte-aihwli{padding:10px 17px;cursor:pointer}.navitem.svelte-aihwli:hover{background:var(--itemHoverBackground);color:var(--itemHoverColor)}.navitem.selected.svelte-aihwli{background:var(--selectedItemBackground);border:var(--selectedItemBorder);color:var(--selectedItemColor)}.content.svelte-aihwli{grid-column:content}"; append(document.head, style); } function get_each_context$3(ctx, list, i) { const child_ctx = Object.create(ctx); child_ctx.navItem = list[i]; child_ctx.index = i; return child_ctx; } // (36:8) {#each items as navItem, index} function create_each_block$3(ctx) { var div, t0_value = ctx.navItem.title + "", t0, t1, dispose; return { c() { div = element("div"); t0 = text(t0_value); t1 = space(); this.h(); }, l(nodes) { div = claim_element(nodes, "DIV", { class: true }, false); var div_nodes = children(div); t0 = claim_text(div_nodes, t0_value); t1 = claim_space(div_nodes); div_nodes.forEach(detach); this.h(); }, h() { attr(div, "class", "navitem svelte-aihwli"); toggle_class(div, "selected", ctx.selectedIndex === ctx.index); dispose = listen(div, "click", ctx.onSelectItem(ctx.index)); }, m(target, anchor) { insert(target, div, anchor); append(div, t0); append(div, t1); }, p(changed, new_ctx) { ctx = new_ctx; if ((changed.items) && t0_value !== (t0_value = ctx.navItem.title + "")) { set_data(t0, t0_value); } if (changed.selectedIndex) { toggle_class(div, "selected", ctx.selectedIndex === ctx.index); } }, d(detaching) { if (detaching) { detach(div); } dispose(); } }; } function create_fragment$6(ctx) { var div2, div0, t, div1, cssVars_action; let each_value = ctx.items; let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i)); } return { c() { div2 = element("div"); div0 = element("div"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } t = space(); div1 = element("div"); this.h(); }, l(nodes) { div2 = claim_element(nodes, "DIV", { class: true }, false); var div2_nodes = children(div2); div0 = claim_element(div2_nodes, "DIV", { class: true }, false); var div0_nodes = children(div0); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].l(div0_nodes); } div0_nodes.forEach(detach); t = claim_space(div2_nodes); div1 = claim_element(div2_nodes, "DIV", { class: true }, false); var div1_nodes = children(div1); div1_nodes.forEach(detach); div2_nodes.forEach(detach); this.h(); }, h() { attr(div0, "class", "navbar svelte-aihwli"); attr(div1, "class", "content svelte-aihwli"); attr(div2, "class", "root svelte-aihwli"); }, m(target, anchor) { insert(target, div2, anchor); append(div2, div0); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].m(div0, null); } append(div2, t); append(div2, div1); ctx.div1_binding(div1); cssVars_action = cssVars.call(null, div2, ctx.styleVars) || {}; }, p(changed, ctx) { if (changed.selectedIndex || changed.items) { each_value = ctx.items; let i; for (i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context$3(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(changed, child_ctx); } else { each_blocks[i] = create_each_block$3(child_ctx); each_blocks[i].c(); each_blocks[i].m(div0, null); } } for (; i < each_blocks.length; i += 1) { each_blocks[i].d(1); } each_blocks.length = each_value.length; } if (typeof cssVars_action.update === 'function' && changed.styleVars) { cssVars_action.update.call(null, ctx.styleVars); } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div2); } destroy_each(each_blocks, detaching); ctx.div1_binding(null); if (cssVars_action && typeof cssVars_action.destroy === 'function') cssVars_action.destroy(); } }; } function instance$6($$self, $$props, $$invalidate) { let { navBarBackground = "", navBarBorder="", navBarColor="", selectedItemBackground="", selectedItemColor="", selectedItemBorder="", itemHoverBackground="", itemHoverColor="", items = [], _bb } = $$props; let selectedIndex; let contentElement; const onSelectItem = (index) => () => { $$invalidate('selectedIndex', selectedIndex = index); _bb.initialiseComponent(items[index].component, contentElement); }; function div1_binding($$value) { binding_callbacks[$$value ? 'unshift' : 'push'](() => { $$invalidate('contentElement', contentElement = $$value); }); } $$self.$set = $$props => { if ('navBarBackground' in $$props) $$invalidate('navBarBackground', navBarBackground = $$props.navBarBackground); if ('navBarBorder' in $$props) $$invalidate('navBarBorder', navBarBorder = $$props.navBarBorder); if ('navBarColor' in $$props) $$invalidate('navBarColor', navBarColor = $$props.navBarColor); if ('selectedItemBackground' in $$props) $$invalidate('selectedItemBackground', selectedItemBackground = $$props.selectedItemBackground); if ('selectedItemColor' in $$props) $$invalidate('selectedItemColor', selectedItemColor = $$props.selectedItemColor); if ('selectedItemBorder' in $$props) $$invalidate('selectedItemBorder', selectedItemBorder = $$props.selectedItemBorder); if ('itemHoverBackground' in $$props) $$invalidate('itemHoverBackground', itemHoverBackground = $$props.itemHoverBackground); if ('itemHoverColor' in $$props) $$invalidate('itemHoverColor', itemHoverColor = $$props.itemHoverColor); if ('items' in $$props) $$invalidate('items', items = $$props.items); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; let styleVars; $$self.$$.update = ($$dirty = { navBarBackground: 1, navBarBorder: 1, navBarColor: 1, selectedItemBackground: 1, selectedItemColor: 1, selectedItemBorder: 1, itemHoverBackground: 1, itemHoverColor: 1 }) => { if ($$dirty.navBarBackground || $$dirty.navBarBorder || $$dirty.navBarColor || $$dirty.selectedItemBackground || $$dirty.selectedItemColor || $$dirty.selectedItemBorder || $$dirty.itemHoverBackground || $$dirty.itemHoverColor) { $$invalidate('styleVars', styleVars = { navBarBackground, navBarBorder, navBarColor, selectedItemBackground, selectedItemColor, selectedItemBorder, itemHoverBackground, itemHoverColor }); } }; return { navBarBackground, navBarBorder, navBarColor, selectedItemBackground, selectedItemColor, selectedItemBorder, itemHoverBackground, itemHoverColor, items, _bb, selectedIndex, contentElement, onSelectItem, styleVars, div1_binding }; } class Nav extends SvelteComponent { constructor(options) { super(); if (!document.getElementById("svelte-aihwli-style")) add_css$6(); init(this, options, instance$6, create_fragment$6, safe_not_equal, ["navBarBackground", "navBarBorder", "navBarColor", "selectedItemBackground", "selectedItemColor", "selectedItemBorder", "itemHoverBackground", "itemHoverColor", "items", "_bb"]); } } /* src\Panel.svelte generated by Svelte v3.12.1 */ function create_fragment$7(ctx) { var div, t; return { c() { div = element("div"); t = text(ctx.text); this.h(); }, l(nodes) { div = claim_element(nodes, "DIV", { class: true, style: true, "this:bind": true }, false); var div_nodes = children(div); t = claim_text(div_nodes, ctx.text); div_nodes.forEach(detach); this.h(); }, h() { attr(div, "class", ctx.containerClass); attr(div, "style", ctx.style); attr(div, "this:bind", ctx.componentElement); }, m(target, anchor) { insert(target, div, anchor); append(div, t); }, p(changed, ctx) { if (changed.text) { set_data(t, ctx.text); } if (changed.containerClass) { attr(div, "class", ctx.containerClass); } if (changed.style) { attr(div, "style", ctx.style); } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div); } } }; } function instance$7($$self, $$props, $$invalidate) { let { component="", text="", containerClass="", background="", border="", borderRadius="", font="", display="", textAlign="", color="", padding="", _bb } = $$props; let style=""; let componentElement; $$self.$set = $$props => { if ('component' in $$props) $$invalidate('component', component = $$props.component); if ('text' in $$props) $$invalidate('text', text = $$props.text); if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass); if ('background' in $$props) $$invalidate('background', background = $$props.background); if ('border' in $$props) $$invalidate('border', border = $$props.border); if ('borderRadius' in $$props) $$invalidate('borderRadius', borderRadius = $$props.borderRadius); if ('font' in $$props) $$invalidate('font', font = $$props.font); if ('display' in $$props) $$invalidate('display', display = $$props.display); if ('textAlign' in $$props) $$invalidate('textAlign', textAlign = $$props.textAlign); if ('color' in $$props) $$invalidate('color', color = $$props.color); if ('padding' in $$props) $$invalidate('padding', padding = $$props.padding); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; $$self.$$.update = ($$dirty = { border: 1, background: 1, font: 1, padding: 1, display: 1, color: 1, textAlign: 1, borderRadius: 1, _bb: 1, component: 1, componentElement: 1 }) => { if ($$dirty.border || $$dirty.background || $$dirty.font || $$dirty.padding || $$dirty.display || $$dirty.color || $$dirty.textAlign || $$dirty.borderRadius || $$dirty._bb || $$dirty.component || $$dirty.componentElement) { { $$invalidate('style', style=buildStyle({ border, background, font, padding, display, color, "text-align": textAlign, "border-radius":borderRadius })); if(_bb && component) { _bb.initialiseComponent(component, componentElement); } } } }; return { component, text, containerClass, background, border, borderRadius, font, display, textAlign, color, padding, _bb, style, componentElement }; } class Panel extends SvelteComponent { constructor(options) { super(); init(this, options, instance$7, create_fragment$7, safe_not_equal, ["component", "text", "containerClass", "background", "border", "borderRadius", "font", "display", "textAlign", "color", "padding", "_bb"]); } } /* src\Text.svelte generated by Svelte v3.12.1 */ function create_fragment$8(ctx) { var div, t; return { c() { div = element("div"); t = text(ctx.value); this.h(); }, l(nodes) { div = claim_element(nodes, "DIV", { class: true, style: true }, false); var div_nodes = children(div); t = claim_text(div_nodes, ctx.value); div_nodes.forEach(detach); this.h(); }, h() { attr(div, "class", ctx.containerClass); attr(div, "style", ctx.style); }, m(target, anchor) { insert(target, div, anchor); append(div, t); }, p(changed, ctx) { if (changed.value) { set_data(t, ctx.value); } if (changed.containerClass) { attr(div, "class", ctx.containerClass); } if (changed.style) { attr(div, "style", ctx.style); } }, i: noop, o: noop, d(detaching) { if (detaching) { detach(div); } } }; } function instance$8($$self, $$props, $$invalidate) { let { value="", containerClass="", font="", textAlign="", verticalAlign="", color="", display="", _bb } = $$props; let style=""; $$self.$set = $$props => { if ('value' in $$props) $$invalidate('value', value = $$props.value); if ('containerClass' in $$props) $$invalidate('containerClass', containerClass = $$props.containerClass); if ('font' in $$props) $$invalidate('font', font = $$props.font); if ('textAlign' in $$props) $$invalidate('textAlign', textAlign = $$props.textAlign); if ('verticalAlign' in $$props) $$invalidate('verticalAlign', verticalAlign = $$props.verticalAlign); if ('color' in $$props) $$invalidate('color', color = $$props.color); if ('display' in $$props) $$invalidate('display', display = $$props.display); if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); }; $$self.$$.update = ($$dirty = { font: 1, verticalAlign: 1, color: 1, textAlign: 1 }) => { if ($$dirty.font || $$dirty.verticalAlign || $$dirty.color || $$dirty.textAlign) { { $$invalidate('style', style=buildStyle({ font, verticalAlign, color, "text-align": textAlign, "vertical-align": verticalAlign })); } } }; return { value, containerClass, font, textAlign, verticalAlign, color, display, _bb, style }; } class Text extends SvelteComponent { constructor(options) { super(); init(this, options, instance$8, create_fragment$8, safe_not_equal, ["value", "containerClass", "font", "textAlign", "verticalAlign", "color", "display", "_bb"]); } } export { Button as button, Form as form, Grid as grid, Login as login, Nav as nav, Panel as panel, StackPanel as stackpanel, Text as text, Textbox as textbox }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbIi4uL25vZGVfbW9kdWxlcy9zdmVsdGUvaW50ZXJuYWwvaW5kZXgubWpzIiwiLi4vc3JjL0J1dHRvbi5zdmVsdGUiLCIuLi9zcmMvVGV4dGJveC5zdmVsdGUiLCIuLi9zcmMvRm9ybS5zdmVsdGUiLCIuLi9zcmMvTG9naW4uc3ZlbHRlIiwiLi4vc3JjL2J1aWxkU3R5bGUuanMiLCIuLi9zcmMvR3JpZC5zdmVsdGUiLCIuLi9zcmMvU3RhY2tQYW5lbC5zdmVsdGUiLCIuLi9zcmMvY3NzVmFycy5qcyIsIi4uL3NyYy9OYXYuc3ZlbHRlIiwiLi4vc3JjL1BhbmVsLnN2ZWx0ZSIsIi4uL3NyYy9UZXh0LnN2ZWx0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyJmdW5jdGlvbiBub29wKCkgeyB9XG5jb25zdCBpZGVudGl0eSA9IHggPT4geDtcbmZ1bmN0aW9uIGFzc2lnbih0YXIsIHNyYykge1xuICAgIC8vIEB0cy1pZ25vcmVcbiAgICBmb3IgKGNvbnN0IGsgaW4gc3JjKVxuICAgICAgICB0YXJba10gPSBzcmNba107XG4gICAgcmV0dXJuIHRhcjtcbn1cbmZ1bmN0aW9uIGlzX3Byb21pc2UodmFsdWUpIHtcbiAgICByZXR1cm4gdmFsdWUgJiYgdHlwZW9mIHZhbHVlID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgdmFsdWUudGhlbiA9PT0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zdGFydF90aW1lID0gbm93KCkgKyBkZWxheSwgXG4gICAgLy8gQHRzLWlnbm9yZSB0b2RvOlxuICAgIGVuZCA9IHN0YXJ0X3RpbWUgKyBkdXJhdGlvbiwgdGljayA9IG5vb3AsIGNzcyB9ID0gZm4obm9kZSwgeyBmcm9tLCB0byB9LCBwYXJhbXMpO1xuICAgIGxldCBydW5uaW5nID0gdHJ1ZTtcbiAgICBsZXQgc3RhcnRlZCA9IGZhbHNlO1xuICAgIGxldCBuYW1lO1xuICAgIGZ1bmN0aW9uIHN0YXJ0KCkge1xuICAgICAgICBpZiAoY3NzKSB7XG4gICAgICAgICAgICBuYW1lID0gY3JlYXRlX3J1bGUobm9kZSwgMCwgMSwgZHVyYXRpb24sIGRlbGF5LCBlYXNpbmcsIGNzcyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFkZWxheSkge1xuICAgICAgICAgICAgc3RhcnRlZCA9IHRydWU7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZnVuY3Rpb24gc3RvcCgpIHtcbiAgICAgICAgaWYgKGNzcylcbiAgICAgICAgICAgIGRlbGV0ZV9ydWxlKG5vZGUsIG5hbWUpO1xuICAgICAgICBydW5uaW5nID0gZmFsc2U7XG4gICAgfVxuICAgIGxvb3Aobm93ID0+IHtcbiAgICAgICAgaWYgKCFzdGFydGVkICYmIG5vdyA+PSBzdGFydF90aW1lKSB7XG4gICAgICAgICAgICBzdGFydGVkID0gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoc3RhcnRlZCAmJiBub3cgPj0gZW5kKSB7XG4gICAgICAgICAgICB0aWNrKDEsIDApO1xuICAgICAgICAgICAgc3RvcCgpO1xuICAgICAgICB9XG4gICAgICAgIGlmICghcnVubmluZykge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChzdGFydGVkKSB7XG4gICAgICAgICAgICBjb25zdCBwID0gbm93IC0gc3RhcnRfdGltZTtcbiA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biAgICBsZXQgdWlkID0gMDtcbiAgICBmdW5jdGlvbiBjbGVhbnVwKCkge1xuICAgICAgICBpZiAoYW5pbWF0aW9uX25hbWUpXG4gICAgICAgICAgICBkZWxldGVfcnVsZShub2RlLCBhbmltYXRpb25fbmFtZSk7XG4gICAgfVxuICAgIGZ1bmN0aW9uIGdvKCkge1xuICAgICAgICBjb25zdCB7IGRlbGF5ID0gMCwgZHVyYXRpb24gPSAzMDAsIGVhc2luZyA9IGlkZW50aXR5LCB0aWNrID0gbm9vcCwgY3NzIH0gPSBjb25maWcgfHwgbnVsbF90cmFuc2l0aW9uO1xuICAgICAgICBpZiAoY3NzKVxuICAgICAgICAgICAgYW5pbWF0aW9uX25hbWUgPSBjcmVhdGVfcnVsZShub2RlLCAwLCAxLCBkdXJhdGlvbiwgZGVsYXksIGVhc2luZywgY3NzLCB1aWQrKyk7XG4gICAgICAgIHRpY2soMCwgMSk7XG4gICAgICAgIGNvbnN0IHN0YXJ0X3RpbWUgPSBub3coKSArIGRlbGF5O1xuICAgICAgICBjb25zdCBlbmRfdGltZSA9IHN0YXJ0X3RpbWUgKyBkdXJhdGlvbjtcbiAgICAgICAgaWYgKHRhc2spXG4gICAgICAgICAgICB0YXNrLmFib3J0KCk7XG4gICAgICAgIHJ1bm5pbmcgPSB0cnVlO1xuICAgICAgICBhZGRfcmVuZGVyX2NhbGxiYWNrKCgpID0+IGRpc3BhdGNoKG5vZGUsIHRydWUsICdzdGFydCcpKTtcbiAgICAgICAgdGFzayA9IGxvb3Aobm93ID0+IHtcbiAgICAgICAgICAgIGlmIChydW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgaWYgKG5vdyA+PSBlbmRfdGltZSkge1xuICAgICAgICAgICAgICAgICAgICB0aWNrKDEsIDApO1xuICAgICAgICAgICAgICAgICAgICBkaXNwYXRjaChub2RlLCB0cnVlLCAnZW5kJyk7XG4gICAgICAgICAgICAgICAgICAgIGNsZWFudXAoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bm5pbmcgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG5vdyA+PSBzdGFydF90aW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHQgPSBlYXNpbmcoKG5vdyAtIHN0YXJ0X3RpbWUpIC8gZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICB0aWNrKHQsIDEgLSB0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcnVubmluZztcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGxldCBzdGFydGVkID0gZmFsc2U7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgc3RhcnQoKSB7XG4gICAgICAgICAgICBpZiAoc3RhcnRlZClcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICBkZWxldGVfcnVsZShub2RlKTtcbiAgICAgICAgICAgIGlmIChpc19mdW5jdGlvbihjb25maWcpKSB7XG4gICAgICAgICAgICAgICAgY29uZmlnID0gY29uZmlnKCk7XG4gICAgICAgICAgICAgICAgd2FpdCgpLnRoZW4oZ28pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgZ28oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgaW52YWxpZGF0ZSgpIHtcbiAgICAgICAgICAgIHN0YXJ0ZWQgPSBmYWxzZTtcbiAgICAgICAgfSxcbiAgICAgICAgZW5kKCkge1xuICAgICAgICAgICAgaWYgKHJ1bm5pbmcpIHtcbiAgICAgICAgICAgICAgICBjbGVhbnVwKCk7XG4gICAgICAgICAgICAgICAgcnVubmluZyA9IGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcbn1cbmZ1bmN0aW9uIGNyZWF0ZV9vdXRfdHJhbnNpdGlvbihub2RlLCBmbiwgcGFyYW1zKSB7XG4gICAgbGV0IGNvbmZpZyA9IGZuKG5vZGUsIHBhcmFtcyk7XG4gICAgbGV0IHJ1bm5pbmcgPSB0cnVlO1xuICAgIGxldCBhbmltYXRpb25fbmFtZTtcbiAgICBjb25zdCBncm91cCA9IG91dHJvcztcbiAgICBncm91cC5yICs9IDE7XG4gICAgZnVuY3Rpb24gZ28oKSB7XG4gICAgICAgIGNvbnN0IHsgZGVsYXkgPSAwLCBkdXJhdGlvbiA9IDMwMCwgZWFzaW5nID0gaWRlbnRpdHksIHRpY2sgPSBub29wLCBjc3MgfSA9IGNvbmZpZyB8fCBudWxsX3RyYW5zaXRpb247XG4gICAgICAgIGlmIChjc3MpXG4gICAgICAgICAgICBhbmltYXRpb25fbmFtZSA9IGNyZWF0ZV9ydWxlKG5vZGUsIDEsIDAsIGR1cmF0aW9uLCBkZWxheSwgZWFzaW5nLCBjc3MpO1xuICAgICAgICBjb25zdCBzdGFydF90aW1lID0gbm93KCkgKyBkZWxheTtcbiAgICAgICAgY29uc3QgZW5kX3RpbWUgPSBzdGFydF90aW1lICsgZHVyYXRpb247XG4gICAgICAgIGFkZF9yZW5kZXJfY2FsbGJhY2soKCkgPT4gZGlzcGF0Y2gobm9kZSwgZmFsc2UsICdzdGFydCcpKTtcbiAgICAgICAgbG9vcChub3cgPT4ge1xuICAgICAgICAgICAgaWYgKHJ1bm5pbmcpIHtcbiAgICAgICAgICAgICAgICBpZiAobm93ID49IGVuZF90aW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHRpY2soMCwgMSk7XG4gICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoKG5vZGUsIGZhbHNlLCAnZW5kJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghLS1ncm91cC5yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIHdpbGwgcmVzdWx0IGluIGBlbmQoKWAgYmVpbmcgY2FsbGVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gc28gd2UgZG9uJ3QgbmVlZCB0byBjbGVhbiB1cCBoZXJlXG4gICAgICAgICAgICAgICAgICAgICAgICBydW5fYWxsKGdyb3VwLmMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKG5vdyA+PSBzdGFydF90aW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHQgPSBlYXNpbmcoKG5vdyAtIHN0YXJ0X3RpbWUpIC8gZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICB0aWNrKDEgLSB0LCB0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcnVubmluZztcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGlmIChpc19mdW5jdGlvbihjb25maWcpKSB7XG4gICAgICAgIHdhaXQoKS50aGVuKCgpID0+IHtcbiAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgIGNvbmZpZyA9IGNvbmZpZygpO1xuICAgICAgICAgICAgZ28oKTtcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGVsc2Uge1xuICAgICAgICBnbygpO1xuICAgIH1cbiAgICByZXR1cm4ge1xuICAgICAgICBlbmQocmVzZXQpIHtcbiAgICAgICAgICAgIGlmIChyZXNldCAmJiBjb25maWcudGljaykge1xuICAgICAgICAgICAgICAgIGNvbmZpZy50aWNrKDEsIDApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHJ1bm5pbmcpIHtcbiAgICAgICAgICAgICAgICBpZiAoYW5pbWF0aW9uX25hbWUpXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZV9ydWxlKG5vZGUsIGFuaW1hdGlvbl9uYW1lKTtcbiAgICAgICAgICAgICAgICBydW5uaW5nID0gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1x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CBwcm9ncmFtID0ge1xuICAgICAgICAgICAgc3RhcnQ6IG5vdygpICsgZGVsYXksXG4gICAgICAgICAgICBiXG4gICAgICAgIH07XG4gICAgICAgIGlmICghYikge1xuICAgICAgICAgICAgLy8gQHRzLWlnbm9yZSB0b2RvOiBpbXByb3ZlIHR5cGluZ3NcbiAgICAgICAgICAgIHByb2dyYW0uZ3JvdXAgPSBvdXRyb3M7XG4gICAgICAgICAgICBvdXRyb3MuciArPSAxO1xuICAgICAgICB9XG4gICAgICAgIGlmIChydW5uaW5nX3Byb2dyYW0pIHtcbiAgICAgICAgICAgIHBlbmRpbmdfcHJvZ3JhbSA9IHByb2dyYW07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAvLyBpZiB0aGlzIGlzIGFuIGludHJvLCBhbmQgdGhlcmUncyBhIGRlbGF5LCB3ZSBuZWVkIHRvIGRvXG4gICAgICAgICAgICAvLyBhbiBpbml0aWFsIHRpY2sgYW5kL29yIGFwcGx5IENTUyBhbmltYXRpb24gaW1tZWRpYXRlbHlcbiAgICAgICAgICAgIGlmIChjc3MpIHtcbiAgICAgICAgICAgICAgICBjbGVhcl9hbmltYXRpb24oKTtcbiAgICAgICAgICAgICAgICBhbmltYXRpb25fbmFtZSA9IGNyZWF0ZV9ydWxlKG5vZGUsIHQsIGIsIGR1cmF0aW9uLCBkZWxheSwgZWFzaW5nLCBjc3MpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGIpXG4gICAgICAgICAgICAgICAgdGljaygwLCAxKTtcbiAgICAgICAgICAgIHJ1bm5pbmdfcHJvZ3JhbSA9IGluaXQocHJvZ3JhbSwgZHVyYXRpb24pO1xuICAgICAgICAgICAgYWRkX3JlbmRlcl9jYWxsYmFjaygoKSA9PiBkaXNwYXRjaChub2RlLCBiLCAnc3RhcnQnKSk7XG4gICAgICAgICAgICBsb29wKG5vdyA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKHBlbmRpbmdfcHJvZ3JhbSAmJiBub3cgPiBwZW5kaW5nX3Byb2dyYW0uc3RhcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgcnVubmluZ19wcm9ncmFtID0gaW5pdChwZW5kaW5nX3Byb2dyYW0sIGR1cmF0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgcGVuZGluZ19wcm9ncmFtID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgZGlzcGF0Y2gobm9kZSwgcnVubmluZ19wcm9ncmFtLmIsICdzdGFydCcpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY3NzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhcl9hbmltYXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbl9uYW1lID0gY3JlYXRlX3J1bGUobm9kZSwgdCwgcnVubmluZ19wcm9ncmFtLmIsIHJ1bm5pbmdfcHJvZ3JhbS5kdXJhdGlvbiwgMCwgZWFzaW5nLCBjb25maWcuY3NzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAocnVubmluZ19wcm9ncmFtKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChub3cgPj0gcnVubmluZ19wcm9ncmFtLmVuZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGljayh0ID0gcnVubmluZ19wcm9ncmFtLmIsIDEgLSB0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoKG5vZGUsIHJ1bm5pbmdfcHJvZ3JhbS5iLCAnZW5kJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXBlbmRpbmdfcHJvZ3JhbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlJ3JlIGRvbmVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVubmluZ19wcm9ncmFtLmIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW50cm8g4oCUIHdlIGNhbiB0aWR5IHVwIGltbWVkaWF0ZWx5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyX2FuaW1hdGlvbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb3V0cm8g4oCUIG5lZWRzIHRvIGJlIGNvb3JkaW5hdGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghLS1ydW5uaW5nX3Byb2dyYW0uZ3JvdXAucilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bl9hbGwocnVubmluZ19wcm9ncmFtLmdyb3VwLmMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bm5pbmdfcHJvZ3JhbSA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAobm93ID49IHJ1bm5pbmdfcHJvZ3JhbS5zdGFydCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcCA9IG5vdyAtIHJ1bm5pbmdfcHJvZ3JhbS5zdGFydDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBydW5uaW5nX3Byb2dyYW0uYSArIHJ1bm5pbmdfcHJvZ3JhbS5kICogZWFzaW5nKHAgLyBydW5uaW5nX3Byb2dyYW0uZHVyYXRpb24pO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGljayh0LCAxIC0gdCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuICEhKHJ1bm5pbmdfcHJvZ3JhbSB8fCBwZW5kaW5nX3Byb2dyYW0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHtcbiAgICAgICAgcnVuKGIpIHtcbiAgICAgICAgICAgIGlmIChpc19mdW5jdGlvbihjb25maWcpKSB7XG4gICAgICAgICAgICAgICAgd2FpdCgpLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZyA9IGNvbmZpZygpO1xuICAgICAgICAgICAgICAgICAgICBnbyhiKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGdvKGIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbmQoKSB7XG4gICAgICAgICAgICBjbGVhcl9hbmltYXRpb24oKTtcbiAgICAgICAgICAgIHJ1bm5pbmdfcHJvZ3JhbSA9IHBlbmRpbmdfcHJvZ3JhbSA9IG51bGw7XG4gICAgICAgIH1cbiAgICB9O1xufVxuXG5mdW5jdGlvbiBoYW5kbGVfcHJvbWlzZShwcm9taXNlLCBpbmZvKSB7XG4gICAgY29uc3QgdG9rZW4gPSBpbmZvLnRva2VuID0ge307XG4gICAgZnVuY3Rpb24gdXBkYXRlKHR5cGUsIGluZGV4LCBrZXksIHZhbHVlKSB7XG4gICAgICAgIGlmIChpbmZvLnRva2VuICE9PSB0b2tlbilcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgaW5mby5yZXNvbHZlZCA9IGtleSAmJiB7IFtrZXldOiB2YWx1ZSB9O1xuICAgICAgICBjb25zdCBjaGlsZF9jdHggPSBhc3NpZ24oYXNzaWduKHt9LCBpbmZvLmN0eCksIGluZm8ucmVzb2x2ZWQpO1xuICAgICAgICBjb25zdCBibG9jayA9IHR5cGUgJiYgKGluZm8uY3VycmVudCA9IHR5cGUpKGNoaWxkX2N0eCk7XG4gICAgICAgIGlmIChpbmZvLmJsb2NrKSB7XG4gICAgICAgICAgICBpZiAoaW5mby5ibG9ja3MpIHtcbiAgICAgICAgICAgICAgICBpbmZvLmJsb2Nrcy5mb3JFYWNoKChibG9jaywgaSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPT0gaW5kZXggJiYgYmxvY2spIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwX291dHJvcygpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvbl9vdXQoYmxvY2ssIDEsIDEsICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvLmJsb2Nrc1tpXSA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrX291dHJvcygpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpbmZvLmJsb2NrLmQoMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBibG9jay5jKCk7XG4gICAgICAgICAgICB0cmFuc2l0aW9uX2luKGJsb2NrLCAxKTtcbiAgICAgICAgICAgIGJsb2NrLm0oaW5mby5tb3VudCgpLCBpbmZvLmFuY2hvcik7XG4gICAgICAgICAgICBmbHVzaCgpO1xuICAgICAgICB9XG4gICAgICAgIGluZm8uYmxvY2sgPSBibG9jaztcbiAgICAgICAgaWYgKGluZm8uYmxvY2tzKVxuICAgICAgICAgICAgaW5mby5ibG9ja3NbaW5kZXhdID0gYmxvY2s7XG4gICAgfVxuICAgIGlmIChpc19wcm9taXNlKHByb21pc2UpKSB7XG4gICAgICAgIGNvbnN0IGN1cnJlbnRfY29tcG9uZW50ID0gZ2V0X2N1cnJlbnRfY29tcG9uZW50KCk7XG4gICAgICAgIHByb21pc2UudGhlbih2YWx1ZSA9PiB7XG4gICAgICAgICAgICBzZXRfY3VycmVudF9jb21wb25lbnQoY3VycmVudF9jb21wb25lbnQpO1xuICAgICAgICAgICAgdXBkYXRlKGluZm8udGhlbiwgMSwgaW5mby52YWx1ZSwgdmFsdWUpO1xuICAgICAgICAgICAgc2V0X2N1cnJlbnRfY29tcG9uZW50KG51bGwpO1xuICAgICAgICB9LCBlcnJvciA9PiB7XG4gICAgICAgICAgICBzZXRfY3VycmVudF9jb21wb25lbnQoY3VycmVudF9jb21wb25lbnQpO1xuICAgICAgICAgICAgdXBkYXRlKGluZm8uY2F0Y2gsIDIsIGluZm8uZXJyb3IsIGVycm9yKTtcbiAgICAgICAgICAgIHNldF9jdXJyZW50X2NvbXBvbmVudChudWxsKTtcbiAgICAgICAgfSk7XG4gICAgICAgIC8vIGlmIHdlIHByZXZpb3VzbHkgaGFkIGEgdGhlbi9jYXRjaCBibG9jaywgZGVzdHJveSBpdFxuICAgICAgICBpZiAoaW5mby5jdXJyZW50ICE9PSBpbmZvLnBlbmRpbmcpIHtcbiAgICAgICAgICAgIHVwZGF0ZShpbmZvLnBlbmRpbmcsIDApO1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIGlmIChpbmZvLmN1cnJlbnQgIT09IGluZm8udGhlbikge1xuICAgICAgICAgICAgdXBkYXRlKGluZm8udGhlbiwgMSwgaW5mby52YWx1ZSwgcHJvbWlzZSk7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBpbmZvLnJlc29sdmVkID0geyBbaW5mby52YWx1ZV06IHByb21pc2UgfTtcbiAgICB9XG59XG5cbmNvbnN0IGdsb2JhbHMgPSAodHlwZW9mIHdpbmRvdyAhPT0gJ3VuZGVmaW5lZCcgPyB3aW5kb3cgOiBnbG9iYWwpO1xuXG5mdW5jdGlvbiBkZXN0cm95X2Jsb2NrKGJsb2NrLCBsb29rdXApIHtcbiAgICBibG9jay5kKDE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vY2sgPSBvbGRfYmxvY2tzW28gLSAxXTtcbiAgICAgICAgY29uc3QgbmV3X2tleSA9IG5ld19ibG9jay5rZXk7XG4gICAgICAgIGNvbnN0IG9sZF9rZXkgPSBvbGRfYmxvY2sua2V5O1xuICAgICAgICBpZiAobmV3X2Jsb2NrID09PSBvbGRfYmxvY2spIHtcbiAgICAgICAgICAgIC8vIGRvIG5vdGhpbmdcbiAgICAgICAgICAgIG5leHQgPSBuZXdfYmxvY2suZmlyc3Q7XG4gICAgICAgICAgICBvLS07XG4gICAgICAgICAgICBuLS07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAoIW5ld19sb29rdXAuaGFzKG9sZF9rZXkpKSB7XG4gICAgICAgICAgICAvLyByZW1vdmUgb2xkIGJsb2NrXG4gICAgICAgICAgICBkZXN0cm95KG9sZF9ibG9jaywgbG9va3VwKTtcbiAgICAgICAgICAgIG8tLTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICghbG9va3VwLmhhcyhuZXdfa2V5KSB8fCB3aWxsX21vdmUuaGFzKG5ld19rZXkpKSB7XG4gICAgICAgICAgICBpbnNlcnQobmV3X2Jsb2NrKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChkaWRfbW92ZS5oYXMob2xkX2tleSkpIHtcbiAgICAgICAgICAgIG8tLTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChkZWx0YXMuZ2V0KG5ld19rZXkpID4gZGVsdGFzLmdldChvbGRfa2V5KSkge1xuICAgICAgICAgICAgZGlkX21vdmUuYWRkKG5ld19rZXkpO1xuICAgICAgICAgICAgaW5zZXJ0KG5ld19ibG9jayk7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICB3aWxsX21vdmUuYWRkKG9sZF9rZXkpO1xuICAgICAgICAgICAgby0tO1xuICAgICAgICB9XG4gICAgfVxuICAgIHdoaWxlIChvLS0pIHtcbiAgICAgICAgY29uc3Qgb2xkX2Js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QoeyAkJCB9KTtcbiAgICAgICAgY29uc3QgaHRtbCA9IGZuKHJlc3VsdCwgcHJvcHMsIGJpbmRpbmdzLCBzbG90cyk7XG4gICAgICAgIHNldF9jdXJyZW50X2NvbXBvbmVudChwYXJlbnRfY29tcG9uZW50KTtcbiAgICAgICAgcmV0dXJuIGh0bWw7XG4gICAgfVxuICAgIHJldHVybiB7XG4gICAgICAgIHJlbmRlcjogKHByb3BzID0ge30sIG9wdGlvbnMgPSB7fSkgPT4ge1xuICAgICAgICAgICAgb25fZGVzdHJveSA9IFtdO1xuICAgICAgICAgICAgY29uc3QgcmVzdWx0ID0geyBoZWFkOiAnJywgY3NzOiBuZXcgU2V0KCkgfTtcbiAgICAgICAgICAgIGNvbnN0IGh0bWwgPSAkJHJlbmRlcihyZXN1bHQsIHByb3BzLCB7fSwgb3B0aW9ucyk7XG4gICAgICAgICAgICBydW5fYWxsKG9uX2Rlc3Ryb3kpO1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBodG1sLFxuICAgICAgICAgICAgICAgIGNzczoge1xuICAgICAgICAgICAgICAgICAgICBjb2RlOiBBcnJheS5mcm9tKHJlc3VsdC5jc3MpLm1hcChjc3MgPT4gY3NzLmNvZGUpLmpvaW4oJ1xcbicpLFxuICAgICAgICAgICAgICAgICAgICBtYXA6IG51bGwgLy8gVE9ET1xuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgaGVhZDogcmVzdWx0LmhlYWRcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0sXG4gICAgICAgICQkcmVuZGVyXG4gICAgfTtcbn1cbmZ1bmN0aW9uIGFkZF9hdHRyaWJ1dGUobmFtZSwgdmFsdWUsIGJvb2xlYW4pIHtcbiAgICBpZiAodmFsdWUgPT0gbnVsbCB8fCAoYm9vbGVhbiAmJiAhdmFsdWUpKVxuICAgICAgICByZXR1cm4gJyc7XG4gICAgcmV0dXJuIGAgJHtuYW1lfSR7dmFsdWUgPT09I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mtfb2JqZWN0KCk7XG4gICAgfVxuICAgIGNvbXBvbmVudC4kJC5kaXJ0eVtrZXldID0gdHJ1ZTtcbn1cbmZ1bmN0aW9uIGluaXQoY29tcG9uZW50LCBvcHRpb25zLCBpbnN0YW5jZSwgY3JlYXRlX2ZyYWdtZW50LCBub3RfZXF1YWwsIHByb3BfbmFtZXMpIHtcbiAgICBjb25zdCBwYXJlbnRfY29tcG9uZW50ID0gY3VycmVudF9jb21wb25lbnQ7XG4gICAgc2V0X2N1cnJlbnRfY29tcG9uZW50KGNvbXBvbmVudCk7XG4gICAgY29uc3QgcHJvcHMgPSBvcHRpb25zLnByb3BzIHx8IHt9O1xuICAgIGNvbnN0ICQkID0gY29tcG9uZW50LiQkID0ge1xuICAgICAgICBmcmFnbWVudDogbnVsbCxcbiAgICAgICAgY3R4OiBudWxsLFxuICAgICAgICAvLyBzdGF0ZVxuICAgICAgICBwcm9wczogcHJvcF9uYW1lcyxcbiAgICAgICAgdXBkYXRlOiBub29wLFxuICAgICAgICBub3RfZXF1YWwsXG4gICAgICAgIGJvdW5kOiBibGFua19vYmplY3QoKSxcbiAgICAgICAgLy8gbGlmZWN5Y2xlXG4gICAgICAgIG9uX21vdW50OiBbXSxcbiAgICAgICAgb25fZGVzdHJveTogW10sXG4gICAgICAgIGJlZm9yZV91cGRhdGU6IFtdLFxuICAgICAgICBhZnRlcl91cGRhdGU6IFtdLFxuICAgICAgICBjb250ZXh0OiBuZXcgTWFwKHBhcmVudF9jb21wb25lbnQgPyBwYXJlbnRfY29tcG9uZW50LiQkLmNvbnRleHQgOiBbXSksXG4gICAgICAgIC8vIGV2ZXJ5dGhpbmcgZWxzZVxuICAgICAgICBjYWxsYmFja3M6IGJsYW5rX29iamVjdCgpLFxuICAgICAgICBkaXJ0eTogbnVsbFxuICAgIH07XG4gICAgbGV0IHJlYWR5ID0gZmFsc2U7XG4gICAgJCQuY3R4ID0gaW5zdGFuY2VcbiAgICAgICAgPyBpbnN0YW5jZShjb21wb25l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O1xuICAgICAgICAgICAgdGhpcy4kZGVzdHJveSA9IG5vb3A7XG4gICAgICAgIH1cbiAgICAgICAgJG9uKHR5cGUsIGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAvLyBUT0RPIHNob3VsZCB0aGlzIGRlbGVnYXRlIHRvIGFkZEV2ZW50TGlzdGVuZXI/XG4gICAgICAgICAgICBjb25zdCBjYWxsYmFja3MgPSAodGhpcy4kJC5jYWxsYmFja3NbdHlwZV0gfHwgKHRoaXMuJCQuY2FsbGJhY2tzW3R5cGVdID0gW10pKTtcbiAgICAgICAgICAgIGNhbGxiYWNrcy5wdXNoKGNhbGxiYWNrKTtcbiAgICAgICAgICAgIHJldHVybiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgY29uc3QgaW5kZXggPSBjYWxsYmFja3MuaW5kZXhPZihjYWxsYmFjayk7XG4gICAgICAgICAgICAgICAgaWYgKGluZGV4ICE9PSAtMSlcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2tzLnNwbGljZShpbmRleCwgMSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgICRzZXQoKSB7XG4gICAgICAgICAgICAvLyBvdmVycmlkZGVuIGJ5IGluc3RhbmNlLCBpZiBpdCBoYXMgcHJvcHNcbiAgICAgICAgfVxuICAgIH07XG59XG5jbGFzcyBTdmVsdGVDb21wb25lbnQge1xuICAgICRkZXN0cm95KCkge1xuICAgICAgICBkZXN0cm95X2NvbXBvbmVudCh0aGlzLCAxKTtcbiAgICAgICAgdGhpcy4kZGVzdHJveSA9IG5vb3A7XG4gICAgfVxuICAgICRvbih0eXBlLCBjYWxsYmFjaykge1xuICAgICAgICBjb25zdCBjYWxsYmFja3MgPSAodGhpcy4kJC5jYWxsYmFja3NbdHlwZV0gfHwgKHRoaXMuJCQuY2FsbGJhY2tzW3R5cGVdID0gW10pKTtcbiAgICAgICAgY2FsbGJhY2tzLnB1c2goY2FsbGJhY2spO1xuICAgICAgICByZXR1cm4gKCk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9zdChcIi9hcGkvYXV0aGVudGljYXRlXCIsIHt1c2VybmFtZSwgcGFzc3dvcmR9KVxuICAgIC50aGVuKHIgPT4ge1xuICAgICAgICBidXN5ID0gZmFsc2U7XG4gICAgICAgIGlmKHIuc3RhdHVzID09PSAyMDApIHtcbiAgICAgICAgICAgIHJldHVybiByLmpzb24oKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGluY29ycmVjdCA9IHRydWU7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cbiAgICB9KVxuICAgIC50aGVuKHVzZXIgPT4ge1xuICAgICAgICBpZih1c2VyKSB7XG4gICAgICAgICAgICBsb2NhbFN0b3JhZ2Uuc2V0SXRlbShcImJ1ZGliYXNlOnVzZXJcIiwgdXNlcik7XG4gICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTtcbiAgICAgICAgfVxuICAgIH0pXG59XG5cbjwvc2NyaXB0PlxuXG48ZGl2IGNsYXNzPVwicm9vdFwiPlxuXG4gICAgPGRpdiBjbGFzcz1cImNvbnRlbnRcIj5cblxuICAgICAgICB7I2lmIF9sb2dvfVxuICAgICAgICA8ZGl2IGNsYXNzPVwibG9nby1jb250YWluZXJcIj5cbiAgICAgICAgICAgIDxpbWcgc3JjPXtfbG9nb30gYWx0PVwibG9nb1wiLz5cbiAgICAgICAgPC9kaXY+XG4gICAgICAgIHsvaWZ9XG5cbiAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tcm9vdFwiPlxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cImxhYmVsXCI+XG4gICAgICAgICAgICAgICAge3VzZXJuYW1lTGFiZWx9XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb250cm9sXCI+XG4gICAgICAgICAgICAgICAgPGlucHV0IGJpbmQ6dmFsdWU9e3VzZXJuYW1lfSB0eXBlPVwidGV4dFwiIGNsYXNzPXtfaW5wdXRDbGFzc30vPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8ZGl2IGNsYXNzPVwibGFiZWxcIj5cbiAgICAgICAgICAgICAgICB7cGFzc3dvcmRMYWJlbH1cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbnRyb2xcIj5cbiAgICAgICAgICAgICAgICA8aW5wdXQgYmluZDp2YWx1ZT17cGFzc3dvcmR9IHR5cGU9XCJwYXNzd29yZFwiIGNsYXNzPXtfaW5wdXRDbGFzc30vPlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgIDwvZGl2PlxuXG4gICAgICAgIDxkaXYgY2xhc3M9XCJsb2dpbi1idXR0b24tY29udGFpbmVyXCI+XG4gICAgICAgICAgICA8YnV0dG9uIGRpc2FibGVkPXtidXN5fSBcbiAgICAgICAgICAgICAgICAgICAgb246Y2xpY2s9e2xvZ2lufVxuICAgICAgICAgICAgICAgICAgICBjbGFzcz17X2J1dHRvbkNsYXNzfT5cbiAgICAgICAgICAgICAgICAgICAge2xvZ2luQnV0dG9uTGFiZWx9XG4gICAgICAgICAgICA8L2J1dHRvbj5cbiAgICAgICAgPC9kaXY+XG5cbiAgICAgICAgeyNpZiBpbmNvcnJlY3R9XG4gICAgICAgIDxkaXYgY2xhc3M9XCJpbmNvcnJlY3QtZGV0YWlscy1wYW5lbFwiPlxuICAgICAgICAgICAgSW5jb3JyZWN0IHVzZXJuYW1lIG9yIHBhc3N3b3JkXG4gICAgICAgIDwvZGl2PlxuICAgICAgICB7L2lmfVxuXG4gICAgPC9kaXY+XG5cbjwvZGl2PlxuXG48c3R5bGU+XG5cbi5yb290IHtcbiAgICBoZWlnaHQ6IDEwMCU7XG4gICAgZGlzcGxheTpncmlkO1xuICAgIGdyaWQtdGVtcGxhdGUtY29sdW1uczogW2xlZnRdIDFmciBbbWlkZGxlXSBhdXRvIFtyaWdodF0gMWZyO1xuICAgIGdyaWQtdGVtcGxhdGUtcm93czogW3RvcF0gMWZy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