|
function create_fragment(ctx) { |
|
let div; |
|
let current; |
|
let dispose; |
|
let if_block = /*level*/ ctx[1] > 0 && create_if_block(ctx); |
|
|
|
return { |
|
create() { |
|
div = document.createElement("div"); |
|
if (if_block) if_block.create(); |
|
div.setAttribute("class", "cell svelte-bywmgz"); |
|
div.setAttribute(div, "tabindex", "-1"); |
|
div.classList.toggle("container", /*container*/ ctx[0]); |
|
div.addEventListener("keydown", /*onKeyDown*/ ctx[6]); |
|
dispose = () => div.removeEventListener("keydown", /*onKeyDown*/ ctx[6]); |
|
}, |
|
mount(target, anchor) { |
|
target.insertBefore(div, anchor || null); |
|
if (if_block) if_block.mount(div, null); |
|
/*div_binding*/ ctx[11](div); |
|
current = true; |
|
}, |
|
update(ctx, [dirty]) { |
|
if (/*level*/ ctx[1] > 0) { |
|
if (if_block) { |
|
if_block.update(ctx, dirty); |
|
if_block.intro(1); |
|
} else { |
|
if_block = create_if_block(ctx); |
|
if_block.create(); |
|
if_block.intro(1); |
|
if_block.mount(div, null); |
|
} |
|
} else if (if_block) { |
|
group_outros(); |
|
|
|
transition_out(if_block, 1, 1, () => { |
|
if_block = null; |
|
}); |
|
|
|
check_outros(); |
|
} |
|
|
|
if (dirty & /*container*/ 1) { |
|
toggle_class(div, "container", /*container*/ ctx[0]); |
|
} |
|
}, |
|
intro(local) { |
|
if (current) return; |
|
if_block.intro(); |
|
current = true; |
|
}, |
|
outro(local) { |
|
outros.push(() => { |
|
if_block.outro(); |
|
}); |
|
current = false; |
|
}, |
|
destroy(detaching) { |
|
if (detaching) detach(div); |
|
if (if_block) if_block.destroy(); |
|
/*div_binding*/ ctx[11](null); |
|
dispose(); |
|
} |
|
}; |
|
} |
|
|
|
function get_each_context(ctx, list, i) { |
|
const child_ctx = ctx.slice(); |
|
child_ctx[12] = list[i]; |
|
child_ctx[14] = i; |
|
return child_ctx; |
|
} |
|
|
|
// (115:2) {#if level > 0} |
|
function create_if_block(ctx) { |
|
let each_1_anchor; |
|
let current; |
|
let each_value = nine; |
|
let each_blocks = []; |
|
|
|
for (let i = 0; i < each_value.length; i += 1) { |
|
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); |
|
} |
|
|
|
const out = i => transition_out(each_blocks[i], 1, 1, () => { |
|
each_blocks[i] = null; |
|
}); |
|
|
|
return { |
|
create() { |
|
for (let i = 0; i < each_blocks.length; i += 1) { |
|
each_blocks[i].create(); |
|
} |
|
|
|
each_1_anchor = empty(); |
|
}, |
|
mount(target, anchor) { |
|
for (let i = 0; i < each_blocks.length; i += 1) { |
|
each_blocks[i].mount(target, anchor); |
|
} |
|
|
|
insert(target, each_1_anchor, anchor); |
|
current = true; |
|
}, |
|
update(ctx, dirty) { |
|
if (dirty & /*level, childRefs, focus, move*/ 54) { |
|
each_value = nine; |
|
let i; |
|
|
|
for (i = 0; i < each_value.length; i += 1) { |
|
const child_ctx = get_each_context(ctx, each_value, i); |
|
|
|
if (each_blocks[i]) { |
|
each_blocks[i].update(child_ctx, dirty); |
|
each_blocks[i].intro(1); |
|
} else { |
|
each_blocks[i] = create_each_block(child_ctx); |
|
each_blocks[i].create(); |
|
each_blocks[i].intro(1); |
|
each_blocks[i].mount(each_1_anchor.parentNode, each_1_anchor); |
|
} |
|
} |
|
|
|
group_outros(); |
|
|
|
for (i = each_value.length; i < each_blocks.length; i += 1) { |
|
out(i); |
|
} |
|
|
|
check_outros(); |
|
} |
|
}, |
|
intro(local) { |
|
if (current) return; |
|
|
|
for (let i = 0; i < each_value.length; i += 1) { |
|
each_blocks[i].intro(); |
|
} |
|
|
|
current = true; |
|
}, |
|
outro(local) { |
|
each_blocks = each_blocks.filter(Boolean); |
|
|
|
for (let i = 0; i < each_blocks.length; i += 1) { |
|
outros.push(() => each_blocks[i].outro()); |
|
} |
|
|
|
current = false; |
|
}, |
|
destroy(detaching) { |
|
destroy_each(each_blocks, detaching); |
|
if (detaching) detach(each_1_anchor); |
|
} |
|
}; |
|
} |
|
|
|
// (116:4) {#each nine as _, index} |
|
function create_each_block(ctx) { |
|
let index = /*index*/ ctx[14]; |
|
let current; |
|
|
|
function move_handler(...args) { |
|
return /*move_handler*/ ctx[10](/*index*/ ctx[14], ...args); |
|
} |
|
|
|
let app_props = { level: /*level*/ ctx[1] - 1 }; |
|
const app = new App({ props: app_props }); |
|
ctx[8](app, index); |
|
app.$on("back", /*back_handler*/ ctx[9]); |
|
app.$on("move", move_handler); |
|
|
|
return { |
|
create() { |
|
app.$$.fragment.create(); |
|
}, |
|
mount(target, anchor) { |
|
app.$$.fragment.mounse( target, anchor); |
|
add_render_callback(() => { |
|
const new_on_destroy = app.$$.on_mount.map(run).filter(is_function); |
|
app.$$.on_destroy.push(...new_on_destroy); |
|
}); |
|
current = true; |
|
}, |
|
update(new_ctx, dirty) { |
|
ctx = new_ctx; |
|
|
|
if (index !== /*index*/ ctx[14]) { |
|
/*app_binding*/ ctx[8](null, index); |
|
index = /*index*/ ctx[14]; |
|
ctx[8](app, index); |
|
} |
|
|
|
const app_changes = {}; |
|
if (dirty & /*level*/ 2) app_changes.level = /*level*/ ctx[1] - 1; |
|
app.$set(app_changes); |
|
}, |
|
intro(local) { |
|
if (current) return; |
|
app.$$.fragment.intro(local); |
|
current = true; |
|
}, |
|
outro(local) { |
|
outros.push(() => app.$$.fragment.outro(local)); |
|
current = false; |
|
}, |
|
destroy(detaching) { |
|
/*app_binding*/ ctx[8](null, index); |
|
run_all(app.on_destroy); |
|
app.fragment.destroy(detaching); |
|
} |
|
}; |
|
} |