var HyperscriptI18n=(function(exports){'use strict';function g(n){let r=n.getAttribute("data-lang");if(r)return l(r);let t=n.getAttribute("data-hyperscript-lang")??n.closest?.("[data-hyperscript-lang]")?.getAttribute("data-hyperscript-lang");if(t)return l(t);let e=typeof document<"u"?document.documentElement?.lang:null;return e&&e!=="en"?l(e):null}function l(n){return n.split("-")[0].toLowerCase()}function p(){if(typeof globalThis>"u")return null;let n=globalThis,r=["LokaScriptSemantic","LokaScriptSemanticPriority","LokaScriptSemanticWestern","LokaScriptSemanticEastAsian","LokaScriptSemanticEsEn","LokaScriptSemanticEn","LokaScriptSemanticEs"];for(let t of r){let e=n[t];if(e&&typeof e=="object"&&"parse"in e&&"render"in e)return e}return null}function f(n,r,t,e){try{if(t.translate)return t.translate(n,r,"en");let o=t.parse(n,r);if(o)return t.render(o,"en")}catch{}return n}function m(n={}){return function(t){let e=p();if(!e){console.warn('[hyperscript-i18n] No LokaScriptSemantic global found. Load a semantic bundle before the adapter: <script src="lokascript-semantic.browser.global.js"></script>');return}let{internals:o}=t,u=o.runtime,d=u.getScript.bind(u);if(u.getScript=function(a){let i=d(a);if(!i)return null;let s=S(a,n);if(!s||s==="en")return i;let c=f(i,s,e);return n.debug&&c!==i&&console.log(`[hyperscript-i18n] ${s}: "${i}" \u2192 "${c}"`),c},n.debug){let a=e.getSupportedLanguages?.()??["(unknown)"];console.log(`[hyperscript-i18n] Lite adapter loaded. Languages: ${a.join(", ")}`);}}}function S(n,r){if(r.languageAttribute){let e=n.getAttribute(r.languageAttribute);if(e)return e.split("-")[0].toLowerCase()}let t=g(n);return t||(r.defaultLanguage??null)}function h(n,r){if(r==="en")return n;let t=p();if(!t)throw new Error("No LokaScriptSemantic global found");return f(n,r,t)}typeof _hyperscript<"u"&&_hyperscript.use&&_hyperscript.use(m());exports.hyperscriptI18n=m;exports.preprocess=h;exports.resolveLanguage=g;return exports;})({});