import{Ct as e,F as t,Kt as n,L as r,N as i,Nt as a,Pt as o,R as s,T as c,Vt as l,X as u,ft as d,k as f,mt as p,ot as m,pt as h,tt as g,ut as _,z as v}from"../chunks/xY0c-UfG.js";import"../chunks/xihTtKlq.js";import{t as y}from"../chunks/eTAE0Ol02.js";import{t as b}from"../chunks/zPR_7qo62.js";var x=n({load:()=>S,ssr:()=>!1}),S=async({params:e,fetch:t})=>{try{let n=await t(`/api/share/${encodeURIComponent(e.token)}`);return n.ok?{entry:await n.json(),token:e.token}:{entry:null,token:e.token}}catch{return{entry:null,token:e.token}}},C={id:`default`,name:`Default`,css:`
.sg-document {
	/* Type scale — editor reading parity. */
	--doc-font-size: var(--editor-font-size);
	--doc-line-height: var(--editor-line-height);
	--doc-title-size: var(--text-xl);
	--doc-h1-size: var(--editor-h1-size);
	--doc-h2-size: var(--editor-h2-size);
	--doc-h3-size: var(--editor-h3-size);
	/* Color — maps to BrandingConfig.colors. */
	--doc-text: var(--color-text-primary);
	--doc-muted: var(--color-text-secondary);
	--doc-bg: var(--color-bg);
	--doc-border: var(--color-border);
	--doc-link: var(--color-link);
	--doc-code-bg: rgba(128, 128, 128, 0.12);
	--doc-pre-bg: rgba(128, 128, 128, 0.08);
	/* Print appearance. */
	--doc-print-text: #000;
	--doc-print-bg: #fff;
	--doc-print-muted: #555;

	font-size: var(--doc-font-size);
	line-height: var(--doc-line-height);
	color: var(--doc-text);
	background: var(--doc-bg);
}

.sg-document-title {
	/* Matches the editor's title field (.name-input): --text-xl / 600 / 1.3. */
	font-size: var(--doc-title-size);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
	margin: 0 0 var(--space-6);
	color: var(--doc-text);
}

/* ── Print ── document *appearance* only. The route shell (un-clipping the
   scroll container for paper) stays in +page.svelte. A branded template could
   print in color; the default pins black-on-white so a dark theme doesn't dump
   toner, and reveals external link URLs so references survive off-screen. */
@page { margin: 2cm; }

@media print {
	.sg-document {
		color: var(--doc-print-text);
		background: var(--doc-print-bg);
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
	.sg-document-title,
	.sg-document h1,
	.sg-document h2,
	.sg-document h3 {
		color: var(--doc-print-text);
		break-after: avoid;
	}
	.sg-document pre,
	.sg-document blockquote,
	.sg-document table,
	.sg-document img,
	.sg-document li {
		break-inside: avoid;
	}
	.sg-document a {
		color: var(--doc-print-text);
		text-decoration: underline;
	}
	.sg-document a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 0.85em;
		color: var(--doc-print-muted);
		word-break: break-all;
	}
}
`},w={[C.id]:C};function T(e){return e&&w[e]?w[e]:C}var E=v(`<meta name="robots" content="noindex"/> <!>`,1),D=v(`<main class="share-page share-page--artifact svelte-152is5u"><!></main>`),O=v(`<main class="share-page svelte-152is5u"><article class="share-content sg-document svelte-152is5u"><h1 class="sg-document-title"> </h1> <!></article></main>`),k=v(`<main class="share-page share-page--center svelte-152is5u"><div class="share-unavailable svelte-152is5u"><h1 class="svelte-152is5u">This link is no longer available</h1> <p class="svelte-152is5u">The shared entry may have been removed, or its link revoked.</p></div></main>`);function A(n,v){o(v,!0);let x=e(()=>T(null));var S=s();c(`152is5u`,e=>{var t=E();f(p(h(t),2),()=>`<style>${u(x).css}</style>`),g(()=>{_.title=`${(v.data.entry?v.data.entry.title:`Shared entry`)??``} · Studiograph`}),r(e,t)});var C=h(S),w=e=>{var n=s(),a=h(n),o=e=>{var t=D();y(d(t),{get content(){return v.data.entry.content},showToolbar:!1,mode:`fullscreen`,get shareToken(){return v.data.token}}),l(t),r(e,t)},c=e=>{var n=O(),i=d(n),a=d(i),o=d(a,!0);l(a),b(p(a,2),{get content(){return v.data.entry.content},internalLinks:`strip`,scale:`reading`}),l(i),l(n),m(()=>t(o,v.data.entry.title)),r(e,n)};i(a,e=>{v.data.entry.entityType===`artifact`?e(o):e(c,-1)}),r(e,n)},A=e=>{r(e,k())};i(C,e=>{v.data.entry?e(w):e(A,-1)}),r(n,S),a()}export{A as component,x as universal};