diff --git "a/bundle.js" "b/bundle.js" --- "a/bundle.js" +++ "b/bundle.js" @@ -217,9 +217,6 @@ var app = (function () { else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value); } - function to_number(value) { - return value === '' ? null : +value; - } function children(element) { return Array.from(element.childNodes); } @@ -936,17 +933,17 @@ var app = (function () { /* src\VideoGradioComponentBrainstorming.svelte generated by Svelte v3.59.2 */ - const { console: console_1$3 } = globals; - const file$c = "src\\VideoGradioComponentBrainstorming.svelte"; + const { console: console_1$6 } = globals; + const file$d = "src\\VideoGradioComponentBrainstorming.svelte"; - function get_each_context$3(ctx, list, i) { + function get_each_context$5(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$3(ctx) { + function create_each_block$5(ctx) { let option; let t_value = /*option*/ ctx[15] + ""; let t; @@ -957,7 +954,7 @@ var app = (function () { t = text(t_value); option.__value = /*option*/ ctx[15]; option.value = option.__value; - add_location(option, file$c, 85, 6, 2561); + add_location(option, file$d, 85, 6, 2561); }, m: function mount(target, anchor) { insert_dev(target, option, anchor); @@ -971,7 +968,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$3.name, + id: create_each_block$5.name, type: "each", source: "(85:4) {#each kitchenOptions as option}", ctx @@ -980,7 +977,7 @@ var app = (function () { return block; } - function create_fragment$c(ctx) { + function create_fragment$d(ctx) { let h1; let t1; let div1; @@ -1007,7 +1004,7 @@ var app = (function () { 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)); + each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i)); } const block = { @@ -1037,34 +1034,34 @@ var app = (function () { each_blocks[i].c(); } - add_location(h1, file$c, 66, 0, 1800); + add_location(h1, file$d, 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$c, 72, 4, 2006); + add_location(track, file$d, 72, 4, 2006); attr_dev(video, "id", "videoCanvas"); video.autoplay = true; attr_dev(video, "class", "svelte-ufd3fo"); - add_location(video, file$c, 70, 2, 1965); + add_location(video, file$d, 70, 2, 1965); attr_dev(div0, "id", "overlayText"); attr_dev(div0, "class", "svelte-ufd3fo"); - add_location(div0, file$c, 74, 2, 2111); + add_location(div0, file$d, 74, 2, 2111); attr_dev(div1, "id", "videoContainer"); attr_dev(div1, "class", "svelte-ufd3fo"); - add_location(div1, file$c, 68, 0, 1911); + add_location(div1, file$d, 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$c, 77, 0, 2186); + add_location(canvas_1, file$d, 77, 0, 2186); attr_dev(input, "type", "text"); - add_location(input, file$c, 78, 0, 2294); - add_location(button, file$c, 82, 2, 2429); + add_location(input, file$d, 78, 0, 2294); + add_location(button, file$d, 82, 2, 2429); if (/*selectedOption*/ ctx[0] === void 0) add_render_callback(() => /*select_change_handler*/ ctx[9].call(select)); - add_location(select, file$c, 83, 2, 2479); + add_location(select, file$d, 83, 2, 2479); attr_dev(div2, "id", "frameForButtons"); - add_location(div2, file$c, 81, 0, 2399); + add_location(div2, file$d, 81, 0, 2399); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -1123,12 +1120,12 @@ var app = (function () { let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$3(ctx, each_value, i); + const child_ctx = get_each_context$5(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$3(child_ctx); + each_blocks[i] = create_each_block$5(child_ctx); each_blocks[i].c(); each_blocks[i].m(select, null); } @@ -1166,7 +1163,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$c.name, + id: create_fragment$d.name, type: "component", source: "", ctx @@ -1179,7 +1176,7 @@ var app = (function () { } // Logic for 'Test OCR' button - function instance$c($$self, $$props, $$invalidate) { + function instance$d($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('VideoGradioComponentBrainstorming', slots, []); let selectedOption = 'Stove - lu'; // default value @@ -1241,7 +1238,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$3.warn(` was created with unknown prop '${key}'`); + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$6.warn(` was created with unknown prop '${key}'`); }); function canvas_1_binding($$value) { @@ -1312,13 +1309,13 @@ var app = (function () { class VideoGradioComponentBrainstorming extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$c, create_fragment$c, safe_not_equal, {}); + init(this, options, instance$d, create_fragment$d, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "VideoGradioComponentBrainstorming", options, - id: create_fragment$c.name + id: create_fragment$d.name }); } } @@ -1389,9 +1386,11 @@ var app = (function () { } /* src\NestedCommentsTestfromReact.svelte generated by Svelte v3.59.2 */ - const file$b = "src\\NestedCommentsTestfromReact.svelte"; - function get_each_context$2(ctx, list, i) { + const { console: console_1$5 } = globals; + const file$c = "src\\NestedCommentsTestfromReact.svelte"; + + function get_each_context$4(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[6] = list[i]; return child_ctx; @@ -1403,8 +1402,8 @@ var app = (function () { return child_ctx; } - // (29:12) {#if comment.items} - function create_if_block$6(ctx) { + // (31:12) {#if comment.items} + function create_if_block$7(ctx) { let each_1_anchor; let each_value_1 = /*comment*/ ctx[6].items; validate_each_argument(each_value_1); @@ -1464,16 +1463,16 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_if_block$6.name, + id: create_if_block$7.name, type: "if", - source: "(29:12) {#if comment.items}", + source: "(31:12) {#if comment.items}", ctx }); return block; } - // (30:16) {#each comment.items as item} + // (32:16) {#each comment.items as item} function create_each_block_1$1(ctx) { let t0_value = /*item*/ ctx[9].title + ""; let t0; @@ -1501,15 +1500,15 @@ var app = (function () { block, id: create_each_block_1$1.name, type: "each", - source: "(30:16) {#each comment.items as item}", + source: "(32:16) {#each comment.items as item}", ctx }); return block; } - // (23:4) {#each comments as comment} - function create_each_block$2(ctx) { + // (25:4) {#each comments as comment} + function create_each_block$4(ctx) { let div1; let div0; let span; @@ -1527,7 +1526,7 @@ var app = (function () { return /*click_handler*/ ctx[5](/*comment*/ ctx[6]); } - let if_block = /*comment*/ ctx[6].items && create_if_block$6(ctx); + let if_block = /*comment*/ ctx[6].items && create_if_block$7(ctx); const block = { c: function create() { @@ -1542,13 +1541,13 @@ var app = (function () { if (if_block) if_block.c(); t4 = space(); attr_dev(span, "class", "text"); - add_location(span, file$b, 25, 16, 818); - add_location(button, file$b, 26, 16, 877); + add_location(span, file$c, 27, 16, 925); + add_location(button, file$c, 28, 16, 984); attr_dev(div0, "class", "card"); - add_location(div0, file$b, 24, 12, 782); + add_location(div0, file$c, 26, 12, 889); attr_dev(div1, "key", div1_key_value = /*comment*/ ctx[6].id); set_style(div1, "margin-left", "20px"); - add_location(div1, file$b, 23, 8, 719); + add_location(div1, file$c, 25, 8, 826); }, m: function mount(target, anchor) { insert_dev(target, div1, anchor); @@ -1574,7 +1573,7 @@ var app = (function () { if (if_block) { if_block.p(ctx, dirty); } else { - if_block = create_if_block$6(ctx); + if_block = create_if_block$7(ctx); if_block.c(); if_block.m(div1, t4); } @@ -1597,22 +1596,24 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$2.name, + id: create_each_block$4.name, type: "each", - source: "(23:4) {#each comments as comment}", + source: "(25:4) {#each comments as comment}", ctx }); return block; } - function create_fragment$b(ctx) { + function create_fragment$c(ctx) { let div1; + let h1; + let t1; let div0; let input; - let t0; - let button; let t2; + let button; + let t4; let mounted; let dispose; let each_value = /*comments*/ ctx[0]; @@ -1620,42 +1621,48 @@ 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$4(get_each_context$4(ctx, each_value, i)); } const block = { c: function create() { div1 = element("div"); + h1 = element("h1"); + h1.textContent = "Nested Comments Idea for LLM Branching ideas/discussions/etc."; + t1 = space(); div0 = element("div"); input = element("input"); - t0 = space(); + t2 = space(); button = element("button"); button.textContent = "Post Comment"; - t2 = space(); + t4 = space(); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } + add_location(h1, file$c, 19, 4, 546); attr_dev(input, "type", "text"); attr_dev(input, "placeholder", "Add a comment"); - add_location(input, file$b, 19, 8, 530); - add_location(button, file$b, 20, 8, 613); - add_location(div0, file$b, 18, 4, 515); + add_location(input, file$c, 21, 8, 637); + add_location(button, file$c, 22, 8, 720); + add_location(div0, file$c, 20, 4, 622); attr_dev(div1, "id", "comment-container"); - add_location(div1, file$b, 17, 0, 481); + add_location(div1, file$c, 18, 0, 512); }, 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, div1, anchor); + append_dev(div1, h1); + append_dev(div1, t1); append_dev(div1, div0); append_dev(div0, input); set_input_value(input, /*newComment*/ ctx[1]); - append_dev(div0, t0); + append_dev(div0, t2); append_dev(div0, button); - append_dev(div1, t2); + append_dev(div1, t4); for (let i = 0; i < each_blocks.length; i += 1) { if (each_blocks[i]) { @@ -1683,12 +1690,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$4(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$4(child_ctx); each_blocks[i].c(); each_blocks[i].m(div1, null); } @@ -1713,7 +1720,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$b.name, + id: create_fragment$c.name, type: "component", source: "", ctx @@ -1722,7 +1729,7 @@ var app = (function () { return block; } - function instance$b($$self, $$props, $$invalidate) { + function instance$c($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('NestedCommentsTestfromReact', slots, []); let comments = []; @@ -1739,6 +1746,7 @@ var app = (function () { ]); $$invalidate(1, newComment = ''); + console.log(comments); }; const addReply = (comment, replyText) => { @@ -1754,7 +1762,7 @@ var app = (function () { const writable_props = []; Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`); + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$5.warn(` was created with unknown prop '${key}'`); }); function input_input_handler() { @@ -1788,13 +1796,13 @@ var app = (function () { class NestedCommentsTestfromReact extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$b, create_fragment$b, safe_not_equal, {}); + init(this, options, instance$c, create_fragment$c, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "NestedCommentsTestfromReact", options, - id: create_fragment$b.name + id: create_fragment$c.name }); } } @@ -1848,44 +1856,47 @@ var app = (function () { } /* src\MovingDotPortfromReact.svelte generated by Svelte v3.59.2 */ - const file$a = "src\\MovingDotPortfromReact.svelte"; + const file$b = "src\\MovingDotPortfromReact.svelte"; - function create_fragment$a(ctx) { - let div; + function create_fragment$b(ctx) { + let button; const block = { c: function create() { - div = element("div"); - 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$a, 47, 0, 1709); + button = element("button"); + attr_dev(button, "class", "MovingDot svelte-1mg0qyd"); + set_style(button, "left", /*position*/ ctx[0].x + "px"); + set_style(button, "top", /*position*/ ctx[0].y + "px"); + attr_dev(button, "tabindex", "0"); + add_location(button, file$b, 48, 0, 1573); }, 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); + insert_dev(target, button, anchor); + /*button_binding*/ ctx[4](button); }, p: function update(ctx, [dirty]) { if (dirty & /*position*/ 1) { - set_style(div, "left", /*position*/ ctx[0].x + "px"); + set_style(button, "left", /*position*/ ctx[0].x + "px"); } if (dirty & /*position*/ 1) { - set_style(div, "top", /*position*/ ctx[0].y + "px"); + set_style(button, "top", /*position*/ ctx[0].y + "px"); } }, i: noop, o: noop, d: function destroy(detaching) { - if (detaching) detach_dev(div); + if (detaching) detach_dev(button); + /*button_binding*/ ctx[4](null); } }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$a.name, + id: create_fragment$b.name, type: "component", source: "", ctx @@ -1896,17 +1907,15 @@ var app = (function () { const step = 10; - function instance$a($$self, $$props, $$invalidate) { + function instance$b($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotPortfromReact', slots, []); let { position = { x: 0, y: 0 } } = $$props; let { boundaries = { minX: 0, maxX: 100, minY: 0, maxY: 100 } } = $$props; const dispatch = createEventDispatcher(); + let dotElement; // Reference to the dot element function moveDot(newX, newY) { - // Calculate new position here - let newPosition = { x: newX, y: newY }; - // Update position with a new object for Svelte reactivity let boundedX = Math.max(boundaries.minX, Math.min(newX, boundaries.maxX)); @@ -1916,7 +1925,7 @@ var app = (function () { $$invalidate(0, position = { x: boundedX, y: boundedY }); // Dispatch the move event with the new position - dispatch('move', newPosition); + dispatch('move', position); } const handleKeyPress = e => { @@ -1940,16 +1949,19 @@ var app = (function () { } moveDot(newX, newY); - }; // // Restrict movement within boundaries - // if (newX >= boundaries.minX && newX <= boundaries.maxX) position.x = newX; - // if (newY >= boundaries.minY && newY <= boundaries.maxY) position.y = newY; + }; + + function focusDot() { + //On click for the space its imported into + dotElement.focus(); + } onMount(() => { - window.addEventListener('keydown', handleKeyPress); + dotElement.addEventListener('keydown', handleKeyPress); + }); - return () => { - window.removeEventListener('keydown', handleKeyPress); - }; + onDestroy(() => { + dotElement.removeEventListener('keydown', handleKeyPress); }); const writable_props = ['position', 'boundaries']; @@ -1958,44 +1970,55 @@ var app = (function () { if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`); }); + function button_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + dotElement = $$value; + $$invalidate(1, dotElement); + }); + } + $$self.$$set = $$props => { if ('position' in $$props) $$invalidate(0, position = $$props.position); - if ('boundaries' in $$props) $$invalidate(1, boundaries = $$props.boundaries); + if ('boundaries' in $$props) $$invalidate(2, boundaries = $$props.boundaries); }; $$self.$capture_state = () => ({ onMount, + onDestroy, createEventDispatcher, position, boundaries, step, dispatch, + dotElement, moveDot, - handleKeyPress + handleKeyPress, + focusDot }); $$self.$inject_state = $$props => { if ('position' in $$props) $$invalidate(0, position = $$props.position); - if ('boundaries' in $$props) $$invalidate(1, boundaries = $$props.boundaries); + if ('boundaries' in $$props) $$invalidate(2, boundaries = $$props.boundaries); + if ('dotElement' in $$props) $$invalidate(1, dotElement = $$props.dotElement); }; if ($$props && "$$inject" in $$props) { $$self.$inject_state($$props.$$inject); } - return [position, boundaries]; + return [position, dotElement, boundaries, focusDot, button_binding]; } class MovingDotPortfromReact extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$a, create_fragment$a, safe_not_equal, { position: 0, boundaries: 1 }); + init(this, options, instance$b, create_fragment$b, safe_not_equal, { position: 0, boundaries: 2, focusDot: 3 }); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotPortfromReact", options, - id: create_fragment$a.name + id: create_fragment$b.name }); } @@ -2014,13 +2037,21 @@ var app = (function () { set boundaries(value) { throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); } + + get focusDot() { + return this.$$.ctx[3]; + } + + set focusDot(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } } /* src\MovingDotTargetPortfromReact.svelte generated by Svelte v3.59.2 */ - const file$9 = "src\\MovingDotTargetPortfromReact.svelte"; + const file$a = "src\\MovingDotTargetPortfromReact.svelte"; - function create_fragment$9(ctx) { + function create_fragment$a(ctx) { let div; const block = { @@ -2029,7 +2060,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$9, 4, 0, 49); + add_location(div, file$a, 4, 0, 49); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -2055,7 +2086,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$9.name, + id: create_fragment$a.name, type: "component", source: "", ctx @@ -2064,7 +2095,7 @@ var app = (function () { return block; } - function instance$9($$self, $$props, $$invalidate) { + function instance$a($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotTargetPortfromReact', slots, []); let { position } = $$props; @@ -2101,13 +2132,13 @@ var app = (function () { class MovingDotTargetPortfromReact extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$9, create_fragment$9, safe_not_equal, { position: 0 }); + init(this, options, instance$a, create_fragment$a, safe_not_equal, { position: 0 }); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotTargetPortfromReact", options, - id: create_fragment$9.name + id: create_fragment$a.name }); } @@ -2120,273 +2151,236 @@ var app = (function () { } } - /* src\MovingDotSpacePortfromReact.svelte generated by Svelte v3.59.2 */ + /* src\SimpleModal.svelte generated by Svelte v3.59.2 */ - const { console: console_1$2 } = globals; - const file$8 = "src\\MovingDotSpacePortfromReact.svelte"; + const { console: console_1$4 } = globals; + const file$9 = "src\\SimpleModal.svelte"; - function get_each_context$1(ctx, list, i) { + function get_each_context$3(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[13] = list[i]; + child_ctx[8] = list[i]; return child_ctx; } - // (70:4) {#each $targets as target (target.name)} - function create_each_block$1(key_1, ctx) { - let first; - let target; + // (22:0) {#if isOpen} + function create_if_block$6(ctx) { + let div3; + let div2; + let div0; + let h2; let t0; - let span; - let t1_value = /*target*/ ctx[13].name + ""; let t1; - let current; + let button; + let t3; + let div1; + let t4; + let t5; + let ul; + let mounted; + let dispose; + let each_value = /*items*/ ctx[3]; + validate_each_argument(each_value); + let each_blocks = []; - target = new MovingDotTargetPortfromReact({ - props: { position: /*target*/ ctx[13] }, - $$inline: true - }); + 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)); + } const block = { - key: key_1, - first: null, c: function create() { - first = empty(); - create_component(target.$$.fragment); - t0 = space(); - span = element("span"); - t1 = text(t1_value); - set_style(span, "position", "absolute"); - set_style(span, "left", /*target*/ ctx[13].x + "px"); - set_style(span, "top", /*target*/ ctx[13].y + "px"); - add_location(span, file$8, 71, 8, 3555); - this.first = first; - }, - m: function mount(target$1, anchor) { - insert_dev(target$1, first, anchor); - mount_component(target, target$1, anchor); - insert_dev(target$1, t0, anchor); - insert_dev(target$1, span, anchor); - append_dev(span, t1); - current = true; + div3 = element("div"); + div2 = element("div"); + div0 = element("div"); + h2 = element("h2"); + t0 = text(/*title*/ ctx[1]); + t1 = space(); + button = element("button"); + button.textContent = "×"; + t3 = space(); + div1 = element("div"); + t4 = text(/*content*/ ctx[2]); + t5 = space(); + ul = element("ul"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + add_location(h2, file$9, 25, 8, 651); + add_location(button, file$9, 26, 8, 677); + attr_dev(div0, "class", "modal-header svelte-m51ous"); + add_location(div0, file$9, 24, 6, 615); + attr_dev(ul, "class", "modal-items"); + add_location(ul, file$9, 30, 8, 801); + attr_dev(div1, "class", "modal-content svelte-m51ous"); + add_location(div1, file$9, 28, 6, 745); + attr_dev(div2, "class", "modal svelte-m51ous"); + add_location(div2, file$9, 23, 4, 588); + attr_dev(div3, "class", "modal-overlay svelte-m51ous"); + add_location(div3, file$9, 22, 2, 555); }, - p: function update(new_ctx, dirty) { - ctx = new_ctx; - const target_changes = {}; - if (dirty & /*$targets*/ 8) target_changes.position = /*target*/ ctx[13]; - target.$set(target_changes); - if ((!current || dirty & /*$targets*/ 8) && t1_value !== (t1_value = /*target*/ ctx[13].name + "")) set_data_dev(t1, t1_value); + m: function mount(target, anchor) { + insert_dev(target, div3, anchor); + append_dev(div3, div2); + append_dev(div2, div0); + append_dev(div0, h2); + append_dev(h2, t0); + append_dev(div0, t1); + append_dev(div0, button); + append_dev(div2, t3); + append_dev(div2, div1); + append_dev(div1, t4); + append_dev(div1, t5); + append_dev(div1, ul); - if (!current || dirty & /*$targets*/ 8) { - set_style(span, "left", /*target*/ ctx[13].x + "px"); + for (let i = 0; i < each_blocks.length; i += 1) { + if (each_blocks[i]) { + each_blocks[i].m(ul, null); + } } - if (!current || dirty & /*$targets*/ 8) { - set_style(span, "top", /*target*/ ctx[13].y + "px"); + if (!mounted) { + dispose = listen_dev(button, "click", /*closeModal*/ ctx[4], false, false, false, false); + mounted = true; } }, - i: function intro(local) { - if (current) return; - transition_in(target.$$.fragment, local); - current = true; - }, - o: function outro(local) { - transition_out(target.$$.fragment, local); - current = false; + p: function update(ctx, dirty) { + if (dirty & /*title*/ 2) set_data_dev(t0, /*title*/ ctx[1]); + if (dirty & /*content*/ 4) set_data_dev(t4, /*content*/ ctx[2]); + + if (dirty & /*handleItemClick, items*/ 40) { + each_value = /*items*/ ctx[3]; + validate_each_argument(each_value); + 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(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block$3(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(ul, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value.length; + } }, d: function destroy(detaching) { - if (detaching) detach_dev(first); - destroy_component(target, detaching); - if (detaching) detach_dev(t0); - if (detaching) detach_dev(span); + if (detaching) detach_dev(div3); + destroy_each(each_blocks, detaching); + mounted = false; + dispose(); } }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$1.name, - type: "each", - source: "(70:4) {#each $targets as target (target.name)}", + id: create_if_block$6.name, + type: "if", + source: "(22:0) {#if isOpen}", ctx }); return block; } - // (76:4) {#if isModalOpen} - function create_if_block$5(ctx) { - const block = { c: noop, m: noop, d: noop }; + // (32:10) {#each items as item} + function create_each_block$3(ctx) { + let button; + let t_value = /*item*/ ctx[8].label + ""; + let t; + let mounted; + let dispose; + + function click_handler() { + return /*click_handler*/ ctx[7](/*item*/ ctx[8]); + } + + const block = { + c: function create() { + button = element("button"); + t = text(t_value); + add_location(button, file$9, 32, 12, 872); + }, + m: function mount(target, anchor) { + insert_dev(target, button, anchor); + append_dev(button, t); + + if (!mounted) { + dispose = listen_dev(button, "click", click_handler, false, false, false, false); + mounted = true; + } + }, + p: function update(new_ctx, dirty) { + ctx = new_ctx; + if (dirty & /*items*/ 8 && t_value !== (t_value = /*item*/ ctx[8].label + "")) set_data_dev(t, t_value); + }, + d: function destroy(detaching) { + if (detaching) detach_dev(button); + mounted = false; + dispose(); + } + }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_if_block$5.name, - type: "if", - source: "(76:4) {#if isModalOpen}", + id: create_each_block$3.name, + type: "each", + source: "(32:10) {#each items as item}", ctx }); return block; } - function create_fragment$8(ctx) { - let div1; - let div0; - let t0; - let t1_value = /*$dotPosition*/ ctx[0].x + ""; - let t1; - let t2; - let t3_value = /*$dotPosition*/ ctx[0].y + ""; - let t3; - let t4; - let canvas_1; - let t5; - let movingdot; - let t6; - let each_blocks = []; - let each_1_lookup = new Map(); - let t7; - let current; - - movingdot = new MovingDotPortfromReact({ - props: { - position: /*$dotPosition*/ ctx[0], - boundaries: /*boundaries*/ ctx[6] - }, - $$inline: true - }); - - movingdot.$on("move", /*move_handler*/ ctx[10]); - let each_value = /*$targets*/ ctx[3]; - validate_each_argument(each_value); - const get_key = ctx => /*target*/ ctx[13].name; - 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$1(ctx, each_value, i); - let key = get_key(child_ctx); - each_1_lookup.set(key, each_blocks[i] = create_each_block$1(key, child_ctx)); - } - - let if_block = /*isModalOpen*/ ctx[2] && create_if_block$5(ctx); + function create_fragment$9(ctx) { + let if_block_anchor; + let if_block = /*isOpen*/ ctx[0] && create_if_block$6(ctx); const block = { c: function create() { - div1 = element("div"); - div0 = element("div"); - t0 = text("Minor Game Events Log for player ||| Position for Developer "); - t1 = text(t1_value); - t2 = space(); - t3 = text(t3_value); - t4 = space(); - canvas_1 = element("canvas"); - t5 = space(); - create_component(movingdot.$$.fragment); - t6 = space(); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - t7 = space(); if (if_block) if_block.c(); - attr_dev(div0, "id", "overlayText"); - attr_dev(div0, "class", "svelte-e0peue"); - add_location(div0, file$8, 66, 4, 3145); - attr_dev(canvas_1, "width", "100%"); - attr_dev(canvas_1, "height", "100%"); - attr_dev(canvas_1, "tabindex", "0"); - add_location(canvas_1, file$8, 67, 4, 3273); - attr_dev(div1, "style", /*spaceStyle*/ ctx[8]); - add_location(div1, file$8, 65, 0, 3115); + 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) { - insert_dev(target, div1, anchor); - append_dev(div1, div0); - append_dev(div0, t0); - append_dev(div0, t1); - append_dev(div0, t2); - append_dev(div0, t3); - append_dev(div1, t4); - append_dev(div1, canvas_1); - /*canvas_1_binding*/ ctx[9](canvas_1); - append_dev(div1, t5); - mount_component(movingdot, div1, null); - append_dev(div1, t6); - - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(div1, null); - } - } - - append_dev(div1, t7); - if (if_block) if_block.m(div1, null); - current = true; + if (if_block) if_block.m(target, anchor); + insert_dev(target, if_block_anchor, anchor); }, p: function update(ctx, [dirty]) { - if ((!current || dirty & /*$dotPosition*/ 1) && t1_value !== (t1_value = /*$dotPosition*/ ctx[0].x + "")) set_data_dev(t1, t1_value); - if ((!current || dirty & /*$dotPosition*/ 1) && t3_value !== (t3_value = /*$dotPosition*/ ctx[0].y + "")) set_data_dev(t3, t3_value); - const movingdot_changes = {}; - if (dirty & /*$dotPosition*/ 1) movingdot_changes.position = /*$dotPosition*/ ctx[0]; - movingdot.$set(movingdot_changes); - - if (dirty & /*$targets*/ 8) { - each_value = /*$targets*/ ctx[3]; - validate_each_argument(each_value); - group_outros(); - 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, t7, get_each_context$1); - check_outros(); - } - - if (/*isModalOpen*/ ctx[2]) { - if (if_block) ; else { - if_block = create_if_block$5(ctx); + if (/*isOpen*/ ctx[0]) { + if (if_block) { + if_block.p(ctx, dirty); + } else { + if_block = create_if_block$6(ctx); if_block.c(); - if_block.m(div1, null); + if_block.m(if_block_anchor.parentNode, if_block_anchor); } } else if (if_block) { if_block.d(1); if_block = null; } }, - i: function intro(local) { - if (current) return; - transition_in(movingdot.$$.fragment, local); - - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - - current = true; - }, - o: function outro(local) { - transition_out(movingdot.$$.fragment, local); - - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - - current = false; - }, + i: noop, + o: noop, d: function destroy(detaching) { - if (detaching) detach_dev(div1); - /*canvas_1_binding*/ ctx[9](null); - destroy_component(movingdot); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].d(); - } - - if (if_block) if_block.d(); + if (if_block) if_block.d(detaching); + if (detaching) detach_dev(if_block_anchor); } }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$8.name, + id: create_fragment$9.name, type: "component", source: "", ctx @@ -2395,414 +2389,477 @@ var app = (function () { return block; } - function instance$8($$self, $$props, $$invalidate) { - let $dotPosition; - let $targets; + function instance$9($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; - validate_slots('MovingDotSpacePortfromReact', slots, []); - let canvas; - let dotPosition = writable({ x: 900, y: 450 }); - validate_store(dotPosition, 'dotPosition'); - component_subscribe($$self, dotPosition, value => $$invalidate(0, $dotPosition = value)); + validate_slots('SimpleModal', slots, []); + let { isOpen = false } = $$props; + let { title = '' } = $$props; + let { content = '' } = $$props; + let { items = [] } = $$props; + let { onClose } = $$props; - let targets = writable([ - { - name: "Target 1", - x: 50, - y: 50, - collisionType: "alert", - collisiontext: "First Test" - }, - { - name: "Target 2", - x: 100, - y: 100, - collisionType: "", - collisiontext: "" - }, - { - name: "Entrance", - x: 995, - y: 660, - collisionType: "", - collisiontext: "" - }, - // Add more targets as needed - { - name: "Market Stall", - x: 200, - y: 300, - collisionType: "", - collisiontext: "" - }, - { - name: "Inn Entrance", // A market stall in the bustling market area. - x: 400, - y: 450, - collisionType: "", - collisiontext: "" - }, - { - name: "Town Hall", // The entrance to the inn for rest or information. - x: 600, - y: 350, - collisionType: "", - collisiontext: "" - }, - { - name: "Fountain", // The entrance to the town hall for quests. - x: 500, - y: 500, - collisionType: "", - collisiontext: "" - }, - { - name: "Bridge", // A fountain in the town square as a meeting point. - x: 1100, - y: 700, - collisionType: "", - collisiontext: "" - }, - { - name: "Waterfall", // A bridge in the mystical forest area. - x: 1300, - y: 800, - collisionType: "", - collisiontext: "" - }, - { - name: "Mountain Peak", // A waterfall that could hide secrets or treasures. - x: 1500, - y: 100, - collisionType: "", - collisiontext: "" + function closeModal() { + if (onClose) { + onClose(); } - ]); + } - validate_store(targets, 'targets'); - component_subscribe($$self, targets, value => $$invalidate(3, $targets = value)); - let boundaries = { maxX: 1885, maxY: 900, minX: 0, minY: 0 }; - let isModalOpen = false; + function handleItemClick(item) { + // You can define what happens when an item is clicked, e.g., close modal, trigger an event, etc. + console.log("Item clicked:", item); - function updateDotPosition(newX, newY) { - dotPosition.set({ x: newX, y: newY }); + closeModal(); } - // Collision check function - const checkCollision = dotPos => { - $targets.forEach(target => { - if (dotPos.x < target.x + 10 && dotPos.x + 10 > target.x && dotPos.y < target.y + 10 && dotPos.y + 10 > target.y) { - handleCollision(target); - } - }); - }; - - // Handle collision based on the target object - const handleCollision = target => { - switch (target.collisionType) { - case "": - console.log("Nothing Happenedddd"); - break; - case "alert": - alert(target.collisiontext); - break; - case "modal": - $$invalidate(2, isModalOpen = true); - break; - } // Handle other permanent UI elements here - }; // ... + $$self.$$.on_mount.push(function () { + if (onClose === undefined && !('onClose' in $$props || $$self.$$.bound[$$self.$$.props['onClose']])) { + console_1$4.warn(" was created without expected prop 'onClose'"); + } + }); - const spaceStyle = `position: relative; width: 100%; height: 100vh; border: 1px solid black; overflow: hidden; background-image: url('/AutoGameBackgrounds/1stGameLoc123.png'); background-size: cover; background-position: center;`; - const writable_props = []; + const writable_props = ['isOpen', 'title', 'content', 'items', 'onClose']; Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$2.warn(` was created with unknown prop '${key}'`); + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$4.warn(` was created with unknown prop '${key}'`); }); - function canvas_1_binding($$value) { - binding_callbacks[$$value ? 'unshift' : 'push'](() => { - canvas = $$value; - $$invalidate(1, canvas); - }); - } + const click_handler = item => handleItemClick(item); - const move_handler = e => updateDotPosition(e.detail.x, e.detail.y); + $$self.$$set = $$props => { + if ('isOpen' in $$props) $$invalidate(0, isOpen = $$props.isOpen); + if ('title' in $$props) $$invalidate(1, title = $$props.title); + if ('content' in $$props) $$invalidate(2, content = $$props.content); + if ('items' in $$props) $$invalidate(3, items = $$props.items); + if ('onClose' in $$props) $$invalidate(6, onClose = $$props.onClose); + }; $$self.$capture_state = () => ({ - onMount, - writable, - MovingDot: MovingDotPortfromReact, - Target: MovingDotTargetPortfromReact, - canvas, - dotPosition, - targets, - boundaries, - isModalOpen, - updateDotPosition, - checkCollision, - handleCollision, - spaceStyle, - $dotPosition, - $targets + isOpen, + title, + content, + items, + onClose, + closeModal, + handleItemClick }); $$self.$inject_state = $$props => { - if ('canvas' in $$props) $$invalidate(1, canvas = $$props.canvas); - if ('dotPosition' in $$props) $$invalidate(4, dotPosition = $$props.dotPosition); - if ('targets' in $$props) $$invalidate(5, targets = $$props.targets); - if ('boundaries' in $$props) $$invalidate(6, boundaries = $$props.boundaries); - if ('isModalOpen' in $$props) $$invalidate(2, isModalOpen = $$props.isModalOpen); + if ('isOpen' in $$props) $$invalidate(0, isOpen = $$props.isOpen); + if ('title' in $$props) $$invalidate(1, title = $$props.title); + if ('content' in $$props) $$invalidate(2, content = $$props.content); + if ('items' in $$props) $$invalidate(3, items = $$props.items); + if ('onClose' in $$props) $$invalidate(6, onClose = $$props.onClose); }; if ($$props && "$$inject" in $$props) { $$self.$inject_state($$props.$$inject); } - $$self.$$.update = () => { - if ($$self.$$.dirty & /*$dotPosition*/ 1) { - // Reactive statement to check collision whenever dotPosition changes - $dotPosition && checkCollision($dotPosition); - } - }; - return [ - $dotPosition, - canvas, - isModalOpen, - $targets, - dotPosition, - targets, - boundaries, - updateDotPosition, - spaceStyle, - canvas_1_binding, - move_handler + isOpen, + title, + content, + items, + closeModal, + handleItemClick, + onClose, + click_handler ]; } - class MovingDotSpacePortfromReact extends SvelteComponentDev { + class SimpleModal extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$8, create_fragment$8, safe_not_equal, {}); + + init(this, options, instance$9, create_fragment$9, safe_not_equal, { + isOpen: 0, + title: 1, + content: 2, + items: 3, + onClose: 6 + }); dispatch_dev("SvelteRegisterComponent", { component: this, - tagName: "MovingDotSpacePortfromReact", + tagName: "SimpleModal", options, - id: create_fragment$8.name + id: create_fragment$9.name }); } + + get isOpen() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set isOpen(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get title() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set title(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get content() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set content(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get items() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set items(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get onClose() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set onClose(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } } - /* node_modules\svelte-youtube-embed\Button.svelte generated by Svelte v3.59.2 */ + /* src\MovingDotSpacePortfromReact.svelte generated by Svelte v3.59.2 */ - const file$7 = "node_modules\\svelte-youtube-embed\\Button.svelte"; + const { console: console_1$3 } = globals; + const file$8 = "src\\MovingDotSpacePortfromReact.svelte"; - // (9:0) {:else} - function create_else_block$1(ctx) { - let button; - let svg; - let path; - let mounted; - let dispose; + function get_each_context$2(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[19] = list[i]; + return child_ctx; + } + + // (155:4) {#each $targets as target (target.name)} + function create_each_block$2(key_1, ctx) { + let first; + let target; + let t0; + let span; + let t1_value = /*target*/ ctx[19].name + ""; + let t1; + let current; + + target = new MovingDotTargetPortfromReact({ + props: { position: /*target*/ ctx[19] }, + $$inline: true + }); const block = { + key: key_1, + first: null, c: function create() { - 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); + first = empty(); + create_component(target.$$.fragment); + t0 = space(); + span = element("span"); + t1 = text(t1_value); + set_style(span, "position", "absolute"); + set_style(span, "left", /*target*/ ctx[19].x + "px"); + set_style(span, "top", /*target*/ ctx[19].y + "px"); + add_location(span, file$8, 156, 8, 7641); + this.first = first; }, - m: function mount(target, anchor) { - insert_dev(target, button, anchor); - append_dev(button, svg); - append_dev(svg, path); + m: function mount(target$1, anchor) { + insert_dev(target$1, first, anchor); + mount_component(target, target$1, anchor); + insert_dev(target$1, t0, anchor); + insert_dev(target$1, span, anchor); + append_dev(span, t1); + current = true; + }, + p: function update(new_ctx, dirty) { + ctx = new_ctx; + const target_changes = {}; + if (dirty & /*$targets*/ 64) target_changes.position = /*target*/ ctx[19]; + target.$set(target_changes); + if ((!current || dirty & /*$targets*/ 64) && t1_value !== (t1_value = /*target*/ ctx[19].name + "")) set_data_dev(t1, t1_value); - if (!mounted) { - dispose = listen_dev(button, "click", /*click_handler_1*/ ctx[4], false, false, false, false); - mounted = true; + if (!current || dirty & /*$targets*/ 64) { + set_style(span, "left", /*target*/ ctx[19].x + "px"); + } + + if (!current || dirty & /*$targets*/ 64) { + set_style(span, "top", /*target*/ ctx[19].y + "px"); } }, - p: noop, - i: noop, - o: noop, + i: function intro(local) { + if (current) return; + transition_in(target.$$.fragment, local); + current = true; + }, + o: function outro(local) { + transition_out(target.$$.fragment, local); + current = false; + }, d: function destroy(detaching) { - if (detaching) detach_dev(button); - mounted = false; - dispose(); + if (detaching) detach_dev(first); + destroy_component(target, detaching); + if (detaching) detach_dev(t0); + if (detaching) detach_dev(span); } }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_else_block$1.name, - type: "else", - source: "(9:0) {:else}", + id: create_each_block$2.name, + type: "each", + source: "(155:4) {#each $targets as target (target.name)}", ctx }); return block; } - // (5:0) {#if isCustomPlayButton} - function create_if_block$4(ctx) { - let button; + // (161:4) {#if isModalOpen} + function create_if_block$5(ctx) { + let modal; 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); + + modal = new SimpleModal({ + props: { + isOpen: /*isModalOpen*/ ctx[2], + onClose: /*handleModalClose*/ ctx[11], + title: "Test Collision", + content: /*currentcollisiontext*/ ctx[3], + items: /*currentcollisionitems*/ ctx[4] + }, + $$inline: true + }); 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); + create_component(modal.$$.fragment); }, m: function mount(target, anchor) { - insert_dev(target, button, anchor); - - if (default_slot) { - default_slot.m(button, null); - } - + mount_component(modal, target, anchor); 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 - ); - } - } + const modal_changes = {}; + if (dirty & /*isModalOpen*/ 4) modal_changes.isOpen = /*isModalOpen*/ ctx[2]; + if (dirty & /*currentcollisiontext*/ 8) modal_changes.content = /*currentcollisiontext*/ ctx[3]; + if (dirty & /*currentcollisionitems*/ 16) modal_changes.items = /*currentcollisionitems*/ ctx[4]; + modal.$set(modal_changes); }, i: function intro(local) { if (current) return; - transition_in(default_slot, local); + transition_in(modal.$$.fragment, local); current = true; }, o: function outro(local) { - transition_out(default_slot, local); + transition_out(modal.$$.fragment, local); current = false; }, d: function destroy(detaching) { - if (detaching) detach_dev(button); - if (default_slot) default_slot.d(detaching); - mounted = false; - dispose(); + destroy_component(modal, detaching); } }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_if_block$4.name, + id: create_if_block$5.name, type: "if", - source: "(5:0) {#if isCustomPlayButton}", + source: "(161:4) {#if isModalOpen}", ctx }); return block; } - function create_fragment$7(ctx) { - let current_block_type_index; - let if_block; - let if_block_anchor; + function create_fragment$8(ctx) { + let div1; + let canvas_1; + let t0; + let movingdot; + let t1; + let div0; + let t2; + let t3_value = /*$dotPosition*/ ctx[0].x + ""; + let t3; + let t4; + let t5_value = /*$dotPosition*/ ctx[0].y + ""; + let t5; + let t6; + let each_blocks = []; + let each_1_lookup = new Map(); + let t7; let current; - const if_block_creators = [create_if_block$4, create_else_block$1]; - const if_blocks = []; + let mounted; + let dispose; - function select_block_type(ctx, dirty) { - if (/*isCustomPlayButton*/ ctx[0]) return 0; - return 1; + let movingdot_props = { + position: /*$dotPosition*/ ctx[0], + boundaries: /*boundaries*/ ctx[9] + }; + + movingdot = new MovingDotPortfromReact({ props: movingdot_props, $$inline: true }); + /*movingdot_binding*/ ctx[15](movingdot); + movingdot.$on("move", /*move_handler*/ ctx[16]); + let each_value = /*$targets*/ ctx[6]; + validate_each_argument(each_value); + const get_key = ctx => /*target*/ ctx[19].name; + validate_each_keys(ctx, each_value, get_each_context$2, get_key); + + for (let i = 0; i < each_value.length; i += 1) { + let child_ctx = get_each_context$2(ctx, each_value, i); + let key = get_key(child_ctx); + each_1_lookup.set(key, each_blocks[i] = create_each_block$2(key, child_ctx)); } - current_block_type_index = select_block_type(ctx); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + let if_block = /*isModalOpen*/ ctx[2] && create_if_block$5(ctx); const block = { c: function create() { - if_block.c(); - if_block_anchor = empty(); + div1 = element("div"); + canvas_1 = element("canvas"); + t0 = space(); + create_component(movingdot.$$.fragment); + t1 = space(); + div0 = element("div"); + t2 = text("Minor Game Events Log for player ||| Position for Developer "); + t3 = text(t3_value); + t4 = space(); + t5 = text(t5_value); + t6 = space(); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t7 = space(); + if (if_block) if_block.c(); + set_style(canvas_1, "width", "100%"); + set_style(canvas_1, "height", "100%"); + attr_dev(canvas_1, "tabindex", "0"); + add_location(canvas_1, file$8, 151, 4, 7167); + attr_dev(div0, "id", "overlayText"); + attr_dev(div0, "class", "svelte-c2nwl9"); + add_location(div0, file$8, 153, 4, 7425); + attr_dev(div1, "id", "game-container"); + attr_dev(div1, "style", /*spaceStyle*/ ctx[13]); + add_location(div1, file$8, 150, 0, 7081); }, 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); + insert_dev(target, div1, anchor); + append_dev(div1, canvas_1); + /*canvas_1_binding*/ ctx[14](canvas_1); + append_dev(div1, t0); + mount_component(movingdot, div1, null); + append_dev(div1, t1); + append_dev(div1, div0); + append_dev(div0, t2); + append_dev(div0, t3); + append_dev(div0, t4); + append_dev(div0, t5); + append_dev(div1, t6); + + for (let i = 0; i < each_blocks.length; i += 1) { + if (each_blocks[i]) { + each_blocks[i].m(div1, null); + } + } + + append_dev(div1, t7); + if (if_block) if_block.m(div1, null); current = true; + + if (!mounted) { + dispose = listen_dev(canvas_1, "click", /*handleSpaceClick*/ ctx[10], false, false, false, false); + mounted = true; + } }, p: function update(ctx, [dirty]) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx); + const movingdot_changes = {}; + if (dirty & /*$dotPosition*/ 1) movingdot_changes.position = /*$dotPosition*/ ctx[0]; + movingdot.$set(movingdot_changes); + if ((!current || dirty & /*$dotPosition*/ 1) && t3_value !== (t3_value = /*$dotPosition*/ ctx[0].x + "")) set_data_dev(t3, t3_value); + if ((!current || dirty & /*$dotPosition*/ 1) && t5_value !== (t5_value = /*$dotPosition*/ ctx[0].y + "")) set_data_dev(t5, t5_value); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx, dirty); - } else { + if (dirty & /*$targets*/ 64) { + each_value = /*$targets*/ ctx[6]; + validate_each_argument(each_value); group_outros(); - - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - + validate_each_keys(ctx, each_value, get_each_context$2, 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$2, t7, get_each_context$2); 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 (/*isModalOpen*/ ctx[2]) { + if (if_block) { if_block.p(ctx, dirty); + + if (dirty & /*isModalOpen*/ 4) { + transition_in(if_block, 1); + } + } else { + if_block = create_if_block$5(ctx); + if_block.c(); + transition_in(if_block, 1); + if_block.m(div1, null); } + } else if (if_block) { + group_outros(); - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); + transition_out(if_block, 1, 1, () => { + if_block = null; + }); + + check_outros(); } }, i: function intro(local) { if (current) return; + transition_in(movingdot.$$.fragment, local); + + for (let i = 0; i < each_value.length; i += 1) { + transition_in(each_blocks[i]); + } + transition_in(if_block); current = true; }, o: function outro(local) { + transition_out(movingdot.$$.fragment, local); + + for (let i = 0; i < each_blocks.length; i += 1) { + transition_out(each_blocks[i]); + } + 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); + if (detaching) detach_dev(div1); + /*canvas_1_binding*/ ctx[14](null); + /*movingdot_binding*/ ctx[15](null); + destroy_component(movingdot); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].d(); + } + + if (if_block) if_block.d(); + mounted = false; + dispose(); } }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$7.name, + id: create_fragment$8.name, type: "component", source: "", ctx @@ -2811,325 +2868,517 @@ var app = (function () { return block; } - function instance$7($$self, $$props, $$invalidate) { + function instance$8($$self, $$props, $$invalidate) { + let $dotPosition; + let $targets; let { $$slots: slots = {}, $$scope } = $$props; - validate_slots('Button', slots, ['default']); - let { isCustomPlayButton } = $$props; + validate_slots('MovingDotSpacePortfromReact', slots, []); + let canvas; + let dotPosition = writable({ x: 900, y: 450 }); + validate_store(dotPosition, 'dotPosition'); + component_subscribe($$self, dotPosition, value => $$invalidate(0, $dotPosition = value)); - $$self.$$.on_mount.push(function () { - if (isCustomPlayButton === undefined && !('isCustomPlayButton' in $$props || $$self.$$.bound[$$self.$$.props['isCustomPlayButton']])) { - console.warn("