/// Default showcase package name built by `build_web_bundle`.
pub const WEB_DEFAULT_PACKAGE: &str = "euv-example";
/// Default output directory for WebAssembly bundles.
pub const WEB_DEFAULT_OUT_DIR: &str = "dist/web";
/// Default portable relative asset base URL prefix.
pub const WEB_DEFAULT_ASSET_BASE: &str = "./";
/// Default HTML document title for generated zero-JS WebAssembly bundles.
pub const WEB_DEFAULT_TITLE: &str = "Euv Studio";
/// Environment variable disabling the optional `wasm-opt` pass when set to `"1"`.
pub const ENV_SKIP_WASM_OPT: &str = "EUV_SKIP_WASM_OPT";
/// Rust target triple for WebAssembly browser builds.
pub(crate) const WEB_RUST_TARGET: &str = "wasm32-unknown-unknown";
/// Environment variable overriding release panic strategy for compact WASM binaries.
pub(crate) const ENV_CARGO_RELEASE_PANIC: &str = "CARGO_PROFILE_RELEASE_PANIC";
/// Panic strategy value passed via `CARGO_PROFILE_RELEASE_PANIC`.
pub(crate) const PANIC_ABORT_VALUE: &str = "abort";
/// Environment variable carrying compiler flags for Cargo invocations.
pub(crate) const ENV_RUSTFLAGS: &str = "RUSTFLAGS";
/// Environment variable overriding Cargo target output directory.
pub(crate) const ENV_CARGO_TARGET_DIR: &str = "CARGO_TARGET_DIR";
/// Bulk-memory target feature flag preserved from `.cargo/config.toml`.
pub(crate) const WEB_RUSTFLAG_BULK_MEMORY: &str = "-C target-feature=+bulk-memory";
/// Bulk-memory substring checked before appending `WEB_RUSTFLAG_BULK_MEMORY`.
pub(crate) const WEB_RUSTFLAG_BULK_MEMORY_TOKEN: &str = "target-feature=+bulk-memory";
/// WebAssembly `getrandom` backend cfg flag preserved from `.cargo/config.toml`.
pub(crate) const WEB_RUSTFLAG_GETRANDOM: &str = "--cfg getrandom_backend=\"wasm_js\"";
/// Substring checked before appending `WEB_RUSTFLAG_GETRANDOM`.
pub(crate) const WEB_RUSTFLAG_GETRANDOM_TOKEN: &str = "getrandom_backend";
/// WASM SIMD128 target feature flag required for release WebAssembly builds.
pub(crate) const WEB_RUSTFLAG_SIMD128: &str = "-C target-feature=+simd128";
/// Substring checked before appending `WEB_RUSTFLAG_SIMD128`.
pub(crate) const WEB_RUSTFLAG_SIMD128_TOKEN: &str = "target-feature=+simd128";
/// Cargo CLI binary name.
pub(crate) const WEB_BIN_CARGO: &str = "cargo";
/// `wasm-bindgen` CLI binary name.
pub(crate) const WEB_BIN_WASM_BINDGEN: &str = "wasm-bindgen";
/// `wasm-opt` binaryen optimizer binary name.
pub(crate) const WEB_BIN_WASM_OPT: &str = "wasm-opt";
/// Cargo `metadata` subcommand.
pub(crate) const WEB_ARG_METADATA: &str = "metadata";
/// Cargo `--format-version` flag.
pub(crate) const WEB_ARG_FORMAT_VERSION: &str = "--format-version";
/// Cargo `--filter-platform` flag.
pub(crate) const WEB_ARG_FILTER_PLATFORM: &str = "--filter-platform";
/// Cargo `build` subcommand.
pub(crate) const WEB_ARG_BUILD: &str = "build";
/// Cargo `--release` flag.
pub(crate) const WEB_ARG_RELEASE: &str = "--release";
/// Cargo `--target` flag.
pub(crate) const WEB_ARG_TARGET: &str = "--target";
/// Cargo `--lib` flag.
pub(crate) const WEB_ARG_LIB: &str = "--lib";
/// Cargo `--package` flag.
pub(crate) const WEB_ARG_PACKAGE: &str = "--package";
/// Cargo `--no-default-features` flag.
pub(crate) const WEB_ARG_NO_DEFAULT_FEATURES: &str = "--no-default-features";
/// Cargo `--features` flag.
pub(crate) const WEB_ARG_FEATURES: &str = "--features";
/// Cargo `--version` flag.
pub(crate) const WEB_ARG_VERSION: &str = "--version";
/// `wasm-bindgen` `--no-typescript` flag.
pub(crate) const WEB_ARG_NO_TS: &str = "--no-typescript";
/// `wasm-bindgen` `--out-dir` flag.
pub(crate) const WEB_ARG_OUT_DIR: &str = "--out-dir";
/// `wasm-bindgen` `--out-name` flag.
pub(crate) const WEB_ARG_OUT_NAME: &str = "--out-name";
/// `wasm-bindgen` web target mode value.
pub(crate) const WEB_TARGET_MODE: &str = "web";
/// `wasm-opt` optimization flags preserving SIMD, bulk memory, and reference types.
pub(crate) const WEB_WASM_OPT_FLAGS: [&str; 8] = [
"-Oz",
"--enable-simd",
"--enable-bulk-memory",
"--enable-nontrapping-float-to-int",
"--enable-sign-ext",
"--enable-mutable-globals",
"--enable-reference-types",
"--enable-multivalue",
];
/// Cargo profile output folder name for release builds.
pub(crate) const WEB_PROFILE_RELEASE: &str = "release";
/// Cargo profile output folder name for debug builds.
pub(crate) const WEB_PROFILE_DEBUG: &str = "debug";
/// Default Cargo target directory folder name.
pub(crate) const WEB_TARGET_DIR_NAME: &str = "target";
/// JSON key for `cargo metadata` packages array.
pub(crate) const META_KEY_PACKAGES: &str = "packages";
/// JSON key for `cargo metadata` resolve graph.
pub(crate) const META_KEY_RESOLVE: &str = "resolve";
/// JSON key for `cargo metadata` resolve nodes array.
pub(crate) const META_KEY_NODES: &str = "nodes";
/// JSON key for `cargo metadata` dependency IDs array.
pub(crate) const META_KEY_DEPENDENCIES: &str = "dependencies";
/// JSON key for `cargo metadata` package name.
pub(crate) const META_KEY_NAME: &str = "name";
/// JSON key for `cargo metadata` package version.
pub(crate) const META_KEY_VERSION: &str = "version";
/// JSON key for `cargo metadata` package targets array.
pub(crate) const META_KEY_TARGETS: &str = "targets";
/// JSON key for `cargo metadata` target kind array.
pub(crate) const META_KEY_KIND: &str = "kind";
/// JSON key for `cargo metadata` package features map.
pub(crate) const META_KEY_FEATURES: &str = "features";
/// JSON key for `cargo metadata` target directory string.
pub(crate) const META_KEY_TARGET_DIR: &str = "target_directory";
/// Crate kind marker matching cdylib WebAssembly library targets.
pub(crate) const META_KIND_CDYLIB: &str = "cdylib";
/// Crate kind marker matching Rust rlib library targets.
pub(crate) const META_KIND_RLIB: &str = "rlib";
/// Fallback semantic version used when `cargo metadata` omits a version field.
pub(crate) const WEB_FALLBACK_VERSION: &str = "0.0.0";
/// Crate name for `wasm-bindgen` dependency version lookup.
pub(crate) const DEP_NAME_WASM_BINDGEN: &str = "wasm-bindgen";
/// Suffix appended by `wasm-bindgen` to the generated `.wasm` binary.
pub(crate) const WEB_BG_WASM_SUFFIX: &str = "_bg.wasm";
/// Temporary filename suffix used during `wasm-opt` atomic replacement.
pub(crate) const WEB_OPT_WASM_SUFFIX: &str = "_bg.opt.wasm";
/// Root HTML entrypoint filename.
pub(crate) const WEB_INDEX_HTML: &str = "index.html";
/// SPA fallback HTML filename required for GitHub Pages routing.
pub(crate) const WEB_NOT_FOUND_HTML: &str = "404.html";
/// Empty marker file disabling Jekyll preprocessing on GitHub Pages.
pub(crate) const WEB_NOJEKYLL_NAME: &str = ".nojekyll";
/// Build-plan JSON filename emitted in `--raw-wasm` mode.
pub(crate) const WEB_BUILD_PLAN_JSON: &str = "build-plan.json";
/// Required favicon PNG filename verified in `euv-release.json`.
pub(crate) const WEB_FAVICON_PNG: &str = "favicon.png";
/// Required Apple touch icon PNG filename verified in `euv-release.json`.
pub(crate) const WEB_APPLE_TOUCH_PNG: &str = "apple-touch-icon.png";
/// File extension identifying raw or bindgen WebAssembly binaries.
pub(crate) const WEB_EXT_WASM: &str = ".wasm";
/// File extension identifying external JavaScript files stripped in zero-JS bundles.
pub(crate) const WEB_EXT_JS: &str = ".js";
/// File extension identifying TypeScript declaration files stripped in zero-JS bundles.
pub(crate) const WEB_EXT_DTS: &str = ".d.ts";
/// Manifest filename stripped from zero-JS Web bundles.
pub(crate) const WEB_PACKAGE_JSON: &str = "package.json";
/// Gitignore filename stripped from zero-JS Web bundles.
pub(crate) const WEB_GITIGNORE: &str = ".gitignore";
/// Prefix for theme feature names discovered during `--theme-variants` builds.
pub(crate) const WEB_THEME_FEATURE_PREFIX: &str = "theme-";
/// Baseline variant label built alongside every `theme-*` feature.
pub(crate) const WEB_THEME_DEFAULT_NAME: &str = "default";
/// Subdirectory holding built theme variants under `out_dir`.
pub(crate) const WEB_THEMES_SUBDIR: &str = "themes";
/// Cache directory storing SHA-256 source fingerprints for theme variants.
pub(crate) const WEB_THEME_CACHE_SUBDIR: &str = ".theme-cache";
/// Extension for cached theme variant source fingerprint stamp files.
pub(crate) const WEB_THEME_STAMP_EXT: &str = "sha256";
/// Workspace root Cargo manifest filename used in theme fingerprinting.
pub(crate) const WEB_CARGO_TOML: &str = "Cargo.toml";
/// Workspace Cargo lockfile filename used in theme fingerprinting.
pub(crate) const WEB_CARGO_LOCK: &str = "Cargo.lock";
/// Workspace crate directories scanned when computing theme variant source fingerprints.
pub(crate) const WEB_FINGERPRINT_CRATES: [&str; 5] = ["core", "macros", "ui", "cli", "example"];
/// Source directory name inside each workspace crate.
pub(crate) const WEB_SRC_DIR_NAME: &str = "src";
/// ES module named export statement prefix stripped when inlining `wasm-bindgen` glue.
pub(crate) const WEB_EXPORT_BRACE: &str = "export {";
/// ES module default export statement prefix stripped when inlining `wasm-bindgen` glue.
pub(crate) const WEB_EXPORT_DEFAULT: &str = "export default ";
/// Leading `export ` keyword stripped from top-level declarations when inlining glue.
pub(crate) const WEB_EXPORT_PREFIX: &str = "export ";
/// Fallback WebAssembly initializer used only if no `.js` glue file exists alongside `.wasm`.
pub(crate) const WEB_FALLBACK_WBG_INIT: &str = "async function __wbg_init(p){var u=typeof p==='string'?p:p.module_or_path;if(u instanceof Uint8Array||u instanceof ArrayBuffer){await WebAssembly.instantiate(u);return;}await WebAssembly.instantiateStreaming(fetch(u));}";
/// HTML document opening tags through viewport meta declaration.
pub(crate) const WEB_SHELL_HEAD_OPEN: &str = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\"/>\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1,viewport-fit=cover\"/>\n";
/// HTML preload link opening before the normalized `.wasm` asset URL.
pub(crate) const WEB_SHELL_PRELOAD_OPEN: &str = "<link rel=\"preload\" href=\"";
/// HTML preload link closing matching `build-web.sh` verification assertions.
pub(crate) const WEB_SHELL_PRELOAD_CLOSE: &str =
"\" as=\"fetch\" type=\"application/wasm\" crossorigin/>\n";
/// HTML icon link opening before the embedded PNG data URI.
pub(crate) const WEB_SHELL_FAVICON_OPEN: &str =
"<link rel=\"icon\" type=\"image/png\" sizes=\"96x96\" href=\"";
/// HTML Apple touch icon link between favicon and touch icon URIs.
pub(crate) const WEB_SHELL_APPLE_ICON_MID: &str =
"\"/>\n<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"";
/// HTML title tag opening after icon links.
pub(crate) const WEB_SHELL_TITLE_OPEN: &str = "\"/>\n<title>";
/// Inline stylesheet and splash loader markup opening (preserves tap-highlight and focus-outline resets).
pub(crate) const WEB_SHELL_STYLE_AND_LOADER: &str = "</title>\n<style>:root{--euv-safe-top:env(safe-area-inset-top,0px);--euv-safe-right:env(safe-area-inset-right,0px);--euv-safe-bottom:env(safe-area-inset-bottom,0px);--euv-safe-left:env(safe-area-inset-left,0px);--euv-bg:#09090b;--euv-fg:#fafafa;--euv-muted:#a1a1aa;--euv-track:rgba(255,255,255,0.1);--euv-ring:rgba(255,255,255,0.1);--euv-surface:rgba(24,24,27,0.78);--euv-glow:rgba(99,102,241,0.18);}@media (prefers-color-scheme:light){:root{--euv-bg:#fafafa;--euv-fg:#09090b;--euv-muted:#52525b;--euv-track:rgba(9,9,11,0.09);--euv-ring:rgba(9,9,11,0.09);--euv-surface:rgba(255,255,255,0.88);--euv-glow:rgba(99,102,241,0.12);}}html,body{margin:0;padding:0;width:100vw;height:100vh;height:100dvh;overflow:hidden;background:var(--euv-bg);touch-action:none;}html,body,canvas{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;outline:none;}canvas{display:block;touch-action:none;}canvas:focus,canvas:focus-visible{outline:none;}#euv-wasm-loader{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box;background:radial-gradient(620px circle at 50% 42%,var(--euv-glow),transparent 68%),var(--euv-bg);color:var(--euv-fg);font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Inter,sans-serif;transition:opacity 220ms cubic-bezier(0.22,1,0.36,1);}.euv-wl-card{width:min(320px,86vw);display:flex;flex-direction:column;align-items:center;gap:14px;}.euv-wl-mark{width:56px;height:56px;border-radius:16px;padding:6px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;background:var(--euv-surface);border:1px solid var(--euv-ring);box-shadow:0 8px 28px rgba(0,0,0,0.12);overflow:hidden;}.euv-wl-mark img{display:block;width:42px;height:42px;object-fit:contain;}.euv-wl-title{font-size:16px;font-weight:600;letter-spacing:-0.015em;text-align:center;line-height:1.3;margin:0;}.euv-wl-track{width:100%;height:4px;border-radius:999px;background:var(--euv-track);overflow:hidden;position:relative;}.euv-wl-bar{height:100%;width:0%;border-radius:999px;background:linear-gradient(90deg,#6366f1 0%,#38bdf8 55%,#22d3ee 100%);transition:width 140ms cubic-bezier(0.22,1,0.36,1);position:relative;overflow:hidden;}.euv-wl-bar::after{content:\"\";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,0.45) 50%,transparent 100%);transform:translateX(-100%);animation:euv-wl-shimmer 1.3s ease-in-out infinite;}.euv-wl-meta{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;font-weight:500;color:var(--euv-muted);font-variant-numeric:tabular-nums;}.euv-wl-err{display:none;width:100%;flex-direction:column;align-items:center;gap:10px;text-align:center;}.euv-wl-err-msg{font-size:12px;color:#ef4444;line-height:1.45;}.euv-wl-retry{appearance:none;border:1px solid var(--euv-ring);background:var(--euv-surface);color:var(--euv-fg);font:600 12px/1 -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,sans-serif;padding:8px 16px;border-radius:999px;cursor:pointer;}@keyframes euv-wl-shimmer{0%{transform:translateX(-100%);}100%{transform:translateX(220%);}}</style>\n</head>\n<body>\n<div id=\"euv-wasm-loader\" role=\"status\" aria-live=\"polite\" aria-label=\"Loading WebAssembly\"><div class=\"euv-wl-card\"><div class=\"euv-wl-mark\" aria-hidden=\"true\"><img src=\"";
/// Splash logo closing tags before the escaped bundle title.
pub(crate) const WEB_SHELL_LOGO_END: &str =
"\" width=\"42\" height=\"42\" alt=\"\" decoding=\"sync\"/></div><div class=\"euv-wl-title\">";
/// Splash progress markup closing and inline ES module script opening.
pub(crate) const WEB_SHELL_SCRIPT_OPEN: &str = "</div><div class=\"euv-wl-track\"><div class=\"euv-wl-bar\" id=\"euv-wasm-bar\"></div></div><div class=\"euv-wl-meta\"><span id=\"euv-wasm-status\">Downloading WebAssembly…</span><span id=\"euv-wasm-pct\">0%</span></div><div class=\"euv-wl-err\" id=\"euv-wasm-err\"><span class=\"euv-wl-err-msg\" id=\"euv-wasm-err-msg\"></span><button type=\"button\" class=\"euv-wl-retry\" id=\"euv-wasm-retry\">Retry</button></div></div></div>\n<script type=\"module\">\n";
/// Boot script assignment opening before the normalized `.wasm` URL.
pub(crate) const WEB_SHELL_BOOT_OPEN: &str = "\nconst __euvWasmUrl='";
/// Streaming `ReadableStream` WebAssembly fetcher, progress updater, and retry handler.
pub(crate) const WEB_SHELL_BOOT_BODY: &str = "';\nconst __euvLoader=document.getElementById('euv-wasm-loader');\nconst __euvBar=document.getElementById('euv-wasm-bar');\nconst __euvStatus=document.getElementById('euv-wasm-status');\nconst __euvPct=document.getElementById('euv-wasm-pct');\nconst __euvErr=document.getElementById('euv-wasm-err');\nconst __euvErrMsg=document.getElementById('euv-wasm-err-msg');\nconst __euvRetry=document.getElementById('euv-wasm-retry');\nconst __euvFmtMb=(b)=>(b/1048576).toFixed(1)+' MB';\nconst __euvSetProg=(p,msg)=>{const c=Math.max(0,Math.min(100,Math.round(p)));if(__euvBar)__euvBar.style.width=c+'%';if(__euvPct)__euvPct.textContent=c+'%';if(__euvStatus&&msg)__euvStatus.textContent=msg;};\nasync function __euvFetchWasm(url){\n const resp=await fetch(url);\n if(!resp.ok)throw new Error('HTTP '+resp.status);\n const total=Number(resp.headers.get('content-length')||0);\n if(!resp.body||typeof resp.body.getReader!=='function'){__euvSetProg(50,'Downloading WebAssembly…');return new Uint8Array(await resp.arrayBuffer());}\n const reader=resp.body.getReader();\n const chunks=[];let loaded=0;\n for(;;){const r=await reader.read();if(r.done)break;chunks.push(r.value);loaded+=r.value.byteLength;\n if(total>0){__euvSetProg(Math.min(90,(loaded/total)*90),__euvFmtMb(loaded)+' / '+__euvFmtMb(total));}\n else{__euvSetProg(Math.min(85,85*(1-Math.exp(-loaded/3145728))),__euvFmtMb(loaded));}\n }\n const out=new Uint8Array(loaded);let off=0;\n for(const ch of chunks){out.set(ch,off);off+=ch.byteLength;}\n return out;\n}\nasync function __euvBoot(){\n if(__euvErr)__euvErr.style.display='none';\n __euvSetProg(0,'Downloading WebAssembly…');\n try{\n if(typeof fetch==='function'&&typeof ReadableStream!=='undefined'){\n const bytes=await __euvFetchWasm(__euvWasmUrl);\n __euvSetProg(92,'Compiling WebAssembly…');\n await __wbg_init({ module_or_path: bytes });\n }else{\n __euvSetProg(50,'Loading WebAssembly…');\n await __wbg_init({ module_or_path: __euvWasmUrl });\n }\n __euvSetProg(100,'Ready');\n requestAnimationFrame(()=>{if(__euvLoader){__euvLoader.style.opacity='0';setTimeout(()=>{if(__euvLoader)__euvLoader.remove();},240);}});\n }catch(err){\n if(__euvStatus)__euvStatus.textContent='Load failed';\n if(__euvErrMsg)__euvErrMsg.textContent=(err&&err.message)?String(err.message):'Failed to load WebAssembly module';\n if(__euvErr)__euvErr.style.display='flex';\n }\n}\nif(__euvRetry)__euvRetry.addEventListener('click',__euvBoot);\n__euvBoot();\n</script>\n</body>\n</html>\n";
/// HTML entity replacement for `&`.
pub(crate) const WEB_HTML_AMP: &str = "&";
/// HTML entity replacement for `<`.
pub(crate) const WEB_HTML_LT: &str = "<";
/// HTML entity replacement for `>`.
pub(crate) const WEB_HTML_GT: &str = ">";
/// HTML entity replacement for `"`.
pub(crate) const WEB_HTML_QUOT: &str = """;
/// Error message when `out_dir` is a symlink.
pub(crate) const ERR_WEB_SYMLINK_OUT: &str = "Refusing to write Web bundle through symlink";
/// Error message when `cargo metadata` fails or cannot find the requested package.
pub(crate) const ERR_WEB_METADATA_PACKAGE: &str =
"Unable to resolve package metadata from cargo metadata";
/// Error message when `wasm-bindgen` CLI is missing or mismatches `Cargo.lock`.
pub(crate) const ERR_WEB_WASM_BINDGEN_MISMATCH: &str =
"wasm-bindgen CLI version mismatch against Cargo.lock";
/// Error message when the compiled `.wasm` output is missing after `cargo build`.
pub(crate) const ERR_WEB_COMPILED_WASM_MISSING: &str =
"Expected compiled WebAssembly artifact not found";
/// Error message when no `.wasm` artifact is present inside `out_dir`.
pub(crate) const ERR_WEB_DIR_WASM_MISSING: &str =
"No .wasm artifact found inside web bundle directory";
/// Error message when external `.js` files remain in a zero-JS Web bundle.
pub(crate) const ERR_WEB_EXTERNAL_JS_REMAIN: &str =
"Unexpected external JavaScript files remain in zero-JS bundle";
/// Error message when `404.html` diverges from `index.html`.
pub(crate) const ERR_WEB_FALLBACK_MISMATCH: &str =
"404.html SPA fallback does not match index.html";
/// Error message when `.nojekyll` is missing.
pub(crate) const ERR_WEB_NOJEKYLL_MISSING: &str = "Missing .nojekyll marker file";
/// Error message when `index.html` lacks the expected relative WASM path or preload link.
pub(crate) const ERR_WEB_PRELOAD_OR_HREF: &str =
"index.html missing expected WASM path or preload link";
/// Error message when `index.html` contains a forbidden root-absolute WASM link under `./` base.
pub(crate) const ERR_WEB_ROOT_ABS_WASM: &str =
"index.html contains forbidden root-absolute WASM link";
/// Error message when a subprocess invoked during Web build exits non-zero.
pub(crate) const ERR_WEB_CMD_FAILED: &str = "Web build command exited with non-zero status";