{"release_id":"01a1998d-9802-0000-b0f7-33a23307f4ed","chunk_id":"01a1998d-9930-7dd0-9b2e-cfcf998c9fc1","file":"DPZIGa5z.mjs","mappings":"wVAUO,MAAMA,EAAe,YAErB,SAASC,GAA4B,CAE3C,OADUC,EAAI,oBAAoB,KAAA,EAAO,cAAc,QAAQ,SAAU,EAAE,GAC/D,IACb,CAEO,SAASC,EAAaC,EAAkBC,EAAsBJ,IAAuB,CAC3F,GAAI,CAACI,EAAM,MAAO,GAClB,MAAMC,EAAIF,EAAS,YAAA,EACnB,OAAOE,IAAMD,GAAQC,IAAM,OAAOD,CAAI,EACvC,CAEO,SAASE,EAAaF,EAAsBJ,IAA6B,CAC/E,OAAOI,EAAO,WAAWA,CAAI,GAAK,IACnC,CAOO,MAAMG,EAAe,UAGrB,SAASC,EAAoBC,EAA0B,CAC7D,MAAMC,EAAID,EAAS,QAAQ,OAAQ,EAAE,GAAK,IAC1C,OAAOC,IAAMH,EAAe,IAAMG,CACnC,CAQO,MAAMC,EAAkC,CAAC,WAAY,qBAAsB,eAAe,EAE1F,SAASC,EAAaC,EAA0C,CACtE,OAAKA,EACEF,EAAa,SAASE,EAAK,QAAQ,OAAQ,EAAE,CAAC,EADnC,EAEnB","names":["STUDIO_BRAND","studioHost","env","isStudioHost","hostname","host","n","studioOrigin","STUDIO_ROUTE","studioCanonicalPath","pathname","p","STUDIO_PAGES","isStudioPage","path"],"sources":["../../../../../../src/lib/studio-host.ts"],"sourcesContent":["/** The studio's own domain.\n *\n *  The studio is served by this same deployment under a second domain\n *  (PornPilot). PUBLIC_STUDIO_HOST names it, bare (`pornpilot.app`); `www.` in\n *  front of it counts as the same host. Unset, nothing changes: the studio lives\n *  at ratemyd.app/studio as it always has, which is what lets this ship before\n *  the domain resolves.\n */\nimport { env } from '$env/dynamic/public';\n\nexport const STUDIO_BRAND = 'PornPilot';\n\nexport function studioHost(): string | null {\n\tconst h = env.PUBLIC_STUDIO_HOST?.trim().toLowerCase().replace(/^www\\./, '');\n\treturn h || null;\n}\n\nexport function isStudioHost(hostname: string, host: string | null = studioHost()): boolean {\n\tif (!host) return false;\n\tconst n = hostname.toLowerCase();\n\treturn n === host || n === `www.${host}`;\n}\n\nexport function studioOrigin(host: string | null = studioHost()): string | null {\n\treturn host ? `https://${host}` : null;\n}\n\n/** The studio is PornPilot's front page. On the studio's domain `/` is served by\n *  this route (the `reroute` hook maps it), with no redirect in between: the\n *  studio converts, and the address every link points at answers 200. /studio\n *  stays the same page under the route's own address, so links into it keep\n *  working; its canonical is `/`. ratemyd keeps its own `/`. */\nexport const STUDIO_ROUTE = '/studio';\n\n/** The address a PornPilot page is canonical at: the studio's is `/`. */\nexport function studioCanonicalPath(pathname: string): string {\n\tconst p = pathname.replace(/\\/+$/, '') || '/';\n\treturn p === STUDIO_ROUTE ? '/' : p;\n}\n\n/** PornPilot's own pages beside the studio (RAT-632). Each is a route of this\n *  app that belongs to the studio's domain the way the studio does: served\n *  there, moved there from ratemyd, drawn without ratemyd's nav, and canonical\n *  on PornPilot's origin wherever it happens to be served. One list, so the\n *  host rule, the layout and the nav cannot disagree about which pages these\n *  are. A route id and its path are the same string for a static page. */\nexport const STUDIO_PAGES: readonly string[] = ['/prompts', '/prompts/generator', '/prompts/grok'];\n\nexport function isStudioPage(path: string | null | undefined): boolean {\n\tif (!path) return false;\n\treturn STUDIO_PAGES.includes(path.replace(/\\/+$/, ''));\n}\n"],"version":3}