diff --git "a/bundle.js" "b/bundle.js" --- "a/bundle.js" +++ "b/bundle.js" @@ -4,6 +4,13 @@ var app = (function () { 'use strict'; function noop() { } + const identity = x => x; + function assign(tar, src) { + // @ts-ignore + for (const k in src) + tar[k] = src[k]; + return tar; + } function add_location(element, file, line, column, char) { element.__svelte_meta = { loc: { file, line, column, char } @@ -35,6 +42,97 @@ var app = (function () { function is_empty(obj) { return Object.keys(obj).length === 0; } + function create_slot(definition, ctx, $$scope, fn) { + if (definition) { + const slot_ctx = get_slot_context(definition, ctx, $$scope, fn); + return definition[0](slot_ctx); + } + } + function get_slot_context(definition, ctx, $$scope, fn) { + return definition[1] && fn + ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) + : $$scope.ctx; + } + function get_slot_changes(definition, $$scope, dirty, fn) { + if (definition[2] && fn) { + const lets = definition[2](fn(dirty)); + if ($$scope.dirty === undefined) { + return lets; + } + if (typeof lets === 'object') { + const merged = []; + const len = Math.max($$scope.dirty.length, lets.length); + for (let i = 0; i < len; i += 1) { + merged[i] = $$scope.dirty[i] | lets[i]; + } + return merged; + } + return $$scope.dirty | lets; + } + return $$scope.dirty; + } + function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) { + if (slot_changes) { + const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn); + slot.p(slot_context, slot_changes); + } + } + function get_all_dirty_from_scope($$scope) { + if ($$scope.ctx.length > 32) { + const dirty = []; + const length = $$scope.ctx.length / 32; + for (let i = 0; i < length; i++) { + dirty[i] = -1; + } + return dirty; + } + return -1; + } + function compute_slots(slots) { + const result = {}; + for (const key in slots) { + result[key] = true; + } + return result; + } + function null_to_empty(value) { + return value == null ? '' : value; + } + + const is_client = typeof window !== 'undefined'; + let now = is_client + ? () => window.performance.now() + : () => Date.now(); + let raf = is_client ? cb => requestAnimationFrame(cb) : noop; + + const tasks = new Set(); + function run_tasks(now) { + tasks.forEach(task => { + if (!task.c(now)) { + tasks.delete(task); + task.f(); + } + }); + if (tasks.size !== 0) + raf(run_tasks); + } + /** + * Creates a new task that runs on each raf frame + * until it returns a falsy value or is aborted + */ + function loop(callback) { + let task; + if (tasks.size === 0) + raf(run_tasks); + return { + promise: new Promise(fulfill => { + tasks.add(task = { c: callback, f: fulfill }); + }), + abort() { + tasks.delete(task); + } + }; + } const globals = (typeof window !== 'undefined' ? window @@ -44,6 +142,24 @@ var app = (function () { function append(target, node) { target.appendChild(node); } + function get_root_for_style(node) { + if (!node) + return document; + const root = node.getRootNode ? node.getRootNode() : node.ownerDocument; + if (root && root.host) { + return root; + } + return node.ownerDocument; + } + function append_empty_stylesheet(node) { + const style_element = element('style'); + append_stylesheet(get_root_for_style(node), style_element); + return style_element.sheet; + } + function append_stylesheet(node, style) { + append(node.head || node, style); + return style.sheet; + } function insert(target, node, anchor) { target.insertBefore(node, anchor || null); } @@ -61,6 +177,9 @@ var app = (function () { 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); } @@ -119,6 +238,71 @@ var app = (function () { return e; } + // we need to store the information for multiple documents because a Svelte application could also contain iframes + // https://github.com/sveltejs/svelte/issues/3624 + const managed_styles = new Map(); + let active = 0; + // 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_style_information(doc, node) { + const info = { stylesheet: append_empty_stylesheet(node), rules: {} }; + managed_styles.set(doc, info); + return info; + } + 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}`; + const doc = get_root_for_style(node); + const { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node); + if (!rules[name]) { + 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) { + const previous = (node.style.animation || '').split(', '); + const next = previous.filter(name + ? anim => anim.indexOf(name) < 0 // remove specific animation + : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations + ); + const deleted = previous.length - next.length; + if (deleted) { + node.style.animation = next.join(', '); + active -= deleted; + if (!active) + clear_rules(); + } + } + function clear_rules() { + raf(() => { + if (active) + return; + managed_styles.forEach(info => { + const { ownerNode } = info.stylesheet; + // there is no ownerNode if it runs on jsdom. + if (ownerNode) + detach(ownerNode); + }); + managed_styles.clear(); + }); + } + let current_component; function set_current_component(component) { current_component = component; @@ -140,6 +324,27 @@ var app = (function () { function onMount(fn) { get_current_component().$$.on_mount.push(fn); } + /** + * Schedules a callback to run immediately before the component is unmounted. + * + * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the + * only one that runs inside a server-side component. + * + * https://svelte.dev/docs#run-time-svelte-ondestroy + */ + function onDestroy(fn) { + get_current_component().$$.on_destroy.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) { + // @ts-ignore + callbacks.slice().forEach(fn => fn.call(this, event)); + } + } const dirty_components = []; const binding_callbacks = []; @@ -246,6 +451,20 @@ var app = (function () { targets.forEach((c) => c()); render_callbacks = filtered; } + + 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}`)); + } const outroing = new Set(); let outros; function group_outros() { @@ -286,6 +505,76 @@ var app = (function () { callback(); } } + const null_transition = { duration: 0 }; + function create_in_transition(node, fn, params) { + const options = { direction: 'in' }; + let config = fn(node, params, options); + 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 = noop, css } = config || null_transition; + if (css) + animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++); + tick(0, 1); + const start_time = now() + delay; + const end_time = start_time + duration; + if (task) + task.abort(); + running = true; + add_render_callback(() => dispatch(node, true, 'start')); + task = loop(now => { + if (running) { + if (now >= end_time) { + tick(1, 0); + dispatch(node, true, 'end'); + cleanup(); + return running = false; + } + if (now >= start_time) { + const t = easing((now - start_time) / duration); + tick(t, 1 - t); + } + } + return running; + }); + } + let started = false; + return { + start() { + if (started) + return; + started = true; + delete_rule(node); + if (is_function(config)) { + config = config(options); + wait().then(go); + } + else { + go(); + } + }, + invalidate() { + started = false; + }, + end() { + if (running) { + cleanup(); + running = false; + } + } + }; + } + + function destroy_block(block, lookup) { + block.d(1); + lookup.delete(block.key); + } function outro_and_destroy_block(block, lookup) { transition_out(block, 1, 1, () => { lookup.delete(block.key); @@ -552,6 +841,10 @@ var app = (function () { else dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value }); } + function prop_dev(node, property, value) { + node[property] = value; + dispatch_dev('SvelteDOMSetProperty', { node, property, value }); + } function set_data_dev(text, data) { data = '' + data; if (text.data === data) @@ -597,17 +890,17 @@ var app = (function () { /* src\VideoGradioComponentBrainstorming.svelte generated by Svelte v3.59.2 */ - const { console: console_1 } = globals; - const file$5 = "src\\VideoGradioComponentBrainstorming.svelte"; + const { console: console_1$2 } = globals; + const file$c = "src\\VideoGradioComponentBrainstorming.svelte"; - function get_each_context$2(ctx, list, i) { + function get_each_context$3(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[15] = list[i]; return child_ctx; } // (85:4) {#each kitchenOptions as option} - function create_each_block$2(ctx) { + function create_each_block$3(ctx) { let option; let t_value = /*option*/ ctx[15] + ""; let t; @@ -618,7 +911,7 @@ var app = (function () { t = text(t_value); option.__value = /*option*/ ctx[15]; option.value = option.__value; - add_location(option, file$5, 85, 6, 2561); + add_location(option, file$c, 85, 6, 2561); }, m: function mount(target, anchor) { insert_dev(target, option, anchor); @@ -632,7 +925,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$2.name, + id: create_each_block$3.name, type: "each", source: "(85:4) {#each kitchenOptions as option}", ctx @@ -641,7 +934,7 @@ var app = (function () { return block; } - function create_fragment$5(ctx) { + function create_fragment$c(ctx) { let h1; let t1; let div1; @@ -668,7 +961,7 @@ var app = (function () { 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)); + each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i)); } const block = { @@ -698,34 +991,34 @@ var app = (function () { each_blocks[i].c(); } - add_location(h1, file$5, 66, 0, 1800); + add_location(h1, file$c, 66, 0, 1800); attr_dev(track, "kind", "captions"); if (!src_url_equal(track.src, track_src_value = "path/to/your/captions/file.vtt")) attr_dev(track, "src", track_src_value); attr_dev(track, "srclang", "en"); attr_dev(track, "label", "English"); - add_location(track, file$5, 72, 4, 2006); + add_location(track, file$c, 72, 4, 2006); attr_dev(video, "id", "videoCanvas"); video.autoplay = true; attr_dev(video, "class", "svelte-ufd3fo"); - add_location(video, file$5, 70, 2, 1965); + add_location(video, file$c, 70, 2, 1965); attr_dev(div0, "id", "overlayText"); attr_dev(div0, "class", "svelte-ufd3fo"); - add_location(div0, file$5, 74, 2, 2111); + add_location(div0, file$c, 74, 2, 2111); attr_dev(div1, "id", "videoContainer"); attr_dev(div1, "class", "svelte-ufd3fo"); - add_location(div1, file$5, 68, 0, 1911); + add_location(div1, file$c, 68, 0, 1911); attr_dev(canvas_1, "id", "myCanvas"); set_style(canvas_1, "border", "2px solid black"); attr_dev(canvas_1, "width", "500"); attr_dev(canvas_1, "height", "500"); - add_location(canvas_1, file$5, 77, 0, 2186); + add_location(canvas_1, file$c, 77, 0, 2186); attr_dev(input, "type", "text"); - add_location(input, file$5, 78, 0, 2294); - add_location(button, file$5, 82, 2, 2429); + add_location(input, file$c, 78, 0, 2294); + add_location(button, file$c, 82, 2, 2429); if (/*selectedOption*/ ctx[0] === void 0) add_render_callback(() => /*select_change_handler*/ ctx[9].call(select)); - add_location(select, file$5, 83, 2, 2479); + add_location(select, file$c, 83, 2, 2479); attr_dev(div2, "id", "frameForButtons"); - add_location(div2, file$5, 81, 0, 2399); + add_location(div2, file$c, 81, 0, 2399); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -784,12 +1077,12 @@ var app = (function () { let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$2(ctx, each_value, i); + const child_ctx = get_each_context$3(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$2(child_ctx); + each_blocks[i] = create_each_block$3(child_ctx); each_blocks[i].c(); each_blocks[i].m(select, null); } @@ -827,7 +1120,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$5.name, + id: create_fragment$c.name, type: "component", source: "", ctx @@ -840,7 +1133,7 @@ var app = (function () { } // Logic for 'Test OCR' button - function instance$5($$self, $$props, $$invalidate) { + function instance$c($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('VideoGradioComponentBrainstorming', slots, []); let selectedOption = 'Stove - lu'; // default value @@ -902,7 +1195,7 @@ var app = (function () { const writable_props = []; Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1.warn(` was created with unknown prop '${key}'`); + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$2.warn(` was created with unknown prop '${key}'`); }); function canvas_1_binding($$value) { @@ -973,13 +1266,13 @@ var app = (function () { class VideoGradioComponentBrainstorming extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$5, create_fragment$5, safe_not_equal, {}); + init(this, options, instance$c, create_fragment$c, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "VideoGradioComponentBrainstorming", options, - id: create_fragment$5.name + id: create_fragment$c.name }); } } @@ -1050,29 +1343,29 @@ var app = (function () { } /* src\NestedCommentsTestfromReact.svelte generated by Svelte v3.59.2 */ - const file$4 = "src\\NestedCommentsTestfromReact.svelte"; + const file$b = "src\\NestedCommentsTestfromReact.svelte"; - function get_each_context$1(ctx, list, i) { + function get_each_context$2(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[6] = list[i]; return child_ctx; } - function get_each_context_1(ctx, list, i) { + function get_each_context_1$1(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[9] = list[i]; return child_ctx; } // (29:12) {#if comment.items} - function create_if_block$1(ctx) { + function create_if_block$6(ctx) { let each_1_anchor; let each_value_1 = /*comment*/ ctx[6].items; validate_each_argument(each_value_1); let each_blocks = []; for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); + each_blocks[i] = create_each_block_1$1(get_each_context_1$1(ctx, each_value_1, i)); } const block = { @@ -1099,12 +1392,12 @@ var app = (function () { let i; for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1(ctx, each_value_1, i); + const child_ctx = get_each_context_1$1(ctx, each_value_1, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block_1(child_ctx); + each_blocks[i] = create_each_block_1$1(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } @@ -1125,7 +1418,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_if_block$1.name, + id: create_if_block$6.name, type: "if", source: "(29:12) {#if comment.items}", ctx @@ -1135,7 +1428,7 @@ var app = (function () { } // (30:16) {#each comment.items as item} - function create_each_block_1(ctx) { + function create_each_block_1$1(ctx) { let t0_value = /*item*/ ctx[9].title + ""; let t0; let t1; @@ -1160,7 +1453,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block_1.name, + id: create_each_block_1$1.name, type: "each", source: "(30:16) {#each comment.items as item}", ctx @@ -1170,7 +1463,7 @@ var app = (function () { } // (23:4) {#each comments as comment} - function create_each_block$1(ctx) { + function create_each_block$2(ctx) { let div1; let div0; let span; @@ -1188,7 +1481,7 @@ var app = (function () { return /*click_handler*/ ctx[5](/*comment*/ ctx[6]); } - let if_block = /*comment*/ ctx[6].items && create_if_block$1(ctx); + let if_block = /*comment*/ ctx[6].items && create_if_block$6(ctx); const block = { c: function create() { @@ -1203,13 +1496,13 @@ var app = (function () { if (if_block) if_block.c(); t4 = space(); attr_dev(span, "class", "text"); - add_location(span, file$4, 25, 16, 818); - add_location(button, file$4, 26, 16, 877); + add_location(span, file$b, 25, 16, 818); + add_location(button, file$b, 26, 16, 877); attr_dev(div0, "class", "card"); - add_location(div0, file$4, 24, 12, 782); + add_location(div0, file$b, 24, 12, 782); attr_dev(div1, "key", div1_key_value = /*comment*/ ctx[6].id); set_style(div1, "margin-left", "20px"); - add_location(div1, file$4, 23, 8, 719); + add_location(div1, file$b, 23, 8, 719); }, m: function mount(target, anchor) { insert_dev(target, div1, anchor); @@ -1235,7 +1528,7 @@ var app = (function () { if (if_block) { if_block.p(ctx, dirty); } else { - if_block = create_if_block$1(ctx); + if_block = create_if_block$6(ctx); if_block.c(); if_block.m(div1, t4); } @@ -1258,7 +1551,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$1.name, + id: create_each_block$2.name, type: "each", source: "(23:4) {#each comments as comment}", ctx @@ -1267,7 +1560,7 @@ var app = (function () { return block; } - function create_fragment$4(ctx) { + function create_fragment$b(ctx) { let div1; let div0; let input; @@ -1281,7 +1574,7 @@ var app = (function () { 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)); + each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i)); } const block = { @@ -1300,11 +1593,11 @@ var app = (function () { attr_dev(input, "type", "text"); attr_dev(input, "placeholder", "Add a comment"); - add_location(input, file$4, 19, 8, 530); - add_location(button, file$4, 20, 8, 613); - add_location(div0, file$4, 18, 4, 515); + add_location(input, file$b, 19, 8, 530); + add_location(button, file$b, 20, 8, 613); + add_location(div0, file$b, 18, 4, 515); attr_dev(div1, "id", "comment-container"); - add_location(div1, file$4, 17, 0, 481); + add_location(div1, file$b, 17, 0, 481); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -1344,12 +1637,12 @@ var app = (function () { let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$1(ctx, each_value, i); + const child_ctx = get_each_context$2(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$1(child_ctx); + each_blocks[i] = create_each_block$2(child_ctx); each_blocks[i].c(); each_blocks[i].m(div1, null); } @@ -1374,7 +1667,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$4.name, + id: create_fragment$b.name, type: "component", source: "", ctx @@ -1383,7 +1676,7 @@ var app = (function () { return block; } - function instance$4($$self, $$props, $$invalidate) { + function instance$b($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('NestedCommentsTestfromReact', slots, []); let comments = []; @@ -1449,21 +1742,21 @@ var app = (function () { class NestedCommentsTestfromReact extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$4, create_fragment$4, safe_not_equal, {}); + init(this, options, instance$b, create_fragment$b, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "NestedCommentsTestfromReact", options, - id: create_fragment$4.name + id: create_fragment$b.name }); } } /* src\MovingDotPortfromReact.svelte generated by Svelte v3.59.2 */ - const file$3 = "src\\MovingDotPortfromReact.svelte"; + const file$a = "src\\MovingDotPortfromReact.svelte"; - function create_fragment$3(ctx) { + function create_fragment$a(ctx) { let div; const block = { @@ -1472,7 +1765,7 @@ var app = (function () { attr_dev(div, "class", "MovingDot svelte-12o76ak"); set_style(div, "left", /*position*/ ctx[0].x + "px"); set_style(div, "top", /*position*/ ctx[0].y + "px"); - add_location(div, file$3, 39, 0, 1178); + add_location(div, file$a, 39, 0, 1178); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -1498,7 +1791,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$3.name, + id: create_fragment$a.name, type: "component", source: "", ctx @@ -1509,7 +1802,7 @@ var app = (function () { const step = 10; - function instance$3($$self, $$props, $$invalidate) { + function instance$a($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotPortfromReact', slots, []); let { position = { x: 0, y: 0 } } = $$props; @@ -1583,13 +1876,13 @@ var app = (function () { class MovingDotPortfromReact extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$3, create_fragment$3, safe_not_equal, { position: 0, boundaries: 1 }); + init(this, options, instance$a, create_fragment$a, safe_not_equal, { position: 0, boundaries: 1 }); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotPortfromReact", options, - id: create_fragment$3.name + id: create_fragment$a.name }); } @@ -1612,9 +1905,9 @@ var app = (function () { /* src\MovingDotTargetPortfromReact.svelte generated by Svelte v3.59.2 */ - const file$2 = "src\\MovingDotTargetPortfromReact.svelte"; + const file$9 = "src\\MovingDotTargetPortfromReact.svelte"; - function create_fragment$2(ctx) { + function create_fragment$9(ctx) { let div; const block = { @@ -1623,7 +1916,7 @@ var app = (function () { attr_dev(div, "class", "target svelte-4yc66h"); set_style(div, "left", /*position*/ ctx[0].x + "px"); set_style(div, "top", /*position*/ ctx[0].y + "px"); - add_location(div, file$2, 4, 0, 49); + add_location(div, file$9, 4, 0, 49); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -1649,7 +1942,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$2.name, + id: create_fragment$9.name, type: "component", source: "", ctx @@ -1658,7 +1951,7 @@ var app = (function () { return block; } - function instance$2($$self, $$props, $$invalidate) { + function instance$9($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotTargetPortfromReact', slots, []); let { position } = $$props; @@ -1695,13 +1988,13 @@ var app = (function () { class MovingDotTargetPortfromReact extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$2, create_fragment$2, safe_not_equal, { position: 0 }); + init(this, options, instance$9, create_fragment$9, safe_not_equal, { position: 0 }); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotTargetPortfromReact", options, - id: create_fragment$2.name + id: create_fragment$9.name }); } @@ -1715,16 +2008,16 @@ var app = (function () { } /* src\MovingDotSpacePortfromReact.svelte generated by Svelte v3.59.2 */ - const file$1 = "src\\MovingDotSpacePortfromReact.svelte"; + const file$8 = "src\\MovingDotSpacePortfromReact.svelte"; - function get_each_context(ctx, list, i) { + function get_each_context$1(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[7] = list[i]; return child_ctx; } - // (31:4) {#each targets as target (target.name)} - function create_each_block(key_1, ctx) { + // (32:4) {#each targets as target (target.name)} + function create_each_block$1(key_1, ctx) { let first; let target; let t0; @@ -1750,7 +2043,7 @@ var app = (function () { set_style(span, "position", "absolute"); set_style(span, "left", /*target*/ ctx[7].x + "px"); set_style(span, "top", /*target*/ ctx[7].y + "px"); - add_location(span, file$1, 32, 8, 1368); + add_location(span, file$8, 33, 8, 1435); this.first = first; }, m: function mount(target$1, anchor) { @@ -1783,39 +2076,41 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block.name, + id: create_each_block$1.name, type: "each", - source: "(31:4) {#each targets as target (target.name)}", + source: "(32:4) {#each targets as target (target.name)}", ctx }); return block; } - // (37:4) {#if isModalOpen} - function create_if_block(ctx) { + // (38:4) {#if isModalOpen} + function create_if_block$5(ctx) { const block = { c: noop, m: noop, d: noop }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_if_block.name, + id: create_if_block$5.name, type: "if", - source: "(37:4) {#if isModalOpen}", + source: "(38:4) {#if isModalOpen}", ctx }); return block; } - function create_fragment$1(ctx) { - let div; + function create_fragment$8(ctx) { + let div1; + let div0; + let t1; let canvas_1; - let t0; + let t2; let movingdot; - let t1; + let t3; let each_blocks = []; let each_1_lookup = new Map(); - let t2; + let t4; let current; movingdot = new MovingDotPortfromReact({ @@ -1829,56 +2124,64 @@ var app = (function () { let each_value = /*targets*/ ctx[2]; validate_each_argument(each_value); const get_key = ctx => /*target*/ ctx[7].name; - validate_each_keys(ctx, each_value, get_each_context, get_key); + validate_each_keys(ctx, each_value, get_each_context$1, get_key); for (let i = 0; i < each_value.length; i += 1) { - let child_ctx = get_each_context(ctx, each_value, i); + let child_ctx = get_each_context$1(ctx, each_value, i); let key = get_key(child_ctx); - each_1_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx)); + each_1_lookup.set(key, each_blocks[i] = create_each_block$1(key, child_ctx)); } - let if_block = /*isModalOpen*/ ctx[4] && create_if_block(ctx); + let if_block = /*isModalOpen*/ ctx[4] && create_if_block$5(ctx); const block = { c: function create() { - div = element("div"); + div1 = element("div"); + div0 = element("div"); + div0.textContent = "Minor Game Events Log for player"; + t1 = space(); canvas_1 = element("canvas"); - t0 = space(); + t2 = space(); create_component(movingdot.$$.fragment); - t1 = space(); + t3 = space(); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - t2 = space(); + t4 = space(); if (if_block) if_block.c(); + attr_dev(div0, "id", "overlayText"); + attr_dev(div0, "class", "svelte-e0peue"); + add_location(div0, file$8, 28, 4, 1144); attr_dev(canvas_1, "width", "100%"); attr_dev(canvas_1, "height", "100%"); - add_location(canvas_1, file$1, 28, 4, 1157); - attr_dev(div, "style", /*spaceStyle*/ ctx[5]); - attr_dev(div, "tabindex", "0"); - add_location(div, file$1, 27, 0, 1114); + attr_dev(canvas_1, "tabindex", "0"); + add_location(canvas_1, file$8, 29, 4, 1211); + attr_dev(div1, "style", /*spaceStyle*/ ctx[5]); + add_location(div1, file$8, 27, 0, 1114); }, 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) { - insert_dev(target, div, anchor); - append_dev(div, canvas_1); + insert_dev(target, div1, anchor); + append_dev(div1, div0); + append_dev(div1, t1); + append_dev(div1, canvas_1); /*canvas_1_binding*/ ctx[6](canvas_1); - append_dev(div, t0); - mount_component(movingdot, div, null); - append_dev(div, t1); + append_dev(div1, t2); + mount_component(movingdot, div1, null); + append_dev(div1, t3); for (let i = 0; i < each_blocks.length; i += 1) { if (each_blocks[i]) { - each_blocks[i].m(div, null); + each_blocks[i].m(div1, null); } } - append_dev(div, t2); - if (if_block) if_block.m(div, null); + append_dev(div1, t4); + if (if_block) if_block.m(div1, null); current = true; }, p: function update(ctx, [dirty]) { @@ -1886,8 +2189,8 @@ var app = (function () { each_value = /*targets*/ ctx[2]; validate_each_argument(each_value); group_outros(); - validate_each_keys(ctx, each_value, get_each_context, get_key); - each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block, t2, get_each_context); + validate_each_keys(ctx, each_value, get_each_context$1, get_key); + each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div1, outro_and_destroy_block, create_each_block$1, t4, get_each_context$1); check_outros(); } }, @@ -1911,7 +2214,7 @@ var app = (function () { current = false; }, d: function destroy(detaching) { - if (detaching) detach_dev(div); + if (detaching) detach_dev(div1); /*canvas_1_binding*/ ctx[6](null); destroy_component(movingdot); @@ -1925,7 +2228,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$1.name, + id: create_fragment$8.name, type: "component", source: "", ctx @@ -1939,7 +2242,7 @@ var app = (function () { } // Collision logic // To open modal or adjust positions, update isModalOpen or dotPosition accordingly - function instance$1($$self, $$props, $$invalidate) { + function instance$8($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotSpacePortfromReact', slots, []); let canvas; @@ -2006,146 +2309,3084 @@ var app = (function () { class MovingDotSpacePortfromReact extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$1, create_fragment$1, safe_not_equal, {}); + init(this, options, instance$8, create_fragment$8, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotSpacePortfromReact", options, - id: create_fragment$1.name + id: create_fragment$8.name }); } } - /* src\App.svelte generated by Svelte v3.59.2 */ - const file = "src\\App.svelte"; + /* node_modules\svelte-youtube-embed\Button.svelte generated by Svelte v3.59.2 */ - function create_fragment(ctx) { - let main; - let h10; - let t0; - let t1; - let t2; - let t3; - let p; - let t4; - let a; - let t6; - let t7; - let h11; - let t9; - let nestedcommentstestfromreact; - let t10; - let videogradiocomponentbrainstorming; - let t11; - let hr; - let t12; - let dotgame; - let current; - nestedcommentstestfromreact = new NestedCommentsTestfromReact({ $$inline: true }); - videogradiocomponentbrainstorming = new VideoGradioComponentBrainstorming({ $$inline: true }); - dotgame = new MovingDotSpacePortfromReact({ $$inline: true }); + const file$7 = "node_modules\\svelte-youtube-embed\\Button.svelte"; + + // (9:0) {:else} + function create_else_block$1(ctx) { + let button; + let svg; + let path; + let mounted; + let dispose; const block = { c: function create() { - main = element("main"); - h10 = element("h1"); - t0 = text("Hello "); - t1 = text(/*name*/ ctx[0]); - t2 = text("!"); - t3 = space(); - p = element("p"); - t4 = text("Visit the "); - a = element("a"); - a.textContent = "Svelte tutorial"; - t6 = text(" to learn how to build Svelte apps."); - t7 = space(); - h11 = element("h1"); - h11.textContent = "My new component test"; - t9 = space(); - create_component(nestedcommentstestfromreact.$$.fragment); - t10 = space(); - create_component(videogradiocomponentbrainstorming.$$.fragment); - t11 = space(); - hr = element("hr"); - t12 = space(); - create_component(dotgame.$$.fragment); - attr_dev(h10, "class", "svelte-1tky8bj"); - add_location(h10, file, 9, 1, 281); - attr_dev(a, "href", "https://svelte.dev/tutorial"); - add_location(a, file, 10, 14, 318); - add_location(p, file, 10, 1, 305); - attr_dev(h11, "class", "svelte-1tky8bj"); - add_location(h11, file, 12, 1, 417); - add_location(hr, file, 15, 1, 521); - attr_dev(main, "class", "svelte-1tky8bj"); - add_location(main, file, 8, 0, 273); - }, - l: function claim(nodes) { - throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + button = element("button"); + svg = svg_element("svg"); + path = svg_element("path"); + attr_dev(path, "fill", "#ff4e45"); + attr_dev(path, "d", "m10 15 5.19-3L10 9v6m11.56-7.83c.13.47.22 1.1.28 1.9.07.8.1 1.49.1 2.09L22 12c0 2.19-.16 3.8-.44 4.83-.25.9-.83 1.48-1.73 1.73-.47.13-1.33.22-2.65.28-1.3.07-2.49.1-3.59.1L12 19c-4.19 0-6.8-.16-7.83-.44-.9-.25-1.48-.83-1.73-1.73-.13-.47-.22-1.1-.28-1.9-.07-.8-.1-1.49-.1-2.09L2 12c0-2.19.16-3.8.44-4.83.25-.9.83-1.48 1.73-1.73.47-.13 1.33-.22 2.65-.28 1.3-.07 2.49-.1 3.59-.1L12 5c4.19 0 6.8.16 7.83.44.9.25 1.48.83 1.73 1.73Z"); + add_location(path, file$7, 16, 6, 407); + attr_dev(svg, "xmlns", "http://www.w3.org/2000/svg"); + attr_dev(svg, "aria-hidden", "true"); + attr_dev(svg, "class", "iconify iconify--mdi"); + attr_dev(svg, "viewBox", "0 0 24 24"); + add_location(svg, file$7, 10, 5, 263); + attr_dev(button, "class", "play__btn svelte-1srk8gt"); + attr_dev(button, "aria-label", "Play YouTube video"); + add_location(button, file$7, 9, 2, 191); }, m: function mount(target, anchor) { - insert_dev(target, main, anchor); - append_dev(main, h10); - append_dev(h10, t0); - append_dev(h10, t1); - append_dev(h10, t2); - append_dev(main, t3); - append_dev(main, p); - append_dev(p, t4); - append_dev(p, a); - append_dev(p, t6); - append_dev(main, t7); - append_dev(main, h11); - append_dev(main, t9); - mount_component(nestedcommentstestfromreact, main, null); - append_dev(main, t10); - mount_component(videogradiocomponentbrainstorming, main, null); - append_dev(main, t11); - append_dev(main, hr); - append_dev(main, t12); - mount_component(dotgame, main, null); - current = true; - }, - p: function update(ctx, [dirty]) { - if (!current || dirty & /*name*/ 1) set_data_dev(t1, /*name*/ ctx[0]); - }, - i: function intro(local) { - if (current) return; - transition_in(nestedcommentstestfromreact.$$.fragment, local); - transition_in(videogradiocomponentbrainstorming.$$.fragment, local); - transition_in(dotgame.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(nestedcommentstestfromreact.$$.fragment, local); - transition_out(videogradiocomponentbrainstorming.$$.fragment, local); - transition_out(dotgame.$$.fragment, local); - current = false; + insert_dev(target, button, anchor); + append_dev(button, svg); + append_dev(svg, path); + + if (!mounted) { + dispose = listen_dev(button, "click", /*click_handler_1*/ ctx[4], false, false, false, false); + mounted = true; + } }, + p: noop, + i: noop, + o: noop, d: function destroy(detaching) { - if (detaching) detach_dev(main); - destroy_component(nestedcommentstestfromreact); - destroy_component(videogradiocomponentbrainstorming); - destroy_component(dotgame); + if (detaching) detach_dev(button); + mounted = false; + dispose(); } }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment.name, - type: "component", - source: "", + id: create_else_block$1.name, + type: "else", + source: "(9:0) {:else}", ctx }); return block; } - function instance($$self, $$props, $$invalidate) { - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots('App', slots, []); - let { name } = $$props; + // (5:0) {#if isCustomPlayButton} + function create_if_block$4(ctx) { + let button; + let current; + let mounted; + let dispose; + const default_slot_template = /*#slots*/ ctx[2].default; + const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[1], null); + + const block = { + c: function create() { + button = element("button"); + if (default_slot) default_slot.c(); + attr_dev(button, "class", "custom__play__btn svelte-1srk8gt"); + attr_dev(button, "aria-label", "Play YouTube video"); + add_location(button, file$7, 5, 2, 80); + }, + m: function mount(target, anchor) { + insert_dev(target, button, anchor); + + if (default_slot) { + default_slot.m(button, null); + } + + current = true; + + if (!mounted) { + dispose = listen_dev(button, "click", /*click_handler*/ ctx[3], false, false, false, false); + mounted = true; + } + }, + p: function update(ctx, dirty) { + if (default_slot) { + if (default_slot.p && (!current || dirty & /*$$scope*/ 2)) { + update_slot_base( + default_slot, + default_slot_template, + ctx, + /*$$scope*/ ctx[1], + !current + ? get_all_dirty_from_scope(/*$$scope*/ ctx[1]) + : get_slot_changes(default_slot_template, /*$$scope*/ ctx[1], dirty, null), + null + ); + } + } + }, + i: function intro(local) { + if (current) return; + transition_in(default_slot, local); + current = true; + }, + o: function outro(local) { + transition_out(default_slot, local); + current = false; + }, + d: function destroy(detaching) { + if (detaching) detach_dev(button); + if (default_slot) default_slot.d(detaching); + mounted = false; + dispose(); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_if_block$4.name, + type: "if", + source: "(5:0) {#if isCustomPlayButton}", + ctx + }); + + return block; + } + + function create_fragment$7(ctx) { + let current_block_type_index; + let if_block; + let if_block_anchor; + let current; + const if_block_creators = [create_if_block$4, create_else_block$1]; + const if_blocks = []; + + function select_block_type(ctx, dirty) { + if (/*isCustomPlayButton*/ ctx[0]) return 0; + return 1; + } + + current_block_type_index = select_block_type(ctx); + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + + const block = { + c: function create() { + if_block.c(); + if_block_anchor = empty(); + }, + 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) { + if_blocks[current_block_type_index].m(target, anchor); + insert_dev(target, if_block_anchor, anchor); + current = true; + }, + p: function update(ctx, [dirty]) { + let previous_block_index = current_block_type_index; + current_block_type_index = select_block_type(ctx); + + if (current_block_type_index === previous_block_index) { + if_blocks[current_block_type_index].p(ctx, dirty); + } 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(); + } else { + if_block.p(ctx, dirty); + } + + transition_in(if_block, 1); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + }, + i: function intro(local) { + if (current) return; + transition_in(if_block); + current = true; + }, + o: function outro(local) { + transition_out(if_block); + current = false; + }, + d: function destroy(detaching) { + if_blocks[current_block_type_index].d(detaching); + if (detaching) detach_dev(if_block_anchor); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_fragment$7.name, + type: "component", + source: "", + ctx + }); + + return block; + } + + function instance$7($$self, $$props, $$invalidate) { + let { $$slots: slots = {}, $$scope } = $$props; + validate_slots('Button', slots, ['default']); + let { isCustomPlayButton } = $$props; + + $$self.$$.on_mount.push(function () { + if (isCustomPlayButton === undefined && !('isCustomPlayButton' in $$props || $$self.$$.bound[$$self.$$.props['isCustomPlayButton']])) { + console.warn("