import { z } from "zod"; export declare const PREVIEW_GUIDE_SCRIPT = "(() => {\n const say = (message) => parent.postMessage({ intenticHtmlPreview: message }, \"*\");\n const memory = () => {\n const held = new Map();\n return {\n get length() { return held.size; },\n key: (index) => [...held.keys()][index] ?? null,\n getItem: (key) => (held.has(String(key)) ? held.get(String(key)) : null),\n setItem: (key, value) => { held.set(String(key), String(value)); },\n removeItem: (key) => { held.delete(String(key)); },\n clear: () => { held.clear(); },\n };\n };\n for (const name of [\"localStorage\", \"sessionStorage\"]) {\n try { void window[name]; } catch { Object.defineProperty(window, name, { value: memory(), configurable: true }); }\n }\n try { void document.cookie; } catch {\n const jar = new Map();\n Object.defineProperty(document, \"cookie\", {\n configurable: true,\n get: () => [...jar].map(([name, value]) => name + \"=\" + value).join(\"; \"),\n set: (text) => {\n const [pair, ...attributes] = String(text).split(\";\");\n const at = pair.indexOf(\"=\");\n const name = (at < 0 ? \"\" : pair.slice(0, at)).trim();\n const value = (at < 0 ? pair : pair.slice(at + 1)).trim();\n const gone = attributes.some((attribute) => {\n const [key, ...rest] = attribute.split(\"=\");\n const setting = rest.join(\"=\").trim();\n const lower = key.trim().toLowerCase();\n return (lower === \"max-age\" && Number(setting) <= 0) || (lower === \"expires\" && Date.parse(setting) < Date.now());\n });\n if (gone) jar.delete(name); else jar.set(name, value);\n },\n });\n }\n addEventListener(\"vite:preloadError\", (event) => event.preventDefault());\n const Native = window.Worker;\n if (typeof Native === \"function\") {\n window.Worker = function Worker(script, options) {\n const url = new URL(String(script), location.href);\n if (!/^https?:$/.test(url.protocol)) return new Native(script, options);\n const at = JSON.stringify(url.href);\n const fetches = \"const get = self.fetch.bind(self); self.fetch = (input, init) => get(typeof input === 'string' ? new URL(input, \" + at + \").href : input, init);\";\n // Chromium starts no module worker from a blob an opaque origin made, but does from a data address; the\n // fetch fix is a module of its own so it runs before the worker's, as static imports run in order.\n if (options?.type === \"module\") {\n const data = (code) => \"data:text/javascript,\" + encodeURIComponent(code);\n return new Native(data(\"import \" + JSON.stringify(data(fetches)) + \"; import \" + at + \";\"), options);\n }\n const body = fetches + \"const load = self.importScripts.bind(self);\" +\n \"self.importScripts = (...urls) => load(...urls.map((each) => new URL(each, \" + at + \").href)); load(\" + at + \");\";\n return new Native(URL.createObjectURL(new Blob([body], { type: \"text/javascript\" })), options);\n };\n window.Worker.prototype = Native.prototype;\n }\n const prefix = location.pathname.split(\"/\").slice(0, 4).join(\"/\") + \"/\";\n const own = (url) => {\n try {\n const parsed = new URL(url, location.href);\n return parsed.origin === location.origin && parsed.pathname.startsWith(prefix) ? decodeURIComponent(parsed.pathname.slice(prefix.length)) : undefined;\n // allow(silent-catch): an address that does not parse or decode is not one of the page's own files.\n } catch { return undefined; }\n };\n addEventListener(\"click\", (event) => {\n const link = event.target instanceof Element ? event.target.closest(\"a[href], area[href]\") : null;\n if (link === null || event.button !== 0 || event.defaultPrevented) return;\n const href = link.href;\n if (!/^https?:/i.test(href) || own(href) !== undefined) return;\n event.preventDefault();\n say({ href });\n });\n const told = new Set();\n const tell = (urls) => {\n const fresh = [];\n for (const url of urls) {\n const path = own(url);\n if (path !== undefined && !told.has(path)) { told.add(path); fresh.push(path); }\n }\n if (fresh.length > 0) say({ loaded: fresh });\n };\n tell([location.href]);\n new PerformanceObserver((list) => tell(list.getEntries().map((entry) => entry.name))).observe({ type: \"resource\", buffered: true });\n addEventListener(\"error\", (event) => {\n const element = event.target;\n if (!(element instanceof Element)) return;\n const url = element.currentSrc || element.src || element.href;\n const path = typeof url === \"string\" ? own(url) : undefined;\n if (path !== undefined) say({ missing: path });\n }, true);\n let moved = 0;\n addEventListener(\"pointermove\", (event) => {\n if (event.pointerType === \"touch\" || event.timeStamp - moved < 150) return;\n moved = event.timeStamp;\n say({ pointer: true });\n }, true);\n addEventListener(\"pointerout\", (event) => {\n if (event.relatedTarget !== null || event.pointerType === \"touch\") return;\n moved = 0;\n say({ pointer: false });\n }, true);\n const snapshot = () => {\n const live = [...document.querySelectorAll(\"canvas\")];\n const copy = document.documentElement.cloneNode(true);\n [...copy.querySelectorAll(\"canvas\")].forEach((canvas, index) => {\n try {\n const picture = document.createElement(\"img\");\n picture.src = live[index].toDataURL();\n picture.style.cssText = canvas.style.cssText;\n picture.width = live[index].clientWidth || live[index].width;\n canvas.replaceWith(picture);\n // allow(silent-catch): a canvas drawn from another origin cannot be read, and prints as the page left it.\n } catch {}\n });\n for (const element of copy.querySelectorAll(\"[src], [href], [poster]\")) {\n for (const name of [\"src\", \"href\", \"poster\"]) {\n const value = element.getAttribute(name);\n if (value !== null && !/^(?:data|blob|javascript|mailto):/i.test(value) && URL.canParse(value, document.baseURI)) {\n element.setAttribute(name, new URL(value, document.baseURI).href);\n }\n }\n }\n return copy.outerHTML;\n };\n addEventListener(\"message\", (event) => {\n if (event.source === parent && event.data?.intenticPrint === true) parent.postMessage({ intenticPrintHtml: snapshot() }, \"*\");\n });\n})();"; export declare const PreviewGuideSayingSchema: z.ZodObject<{ intenticHtmlPreview: z.ZodUnion, z.ZodObject<{ pointer: z.ZodBoolean; }, z.core.$strip>, z.ZodObject<{ loaded: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ missing: z.ZodString; }, z.core.$strip>]>; }, z.core.$strip>; export type PreviewGuideSaying = z.infer["intenticHtmlPreview"]; //# sourceMappingURL=preview-guide.d.ts.map