diff --git "a/bundle.js" "b/bundle.js" --- "a/bundle.js" +++ "b/bundle.js" @@ -4,6 +4,12 @@ var app = (function () { 'use strict'; function noop() { } + 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 } @@ -50,9 +56,59 @@ var app = (function () { function component_subscribe(component, store, callback) { component.$$.on_destroy.push(subscribe(store, callback)); } + 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 null_to_empty(value) { return value == null ? '' : value; } + function set_store_value(store, ret, value) { + store.set(value); + return ret; + } const globals = (typeof window !== 'undefined' ? window @@ -677,17 +733,17 @@ var app = (function () { /* src\VideoGradioComponentBrainstorming.svelte generated by Svelte v3.59.2 */ - const { console: console_1$9 } = globals; - const file$l = "src\\VideoGradioComponentBrainstorming.svelte"; + const { console: console_1$c } = globals; + const file$q = "src\\VideoGradioComponentBrainstorming.svelte"; - function get_each_context$e(ctx, list, i) { + function get_each_context$g(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$e(ctx) { + function create_each_block$g(ctx) { let option; let t_value = /*option*/ ctx[15] + ""; let t; @@ -698,7 +754,7 @@ var app = (function () { t = text(t_value); option.__value = /*option*/ ctx[15]; option.value = option.__value; - add_location(option, file$l, 85, 6, 2561); + add_location(option, file$q, 85, 6, 2561); }, m: function mount(target, anchor) { insert_dev(target, option, anchor); @@ -712,7 +768,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$e.name, + id: create_each_block$g.name, type: "each", source: "(85:4) {#each kitchenOptions as option}", ctx @@ -721,7 +777,7 @@ var app = (function () { return block; } - function create_fragment$l(ctx) { + function create_fragment$q(ctx) { let h1; let t1; let div1; @@ -748,7 +804,7 @@ var app = (function () { let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$e(get_each_context$e(ctx, each_value, i)); + each_blocks[i] = create_each_block$g(get_each_context$g(ctx, each_value, i)); } const block = { @@ -778,34 +834,34 @@ var app = (function () { each_blocks[i].c(); } - add_location(h1, file$l, 66, 0, 1800); + add_location(h1, file$q, 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$l, 72, 4, 2006); + add_location(track, file$q, 72, 4, 2006); attr_dev(video, "id", "videoCanvas"); video.autoplay = true; attr_dev(video, "class", "svelte-ufd3fo"); - add_location(video, file$l, 70, 2, 1965); + add_location(video, file$q, 70, 2, 1965); attr_dev(div0, "id", "overlayText"); attr_dev(div0, "class", "svelte-ufd3fo"); - add_location(div0, file$l, 74, 2, 2111); + add_location(div0, file$q, 74, 2, 2111); attr_dev(div1, "id", "videoContainer"); attr_dev(div1, "class", "svelte-ufd3fo"); - add_location(div1, file$l, 68, 0, 1911); + add_location(div1, file$q, 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$l, 77, 0, 2186); + add_location(canvas_1, file$q, 77, 0, 2186); attr_dev(input, "type", "text"); - add_location(input, file$l, 78, 0, 2294); - add_location(button, file$l, 82, 2, 2429); + add_location(input, file$q, 78, 0, 2294); + add_location(button, file$q, 82, 2, 2429); if (/*selectedOption*/ ctx[0] === void 0) add_render_callback(() => /*select_change_handler*/ ctx[9].call(select)); - add_location(select, file$l, 83, 2, 2479); + add_location(select, file$q, 83, 2, 2479); attr_dev(div2, "id", "frameForButtons"); - add_location(div2, file$l, 81, 0, 2399); + add_location(div2, file$q, 81, 0, 2399); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -864,12 +920,12 @@ var app = (function () { let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$e(ctx, each_value, i); + const child_ctx = get_each_context$g(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$e(child_ctx); + each_blocks[i] = create_each_block$g(child_ctx); each_blocks[i].c(); each_blocks[i].m(select, null); } @@ -907,7 +963,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$l.name, + id: create_fragment$q.name, type: "component", source: "", ctx @@ -920,7 +976,7 @@ var app = (function () { } // Logic for 'Test OCR' button - function instance$l($$self, $$props, $$invalidate) { + function instance$q($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('VideoGradioComponentBrainstorming', slots, []); let selectedOption = 'Stove - lu'; // default value @@ -982,7 +1038,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$9.warn(` was created with unknown prop '${key}'`); + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$c.warn(` was created with unknown prop '${key}'`); }); function canvas_1_binding($$value) { @@ -1053,13 +1109,13 @@ var app = (function () { class VideoGradioComponentBrainstorming extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$l, create_fragment$l, safe_not_equal, {}); + init(this, options, instance$q, create_fragment$q, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "VideoGradioComponentBrainstorming", options, - id: create_fragment$l.name + id: create_fragment$q.name }); } } @@ -1113,9 +1169,9 @@ var app = (function () { } /* src\MovingDotPortfromReact.svelte generated by Svelte v3.59.2 */ - const file$k = "src\\MovingDotPortfromReact.svelte"; + const file$p = "src\\MovingDotPortfromReact.svelte"; - function create_fragment$k(ctx) { + function create_fragment$p(ctx) { let button; const block = { @@ -1125,7 +1181,7 @@ var app = (function () { 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$k, 48, 0, 1573); + add_location(button, file$p, 48, 0, 1573); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -1153,7 +1209,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$k.name, + id: create_fragment$p.name, type: "component", source: "", ctx @@ -1164,7 +1220,7 @@ var app = (function () { const step = 10; - function instance$k($$self, $$props, $$invalidate) { + function instance$p($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotPortfromReact', slots, []); let { position = { x: 0, y: 0 } } = $$props; @@ -1269,13 +1325,13 @@ var app = (function () { class MovingDotPortfromReact extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$k, create_fragment$k, safe_not_equal, { position: 0, boundaries: 2, focusDot: 3 }); + init(this, options, instance$p, create_fragment$p, safe_not_equal, { position: 0, boundaries: 2, focusDot: 3 }); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotPortfromReact", options, - id: create_fragment$k.name + id: create_fragment$p.name }); } @@ -1306,9 +1362,9 @@ var app = (function () { /* src\MovingDotTargetPortfromReact.svelte generated by Svelte v3.59.2 */ - const file$j = "src\\MovingDotTargetPortfromReact.svelte"; + const file$o = "src\\MovingDotTargetPortfromReact.svelte"; - function create_fragment$j(ctx) { + function create_fragment$o(ctx) { let div; const block = { @@ -1317,7 +1373,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$j, 4, 0, 49); + add_location(div, file$o, 4, 0, 49); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -1343,7 +1399,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$j.name, + id: create_fragment$o.name, type: "component", source: "", ctx @@ -1352,7 +1408,7 @@ var app = (function () { return block; } - function instance$j($$self, $$props, $$invalidate) { + function instance$o($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotTargetPortfromReact', slots, []); let { position } = $$props; @@ -1389,13 +1445,13 @@ var app = (function () { class MovingDotTargetPortfromReact extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$j, create_fragment$j, safe_not_equal, { position: 0 }); + init(this, options, instance$o, create_fragment$o, safe_not_equal, { position: 0 }); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotTargetPortfromReact", options, - id: create_fragment$j.name + id: create_fragment$o.name }); } @@ -1410,17 +1466,17 @@ var app = (function () { /* src\MovingDotSpaceSimpleModal.svelte generated by Svelte v3.59.2 */ - const { console: console_1$8 } = globals; - const file$i = "src\\MovingDotSpaceSimpleModal.svelte"; + const { console: console_1$b } = globals; + const file$n = "src\\MovingDotSpaceSimpleModal.svelte"; - function get_each_context$d(ctx, list, i) { + function get_each_context$f(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[10] = list[i]; return child_ctx; } // (34:0) {#if isOpen} - function create_if_block$8(ctx) { + function create_if_block$d(ctx) { let div3; let div2; let div0; @@ -1440,7 +1496,7 @@ var app = (function () { let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$d(get_each_context$d(ctx, each_value, i)); + each_blocks[i] = create_each_block$f(get_each_context$f(ctx, each_value, i)); } const block = { @@ -1463,18 +1519,18 @@ var app = (function () { each_blocks[i].c(); } - add_location(h2, file$i, 37, 8, 1159); - add_location(button, file$i, 38, 8, 1185); + add_location(h2, file$n, 37, 8, 1159); + add_location(button, file$n, 38, 8, 1185); attr_dev(div0, "class", "modal-header svelte-m51ous"); - add_location(div0, file$i, 36, 6, 1123); + add_location(div0, file$n, 36, 6, 1123); attr_dev(ul, "class", "modal-items"); - add_location(ul, file$i, 42, 8, 1309); + add_location(ul, file$n, 42, 8, 1309); attr_dev(div1, "class", "modal-content svelte-m51ous"); - add_location(div1, file$i, 40, 6, 1253); + add_location(div1, file$n, 40, 6, 1253); attr_dev(div2, "class", "modal svelte-m51ous"); - add_location(div2, file$i, 35, 4, 1096); + add_location(div2, file$n, 35, 4, 1096); attr_dev(div3, "class", "modal-overlay svelte-m51ous"); - add_location(div3, file$i, 34, 2, 1063); + add_location(div3, file$n, 34, 2, 1063); }, m: function mount(target, anchor) { insert_dev(target, div3, anchor); @@ -1511,12 +1567,12 @@ var app = (function () { let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$d(ctx, each_value, i); + const child_ctx = get_each_context$f(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$d(child_ctx); + each_blocks[i] = create_each_block$f(child_ctx); each_blocks[i].c(); each_blocks[i].m(ul, null); } @@ -1539,7 +1595,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_if_block$8.name, + id: create_if_block$d.name, type: "if", source: "(34:0) {#if isOpen}", ctx @@ -1549,7 +1605,7 @@ var app = (function () { } // (44:10) {#each items as item} - function create_each_block$d(ctx) { + function create_each_block$f(ctx) { let button; let t_value = /*item*/ ctx[10].label + ""; let t; @@ -1564,7 +1620,7 @@ var app = (function () { c: function create() { button = element("button"); t = text(t_value); - add_location(button, file$i, 44, 12, 1380); + add_location(button, file$n, 44, 12, 1380); }, m: function mount(target, anchor) { insert_dev(target, button, anchor); @@ -1588,7 +1644,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$d.name, + id: create_each_block$f.name, type: "each", source: "(44:10) {#each items as item}", ctx @@ -1597,9 +1653,9 @@ var app = (function () { return block; } - function create_fragment$i(ctx) { + function create_fragment$n(ctx) { let if_block_anchor; - let if_block = /*isOpen*/ ctx[0] && create_if_block$8(ctx); + let if_block = /*isOpen*/ ctx[0] && create_if_block$d(ctx); const block = { c: function create() { @@ -1618,7 +1674,7 @@ var app = (function () { if (if_block) { if_block.p(ctx, dirty); } else { - if_block = create_if_block$8(ctx); + if_block = create_if_block$d(ctx); if_block.c(); if_block.m(if_block_anchor.parentNode, if_block_anchor); } @@ -1637,7 +1693,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$i.name, + id: create_fragment$n.name, type: "component", source: "", ctx @@ -1646,7 +1702,7 @@ var app = (function () { return block; } - function instance$i($$self, $$props, $$invalidate) { + function instance$n($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotSpaceSimpleModal', slots, []); let { isOpen = false } = $$props; @@ -1681,11 +1737,11 @@ var app = (function () { $$self.$$.on_mount.push(function () { if (onClose === undefined && !('onClose' in $$props || $$self.$$.bound[$$self.$$.props['onClose']])) { - console_1$8.warn(" was created without expected prop 'onClose'"); + console_1$b.warn(" was created without expected prop 'onClose'"); } if (themeActions === undefined && !('themeActions' in $$props || $$self.$$.bound[$$self.$$.props['themeActions']])) { - console_1$8.warn(" was created without expected prop 'themeActions'"); + console_1$b.warn(" was created without expected prop 'themeActions'"); } }); @@ -1700,7 +1756,7 @@ var app = (function () { ]; Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$8.warn(` was created with unknown prop '${key}'`); + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$b.warn(` was created with unknown prop '${key}'`); }); const click_handler = item => handleItemClick(item); @@ -1759,7 +1815,7 @@ var app = (function () { constructor(options) { super(options); - init(this, options, instance$i, create_fragment$i, safe_not_equal, { + init(this, options, instance$n, create_fragment$n, safe_not_equal, { isOpen: 0, title: 1, content: 2, @@ -1773,7 +1829,7 @@ var app = (function () { component: this, tagName: "MovingDotSpaceSimpleModal", options, - id: create_fragment$i.name + id: create_fragment$n.name }); } @@ -1834,98 +1890,518 @@ var app = (function () { } } - const health = writable(100); - const mana = writable(50); - const strength = writable(10); - const agility = writable(10); - const intelligence = writable(10); - const charisma = writable(10); - const luck = writable(10); - const money = writable(1000); - const fightplayerHuman = createfightPlayer(); - const fightplayerComputer = createfightPlayer(); - const fightcurrentTurn = writable('human'); // 'human' or 'computer' - - function createfightPlayer() { - return writable({ - fighthealth: 100, - fightstamina: 100, - fightisBlocking: false, - fightcooldowns: { - attack: 0, - specialAttack: 0, - }, - }); + const ytsubuse = writable(false); + const ytsubuseplayer = writable(false); + const ytsubcurrentID = writable('IVJkOHTBPn0'); + const ytsubcurrenttext = writable('Currently none'); + + const health = writable(100); + const mana = writable(50); + const strength = writable(10); + const agility = writable(10); + const intelligence = writable(10); + const charisma = writable(10); + const luck = writable(10); + const money = writable(1000); + const fightplayerHuman = createfightPlayer(); + const fightplayerComputer = createfightPlayer(); + const fightcurrentTurn = writable('human'); // 'human' or 'computer' + const themeactions = writable({}); + + function createfightPlayer() { + return writable({ + fighthealth: 100, + fightstamina: 100, + fightisBlocking: false, + fightcooldowns: { + attack: 0, + specialAttack: 0, + }, + }); + } + + const inventory = writable([ + // Sample inventory items + { type: "weapon", name: "Sword", description: "A sharp blade." }, + { type: "armor", name: "Shield", description: "Protects against attacks." }, + { type: "consumable", name: "Health Potion", description: "Restores health." }, + // Add more items as needed + ]); + + const skills = writable([ + // Sample skills + { branch: "Combat", name: "Basic Attack", learned: false }, + { branch: "Magic", name: "Fireball", learned: false }, + { branch: "Stealth", name: "Sneak", learned: false }, + // Add more skills as needed + ]); + + const objectives = writable([ + // Sample objectives + { id: "Seperate", name: "Visit Mountain Peak", complete: false }, + { id: "Mission 1", name: "Intercept The Courier (Search the Locations)", complete: false }, + { id: "Mission 1", name: "Deliver the package to Market Stall", complete: false }, + // Add more objectives as needed + ]); + + const 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: "modal", modalConfig: { + title: "Entrance", + content: "You've reached the Entrance. What's your next step?", + actions: [ + { + label: "Ask for guidance on next move", + action: "askforDirections" + }, + { + label: "Buy an Axe", + action: "buyAxeAlert" + }, + // ... more actions if necessary + ]}, + }, + { name: "Market Stall", x: 200, y: 300, collisionType: "", collisiontext: "" }, // A market stall in the bustling market area. + { name: "Inn Entrance", x: 400, y: 450, collisionType: "", collisiontext: "" }, // The entrance to the inn for rest or information. + { name: "Town Hall", x: 600, y: 350, collisionType: "", collisiontext: "" }, // The entrance to the town hall for quests. + { name: "Fountain", x: 500, y: 500, collisionType: "", collisiontext: "" }, // A fountain in the town square as a meeting point. + { name: "Bridge", x: 1100, y: 700, collisionType: "", collisiontext: "" }, // A bridge in the mystical forest area. + { name: "Waterfall", x: 1300, y: 800, collisionType: "", collisiontext: "" }, // A waterfall that could hide secrets or treasures. + { name: "Mountain Peak", x: 1500, y: 100, collisionType: "", collisiontext: "" }, + ]); + + function addInventoryItem(item) { + inventory.update(items => { + return [...items, item]; + }); + } + + /* src\SimpleStateMachineModal.svelte generated by Svelte v3.59.2 */ + + const { console: console_1$a } = globals; + const file$m = "src\\SimpleStateMachineModal.svelte"; + + function get_each_context$e(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[14] = list[i]; + return child_ctx; } - const inventory = writable([ - // Sample inventory items - { type: "weapon", name: "Sword", description: "A sharp blade." }, - { type: "armor", name: "Shield", description: "Protects against attacks." }, - { type: "consumable", name: "Health Potion", description: "Restores health." }, - // Add more items as needed - ]); - - const skills = writable([ - // Sample skills - { branch: "Combat", name: "Basic Attack", learned: false }, - { branch: "Magic", name: "Fireball", learned: false }, - { branch: "Stealth", name: "Sneak", learned: false }, - // Add more skills as needed - ]); - - const objectives = writable([ - // Sample objectives - { id: "Seperate", name: "Visit Mountain Peak", complete: false }, - { id: "Mission 1", name: "Intercept The Courier (Search the Locations)", complete: false }, - { id: "Mission 1", name: "Deliver the package to Market Stall", complete: false }, - // Add more objectives as needed - ]); - - const 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: "modal", modalConfig: { - title: "Entrance", - content: "You've reached the Entrance. What's your next step?", - actions: [ - { - label: "Ask for guidance on next move", - action: "askforDirections" - }, - { - label: "Buy an Axe", - action: "buyAxeAlert" - }, - // ... more actions if necessary - ]}, - }, - { name: "Market Stall", x: 200, y: 300, collisionType: "", collisiontext: "" }, // A market stall in the bustling market area. - { name: "Inn Entrance", x: 400, y: 450, collisionType: "", collisiontext: "" }, // The entrance to the inn for rest or information. - { name: "Town Hall", x: 600, y: 350, collisionType: "", collisiontext: "" }, // The entrance to the town hall for quests. - { name: "Fountain", x: 500, y: 500, collisionType: "", collisiontext: "" }, // A fountain in the town square as a meeting point. - { name: "Bridge", x: 1100, y: 700, collisionType: "", collisiontext: "" }, // A bridge in the mystical forest area. - { name: "Waterfall", x: 1300, y: 800, collisionType: "", collisiontext: "" }, // A waterfall that could hide secrets or treasures. - { name: "Mountain Peak", x: 1500, y: 100, collisionType: "", collisiontext: "" }, - ]); - - function addInventoryItem(item) { - inventory.update(items => { - return [...items, item]; - }); + // (64:0) {#if isOpen} + function create_if_block$c(ctx) { + let div3; + let div2; + let div0; + let h2; + let t0; + let t1; + 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 = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block$e(get_each_context$e(ctx, each_value, i)); + } + + const block = { + c: function create() { + 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$m, 67, 12, 2262); + add_location(button, file$m, 68, 12, 2292); + attr_dev(div0, "class", "modal-header svelte-13fuaz8"); + add_location(div0, file$m, 66, 8, 2222); + attr_dev(ul, "class", "modal-items"); + add_location(ul, file$m, 72, 12, 2428); + attr_dev(div1, "class", "modal-content svelte-13fuaz8"); + add_location(div1, file$m, 70, 8, 2364); + attr_dev(div2, "class", "modal svelte-13fuaz8"); + add_location(div2, file$m, 65, 8, 2193); + attr_dev(div3, "class", "modal-overlay svelte-13fuaz8"); + add_location(div3, file$m, 64, 4, 2156); + }, + 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); + + for (let i = 0; i < each_blocks.length; i += 1) { + if (each_blocks[i]) { + each_blocks[i].m(ul, null); + } + } + + if (!mounted) { + dispose = listen_dev(button, "click", /*closeModal*/ ctx[5], false, false, false, false); + mounted = true; + } + }, + 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*/ 72) { + 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$e(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block$e(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(div3); + destroy_each(each_blocks, detaching); + mounted = false; + dispose(); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_if_block$c.name, + type: "if", + source: "(64:0) {#if isOpen}", + ctx + }); + + return block; + } + + // (74:12) {#each items as item} + function create_each_block$e(ctx) { + let button; + let t_value = /*item*/ ctx[14].label + ""; + let t; + let mounted; + let dispose; + + function click_handler() { + return /*click_handler*/ ctx[10](/*item*/ ctx[14]); + } + + const block = { + c: function create() { + button = element("button"); + t = text(t_value); + add_location(button, file$m, 74, 16, 2505); + }, + 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[14].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_each_block$e.name, + type: "each", + source: "(74:12) {#each items as item}", + ctx + }); + + return block; + } + + function create_fragment$m(ctx) { + let if_block_anchor; + let if_block = /*isOpen*/ ctx[0] && create_if_block$c(ctx); + + const block = { + c: function create() { + if (if_block) 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 (if_block) if_block.m(target, anchor); + insert_dev(target, if_block_anchor, anchor); + }, + p: function update(ctx, [dirty]) { + if (/*isOpen*/ ctx[0]) { + if (if_block) { + if_block.p(ctx, dirty); + } else { + if_block = create_if_block$c(ctx); + if_block.c(); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + }, + i: noop, + o: noop, + d: function destroy(detaching) { + if (if_block) if_block.d(detaching); + if (detaching) detach_dev(if_block_anchor); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_fragment$m.name, + type: "component", + source: "", + ctx + }); + + return block; + } + + function instance$m($$self, $$props, $$invalidate) { + let $themeactions; + let $state; + validate_store(themeactions, 'themeactions'); + component_subscribe($$self, themeactions, $$value => $$invalidate(12, $themeactions = $$value)); + let { $$slots: slots = {}, $$scope } = $$props; + validate_slots('SimpleStateMachineModal', slots, []); + let { modalStates } = $$props; + let { isOpen = false } = $$props; + let state = writable("default"); // Manage modal state + validate_store(state, 'state'); + component_subscribe($$self, state, value => $$invalidate(9, $state = value)); + let title = modalStates.default.title; // Define title + let content = modalStates.default.content; // Define content + let items = modalStates.default.items; // Define items + let consequences = modalStates.default.consequences; //modalStates.default.consequences; // Define consequences + let { onClose } = $$props; + + function closeModal() { + if (onClose) { + onClose(); + } + } + + function handleItemClick(item) { + // Decide what happens based on the item action + switch (item.action) { + case 'defined modal button': + console.log('Figure out how to call the imported store items here and delete the test ones below'); + break; + case 'buyAxe': + console.log("Axe purchased"); + closeModal(); + break; + case 'guidance': + case 'forest': + console.log("Went to the forest. Leaves were blowing everywhere"); + case 'default': + state.set(item.action); + break; + default: + console.log("Action not recognized"); + } + } //Execute the consequences + + function updateModal(newState) { + $$invalidate(1, title = modalStates[newState].title); + $$invalidate(2, content = modalStates[newState].content); + $$invalidate(3, items = modalStates[newState].items); + consequences = modalStates[newState].consequences; + + //consequences.forEach(func => func()); // Execute each function in consequences + consequences.forEach(consequence => { + if ($themeactions[consequence]) { + $themeactions[consequence](); // Execute consequence functions by name + } + }); + } + + $$self.$$.on_mount.push(function () { + if (modalStates === undefined && !('modalStates' in $$props || $$self.$$.bound[$$self.$$.props['modalStates']])) { + console_1$a.warn(" was created without expected prop 'modalStates'"); + } + + if (onClose === undefined && !('onClose' in $$props || $$self.$$.bound[$$self.$$.props['onClose']])) { + console_1$a.warn(" was created without expected prop 'onClose'"); + } + }); + + const writable_props = ['modalStates', 'isOpen', 'onClose']; + + Object.keys($$props).forEach(key => { + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$a.warn(` was created with unknown prop '${key}'`); + }); + + const click_handler = item => handleItemClick(item); + + $$self.$$set = $$props => { + if ('modalStates' in $$props) $$invalidate(7, modalStates = $$props.modalStates); + if ('isOpen' in $$props) $$invalidate(0, isOpen = $$props.isOpen); + if ('onClose' in $$props) $$invalidate(8, onClose = $$props.onClose); + }; + + $$self.$capture_state = () => ({ + writable, + themeactions, + modalStates, + isOpen, + state, + title, + content, + items, + consequences, + onClose, + closeModal, + handleItemClick, + updateModal, + $themeactions, + $state + }); + + $$self.$inject_state = $$props => { + if ('modalStates' in $$props) $$invalidate(7, modalStates = $$props.modalStates); + if ('isOpen' in $$props) $$invalidate(0, isOpen = $$props.isOpen); + if ('state' in $$props) $$invalidate(4, state = $$props.state); + 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 ('consequences' in $$props) consequences = $$props.consequences; + if ('onClose' in $$props) $$invalidate(8, onClose = $$props.onClose); + }; + + if ($$props && "$$inject" in $$props) { + $$self.$inject_state($$props.$$inject); + } + + $$self.$$.update = () => { + if ($$self.$$.dirty & /*$state*/ 512) { + // Reactive statements to update the modal based on state changes + (updateModal($state)); + } + }; + + return [ + isOpen, + title, + content, + items, + state, + closeModal, + handleItemClick, + modalStates, + onClose, + $state, + click_handler + ]; + } + + class SimpleStateMachineModal extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance$m, create_fragment$m, safe_not_equal, { modalStates: 7, isOpen: 0, onClose: 8 }); + + dispatch_dev("SvelteRegisterComponent", { + component: this, + tagName: "SimpleStateMachineModal", + options, + id: create_fragment$m.name + }); + } + + get modalStates() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set modalStates(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + 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 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 ''"); + } } /* src\MovingDotStatDisplay.svelte generated by Svelte v3.59.2 */ - const file$h = "src\\MovingDotStatDisplay.svelte"; + const file$l = "src\\MovingDotStatDisplay.svelte"; - function get_each_context$c(ctx, list, i) { + function get_each_context$d(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[13] = list[i]; return child_ctx; } - function get_each_context_1$6(ctx, list, i) { + function get_each_context_1$7(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[16] = list[i]; return child_ctx; @@ -1959,7 +2435,7 @@ var app = (function () { t3 = space(); t4 = text(t4_value); attr_dev(li, "class", li_class_value = "" + (null_to_empty(/*item*/ ctx[16].complete ? 'completedobjetive' : '') + " svelte-w7krpq")); - add_location(li, file$h, 15, 8, 453); + add_location(li, file$l, 15, 8, 453); }, m: function mount(target, anchor) { insert_dev(target, li, anchor); @@ -1995,7 +2471,7 @@ var app = (function () { } // (26:8) {#each $inventory as item} - function create_each_block_1$6(ctx) { + function create_each_block_1$7(ctx) { let button; let t0_value = /*item*/ ctx[16].name + ""; let t0; @@ -2013,7 +2489,7 @@ var app = (function () { t0 = text(t0_value); t1 = space(); attr_dev(button, "class", "skill"); - add_location(button, file$h, 26, 10, 813); + add_location(button, file$l, 26, 10, 813); }, m: function mount(target, anchor) { insert_dev(target, button, anchor); @@ -2038,7 +2514,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block_1$6.name, + id: create_each_block_1$7.name, type: "each", source: "(26:8) {#each $inventory as item}", ctx @@ -2048,7 +2524,7 @@ var app = (function () { } // (50:8) {#each $skills as skill} - function create_each_block$c(ctx) { + function create_each_block$d(ctx) { let li; let t0_value = /*skill*/ ctx[13].name + ""; let t0; @@ -2067,7 +2543,7 @@ var app = (function () { t2 = text(t2_value); t3 = text(" - Learned: "); t4 = text(t4_value); - add_location(li, file$h, 50, 10, 1580); + add_location(li, file$l, 50, 10, 1580); }, m: function mount(target, anchor) { insert_dev(target, li, anchor); @@ -2089,7 +2565,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$c.name, + id: create_each_block$d.name, type: "each", source: "(50:8) {#each $skills as skill}", ctx @@ -2098,7 +2574,7 @@ var app = (function () { return block; } - function create_fragment$h(ctx) { + function create_fragment$l(ctx) { let div10; let div0; let h10; @@ -2161,7 +2637,7 @@ var app = (function () { let each_blocks_1 = []; for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks_1[i] = create_each_block_1$6(get_each_context_1$6(ctx, each_value_1, i)); + each_blocks_1[i] = create_each_block_1$7(get_each_context_1$7(ctx, each_value_1, i)); } let each_value = /*$skills*/ ctx[10]; @@ -2169,7 +2645,7 @@ var app = (function () { let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$c(get_each_context$c(ctx, each_value, i)); + each_blocks[i] = create_each_block$d(get_each_context$d(ctx, each_value, i)); } const block = { @@ -2245,35 +2721,35 @@ var app = (function () { each_blocks[i].c(); } - add_location(h10, file$h, 11, 4, 329); - add_location(ul0, file$h, 12, 4, 354); + add_location(h10, file$l, 11, 4, 329); + add_location(ul0, file$l, 12, 4, 354); attr_dev(div0, "class", "grid-statsitem svelte-w7krpq"); - add_location(div0, file$h, 10, 2, 295); - add_location(h20, file$h, 22, 6, 677); - add_location(h60, file$h, 23, 6, 703); - add_location(ul1, file$h, 24, 6, 761); + add_location(div0, file$l, 10, 2, 295); + add_location(h20, file$l, 22, 6, 677); + add_location(h60, file$l, 23, 6, 703); + add_location(ul1, file$l, 24, 6, 761); attr_dev(div1, "class", "inventory svelte-w7krpq"); - add_location(div1, file$h, 21, 4, 646); + add_location(div1, file$l, 21, 4, 646); attr_dev(div2, "class", "grid-statsitem svelte-w7krpq"); - add_location(div2, file$h, 20, 2, 612); - add_location(h11, file$h, 36, 6, 1066); - add_location(h61, file$h, 37, 6, 1095); - add_location(div3, file$h, 38, 6, 1142); - add_location(div4, file$h, 39, 6, 1286); - add_location(div5, file$h, 40, 6, 1318); + add_location(div2, file$l, 20, 2, 612); + add_location(h11, file$l, 36, 6, 1066); + add_location(h61, file$l, 37, 6, 1095); + add_location(div3, file$l, 38, 6, 1142); + add_location(div4, file$l, 39, 6, 1286); + add_location(div5, file$l, 40, 6, 1318); attr_dev(div6, "class", "stats svelte-w7krpq"); - add_location(div6, file$h, 35, 4, 1039); + add_location(div6, file$l, 35, 4, 1039); attr_dev(div7, "class", "grid-statsitem svelte-w7krpq"); - add_location(div7, file$h, 34, 2, 1005); - add_location(h21, file$h, 46, 6, 1440); - add_location(h62, file$h, 47, 6, 1479); - add_location(ul2, file$h, 48, 6, 1530); + add_location(div7, file$l, 34, 2, 1005); + add_location(h21, file$l, 46, 6, 1440); + add_location(h62, file$l, 47, 6, 1479); + add_location(ul2, file$l, 48, 6, 1530); attr_dev(div8, "class", "skill-tree svelte-w7krpq"); - add_location(div8, file$h, 45, 4, 1408); + add_location(div8, file$l, 45, 4, 1408); attr_dev(div9, "class", "grid-statsitem svelte-w7krpq"); - add_location(div9, file$h, 44, 2, 1374); + add_location(div9, file$l, 44, 2, 1374); attr_dev(div10, "class", "grid-statsContainer svelte-w7krpq"); - add_location(div10, file$h, 9, 0, 258); + add_location(div10, file$l, 9, 0, 258); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -2380,12 +2856,12 @@ var app = (function () { let i; for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1$6(ctx, each_value_1, i); + const child_ctx = get_each_context_1$7(ctx, each_value_1, i); if (each_blocks_1[i]) { each_blocks_1[i].p(child_ctx, dirty); } else { - each_blocks_1[i] = create_each_block_1$6(child_ctx); + each_blocks_1[i] = create_each_block_1$7(child_ctx); each_blocks_1[i].c(); each_blocks_1[i].m(ul1, null); } @@ -2413,12 +2889,12 @@ var app = (function () { let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$c(ctx, each_value, i); + const child_ctx = get_each_context$d(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$c(child_ctx); + each_blocks[i] = create_each_block$d(child_ctx); each_blocks[i].c(); each_blocks[i].m(ul2, null); } @@ -2443,7 +2919,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$h.name, + id: create_fragment$l.name, type: "component", source: "", ctx @@ -2452,7 +2928,7 @@ var app = (function () { return block; } - function instance$h($$self, $$props, $$invalidate) { + function instance$l($$self, $$props, $$invalidate) { let $objectives; let $inventory; let $health; @@ -2548,225 +3024,178 @@ var app = (function () { class MovingDotStatDisplay extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$h, create_fragment$h, safe_not_equal, {}); + init(this, options, instance$l, create_fragment$l, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotStatDisplay", options, - id: create_fragment$h.name + id: create_fragment$l.name }); } } - /* src\MovingDotSpaceThemeManager.svelte generated by Svelte v3.59.2 */ - const file$g = "src\\MovingDotSpaceThemeManager.svelte"; + /* src\SimpleCollapsible.svelte generated by Svelte v3.59.2 */ - function create_fragment$g(ctx) { - let hr; + const file$k = "src\\SimpleCollapsible.svelte"; + + // (16:4) {#if isOpen} + function create_if_block$b(ctx) { + let div; + let current; + const default_slot_template = /*#slots*/ ctx[4].default; + const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[3], null); + + const block = { + c: function create() { + div = element("div"); + if (default_slot) default_slot.c(); + attr_dev(div, "class", "content svelte-rzwxvd"); + add_location(div, file$k, 16, 6, 335); + }, + m: function mount(target, anchor) { + insert_dev(target, div, anchor); + + if (default_slot) { + default_slot.m(div, null); + } + + current = true; + }, + p: function update(ctx, dirty) { + if (default_slot) { + if (default_slot.p && (!current || dirty & /*$$scope*/ 8)) { + update_slot_base( + default_slot, + default_slot_template, + ctx, + /*$$scope*/ ctx[3], + !current + ? get_all_dirty_from_scope(/*$$scope*/ ctx[3]) + : get_slot_changes(default_slot_template, /*$$scope*/ ctx[3], 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(div); + if (default_slot) default_slot.d(detaching); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_if_block$b.name, + type: "if", + source: "(16:4) {#if isOpen}", + ctx + }); + + return block; + } + + function create_fragment$k(ctx) { + let div; + let button; + let t0_value = (/*isOpen*/ ctx[1] ? 'Close' : 'Open') + ""; let t0; - let form; - let input0; let t1; - let input1; let t2; - let input2; let t3; - let button0; - let t5; - let button1; - let t7; - let input3; - let t8; - let label; - let t10; - let div3; - let div0; - let t11; - let br0; - let t12; - let br1; - let t13; - let t14; - let div1; - let t15; - let t16; - let br2; - let t17; - let br3; - let br4; - let t18; - let t19; - let div2; + let current; let mounted; let dispose; + let if_block = /*isOpen*/ ctx[1] && create_if_block$b(ctx); const block = { c: function create() { - hr = element("hr"); - t0 = text("\r\nIncomplete Custom game setting assistant\r\n\r\n"); - form = element("form"); - input0 = element("input"); + div = element("div"); + button = element("button"); + t0 = text(t0_value); t1 = space(); - input1 = element("input"); - t2 = space(); - input2 = element("input"); + t2 = text(/*title*/ ctx[0]); t3 = space(); - button0 = element("button"); - button0.textContent = "Add Item"; - t5 = space(); - button1 = element("button"); - button1.textContent = "Download Configuration"; - t7 = space(); - input3 = element("input"); - t8 = space(); - label = element("label"); - label.textContent = "Upload Configuration"; - t10 = space(); - div3 = element("div"); - div0 = element("div"); - t11 = text("Website = multilingual support in chrome "); - br0 = element("br"); - t12 = text("\r\n The mechanics here are location based so story should be location based "); - br1 = element("br"); - t13 = text("\r\n Simultaneous relationships between multiple items = complexity - eg. player location and objectives"); - t14 = space(); - div1 = element("div"); - t15 = text(/*ChangedContentPlaceholder*/ ctx[0]); - t16 = space(); - br2 = element("br"); - t17 = text("\r\n Most stories for games are about a character that lacks something to beat their problems and the 90% inbetween the begining and the end is acquiring\r\n "); - br3 = element("br"); - br4 = element("br"); - t18 = text("\r\n Example - Write a story where the main event are in this order: gosomewhere getsomething makeobservation getsomething talktosomeone makeobservation getsomething talktosomeone gosomewhere fight talktosomeone fight fight talktosomeone talktosomeone talktosomeone gosomewhere talktosomeone"); - t19 = space(); - div2 = element("div"); - div2.textContent = "lets write the story to fit this order - stats location stats inventory stats location location skills inventory stats inventory skills skills skills stats stats skills"; - add_location(hr, file$g, 66, 0, 2505); - attr_dev(input0, "type", "text"); - attr_dev(input0, "placeholder", "Type (weapon, armor, consumable)"); - add_location(input0, file$g, 70, 4, 2641); - attr_dev(input1, "type", "text"); - attr_dev(input1, "placeholder", "Name"); - add_location(input1, file$g, 71, 4, 2741); - attr_dev(input2, "type", "text"); - attr_dev(input2, "placeholder", "Description"); - add_location(input2, file$g, 72, 4, 2813); - attr_dev(button0, "type", "submit"); - add_location(button0, file$g, 73, 4, 2899); - add_location(form, file$g, 69, 0, 2594); - add_location(button1, file$g, 79, 0, 3078); - attr_dev(input3, "type", "file"); - attr_dev(input3, "id", "fileInput"); - set_style(input3, "display", "none"); - add_location(input3, file$g, 80, 0, 3152); - attr_dev(label, "for", "fileInput"); - attr_dev(label, "class", "btn"); - add_location(label, file$g, 81, 0, 3241); - add_location(br0, file$g, 85, 49, 3407); - add_location(br1, file$g, 86, 80, 3493); - add_location(div0, file$g, 84, 4, 3351); - add_location(br2, file$g, 91, 38, 3671); - add_location(br3, file$g, 93, 8, 3843); - add_location(br4, file$g, 93, 12, 3847); - add_location(div1, file$g, 90, 4, 3626); - add_location(div2, file$g, 97, 4, 4168); - attr_dev(div3, "class", "grid-themegridContainer svelte-a95t5t"); - add_location(div3, file$g, 83, 0, 3308); + if (if_block) if_block.c(); + attr_dev(button, "class", "svelte-rzwxvd"); + add_location(button, file$k, 11, 4, 210); + attr_dev(div, "class", "collapsible svelte-rzwxvd"); + add_location(div, file$k, 10, 0, 179); }, 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, hr, anchor); - insert_dev(target, t0, anchor); - insert_dev(target, form, anchor); - append_dev(form, input0); - set_input_value(input0, /*newItem*/ ctx[1].type); - append_dev(form, t1); - append_dev(form, input1); - set_input_value(input1, /*newItem*/ ctx[1].name); - append_dev(form, t2); - append_dev(form, input2); - set_input_value(input2, /*newItem*/ ctx[1].description); - append_dev(form, t3); - append_dev(form, button0); - insert_dev(target, t5, anchor); - insert_dev(target, button1, anchor); - insert_dev(target, t7, anchor); - insert_dev(target, input3, anchor); - insert_dev(target, t8, anchor); - insert_dev(target, label, anchor); - insert_dev(target, t10, anchor); - insert_dev(target, div3, anchor); - append_dev(div3, div0); - append_dev(div0, t11); - append_dev(div0, br0); - append_dev(div0, t12); - append_dev(div0, br1); - append_dev(div0, t13); - append_dev(div3, t14); - append_dev(div3, div1); - append_dev(div1, t15); - append_dev(div1, t16); - append_dev(div1, br2); - append_dev(div1, t17); - append_dev(div1, br3); - append_dev(div1, br4); - append_dev(div1, t18); - append_dev(div3, t19); - append_dev(div3, div2); + insert_dev(target, div, anchor); + append_dev(div, button); + append_dev(button, t0); + append_dev(button, t1); + append_dev(button, t2); + append_dev(div, t3); + if (if_block) if_block.m(div, null); + current = true; if (!mounted) { - dispose = [ - listen_dev(input0, "input", /*input0_input_handler*/ ctx[5]), - listen_dev(input1, "input", /*input1_input_handler*/ ctx[6]), - listen_dev(input2, "input", /*input2_input_handler*/ ctx[7]), - listen_dev(form, "submit", prevent_default(/*addItem*/ ctx[2]), false, true, false, false), - listen_dev(button1, "click", /*downloadConfiguration*/ ctx[3], false, false, false, false), - listen_dev(input3, "change", /*handleFileUpload*/ ctx[4], false, false, false, false) - ]; - + dispose = listen_dev(button, "click", /*toggleCollapsible*/ ctx[2], false, false, false, false); mounted = true; } }, p: function update(ctx, [dirty]) { - if (dirty & /*newItem*/ 2 && input0.value !== /*newItem*/ ctx[1].type) { - set_input_value(input0, /*newItem*/ ctx[1].type); - } + if ((!current || dirty & /*isOpen*/ 2) && t0_value !== (t0_value = (/*isOpen*/ ctx[1] ? 'Close' : 'Open') + "")) set_data_dev(t0, t0_value); + if (!current || dirty & /*title*/ 1) set_data_dev(t2, /*title*/ ctx[0]); - if (dirty & /*newItem*/ 2 && input1.value !== /*newItem*/ ctx[1].name) { - set_input_value(input1, /*newItem*/ ctx[1].name); - } + if (/*isOpen*/ ctx[1]) { + if (if_block) { + if_block.p(ctx, dirty); - if (dirty & /*newItem*/ 2 && input2.value !== /*newItem*/ ctx[1].description) { - set_input_value(input2, /*newItem*/ ctx[1].description); - } + if (dirty & /*isOpen*/ 2) { + transition_in(if_block, 1); + } + } else { + if_block = create_if_block$b(ctx); + if_block.c(); + transition_in(if_block, 1); + if_block.m(div, null); + } + } else if (if_block) { + group_outros(); + + transition_out(if_block, 1, 1, () => { + if_block = null; + }); - if (dirty & /*ChangedContentPlaceholder*/ 1) set_data_dev(t15, /*ChangedContentPlaceholder*/ ctx[0]); + check_outros(); + } + }, + i: function intro(local) { + if (current) return; + transition_in(if_block); + current = true; + }, + o: function outro(local) { + transition_out(if_block); + current = false; }, - i: noop, - o: noop, d: function destroy(detaching) { - if (detaching) detach_dev(hr); - if (detaching) detach_dev(t0); - if (detaching) detach_dev(form); - if (detaching) detach_dev(t5); - if (detaching) detach_dev(button1); - if (detaching) detach_dev(t7); - if (detaching) detach_dev(input3); - if (detaching) detach_dev(t8); - if (detaching) detach_dev(label); - if (detaching) detach_dev(t10); - if (detaching) detach_dev(div3); + if (detaching) detach_dev(div); + if (if_block) if_block.d(); mounted = false; - run_all(dispose); + dispose(); } }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$g.name, + id: create_fragment$k.name, type: "component", source: "", ctx @@ -2775,243 +3204,3864 @@ var app = (function () { return block; } - function instance$g($$self, $$props, $$invalidate) { - let $targets; - let $objectives; - let $skills; - let $inventory; - validate_store(targets, 'targets'); - component_subscribe($$self, targets, $$value => $$invalidate(10, $targets = $$value)); - validate_store(objectives, 'objectives'); - component_subscribe($$self, objectives, $$value => $$invalidate(11, $objectives = $$value)); - validate_store(skills, 'skills'); - component_subscribe($$self, skills, $$value => $$invalidate(12, $skills = $$value)); - validate_store(inventory, 'inventory'); - component_subscribe($$self, inventory, $$value => $$invalidate(13, $inventory = $$value)); + function instance$k($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; - validate_slots('MovingDotSpaceThemeManager', slots, []); - let { ChangedContentPlaceholder = "" } = $$props; - let newItem = { type: "", name: "", description: "" }; - let newSkill = { branch: "", name: "", learned: false }; - let newObjective = { branch: "", name: "", complete: false }; - - // ... similarly for targets - function addItem() { - inventory.update(items => [...items, newItem]); - $$invalidate(1, newItem = { type: "", name: "", description: "" }); // Reset form - } - - function addSkill() { - skills.update(skills => [...skills, newSkill]); - newSkill = { branch: "", name: "", learned: false }; // Reset form - } - - function addObjective() { - objectives.update(objectives => [...objectives, newObjective]); - newObjective = { branch: "", name: "", complete: false }; // Reset form - } - - // ... similarly for targets - // Functions to save and load configurations to/from localStorage or a backend would also be defined here - // Function to download the current configuration as a JSON file - function downloadConfiguration() { - const gameConfig = { - inventory: $inventory, - skills: $skills, - objectives: $objectives, - targets: $targets - }; - - const blob = new Blob([JSON.stringify(gameConfig, null, 2)], { type: 'application/json' }); - const href = URL.createObjectURL(blob); - const link = document.createElement('a'); - link.href = href; - link.download = 'gameConfig.json'; - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - } - - // Function to load configuration from an uploaded JSON file - function handleFileUpload(event) { - const file = event.target.files[0]; - - if (file) { - const reader = new FileReader(); - - reader.onload = e => { - const fileContent = e.target.result; - const { inventory: loadedInventory, skills: loadedSkills, objectives: loadedObjectives, targets: loadedTargets } = JSON.parse(fileContent); - inventory.set(loadedInventory); - skills.set(loadedSkills); - objectives.set(loadedObjectives); - targets.set(loadedTargets); - alert('Configuration loaded!'); - }; + validate_slots('SimpleCollapsible', slots, ['default']); + let { title = '' } = $$props; + let isOpen = false; - reader.readAsText(file); - } + function toggleCollapsible() { + $$invalidate(1, isOpen = !isOpen); } - const writable_props = ['ChangedContentPlaceholder']; + const writable_props = ['title']; 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.warn(` was created with unknown prop '${key}'`); }); - function input0_input_handler() { - newItem.type = this.value; - $$invalidate(1, newItem); - } - - function input1_input_handler() { - newItem.name = this.value; - $$invalidate(1, newItem); - } - - function input2_input_handler() { - newItem.description = this.value; - $$invalidate(1, newItem); - } - $$self.$$set = $$props => { - if ('ChangedContentPlaceholder' in $$props) $$invalidate(0, ChangedContentPlaceholder = $$props.ChangedContentPlaceholder); + if ('title' in $$props) $$invalidate(0, title = $$props.title); + if ('$$scope' in $$props) $$invalidate(3, $$scope = $$props.$$scope); }; - $$self.$capture_state = () => ({ - ChangedContentPlaceholder, - inventory, - skills, - objectives, - targets, - newItem, - newSkill, - newObjective, - addItem, - addSkill, - addObjective, - downloadConfiguration, - handleFileUpload, - $targets, - $objectives, - $skills, - $inventory - }); + $$self.$capture_state = () => ({ title, isOpen, toggleCollapsible }); $$self.$inject_state = $$props => { - if ('ChangedContentPlaceholder' in $$props) $$invalidate(0, ChangedContentPlaceholder = $$props.ChangedContentPlaceholder); - if ('newItem' in $$props) $$invalidate(1, newItem = $$props.newItem); - if ('newSkill' in $$props) newSkill = $$props.newSkill; - if ('newObjective' in $$props) newObjective = $$props.newObjective; + if ('title' in $$props) $$invalidate(0, title = $$props.title); + if ('isOpen' in $$props) $$invalidate(1, isOpen = $$props.isOpen); }; if ($$props && "$$inject" in $$props) { $$self.$inject_state($$props.$$inject); } - return [ - ChangedContentPlaceholder, - newItem, - addItem, - downloadConfiguration, - handleFileUpload, - input0_input_handler, - input1_input_handler, - input2_input_handler - ]; + return [title, isOpen, toggleCollapsible, $$scope, slots]; } - class MovingDotSpaceThemeManager extends SvelteComponentDev { + class SimpleCollapsible extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$g, create_fragment$g, safe_not_equal, { ChangedContentPlaceholder: 0 }); + init(this, options, instance$k, create_fragment$k, safe_not_equal, { title: 0 }); dispatch_dev("SvelteRegisterComponent", { component: this, - tagName: "MovingDotSpaceThemeManager", + tagName: "SimpleCollapsible", options, - id: create_fragment$g.name + id: create_fragment$k.name }); } - get ChangedContentPlaceholder() { - throw new Error(": Props cannot be read directly from 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 ChangedContentPlaceholder(value) { - throw new Error(": Props cannot be set directly on 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 ''"); } } - /* src\MovingDotSpaceGameFight.svelte generated by Svelte v3.59.2 */ + /* src\BrainstormGameConfigsRandom.svelte generated by Svelte v3.59.2 */ - const file$f = "src\\MovingDotSpaceGameFight.svelte"; + const { console: console_1$9 } = globals; + const file$j = "src\\BrainstormGameConfigsRandom.svelte"; - // (88:8) {#if $fightcurrentTurn === 'human'} - function create_if_block$7(ctx) { - let button0; + function get_each_context$c(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[9] = list[i]; + return child_ctx; + } + + function get_each_context_1$6(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[12] = list[i]; + child_ctx[14] = i; + return child_ctx; + } + + function get_each_context_2$1(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[15] = list[i]; + return child_ctx; + } + + function get_each_context_3(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[18] = list[i]; + return child_ctx; + } + + function get_each_context_4(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[21] = list[i]; + return child_ctx; + } + + function get_each_context_5(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[24] = list[i]; + child_ctx[14] = i; + return child_ctx; + } + + function get_each_context_6(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[15] = list[i]; + return child_ctx; + } + + function get_each_context_7(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[21] = list[i]; + return child_ctx; + } + + function get_each_context_8(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[30] = list[i]; + return child_ctx; + } + + function get_each_context_9(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[33] = list[i]; + return child_ctx; + } + + // (262:24) {#each randomContent.inventory as item} + function create_each_block_9(ctx) { + let li; + let t0_value = /*item*/ ctx[33].name + ""; + let t0; let t1; - let button1; - let t3; - let button2; - let mounted; - let dispose; + let t2_value = /*item*/ ctx[33].description + ""; + let t2; - const block_1 = { + const block = { c: function create() { - button0 = element("button"); - button0.textContent = "Attack"; - t1 = space(); - button1 = element("button"); - button1.textContent = "Special Attack"; - t3 = space(); - button2 = element("button"); - button2.textContent = "Block"; - add_location(button0, file$f, 88, 12, 3623); - add_location(button1, file$f, 89, 12, 3730); - add_location(button2, file$f, 90, 12, 3856); + li = element("li"); + t0 = text(t0_value); + t1 = text(" - "); + t2 = text(t2_value); + attr_dev(li, "class", "svelte-utjjnp"); + add_location(li, file$j, 262, 28, 10991); }, m: function mount(target, anchor) { - insert_dev(target, button0, anchor); - insert_dev(target, t1, anchor); - insert_dev(target, button1, anchor); - insert_dev(target, t3, anchor); - insert_dev(target, button2, anchor); - - if (!mounted) { - dispose = [ - listen_dev(button0, "click", /*click_handler*/ ctx[5], false, false, false, false), - listen_dev(button1, "click", /*click_handler_1*/ ctx[6], false, false, false, false), - listen_dev(button2, "click", /*click_handler_2*/ ctx[7], false, false, false, false) - ]; - - mounted = true; - } + insert_dev(target, li, anchor); + append_dev(li, t0); + append_dev(li, t1); + append_dev(li, t2); + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*randomContent*/ 1 && t0_value !== (t0_value = /*item*/ ctx[33].name + "")) set_data_dev(t0, t0_value); + if (dirty[0] & /*randomContent*/ 1 && t2_value !== (t2_value = /*item*/ ctx[33].description + "")) set_data_dev(t2, t2_value); }, - p: noop, d: function destroy(detaching) { - if (detaching) detach_dev(button0); - if (detaching) detach_dev(t1); - if (detaching) detach_dev(button1); - if (detaching) detach_dev(t3); - if (detaching) detach_dev(button2); - mounted = false; - run_all(dispose); + if (detaching) detach_dev(li); } }; dispatch_dev("SvelteRegisterBlock", { - block: block_1, - id: create_if_block$7.name, - type: "if", - source: "(88:8) {#if $fightcurrentTurn === 'human'}", + block, + id: create_each_block_9.name, + type: "each", + source: "(262:24) {#each randomContent.inventory as item}", ctx }); - return block_1; + return block; + } + + // (269:24) {#each randomContent.skills as skill} + function create_each_block_8(ctx) { + let li; + let t0_value = /*skill*/ ctx[30].branch + ""; + let t0; + let t1; + let t2_value = /*skill*/ ctx[30].name + ""; + let t2; + + const block = { + c: function create() { + li = element("li"); + t0 = text(t0_value); + t1 = text(" - "); + t2 = text(t2_value); + attr_dev(li, "class", "svelte-utjjnp"); + toggle_class(li, "learned", /*skill*/ ctx[30].learned); + add_location(li, file$j, 269, 28, 11282); + }, + m: function mount(target, anchor) { + insert_dev(target, li, anchor); + append_dev(li, t0); + append_dev(li, t1); + append_dev(li, t2); + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*randomContent*/ 1 && t0_value !== (t0_value = /*skill*/ ctx[30].branch + "")) set_data_dev(t0, t0_value); + if (dirty[0] & /*randomContent*/ 1 && t2_value !== (t2_value = /*skill*/ ctx[30].name + "")) set_data_dev(t2, t2_value); + + if (dirty[0] & /*randomContent*/ 1) { + toggle_class(li, "learned", /*skill*/ ctx[30].learned); + } + }, + d: function destroy(detaching) { + if (detaching) detach_dev(li); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block_8.name, + type: "each", + source: "(269:24) {#each randomContent.skills as skill}", + ctx + }); + + return block; + } + + // (276:24) {#each randomContent.objectives as objective} + function create_each_block_7(ctx) { + let li; + let t0_value = /*objective*/ ctx[21].id + ""; + let t0; + let t1; + let t2_value = /*objective*/ ctx[21].name + ""; + let t2; + + const block = { + c: function create() { + li = element("li"); + t0 = text(t0_value); + t1 = text(" - "); + t2 = text(t2_value); + attr_dev(li, "class", "svelte-utjjnp"); + toggle_class(li, "complete", /*objective*/ ctx[21].complete); + add_location(li, file$j, 276, 28, 11612); + }, + m: function mount(target, anchor) { + insert_dev(target, li, anchor); + append_dev(li, t0); + append_dev(li, t1); + append_dev(li, t2); + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*randomContent*/ 1 && t0_value !== (t0_value = /*objective*/ ctx[21].id + "")) set_data_dev(t0, t0_value); + if (dirty[0] & /*randomContent*/ 1 && t2_value !== (t2_value = /*objective*/ ctx[21].name + "")) set_data_dev(t2, t2_value); + + if (dirty[0] & /*randomContent*/ 1) { + toggle_class(li, "complete", /*objective*/ ctx[21].complete); + } + }, + d: function destroy(detaching) { + if (detaching) detach_dev(li); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block_7.name, + type: "each", + source: "(276:24) {#each randomContent.objectives as objective}", + ctx + }); + + return block; + } + + // (288:28) {#each chapter.targets as target} + function create_each_block_6(ctx) { + let li; + let t0_value = /*target*/ ctx[15].name + ""; + let t0; + let t1; + let t2_value = /*target*/ ctx[15].x + ""; + let t2; + let t3; + let t4_value = /*target*/ ctx[15].y + ""; + let t4; + let t5; + let t6_value = /*target*/ ctx[15].collisionType + ""; + let t6; + + const block = { + c: function create() { + li = element("li"); + t0 = text(t0_value); + t1 = text(" - ("); + t2 = text(t2_value); + t3 = text(", "); + t4 = text(t4_value); + t5 = text(") - "); + t6 = text(t6_value); + attr_dev(li, "class", "svelte-utjjnp"); + add_location(li, file$j, 288, 28, 12148); + }, + m: function mount(target, anchor) { + insert_dev(target, li, anchor); + append_dev(li, t0); + append_dev(li, t1); + append_dev(li, t2); + append_dev(li, t3); + append_dev(li, t4); + append_dev(li, t5); + append_dev(li, t6); + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*randomContent*/ 1 && t0_value !== (t0_value = /*target*/ ctx[15].name + "")) set_data_dev(t0, t0_value); + if (dirty[0] & /*randomContent*/ 1 && t2_value !== (t2_value = /*target*/ ctx[15].x + "")) set_data_dev(t2, t2_value); + if (dirty[0] & /*randomContent*/ 1 && t4_value !== (t4_value = /*target*/ ctx[15].y + "")) set_data_dev(t4, t4_value); + if (dirty[0] & /*randomContent*/ 1 && t6_value !== (t6_value = /*target*/ ctx[15].collisionType + "")) set_data_dev(t6, t6_value); + }, + d: function destroy(detaching) { + if (detaching) detach_dev(li); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block_6.name, + type: "each", + source: "(288:28) {#each chapter.targets as target}", + ctx + }); + + return block; + } + + // (284:24) {#each randomContent.story as chapter, i} + function create_each_block_5(ctx) { + let h3; + let t0; + let t1_value = /*i*/ ctx[14] + 1 + ""; + let t1; + let t2; + let p; + let t4; + let ul; + let t5; + let each_value_6 = /*chapter*/ ctx[24].targets; + validate_each_argument(each_value_6); + let each_blocks = []; + + for (let i = 0; i < each_value_6.length; i += 1) { + each_blocks[i] = create_each_block_6(get_each_context_6(ctx, each_value_6, i)); + } + + const block = { + c: function create() { + h3 = element("h3"); + t0 = text("Chapter "); + t1 = text(t1_value); + t2 = space(); + p = element("p"); + p.textContent = "Targets:"; + t4 = space(); + ul = element("ul"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t5 = space(); + add_location(h3, file$j, 284, 24, 11960); + add_location(p, file$j, 285, 24, 12010); + attr_dev(ul, "class", "svelte-utjjnp"); + add_location(ul, file$j, 286, 24, 12051); + }, + m: function mount(target, anchor) { + insert_dev(target, h3, anchor); + append_dev(h3, t0); + append_dev(h3, t1); + insert_dev(target, t2, anchor); + insert_dev(target, p, anchor); + insert_dev(target, t4, anchor); + insert_dev(target, ul, anchor); + + for (let i = 0; i < each_blocks.length; i += 1) { + if (each_blocks[i]) { + each_blocks[i].m(ul, null); + } + } + + append_dev(ul, t5); + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*randomContent*/ 1) { + each_value_6 = /*chapter*/ ctx[24].targets; + validate_each_argument(each_value_6); + let i; + + for (i = 0; i < each_value_6.length; i += 1) { + const child_ctx = get_each_context_6(ctx, each_value_6, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block_6(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(ul, t5); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value_6.length; + } + }, + d: function destroy(detaching) { + if (detaching) detach_dev(h3); + if (detaching) detach_dev(t2); + if (detaching) detach_dev(p); + if (detaching) detach_dev(t4); + if (detaching) detach_dev(ul); + destroy_each(each_blocks, detaching); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block_5.name, + type: "each", + source: "(284:24) {#each randomContent.story as chapter, i}", + ctx + }); + + return block; + } + + // (308:36) {#each storyPart.objectives as objective} + function create_each_block_4(ctx) { + let li; + let span; + let t0_value = /*objective*/ ctx[21].name + ""; + let t0; + let t1; + let input; + let t2; + + const block = { + c: function create() { + li = element("li"); + span = element("span"); + t0 = text(t0_value); + t1 = space(); + input = element("input"); + t2 = space(); + add_location(span, file$j, 309, 44, 13293); + attr_dev(input, "type", "text"); + attr_dev(input, "placeholder", "Enter objective details"); + add_location(input, file$j, 310, 44, 13368); + attr_dev(li, "class", "svelte-utjjnp"); + add_location(li, file$j, 308, 40, 13243); + }, + m: function mount(target, anchor) { + insert_dev(target, li, anchor); + append_dev(li, span); + append_dev(span, t0); + append_dev(li, t1); + append_dev(li, input); + append_dev(li, t2); + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && t0_value !== (t0_value = /*objective*/ ctx[21].name + "")) set_data_dev(t0, t0_value); + }, + d: function destroy(detaching) { + if (detaching) detach_dev(li); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block_4.name, + type: "each", + source: "(308:36) {#each storyPart.objectives as objective}", + ctx + }); + + return block; + } + + // (326:44) {#if target.subTargets && target.subTargets.length > 0} + function create_if_block$a(ctx) { + let div; + let h5; + let t0; + let t1_value = /*target*/ ctx[15].name + ""; + let t1; + let t2; + let ul; + let each_value_3 = /*target*/ ctx[15].subTargets; + validate_each_argument(each_value_3); + let each_blocks = []; + + for (let i = 0; i < each_value_3.length; i += 1) { + each_blocks[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); + } + + const block = { + c: function create() { + div = element("div"); + h5 = element("h5"); + t0 = text("Subtargets of "); + t1 = text(t1_value); + t2 = space(); + ul = element("ul"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + add_location(h5, file$j, 327, 52, 14525); + attr_dev(ul, "class", "svelte-utjjnp"); + add_location(ul, file$j, 328, 52, 14615); + add_location(div, file$j, 326, 48, 14466); + }, + m: function mount(target, anchor) { + insert_dev(target, div, anchor); + append_dev(div, h5); + append_dev(h5, t0); + append_dev(h5, t1); + append_dev(div, t2); + append_dev(div, ul); + + for (let i = 0; i < each_blocks.length; i += 1) { + if (each_blocks[i]) { + each_blocks[i].m(ul, null); + } + } + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && t1_value !== (t1_value = /*target*/ ctx[15].name + "")) set_data_dev(t1, t1_value); + + if (dirty[0] & /*randomContentStructureSubtargets*/ 2) { + each_value_3 = /*target*/ ctx[15].subTargets; + validate_each_argument(each_value_3); + let i; + + for (i = 0; i < each_value_3.length; i += 1) { + const child_ctx = get_each_context_3(ctx, each_value_3, 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_3.length; + } + }, + d: function destroy(detaching) { + if (detaching) detach_dev(div); + destroy_each(each_blocks, detaching); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_if_block$a.name, + type: "if", + source: "(326:44) {#if target.subTargets && target.subTargets.length > 0}", + ctx + }); + + return block; + } + + // (330:56) {#each target.subTargets as subTarget} + function create_each_block_3(ctx) { + let li; + let span; + let t0_value = /*subTarget*/ ctx[18].name + ""; + let t0; + let t1; + let input; + let t2; + let p0; + let t3; + let t4_value = /*subTarget*/ ctx[18].x + ""; + let t4; + let t5; + let t6_value = /*subTarget*/ ctx[18].y + ""; + let t6; + let t7; + let t8; + let p1; + let t9; + let t10_value = /*subTarget*/ ctx[18].collisionType + ""; + let t10; + let t11; + let textarea; + let textarea_value_value; + let t12; + + const block = { + c: function create() { + li = element("li"); + span = element("span"); + t0 = text(t0_value); + t1 = space(); + input = element("input"); + t2 = space(); + p0 = element("p"); + t3 = text("Coordinates: ("); + t4 = text(t4_value); + t5 = text(", "); + t6 = text(t6_value); + t7 = text(")"); + t8 = space(); + p1 = element("p"); + t9 = text("Collision Type: "); + t10 = text(t10_value); + t11 = space(); + textarea = element("textarea"); + t12 = space(); + add_location(span, file$j, 331, 64, 14847); + attr_dev(input, "type", "text"); + attr_dev(input, "placeholder", "Enter subtarget details"); + add_location(input, file$j, 332, 64, 14942); + add_location(p0, file$j, 333, 64, 15067); + add_location(p1, file$j, 334, 64, 15183); + attr_dev(textarea, "placeholder", "Enter collision text"); + textarea.value = textarea_value_value = /*subTarget*/ ctx[18].collisiontext; + add_location(textarea, file$j, 335, 64, 15297); + attr_dev(li, "class", "svelte-utjjnp"); + add_location(li, file$j, 330, 60, 14777); + }, + m: function mount(target, anchor) { + insert_dev(target, li, anchor); + append_dev(li, span); + append_dev(span, t0); + append_dev(li, t1); + append_dev(li, input); + append_dev(li, t2); + append_dev(li, p0); + append_dev(p0, t3); + append_dev(p0, t4); + append_dev(p0, t5); + append_dev(p0, t6); + append_dev(p0, t7); + append_dev(li, t8); + append_dev(li, p1); + append_dev(p1, t9); + append_dev(p1, t10); + append_dev(li, t11); + append_dev(li, textarea); + append_dev(li, t12); + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && t0_value !== (t0_value = /*subTarget*/ ctx[18].name + "")) set_data_dev(t0, t0_value); + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && t4_value !== (t4_value = /*subTarget*/ ctx[18].x + "")) set_data_dev(t4, t4_value); + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && t6_value !== (t6_value = /*subTarget*/ ctx[18].y + "")) set_data_dev(t6, t6_value); + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && t10_value !== (t10_value = /*subTarget*/ ctx[18].collisionType + "")) set_data_dev(t10, t10_value); + + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && textarea_value_value !== (textarea_value_value = /*subTarget*/ ctx[18].collisiontext)) { + prop_dev(textarea, "value", textarea_value_value); + } + }, + d: function destroy(detaching) { + if (detaching) detach_dev(li); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block_3.name, + type: "each", + source: "(330:56) {#each target.subTargets as subTarget}", + ctx + }); + + return block; + } + + // (319:36) {#each storyPart.targets as target} + function create_each_block_2$1(ctx) { + let li; + let span; + let t0_value = /*target*/ ctx[15].name + ""; + let t0; + let t1; + let input; + let t2; + let p0; + let t3; + let t4_value = /*target*/ ctx[15].x + ""; + let t4; + let t5; + let t6_value = /*target*/ ctx[15].y + ""; + let t6; + let t7; + let t8; + let p1; + let t9; + let t10_value = /*target*/ ctx[15].collisionType + ""; + let t10; + let t11; + let textarea; + let textarea_value_value; + let t12; + let t13; + let if_block = /*target*/ ctx[15].subTargets && /*target*/ ctx[15].subTargets.length > 0 && create_if_block$a(ctx); + + const block = { + c: function create() { + li = element("li"); + span = element("span"); + t0 = text(t0_value); + t1 = space(); + input = element("input"); + t2 = space(); + p0 = element("p"); + t3 = text("Coordinates: ("); + t4 = text(t4_value); + t5 = text(", "); + t6 = text(t6_value); + t7 = text(")"); + t8 = space(); + p1 = element("p"); + t9 = text("Collision Type: "); + t10 = text(t10_value); + t11 = space(); + textarea = element("textarea"); + t12 = space(); + if (if_block) if_block.c(); + t13 = space(); + add_location(span, file$j, 320, 44, 13882); + attr_dev(input, "type", "text"); + attr_dev(input, "placeholder", "Enter target details"); + add_location(input, file$j, 321, 44, 13954); + add_location(p0, file$j, 322, 44, 14056); + add_location(p1, file$j, 323, 44, 14146); + attr_dev(textarea, "placeholder", "Enter collision text"); + textarea.value = textarea_value_value = /*target*/ ctx[15].collisiontext; + add_location(textarea, file$j, 324, 44, 14237); + attr_dev(li, "class", "svelte-utjjnp"); + add_location(li, file$j, 319, 40, 13832); + }, + m: function mount(target, anchor) { + insert_dev(target, li, anchor); + append_dev(li, span); + append_dev(span, t0); + append_dev(li, t1); + append_dev(li, input); + append_dev(li, t2); + append_dev(li, p0); + append_dev(p0, t3); + append_dev(p0, t4); + append_dev(p0, t5); + append_dev(p0, t6); + append_dev(p0, t7); + append_dev(li, t8); + append_dev(li, p1); + append_dev(p1, t9); + append_dev(p1, t10); + append_dev(li, t11); + append_dev(li, textarea); + append_dev(li, t12); + if (if_block) if_block.m(li, null); + append_dev(li, t13); + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && t0_value !== (t0_value = /*target*/ ctx[15].name + "")) set_data_dev(t0, t0_value); + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && t4_value !== (t4_value = /*target*/ ctx[15].x + "")) set_data_dev(t4, t4_value); + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && t6_value !== (t6_value = /*target*/ ctx[15].y + "")) set_data_dev(t6, t6_value); + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && t10_value !== (t10_value = /*target*/ ctx[15].collisionType + "")) set_data_dev(t10, t10_value); + + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && textarea_value_value !== (textarea_value_value = /*target*/ ctx[15].collisiontext)) { + prop_dev(textarea, "value", textarea_value_value); + } + + if (/*target*/ ctx[15].subTargets && /*target*/ ctx[15].subTargets.length > 0) { + if (if_block) { + if_block.p(ctx, dirty); + } else { + if_block = create_if_block$a(ctx); + if_block.c(); + if_block.m(li, t13); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + }, + d: function destroy(detaching) { + if (detaching) detach_dev(li); + if (if_block) if_block.d(); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block_2$1.name, + type: "each", + source: "(319:36) {#each storyPart.targets as target}", + ctx + }); + + return block; + } + + // (302:20) {#each randomContentStructureSubtargets.story as storyPart, i} + function create_each_block_1$6(ctx) { + let div2; + let h3; + let t0; + let t1_value = /*storyPart*/ ctx[12].part + 1 + ""; + let t1; + let t2; + let div0; + let h40; + let t4; + let ul0; + let t5; + let div1; + let h41; + let t7; + let ul1; + let t8; + let each_value_4 = /*storyPart*/ ctx[12].objectives; + validate_each_argument(each_value_4); + let each_blocks_1 = []; + + for (let i = 0; i < each_value_4.length; i += 1) { + each_blocks_1[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i)); + } + + let each_value_2 = /*storyPart*/ ctx[12].targets; + validate_each_argument(each_value_2); + let each_blocks = []; + + for (let i = 0; i < each_value_2.length; i += 1) { + each_blocks[i] = create_each_block_2$1(get_each_context_2$1(ctx, each_value_2, i)); + } + + const block = { + c: function create() { + div2 = element("div"); + h3 = element("h3"); + t0 = text("Part "); + t1 = text(t1_value); + t2 = space(); + div0 = element("div"); + h40 = element("h4"); + h40.textContent = "Objectives"; + t4 = space(); + ul0 = element("ul"); + + for (let i = 0; i < each_blocks_1.length; i += 1) { + each_blocks_1[i].c(); + } + + t5 = space(); + div1 = element("div"); + h41 = element("h4"); + h41.textContent = "Targets"; + t7 = space(); + ul1 = element("ul"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + t8 = space(); + add_location(h3, file$j, 303, 28, 12962); + add_location(h40, file$j, 305, 32, 13065); + attr_dev(ul0, "class", "svelte-utjjnp"); + add_location(ul0, file$j, 306, 32, 13118); + add_location(div0, file$j, 304, 28, 13026); + add_location(h41, file$j, 316, 32, 13663); + attr_dev(ul1, "class", "svelte-utjjnp"); + add_location(ul1, file$j, 317, 32, 13713); + add_location(div1, file$j, 315, 28, 13624); + add_location(div2, file$j, 302, 24, 12927); + }, + m: function mount(target, anchor) { + insert_dev(target, div2, anchor); + append_dev(div2, h3); + append_dev(h3, t0); + append_dev(h3, t1); + append_dev(div2, t2); + append_dev(div2, div0); + append_dev(div0, h40); + append_dev(div0, t4); + append_dev(div0, ul0); + + for (let i = 0; i < each_blocks_1.length; i += 1) { + if (each_blocks_1[i]) { + each_blocks_1[i].m(ul0, null); + } + } + + append_dev(div2, t5); + append_dev(div2, div1); + append_dev(div1, h41); + append_dev(div1, t7); + append_dev(div1, ul1); + + for (let i = 0; i < each_blocks.length; i += 1) { + if (each_blocks[i]) { + each_blocks[i].m(ul1, null); + } + } + + append_dev(div2, t8); + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*randomContentStructureSubtargets*/ 2 && t1_value !== (t1_value = /*storyPart*/ ctx[12].part + 1 + "")) set_data_dev(t1, t1_value); + + if (dirty[0] & /*randomContentStructureSubtargets*/ 2) { + each_value_4 = /*storyPart*/ ctx[12].objectives; + validate_each_argument(each_value_4); + let i; + + for (i = 0; i < each_value_4.length; i += 1) { + const child_ctx = get_each_context_4(ctx, each_value_4, i); + + if (each_blocks_1[i]) { + each_blocks_1[i].p(child_ctx, dirty); + } else { + each_blocks_1[i] = create_each_block_4(child_ctx); + each_blocks_1[i].c(); + each_blocks_1[i].m(ul0, null); + } + } + + for (; i < each_blocks_1.length; i += 1) { + each_blocks_1[i].d(1); + } + + each_blocks_1.length = each_value_4.length; + } + + if (dirty[0] & /*randomContentStructureSubtargets*/ 2) { + each_value_2 = /*storyPart*/ ctx[12].targets; + validate_each_argument(each_value_2); + let i; + + for (i = 0; i < each_value_2.length; i += 1) { + const child_ctx = get_each_context_2$1(ctx, each_value_2, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block_2$1(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(ul1, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value_2.length; + } + }, + d: function destroy(detaching) { + if (detaching) detach_dev(div2); + destroy_each(each_blocks_1, detaching); + destroy_each(each_blocks, detaching); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block_1$6.name, + type: "each", + source: "(302:20) {#each randomContentStructureSubtargets.story as storyPart, i}", + ctx + }); + + return block; + } + + // (358:12) {#each timelinePoints as point} + function create_each_block$c(ctx) { + let li; + let strong; + let t0_value = /*point*/ ctx[9].name + ""; + let t0; + let t1; + let p; + let t2_value = /*point*/ ctx[9].details + ""; + let t2; + let t3; + + const block = { + c: function create() { + li = element("li"); + strong = element("strong"); + t0 = text(t0_value); + t1 = space(); + p = element("p"); + t2 = text(t2_value); + t3 = space(); + add_location(strong, file$j, 359, 20, 16431); + add_location(p, file$j, 360, 20, 16482); + attr_dev(li, "class", "svelte-utjjnp"); + add_location(li, file$j, 358, 16, 16405); + }, + m: function mount(target, anchor) { + insert_dev(target, li, anchor); + append_dev(li, strong); + append_dev(strong, t0); + append_dev(li, t1); + append_dev(li, p); + append_dev(p, t2); + append_dev(li, t3); + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*timelinePoints*/ 4 && t0_value !== (t0_value = /*point*/ ctx[9].name + "")) set_data_dev(t0, t0_value); + if (dirty[0] & /*timelinePoints*/ 4 && t2_value !== (t2_value = /*point*/ ctx[9].details + "")) set_data_dev(t2, t2_value); + }, + d: function destroy(detaching) { + if (detaching) detach_dev(li); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block$c.name, + type: "each", + source: "(358:12) {#each timelinePoints as point}", + ctx + }); + + return block; + } + + function create_fragment$j(ctx) { + let div10; + let h10; + let t1; + let div8; + let div7; + let div4; + let div0; + let h11; + let t3; + let button0; + let t5; + let button1; + let t7; + let div3; + let div1; + let h20; + let t9; + let t10_value = /*randomContent*/ ctx[0].background + ""; + let t10; + let t11; + let h21; + let t13; + let ul0; + let t14; + let h22; + let t16; + let ul1; + let t17; + let h23; + let t19; + let ul2; + let t20; + let div2; + let h24; + let t22; + let t23; + let div6; + let h12; + let t25; + let button2; + let t27; + let button3; + let t29; + let div5; + let t30; + let h13; + let t32; + let button4; + let t34; + let button5; + let t36; + let div9; + let ul3; + let mounted; + let dispose; + let each_value_9 = /*randomContent*/ ctx[0].inventory; + validate_each_argument(each_value_9); + let each_blocks_5 = []; + + for (let i = 0; i < each_value_9.length; i += 1) { + each_blocks_5[i] = create_each_block_9(get_each_context_9(ctx, each_value_9, i)); + } + + let each_value_8 = /*randomContent*/ ctx[0].skills; + validate_each_argument(each_value_8); + let each_blocks_4 = []; + + for (let i = 0; i < each_value_8.length; i += 1) { + each_blocks_4[i] = create_each_block_8(get_each_context_8(ctx, each_value_8, i)); + } + + let each_value_7 = /*randomContent*/ ctx[0].objectives; + validate_each_argument(each_value_7); + let each_blocks_3 = []; + + for (let i = 0; i < each_value_7.length; i += 1) { + each_blocks_3[i] = create_each_block_7(get_each_context_7(ctx, each_value_7, i)); + } + + let each_value_5 = /*randomContent*/ ctx[0].story; + validate_each_argument(each_value_5); + let each_blocks_2 = []; + + for (let i = 0; i < each_value_5.length; i += 1) { + each_blocks_2[i] = create_each_block_5(get_each_context_5(ctx, each_value_5, i)); + } + + let each_value_1 = /*randomContentStructureSubtargets*/ ctx[1].story; + validate_each_argument(each_value_1); + let each_blocks_1 = []; + + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks_1[i] = create_each_block_1$6(get_each_context_1$6(ctx, each_value_1, i)); + } + + let each_value = /*timelinePoints*/ ctx[2]; + validate_each_argument(each_value); + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block$c(get_each_context$c(ctx, each_value, i)); + } + + const block = { + c: function create() { + div10 = element("div"); + h10 = element("h1"); + h10.textContent = "Prototyping Custom User Config game on the fly"; + t1 = space(); + div8 = element("div"); + div7 = element("div"); + div4 = element("div"); + div0 = element("div"); + h11 = element("h1"); + h11.textContent = "Random Game Content Generator"; + t3 = space(); + button0 = element("button"); + button0.textContent = "Generate New Content"; + t5 = space(); + button1 = element("button"); + button1.textContent = "Copy Content Config to Clipboard"; + t7 = space(); + div3 = element("div"); + div1 = element("div"); + h20 = element("h2"); + h20.textContent = "Background"; + t9 = space(); + t10 = text(t10_value); + t11 = space(); + h21 = element("h2"); + h21.textContent = "Inventory"; + t13 = space(); + ul0 = element("ul"); + + for (let i = 0; i < each_blocks_5.length; i += 1) { + each_blocks_5[i].c(); + } + + t14 = space(); + h22 = element("h2"); + h22.textContent = "Skills"; + t16 = space(); + ul1 = element("ul"); + + for (let i = 0; i < each_blocks_4.length; i += 1) { + each_blocks_4[i].c(); + } + + t17 = space(); + h23 = element("h2"); + h23.textContent = "Objectives"; + t19 = space(); + ul2 = element("ul"); + + for (let i = 0; i < each_blocks_3.length; i += 1) { + each_blocks_3[i].c(); + } + + t20 = space(); + div2 = element("div"); + h24 = element("h2"); + h24.textContent = "Story"; + t22 = space(); + + for (let i = 0; i < each_blocks_2.length; i += 1) { + each_blocks_2[i].c(); + } + + t23 = space(); + div6 = element("div"); + h12 = element("h1"); + h12.textContent = "Random Game Structure Generator subtargets"; + t25 = space(); + button2 = element("button"); + button2.textContent = "Generate New Content Story Structure"; + t27 = space(); + button3 = element("button"); + button3.textContent = "Copy Random Structure to Clipboard"; + t29 = space(); + div5 = element("div"); + + for (let i = 0; i < each_blocks_1.length; i += 1) { + each_blocks_1[i].c(); + } + + t30 = space(); + h13 = element("h1"); + h13.textContent = "Random Game Structure to Timeline Generator"; + t32 = space(); + button4 = element("button"); + button4.textContent = "Generate Random Timeline from Story Structure"; + t34 = space(); + button5 = element("button"); + button5.textContent = "Generate Linear Timeline from Story Structure"; + t36 = space(); + div9 = element("div"); + ul3 = element("ul"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + add_location(h10, file$j, 244, 4, 10201); + add_location(h11, file$j, 250, 20, 10377); + add_location(button0, file$j, 251, 20, 10437); + add_location(button1, file$j, 252, 20, 10553); + add_location(div0, file$j, 249, 16, 10350); + add_location(h20, file$j, 256, 24, 10749); + add_location(h21, file$j, 259, 24, 10848); + attr_dev(ul0, "class", "svelte-utjjnp"); + add_location(ul0, file$j, 260, 24, 10892); + add_location(h22, file$j, 266, 24, 11144); + attr_dev(ul1, "class", "svelte-utjjnp"); + add_location(ul1, file$j, 267, 24, 11185); + add_location(h23, file$j, 273, 24, 11462); + attr_dev(ul2, "class", "svelte-utjjnp"); + add_location(ul2, file$j, 274, 24, 11507); + add_location(div1, file$j, 255, 20, 10718); + add_location(h24, file$j, 282, 24, 11853); + add_location(div2, file$j, 281, 20, 11822); + attr_dev(div3, "class", "StatColumns svelte-utjjnp"); + add_location(div3, file$j, 254, 16, 10671); + add_location(div4, file$j, 248, 12, 10323); + add_location(h12, file$j, 297, 16, 12442); + add_location(button2, file$j, 298, 16, 12511); + add_location(button3, file$j, 299, 16, 12677); + attr_dev(div5, "class", "StatColumns svelte-utjjnp"); + add_location(div5, file$j, 300, 16, 12792); + add_location(div6, file$j, 296, 12, 12419); + attr_dev(div7, "class", "ContainerColumns svelte-utjjnp"); + add_location(div7, file$j, 247, 8, 10279); + add_location(div8, file$j, 246, 4, 10264); + add_location(h13, file$j, 352, 4, 15984); + add_location(button4, file$j, 353, 4, 16042); + add_location(button5, file$j, 354, 4, 16177); + attr_dev(ul3, "class", "svelte-utjjnp"); + add_location(ul3, file$j, 356, 8, 16338); + attr_dev(div9, "class", "timeline svelte-utjjnp"); + add_location(div9, file$j, 355, 4, 16306); + add_location(div10, file$j, 243, 0, 10190); + }, + 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, div10, anchor); + append_dev(div10, h10); + append_dev(div10, t1); + append_dev(div10, div8); + append_dev(div8, div7); + append_dev(div7, div4); + append_dev(div4, div0); + append_dev(div0, h11); + append_dev(div0, t3); + append_dev(div0, button0); + append_dev(div0, t5); + append_dev(div0, button1); + append_dev(div4, t7); + append_dev(div4, div3); + append_dev(div3, div1); + append_dev(div1, h20); + append_dev(div1, t9); + append_dev(div1, t10); + append_dev(div1, t11); + append_dev(div1, h21); + append_dev(div1, t13); + append_dev(div1, ul0); + + for (let i = 0; i < each_blocks_5.length; i += 1) { + if (each_blocks_5[i]) { + each_blocks_5[i].m(ul0, null); + } + } + + append_dev(div1, t14); + append_dev(div1, h22); + append_dev(div1, t16); + append_dev(div1, ul1); + + for (let i = 0; i < each_blocks_4.length; i += 1) { + if (each_blocks_4[i]) { + each_blocks_4[i].m(ul1, null); + } + } + + append_dev(div1, t17); + append_dev(div1, h23); + append_dev(div1, t19); + append_dev(div1, ul2); + + for (let i = 0; i < each_blocks_3.length; i += 1) { + if (each_blocks_3[i]) { + each_blocks_3[i].m(ul2, null); + } + } + + append_dev(div3, t20); + append_dev(div3, div2); + append_dev(div2, h24); + append_dev(div2, t22); + + for (let i = 0; i < each_blocks_2.length; i += 1) { + if (each_blocks_2[i]) { + each_blocks_2[i].m(div2, null); + } + } + + append_dev(div7, t23); + append_dev(div7, div6); + append_dev(div6, h12); + append_dev(div6, t25); + append_dev(div6, button2); + append_dev(div6, t27); + append_dev(div6, button3); + append_dev(div6, t29); + append_dev(div6, div5); + + for (let i = 0; i < each_blocks_1.length; i += 1) { + if (each_blocks_1[i]) { + each_blocks_1[i].m(div5, null); + } + } + + append_dev(div10, t30); + append_dev(div10, h13); + append_dev(div10, t32); + append_dev(div10, button4); + append_dev(div10, t34); + append_dev(div10, button5); + append_dev(div10, t36); + append_dev(div10, div9); + append_dev(div9, ul3); + + for (let i = 0; i < each_blocks.length; i += 1) { + if (each_blocks[i]) { + each_blocks[i].m(ul3, null); + } + } + + if (!mounted) { + dispose = [ + listen_dev(button0, "click", /*click_handler*/ ctx[7], false, false, false, false), + listen_dev(button1, "click", /*copyToClipboard*/ ctx[3], false, false, false, false), + listen_dev(button2, "click", /*click_handler_1*/ ctx[8], false, false, false, false), + listen_dev(button3, "click", /*copyToClipboardStructuresubtargets*/ ctx[4], false, false, false, false), + listen_dev(button4, "click", /*generateAndUpdaterandomContentStructureSubtargetsRandom*/ ctx[6], false, false, false, false), + listen_dev(button5, "click", /*generateAndUpdaterandomContentStructureSubtargets*/ ctx[5], false, false, false, false) + ]; + + mounted = true; + } + }, + p: function update(ctx, dirty) { + if (dirty[0] & /*randomContent*/ 1 && t10_value !== (t10_value = /*randomContent*/ ctx[0].background + "")) set_data_dev(t10, t10_value); + + if (dirty[0] & /*randomContent*/ 1) { + each_value_9 = /*randomContent*/ ctx[0].inventory; + validate_each_argument(each_value_9); + let i; + + for (i = 0; i < each_value_9.length; i += 1) { + const child_ctx = get_each_context_9(ctx, each_value_9, i); + + if (each_blocks_5[i]) { + each_blocks_5[i].p(child_ctx, dirty); + } else { + each_blocks_5[i] = create_each_block_9(child_ctx); + each_blocks_5[i].c(); + each_blocks_5[i].m(ul0, null); + } + } + + for (; i < each_blocks_5.length; i += 1) { + each_blocks_5[i].d(1); + } + + each_blocks_5.length = each_value_9.length; + } + + if (dirty[0] & /*randomContent*/ 1) { + each_value_8 = /*randomContent*/ ctx[0].skills; + validate_each_argument(each_value_8); + let i; + + for (i = 0; i < each_value_8.length; i += 1) { + const child_ctx = get_each_context_8(ctx, each_value_8, i); + + if (each_blocks_4[i]) { + each_blocks_4[i].p(child_ctx, dirty); + } else { + each_blocks_4[i] = create_each_block_8(child_ctx); + each_blocks_4[i].c(); + each_blocks_4[i].m(ul1, null); + } + } + + for (; i < each_blocks_4.length; i += 1) { + each_blocks_4[i].d(1); + } + + each_blocks_4.length = each_value_8.length; + } + + if (dirty[0] & /*randomContent*/ 1) { + each_value_7 = /*randomContent*/ ctx[0].objectives; + validate_each_argument(each_value_7); + let i; + + for (i = 0; i < each_value_7.length; i += 1) { + const child_ctx = get_each_context_7(ctx, each_value_7, i); + + if (each_blocks_3[i]) { + each_blocks_3[i].p(child_ctx, dirty); + } else { + each_blocks_3[i] = create_each_block_7(child_ctx); + each_blocks_3[i].c(); + each_blocks_3[i].m(ul2, null); + } + } + + for (; i < each_blocks_3.length; i += 1) { + each_blocks_3[i].d(1); + } + + each_blocks_3.length = each_value_7.length; + } + + if (dirty[0] & /*randomContent*/ 1) { + each_value_5 = /*randomContent*/ ctx[0].story; + validate_each_argument(each_value_5); + let i; + + for (i = 0; i < each_value_5.length; i += 1) { + const child_ctx = get_each_context_5(ctx, each_value_5, i); + + if (each_blocks_2[i]) { + each_blocks_2[i].p(child_ctx, dirty); + } else { + each_blocks_2[i] = create_each_block_5(child_ctx); + each_blocks_2[i].c(); + each_blocks_2[i].m(div2, null); + } + } + + for (; i < each_blocks_2.length; i += 1) { + each_blocks_2[i].d(1); + } + + each_blocks_2.length = each_value_5.length; + } + + if (dirty[0] & /*randomContentStructureSubtargets*/ 2) { + each_value_1 = /*randomContentStructureSubtargets*/ ctx[1].story; + validate_each_argument(each_value_1); + let i; + + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_1$6(ctx, each_value_1, i); + + if (each_blocks_1[i]) { + each_blocks_1[i].p(child_ctx, dirty); + } else { + each_blocks_1[i] = create_each_block_1$6(child_ctx); + each_blocks_1[i].c(); + each_blocks_1[i].m(div5, null); + } + } + + for (; i < each_blocks_1.length; i += 1) { + each_blocks_1[i].d(1); + } + + each_blocks_1.length = each_value_1.length; + } + + if (dirty[0] & /*timelinePoints*/ 4) { + each_value = /*timelinePoints*/ ctx[2]; + validate_each_argument(each_value); + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context$c(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block$c(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(ul3, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value.length; + } + }, + i: noop, + o: noop, + d: function destroy(detaching) { + if (detaching) detach_dev(div10); + destroy_each(each_blocks_5, detaching); + destroy_each(each_blocks_4, detaching); + destroy_each(each_blocks_3, detaching); + destroy_each(each_blocks_2, detaching); + destroy_each(each_blocks_1, detaching); + destroy_each(each_blocks, detaching); + mounted = false; + run_all(dispose); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_fragment$j.name, + type: "component", + source: "", + ctx + }); + + return block; + } + + function generateRandomContent() { + const backgrounds = [ + '/AutoGameBackgrounds/space_background.png', + '/AutoGameBackgrounds/forest_background.png', + '/AutoGameBackgrounds/city_background.png', + '/AutoGameBackgrounds/desert_background.png', + '/AutoGameBackgrounds/underwater_background.png' + ]; + + const weaponTypes = ['Sword', 'Bow', 'Staff', 'Dagger', 'Axe', 'Mace', 'Whip', 'Spear']; + const armorTypes = ['Helmet', 'Chestplate', 'Leggings', 'Boots', 'Shield', 'Gloves', 'Cloak']; + const consumableTypes = ['Health Potion', 'Mana Potion', 'Stamina Potion', 'Antidote', 'Bomb']; + + const skillBranches = [ + 'Combat', + 'Magic', + 'Stealth', + 'Crafting', + 'Alchemy', + 'Archery', + 'Blacksmithing' + ]; + + const objectiveNames = [ + 'Explore', + 'Gather Resources', + 'Defeat Enemy', + 'Find Artifact', + 'Rescue Prisoner', + 'Escort NPC', + 'Solve Puzzle', + 'Repair Structure', + 'Negotiate Treaty', + 'Investigate Mystery' + ]; + + const targetNames = [ + 'Goblin', + 'Skeleton', + 'Dragon', + 'Bandit', + 'Orc', + 'Troll', + 'Giant Spider', + 'Undead Knight', + 'Corrupted Mage', + 'Rogue Assassin' + ]; + + const collisionTypes = ['alert', 'battle', 'dialogue', 'trade', 'cutscene']; + const randomBackground = backgrounds[Math.floor(Math.random() * backgrounds.length)]; + + const randomInventory = [ + ...Array.from({ length: 3 }, () => ({ + type: 'weapon', + name: `${weaponTypes[Math.floor(Math.random() * weaponTypes.length)]}`, + description: 'A powerful weapon.' + })), + ...Array.from({ length: 2 }, () => ({ + type: 'armor', + name: `${armorTypes[Math.floor(Math.random() * armorTypes.length)]}`, + description: 'Protective gear.' + })), + ...Array.from({ length: 2 }, () => ({ + type: 'consumable', + name: `${consumableTypes[Math.floor(Math.random() * consumableTypes.length)]}`, + description: 'A helpful item.' + })) + ]; + + const randomSkills = Array.from({ length: 15 }, (_, index) => ({ + branch: skillBranches[Math.floor(Math.random() * skillBranches.length)], + name: `Skill ${index + 1}`, + learned: Math.random() < 0.5 + })); + + const randomObjectives = Array.from({ length: 5 }, (_, index) => ({ + id: `Mission ${index + 1}`, + name: `${objectiveNames[Math.floor(Math.random() * objectiveNames.length)]} Mission`, + complete: Math.random() < 0.5 + })); + + const randomStory = Array.from({ length: 5 }, (_, index) => ({ + part: index, + objectives: Array.from({ length: 2 }, () => ({ + id: `Task ${Math.floor(Math.random() * 5) + 1}`, + name: `${objectiveNames[Math.floor(Math.random() * objectiveNames.length)]} Task`, + complete: Math.random() < 0.5 + })), + targets: Array.from({ length: 3 }, () => ({ + name: `${targetNames[Math.floor(Math.random() * targetNames.length)]}`, + x: Math.floor(Math.random() * 100), + y: Math.floor(Math.random() * 100), + collisionType: collisionTypes[Math.floor(Math.random() * collisionTypes.length)], + collisiontext: 'Test Collision' + })) + })); + + const randomContent = { + background: randomBackground, + inventory: randomInventory, + skills: randomSkills, + persistentTargets: [], + objectives: randomObjectives, + story: randomStory, + actions: { + Buybook() { + + }, // Logic to buy a book + // Logic to buy a book + + } + }; + + return randomContent; + } + + // function generateRandomContentStructure() { + // // ... (existing code for generating random content) + // const randomStoryPartslengths = Math.floor(Math.random() * 5) + 1; // Generate random number of story parts (1-5) + // const randomStorystructure = Array.from({ length: randomStoryPartslengths }, (_, index) => ({ + // part: index, + // objectives: Array.from({ length: Math.floor(Math.random() * 3) + 1 }, (_, idx) => ({ + // id: `Objective${index + 1}_${idx + 1}`, + // name: `Objective ${index + 1}.${idx + 1}`, + // complete: false, + // })), + // targets: Array.from({ length: Math.floor(Math.random() * 4) + 1 }, (_, idx) => ({ + // name: `Target${index + 1}_${idx + 1}`, + // x: Math.floor(Math.random() * 100), + // y: Math.floor(Math.random() * 100), + // collisionType: 'alert', + // collisiontext: `Placeholder text for Target ${index + 1}.${idx + 1}`, + // })), + // })); + // const randomContentstructure = { + // // ... (existing properties) + // story: randomStorystructure, + // }; + // return randomContentstructure; + // } + function generateRandomContentStructureSubtargets() { + // Random number generator for various properties + function getRandomNumber(max, min = 1) { + return Math.floor(Math.random() * (max - min + 1)) + min; + } + + // Recursive function to generate targets and optionally subtargets + function generateTargets(level = 0) { + const numberOfTargets = getRandomNumber(4); // Generate up to 4 targets + + const targets = Array.from({ length: numberOfTargets }, (_, idx) => { + const target = { + name: `Target${level}_${idx + 1}`, + x: getRandomNumber(100), + y: getRandomNumber(100), + collisionType: 'alert', + collisiontext: `Placeholder text for Target ${level}.${idx + 1}` + }; + + // Randomly decide if this target should have subtargets, less likely as level increases + if (Math.random() < 0.5 - level * 0.1) { + target.subTargets = generateTargets(level + 1); + } + + return target; + }); + + return targets; + } + + // Generate the random story structure with nested targets + const randomStoryPartsLength = getRandomNumber(5); // Generate random number of story parts (1-5) + + const randomStoryStructure = Array.from({ length: randomStoryPartsLength }, (_, index) => ({ + part: index, + objectives: Array.from({ length: getRandomNumber(3) }, (_, idx) => ({ + id: `Objective${index + 1}_${idx + 1}`, + name: `Objective ${index + 1}.${idx + 1}`, + complete: false + })), + targets: generateTargets() + })); + + // Compile the full random content structure + const randomContentStructure = { story: randomStoryStructure }; + + return randomContentStructure; + } + + function copyToClipboardStructure() { + navigator.clipboard.writeText(JSON.stringify(randomContentstructure, null, 2)).then(() => { + alert('Random content Structure copied to clipboard!'); + }).catch(error => { + console.error('Failed to copy to clipboard:', error); + alert('Error, Random content Structure failed to copy due to error!'); + }); + } + + // Flatten and prepare targets for the timeline + function prepareTimelineData(story) { + const allPoints = []; + + function recurseTargets(targets, prefix = '') { + targets.forEach((target, index) => { + const path = `${prefix}Target ${index + 1}: ${target.name}`; + + allPoints.push({ + name: path, + details: target.collisiontext + }); + + if (target.subTargets && target.subTargets.length > 0) { + recurseTargets(target.subTargets, path + ' -> '); + } + }); + } + + story.forEach((part, index) => { + if (part.targets) { + recurseTargets(part.targets, `Part ${index + 1} -> `); + } + }); + + return allPoints; + } + + function instance$j($$self, $$props, $$invalidate) { + let { $$slots: slots = {}, $$scope } = $$props; + validate_slots('BrainstormGameConfigsRandom', slots, []); + let randomContent = generateRandomContent(); + + // let randomContentstructure = generateRandomContentStructure(); + let randomContentStructureSubtargets = generateRandomContentStructureSubtargets(); + + console.log(randomContentStructureSubtargets); + + function copyToClipboard() { + navigator.clipboard.writeText(JSON.stringify(randomContent, null, 2)).then(() => { + alert('Random content copied to clipboard!'); + }).catch(error => { + console.error('Failed to copy to clipboard:', error); + alert('Error, Random content failed to copy due to error!'); + }); + } + + function copyToClipboardStructuresubtargets() { + navigator.clipboard.writeText(JSON.stringify(randomContentStructureSubtargets, null, 2)).then(() => { + alert('Random content Structure copied to clipboard!'); + }).catch(error => { + console.error('Failed to copy to clipboard:', error); + alert('Error, Random content Structure failed to copy due to error!'); + }); + } + + let timelinePoints = []; + + // Function to generate a new random structure and update the timeline + function generateAndUpdaterandomContentStructureSubtargets() { + $$invalidate(2, timelinePoints = prepareTimelineData(randomContentStructureSubtargets.story)); + } + + function generateAndUpdaterandomContentStructureSubtargetsRandom() { + const randomallPoints = prepareTimelineData(randomContentStructureSubtargets.story); + randomallPoints.sort(() => Math.random() - 0.5); + $$invalidate(2, timelinePoints = randomallPoints); + } + + const writable_props = []; + + Object.keys($$props).forEach(key => { + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$9.warn(` was created with unknown prop '${key}'`); + }); + + const click_handler = () => $$invalidate(0, randomContent = generateRandomContent()); + const click_handler_1 = () => $$invalidate(1, randomContentStructureSubtargets = generateRandomContentStructureSubtargets()); + + $$self.$capture_state = () => ({ + generateRandomContent, + generateRandomContentStructureSubtargets, + randomContent, + randomContentStructureSubtargets, + copyToClipboard, + copyToClipboardStructure, + copyToClipboardStructuresubtargets, + prepareTimelineData, + timelinePoints, + generateAndUpdaterandomContentStructureSubtargets, + generateAndUpdaterandomContentStructureSubtargetsRandom + }); + + $$self.$inject_state = $$props => { + if ('randomContent' in $$props) $$invalidate(0, randomContent = $$props.randomContent); + if ('randomContentStructureSubtargets' in $$props) $$invalidate(1, randomContentStructureSubtargets = $$props.randomContentStructureSubtargets); + if ('timelinePoints' in $$props) $$invalidate(2, timelinePoints = $$props.timelinePoints); + }; + + if ($$props && "$$inject" in $$props) { + $$self.$inject_state($$props.$$inject); + } + + return [ + randomContent, + randomContentStructureSubtargets, + timelinePoints, + copyToClipboard, + copyToClipboardStructuresubtargets, + generateAndUpdaterandomContentStructureSubtargets, + generateAndUpdaterandomContentStructureSubtargetsRandom, + click_handler, + click_handler_1 + ]; + } + + class BrainstormGameConfigsRandom extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance$j, create_fragment$j, safe_not_equal, {}, null, [-1, -1]); + + dispatch_dev("SvelteRegisterComponent", { + component: this, + tagName: "BrainstormGameConfigsRandom", + options, + id: create_fragment$j.name + }); + } + } + + /* src\BrainstormStateTransitionsRandom.svelte generated by Svelte v3.59.2 */ + + const file$i = "src\\BrainstormStateTransitionsRandom.svelte"; + + // (109:8) {#if sequence.length > 0} + function create_if_block_2$1(ctx) { + let div; + let p; + let t0; + let t1_value = /*sequence*/ ctx[0].join(', ') + ""; + let t1; + + const block = { + c: function create() { + div = element("div"); + p = element("p"); + t0 = text("Generated Sequence: "); + t1 = text(t1_value); + add_location(p, file$i, 110, 12, 5001); + add_location(div, file$i, 109, 8, 4982); + }, + m: function mount(target, anchor) { + insert_dev(target, div, anchor); + append_dev(div, p); + append_dev(p, t0); + append_dev(p, t1); + }, + p: function update(ctx, dirty) { + if (dirty & /*sequence*/ 1 && t1_value !== (t1_value = /*sequence*/ ctx[0].join(', ') + "")) set_data_dev(t1, t1_value); + }, + d: function destroy(detaching) { + if (detaching) detach_dev(div); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_if_block_2$1.name, + type: "if", + source: "(109:8) {#if sequence.length > 0}", + ctx + }); + + return block; + } + + // (99:4) {#if isTwoColumnLayout} + function create_if_block_1$4(ctx) { + let div2; + let div0; + let p0; + let t0; + let t1_value = /*playerSequence*/ ctx[1].join(', ') + ""; + let t1; + let t2; + let div1; + let p1; + let t3; + let t4_value = /*enemySequence*/ ctx[2].join(', ') + ""; + let t4; + + const block = { + c: function create() { + div2 = element("div"); + div0 = element("div"); + p0 = element("p"); + t0 = text("Player Sequence: "); + t1 = text(t1_value); + t2 = space(); + div1 = element("div"); + p1 = element("p"); + t3 = text("Enemy Sequence: "); + t4 = text(t4_value); + add_location(p0, file$i, 101, 12, 4730); + set_style(div0, "flex", "1"); + add_location(div0, file$i, 100, 8, 4694); + add_location(p1, file$i, 104, 12, 4843); + set_style(div1, "flex", "1"); + add_location(div1, file$i, 103, 8, 4807); + set_style(div2, "display", "flex"); + add_location(div2, file$i, 99, 8, 4656); + }, + m: function mount(target, anchor) { + insert_dev(target, div2, anchor); + append_dev(div2, div0); + append_dev(div0, p0); + append_dev(p0, t0); + append_dev(p0, t1); + append_dev(div2, t2); + append_dev(div2, div1); + append_dev(div1, p1); + append_dev(p1, t3); + append_dev(p1, t4); + }, + p: function update(ctx, dirty) { + if (dirty & /*playerSequence*/ 2 && t1_value !== (t1_value = /*playerSequence*/ ctx[1].join(', ') + "")) set_data_dev(t1, t1_value); + if (dirty & /*enemySequence*/ 4 && t4_value !== (t4_value = /*enemySequence*/ ctx[2].join(', ') + "")) set_data_dev(t4, t4_value); + }, + d: function destroy(detaching) { + if (detaching) detach_dev(div2); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_if_block_1$4.name, + type: "if", + source: "(99:4) {#if isTwoColumnLayout}", + ctx + }); + + return block; + } + + // (116:4) {#if sequence.length > 0} + function create_if_block$9(ctx) { + let div; + let button0; + let t1; + let button1; + let t3; + let button2; + let t5; + let button3; + let mounted; + let dispose; + + const block = { + c: function create() { + div = element("div"); + button0 = element("button"); + button0.textContent = "Copy 5 Items"; + t1 = space(); + button1 = element("button"); + button1.textContent = "Copy 10 Items"; + t3 = space(); + button2 = element("button"); + button2.textContent = "Copy 30 Items"; + t5 = space(); + button3 = element("button"); + button3.textContent = "Copy All Events"; + add_location(button0, file$i, 117, 8, 5147); + add_location(button1, file$i, 118, 8, 5222); + add_location(button2, file$i, 119, 8, 5299); + add_location(button3, file$i, 120, 8, 5376); + add_location(div, file$i, 116, 6, 5132); + }, + m: function mount(target, anchor) { + insert_dev(target, div, anchor); + append_dev(div, button0); + append_dev(div, t1); + append_dev(div, button1); + append_dev(div, t3); + append_dev(div, button2); + append_dev(div, t5); + append_dev(div, button3); + + if (!mounted) { + dispose = [ + listen_dev(button0, "click", /*click_handler*/ ctx[8], false, false, false, false), + listen_dev(button1, "click", /*click_handler_1*/ ctx[9], false, false, false, false), + listen_dev(button2, "click", /*click_handler_2*/ ctx[10], false, false, false, false), + listen_dev(button3, "click", /*click_handler_3*/ ctx[11], false, false, false, false) + ]; + + mounted = true; + } + }, + p: noop, + d: function destroy(detaching) { + if (detaching) detach_dev(div); + mounted = false; + run_all(dispose); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_if_block$9.name, + type: "if", + source: "(116:4) {#if sequence.length > 0}", + ctx + }); + + return block; + } + + function create_fragment$i(ctx) { + let main; + let button0; + let t1; + let button1; + let t2; + let button1_disabled_value; + let t3; + let button2; + let t5; + let t6; + let mounted; + let dispose; + + function select_block_type(ctx, dirty) { + if (/*isTwoColumnLayout*/ ctx[3]) return create_if_block_1$4; + if (/*sequence*/ ctx[0].length > 0) return create_if_block_2$1; + } + + let current_block_type = select_block_type(ctx); + let if_block0 = current_block_type && current_block_type(ctx); + let if_block1 = /*sequence*/ ctx[0].length > 0 && create_if_block$9(ctx); + + const block = { + c: function create() { + main = element("main"); + button0 = element("button"); + button0.textContent = "Generate New Sequence"; + t1 = space(); + button1 = element("button"); + t2 = text("Generate Follow-Up Sequence"); + t3 = space(); + button2 = element("button"); + button2.textContent = "Generate Main Enemy (solo protagonist) based Sequence"; + t5 = text("\r\n | TODO Group Protag button\r\n \r\n "); + if (if_block0) if_block0.c(); + t6 = space(); + if (if_block1) if_block1.c(); + add_location(button0, file$i, 93, 4, 4282); + button1.disabled = button1_disabled_value = /*sequence*/ ctx[0].length === 0; + add_location(button1, file$i, 94, 4, 4354); + add_location(button2, file$i, 95, 4, 4473); + add_location(main, file$i, 92, 0, 4270); + }, + 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, main, anchor); + append_dev(main, button0); + append_dev(main, t1); + append_dev(main, button1); + append_dev(button1, t2); + append_dev(main, t3); + append_dev(main, button2); + append_dev(main, t5); + if (if_block0) if_block0.m(main, null); + append_dev(main, t6); + if (if_block1) if_block1.m(main, null); + + if (!mounted) { + dispose = [ + listen_dev(button0, "click", /*generateSequence*/ ctx[4], false, false, false, false), + listen_dev(button1, "click", /*generateFollowUpSequence*/ ctx[5], false, false, false, false), + listen_dev(button2, "click", /*generateMainEnemySequence*/ ctx[6], false, false, false, false) + ]; + + mounted = true; + } + }, + p: function update(ctx, [dirty]) { + if (dirty & /*sequence*/ 1 && button1_disabled_value !== (button1_disabled_value = /*sequence*/ ctx[0].length === 0)) { + prop_dev(button1, "disabled", button1_disabled_value); + } + + if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block0) { + if_block0.p(ctx, dirty); + } else { + if (if_block0) if_block0.d(1); + if_block0 = current_block_type && current_block_type(ctx); + + if (if_block0) { + if_block0.c(); + if_block0.m(main, t6); + } + } + + if (/*sequence*/ ctx[0].length > 0) { + if (if_block1) { + if_block1.p(ctx, dirty); + } else { + if_block1 = create_if_block$9(ctx); + if_block1.c(); + if_block1.m(main, null); + } + } else if (if_block1) { + if_block1.d(1); + if_block1 = null; + } + }, + i: noop, + o: noop, + d: function destroy(detaching) { + if (detaching) detach_dev(main); + + if (if_block0) { + if_block0.d(); + } + + if (if_block1) if_block1.d(); + mounted = false; + run_all(dispose); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_fragment$i.name, + type: "component", + source: "", + ctx + }); + + return block; + } + + function instance$i($$self, $$props, $$invalidate) { + let { $$slots: slots = {}, $$scope } = $$props; + validate_slots('BrainstormStateTransitionsRandom', slots, []); + + let predefinedList = [ + 'exploreLocation', + 'discoverClue', + 'meetCharacter', + 'solveRiddle', + 'findItem', + 'faceChallenge', + 'makeDecision', + 'engageBattle', + 'unlockAbility', + 'learnSecret', + 'completeMission', + 'experienceSetback', + 'earnReward', + 'uncoverMystery', + 'formAlliance', + 'faceBetrayal', + 'confrontNemesis', + 'makeDiscovery', + 'overcomeLoss', + 'achieveVictory' + ]; + + let followUpEvents = { + 'meetCharacter': [ + 'interactWithCharacterAgain', + 'receiveHelpFrommetCharacter', + 'charactermetBetraysProtagonist' + ], + 'discoverClue': [ + 'followUpOnpreviousClue', + 'previousclueLeadsToDeadEnd', + 'previousclueUnlocksNewPath' + ], + 'faceChallenge': [ + 'overcomepreviousChallengeWithNewApproach', + 'failpreviousChallengeWithConsequences', + 'discoverHiddenOpportunityInpreviousChallenge' + ], + 'engageBattle': [ + 'emergeFrompreviousBattleVictorious', + 'sufferDefeatInpreviousBattle', + 'forgeUnlikelyAlliancefrompreviousBattle', + 'negativesideeffectofpreviousbattle' + ] + }; + + let sequence = []; + let playerSequence = []; + let enemySequence = []; + let isTwoColumnLayout = false; + + function generateSequence() { + $$invalidate(0, sequence = []); + + for (let i = 0; i < 30; i++) { + const randomIndex = Math.floor(Math.random() * predefinedList.length); + sequence.push(predefinedList[randomIndex]); + } + + $$invalidate(1, playerSequence = [...sequence]); + $$invalidate(3, isTwoColumnLayout = false); + } + + function generateFollowUpSequence() { + const extendedSequence = [...sequence]; + + for (let i = 0; i < sequence.length; i++) { + const currentEvent = sequence[i]; + + if (followUpEvents[currentEvent]) { + const followUpIndex = Math.floor(Math.random() * followUpEvents[currentEvent].length); + const followUpEvent = followUpEvents[currentEvent][followUpIndex]; + extendedSequence.push(followUpEvent); + } + } + + $$invalidate(0, sequence = extendedSequence); + $$invalidate(1, playerSequence = [...sequence]); + $$invalidate(3, isTwoColumnLayout = false); + } + + function generateMainEnemySequence() { + const subordinateSequences = []; + const subordinateCount = Math.floor(Math.random() * 5) + 1; + + // Generate main enemy events + for (let i = 0; i < 10; i++) { + const randomIndex = Math.floor(Math.random() * predefinedList.length); + enemySequence.push(`mainEnemy${predefinedList[randomIndex]}`); + } + + // Generate subordinate events + for (let i = 0; i < subordinateCount; i++) { + const subordinateSequence = []; + + for (let j = 0; j < 5; j++) { + const randomIndex = Math.floor(Math.random() * predefinedList.length); + subordinateSequence.push(`enemysubordinate${i + 1}${predefinedList[randomIndex]}`); + } + + subordinateSequences.push(subordinateSequence); + } + + // Randomize the order of player, main enemy, and subordinate events + const combinedSequence = [...playerSequence, ...enemySequence, ...subordinateSequences.flat()]; + + for (let i = combinedSequence.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [combinedSequence[i], combinedSequence[j]] = [combinedSequence[j], combinedSequence[i]]; + } + + $$invalidate(2, enemySequence = combinedSequence); + $$invalidate(3, isTwoColumnLayout = true); + } + + function copyToClipboard(count) { + const selectedItems = sequence.slice(0, count); + const textToCopy = 'Write a story in this order - ' + selectedItems.join(', '); + navigator.clipboard.writeText(textToCopy); + alert(`Copied ${count} items to clipboard!`); + } + + 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}'`); + }); + + const click_handler = () => copyToClipboard(5); + const click_handler_1 = () => copyToClipboard(10); + const click_handler_2 = () => copyToClipboard(30); + const click_handler_3 = () => copyToClipboard(sequence.length); + + $$self.$capture_state = () => ({ + predefinedList, + followUpEvents, + sequence, + playerSequence, + enemySequence, + isTwoColumnLayout, + generateSequence, + generateFollowUpSequence, + generateMainEnemySequence, + copyToClipboard + }); + + $$self.$inject_state = $$props => { + if ('predefinedList' in $$props) predefinedList = $$props.predefinedList; + if ('followUpEvents' in $$props) followUpEvents = $$props.followUpEvents; + if ('sequence' in $$props) $$invalidate(0, sequence = $$props.sequence); + if ('playerSequence' in $$props) $$invalidate(1, playerSequence = $$props.playerSequence); + if ('enemySequence' in $$props) $$invalidate(2, enemySequence = $$props.enemySequence); + if ('isTwoColumnLayout' in $$props) $$invalidate(3, isTwoColumnLayout = $$props.isTwoColumnLayout); + }; + + if ($$props && "$$inject" in $$props) { + $$self.$inject_state($$props.$$inject); + } + + return [ + sequence, + playerSequence, + enemySequence, + isTwoColumnLayout, + generateSequence, + generateFollowUpSequence, + generateMainEnemySequence, + copyToClipboard, + click_handler, + click_handler_1, + click_handler_2, + click_handler_3 + ]; + } + + class BrainstormStateTransitionsRandom extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance$i, create_fragment$i, safe_not_equal, {}); + + dispatch_dev("SvelteRegisterComponent", { + component: this, + tagName: "BrainstormStateTransitionsRandom", + options, + id: create_fragment$i.name + }); + } + } + + /* src\testbrainstorminstantpopulate.svelte generated by Svelte v3.59.2 */ + + const { console: console_1$8 } = globals; + const file$h = "src\\testbrainstorminstantpopulate.svelte"; + + function get_each_context$b(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[6] = list[i]; + return child_ctx; + } + + function get_each_context_1$5(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[6] = list[i]; + return child_ctx; + } + + // (70:12) {#each filteredKeys as key} + function create_each_block_1$5(ctx) { + let li; + let t_value = /*key*/ ctx[6] + ""; + let t; + + const block = { + c: function create() { + li = element("li"); + t = text(t_value); + add_location(li, file$h, 70, 14, 2213); + }, + m: function mount(target, anchor) { + insert_dev(target, li, anchor); + append_dev(li, t); + }, + p: function update(ctx, dirty) { + if (dirty & /*filteredKeys*/ 2 && t_value !== (t_value = /*key*/ ctx[6] + "")) set_data_dev(t, t_value); + }, + d: function destroy(detaching) { + if (detaching) detach_dev(li); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block_1$5.name, + type: "each", + source: "(70:12) {#each filteredKeys as key}", + ctx + }); + + return block; + } + + // (79:12) {#each remainingKeys as key} + function create_each_block$b(ctx) { + let li; + let t_value = /*key*/ ctx[6] + ""; + let t; + + const block = { + c: function create() { + li = element("li"); + t = text(t_value); + add_location(li, file$h, 79, 14, 2410); + }, + m: function mount(target, anchor) { + insert_dev(target, li, anchor); + append_dev(li, t); + }, + p: function update(ctx, dirty) { + if (dirty & /*remainingKeys*/ 4 && t_value !== (t_value = /*key*/ ctx[6] + "")) set_data_dev(t, t_value); + }, + d: function destroy(detaching) { + if (detaching) detach_dev(li); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block$b.name, + type: "each", + source: "(79:12) {#each remainingKeys as key}", + ctx + }); + + return block; + } + + function create_fragment$h(ctx) { + let main; + let h1; + let t1; + let div4; + let div0; + let label; + let t3; + let textarea; + let t4; + let button; + let t6; + let div3; + let div1; + let h20; + let t8; + let ul0; + let t9; + let div2; + let h21; + let t11; + let ul1; + let mounted; + let dispose; + let each_value_1 = /*filteredKeys*/ ctx[1]; + validate_each_argument(each_value_1); + let each_blocks_1 = []; + + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks_1[i] = create_each_block_1$5(get_each_context_1$5(ctx, each_value_1, i)); + } + + let each_value = /*remainingKeys*/ ctx[2]; + validate_each_argument(each_value); + let each_blocks = []; + + for (let i = 0; i < each_value.length; i += 1) { + each_blocks[i] = create_each_block$b(get_each_context$b(ctx, each_value, i)); + } + + const block = { + c: function create() { + main = element("main"); + h1 = element("h1"); + h1.textContent = "JSON Key Extractor"; + t1 = space(); + div4 = element("div"); + div0 = element("div"); + label = element("label"); + label.textContent = "Enter JSON:"; + t3 = space(); + textarea = element("textarea"); + t4 = space(); + button = element("button"); + button.textContent = "Extract Keys"; + t6 = space(); + div3 = element("div"); + div1 = element("div"); + h20 = element("h2"); + h20.textContent = "Filtered Keys:"; + t8 = space(); + ul0 = element("ul"); + + for (let i = 0; i < each_blocks_1.length; i += 1) { + each_blocks_1[i].c(); + } + + t9 = space(); + div2 = element("div"); + h21 = element("h2"); + h21.textContent = "Remaining Keys:"; + t11 = space(); + ul1 = element("ul"); + + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + + add_location(h1, file$h, 56, 4, 1730); + attr_dev(label, "for", "jsonInput"); + add_location(label, file$h, 60, 8, 1834); + attr_dev(textarea, "id", "jsonInput"); + attr_dev(textarea, "class", "svelte-1t47hvo"); + add_location(textarea, file$h, 61, 8, 1886); + add_location(button, file$h, 62, 8, 1985); + attr_dev(div0, "class", "input-column svelte-1t47hvo"); + add_location(div0, file$h, 59, 6, 1798); + add_location(h20, file$h, 67, 10, 2117); + add_location(ul0, file$h, 68, 10, 2152); + add_location(div1, file$h, 66, 8, 2100); + add_location(h21, file$h, 76, 10, 2312); + add_location(ul1, file$h, 77, 10, 2348); + add_location(div2, file$h, 75, 8, 2295); + attr_dev(div3, "class", "output-column svelte-1t47hvo"); + add_location(div3, file$h, 65, 6, 2063); + attr_dev(div4, "class", "container svelte-1t47hvo"); + add_location(div4, file$h, 58, 4, 1767); + add_location(main, file$h, 55, 2, 1718); + }, + 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, main, anchor); + append_dev(main, h1); + append_dev(main, t1); + append_dev(main, div4); + append_dev(div4, div0); + append_dev(div0, label); + append_dev(div0, t3); + append_dev(div0, textarea); + set_input_value(textarea, /*jsonInput*/ ctx[0]); + append_dev(div0, t4); + append_dev(div0, button); + append_dev(div4, t6); + append_dev(div4, div3); + append_dev(div3, div1); + append_dev(div1, h20); + append_dev(div1, t8); + append_dev(div1, ul0); + + for (let i = 0; i < each_blocks_1.length; i += 1) { + if (each_blocks_1[i]) { + each_blocks_1[i].m(ul0, null); + } + } + + append_dev(div3, t9); + append_dev(div3, div2); + append_dev(div2, h21); + append_dev(div2, t11); + append_dev(div2, ul1); + + for (let i = 0; i < each_blocks.length; i += 1) { + if (each_blocks[i]) { + each_blocks[i].m(ul1, null); + } + } + + if (!mounted) { + dispose = [ + listen_dev(textarea, "input", /*textarea_input_handler*/ ctx[4]), + listen_dev(textarea, "input", autoExpandTextarea$1, false, false, false, false), + listen_dev(button, "click", /*extractKeys*/ ctx[3], false, false, false, false) + ]; + + mounted = true; + } + }, + p: function update(ctx, [dirty]) { + if (dirty & /*jsonInput*/ 1) { + set_input_value(textarea, /*jsonInput*/ ctx[0]); + } + + if (dirty & /*filteredKeys*/ 2) { + each_value_1 = /*filteredKeys*/ ctx[1]; + validate_each_argument(each_value_1); + let i; + + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_1$5(ctx, each_value_1, i); + + if (each_blocks_1[i]) { + each_blocks_1[i].p(child_ctx, dirty); + } else { + each_blocks_1[i] = create_each_block_1$5(child_ctx); + each_blocks_1[i].c(); + each_blocks_1[i].m(ul0, null); + } + } + + for (; i < each_blocks_1.length; i += 1) { + each_blocks_1[i].d(1); + } + + each_blocks_1.length = each_value_1.length; + } + + if (dirty & /*remainingKeys*/ 4) { + each_value = /*remainingKeys*/ ctx[2]; + validate_each_argument(each_value); + let i; + + for (i = 0; i < each_value.length; i += 1) { + const child_ctx = get_each_context$b(ctx, each_value, i); + + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + } else { + each_blocks[i] = create_each_block$b(child_ctx); + each_blocks[i].c(); + each_blocks[i].m(ul1, null); + } + } + + for (; i < each_blocks.length; i += 1) { + each_blocks[i].d(1); + } + + each_blocks.length = each_value.length; + } + }, + i: noop, + o: noop, + d: function destroy(detaching) { + if (detaching) detach_dev(main); + destroy_each(each_blocks_1, detaching); + destroy_each(each_blocks, detaching); + mounted = false; + run_all(dispose); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_fragment$h.name, + type: "component", + source: "", + ctx + }); + + return block; + } + + function getKeysFromJSON(json, filter) { + const filteredKeys = []; + const remainingKeys = []; + + function traverseObject(obj, parentKey = '') { + for (const key in obj) { + if (obj.hasOwnProperty(key)) { + const fullKey = parentKey ? `${parentKey}.${key}` : key; + + if (typeof filter === 'function' && filter(fullKey)) { + filteredKeys.push(fullKey); + } else { + remainingKeys.push(fullKey); + } + + if (typeof obj[key] === 'object' && obj[key] !== null) { + traverseObject(obj[key], fullKey); + } + } + } + } + + traverseObject(json); + return { filteredKeys, remainingKeys }; + } + + function autoExpandTextarea$1(event) { + const textarea = event.target; + textarea.style.height = 'auto'; + textarea.style.height = `${textarea.scrollHeight}px`; + } + + function instance$h($$self, $$props, $$invalidate) { + let { $$slots: slots = {}, $$scope } = $$props; + validate_slots('Testbrainstorminstantpopulate', slots, []); + let jsonInput = ''; + let json = {}; + let filteredKeys = []; + let remainingKeys = []; + + function extractKeys() { + try { + json = JSON.parse(jsonInput); + + const { filteredKeys: filtered, remainingKeys: remaining } = getKeysFromJSON(json, key => { + return key.includes('name') || key.includes('collisiontext'); //|| modal fields; + }); //return key.endsWith('.x') || key.endsWith('.y') || key.includes('Type') || key.includes('complete'); + + $$invalidate(1, filteredKeys = filtered); + $$invalidate(2, remainingKeys = remaining); + } catch(error) { + console.error('Invalid JSON:', error); + $$invalidate(1, filteredKeys = []); + $$invalidate(2, remainingKeys = []); + } + } + + const writable_props = []; + + Object.keys($$props).forEach(key => { + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$8.warn(` was created with unknown prop '${key}'`); + }); + + function textarea_input_handler() { + jsonInput = this.value; + $$invalidate(0, jsonInput); + } + + $$self.$capture_state = () => ({ + jsonInput, + json, + filteredKeys, + remainingKeys, + getKeysFromJSON, + extractKeys, + autoExpandTextarea: autoExpandTextarea$1 + }); + + $$self.$inject_state = $$props => { + if ('jsonInput' in $$props) $$invalidate(0, jsonInput = $$props.jsonInput); + if ('json' in $$props) json = $$props.json; + if ('filteredKeys' in $$props) $$invalidate(1, filteredKeys = $$props.filteredKeys); + if ('remainingKeys' in $$props) $$invalidate(2, remainingKeys = $$props.remainingKeys); + }; + + if ($$props && "$$inject" in $$props) { + $$self.$inject_state($$props.$$inject); + } + + return [jsonInput, filteredKeys, remainingKeys, extractKeys, textarea_input_handler]; + } + + class Testbrainstorminstantpopulate extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance$h, create_fragment$h, safe_not_equal, {}); + + dispatch_dev("SvelteRegisterComponent", { + component: this, + tagName: "Testbrainstorminstantpopulate", + options, + id: create_fragment$h.name + }); + } + } + + /* src\testjsonmatchingfieldmerge.svelte generated by Svelte v3.59.2 */ + + const { Object: Object_1$3, console: console_1$7 } = globals; + const file$g = "src\\testjsonmatchingfieldmerge.svelte"; + + // (195:4) {#if Object.keys(mergedJson).length > 0} + function create_if_block$8(ctx) { + let div; + let h3; + let t1; + let pre; + let t2_value = JSON.stringify(/*mergedJson*/ ctx[2], null, 2) + ""; + let t2; + + const block = { + c: function create() { + div = element("div"); + h3 = element("h3"); + h3.textContent = "Merged JSON:"; + t1 = space(); + pre = element("pre"); + t2 = text(t2_value); + add_location(h3, file$g, 196, 8, 4625); + add_location(pre, file$g, 197, 8, 4656); + add_location(div, file$g, 195, 6, 4610); + }, + m: function mount(target, anchor) { + insert_dev(target, div, anchor); + append_dev(div, h3); + append_dev(div, t1); + append_dev(div, pre); + append_dev(pre, t2); + }, + p: function update(ctx, dirty) { + if (dirty & /*mergedJson*/ 4 && t2_value !== (t2_value = JSON.stringify(/*mergedJson*/ ctx[2], null, 2) + "")) set_data_dev(t2, t2_value); + }, + d: function destroy(detaching) { + if (detaching) detach_dev(div); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_if_block$8.name, + type: "if", + source: "(195:4) {#if Object.keys(mergedJson).length > 0}", + ctx + }); + + return block; + } + + function create_fragment$g(ctx) { + let main; + let h2; + let t1; + let div0; + let h30; + let t3; + let textarea0; + let t4; + let div1; + let h31; + let t6; + let textarea1; + let t7; + let button; + let t9; + let show_if = Object.keys(/*mergedJson*/ ctx[2]).length > 0; + let mounted; + let dispose; + let if_block = show_if && create_if_block$8(ctx); + + const block = { + c: function create() { + main = element("main"); + h2 = element("h2"); + h2.textContent = "JSON Merger"; + t1 = space(); + div0 = element("div"); + h30 = element("h3"); + h30.textContent = "Original JSON:"; + t3 = space(); + textarea0 = element("textarea"); + t4 = space(); + div1 = element("div"); + h31 = element("h3"); + h31.textContent = "Snippet JSON:"; + t6 = space(); + textarea1 = element("textarea"); + t7 = space(); + button = element("button"); + button.textContent = "Merge JSON"; + t9 = space(); + if (if_block) if_block.c(); + add_location(h2, file$g, 180, 4, 4178); + add_location(h30, file$g, 183, 6, 4221); + attr_dev(textarea0, "class", "svelte-1jgnkl9"); + add_location(textarea0, file$g, 184, 6, 4252); + add_location(div0, file$g, 182, 4, 4208); + add_location(h31, file$g, 188, 6, 4369); + attr_dev(textarea1, "class", "svelte-1jgnkl9"); + add_location(textarea1, file$g, 189, 6, 4399); + add_location(div1, file$g, 187, 4, 4356); + add_location(button, file$g, 192, 4, 4502); + add_location(main, file$g, 179, 2, 4166); + }, + 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, main, anchor); + append_dev(main, h2); + append_dev(main, t1); + append_dev(main, div0); + append_dev(div0, h30); + append_dev(div0, t3); + append_dev(div0, textarea0); + set_input_value(textarea0, /*originalJsonInput*/ ctx[0]); + append_dev(main, t4); + append_dev(main, div1); + append_dev(div1, h31); + append_dev(div1, t6); + append_dev(div1, textarea1); + set_input_value(textarea1, /*snippetJsonInput*/ ctx[1]); + append_dev(main, t7); + append_dev(main, button); + append_dev(main, t9); + if (if_block) if_block.m(main, null); + + if (!mounted) { + dispose = [ + listen_dev(textarea0, "input", /*textarea0_input_handler*/ ctx[4]), + listen_dev(textarea0, "input", autoExpandTextarea, false, false, false, false), + listen_dev(textarea1, "input", /*textarea1_input_handler*/ ctx[5]), + listen_dev(textarea1, "input", autoExpandTextarea, false, false, false, false), + listen_dev(button, "click", /*handleMerge*/ ctx[3], false, false, false, false) + ]; + + mounted = true; + } + }, + p: function update(ctx, [dirty]) { + if (dirty & /*originalJsonInput*/ 1) { + set_input_value(textarea0, /*originalJsonInput*/ ctx[0]); + } + + if (dirty & /*snippetJsonInput*/ 2) { + set_input_value(textarea1, /*snippetJsonInput*/ ctx[1]); + } + + if (dirty & /*mergedJson*/ 4) show_if = Object.keys(/*mergedJson*/ ctx[2]).length > 0; + + if (show_if) { + if (if_block) { + if_block.p(ctx, dirty); + } else { + if_block = create_if_block$8(ctx); + if_block.c(); + if_block.m(main, null); + } + } else if (if_block) { + if_block.d(1); + if_block = null; + } + }, + i: noop, + o: noop, + d: function destroy(detaching) { + if (detaching) detach_dev(main); + if (if_block) if_block.d(); + mounted = false; + run_all(dispose); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_fragment$g.name, + type: "component", + source: "", + ctx + }); + + return block; + } + + function mergeJSON(original, snippet) { + const merged = JSON.parse(JSON.stringify(original)); + + // Update objectives + if (Array.isArray(snippet.story.objectives)) { + merged.story[0].objectives.forEach((obj, index) => { + if (snippet.story.objectives[index]) { + obj.name = snippet.story.objectives[index].name; + } + }); + } + + // Update targets + if (Array.isArray(snippet.story.targets)) { + merged.story[0].targets.forEach((target, index) => { + if (snippet.story.targets[index]) { + target.name = snippet.story.targets[index].name; + target.collisiontext = snippet.story.targets[index].collisiontext; + + // Update subTargets recursively + function updateSubTargets(originalSubTargets, snippetSubTargets) { + originalSubTargets.forEach((subTarget, subIndex) => { + if (snippetSubTargets[subIndex]) { + subTarget.name = snippetSubTargets[subIndex].name; + subTarget.collisiontext = snippetSubTargets[subIndex].collisiontext; + + if (Array.isArray(snippetSubTargets[subIndex].subTargets)) { + updateSubTargets(subTarget.subTargets, snippetSubTargets[subIndex].subTargets); + } + } + }); + } + + if (Array.isArray(target.subTargets) && Array.isArray(snippet.story.targets[index].subTargets)) { + updateSubTargets(target.subTargets, snippet.story.targets[index].subTargets); + } + } + }); + } + + return merged; + } + + function autoExpandTextarea(event) { + const textarea = event.target; + textarea.style.height = 'auto'; + textarea.style.height = `${textarea.scrollHeight}px`; + } + + function instance$g($$self, $$props, $$invalidate) { + let { $$slots: slots = {}, $$scope } = $$props; + validate_slots('Testjsonmatchingfieldmerge', slots, []); + + let originalJsonInput = `{ +"story": [ +{ +"part": 0, +"objectives": [ +{ +"id": "Objective1_1", +"name": "Objective 1.1", +"complete": false +}, +{ +"id": "Objective1_2", +"name": "Objective 1.2", +"complete": false +} +], +"targets": [ +{ +"name": "Target0_1", +"x": 55, +"y": 4, +"collisionType": "alert", +"collisiontext": "Placeholder text for Target 0.1", +"subTargets": [ +{ +"name": "Target1_1", +"x": 63, +"y": 4, +"collisionType": "alert", +"collisiontext": "Placeholder text for Target 1.1", +"subTargets": [ +{ +"name": "Target2_1", +"x": 88, +"y": 87, +"collisionType": "alert", +"collisiontext": "Placeholder text for Target 2.1" +} +] +}, +{ +"name": "Target1_2", +"x": 89, +"y": 5, +"collisionType": "alert", +"collisiontext": "Placeholder text for Target 1.2", +"subTargets": [ +{ +"name": "Target2_1", +"x": 69, +"y": 92, +"collisionType": "alert", +"collisiontext": "Placeholder text for Target 2.1" +} +] +} +] +}, +{ +"name": "Target0_2", +"x": 12, +"y": 59, +"collisionType": "alert", +"collisiontext": "Placeholder text for Target 0.2" +} +] +} +] +}`; + + let snippetJsonInput = `{ +"story": { +"objectives": [ +{"name": "Master the ancient magic"}, +{"name": "Unite the warring clans"} +], +"targets": [ +{ +"name": "The ancient temple", +"collisiontext": "Enter the temple", +"subTargets": [ +{ +"name": "The sacred artifact", +"collisiontext": "Take the artifact", +"subTargets": [ +{ +"name": "The ancient scroll", +"collisiontext": "Unroll the scroll" +} +] +}, +{ +"name": "The hidden chamber", +"collisiontext": "Discover the chamber", +"subTargets": [ +{ +"name": "The ancient relic", +"collisiontext": "Claim the relic" +} +] +} +] +}, +{ +"name": "The dark forest", +"collisiontext": "Venture into the forest" +} +] +} +}`; + + let originalJson = {}; + let snippetJson = {}; + let mergedJson = {}; + + function handleMerge() { + try { + originalJson = JSON.parse(originalJsonInput); + snippetJson = JSON.parse(snippetJsonInput); + $$invalidate(2, mergedJson = mergeJSON(originalJson, snippetJson)); + } catch(error) { + console.error('Invalid JSON:', error); + $$invalidate(2, mergedJson = {}); + } + } + + const writable_props = []; + + Object_1$3.keys($$props).forEach(key => { + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$7.warn(` was created with unknown prop '${key}'`); + }); + + function textarea0_input_handler() { + originalJsonInput = this.value; + $$invalidate(0, originalJsonInput); + } + + function textarea1_input_handler() { + snippetJsonInput = this.value; + $$invalidate(1, snippetJsonInput); + } + + $$self.$capture_state = () => ({ + originalJsonInput, + snippetJsonInput, + originalJson, + snippetJson, + mergedJson, + mergeJSON, + handleMerge, + autoExpandTextarea + }); + + $$self.$inject_state = $$props => { + if ('originalJsonInput' in $$props) $$invalidate(0, originalJsonInput = $$props.originalJsonInput); + if ('snippetJsonInput' in $$props) $$invalidate(1, snippetJsonInput = $$props.snippetJsonInput); + if ('originalJson' in $$props) originalJson = $$props.originalJson; + if ('snippetJson' in $$props) snippetJson = $$props.snippetJson; + if ('mergedJson' in $$props) $$invalidate(2, mergedJson = $$props.mergedJson); + }; + + if ($$props && "$$inject" in $$props) { + $$self.$inject_state($$props.$$inject); + } + + return [ + originalJsonInput, + snippetJsonInput, + mergedJson, + handleMerge, + textarea0_input_handler, + textarea1_input_handler + ]; + } + + class Testjsonmatchingfieldmerge extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance$g, create_fragment$g, safe_not_equal, {}); + + dispatch_dev("SvelteRegisterComponent", { + component: this, + tagName: "Testjsonmatchingfieldmerge", + options, + id: create_fragment$g.name + }); + } + } + + /* src\MovingDotSpaceThemeManager.svelte generated by Svelte v3.59.2 */ + const file$f = "src\\MovingDotSpaceThemeManager.svelte"; + + // (71:0) + function create_default_slot$1(ctx) { + let t0; + let hr; + let t1; + let form; + let input0; + let t2; + let input1; + let t3; + let input2; + let t4; + let button0; + let t6; + let button1; + let t8; + let input3; + let t9; + let label; + let t11; + let brainstormgameconfigsrandom; + let t12; + let testbrainstorminstantpopulate; + let t13; + let testjsonmatchingfieldmerge; + let current; + let mounted; + let dispose; + brainstormgameconfigsrandom = new BrainstormGameConfigsRandom({ $$inline: true }); + testbrainstorminstantpopulate = new Testbrainstorminstantpopulate({ $$inline: true }); + testjsonmatchingfieldmerge = new Testjsonmatchingfieldmerge({ $$inline: true }); + + const block = { + c: function create() { + t0 = text("Currently the state machine is the json config - Story parts / target type controlled by switch case for collisions and smmodal (state machine modal as the targets all have to a transitions field) (modals and smmodals not yet part of randomisers below)\r\n "); + hr = element("hr"); + t1 = text("\r\n Incomplete Custom game setting assistant\r\n \r\n "); + form = element("form"); + input0 = element("input"); + t2 = space(); + input1 = element("input"); + t3 = space(); + input2 = element("input"); + t4 = space(); + button0 = element("button"); + button0.textContent = "Add Item"; + t6 = space(); + button1 = element("button"); + button1.textContent = "Download Configuration"; + t8 = space(); + input3 = element("input"); + t9 = space(); + label = element("label"); + label.textContent = "Upload Configuration"; + t11 = space(); + create_component(brainstormgameconfigsrandom.$$.fragment); + t12 = space(); + create_component(testbrainstorminstantpopulate.$$.fragment); + t13 = space(); + create_component(testjsonmatchingfieldmerge.$$.fragment); + add_location(hr, file$f, 72, 4, 3248); + attr_dev(input0, "type", "text"); + attr_dev(input0, "placeholder", "Type (weapon, armor, consumable)"); + add_location(input0, file$f, 76, 8, 3400); + attr_dev(input1, "type", "text"); + attr_dev(input1, "placeholder", "Name"); + add_location(input1, file$f, 77, 8, 3504); + attr_dev(input2, "type", "text"); + attr_dev(input2, "placeholder", "Description"); + add_location(input2, file$f, 78, 8, 3580); + attr_dev(button0, "type", "submit"); + add_location(button0, file$f, 79, 8, 3670); + add_location(form, file$f, 75, 4, 3349); + add_location(button1, file$f, 85, 4, 3865); + attr_dev(input3, "type", "file"); + attr_dev(input3, "id", "fileInput"); + set_style(input3, "display", "none"); + add_location(input3, file$f, 86, 4, 3943); + attr_dev(label, "for", "fileInput"); + attr_dev(label, "class", "btn"); + add_location(label, file$f, 87, 4, 4036); + }, + m: function mount(target, anchor) { + insert_dev(target, t0, anchor); + insert_dev(target, hr, anchor); + insert_dev(target, t1, anchor); + insert_dev(target, form, anchor); + append_dev(form, input0); + set_input_value(input0, /*newItem*/ ctx[1].type); + append_dev(form, t2); + append_dev(form, input1); + set_input_value(input1, /*newItem*/ ctx[1].name); + append_dev(form, t3); + append_dev(form, input2); + set_input_value(input2, /*newItem*/ ctx[1].description); + append_dev(form, t4); + append_dev(form, button0); + insert_dev(target, t6, anchor); + insert_dev(target, button1, anchor); + insert_dev(target, t8, anchor); + insert_dev(target, input3, anchor); + insert_dev(target, t9, anchor); + insert_dev(target, label, anchor); + insert_dev(target, t11, anchor); + mount_component(brainstormgameconfigsrandom, target, anchor); + insert_dev(target, t12, anchor); + mount_component(testbrainstorminstantpopulate, target, anchor); + insert_dev(target, t13, anchor); + mount_component(testjsonmatchingfieldmerge, target, anchor); + current = true; + + if (!mounted) { + dispose = [ + listen_dev(input0, "input", /*input0_input_handler*/ ctx[5]), + listen_dev(input1, "input", /*input1_input_handler*/ ctx[6]), + listen_dev(input2, "input", /*input2_input_handler*/ ctx[7]), + listen_dev(form, "submit", prevent_default(/*addItem*/ ctx[2]), false, true, false, false), + listen_dev(button1, "click", /*downloadConfiguration*/ ctx[3], false, false, false, false), + listen_dev(input3, "change", /*handleFileUpload*/ ctx[4], false, false, false, false) + ]; + + mounted = true; + } + }, + p: function update(ctx, dirty) { + if (dirty & /*newItem*/ 2 && input0.value !== /*newItem*/ ctx[1].type) { + set_input_value(input0, /*newItem*/ ctx[1].type); + } + + if (dirty & /*newItem*/ 2 && input1.value !== /*newItem*/ ctx[1].name) { + set_input_value(input1, /*newItem*/ ctx[1].name); + } + + if (dirty & /*newItem*/ 2 && input2.value !== /*newItem*/ ctx[1].description) { + set_input_value(input2, /*newItem*/ ctx[1].description); + } + }, + i: function intro(local) { + if (current) return; + transition_in(brainstormgameconfigsrandom.$$.fragment, local); + transition_in(testbrainstorminstantpopulate.$$.fragment, local); + transition_in(testjsonmatchingfieldmerge.$$.fragment, local); + current = true; + }, + o: function outro(local) { + transition_out(brainstormgameconfigsrandom.$$.fragment, local); + transition_out(testbrainstorminstantpopulate.$$.fragment, local); + transition_out(testjsonmatchingfieldmerge.$$.fragment, local); + current = false; + }, + d: function destroy(detaching) { + if (detaching) detach_dev(t0); + if (detaching) detach_dev(hr); + if (detaching) detach_dev(t1); + if (detaching) detach_dev(form); + if (detaching) detach_dev(t6); + if (detaching) detach_dev(button1); + if (detaching) detach_dev(t8); + if (detaching) detach_dev(input3); + if (detaching) detach_dev(t9); + if (detaching) detach_dev(label); + if (detaching) detach_dev(t11); + destroy_component(brainstormgameconfigsrandom, detaching); + if (detaching) detach_dev(t12); + destroy_component(testbrainstorminstantpopulate, detaching); + if (detaching) detach_dev(t13); + destroy_component(testjsonmatchingfieldmerge, detaching); + mounted = false; + run_all(dispose); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_default_slot$1.name, + type: "slot", + source: "(71:0) ", + ctx + }); + + return block; } function create_fragment$f(ctx) { + let simplecollapsible; + let t0; + let brainstormstatetransitionsrandom; + let t1; + let hr; + let t2; + let br0; + let t3; + let br1; + let t4; + let br2; + let t5; + let br3; + let t6; + let div3; + let div0; + let t7; + let br4; + let t8; + let br5; + let t9; + let t10; + let div1; + let t11; + let t12; + let br6; + let t13; + let br7; + let br8; + let t14; + let t15; + let div2; + let current; + + simplecollapsible = new SimpleCollapsible({ + props: { + title: "Config Customisation Assistant - WIP", + $$slots: { default: [create_default_slot$1] }, + $$scope: { ctx } + }, + $$inline: true + }); + + brainstormstatetransitionsrandom = new BrainstormStateTransitionsRandom({ $$inline: true }); + + const block = { + c: function create() { + create_component(simplecollapsible.$$.fragment); + t0 = space(); + create_component(brainstormstatetransitionsrandom.$$.fragment); + t1 = space(); + hr = element("hr"); + t2 = text("\r\nNext Is auto generate + extract in one output "); + br0 = element("br"); + t3 = text("-- Then autogenerate + extract + llm api call for the JSON snippet "); + br1 = element("br"); + t4 = text("-- Then autogenerate + extract + llm api call for the JSON snippet + Merge in one button press "); + br2 = element("br"); + t5 = text("-- Then autogenerate + extract + llm api call for the JSON snippet + Merge in one button press + load into game component for testing \r\n"); + br3 = element("br"); + t6 = text("-- Then autogenerate + extract + llm api call for the JSON snippet + Merge in one button press + load into game component for testing + Sequence generate built into autogenerate json as an option (sequence becomes the placeholder text)\r\n\r\n"); + div3 = element("div"); + div0 = element("div"); + t7 = text("Website = multilingual support in chrome "); + br4 = element("br"); + t8 = text("\r\n The mechanics here are location based so story should be location based "); + br5 = element("br"); + t9 = text("\r\n Simultaneous relationships between multiple items = complexity - eg. player location and objectives"); + t10 = space(); + div1 = element("div"); + t11 = text(/*ChangedContentPlaceholder*/ ctx[0]); + t12 = space(); + br6 = element("br"); + t13 = text("\r\n Most stories for games are about a character that lacks something to beat their problems and the 90% inbetween the begining and the end is acquiring\r\n "); + br7 = element("br"); + br8 = element("br"); + t14 = text("\r\n Example - Write a story where the main event are in this order: gosomewhere getsomething makeobservation getsomething talktosomeone makeobservation getsomething talktosomeone gosomewhere fight talktosomeone fight fight talktosomeone talktosomeone talktosomeone gosomewhere talktosomeone"); + t15 = space(); + div2 = element("div"); + div2.textContent = "lets write the story to fit this order - stats location stats inventory stats location location skills inventory stats inventory skills skills skills stats stats skills"; + add_location(hr, file$f, 96, 0, 4278); + add_location(br0, file$f, 97, 46, 4330); + add_location(br1, file$f, 97, 117, 4401); + add_location(br2, file$f, 97, 216, 4500); + add_location(br3, file$f, 98, 0, 4640); + add_location(br4, file$f, 102, 49, 4982); + add_location(br5, file$f, 103, 80, 5068); + add_location(div0, file$f, 101, 4, 4926); + add_location(br6, file$f, 108, 38, 5246); + add_location(br7, file$f, 110, 8, 5418); + add_location(br8, file$f, 110, 12, 5422); + add_location(div1, file$f, 107, 4, 5201); + add_location(div2, file$f, 114, 4, 5743); + attr_dev(div3, "class", "grid-themegridContainer svelte-a95t5t"); + add_location(div3, file$f, 100, 0, 4883); + }, + 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) { + mount_component(simplecollapsible, target, anchor); + insert_dev(target, t0, anchor); + mount_component(brainstormstatetransitionsrandom, target, anchor); + insert_dev(target, t1, anchor); + insert_dev(target, hr, anchor); + insert_dev(target, t2, anchor); + insert_dev(target, br0, anchor); + insert_dev(target, t3, anchor); + insert_dev(target, br1, anchor); + insert_dev(target, t4, anchor); + insert_dev(target, br2, anchor); + insert_dev(target, t5, anchor); + insert_dev(target, br3, anchor); + insert_dev(target, t6, anchor); + insert_dev(target, div3, anchor); + append_dev(div3, div0); + append_dev(div0, t7); + append_dev(div0, br4); + append_dev(div0, t8); + append_dev(div0, br5); + append_dev(div0, t9); + append_dev(div3, t10); + append_dev(div3, div1); + append_dev(div1, t11); + append_dev(div1, t12); + append_dev(div1, br6); + append_dev(div1, t13); + append_dev(div1, br7); + append_dev(div1, br8); + append_dev(div1, t14); + append_dev(div3, t15); + append_dev(div3, div2); + current = true; + }, + p: function update(ctx, [dirty]) { + const simplecollapsible_changes = {}; + + if (dirty & /*$$scope, newItem*/ 65538) { + simplecollapsible_changes.$$scope = { dirty, ctx }; + } + + simplecollapsible.$set(simplecollapsible_changes); + if (!current || dirty & /*ChangedContentPlaceholder*/ 1) set_data_dev(t11, /*ChangedContentPlaceholder*/ ctx[0]); + }, + i: function intro(local) { + if (current) return; + transition_in(simplecollapsible.$$.fragment, local); + transition_in(brainstormstatetransitionsrandom.$$.fragment, local); + current = true; + }, + o: function outro(local) { + transition_out(simplecollapsible.$$.fragment, local); + transition_out(brainstormstatetransitionsrandom.$$.fragment, local); + current = false; + }, + d: function destroy(detaching) { + destroy_component(simplecollapsible, detaching); + if (detaching) detach_dev(t0); + destroy_component(brainstormstatetransitionsrandom, detaching); + if (detaching) detach_dev(t1); + if (detaching) detach_dev(hr); + if (detaching) detach_dev(t2); + if (detaching) detach_dev(br0); + if (detaching) detach_dev(t3); + if (detaching) detach_dev(br1); + if (detaching) detach_dev(t4); + if (detaching) detach_dev(br2); + if (detaching) detach_dev(t5); + if (detaching) detach_dev(br3); + if (detaching) detach_dev(t6); + if (detaching) detach_dev(div3); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_fragment$f.name, + type: "component", + source: "", + ctx + }); + + return block; + } + + function instance$f($$self, $$props, $$invalidate) { + let $targets; + let $objectives; + let $skills; + let $inventory; + validate_store(targets, 'targets'); + component_subscribe($$self, targets, $$value => $$invalidate(10, $targets = $$value)); + validate_store(objectives, 'objectives'); + component_subscribe($$self, objectives, $$value => $$invalidate(11, $objectives = $$value)); + validate_store(skills, 'skills'); + component_subscribe($$self, skills, $$value => $$invalidate(12, $skills = $$value)); + validate_store(inventory, 'inventory'); + component_subscribe($$self, inventory, $$value => $$invalidate(13, $inventory = $$value)); + let { $$slots: slots = {}, $$scope } = $$props; + validate_slots('MovingDotSpaceThemeManager', slots, []); + let { ChangedContentPlaceholder = "" } = $$props; + let newItem = { type: "", name: "", description: "" }; + let newSkill = { branch: "", name: "", learned: false }; + let newObjective = { branch: "", name: "", complete: false }; + + // ... similarly for targets + function addItem() { + inventory.update(items => [...items, newItem]); + $$invalidate(1, newItem = { type: "", name: "", description: "" }); // Reset form + } + + function addSkill() { + skills.update(skills => [...skills, newSkill]); + newSkill = { branch: "", name: "", learned: false }; // Reset form + } + + function addObjective() { + objectives.update(objectives => [...objectives, newObjective]); + newObjective = { branch: "", name: "", complete: false }; // Reset form + } + + // ... similarly for targets + // Functions to save and load configurations to/from localStorage or a backend would also be defined here + // Function to download the current configuration as a JSON file + function downloadConfiguration() { + const gameConfig = { + inventory: $inventory, + skills: $skills, + objectives: $objectives, + targets: $targets + }; + + const blob = new Blob([JSON.stringify(gameConfig, null, 2)], { type: 'application/json' }); + const href = URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = href; + link.download = 'gameConfig.json'; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } + + // Function to load configuration from an uploaded JSON file + function handleFileUpload(event) { + const file = event.target.files[0]; + + if (file) { + const reader = new FileReader(); + + reader.onload = e => { + const fileContent = e.target.result; + const { inventory: loadedInventory, skills: loadedSkills, objectives: loadedObjectives, targets: loadedTargets } = JSON.parse(fileContent); + inventory.set(loadedInventory); + skills.set(loadedSkills); + objectives.set(loadedObjectives); + targets.set(loadedTargets); + alert('Configuration loaded!'); + }; + + reader.readAsText(file); + } + } + + const writable_props = ['ChangedContentPlaceholder']; + + Object.keys($$props).forEach(key => { + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(` was created with unknown prop '${key}'`); + }); + + function input0_input_handler() { + newItem.type = this.value; + $$invalidate(1, newItem); + } + + function input1_input_handler() { + newItem.name = this.value; + $$invalidate(1, newItem); + } + + function input2_input_handler() { + newItem.description = this.value; + $$invalidate(1, newItem); + } + + $$self.$$set = $$props => { + if ('ChangedContentPlaceholder' in $$props) $$invalidate(0, ChangedContentPlaceholder = $$props.ChangedContentPlaceholder); + }; + + $$self.$capture_state = () => ({ + ChangedContentPlaceholder, + inventory, + skills, + objectives, + targets, + SimpleCollapsible, + BrainstormGameConfigsRandom, + BrainstormStateTransitionsRandom, + Testbrainstorminstantpopulate, + Testjsonmatchingfieldmerge, + newItem, + newSkill, + newObjective, + addItem, + addSkill, + addObjective, + downloadConfiguration, + handleFileUpload, + $targets, + $objectives, + $skills, + $inventory + }); + + $$self.$inject_state = $$props => { + if ('ChangedContentPlaceholder' in $$props) $$invalidate(0, ChangedContentPlaceholder = $$props.ChangedContentPlaceholder); + if ('newItem' in $$props) $$invalidate(1, newItem = $$props.newItem); + if ('newSkill' in $$props) newSkill = $$props.newSkill; + if ('newObjective' in $$props) newObjective = $$props.newObjective; + }; + + if ($$props && "$$inject" in $$props) { + $$self.$inject_state($$props.$$inject); + } + + return [ + ChangedContentPlaceholder, + newItem, + addItem, + downloadConfiguration, + handleFileUpload, + input0_input_handler, + input1_input_handler, + input2_input_handler + ]; + } + + class MovingDotSpaceThemeManager extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance$f, create_fragment$f, safe_not_equal, { ChangedContentPlaceholder: 0 }); + + dispatch_dev("SvelteRegisterComponent", { + component: this, + tagName: "MovingDotSpaceThemeManager", + options, + id: create_fragment$f.name + }); + } + + get ChangedContentPlaceholder() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set ChangedContentPlaceholder(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + } + + /* src\MovingDotSpaceGameFight.svelte generated by Svelte v3.59.2 */ + + const file$e = "src\\MovingDotSpaceGameFight.svelte"; + + // (88:8) {#if $fightcurrentTurn === 'human'} + function create_if_block$7(ctx) { + let button0; + let t1; + let button1; + let t3; + let button2; + let mounted; + let dispose; + + const block_1 = { + c: function create() { + button0 = element("button"); + button0.textContent = "Attack"; + t1 = space(); + button1 = element("button"); + button1.textContent = "Special Attack"; + t3 = space(); + button2 = element("button"); + button2.textContent = "Block"; + add_location(button0, file$e, 88, 12, 3623); + add_location(button1, file$e, 89, 12, 3730); + add_location(button2, file$e, 90, 12, 3856); + }, + m: function mount(target, anchor) { + insert_dev(target, button0, anchor); + insert_dev(target, t1, anchor); + insert_dev(target, button1, anchor); + insert_dev(target, t3, anchor); + insert_dev(target, button2, anchor); + + if (!mounted) { + dispose = [ + listen_dev(button0, "click", /*click_handler*/ ctx[5], false, false, false, false), + listen_dev(button1, "click", /*click_handler_1*/ ctx[6], false, false, false, false), + listen_dev(button2, "click", /*click_handler_2*/ ctx[7], false, false, false, false) + ]; + + mounted = true; + } + }, + p: noop, + d: function destroy(detaching) { + if (detaching) detach_dev(button0); + if (detaching) detach_dev(t1); + if (detaching) detach_dev(button1); + if (detaching) detach_dev(t3); + if (detaching) detach_dev(button2); + mounted = false; + run_all(dispose); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block: block_1, + id: create_if_block$7.name, + type: "if", + source: "(88:8) {#if $fightcurrentTurn === 'human'}", + ctx + }); + + return block_1; + } + + function create_fragment$e(ctx) { let div4; let div0; let t0; @@ -3128,22 +7178,22 @@ var app = (function () { t28 = text(t28_value); t29 = text("s "); br9 = element("br"); - add_location(br0, file$f, 76, 17, 3171); - add_location(br1, file$f, 77, 48, 3225); - add_location(br2, file$f, 78, 50, 3281); - add_location(br3, file$f, 79, 62, 3349); - add_location(br4, file$f, 80, 70, 3425); - add_location(div0, file$f, 75, 4, 3147); - add_location(div1, file$f, 84, 8, 3464); - add_location(div2, file$f, 83, 4, 3449); - add_location(br5, file$f, 95, 17, 3978); - add_location(br6, file$f, 96, 51, 4035); - add_location(br7, file$f, 97, 53, 4094); - add_location(br8, file$f, 98, 65, 4165); - add_location(br9, file$f, 99, 73, 4244); - add_location(div3, file$f, 94, 4, 3954); + add_location(br0, file$e, 76, 17, 3171); + add_location(br1, file$e, 77, 48, 3225); + add_location(br2, file$e, 78, 50, 3281); + add_location(br3, file$e, 79, 62, 3349); + add_location(br4, file$e, 80, 70, 3425); + add_location(div0, file$e, 75, 4, 3147); + add_location(div1, file$e, 84, 8, 3464); + add_location(div2, file$e, 83, 4, 3449); + add_location(br5, file$e, 95, 17, 3978); + add_location(br6, file$e, 96, 51, 4035); + add_location(br7, file$e, 97, 53, 4094); + add_location(br8, file$e, 98, 65, 4165); + add_location(br9, file$e, 99, 73, 4244); + add_location(div3, file$e, 94, 4, 3954); attr_dev(div4, "class", "statscontainer svelte-izilsr"); - add_location(div4, file$f, 74, 0, 3113); + add_location(div4, file$e, 74, 0, 3113); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -3242,7 +7292,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block: block_1, - id: create_fragment$f.name, + id: create_fragment$e.name, type: "component", source: "", ctx @@ -3257,7 +7307,7 @@ var app = (function () { }); } - function instance$f($$self, $$props, $$invalidate) { + function instance$e($$self, $$props, $$invalidate) { let $fightcurrentTurn; let $fightplayerHuman; let $fightplayerComputer; @@ -3390,13 +7440,13 @@ var app = (function () { class MovingDotSpaceGameFight extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$f, create_fragment$f, safe_not_equal, {}); + init(this, options, instance$e, create_fragment$e, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotSpaceGameFight", options, - id: create_fragment$f.name + id: create_fragment$e.name }); } } @@ -53580,16 +57630,16 @@ var app = (function () { }); /* src\MovingDotSpaceModalBrainstorm.svelte generated by Svelte v3.59.2 */ - const file$e = "src\\MovingDotSpaceModalBrainstorm.svelte"; + const file$d = "src\\MovingDotSpaceModalBrainstorm.svelte"; - function create_fragment$e(ctx) { + function create_fragment$d(ctx) { let div; const block = { c: function create() { div = element("div"); attr_dev(div, "class", "svelte-1kuj9kb"); - add_location(div, file$e, 95, 0, 3254); + add_location(div, file$d, 95, 0, 3254); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -53609,7 +57659,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$e.name, + id: create_fragment$d.name, type: "component", source: "", ctx @@ -53618,7 +57668,7 @@ var app = (function () { return block; } - function instance$e($$self, $$props, $$invalidate) { + function instance$d($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotSpaceModalBrainstorm', slots, []); let container; @@ -53710,29 +57760,29 @@ var app = (function () { class MovingDotSpaceModalBrainstorm extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$e, create_fragment$e, safe_not_equal, {}); + init(this, options, instance$d, create_fragment$d, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotSpaceModalBrainstorm", options, - id: create_fragment$e.name + id: create_fragment$d.name }); } } /* src\MovingDotSpaceGameFind.svelte generated by Svelte v3.59.2 */ - const file$d = "src\\MovingDotSpaceGameFind.svelte"; + const file$c = "src\\MovingDotSpaceGameFind.svelte"; - function get_each_context$b(ctx, list, i) { + function get_each_context$a(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[9] = list[i]; child_ctx[11] = i; return child_ctx; } - function get_each_context_1$5(ctx, list, i) { + function get_each_context_1$4(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[12] = list[i]; child_ctx[14] = i; @@ -53747,7 +57797,7 @@ var app = (function () { c: function create() { p = element("p"); p.textContent = "Game over. Try again!"; - add_location(p, file$d, 63, 6, 1832); + add_location(p, file$c, 63, 6, 1832); }, m: function mount(target, anchor) { insert_dev(target, p, anchor); @@ -53770,14 +57820,14 @@ var app = (function () { } // (61:34) - function create_if_block_1$2(ctx) { + function create_if_block_1$3(ctx) { let p; const block = { c: function create() { p = element("p"); p.textContent = "You won! 🎉"; - add_location(p, file$d, 61, 6, 1793); + add_location(p, file$c, 61, 6, 1793); }, m: function mount(target, anchor) { insert_dev(target, p, anchor); @@ -53790,7 +57840,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_if_block_1$2.name, + id: create_if_block_1$3.name, type: "if", source: "(61:34) ", ctx @@ -53810,7 +57860,7 @@ var app = (function () { p = element("p"); t0 = text("Presses Remaining: "); t1 = text(/*pressesRemaining*/ ctx[0]); - add_location(p, file$d, 59, 6, 1705); + add_location(p, file$c, 59, 6, 1705); }, m: function mount(target, anchor) { insert_dev(target, p, anchor); @@ -53837,7 +57887,7 @@ var app = (function () { } // (71:6) {#each row as cell, colIndex} - function create_each_block_1$5(ctx) { + function create_each_block_1$4(ctx) { let button; let t0_value = (/*cell*/ ctx[12].pressed @@ -53864,7 +57914,7 @@ var app = (function () { button.disabled = button_disabled_value = /*gameState*/ ctx[2] !== 'playing'; attr_dev(button, "class", "svelte-p3ubim"); toggle_class(button, "pressed", /*cell*/ ctx[12].pressed); - add_location(button, file$d, 71, 8, 2045); + add_location(button, file$c, 71, 8, 2045); }, m: function mount(target, anchor) { insert_dev(target, button, anchor); @@ -53902,7 +57952,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block_1$5.name, + id: create_each_block_1$4.name, type: "each", source: "(71:6) {#each row as cell, colIndex}", ctx @@ -53912,14 +57962,14 @@ var app = (function () { } // (70:4) {#each grid as row, rowIndex} - function create_each_block$b(ctx) { + function create_each_block$a(ctx) { let each_1_anchor; let each_value_1 = /*row*/ ctx[9]; 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$5(get_each_context_1$5(ctx, each_value_1, i)); + each_blocks[i] = create_each_block_1$4(get_each_context_1$4(ctx, each_value_1, i)); } const block = { @@ -53946,12 +57996,12 @@ var app = (function () { let i; for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1$5(ctx, each_value_1, i); + const child_ctx = get_each_context_1$4(ctx, each_value_1, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block_1$5(child_ctx); + each_blocks[i] = create_each_block_1$4(child_ctx); each_blocks[i].c(); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } @@ -53972,7 +58022,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$b.name, + id: create_each_block$a.name, type: "each", source: "(70:4) {#each grid as row, rowIndex}", ctx @@ -53981,7 +58031,7 @@ var app = (function () { return block; } - function create_fragment$d(ctx) { + function create_fragment$c(ctx) { let div0; let t0; let button; @@ -53992,7 +58042,7 @@ var app = (function () { function select_block_type(ctx, dirty) { if (/*gameState*/ ctx[2] === 'playing') return create_if_block$6; - if (/*gameState*/ ctx[2] === 'won') return create_if_block_1$2; + if (/*gameState*/ ctx[2] === 'won') return create_if_block_1$3; return create_else_block$1; } @@ -54003,7 +58053,7 @@ var app = (function () { let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$b(get_each_context$b(ctx, each_value, i)); + each_blocks[i] = create_each_block$a(get_each_context$a(ctx, each_value, i)); } const block = { @@ -54021,10 +58071,10 @@ var app = (function () { } attr_dev(button, "class", "svelte-p3ubim"); - add_location(button, file$d, 65, 4, 1877); - add_location(div0, file$d, 57, 2, 1657); + add_location(button, file$c, 65, 4, 1877); + add_location(div0, file$c, 57, 2, 1657); attr_dev(div1, "class", "grid svelte-p3ubim"); - add_location(div1, file$d, 68, 2, 1945); + add_location(div1, file$c, 68, 2, 1945); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -54067,12 +58117,12 @@ var app = (function () { let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$b(ctx, each_value, i); + const child_ctx = get_each_context$a(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$b(child_ctx); + each_blocks[i] = create_each_block$a(child_ctx); each_blocks[i].c(); each_blocks[i].m(div1, null); } @@ -54100,7 +58150,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$d.name, + id: create_fragment$c.name, type: "component", source: "", ctx @@ -54109,7 +58159,7 @@ var app = (function () { return block; } - function instance$d($$self, $$props, $$invalidate) { + function instance$c($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotSpaceGameFind', slots, []); let gridSize = 10; @@ -54200,22 +58250,22 @@ var app = (function () { class MovingDotSpaceGameFind extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$d, create_fragment$d, safe_not_equal, {}); + init(this, options, instance$c, create_fragment$c, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotSpaceGameFind", options, - id: create_fragment$d.name + id: create_fragment$c.name }); } } /* src\MovingDotSpaceGameOrder.svelte generated by Svelte v3.59.2 */ - const file$c = "src\\MovingDotSpaceGameOrder.svelte"; + const file$b = "src\\MovingDotSpaceGameOrder.svelte"; - function get_each_context$a(ctx, list, i) { + function get_each_context$9(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[10] = list[i]; child_ctx[12] = i; @@ -54230,7 +58280,7 @@ var app = (function () { c: function create() { p = element("p"); p.textContent = "Incorrect order. Try again!"; - add_location(p, file$c, 72, 4, 2206); + add_location(p, file$b, 72, 4, 2206); }, m: function mount(target, anchor) { insert_dev(target, p, anchor); @@ -54252,14 +58302,14 @@ var app = (function () { } // (70:2) {#if gameStatus === "correct"} - function create_if_block_1$1(ctx) { + function create_if_block_1$2(ctx) { let p; const block = { c: function create() { p = element("p"); p.textContent = "You guessed the correct order! 🎉"; - add_location(p, file$c, 70, 4, 2119); + add_location(p, file$b, 70, 4, 2119); }, m: function mount(target, anchor) { insert_dev(target, p, anchor); @@ -54271,7 +58321,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_if_block_1$1.name, + id: create_if_block_1$2.name, type: "if", source: "(70:2) {#if gameStatus === \\\"correct\\\"}", ctx @@ -54281,7 +58331,7 @@ var app = (function () { } // (79:4) {#each Array(gridSize) as _, i} - function create_each_block$a(ctx) { + function create_each_block$9(ctx) { let button; let t0_value = /*i*/ ctx[12] + 1 + ""; let t0; @@ -54301,7 +58351,7 @@ var app = (function () { attr_dev(button, "data-number", /*i*/ ctx[12] + 1); attr_dev(button, "class", "svelte-7k1yf9"); toggle_class(button, "pressed", /*userOrder*/ ctx[0].includes(/*i*/ ctx[12] + 1)); - add_location(button, file$c, 79, 6, 2378); + add_location(button, file$b, 79, 6, 2378); }, m: function mount(target, anchor) { insert_dev(target, button, anchor); @@ -54329,7 +58379,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$a.name, + id: create_each_block$9.name, type: "each", source: "(79:4) {#each Array(gridSize) as _, i}", ctx @@ -54352,7 +58402,7 @@ var app = (function () { t = text("Check Order"); button.disabled = button_disabled_value = /*userOrder*/ ctx[0].length !== /*gridSize*/ ctx[3]; attr_dev(button, "class", "svelte-7k1yf9"); - add_location(button, file$c, 86, 4, 2600); + add_location(button, file$b, 86, 4, 2600); }, m: function mount(target, anchor) { insert_dev(target, button, anchor); @@ -54386,7 +58436,7 @@ var app = (function () { return block; } - function create_fragment$c(ctx) { + function create_fragment$b(ctx) { let div0; let input; let t0; @@ -54402,7 +58452,7 @@ var app = (function () { let dispose; function select_block_type(ctx, dirty) { - if (/*gameStatus*/ ctx[2] === "correct") return create_if_block_1$1; + if (/*gameStatus*/ ctx[2] === "correct") return create_if_block_1$2; if (/*gameStatus*/ ctx[2] === "incorrect") return create_if_block_2; } @@ -54413,7 +58463,7 @@ var app = (function () { let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$a(get_each_context$a(ctx, each_value, i)); + each_blocks[i] = create_each_block$9(get_each_context$9(ctx, each_value, i)); } let if_block1 = !/*checkOnEveryPress*/ ctx[1] && /*gameStatus*/ ctx[2] === "" && create_if_block$5(ctx); @@ -54441,14 +58491,14 @@ var app = (function () { if (if_block1) if_block1.c(); if_block1_anchor = empty(); attr_dev(input, "type", "checkbox"); - add_location(input, file$c, 65, 4, 1962); - add_location(label, file$c, 66, 4, 2024); + add_location(input, file$b, 65, 4, 1962); + add_location(label, file$b, 66, 4, 2024); attr_dev(div0, "class", "controls svelte-7k1yf9"); - add_location(div0, file$c, 64, 2, 1934); + add_location(div0, file$b, 64, 2, 1934); attr_dev(button, "class", "svelte-7k1yf9"); - add_location(button, file$c, 75, 2, 2257); + add_location(button, file$b, 75, 2, 2257); attr_dev(div1, "class", "grid svelte-7k1yf9"); - add_location(div1, file$c, 77, 2, 2315); + add_location(div1, file$b, 77, 2, 2315); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -54506,12 +58556,12 @@ var app = (function () { let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$a(ctx, each_value, i); + const child_ctx = get_each_context$9(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$a(child_ctx); + each_blocks[i] = create_each_block$9(child_ctx); each_blocks[i].c(); each_blocks[i].m(div1, null); } @@ -54562,7 +58612,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$c.name, + id: create_fragment$b.name, type: "component", source: "", ctx @@ -54571,7 +58621,7 @@ var app = (function () { return block; } - function instance$c($$self, $$props, $$invalidate) { + function instance$b($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotSpaceGameOrder', slots, []); let gridSize = 4; // Grid size for simplicity @@ -54670,1001 +58720,1041 @@ var app = (function () { class MovingDotSpaceGameOrder extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$c, create_fragment$c, safe_not_equal, {}); + init(this, options, instance$b, create_fragment$b, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotSpaceGameOrder", options, - id: create_fragment$c.name + id: create_fragment$b.name }); } } - // themeConfig.js - - const themes = { - 'User Custom': { - background: '/AutoGameBackgrounds/theme_background.png', - inventory: [ - { type: "weapon", name: "Random waepon", description: "A powerful weapon." }, - // ... more space items - ], - skills: [ - { branch: "Skill Group 1", name: "Skill One", learned: false }, - // ... more space skills - ], - persistentTargets: [ - { name: "Background Target 1", x: 500, y: 500, collisionType: "alert", collisiontext: "First Test"}, - ], - // ... and so on for targets - story: [ - { - part: 0, - objectives: [ - { id: 1, - name: "Mission Details", - complete: false, - progress: 0, - inventoryRequired: [], }, - ], - targets: [ - { name: "Target 1", x: 150, y: 150, collisionType: "alert", collisiontext: "First Test"}, - ], - }, - { - part: 1, - objectives: [ - { id: 2, - name: "Mission Details", - complete: false, - progress: 0, - inventoryRequired: [], }, - ], - targets: [ - { name: "Target 2", x: 250, y: 250, collisionType: "alert", collisiontext: "First Test"}, - ], - }, - ], - actions: { - Buybook() { - // Logic to slay the dragon - }, - }, - }, - 'Default': { - background: '/AutoGameBackgrounds/1stGameLoc123.png', - inventory: [ - { type: "weapon", name: "Sword", description: "A sharp blade." }, - { type: "armor", name: "Shield", description: "Protects against attacks." }, - { type: "consumable", name: "Health Potion", description: "Restores health." }, - // ... more space items - ], - skills: [ - { branch: "Combat", name: "Basic Attack", learned: false }, - { branch: "Magic", name: "Fireball", learned: false }, - { branch: "Stealth", name: "Sneak", learned: false }, - // ... more space skills - ], - persistentTargets: [ - - ], - objectives: [ - { id: "Seperate", name: "Visit Mountain Peak", complete: false }, - { id: "Mission 1", name: "Intercept The Courier (Search the Locations)", complete: false }, - { id: "Mission 1", name: "Deliver the package to Market Stall", complete: false }, - // ... more space objectives - ], - // ... and so on for targets - story: [ - { - part: 0, - objectives: [], - targets: [ - { 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: "modal", modalConfig: { - title: "Entrance", - content: "You've reached the Entrance. What's your next step?", - actions: [ - {label: "Ask for guidance on next move", action: "askforDirections"}, - {label: "Buy an Axe", action: "buyAxeAlert"}, - // ... more actions if necessary - ]}, - }, - { name: "Market Stall", x: 200, y: 300, collisionType: "", collisiontext: "" }, // A market stall in the bustling market area. - { name: "Inn Entrance", x: 400, y: 450, collisionType: "", collisiontext: "" }, // The entrance to the inn for rest or information. - { name: "Town Hall", x: 600, y: 350, collisionType: "", collisiontext: "" }, // The entrance to the town hall for quests. - { name: "Fountain", x: 500, y: 500, collisionType: "", collisiontext: "" }, // A fountain in the town square as a meeting point. - { name: "Bridge", x: 1100, y: 700, collisionType: "", collisiontext: "" }, // A bridge in the mystical forest area. - { name: "Waterfall", x: 1300, y: 800, collisionType: "", collisiontext: "" }, // A waterfall that could hide secrets or treasures. - { name: "Mountain Peak", x: 1500, y: 100, collisionType: "", collisiontext: "" }, - //{ name: "Mysterious Stranger", x: 350, y: 550, collisionType: "alert", collisiontext: "Beware the hidden caves in the north." }, - //{ name: "Hidden Cave", x: 1200, y: 400, collisionType: "changeBackgroundColor", color: "#0B3D91" }, - //{ name: "Ancient Tree", x: 300, y: 700, collisionType: "playSound", soundUrl: "tree_whisper.mp3" }, - //{ name: "Forgotten Monument", x: 700, y: 800, collisionType: "startAnimation", elementId: "monument", animationClass: "glow" }, - //{ name: "Wizard's Tower", x: 950, y: 150, collisionType: "rotateDot" }, - //{ name: "Lakeside", x: 1400, y: 600, collisionType: "changeDotColor", color: "#00BFFF" }, - //{ name: "Dragon's Lair", x: 1600, y: 200, collisionType: "incrementScore", incrementValue: 50 }, - //{ name: "Abandoned Shipwreck", x: 1300, y: 500, collisionType: "shrinkDot" }, - - { name: "Switch Test 1", x: 700, y: 700, collisionType: "storypartchange", collisiontext: "First Test", newStage: 1}, - ], - }, - { - part: 1, - objectives: [], - targets: [ - { name: "Target 1", x: 50, y: 50, collisionType: "alert", collisiontext: "First Test"}, - { name: "Switch Back Test 1", x: 600, y: 400, collisionType: "storypartchange", collisiontext: "First Test", newStage: 0}, - ], - }, - ], - actions: { - Buybook() { - // Logic to slay the dragon - }, - }, - }, - 'Space Odyssey': { - background: '/AutoGameBackgrounds/SpaceOdysseyGameLoc.png', - inventory: [ - { type: "weapon", name: "Laser Gun", description: "A powerful laser weapon." }, - // ... more space items - ], - skills: [ - { branch: "Piloting", name: "Astro Navigation", learned: false }, - // ... more space skills - ], - persistentTargets: [ - { name: "Space Station", x: 200, y: 300, collisionType: "", collisiontext: "" }, - //{ name: "Asteroid Field", x: 400, y: 450, collisionType: "", collisiontext: "" }, - { name: "Alien Planet", x: 940, y: 460, collisionType: "alert", collisiontext: "You have arrived at an alien planet. The inhabitants seem cautious but willing to negotiate. Find a way to establish peace." }, - - { name: "Abandoned Spaceship", x: 460, y: 570, collisionType: "alert", collisiontext: "You have discovered an abandoned spaceship. It appears to be of ancient origin. Explore it for clues."}, - { name: "Colony", x: 640, y: 500, collisionType: "modal", modalConfig: { - title: "Human Colony", - content: "You have reached the human colony. Rest and prepare for your upcoming missions. Keep an eye out for any suspicious activities.", - actions: [ - {label: "Request Mission Briefing", action: "requestBriefing"}, - {label: "Purchase Upgrades", action: "purchaseUpgrades"}, - // ... more actions if necessary - ]}, - }, - { name: "Meteor Field", x: 1100, y: 470, collisionType: "modal", modalConfig: { - title: "Dangerous Meteor Field", - content: "You have entered a dense meteor field. Navigate carefully to avoid damage to your ship.", - actions: [ - {label: "Activate Shields", action: "activateShields"}, - {label: "Scan for Rare Minerals", action: "scanMinerals"}, - // ... more actions if necessary - ]}, - }, - // ... more persistent neutral targets - ], - story: [ - { - part: 0, - objectives: [ - { - id: 1, - name: "Dock at the Space Station", - complete: false, - progress: 0, - inventoryRequired: [], - }, - { - id: 2, - name: "Repair the Communication Array", - complete: false, - progress: 0, - inventoryRequired: ["Repair Kit"], - }, - ], - targets: [ - { name: "Space Station Docking Bay", x: 500, y: 400, collisionType: "alert", collisiontext: "Welcome to the space station. Please dock your ship and proceed to the communication room for your first mission." }, - { name: "Communication Room", x: 800, y: 200, collisionType: "alert", collisiontext: "You enter the communication room and find the array in disrepair. Collect the necessary tools and fix it to establish contact with Earth." }, - { name: "To Asteroid Field", x: 900, y: 100, collisionType: "storypartchange", transitionToPart: 1, collisiontext: "With the communication array repaired, you receive orders to investigate the nearby asteroid field for rare minerals." }, - ], - }, - { - part: 1, - objectives: [ - { - id: 3, - name: "Collect Rare Asteroid Minerals", - complete: false, - progress: 0, - inventoryRequired: ["Mining Laser"], - }, - ], - targets: [ - { name: "Asteroid Field", x: 1200, y: 300, collisionType: "alert", collisiontext: "You arrive at the asteroid field. Scan the asteroids for the rare minerals and use your mining laser to extract them." }, - { name: "Alien Encounter", x: 1250, y: 350, collisionType: "alert", collisiontext: "During the mining operation, you encounter an alien ship. They seem suspicious of your activities. Attempt to communicate and explain your peaceful intentions." }, - { name: "To Alien Homeworld", x: 1100, y: 200, collisionType: "storypartchange", transitionToPart: 2, collisiontext: "After successful communication, the aliens invite you to their homeworld to discuss a potential peace treaty." }, - ], - }, - // ... more story parts - ], - actions: { - activateShields() { - // Logic to activate shields - }, - scanMinerals() { - // Logic to scan for rare minerals - }, - requestBriefing() { - // Logic to request mission briefing - }, - purchaseUpgrades() { - // Logic to purchase ship upgrades - }, - // ... add more space-specific actions - }, - }, - 'Medieval Fantasy': { - background: '/AutoGameBackgrounds/MedievalFantasyGameLoc.png', - inventory: [ - { type: "weapon", name: "Longsword", description: "A sturdy steel blade." }, - // ... more medieval items - ], - skills: [ - // ... medieval skills - { branch: "Piloting", name: "Astro Navigation", learned: false }, - ], - persistentTargets: [ - { name: "Market Stall", x: 200, y: 300, collisionType: "", collisiontext: "" }, - { name: "Inn Entrance", x: 400, y: 450, collisionType: "", collisiontext: "" }, - { name: "Castle", x: 940, y: 460, collisionType: "alert", collisiontext: "The King of this land has summoned you to find and release his champion Daryl the Knight. Find him and free him" }, - { name: "Hidden Space", x: 460, y: 570, collisionType: "alert", collisiontext: "Seems like a hidden space. Nobody is here currently."}, - { name: "Home", x: 640, y: 500, collisionType: "modal", modalConfig: { - title: "Your Space", - content: "Rest and prepare for your tasks. Sometimes you hear noises in the area but this is the area with least interference", - actions: [ - {label: "Ask for guidance on next move", action: "askforDirections"}, - {label: "Buy an Axe", action: "buyAxeAlert"}, - // ... more actions if necessary - ]}, - }, - { name: "Marketplace", x: 1100, y: 470, collisionType: "modal", modalConfig: { - title: "Place to find information and items", - content: "A bustling marketplace", - actions: [ - {label: "Ask for guidance on next move", action: "askforDirections"}, - {label: "Buy an Axe", action: "buyAxeAlert"}, - {label: "Ask about the knight", action: "knightalert", message: "The armourer said he went to see the mini waterfall for some relaxtion"}, - // ... more actions if necessary - ]}, - }, - { name: "Mini Waterfall", x: 500, y: 640, collisionType: "alert", collisiontext: "A weird waterfall is upfront. It strangely gives a calming vibe. Nobody is here currently but there seems to be a trail of water leading to a closeby location .... "}, - // ... more persistent neutral targets - ], - story: [ - { - part: 0, - objectives: [ - { - id: 1, - name: "Investigate the Disappearances", - complete: false, - progress: 0, - inventoryRequired: [], - }, - { - id: 6, - name: "Rescue the Captured Knight", - complete: false, - progress: 0, - inventoryRequired: ["Longsword"], - }, - ], - targets: [ - { name: "Village Elder's House", x: 500, y: 400, collisionType: "alert", collisiontext: "Greetings, adventurer. Our village is in dire need of your help. People have been disappearing without a trace. Please, investigate and find out what's happening." }, - { name: "Mysterious Forest", x: 800, y: 200, collisionType: "alert", collisiontext: "As you enter the forest, an eerie silence envelops you. The trees seem to whisper secrets, and the shadows dance with an unnatural rhythm." }, - { name: "To Goblin Bandits", x: 900, y: 100, collisionType: "storypartchange", transitionToPart: 1, collisiontext: "You notice tracks leading deeper into the forest. They might lead to the missing villagers." }, - ], - }, - { - part: 1, - objectives: [ - { - id: 2, - name: "Defeat the Goblin Bandits", - complete: false, - progress: 0, - inventoryRequired: ["Longsword"], - }, - ], - targets: [ - { name: "Bandit Camp", x: 1200, y: 300, collisionType: "alert", collisiontext: "You stumble upon a hidden bandit camp deep in the forest. The goblins spot you and charge, weapons drawn. Prepare for battle!" }, - { name: "Prisoner Cages", x: 1250, y: 350, collisionType: "alert", collisiontext: "After defeating the goblins, you discover cages containing the missing villagers. You free them, and they share their gratitude and information about a mysterious sorcerer controlling the goblins." }, - { name: "To Gather Information", x: 1100, y: 200, collisionType: "storypartchange", transitionToPart: 2, collisiontext: "With the villagers safe, you decide to gather more information about the sorcerer in the nearby town." }, - ], - }, - { - part: 2, - objectives: [ - { - id: 3, - name: "Gather Information about the Sorcerer", - complete: false, - progress: 0, - inventoryRequired: [], - }, - ], - targets: [ - { name: "Tavern", x: 600, y: 500, collisionType: "alert", collisiontext: "You enter the tavern and overhear rumors about the sorcerer. Patrons speak of an ancient tower deep within the mountains where the sorcerer resides." }, - { name: "Mage's Guild", x: 400, y: 600, collisionType: "alert", collisiontext: "Seeking more information, you visit the Mage's Guild. The guild master provides you with a map to the sorcerer's tower and warns you of the powerful magic protecting it." }, - { name: "To Enchanted Maze", x: 300, y: 500, collisionType: "storypartchange", transitionToPart: 3, collisiontext: "With the information and map in hand, you set out to navigate the enchanted maze surrounding the sorcerer's tower." }, - ], - }, - { - part: 3, - objectives: [ - { - id: 4, - name: "Navigate the Enchanted Maze", - complete: false, - progress: 0, - inventoryRequired: ["Mage's Map"], - }, - ], - targets: [ - { name: "Enchanted Maze Entrance", x: 1000, y: 800, collisionType: "dialog", collisiontext: "Following the map, you reach the entrance of an enchanted maze surrounding the sorcerer's tower. The air crackles with magical energy, and illusory walls shift before your eyes." }, - { name: "Maze Center", x: 1000, y: 900, collisionType: "dialog", collisiontext: "After navigating the maze's twists and turns, you reach its center. A shimmering portal appears, leading directly to the sorcerer's tower." }, - { name: "To Sorcerer's Chamber", x: 1000, y: 950, collisionType: "storypartchange", transitionToPart: 4, collisiontext: "With determination, you step through the portal, ready to confront the sorcerer and end his tyranny." }, - ], - }, - { - part: 4, - objectives: [ - { - id: 5, - name: "Confront the Sorcerer", - complete: false, - progress: 0, - inventoryRequired: ["Enchanted Amulet"], - }, - ], - targets: [ - { name: "Sorcerer's Chamber", x: 1200, y: 1000, collisionType: "dialog", collisiontext: "You step through the portal and find yourself in the sorcerer's chamber. The sorcerer, a figure cloaked in dark robes, turns to face you. 'So, you've come to challenge me?' The final battle begins." }, - { name: "Villagers' Celebration", x: 500, y: 400, collisionType: "dialog", collisiontext: "With the sorcerer defeated, you return to the village as a hero. The villagers gather to celebrate your victory and express their gratitude. Peace has been restored to the land." }, - ], - }, - ], - actions: { - knightalert() { - alert("The armourer said he went to see the mini waterfall for some relaxtion"); - }, - buyAxeAlert() { - money.update(h => h - 10 > 0 ? h - 10 : 0); // Decreases money but never below 0 - const newItem = {type: "weapon", name: "Axe", description: "A heavy, sharp axe."}; - addInventoryItem(newItem); - }, - askforDirections() { - alert("Stranger: Go back to the fountain"); - }, - defendCastle() { - // Logic to defend the castle - }, - slayDragon() { - // Logic to slay the dragon - }, - // ... add more medieval-specific actions - }, - }, - // ... - 'Cyberpunk': { - background: '/AutoGameBackgrounds/CyberpunkGameLoc.png', - inventory: [ - { type: "weapon", name: "Plasma Rifle", description: "A high-tech firearm with plasma rounds." }, - { type: "armor", name: "NanoSuit", description: "Protects with reactive nano technology." }, - { type: "consumable", name: "Stim Pack", description: "Enhances reflexes temporarily." }, - // ... more cyberpunk items - ], - // ... skills, objectives, and targets for cyberpunk theme - skills: [ - { branch: "Hacking", name: "Cyber Intrusion", learned: false }, - { branch: "Combat", name: "Gun Kata", learned: false }, - { branch: "Stealth", name: "Cloaking", learned: false }, - // ... more space skills - ], - persistentTargets: [ - ], - objectives: [ - { id: 1, name: "Hack the Mainframe", complete: false, progress: 0 }, - { id: 2, name: "Escape the Megacorp Security", complete: false, progress: 0 }, - { id: 3, name: "Infiltrate the Underground Hacker Group", complete: false, progress: 0 }, - { id: 4, name: "Negotiate a Truce with the Rival Gang", complete: false, progress: 0 }, - { id: 5, name: "Expose the Corrupt Politician", complete: false, progress: 0 }, - { id: 6, name: "Survive the Drone Assault", complete: false, progress: 0 }, - { id: 7, name: "Retrieve the Stolen Cybernetic Tech", complete: false, progress: 0 }, - { id: 8, name: "Win the Street Race in Neo-Tokyo", complete: false, progress: 0 }, - { id: 9, name: "Decrypt the Corporate Data Files", complete: false, progress: 0 }, - { id: 10, name: "Disarm the City-Wide Neural Bomb", complete: false, progress: 0 } - - // ... more space objectives - ], - story: [ - { - part: 0, - objectives: [], - targets: [ - { name: "Target 1", x: 50, y: 50, collisionType: "alert", collisiontext: "First Test"}, - { name: "MegaCorp Server", x: 200, y: 50, collisionType: "alert", collisiontext: "First Test"}, - { name: "City Police", x: 50, y: 250, collisionType: "alert", collisiontext: "First Test"}, - { name: "Rival Gang", x: 550, y: 550, collisionType: "alert", collisiontext: "First Test"}, - ], - }, - ], - actions: { - Buybook() { - // Logic to slay the dragon - }, - }, - - }, - 'Super Teacher': { - background: '/AutoGameBackgrounds/SuperTeacherGameLoc.png', - inventory: [ - { type: "book", name: "Math Advice", description: "Useful topical knowledge." }, - { type: "book", name: "Science Advice", description: "Useful topical knowledge." }, - { type: "book", name: "English Advice", description: "Useful topical knowledge." }, - { type: "book", name: "Economics Advice", description: "Useful topical knowledge." }, - // ... more space items - ], - skills: [ - { branch: "Multitask", name: "Movement Speed", learned: false }, - { branch: "Multitask", name: "Stop Window Interference for 1 min", learned: false }, - // ... more space skills - ], - persistentTargets: [ - { name: "Super Teacher Toolkit", x: 1000, y: 330, collisionType: "alert", collisiontext: "First Test"}, - ], - objectives: [ - { id: "Mission 1", name: "Get the children to grade one 1 level", complete: false }, - { id: "Mission 2", name: "Get the children to grade one 2 level", complete: false }, - { id: "Mission 3", name: "Get the children to grade one 3 level", complete: false }, - // ... more space objectives - ], - // ... and so on for targets - story: [ - { - part: 0, - objectives: [], - targets: [ - { name: "Random Noise Interference", x: 250, y: 110, collisionType: "alert", collisiontext: "First Test"}, - { name: "Student 1", x: 310, y: 620, collisionType: "alert", collisiontext: "Attention fully restored. Needs reasoning help with english"}, - { name: "Student 2", x: 660, y: 610, collisionType: "alert", collisiontext: "Attention fully restored. Doesnt speak english."}, - { name: "Student 3", x: 1010, y: 620, collisionType: "alert", collisiontext: "Attention fully restored. Needs reasoning help with math"}, - ], - }, - ], - actions: { - BuybookforStudent() { - // Logic to slay the dragon - }, - }, - }, - 'Fantasy Adventure': { - background: '/AutoGameBackgrounds/eldoria_background.png', - inventory: [ - { type: "book", name: "Book of Eldrak", description: "An ancient tome containing half of a map." }, - { type: "amulet", name: "Peculiar Amulet", description: "A mysterious amulet bought in Meridia, reveals the unseen." }, - { type: "map", name: "Tattered Map", description: "A map hinting at significant locations within the Whispering Woods." }, - { type: "artifact", name: "Magical Acorn", description: "A gift from the forest spirit, promising future aid." }, - { type: "relic", name: "Shrine Relic", description: "A powerful artifact that enhances magical abilities, found in the Ruined Shrine." }, - { type: "record", name: "Echoing Cave Echoes", description: "A recording of whispers from the Echoing Caves, revealing secrets and hidden paths." }, - // ... more fantasy items - ], - skills: [ - { branch: "Combat", name: "Sword Mastery", learned: false }, - { branch: "Magic", name: "Elemental Control", learned: false }, - { branch: "Lore", name: "Ancient Lore", learned: true, description: "Ability to decipher old texts and understand magical artifacts, gained at the Ruined Shrine." }, - { branch: "Stealth", name: "Eavesdropping", learned: true, description: "Skill in using acoustics to eavesdrop, developed in the Echoing Caves." }, - { branch: "Stealth", name: "Stealth Movement", learned: true, description: "Improved stealth for moving unseen, honed in the Echoing Caves." }, - { branch: "Diplomacy", name: "Negotiation", learned: true, description: "Enhanced negotiation skills, honed through interaction with the spirits of the Forgotten Graveyard." }, - { branch: "Magic", name: "Artifact Mastery", learned: true, description: "Mastery over various magical artifacts collected throughout the journey." }, - // ... more fantasy skills - ], - persistentTargets: [ - { name: "Lila's Home", x: 460, y: 600, collisionType: "alert", collisiontext: "A cozy cottage where Lila's quest for knowledge begins."}, - { name: "Eldoria Library", x: 360, y: 620, collisionType: "alert", collisiontext: "A treasure trove of books and maps. Lila spends hours here."}, - ], - objectives: [ - { id: "FindBook", name: "Find the Book of Eldrak", complete: false }, - { id: "GetAmulet", name: "Acquire the Peculiar Amulet", complete: false }, - { id: "DiscoverArtefact", name: "Uncover the Artefact of Vorin", complete: false }, - { id: "LeaveEldoria", name: "Leave Eldoria's Outskirts", complete: true }, - { id: "VisitAncientOak", name: "Visit the Ancient Oak", complete: true }, - { id: "ExploreCrystalClearing", name: "Explore the Crystal Clearing", complete: true }, - { id: "DiscoverRuinedShrine", name: "Discover the Ruined Shrine", complete: true }, - { id: "NavigateEchoingCaves", name: "Navigate the Echoing Caves", complete: true }, - { id: "UncoverForgottenGraveyard", name: "Uncover the Secrets of the Forgotten Graveyard", complete: true }, - { id: "MasterArtifacts", name: "Master the Use of Collected Artifacts", complete: true }, - // ... more fantasy objectives - ], - story: [ - { - part: 0, - objectives: [], - targets: [ - { name: "Eldoria Main Square", x: 410, y: 590, collisionType: "requirementsgated", collisiontext: "The heart of Eldoria, bustling with townsfolk and traders.", requirements: (8)}, - { name: "Whispering Forest Edge", x: 830, y: 700, collisionType: "alert", collisiontext: "The mysterious forest that borders Eldoria. Lila feels drawn to its secrets."}, - { name: "Serene Hills", x: 520, y: 490, collisionType: "alert", collisiontext: "Gentle hills that promise adventure beyond Eldoria. Lila often gazes here, dreaming of what lies beyond."}, - { name: "Marketplace", x: 360, y: 560, collisionType: "alert", collisiontext: "A place of trade and gossip. Lila hears rumors of ancient artifacts here."}, - { name: "Eldoria", x: 490, y: 420, collisionType: "storypartchange", collisiontext: "Your journey begins in the quaint town of Eldoria.", newStage: 1}, - { name: "Old Sage's Hut", x: 600, y: 480, collisionType: "alert", collisiontext: "The home of Eldoria's oldest sage. Lila seeks his wisdom for her journey."}, - { name: "Eldoria's Outskirts", x: 100, y: 10, collisionType: "stats", collisiontext: "Your courage grows as you step into the unknown."}, - { name: "Tattered Map", x: 200, y: 20, collisionType: "inventory", collisiontext: "You've found a map that hints at significant locations in the Whispering Woods."}, - ], - }, - { - part: 1, - objectives: [], - targets: [ - { name: "Library of Eldrak", x: 620, y: 600, collisionType: "alert", collisiontext: "You discover the ancient Book of Eldrak."}, - { name: "Meridia Market", x: 750, y: 590, collisionType: "alert", collisiontext: "A peculiar amulet catches your eye, promising to reveal the unseen."}, - { name: "Suspicious Place", x: 810, y: 530, collisionType: "decision", collisiontext: "Do you know why you came here?"}, - { name: "The Ancient Oak", x: 300, y: 130, collisionType: "modal", modalConfig: { - title: "The Ancient Oak Area", - content: "The Ancient Oak stands before you,", - actions: [ - {label: "Talk to the Ancient Oak", action: "approachAncientOak"}, - // ... more actions if necessary - ]} - }, - { name: "Magical Acorn", x: 400, y: 140, collisionType: "modal", modalConfig: { - title: "Magical Acorn Area", - content: "You are drawn to the acorn but as you near it a spirit appears", - actions: [ - {label: "Talk to the spirit", action: "acquireMagicalAcorn"}, - // ... more actions if necessary - ]} - }, - ], - }, - { - part: 2, - objectives: [], - targets: [ - { name: "Whispering Woods", x: 400, y: 300, collisionType: "modal", collisiontext: "The woods are dense and mysterious, hiding both allies and secrets."}, - { name: "The Crystal Clearing", x: 500, y: 50, collisionType: "location", collisiontext: "Visions of potential futures flash before your eyes."}, - { name: "The Ruined Shrine", x: 600, y: 60, collisionType: "location", collisiontext: "You discover a relic among the ruins, learning about a forgotten deity."}, - ], - }, - { - part: 3, - objectives: [], - targets: [ - { name: "Shadowed Caverns", x: 600, y: 400, collisionType: "fight", collisiontext: "The lair of the Keepers. A test of strength and wit awaits."}, - { name: "Ancient Lore Skill", x: 370, y: 70, collisionType: "skills", collisiontext: "You've gained the skill to decipher old texts and understand magical artifacts."}, - { name: "Shrine Relic", x: 480, y: 80, collisionType: "inventory", collisiontext: "This powerful artifact enhances your magical abilities."}, - ], - }, - { - part: 4, - objectives: [], - targets: [ - { name: "Return to Eldoria", x: 100, y: 500, collisionType: "end", collisiontext: "With the Artefact of Vorin, you return, forever changed by your journey."}, - { name: "Echoing Cave Echoes", x: 90, y: 90, collisionType: "inventory", collisiontext: "You record the cave's whispers, a strategic item."}, - { name: "Eavesdropping Skill", x: 100, y: 100, collisionType: "skills", collisiontext: "You learn to use the cave's acoustics to eavesdrop."}, - ], - }, - { - part: 5, - objectives: [], - targets: [ - { name: "Stealth Skill", x: 110, y: 110, collisionType: "skills", collisiontext: "Navigating the caves, you improve your stealth."}, - { name: "Negotiation Skill", x: 120, y: 120, collisionType: "skills", collisiontext: "You've honed your negotiation skills with the spirits."}, - ], - }, - { - part: 6, - objectives: [], - targets: [ - { name: "Endurance Increase", x: 130, y: 130, collisionType: "stats", collisiontext: "The trials in the graveyard boost your endurance."}, - { name: "Intelligence Increase", x: 140, y: 140, collisionType: "stats", collisiontext: "Piecing together clues, your intelligence grows."}, - ], - }, - { - part: 7, - objectives: [], - targets: [ - { name: "Artifact Mastery Skill", x: 150, y: 150, collisionType: "skills", collisiontext: "You master the use of the artifacts you've collected."}, - ] - }, - // ... additional story parts as needed - ], - actions: { - Buybook() { - // Logic to slay the dragon - }, - }, - }, - 'Fantasy Adventure 2': { - background: '/AutoGameBackgrounds/fantasy_background.png', - inventory: [ - { type: "weapon", name: "Bow and Arrows", description: "A reliable ranged weapon." }, - { type: "tool", name: "Lockpicks", description: "Used for opening locked doors and chests." }, - { type: "consumable", name: "Healing Potion", description: "Restores health when consumed." }, - { type: "currency", name: "Gold Coins", description: "Used for purchasing items and services." }, - ], - skills: [ - { branch: "Combat", name: "Archery", learned: false }, - { branch: "Stealth", name: "Lockpicking", learned: false }, - { branch: "Magic", name: "Alchemy", learned: false }, - { branch: "Social", name: "Persuasion", learned: false }, - ], - persistentTargets: [ - { name: "Villager", x: 500, y: 500, collisionType: "alert", collisiontext: "Welcome to our village, traveler!" }, - ], - story: [ - { - part: 0, - objectives: [ - { id: 1, name: "Retrieve the Lost Amulet", complete: false, progress: 0, inventoryRequired: [], }, - { id: 2, name: "Gather information about the cave", complete: false, progress: 0, inventoryRequired: [], }, - { id: 3, name: "Obtain a map of the region", complete: false, progress: 0, inventoryRequired: [], }, - ], - targets: [ - { - name: "Villager 2", - x: 100, - y: 100, - collisionType: "modal", - modalConfig: { - title: "Conversation with Villager", - content: "Hello, traveler! How can I assist you today?", - actions: [ - { label: "Ask for directions", action: "askDirections" }, - { label: "Buy supplies", action: "buySupplies" }, - { label: "Inquire about the Lost Amulet", action: "inquireAboutAmulet" }, - { label: "Goodbye", action: "closeModal" }, - ], - }, - }, - { - name: "Merchant", - x: 300, - y: 150, - collisionType: "modal", - modalConfig: { - title: "Merchant's Shop", - content: "Welcome to my humble shop! What can I interest you in?", - actions: [ - { label: "Browse wares", action: "browseWares" }, - { label: "Ask about the cave", action: "askAboutCave" }, - { label: "Buy a map", action: "buyMap" }, - { label: "Leave shop", action: "closeModal" }, - ], - }, - }, - { - name: "Cave Entrance", - x: 200, - y: 200, - collisionType: "modal", - modalConfig: { - title: "Entering the Cave", - content: "You have reached the entrance of a dark and mysterious cave. Do you want to enter?", - actions: [ - { label: "Enter the cave", action: "enterCave" }, - { label: "Turn back", action: "closeModal" }, - ], - }, - }, - { - name: "Mysterious Stranger", - x: 400, - y: 300, - collisionType: "modal", - modalConfig: { - title: "Encounter with a Mysterious Stranger", - content: "Greetings, adventurer. You seem to be searching for something. Perhaps I can be of assistance.", - actions: [ - { label: "Ask about the Lost Amulet", action: "askAboutAmulet" }, - { label: "Inquire about the cave", action: "inquireAboutCave" }, - { label: "Ignore and walk away", action: "closeModal" }, - ], - }, - } - ], - }, - { - part: 1, - objectives: [ - { id: 11, name: "Rescue the Captured Princess", complete: false, progress: 0, inventoryRequired: [], }, - ], - targets: [ - { name: "Castle Gate", x: 400, y: 400, collisionType: "alert", collisiontext: "You've reached the castle gates!" }, - ], - }, - { - part: 2, - objectives: [ - { id: 21, name: "Defeat the Evil Sorcerer", complete: false, progress: 0, inventoryRequired: [], }, - ], - targets: [ - { name: "Sorcerer's Tower", x: 600, y: 600, collisionType: "alert", collisiontext: "You've arrived at the sorcerer's tower!" }, - ], - }, - { - part: 3, - objectives: [ - { id: 31, name: "Obtain the Rare Herb", complete: false, progress: 0, inventoryRequired: [], }, - ], - targets: [ - { name: "Herbalist's Hut", x: 800, y: 800, collisionType: "alert", collisiontext: "You've found the herbalist's hut!" }, - ], - }, - ], - actions: { - BuyItem(itemName) { - // Logic to buy an item from a vendor - }, - inquireAboutAmulet() { - alert("Villager: I've heard tales of a powerful amulet hidden deep within the cave. Be cautious if you seek it."); - }, - browseWares() { - // Logic to browse the merchant's wares - }, - askAboutCave() { - alert("Merchant: The cave to the east is known to be filled with dangerous creatures and traps. Proceed with caution."); - }, - buyMap() { - // Logic to buy a map from the merchant - }, - askAboutAmulet() { - alert("Stranger: The Lost Amulet possesses great power. It is said to be guarded by ancient guardians within the cave."); - }, - inquireAboutCave() { - alert("Stranger: The cave holds many secrets and challenges. Only the brave and resourceful can navigate its depths."); - }, - }, - }, - 'Constuction' : { - background: '/AutoGameBackgrounds/ConstructionGameLoc.png', - inventory: [ - { - type: "tool", - name: "Hammer", - description: "A sturdy hammer for various construction tasks." - }, - { - type: "tool", - name: "Screwdriver", - description: "A versatile screwdriver for fastening and loosening screws." - }, - { - type: "equipment", - name: "Safety Helmet", - description: "A hard hat to protect the worker's head from falling objects." - }, - { - type: "equipment", - name: "Safety Vest", - description: "A high-visibility vest to ensure the worker's safety on site." - }, - { - type: "consumable", - name: "Energy Bar", - description: "A snack to provide energy and sustenance during the workday." - } - ], - skills: [ - { - branch: "Construction", - name: "Electrical Wiring", - learned: true - }, - { - branch: "Construction", - name: "Concrete Pouring", - learned: true - }, - { - branch: "Safety", - name: "Fall Protection", - learned: false - }, - { - branch: "Safety", - name: "Hazard Recognition", - learned: true - }, - { - branch: "Equipment Operation", - name: "Forklift Certification", - learned: false - } - ], - persistentTargets: [ - { - name: "Blueprints", - x: 300, - y: 670, - collisionType: "alert", - collisiontext: "You consult the blueprints to ensure accurate construction." - }, - { - name: "Water Cooler", - x: 490, - y: 650, - collisionType: "alert", - collisiontext: "You take a brief break to hydrate and chat with co-workers." - } - ], - story: [ - { - part: 0, - objectives: [ - { - id: "Objective1_1", - name: "Attend Morning Briefing", - complete: false - }, - { - id: "Objective1_2", - name: "Gather Required Tools", - complete: false - } - ], - targets: [ - { - name: "Construction Site", - x: 470, - y: 310, - collisionType: "alert", - collisiontext: "You arrive at the construction site, ready to start the day." - }, - { - name: "Foreman's Office", - x: 1270, - y: 690, - collisionType: "alert", - collisiontext: "You attend the morning briefing with the foreman and receive your tasks for the day." - }, - { - name: "Tool Shed", - x: 430, - y: 540, - collisionType: "alert", - collisiontext: "You gather the necessary tools and equipment for your assigned tasks." - }, - { - name: "Continue Construction", - x: 1100, - y: 520, - collisionType: "storypartchange", - transitionToPart: 1, - collisiontext: "Continue to specific tasks after arriving", - } - ] - }, - { - part: 1, - objectives: [ - { - id: "Objective2_1", - name: "Install Electrical Wiring", - complete: false - }, - { - id: "Objective2_2", - name: "Assist with Concrete Pouring", - complete: false - }, - { - id: "Objective2_3", - name: "Attend Safety Training", - complete: false - } - ], - targets: [ - { - name: "Electrical Room", - x: 37, - y: 13, - collisionType: "alert", - collisiontext: "You begin installing electrical wiring according to the blueprints." - }, - { - name: "Foundation Area", - x: 370, - y: 50, - collisionType: "alert", - collisiontext: "You assist the team in pouring concrete for the building's foundation." - }, - { - name: "Safety Meeting Point", - x: 530, - y: 160, - collisionType: "alert", - collisiontext: "You attend a mandatory safety training session to ensure a secure working environment." - }, - { - name: "Lunch Break Area", - x: 820, - y: 540, - collisionType: "alert", - collisiontext: "You take a well-deserved lunch break with your co-workers." - } - ] - }, - { - part: 2, - objectives: [ - { - id: "Objective3_1", - name: "Inspect Completed Work", - complete: false - }, - { - id: "Objective3_2", - name: "Clean Up and Secure Site", - complete: false - } - ], - targets: [ - { - name: "Inspection Point", - x: 90, - y: 600, - collisionType: "alert", - collisiontext: "You inspect the completed work to ensure it meets the required standards." - }, - { - name: "Equipment Storage", - x: 220, - y: 800, - collisionType: "alert", - collisiontext: "You clean up your tools and equipment and store them properly." - }, - { - name: "Site Exit", - x: 900, - y: 900, - collisionType: "alert", - collisiontext: "You secure the construction site and leave for the day, feeling accomplished." - } - ] - } - ] - } + // themeConfig.js + + const themes = { + 'User Custom': { + background: '/AutoGameBackgrounds/theme_background.png', + inventory: [ + { type: "weapon", name: "Random waepon", description: "A powerful weapon." }, + // ... more space items + ], + skills: [ + { branch: "Skill Group 1", name: "Skill One", learned: false }, + // ... more space skills + ], + persistentTargets: [ + { name: "Background Target 1", x: 500, y: 500, collisionType: "alert", collisiontext: "First Test"}, + ], + // ... and so on for targets + story: [ + { + part: 0, + objectives: [ + { id: 1, + name: "Mission Details", + complete: false, + progress: 0, + inventoryRequired: [], }, + ], + targets: [ + { name: "Target 1", x: 150, y: 150, collisionType: "alert", collisiontext: "First Test"}, + ], + }, + { + part: 1, + objectives: [ + { id: 2, + name: "Mission Details", + complete: false, + progress: 0, + inventoryRequired: [], }, + ], + targets: [ + { name: "Target 2", x: 250, y: 250, collisionType: "alert", collisiontext: "First Test"}, + ], + }, + ], + actions: { + Buybook() { + // Logic to slay the dragon + }, + }, + stateobjects: { + // For location based story within a part + }, + }, + 'Default': { + background: '/AutoGameBackgrounds/1stGameLoc123.png', + inventory: [ + { type: "weapon", name: "Sword", description: "A sharp blade." }, + { type: "armor", name: "Shield", description: "Protects against attacks." }, + { type: "consumable", name: "Health Potion", description: "Restores health." }, + // ... more space items + ], + skills: [ + { branch: "Combat", name: "Basic Attack", learned: false }, + { branch: "Magic", name: "Fireball", learned: false }, + { branch: "Stealth", name: "Sneak", learned: false }, + // ... more space skills + ], + persistentTargets: [ + + ], + objectives: [ + { id: "Seperate", name: "Visit Mountain Peak", complete: false }, + { id: "Mission 1", name: "Intercept The Courier (Search the Locations)", complete: false }, + { id: "Mission 1", name: "Deliver the package to Market Stall", complete: false }, + // ... more space objectives + ], + // ... and so on for targets + story: [ + { + part: 0, + objectives: [], + targets: [ + { name: "Target 1", x: 50, y: 50, collisionType: "alert", collisiontext: "First Test", + subtargets: [ + { name: "Target 1 sub 1", x: 100, y: 75, collisionType: "alert", collisiontext: "First Test in Sub of First Test"} , + ], + }, + { name: "Target 2", x: 100, y: 100, collisionType: "", collisiontext: ""}, + { name: "Target 2 - SM in this space is passing function from the config to the case function", x: 600, y: 600, collisionType: "smmodal", modalStates: { + default: { + title: "Entrance", + content: "You've reached the Entrance. What's your next step?", + items: [ + { label: "Ask for guidance on next move", action: "guidance" }, + { label: "Buy an Axe", action: "buyAxe" } + ], + consequences: [], + }, + guidance: { + title: "Entrance - Guidance", + content: "The path to the north leads to the forest, and the path to the south leads to the village.", + items: [ + { label: "Head North", action: "forest" }, + { label: "Return", action: "default" } + ], + consequences: [], + }, + forest: { + title: "Forest", + content: "Went to the forest", + items: [], + consequences: [ 'gainleaf' ], + } + }}, + { name: "Entrance", x: 995, y: 660, collisionType: "modal", modalConfig: { + title: "Entrance", + content: "You've reached the Entrance. What's your next step?", + actions: [ + {label: "Ask for guidance on next move", action: "askforDirections"}, + {label: "Buy an Axe", action: "buyAxeAlert"}, + // ... more actions if necessary + ]}, + }, + { name: "Market Stall", x: 200, y: 300, collisionType: "", collisiontext: "" }, // A market stall in the bustling market area. + { name: "Inn Entrance", x: 400, y: 450, collisionType: "", collisiontext: "" }, // The entrance to the inn for rest or information. + { name: "Town Hall", x: 600, y: 350, collisionType: "", collisiontext: "" }, // The entrance to the town hall for quests. + { name: "Fountain", x: 500, y: 500, collisionType: "", collisiontext: "" }, // A fountain in the town square as a meeting point. + { name: "Bridge", x: 1100, y: 700, collisionType: "", collisiontext: "" }, // A bridge in the mystical forest area. + { name: "Waterfall", x: 1300, y: 800, collisionType: "", collisiontext: "" }, // A waterfall that could hide secrets or treasures. + { name: "Mountain Peak", x: 1500, y: 100, collisionType: "", collisiontext: "" }, + //{ name: "Mysterious Stranger", x: 350, y: 550, collisionType: "alert", collisiontext: "Beware the hidden caves in the north." }, + //{ name: "Hidden Cave", x: 1200, y: 400, collisionType: "changeBackgroundColor", color: "#0B3D91" }, + //{ name: "Ancient Tree", x: 300, y: 700, collisionType: "playSound", soundUrl: "tree_whisper.mp3" }, + //{ name: "Forgotten Monument", x: 700, y: 800, collisionType: "startAnimation", elementId: "monument", animationClass: "glow" }, + //{ name: "Wizard's Tower", x: 950, y: 150, collisionType: "rotateDot" }, + //{ name: "Lakeside", x: 1400, y: 600, collisionType: "changeDotColor", color: "#00BFFF" }, + //{ name: "Dragon's Lair", x: 1600, y: 200, collisionType: "incrementScore", incrementValue: 50 }, + //{ name: "Abandoned Shipwreck", x: 1300, y: 500, collisionType: "shrinkDot" }, + + { name: "Switch Test 1", x: 700, y: 700, collisionType: "storypartchange", collisiontext: "First Test", newStage: 1}, + ], + }, + { + part: 1, + objectives: [], + targets: [ + { name: "Target 1", x: 50, y: 50, collisionType: "alert", collisiontext: "First Test"}, + { name: "Switch Back Test 1", x: 600, y: 400, collisionType: "storypartchange", collisiontext: "First Test", newStage: 0}, + ], + }, + ], + actions: { + Buybook() { + // Logic to buy a book + }, + buyAxeAlert() { + alert('bought book'); + }, + gainleaf() { + const newItem = {type: "random", name: "Leaf", description: "Random Leaf blown to you by the wind"}; + addInventoryItem(newItem); + }, + }, + }, + 'Space Odyssey': { + background: '/AutoGameBackgrounds/SpaceOdysseyGameLoc.png', + inventory: [ + { type: "weapon", name: "Laser Gun", description: "A powerful laser weapon." }, + // ... more space items + ], + skills: [ + { branch: "Piloting", name: "Astro Navigation", learned: false }, + // ... more space skills + ], + persistentTargets: [ + { name: "Space Station", x: 200, y: 300, collisionType: "", collisiontext: "" }, + //{ name: "Asteroid Field", x: 400, y: 450, collisionType: "", collisiontext: "" }, + { name: "Alien Planet", x: 940, y: 460, collisionType: "alert", collisiontext: "You have arrived at an alien planet. The inhabitants seem cautious but willing to negotiate. Find a way to establish peace." }, + + { name: "Abandoned Spaceship", x: 460, y: 570, collisionType: "alert", collisiontext: "You have discovered an abandoned spaceship. It appears to be of ancient origin. Explore it for clues."}, + { name: "Colony", x: 640, y: 500, collisionType: "modal", modalConfig: { + title: "Human Colony", + content: "You have reached the human colony. Rest and prepare for your upcoming missions. Keep an eye out for any suspicious activities.", + actions: [ + {label: "Request Mission Briefing", action: "requestBriefing"}, + {label: "Purchase Upgrades", action: "purchaseUpgrades"}, + // ... more actions if necessary + ]}, + }, + { name: "Meteor Field", x: 1100, y: 470, collisionType: "modal", modalConfig: { + title: "Dangerous Meteor Field", + content: "You have entered a dense meteor field. Navigate carefully to avoid damage to your ship.", + actions: [ + {label: "Activate Shields", action: "activateShields"}, + {label: "Scan for Rare Minerals", action: "scanMinerals"}, + // ... more actions if necessary + ]}, + }, + // ... more persistent neutral targets + ], + story: [ + { + part: 0, + objectives: [ + { + id: 1, + name: "Dock at the Space Station", + complete: false, + progress: 0, + inventoryRequired: [], + }, + { + id: 2, + name: "Repair the Communication Array", + complete: false, + progress: 0, + inventoryRequired: ["Repair Kit"], + }, + ], + targets: [ + { name: "Space Station Docking Bay", x: 500, y: 400, collisionType: "alert", collisiontext: "Welcome to the space station. Please dock your ship and proceed to the communication room for your first mission." }, + { name: "Communication Room", x: 800, y: 200, collisionType: "alert", collisiontext: "You enter the communication room and find the array in disrepair. Collect the necessary tools and fix it to establish contact with Earth." }, + { name: "To Asteroid Field", x: 900, y: 100, collisionType: "storypartchange", transitionToPart: 1, collisiontext: "With the communication array repaired, you receive orders to investigate the nearby asteroid field for rare minerals." }, + ], + }, + { + part: 1, + objectives: [ + { + id: 3, + name: "Collect Rare Asteroid Minerals", + complete: false, + progress: 0, + inventoryRequired: ["Mining Laser"], + }, + ], + targets: [ + { name: "Asteroid Field", x: 1200, y: 300, collisionType: "alert", collisiontext: "You arrive at the asteroid field. Scan the asteroids for the rare minerals and use your mining laser to extract them." }, + { name: "Alien Encounter", x: 1250, y: 350, collisionType: "alert", collisiontext: "During the mining operation, you encounter an alien ship. They seem suspicious of your activities. Attempt to communicate and explain your peaceful intentions." }, + { name: "To Alien Homeworld", x: 1100, y: 200, collisionType: "storypartchange", transitionToPart: 2, collisiontext: "After successful communication, the aliens invite you to their homeworld to discuss a potential peace treaty." }, + ], + }, + // ... more story parts + ], + actions: { + activateShields() { + // Logic to activate shields + }, + scanMinerals() { + // Logic to scan for rare minerals + }, + requestBriefing() { + // Logic to request mission briefing + }, + purchaseUpgrades() { + // Logic to purchase ship upgrades + }, + // ... add more space-specific actions + }, + }, + 'Medieval Fantasy': { + background: '/AutoGameBackgrounds/MedievalFantasyGameLoc.png', + inventory: [ + { type: "weapon", name: "Longsword", description: "A sturdy steel blade." }, + // ... more medieval items + ], + skills: [ + // ... medieval skills + { branch: "Piloting", name: "Astro Navigation", learned: false }, + ], + persistentTargets: [ + { name: "Market Stall", x: 200, y: 300, collisionType: "", collisiontext: "" }, + { name: "Inn Entrance", x: 400, y: 450, collisionType: "", collisiontext: "" }, + { name: "Castle", x: 940, y: 460, collisionType: "alert", collisiontext: "The King of this land has summoned you to find and release his champion Daryl the Knight. Find him and free him" }, + { name: "Hidden Space", x: 460, y: 570, collisionType: "alert", collisiontext: "Seems like a hidden space. Nobody is here currently."}, + { name: "Home", x: 640, y: 500, collisionType: "modal", modalConfig: { + title: "Your Space", + content: "Rest and prepare for your tasks. Sometimes you hear noises in the area but this is the area with least interference", + actions: [ + {label: "Ask for guidance on next move", action: "askforDirections"}, + {label: "Buy an Axe", action: "buyAxeAlert"}, + // ... more actions if necessary + ]}, + }, + { name: "Marketplace", x: 1100, y: 470, collisionType: "modal", modalConfig: { + title: "Place to find information and items", + content: "A bustling marketplace", + actions: [ + {label: "Ask for guidance on next move", action: "askforDirections"}, + {label: "Buy an Axe", action: "buyAxeAlert"}, + {label: "Ask about the knight", action: "knightalert", message: "The armourer said he went to see the mini waterfall for some relaxtion"}, + // ... more actions if necessary + ]}, + }, + { name: "Mini Waterfall", x: 500, y: 640, collisionType: "alert", collisiontext: "A weird waterfall is upfront. It strangely gives a calming vibe. Nobody is here currently but there seems to be a trail of water leading to a closeby location .... "}, + // ... more persistent neutral targets + ], + story: [ + { + part: 0, + objectives: [ + { + id: 1, + name: "Investigate the Disappearances", + complete: false, + progress: 0, + inventoryRequired: [], + }, + { + id: 6, + name: "Rescue the Captured Knight", + complete: false, + progress: 0, + inventoryRequired: ["Longsword"], + }, + ], + targets: [ + { name: "Village Elder's House", x: 500, y: 400, collisionType: "alert", collisiontext: "Greetings, adventurer. Our village is in dire need of your help. People have been disappearing without a trace. Please, investigate and find out what's happening." }, + { name: "Mysterious Forest", x: 800, y: 200, collisionType: "alert", collisiontext: "As you enter the forest, an eerie silence envelops you. The trees seem to whisper secrets, and the shadows dance with an unnatural rhythm." }, + { name: "To Goblin Bandits", x: 900, y: 100, collisionType: "storypartchange", transitionToPart: 1, collisiontext: "You notice tracks leading deeper into the forest. They might lead to the missing villagers." }, + ], + }, + { + part: 1, + objectives: [ + { + id: 2, + name: "Defeat the Goblin Bandits", + complete: false, + progress: 0, + inventoryRequired: ["Longsword"], + }, + ], + targets: [ + { name: "Bandit Camp", x: 1200, y: 300, collisionType: "alert", collisiontext: "You stumble upon a hidden bandit camp deep in the forest. The goblins spot you and charge, weapons drawn. Prepare for battle!" }, + { name: "Prisoner Cages", x: 1250, y: 350, collisionType: "alert", collisiontext: "After defeating the goblins, you discover cages containing the missing villagers. You free them, and they share their gratitude and information about a mysterious sorcerer controlling the goblins." }, + { name: "To Gather Information", x: 1100, y: 200, collisionType: "storypartchange", transitionToPart: 2, collisiontext: "With the villagers safe, you decide to gather more information about the sorcerer in the nearby town." }, + ], + }, + { + part: 2, + objectives: [ + { + id: 3, + name: "Gather Information about the Sorcerer", + complete: false, + progress: 0, + inventoryRequired: [], + }, + ], + targets: [ + { name: "Tavern", x: 600, y: 500, collisionType: "alert", collisiontext: "You enter the tavern and overhear rumors about the sorcerer. Patrons speak of an ancient tower deep within the mountains where the sorcerer resides." }, + { name: "Mage's Guild", x: 400, y: 600, collisionType: "alert", collisiontext: "Seeking more information, you visit the Mage's Guild. The guild master provides you with a map to the sorcerer's tower and warns you of the powerful magic protecting it." }, + { name: "To Enchanted Maze", x: 300, y: 500, collisionType: "storypartchange", transitionToPart: 3, collisiontext: "With the information and map in hand, you set out to navigate the enchanted maze surrounding the sorcerer's tower." }, + ], + }, + { + part: 3, + objectives: [ + { + id: 4, + name: "Navigate the Enchanted Maze", + complete: false, + progress: 0, + inventoryRequired: ["Mage's Map"], + }, + ], + targets: [ + { name: "Enchanted Maze Entrance", x: 1000, y: 800, collisionType: "dialog", collisiontext: "Following the map, you reach the entrance of an enchanted maze surrounding the sorcerer's tower. The air crackles with magical energy, and illusory walls shift before your eyes." }, + { name: "Maze Center", x: 1000, y: 900, collisionType: "dialog", collisiontext: "After navigating the maze's twists and turns, you reach its center. A shimmering portal appears, leading directly to the sorcerer's tower." }, + { name: "To Sorcerer's Chamber", x: 1000, y: 950, collisionType: "storypartchange", transitionToPart: 4, collisiontext: "With determination, you step through the portal, ready to confront the sorcerer and end his tyranny." }, + ], + }, + { + part: 4, + objectives: [ + { + id: 5, + name: "Confront the Sorcerer", + complete: false, + progress: 0, + inventoryRequired: ["Enchanted Amulet"], + }, + ], + targets: [ + { name: "Sorcerer's Chamber", x: 1200, y: 1000, collisionType: "dialog", collisiontext: "You step through the portal and find yourself in the sorcerer's chamber. The sorcerer, a figure cloaked in dark robes, turns to face you. 'So, you've come to challenge me?' The final battle begins." }, + { name: "Villagers' Celebration", x: 500, y: 400, collisionType: "dialog", collisiontext: "With the sorcerer defeated, you return to the village as a hero. The villagers gather to celebrate your victory and express their gratitude. Peace has been restored to the land." }, + ], + }, + ], + actions: { + knightalert() { + alert("The armourer said he went to see the mini waterfall for some relaxtion"); + }, + buyAxeAlert() { + money.update(h => h - 10 > 0 ? h - 10 : 0); // Decreases money but never below 0 + const newItem = {type: "weapon", name: "Axe", description: "A heavy, sharp axe."}; + addInventoryItem(newItem); + }, + askforDirections() { + alert("Stranger: Go back to the fountain"); + }, + defendCastle() { + // Logic to defend the castle + }, + slayDragon() { + // Logic to slay the dragon + }, + // ... add more medieval-specific actions + }, + }, + // ... + 'Cyberpunk': { + background: '/AutoGameBackgrounds/CyberpunkGameLoc.png', + inventory: [ + { type: "weapon", name: "Plasma Rifle", description: "A high-tech firearm with plasma rounds." }, + { type: "armor", name: "NanoSuit", description: "Protects with reactive nano technology." }, + { type: "consumable", name: "Stim Pack", description: "Enhances reflexes temporarily." }, + // ... more cyberpunk items + ], + // ... skills, objectives, and targets for cyberpunk theme + skills: [ + { branch: "Hacking", name: "Cyber Intrusion", learned: false }, + { branch: "Combat", name: "Gun Kata", learned: false }, + { branch: "Stealth", name: "Cloaking", learned: false }, + // ... more space skills + ], + persistentTargets: [ + ], + objectives: [ + { id: 1, name: "Hack the Mainframe", complete: false, progress: 0 }, + { id: 2, name: "Escape the Megacorp Security", complete: false, progress: 0 }, + { id: 3, name: "Infiltrate the Underground Hacker Group", complete: false, progress: 0 }, + { id: 4, name: "Negotiate a Truce with the Rival Gang", complete: false, progress: 0 }, + { id: 5, name: "Expose the Corrupt Politician", complete: false, progress: 0 }, + { id: 6, name: "Survive the Drone Assault", complete: false, progress: 0 }, + { id: 7, name: "Retrieve the Stolen Cybernetic Tech", complete: false, progress: 0 }, + { id: 8, name: "Win the Street Race in Neo-Tokyo", complete: false, progress: 0 }, + { id: 9, name: "Decrypt the Corporate Data Files", complete: false, progress: 0 }, + { id: 10, name: "Disarm the City-Wide Neural Bomb", complete: false, progress: 0 } + + // ... more space objectives + ], + story: [ + { + part: 0, + objectives: [], + targets: [ + { name: "Target 1", x: 50, y: 50, collisionType: "alert", collisiontext: "First Test"}, + { name: "MegaCorp Server", x: 200, y: 50, collisionType: "alert", collisiontext: "First Test"}, + { name: "City Police", x: 50, y: 250, collisionType: "alert", collisiontext: "First Test"}, + { name: "Rival Gang", x: 550, y: 550, collisionType: "alert", collisiontext: "First Test"}, + ], + }, + ], + actions: { + Buybook() { + // Logic to slay the dragon + }, + }, + + }, + 'Super Teacher': { + background: '/AutoGameBackgrounds/SuperTeacherGameLoc.png', + inventory: [ + { type: "book", name: "Math Advice", description: "Useful topical knowledge." }, + { type: "book", name: "Science Advice", description: "Useful topical knowledge." }, + { type: "book", name: "English Advice", description: "Useful topical knowledge." }, + { type: "book", name: "Economics Advice", description: "Useful topical knowledge." }, + // ... more space items + ], + skills: [ + { branch: "Multitask", name: "Movement Speed", learned: false }, + { branch: "Multitask", name: "Stop Window Interference for 1 min", learned: false }, + // ... more space skills + ], + persistentTargets: [ + { name: "Super Teacher Toolkit", x: 1000, y: 330, collisionType: "alert", collisiontext: "First Test"}, + ], + objectives: [ + { id: "Mission 1", name: "Get the children to grade one 1 level", complete: false }, + { id: "Mission 2", name: "Get the children to grade one 2 level", complete: false }, + { id: "Mission 3", name: "Get the children to grade one 3 level", complete: false }, + // ... more space objectives + ], + // ... and so on for targets + story: [ + { + part: 0, + objectives: [], + targets: [ + { name: "Random Noise Interference", x: 250, y: 110, collisionType: "alert", collisiontext: "First Test"}, + { name: "Student 1", x: 310, y: 620, collisionType: "alert", collisiontext: "Attention fully restored. Needs reasoning help with english"}, + { name: "Student 2", x: 660, y: 610, collisionType: "alert", collisiontext: "Attention fully restored. Doesnt speak english."}, + { name: "Student 3", x: 1010, y: 620, collisionType: "alert", collisiontext: "Attention fully restored. Needs reasoning help with math"}, + ], + }, + ], + actions: { + BuybookforStudent() { + // Logic to slay the dragon + }, + }, + }, + 'Fantasy Adventure': { + background: '/AutoGameBackgrounds/eldoria_background.png', + inventory: [ + { type: "book", name: "Book of Eldrak", description: "An ancient tome containing half of a map." }, + { type: "amulet", name: "Peculiar Amulet", description: "A mysterious amulet bought in Meridia, reveals the unseen." }, + { type: "map", name: "Tattered Map", description: "A map hinting at significant locations within the Whispering Woods." }, + { type: "artifact", name: "Magical Acorn", description: "A gift from the forest spirit, promising future aid." }, + { type: "relic", name: "Shrine Relic", description: "A powerful artifact that enhances magical abilities, found in the Ruined Shrine." }, + { type: "record", name: "Echoing Cave Echoes", description: "A recording of whispers from the Echoing Caves, revealing secrets and hidden paths." }, + // ... more fantasy items + ], + skills: [ + { branch: "Combat", name: "Sword Mastery", learned: false }, + { branch: "Magic", name: "Elemental Control", learned: false }, + { branch: "Lore", name: "Ancient Lore", learned: true, description: "Ability to decipher old texts and understand magical artifacts, gained at the Ruined Shrine." }, + { branch: "Stealth", name: "Eavesdropping", learned: true, description: "Skill in using acoustics to eavesdrop, developed in the Echoing Caves." }, + { branch: "Stealth", name: "Stealth Movement", learned: true, description: "Improved stealth for moving unseen, honed in the Echoing Caves." }, + { branch: "Diplomacy", name: "Negotiation", learned: true, description: "Enhanced negotiation skills, honed through interaction with the spirits of the Forgotten Graveyard." }, + { branch: "Magic", name: "Artifact Mastery", learned: true, description: "Mastery over various magical artifacts collected throughout the journey." }, + // ... more fantasy skills + ], + persistentTargets: [ + { name: "Lila's Home", x: 460, y: 600, collisionType: "alert", collisiontext: "A cozy cottage where Lila's quest for knowledge begins."}, + { name: "Eldoria Library", x: 360, y: 620, collisionType: "alert", collisiontext: "A treasure trove of books and maps. Lila spends hours here."}, + ], + objectives: [ + { id: "FindBook", name: "Find the Book of Eldrak", complete: false }, + { id: "GetAmulet", name: "Acquire the Peculiar Amulet", complete: false }, + { id: "DiscoverArtefact", name: "Uncover the Artefact of Vorin", complete: false }, + { id: "LeaveEldoria", name: "Leave Eldoria's Outskirts", complete: true }, + { id: "VisitAncientOak", name: "Visit the Ancient Oak", complete: true }, + { id: "ExploreCrystalClearing", name: "Explore the Crystal Clearing", complete: true }, + { id: "DiscoverRuinedShrine", name: "Discover the Ruined Shrine", complete: true }, + { id: "NavigateEchoingCaves", name: "Navigate the Echoing Caves", complete: true }, + { id: "UncoverForgottenGraveyard", name: "Uncover the Secrets of the Forgotten Graveyard", complete: true }, + { id: "MasterArtifacts", name: "Master the Use of Collected Artifacts", complete: true }, + // ... more fantasy objectives + ], + story: [ + { + part: 0, + objectives: [], + targets: [ + { name: "Eldoria Main Square", x: 410, y: 590, collisionType: "requirementsgated", collisiontext: "The heart of Eldoria, bustling with townsfolk and traders.", requirements: (8)}, + { name: "Whispering Forest Edge", x: 830, y: 700, collisionType: "alert", collisiontext: "The mysterious forest that borders Eldoria. Lila feels drawn to its secrets."}, + { name: "Serene Hills", x: 520, y: 490, collisionType: "alert", collisiontext: "Gentle hills that promise adventure beyond Eldoria. Lila often gazes here, dreaming of what lies beyond."}, + { name: "Marketplace", x: 360, y: 560, collisionType: "alert", collisiontext: "A place of trade and gossip. Lila hears rumors of ancient artifacts here."}, + { name: "Eldoria", x: 490, y: 420, collisionType: "storypartchange", collisiontext: "Your journey begins in the quaint town of Eldoria.", newStage: 1}, + { name: "Old Sage's Hut", x: 600, y: 480, collisionType: "alert", collisiontext: "The home of Eldoria's oldest sage. Lila seeks his wisdom for her journey."}, + { name: "Eldoria's Outskirts", x: 100, y: 10, collisionType: "stats", collisiontext: "Your courage grows as you step into the unknown."}, + { name: "Tattered Map", x: 200, y: 20, collisionType: "inventory", collisiontext: "You've found a map that hints at significant locations in the Whispering Woods."}, + ], + }, + { + part: 1, + objectives: [], + targets: [ + { name: "Library of Eldrak", x: 620, y: 600, collisionType: "alert", collisiontext: "You discover the ancient Book of Eldrak."}, + { name: "Meridia Market", x: 750, y: 590, collisionType: "alert", collisiontext: "A peculiar amulet catches your eye, promising to reveal the unseen."}, + { name: "Suspicious Place", x: 810, y: 530, collisionType: "decision", collisiontext: "Do you know why you came here?"}, + { name: "The Ancient Oak", x: 300, y: 130, collisionType: "modal", modalConfig: { + title: "The Ancient Oak Area", + content: "The Ancient Oak stands before you,", + actions: [ + {label: "Talk to the Ancient Oak", action: "approachAncientOak"}, + // ... more actions if necessary + ]} + }, + { name: "Magical Acorn", x: 400, y: 140, collisionType: "modal", modalConfig: { + title: "Magical Acorn Area", + content: "You are drawn to the acorn but as you near it a spirit appears", + actions: [ + {label: "Talk to the spirit", action: "acquireMagicalAcorn"}, + // ... more actions if necessary + ]} + }, + ], + }, + { + part: 2, + objectives: [], + targets: [ + { name: "Whispering Woods", x: 400, y: 300, collisionType: "modal", collisiontext: "The woods are dense and mysterious, hiding both allies and secrets."}, + { name: "The Crystal Clearing", x: 500, y: 50, collisionType: "location", collisiontext: "Visions of potential futures flash before your eyes."}, + { name: "The Ruined Shrine", x: 600, y: 60, collisionType: "location", collisiontext: "You discover a relic among the ruins, learning about a forgotten deity."}, + ], + }, + { + part: 3, + objectives: [], + targets: [ + { name: "Shadowed Caverns", x: 600, y: 400, collisionType: "fight", collisiontext: "The lair of the Keepers. A test of strength and wit awaits."}, + { name: "Ancient Lore Skill", x: 370, y: 70, collisionType: "skills", collisiontext: "You've gained the skill to decipher old texts and understand magical artifacts."}, + { name: "Shrine Relic", x: 480, y: 80, collisionType: "inventory", collisiontext: "This powerful artifact enhances your magical abilities."}, + ], + }, + { + part: 4, + objectives: [], + targets: [ + { name: "Return to Eldoria", x: 100, y: 500, collisionType: "end", collisiontext: "With the Artefact of Vorin, you return, forever changed by your journey."}, + { name: "Echoing Cave Echoes", x: 90, y: 90, collisionType: "inventory", collisiontext: "You record the cave's whispers, a strategic item."}, + { name: "Eavesdropping Skill", x: 100, y: 100, collisionType: "skills", collisiontext: "You learn to use the cave's acoustics to eavesdrop."}, + ], + }, + { + part: 5, + objectives: [], + targets: [ + { name: "Stealth Skill", x: 110, y: 110, collisionType: "skills", collisiontext: "Navigating the caves, you improve your stealth."}, + { name: "Negotiation Skill", x: 120, y: 120, collisionType: "skills", collisiontext: "You've honed your negotiation skills with the spirits."}, + ], + }, + { + part: 6, + objectives: [], + targets: [ + { name: "Endurance Increase", x: 130, y: 130, collisionType: "stats", collisiontext: "The trials in the graveyard boost your endurance."}, + { name: "Intelligence Increase", x: 140, y: 140, collisionType: "stats", collisiontext: "Piecing together clues, your intelligence grows."}, + ], + }, + { + part: 7, + objectives: [], + targets: [ + { name: "Artifact Mastery Skill", x: 150, y: 150, collisionType: "skills", collisiontext: "You master the use of the artifacts you've collected."}, + ] + }, + // ... additional story parts as needed + ], + actions: { + Buybook() { + // Logic to slay the dragon + }, + }, + }, + 'Fantasy Adventure 2': { + background: '/AutoGameBackgrounds/fantasy_background.png', + inventory: [ + { type: "weapon", name: "Bow and Arrows", description: "A reliable ranged weapon." }, + { type: "tool", name: "Lockpicks", description: "Used for opening locked doors and chests." }, + { type: "consumable", name: "Healing Potion", description: "Restores health when consumed." }, + { type: "currency", name: "Gold Coins", description: "Used for purchasing items and services." }, + ], + skills: [ + { branch: "Combat", name: "Archery", learned: false }, + { branch: "Stealth", name: "Lockpicking", learned: false }, + { branch: "Magic", name: "Alchemy", learned: false }, + { branch: "Social", name: "Persuasion", learned: false }, + ], + persistentTargets: [ + { name: "Villager", x: 500, y: 500, collisionType: "alert", collisiontext: "Welcome to our village, traveler!" }, + ], + story: [ + { + part: 0, + objectives: [ + { id: 1, name: "Retrieve the Lost Amulet", complete: false, progress: 0, inventoryRequired: [], }, + { id: 2, name: "Gather information about the cave", complete: false, progress: 0, inventoryRequired: [], }, + { id: 3, name: "Obtain a map of the region", complete: false, progress: 0, inventoryRequired: [], }, + ], + targets: [ + { + name: "Villager 2", + x: 100, + y: 100, + collisionType: "modal", + modalConfig: { + title: "Conversation with Villager", + content: "Hello, traveler! How can I assist you today?", + actions: [ + { label: "Ask for directions", action: "askDirections" }, + { label: "Buy supplies", action: "buySupplies" }, + { label: "Inquire about the Lost Amulet", action: "inquireAboutAmulet" }, + { label: "Goodbye", action: "closeModal" }, + ], + }, + }, + { + name: "Merchant", + x: 300, + y: 150, + collisionType: "modal", + modalConfig: { + title: "Merchant's Shop", + content: "Welcome to my humble shop! What can I interest you in?", + actions: [ + { label: "Browse wares", action: "browseWares" }, + { label: "Ask about the cave", action: "askAboutCave" }, + { label: "Buy a map", action: "buyMap" }, + { label: "Leave shop", action: "closeModal" }, + ], + }, + }, + { + name: "Cave Entrance", + x: 200, + y: 200, + collisionType: "modal", + modalConfig: { + title: "Entering the Cave", + content: "You have reached the entrance of a dark and mysterious cave. Do you want to enter?", + actions: [ + { label: "Enter the cave", action: "enterCave" }, + { label: "Turn back", action: "closeModal" }, + ], + }, + }, + { + name: "Mysterious Stranger", + x: 400, + y: 300, + collisionType: "modal", + modalConfig: { + title: "Encounter with a Mysterious Stranger", + content: "Greetings, adventurer. You seem to be searching for something. Perhaps I can be of assistance.", + actions: [ + { label: "Ask about the Lost Amulet", action: "askAboutAmulet" }, + { label: "Inquire about the cave", action: "inquireAboutCave" }, + { label: "Ignore and walk away", action: "closeModal" }, + ], + }, + } + ], + }, + { + part: 1, + objectives: [ + { id: 11, name: "Rescue the Captured Princess", complete: false, progress: 0, inventoryRequired: [], }, + ], + targets: [ + { name: "Castle Gate", x: 400, y: 400, collisionType: "alert", collisiontext: "You've reached the castle gates!" }, + ], + }, + { + part: 2, + objectives: [ + { id: 21, name: "Defeat the Evil Sorcerer", complete: false, progress: 0, inventoryRequired: [], }, + ], + targets: [ + { name: "Sorcerer's Tower", x: 600, y: 600, collisionType: "alert", collisiontext: "You've arrived at the sorcerer's tower!" }, + ], + }, + { + part: 3, + objectives: [ + { id: 31, name: "Obtain the Rare Herb", complete: false, progress: 0, inventoryRequired: [], }, + ], + targets: [ + { name: "Herbalist's Hut", x: 800, y: 800, collisionType: "alert", collisiontext: "You've found the herbalist's hut!" }, + ], + }, + ], + actions: { + BuyItem(itemName) { + // Logic to buy an item from a vendor + }, + inquireAboutAmulet() { + alert("Villager: I've heard tales of a powerful amulet hidden deep within the cave. Be cautious if you seek it."); + }, + browseWares() { + // Logic to browse the merchant's wares + }, + askAboutCave() { + alert("Merchant: The cave to the east is known to be filled with dangerous creatures and traps. Proceed with caution."); + }, + buyMap() { + // Logic to buy a map from the merchant + }, + askAboutAmulet() { + alert("Stranger: The Lost Amulet possesses great power. It is said to be guarded by ancient guardians within the cave."); + }, + inquireAboutCave() { + alert("Stranger: The cave holds many secrets and challenges. Only the brave and resourceful can navigate its depths."); + }, + }, + }, + 'Constuction' : { + background: '/AutoGameBackgrounds/ConstructionGameLoc.png', + inventory: [ + { + type: "tool", + name: "Hammer", + description: "A sturdy hammer for various construction tasks." + }, + { + type: "tool", + name: "Screwdriver", + description: "A versatile screwdriver for fastening and loosening screws." + }, + { + type: "equipment", + name: "Safety Helmet", + description: "A hard hat to protect the worker's head from falling objects." + }, + { + type: "equipment", + name: "Safety Vest", + description: "A high-visibility vest to ensure the worker's safety on site." + }, + { + type: "consumable", + name: "Energy Bar", + description: "A snack to provide energy and sustenance during the workday." + } + ], + skills: [ + { + branch: "Construction", + name: "Electrical Wiring", + learned: true + }, + { + branch: "Construction", + name: "Concrete Pouring", + learned: true + }, + { + branch: "Safety", + name: "Fall Protection", + learned: false + }, + { + branch: "Safety", + name: "Hazard Recognition", + learned: true + }, + { + branch: "Equipment Operation", + name: "Forklift Certification", + learned: false + } + ], + persistentTargets: [ + { + name: "Blueprints", + x: 300, + y: 670, + collisionType: "alert", + collisiontext: "You consult the blueprints to ensure accurate construction." + }, + { + name: "Water Cooler", + x: 490, + y: 650, + collisionType: "alert", + collisiontext: "You take a brief break to hydrate and chat with co-workers." + } + ], + story: [ + { + part: 0, + objectives: [ + { + id: "Objective1_1", + name: "Attend Morning Briefing", + complete: false + }, + { + id: "Objective1_2", + name: "Gather Required Tools", + complete: false + } + ], + targets: [ + { + name: "Construction Site", + x: 470, + y: 310, + collisionType: "alert", + collisiontext: "You arrive at the construction site, ready to start the day." + }, + { + name: "Foreman's Office", + x: 1270, + y: 690, + collisionType: "alert", + collisiontext: "You attend the morning briefing with the foreman and receive your tasks for the day." + }, + { + name: "Tool Shed", + x: 430, + y: 540, + collisionType: "alert", + collisiontext: "You gather the necessary tools and equipment for your assigned tasks." + }, + { + name: "Continue Construction", + x: 1100, + y: 520, + collisionType: "storypartchange", + transitionToPart: 1, + collisiontext: "Continue to specific tasks after arriving", + } + ] + }, + { + part: 1, + objectives: [ + { + id: "Objective2_1", + name: "Install Electrical Wiring", + complete: false + }, + { + id: "Objective2_2", + name: "Assist with Concrete Pouring", + complete: false + }, + { + id: "Objective2_3", + name: "Attend Safety Training", + complete: false + } + ], + targets: [ + { + name: "Electrical Room", + x: 37, + y: 13, + collisionType: "alert", + collisiontext: "You begin installing electrical wiring according to the blueprints." + }, + { + name: "Foundation Area", + x: 370, + y: 50, + collisionType: "alert", + collisiontext: "You assist the team in pouring concrete for the building's foundation." + }, + { + name: "Safety Meeting Point", + x: 530, + y: 160, + collisionType: "alert", + collisiontext: "You attend a mandatory safety training session to ensure a secure working environment." + }, + { + name: "Lunch Break Area", + x: 820, + y: 540, + collisionType: "alert", + collisiontext: "You take a well-deserved lunch break with your co-workers." + } + ] + }, + { + part: 2, + objectives: [ + { + id: "Objective3_1", + name: "Inspect Completed Work", + complete: false + }, + { + id: "Objective3_2", + name: "Clean Up and Secure Site", + complete: false + } + ], + targets: [ + { + name: "Inspection Point", + x: 90, + y: 600, + collisionType: "alert", + collisiontext: "You inspect the completed work to ensure it meets the required standards." + }, + { + name: "Equipment Storage", + x: 220, + y: 800, + collisionType: "alert", + collisiontext: "You clean up your tools and equipment and store them properly." + }, + { + name: "Site Exit", + x: 900, + y: 900, + collisionType: "alert", + collisiontext: "You secure the construction site and leave for the day, feeling accomplished." + } + ] + } + ] + } }; /* src\MovingDotSpacePortfromReact.svelte generated by Svelte v3.59.2 */ - const { Object: Object_1$2, console: console_1$7 } = globals; + const { Object: Object_1$2, console: console_1$6 } = globals; - const file$b = "src\\MovingDotSpacePortfromReact.svelte"; + const file$a = "src\\MovingDotSpacePortfromReact.svelte"; - function get_each_context$9(ctx, list, i) { + function get_each_context$8(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[25] = list[i]; + child_ctx[27] = list[i]; return child_ctx; } - function get_each_context_1$4(ctx, list, i) { + function get_each_context_1$3(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[28] = list[i]; + child_ctx[30] = list[i]; return child_ctx; } - // (226:4) {#each themeKeys as key} - function create_each_block_1$4(ctx) { + // (252:4) {#each themeKeys as key} + function create_each_block_1$3(ctx) { let option; - let t_value = /*key*/ ctx[28] + ""; + let t_value = /*key*/ ctx[30] + ""; let t; const block = { c: function create() { option = element("option"); t = text(t_value); - option.__value = /*key*/ ctx[28]; + option.__value = /*key*/ ctx[30]; option.value = option.__value; - add_location(option, file$b, 226, 8, 9041); + add_location(option, file$a, 252, 8, 10253); }, m: function mount(target, anchor) { insert_dev(target, option, anchor); @@ -55678,27 +59768,27 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block_1$4.name, + id: create_each_block_1$3.name, type: "each", - source: "(226:4) {#each themeKeys as key}", + source: "(252:4) {#each themeKeys as key}", ctx }); return block; } - // (236:4) {#each $targets as target (target.name)} - function create_each_block$9(key_1, ctx) { + // (262:4) {#each $targets as target (target.name)} + function create_each_block$8(key_1, ctx) { let first; let target; let t0; let span; - let t1_value = /*target*/ ctx[25].name + ""; + let t1_value = /*target*/ ctx[27].name + ""; let t1; let current; target = new MovingDotTargetPortfromReact({ - props: { position: /*target*/ ctx[25] }, + props: { position: /*target*/ ctx[27] }, $$inline: true }); @@ -55712,9 +59802,9 @@ var app = (function () { span = element("span"); t1 = text(t1_value); set_style(span, "position", "absolute"); - set_style(span, "left", /*target*/ ctx[25].x + "px"); - set_style(span, "top", /*target*/ ctx[25].y + "px"); - add_location(span, file$b, 237, 8, 10087); + set_style(span, "left", /*target*/ ctx[27].x + "px"); + set_style(span, "top", /*target*/ ctx[27].y + "px"); + add_location(span, file$a, 263, 8, 11299); this.first = first; }, m: function mount(target$1, anchor) { @@ -55728,16 +59818,16 @@ var app = (function () { p: function update(new_ctx, dirty) { ctx = new_ctx; const target_changes = {}; - if (dirty & /*$targets*/ 1024) target_changes.position = /*target*/ ctx[25]; + if (dirty[0] & /*$targets*/ 4096) target_changes.position = /*target*/ ctx[27]; target.$set(target_changes); - if ((!current || dirty & /*$targets*/ 1024) && t1_value !== (t1_value = /*target*/ ctx[25].name + "")) set_data_dev(t1, t1_value); + if ((!current || dirty[0] & /*$targets*/ 4096) && t1_value !== (t1_value = /*target*/ ctx[27].name + "")) set_data_dev(t1, t1_value); - if (!current || dirty & /*$targets*/ 1024) { - set_style(span, "left", /*target*/ ctx[25].x + "px"); + if (!current || dirty[0] & /*$targets*/ 4096) { + set_style(span, "left", /*target*/ ctx[27].x + "px"); } - if (!current || dirty & /*$targets*/ 1024) { - set_style(span, "top", /*target*/ ctx[25].y + "px"); + if (!current || dirty[0] & /*$targets*/ 4096) { + set_style(span, "top", /*target*/ ctx[27].y + "px"); } }, i: function intro(local) { @@ -55759,29 +59849,29 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$9.name, + id: create_each_block$8.name, type: "each", - source: "(236:4) {#each $targets as target (target.name)}", + source: "(262:4) {#each $targets as target (target.name)}", ctx }); return block; } - // (242:4) {#if isModalOpen} - function create_if_block$4(ctx) { + // (268:4) {#if isModalOpen} + function create_if_block_1$1(ctx) { let modal; let current; modal = new MovingDotSpaceSimpleModal({ props: { isOpen: /*isModalOpen*/ ctx[3], - onClose: /*handleModalClose*/ ctx[16], - title: /*currentcollisiontitletext*/ ctx[4], - content: /*currentcollisiontext*/ ctx[5], - items: /*currentcollisionitems*/ ctx[6], - currentTheme: /*currentTheme*/ ctx[8], - themeActions: themes[/*currentTheme*/ ctx[8]].actions + onClose: /*handleModalClose*/ ctx[18], + title: /*currentcollisiontitletext*/ ctx[5], + content: /*currentcollisiontext*/ ctx[6], + items: /*currentcollisionitems*/ ctx[7], + currentTheme: /*currentTheme*/ ctx[10], + themeActions: themes[/*currentTheme*/ ctx[10]].actions }, $$inline: true }); @@ -55796,12 +59886,12 @@ var app = (function () { }, p: function update(ctx, dirty) { const modal_changes = {}; - if (dirty & /*isModalOpen*/ 8) modal_changes.isOpen = /*isModalOpen*/ ctx[3]; - if (dirty & /*currentcollisiontitletext*/ 16) modal_changes.title = /*currentcollisiontitletext*/ ctx[4]; - if (dirty & /*currentcollisiontext*/ 32) modal_changes.content = /*currentcollisiontext*/ ctx[5]; - if (dirty & /*currentcollisionitems*/ 64) modal_changes.items = /*currentcollisionitems*/ ctx[6]; - if (dirty & /*currentTheme*/ 256) modal_changes.currentTheme = /*currentTheme*/ ctx[8]; - if (dirty & /*currentTheme*/ 256) modal_changes.themeActions = themes[/*currentTheme*/ ctx[8]].actions; + if (dirty[0] & /*isModalOpen*/ 8) modal_changes.isOpen = /*isModalOpen*/ ctx[3]; + if (dirty[0] & /*currentcollisiontitletext*/ 32) modal_changes.title = /*currentcollisiontitletext*/ ctx[5]; + if (dirty[0] & /*currentcollisiontext*/ 64) modal_changes.content = /*currentcollisiontext*/ ctx[6]; + if (dirty[0] & /*currentcollisionitems*/ 128) modal_changes.items = /*currentcollisionitems*/ ctx[7]; + if (dirty[0] & /*currentTheme*/ 1024) modal_changes.currentTheme = /*currentTheme*/ ctx[10]; + if (dirty[0] & /*currentTheme*/ 1024) modal_changes.themeActions = themes[/*currentTheme*/ ctx[10]].actions; modal.$set(modal_changes); }, i: function intro(local) { @@ -55818,18 +59908,174 @@ var app = (function () { } }; + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_if_block_1$1.name, + type: "if", + source: "(268:4) {#if isModalOpen}", + ctx + }); + + return block; + } + + // (272:4) {#if isSMModalOpen} + function create_if_block$4(ctx) { + let smmodal; + let current; + + smmodal = new SimpleStateMachineModal({ + props: { + isOpen: /*isSMModalOpen*/ ctx[4], + onClose: /*handleModalClose*/ ctx[18], + modalStates: /*currentstatemodalstates*/ ctx[9] + }, + $$inline: true + }); + + const block = { + c: function create() { + create_component(smmodal.$$.fragment); + }, + m: function mount(target, anchor) { + mount_component(smmodal, target, anchor); + current = true; + }, + p: function update(ctx, dirty) { + const smmodal_changes = {}; + if (dirty[0] & /*isSMModalOpen*/ 16) smmodal_changes.isOpen = /*isSMModalOpen*/ ctx[4]; + if (dirty[0] & /*currentstatemodalstates*/ 512) smmodal_changes.modalStates = /*currentstatemodalstates*/ ctx[9]; + smmodal.$set(smmodal_changes); + }, + i: function intro(local) { + if (current) return; + transition_in(smmodal.$$.fragment, local); + current = true; + }, + o: function outro(local) { + transition_out(smmodal.$$.fragment, local); + current = false; + }, + d: function destroy(detaching) { + destroy_component(smmodal, detaching); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block$4.name, type: "if", - source: "(242:4) {#if isModalOpen}", + source: "(272:4) {#if isSMModalOpen}", ctx }); return block; } - function create_fragment$b(ctx) { + // (282:0) + function create_default_slot(ctx) { + let h10; + let t1; + let fighttest; + let t2; + let modaltest; + let t3; + let h11; + let t5; + let findtest; + let t6; + let h12; + let t8; + let ordertest; + let current; + fighttest = new MovingDotSpaceGameFight({ $$inline: true }); + modaltest = new MovingDotSpaceModalBrainstorm({ $$inline: true }); + findtest = new MovingDotSpaceGameFind({ $$inline: true }); + ordertest = new MovingDotSpaceGameOrder({ $$inline: true }); + + const block = { + c: function create() { + h10 = element("h1"); + h10.textContent = "Expand this to allow up to 100 fighters on each side"; + t1 = space(); + create_component(fighttest.$$.fragment); + t2 = space(); + create_component(modaltest.$$.fragment); + t3 = space(); + h11 = element("h1"); + h11.textContent = "Find games are choices between similar looking items missing information with limited information (Luck = More Targets)"; + t5 = space(); + create_component(findtest.$$.fragment); + t6 = space(); + h12 = element("h1"); + h12.textContent = "Find out/ make sense / Resolve Conflict = order mixed up and"; + t8 = space(); + create_component(ordertest.$$.fragment); + add_location(h10, file$a, 282, 4, 12202); + add_location(h11, file$a, 285, 4, 12307); + add_location(h12, file$a, 287, 4, 12460); + }, + m: function mount(target, anchor) { + insert_dev(target, h10, anchor); + insert_dev(target, t1, anchor); + mount_component(fighttest, target, anchor); + insert_dev(target, t2, anchor); + mount_component(modaltest, target, anchor); + insert_dev(target, t3, anchor); + insert_dev(target, h11, anchor); + insert_dev(target, t5, anchor); + mount_component(findtest, target, anchor); + insert_dev(target, t6, anchor); + insert_dev(target, h12, anchor); + insert_dev(target, t8, anchor); + mount_component(ordertest, target, anchor); + current = true; + }, + p: noop, + i: function intro(local) { + if (current) return; + transition_in(fighttest.$$.fragment, local); + transition_in(modaltest.$$.fragment, local); + transition_in(findtest.$$.fragment, local); + transition_in(ordertest.$$.fragment, local); + current = true; + }, + o: function outro(local) { + transition_out(fighttest.$$.fragment, local); + transition_out(modaltest.$$.fragment, local); + transition_out(findtest.$$.fragment, local); + transition_out(ordertest.$$.fragment, local); + current = false; + }, + d: function destroy(detaching) { + if (detaching) detach_dev(h10); + if (detaching) detach_dev(t1); + destroy_component(fighttest, detaching); + if (detaching) detach_dev(t2); + destroy_component(modaltest, detaching); + if (detaching) detach_dev(t3); + if (detaching) detach_dev(h11); + if (detaching) detach_dev(t5); + destroy_component(findtest, detaching); + if (detaching) detach_dev(t6); + if (detaching) detach_dev(h12); + if (detaching) detach_dev(t8); + destroy_component(ordertest, detaching); + } + }; + + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_default_slot.name, + type: "slot", + source: "(282:0) ", + ctx + }); + + return block; + } + + function create_fragment$a(ctx) { let t0; let select; let t1; @@ -55853,34 +60099,23 @@ var app = (function () { let each1_lookup = new Map(); let t11; let t12; - let movingdotstats; let t13; - let h10; - let t15; - let hr; + let movingdotstats; + let t14; + let h1; let t16; - let h11; - let t18; - let fighttest; - let t19; - let modaltest; - let t20; - let h12; - let t22; - let findtest; - let t23; - let h13; - let t25; - let ordertest; + let hr; + let t17; + let simplecollapsible; let current; let mounted; let dispose; - let each_value_1 = /*themeKeys*/ ctx[13]; + let each_value_1 = /*themeKeys*/ ctx[15]; validate_each_argument(each_value_1); let each_blocks_1 = []; for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks_1[i] = create_each_block_1$4(get_each_context_1$4(ctx, each_value_1, i)); + each_blocks_1[i] = create_each_block_1$3(get_each_context_1$3(ctx, each_value_1, i)); } dotgamethememanager = new MovingDotSpaceThemeManager({ @@ -55892,29 +60127,35 @@ var app = (function () { let movingdot_props = { position: /*$dotPosition*/ ctx[0], - boundaries: /*boundaries*/ ctx[12] + boundaries: /*boundaries*/ ctx[14] }; movingdot = new MovingDotPortfromReact({ props: movingdot_props, $$inline: true }); - /*movingdot_binding*/ ctx[20](movingdot); - movingdot.$on("move", /*move_handler*/ ctx[21]); - let each_value = /*$targets*/ ctx[10]; + /*movingdot_binding*/ ctx[22](movingdot); + movingdot.$on("move", /*move_handler*/ ctx[23]); + let each_value = /*$targets*/ ctx[12]; validate_each_argument(each_value); - const get_key = ctx => /*target*/ ctx[25].name; - validate_each_keys(ctx, each_value, get_each_context$9, get_key); + const get_key = ctx => /*target*/ ctx[27].name; + validate_each_keys(ctx, each_value, get_each_context$8, get_key); for (let i = 0; i < each_value.length; i += 1) { - let child_ctx = get_each_context$9(ctx, each_value, i); + let child_ctx = get_each_context$8(ctx, each_value, i); let key = get_key(child_ctx); - each1_lookup.set(key, each_blocks[i] = create_each_block$9(key, child_ctx)); + each1_lookup.set(key, each_blocks[i] = create_each_block$8(key, child_ctx)); } - let if_block = /*isModalOpen*/ ctx[3] && create_if_block$4(ctx); + let if_block0 = /*isModalOpen*/ ctx[3] && create_if_block_1$1(ctx); + let if_block1 = /*isSMModalOpen*/ ctx[4] && create_if_block$4(ctx); movingdotstats = new MovingDotStatDisplay({ $$inline: true }); - fighttest = new MovingDotSpaceGameFight({ $$inline: true }); - modaltest = new MovingDotSpaceModalBrainstorm({ $$inline: true }); - findtest = new MovingDotSpaceGameFind({ $$inline: true }); - ordertest = new MovingDotSpaceGameOrder({ $$inline: true }); + + simplecollapsible = new SimpleCollapsible({ + props: { + title: "Some practice modal ideas - how to solve the import issue (have to import all modals all the time?)", + $$slots: { default: [create_default_slot] }, + $$scope: { ctx } + }, + $$inline: true + }); const block = { c: function create() { @@ -55946,55 +60187,39 @@ var app = (function () { } t11 = space(); - if (if_block) if_block.c(); + if (if_block0) if_block0.c(); t12 = space(); - create_component(movingdotstats.$$.fragment); + if (if_block1) if_block1.c(); t13 = space(); - h10 = element("h1"); - h10.textContent = "Game is normally just story with fighting and traversing mechanics repeated in between videos"; - t15 = space(); - hr = element("hr"); + create_component(movingdotstats.$$.fragment); + t14 = space(); + h1 = element("h1"); + h1.textContent = "Simple Game is normally just story with fighting and traversing mechanics repeated in between videos"; t16 = space(); - h11 = element("h1"); - h11.textContent = "Expand this to allow up to 100 fighters on each side"; - t18 = space(); - create_component(fighttest.$$.fragment); - t19 = space(); - create_component(modaltest.$$.fragment); - t20 = space(); - h12 = element("h1"); - h12.textContent = "Find games are choices between similar looking items missing information with limited information (Luck = More Targets)"; - t22 = space(); - create_component(findtest.$$.fragment); - t23 = space(); - h13 = element("h1"); - h13.textContent = "Find out/ make sense / Resolve Conflict = order mixed up and"; - t25 = space(); - create_component(ordertest.$$.fragment); - if (/*currentTheme*/ ctx[8] === void 0) add_render_callback(() => /*select_change_handler*/ ctx[18].call(select)); - add_location(select, file$b, 224, 0, 8943); + hr = element("hr"); + t17 = space(); + create_component(simplecollapsible.$$.fragment); + if (/*currentTheme*/ ctx[10] === void 0) add_render_callback(() => /*select_change_handler*/ ctx[20].call(select)); + add_location(select, file$a, 250, 0, 10155); set_style(canvas_1, "width", "100%"); set_style(canvas_1, "height", "100%"); attr_dev(canvas_1, "tabindex", "0"); - add_location(canvas_1, file$b, 232, 4, 9423); + add_location(canvas_1, file$a, 258, 4, 10635); attr_dev(div0, "id", "overlayText"); attr_dev(div0, "class", "svelte-c2nwl9"); - add_location(div0, file$b, 234, 4, 9681); + add_location(div0, file$a, 260, 4, 10893); attr_dev(div1, "id", "game-container"); set_style(div1, "position", "relative"); set_style(div1, "width", "100%"); set_style(div1, "height", "100vh"); set_style(div1, "border", "1px solid black"); set_style(div1, "overflow", "hidden"); - set_style(div1, "background-image", "url('" + /*CurrentGameBackground*/ ctx[9] + "')"); + set_style(div1, "background-image", "url('" + /*CurrentGameBackground*/ ctx[11] + "')"); set_style(div1, "background-size", "cover"); set_style(div1, "background-position", "center"); - add_location(div1, file$b, 231, 0, 9190); - add_location(h10, file$b, 248, 0, 10555); - add_location(hr, file$b, 249, 0, 10659); - add_location(h11, file$b, 250, 0, 10665); - add_location(h12, file$b, 253, 0, 10758); - add_location(h13, file$b, 255, 0, 10903); + add_location(div1, file$a, 257, 0, 10402); + add_location(h1, file$a, 278, 0, 11950); + add_location(hr, file$a, 279, 0, 12061); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -56009,13 +60234,13 @@ var app = (function () { } } - select_option(select, /*currentTheme*/ ctx[8], true); + select_option(select, /*currentTheme*/ ctx[10], true); insert_dev(target, t1, anchor); mount_component(dotgamethememanager, target, anchor); insert_dev(target, t2, anchor); insert_dev(target, div1, anchor); append_dev(div1, canvas_1); - /*canvas_1_binding*/ ctx[19](canvas_1); + /*canvas_1_binding*/ ctx[21](canvas_1); append_dev(div1, t3); mount_component(movingdot, div1, null); append_dev(div1, t4); @@ -56034,52 +60259,42 @@ var app = (function () { } append_dev(div1, t11); - if (if_block) if_block.m(div1, null); - insert_dev(target, t12, anchor); - mount_component(movingdotstats, target, anchor); + if (if_block0) if_block0.m(div1, null); + append_dev(div1, t12); + if (if_block1) if_block1.m(div1, null); insert_dev(target, t13, anchor); - insert_dev(target, h10, anchor); - insert_dev(target, t15, anchor); - insert_dev(target, hr, anchor); + mount_component(movingdotstats, target, anchor); + insert_dev(target, t14, anchor); + insert_dev(target, h1, anchor); insert_dev(target, t16, anchor); - insert_dev(target, h11, anchor); - insert_dev(target, t18, anchor); - mount_component(fighttest, target, anchor); - insert_dev(target, t19, anchor); - mount_component(modaltest, target, anchor); - insert_dev(target, t20, anchor); - insert_dev(target, h12, anchor); - insert_dev(target, t22, anchor); - mount_component(findtest, target, anchor); - insert_dev(target, t23, anchor); - insert_dev(target, h13, anchor); - insert_dev(target, t25, anchor); - mount_component(ordertest, target, anchor); + insert_dev(target, hr, anchor); + insert_dev(target, t17, anchor); + mount_component(simplecollapsible, target, anchor); current = true; if (!mounted) { dispose = [ - listen_dev(select, "change", /*select_change_handler*/ ctx[18]), - listen_dev(select, "change", /*changeTheme*/ ctx[14], false, false, false, false), - listen_dev(canvas_1, "click", /*handleSpaceClick*/ ctx[15], false, false, false, false) + listen_dev(select, "change", /*select_change_handler*/ ctx[20]), + listen_dev(select, "change", /*changeTheme*/ ctx[16], false, false, false, false), + listen_dev(canvas_1, "click", /*handleSpaceClick*/ ctx[17], false, false, false, false) ]; mounted = true; } }, - p: function update(ctx, [dirty]) { - if (dirty & /*themeKeys*/ 8192) { - each_value_1 = /*themeKeys*/ ctx[13]; + p: function update(ctx, dirty) { + if (dirty[0] & /*themeKeys*/ 32768) { + each_value_1 = /*themeKeys*/ ctx[15]; validate_each_argument(each_value_1); let i; for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1$4(ctx, each_value_1, i); + const child_ctx = get_each_context_1$3(ctx, each_value_1, i); if (each_blocks_1[i]) { each_blocks_1[i].p(child_ctx, dirty); } else { - each_blocks_1[i] = create_each_block_1$4(child_ctx); + each_blocks_1[i] = create_each_block_1$3(child_ctx); each_blocks_1[i].c(); each_blocks_1[i].m(select, null); } @@ -56092,54 +60307,85 @@ var app = (function () { each_blocks_1.length = each_value_1.length; } - if (dirty & /*currentTheme, themeKeys*/ 8448) { - select_option(select, /*currentTheme*/ ctx[8]); + if (dirty[0] & /*currentTheme, themeKeys*/ 33792) { + select_option(select, /*currentTheme*/ ctx[10]); } const dotgamethememanager_changes = {}; - if (dirty & /*ChangedContentPlaceholdertoSend*/ 2) dotgamethememanager_changes.ChangedContentPlaceholder = /*ChangedContentPlaceholdertoSend*/ ctx[1]; + if (dirty[0] & /*ChangedContentPlaceholdertoSend*/ 2) dotgamethememanager_changes.ChangedContentPlaceholder = /*ChangedContentPlaceholdertoSend*/ ctx[1]; dotgamethememanager.$set(dotgamethememanager_changes); const movingdot_changes = {}; - if (dirty & /*$dotPosition*/ 1) movingdot_changes.position = /*$dotPosition*/ ctx[0]; + if (dirty[0] & /*$dotPosition*/ 1) movingdot_changes.position = /*$dotPosition*/ ctx[0]; movingdot.$set(movingdot_changes); - if ((!current || dirty & /*$dotPosition*/ 1) && t6_value !== (t6_value = /*$dotPosition*/ ctx[0].x + "")) set_data_dev(t6, t6_value); - if ((!current || dirty & /*$dotPosition*/ 1) && t8_value !== (t8_value = /*$dotPosition*/ ctx[0].y + "")) set_data_dev(t8, t8_value); + if ((!current || dirty[0] & /*$dotPosition*/ 1) && t6_value !== (t6_value = /*$dotPosition*/ ctx[0].x + "")) set_data_dev(t6, t6_value); + if ((!current || dirty[0] & /*$dotPosition*/ 1) && t8_value !== (t8_value = /*$dotPosition*/ ctx[0].y + "")) set_data_dev(t8, t8_value); - if (dirty & /*$targets*/ 1024) { - each_value = /*$targets*/ ctx[10]; + if (dirty[0] & /*$targets*/ 4096) { + each_value = /*$targets*/ ctx[12]; validate_each_argument(each_value); group_outros(); - validate_each_keys(ctx, each_value, get_each_context$9, get_key); - each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div1, outro_and_destroy_block, create_each_block$9, t11, get_each_context$9); + validate_each_keys(ctx, each_value, get_each_context$8, get_key); + each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each1_lookup, div1, outro_and_destroy_block, create_each_block$8, t11, get_each_context$8); check_outros(); } if (/*isModalOpen*/ ctx[3]) { - if (if_block) { - if_block.p(ctx, dirty); + if (if_block0) { + if_block0.p(ctx, dirty); - if (dirty & /*isModalOpen*/ 8) { - transition_in(if_block, 1); + if (dirty[0] & /*isModalOpen*/ 8) { + transition_in(if_block0, 1); } } else { - if_block = create_if_block$4(ctx); - if_block.c(); - transition_in(if_block, 1); - if_block.m(div1, null); + if_block0 = create_if_block_1$1(ctx); + if_block0.c(); + transition_in(if_block0, 1); + if_block0.m(div1, t12); } - } else if (if_block) { + } else if (if_block0) { group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; + transition_out(if_block0, 1, 1, () => { + if_block0 = null; }); check_outros(); } - if (!current || dirty & /*CurrentGameBackground*/ 512) { - set_style(div1, "background-image", "url('" + /*CurrentGameBackground*/ ctx[9] + "')"); + if (/*isSMModalOpen*/ ctx[4]) { + if (if_block1) { + if_block1.p(ctx, dirty); + + if (dirty[0] & /*isSMModalOpen*/ 16) { + transition_in(if_block1, 1); + } + } else { + if_block1 = create_if_block$4(ctx); + if_block1.c(); + transition_in(if_block1, 1); + if_block1.m(div1, null); + } + } else if (if_block1) { + group_outros(); + + transition_out(if_block1, 1, 1, () => { + if_block1 = null; + }); + + check_outros(); + } + + if (!current || dirty[0] & /*CurrentGameBackground*/ 2048) { + set_style(div1, "background-image", "url('" + /*CurrentGameBackground*/ ctx[11] + "')"); } + + const simplecollapsible_changes = {}; + + if (dirty[1] & /*$$scope*/ 4) { + simplecollapsible_changes.$$scope = { dirty, ctx }; + } + + simplecollapsible.$set(simplecollapsible_changes); }, i: function intro(local) { if (current) return; @@ -56150,12 +60396,10 @@ var app = (function () { transition_in(each_blocks[i]); } - transition_in(if_block); + transition_in(if_block0); + transition_in(if_block1); transition_in(movingdotstats.$$.fragment, local); - transition_in(fighttest.$$.fragment, local); - transition_in(modaltest.$$.fragment, local); - transition_in(findtest.$$.fragment, local); - transition_in(ordertest.$$.fragment, local); + transition_in(simplecollapsible.$$.fragment, local); current = true; }, o: function outro(local) { @@ -56166,12 +60410,10 @@ var app = (function () { transition_out(each_blocks[i]); } - transition_out(if_block); + transition_out(if_block0); + transition_out(if_block1); transition_out(movingdotstats.$$.fragment, local); - transition_out(fighttest.$$.fragment, local); - transition_out(modaltest.$$.fragment, local); - transition_out(findtest.$$.fragment, local); - transition_out(ordertest.$$.fragment, local); + transition_out(simplecollapsible.$$.fragment, local); current = false; }, d: function destroy(detaching) { @@ -56182,35 +60424,24 @@ var app = (function () { destroy_component(dotgamethememanager, detaching); if (detaching) detach_dev(t2); if (detaching) detach_dev(div1); - /*canvas_1_binding*/ ctx[19](null); - /*movingdot_binding*/ ctx[20](null); + /*canvas_1_binding*/ ctx[21](null); + /*movingdot_binding*/ ctx[22](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 (detaching) detach_dev(t12); - destroy_component(movingdotstats, detaching); + if (if_block0) if_block0.d(); + if (if_block1) if_block1.d(); if (detaching) detach_dev(t13); - if (detaching) detach_dev(h10); - if (detaching) detach_dev(t15); - if (detaching) detach_dev(hr); + destroy_component(movingdotstats, detaching); + if (detaching) detach_dev(t14); + if (detaching) detach_dev(h1); if (detaching) detach_dev(t16); - if (detaching) detach_dev(h11); - if (detaching) detach_dev(t18); - destroy_component(fighttest, detaching); - if (detaching) detach_dev(t19); - destroy_component(modaltest, detaching); - if (detaching) detach_dev(t20); - if (detaching) detach_dev(h12); - if (detaching) detach_dev(t22); - destroy_component(findtest, detaching); - if (detaching) detach_dev(t23); - if (detaching) detach_dev(h13); - if (detaching) detach_dev(t25); - destroy_component(ordertest, detaching); + if (detaching) detach_dev(hr); + if (detaching) detach_dev(t17); + destroy_component(simplecollapsible, detaching); mounted = false; run_all(dispose); } @@ -56218,7 +60449,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$b.name, + id: create_fragment$a.name, type: "component", source: "", ctx @@ -56227,11 +60458,11 @@ var app = (function () { return block; } - function instance$b($$self, $$props, $$invalidate) { + function instance$a($$self, $$props, $$invalidate) { let $dotPosition; let $targets; validate_store(targets, 'targets'); - component_subscribe($$self, targets, $$value => $$invalidate(10, $targets = $$value)); + component_subscribe($$self, targets, $$value => $$invalidate(12, $targets = $$value)); let { $$slots: slots = {}, $$scope } = $$props; validate_slots('MovingDotSpacePortfromReact', slots, []); let ChangedContentPlaceholdertoSend = "No changes"; @@ -56241,11 +60472,13 @@ var app = (function () { component_subscribe($$self, dotPosition, value => $$invalidate(0, $dotPosition = value)); let boundaries = { maxX: 1835, maxY: 890, minX: 0, minY: 0 }; let isModalOpen = false; + let isSMModalOpen = false; let currentcollisiontitletext; let currentcollisiontext; let currentcollisionitems = []; let movingDotElement; - let currentTheme = 'Medieval Fantasy'; // default theme + let currentstatemodalstates; + let currentTheme = 'Default'; // default theme let currentThemeStage = 0; let themeKeys = Object.keys(themes); let CurrentGameBackground = themes[currentTheme].background; //GameBackgrounds[0].url; @@ -56258,6 +60491,9 @@ var app = (function () { ...themes[currentTheme].story[0].targets ]); + themeactions.set(themes[currentTheme].actions); + + //$: console.log($themeactions) // objectives.set(themes[currentTheme].objectives); // targets.set(themes[currentTheme].storyparttargets[0]) // function changeTheme(event) { @@ -56272,12 +60508,13 @@ var app = (function () { // ChangedContentPlaceholdertoSend = "TODO is all other variables to change" // } function changeTheme(event) { - $$invalidate(8, currentTheme = event.target.value); + $$invalidate(10, currentTheme = event.target.value); console.log(currentTheme); const theme = themes[currentTheme]; console.log(theme); inventory.set(theme.inventory); skills.set(theme.skills); + themeactions.set(themes.actions); currentThemeStage = 0; const initialStory = theme.story.find(part => part.part === 0); @@ -56297,7 +60534,7 @@ var app = (function () { targets.set([...theme.persistentTargets]); } - $$invalidate(9, CurrentGameBackground = theme.background); + $$invalidate(11, CurrentGameBackground = theme.background); $$invalidate(1, ChangedContentPlaceholdertoSend = "TODO is all other variables to change"); } @@ -56308,6 +60545,7 @@ var app = (function () { function handleModalClose() { $$invalidate(3, isModalOpen = false); + $$invalidate(4, isSMModalOpen = false); movingDotElement.focusDot(); } @@ -56326,6 +60564,11 @@ var app = (function () { // Handle collision based on the target object const handleCollision = target => { + if (target.subtargets) { + alert("Subtargets found. Can be used as discovered locations or just splitting one target into a self contained set of targets. (variable logged in console)"); + console.log(target.subtargets); + } //eventually use to temporarily act as the all targets in the map which can each all have smmodals + switch (target.collisionType) { case "": console.log("Nothing Happenedddd"); @@ -56342,9 +60585,18 @@ var app = (function () { break; case "modal": $$invalidate(3, isModalOpen = true); - $$invalidate(4, currentcollisiontitletext = target.modalConfig.title); - $$invalidate(5, currentcollisiontext = target.modalConfig.content); - $$invalidate(6, currentcollisionitems = target.modalConfig.actions); + $$invalidate(5, currentcollisiontitletext = target.modalConfig.title); + $$invalidate(6, currentcollisiontext = target.modalConfig.content); + $$invalidate(7, currentcollisionitems = target.modalConfig.actions); + break; + case "smmodal": + $$invalidate(4, isSMModalOpen = true); + console.log('smmodal'); + console.log(target.modalStates); + $$invalidate(9, currentstatemodalstates = target.modalStates); + //currentcollisiontitletext = target.modalConfig.title; + //currentcollisiontext = target.modalConfig.content; + //currentcollisionitems = target.modalConfig.actions; break; case "storypartchange": currentThemeStage = target.transitionToPart; @@ -56375,13 +60627,13 @@ var app = (function () { const writable_props = []; Object_1$2.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$7.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 select_change_handler() { currentTheme = select_value(this); - $$invalidate(8, currentTheme); - $$invalidate(13, themeKeys); + $$invalidate(10, currentTheme); + $$invalidate(15, themeKeys); } function canvas_1_binding($$value) { @@ -56394,7 +60646,7 @@ var app = (function () { function movingdot_binding($$value) { binding_callbacks[$$value ? 'unshift' : 'push'](() => { movingDotElement = $$value; - $$invalidate(7, movingDotElement); + $$invalidate(8, movingDotElement); }); } @@ -56406,26 +60658,31 @@ var app = (function () { MovingDot: MovingDotPortfromReact, Target: MovingDotTargetPortfromReact, Modal: MovingDotSpaceSimpleModal, + SMModal: SimpleStateMachineModal, MovingDotStats: MovingDotStatDisplay, DotGameThemeManager: MovingDotSpaceThemeManager, FightTest: MovingDotSpaceGameFight, ModalTest: MovingDotSpaceModalBrainstorm, FindTest: MovingDotSpaceGameFind, OrderTest: MovingDotSpaceGameOrder, + SimpleCollapsible, themes, inventory, skills, objectives, targets, + themeactions, ChangedContentPlaceholdertoSend, canvas, dotPosition, boundaries, isModalOpen, + isSMModalOpen, currentcollisiontitletext, currentcollisiontext, currentcollisionitems, movingDotElement, + currentstatemodalstates, currentTheme, currentThemeStage, themeKeys, @@ -56443,17 +60700,19 @@ var app = (function () { $$self.$inject_state = $$props => { if ('ChangedContentPlaceholdertoSend' in $$props) $$invalidate(1, ChangedContentPlaceholdertoSend = $$props.ChangedContentPlaceholdertoSend); if ('canvas' in $$props) $$invalidate(2, canvas = $$props.canvas); - if ('dotPosition' in $$props) $$invalidate(11, dotPosition = $$props.dotPosition); - if ('boundaries' in $$props) $$invalidate(12, boundaries = $$props.boundaries); + if ('dotPosition' in $$props) $$invalidate(13, dotPosition = $$props.dotPosition); + if ('boundaries' in $$props) $$invalidate(14, boundaries = $$props.boundaries); if ('isModalOpen' in $$props) $$invalidate(3, isModalOpen = $$props.isModalOpen); - if ('currentcollisiontitletext' in $$props) $$invalidate(4, currentcollisiontitletext = $$props.currentcollisiontitletext); - if ('currentcollisiontext' in $$props) $$invalidate(5, currentcollisiontext = $$props.currentcollisiontext); - if ('currentcollisionitems' in $$props) $$invalidate(6, currentcollisionitems = $$props.currentcollisionitems); - if ('movingDotElement' in $$props) $$invalidate(7, movingDotElement = $$props.movingDotElement); - if ('currentTheme' in $$props) $$invalidate(8, currentTheme = $$props.currentTheme); + if ('isSMModalOpen' in $$props) $$invalidate(4, isSMModalOpen = $$props.isSMModalOpen); + if ('currentcollisiontitletext' in $$props) $$invalidate(5, currentcollisiontitletext = $$props.currentcollisiontitletext); + if ('currentcollisiontext' in $$props) $$invalidate(6, currentcollisiontext = $$props.currentcollisiontext); + if ('currentcollisionitems' in $$props) $$invalidate(7, currentcollisionitems = $$props.currentcollisionitems); + if ('movingDotElement' in $$props) $$invalidate(8, movingDotElement = $$props.movingDotElement); + if ('currentstatemodalstates' in $$props) $$invalidate(9, currentstatemodalstates = $$props.currentstatemodalstates); + if ('currentTheme' in $$props) $$invalidate(10, currentTheme = $$props.currentTheme); if ('currentThemeStage' in $$props) currentThemeStage = $$props.currentThemeStage; - if ('themeKeys' in $$props) $$invalidate(13, themeKeys = $$props.themeKeys); - if ('CurrentGameBackground' in $$props) $$invalidate(9, CurrentGameBackground = $$props.CurrentGameBackground); + if ('themeKeys' in $$props) $$invalidate(15, themeKeys = $$props.themeKeys); + if ('CurrentGameBackground' in $$props) $$invalidate(11, CurrentGameBackground = $$props.CurrentGameBackground); }; if ($$props && "$$inject" in $$props) { @@ -56461,7 +60720,7 @@ var app = (function () { } $$self.$$.update = () => { - if ($$self.$$.dirty & /*$dotPosition*/ 1) { + if ($$self.$$.dirty[0] & /*$dotPosition*/ 1) { // document.body.style.backgroundColor = target.color; // break; // Play a sound effect. You'll need to pre-load these sounds. @@ -56513,10 +60772,12 @@ var app = (function () { ChangedContentPlaceholdertoSend, canvas, isModalOpen, + isSMModalOpen, currentcollisiontitletext, currentcollisiontext, currentcollisionitems, movingDotElement, + currentstatemodalstates, currentTheme, CurrentGameBackground, $targets, @@ -56537,40 +60798,41 @@ var app = (function () { class MovingDotSpacePortfromReact extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$b, create_fragment$b, safe_not_equal, {}); + init(this, options, instance$a, create_fragment$a, safe_not_equal, {}, null, [-1, -1]); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "MovingDotSpacePortfromReact", options, - id: create_fragment$b.name + id: create_fragment$a.name }); } } /* src\YoutubeIframeAPICustomInterface.svelte generated by Svelte v3.59.2 */ - const { console: console_1$6 } = globals; - const file$a = "src\\YoutubeIframeAPICustomInterface.svelte"; + const { console: console_1$5 } = globals; + + const file$9 = "src\\YoutubeIframeAPICustomInterface.svelte"; - function get_each_context$8(ctx, list, i) { + function get_each_context$7(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[64] = list[i]; - child_ctx[66] = i; + child_ctx[76] = list[i]; + child_ctx[78] = i; return child_ctx; } - // (384:8) {#each YTIDitems as item, index} - function create_each_block$8(ctx) { + // (518:8) {#each YTIDitems as item, index} + function create_each_block$7(ctx) { let button; - let t0_value = /*item*/ ctx[64] + ""; + let t0_value = /*item*/ ctx[76] + ""; let t0; let t1; let mounted; let dispose; function click_handler() { - return /*click_handler*/ ctx[38](/*index*/ ctx[66]); + return /*click_handler*/ ctx[43](/*index*/ ctx[78]); } const block = { @@ -56578,7 +60840,7 @@ var app = (function () { button = element("button"); t0 = text(t0_value); t1 = space(); - add_location(button, file$a, 384, 12, 13306); + add_location(button, file$9, 518, 12, 18828); }, m: function mount(target, anchor) { insert_dev(target, button, anchor); @@ -56592,7 +60854,7 @@ var app = (function () { }, p: function update(new_ctx, dirty) { ctx = new_ctx; - if (dirty[0] & /*YTIDitems*/ 65536 && t0_value !== (t0_value = /*item*/ ctx[64] + "")) set_data_dev(t0, t0_value); + if (dirty[0] & /*YTIDitems*/ 65536 && t0_value !== (t0_value = /*item*/ ctx[76] + "")) set_data_dev(t0, t0_value); }, d: function destroy(detaching) { if (detaching) detach_dev(button); @@ -56603,124 +60865,165 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$8.name, + id: create_each_block$7.name, type: "each", - source: "(384:8) {#each YTIDitems as item, index}", + source: "(518:8) {#each YTIDitems as item, index}", ctx }); return block; } - function create_fragment$a(ctx) { - let h1; + function create_fragment$9(ctx) { + let h10; let t1; - let div1; - let label; - let br0; + let h20; let t3; - let input0; + let h3; let t4; - let button0; + let b; let t6; - let button1; + let h11; + let t7; let t8; - let br1; let t9; - let textarea0; - let br2; - let t10; - let div0; + let div1; + let label; + let br0; let t11; - let div2; - let input1; + let input0; let t12; - let input2; - let t13; - let textarea1; + let button0; let t14; - let button2; + let button1; let t16; - let pre; + let br1; let t17; + let textarea0; + let br2; let t18; - let div6; - let div3; + let div0; let t19; - let div4; + let div2; + let input1; let t20; - let t21_value = /*currentTime*/ ctx[4].toFixed(2) + ""; + let input2; let t21; + let textarea1; let t22; - let t23; - let div5; + let button2; let t24; + let pre; let t25; - let br3; let t26; + let div7; + let div3; let t27; + let div4; let t28; - let div7; + let t29_value = /*currentTime*/ ctx[4].toFixed(2) + ""; + let t29; let t30; - let button3; + let t31; + let div5; + let t32; + let t33; + let br3; let t34; - let button4; + let t35; + let t36; + let br4; + let t37; + let div6; let t38; let t39; let t40; - let t41_value = /*timestamps*/ ctx[11].length + ""; + let div8; let t41; let t42; - let br4; let t43; - let button5; + let br5; + let t44; + let input3; let t45; - let button6; - let t46; - let button6_class_value; - let button6_disabled_value; + let button3; let t47; - let button7; let t48; - let button7_class_value; - let button7_disabled_value; let t49; - let button8; - let t50; - let button8_class_value; - let button8_disabled_value; + let button4; let t51; + let textarea2; let t52; - let t53; - let t54_value = /*userTimestamps*/ ctx[1].length + ""; - let t54; - let t55; - let br5; + let button5; let t56; - let t57; - let t58; - let t59_value = /*r2userTimestamps*/ ctx[12].length + ""; - let t59; + let button6; let t60; - let br6; let t61; - let br7; let t62; - let button9; + let t63_value = /*timestamps*/ ctx[11].length + ""; + let t63; let t64; - let button10; - let t66; - let input3; + let br6; + let t65; + let button7; let t67; - let br8; + let button8; let t68; - let input4; + let button8_class_value; + let button8_disabled_value; let t69; - let input5; + let button9; let t70; - let input6; + let button9_class_value; + let button9_disabled_value; let t71; + let button10; + let t72; + let button10_class_value; + let button10_disabled_value; + let t73; + let t74; + let t75; + let t76_value = /*userTimestamps*/ ctx[1].length + ""; + let t76; + let t77; + let br7; + let t78; + let t79; + let t80; + let t81_value = /*r2userTimestamps*/ ctx[12].length + ""; + let t81; + let t82; + let br8; + let t83; + let br9; + let t84; + let button11; + let t86; + let button12; + let t88; + let input4; + let t89; + let br10; + let t90; + let input5; + let t91; + let input6; + let t92; let input7; + let t93; + let input8; + let t94; + let div9; + let h21; + let t96; + let h22; + let t98; + let hr; + let t99; + let div10; + let t100; + let br11; let mounted; let dispose; let each_value = /*YTIDitems*/ ctx[16]; @@ -56728,233 +61031,318 @@ var app = (function () { let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$8(get_each_context$8(ctx, each_value, i)); + each_blocks[i] = create_each_block$7(get_each_context$7(ctx, each_value, i)); } const block = { c: function create() { - h1 = element("h1"); - h1.textContent = "Custom Youtube Player for learning Video and music"; + h10 = element("h1"); + h10.textContent = "Custom Youtube Player for learning Video and music"; t1 = space(); + h20 = element("h2"); + h20.textContent = "Next Step for social media is to build in education blocks eg. App lets you watch next short uninterrupted if you get answer right, app forces you to see the correction as overlay if you get it wrong"; + t3 = space(); + h3 = element("h3"); + t4 = text("End Goal is special subtitles - Nouns Verbs and images of them in sync with video AND "); + b = element("b"); + b.textContent = "NB NB NB random repitition of items over video Reading as you watch any video NB NB NB"; + t6 = space(); + h11 = element("h1"); + t7 = text("Debug subs = "); + t8 = text(/*$ytsubcurrenttext*/ ctx[22]); + t9 = space(); div1 = element("div"); label = element("label"); label.textContent = "Manage Multiple Videos"; br0 = element("br"); - t3 = text("\r\n Import "); + t11 = text("\r\n Import "); input0 = element("input"); - t4 = space(); + t12 = space(); button0 = element("button"); button0.textContent = "Add Items"; - t6 = space(); + t14 = space(); button1 = element("button"); button1.textContent = "Download List as Text File"; - t8 = space(); + t16 = space(); br1 = element("br"); - t9 = space(); + t17 = space(); textarea0 = element("textarea"); br2 = element("br"); - t10 = space(); + t18 = space(); div0 = element("div"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - t11 = space(); + t19 = space(); div2 = element("div"); input1 = element("input"); - t12 = text("\r\n Start/Stop Word Update (Dummy Transcript as default)\r\n "); + t20 = text("\r\n Start/Stop Word Update (Dummy Transcript as default)\r\n "); input2 = element("input"); - t13 = space(); + t21 = space(); textarea1 = element("textarea"); - t14 = space(); + t22 = space(); button2 = element("button"); - button2.textContent = "Convert to JSON"; - t16 = space(); + button2.textContent = "Convert YT Transcript to JSON Test"; + t24 = space(); pre = element("pre"); - t17 = text(/*jsonOutput*/ ctx[6]); - t18 = space(); - div6 = element("div"); + t25 = text(/*jsonOutput*/ ctx[6]); + t26 = space(); + div7 = element("div"); div3 = element("div"); - t19 = space(); + t27 = space(); div4 = element("div"); - t20 = text("Current Time: "); - t21 = text(t21_value); - t22 = text(" seconds"); - t23 = space(); + t28 = text("Current Time: "); + t29 = text(t29_value); + t30 = text(" seconds"); + t31 = space(); div5 = element("div"); - t24 = text(/*line*/ ctx[8]); - t25 = space(); + t32 = text(/*line*/ ctx[8]); + t33 = space(); br3 = element("br"); - t26 = space(); - t27 = text(/*currentWord*/ ctx[7]); - t28 = space(); - div7 = element("div"); - div7.textContent = "Placeholder for incomplete idea of image subtitle - each word or each noun in the sentence as collage (Dall-E 3) or sentence meaning as an image"; - t30 = space(); - button3 = element("button"); - button3.textContent = `Previous Auto Timestamp - ${/*interval*/ ctx[21]}s`; t34 = space(); - button4 = element("button"); - button4.textContent = `Next Auto Timestamp - ${/*interval*/ ctx[21]}s`; - t38 = text("\r\nAuto Timestamps: "); - t39 = text(/*currentIndex*/ ctx[10]); - t40 = text(" / "); - t41 = text(t41_value); - t42 = space(); + t35 = text(/*currentWord*/ ctx[7]); + t36 = space(); br4 = element("br"); - t43 = space(); - button5 = element("button"); - button5.textContent = "Add Timestamp"; + t37 = space(); + div6 = element("div"); + t38 = text("Debug subs (Hide = '') = "); + t39 = text(/*$ytsubcurrenttext*/ ctx[22]); + t40 = space(); + div8 = element("div"); + t41 = text("Note Taking Section based on auto gen timestamp (currently "); + t42 = text(/*interval*/ ctx[23]); + t43 = text(") (caution - all changes saved) --- "); + br5 = element("br"); + t44 = space(); + input3 = element("input"); t45 = space(); + button3 = element("button"); + button3.textContent = "create note Segments"; + t47 = text(" | Current index of Note: "); + t48 = text(/*currentIndex*/ ctx[10]); + t49 = text(" | "); + button4 = element("button"); + button4.textContent = "Save Notes to File"; + t51 = text(" Overlay notes on screen check box | AI analysis generate button |\r\n "); + textarea2 = element("textarea"); + t52 = space(); + button5 = element("button"); + button5.textContent = `Previous Auto Timestamp - ${/*interval*/ ctx[23]}s`; + t56 = space(); button6 = element("button"); - t46 = text("Current User Timestamp (incomplete)"); - t47 = space(); + button6.textContent = `Next Auto Timestamp - ${/*interval*/ ctx[23]}s`; + t60 = text("\r\nAuto Timestamps: "); + t61 = text(/*currentIndex*/ ctx[10]); + t62 = text(" / "); + t63 = text(t63_value); + t64 = space(); + br6 = element("br"); + t65 = space(); button7 = element("button"); - t48 = text("Previous User Timestamp"); - t49 = space(); + button7.textContent = "Add Timestamp"; + t67 = space(); button8 = element("button"); - t50 = text("Next User Timestamp"); - t51 = text("\r\nUser Timestamps: "); - t52 = text(/*currentuserIndex*/ ctx[0]); - t53 = text(" / "); - t54 = text(t54_value); - t55 = space(); - br5 = element("br"); - t56 = text(" Round 2 (/n) User Timestamps: "); - t57 = text(/*currentuserIndex*/ ctx[0]); - t58 = text(" / "); - t59 = text(t59_value); - t60 = space(); - br6 = element("br"); - t61 = text("A list of one messes up the logic for the counter in conjuction with the user timestamp button reactivity "); - br7 = element("br"); - t62 = space(); + t68 = text("Current User Timestamp (incomplete)"); + t69 = space(); button9 = element("button"); - button9.textContent = "Export Timestamps"; - t64 = space(); + t70 = text("Previous User Timestamp"); + t71 = space(); button10 = element("button"); - button10.textContent = "Export Round 2 Timestamps"; - t66 = text(" Import Timestamps (Incomplete) "); - input3 = element("input"); - t67 = space(); + t72 = text("Next User Timestamp"); + t73 = text("\r\nUser Timestamps: "); + t74 = text(/*currentuserIndex*/ ctx[0]); + t75 = text(" / "); + t76 = text(t76_value); + t77 = space(); + br7 = element("br"); + t78 = text(" Round 2 (/n) User Timestamps: "); + t79 = text(/*currentuserIndex*/ ctx[0]); + t80 = text(" / "); + t81 = text(t81_value); + t82 = space(); br8 = element("br"); - t68 = text(" Interval Repeat "); + t83 = text("A list of one messes up the logic for the counter in conjuction with the user timestamp button reactivity "); + br9 = element("br"); + t84 = space(); + button11 = element("button"); + button11.textContent = "Export Timestamps"; + t86 = space(); + button12 = element("button"); + button12.textContent = "Export Round 2 Timestamps"; + t88 = text(" Import Timestamps (Incomplete) "); input4 = element("input"); - t69 = text(" ||| Start "); + t89 = space(); + br10 = element("br"); + t90 = text(" Interval Repeat "); input5 = element("input"); - t70 = text(" End "); + t91 = text(" ||| Start "); input6 = element("input"); - t71 = text(" Reps "); + t92 = text(" End "); input7 = element("input"); - add_location(h1, file$a, 374, 0, 12750); + t93 = text(" Reps "); + input8 = element("input"); + t94 = space(); + div9 = element("div"); + h21 = element("h2"); + h21.textContent = "Anticipation Training? -- Verbs in subtitle order known before interval repitition?"; + t96 = space(); + h22 = element("h2"); + h22.textContent = "Stateful Video - Reverse Interval Repeat aka parts of the video you know == Autoskip sections"; + t98 = space(); + hr = element("hr"); + t99 = space(); + div10 = element("div"); + t100 = text("Skip Interval Button sections\r\n "); + br11 = element("br"); + add_location(h10, file$9, 504, 0, 17783); + add_location(h20, file$9, 505, 0, 17844); + add_location(b, file$9, 506, 90, 18144); + add_location(h3, file$9, 506, 0, 18054); + add_location(h11, file$9, 508, 0, 18246); attr_dev(label, "for", "ytid-input"); - add_location(label, file$a, 377, 4, 12824); - add_location(br0, file$a, 377, 58, 12878); + add_location(label, file$9, 511, 4, 18304); + add_location(br0, file$9, 511, 58, 18358); attr_dev(input0, "type", "file"); attr_dev(input0, "id", "file-import"); - add_location(input0, file$a, 378, 11, 12895); - add_location(button0, file$a, 379, 4, 12972); - add_location(button1, file$a, 380, 4, 13028); - add_location(br1, file$a, 380, 76, 13100); + add_location(input0, file$9, 512, 11, 18375); + add_location(button0, file$9, 513, 4, 18452); + add_location(button1, file$9, 514, 4, 18508); + add_location(br1, file$9, 514, 76, 18580); attr_dev(textarea0, "id", "ytid-input"); attr_dev(textarea0, "rows", "4"); - attr_dev(textarea0, "placeholder", "Add multiple items separated by new lines"); - add_location(textarea0, file$a, 381, 4, 13110); - add_location(br2, file$a, 381, 129, 13235); - add_location(div0, file$a, 382, 4, 13245); - add_location(div1, file$a, 376, 0, 12813); + set_style(textarea0, "width", "35%"); + attr_dev(textarea0, "placeholder", "Add multiple Youtube IDs separated by new lines to make buttons"); + add_location(textarea0, file$9, 515, 4, 18590); + add_location(br2, file$9, 515, 171, 18757); + add_location(div0, file$9, 516, 4, 18767); + add_location(div1, file$9, 510, 0, 18293); attr_dev(input1, "type", "text"); - add_location(input1, file$a, 393, 4, 13452); + add_location(input1, file$9, 527, 4, 18974); attr_dev(input2, "type", "checkbox"); - add_location(input2, file$a, 395, 4, 13563); + add_location(input2, file$9, 529, 4, 19086); attr_dev(textarea1, "placeholder", "Enter transcript here..."); - add_location(textarea1, file$a, 400, 4, 13886); - add_location(button2, file$a, 401, 4, 13976); + add_location(textarea1, file$9, 534, 4, 19409); + add_location(button2, file$9, 535, 4, 19499); attr_dev(pre, "class", "transcriptpre svelte-udvqea"); - add_location(pre, file$a, 402, 4, 14042); - add_location(div2, file$a, 392, 0, 13441); + add_location(pre, file$9, 536, 4, 19584); + add_location(div2, file$9, 526, 0, 18963); attr_dev(div3, "id", "youtube-player"); set_style(div3, "height", "90vh"); set_style(div3, "width", "90%"); - add_location(div3, file$a, 406, 4, 14138); + add_location(div3, file$9, 540, 4, 19680); set_style(div4, "position", "absolute"); set_style(div4, "top", "0%"); set_style(div4, "left", "40%"); set_style(div4, "color", "white"); set_style(div4, "background-color", "rgba(0, 0, 0, 0.5)"); - add_location(div4, file$a, 407, 4, 14208); - add_location(br3, file$a, 411, 15, 14528); + add_location(div4, file$9, 541, 4, 19750); + add_location(br3, file$9, 545, 15, 20070); + add_location(br4, file$9, 546, 22, 20098); set_style(div5, "position", "absolute"); set_style(div5, "top", "50%"); set_style(div5, "left", "20%"); set_style(div5, "color", "white"); set_style(div5, "background-color", "rgba(0, 0, 0, 0.5)"); set_style(div5, "font-size", "100px"); - add_location(div5, file$a, 410, 4, 14387); - set_style(div6, "position", "relative"); - add_location(div6, file$a, 405, 0, 14099); - attr_dev(div7, "class", "imagesubtitle svelte-udvqea"); - add_location(div7, file$a, 415, 0, 14577); - add_location(button3, file$a, 420, 0, 14841); - add_location(button4, file$a, 421, 0, 14934); - add_location(br4, file$a, 424, 0, 15076); - add_location(button5, file$a, 425, 0, 15082); - attr_dev(button6, "class", button6_class_value = "" + (null_to_empty(/*currentindexButtonClass*/ ctx[18]) + " svelte-udvqea")); - button6.disabled = button6_disabled_value = /*currentuserIndex*/ ctx[0] <= 0; - add_location(button6, file$a, 426, 0, 15142); - attr_dev(button7, "class", button7_class_value = "" + (null_to_empty(/*previousindexButtonClass*/ ctx[19]) + " svelte-udvqea")); - button7.disabled = button7_disabled_value = /*currentuserIndex*/ ctx[0] <= 0; - add_location(button7, file$a, 427, 0, 15297); - attr_dev(button8, "class", button8_class_value = "" + (null_to_empty(/*nextindexButtonClass*/ ctx[20]) + " svelte-udvqea")); - button8.disabled = button8_disabled_value = /*currentuserIndex*/ ctx[0] >= /*userTimestamps*/ ctx[1].length - 1; - add_location(button8, file$a, 428, 0, 15442); - add_location(br5, file$a, 431, 0, 15665); - add_location(br6, file$a, 431, 82, 15747); - add_location(br7, file$a, 431, 192, 15857); - add_location(button9, file$a, 432, 0, 15863); - add_location(button10, file$a, 432, 63, 15926); + add_location(div5, file$9, 544, 4, 19929); + set_style(div6, "position", "absolute"); + set_style(div6, "top", "25%"); + set_style(div6, "left", "30%"); + set_style(div6, "color", "white"); + set_style(div6, "background-color", "rgba(0, 0, 0, 0.5)"); + set_style(div6, "font-size", "100px"); + add_location(div6, file$9, 548, 4, 20120); + set_style(div7, "position", "relative"); + add_location(div7, file$9, 539, 0, 19641); + add_location(br5, file$9, 554, 109, 20441); attr_dev(input3, "type", "file"); - attr_dev(input3, "accept", ".json"); - add_location(input3, file$a, 432, 167, 16030); - add_location(br8, file$a, 433, 0, 16095); - attr_dev(input4, "type", "checkbox"); - add_location(input4, file$a, 433, 21, 16116); - attr_dev(input5, "type", "number"); - attr_dev(input5, "class", "numberinput svelte-udvqea"); - attr_dev(input5, "min", "0"); - add_location(input5, file$a, 433, 82, 16177); + add_location(input3, file$9, 555, 4, 20451); + add_location(button3, file$9, 555, 59, 20506); + add_location(button4, file$9, 555, 169, 20616); + attr_dev(textarea2, "name", "notesubtitles"); + attr_dev(textarea2, "id", "notestextarea"); + attr_dev(textarea2, "rows", "2"); + set_style(textarea2, "width", "100%"); + add_location(textarea2, file$9, 556, 4, 20758); + add_location(div8, file$9, 553, 0, 20325); + add_location(button5, file$9, 560, 0, 20985); + add_location(button6, file$9, 561, 0, 21078); + add_location(br6, file$9, 564, 0, 21220); + add_location(button7, file$9, 565, 0, 21226); + attr_dev(button8, "class", button8_class_value = "" + (null_to_empty(/*currentindexButtonClass*/ ctx[19]) + " svelte-udvqea")); + button8.disabled = button8_disabled_value = /*currentuserIndex*/ ctx[0] <= 0; + add_location(button8, file$9, 566, 0, 21286); + attr_dev(button9, "class", button9_class_value = "" + (null_to_empty(/*previousindexButtonClass*/ ctx[20]) + " svelte-udvqea")); + button9.disabled = button9_disabled_value = /*currentuserIndex*/ ctx[0] <= 0; + add_location(button9, file$9, 567, 0, 21441); + attr_dev(button10, "class", button10_class_value = "" + (null_to_empty(/*nextindexButtonClass*/ ctx[21]) + " svelte-udvqea")); + button10.disabled = button10_disabled_value = /*currentuserIndex*/ ctx[0] >= /*userTimestamps*/ ctx[1].length - 1; + add_location(button10, file$9, 568, 0, 21586); + add_location(br7, file$9, 571, 0, 21809); + add_location(br8, file$9, 571, 82, 21891); + add_location(br9, file$9, 571, 192, 22001); + add_location(button11, file$9, 572, 0, 22007); + add_location(button12, file$9, 572, 63, 22070); + attr_dev(input4, "type", "file"); + attr_dev(input4, "accept", ".json"); + add_location(input4, file$9, 572, 167, 22174); + add_location(br10, file$9, 573, 0, 22239); + attr_dev(input5, "type", "checkbox"); + add_location(input5, file$9, 573, 21, 22260); attr_dev(input6, "type", "number"); attr_dev(input6, "class", "numberinput svelte-udvqea"); attr_dev(input6, "min", "0"); - add_location(input6, file$a, 433, 162, 16257); + add_location(input6, file$9, 573, 82, 22321); attr_dev(input7, "type", "number"); attr_dev(input7, "class", "numberinput svelte-udvqea"); attr_dev(input7, "min", "0"); - add_location(input7, file$a, 433, 241, 16336); + add_location(input7, file$9, 573, 162, 22401); + attr_dev(input8, "type", "number"); + attr_dev(input8, "class", "numberinput svelte-udvqea"); + attr_dev(input8, "min", "0"); + add_location(input8, file$9, 573, 241, 22480); + add_location(h21, file$9, 577, 4, 22593); + add_location(h22, file$9, 578, 4, 22691); + attr_dev(div9, "class", "imagesubtitle svelte-udvqea"); + add_location(div9, file$9, 576, 0, 22560); + add_location(hr, file$9, 582, 0, 22807); + add_location(br11, file$9, 585, 4, 22859); + add_location(div10, file$9, 583, 0, 22813); }, 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, h1, anchor); + insert_dev(target, h10, anchor); insert_dev(target, t1, anchor); + insert_dev(target, h20, anchor); + insert_dev(target, t3, anchor); + insert_dev(target, h3, anchor); + append_dev(h3, t4); + append_dev(h3, b); + insert_dev(target, t6, anchor); + insert_dev(target, h11, anchor); + append_dev(h11, t7); + append_dev(h11, t8); + insert_dev(target, t9, anchor); insert_dev(target, div1, anchor); append_dev(div1, label); append_dev(div1, br0); - append_dev(div1, t3); + append_dev(div1, t11); append_dev(div1, input0); - append_dev(div1, t4); + append_dev(div1, t12); append_dev(div1, button0); - append_dev(div1, t6); + append_dev(div1, t14); append_dev(div1, button1); - append_dev(div1, t8); + append_dev(div1, t16); append_dev(div1, br1); - append_dev(div1, t9); + append_dev(div1, t17); append_dev(div1, textarea0); set_input_value(textarea0, /*YTIDinput*/ ctx[17]); append_dev(div1, br2); - append_dev(div1, t10); + append_dev(div1, t18); append_dev(div1, div0); for (let i = 0; i < each_blocks.length; i += 1) { @@ -56963,140 +61351,178 @@ var app = (function () { } } - insert_dev(target, t11, anchor); + insert_dev(target, t19, anchor); insert_dev(target, div2, anchor); append_dev(div2, input1); - set_input_value(input1, /*currentvideoId*/ ctx[2]); - append_dev(div2, t12); + set_input_value(input1, /*$ytsubcurrentID*/ ctx[3]); + append_dev(div2, t20); append_dev(div2, input2); input2.checked = /*isUpdating*/ ctx[9]; - append_dev(div2, t13); + append_dev(div2, t21); append_dev(div2, textarea1); set_input_value(textarea1, /*transcript*/ ctx[5]); - append_dev(div2, t14); + append_dev(div2, t22); append_dev(div2, button2); - append_dev(div2, t16); + append_dev(div2, t24); append_dev(div2, pre); - append_dev(pre, t17); - insert_dev(target, t18, anchor); - insert_dev(target, div6, anchor); - append_dev(div6, div3); - append_dev(div6, t19); - append_dev(div6, div4); - append_dev(div4, t20); - append_dev(div4, t21); - append_dev(div4, t22); - append_dev(div6, t23); - append_dev(div6, div5); - append_dev(div5, t24); - append_dev(div5, t25); - append_dev(div5, br3); - append_dev(div5, t26); - append_dev(div5, t27); - insert_dev(target, t28, anchor); + append_dev(pre, t25); + insert_dev(target, t26, anchor); insert_dev(target, div7, anchor); - insert_dev(target, t30, anchor); - insert_dev(target, button3, anchor); - insert_dev(target, t34, anchor); - insert_dev(target, button4, anchor); - insert_dev(target, t38, anchor); - insert_dev(target, t39, anchor); + append_dev(div7, div3); + append_dev(div7, t27); + append_dev(div7, div4); + append_dev(div4, t28); + append_dev(div4, t29); + append_dev(div4, t30); + append_dev(div7, t31); + append_dev(div7, div5); + append_dev(div5, t32); + append_dev(div5, t33); + append_dev(div5, br3); + append_dev(div5, t34); + append_dev(div5, t35); + append_dev(div5, t36); + append_dev(div5, br4); + append_dev(div7, t37); + append_dev(div7, div6); + append_dev(div6, t38); + append_dev(div6, t39); insert_dev(target, t40, anchor); - insert_dev(target, t41, anchor); - insert_dev(target, t42, anchor); - insert_dev(target, br4, anchor); - insert_dev(target, t43, anchor); - insert_dev(target, button5, anchor); - insert_dev(target, t45, anchor); - insert_dev(target, button6, anchor); - append_dev(button6, t46); - insert_dev(target, t47, anchor); - insert_dev(target, button7, anchor); - append_dev(button7, t48); - insert_dev(target, t49, anchor); - insert_dev(target, button8, anchor); - append_dev(button8, t50); - insert_dev(target, t51, anchor); + insert_dev(target, div8, anchor); + append_dev(div8, t41); + append_dev(div8, t42); + append_dev(div8, t43); + append_dev(div8, br5); + append_dev(div8, t44); + append_dev(div8, input3); + append_dev(div8, t45); + append_dev(div8, button3); + append_dev(div8, t47); + append_dev(div8, t48); + append_dev(div8, t49); + append_dev(div8, button4); + append_dev(div8, t51); + append_dev(div8, textarea2); + set_input_value(textarea2, /*notesegments*/ ctx[18][/*currentIndex*/ ctx[10]]['notes']); insert_dev(target, t52, anchor); - insert_dev(target, t53, anchor); - insert_dev(target, t54, anchor); - insert_dev(target, t55, anchor); - insert_dev(target, br5, anchor); + insert_dev(target, button5, anchor); insert_dev(target, t56, anchor); - insert_dev(target, t57, anchor); - insert_dev(target, t58, anchor); - insert_dev(target, t59, anchor); + insert_dev(target, button6, anchor); insert_dev(target, t60, anchor); - insert_dev(target, br6, anchor); insert_dev(target, t61, anchor); - insert_dev(target, br7, anchor); insert_dev(target, t62, anchor); - insert_dev(target, button9, anchor); + insert_dev(target, t63, anchor); insert_dev(target, t64, anchor); - insert_dev(target, button10, anchor); - insert_dev(target, t66, anchor); - insert_dev(target, input3, anchor); + insert_dev(target, br6, anchor); + insert_dev(target, t65, anchor); + insert_dev(target, button7, anchor); insert_dev(target, t67, anchor); + insert_dev(target, button8, anchor); + append_dev(button8, t68); + insert_dev(target, t69, anchor); + insert_dev(target, button9, anchor); + append_dev(button9, t70); + insert_dev(target, t71, anchor); + insert_dev(target, button10, anchor); + append_dev(button10, t72); + insert_dev(target, t73, anchor); + insert_dev(target, t74, anchor); + insert_dev(target, t75, anchor); + insert_dev(target, t76, anchor); + insert_dev(target, t77, anchor); + insert_dev(target, br7, anchor); + insert_dev(target, t78, anchor); + insert_dev(target, t79, anchor); + insert_dev(target, t80, anchor); + insert_dev(target, t81, anchor); + insert_dev(target, t82, anchor); insert_dev(target, br8, anchor); - insert_dev(target, t68, anchor); + insert_dev(target, t83, anchor); + insert_dev(target, br9, anchor); + insert_dev(target, t84, anchor); + insert_dev(target, button11, anchor); + insert_dev(target, t86, anchor); + insert_dev(target, button12, anchor); + insert_dev(target, t88, anchor); insert_dev(target, input4, anchor); - input4.checked = /*isRepeating*/ ctx[3]; - insert_dev(target, t69, anchor); + insert_dev(target, t89, anchor); + insert_dev(target, br10, anchor); + insert_dev(target, t90, anchor); insert_dev(target, input5, anchor); - set_input_value(input5, /*repstartTime*/ ctx[13]); - insert_dev(target, t70, anchor); + input5.checked = /*isRepeating*/ ctx[2]; + insert_dev(target, t91, anchor); insert_dev(target, input6, anchor); - set_input_value(input6, /*rependTime*/ ctx[14]); - insert_dev(target, t71, anchor); + set_input_value(input6, /*repstartTime*/ ctx[13]); + insert_dev(target, t92, anchor); insert_dev(target, input7, anchor); - set_input_value(input7, /*repetitions*/ ctx[15]); + set_input_value(input7, /*rependTime*/ ctx[14]); + insert_dev(target, t93, anchor); + insert_dev(target, input8, anchor); + set_input_value(input8, /*repetitions*/ ctx[15]); + insert_dev(target, t94, anchor); + insert_dev(target, div9, anchor); + append_dev(div9, h21); + append_dev(div9, t96); + append_dev(div9, h22); + insert_dev(target, t98, anchor); + insert_dev(target, hr, anchor); + insert_dev(target, t99, anchor); + insert_dev(target, div10, anchor); + append_dev(div10, t100); + append_dev(div10, br11); if (!mounted) { dispose = [ - listen_dev(input0, "change", /*YTIDhandleFileImport*/ ctx[36], false, false, false, false), - listen_dev(button0, "click", /*YTIDaddItems*/ ctx[33], false, false, false, false), - listen_dev(button1, "click", /*YTIDdownloadList*/ ctx[35], false, false, false, false), - listen_dev(textarea0, "input", /*textarea0_input_handler*/ ctx[37]), - listen_dev(input1, "input", /*input1_input_handler*/ ctx[39]), - listen_dev(input2, "change", /*input2_change_handler*/ ctx[40]), - listen_dev(input2, "click", /*toggleUpdate*/ ctx[22], false, false, false, false), - listen_dev(textarea1, "input", /*textarea1_input_handler*/ ctx[41]), - listen_dev(button2, "click", /*transcriptToJson*/ ctx[32], false, false, false, false), - listen_dev(button3, "click", /*goToPreviousAutoTimestamp*/ ctx[24], false, false, false, false), - listen_dev(button4, "click", /*goToNextAutoTimestamp*/ ctx[23], false, false, false, false), - listen_dev(button5, "click", /*addUserTimestamp*/ ctx[25], false, false, false, false), - listen_dev(button6, "click", /*goToCurrentUserTimestamp*/ ctx[26], false, false, false, false), - listen_dev(button7, "click", /*goToPreviousUserTimestamp*/ ctx[28], false, false, false, false), - listen_dev(button8, "click", /*goToNextUserTimestamp*/ ctx[27], false, false, false, false), - listen_dev(button9, "click", /*exportTimestamps*/ ctx[29], false, false, false, false), - listen_dev(button10, "click", /*exportr2Timestamps*/ ctx[30], false, false, false, false), - listen_dev(input3, "change", /*importTimestamps*/ ctx[31], false, false, false, false), - listen_dev(input4, "change", /*input4_change_handler*/ ctx[42]), - listen_dev(input5, "input", /*input5_input_handler*/ ctx[43]), - listen_dev(input6, "input", /*input6_input_handler*/ ctx[44]), - listen_dev(input7, "input", /*input7_input_handler*/ ctx[45]) + listen_dev(input0, "change", /*YTIDhandleFileImport*/ ctx[39], false, false, false, false), + listen_dev(button0, "click", /*YTIDaddItems*/ ctx[36], false, false, false, false), + listen_dev(button1, "click", /*YTIDdownloadList*/ ctx[38], false, false, false, false), + listen_dev(textarea0, "input", /*textarea0_input_handler*/ ctx[42]), + listen_dev(input1, "input", /*input1_input_handler*/ ctx[44]), + listen_dev(input2, "change", /*input2_change_handler*/ ctx[45]), + listen_dev(input2, "click", /*toggleUpdate*/ ctx[25], false, false, false, false), + listen_dev(textarea1, "input", /*textarea1_input_handler*/ ctx[46]), + listen_dev(button2, "click", /*transcriptToJson*/ ctx[35], false, false, false, false), + listen_dev(input3, "change", /*loadnotesegmentstofile*/ ctx[41], false, false, false, false), + listen_dev(button3, "click", /*createNoteSegments*/ ctx[24], false, false, false, false), + listen_dev(button4, "click", /*savenoteSegmentstofile*/ ctx[40], false, false, false, false), + listen_dev(textarea2, "input", /*textarea2_input_handler*/ ctx[47]), + listen_dev(button5, "click", /*goToPreviousAutoTimestamp*/ ctx[27], false, false, false, false), + listen_dev(button6, "click", /*goToNextAutoTimestamp*/ ctx[26], false, false, false, false), + listen_dev(button7, "click", /*addUserTimestamp*/ ctx[28], false, false, false, false), + listen_dev(button8, "click", /*goToCurrentUserTimestamp*/ ctx[29], false, false, false, false), + listen_dev(button9, "click", /*goToPreviousUserTimestamp*/ ctx[31], false, false, false, false), + listen_dev(button10, "click", /*goToNextUserTimestamp*/ ctx[30], false, false, false, false), + listen_dev(button11, "click", /*exportTimestamps*/ ctx[32], false, false, false, false), + listen_dev(button12, "click", /*exportr2Timestamps*/ ctx[33], false, false, false, false), + listen_dev(input4, "change", /*importTimestamps*/ ctx[34], false, false, false, false), + listen_dev(input5, "change", /*input5_change_handler*/ ctx[48]), + listen_dev(input6, "input", /*input6_input_handler*/ ctx[49]), + listen_dev(input7, "input", /*input7_input_handler*/ ctx[50]), + listen_dev(input8, "input", /*input8_input_handler*/ ctx[51]) ]; mounted = true; } }, p: function update(ctx, dirty) { + if (dirty[0] & /*$ytsubcurrenttext*/ 4194304) set_data_dev(t8, /*$ytsubcurrenttext*/ ctx[22]); + if (dirty[0] & /*YTIDinput*/ 131072) { set_input_value(textarea0, /*YTIDinput*/ ctx[17]); } - if (dirty[0] & /*YTIDitems*/ 65536 | dirty[1] & /*YTIDupdateItem*/ 8) { + if (dirty[0] & /*YTIDitems*/ 65536 | dirty[1] & /*YTIDupdateItem*/ 64) { each_value = /*YTIDitems*/ ctx[16]; validate_each_argument(each_value); let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$8(ctx, each_value, i); + const child_ctx = get_each_context$7(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$8(child_ctx); + each_blocks[i] = create_each_block$7(child_ctx); each_blocks[i].c(); each_blocks[i].m(div0, null); } @@ -57109,8 +61535,8 @@ var app = (function () { each_blocks.length = each_value.length; } - if (dirty[0] & /*currentvideoId*/ 4 && input1.value !== /*currentvideoId*/ ctx[2]) { - set_input_value(input1, /*currentvideoId*/ ctx[2]); + if (dirty[0] & /*$ytsubcurrentID*/ 8 && input1.value !== /*$ytsubcurrentID*/ ctx[3]) { + set_input_value(input1, /*$ytsubcurrentID*/ ctx[3]); } if (dirty[0] & /*isUpdating*/ 512) { @@ -57121,119 +61547,138 @@ var app = (function () { set_input_value(textarea1, /*transcript*/ ctx[5]); } - if (dirty[0] & /*jsonOutput*/ 64) set_data_dev(t17, /*jsonOutput*/ ctx[6]); - if (dirty[0] & /*currentTime*/ 16 && t21_value !== (t21_value = /*currentTime*/ ctx[4].toFixed(2) + "")) set_data_dev(t21, t21_value); - if (dirty[0] & /*line*/ 256) set_data_dev(t24, /*line*/ ctx[8]); - if (dirty[0] & /*currentWord*/ 128) set_data_dev(t27, /*currentWord*/ ctx[7]); - if (dirty[0] & /*currentIndex*/ 1024) set_data_dev(t39, /*currentIndex*/ ctx[10]); - if (dirty[0] & /*timestamps*/ 2048 && t41_value !== (t41_value = /*timestamps*/ ctx[11].length + "")) set_data_dev(t41, t41_value); + if (dirty[0] & /*jsonOutput*/ 64) set_data_dev(t25, /*jsonOutput*/ ctx[6]); + if (dirty[0] & /*currentTime*/ 16 && t29_value !== (t29_value = /*currentTime*/ ctx[4].toFixed(2) + "")) set_data_dev(t29, t29_value); + if (dirty[0] & /*line*/ 256) set_data_dev(t32, /*line*/ ctx[8]); + if (dirty[0] & /*currentWord*/ 128) set_data_dev(t35, /*currentWord*/ ctx[7]); + if (dirty[0] & /*$ytsubcurrenttext*/ 4194304) set_data_dev(t39, /*$ytsubcurrenttext*/ ctx[22]); + if (dirty[0] & /*currentIndex*/ 1024) set_data_dev(t48, /*currentIndex*/ ctx[10]); + + if (dirty[0] & /*notesegments, currentIndex*/ 263168) { + set_input_value(textarea2, /*notesegments*/ ctx[18][/*currentIndex*/ ctx[10]]['notes']); + } + + if (dirty[0] & /*currentIndex*/ 1024) set_data_dev(t61, /*currentIndex*/ ctx[10]); + if (dirty[0] & /*timestamps*/ 2048 && t63_value !== (t63_value = /*timestamps*/ ctx[11].length + "")) set_data_dev(t63, t63_value); - if (dirty[0] & /*currentindexButtonClass*/ 262144 && button6_class_value !== (button6_class_value = "" + (null_to_empty(/*currentindexButtonClass*/ ctx[18]) + " svelte-udvqea"))) { - attr_dev(button6, "class", button6_class_value); + if (dirty[0] & /*currentindexButtonClass*/ 524288 && button8_class_value !== (button8_class_value = "" + (null_to_empty(/*currentindexButtonClass*/ ctx[19]) + " svelte-udvqea"))) { + attr_dev(button8, "class", button8_class_value); } - if (dirty[0] & /*currentuserIndex*/ 1 && button6_disabled_value !== (button6_disabled_value = /*currentuserIndex*/ ctx[0] <= 0)) { - prop_dev(button6, "disabled", button6_disabled_value); + if (dirty[0] & /*currentuserIndex*/ 1 && button8_disabled_value !== (button8_disabled_value = /*currentuserIndex*/ ctx[0] <= 0)) { + prop_dev(button8, "disabled", button8_disabled_value); } - if (dirty[0] & /*previousindexButtonClass*/ 524288 && button7_class_value !== (button7_class_value = "" + (null_to_empty(/*previousindexButtonClass*/ ctx[19]) + " svelte-udvqea"))) { - attr_dev(button7, "class", button7_class_value); + if (dirty[0] & /*previousindexButtonClass*/ 1048576 && button9_class_value !== (button9_class_value = "" + (null_to_empty(/*previousindexButtonClass*/ ctx[20]) + " svelte-udvqea"))) { + attr_dev(button9, "class", button9_class_value); } - if (dirty[0] & /*currentuserIndex*/ 1 && button7_disabled_value !== (button7_disabled_value = /*currentuserIndex*/ ctx[0] <= 0)) { - prop_dev(button7, "disabled", button7_disabled_value); + if (dirty[0] & /*currentuserIndex*/ 1 && button9_disabled_value !== (button9_disabled_value = /*currentuserIndex*/ ctx[0] <= 0)) { + prop_dev(button9, "disabled", button9_disabled_value); } - if (dirty[0] & /*nextindexButtonClass*/ 1048576 && button8_class_value !== (button8_class_value = "" + (null_to_empty(/*nextindexButtonClass*/ ctx[20]) + " svelte-udvqea"))) { - attr_dev(button8, "class", button8_class_value); + if (dirty[0] & /*nextindexButtonClass*/ 2097152 && button10_class_value !== (button10_class_value = "" + (null_to_empty(/*nextindexButtonClass*/ ctx[21]) + " svelte-udvqea"))) { + attr_dev(button10, "class", button10_class_value); } - if (dirty[0] & /*currentuserIndex, userTimestamps*/ 3 && button8_disabled_value !== (button8_disabled_value = /*currentuserIndex*/ ctx[0] >= /*userTimestamps*/ ctx[1].length - 1)) { - prop_dev(button8, "disabled", button8_disabled_value); + if (dirty[0] & /*currentuserIndex, userTimestamps*/ 3 && button10_disabled_value !== (button10_disabled_value = /*currentuserIndex*/ ctx[0] >= /*userTimestamps*/ ctx[1].length - 1)) { + prop_dev(button10, "disabled", button10_disabled_value); } - if (dirty[0] & /*currentuserIndex*/ 1) set_data_dev(t52, /*currentuserIndex*/ ctx[0]); - if (dirty[0] & /*userTimestamps*/ 2 && t54_value !== (t54_value = /*userTimestamps*/ ctx[1].length + "")) set_data_dev(t54, t54_value); - if (dirty[0] & /*currentuserIndex*/ 1) set_data_dev(t57, /*currentuserIndex*/ ctx[0]); - if (dirty[0] & /*r2userTimestamps*/ 4096 && t59_value !== (t59_value = /*r2userTimestamps*/ ctx[12].length + "")) set_data_dev(t59, t59_value); + if (dirty[0] & /*currentuserIndex*/ 1) set_data_dev(t74, /*currentuserIndex*/ ctx[0]); + if (dirty[0] & /*userTimestamps*/ 2 && t76_value !== (t76_value = /*userTimestamps*/ ctx[1].length + "")) set_data_dev(t76, t76_value); + if (dirty[0] & /*currentuserIndex*/ 1) set_data_dev(t79, /*currentuserIndex*/ ctx[0]); + if (dirty[0] & /*r2userTimestamps*/ 4096 && t81_value !== (t81_value = /*r2userTimestamps*/ ctx[12].length + "")) set_data_dev(t81, t81_value); - if (dirty[0] & /*isRepeating*/ 8) { - input4.checked = /*isRepeating*/ ctx[3]; + if (dirty[0] & /*isRepeating*/ 4) { + input5.checked = /*isRepeating*/ ctx[2]; } - if (dirty[0] & /*repstartTime*/ 8192 && to_number(input5.value) !== /*repstartTime*/ ctx[13]) { - set_input_value(input5, /*repstartTime*/ ctx[13]); + if (dirty[0] & /*repstartTime*/ 8192 && to_number(input6.value) !== /*repstartTime*/ ctx[13]) { + set_input_value(input6, /*repstartTime*/ ctx[13]); } - if (dirty[0] & /*rependTime*/ 16384 && to_number(input6.value) !== /*rependTime*/ ctx[14]) { - set_input_value(input6, /*rependTime*/ ctx[14]); + if (dirty[0] & /*rependTime*/ 16384 && to_number(input7.value) !== /*rependTime*/ ctx[14]) { + set_input_value(input7, /*rependTime*/ ctx[14]); } - if (dirty[0] & /*repetitions*/ 32768 && to_number(input7.value) !== /*repetitions*/ ctx[15]) { - set_input_value(input7, /*repetitions*/ ctx[15]); + if (dirty[0] & /*repetitions*/ 32768 && to_number(input8.value) !== /*repetitions*/ ctx[15]) { + set_input_value(input8, /*repetitions*/ ctx[15]); } }, i: noop, o: noop, d: function destroy(detaching) { - if (detaching) detach_dev(h1); + if (detaching) detach_dev(h10); if (detaching) detach_dev(t1); + if (detaching) detach_dev(h20); + if (detaching) detach_dev(t3); + if (detaching) detach_dev(h3); + if (detaching) detach_dev(t6); + if (detaching) detach_dev(h11); + if (detaching) detach_dev(t9); if (detaching) detach_dev(div1); destroy_each(each_blocks, detaching); - if (detaching) detach_dev(t11); + if (detaching) detach_dev(t19); if (detaching) detach_dev(div2); - if (detaching) detach_dev(t18); - if (detaching) detach_dev(div6); - if (detaching) detach_dev(t28); + if (detaching) detach_dev(t26); if (detaching) detach_dev(div7); - if (detaching) detach_dev(t30); - if (detaching) detach_dev(button3); - if (detaching) detach_dev(t34); - if (detaching) detach_dev(button4); - if (detaching) detach_dev(t38); - if (detaching) detach_dev(t39); if (detaching) detach_dev(t40); - if (detaching) detach_dev(t41); - if (detaching) detach_dev(t42); - if (detaching) detach_dev(br4); - if (detaching) detach_dev(t43); - if (detaching) detach_dev(button5); - if (detaching) detach_dev(t45); - if (detaching) detach_dev(button6); - if (detaching) detach_dev(t47); - if (detaching) detach_dev(button7); - if (detaching) detach_dev(t49); - if (detaching) detach_dev(button8); - if (detaching) detach_dev(t51); + if (detaching) detach_dev(div8); if (detaching) detach_dev(t52); - if (detaching) detach_dev(t53); - if (detaching) detach_dev(t54); - if (detaching) detach_dev(t55); - if (detaching) detach_dev(br5); + if (detaching) detach_dev(button5); if (detaching) detach_dev(t56); - if (detaching) detach_dev(t57); - if (detaching) detach_dev(t58); - if (detaching) detach_dev(t59); + if (detaching) detach_dev(button6); if (detaching) detach_dev(t60); - if (detaching) detach_dev(br6); if (detaching) detach_dev(t61); - if (detaching) detach_dev(br7); if (detaching) detach_dev(t62); - if (detaching) detach_dev(button9); + if (detaching) detach_dev(t63); if (detaching) detach_dev(t64); - if (detaching) detach_dev(button10); - if (detaching) detach_dev(t66); - if (detaching) detach_dev(input3); + if (detaching) detach_dev(br6); + if (detaching) detach_dev(t65); + if (detaching) detach_dev(button7); if (detaching) detach_dev(t67); + if (detaching) detach_dev(button8); + if (detaching) detach_dev(t69); + if (detaching) detach_dev(button9); + if (detaching) detach_dev(t71); + if (detaching) detach_dev(button10); + if (detaching) detach_dev(t73); + if (detaching) detach_dev(t74); + if (detaching) detach_dev(t75); + if (detaching) detach_dev(t76); + if (detaching) detach_dev(t77); + if (detaching) detach_dev(br7); + if (detaching) detach_dev(t78); + if (detaching) detach_dev(t79); + if (detaching) detach_dev(t80); + if (detaching) detach_dev(t81); + if (detaching) detach_dev(t82); if (detaching) detach_dev(br8); - if (detaching) detach_dev(t68); + if (detaching) detach_dev(t83); + if (detaching) detach_dev(br9); + if (detaching) detach_dev(t84); + if (detaching) detach_dev(button11); + if (detaching) detach_dev(t86); + if (detaching) detach_dev(button12); + if (detaching) detach_dev(t88); if (detaching) detach_dev(input4); - if (detaching) detach_dev(t69); + if (detaching) detach_dev(t89); + if (detaching) detach_dev(br10); + if (detaching) detach_dev(t90); if (detaching) detach_dev(input5); - if (detaching) detach_dev(t70); + if (detaching) detach_dev(t91); if (detaching) detach_dev(input6); - if (detaching) detach_dev(t71); + if (detaching) detach_dev(t92); if (detaching) detach_dev(input7); + if (detaching) detach_dev(t93); + if (detaching) detach_dev(input8); + if (detaching) detach_dev(t94); + if (detaching) detach_dev(div9); + if (detaching) detach_dev(t98); + if (detaching) detach_dev(hr); + if (detaching) detach_dev(t99); + if (detaching) detach_dev(div10); mounted = false; run_all(dispose); } @@ -57241,7 +61686,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$a.name, + id: create_fragment$9.name, type: "component", source: "", ctx @@ -57255,10 +61700,16 @@ var app = (function () { return words[Math.floor(Math.random() * words.length)]; } - function instance$a($$self, $$props, $$invalidate) { + function instance$9($$self, $$props, $$invalidate) { let nextindexButtonClass; let previousindexButtonClass; let currentindexButtonClass; + let $ytsubcurrentID; + let $ytsubcurrenttext; + validate_store(ytsubcurrentID, 'ytsubcurrentID'); + component_subscribe($$self, ytsubcurrentID, $$value => $$invalidate(3, $ytsubcurrentID = $$value)); + validate_store(ytsubcurrenttext, 'ytsubcurrenttext'); + component_subscribe($$self, ytsubcurrenttext, $$value => $$invalidate(22, $ytsubcurrenttext = $$value)); let { $$slots: slots = {}, $$scope } = $$props; validate_slots('YoutubeIframeAPICustomInterface', slots, []); let player; @@ -57288,8 +61739,10 @@ var app = (function () { let timestamps = []; // Array of timestamps let userTimestamps = []; // Array of user timestamps let r2userTimestamps = []; // Array of user timestamps - let currentvideoId = 'IVJkOHTBPn0'; + + //let currentvideoId = 'IVJkOHTBPn0'; let youTubeApiLoaded = false; + let currentvideoduration; let regeneratedautotimestamps = false; let repstartTime = 10; @@ -57297,6 +61750,21 @@ var app = (function () { let repetitions = 20; let intervalId; let isRepeating = false; + let YTIDitems = ['mwO6v4BlgZQ', 'IVJkOHTBPn0']; + let YTIDinput = ''; + let skipIntervals = []; + let intervalstartTime = 0; + let intervalendTime = 0; + + let notesegments = [ + { start: 0, end: 20, notes: 'Test' }, + { start: 21, end: 40, notes: 'For if' }, + { + start: 41, + end: 60, + notes: 'Correct text loads (Inititalise)' + } + ]; window.onYouTubeIframeAPIReady = function () { youTubeApiLoaded = true; @@ -57317,13 +61785,13 @@ var app = (function () { // Reinitialize player with new video ID if (player) { - player.loadVideoById(currentvideoId); + player.loadVideoById($ytsubcurrentID); } else { player = new YT.Player('youtube-player', { height: '360', width: '640', - videoId: currentvideoId, + videoId: $ytsubcurrentID, events: { 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange @@ -57364,9 +61832,36 @@ var app = (function () { regeneratedautotimestamps = true; } + function createNoteSegments() { + // console.log("Video duration: " + currentvideoduration); + // console.log("Timestamps: " + timestamps); + $$invalidate(18, notesegments = []); // Clear existing segments + + let start = 0; + + timestamps.forEach((end, index) => { + if (index === 0) { + notesegments.push({ start: 0, end, notes: "" }); + } else { + start = timestamps[index - 1] + 1; + notesegments.push({ start, end, notes: "" }); + } + }); + + // Add a final segment if the last timestamp is less than the video duration + if (timestamps[timestamps.length - 1] < currentvideoduration) { + notesegments.push({ + start: timestamps[timestamps.length - 1] + 1, + end: currentvideoduration, + notes: "" + }); + } + } + // Event handler for when the player is ready function onPlayerReady(event) { autogeneratedtimestamps(); + createNoteSegments(); } function onPlayerStateChange(event) { @@ -57377,6 +61872,7 @@ var app = (function () { // Check if the video has just started playing if (event.data === YT.PlayerState.PLAYING && !regeneratedautotimestamps) { autogeneratedtimestamps(); + createNoteSegments(); } } @@ -57479,7 +61975,7 @@ var app = (function () { function exportTimestamps() { const data = JSON.stringify({ - currentvideoId, + $ytsubcurrentID, timestamps: userTimestamps }); @@ -57487,7 +61983,7 @@ var app = (function () { const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.style.display = 'none'; - const filename = `${currentvideoId}_timestamps.json`; + const filename = `${$ytsubcurrentID}_timestamps.json`; a.href = url; a.download = filename; document.body.appendChild(a); @@ -57497,7 +61993,7 @@ var app = (function () { function exportr2Timestamps() { const data = JSON.stringify({ - currentvideoId, + $ytsubcurrentID, timestamps: r2userTimestamps }); @@ -57505,7 +62001,7 @@ var app = (function () { const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.style.display = 'none'; - const filename = `${currentvideoId}_round2timestamps.json`; + const filename = `${$ytsubcurrentID}_round2timestamps.json`; a.href = url; a.download = filename; document.body.appendChild(a); @@ -57539,7 +62035,7 @@ var app = (function () { return; } - $$invalidate(2, currentvideoId = data.currentvideoId || ''); + set_store_value(ytsubcurrentID, $ytsubcurrentID = data.$ytsubcurrentID || '', $ytsubcurrentID); $$invalidate(1, userTimestamps = data.timestamps); } catch(error) { alert('An error occurred while importing timestamps.'); //regeneratedautotimestamps = false; = true @@ -57588,9 +62084,6 @@ var app = (function () { clearInterval(intervalId); } //player.pauseVideo(); - let YTIDitems = ['mwO6v4BlgZQ', 'IVJkOHTBPn0']; - let YTIDinput = ''; - // Function to handle button click for adding items function YTIDaddItems() { const newItems = YTIDinput.split('\n').filter(item => item.trim() !== ''); @@ -57601,7 +62094,7 @@ var app = (function () { function YTIDupdateItem(index) { $$invalidate(16, YTIDitems[index] = `${YTIDitems[index]}`, YTIDitems); //(updated)`; - $$invalidate(2, currentvideoId = YTIDitems[index]); + set_store_value(ytsubcurrentID, $ytsubcurrentID = YTIDitems[index], $ytsubcurrentID); $$invalidate(16, YTIDitems = YTIDitems.slice()); } @@ -57632,10 +62125,105 @@ var app = (function () { } } + function checkSkipIntervals() { + const currentTime = player.getCurrentTime(); + + for (const interval of skipIntervals) { + if (currentTime >= interval.start && currentTime < interval.end) { + player.seekTo(interval.end); + break; + } + } + } + + function addSkipInterval() { + skipIntervals.push({ + start: intervalstartTime, + end: intervalendTime + }); + + skipIntervals = skipIntervals; + intervalstartTime = 0; + intervalendTime = 0; + } + + function removeSkipInterval(index) { + skipIntervals.splice(index, 1); + skipIntervals = skipIntervals; + } + + // function createnoteSegments() { + // console.log(currentvideoduration) + // console.log(timestamps) + // notesegments = []; // Clear existing segments + // for (let start = 0; start < currentvideoduration; start += timestamps) { + // let end = start + timestamps - 1; + // if (end > currentvideoduration) end = currentvideoduration; // Adjust last segment to not exceed video duration + // notesegments.push({ start: start, end: end, notes: "" }); + // } + // console.log(notesegments) + // } + // function createNoteSegments() { + // console.log("Video duration: " + currentvideoduration); + // console.log("Timestamps: " + timestamps); + // notesegments = []; // Clear existing segments + // let start = 0; + // timestamps.forEach((end, index) => { + // if (index === 0) { + // notesegments.push({ start: 0, end: end, notes: "" }); + // } else { + // start = timestamps[index - 1] + 1; + // notesegments.push({ start: start, end: end, notes: "" }); + // } + // }); + // // Add a final segment if the last timestamp is less than the video duration + // if (timestamps[timestamps.length - 1] < currentvideoduration) { + // notesegments.push({ + // start: timestamps[timestamps.length - 1] + 1, + // end: currentvideoduration, + // notes: "" + // }); + // } + // console.log(notesegments); + // } + function savenoteSegmentstofile() { + const dataStr = JSON.stringify(notesegments); + const blob = new Blob([dataStr], { type: "application/json" }); + + // Getting current date and time for filename + const now = new Date(); + + const dateTimeStamp = `${now.getFullYear()}-${(now.getMonth() + 1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')}_${now.getHours().toString().padStart(2, '0')}-${now.getMinutes().toString().padStart(2, '0')}-${now.getSeconds().toString().padStart(2, '0')}`; + const filename = `noteSegments_${$ytsubcurrentID}_${dateTimeStamp}.json`; + const url = URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = url; + link.download = filename; //"notesegments.json"; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + URL.revokeObjectURL(url); + } + + function loadnotesegmentstofile(event) { + const file = event.target.files[0]; + + if (file) { + const reader = new FileReader(); + + reader.onload = e => { + $$invalidate(18, notesegments = JSON.parse(e.target.result)); + console.log("Notes loaded:", notesegments); + }; + + reader.readAsText(file); + } + } + const writable_props = []; Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$6.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 textarea0_input_handler() { @@ -57646,8 +62234,8 @@ var app = (function () { const click_handler = index => YTIDupdateItem(index); function input1_input_handler() { - currentvideoId = this.value; - $$invalidate(2, currentvideoId); + $ytsubcurrentID = this.value; + ytsubcurrentID.set($ytsubcurrentID); } function input2_change_handler() { @@ -57660,22 +62248,27 @@ var app = (function () { $$invalidate(5, transcript); } - function input4_change_handler() { + function textarea2_input_handler() { + notesegments[currentIndex]['notes'] = this.value; + $$invalidate(18, notesegments); + } + + function input5_change_handler() { isRepeating = this.checked; - $$invalidate(3, isRepeating); + $$invalidate(2, isRepeating); } - function input5_input_handler() { + function input6_input_handler() { repstartTime = to_number(this.value); $$invalidate(13, repstartTime); } - function input6_input_handler() { + function input7_input_handler() { rependTime = to_number(this.value); $$invalidate(14, rependTime); } - function input7_input_handler() { + function input8_input_handler() { repetitions = to_number(this.value); $$invalidate(15, repetitions); } @@ -57683,6 +62276,10 @@ var app = (function () { $$self.$capture_state = () => ({ onMount, onDestroy, + ytsubcurrenttext, + ytsubcurrentID, + ytsubuse, + ytsubuseplayer, player, interval, currentTime, @@ -57699,7 +62296,6 @@ var app = (function () { timestamps, userTimestamps, r2userTimestamps, - currentvideoId, youTubeApiLoaded, currentvideoduration, regeneratedautotimestamps, @@ -57708,8 +62304,15 @@ var app = (function () { repetitions, intervalId, isRepeating, + YTIDitems, + YTIDinput, + skipIntervals, + intervalstartTime, + intervalendTime, + notesegments, initYouTubePlayer, autogeneratedtimestamps, + createNoteSegments, onPlayerReady, onPlayerStateChange, updateCurrentIndex, @@ -57730,20 +62333,25 @@ var app = (function () { transcriptToJson, startRepetition, stopRepetition, - YTIDitems, - YTIDinput, YTIDaddItems, YTIDupdateItem, YTIDdownloadList, YTIDhandleFileImport, + checkSkipIntervals, + addSkipInterval, + removeSkipInterval, + savenoteSegmentstofile, + loadnotesegmentstofile, currentindexButtonClass, previousindexButtonClass, - nextindexButtonClass + nextindexButtonClass, + $ytsubcurrentID, + $ytsubcurrenttext }); $$self.$inject_state = $$props => { if ('player' in $$props) player = $$props.player; - if ('interval' in $$props) $$invalidate(21, interval = $$props.interval); + if ('interval' in $$props) $$invalidate(23, interval = $$props.interval); if ('currentTime' in $$props) $$invalidate(4, currentTime = $$props.currentTime); if ('timeUpdateInterval' in $$props) timeUpdateInterval = $$props.timeUpdateInterval; if ('transcript' in $$props) $$invalidate(5, transcript = $$props.transcript); @@ -57758,7 +62366,6 @@ var app = (function () { if ('timestamps' in $$props) $$invalidate(11, timestamps = $$props.timestamps); if ('userTimestamps' in $$props) $$invalidate(1, userTimestamps = $$props.userTimestamps); if ('r2userTimestamps' in $$props) $$invalidate(12, r2userTimestamps = $$props.r2userTimestamps); - if ('currentvideoId' in $$props) $$invalidate(2, currentvideoId = $$props.currentvideoId); if ('youTubeApiLoaded' in $$props) youTubeApiLoaded = $$props.youTubeApiLoaded; if ('currentvideoduration' in $$props) currentvideoduration = $$props.currentvideoduration; if ('regeneratedautotimestamps' in $$props) regeneratedautotimestamps = $$props.regeneratedautotimestamps; @@ -57766,12 +62373,16 @@ var app = (function () { if ('rependTime' in $$props) $$invalidate(14, rependTime = $$props.rependTime); if ('repetitions' in $$props) $$invalidate(15, repetitions = $$props.repetitions); if ('intervalId' in $$props) intervalId = $$props.intervalId; - if ('isRepeating' in $$props) $$invalidate(3, isRepeating = $$props.isRepeating); + if ('isRepeating' in $$props) $$invalidate(2, isRepeating = $$props.isRepeating); if ('YTIDitems' in $$props) $$invalidate(16, YTIDitems = $$props.YTIDitems); if ('YTIDinput' in $$props) $$invalidate(17, YTIDinput = $$props.YTIDinput); - if ('currentindexButtonClass' in $$props) $$invalidate(18, currentindexButtonClass = $$props.currentindexButtonClass); - if ('previousindexButtonClass' in $$props) $$invalidate(19, previousindexButtonClass = $$props.previousindexButtonClass); - if ('nextindexButtonClass' in $$props) $$invalidate(20, nextindexButtonClass = $$props.nextindexButtonClass); + if ('skipIntervals' in $$props) skipIntervals = $$props.skipIntervals; + if ('intervalstartTime' in $$props) intervalstartTime = $$props.intervalstartTime; + if ('intervalendTime' in $$props) intervalendTime = $$props.intervalendTime; + if ('notesegments' in $$props) $$invalidate(18, notesegments = $$props.notesegments); + if ('currentindexButtonClass' in $$props) $$invalidate(19, currentindexButtonClass = $$props.currentindexButtonClass); + if ('previousindexButtonClass' in $$props) $$invalidate(20, previousindexButtonClass = $$props.previousindexButtonClass); + if ('nextindexButtonClass' in $$props) $$invalidate(21, nextindexButtonClass = $$props.nextindexButtonClass); }; if ($$props && "$$inject" in $$props) { @@ -57779,27 +62390,27 @@ var app = (function () { } $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*currentvideoId*/ 4) { - if (currentvideoId) { + if ($$self.$$.dirty[0] & /*$ytsubcurrentID*/ 8) { + if ($ytsubcurrentID) { initYouTubePlayer(); } } if ($$self.$$.dirty[0] & /*currentuserIndex, userTimestamps*/ 3) { - $$invalidate(20, nextindexButtonClass = currentuserIndex >= userTimestamps.length - 1 + $$invalidate(21, nextindexButtonClass = currentuserIndex >= userTimestamps.length - 1 ? 'button-at-end' : 'button'); } if ($$self.$$.dirty[0] & /*currentuserIndex*/ 1) { - $$invalidate(19, previousindexButtonClass = currentuserIndex <= 0 ? 'button-at-end' : 'button'); + $$invalidate(20, previousindexButtonClass = currentuserIndex <= 0 ? 'button-at-end' : 'button'); } if ($$self.$$.dirty[0] & /*currentuserIndex*/ 1) { - $$invalidate(18, currentindexButtonClass = currentuserIndex <= 0 ? 'button-at-end' : 'button'); + $$invalidate(19, currentindexButtonClass = currentuserIndex <= 0 ? 'button-at-end' : 'button'); } - if ($$self.$$.dirty[0] & /*isRepeating*/ 8) { + if ($$self.$$.dirty[0] & /*isRepeating*/ 4) { if (isRepeating) { startRepetition(); } else { @@ -57811,8 +62422,8 @@ var app = (function () { return [ currentuserIndex, userTimestamps, - currentvideoId, isRepeating, + $ytsubcurrentID, currentTime, transcript, jsonOutput, @@ -57827,10 +62438,13 @@ var app = (function () { repetitions, YTIDitems, YTIDinput, + notesegments, currentindexButtonClass, previousindexButtonClass, nextindexButtonClass, + $ytsubcurrenttext, interval, + createNoteSegments, toggleUpdate, goToNextAutoTimestamp, goToPreviousAutoTimestamp, @@ -57846,28 +62460,31 @@ var app = (function () { YTIDupdateItem, YTIDdownloadList, YTIDhandleFileImport, + savenoteSegmentstofile, + loadnotesegmentstofile, textarea0_input_handler, click_handler, input1_input_handler, input2_change_handler, textarea1_input_handler, - input4_change_handler, - input5_input_handler, + textarea2_input_handler, + input5_change_handler, input6_input_handler, - input7_input_handler + input7_input_handler, + input8_input_handler ]; } class YoutubeIframeAPICustomInterface extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$a, create_fragment$a, safe_not_equal, {}, null, [-1, -1, -1]); + init(this, options, instance$9, create_fragment$9, safe_not_equal, {}, null, [-1, -1, -1]); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "YoutubeIframeAPICustomInterface", options, - id: create_fragment$a.name + id: create_fragment$9.name }); } } @@ -57939,10 +62556,10 @@ var app = (function () { /* src\RecursiveNestedCommentsElement.svelte generated by Svelte v3.59.2 */ - const { console: console_1$5 } = globals; - const file$9 = "src\\RecursiveNestedCommentsElement.svelte"; + const { console: console_1$4 } = globals; + const file$8 = "src\\RecursiveNestedCommentsElement.svelte"; - function get_each_context$7(ctx, list, i) { + function get_each_context$6(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[14] = list[i]; child_ctx[15] = list; @@ -57975,10 +62592,10 @@ var app = (function () { button = element("button"); button.textContent = "Post Reply"; attr_dev(input, "placeholder", "Write a reply..."); - add_location(input, file$9, 124, 24, 4690); - add_location(button, file$9, 125, 24, 4791); + add_location(input, file$8, 124, 24, 4690); + add_location(button, file$8, 125, 24, 4791); attr_dev(div, "class", "reply-input"); - add_location(div, file$9, 123, 20, 4639); + add_location(div, file$8, 123, 20, 4639); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); @@ -58022,7 +62639,7 @@ var app = (function () { } // (119:8) {#each flattenedComments as comment} - function create_each_block$7(ctx) { + function create_each_block$6(ctx) { let div; let span; let t0_value = /*comment*/ ctx[14].title + ""; @@ -58052,15 +62669,15 @@ var app = (function () { t3 = space(); if (if_block) if_block.c(); t4 = space(); - add_location(span, file$9, 120, 16, 4453); - add_location(button, file$9, 121, 16, 4499); + add_location(span, file$8, 120, 16, 4453); + add_location(button, file$8, 121, 16, 4499); attr_dev(div, "class", div_class_value = "" + (null_to_empty(/*comment*/ ctx[14].level === 0 ? 'top-level-comment' : 'comment') + " svelte-bsj1sx")); set_style(div, "margin-left", /*comment*/ ctx[14].level * 20 + "px"); - add_location(div, file$9, 119, 12, 4323); + add_location(div, file$8, 119, 12, 4323); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); @@ -58114,7 +62731,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$7.name, + id: create_each_block$6.name, type: "each", source: "(119:8) {#each flattenedComments as comment}", ctx @@ -58123,7 +62740,7 @@ var app = (function () { return block; } - function create_fragment$9(ctx) { + function create_fragment$8(ctx) { let h1; let t1; let h4; @@ -58148,7 +62765,7 @@ var app = (function () { let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$7(get_each_context$7(ctx, each_value, i)); + each_blocks[i] = create_each_block$6(get_each_context$6(ctx, each_value, i)); } const block = { @@ -58179,22 +62796,22 @@ var app = (function () { each_blocks[i].c(); } - add_location(h1, file$9, 104, 0, 3512); - add_location(h4, file$9, 105, 0, 3614); - add_location(button0, file$9, 108, 8, 3897); + add_location(h1, file$8, 104, 0, 3512); + add_location(h4, file$8, 105, 0, 3614); + add_location(button0, file$8, 108, 8, 3897); attr_dev(input0, "type", "file"); - add_location(input0, file$9, 110, 8, 4000); + add_location(input0, file$8, 110, 8, 4000); attr_dev(input1, "placeholder", "Add a comment..."); - add_location(input1, file$9, 112, 8, 4072); - add_location(button1, file$9, 113, 8, 4146); - add_location(div0, file$9, 107, 4, 3882); - add_location(br, file$9, 116, 4, 4225); + add_location(input1, file$8, 112, 8, 4072); + add_location(button1, file$8, 113, 8, 4146); + add_location(div0, file$8, 107, 4, 3882); + add_location(br, file$8, 116, 4, 4225); attr_dev(div1, "id", "comment-container"); - add_location(div1, file$9, 117, 4, 4235); + add_location(div1, file$8, 117, 4, 4235); attr_dev(div2, "class", "component-containter svelte-bsj1sx"); set_style(div2, "border", "1px solid black"); set_style(div2, "padding", "4px"); - add_location(div2, file$9, 106, 0, 3795); + add_location(div2, file$8, 106, 0, 3795); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -58247,12 +62864,12 @@ var app = (function () { let i; for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$7(ctx, each_value, i); + const child_ctx = get_each_context$6(ctx, each_value, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block$7(child_ctx); + each_blocks[i] = create_each_block$6(child_ctx); each_blocks[i].c(); each_blocks[i].m(div1, null); } @@ -58281,7 +62898,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$9.name, + id: create_fragment$8.name, type: "component", source: "", ctx @@ -58307,7 +62924,7 @@ var app = (function () { return result; } - function instance$9($$self, $$props, $$invalidate) { + function instance$8($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('RecursiveNestedCommentsElement', slots, []); let comments = []; @@ -58392,7 +63009,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$5.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 input1_input_handler() { @@ -58459,23 +63076,23 @@ var app = (function () { class RecursiveNestedCommentsElement extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$9, create_fragment$9, safe_not_equal, {}); + init(this, options, instance$8, create_fragment$8, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "RecursiveNestedCommentsElement", options, - id: create_fragment$9.name + id: create_fragment$8.name }); } } /* src\CopyandRemoveListComponent.svelte generated by Svelte v3.59.2 */ - const { console: console_1$4 } = globals; - const file$8 = "src\\CopyandRemoveListComponent.svelte"; + const { console: console_1$3 } = globals; + const file$7 = "src\\CopyandRemoveListComponent.svelte"; - function get_each_context$6(ctx, list, i) { + function get_each_context$5(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[6] = list[i]; return child_ctx; @@ -58489,12 +63106,12 @@ var app = (function () { let each_value = /*items*/ ctx[1]; validate_each_argument(each_value); const get_key = ctx => /*item*/ ctx[6].id; - validate_each_keys(ctx, each_value, get_each_context$6, get_key); + validate_each_keys(ctx, each_value, get_each_context$5, get_key); for (let i = 0; i < each_value.length; i += 1) { - let child_ctx = get_each_context$6(ctx, each_value, i); + let child_ctx = get_each_context$5(ctx, each_value, i); let key = get_key(child_ctx); - each_1_lookup.set(key, each_blocks[i] = create_each_block$6(key, child_ctx)); + each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx)); } const block = { @@ -58518,8 +63135,8 @@ var app = (function () { if (dirty & /*copyAndRemoveItem, items*/ 10) { each_value = /*items*/ ctx[1]; validate_each_argument(each_value); - validate_each_keys(ctx, each_value, get_each_context$6, get_key); - each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, destroy_block, create_each_block$6, each_1_anchor, get_each_context$6); + validate_each_keys(ctx, each_value, get_each_context$5, get_key); + each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, destroy_block, create_each_block$5, each_1_anchor, get_each_context$5); } }, d: function destroy(detaching) { @@ -58550,7 +63167,7 @@ var app = (function () { c: function create() { p = element("p"); p.textContent = "All items have been copied! (or none entered yet)"; - add_location(p, file$8, 24, 4, 732); + add_location(p, file$7, 24, 4, 732); }, m: function mount(target, anchor) { insert_dev(target, p, anchor); @@ -58573,7 +63190,7 @@ var app = (function () { } // (27:4) {#each items as item (item.id)} - function create_each_block$6(key_1, ctx) { + function create_each_block$5(key_1, ctx) { let button; let t0_value = /*item*/ ctx[6].text + ""; let t0; @@ -58593,7 +63210,7 @@ var app = (function () { t0 = text(t0_value); t1 = space(); attr_dev(button, "class", "item svelte-13m3fab"); - add_location(button, file$8, 27, 8, 844); + add_location(button, file$7, 27, 8, 844); this.first = button; }, m: function mount(target, anchor) { @@ -58619,7 +63236,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$6.name, + id: create_each_block$5.name, type: "each", source: "(27:4) {#each items as item (item.id)}", ctx @@ -58628,7 +63245,7 @@ var app = (function () { return block; } - function create_fragment$8(ctx) { + function create_fragment$7(ctx) { let h1; let t1; let textarea; @@ -58654,10 +63271,10 @@ var app = (function () { t2 = space(); if_block.c(); if_block_anchor = empty(); - add_location(h1, file$8, 19, 0, 537); + add_location(h1, file$7, 19, 0, 537); attr_dev(textarea, "placeholder", "Enter text here..."); attr_dev(textarea, "class", "svelte-13m3fab"); - add_location(textarea, file$8, 21, 0, 598); + add_location(textarea, file$7, 21, 0, 598); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -58713,7 +63330,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$8.name, + id: create_fragment$7.name, type: "component", source: "", ctx @@ -58722,7 +63339,7 @@ var app = (function () { return block; } - function instance$8($$self, $$props, $$invalidate) { + function instance$7($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('CopyandRemoveListComponent', slots, []); let textInput = ''; @@ -58744,7 +63361,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$4.warn(` was created with unknown prop '${key}'`); + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$3.warn(` was created with unknown prop '${key}'`); }); function textarea_input_handler() { @@ -58783,22 +63400,22 @@ var app = (function () { class CopyandRemoveListComponent extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$8, create_fragment$8, safe_not_equal, {}); + init(this, options, instance$7, create_fragment$7, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "CopyandRemoveListComponent", options, - id: create_fragment$8.name + id: create_fragment$7.name }); } } /* src\ReadingStateCounter.svelte generated by Svelte v3.59.2 */ - const file$7 = "src\\ReadingStateCounter.svelte"; + const file$6 = "src\\ReadingStateCounter.svelte"; - function get_each_context$5(ctx, list, i) { + function get_each_context$4(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[8] = list[i]; child_ctx[10] = i; @@ -58806,7 +63423,7 @@ var app = (function () { } // (67:4) {#each words as wordObj, index (index)} - function create_each_block$5(key_1, ctx) { + function create_each_block$4(key_1, ctx) { let button; let t0_value = /*wordObj*/ ctx[8].word + ""; let t0; @@ -58832,7 +63449,7 @@ var app = (function () { t3 = text(")\r\n "); attr_dev(button, "class", "word-button svelte-13vjncp"); set_style(button, "background-color", getColor(/*wordObj*/ ctx[8].count)); - add_location(button, file$7, 67, 8, 1994); + add_location(button, file$6, 67, 8, 1994); this.first = button; }, m: function mount(target, anchor) { @@ -58865,7 +63482,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$5.name, + id: create_each_block$4.name, type: "each", source: "(67:4) {#each words as wordObj, index (index)}", ctx @@ -58874,7 +63491,7 @@ var app = (function () { return block; } - function create_fragment$7(ctx) { + function create_fragment$6(ctx) { let div0; let h1; let t1; @@ -58894,12 +63511,12 @@ var app = (function () { let each_value = /*words*/ ctx[1]; validate_each_argument(each_value); const get_key = ctx => /*index*/ ctx[10]; - validate_each_keys(ctx, each_value, get_each_context$5, get_key); + validate_each_keys(ctx, each_value, get_each_context$4, get_key); for (let i = 0; i < each_value.length; i += 1) { - let child_ctx = get_each_context$5(ctx, each_value, i); + let child_ctx = get_each_context$4(ctx, each_value, i); let key = get_key(child_ctx); - each_1_lookup.set(key, each_blocks[i] = create_each_block$5(key, child_ctx)); + each_1_lookup.set(key, each_blocks[i] = create_each_block$4(key, child_ctx)); } const block = { @@ -58924,20 +63541,20 @@ var app = (function () { each_blocks[i].c(); } - add_location(h1, file$7, 57, 4, 1576); + add_location(h1, file$6, 57, 4, 1576); attr_dev(input0, "type", "text"); attr_dev(input0, "placeholder", "Enter text here"); attr_dev(input0, "class", "svelte-13vjncp"); - add_location(input0, file$7, 58, 4, 1617); + add_location(input0, file$6, 58, 4, 1617); attr_dev(button0, "class", "svelte-13vjncp"); - add_location(button0, file$7, 59, 4, 1696); + add_location(button0, file$6, 59, 4, 1696); attr_dev(button1, "class", "svelte-13vjncp"); - add_location(button1, file$7, 60, 4, 1752); + add_location(button1, file$6, 60, 4, 1752); attr_dev(input1, "type", "file"); attr_dev(input1, "class", "svelte-13vjncp"); - add_location(input1, file$7, 61, 4, 1813); - add_location(div0, file$7, 56, 0, 1565); - add_location(div1, file$7, 64, 0, 1873); + add_location(input1, file$6, 61, 4, 1813); + add_location(div0, file$6, 56, 0, 1565); + add_location(div1, file$6, 64, 0, 1873); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -58982,8 +63599,8 @@ var app = (function () { if (dirty & /*getColor, words, handleClick*/ 10) { each_value = /*words*/ ctx[1]; validate_each_argument(each_value); - validate_each_keys(ctx, each_value, get_each_context$5, get_key); - each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div1, destroy_block, create_each_block$5, null, get_each_context$5); + validate_each_keys(ctx, each_value, get_each_context$4, get_key); + each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div1, destroy_block, create_each_block$4, null, get_each_context$4); } }, i: noop, @@ -59004,7 +63621,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$7.name, + id: create_fragment$6.name, type: "component", source: "", ctx @@ -59030,7 +63647,7 @@ var app = (function () { return colors[Math.min(Math.floor(count / 10), 9)]; } - function instance$7($$self, $$props, $$invalidate) { + function instance$6($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('ReadingStateCounter', slots, []); let inputText = ""; @@ -59120,21 +63737,21 @@ var app = (function () { class ReadingStateCounter extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$7, create_fragment$7, safe_not_equal, {}); + init(this, options, instance$6, create_fragment$6, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "ReadingStateCounter", options, - id: create_fragment$7.name + id: create_fragment$6.name }); } } /* src\DeliberateSubconciousRepititionPractice.svelte generated by Svelte v3.59.2 */ - const { Object: Object_1$1, console: console_1$3 } = globals; - const file$6 = "src\\DeliberateSubconciousRepititionPractice.svelte"; + const { Object: Object_1$1, console: console_1$2 } = globals; + const file$5 = "src\\DeliberateSubconciousRepititionPractice.svelte"; // (156:0) {#if selectedItem} function create_if_block_1(ctx) { @@ -59161,9 +63778,9 @@ var app = (function () { strong1.textContent = "Count:"; t5 = space(); t6 = text(t6_value); - add_location(strong0, file$6, 157, 8, 5744); - add_location(strong1, file$6, 158, 8, 5805); - add_location(div, file$6, 156, 4, 5729); + add_location(strong0, file$5, 157, 8, 5744); + add_location(strong1, file$5, 158, 8, 5805); + add_location(div, file$5, 156, 4, 5729); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); @@ -59204,7 +63821,7 @@ var app = (function () { div = element("div"); div.textContent = "All words have reached the count limit."; attr_dev(div, "class", "alert svelte-fb2ql8"); - add_location(div, file$6, 163, 4, 5910); + add_location(div, file$5, 163, 4, 5910); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); @@ -59225,7 +63842,7 @@ var app = (function () { return block; } - function create_fragment$6(ctx) { + function create_fragment$5(ctx) { let h1; let t1; let input0; @@ -59297,28 +63914,28 @@ var app = (function () { button3.textContent = "Simulate one hour or limit Counts"; t19 = space(); textarea1 = element("textarea"); - add_location(h1, file$6, 141, 0, 5255); + add_location(h1, file$5, 141, 0, 5255); attr_dev(input0, "type", "file"); - add_location(input0, file$6, 143, 0, 5317); - add_location(button0, file$6, 144, 0, 5365); - add_location(br, file$6, 145, 0, 5421); + add_location(input0, file$5, 143, 0, 5317); + add_location(button0, file$5, 144, 0, 5365); + add_location(br, file$5, 145, 0, 5421); attr_dev(textarea0, "placeholder", "Enter text here..."); - add_location(textarea0, file$6, 146, 0, 5427); - add_location(hr0, file$6, 148, 0, 5531); + add_location(textarea0, file$5, 146, 0, 5427); + add_location(hr0, file$5, 148, 0, 5531); attr_dev(label, "for", "totalCountLimit"); - add_location(label, file$6, 151, 4, 5550); + add_location(label, file$5, 151, 4, 5550); attr_dev(input1, "type", "number"); attr_dev(input1, "min", "1"); attr_dev(input1, "id", "totalCountLimit"); - add_location(input1, file$6, 152, 4, 5612); - add_location(div, file$6, 150, 0, 5539); - add_location(button1, file$6, 168, 0, 6001); - add_location(button2, file$6, 169, 0, 6042); - add_location(hr1, file$6, 171, 0, 6083); - add_location(button3, file$6, 173, 0, 6091); + add_location(input1, file$5, 152, 4, 5612); + add_location(div, file$5, 150, 0, 5539); + add_location(button1, file$5, 168, 0, 6001); + add_location(button2, file$5, 169, 0, 6042); + add_location(hr1, file$5, 171, 0, 6083); + add_location(button3, file$5, 173, 0, 6091); textarea1.readOnly = true; attr_dev(textarea1, "placeholder", "Simulation result will be shown here..."); - add_location(textarea1, file$6, 174, 0, 6168); + add_location(textarea1, file$5, 174, 0, 6168); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -59448,7 +64065,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_fragment$6.name, + id: create_fragment$5.name, type: "component", source: "", ctx @@ -59457,7 +64074,7 @@ var app = (function () { return block; } - function instance$6($$self, $$props, $$invalidate) { + function instance$5($$self, $$props, $$invalidate) { let { $$slots: slots = {}, $$scope } = $$props; validate_slots('DeliberateSubconciousRepititionPractice', slots, []); let textInput = ''; @@ -59608,7 +64225,7 @@ var app = (function () { const writable_props = []; Object_1$1.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$2.warn(` was created with unknown prop '${key}'`); }); function textarea0_input_handler() { @@ -59684,23 +64301,23 @@ var app = (function () { class DeliberateSubconciousRepititionPractice extends SvelteComponentDev { constructor(options) { super(options); - init(this, options, instance$6, create_fragment$6, safe_not_equal, {}); + init(this, options, instance$5, create_fragment$5, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "DeliberateSubconciousRepititionPractice", options, - id: create_fragment$6.name + id: create_fragment$5.name }); } } /* src\LLMWorkflowTest.svelte generated by Svelte v3.59.2 */ - const { Object: Object_1, console: console_1$2 } = globals; - const file$5 = "src\\LLMWorkflowTest.svelte"; + const { Object: Object_1, console: console_1$1 } = globals; + const file$4 = "src\\LLMWorkflowTest.svelte"; - function get_each_context$4(ctx, list, i) { + function get_each_context$3(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[10] = list[i]; child_ctx[11] = list; @@ -59708,14 +64325,14 @@ var app = (function () { return child_ctx; } - function get_each_context_1$3(ctx, list, i) { + function get_each_context_1$2(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[13] = list[i]; return child_ctx; } // (87:4) {#each Object.keys(workflows) as workflow} - function create_each_block_1$3(ctx) { + function create_each_block_1$2(ctx) { let option; let t_value = /*workflow*/ ctx[13] + ""; let t; @@ -59726,7 +64343,7 @@ var app = (function () { t = text(t_value); option.__value = /*workflow*/ ctx[13]; option.value = option.__value; - add_location(option, file$5, 87, 6, 2693); + add_location(option, file$4, 87, 6, 2693); }, m: function mount(target, anchor) { insert_dev(target, option, anchor); @@ -59740,7 +64357,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block_1$3.name, + id: create_each_block_1$2.name, type: "each", source: "(87:4) {#each Object.keys(workflows) as workflow}", ctx @@ -59750,7 +64367,7 @@ var app = (function () { } // (92:2) {#each placeholderInputs as placeholder} - function create_each_block$4(ctx) { + function create_each_block$3(ctx) { let div; let label; let t0; @@ -59775,10 +64392,10 @@ var app = (function () { t2 = text(">"); t3 = space(); input = element("input"); - add_location(label, file$5, 93, 6, 2828); + add_location(label, file$4, 93, 6, 2828); attr_dev(input, "type", "text"); - add_location(input, file$5, 94, 6, 2887); - add_location(div, file$5, 92, 4, 2815); + add_location(input, file$4, 94, 6, 2887); + add_location(div, file$4, 92, 4, 2815); }, m: function mount(target, anchor) { insert_dev(target, div, anchor); @@ -59816,7 +64433,7 @@ var app = (function () { dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$4.name, + id: create_each_block$3.name, type: "each", source: "(92:2) {#each placeholderInputs as placeholder}", ctx @@ -59825,7 +64442,7 @@ var app = (function () { return block; } - function create_fragment$5(ctx) { + function create_fragment$4(ctx) { let div1; let h1; let t1; @@ -59842,7 +64459,7 @@ var app = (function () { let each_blocks_1 = []; for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks_1[i] = create_each_block_1$3(get_each_context_1$3(ctx, each_value_1, i)); + each_blocks_1[i] = create_each_block_1$2(get_each_context_1$2(ctx, each_value_1, i)); } let each_value = /*placeholderInputs*/ ctx[2]; @@ -59850,7 +64467,7 @@ var app = (function () { let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i)); + each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i)); } const block = { @@ -59876,13 +64493,13 @@ var app = (function () { t4 = space(); button = element("button"); button.textContent = "Submit"; - add_location(h1, file$5, 84, 2, 2523); + add_location(h1, file$4, 84, 2, 2523); if (/*selectedWorkflow*/ ctx[0] === void 0) add_render_callback(() => /*select_change_handler*/ ctx[7].call(select)); - add_location(select, file$5, 85, 2, 2566); + add_location(select, file$4, 85, 2, 2566); attr_dev(div0, "id", "input-group"); - add_location(div0, file$5, 102, 2, 3039); - add_location(button, file$5, 104, 2, 3073); - add_location(div1, file$5, 83, 0, 2514); + add_location(div0, file$4, 102, 2, 3039); + add_location(button, file$4, 104, 2, 3073); + add_location(div1, file$4, 83, 0, 2514); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -59930,546 +64547,30 @@ var app = (function () { let i; for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1$3(ctx, each_value_1, i); + const child_ctx = get_each_context_1$2(ctx, each_value_1, i); if (each_blocks_1[i]) { each_blocks_1[i].p(child_ctx, dirty); } else { - each_blocks_1[i] = create_each_block_1$3(child_ctx); + each_blocks_1[i] = create_each_block_1$2(child_ctx); each_blocks_1[i].c(); each_blocks_1[i].m(select, null); } } for (; i < each_blocks_1.length; i += 1) { - each_blocks_1[i].d(1); - } - - each_blocks_1.length = each_value_1.length; - } - - if (dirty & /*selectedWorkflow, Object, workflows*/ 9) { - select_option(select, /*selectedWorkflow*/ ctx[0]); - } - - if (dirty & /*placeholderValues, placeholderInputs, updateInputs*/ 70) { - each_value = /*placeholderInputs*/ ctx[2]; - validate_each_argument(each_value); - let i; - - for (i = 0; i < each_value.length; i += 1) { - 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$4(child_ctx); - each_blocks[i].c(); - each_blocks[i].m(div1, t3); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].d(1); - } - - each_blocks.length = each_value.length; - } - }, - i: noop, - o: noop, - d: function destroy(detaching) { - if (detaching) detach_dev(div1); - destroy_each(each_blocks_1, detaching); - destroy_each(each_blocks, detaching); - mounted = false; - run_all(dispose); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_fragment$5.name, - type: "component", - source: "", - ctx - }); - - return block; - } - - function instance$5($$self, $$props, $$invalidate) { - let { $$slots: slots = {}, $$scope } = $$props; - validate_slots('LLMWorkflowTest', slots, []); - - let workflows = { - "Merged Spelling": { - steps: [ - "Please make an image description the meaning of the word ", - "next please find english words close in spelling to ", - "great, next make an image description using those words", - "Thanks lets now merge the two seperate image descriptions together" - ], - placeholders: { "": "much", "": "henduo" }, - timeline: [[], 1, [1], [0, 2]] - }, - "Another Workflow": { - steps: [ - "Do something with ", - "Then do something else with " - ], - placeholders: { - "": "value1", - "": "value2" - }, - timeline: [[], 1] - } - }; - - let selectedWorkflow = "Merged Spelling"; - let placeholderValues = workflows[selectedWorkflow].placeholders; - let placeholderInputs = Object.keys(placeholderValues); - let timeline = workflows[selectedWorkflow].timeline; - - function handleWorkflowChange() { - $$invalidate(1, placeholderValues = workflows[selectedWorkflow].placeholders); - $$invalidate(2, placeholderInputs = Object.keys(placeholderValues)); - timeline = workflows[selectedWorkflow].timeline; - updateInputs(); - } - - function processInputs() { - const inputs = document.querySelectorAll('input[type="text"]'); - console.log(`Workflow: ${selectedWorkflow}`); - - inputs.forEach((input, i) => { - console.log(`Step ${i + 1}: ${input.value}`); - }); - } - - onMount(() => { - handleWorkflowChange(); - updateInputs(); - }); - - function updateInputs() { - const inputGroup = document.getElementById('input-group'); - inputGroup.innerHTML = ''; - const steps = workflows[selectedWorkflow].steps; - - steps.forEach((step, i) => { - const label = placeholderInputs.reduce((updatedStep, placeholder) => updatedStep.replace(new RegExp(placeholder, 'g'), placeholderValues[placeholder]), step); - - const dependencyText = Array.isArray(timeline[i]) - ? timeline[i].join(', ') - : timeline[i]; - - const inputBox = ` -
- - - ${timeline[i].length > 0 - ? `Output depends on: ${dependencyText}` - : ''} -
- `; - - inputGroup.innerHTML += inputBox; - }); - } - - const writable_props = []; - - Object_1.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}'`); - }); - - function select_change_handler() { - selectedWorkflow = select_value(this); - $$invalidate(0, selectedWorkflow); - $$invalidate(3, workflows); - } - - function input_input_handler(placeholder) { - placeholderValues[placeholder] = this.value; - $$invalidate(1, placeholderValues); - } - - $$self.$capture_state = () => ({ - onMount, - workflows, - selectedWorkflow, - placeholderValues, - placeholderInputs, - timeline, - handleWorkflowChange, - processInputs, - updateInputs - }); - - $$self.$inject_state = $$props => { - if ('workflows' in $$props) $$invalidate(3, workflows = $$props.workflows); - if ('selectedWorkflow' in $$props) $$invalidate(0, selectedWorkflow = $$props.selectedWorkflow); - if ('placeholderValues' in $$props) $$invalidate(1, placeholderValues = $$props.placeholderValues); - if ('placeholderInputs' in $$props) $$invalidate(2, placeholderInputs = $$props.placeholderInputs); - if ('timeline' in $$props) timeline = $$props.timeline; - }; - - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } - - return [ - selectedWorkflow, - placeholderValues, - placeholderInputs, - workflows, - handleWorkflowChange, - processInputs, - updateInputs, - select_change_handler, - input_input_handler - ]; - } - - class LLMWorkflowTest extends SvelteComponentDev { - constructor(options) { - super(options); - init(this, options, instance$5, create_fragment$5, safe_not_equal, {}); - - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "LLMWorkflowTest", - options, - id: create_fragment$5.name - }); - } - } - - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - function getDefaultExportFromCjs (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; - } - - function commonjsRequire(path) { - throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); - } - - var jszip_min = {exports: {}}; - - /*! - - JSZip v3.10.1 - A JavaScript class for generating and reading zip files - - - (c) 2009-2016 Stuart Knightley - Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. - - JSZip uses the library pako released under the MIT license : - https://github.com/nodeca/pako/blob/main/LICENSE - */ - - (function (module, exports) { - !function(e){module.exports=e();}(function(){return function s(a,o,h){function u(r,e){if(!o[r]){if(!a[r]){var t="function"==typeof commonjsRequire&&commonjsRequire;if(!e&&t)return t(r,!0);if(l)return l(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var i=o[r]={exports:{}};a[r][0].call(i.exports,function(e){var t=a[r][1][e];return u(t||e)},i,i.exports,s,a,o,h);}return o[r].exports}for(var l="function"==typeof commonjsRequire&&commonjsRequire,e=0;e>2,s=(3&t)<<4|r>>4,a=1>6:64,o=2>4,r=(15&i)<<4|(s=p.indexOf(e.charAt(o++)))>>2,n=(3&s)<<6|(a=p.indexOf(e.charAt(o++))),l[h++]=t,64!==s&&(l[h++]=r),64!==a&&(l[h++]=n);return l};},{"./support":30,"./utils":32}],2:[function(e,t,r){var n=e("./external"),i=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function o(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i;}o.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=o;},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate");},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){var n=e("./utils");var o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e;}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return -1^e}(0|t,e,e.length,0):function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t.charCodeAt(a))];return -1^e}(0|t,e,e.length,0):0};},{"./utils":32}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null;},{}],6:[function(e,t,r){var n=null;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n};},{lie:37}],7:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),s=e("./utils"),a=e("./stream/GenericWorker"),o=n?"uint8array":"array";function h(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={};}r.magic="\b\0",s.inherits(h,a),h.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,e.data),!1);},h.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0);},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null;},h.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta});};},r.compressWorker=function(e){return new h("Deflate",e)},r.uncompressWorker=function(){return new h("Inflate",{})};},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){function A(e,t){var r,n="";for(r=0;r>>=8;return n}function n(e,t,r,n,i,s){var a,o,h=e.file,u=e.compression,l=s!==O.utf8encode,f=I.transformTo("string",s(h.name)),c=I.transformTo("string",O.utf8encode(h.name)),d=h.comment,p=I.transformTo("string",s(d)),m=I.transformTo("string",O.utf8encode(d)),_=c.length!==h.name.length,g=m.length!==d.length,b="",v="",y="",w=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),l||!_&&!g||(S|=2048);var z=0,C=0;w&&(z|=16),"UNIX"===i?(C=798,z|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(h.unixPermissions,w)):(C=20,z|=function(e){return 63&(e||0)}(h.dosPermissions)),a=k.getUTCHours(),a<<=6,a|=k.getUTCMinutes(),a<<=5,a|=k.getUTCSeconds()/2,o=k.getUTCFullYear()-1980,o<<=4,o|=k.getUTCMonth()+1,o<<=5,o|=k.getUTCDate(),_&&(v=A(1,1)+A(B(f),4)+c,b+="up"+A(v.length,2)+v),g&&(y=A(1,1)+A(B(p),4)+m,b+="uc"+A(y.length,2)+y);var E="";return E+="\n\0",E+=A(S,2),E+=u.magic,E+=A(a,2),E+=A(o,2),E+=A(x.crc32,4),E+=A(x.compressedSize,4),E+=A(x.uncompressedSize,4),E+=A(f.length,2),E+=A(b.length,2),{fileRecord:R.LOCAL_FILE_HEADER+E+f+b,dirRecord:R.CENTRAL_FILE_HEADER+A(C,2)+E+A(p.length,2)+"\0\0\0\0"+A(z,4)+A(n,4)+f+b+p}}var I=e("../utils"),i=e("../stream/GenericWorker"),O=e("../utf8"),B=e("../crc32"),R=e("../signature");function s(e,t,r,n){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[];}I.inherits(s,i),s.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}));},s.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=n(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}});}else this.accumulate=!0;},s.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=n(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return R.DATA_DESCRIPTOR+A(e.crc32,4)+A(e.compressedSize,4)+A(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null;},s.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i;},{"../utils":32}],19:[function(e,t,r){var n=e("./Uint8ArrayReader");function i(e){n.call(this,e);}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i;},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e);}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i;},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){var n=e("./ArrayReader");function i(e){n.call(this,e);}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i;},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){var n=e("../utils"),i=e("../support"),s=e("./ArrayReader"),a=e("./StringReader"),o=e("./NodeBufferReader"),h=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new o(e):i.uint8array?new h(n.transformTo("uint8array",e)):new s(n.transformTo("array",e)):new a(e)};},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b";},{}],24:[function(e,t,r){var n=e("./GenericWorker"),i=e("../utils");function s(e){n.call(this,"ConvertWorker to "+e),this.destType=e;}i.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta});},t.exports=s;},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){var n=e("./GenericWorker"),i=e("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0);}e("../utils").inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e);},t.exports=s;},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0);}n.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length;}i.prototype.processChunk.call(this,e);},t.exports=s;},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat();},function(e){t.error(e);});}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null;},s.prototype.resume=function(){return !!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0));},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return !1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t);}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s;},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null;}n.prototype={push:function(e){this.emit("data",e);},end:function(){if(this.isFinished)return !1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0;}catch(e){this.emit("error",e);}return !0},error:function(e){return !this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[];},emit:function(e,t){if(this._listeners[e])for(var r=0;r "+e:e}},t.exports=n;},{}],29:[function(e,t,r){var h=e("../utils"),i=e("./ConvertWorker"),s=e("./GenericWorker"),u=e("../base64"),n=e("../support"),a=e("../external"),o=null;if(n.nodestream)try{o=e("../nodejs/NodejsStreamOutputAdapter");}catch(e){}function l(e,o){return new a.Promise(function(t,r){var n=[],i=e._internalType,s=e._outputType,a=e._mimeType;e.on("data",function(e,t){n.push(e),o&&o(t);}).on("error",function(e){n=[],r(e);}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return h.newBlob(h.transformTo("arraybuffer",t),r);case"base64":return u.encode(t);default:return h.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return h.nodebuffer?o.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,n,i,s=e.length,a=new Array(2*s);for(t=r=0;t>10&1023,a[r++]=56320|1023&n);}return a.length!==r&&(a.subarray?a=a.subarray(0,r):a.length=r),o.applyFromCharCode(a)}(e=o.transformTo(h.uint8array?"uint8array":"array",e))},o.inherits(a,n),a.prototype.processChunk=function(e){var t=o.transformTo(h.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(h.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length);}else t=this.leftOver.concat(t);this.leftOver=null;}var n=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}(t),i=t;n!==t.length&&(h.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:s.utf8decode(i),meta:e.meta});},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null);},s.Utf8DecodeWorker=a,o.inherits(l,n),l.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta});},s.Utf8EncodeWorker=l;},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,a){var o=e("./support"),h=e("./base64"),r=e("./nodejsUtils"),u=e("./external");function n(e){return e}function l(e,t){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0);},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4));}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new h.Buf8(e.length),r=0,n=t.length;r>10&1023,o[n++]=56320|1023&i);}return l(o,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t};},{"./common":41}],43:[function(e,t,r){t.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,a=0;0!==r;){for(r-=a=2e3>>1:e>>>1;t[r]=e;}return t}();t.exports=function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return -1^e};},{}],46:[function(e,t,r){var h,c=e("../utils/common"),u=e("./trees"),d=e("./adler32"),p=e("./crc32"),n=e("./messages"),l=0,f=4,m=0,_=-2,g=-1,b=4,i=2,v=8,y=9,s=286,a=30,o=19,w=2*s+1,k=15,x=3,S=258,z=S+x+1,C=42,E=113,A=1,I=2,O=3,B=4;function R(e,t){return e.msg=n[t],t}function T(e){return (e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(c.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0));}function N(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm);}function U(e,t){e.pending_buf[e.pending++]=t;}function P(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t;}function L(e,t){var r,n,i=e.max_chain_length,s=e.strstart,a=e.prev_length,o=e.nice_match,h=e.strstart>e.w_size-z?e.strstart-(e.w_size-z):0,u=e.window,l=e.w_mask,f=e.prev,c=e.strstart+S,d=u[s+a-1],p=u[s+a];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(u[(r=t)+a]===p&&u[r+a-1]===d&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sh&&0!=--i);return a<=e.lookahead?a:e.lookahead}function j(e){var t,r,n,i,s,a,o,h,u,l,f=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-z)){for(c.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=r=e.hash_size;n=e.head[--t],e.head[t]=f<=n?n-f:0,--r;);for(t=r=f;n=e.prev[--t],e.prev[t]=f<=n?n-f:0,--r;);i+=f;}if(0===e.strm.avail_in)break;if(a=e.strm,o=e.window,h=e.strstart+e.lookahead,u=i,l=void 0,l=a.avail_in,u=x)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(n=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-x,n=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(j(e),0===e.lookahead&&t===l)return A;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,N(e,!1),0===e.strm.avail_out))return A;if(e.strstart-e.block_start>=e.w_size-z&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):(e.strstart>e.block_start&&(N(e,!1),e.strm.avail_out),A)}),new M(4,4,8,4,Z),new M(4,5,16,8,Z),new M(4,6,32,32,Z),new M(4,4,16,16,W),new M(8,16,32,32,W),new M(8,16,128,128,W),new M(8,32,128,256,W),new M(32,128,258,1024,W),new M(32,258,258,4096,W)],r.deflateInit=function(e,t){return Y(e,t,v,15,8,0)},r.deflateInit2=Y,r.deflateReset=K,r.deflateResetKeep=G,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?_:(e.state.gzhead=t,m):_},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||5>8&255),U(n,n.gzhead.time>>16&255),U(n,n.gzhead.time>>24&255),U(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),U(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(U(n,255&n.gzhead.extra.length),U(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(U(n,0),U(n,0),U(n,0),U(n,0),U(n,0),U(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),U(n,3),n.status=E);else {var a=v+(n.w_bits-8<<4)<<8;a|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=32),a+=31-a%31,n.status=E,P(n,a),0!==n.strstart&&(P(n,e.adler>>>16),P(n,65535&e.adler)),e.adler=1;}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending!==n.pending_buf_size));)U(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73);}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91);}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=103);}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&F(e),n.pending+2<=n.pending_buf_size&&(U(n,255&e.adler),U(n,e.adler>>8&255),e.adler=0,n.status=E)):n.status=E),0!==n.pending){if(F(e),0===e.avail_out)return n.last_flush=-1,m}else if(0===e.avail_in&&T(t)<=T(r)&&t!==f)return R(e,-5);if(666===n.status&&0!==e.avail_in)return R(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==l&&666!==n.status){var o=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(j(e),0===e.lookahead)){if(t===l)return A;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=S){if(j(e),e.lookahead<=S&&t===l)return A;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead);}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):h[n.level].func(n,t);if(o!==O&&o!==B||(n.status=666),o===A||o===O)return 0===e.avail_out&&(n.last_flush=-1),m;if(o===I&&(1===t?u._tr_align(n):5!==t&&(u._tr_stored_block(n,0,0,!1),3===t&&(D(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),F(e),0===e.avail_out))return n.last_flush=-1,m}return t!==f?m:n.wrap<=0?1:(2===n.wrap?(U(n,255&e.adler),U(n,e.adler>>8&255),U(n,e.adler>>16&255),U(n,e.adler>>24&255),U(n,255&e.total_in),U(n,e.total_in>>8&255),U(n,e.total_in>>16&255),U(n,e.total_in>>24&255)):(P(n,e.adler>>>16),P(n,65535&e.adler)),F(e),0=r.w_size&&(0===s&&(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new c.Buf8(r.w_size),c.arraySet(u,t,l-r.w_size,r.w_size,0),t=u,l=r.w_size),a=e.avail_in,o=e.next_in,h=e.input,e.avail_in=l,e.next_in=0,e.input=t,j(r);r.lookahead>=x;){for(n=r.strstart,i=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=y=v>>>24,p-=y,0===(y=v>>>16&255))C[s++]=65535&v;else {if(!(16&y)){if(0==(64&y)){v=m[(65535&v)+(d&(1<>>=y,p-=y),p<15&&(d+=z[n++]<>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(d&(1<>>=y,p-=y,(y=s-a)>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0;}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=P,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new I.Buf32(n),t.distcode=t.distdyn=new I.Buf32(i),t.sane=1,t.back=-1,N):U}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):U}function h(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(I.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n<(i=s.wsize-s.wnext)&&(i=n),I.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(I.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=B(r.check,E,2,0),l=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(l-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=B(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l<16;){if(0===o)break e;o--,u+=n[s++]<>8),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break e;o--,u+=n[s++]<>>8&255,r.check=B(r.check,E,2,0)),l=u=0;}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(d=r.length)&&(d=o),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,n,s,d,k)),512&r.flags&&(r.check=B(r.check,n,d,s)),o-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;for(d=0;k=n[s+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break e;o--,u+=n[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;u>>>=2,l-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30;}u>>>=2,l-=2;break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,u+=n[s++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,l=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(d=r.length){if(o>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,286>>=3,l-=3;}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=_,l-=_,r.lens[r.have++]=b;else {if(16===b){for(z=_+2;l>>=_,l-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],d=3+(3&u),u>>>=2,l-=2;}else if(17===b){for(z=_+3;l>>=_)),u>>>=3,l-=3;}else {for(z=_+7;l>>=_)),u>>>=7,l-=7;}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=k;}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=T(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=o&&258<=h){e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,R(e,c),a=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,u=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(C=r.lencode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=v,l-=v,r.back+=v;}if(u>>>=_,l-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra;}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=v,l-=v,r.back+=v;}if(u>>>=_,l-=_,r.back+=_,64&g){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra;}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===h)break e;if(d=c-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}p=d>r.wnext?(d-=r.wnext,r.wsize-d):r.wnext-d,d>r.length&&(d=r.length),m=r.window;}else m=i,p=a-r.offset,d=r.length;for(hd?(m=R[T+a[v]],A[I+a[v]]):(m=96,0),h=1<>S)+(u-=h)]=p<<24|m<<16|_|0,0!==u;);for(h=1<>=1;if(0!==h?(E&=h-1,E+=h):E=0,v++,0==--O[b]){if(b===w)break;b=t[r+a[v]];}if(k>>7)]}function U(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255;}function P(e,t,r){e.bi_valid>d-r?(e.bi_buf|=t<>d-e.bi_valid,e.bi_valid+=r-d):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function Z(e,t,r){var n,i,s=new Array(g+1),a=0;for(n=1;n<=g;n++)s[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=j(s[o]++,o));}}function W(e){var t;for(t=0;t>1;1<=r;r--)G(e,s,r);for(i=h;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,G(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,a,o,h=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=g;s++)e.bl_count[s]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<_;r++)p<(s=h[2*h[2*(n=e.heap[r])+1]+1]+1)&&(s=p,m++),h[2*n+1]=s,u>=7;n>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return h;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?J(e,t,r,n):4===e.strategy||s===i?(P(e,2+(n?1:0),3),K(e,z,C)):(P(e,4+(n?1:0),3),function(e,t,r,n){var i;for(P(e,t-257,5),P(e,r-1,5),P(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(A[r]+u+1)]++,e.dyn_dtree[2*N(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){P(e,2,3),L(e,m,z),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8);}(e);};},{"../utils/common":41}],53:[function(e,t,r){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0;};},{}],54:[function(e,t,r){(function(e){!function(r,n){if(!r.setImmediate){var i,s,t,a,o=1,h={},u=!1,l=r.document,e=Object.getPrototypeOf&&Object.getPrototypeOf(r);e=e&&e.setTimeout?e:r,i="[object process]"==={}.toString.call(r.process)?function(e){process.nextTick(function(){c(e);});}:function(){if(r.postMessage&&!r.importScripts){var e=!0,t=r.onmessage;return r.onmessage=function(){e=!1;},r.postMessage("","*"),r.onmessage=t,e}}()?(a="setImmediate$"+Math.random()+"$",r.addEventListener?r.addEventListener("message",d,!1):r.attachEvent("onmessage",d),function(e){r.postMessage(a+e,"*");}):r.MessageChannel?((t=new MessageChannel).port1.onmessage=function(e){c(e.data);},function(e){t.port2.postMessage(e);}):l&&"onreadystatechange"in l.createElement("script")?(s=l.documentElement,function(e){var t=l.createElement("script");t.onreadystatechange=function(){c(e),t.onreadystatechange=null,s.removeChild(t),t=null;},s.appendChild(t);}):function(e){setTimeout(c,0,e);},e.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r $$invalidate(5, $paused = value)); - let restart = writable(false); // Signal to restart - validate_store(restart, 'restart'); - component_subscribe($$self, restart, value => $$invalidate(14, $restart = value)); - let onlyCurrentSubtitle = writable(false); // Control subtitle display mode - validate_store(onlyCurrentSubtitle, 'onlyCurrentSubtitle'); - component_subscribe($$self, onlyCurrentSubtitle, value => $$invalidate(4, $onlyCurrentSubtitle = value)); - let progress = 0; - let totalDuration = 0; - - async function handleFileUpload() { - // Reset the component state - $$invalidate(1, subtitlesOutput = []); - - currentTime.set(0); - paused.set(false); - restart.set(false); - onlyCurrentSubtitle.set(false); - $$invalidate(2, progress = 0); - $$invalidate(3, totalDuration = 0); + validate_slots('LLMWorkflowTest', slots, []); - if (!zipFile) { - console.log('No zip file selected'); - return; + let workflows = { + "Merged Spelling": { + steps: [ + "Please make an image description the meaning of the word ", + "next please find english words close in spelling to ", + "great, next make an image description using those words", + "Thanks lets now merge the two seperate image descriptions together" + ], + placeholders: { "": "much", "": "henduo" }, + timeline: [[], 1, [1], [0, 2]] + }, + "Another Workflow": { + steps: [ + "Do something with ", + "Then do something else with " + ], + placeholders: { + "": "value1", + "": "value2" + }, + timeline: [[], 1] } + }; - const zip = new JSZip(); - const contents = await zip.loadAsync(zipFile); - console.log('Zip file loaded'); - const subtitlesFile = await contents.file('preprocessed_subtitles.json').async('text'); - const preprocessedSubtitles = JSON.parse(subtitlesFile); - preprocessedSubtitles.sort((a, b) => a.start - b.start); - console.log('Subtitles parsed and sorted'); - let localTime = 0; - let i = 0; - - const displayNextSubtitle = async () => { - console.log('Starting displayNextSubtitle'); - $$invalidate(3, totalDuration = preprocessedSubtitles.reduce((total, subtitle) => total + subtitle.duration, 0)); - - while (i < preprocessedSubtitles.length) { - const subtitle = preprocessedSubtitles[i]; - console.log('Current subtitle:', subtitle); - - if (localTime < subtitle.start) { - await new Promise(resolve => setTimeout(resolve, (subtitle.start - localTime) * 1000)); - console.log('Waited for subtitle start time'); - } - - if ($paused) { - await new Promise(resolve => paused.subscribe(value => !value && resolve())); - console.log('Resumed from pause'); - } + let selectedWorkflow = "Merged Spelling"; + let placeholderValues = workflows[selectedWorkflow].placeholders; + let placeholderInputs = Object.keys(placeholderValues); + let timeline = workflows[selectedWorkflow].timeline; - if ($restart) { - localTime = 0; - i = 0; - $$invalidate(1, subtitlesOutput = []); - restart.set(false); - console.log('Restarted subtitles'); - continue; - } + function handleWorkflowChange() { + $$invalidate(1, placeholderValues = workflows[selectedWorkflow].placeholders); + $$invalidate(2, placeholderInputs = Object.keys(placeholderValues)); + timeline = workflows[selectedWorkflow].timeline; + updateInputs(); + } - const images = await Promise.all(subtitle.image_paths.map(async path => URL.createObjectURL(await contents.file(path).async('blob')))); + function processInputs() { + const inputs = document.querySelectorAll('input[type="text"]'); + console.log(`Workflow: ${selectedWorkflow}`); - if ($onlyCurrentSubtitle) { - $$invalidate(1, subtitlesOutput = [{ text: subtitle.text, images }]); - } else { - $$invalidate(1, subtitlesOutput = [...subtitlesOutput, { text: subtitle.text, images }]); - } + inputs.forEach((input, i) => { + console.log(`Step ${i + 1}: ${input.value}`); + }); + } - $$invalidate(2, progress = localTime / totalDuration * 100); - await tick(); - console.log('Subtitle added to output:', subtitlesOutput); - await new Promise(resolve => setTimeout(resolve, subtitle.duration * 1000)); - console.log('Waited for subtitle duration'); - localTime += subtitle.duration; - i++; - } + onMount(() => { + handleWorkflowChange(); + updateInputs(); + }); - console.log('Finished displaying subtitles'); - }; + function updateInputs() { + const inputGroup = document.getElementById('input-group'); + inputGroup.innerHTML = ''; + const steps = workflows[selectedWorkflow].steps; - await displayNextSubtitle(); - console.log('Finished handleFileUpload'); - } + steps.forEach((step, i) => { + const label = placeholderInputs.reduce((updatedStep, placeholder) => updatedStep.replace(new RegExp(placeholder, 'g'), placeholderValues[placeholder]), step); - function pause() { - paused.update(value => !value); - } + const dependencyText = Array.isArray(timeline[i]) + ? timeline[i].join(', ') + : timeline[i]; - function reset() { - restart.set(true); - } + const inputBox = ` +
+ + + ${timeline[i].length > 0 + ? `Output depends on: ${dependencyText}` + : ''} +
+ `; - function toggleSubtitleMode() { - onlyCurrentSubtitle.update(value => !value); + inputGroup.innerHTML += inputBox; + }); } const writable_props = []; - Object.keys($$props).forEach(key => { - if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$1.warn(` was created with unknown prop '${key}'`); + Object_1.keys($$props).forEach(key => { + if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$1.warn(` was created with unknown prop '${key}'`); }); - const change_handler = e => $$invalidate(0, zipFile = e.target.files[0]); + function select_change_handler() { + selectedWorkflow = select_value(this); + $$invalidate(0, selectedWorkflow); + $$invalidate(3, workflows); + } - function input1_change_handler() { - $onlyCurrentSubtitle = this.checked; - onlyCurrentSubtitle.set($onlyCurrentSubtitle); + function input_input_handler(placeholder) { + placeholderValues[placeholder] = this.value; + $$invalidate(1, placeholderValues); } $$self.$capture_state = () => ({ onMount, - tick, - writable, - JSZip, - zipFile, - subtitlesOutput, - currentTime, - paused, - restart, - onlyCurrentSubtitle, - progress, - totalDuration, - handleFileUpload, - pause, - reset, - toggleSubtitleMode, - $onlyCurrentSubtitle, - $restart, - $paused + workflows, + selectedWorkflow, + placeholderValues, + placeholderInputs, + timeline, + handleWorkflowChange, + processInputs, + updateInputs }); $$self.$inject_state = $$props => { - if ('zipFile' in $$props) $$invalidate(0, zipFile = $$props.zipFile); - if ('subtitlesOutput' in $$props) $$invalidate(1, subtitlesOutput = $$props.subtitlesOutput); - if ('currentTime' in $$props) currentTime = $$props.currentTime; - if ('paused' in $$props) $$invalidate(6, paused = $$props.paused); - if ('restart' in $$props) $$invalidate(7, restart = $$props.restart); - if ('onlyCurrentSubtitle' in $$props) $$invalidate(8, onlyCurrentSubtitle = $$props.onlyCurrentSubtitle); - if ('progress' in $$props) $$invalidate(2, progress = $$props.progress); - if ('totalDuration' in $$props) $$invalidate(3, totalDuration = $$props.totalDuration); + if ('workflows' in $$props) $$invalidate(3, workflows = $$props.workflows); + if ('selectedWorkflow' in $$props) $$invalidate(0, selectedWorkflow = $$props.selectedWorkflow); + if ('placeholderValues' in $$props) $$invalidate(1, placeholderValues = $$props.placeholderValues); + if ('placeholderInputs' in $$props) $$invalidate(2, placeholderInputs = $$props.placeholderInputs); + if ('timeline' in $$props) timeline = $$props.timeline; }; if ($$props && "$$inject" in $$props) { @@ -60674,319 +64737,192 @@ var app = (function () { } return [ - zipFile, - subtitlesOutput, - progress, - totalDuration, - $onlyCurrentSubtitle, - $paused, - paused, - restart, - onlyCurrentSubtitle, - handleFileUpload, - pause, - reset, - change_handler, - input1_change_handler + selectedWorkflow, + placeholderValues, + placeholderInputs, + workflows, + handleWorkflowChange, + processInputs, + updateInputs, + select_change_handler, + input_input_handler ]; } - class PictureSubtitlesbasedonYTTranscript extends SvelteComponentDev { + class LLMWorkflowTest extends SvelteComponentDev { constructor(options) { super(options); init(this, options, instance$4, create_fragment$4, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, - tagName: "PictureSubtitlesbasedonYTTranscript", + tagName: "LLMWorkflowTest", options, id: create_fragment$4.name }); } } - /* src\PSWSasspellingpractice.svelte generated by Svelte v3.59.2 */ - - const file$3 = "src\\PSWSasspellingpractice.svelte"; - - function get_each_context$2(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[3] = list[i]; - child_ctx[5] = i; - return child_ctx; - } + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - function get_each_context_1$1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[6] = list[i]; - return child_ctx; + function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } - function get_each_context_2$1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[9] = list[i]; - return child_ctx; + function commonjsRequire(path) { + throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } - // (25:8) {#if sentence} - function create_if_block(ctx) { - let h4; - let t1; - let div; - let table; - let each_value_1 = extractLetters(/*sentence*/ ctx[3]); - validate_each_argument(each_value_1); - let each_blocks = []; + var jszip_min = {exports: {}}; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1$1(get_each_context_1$1(ctx, each_value_1, i)); - } + /*! - const block = { - c: function create() { - h4 = element("h4"); - h4.textContent = "Extracted Letters:"; - t1 = space(); - div = element("div"); - table = element("table"); + JSZip v3.10.1 - A JavaScript class for generating and reading zip files + - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } + (c) 2009-2016 Stuart Knightley + Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. - add_location(h4, file$3, 25, 10, 918); - add_location(table, file$3, 27, 12, 1058); - set_style(div, "max-height", "275px"); - set_style(div, "max-width", "97%"); - set_style(div, "overflow", "auto"); - set_style(div, "display", "inline-block"); - add_location(div, file$3, 26, 10, 957); - }, - m: function mount(target, anchor) { - insert_dev(target, h4, anchor); - insert_dev(target, t1, anchor); - insert_dev(target, div, anchor); - append_dev(div, table); + JSZip uses the library pako released under the MIT license : + https://github.com/nodeca/pako/blob/main/LICENSE + */ - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(table, null); - } - } - }, - p: function update(ctx, dirty) { - if (dirty & /*extractLetters, sentences*/ 2) { - each_value_1 = extractLetters(/*sentence*/ ctx[3]); - validate_each_argument(each_value_1); - let i; + (function (module, exports) { + !function(e){module.exports=e();}(function(){return function s(a,o,h){function u(r,e){if(!o[r]){if(!a[r]){var t="function"==typeof commonjsRequire&&commonjsRequire;if(!e&&t)return t(r,!0);if(l)return l(r,!0);var n=new Error("Cannot find module '"+r+"'");throw n.code="MODULE_NOT_FOUND",n}var i=o[r]={exports:{}};a[r][0].call(i.exports,function(e){var t=a[r][1][e];return u(t||e)},i,i.exports,s,a,o,h);}return o[r].exports}for(var l="function"==typeof commonjsRequire&&commonjsRequire,e=0;e>2,s=(3&t)<<4|r>>4,a=1>6:64,o=2>4,r=(15&i)<<4|(s=p.indexOf(e.charAt(o++)))>>2,n=(3&s)<<6|(a=p.indexOf(e.charAt(o++))),l[h++]=t,64!==s&&(l[h++]=r),64!==a&&(l[h++]=n);return l};},{"./support":30,"./utils":32}],2:[function(e,t,r){var n=e("./external"),i=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function o(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i;}o.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=o;},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate");},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){var n=e("./utils");var o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e;}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return -1^e}(0|t,e,e.length,0):function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t.charCodeAt(a))];return -1^e}(0|t,e,e.length,0):0};},{"./utils":32}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null;},{}],6:[function(e,t,r){var n=null;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n};},{lie:37}],7:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),s=e("./utils"),a=e("./stream/GenericWorker"),o=n?"uint8array":"array";function h(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={};}r.magic="\b\0",s.inherits(h,a),h.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,e.data),!1);},h.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0);},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null;},h.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta});};},r.compressWorker=function(e){return new h("Deflate",e)},r.uncompressWorker=function(){return new h("Inflate",{})};},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){function A(e,t){var r,n="";for(r=0;r>>=8;return n}function n(e,t,r,n,i,s){var a,o,h=e.file,u=e.compression,l=s!==O.utf8encode,f=I.transformTo("string",s(h.name)),c=I.transformTo("string",O.utf8encode(h.name)),d=h.comment,p=I.transformTo("string",s(d)),m=I.transformTo("string",O.utf8encode(d)),_=c.length!==h.name.length,g=m.length!==d.length,b="",v="",y="",w=h.dir,k=h.date,x={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(x.crc32=e.crc32,x.compressedSize=e.compressedSize,x.uncompressedSize=e.uncompressedSize);var S=0;t&&(S|=8),l||!_&&!g||(S|=2048);var z=0,C=0;w&&(z|=16),"UNIX"===i?(C=798,z|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(h.unixPermissions,w)):(C=20,z|=function(e){return 63&(e||0)}(h.dosPermissions)),a=k.getUTCHours(),a<<=6,a|=k.getUTCMinutes(),a<<=5,a|=k.getUTCSeconds()/2,o=k.getUTCFullYear()-1980,o<<=4,o|=k.getUTCMonth()+1,o<<=5,o|=k.getUTCDate(),_&&(v=A(1,1)+A(B(f),4)+c,b+="up"+A(v.length,2)+v),g&&(y=A(1,1)+A(B(p),4)+m,b+="uc"+A(y.length,2)+y);var E="";return E+="\n\0",E+=A(S,2),E+=u.magic,E+=A(a,2),E+=A(o,2),E+=A(x.crc32,4),E+=A(x.compressedSize,4),E+=A(x.uncompressedSize,4),E+=A(f.length,2),E+=A(b.length,2),{fileRecord:R.LOCAL_FILE_HEADER+E+f+b,dirRecord:R.CENTRAL_FILE_HEADER+A(C,2)+E+A(p.length,2)+"\0\0\0\0"+A(z,4)+A(n,4)+f+b+p}}var I=e("../utils"),i=e("../stream/GenericWorker"),O=e("../utf8"),B=e("../crc32"),R=e("../signature");function s(e,t,r,n){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[];}I.inherits(s,i),s.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}));},s.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=n(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}});}else this.accumulate=!0;},s.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=n(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return R.DATA_DESCRIPTOR+A(e.crc32,4)+A(e.compressedSize,4)+A(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null;},s.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i;},{"../utils":32}],19:[function(e,t,r){var n=e("./Uint8ArrayReader");function i(e){n.call(this,e);}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i;},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e);}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i;},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){var n=e("./ArrayReader");function i(e){n.call(this,e);}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i;},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){var n=e("../utils"),i=e("../support"),s=e("./ArrayReader"),a=e("./StringReader"),o=e("./NodeBufferReader"),h=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new o(e):i.uint8array?new h(n.transformTo("uint8array",e)):new s(n.transformTo("array",e)):new a(e)};},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b";},{}],24:[function(e,t,r){var n=e("./GenericWorker"),i=e("../utils");function s(e){n.call(this,"ConvertWorker to "+e),this.destType=e;}i.inherits(s,n),s.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta});},t.exports=s;},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){var n=e("./GenericWorker"),i=e("../crc32");function s(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0);}e("../utils").inherits(s,n),s.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e);},t.exports=s;},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0);}n.inherits(s,i),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length;}i.prototype.processChunk.call(this,e);},t.exports=s;},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function s(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat();},function(e){t.error(e);});}n.inherits(s,i),s.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null;},s.prototype.resume=function(){return !!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0));},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return !1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t);}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s;},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null;}n.prototype={push:function(e){this.emit("data",e);},end:function(){if(this.isFinished)return !1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0;}catch(e){this.emit("error",e);}return !0},error:function(e){return !this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[];},emit:function(e,t){if(this._listeners[e])for(var r=0;r "+e:e}},t.exports=n;},{}],29:[function(e,t,r){var h=e("../utils"),i=e("./ConvertWorker"),s=e("./GenericWorker"),u=e("../base64"),n=e("../support"),a=e("../external"),o=null;if(n.nodestream)try{o=e("../nodejs/NodejsStreamOutputAdapter");}catch(e){}function l(e,o){return new a.Promise(function(t,r){var n=[],i=e._internalType,s=e._outputType,a=e._mimeType;e.on("data",function(e,t){n.push(e),o&&o(t);}).on("error",function(e){n=[],r(e);}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return h.newBlob(h.transformTo("arraybuffer",t),r);case"base64":return u.encode(t);default:return h.transformTo(e,t)}}(s,function(e,t){var r,n=0,i=null,s=0;for(r=0;r>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return h.nodebuffer?o.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,n,i,s=e.length,a=new Array(2*s);for(t=r=0;t>10&1023,a[r++]=56320|1023&n);}return a.length!==r&&(a.subarray?a=a.subarray(0,r):a.length=r),o.applyFromCharCode(a)}(e=o.transformTo(h.uint8array?"uint8array":"array",e))},o.inherits(a,n),a.prototype.processChunk=function(e){var t=o.transformTo(h.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(h.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length);}else t=this.leftOver.concat(t);this.leftOver=null;}var n=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t}(t),i=t;n!==t.length&&(h.uint8array?(i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length)):(i=t.slice(0,n),this.leftOver=t.slice(n,t.length))),this.push({data:s.utf8decode(i),meta:e.meta});},a.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null);},s.Utf8DecodeWorker=a,o.inherits(l,n),l.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta});},s.Utf8EncodeWorker=l;},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,a){var o=e("./support"),h=e("./base64"),r=e("./nodejsUtils"),u=e("./external");function n(e){return e}function l(e,t){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0);},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4));}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new h.Buf8(e.length),r=0,n=t.length;r>10&1023,o[n++]=56320|1023&i);}return l(o,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+u[e[r]]>t?r:t};},{"./common":41}],43:[function(e,t,r){t.exports=function(e,t,r,n){for(var i=65535&e|0,s=e>>>16&65535|0,a=0;0!==r;){for(r-=a=2e3>>1:e>>>1;t[r]=e;}return t}();t.exports=function(e,t,r,n){var i=o,s=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return -1^e};},{}],46:[function(e,t,r){var h,c=e("../utils/common"),u=e("./trees"),d=e("./adler32"),p=e("./crc32"),n=e("./messages"),l=0,f=4,m=0,_=-2,g=-1,b=4,i=2,v=8,y=9,s=286,a=30,o=19,w=2*s+1,k=15,x=3,S=258,z=S+x+1,C=42,E=113,A=1,I=2,O=3,B=4;function R(e,t){return e.msg=n[t],t}function T(e){return (e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(c.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0));}function N(e,t){u._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm);}function U(e,t){e.pending_buf[e.pending++]=t;}function P(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t;}function L(e,t){var r,n,i=e.max_chain_length,s=e.strstart,a=e.prev_length,o=e.nice_match,h=e.strstart>e.w_size-z?e.strstart-(e.w_size-z):0,u=e.window,l=e.w_mask,f=e.prev,c=e.strstart+S,d=u[s+a-1],p=u[s+a];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(u[(r=t)+a]===p&&u[r+a-1]===d&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&sh&&0!=--i);return a<=e.lookahead?a:e.lookahead}function j(e){var t,r,n,i,s,a,o,h,u,l,f=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-z)){for(c.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=r=e.hash_size;n=e.head[--t],e.head[t]=f<=n?n-f:0,--r;);for(t=r=f;n=e.prev[--t],e.prev[t]=f<=n?n-f:0,--r;);i+=f;}if(0===e.strm.avail_in)break;if(a=e.strm,o=e.window,h=e.strstart+e.lookahead,u=i,l=void 0,l=a.avail_in,u=x)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x)if(n=u._tr_tally(e,e.strstart-e.match_start,e.match_length-x),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=x){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=x&&(e.ins_h=(e.ins_h<=x&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-x,n=u._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-x),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(j(e),0===e.lookahead&&t===l)return A;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,N(e,!1),0===e.strm.avail_out))return A;if(e.strstart-e.block_start>=e.w_size-z&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):(e.strstart>e.block_start&&(N(e,!1),e.strm.avail_out),A)}),new M(4,4,8,4,Z),new M(4,5,16,8,Z),new M(4,6,32,32,Z),new M(4,4,16,16,W),new M(8,16,32,32,W),new M(8,16,128,128,W),new M(8,32,128,256,W),new M(32,128,258,1024,W),new M(32,258,258,4096,W)],r.deflateInit=function(e,t){return Y(e,t,v,15,8,0)},r.deflateInit2=Y,r.deflateReset=K,r.deflateResetKeep=G,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?_:(e.state.gzhead=t,m):_},r.deflate=function(e,t){var r,n,i,s;if(!e||!e.state||5>8&255),U(n,n.gzhead.time>>16&255),U(n,n.gzhead.time>>24&255),U(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),U(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(U(n,255&n.gzhead.extra.length),U(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=p(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(U(n,0),U(n,0),U(n,0),U(n,0),U(n,0),U(n,9===n.level?2:2<=n.strategy||n.level<2?4:0),U(n,3),n.status=E);else {var a=v+(n.w_bits-8<<4)<<8;a|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=32),a+=31-a%31,n.status=E,P(n,a),0!==n.strstart&&(P(n,e.adler>>>16),P(n,65535&e.adler)),e.adler=1;}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending!==n.pending_buf_size));)U(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73);}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.gzindex=0,n.status=91);}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),F(e),i=n.pending,n.pending===n.pending_buf_size)){s=1;break}s=n.gzindexi&&(e.adler=p(e.adler,n.pending_buf,n.pending-i,i)),0===s&&(n.status=103);}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&F(e),n.pending+2<=n.pending_buf_size&&(U(n,255&e.adler),U(n,e.adler>>8&255),e.adler=0,n.status=E)):n.status=E),0!==n.pending){if(F(e),0===e.avail_out)return n.last_flush=-1,m}else if(0===e.avail_in&&T(t)<=T(r)&&t!==f)return R(e,-5);if(666===n.status&&0!==e.avail_in)return R(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==l&&666!==n.status){var o=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(j(e),0===e.lookahead)){if(t===l)return A;break}if(e.match_length=0,r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):3===n.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=S){if(j(e),e.lookahead<=S&&t===l)return A;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=x&&0e.lookahead&&(e.match_length=e.lookahead);}if(e.match_length>=x?(r=u._tr_tally(e,1,e.match_length-x),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=u._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(N(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===f?(N(e,!0),0===e.strm.avail_out?O:B):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?A:I}(n,t):h[n.level].func(n,t);if(o!==O&&o!==B||(n.status=666),o===A||o===O)return 0===e.avail_out&&(n.last_flush=-1),m;if(o===I&&(1===t?u._tr_align(n):5!==t&&(u._tr_stored_block(n,0,0,!1),3===t&&(D(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),F(e),0===e.avail_out))return n.last_flush=-1,m}return t!==f?m:n.wrap<=0?1:(2===n.wrap?(U(n,255&e.adler),U(n,e.adler>>8&255),U(n,e.adler>>16&255),U(n,e.adler>>24&255),U(n,255&e.total_in),U(n,e.total_in>>8&255),U(n,e.total_in>>16&255),U(n,e.total_in>>24&255)):(P(n,e.adler>>>16),P(n,65535&e.adler)),F(e),0=r.w_size&&(0===s&&(D(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new c.Buf8(r.w_size),c.arraySet(u,t,l-r.w_size,r.w_size,0),t=u,l=r.w_size),a=e.avail_in,o=e.next_in,h=e.input,e.avail_in=l,e.next_in=0,e.input=t,j(r);r.lookahead>=x;){for(n=r.strstart,i=r.lookahead-(x-1);r.ins_h=(r.ins_h<>>=y=v>>>24,p-=y,0===(y=v>>>16&255))C[s++]=65535&v;else {if(!(16&y)){if(0==(64&y)){v=m[(65535&v)+(d&(1<>>=y,p-=y),p<15&&(d+=z[n++]<>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(d&(1<>>=y,p-=y,(y=s-a)>3,d&=(1<<(p-=w<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new I.Buf16(320),this.work=new I.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0;}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=P,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new I.Buf32(n),t.distcode=t.distdyn=new I.Buf32(i),t.sane=1,t.back=-1,N):U}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):U}function h(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(I.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n<(i=s.wsize-s.wnext)&&(i=n),I.arraySet(s.window,t,r-n,i,s.wnext),(n-=i)?(I.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=B(r.check,E,2,0),l=u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&u)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&u)){e.msg="unknown compression method",r.mode=30;break}if(l-=4,k=8+(15&(u>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=3;case 3:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,r.check=B(r.check,E,4,0)),l=u=0,r.mode=4;case 4:for(;l<16;){if(0===o)break e;o--,u+=n[s++]<>8),512&r.flags&&(E[0]=255&u,E[1]=u>>>8&255,r.check=B(r.check,E,2,0)),l=u=0,r.mode=5;case 5:if(1024&r.flags){for(;l<16;){if(0===o)break e;o--,u+=n[s++]<>>8&255,r.check=B(r.check,E,2,0)),l=u=0;}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(d=r.length)&&(d=o),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),I.arraySet(r.head.extra,n,s,d,k)),512&r.flags&&(r.check=B(r.check,n,d,s)),o-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;for(d=0;k=n[s+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k)),k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;l<32;){if(0===o)break e;o--,u+=n[s++]<>>=7&l,l-=7&l,r.mode=27;break}for(;l<3;){if(0===o)break e;o--,u+=n[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(j(r),r.mode=20,6!==t)break;u>>>=2,l-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30;}u>>>=2,l-=2;break;case 14:for(u>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,u+=n[s++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&u,l=u=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(d=r.length){if(o>>=5,l-=5,r.ndist=1+(31&u),u>>>=5,l-=5,r.ncode=4+(15&u),u>>>=4,l-=4,286>>=3,l-=3;}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},x=T(0,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=_,l-=_,r.lens[r.have++]=b;else {if(16===b){for(z=_+2;l>>=_,l-=_,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}k=r.lens[r.have-1],d=3+(3&u),u>>>=2,l-=2;}else if(17===b){for(z=_+3;l>>=_)),u>>>=3,l-=3;}else {for(z=_+7;l>>=_)),u>>>=7,l-=7;}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=k;}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,S={bits:r.lenbits},x=T(D,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,x){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},x=T(F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,x){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=o&&258<=h){e.next_out=a,e.avail_out=h,e.next_in=s,e.avail_in=o,r.hold=u,r.bits=l,R(e,c),a=e.next_out,i=e.output,h=e.avail_out,s=e.next_in,n=e.input,o=e.avail_in,u=r.hold,l=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;g=(C=r.lencode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=v,l-=v,r.back+=v;}if(u>>>=_,l-=_,r.back+=_,r.length=b,0===g){r.mode=26;break}if(32&g){r.back=-1,r.mode=12;break}if(64&g){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&g,r.mode=22;case 22:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra;}r.was=r.length,r.mode=23;case 23:for(;g=(C=r.distcode[u&(1<>>16&255,b=65535&C,!((_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>v)])>>>16&255,b=65535&C,!(v+(_=C>>>24)<=l);){if(0===o)break e;o--,u+=n[s++]<>>=v,l-=v,r.back+=v;}if(u>>>=_,l-=_,r.back+=_,64&g){e.msg="invalid distance code",r.mode=30;break}r.offset=b,r.extra=15&g,r.mode=24;case 24:if(r.extra){for(z=r.extra;l>>=r.extra,l-=r.extra,r.back+=r.extra;}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===h)break e;if(d=c-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}p=d>r.wnext?(d-=r.wnext,r.wsize-d):r.wnext-d,d>r.length&&(d=r.length),m=r.window;}else m=i,p=a-r.offset,d=r.length;for(hd?(m=R[T+a[v]],A[I+a[v]]):(m=96,0),h=1<>S)+(u-=h)]=p<<24|m<<16|_|0,0!==u;);for(h=1<>=1;if(0!==h?(E&=h-1,E+=h):E=0,v++,0==--O[b]){if(b===w)break;b=t[r+a[v]];}if(k>>7)]}function U(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255;}function P(e,t,r){e.bi_valid>d-r?(e.bi_buf|=t<>d-e.bi_valid,e.bi_valid+=r-d):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function Z(e,t,r){var n,i,s=new Array(g+1),a=0;for(n=1;n<=g;n++)s[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=j(s[o]++,o));}}function W(e){var t;for(t=0;t>1;1<=r;r--)G(e,s,r);for(i=h;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,s[2*i]=s[2*r]+s[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,s[2*r+1]=s[2*n+1]=i,e.heap[1]=i++,G(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,s,a,o,h=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,f=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=g;s++)e.bl_count[s]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<_;r++)p<(s=h[2*h[2*(n=e.heap[r])+1]+1]+1)&&(s=p,m++),h[2*n+1]=s,u>=7;n>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return h;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?J(e,t,r,n):4===e.strategy||s===i?(P(e,2+(n?1:0),3),K(e,z,C)):(P(e,4+(n?1:0),3),function(e,t,r,n){var i;for(P(e,t-257,5),P(e,r-1,5),P(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(A[r]+u+1)]++,e.dyn_dtree[2*N(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){P(e,2,3),L(e,m,z),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8);}(e);};},{"../utils/common":41}],53:[function(e,t,r){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0;};},{}],54:[function(e,t,r){(function(e){!function(r,n){if(!r.setImmediate){var i,s,t,a,o=1,h={},u=!1,l=r.document,e=Object.getPrototypeOf&&Object.getPrototypeOf(r);e=e&&e.setTimeout?e:r,i="[object process]"==={}.toString.call(r.process)?function(e){process.nextTick(function(){c(e);});}:function(){if(r.postMessage&&!r.importScripts){var e=!0,t=r.onmessage;return r.onmessage=function(){e=!1;},r.postMessage("","*"),r.onmessage=t,e}}()?(a="setImmediate$"+Math.random()+"$",r.addEventListener?r.addEventListener("message",d,!1):r.attachEvent("onmessage",d),function(e){r.postMessage(a+e,"*");}):r.MessageChannel?((t=new MessageChannel).port1.onmessage=function(e){c(e.data);},function(e){t.port2.postMessage(e);}):l&&"onreadystatechange"in l.createElement("script")?(s=l.documentElement,function(e){var t=l.createElement("script");t.onreadystatechange=function(){c(e),t.onreadystatechange=null,s.removeChild(t),t=null;},s.appendChild(t);}):function(e){setTimeout(c,0,e);},e.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r word.length)); - const result = []; - - for (let i = 0; i < maxLength; i++) { - const letters = words.map(word => word[i] || ''); - result.push(letters); - } - - return result; - } - function instance$3($$self, $$props, $$invalidate) { - let sentences; + let $onlyCurrentSubtitle; + let $restart; + let $paused; + let $ytsubcurrenttext; + let $ytsubcurrentID; + let $ytsubuseplayer; + validate_store(ytsubcurrenttext, 'ytsubcurrenttext'); + component_subscribe($$self, ytsubcurrenttext, $$value => $$invalidate(21, $ytsubcurrenttext = $$value)); + validate_store(ytsubcurrentID, 'ytsubcurrentID'); + component_subscribe($$self, ytsubcurrentID, $$value => $$invalidate(22, $ytsubcurrentID = $$value)); + validate_store(ytsubuseplayer, 'ytsubuseplayer'); + component_subscribe($$self, ytsubuseplayer, $$value => $$invalidate(9, $ytsubuseplayer = $$value)); let { $$slots: slots = {}, $$scope } = $$props; - validate_slots('PSWSasspellingpractice', slots, []); - let inputText = ''; - 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}'`); - }); + validate_slots('PictureSubtitlesbasedonYTTranscript', slots, []); + let zipFile; + let subtitlesOutput = []; //writable([]); + let currentTime = writable(0); // Track current time + let paused = writable(false); // Control pause state + validate_store(paused, 'paused'); + component_subscribe($$self, paused, value => $$invalidate(8, $paused = value)); + let restart = writable(false); // Signal to restart + validate_store(restart, 'restart'); + component_subscribe($$self, restart, value => $$invalidate(20, $restart = value)); + let onlyCurrentSubtitle = writable(false); // Control subtitle display mode + validate_store(onlyCurrentSubtitle, 'onlyCurrentSubtitle'); + component_subscribe($$self, onlyCurrentSubtitle, value => $$invalidate(7, $onlyCurrentSubtitle = value)); + let progress = 0; + let totalDuration = 0; - function textarea_input_handler() { - inputText = this.value; - $$invalidate(0, inputText); - } + //let useYTPlayer = writable(false); + let uistatusupdate = null; - $$self.$capture_state = () => ({ inputText, extractLetters, sentences }); + let uiTimeStatus = 0; + let subtitleVideoDetailsFileData = null; + let subtitleVideoTitle = null; - $$self.$inject_state = $$props => { - if ('inputText' in $$props) $$invalidate(0, inputText = $$props.inputText); - if ('sentences' in $$props) $$invalidate(1, sentences = $$props.sentences); - }; + async function handleFileUpload() { + // Reset the component state + $$invalidate(1, subtitlesOutput = []); - if ($$props && "$$inject" in $$props) { - $$self.$inject_state($$props.$$inject); - } + currentTime.set(0); + paused.set(false); + restart.set(false); + onlyCurrentSubtitle.set(false); + $$invalidate(2, progress = 0); + $$invalidate(3, totalDuration = 0); - $$self.$$.update = () => { - if ($$self.$$.dirty & /*inputText*/ 1) { - $$invalidate(1, sentences = inputText.split(/[.?!:]/).map(sentence => sentence.trim()).filter(sentence => sentence !== '')); + if (!zipFile) { + console.log('No zip file selected'); + return; } - }; - return [inputText, sentences, textarea_input_handler]; - } + const zip = new JSZip(); + const contents = await zip.loadAsync(zipFile); + console.log('Zip file loaded'); + const subtitlesFile = await contents.file('preprocessed_subtitles.json').async('text'); + const subtitlesVideoDetailsFile = await contents.file('YTTVideoInfo.txt'); - class PSWSasspellingpractice extends SvelteComponentDev { - constructor(options) { - super(options); - init(this, options, instance$3, create_fragment$3, safe_not_equal, {}); + if (subtitlesVideoDetailsFile) { + const textContent = await subtitlesVideoDetailsFile.async('text'); - dispatch_dev("SvelteRegisterComponent", { - component: this, - tagName: "PSWSasspellingpractice", - options, - id: create_fragment$3.name - }); - } - } + try { + subtitleVideoDetailsFileData = JSON.parse(textContent); + console.log(subtitleVideoDetailsFileData["video_id"]); - /* src\BrainstormGameConfigsRandom.svelte generated by Svelte v3.59.2 */ + if ($ytsubuseplayer) { + set_store_value(ytsubcurrentID, $ytsubcurrentID = subtitleVideoDetailsFileData["video_id"], $ytsubcurrentID); + } - const { console: console_1 } = globals; - const file$2 = "src\\BrainstormGameConfigsRandom.svelte"; + $$invalidate(6, subtitleVideoTitle = subtitleVideoDetailsFileData["title"]); + } catch(error) { + console.error('Error parsing JSON:', error); + } + } else { + console.error('Text file not found in the ZIP file.'); + } - function get_each_context$1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[6] = list[i]; - child_ctx[8] = i; - return child_ctx; - } + const preprocessedSubtitles = JSON.parse(subtitlesFile); + preprocessedSubtitles.sort((a, b) => a.start - b.start); + console.log('Subtitles parsed and sorted'); + $$invalidate(4, uistatusupdate = 'Subtitles parsed and sorted - Syncing to time has started'); + let localTime = 0; + let i = 0; - function get_each_context_1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[9] = list[i]; - return child_ctx; - } + const displayNextSubtitle = async () => { + console.log('Starting displayNextSubtitle'); + $$invalidate(3, totalDuration = preprocessedSubtitles.reduce((total, subtitle) => total + subtitle.duration, 0)); - function get_each_context_2(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[12] = list[i]; - return child_ctx; - } + while (i < preprocessedSubtitles.length) { + const subtitle = preprocessedSubtitles[i]; + console.log('Current subtitle:', subtitle); + set_store_value(ytsubcurrenttext, $ytsubcurrenttext = subtitle.text, $ytsubcurrenttext); - function get_each_context_3(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[15] = list[i]; - child_ctx[8] = i; - return child_ctx; - } + if (localTime < subtitle.start) { + await new Promise(resolve => setTimeout(resolve, (subtitle.start - localTime) * 1000)); + console.log('Waited for subtitle start time'); + } - function get_each_context_4(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[9] = list[i]; - return child_ctx; - } + if ($paused) { + await new Promise(resolve => paused.subscribe(value => !value && resolve())); + console.log('Resumed from pause'); + } - function get_each_context_5(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[12] = list[i]; - return child_ctx; - } + if ($restart) { + localTime = 0; + i = 0; + $$invalidate(1, subtitlesOutput = []); + restart.set(false); + console.log('Restarted subtitles'); + continue; + } - function get_each_context_6(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[21] = list[i]; - return child_ctx; - } + const images = await Promise.all(subtitle.image_paths.map(async path => URL.createObjectURL(await contents.file(path).async('blob')))); - function get_each_context_7(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[24] = list[i]; - return child_ctx; - } + if ($onlyCurrentSubtitle) { + $$invalidate(1, subtitlesOutput = [{ text: subtitle.text, images }]); + } else { + $$invalidate(1, subtitlesOutput = [...subtitlesOutput, { text: subtitle.text, images }]); + } - // (158:12) {#each randomContent.inventory as item} - function create_each_block_7(ctx) { - let li; - let t0_value = /*item*/ ctx[24].name + ""; - let t0; - let t1; - let t2_value = /*item*/ ctx[24].description + ""; - let t2; + $$invalidate(2, progress = localTime / totalDuration * 100); + await tick(); + console.log('Subtitle added to output:', subtitlesOutput); + await new Promise(resolve => setTimeout(resolve, subtitle.duration * 1000)); + console.log('Waited for subtitle duration'); + ($$invalidate(4, uistatusupdate = 'Waited for subtitle duration')); + $$invalidate(5, uiTimeStatus = localTime); + localTime += subtitle.duration; + i++; + } - const block = { - c: function create() { - li = element("li"); - t0 = text(t0_value); - t1 = text(" - "); - t2 = text(t2_value); - add_location(li, file$2, 158, 16, 6725); - }, - m: function mount(target, anchor) { - insert_dev(target, li, anchor); - append_dev(li, t0); - append_dev(li, t1); - append_dev(li, t2); - }, - p: function update(ctx, dirty) { - if (dirty & /*randomContent*/ 1 && t0_value !== (t0_value = /*item*/ ctx[24].name + "")) set_data_dev(t0, t0_value); - if (dirty & /*randomContent*/ 1 && t2_value !== (t2_value = /*item*/ ctx[24].description + "")) set_data_dev(t2, t2_value); - }, - d: function destroy(detaching) { - if (detaching) detach_dev(li); - } - }; + console.log('Finished displaying subtitles'); + }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block_7.name, - type: "each", - source: "(158:12) {#each randomContent.inventory as item}", - ctx - }); + await displayNextSubtitle(); + console.log('Finished handleFileUpload'); + } - return block; - } + function pause() { + paused.update(value => !value); + } - // (167:12) {#each randomContent.skills as skill} - function create_each_block_6(ctx) { - let li; - let t0_value = /*skill*/ ctx[21].branch + ""; - let t0; - let t1; - let t2_value = /*skill*/ ctx[21].name + ""; - let t2; + function reset() { + restart.set(true); + } - const block = { - c: function create() { - li = element("li"); - t0 = text(t0_value); - t1 = text(" - "); - t2 = text(t2_value); - attr_dev(li, "class", "svelte-wnpr4k"); - toggle_class(li, "learned", /*skill*/ ctx[21].learned); - add_location(li, file$2, 167, 16, 6959); - }, - m: function mount(target, anchor) { - insert_dev(target, li, anchor); - append_dev(li, t0); - append_dev(li, t1); - append_dev(li, t2); - }, - p: function update(ctx, dirty) { - if (dirty & /*randomContent*/ 1 && t0_value !== (t0_value = /*skill*/ ctx[21].branch + "")) set_data_dev(t0, t0_value); - if (dirty & /*randomContent*/ 1 && t2_value !== (t2_value = /*skill*/ ctx[21].name + "")) set_data_dev(t2, t2_value); + function toggleSubtitleMode() { + onlyCurrentSubtitle.update(value => !value); + } - if (dirty & /*randomContent*/ 1) { - toggle_class(li, "learned", /*skill*/ ctx[21].learned); - } - }, - d: function destroy(detaching) { - if (detaching) detach_dev(li); - } - }; + const writable_props = []; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block_6.name, - type: "each", - source: "(167:12) {#each randomContent.skills as skill}", - ctx + 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}'`); }); - return block; - } + function input0_change_handler() { + $ytsubuseplayer = this.checked; + ytsubuseplayer.set($ytsubuseplayer); + } - // (176:12) {#each randomContent.objectives as objective} - function create_each_block_5(ctx) { - let li; - let t0_value = /*objective*/ ctx[12].id + ""; - let t0; - let t1; - let t2_value = /*objective*/ ctx[12].name + ""; - let t2; + const change_handler = e => $$invalidate(0, zipFile = e.target.files[0]); - const block = { - c: function create() { - li = element("li"); - t0 = text(t0_value); - t1 = text(" - "); - t2 = text(t2_value); - attr_dev(li, "class", "svelte-wnpr4k"); - toggle_class(li, "complete", /*objective*/ ctx[12].complete); - add_location(li, file$2, 176, 16, 7232); - }, - m: function mount(target, anchor) { - insert_dev(target, li, anchor); - append_dev(li, t0); - append_dev(li, t1); - append_dev(li, t2); - }, - p: function update(ctx, dirty) { - if (dirty & /*randomContent*/ 1 && t0_value !== (t0_value = /*objective*/ ctx[12].id + "")) set_data_dev(t0, t0_value); - if (dirty & /*randomContent*/ 1 && t2_value !== (t2_value = /*objective*/ ctx[12].name + "")) set_data_dev(t2, t2_value); + function input2_change_handler() { + $onlyCurrentSubtitle = this.checked; + onlyCurrentSubtitle.set($onlyCurrentSubtitle); + } - if (dirty & /*randomContent*/ 1) { - toggle_class(li, "complete", /*objective*/ ctx[12].complete); - } - }, - d: function destroy(detaching) { - if (detaching) detach_dev(li); - } + $$self.$capture_state = () => ({ + onMount, + tick, + writable, + JSZip, + ytsubcurrenttext, + ytsubcurrentID, + ytsubuseplayer, + ytsubuse, + zipFile, + subtitlesOutput, + currentTime, + paused, + restart, + onlyCurrentSubtitle, + progress, + totalDuration, + uistatusupdate, + uiTimeStatus, + subtitleVideoDetailsFileData, + subtitleVideoTitle, + handleFileUpload, + pause, + reset, + toggleSubtitleMode, + $onlyCurrentSubtitle, + $restart, + $paused, + $ytsubcurrenttext, + $ytsubcurrentID, + $ytsubuseplayer + }); + + $$self.$inject_state = $$props => { + if ('zipFile' in $$props) $$invalidate(0, zipFile = $$props.zipFile); + if ('subtitlesOutput' in $$props) $$invalidate(1, subtitlesOutput = $$props.subtitlesOutput); + if ('currentTime' in $$props) currentTime = $$props.currentTime; + if ('paused' in $$props) $$invalidate(10, paused = $$props.paused); + if ('restart' in $$props) $$invalidate(11, restart = $$props.restart); + if ('onlyCurrentSubtitle' in $$props) $$invalidate(12, onlyCurrentSubtitle = $$props.onlyCurrentSubtitle); + if ('progress' in $$props) $$invalidate(2, progress = $$props.progress); + if ('totalDuration' in $$props) $$invalidate(3, totalDuration = $$props.totalDuration); + if ('uistatusupdate' in $$props) $$invalidate(4, uistatusupdate = $$props.uistatusupdate); + if ('uiTimeStatus' in $$props) $$invalidate(5, uiTimeStatus = $$props.uiTimeStatus); + if ('subtitleVideoDetailsFileData' in $$props) subtitleVideoDetailsFileData = $$props.subtitleVideoDetailsFileData; + if ('subtitleVideoTitle' in $$props) $$invalidate(6, subtitleVideoTitle = $$props.subtitleVideoTitle); }; - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block_5.name, - type: "each", - source: "(176:12) {#each randomContent.objectives as objective}", - ctx - }); + if ($$props && "$$inject" in $$props) { + $$self.$inject_state($$props.$$inject); + } - return block; + return [ + zipFile, + subtitlesOutput, + progress, + totalDuration, + uistatusupdate, + uiTimeStatus, + subtitleVideoTitle, + $onlyCurrentSubtitle, + $paused, + $ytsubuseplayer, + paused, + restart, + onlyCurrentSubtitle, + handleFileUpload, + pause, + reset, + input0_change_handler, + change_handler, + input2_change_handler + ]; } - // (188:16) {#each chapter.targets as target} - function create_each_block_4(ctx) { - let li; - let t0_value = /*target*/ ctx[9].name + ""; - let t0; - let t1; - let t2_value = /*target*/ ctx[9].x + ""; - let t2; - let t3; - let t4_value = /*target*/ ctx[9].y + ""; - let t4; - let t5; - let t6_value = /*target*/ ctx[9].collisionType + ""; - let t6; + class PictureSubtitlesbasedonYTTranscript extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance$3, create_fragment$3, safe_not_equal, {}); - const block = { - c: function create() { - li = element("li"); - t0 = text(t0_value); - t1 = text(" - ("); - t2 = text(t2_value); - t3 = text(", "); - t4 = text(t4_value); - t5 = text(") - "); - t6 = text(t6_value); - add_location(li, file$2, 188, 16, 7624); - }, - m: function mount(target, anchor) { - insert_dev(target, li, anchor); - append_dev(li, t0); - append_dev(li, t1); - append_dev(li, t2); - append_dev(li, t3); - append_dev(li, t4); - append_dev(li, t5); - append_dev(li, t6); - }, - p: function update(ctx, dirty) { - if (dirty & /*randomContent*/ 1 && t0_value !== (t0_value = /*target*/ ctx[9].name + "")) set_data_dev(t0, t0_value); - if (dirty & /*randomContent*/ 1 && t2_value !== (t2_value = /*target*/ ctx[9].x + "")) set_data_dev(t2, t2_value); - if (dirty & /*randomContent*/ 1 && t4_value !== (t4_value = /*target*/ ctx[9].y + "")) set_data_dev(t4, t4_value); - if (dirty & /*randomContent*/ 1 && t6_value !== (t6_value = /*target*/ ctx[9].collisionType + "")) set_data_dev(t6, t6_value); - }, - d: function destroy(detaching) { - if (detaching) detach_dev(li); - } - }; + dispatch_dev("SvelteRegisterComponent", { + component: this, + tagName: "PictureSubtitlesbasedonYTTranscript", + options, + id: create_fragment$3.name + }); + } + } + + /* src\PSWSasspellingpractice.svelte generated by Svelte v3.59.2 */ - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block_4.name, - type: "each", - source: "(188:16) {#each chapter.targets as target}", - ctx - }); + const file$2 = "src\\PSWSasspellingpractice.svelte"; - return block; + function get_each_context$1(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[3] = list[i]; + child_ctx[5] = i; + return child_ctx; } - // (184:12) {#each randomContent.story as chapter, i} - function create_each_block_3(ctx) { - let h3; - let t0; - let t1_value = /*i*/ ctx[8] + 1 + ""; + function get_each_context_1(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[6] = list[i]; + return child_ctx; + } + + function get_each_context_2(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[9] = list[i]; + return child_ctx; + } + + // (25:8) {#if sentence} + function create_if_block(ctx) { + let h4; let t1; - let t2; - let p; - let t4; - let ul; - let t5; - let each_value_4 = /*chapter*/ ctx[15].targets; - validate_each_argument(each_value_4); + let div; + let table; + let each_value_1 = extractLetters(/*sentence*/ ctx[3]); + validate_each_argument(each_value_1); let each_blocks = []; - for (let i = 0; i < each_value_4.length; i += 1) { - each_blocks[i] = create_each_block_4(get_each_context_4(ctx, each_value_4, i)); + 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)); } const block = { c: function create() { - h3 = element("h3"); - t0 = text("Chapter "); - t1 = text(t1_value); - t2 = space(); - p = element("p"); - p.textContent = "Targets:"; - t4 = space(); - ul = element("ul"); + h4 = element("h4"); + h4.textContent = "Extracted Letters:"; + t1 = space(); + div = element("div"); + table = element("table"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - t5 = space(); - add_location(h3, file$2, 184, 12, 7484); - add_location(p, file$2, 185, 12, 7522); - add_location(ul, file$2, 186, 12, 7551); + add_location(h4, file$2, 25, 10, 918); + add_location(table, file$2, 27, 12, 1058); + set_style(div, "max-height", "275px"); + set_style(div, "max-width", "97%"); + set_style(div, "overflow", "auto"); + set_style(div, "display", "inline-block"); + add_location(div, file$2, 26, 10, 957); }, m: function mount(target, anchor) { - insert_dev(target, h3, anchor); - append_dev(h3, t0); - append_dev(h3, t1); - insert_dev(target, t2, anchor); - insert_dev(target, p, anchor); - insert_dev(target, t4, anchor); - insert_dev(target, ul, anchor); + insert_dev(target, h4, anchor); + insert_dev(target, t1, anchor); + insert_dev(target, div, anchor); + append_dev(div, table); for (let i = 0; i < each_blocks.length; i += 1) { if (each_blocks[i]) { - each_blocks[i].m(ul, null); + each_blocks[i].m(table, null); } } - - append_dev(ul, t5); }, p: function update(ctx, dirty) { - if (dirty & /*randomContent*/ 1) { - each_value_4 = /*chapter*/ ctx[15].targets; - validate_each_argument(each_value_4); + if (dirty & /*extractLetters, sentences*/ 2) { + each_value_1 = extractLetters(/*sentence*/ ctx[3]); + validate_each_argument(each_value_1); let i; - for (i = 0; i < each_value_4.length; i += 1) { - const child_ctx = get_each_context_4(ctx, each_value_4, i); + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_1(ctx, each_value_1, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); } else { - each_blocks[i] = create_each_block_4(child_ctx); + each_blocks[i] = create_each_block_1(child_ctx); each_blocks[i].c(); - each_blocks[i].m(ul, t5); + each_blocks[i].m(table, null); } } @@ -61514,67 +65534,49 @@ var app = (function () { each_blocks[i].d(1); } - each_blocks.length = each_value_4.length; + each_blocks.length = each_value_1.length; } }, d: function destroy(detaching) { - if (detaching) detach_dev(h3); - if (detaching) detach_dev(t2); - if (detaching) detach_dev(p); - if (detaching) detach_dev(t4); - if (detaching) detach_dev(ul); + if (detaching) detach_dev(h4); + if (detaching) detach_dev(t1); + if (detaching) detach_dev(div); destroy_each(each_blocks, detaching); } }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block_3.name, - type: "each", - source: "(184:12) {#each randomContent.story as chapter, i}", + id: create_if_block.name, + type: "if", + source: "(25:8) {#if sentence}", ctx }); return block; } - // (207:16) {#each storyPart.objectives as objective} + // (31:18) {#each row as cell} function create_each_block_2(ctx) { - let li; - let span; - let t0_value = /*objective*/ ctx[12].name + ""; - let t0; - let t1; - let input; - let t2; + let td; + let t_value = /*cell*/ ctx[9] + ""; + let t; const block = { c: function create() { - li = element("li"); - span = element("span"); - t0 = text(t0_value); - t1 = space(); - input = element("input"); - t2 = space(); - add_location(span, file$2, 208, 20, 8397); - attr_dev(input, "type", "text"); - attr_dev(input, "placeholder", "Enter objective details"); - add_location(input, file$2, 209, 20, 8448); - add_location(li, file$2, 207, 16, 8371); + td = element("td"); + t = text(t_value); + add_location(td, file$2, 31, 20, 1203); }, m: function mount(target, anchor) { - insert_dev(target, li, anchor); - append_dev(li, span); - append_dev(span, t0); - append_dev(li, t1); - append_dev(li, input); - append_dev(li, t2); + insert_dev(target, td, anchor); + append_dev(td, t); }, p: function update(ctx, dirty) { - if (dirty & /*randomContentstructure*/ 2 && t0_value !== (t0_value = /*objective*/ ctx[12].name + "")) set_data_dev(t0, t0_value); + if (dirty & /*sentences*/ 2 && t_value !== (t_value = /*cell*/ ctx[9] + "")) set_data_dev(t, t_value); }, d: function destroy(detaching) { - if (detaching) detach_dev(li); + if (detaching) detach_dev(td); } }; @@ -61582,263 +65584,58 @@ var app = (function () { block, id: create_each_block_2.name, type: "each", - source: "(207:16) {#each storyPart.objectives as objective}", + source: "(31:18) {#each row as cell}", ctx }); return block; } - // (218:16) {#each storyPart.targets as target} + // (29:14) {#each extractLetters(sentence) as row} function create_each_block_1(ctx) { - let li; - let span; - let t0_value = /*target*/ ctx[9].name + ""; - let t0; - let t1; - let input; - let t2; - let p0; - let t3; - let t4_value = /*target*/ ctx[9].x + ""; - let t4; - let t5; - let t6_value = /*target*/ ctx[9].y + ""; - let t6; - let t7; - let t8; - let p1; - let t9; - let t10_value = /*target*/ ctx[9].collisionType + ""; - let t10; - let t11; - let textarea; - let textarea_value_value; - let t12; - - const block = { - c: function create() { - li = element("li"); - span = element("span"); - t0 = text(t0_value); - t1 = space(); - input = element("input"); - t2 = space(); - p0 = element("p"); - t3 = text("Coordinates: ("); - t4 = text(t4_value); - t5 = text(", "); - t6 = text(t6_value); - t7 = text(")"); - t8 = space(); - p1 = element("p"); - t9 = text("Collision Type: "); - t10 = text(t10_value); - t11 = space(); - textarea = element("textarea"); - t12 = space(); - add_location(span, file$2, 219, 20, 8758); - attr_dev(input, "type", "text"); - attr_dev(input, "placeholder", "Enter target details"); - add_location(input, file$2, 220, 20, 8806); - add_location(p0, file$2, 221, 20, 8884); - add_location(p1, file$2, 222, 20, 8950); - attr_dev(textarea, "placeholder", "Enter collision text"); - textarea.value = textarea_value_value = /*target*/ ctx[9].collisiontext; - add_location(textarea, file$2, 223, 20, 9017); - add_location(li, file$2, 218, 16, 8732); - }, - m: function mount(target, anchor) { - insert_dev(target, li, anchor); - append_dev(li, span); - append_dev(span, t0); - append_dev(li, t1); - append_dev(li, input); - append_dev(li, t2); - append_dev(li, p0); - append_dev(p0, t3); - append_dev(p0, t4); - append_dev(p0, t5); - append_dev(p0, t6); - append_dev(p0, t7); - append_dev(li, t8); - append_dev(li, p1); - append_dev(p1, t9); - append_dev(p1, t10); - append_dev(li, t11); - append_dev(li, textarea); - append_dev(li, t12); - }, - p: function update(ctx, dirty) { - if (dirty & /*randomContentstructure*/ 2 && t0_value !== (t0_value = /*target*/ ctx[9].name + "")) set_data_dev(t0, t0_value); - if (dirty & /*randomContentstructure*/ 2 && t4_value !== (t4_value = /*target*/ ctx[9].x + "")) set_data_dev(t4, t4_value); - if (dirty & /*randomContentstructure*/ 2 && t6_value !== (t6_value = /*target*/ ctx[9].y + "")) set_data_dev(t6, t6_value); - if (dirty & /*randomContentstructure*/ 2 && t10_value !== (t10_value = /*target*/ ctx[9].collisionType + "")) set_data_dev(t10, t10_value); - - if (dirty & /*randomContentstructure*/ 2 && textarea_value_value !== (textarea_value_value = /*target*/ ctx[9].collisiontext)) { - prop_dev(textarea, "value", textarea_value_value); - } - }, - d: function destroy(detaching) { - if (detaching) detach_dev(li); - } - }; - - dispatch_dev("SvelteRegisterBlock", { - block, - id: create_each_block_1.name, - type: "each", - source: "(218:16) {#each storyPart.targets as target}", - ctx - }); - - return block; - } - - // (201:8) {#each randomContentstructure.story as storyPart, i} - function create_each_block$1(ctx) { - let div2; - let h3; - let t0; - let t1_value = /*storyPart*/ ctx[6].part + 1 + ""; - let t1; - let t2; - let div0; - let h40; - let t4; - let ul0; - let t5; - let div1; - let h41; - let t7; - let ul1; - let t8; - let each_value_2 = /*storyPart*/ ctx[6].objectives; + let tr; + let each_value_2 = /*row*/ ctx[6]; validate_each_argument(each_value_2); - let each_blocks_1 = []; - - for (let i = 0; i < each_value_2.length; i += 1) { - each_blocks_1[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); - } - - let each_value_1 = /*storyPart*/ ctx[6].targets; - 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)); + for (let i = 0; i < each_value_2.length; i += 1) { + each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); } const block = { c: function create() { - div2 = element("div"); - h3 = element("h3"); - t0 = text("Part "); - t1 = text(t1_value); - t2 = space(); - div0 = element("div"); - h40 = element("h4"); - h40.textContent = "Objectives"; - t4 = space(); - ul0 = element("ul"); - - for (let i = 0; i < each_blocks_1.length; i += 1) { - each_blocks_1[i].c(); - } - - t5 = space(); - div1 = element("div"); - h41 = element("h4"); - h41.textContent = "Targets"; - t7 = space(); - ul1 = element("ul"); + tr = element("tr"); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - t8 = space(); - add_location(h3, file$2, 202, 12, 8190); - add_location(h40, file$2, 204, 12, 8257); - add_location(ul0, file$2, 205, 12, 8290); - add_location(div0, file$2, 203, 12, 8238); - add_location(h41, file$2, 215, 12, 8627); - add_location(ul1, file$2, 216, 12, 8657); - add_location(div1, file$2, 214, 12, 8608); - add_location(div2, file$2, 201, 8, 8171); + add_location(tr, file$2, 29, 16, 1138); }, m: function mount(target, anchor) { - insert_dev(target, div2, anchor); - append_dev(div2, h3); - append_dev(h3, t0); - append_dev(h3, t1); - append_dev(div2, t2); - append_dev(div2, div0); - append_dev(div0, h40); - append_dev(div0, t4); - append_dev(div0, ul0); - - for (let i = 0; i < each_blocks_1.length; i += 1) { - if (each_blocks_1[i]) { - each_blocks_1[i].m(ul0, null); - } - } - - append_dev(div2, t5); - append_dev(div2, div1); - append_dev(div1, h41); - append_dev(div1, t7); - append_dev(div1, ul1); + insert_dev(target, tr, anchor); for (let i = 0; i < each_blocks.length; i += 1) { if (each_blocks[i]) { - each_blocks[i].m(ul1, null); + each_blocks[i].m(tr, null); } } - - append_dev(div2, t8); }, p: function update(ctx, dirty) { - if (dirty & /*randomContentstructure*/ 2 && t1_value !== (t1_value = /*storyPart*/ ctx[6].part + 1 + "")) set_data_dev(t1, t1_value); - - if (dirty & /*randomContentstructure*/ 2) { - each_value_2 = /*storyPart*/ ctx[6].objectives; + if (dirty & /*extractLetters, sentences*/ 2) { + each_value_2 = /*row*/ ctx[6]; validate_each_argument(each_value_2); let i; for (i = 0; i < each_value_2.length; i += 1) { const child_ctx = get_each_context_2(ctx, each_value_2, i); - if (each_blocks_1[i]) { - each_blocks_1[i].p(child_ctx, dirty); - } else { - each_blocks_1[i] = create_each_block_2(child_ctx); - each_blocks_1[i].c(); - each_blocks_1[i].m(ul0, null); - } - } - - for (; i < each_blocks_1.length; i += 1) { - each_blocks_1[i].d(1); - } - - each_blocks_1.length = each_value_2.length; - } - - if (dirty & /*randomContentstructure*/ 2) { - each_value_1 = /*storyPart*/ ctx[6].targets; - validate_each_argument(each_value_1); - let i; - - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_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_2(child_ctx); each_blocks[i].c(); - each_blocks[i].m(ul1, null); + each_blocks[i].m(tr, null); } } @@ -61846,422 +65643,176 @@ var app = (function () { each_blocks[i].d(1); } - each_blocks.length = each_value_1.length; + each_blocks.length = each_value_2.length; } }, d: function destroy(detaching) { - if (detaching) detach_dev(div2); - destroy_each(each_blocks_1, detaching); + if (detaching) detach_dev(tr); destroy_each(each_blocks, detaching); } }; dispatch_dev("SvelteRegisterBlock", { block, - id: create_each_block$1.name, + id: create_each_block_1.name, type: "each", - source: "(201:8) {#each randomContentstructure.story as storyPart, i}", + source: "(29:14) {#each extractLetters(sentence) as row}", ctx }); return block; } - function create_fragment$2(ctx) { - let div7; - let h10; + // (21:4) {#each sentences as sentence, index} + function create_each_block$1(ctx) { + let div; + let h3; + let t0; + let t1_value = /*index*/ ctx[5] + 1 + ""; let t1; - let hr; let t2; - let h11; + let t3; + let p; + let t4_value = /*sentence*/ ctx[3] + ""; let t4; - let button0; - let t6; - let button1; - let t8; - let div5; - let div0; - let h20; - let t10; - let img; - let img_src_value; - let t11; - let div1; - let h21; - let t13; - let ul0; - let t14; - let div2; - let h22; - let t16; - let ul1; - let t17; - let div3; - let h23; - let t19; - let ul2; - let t20; - let div4; - let h24; - let t22; - let t23; - let h12; - let t25; - let button2; - let t27; - let button3; - let t29; - let div6; - let mounted; - let dispose; - let each_value_7 = /*randomContent*/ ctx[0].inventory; - validate_each_argument(each_value_7); - let each_blocks_4 = []; - - for (let i = 0; i < each_value_7.length; i += 1) { - each_blocks_4[i] = create_each_block_7(get_each_context_7(ctx, each_value_7, i)); - } - - let each_value_6 = /*randomContent*/ ctx[0].skills; - validate_each_argument(each_value_6); - let each_blocks_3 = []; - - for (let i = 0; i < each_value_6.length; i += 1) { - each_blocks_3[i] = create_each_block_6(get_each_context_6(ctx, each_value_6, i)); - } - - let each_value_5 = /*randomContent*/ ctx[0].objectives; - validate_each_argument(each_value_5); - let each_blocks_2 = []; - - for (let i = 0; i < each_value_5.length; i += 1) { - each_blocks_2[i] = create_each_block_5(get_each_context_5(ctx, each_value_5, i)); - } - - let each_value_3 = /*randomContent*/ ctx[0].story; - validate_each_argument(each_value_3); - let each_blocks_1 = []; - - for (let i = 0; i < each_value_3.length; i += 1) { - each_blocks_1[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); - } - - let each_value = /*randomContentstructure*/ ctx[1].story; - validate_each_argument(each_value); - 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)); - } + let t5; + let if_block = /*sentence*/ ctx[3] && create_if_block(ctx); const block = { c: function create() { - div7 = element("div"); - h10 = element("h1"); - h10.textContent = "Prototyping Custom User Config game on the fly"; - t1 = space(); - hr = element("hr"); - t2 = space(); - h11 = element("h1"); - h11.textContent = "Random Game Content Generator"; - t4 = space(); - button0 = element("button"); - button0.textContent = "Generate New Content"; - t6 = space(); - button1 = element("button"); - button1.textContent = "Copy Content Config to Clipboard"; - t8 = space(); - div5 = element("div"); - div0 = element("div"); - h20 = element("h2"); - h20.textContent = "Background"; - t10 = space(); - img = element("img"); - t11 = space(); - div1 = element("div"); - h21 = element("h2"); - h21.textContent = "Inventory"; - t13 = space(); - ul0 = element("ul"); - - for (let i = 0; i < each_blocks_4.length; i += 1) { - each_blocks_4[i].c(); - } - - t14 = space(); - div2 = element("div"); - h22 = element("h2"); - h22.textContent = "Skills"; - t16 = space(); - ul1 = element("ul"); + div = element("div"); + h3 = element("h3"); + t0 = text("Sentence "); + t1 = text(t1_value); + t2 = text(":"); + t3 = space(); + p = element("p"); + t4 = text(t4_value); + t5 = space(); + if (if_block) if_block.c(); + add_location(h3, file$2, 22, 8, 825); + add_location(p, file$2, 23, 8, 865); + add_location(div, file$2, 21, 6, 810); + }, + m: function mount(target, anchor) { + insert_dev(target, div, anchor); + append_dev(div, h3); + append_dev(h3, t0); + append_dev(h3, t1); + append_dev(h3, t2); + append_dev(div, t3); + append_dev(div, p); + append_dev(p, t4); + append_dev(div, t5); + if (if_block) if_block.m(div, null); + }, + p: function update(ctx, dirty) { + if (dirty & /*sentences*/ 2 && t4_value !== (t4_value = /*sentence*/ ctx[3] + "")) set_data_dev(t4, t4_value); - for (let i = 0; i < each_blocks_3.length; i += 1) { - each_blocks_3[i].c(); + if (/*sentence*/ ctx[3]) { + if (if_block) { + if_block.p(ctx, dirty); + } else { + if_block = create_if_block(ctx); + if_block.c(); + if_block.m(div, null); + } + } else if (if_block) { + if_block.d(1); + if_block = null; } + }, + d: function destroy(detaching) { + if (detaching) detach_dev(div); + if (if_block) if_block.d(); + } + }; - t17 = space(); - div3 = element("div"); - h23 = element("h2"); - h23.textContent = "Objectives"; - t19 = space(); - ul2 = element("ul"); + dispatch_dev("SvelteRegisterBlock", { + block, + id: create_each_block$1.name, + type: "each", + source: "(21:4) {#each sentences as sentence, index}", + ctx + }); - for (let i = 0; i < each_blocks_2.length; i += 1) { - each_blocks_2[i].c(); - } + return block; + } - t20 = space(); - div4 = element("div"); - h24 = element("h2"); - h24.textContent = "Story"; - t22 = space(); + function create_fragment$2(ctx) { + let div; + let h2; + let t1; + let textarea; + let t2; + let t3; + let p; + let mounted; + let dispose; + let each_value = /*sentences*/ ctx[1]; + validate_each_argument(each_value); + let each_blocks = []; - for (let i = 0; i < each_blocks_1.length; i += 1) { - each_blocks_1[i].c(); - } + 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)); + } - t23 = space(); - h12 = element("h1"); - h12.textContent = "Random Game Structure Generator"; - t25 = space(); - button2 = element("button"); - button2.textContent = "Generate New Content Story Structure"; - t27 = space(); - button3 = element("button"); - button3.textContent = "Copy Random Structure to Clipboard"; - t29 = space(); - div6 = element("div"); + const block = { + c: function create() { + div = element("div"); + h2 = element("h2"); + h2.textContent = "Sentence Letter Extractor"; + t1 = space(); + textarea = element("textarea"); + t2 = space(); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - add_location(h10, file$2, 141, 4, 6124); - add_location(hr, file$2, 142, 4, 6185); - add_location(h11, file$2, 143, 4, 6195); - add_location(button0, file$2, 145, 4, 6241); - add_location(button1, file$2, 146, 4, 6341); - add_location(h20, file$2, 150, 12, 6479); - if (!src_url_equal(img.src, img_src_value = /*randomContent*/ ctx[0].background)) attr_dev(img, "src", img_src_value); - attr_dev(img, "alt", "Background"); - add_location(img, file$2, 151, 12, 6512); - add_location(div0, file$2, 149, 8, 6460); - add_location(h21, file$2, 155, 12, 6618); - add_location(ul0, file$2, 156, 12, 6650); - add_location(div1, file$2, 154, 8, 6599); - add_location(h22, file$2, 164, 12, 6857); - add_location(ul1, file$2, 165, 12, 6886); - add_location(div2, file$2, 163, 8, 6838); - add_location(h23, file$2, 173, 12, 7118); - add_location(ul2, file$2, 174, 12, 7151); - add_location(div3, file$2, 172, 8, 7099); - add_location(h24, file$2, 182, 12, 7401); - add_location(div4, file$2, 181, 8, 7382); - attr_dev(div5, "class", "StatColumns svelte-wnpr4k"); - add_location(div5, file$2, 148, 4, 6425); - add_location(h12, file$2, 196, 4, 7801); - add_location(button2, file$2, 197, 4, 7847); - add_location(button3, file$2, 198, 4, 7981); - attr_dev(div6, "class", "StatColumns svelte-wnpr4k"); - add_location(div6, file$2, 199, 4, 8074); - add_location(div7, file$2, 140, 0, 6113); + t3 = space(); + p = element("p"); + p.textContent = "Example rough prompt to claude/gpt 4 to generate image prompt - The output of a random sentence brought R b N C I f L r t n f b r, please try and make a sentence where each letter is used to make a sentence with as many nouns adjectives in it while using as few words as possible"; + add_location(h2, file$2, 18, 4, 541); + set_style(textarea, "width", "95%"); + set_style(textarea, "height", "100px"); + attr_dev(textarea, "placeholder", "Enter sentences separated by full stops, question marks, exclamation marks, or colons"); + add_location(textarea, file$2, 19, 4, 581); + add_location(p, file$2, 40, 4, 1379); + add_location(div, file$2, 17, 2, 530); }, 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, div7, anchor); - append_dev(div7, h10); - append_dev(div7, t1); - append_dev(div7, hr); - append_dev(div7, t2); - append_dev(div7, h11); - append_dev(div7, t4); - append_dev(div7, button0); - append_dev(div7, t6); - append_dev(div7, button1); - append_dev(div7, t8); - append_dev(div7, div5); - append_dev(div5, div0); - append_dev(div0, h20); - append_dev(div0, t10); - append_dev(div0, img); - append_dev(div5, t11); - append_dev(div5, div1); - append_dev(div1, h21); - append_dev(div1, t13); - append_dev(div1, ul0); - - for (let i = 0; i < each_blocks_4.length; i += 1) { - if (each_blocks_4[i]) { - each_blocks_4[i].m(ul0, null); - } - } - - append_dev(div5, t14); - append_dev(div5, div2); - append_dev(div2, h22); - append_dev(div2, t16); - append_dev(div2, ul1); - - for (let i = 0; i < each_blocks_3.length; i += 1) { - if (each_blocks_3[i]) { - each_blocks_3[i].m(ul1, null); - } - } - - append_dev(div5, t17); - append_dev(div5, div3); - append_dev(div3, h23); - append_dev(div3, t19); - append_dev(div3, ul2); - - for (let i = 0; i < each_blocks_2.length; i += 1) { - if (each_blocks_2[i]) { - each_blocks_2[i].m(ul2, null); - } - } - - append_dev(div5, t20); - append_dev(div5, div4); - append_dev(div4, h24); - append_dev(div4, t22); - - for (let i = 0; i < each_blocks_1.length; i += 1) { - if (each_blocks_1[i]) { - each_blocks_1[i].m(div4, null); - } - } - - append_dev(div7, t23); - append_dev(div7, h12); - append_dev(div7, t25); - append_dev(div7, button2); - append_dev(div7, t27); - append_dev(div7, button3); - append_dev(div7, t29); - append_dev(div7, div6); + insert_dev(target, div, anchor); + append_dev(div, h2); + append_dev(div, t1); + append_dev(div, textarea); + set_input_value(textarea, /*inputText*/ ctx[0]); + append_dev(div, t2); for (let i = 0; i < each_blocks.length; i += 1) { if (each_blocks[i]) { - each_blocks[i].m(div6, null); + each_blocks[i].m(div, null); } } - if (!mounted) { - dispose = [ - listen_dev(button0, "click", /*click_handler*/ ctx[4], false, false, false, false), - listen_dev(button1, "click", /*copyToClipboard*/ ctx[2], false, false, false, false), - listen_dev(button2, "click", /*click_handler_1*/ ctx[5], false, false, false, false), - listen_dev(button3, "click", /*copyToClipboardStructure*/ ctx[3], false, false, false, false) - ]; + append_dev(div, t3); + append_dev(div, p); + if (!mounted) { + dispose = listen_dev(textarea, "input", /*textarea_input_handler*/ ctx[2]); mounted = true; } }, p: function update(ctx, [dirty]) { - if (dirty & /*randomContent*/ 1 && !src_url_equal(img.src, img_src_value = /*randomContent*/ ctx[0].background)) { - attr_dev(img, "src", img_src_value); - } - - if (dirty & /*randomContent*/ 1) { - each_value_7 = /*randomContent*/ ctx[0].inventory; - validate_each_argument(each_value_7); - let i; - - for (i = 0; i < each_value_7.length; i += 1) { - const child_ctx = get_each_context_7(ctx, each_value_7, i); - - if (each_blocks_4[i]) { - each_blocks_4[i].p(child_ctx, dirty); - } else { - each_blocks_4[i] = create_each_block_7(child_ctx); - each_blocks_4[i].c(); - each_blocks_4[i].m(ul0, null); - } - } - - for (; i < each_blocks_4.length; i += 1) { - each_blocks_4[i].d(1); - } - - each_blocks_4.length = each_value_7.length; - } - - if (dirty & /*randomContent*/ 1) { - each_value_6 = /*randomContent*/ ctx[0].skills; - validate_each_argument(each_value_6); - let i; - - for (i = 0; i < each_value_6.length; i += 1) { - const child_ctx = get_each_context_6(ctx, each_value_6, i); - - if (each_blocks_3[i]) { - each_blocks_3[i].p(child_ctx, dirty); - } else { - each_blocks_3[i] = create_each_block_6(child_ctx); - each_blocks_3[i].c(); - each_blocks_3[i].m(ul1, null); - } - } - - for (; i < each_blocks_3.length; i += 1) { - each_blocks_3[i].d(1); - } - - each_blocks_3.length = each_value_6.length; - } - - if (dirty & /*randomContent*/ 1) { - each_value_5 = /*randomContent*/ ctx[0].objectives; - validate_each_argument(each_value_5); - let i; - - for (i = 0; i < each_value_5.length; i += 1) { - const child_ctx = get_each_context_5(ctx, each_value_5, i); - - if (each_blocks_2[i]) { - each_blocks_2[i].p(child_ctx, dirty); - } else { - each_blocks_2[i] = create_each_block_5(child_ctx); - each_blocks_2[i].c(); - each_blocks_2[i].m(ul2, null); - } - } - - for (; i < each_blocks_2.length; i += 1) { - each_blocks_2[i].d(1); - } - - each_blocks_2.length = each_value_5.length; - } - - if (dirty & /*randomContent*/ 1) { - each_value_3 = /*randomContent*/ ctx[0].story; - validate_each_argument(each_value_3); - let i; - - for (i = 0; i < each_value_3.length; i += 1) { - const child_ctx = get_each_context_3(ctx, each_value_3, i); - - if (each_blocks_1[i]) { - each_blocks_1[i].p(child_ctx, dirty); - } else { - each_blocks_1[i] = create_each_block_3(child_ctx); - each_blocks_1[i].c(); - each_blocks_1[i].m(div4, null); - } - } - - for (; i < each_blocks_1.length; i += 1) { - each_blocks_1[i].d(1); - } - - each_blocks_1.length = each_value_3.length; + if (dirty & /*inputText*/ 1) { + set_input_value(textarea, /*inputText*/ ctx[0]); } - if (dirty & /*randomContentstructure*/ 2) { - each_value = /*randomContentstructure*/ ctx[1].story; + if (dirty & /*extractLetters, sentences*/ 2) { + each_value = /*sentences*/ ctx[1]; validate_each_argument(each_value); let i; @@ -62273,7 +65824,7 @@ var app = (function () { } else { each_blocks[i] = create_each_block$1(child_ctx); each_blocks[i].c(); - each_blocks[i].m(div6, null); + each_blocks[i].m(div, t3); } } @@ -62287,14 +65838,10 @@ var app = (function () { i: noop, o: noop, d: function destroy(detaching) { - if (detaching) detach_dev(div7); - destroy_each(each_blocks_4, detaching); - destroy_each(each_blocks_3, detaching); - destroy_each(each_blocks_2, detaching); - destroy_each(each_blocks_1, detaching); + if (detaching) detach_dev(div); destroy_each(each_blocks, detaching); mounted = false; - run_all(dispose); + dispose(); } }; @@ -62309,230 +65856,63 @@ var app = (function () { return block; } - function generateRandomContent() { - const backgrounds = [ - '/AutoGameBackgrounds/space_background.png', - '/AutoGameBackgrounds/forest_background.png', - '/AutoGameBackgrounds/city_background.png', - '/AutoGameBackgrounds/desert_background.png', - '/AutoGameBackgrounds/underwater_background.png' - ]; - - const weaponTypes = ['Sword', 'Bow', 'Staff', 'Dagger', 'Axe', 'Mace', 'Whip', 'Spear']; - const armorTypes = ['Helmet', 'Chestplate', 'Leggings', 'Boots', 'Shield', 'Gloves', 'Cloak']; - const consumableTypes = ['Health Potion', 'Mana Potion', 'Stamina Potion', 'Antidote', 'Bomb']; - - const skillBranches = [ - 'Combat', - 'Magic', - 'Stealth', - 'Crafting', - 'Alchemy', - 'Archery', - 'Blacksmithing' - ]; - - const objectiveNames = [ - 'Explore', - 'Gather Resources', - 'Defeat Enemy', - 'Find Artifact', - 'Rescue Prisoner', - 'Escort NPC', - 'Solve Puzzle', - 'Repair Structure', - 'Negotiate Treaty', - 'Investigate Mystery' - ]; - - const targetNames = [ - 'Goblin', - 'Skeleton', - 'Dragon', - 'Bandit', - 'Orc', - 'Troll', - 'Giant Spider', - 'Undead Knight', - 'Corrupted Mage', - 'Rogue Assassin' - ]; - - const collisionTypes = ['alert', 'battle', 'dialogue', 'trade', 'cutscene']; - const randomBackground = backgrounds[Math.floor(Math.random() * backgrounds.length)]; - - const randomInventory = [ - ...Array.from({ length: 3 }, () => ({ - type: 'weapon', - name: `${weaponTypes[Math.floor(Math.random() * weaponTypes.length)]}`, - description: 'A powerful weapon.' - })), - ...Array.from({ length: 2 }, () => ({ - type: 'armor', - name: `${armorTypes[Math.floor(Math.random() * armorTypes.length)]}`, - description: 'Protective gear.' - })), - ...Array.from({ length: 2 }, () => ({ - type: 'consumable', - name: `${consumableTypes[Math.floor(Math.random() * consumableTypes.length)]}`, - description: 'A helpful item.' - })) - ]; - - const randomSkills = Array.from({ length: 15 }, (_, index) => ({ - branch: skillBranches[Math.floor(Math.random() * skillBranches.length)], - name: `Skill ${index + 1}`, - learned: Math.random() < 0.5 - })); - - const randomObjectives = Array.from({ length: 5 }, (_, index) => ({ - id: `Mission ${index + 1}`, - name: `${objectiveNames[Math.floor(Math.random() * objectiveNames.length)]} Mission`, - complete: Math.random() < 0.5 - })); - - const randomStory = Array.from({ length: 5 }, (_, index) => ({ - part: index, - objectives: Array.from({ length: 2 }, () => ({ - id: `Task ${Math.floor(Math.random() * 5) + 1}`, - name: `${objectiveNames[Math.floor(Math.random() * objectiveNames.length)]} Task`, - complete: Math.random() < 0.5 - })), - targets: Array.from({ length: 3 }, () => ({ - name: `${targetNames[Math.floor(Math.random() * targetNames.length)]}`, - x: Math.floor(Math.random() * 100), - y: Math.floor(Math.random() * 100), - collisionType: collisionTypes[Math.floor(Math.random() * collisionTypes.length)], - collisiontext: 'Test Collision' - })) - })); - - const randomContent = { - background: randomBackground, - inventory: randomInventory, - skills: randomSkills, - persistentTargets: [], - objectives: randomObjectives, - story: randomStory, - actions: { - Buybook() { - - }, // Logic to buy a book - // Logic to buy a book - - } - }; - - return randomContent; - } - - function generateRandomContentStructure() { - // ... (existing code for generating random content) - const randomStoryPartslengths = Math.floor(Math.random() * 5) + 1; // Generate random number of story parts (1-5) - - const randomStorystructure = Array.from({ length: randomStoryPartslengths }, (_, index) => ({ - part: index, - objectives: Array.from( - { - length: Math.floor(Math.random() * 3) + 1 - }, - (_, idx) => ({ - id: `Objective${index + 1}_${idx + 1}`, - name: `Objective ${index + 1}.${idx + 1}`, - complete: false - }) - ), - targets: Array.from( - { - length: Math.floor(Math.random() * 4) + 1 - }, - (_, idx) => ({ - name: `Target${index + 1}_${idx + 1}`, - x: Math.floor(Math.random() * 100), - y: Math.floor(Math.random() * 100), - collisionType: 'alert', - collisiontext: `Placeholder text for Target ${index + 1}.${idx + 1}` - }) - ) - })); + function extractLetters(sentence) { + const words = sentence.split(' '); + const maxLength = Math.max(...words.map(word => word.length)); + const result = []; - const randomContentstructure = { - // ... (existing properties) - story: randomStorystructure - }; + for (let i = 0; i < maxLength; i++) { + const letters = words.map(word => word[i] || ''); + result.push(letters); + } - return randomContentstructure; + return result; } function instance$2($$self, $$props, $$invalidate) { + let sentences; let { $$slots: slots = {}, $$scope } = $$props; - validate_slots('BrainstormGameConfigsRandom', slots, []); - let randomContent = generateRandomContent(); - let randomContentstructure = generateRandomContentStructure(); - - function copyToClipboard() { - navigator.clipboard.writeText(JSON.stringify(randomContent, null, 2)).then(() => { - alert('Random content copied to clipboard!'); - }).catch(error => { - console.error('Failed to copy to clipboard:', error); - alert('Error, Random content failed to copy due to error!'); - }); - } - - function copyToClipboardStructure() { - navigator.clipboard.writeText(JSON.stringify(randomContentstructure, null, 2)).then(() => { - alert('Random content Structure copied to clipboard!'); - }).catch(error => { - console.error('Failed to copy to clipboard:', error); - alert('Error, Random content Structure failed to copy due to error!'); - }); - } - + validate_slots('PSWSasspellingpractice', slots, []); + let inputText = ''; 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.warn(` was created with unknown prop '${key}'`); }); - const click_handler = () => $$invalidate(0, randomContent = generateRandomContent()); - const click_handler_1 = () => $$invalidate(1, randomContentstructure = generateRandomContentStructure()); + function textarea_input_handler() { + inputText = this.value; + $$invalidate(0, inputText); + } - $$self.$capture_state = () => ({ - generateRandomContent, - generateRandomContentStructure, - randomContent, - randomContentstructure, - copyToClipboard, - copyToClipboardStructure - }); + $$self.$capture_state = () => ({ inputText, extractLetters, sentences }); $$self.$inject_state = $$props => { - if ('randomContent' in $$props) $$invalidate(0, randomContent = $$props.randomContent); - if ('randomContentstructure' in $$props) $$invalidate(1, randomContentstructure = $$props.randomContentstructure); + if ('inputText' in $$props) $$invalidate(0, inputText = $$props.inputText); + if ('sentences' in $$props) $$invalidate(1, sentences = $$props.sentences); }; if ($$props && "$$inject" in $$props) { $$self.$inject_state($$props.$$inject); } - return [ - randomContent, - randomContentstructure, - copyToClipboard, - copyToClipboardStructure, - click_handler, - click_handler_1 - ]; + $$self.$$.update = () => { + if ($$self.$$.dirty & /*inputText*/ 1) { + $$invalidate(1, sentences = inputText.split(/[.?!:]/).map(sentence => sentence.trim()).filter(sentence => sentence !== '')); + } + }; + + return [inputText, sentences, textarea_input_handler]; } - class BrainstormGameConfigsRandom extends SvelteComponentDev { + class PSWSasspellingpractice extends SvelteComponentDev { constructor(options) { super(options); init(this, options, instance$2, create_fragment$2, safe_not_equal, {}); dispatch_dev("SvelteRegisterComponent", { component: this, - tagName: "BrainstormGameConfigsRandom", + tagName: "PSWSasspellingpractice", options, id: create_fragment$2.name }); @@ -62550,15 +65930,12 @@ var app = (function () { return child_ctx; } - // (24:4) {#each syllableLists as syllables, index (index)} + // (25:4) {#each syllableLists as syllables, index (index)} function create_each_block(key_1, ctx) { - let div; let button; + let t0_value = /*displayTexts*/ ctx[1][/*index*/ ctx[8]] + ""; + let t0; let t1; - let p; - let t2_value = /*displayTexts*/ ctx[1][/*index*/ ctx[8]] + ""; - let t2; - let t3; let mounted; let dispose; @@ -62570,28 +65947,17 @@ var app = (function () { key: key_1, first: null, c: function create() { - div = element("div"); button = element("button"); - button.textContent = "Show Next Syllable"; + t0 = text(t0_value); t1 = space(); - p = element("p"); - t2 = text(t2_value); - t3 = space(); set_style(button, "cursor", "pointer"); - add_location(button, file$1, 25, 12, 844); - attr_dev(p, "class", "svelte-1abadcv"); - add_location(p, file$1, 28, 12, 987); - attr_dev(div, "class", "svelte-1abadcv"); - add_location(div, file$1, 24, 8, 825); - this.first = div; + add_location(button, file$1, 25, 8, 874); + this.first = button; }, m: function mount(target, anchor) { - insert_dev(target, div, anchor); - append_dev(div, button); - append_dev(div, t1); - append_dev(div, p); - append_dev(p, t2); - append_dev(div, t3); + insert_dev(target, button, anchor); + append_dev(button, t0); + append_dev(button, t1); if (!mounted) { dispose = listen_dev(button, "click", click_handler, false, false, false, false); @@ -62600,10 +65966,10 @@ var app = (function () { }, p: function update(new_ctx, dirty) { ctx = new_ctx; - if (dirty & /*displayTexts, syllableLists*/ 3 && t2_value !== (t2_value = /*displayTexts*/ ctx[1][/*index*/ ctx[8]] + "")) set_data_dev(t2, t2_value); + if (dirty & /*displayTexts, syllableLists*/ 3 && t0_value !== (t0_value = /*displayTexts*/ ctx[1][/*index*/ ctx[8]] + "")) set_data_dev(t0, t0_value); }, d: function destroy(detaching) { - if (detaching) detach_dev(div); + if (detaching) detach_dev(button); mounted = false; dispose(); } @@ -62613,7 +65979,7 @@ var app = (function () { block, id: create_each_block.name, type: "each", - source: "(24:4) {#each syllableLists as syllables, index (index)}", + source: "(25:4) {#each syllableLists as syllables, index (index)}", ctx }); @@ -62622,6 +65988,8 @@ var app = (function () { function create_fragment$1(ctx) { let main; + let div; + let t1; let each_blocks = []; let each_1_lookup = new Map(); let each_value = /*syllableLists*/ ctx[0]; @@ -62638,11 +66006,16 @@ var app = (function () { const block = { c: function create() { main = element("main"); + div = element("div"); + div.textContent = "On click will Show Next Syllable"; + t1 = space(); for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } + attr_dev(div, "class", "svelte-18he4oy"); + add_location(div, file$1, 23, 4, 766); add_location(main, file$1, 22, 0, 754); }, l: function claim(nodes) { @@ -62650,6 +66023,8 @@ var app = (function () { }, m: function mount(target, anchor) { insert_dev(target, main, anchor); + append_dev(main, div); + append_dev(main, t1); for (let i = 0; i < each_blocks.length; i += 1) { if (each_blocks[i]) { @@ -62658,7 +66033,7 @@ var app = (function () { } }, p: function update(ctx, [dirty]) { - if (dirty & /*displayTexts, syllableLists, nextSyllable*/ 7) { + if (dirty & /*nextSyllable, syllableLists, displayTexts*/ 7) { each_value = /*syllableLists*/ ctx[0]; validate_each_argument(each_value); validate_each_keys(ctx, each_value, get_each_context, get_key); @@ -62773,50 +66148,52 @@ var app = (function () { let t1; let t2; let t3; + let h20; + let t5; let p; - let t4; - let a; let t6; - let t7; - let h11; + let a; + let t8; let t9; - let h30; + let h11; let t11; + let h30; + let t13; let div6; let div0; let copyremove; - let t12; + let t14; let div1; let llmwf; - let t13; + let t15; let div2; let subrepprac; - let t14; + let t16; let div3; let readingstatecounter; - let t15; + let t17; let div4; - let t16; + let t18; let br; - let t17; + let t19; let orderaspractice; - let t18; + let t20; let div5; let firstsyllable; - let t19; - let h31; let t21; + let h31; + let t23; let nestedcommentssvelte; - let t22; + let t24; let myyoutube; - let t23; + let t25; let ytpicsubs; - let t24; - let h12; let t26; + let h12; + let t28; + let h21; + let t30; let dotgame; - let t27; - let brainstormgameconfigsrandom; let current; copyremove = new CopyandRemoveListComponent({ $$inline: true }); llmwf = new LLMWorkflowTest({ $$inline: true }); @@ -62833,7 +66210,6 @@ var app = (function () { myyoutube = new YoutubeIframeAPICustomInterface({ $$inline: true }); ytpicsubs = new PictureSubtitlesbasedonYTTranscript({ $$inline: true }); dotgame = new MovingDotSpacePortfromReact({ $$inline: true }); - brainstormgameconfigsrandom = new BrainstormGameConfigsRandom({ $$inline: true }); const block = { c: function create() { @@ -62843,83 +66219,89 @@ var app = (function () { t1 = text(/*name*/ ctx[0]); t2 = text("!"); t3 = space(); + h20 = element("h2"); + h20.textContent = "(I forgot to log how many prompts to make the whole page. As most of code is from llms, a planning LLM could have made this in 1 day. Prompts to app should be a benchmark)"; + t5 = space(); p = element("p"); - t4 = text("Visit the "); + t6 = text("Visit the "); a = element("a"); a.textContent = "Svelte tutorial"; - t6 = text(" to learn how to build Svelte apps. (or ask Claude / GPT4 for help)"); - t7 = space(); + t8 = text(" to learn how to build Svelte apps. (or ask Claude / GPT4 for help)"); + t9 = space(); h11 = element("h1"); h11.textContent = "Brainstorm for Educational Interfaces to add LLM and other models into"; - t9 = space(); + t11 = space(); h30 = element("h3"); h30.textContent = "(Through Gradio and Custom Components)"; - t11 = space(); + t13 = space(); div6 = element("div"); div0 = element("div"); create_component(copyremove.$$.fragment); - t12 = space(); + t14 = space(); div1 = element("div"); create_component(llmwf.$$.fragment); - t13 = space(); + t15 = space(); div2 = element("div"); create_component(subrepprac.$$.fragment); - t14 = space(); + t16 = space(); div3 = element("div"); create_component(readingstatecounter.$$.fragment); - t15 = space(); + t17 = space(); div4 = element("div"); - t16 = text("Works well with this prompt + gemini: (Please seperate the words into a list and have the roman and english in brackets next to each word:) "); + t18 = text("Works well with this prompt + gemini: (Please seperate the words into a list and have the roman and english in brackets next to each word:) "); br = element("br"); - t17 = text(" Current Practice flow plan User steps: 1) get lyrics (youtube/genius/whisper/other) 2) send to gemini with prompt 3)Enter into new component which starts with scramble spelling with dropdowns then scramble spelling using typing then moves to \n\t\t\t"); + t19 = text(" Current Practice flow plan User steps: 1) get lyrics (youtube/genius/whisper/other) 2) send to gemini with prompt 3)Enter into new component which starts with scramble spelling with dropdowns then scramble spelling using typing then moves to \n\t\t\t"); create_component(orderaspractice.$$.fragment); - t18 = space(); + t20 = space(); div5 = element("div"); create_component(firstsyllable.$$.fragment); - t19 = space(); + t21 = space(); h31 = element("h3"); h31.textContent = "Gradio client Test in another space due to incompatabilitiess with default svelte and @gradio/client"; - t21 = space(); + t23 = space(); create_component(nestedcommentssvelte.$$.fragment); - t22 = space(); + t24 = space(); create_component(myyoutube.$$.fragment); - t23 = space(); + t25 = space(); create_component(ytpicsubs.$$.fragment); - t24 = space(); + t26 = space(); h12 = element("h1"); h12.textContent = "Themeable Game Brainstorm - Image + Lists - Game as Universal Translator for any subject"; - t26 = space(); + t28 = space(); + h21 = element("h2"); + h21.textContent = "Also bridge to testing on low pc before auto refactor pipeline to unreal engine = truly multiplatform game"; + t30 = space(); create_component(dotgame.$$.fragment); - t27 = space(); - create_component(brainstormgameconfigsrandom.$$.fragment); attr_dev(h10, "class", "svelte-192gzri"); - add_location(h10, file, 37, 1, 1174); + add_location(h10, file, 36, 1, 1093); + add_location(h20, file, 37, 1, 1130); attr_dev(a, "href", "https://svelte.dev/tutorial"); - add_location(a, file, 38, 14, 1224); - add_location(p, file, 38, 1, 1211); + add_location(a, file, 38, 14, 1325); + add_location(p, file, 38, 1, 1312); attr_dev(h11, "class", "svelte-192gzri"); - add_location(h11, file, 40, 1, 1355); - add_location(h30, file, 41, 1, 1438); + add_location(h11, file, 40, 1, 1456); + add_location(h30, file, 41, 1, 1539); attr_dev(div0, "class", "componentborder svelte-192gzri"); - add_location(div0, file, 44, 2, 1535); + add_location(div0, file, 44, 2, 1636); attr_dev(div1, "class", "componentborder svelte-192gzri"); - add_location(div1, file, 45, 2, 1587); + add_location(div1, file, 45, 2, 1688); attr_dev(div2, "class", "componentborder svelte-192gzri"); - add_location(div2, file, 46, 2, 1634); + add_location(div2, file, 46, 2, 1735); attr_dev(div3, "class", "componentborder svelte-192gzri"); - add_location(div3, file, 47, 2, 1686); - add_location(br, file, 49, 143, 1920); + add_location(div3, file, 47, 2, 1787); + add_location(br, file, 49, 143, 2021); attr_dev(div4, "class", "componentborder svelte-192gzri"); - add_location(div4, file, 48, 2, 1747); + add_location(div4, file, 48, 2, 1848); attr_dev(div5, "class", "componentborder svelte-192gzri"); - add_location(div5, file, 52, 2, 2204); + add_location(div5, file, 52, 2, 2305); attr_dev(div6, "class", "grid-MultiComponentContainer svelte-192gzri"); - add_location(div6, file, 43, 1, 1490); - add_location(h31, file, 55, 1, 2292); + add_location(div6, file, 43, 1, 1591); + add_location(h31, file, 55, 1, 2393); attr_dev(h12, "class", "svelte-192gzri"); - add_location(h12, file, 63, 1, 2512); + add_location(h12, file, 63, 1, 2613); + add_location(h21, file, 64, 1, 2714); attr_dev(main, "class", "svelte-192gzri"); - add_location(main, file, 35, 0, 1165); + add_location(main, file, 34, 0, 1084); }, l: function claim(nodes) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); @@ -62931,50 +66313,52 @@ var app = (function () { append_dev(h10, t1); append_dev(h10, t2); append_dev(main, t3); + append_dev(main, h20); + append_dev(main, t5); 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(p, a); + append_dev(p, t8); append_dev(main, t9); - append_dev(main, h30); + append_dev(main, h11); append_dev(main, t11); + append_dev(main, h30); + append_dev(main, t13); append_dev(main, div6); append_dev(div6, div0); mount_component(copyremove, div0, null); - append_dev(div6, t12); + append_dev(div6, t14); append_dev(div6, div1); mount_component(llmwf, div1, null); - append_dev(div6, t13); + append_dev(div6, t15); append_dev(div6, div2); mount_component(subrepprac, div2, null); - append_dev(div6, t14); + append_dev(div6, t16); append_dev(div6, div3); mount_component(readingstatecounter, div3, null); - append_dev(div6, t15); + append_dev(div6, t17); append_dev(div6, div4); - append_dev(div4, t16); + append_dev(div4, t18); append_dev(div4, br); - append_dev(div4, t17); + append_dev(div4, t19); mount_component(orderaspractice, div4, null); - append_dev(div6, t18); + append_dev(div6, t20); append_dev(div6, div5); mount_component(firstsyllable, div5, null); - append_dev(main, t19); - append_dev(main, h31); append_dev(main, t21); + append_dev(main, h31); + append_dev(main, t23); mount_component(nestedcommentssvelte, main, null); - append_dev(main, t22); + append_dev(main, t24); mount_component(myyoutube, main, null); - append_dev(main, t23); + append_dev(main, t25); mount_component(ytpicsubs, main, null); - append_dev(main, t24); - append_dev(main, h12); append_dev(main, t26); + append_dev(main, h12); + append_dev(main, t28); + append_dev(main, h21); + append_dev(main, t30); mount_component(dotgame, main, null); - append_dev(main, t27); - mount_component(brainstormgameconfigsrandom, main, null); current = true; }, p: function update(ctx, [dirty]) { @@ -62992,7 +66376,6 @@ var app = (function () { transition_in(myyoutube.$$.fragment, local); transition_in(ytpicsubs.$$.fragment, local); transition_in(dotgame.$$.fragment, local); - transition_in(brainstormgameconfigsrandom.$$.fragment, local); current = true; }, o: function outro(local) { @@ -63006,7 +66389,6 @@ var app = (function () { transition_out(myyoutube.$$.fragment, local); transition_out(ytpicsubs.$$.fragment, local); transition_out(dotgame.$$.fragment, local); - transition_out(brainstormgameconfigsrandom.$$.fragment, local); current = false; }, d: function destroy(detaching) { @@ -63021,7 +66403,6 @@ var app = (function () { destroy_component(myyoutube); destroy_component(ytpicsubs); destroy_component(dotgame); - destroy_component(brainstormgameconfigsrandom); } }; @@ -63086,7 +66467,6 @@ var app = (function () { LLMWF: LLMWorkflowTest, YTPicSubs: PictureSubtitlesbasedonYTTranscript, OrderasPractice: PSWSasspellingpractice, - BrainstormGameConfigsRandom, FirstSyllable: ListeningPracticeandSyllableStudy, showModal, openModal,