root.svelte
1 <!-- This file is generated by @sveltejs/kit — do not edit it! --> 2 <svelte:options runes={true} /> 3 <script> 4 import { setContext, onMount, tick } from 'svelte'; 5 import { browser } from '$app/environment'; 6 7 // stores 8 let { stores, page, constructors, components = [], form, data_0 = null, data_1 = null } = $props(); 9 10 if (!browser) { 11 setContext('__svelte__', stores); 12 } 13 14 if (browser) { 15 $effect.pre(() => stores.page.set(page)); 16 } else { 17 stores.page.set(page); 18 } 19 $effect(() => { 20 stores;page;constructors;components;form;data_0;data_1; 21 stores.page.notify(); 22 }); 23 24 let mounted = $state(false); 25 let navigated = $state(false); 26 let title = $state(null); 27 28 onMount(() => { 29 const unsubscribe = stores.page.subscribe(() => { 30 if (mounted) { 31 navigated = true; 32 tick().then(() => { 33 title = document.title || 'untitled page'; 34 }); 35 } 36 }); 37 38 mounted = true; 39 return unsubscribe; 40 }); 41 42 const Pyramid_1=$derived(constructors[1]) 43 </script> 44 45 {#if constructors[1]} 46 {@const Pyramid_0 = constructors[0]} 47 <!-- svelte-ignore binding_property_non_reactive --> 48 <Pyramid_0 bind:this={components[0]} data={data_0} {form}> 49 <!-- svelte-ignore binding_property_non_reactive --> 50 <Pyramid_1 bind:this={components[1]} data={data_1} {form} /> 51 </Pyramid_0> 52 53 {:else} 54 {@const Pyramid_0 = constructors[0]} 55 <!-- svelte-ignore binding_property_non_reactive --> 56 <Pyramid_0 bind:this={components[0]} data={data_0} {form} /> 57 58 {/if} 59 60 {#if mounted} 61 <div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"> 62 {#if navigated} 63 {title} 64 {/if} 65 </div> 66 {/if}