{"version":3,"file":"stores.191a2217.mjs","sources":["../../../../../../node_modules/@sveltejs/kit/src/runtime/app/stores.js"],"sourcesContent":["import { getContext } from 'svelte';\nimport { browser } from './environment.js';\nimport { stores as browser_stores } from '../client/singletons.js';\n\n/**\n * @type {import('$app/stores').getStores}\n */\nexport const getStores = () => {\n\tconst stores = browser ? browser_stores : getContext('__svelte__');\n\n\treturn {\n\t\tpage: {\n\t\t\tsubscribe: stores.page.subscribe\n\t\t},\n\t\tnavigating: {\n\t\t\tsubscribe: stores.navigating.subscribe\n\t\t},\n\t\tupdated: stores.updated\n\t};\n};\n\n/** @type {typeof import('$app/stores').page} */\nexport const page = {\n\t/** @param {(value: any) => void} fn */\n\tsubscribe(fn) {\n\t\tconst store = __SVELTEKIT_DEV__ ? get_store('page') : getStores().page;\n\t\treturn store.subscribe(fn);\n\t}\n};\n\n/** @type {typeof import('$app/stores').navigating} */\nexport const navigating = {\n\tsubscribe(fn) {\n\t\tconst store = __SVELTEKIT_DEV__ ? get_store('navigating') : getStores().navigating;\n\t\treturn store.subscribe(fn);\n\t}\n};\n\n/** @type {typeof import('$app/stores').updated} */\nexport const updated = {\n\tsubscribe(fn) {\n\t\tconst store = __SVELTEKIT_DEV__ ? get_store('updated') : getStores().updated;\n\n\t\tif (browser) {\n\t\t\tupdated.check = store.check;\n\t\t}\n\n\t\treturn store.subscribe(fn);\n\t},\n\tcheck: () => {\n\t\tthrow new Error(\n\t\t\tbrowser\n\t\t\t\t? `Cannot check updated store before subscribing`\n\t\t\t\t: `Can only check updated store in browser`\n\t\t);\n\t}\n};\n\n/**\n * @template {keyof ReturnType<typeof getStores>} Name\n * @param {Name} name\n * @returns {ReturnType<typeof getStores>[Name]}\n */\nfunction get_store(name) {\n\ttry {\n\t\treturn getStores()[name];\n\t} catch (e) {\n\t\tthrow new Error(\n\t\t\t`Cannot subscribe to '${name}' store on the server outside of a Svelte component, as it is bound to the current request via component context. This prevents state from leaking between users.`\n\t\t);\n\t}\n}\n"],"names":["getStores","stores","browser_stores","page","fn"],"mappings":"8CAOO,MAAMA,EAAY,IAAM,CAC9B,MAAMC,EAAmBC,EAEzB,MAAO,CACN,KAAM,CACL,UAAWD,EAAO,KAAK,SACvB,EACD,WAAY,CACX,UAAWA,EAAO,WAAW,SAC7B,EACD,QAASA,EAAO,OAClB,CACA,EAGaE,EAAO,CAEnB,UAAUC,EAAI,CAEb,OADsDJ,EAAW,EAAC,KACrD,UAAUI,CAAE,CACzB,CACF","x_google_ignoreList":[0]}