furifont 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/cli.d.mts +1 -0
  2. package/dist/cli.mjs +53 -0
  3. package/dist/client/200.html +1 -0
  4. package/dist/client/404.html +1 -0
  5. package/dist/client/_nuxt/AmQakyTh.js +1 -0
  6. package/dist/client/_nuxt/BDNMzG2s.js +1 -0
  7. package/dist/client/_nuxt/Bc3GUY-S.js +3 -0
  8. package/dist/client/_nuxt/Bs3Pv9Qv.js +1 -0
  9. package/dist/client/_nuxt/C4NVi0HP.js +75 -0
  10. package/dist/client/_nuxt/CC4_XjFP.js +3 -0
  11. package/dist/client/_nuxt/CEWHii-_.js +3 -0
  12. package/dist/client/_nuxt/CEo6aVYN.js +1 -0
  13. package/dist/client/_nuxt/CQTZHv-y.js +1 -0
  14. package/dist/client/_nuxt/CRzLMJPS.js +1 -0
  15. package/dist/client/_nuxt/Cg7TlFyt.js +1 -0
  16. package/dist/client/_nuxt/DA1XwGcq.js +1 -0
  17. package/dist/client/_nuxt/DGhFAXuQ.js +1 -0
  18. package/dist/client/_nuxt/DLl_pn_F.js +58 -0
  19. package/dist/client/_nuxt/DSYkQlQa.js +1 -0
  20. package/dist/client/_nuxt/DT7XmrQw.js +132 -0
  21. package/dist/client/_nuxt/DTC_KzWZ.js +79 -0
  22. package/dist/client/_nuxt/DhRy_lmV.js +1 -0
  23. package/dist/client/_nuxt/DmOlRIb5.js +2 -0
  24. package/dist/client/_nuxt/DmlUWPPW.js +3 -0
  25. package/dist/client/_nuxt/Dz56DRZ7.js +59 -0
  26. package/dist/client/_nuxt/HB7Qu17x.js +1 -0
  27. package/dist/client/_nuxt/JRbXhaR6.js +1 -0
  28. package/dist/client/_nuxt/builds/latest.json +1 -0
  29. package/dist/client/_nuxt/builds/meta/1bd12827-b513-45af-9638-872afc8faff4.json +1 -0
  30. package/dist/client/_nuxt/entry.CsCxOCYm.css +1 -0
  31. package/dist/client/_nuxt/error-404.DqUWOYf4.css +1 -0
  32. package/dist/client/_nuxt/error-500.BYTKxx4O.css +1 -0
  33. package/dist/client/_nuxt/g9q6jbAq.js +1 -0
  34. package/dist/client/_nuxt/jjE7wdAL.js +1 -0
  35. package/dist/client/_nuxt/nNFr3PcB.js +2 -0
  36. package/dist/client/_nuxt/nQF5Cd64.js +3 -0
  37. package/dist/client/_nuxt/y07Wd5I9.js +1 -0
  38. package/dist/client/customize/index.html +1 -0
  39. package/dist/client/docs/index.html +1 -0
  40. package/dist/client/favicon.svg +4 -0
  41. package/dist/client/furifont.user.js +69 -0
  42. package/dist/client/index.html +1 -0
  43. package/dist/client/logo.svg +4 -0
  44. package/dist/client/og.png +0 -0
  45. package/dist/client/okurigana.json +5339 -0
  46. package/dist/client/reference/index.html +1 -0
  47. package/dist/client/version.json +1 -0
  48. package/dist/config-BgEXAgR6.mjs +181 -0
  49. package/dist/devframe.d.mts +5 -0
  50. package/dist/devframe.mjs +24 -0
  51. package/dist/index.d.mts +162 -0
  52. package/dist/index.mjs +4 -0
  53. package/dist/studio-DLNpk_rE.mjs +137 -0
  54. package/package.json +5 -5
package/dist/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ export {}
package/dist/cli.mjs ADDED
@@ -0,0 +1,53 @@
1
+ import { a as buildFont, i as loadConfig, n as FONT_FORMATS, p as version, r as FurifontConfigSchema, t as CONFIG_FILE } from "./config-BgEXAgR6.mjs";
2
+ import { relative } from "node:path";
3
+ import process from "node:process";
4
+ import { RUBY_SCRIPTS } from "@furifont/core";
5
+ import * as v from "valibot";
6
+ import { cac } from "cac";
7
+ //#region src/cli.ts
8
+ const STUDIO_PAGE = "customize";
9
+ const cli = cac("furifont");
10
+ cli.command("build", "Build a font into --out").option("--config <file>", `Config file`, { default: CONFIG_FILE }).option("--base <font>", "A font to download, such as \"Source Han Serif JP Bold\", or a font file").option("--family <name>", "Font family name").option("--script <script>", `Ruby script: ${RUBY_SCRIPTS.join(", ")}`).option("--nf <bucket>", "Annotate words up to this newspaper frequency bucket (1-48)").option("--formats <list>", `Fonts to write, comma-separated: ${FONT_FORMATS.join(", ")}`).option("--out <dir>", "Output directory", { default: "fonts" }).action(async (flags) => {
11
+ const cwd = process.cwd();
12
+ const overrides = {
13
+ ...flags.base && { base: flags.base },
14
+ ...flags.family && { family: flags.family },
15
+ ...flags.script && { rubyScript: v.parse(v.picklist(RUBY_SCRIPTS), flags.script) },
16
+ ...flags.nf && { nfMax: Number(flags.nf) },
17
+ ...flags.formats && { formats: v.parse(v.array(v.picklist(FONT_FORMATS)), flags.formats.split(",")) }
18
+ };
19
+ const config = v.parse(FurifontConfigSchema, {
20
+ ...await loadConfig(cwd, flags.config),
21
+ ...overrides
22
+ });
23
+ const { files, report } = await buildFont(config, {
24
+ cwd,
25
+ outDir: flags.out,
26
+ onProgress: ({ step, done, total }) => process.stderr.write(`\r${step}${total ? ` ${done}/${total}` : ""}`.padEnd(24))
27
+ });
28
+ process.stderr.write("\r".padEnd(24));
29
+ const { stats } = report;
30
+ console.log(`\r${stats.patterns} words, ${stats.isolated} lone kanji, ${stats.glyphs} ruby glyphs`);
31
+ for (const file of files) console.log(` ${relative(cwd, file.path)} ${(file.bytes / 1024 / 1024).toFixed(1)} MB`);
32
+ });
33
+ cli.command("dev", "Open the studio to customize, preview and build fonts").option("--port <port>", "Port to listen on").option("--host <host>", "Host to bind, 0.0.0.0 to reach it from another machine", { default: "localhost" }).option("--open", "Open the studio in a browser", { default: true }).option("--auth", "Ask for the one-time code printed here; --no-auth only on a machine you trust", { default: true }).action(async (flags) => {
34
+ const [{ createDevServer }, { default: devframe }] = await Promise.all([import("devframe/adapters/dev"), import("./devframe.mjs")]);
35
+ await createDevServer(devframe, {
36
+ host: flags.host,
37
+ port: flags.port ? Number(flags.port) : void 0,
38
+ openBrowser: flags.open && STUDIO_PAGE,
39
+ auth: flags.auth ? void 0 : false,
40
+ allowedOrigins: flags.host === "localhost" ? void 0 : false,
41
+ onReady: ({ origin }) => console.log(`Furifont studio: ${origin}/${STUDIO_PAGE}`)
42
+ });
43
+ });
44
+ cli.help();
45
+ cli.version(version);
46
+ cli.parse(process.argv, { run: false });
47
+ await cli.runMatchedCommand()?.catch((error) => {
48
+ console.error(error.message);
49
+ process.exitCode = 1;
50
+ });
51
+ if (!cli.matchedCommand && !cli.options.help && !cli.options.version) cli.outputHelp();
52
+ //#endregion
53
+ export {};
@@ -0,0 +1 @@
1
+ <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Furifont: furigana built into the font</title><script type="importmap">{"imports":{"#entry":"/_nuxt/CC4_XjFP.js"}}</script><link rel="stylesheet" href="/_nuxt/entry.CsCxOCYm.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/_nuxt/CC4_XjFP.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/y07Wd5I9.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/DmlUWPPW.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/DmOlRIb5.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/Cg7TlFyt.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/CRzLMJPS.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/CEWHii-_.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/BDNMzG2s.js"><script type="module" src="/_nuxt/CC4_XjFP.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/_nuxt/DLl_pn_F.js"><link rel="prefetch" as="script" crossorigin href="/_nuxt/Dz56DRZ7.js"><link rel="prefetch" as="script" crossorigin href="/_nuxt/DT7XmrQw.js"><link rel="prefetch" as="script" crossorigin href="/_nuxt/jjE7wdAL.js"><link rel="prefetch" as="script" crossorigin href="/_nuxt/Bs3Pv9Qv.js"><link rel="prefetch" as="script" crossorigin href="/_nuxt/DA1XwGcq.js"><link rel="prefetch" as="style" crossorigin href="/_nuxt/error-404.DqUWOYf4.css"><link rel="prefetch" as="script" crossorigin href="/_nuxt/CEo6aVYN.js"><link rel="prefetch" as="style" crossorigin href="/_nuxt/error-500.BYTKxx4O.css"><link rel="prefetch" as="script" crossorigin href="/_nuxt/DhRy_lmV.js"><meta name="description" content="A Japanese font that shows furigana by itself."><meta property="og:type" content="website"><meta property="og:url" content="https://furifont.antfu.me"><meta property="og:title" content="Furifont: furigana built into the font"><meta property="og:description" content="A Japanese font that shows furigana by itself."><meta property="og:image" content="https://furifont.antfu.me/og.png"><meta property="og:image:width" content="2400"><meta property="og:image:height" content="1260"><meta property="og:image:alt" content="Furifont: furigana built into the font"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="Furifont: furigana built into the font"><meta name="twitter:description" content="A Japanese font that shows furigana by itself."><meta name="twitter:image" content="https://furifont.antfu.me/og.png"><link rel="icon" type="image/svg+xml" href="favicon.svg"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{devCustomizeBase:"/__furifont/"},app:{baseURL:"/",buildId:"1bd12827-b513-45af-9638-872afc8faff4",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1792041185170,false]</script></body></html>
@@ -0,0 +1 @@
1
+ <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Furifont: furigana built into the font</title><script type="importmap">{"imports":{"#entry":"/_nuxt/CC4_XjFP.js"}}</script><link rel="stylesheet" href="/_nuxt/entry.CsCxOCYm.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/_nuxt/CC4_XjFP.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/y07Wd5I9.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/DmlUWPPW.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/DmOlRIb5.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/Cg7TlFyt.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/CRzLMJPS.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/CEWHii-_.js"><link rel="modulepreload" as="script" crossorigin href="/_nuxt/BDNMzG2s.js"><script type="module" src="/_nuxt/CC4_XjFP.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/_nuxt/DLl_pn_F.js"><link rel="prefetch" as="script" crossorigin href="/_nuxt/Dz56DRZ7.js"><link rel="prefetch" as="script" crossorigin href="/_nuxt/DT7XmrQw.js"><link rel="prefetch" as="script" crossorigin href="/_nuxt/jjE7wdAL.js"><link rel="prefetch" as="script" crossorigin href="/_nuxt/Bs3Pv9Qv.js"><link rel="prefetch" as="script" crossorigin href="/_nuxt/DA1XwGcq.js"><link rel="prefetch" as="style" crossorigin href="/_nuxt/error-404.DqUWOYf4.css"><link rel="prefetch" as="script" crossorigin href="/_nuxt/CEo6aVYN.js"><link rel="prefetch" as="style" crossorigin href="/_nuxt/error-500.BYTKxx4O.css"><link rel="prefetch" as="script" crossorigin href="/_nuxt/DhRy_lmV.js"><meta name="description" content="A Japanese font that shows furigana by itself."><meta property="og:type" content="website"><meta property="og:url" content="https://furifont.antfu.me"><meta property="og:title" content="Furifont: furigana built into the font"><meta property="og:description" content="A Japanese font that shows furigana by itself."><meta property="og:image" content="https://furifont.antfu.me/og.png"><meta property="og:image:width" content="2400"><meta property="og:image:height" content="1260"><meta property="og:image:alt" content="Furifont: furigana built into the font"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="Furifont: furigana built into the font"><meta name="twitter:description" content="A Japanese font that shows furigana by itself."><meta name="twitter:image" content="https://furifont.antfu.me/og.png"><link rel="icon" type="image/svg+xml" href="favicon.svg"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{devCustomizeBase:"/__furifont/"},app:{baseURL:"/",buildId:"1bd12827-b513-45af-9638-872afc8faff4",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1792041185170,false]</script></body></html>
@@ -0,0 +1 @@
1
+ import{C as e,D as t,E as n,Gt as r,K as i,Kt as a,M as o,P as s,V as c,Z as l,_t as u,at as d,it as f,ot as p,tt as m,vt as h,w as g,wt as _}from"./DmlUWPPW.js";import{r as v}from"./CEWHii-_.js";import{n as y}from"./g9q6jbAq.js";import{r as b}from"#entry";function x(){let e=h(),t;async function n(n){await navigator.clipboard?.writeText(n).then(()=>!0,()=>!1)&&(e.value=n,clearTimeout(t),t=setTimeout(()=>e.value=void 0,1200))}return{copied:u(e),copy:n}}var S=[`aria-label`],C=Object.assign(s({__name:`FuriText`,props:c({family:{default:()=>v[0].family},ruby:{type:Boolean,default:!0},size:{default:32},weight:{default:400},okurigana:{}},{text:{required:!0},textModifiers:{}}),emits:[`update:text`],setup(n){let a=f(n,`text`),o=e(()=>({fontFamily:`"${n.family}", sans-serif`,fontSize:`${n.size}px`,fontWeight:n.weight,lineHeight:y,fontFeatureSettings:n.ruby?`normal`:`"ss01"`}));function s(e){let t=[],n=0;for(let r of e.childNodes){let e=r.textContent.length;r instanceof HTMLElement&&t.push({at:n,length:e,salt:Number(r.dataset.salt)}),n+=e}return t}function c(e){let t=getSelection();if(!t?.rangeCount||!t.isCollapsed||!e.contains(t.anchorNode))return;let n=document.createRange();return n.selectNodeContents(e),n.setEnd(t.anchorNode,t.anchorOffset),n.toString().length}function u(e,t){let n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),r=t;for(let e=n.nextNode();e;e=n.nextNode()){let t=e.nodeValue.length;if(r<=t){let t=document.createRange();t.setStart(e,r),t.collapse(!0),getSelection().removeAllRanges(),getSelection().addRange(t);return}r-=t}}let m=d(`el`),h,g=!1,v;function b(e,t,r=!1){let i=n.ruby&&n.okurigana?n.okurigana.find(t):[];if(!r&&e.textContent===t&&JSON.stringify(s(e))===JSON.stringify(i.map(({at:e,length:t,salt:n})=>({at:e,length:t,salt:n}))))return;let a=c(e),o=[],l=0;for(let e of i){o.push(t.slice(l,e.at));let n=document.createElement(`span`);n.textContent=t.slice(e.at,e.at+e.length),n.dataset.salt=String(e.salt),n.style.fontFeatureSettings=`"salt" ${e.salt}`,o.push(n),l=e.at+e.length}o.push(t.slice(l)),e.replaceChildren(...o.filter(e=>e!==``)),a!==void 0&&u(e,a)}p([m,a],([e,t])=>{e&&t!==h&&b(e,t,!0)},{immediate:!0}),p([()=>n.okurigana,()=>n.ruby],()=>{m.value&&b(m.value,h??a.value)});function x(){g=!0}function C(){g=!1,w()}function w(){h=m.value.innerText,a.value=h,clearTimeout(v),v=setTimeout(()=>!g&&m.value&&b(m.value,h),300)}return i(()=>clearTimeout(v)),(e,n)=>(l(),t(`p`,{ref_key:`el`,ref:m,lang:`ja`,contenteditable:`plaintext-only`,spellcheck:`false`,role:`textbox`,"aria-multiline":`true`,"aria-label":e.$t(`editable`),class:`cursor-text whitespace-pre-wrap break-words outline-1 outline-transparent outline-offset-4 transition-[outline-color] hover:outline-dashed hover:outline-[var(--ff-line)] focus:outline-dashed focus:outline-[var(--ff-fg)]`,style:r(_(o)),onInput:w,onCompositionstart:x,onCompositionend:C},null,44,S))}}),{__name:`FuriText`}),w={class:`relative border-t border-base`},T={key:0,class:`flex items-baseline gap-3 border-b border-base px-6 py-3`},E={key:0,class:`label`},D={class:`label color-base`},O=Object.assign(s({__name:`UiSection`,props:{index:{},title:{}},setup(e){return(r,i)=>{let s=b;return l(),t(`section`,w,[o(s,{class:`-left-[6px] -top-[6px]`}),o(s,{class:`-right-[6px] -top-[6px]`}),e.title?(l(),t(`header`,T,[e.index?(l(),t(`span`,E,a(e.index),1)):n(``,!0),g(`h2`,D,a(e.title),1),m(r.$slots,`aside`)])):n(``,!0),m(r.$slots,`default`)])}}}),{__name:`UiSection`});export{C as n,x as r,O as t};
@@ -0,0 +1 @@
1
+ var e=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};export{e as t};
@@ -0,0 +1,3 @@
1
+ import{t as e}from"./y07Wd5I9.js";import{t}from"./CRzLMJPS.js";function n(e){return t=>{let n=`${e.bold(e.red(`[${t.name}]`))} ${t.message}`,r=[];return t.fix&&r.push(`${e.dim(`fix:`)} ${t.fix}`),t.sources?.length&&r.push(`${e.dim(`sources:`)} ${t.sources.join(`, `)}`),t.docs&&r.push(`${e.dim(`see:`)} ${e.cyan(t.docs)}`),r.length===0?n:[n,...r.map((t,n)=>`${e.dim(n<r.length-1?`├▶`:`╰▶`)} ${t}`)].join(`
2
+ `)}}var r=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function i(e=21){let t=``,n=e;for(;n--;)t+=r[Math.random()*64|0];return t}function a(e,t){let n=`\x1B[${e}m`,r=`\x1B[${t}m`;return((e,...t)=>{if(Array.isArray(e)&&`raw`in e){let i=e,a=``;for(let e=0;e<i.length;e++)a+=i[e],e<t.length&&(a+=String(t[e]));return`${n}${a}${r}`}return`${n}${String(e)}${r}`})}var o={blue:a(34,39),cyan:a(36,39),gray:a(90,39),green:a(32,39),red:a(31,39),yellow:a(33,39),bold:a(1,22),dim:a(2,22),reset:a(0,0),underline:a(4,24)},s={bus:{agentManifestChanged:`agent:manifest:changed`,agentToolRegistered:`agent:tool:registered`,agentToolUnregistered:`agent:tool:unregistered`,agentResourceRegistered:`agent:resource:registered`,agentResourceUnregistered:`agent:resource:unregistered`},client:{isTrustedUpdated:`rpc:is-trusted:updated`,error:`rpc:error`,connectionStatus:`connection:status`,connectionError:`connection:error`},broadcast:{authRevoked:`devframe:auth:revoked`,cacheInvalidate:`devframe:rpc:cache:invalidate`,clientStateUpdated:`devframe:rpc:client-state:updated`,clientStatePatch:`devframe:rpc:client-state:patch`,streamingChunk:`devframe:streaming:chunk`,streamingEnd:`devframe:streaming:end`,streamingUploadCancel:`devframe:streaming:upload-cancel`},inPageChannel:{panelStateUpdated:`devframe:in-page:panel-state:updated`,panelStatePatch:`devframe:in-page:panel-state:patch`},postMessage:{remoteAssetsError:`devframe:remote-assets-error`,inPageChannel:`devframe:in-page-channel`}},c=n(o);function l(e,{method:t=`warn`}={}){console[t](c(e))}function u(t){return e({...t,reporters:[l,...t.reporters??[]]})}function d(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var f=Math.random.bind(Math),p=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`;function m(e=21){let t=``,n=e;for(;n--;)t+=p[f()*64|0];return t}var h=6e4,g=e=>e,_=g,{clearTimeout:v,setTimeout:y}=globalThis;function b(e,t){let{post:n,on:r,off:i=()=>{},eventNames:a=[],serialize:o=g,deserialize:s=_,resolver:c,bind:l=`rpc`,timeout:u=h,proxify:f=!0}=t,p=!1,b=new Map,x,S;async function C(e,r,i,a){if(p)throw Error(`[birpc] rpc is closed, cannot call "${e}"`);let s={m:e,a:r,t:`q`};a&&(s.o=!0);let c=async e=>n(o(e));if(i){await c(s);return}if(x)try{await x}finally{x=void 0}let{promise:l,resolve:f,reject:h}=d(),g=m();s.i=g;let _;async function C(n=s){return u>=0&&(_=y(()=>{try{if(t.onTimeoutError?.call(S,e,r)!==!0)throw Error(`[birpc] timeout on calling "${e}"`)}catch(e){h(e)}b.delete(g)},u),typeof _==`object`&&(_=_.unref?.())),b.set(g,{resolve:f,reject:h,timeoutId:_,method:e}),await c(n),l}try{t.onRequest?await t.onRequest.call(S,s,C,f):await C()}catch(e){if(t.onGeneralError?.call(S,e)!==!0)throw e;return}finally{v(_),b.delete(g)}return l}let w={$call:(e,...t)=>C(e,t,!1),$callOptional:(e,...t)=>C(e,t,!1,!0),$callEvent:(e,...t)=>C(e,t,!0),$callRaw:e=>C(e.method,e.args,e.event,e.optional),$rejectPendingCalls:ee,get $closed(){return p},get $meta(){return t.meta},$close:T,$functions:e};S=f?new Proxy({},{get(t,n){if(Object.hasOwn(w,n))return w[n];if(n===`then`&&!a.includes(`then`)&&!(`then`in e))return;let r=(...e)=>C(n,e,!0);if(a.includes(n))return r.asEvent=r,r;let i=(...e)=>C(n,e,!1);return i.asEvent=r,i}}):w;function T(e){p=!0,b.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),b.clear(),i(E)}function ee(e){let t=Array.from(b.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return b.clear(),t}async function E(r,...i){let a;try{a=s(r)}catch(e){if(t.onGeneralError?.call(S,e)!==!0)throw e;return}if(a.t===`q`){let{m:r,a:s,o:u}=a,d,f,p=await(c?c.call(S,r,e[r]):e[r]);if(u&&(p||=()=>void 0),!p)f=Error(`[birpc] function "${r}" not found`);else try{d=await p.apply(l===`rpc`?S:e,s)}catch(e){f=e}if(a.i){if(f&&t.onFunctionError&&t.onFunctionError.call(S,f,r,s)===!0)return;if(!f)try{await n(o({t:`s`,i:a.i,r:d}),...i);return}catch(e){if(f=e,t.onGeneralError?.call(S,e,r,s)!==!0)throw e}try{await n(o({t:`s`,i:a.i,e:f}),...i)}catch(e){if(t.onGeneralError?.call(S,e,r,s)!==!0)throw e}}}else{let{i:e,r:t,e:n}=a,r=b.get(e);r&&(v(r.timeoutId),n?r.reject(n):r.resolve(t)),b.delete(e)}}return x=r(E),S}function x(e,t){return t.safety?t.safety:e===`static`||e===`query`||e==null?`read`:`action`}var S=Object.freeze({type:`object`,additionalProperties:!0});function C(e){let t=e[`~standard`];if(t.jsonSchema)try{return t.jsonSchema.input({target:`draft-2020-12`})}catch{return S}return S}function w(e){if(!e||e.length===0)return{type:`object`,properties:{}};let t={},n=[];for(let r=0;r<e.length;r++){let i=`arg${r}`;t[i]=C(e[r]),n.push(i)}return{type:`object`,properties:t,required:n,additionalProperties:!1}}function T(e,t){if(Array.isArray(e))return e;if(e==null)return[];if(typeof e!=`object`)return;let n=e;if(t!=null)return Array.from({length:t},(e,t)=>n[`arg${t}`]);if(`arg0`in n){let e=[];for(;`arg${e.length}`in n;)e.push(n[`arg${e.length}`]);return e}return Object.keys(n).length===0?[]:void 0}function ee(e,t){return T(e,t)??[e]}function E(e){return typeof e==`string`?`'${e}'`:new te().serialize(e)}var D=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,O=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[D.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function k(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&O[n]?O[n]:n+128,s=a<128&&O[a]?O[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var te=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?k(e,t):n===`number`&&r===`number`?e-t:k(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(k),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e})(),ne=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],A=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],re=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`,j=[],ie=class{_data=new ae;_hash=new ae([...ne]);_nDataBytes=0;_minBufferSize=0;finalize(e){e&&this._append(e);let t=this._nDataBytes*8,n=this._data.sigBytes*8;return this._data.words[n>>>5]|=128<<24-n%32,this._data.words[(n+64>>>9<<4)+14]=Math.floor(t/4294967296),this._data.words[(n+64>>>9<<4)+15]=t,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,t){let n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7];for(let n=0;n<64;n++){if(n<16)j[n]=e[t+n]|0;else{let e=j[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=j[n-2],i=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;j[n]=t+j[n-7]+i+j[n-16]}let d=s&c^~s&l,f=r&i^r&a^i&a,p=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),m=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),h=u+m+d+A[n]+j[n],g=p+f;u=l,l=c,c=s,s=o+h|0,o=a,a=i,i=r,r=h+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+u|0}_append(e){typeof e==`string`&&(e=ae.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let t,n=this._data.sigBytes/64;n=e?Math.ceil(n):Math.max((n|0)-this._minBufferSize,0);let r=n*16,i=Math.min(r*4,this._data.sigBytes);if(r){for(let e=0;e<r;e+=16)this._doProcessBlock(this._data.words,e);t=this._data.words.splice(0,r),this._data.sigBytes-=i}return new ae(t,i)}},ae=class e{words;sigBytes;constructor(e,t){e=this.words=e||[],this.sigBytes=t===void 0?e.length*4:t}static fromUtf8(t){let n=unescape(encodeURIComponent(t)),r=n.length,i=[];for(let e=0;e<r;e++)i[e>>>2]|=(n.charCodeAt(e)&255)<<24-e%4*8;return new e(i,r)}toBase64(){let e=[];for(let t=0;t<this.sigBytes;t+=3){let n=this.words[t>>>2]>>>24-t%4*8&255,r=this.words[t+1>>>2]>>>24-(t+1)%4*8&255,i=this.words[t+2>>>2]>>>24-(t+2)%4*8&255,a=n<<16|r<<8|i;for(let n=0;n<4&&t*8+n*6<this.sigBytes*8;n++)e.push(re.charAt(a>>>6*(3-n)&63))}return e.join(``)}concat(e){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let n=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=n<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];this.sigBytes+=e.sigBytes}};function oe(e){return new ie().finalize(e).toBase64()}function se(e){return oe(E(e))}function ce(e){return se(e)}function le(){let e={};function t(t,...n){let r=e[t]||[];for(let e=0,t=r.length;e<t;e++){let t=r[e];t&&t(...n)}}function n(n,...r){t(n,...r),delete e[n]}function r(t,n){return(e[t]||=[]).push(n),()=>{e[t]=e[t]?.filter(e=>n!==e)}}function i(e,t){let n=r(e,((...e)=>(n(),t(...e))));return n}return{_listeners:e,emit:t,emitOnce:n,on:r,once:i}}var ue=/^[\w+.-]{2,}:\/\//;function de(e){return e.endsWith(`/`)?e:`${e}/`}function fe(e){return(e.endsWith(`/`)?e.slice(0,-1):e)||`/`}function pe(e,...t){let n=e;for(let e of t)e&&e!==`/`&&(n=n?de(n)+e.replace(/^\.?\//,``):e);return n}function me(e,t){if(!t||t===`/`||ue.test(e))return e;let n=fe(t);return e.startsWith(n)?e:pe(n,e)}function he(e,t){let n=e.match(ue);return t+(n?e.slice(n[0].length):e)}var ge=Symbol.for(`immer-nothing`),_e=Symbol.for(`immer-draftable`),M=Symbol.for(`immer-state`),ve=[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},`This object has been frozen and should not be mutated`,function(e){return`Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? `+e},`An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.`,`Immer forbids circular references`,"The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},`Object.defineProperty() cannot be used on an Immer draft`,`Object.setPrototypeOf() cannot be used on an Immer draft`,`Immer only supports deleting array indices`,`Immer only supports setting array indices and the 'length' property`,function(e){return`'original' expects a draft, got: ${e}`}];function N(e,...t){{let n=ve[e],r=G(n)?n.apply(null,t):n;throw Error(`[Immer] ${r}`)}}var P=Object,F=P.getPrototypeOf,I=`constructor`,L=`prototype`,ye=`configurable`,be=`enumerable`,xe=`writable`,R=`value`,z=e=>!!e&&!!e[M];function B(e){return e?we(e)||Oe(e)||!!e[_e]||!!e[I]?.[_e]||ke(e)||Ae(e):!1}var Se=P[L][I].toString(),Ce=new WeakMap;function we(e){if(!e||!W(e))return!1;let t=F(e);if(t===null||t===P[L])return!0;let n=P.hasOwnProperty.call(t,I)&&t[I];if(n===Object)return!0;if(!G(n))return!1;let r=Ce.get(n);return r===void 0&&(r=Function.toString.call(n),Ce.set(n,r)),r===Se}function Te(e,t,n=!0){V(e)===0?(n?Reflect.ownKeys(e):P.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function V(e){let t=e[M];return t?t.type_:Oe(e)?1:ke(e)?2:Ae(e)?3:0}var H=(e,t,n=V(e))=>n===2?e.has(t):P[L].hasOwnProperty.call(e,t),U=(e,t,n=V(e))=>n===2?e.get(t):e[t],Ee=(e,t,n,r=V(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function De(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}var Oe=Array.isArray,ke=e=>e instanceof Map,Ae=e=>e instanceof Set,W=e=>typeof e==`object`,G=e=>typeof e==`function`,je=e=>typeof e==`boolean`;function Me(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Ne=e=>W(e)?e?.[M]:null,K=e=>e.copy_||e.base_,Pe=e=>e.modified_?e.copy_:e.base_;function Fe(e,t){if(ke(e))return new Map(e);if(Ae(e))return new Set(e);if(Oe(e))return Array[L].slice.call(e);let n=we(e);if(t===!0||t===`class_only`&&!n){let t=P.getOwnPropertyDescriptors(e);delete t[M];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],a=t[i];a[xe]===!1&&(a[xe]=!0,a[ye]=!0),(a.get||a.set)&&(t[i]={[ye]:!0,[xe]:!0,[be]:a[be],[R]:e[i]})}return P.create(F(e),t)}{let t=F(e);if(t!==null&&n)return{...e};let r=P.create(t);return P.assign(r,e)}}function Ie(e,t=!1){return ze(e)||z(e)||!B(e)||(V(e)>1&&P.defineProperties(e,{set:Re,add:Re,clear:Re,delete:Re}),P.freeze(e),t&&Te(e,(e,t)=>{Ie(t,!0)},!1)),e}function Le(){N(2)}var Re={[R]:Le};function ze(e){return e===null||!W(e)||P.isFrozen(e)}var Be=`MapSet`,Ve=`Patches`,He=`ArrayMethods`,Ue={};function q(e){let t=Ue[e];return t||N(0,e),t}var We=e=>!!Ue[e];function Ge(e,t){Ue[e]||(Ue[e]=t)}var Ke,qe=()=>Ke,Je=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:We(Be)?q(Be):void 0,arrayMethodsPlugin_:We(He)?q(He):void 0});function Ye(e,t){t&&(e.patchPlugin_=q(Ve),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Xe(e){Ze(e),e.drafts_.forEach($e),e.drafts_=null}function Ze(e){e===Ke&&(Ke=e.parent_)}var Qe=e=>Ke=Je(Ke,e);function $e(e){let t=e[M];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function et(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[M].modified_&&(Xe(t),N(4)),B(e)&&(e=tt(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[M].base_,e,t)}else e=tt(t,n);return nt(t,e,!0),Xe(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e===ge?void 0:e}function tt(e,t){if(ze(t))return t;let n=t[M];if(!n)return ut(t,e.handledSet_,e);if(!it(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);ct(n,e)}return n.copy_}function nt(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ie(t,n)}function rt(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var it=(e,t)=>e.scope_===t,at=[];function ot(e,t,n,r){let i=K(e),a=e.type_;if(r!==void 0&&U(i,r,a)===t){Ee(i,r,n,a);return}if(!e.draftLocations_){let t=e.draftLocations_=new Map;Te(i,(e,n)=>{if(z(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}let o=e.draftLocations_.get(t)??at;for(let e of o)Ee(i,e,n,a)}function st(e,t,n){e.callbacks_.push(function(r){let i=t;if(!i||!it(i,r))return;r.mapSetPlugin_?.fixSetContents(i);let a=Pe(i);ot(e,i.draft_??i,a,n),ct(i,r)})}function ct(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}rt(e)}}function lt(e,t,n){let{scope_:r}=e;if(z(n)){let i=n[M];it(i,r)&&i.callbacks_.push(function(){yt(e),ot(e,n,Pe(i),t)})}else B(n)&&e.callbacks_.push(function(){let i=K(e);e.type_===3?i.has(n)&&ut(n,r.handledSet_,r):U(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&ut(U(e.copy_,t,e.type_),r.handledSet_,r)})}function ut(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||z(e)||t.has(e)||!B(e)||ze(e)||(t.add(e),Te(e,(r,i)=>{if(z(i)){let t=i[M];it(t,n)&&(Ee(e,r,Pe(t),e.type_),rt(t))}else B(i)&&ut(i,t,n)})),e}function dt(e,t){let n=Oe(e),r={type_:+!!n,scope_:t?t.scope_:qe(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,a=ft;n&&(i=[r],a=pt);let{revoke:o,proxy:s}=Proxy.revocable(i,a);return r.draft_=s,r.revoke_=o,[s,r]}var ft={get(e,t){if(t===M)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t==`string`;if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let i=K(e);if(!H(i,t,e.type_))return gt(e,i,t);let a=i[t];if(e.finalized_||!B(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Me(t))return a;if(a===mt(e.base_,t)||ht(e,t,a)){yt(e);let n=e.type_===1?+t:t,r=xt(e.scope_,a,e,n);return e.copy_[n]=r}return a},has(e,t){return t in K(e)},ownKeys(e){return Reflect.ownKeys(K(e))},set(e,t,n){let r=_t(K(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=mt(K(e),t),i=r?.[M];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.delete(t),!0;if(De(n,r)&&(n!==void 0||H(e.base_,t,e.type_)))return!0;yt(e),vt(e)}return e.copy_[t]===n&&(n!==void 0||H(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),lt(e,t,n)),!0},deleteProperty(e,t){return yt(e),mt(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),vt(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=K(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[xe]:!0,[ye]:e.type_!==1||t!==`length`,[be]:r[be],[R]:n[t]}},defineProperty(){N(11)},getPrototypeOf(e){return F(e.base_)},setPrototypeOf(){N(12)}},pt={};for(let e in ft){let t=ft[e];pt[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}pt.deleteProperty=function(e,t){return isNaN(parseInt(t))&&N(13),pt.set.call(this,e,t,void 0)},pt.set=function(e,t,n){return t!==`length`&&isNaN(parseInt(t))&&N(14),ft.set.call(this,e[0],t,n,e[0])};function mt(e,t){let n=e[M];return(n?K(n):e)[t]}function ht(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!B(n)||n[M]?!1:e.baseRefs_.has(n)}function gt(e,t,n){let r=_t(t,n);return r?R in r?r[R]:r.get?.call(e.draft_):void 0}function _t(e,t){if(!(t in e))return;let n=F(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=F(n)}}function vt(e){e.modified_||(e.modified_=!0,e.parent_&&vt(e.parent_))}function yt(e){e.copy_||=(e.assigned_=new Map,Fe(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var bt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{if(G(e)&&!G(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}G(t)||N(6),n!==void 0&&!G(n)&&N(7);let r;if(B(e)){let i=Qe(this),a=xt(i,e,void 0),o=!0;try{r=t(a),o=!1}finally{o?Xe(i):Ze(i)}return Ye(i,n),et(r,i)}if(!e||!W(e)){if(r=t(e),r===void 0&&(r=e),r===ge&&(r=void 0),this.autoFreeze_&&Ie(r,!0),n){let t=[],i=[];q(Ve).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}N(1,e)},this.produceWithPatches=(e,t)=>{if(G(e))return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},je(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),je(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),je(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){B(e)||N(8),z(e)&&(e=St(e));let t=Qe(this),n=xt(t,e,void 0);return n[M].isManual_=!0,Ze(t),n}finishDraft(e,t){let n=e&&e[M];(!n||!n.isManual_)&&N(9);let{scope_:r}=n;return Ye(r,t),et(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=q(Ve).applyPatches_;return z(e)?r(e,t):this.produce(e,e=>r(e,t))}};function xt(e,t,n,r){let[i,a]=ke(t)?q(Be).proxyMap_(t,n):Ae(t)?q(Be).proxySet_(t,n):dt(t,n);return(n?.scope_??qe()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?st(n,a,r):a.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(a);let{patchPlugin_:t}=e;a.modified_&&t&&t.generatePatches_(a,[],e)}),i}function St(e){return z(e)||N(10,e),Ct(e)}function Ct(e){if(!B(e)||ze(e))return e;let t=e[M],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Fe(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Fe(e,!0);return Te(n,(e,t)=>{Ee(n,e,Ct(t))},r),t&&(t.finalized_=!1),n}function wt(){ve.push(`Sets cannot have "replace" patches.`,function(e){return`Unsupported patch operation: `+e},function(e){return`Cannot apply patch, path doesn't resolve: `+e},`Patching reserved attributes like __proto__, prototype and constructor is not allowed`);function e(n,r=[]){if(n.key_!==void 0){let e=n.parent_.copy_??n.parent_.base_,t=Ne(U(e,n.key_)),i=U(e,n.key_);if(i===void 0||i!==n.draft_&&i!==n.base_&&i!==n.copy_||t!=null&&t.base_!==n.base_)return null;let a=n.parent_.type_===3,o;if(a){let e=n.parent_;o=Array.from(e.drafts_.keys()).indexOf(n.key_)}else o=n.key_;if(!(a&&e.size>o||H(e,o)))return null;r.push(o)}if(n.parent_)return e(n.parent_,r);r.reverse();try{t(n.copy_,r)}catch{return null}return r}function t(e,t){let n=e;for(let e=0;e<t.length-1;e++){let r=t[e];if(n=U(n,r),!W(n)||n===null)throw Error(`Cannot resolve path at '${t.join(`/`)}'`)}return n}let n=`replace`,r=`remove`;function i(e,t,n){if(e.scope_.processedForPatches_.has(e))return;e.scope_.processedForPatches_.add(e);let{patches_:r,inversePatches_:i}=n;switch(e.type_){case 0:case 2:return o(e,t,r,i);case 1:return a(e,t,r,i);case 3:return s(e,t,r,i)}}function a(e,t,i,a){let{base_:o,assigned_:s}=e,c=e.copy_;c.length<o.length&&([o,c]=[c,o],[i,a]=[a,i]);let l=e.allIndicesReassigned_===!0;for(let e=0;e<o.length;e++){let r=c[e],u=o[e];if((l||s?.get(e.toString()))&&r!==u){let o=r?.[M];if(o&&o.modified_)continue;let s=t.concat([e]);i.push({op:n,path:s,value:d(r)}),a.push({op:n,path:s,value:d(u)})}}for(let e=o.length;e<c.length;e++){let n=t.concat([e]);i.push({op:`add`,path:n,value:d(c[e])})}for(let e=c.length-1;o.length<=e;--e){let n=t.concat([e]);a.push({op:r,path:n})}}function o(e,t,i,a){let{base_:o,copy_:s,type_:c}=e;Te(e.assigned_,(e,l)=>{let u=U(o,e,c),f=U(s,e,c),p=l?H(o,e)?n:`add`:r;if(u===f&&p===n)return;let m=t.concat(e);i.push(p===r?{op:p,path:m}:{op:p,path:m,value:d(f)}),a.push(p===`add`?{op:r,path:m}:p===r?{op:`add`,path:m,value:d(u)}:{op:n,path:m,value:d(u)})})}function s(e,t,n,i){let{base_:a,copy_:o}=e,s=0;a.forEach(e=>{if(!o.has(e)){let a=t.concat([s]);n.push({op:r,path:a,value:e}),i.unshift({op:`add`,path:a,value:e})}s++}),s=0,o.forEach(e=>{if(!a.has(e)){let a=t.concat([s]);n.push({op:`add`,path:a,value:e}),i.unshift({op:r,path:a,value:e})}s++})}function c(e,t,r){let{patches_:i,inversePatches_:a}=r;i.push({op:n,path:[],value:t===ge?void 0:t}),a.push({op:n,path:[],value:e})}function l(e,t){return t.forEach(t=>{let{path:i,op:a}=t,o=e;for(let e=0;e<i.length-1;e++){let t=V(o),n=i[e];typeof n!=`string`&&typeof n!=`number`&&(n=``+n),(t===0||t===1)&&(n===`__proto__`||n===I)&&N(19),G(o)&&n===L&&N(19),o=U(o,n),(o===null||!W(o))&&N(18,i.join(`/`))}let s=V(o),c=u(t.value),l=i[i.length-1];switch(a){case n:switch(s){case 2:return o.set(l,c);case 3:N(16);default:return o[l]=c}case`add`:switch(s){case 1:return l===`-`?o.push(c):o.splice(l,0,c);case 2:return o.set(l,c);case 3:return o.add(c);default:return o[l]=c}case r:switch(s){case 1:return o.splice(l,1);case 2:return o.delete(l);case 3:return o.delete(t.value);default:return delete o[l]}default:N(17,a)}}),e}function u(e){if(!B(e))return e;if(Oe(e))return e.map(u);if(ke(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,u(t)]));if(Ae(e))return new Set(Array.from(e).map(u));let t=Object.create(F(e));for(let n in e)t[n]=u(e[n]);return H(e,_e)&&(t[_e]=e[_e]),t}function d(e){return z(e)?u(e):e}Ge(Ve,{applyPatches_:l,generatePatches_:i,generateReplacementPatches_:c,getPath:e})}globalThis.Iterator?.from;var Tt=new bt,Et=Tt.produce,Dt=Tt.produceWithPatches.bind(Tt),Ot=Tt.applyPatches.bind(Tt),kt=1e3;function At(e,t){if(e.add(t),e.size>kt){let t=e.values().next().value;t!==void 0&&e.delete(t)}}function jt(e){let{enablePatches:t=!1}=e;t&&wt();let n=le(),r=e.initialValue,a=new Set;return{on:n.on,value:()=>r,patch:(e,t=i())=>{a.has(t)||(wt(),r=Ot(r,e),At(a,t),n.emit(`updated`,r,void 0,t))},mutate:(e,o=i())=>{if(!a.has(o)){if(At(a,o),t){let[t,i]=Dt(r,e);if(t===r)return;r=t,n.emit(`updated`,r,i,o)}else{let t=Et(r,e);if(t===r)return;r=t,n.emit(`updated`,r,void 0,o)}}},syncIds:a}}var Mt=typeof self==`object`?self:globalThis,Nt=new Set([`Error`,`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`,`AggregateError`]),Pt=new Set([`Boolean`,`Number`,`String`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float16Array`,`Float32Array`,`Float64Array`,`BigInt64Array`,`BigUint64Array`]);function Ft(e,t){let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o,r=Nt.has(e)?Mt[e]:void 0;return n(new(r??Mt.Error)(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}if(typeof a==`string`&&Pt.has(a))return n(new Mt[a](o),i);throw TypeError(`unable to deserialize unsafe or unknown type: ${String(a)}`)};return r}function It(e){return Ft(new Map,e)(0)}var J=``,{toString:Lt}={},{keys:Rt}=Object;function zt(e){let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Lt.call(e).slice(8,-1);switch(n){case`Array`:return[1,J];case`Object`:return[2,J];case`Date`:return[3,J];case`RegExp`:return[4,J];case`Map`:return[5,J];case`Set`:return[6,J];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]}function Bt([e,t]){return e===0&&(t===`function`||t===`symbol`)}function Vt(e,t,n,r){let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=zt(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize ${s}`);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Rt(r))(e||!Bt(zt(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Bt(zt(n))||Bt(zt(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Bt(zt(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a}function Ht(e,t={}){let n=[];return Vt(!(t.json||t.lossy),!!t.json,new Map,n)(e),n}var{parse:Ut,stringify:Wt}=JSON,Gt={json:!0,lossy:!0};function Kt(e){return It(Ut(e))}function qt(e){return Wt(Ht(e,Gt))}function Jt(e){return It(e)}function Yt(e){return qt(e)}function Xt(e){return Kt(e)}var Zt=256,Qt=class extends Error{name=`StreamClosedError`};function $t(e={}){let t=e.id??i(),n=Math.max(0,e.replayWindow??0),r=le(),a=new AbortController,o=[],s=!1,c=0;function l(e){if(s)throw new Qt(`Cannot write to a closed stream "${t}"`);c+=1,n>0&&(o.push({seq:c,chunk:e}),o.length>n&&(o.length-n===1?o.shift():o.splice(0,o.length-n))),r.emit(`chunk`,c,e)}function u(e){if(s)return;s=!0;let t=tn(e);a.abort(e),r.emit(`end`,t)}function d(){s||(s=!0,a.signal.aborted||a.abort(`stream closed`),r.emit(`end`,void 0))}function f(e){s||a.signal.aborted||a.abort(e??`aborted`)}let p=new WritableStream({write(e){l(e)},close(){d()},abort(e){u(e)}});return{id:t,signal:a.signal,get closed(){return s},get lastSeq(){return c},write:l,error:u,close:d,abort:f,writable:p,events:r,buffer:o}}function en(e={}){let t=e.id??i(),n=Math.max(1,e.highWaterMark??Zt),r=[],a=0,o=!1,s=!1,c,l,u,d;function f(){if(l){if(r.length>0){let e=r.shift(),t=l;l=void 0,t.resolve({value:e,done:!1})}else if(o){let e=l;if(l=void 0,c){let t=Error(c.message);t.name=c.name,e.reject(t)}else e.resolve({value:void 0,done:!0})}}}function p(){if(u){for(;r.length>0;){let e=r.shift();try{u.enqueue(e)}catch{break}}if(o&&u){try{if(c){let e=Error(c.message);e.name=c.name,u.error(e)}else u.close()}catch{}u=void 0}}}function m(t,i){if(!(o||s)&&!(t<=a)){if(a=t,r.push(i),r.length>n){let t=r.length-n;r.splice(0,t),e.onOverflow?.(t)}f(),d&&p()}}function h(e){o||(o=!0,c=e,f(),d&&p())}function g(){s||o||(s=!0,e.onCancel?.(),h(void 0))}function _(){return d||(d=new ReadableStream({start(e){u=e,p()},cancel(){g()}}),d)}return{id:t,get cancelled(){return s},get done(){return o},get lastSeenSeq(){return a},get readable(){return _()},cancel:g,_push:m,_end:h,[Symbol.asyncIterator](){return{next(){if(r.length>0)return Promise.resolve({value:r.shift(),done:!1});if(o){if(c){let e=Error(c.message);return e.name=c.name,Promise.reject(e)}return Promise.resolve({value:void 0,done:!0})}return new Promise((e,t)=>{l={resolve:e,reject:t}})},return(){return g(),Promise.resolve({value:void 0,done:!0})}}}}}function tn(e){if(e instanceof Error)return{name:e.name||`Error`,message:e.message};if(typeof e==`string`)return{name:`Error`,message:e};try{return{name:`Error`,message:JSON.stringify(e)}}catch{return{name:`Error`,message:String(e)}}}var nn=128;function rn(e){return e.replace(/[^\w-]+/g,`_`).slice(0,nn)}var an=`__connection.json`,on=`__DEVFRAME_CONNECTION__`,sn=`x-birpc-session`,cn=`__rpc-dump/index.json`,ln=`devframe:services`,un=`devframe_otp`,dn=`devframe_auth_token`;s.postMessage.remoteAssetsError;var fn=class{cacheMap=new Map;options;keySerializer;constructor(e){this.options=e,this.keySerializer=e.keySerializer||(e=>ce(e))}updateOptions(e){this.options={...this.options,...e}}cached(e,t){let n=this.cacheMap.get(e);if(n)return n.get(this.keySerializer(t))}has(e,t){return this.cacheMap.get(e)?.has(this.keySerializer(t))??!1}apply(e,t){let n=this.cacheMap.get(e.m)||new Map;n.set(this.keySerializer(e.a),t),this.cacheMap.set(e.m,n)}validate(e){return this.options.functions.includes(e)}clear(e){e?this.cacheMap.delete(e):this.cacheMap.clear()}},Y=u({docsBase:`https://devfra.me/errors`,codes:{DF0019:{why:e=>`RPC function "${e.name}" has \`agent\` set but \`jsonSerializable\` is \`false\`; MCP requires JSON-serializable data.`,fix:"Remove `jsonSerializable: false`, or remove `agent` to keep it RPC-only."},DF0020:{why:e=>`RPC function "${e.name}" declares \`jsonSerializable: true\` but the value at "${e.path}" is a ${e.type}.`,fix:"Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."},DF0021:{why:e=>`RPC function "${e.name}" is already registered`,fix:"Use the `force` parameter to overwrite an existing registration."},DF0022:{why:e=>`RPC function "${e.name}" is not registered. Use register() to add new functions.`},DF0023:{why:e=>`RPC function "${e.name}" is not registered`},DF0024:{why:e=>`Either handler or setup function must be provided for RPC function "${e.name}"`},DF0025:{why:e=>`Function "${e.name}" not found in dump store`},DF0026:{why:e=>`No dump match for "${e.name}" with args: ${e.args}`},DF0027:{why:e=>`Function "${e.name}" with type "${e.type}" cannot have dump configuration. Only "static" and "query" types support dumps.`},DF0028:{why:e=>`Function "${e.name}" with type "${e.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,fix:"Remove `snapshot: true`, or change the function type to `query`."},DF0043:{why:e=>`RPC function "${e.name}" received an invalid argument at position ${e.index}: ${e.issues}`,fix:"Pass a value that satisfies the `args` schema declared for this function."},DF0044:{why:e=>`RPC function "${e.name}" returned a value that failed its \`returns\` schema: ${e.issues}`,fix:"Make the handler return a value that satisfies the `returns` schema, or relax the schema."}}});function pn(e){if(e.agent&&e.jsonSerializable===!1)throw Y.DF0019({name:e.name});e.agent&&!e.jsonSerializable&&(e.jsonSerializable=!0)}async function mn(e,t){let n=e[`~standard`].validate(t);return n instanceof Promise?await n:n}function hn(e){return e.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `)}async function gn(e,t,n){let r=n.slice();if(!t||t.length===0)return r;for(let r=0;r<t.length;r++){let i=t[r];if(!i)continue;let a=await mn(i,n[r]);if(a.issues)throw Y.DF0043({name:e,index:r,issues:hn(a.issues)})}return r}async function _n(e,t,n){if(!t)return n;let r=await mn(t,n);if(r.issues)throw Y.DF0044({name:e,issues:hn(r.issues)});return n}async function vn(e,t){if(!e.setup)return{};if(typeof t==`object`&&t){e.__cache??=new WeakMap;let n=e.__cache,r=n.get(t);return r||(r=Promise.resolve(e.setup(t)),r.catch(()=>{n.get(t)===r&&n.delete(t)}),n.set(t,r)),await r}if(!e.__promise){let n=Promise.resolve(e.setup(t));n.catch(()=>{e.__promise===n&&(e.__promise=void 0)}),e.__promise=n}return await e.__promise}async function yn(e,t){let n=e.handler;if(!n){let r=await vn(e,t);if(!r.handler)throw Y.DF0024({name:e.name});n=r.handler}let r=e.args,i=e.returns;if(!r&&!i)return n;let a=n;return async(...t)=>{let n=await gn(e.name,r,t),o=await a(...n);return await _n(e.name,i,o)}}var bn=class{context;definitions=new Map;functions;_onChanged=[];constructor(e){this.context=e;let t=this.definitions,n=this;this.functions=new Proxy({},{get(e,r){let i=t.get(r);if(i)return yn(i,n.context)},has(e,n){return t.has(n)},getOwnPropertyDescriptor(e,n){return{value:t.get(n)?.handler,configurable:!0,enumerable:!0}},ownKeys(){return Array.from(t.keys())}})}register(e,t=!1){if(this.definitions.has(e.name)&&!t)throw Y.DF0021({name:e.name});pn(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}update(e,t=!1){if(!this.definitions.has(e.name)&&!t)throw Y.DF0022({name:e.name});pn(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}onChanged(e){return this._onChanged.push(e),()=>{let t=this._onChanged.indexOf(e);t!==-1&&this._onChanged.splice(t,1)}}async getHandler(e){return await yn(this.definitions.get(e),this.context)}getSchema(e){let t=this.definitions.get(e);if(!t)throw Y.DF0023({name:String(e)});return{args:t.args,returns:t.returns}}has(e){return this.definitions.has(e)}get(e){return this.definitions.get(e)}list(){return Array.from(this.definitions.keys())}};function xn(e,t=``){return JSON.stringify(e,function(e,n){let r=this,i=r==null?n:r[e];if(i===void 0){if(Array.isArray(r))throw X(t,`undefined`,r,e);return n}return i!==null&&Sn(i,r,e,t),n})}function Sn(e,t,n,r){if(typeof e==`bigint`)throw X(r,`BigInt`,t,n);if(typeof e!=`object`)return;if(e instanceof Map)throw X(r,`Map`,t,n);if(e instanceof Set)throw X(r,`Set`,t,n);if(e instanceof Date)throw X(r,`Date`,t,n);if(Array.isArray(e))return;let i=Object.getPrototypeOf(e);if(i!==null&&i!==Object.prototype)throw X(r,e.constructor?.name??`class instance`,t,n)}function X(e,t,n,r){let i=Cn(n,r);return Y.DF0020({name:e||`<anonymous>`,type:t,path:i})}function Cn(e,t){return Array.isArray(e)?`[${t}]`:t===``?`<root>`:t}var wn=`__DEVFRAME_CONNECTION_META__`,Tn=`__DEVFRAME_CONNECTION_AUTH_TOKEN__`;function En(e){let t=[()=>window?.[e],()=>globalThis?.[e],()=>parent.window?.[e]];for(let e of t)try{let t=e();if(t)return t}catch{}}function Dn(){return En(on)}function On(){return En(wn)}function Z(e){if(e)return e;try{let e=localStorage.getItem(Tn);if(e)return e}catch{}return En(Tn)}function kn(e){globalThis[on]=e,globalThis[wn]={...e.connectionMeta,baseUrl:e.metaBaseUrl},e.authToken&&An(e.authToken)}function An(e){try{localStorage.setItem(Tn,e)}catch{}globalThis[Tn]=e;let t=Dn();t&&(globalThis[on]={...t,authToken:e})}function jn(e){let t=me(an,e);try{return new URL(t,globalThis.location?.href).href}catch{return t}}function Mn(e,t){return t&&t!==e.authToken?{...e,authToken:t}:e}function Nn(){let e=Dn();if(e)return Mn(e,Z()??e.authToken??e.connectionMeta.authToken);let t=On();if(t)return{connectionMeta:t,metaBaseUrl:t.baseUrl??jn(`./`),authToken:Z(t.authToken)}}async function Pn(e={}){if(e.connection){let t=Mn(e.connection,Z(e.authToken??e.connection.authToken??e.connection.connectionMeta.authToken));return kn(t),t}let t=Array.isArray(e.baseURL)?e.baseURL:[e.baseURL??`./`];if(e.connectionMeta){let n={connectionMeta:e.connectionMeta,metaBaseUrl:jn(t[0]??`./`),authToken:Z(e.authToken??e.connectionMeta.authToken)};return kn(n),n}let n=Nn();if(n){let t=Mn(n,Z(e.authToken??n.authToken??n.connectionMeta.authToken));return kn(t),t}let r=[];for(let n of t){let t=me(an,n),i=jn(n);try{let n=await fetch(t);if(!n.ok)throw Error(`Failed to fetch connection meta from ${i}: ${n.status}`);let r=await n.json(),a=n.url||i,o={connectionMeta:r,metaBaseUrl:r.baseUrl?new URL(r.baseUrl,a).href:a,authToken:Z(e.authToken??r.authToken)};return kn(o),o}catch(e){r.push(e)}}throw Error(`Failed to get connection meta from ${t.join(`, `)}`,{cause:r})}var Q=class extends Error{name=`DevframeConnectionError`;kind;constructor(e,t,n){super(t,n),this.kind=e}};function Fn(e=un){try{let t=globalThis.location?.hash?.replace(/^#/,``)??``;return new URLSearchParams(t).get(e)||void 0}catch{return}}function In(e){try{let t=new URL(globalThis.location.href),n=new URLSearchParams(t.hash.replace(/^#/,``));if(!n.has(e))return;n.delete(e),t.hash=n.toString(),globalThis.history?.replaceState(globalThis.history.state,``,t.href)}catch{}}function Ln(e=un){let t=Fn(e);return t&&In(e),t}async function Rn(e,t={}){let n=Ln(t.param??`devframe_otp`);return n?e.isTrusted?!0:e.requestTrustWithCode(n):!1}function zn(e){let t={},n=new WeakMap,r,i=()=>(r??=e.sharedState.get(ln,{initialValue:{}}).then(e=>(t=e.value(),e.on(`updated`,e=>{t=e}),e)),r);return i(),{state:i,has:e=>e in t,keys:()=>Object.keys(t),get:r=>{let i=t[r];if(!i)return;let a=n.get(i);return a||(a={...i,rpc:e.scope(i.scope).rpc},n.set(i,a)),a}}}function Bn(e){let t=new Map,n=new Map,r=new Map,i=new Set,a=e.connectionMeta.backend===`static`;function o(e,t){let n=r.get(e);return n&&typeof n==`object`&&!Array.isArray(n)&&typeof t==`object`&&!Array.isArray(t)?{...n,...t}:t}e.client.register({name:s.broadcast.clientStateUpdated,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.mutate(()=>o(e,n),r)}}),e.client.register({name:s.broadcast.clientStatePatch,type:`event`,handler:(e,n,r)=>{let i=t.get(e);i&&!i.syncIds.has(r)&&i.patch(n,r)}});function c(t,n){let r=[];return r.push(n.on(`updated`,(n,r,i)=>{a||(r?e.callEvent(`devframe:rpc:server-state:patch`,t,r,i):e.callEvent(`devframe:rpc:server-state:set`,t,n,i))})),()=>{for(let e of r)e()}}return{keys:()=>Array.from(t.keys()),onKeyAdded(e){return i.add(e),()=>{i.delete(e)}},delete(e){let i=n.get(e);n.delete(e);let a=t.delete(e);return r.delete(e),i?.(),a},get:async(l,u)=>{if(u?.initialValue!==void 0&&r.set(l,u.initialValue),t.has(l))return t.get(l);let d=jt({initialValue:u?.initialValue,enablePatches:!1});async function f(){if(a||e.callEvent(`devframe:rpc:server-state:subscribe`,l),u?.initialValue!==void 0){t.set(l,d);for(let e of i)e(l);return e.call(`devframe:rpc:server-state:get`,l).then(e=>{e!==void 0&&d.mutate(()=>o(l,e))}).catch(e=>{console.error(`Error getting server state`,e)}),n.set(l,c(l,d)),d}{let r=await e.call(`devframe:rpc:server-state:get`,l);d.mutate(()=>o(l,r)),t.set(l,d);for(let e of i)e(l);return n.set(l,c(l,d)),d}}return new Promise((t,n)=>{if(e.isTrusted)f().then(t,n);else{t(d);let n=!1;e.events.on(s.client.isTrustedUpdated,e=>{e&&!n&&(n=!0,f())})}})}}}var Vn=new Map;function Hn(e=Vn){let t=new Map;return{serialize:n=>{let r;return n.t===`q`?r=n.m:(r=t.get(n.i),t.delete(n.i)),!(n.t===`s`&&`e`in n)&&r&&e.get(r)?.jsonSerializable===!0?xn(n,r??``):`s:${Yt(n)}`},deserialize:e=>{let n=e.startsWith(`s:`)?Xt(e.slice(2)):JSON.parse(e);return n.t===`q`&&n.i&&n.m&&t.set(n.i,n.m),n}}}function Un(){}function Wn(e){let t=e.search(/\n\n|\r\n\r\n/);if(!(t<0))return{frame:e.slice(0,t),rest:e.slice(t+(e[t]===`\r`?4:2))}}function Gn(e){let t=`message`,n=[];for(let r of e.split(/\r?\n/))r.startsWith(`:`)||(r.startsWith(`event:`)?t=r.slice(6).trimStart():r.startsWith(`data:`)&&n.push(r.slice(5).replace(/^ /,``)));return{event:t,data:n}}function Kn(e){let{onConnected:t=Un,onError:n=Un,onDisconnected:r=Un,definitions:i,fetch:a=globalThis.fetch.bind(globalThis)}=e,o=e.url;e.authToken&&(o=`${o}${o.includes(`?`)?`&`:`?`}${dn}=${encodeURIComponent(e.authToken)}`);let s=Hn(i),c=new AbortController,l=!1,u,d,f,p,m=new Promise((e,t)=>{f=e,p=t});m.catch(()=>{});function h(e){l||(l=!0,p(e),n(e),r())}function g(){l||(l=!0,p(Error(`Devframe SSE stream closed`)),r())}function _(e,n){e===`session`?(f(n),t()):u?.(n)}async function v(e){let t=e.getReader();d=t;let n=new TextDecoder,r=``;for(;;){let{done:e,value:i}=await t.read();if(e)break;for(r+=n.decode(i,{stream:!0});;){let e=Wn(r);if(!e)break;r=e.rest;let{event:t,data:n}=Gn(e.frame);n.length>0&&_(t,n.join(`
3
+ `))}}g()}return(async()=>{try{let e=await a(o,{headers:{accept:`text/event-stream`},signal:c.signal});if(!e.ok||!e.body)throw Error(`Devframe SSE stream request failed: ${e.status}`);await v(e.body)}catch(e){if(c.signal.aborted){g();return}h(e instanceof Error?e:Error(String(e)))}})(),{close:()=>{l=!0,c.abort(),d?.cancel().catch(()=>{})},on:e=>{u=e},post:async e=>{let t;try{t=await m}catch{return}if(l)n(Error(`Devframe SSE channel is closed; message dropped`));else try{let n=await a(o,{method:`POST`,headers:{"content-type":`text/plain; charset=utf-8`,[sn]:t},body:e});if(n.status===200){let e=await n.text();e&&u?.(e);return}if(!n.ok)throw Error(`Devframe SSE POST failed: ${n.status}`)}catch(e){n(e instanceof Error?e:Error(String(e)))}},serialize:s.serialize,deserialize:s.deserialize}}function qn(e,t){let{channel:n,rpcOptions:r={}}=t;return b(e,{...n,timeout:-1,...r,proxify:!1})}function Jn(e){let{transport:t,authToken:n,connectionMeta:r,events:i,clientRpc:a,rpcOptions:o={},callTimeout:c=0}=e,l=!1,u=`connecting`,d=null,f=Promise.withResolvers();function p(e,t=null){if(t?d=t:e===`connected`&&(d=null),e===u)return;let n=u;u=e,i.emit(s.client.connectionStatus,e,n)}let m=new Set;function h(e){for(let t of[...m])t.reject(e)}function g(){return u===`disconnected`||u===`error`?new Q(`connection`,`[devframe] Not connected to the devframe server`,{cause:d??void 0}):u===`unauthorized`?new Q(`auth`,`[devframe] Not authorized by the devframe server`,{cause:d??void 0}):null}function _(e,t){return new Promise((n,r)=>{let a=!1,o,l={reject(e){a||(u(),i.emit(s.client.error,e,t),r(e))}};function u(){a=!0,m.delete(l),o&&clearTimeout(o)}m.add(l),c>0&&(o=setTimeout(()=>{l.reject(new Q(`timeout`,`[devframe] RPC call "${t}" timed out after ${c}ms`))},c)),e.then(e=>{a||(u(),n(e))},e=>{if(a)return;u();let n=e instanceof Error?e:Error(String(e));i.emit(s.client.error,n,t),r(n)})})}let v=new Map;for(let e of r.jsonSerializableMethods??[])v.set(e,{jsonSerializable:!0});let y=e.createChannel({definitions:v,onError(e){p(`error`,e),i.emit(s.client.connectionError,e),h(new Q(`connection`,`[devframe] Connection to the devframe server failed`,{cause:e}))},onDisconnected(){u!==`error`&&p(`disconnected`),h(new Q(`connection`,`[devframe] Disconnected from the devframe server`,{cause:d??void 0}))}}),b=qn(a.functions,{channel:y,rpcOptions:o});a.register({name:s.broadcast.authRevoked,type:`event`,handler:()=>{l=!1;let e=new Q(`auth`,`[devframe] The devframe server revoked this client's trust`);p(`unauthorized`,e),i.emit(s.client.connectionError,e),h(e),i.emit(s.client.isTrustedUpdated,!1)}});let x=n;async function S(e){x=e;let t=await b.$call(`anonymous:devframe:auth`,{authToken:e,ua:navigator.userAgent,origin:location.origin});if(l=t.isTrusted,l)f.resolve(!0),p(`connected`);else{let e=new Q(`auth`,`[devframe] The devframe server refused this client's credentials`);p(`unauthorized`,e),i.emit(s.client.connectionError,e)}return i.emit(s.client.isTrustedUpdated,l),t.isTrusted}async function C(e){let t=(await b.$call(`anonymous:devframe:auth:exchange`,{code:e,ua:navigator.userAgent,origin:location.origin}))?.authToken??null;return t&&(x=t,l=!0,f.resolve(!0),p(`connected`),i.emit(s.client.isTrustedUpdated,!0)),t}async function w(e={}){await b.$call(`anonymous:devframe:auth:request-code`,{ua:navigator.userAgent,origin:location.origin,...e.reissue?{reissue:!0}:{}})}async function T(){return l?!0:S(x??``)}async function ee(e=6e4){if(l&&f.resolve(!0),e<=0)return f.promise;let t;try{return await Promise.race([f.promise,new Promise((n,r)=>{t=setTimeout(()=>{r(Error(`[devframe] Timeout waiting for rpc to be trusted`))},e)})]),l}finally{clearTimeout(t)}}return{transport:t,get isTrusted(){return l},get status(){return u},get connectionError(){return d},requestTrust:T,requestTrustWithToken:S,requestTrustWithCode:C,requestAuthCode:w,ensureTrusted:ee,call:(...e)=>{let t=String(e[0]),n=g();return n?(i.emit(s.client.error,n,t),Promise.reject(n)):_(b.$call(...e),t)},callEvent:(...e)=>{let t=g();if(t)i.emit(s.client.error,t,String(e[0]));else return b.$callEvent(...e)},callOptional:(...e)=>{let t=String(e[0]),n=g();return n?(i.emit(s.client.error,n,t),Promise.reject(n)):_(b.$callOptional(...e),t)},close:()=>{y.close()}}}function Yn(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})();if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`;return new URL(e.path??`/`,`${r.protocol}//${t}`).href}return new URL(e.path??``,r).href}let i=e??``;return/^https?:\/\//i.test(i)?i:new URL(i,r).href}function Xn(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},sseOptions:s={},callTimeout:c=0}=e,l=Yn(n.sse,r??`./`,location);return Jn({transport:`sse`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>Kn({url:l,authToken:t,definitions:e.definitions,...s,onConnected(){s.onConnected?.()},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(){e.onDisconnected(),s.onDisconnected?.()}})})}function Zn(e){let{name:t,message:n,cause:r,...i}=e,a=r instanceof Error?r:Qn(r)?Zn(r):r,o=a===void 0?Error(n):Error(n,{cause:a});return o.name=t,Object.assign(o,i),o}function Qn(e){return typeof e==`object`&&!!e&&typeof e.message==`string`&&typeof e.name==`string`}function $n(e){return typeof e==`object`&&!!e&&e.type===`static`&&typeof e.path==`string`}function er(e){return typeof e==`object`&&!!e&&e.type===`query`&&typeof e.records==`object`&&e.records!==null}function tr(e){return typeof e==`object`&&!!e&&(`output`in e||`error`in e)}function nr(e){if(e.error)throw Zn(e.error);return e.output}function rr(e){return e.some(e=>e!=null)}function ir(e){return typeof e==`object`&&e&&`serialization`in e&&`data`in e?e.data:e}function ar(e,t){let n=new Map,r=new Map;function i(e,t){return t===`structured-clone`&&Array.isArray(e)?Jt(e):e}function a(e,t){return i(ir(e),t)}async function o(e){n.has(e.path)||n.set(e.path,t(e.path).then(t=>a(t,e.serialization)));let r=await n.get(e.path);return tr(r)?nr(r):r}async function s(e,n){return r.has(e)||r.set(e,t(e).then(e=>a(e,n))),await r.get(e)}async function c(t,n){if(!(t in e))throw Error(`[devframe-rpc] Function "${t}" not found in dump store`);let r=e[t];if($n(r)){if(rr(n))throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await o(r)}if(er(r)){let e=ce(n),i=r.records[e];if(i)return nr(await s(i,r.serialization));if(r.fallback)return nr(await s(r.fallback,r.serialization));throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(!rr(n))return r;throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}return{call:async(e,t)=>await c(e,t),callOptional:async(t,n)=>{if(t in e)return await c(t,n)},callEvent:async(e,t)=>{}}}async function or(e){let t=ar(await e.fetchJsonFromBases(cn),e.fetchJsonFromBases);return{transport:`static`,isTrusted:!0,status:`connected`,connectionError:null,requestTrust:async()=>!0,requestTrustWithToken:async()=>!0,requestTrustWithCode:async()=>null,requestAuthCode:async()=>{},ensureTrusted:async()=>!0,call:(...e)=>t.call(e[0],e.slice(1)),callEvent:(...e)=>t.callEvent(e[0],e.slice(1)),callOptional:(...e)=>t.callOptional(e[0],e.slice(1)),close:()=>{}}}var sr=``;function cr(e,t){return`${e}${sr}${t}`}function lr(e){let t=new Map,n=new Map;e.client.register({name:s.broadcast.streamingChunk,type:`event`,handler(e,n,r,i){t.get(cr(e,n))?._push(r,i)}}),e.client.register({name:s.broadcast.streamingEnd,type:`event`,handler(e,n,r){let i=cr(e,n),a=t.get(i);a&&(a._end(r),t.delete(i))}}),e.client.register({name:s.broadcast.streamingUploadCancel,type:`event`,handler(e,t){let r=cr(e,t),i=n.get(r);i&&(i.abort(`server cancelled upload`),n.delete(r))}}),e.events.on(s.client.isTrustedUpdated,n=>{if(n)for(let[n,r]of t){if(r.cancelled||r.done)continue;let t=n.indexOf(sr);if(t<0)continue;let i=n.slice(0,t),a=n.slice(t+1);e.callEvent(`devframe:streaming:subscribe`,i,a,{afterSeq:r.lastSeenSeq})}});function r(n,r,i={}){let a=cr(n,r),o=t.get(a);if(o)return o;let c=en({id:r,highWaterMark:i.highWaterMark,onOverflow(e){console.warn(`[devframe] DF0029: Stream "${n}#${r}" dropped ${e} chunk(s) after exceeding the client high-water mark.`)},onCancel(){e.callEvent(`devframe:streaming:cancel`,n,r),t.delete(a)}});if(t.set(a,c),e.isTrusted)e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:0});else{let i=e.events.on(s.client.isTrustedUpdated,o=>{o&&(i(),t.has(a)&&!c.cancelled&&!c.done&&e.callEvent(`devframe:streaming:subscribe`,n,r,{afterSeq:c.lastSeenSeq}))})}return c}function i(t,r){let i=cr(t,r),a=n.get(i);if(a)return a;let o=$t({id:r});return o.events.on(`chunk`,(n,i)=>{e.callEvent(`devframe:streaming:upload-chunk`,t,r,n,i)}),o.events.on(`end`,a=>{e.callEvent(`devframe:streaming:upload-end`,t,r,a),n.delete(i)}),n.set(i,o),o}return{subscribe:r,upload:i}}function ur(){}var dr=new Map;function fr(e){let t=e.url;e.authToken&&(t=`${t}?${dn}=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=ur,onError:i=ur,onDisconnected:a=ur,definitions:o=dr}=e;n.addEventListener(`open`,e=>{r(e)}),n.addEventListener(`error`,e=>{let t=e instanceof Error?e:Error(e.type);i(t)}),n.addEventListener(`close`,e=>{a(e)});let s=Hn(o);return{close:()=>{n.close()},on:e=>{n.addEventListener(`message`,t=>{e(t.data)})},post:e=>{if(n.readyState===WebSocket.OPEN)n.send(e);else if(n.readyState===WebSocket.CONNECTING){let t=()=>{i(),n.readyState===WebSocket.OPEN&&n.send(e)},r=()=>i();function i(){n.removeEventListener(`open`,t),n.removeEventListener(`close`,r)}n.addEventListener(`open`,t),n.addEventListener(`close`,r)}else i(Error(`Devframe WebSocket is not open; message dropped`))},serialize:s.serialize,deserialize:s.deserialize}}function pr(e,t,n){let r=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})(),i=r.protocol===`https:`?`wss:`:`ws:`;if(e&&typeof e==`object`){if(e.host!=null||e.port!=null){let t=e.host??`${r.hostname}:${e.port}`,n=new URL(e.path??`/`,`${i}//${t}`);return n.protocol=i,n.href}let t=new URL(e.path??``,r);return t.protocol=i,t.href}if(typeof e==`number`)return`${i}//${r.hostname}:${e}`;let a=e??``;if(/^wss?:\/\//i.test(a))return a;if(/^https?:\/\//i.test(a))return he(a,/^https/i.test(a)?`wss://`:`ws://`);let o=new URL(a,r);return o.protocol=i,o.href}function mr(e){let{authToken:t,connectionMeta:n,metaBaseUrl:r,events:i,clientRpc:a,rpcOptions:o={},wsOptions:s={},callTimeout:c=0}=e,l=pr(n.websocket,r??`./`,location);return Jn({transport:`websocket`,authToken:t,connectionMeta:n,events:i,clientRpc:a,rpcOptions:o,callTimeout:c,createChannel:e=>fr({url:l,authToken:t,definitions:e.definitions,...s,onConnected(e){s.onConnected?.(e)},onError(t){e.onError(t),s.onError?.(t)},onDisconnected(t){e.onDisconnected(),s.onDisconnected?.(t)}})})}function hr(e){return e.includes(`:`)}function $(e,t){return hr(t)?t:`${e}:${t}`}function gr(e){return{async get(t){return(await e()).value()?.[t]},async set(t,n){(await e()).mutate(e=>{if(e===void 0)return{[t]:n};e[t]=n})},async delete(t){(await e()).mutate(e=>{e!==void 0&&delete e[t]})},async all(){return(await e()).value()??{}},async onChange(t){return(await e()).on(`updated`,e=>t(e??{}))}}}function _r(e,t,n){let r=`devframe:settings:${n}:${t}`,i;function a(){return i||=(async()=>(await e.ensureTrusted(),e.sharedState.get(r)))().catch(e=>{throw i=void 0,e}),i}return gr(a)}function vr(e,t){return{global:_r(e,t,`global`),project:_r(e,t,`project`)}}function yr(e,t){return{namespace:t,base:e,rpc:{namespace:t,register(n){if(hr(n.name))throw Error(`[devframe] Scoped client RPC registration for namespace "${t}" received an already-namespaced function name "${n.name}". Pass a bare name without a ":" separator.`);e.client.register({...n,name:`${t}:${n.name}`})},call:((n,...r)=>e.call($(t,n),...r)),callEvent:((n,...r)=>e.callEvent($(t,n),...r)),callOptional:((n,...r)=>e.callOptional($(t,n),...r)),sharedState:((n,r)=>e.sharedState.get($(t,n),r)),streaming:{subscribe:(n,r,i)=>e.streaming.subscribe($(t,n),r,i),upload:(n,r)=>e.streaming.upload($(t,n),r)}},settings:vr(e,t),scope:e.scope}}function br(){if(typeof document<`u`){let e=document.modelContext;if(e)return e}if(typeof navigator<`u`){let e=navigator.modelContext;if(e)return e}}function xr(e,t={}){let n=t.modelContext??br();if(!n)return()=>{};let r=n,i=new Map,a=new Map;function o(t,n){let o=rn(t.name),s=a.get(o);if(s&&s!==t.name){console.warn(`[devframe] WebMCP tool name "${o}" (from "${t.name}") collides with "${s}"; keeping the first registration.`);return}let c=new AbortController,l=x(t.type,n),u=r.registerTool({name:o,description:n.description,inputSchema:w(t.args),annotations:{title:n.title??t.name,readOnlyHint:l===`read`,destructiveHint:l===`destructive`},execute:n=>Sr(t,e.context,n)},{signal:c.signal});u&&`then`in u&&u.then(()=>{},()=>{}),a.set(o,t.name),i.set(t.name,()=>{c.abort(),u&&`unregister`in u&&typeof u.unregister==`function`&&u.unregister(),a.delete(o)})}function s(t){let n=t?[t]:[...e.definitions.keys()];for(let t of n){i.get(t)?.(),i.delete(t);let n=e.definitions.get(t),r=n?.agent;n&&r&&o(n,r)}}s();let c=e.onChanged(e=>s(e));return()=>{c();for(let e of i.values())e();i.clear()}}async function Sr(e,t,n){try{let r=ee(n,e.args?.length);return{content:[{type:`text`,text:Cr(await(await yn(e,t))(...r))}]}}catch(e){return{isError:!0,content:[{type:`text`,text:wr(e)}]}}}function Cr(e){return e===void 0?`undefined`:typeof e==`string`?e:JSON.stringify(e,null,2)}function wr(e){if(!(e instanceof Error))return String(e);let t=e.cause instanceof Error?` (cause: ${e.cause.message})`:``;return`${e.name}: ${e.message}${t}`}function Tr(e,t){if(t.backend===`static`)return`static`;let n=t.websocket!==void 0,r=t.sse!==void 0;if(e===`websocket`){if(!n)throw Error(`[devframe] transport: 'websocket' was requested, but this server does not advertise a WebSocket endpoint`);return`websocket`}if(e===`sse`){if(!r)throw Error(`[devframe] transport: 'sse' was requested, but this server does not advertise an SSE endpoint`);return`sse`}if(t.backend===`sse`&&r)return`sse`;if(n)return`websocket`;if(r)return`sse`;throw Error(`[devframe] This server advertises no RPC transport (backend "none"), so there is nothing to connect to. Enable the WebSocket or SSE endpoint on the server, or use its static/MCP surfaces instead.`)}async function Er(e={}){let{baseURL:n=`./`,rpcOptions:r={},cacheOptions:i=!1}=e,a=le(),o=Array.isArray(n)?n:[n],c=await Pn(e),{connectionMeta:l,metaBaseUrl:u,authToken:d}=c,f=o[0]??`./`;try{f=new URL(`.`,u).href}catch{}let p=new fn({functions:[],...typeof e.cacheOptions==`object`?e.cacheOptions:{}}),m={rpc:void 0},h=new bn(m),g=e.webmcp===!1?void 0:xr(h),_,v=!1,y=0,b;function x(){y++,b=void 0,p.clear(),i===!0&&p.updateOptions({functions:[]})}i&&(h.register({name:s.broadcast.cacheInvalidate,type:`event`,handler:x}),a.on(s.client.connectionStatus,x),a.on(s.client.isTrustedUpdated,x));async function S(e){let t=[f,...o.filter(e=>e!==f)].filter(e=>e!=null),n=[];for(let r of t)try{return await fetch(me(e,r)).then(t=>{if(!t.ok)throw Error(`Failed to fetch ${e} from ${r}: ${t.status}`);return t.json()})}catch(e){n.push(e)}throw Error(`Failed to load ${e} from ${t.join(`, `)}`,{cause:n})}let C=e.callTimeout??0,w=C>0?C:1/0,T,ee={authToken:d,connectionMeta:l,metaBaseUrl:u,events:a,clientRpc:h,callTimeout:e.callTimeout,rpcOptions:{...r,async onRequest(e,t,n){let a=performance.now()+w;if(await r.onRequest?.call(this,e,t,n),i===!0&&e.i&&T.isTrusted&&!e.m.startsWith(`anonymous:`)&&e.m!==`devframe:rpc:cacheable-functions`){function t(){if(performance.now()>=a)throw new Q(`timeout`,`[devframe] RPC call "${e.m}" timed out after ${C}ms`)}for(;!b&&(t(),!(v||T.status!==`connected`));){let e=y;b=T.callOptional(`devframe:rpc:cacheable-functions`).then(t=>{e===y&&p.updateOptions({functions:t??[]})}).catch(t=>{throw e===y&&(b=void 0),t}),await b}await b,t()}let o=y;if(i&&e.i&&!v&&T.isTrusted&&p.validate(e.m)){if(p.has(e.m,e.a))return n(p.cached(e.m,e.a));let r=await t(e);o===y&&!v&&p.apply(e,r)}else await t(e)}}},E=Tr(e.transport??`auto`,l);T=E===`static`?await or({fetchJsonFromBases:S}):E===`sse`?Xn({...ee,sseOptions:e.sseOptions}):mr({...ee,wsOptions:e.wsOptions});let D;try{D=new BroadcastChannel(`devframe-auth`)}catch{}let O,k=!1;function te(e){return((...t)=>k||!O?e(...t):O.then(()=>e(...t)))}function ne(){v=!0,x();try{_?.(),g?.()}finally{try{D?.close()}finally{T.close?.()}}}let A={events:a,get isTrusted(){return T.isTrusted},get status(){return T.status},get connectionError(){return T.connectionError},get transport(){return T.transport??E},get connection(){return c},connectionMeta:l,ensureTrusted:T.ensureTrusted,requestTrust:T.requestTrust,requestTrustWithToken:async e=>(An(e),c={...c,authToken:e},T.requestTrustWithToken(e)),requestTrustWithCode:async e=>{let t=await T.requestTrustWithCode(e);if(!t)return!1;An(t),c={...c,authToken:t};try{D?.postMessage({type:`auth-update`,authToken:t})}catch{}return!0},requestAuthCode:e=>T.requestAuthCode(e),call:te(T.call),callEvent:te(T.callEvent),callOptional:te(T.callOptional),client:h,sharedState:void 0,services:void 0,streaming:void 0,cacheManager:p,scope:void 0,close:ne};A.sharedState=Bn(A),A.streaming=lr(A),A.services=zn(A);let re=new Map;A.scope=(e=>{if(!e)return A;let t=re.get(e);return t||(t=yr(A,e),re.set(e,t)),t}),m.rpc=A;function j(){try{return typeof window<`u`&&window.self===window.top}catch{return!1}}async function ie(){if(e.simpleAuth!==!1&&j()&&typeof globalThis.prompt==`function`)for(await A.requestAuthCode().catch(()=>{});!A.isTrusted;){let e=globalThis.prompt(`devframe: enter the authentication code shown in your terminal`);if(e==null)return;let t=e.trim();if(t&&await A.requestTrustWithCode(t))return}}async function ae(){let t=await T.requestTrust(),n=e.otpParam??`devframe_otp`,r=n?await Rn(A,{param:n}):!1;t||r||A.isTrusted||await ie()}return O=ae().then(()=>{k=!0},()=>{k=!0}),l.mcp&&t(async()=>{let{setupBrowserAgentRpcBridge:e}=await import(`./CQTZHv-y.js`);return{setupBrowserAgentRpcBridge:e}},[],import.meta.url).then(({setupBrowserAgentRpcBridge:e})=>{v||(_=e(A))}).catch(()=>{}),D&&(D.onmessage=e=>{e.data?.type===`auth-update`&&e.data.authToken&&A.requestTrustWithToken(e.data.authToken)}),A}var Dr=Er;export{Dr as connectDevframe,i as t};
@@ -0,0 +1 @@
1
+ var e={meta:{title:`Furifont:自带振假名的日文字体`,description:`自带振假名的日语字体。`},nav:{demo:`简介`,docs:`文档`,customize:`自定义`,github:`GitHub 仓库`,light:`切换到浅色`,dark:`切换到深色`,language:`语言`,rubyOff:`隐藏振假名`,rubyOn:`显示振假名`},footer:{fonts:`字体采用{license},源自 Source Han Sans 和 Source Han Serif。`,data:`读音数据来自 {jmdict}、{jmnedict}、{kanjidic}(EDRDG)和 {furigana},采用 CC BY-SA 4.0 许可。`,code:`工具采用 MIT 许可。`,source:`GitHub 上的源代码`,made:`作者:{author}`,supported:`由 {vercel} 和{sponsors}支持`,sponsors:`赞助者`},copied:`已复制`,shuffle:`换一个例句`,editable:`示例文字,可以编辑。`,scripts:{hiragana:`平假名`,hepburn:`罗马字`},faces:{sans:`黑体`,serif:`宋体`},hero:{title1:`振假名,`,title2:`交给字体。`,body:`Furifont 是一款把振假名直接显示在字体上的日语字体。它用连字(ligature)按词语的读音切换。只要支持自定义字体,哪里都能用。`,download:`下载字体`,build:`自己构建`},notice:`受字体限制,振假名可能不正确,请留意。`,sections:{try:`试一试`,how:`原理`,selectors:`选择读音`,download:`下载`,anyPage:`用于网站`},playground:{script:`振假名所用文字`,face:`字体样式`,size:`字号 / {size}px`,weight:`字重 / {weight}`,ruby:`振假名`,okurigana:`送假名读音`,okuriganaHint:`需要 JavaScript。受浏览器限制,字体无法自行处理送假名。`,textHint:`点击文字即可编辑。`,copy:`复制文本`},how:{build:{title:`定制构建`,body:`Furifont 以思源黑体或思源宋体为基础编译而成。构建时会读取包含数千个词的词典,并把振假名绘制成新的字形。得到的是普通的字体文件,不需要 JavaScript,也不需要插件。`},ligatures:{title:`由连字完成工作`,body:`字体中为每个词准备了连字。今日 会变成上方带有 きょう 的单个字形。替换发生在绘制文字时,所以文本本身不会改变。`},longest:{title:`长词优先`,body:`Furifont 把每一组汉字与几千个常用词的列表对照,先试最长的词。例如,会先选 日本語,再考虑 日本。今日 会当作一个词,读作 きょう。`},bare:{title:`拿不准就不加`,body:`只有一个汉字时,只有当某个读音明显最可能,才加振假名。大人気 可以读作 だいにんき,也可以读作 おとなげ,所以不加振假名。`},okurigana:{title:`可选的送假名支持`,body:`浏览器按字体的文字种类分别排版,所以字体看不到汉字后面的假名(称为送假名)。我们通过 JavaScript 标注,提供可选的支持。`}},selectors:{body:`有些词有多个常用读音。Furifont 显示最常见的那个。要选其他读音,就在第一个汉字后面紧跟一个变体选择器(看不见的字符)。VS226 是读音 1,VS227 是读音 2,依此类推。VS225 去掉振假名。`,lookUp:`查询读音`,default:`默认`,reading2:`读音 2(VS227)`,none:`无振假名(VS225)`},downloads:{all:`全部下载为 ZIP`,family:`字体家族`,ruby:`振假名`,variable:`可变`,formats:`OTF 和 TTF 常用于安装到电脑上。WOFF2 针对网站做了优化。我们推荐使用可变字体,体验最佳。在某些情况下,为了兼容性,你可能需要固定字重的版本。`,buildOwn:`你也可以自己制作字体。可以选择其他基础字体、词的数量、振假名所用文字或尺寸。`},anyPage:{body:`你可以在任何网站上使用 Furifont。有汉字的行会留出放振假名的空间。如果电脑上已安装 Furifont,就不用下载。否则字体会从本站加载。`,bookmarklet:`书签小工具`,bookmarkletHint:`把它拖到书签栏。在任何页面点击它,就会打开 Furifont;再点一次就会关闭。有些网站(如 X 和 GitHub)不允许加载其他网站的字体。在这些网站上,请在电脑上安装 Furifont。`,okurigana:`送假名读音`,okuriganaHint:`为送假名前的汉字选出正确的读音,例如「来る」「来ない」中的「来」。`,userscript:`用户脚本`,install:`安装用户脚本`,userscriptHint:`适用于 Tampermonkey 或 Violentmonkey(运行小脚本的浏览器扩展)。它会在日语页面自动打开 Furifont,在不允许加载其他网站字体的网站上也能用。你可以在它的菜单里切换到另一款 Furifont 字体,或将其关闭。`,toast:{message:`Furifont 无法在此页面加载字体。有些网站(如 X 和 GitHub)不允许加载其他网站的字体。在这些网站上,需要在电脑上安装 Furifont。`,download:`下载字体`,close:`关闭`,outdated:`Furifont 有新版本了。`,userscript:`更新用户脚本`,bookmarklet:`获取新的书签小工具`},menu:{okuriganaOn:`送假名读音:开`,okuriganaOff:`送假名读音:关`}},reference:{eyebrow:`参考`,title:`选择读音`,body:`Furifont 显示词最常见的读音。要显示其他读音,就在词的第一个汉字后面紧跟一个变体选择器(看不见的字符)。VS226 是读音 1,VS227 是读音 2,依此类推。单个汉字后面的选择器,选的是这个汉字的读音。VS225 显示不带振假名的汉字。`,search:`搜索词语或汉字:市場、今日、生`,searchLabel:`搜索读音`,hint:`点击读音即可复制带选择器的词语。`,unavailable:`参考表随现成字体一起提供,但这里没能加载({error})。请用 {command} 制作字体,或打开自定义。`,loading:`加载中`,words:`有多个读音的词 / {count}`,kanji:`汉字 / {count}`,copyWith:`复制带 {selector} 的「{text}」`,default:`默认`},docs:{install:`安装字体`,website:`在网站上使用`,readings:`选择读音`},customize:{connecting:`正在连接 furifont dev`,title:`自定义`,offline:{eyebrow:`自定义 / 离线`,title:`构建你自己的 Furifont`,body:`自定义是运行在你电脑上的工具。它读取基础字体,并保存制作好的字体。在任意文件夹中启动它,本页就会连接上并打开,提供实时预览、词典和构建按钮。制作好的字体保存在 {folder}。`,needs:`需要 Node 22.18 或更高版本(一个运行 JavaScript 工具的免费程序)。`,run:`在任意文件夹中启动自定义`},auth:{eyebrow:`自定义 / 已锁定`,title:`输入终端中显示的验证码`,body:`{command} 在你的终端(输入命令的窗口)中显示了一个六位数验证码。`,code:`验证码`,failed:`验证码无效,请查看终端后重试。`,unlock:`解锁`},sections:{preview:`预览`,build:`构建`,dictionary:`词典`,words:`你的词语`},options:{family:`字体名称`,base:`基础字体`,baseHint:`要加振假名的字体。可以是要下载的字体,如 Source Han Serif JP Bold,也可以是电脑上另一个字体文件的路径。`,script:`振假名所用文字`,hiragana:`平假名`,katakanaOn:`片假名`,hepburn:`罗马字`,skip:`跳过最常见的词`,skipHint:`读者已经认识这些词,所以不加振假名。报纸词表按出现频率排序,每 500 个词一档。`,words:`接着加振假名的词数`,wordsHint:`词表中接下来的词。加上下方的词表,共 {count} 个词加振假名。`,jlpt:`跳过 JLPT 词汇`,jlptHint:`JLPT(日本语能力测试)词表中到这个级别为止的词不加振假名。N5 是最简单的级别。`,none:`无`,sources:`同时收录来自以下来源的词`,source:{spec1:{name:`日常词`,hint:`JMdict“spec1”:其他词表没有收录的常用词,如 日本。`},ichi1:{name:`基础词`,hint:`JMdict“ichi1”:“一万语”词表(基础词汇表)中最常用的词。`},news1:{name:`报纸用词`,hint:`JMdict“news1”:报纸中出现最多的 12,000 个词。`},gai1:{name:`外来语`,hint:`JMdict“gai1”:日语从其他语言借来的常用词。`},places:{name:`地名`,hint:`JMnedict:站名和地名。在没有常用词匹配的文字上使用。`}},isolated:`单个汉字也加振假名`,share:`单个汉字的把握度`,shareHint:`只有一个汉字时,只有当某个读音在词典中至少占这个比例,才加振假名。请输入 0.5 到 1 之间的数。数字越大,加振假名的汉字越少。`,rubyScale:`振假名大小(汉字的几倍)`,rubyGap:`汉字上方的间距(em)`,squeeze:`最窄压缩到(正常宽度的几倍)`,maxWidth:`振假名最大宽度(em)`,reset:`恢复默认`,resetHint:`回到自定义载入的设置。你添加的词会保留。`},preview:{compiling:`正在制作预览`,weight:`预览字重`,size:`预览字号`,stats:`{glyphs} 个字形 / {ms} ms`},build:{words:`词语`,places:`地名`,ambiguous:`多读音`,lone:`单个汉字`,protected:`你的设置`,glyphs:`振假名字形`,rules:`规则`,planning:`规划中`,estimate:{woff2:`≈ {size} WOFF2`,otf:`{size} OTF`},formats:`格式`,estimating:`正在估算大小`,run:`构建字体`,save:`保存设置`},dictionary:{search:`搜索词典:今日、生`,results:`{count} 个词`,hint:`这些词有多个常用读音。固定其中一个,它就成为默认读音。`,noTag:`不是常用词`,restore:`恢复`,remove:`不加振假名`},custom:{placeholder:`日[に]本[ほん] 或 今日[きょう]`,label:`要添加的词`,add:`添加词语`,added:`已添加 / {count}`,pinned:`已固定 / {count}`,removed:`不加振假名 / {count}`,none:`无`,takeOut:`移除 {item}`}}};export{e as default};
@@ -0,0 +1,75 @@
1
+ import{C as e,D as t,E as n,Gt as r,Kt as i,P as a,T as o,Ut as s,V as c,Z as l,_ as u,et as d,it as f,lt as p,tt as m,ut as h,w as g,wt as _}from"./DmlUWPPW.js";import{i as v,o as y}from"./DmOlRIb5.js";import{t as b}from"./Cg7TlFyt.js";var x=[{text:`今日は桜が満開
2
+ 新幹線で京都まで`,reading:`きょうはさくらがまんかい
3
+ しんかんせんできょうとまで`},{text:`東京特許許可局`,reading:`とうきょうとっきょきょかきょく`},{text:`ひさかたの
4
+ 光のどけき
5
+ 春の日に
6
+ しづ心なく
7
+ 花の散るらむ`,reading:`ひさかたの
8
+ ひかりのどけき
9
+ はるのひに
10
+ しづこころなく
11
+ はなのちるらむ`,author:`紀友則`},{text:`花さそふ
12
+ 嵐の庭の
13
+ 雪ならで
14
+ ふりゆくものは
15
+ わが身なりけり`,reading:`はなさそふ
16
+ あらしのにわの
17
+ ゆきならで
18
+ ふりゆくものは
19
+ わがみなりけり`,author:`入道前太政大臣`},{text:`いのちなき
20
+ 砂のかなしさよ
21
+ さらさらと
22
+ 握れば指の
23
+ あひだより落つ`,reading:`いのちなき
24
+ すなのかなしさよ
25
+ さらさらと
26
+ にぎればゆびの
27
+ あひだよりおつ`,author:`石川啄木`},{text:`かにかくに
28
+ 祇園はこひし
29
+ 寝るときも
30
+ 枕のしたを
31
+ 水のながるる`,reading:`かにかくに
32
+ ぎおんはこひし
33
+ ねるときも
34
+ まくらのしたを
35
+ みずのながるる`,author:`吉井勇`},{text:`この味が
36
+ いいねと君が
37
+ 言ったから
38
+ 七月六日は
39
+ サラダ記念日`,reading:`このあじが
40
+ いいねときみが
41
+ いったから
42
+ しちがつむいかは
43
+ さらだきねんび`,author:`俵万智`},{text:`柿くへば
44
+ 鐘が鳴るなり
45
+ 法隆寺`,reading:`かきくへば
46
+ かねがなるなり
47
+ ほうりゅうじ`,author:`正岡子規`},{text:`菜の花や
48
+ 月は東に
49
+ 日は西に`,reading:`なのはなや
50
+ つきはひがしに
51
+ ひはにしに`,author:`与謝蕪村`},{text:`朝顔に
52
+ つるべとられて
53
+ もらひ水`,reading:`あさがおに
54
+ つるべとられて
55
+ もらひみず`,author:`加賀千代女`},{text:`閑さや
56
+ 岩にしみ入る
57
+ 蝉の声`,reading:`しずけさや
58
+ いわにしみいる
59
+ せみのこえ`,author:`松尾芭蕉`},{text:`海を知らぬ
60
+ 少女の前に
61
+ 麦藁帽の
62
+ われは両手を
63
+ ひろげていたり`,reading:`うみをしらぬ
64
+ しょうじょのまえに
65
+ むぎわらぼうの
66
+ われはりょうてを
67
+ ひろげていたり`,author:`寺山修司`},{text:`五月雨を
68
+ 集めて早し
69
+ 最上川`,reading:`さみだれを
70
+ あつめてはやし
71
+ もがみがわ`,author:`松尾芭蕉`},{text:`我と来て
72
+ 遊べや親の
73
+ ない雀`,reading:`われときて
74
+ あそべやおやの
75
+ ないすずめ`,author:`小林一茶`}];function S(e){let t=x.filter(t=>t.text!==e);return t[Math.floor(Math.random()*t.length)]}var C={class:`flex flex-col gap-1.5`},w={class:`label`},T={key:0,class:`text-xs color-muted`},E=Object.assign(a({__name:`UiField`,props:{label:{},hint:{}},setup(e){return(r,a)=>(l(),t(`label`,C,[g(`span`,w,i(e.label),1),m(r.$slots,`default`),e.hint?(l(),t(`span`,T,i(e.hint),1)):n(``,!0)]))}}),{__name:`UiField`}),D=[`aria-label`],O=[`aria-checked`,`onClick`],k=Object.assign(a({__name:`UiSegmented`,props:c({options:{},label:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=f(e,`modelValue`);return(r,a)=>(l(),t(`div`,{role:`radiogroup`,"aria-label":e.label,class:`inline-flex border border-strong w-fit`},[(l(!0),t(u,null,d(e.options,(e,r)=>(l(),t(`button`,{key:e.value,type:`button`,role:`radio`,"aria-checked":n.value===e.value,class:s([`focus-ring h-8 px-3 text-xs font-medium transition-colors`,[n.value===e.value?`bg-inverse color-inverse`:`color-muted hover:color-base hover:bg-hover`,r>0&&(n.value===e.value?`border-l border-inverse`:`border-l border-strong`)]]),onClick:t=>n.value=e.value},i(e.label),11,O))),128))],8,D))}}),{__name:`UiSegmented`}),A=[`min`,`max`,`step`],j=Object.assign(a({__name:`UiSlider`,props:c({min:{},max:{},step:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=f(e,`modelValue`);return(i,a)=>h((l(),t(`input`,{"onUpdate:modelValue":a[0]||=e=>n.value=e,type:`range`,min:e.min,max:e.max,step:e.step,class:`slider`,style:r({"--slider-fraction":(n.value-e.min)/(e.max-e.min)})},null,12,A)),[[y,n.value,void 0,{number:!0}]])}}),{__name:`UiSlider`}),M={class:`inline-flex cursor-pointer items-center gap-2 text-sm select-none`},N=Object.assign(a({__name:`UiToggle`,props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let n=f(e,`modelValue`);return(e,r)=>(l(),t(`label`,M,[h(g(`input`,{"onUpdate:modelValue":r[0]||=e=>n.value=e,type:`checkbox`,class:`peer sr-only`},null,512),[[v,n.value]]),g(`span`,{class:s([`relative h-4 w-7 border transition-colors peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-[var(--ff-fg)]`,n.value?`border-inverse bg-inverse`:`border-strong bg-base`])},[g(`span`,{class:s([`absolute top-[2px] size-[10px] transition-all`,n.value?`left-[14px] bg-base`:`left-[2px] bg-inverse`])},null,2)],2),m(e.$slots,`default`)]))}}),{__name:`UiToggle`}),P=[`href`],F=Object.assign(a({__name:`UiButton`,props:{variant:{default:`outline`},to:{},href:{},icon:{}},setup(r){let i=e(()=>[`btn-${r.variant}`,`focus-ring`]);return(e,a)=>{let c=b;return r.to?(l(),o(c,{key:0,to:r.to,class:s(_(i))},{default:p(()=>[r.icon?(l(),t(`span`,{key:0,class:s(r.icon)},null,2)):n(``,!0),m(e.$slots,`default`)]),_:3},8,[`to`,`class`])):r.href?(l(),t(`a`,{key:1,href:r.href,target:`_blank`,rel:`noopener`,class:s(_(i))},[r.icon?(l(),t(`span`,{key:0,class:s(r.icon)},null,2)):n(``,!0),m(e.$slots,`default`)],10,P)):(l(),t(`button`,{key:2,type:`button`,class:s(_(i))},[r.icon?(l(),t(`span`,{key:0,class:s(r.icon)},null,2)):n(``,!0),m(e.$slots,`default`)],2))}}}),{__name:`UiButton`});export{E as a,k as i,N as n,x as o,j as r,S as s,F as t};
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./nNFr3PcB.js","./DmlUWPPW.js","./y07Wd5I9.js","./DmOlRIb5.js","./CRzLMJPS.js","./CEWHii-_.js","./g9q6jbAq.js","./AmQakyTh.js","./C4NVi0HP.js","./Cg7TlFyt.js","./DSYkQlQa.js","./BDNMzG2s.js","./DTC_KzWZ.js","./JRbXhaR6.js","./HB7Qu17x.js","./DGhFAXuQ.js","./nQF5Cd64.js","./CEo6aVYN.js","./error-404.DqUWOYf4.css","./DhRy_lmV.js","./error-500.BYTKxx4O.css"])))=>i.map(i=>d[i]);
2
+ import{n as e}from"./y07Wd5I9.js";import{A as t,B as n,C as r,Ct as i,D as a,E as o,F as s,I as c,J as l,Jt as u,K as d,Kt as f,L as p,M as m,N as h,P as g,Q as _,R as v,St as y,T as b,U as ee,Ut as x,W as te,Wt as S,Xt as C,Yt as w,Z as T,_ as E,_t as ne,a as D,bt as re,et as O,f as k,ft as ie,gt as ae,j as oe,l as A,lt as j,m as se,mt as M,n as ce,nt as le,o as N,ot as P,p as F,pt as I,q as ue,r as L,rt as de,s as fe,st as pe,t as me,ut as he,v as ge,vt as _e,w as R,wt as z,y as ve,yt as ye,z as B}from"./DmlUWPPW.js";import{a as be,n as xe,r as Se}from"./DmOlRIb5.js";import{$ as Ce,A as we,B as Te,C as Ee,Ct as De,D as Oe,E as V,F as ke,G as Ae,H as je,I as Me,J as H,K as Ne,L as Pe,M as Fe,N as Ie,O as Le,P as Re,Q as ze,R as Be,S as Ve,St as He,T as Ue,Tt as We,U as Ge,V as Ke,W as U,X as qe,Y as Je,Z as W,_ as Ye,_t as Xe,a as Ze,at as Qe,b as $e,bt as et,c as tt,ct as nt,d as rt,dt as it,et as at,f as ot,ft as st,g as G,gt as K,ht as ct,it as lt,j as ut,k as dt,l as q,lt as ft,mt as pt,nt as mt,o as ht,ot as J,p as gt,pt as _t,q as vt,r as yt,rt as bt,s as xt,st as St,t as Ct,tt as wt,u as Tt,ut as Y,v as Et,vt as Dt,w as Ot,wt as kt,x as At,xt as jt,y as Mt,yt as Nt,z as Pt}from"./Cg7TlFyt.js";import{t as X}from"./CRzLMJPS.js";import{d as Ft,n as It,o as Lt,r as Rt,t as zt}from"./CEWHii-_.js";import{t as Bt}from"./BDNMzG2s.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Vt=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Ht=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Ut=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Wt(e,t){if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t)Gt(e);else return t}function Gt(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function Kt(e,t={}){if(typeof e!=`string`)return e;if(e[0]===`"`&&e[e.length-1]===`"`&&e.indexOf(`\\`)===-1)return e.slice(1,-1);let n=e.trim();if(n.length<=9)switch(n.toLowerCase()){case`true`:return!0;case`false`:return!1;case`undefined`:return;case`null`:return null;case`nan`:return NaN;case`infinity`:return 1/0;case`-infinity`:return-1/0}if(!Ut.test(e)){if(t.strict)throw SyntaxError(`[destr] Invalid JSON`);return e}try{if(Vt.test(e)||Ht.test(e)){if(t.strict)throw Error(`[destr] Possible prototype pollution`);return JSON.parse(e,Wt)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}var qt=class extends Error{constructor(e,t){super(e,t),this.name=`FetchError`,t?.cause&&!this.cause&&(this.cause=t.cause)}};function Jt(e){let t=e.error?.message||e.error?.toString()||``,n=e.request?.method||e.options?.method||`GET`,r=e.request?.url||String(e.request)||`/`,i=new qt(`${`[${n}] ${JSON.stringify(r)}`}: ${e.response?`${e.response.status} ${e.response.statusText}`:`<no response>`}${t?` ${t}`:``}`,e.error?{cause:e.error}:void 0);for(let t of[`request`,`options`,`response`])Object.defineProperty(i,t,{get(){return e[t]}});for(let[t,n]of[[`data`,`_data`],[`status`,`status`],[`statusCode`,`status`],[`statusText`,`statusText`],[`statusMessage`,`statusText`]])Object.defineProperty(i,t,{get(){return e.response&&e.response[n]}});return i}var Yt=new Set(Object.freeze([`PATCH`,`POST`,`PUT`,`DELETE`]));function Xt(e=`GET`){return Yt.has(e.toUpperCase())}function Zt(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer||e instanceof FormData||e instanceof URLSearchParams?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}var Qt=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]),$t=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function en(e=``){if(!e)return`json`;let t=e.split(`;`).shift()||``;return $t.test(t)?`json`:t===`text/event-stream`?`stream`:Qt.has(t)||t.startsWith(`text/`)?`text`:`blob`}function tn(e,t,n,r){let i=nn(t?.headers??e?.headers,n?.headers,r),a;return(n?.query||n?.params||t?.params||t?.query)&&(a={...n?.params,...n?.query,...t?.params,...t?.query}),{...n,...t,query:a,params:a,headers:i}}function nn(e,t,n){if(!t)return new n(e);let r=new n(t);if(e)for(let[t,i]of Symbol.iterator in e||Array.isArray(e)?e:new n(e))r.set(t,i);return r}async function rn(e,t){if(t){if(Array.isArray(t))for(let n of t)await n(e);else await t(e)}}var an=new Set([408,409,425,429,500,502,503,504]),on=new Set([101,204,205,304]);function sn(e={}){let{fetch:t=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=e;async function i(e){let t=e.error&&e.error.name===`AbortError`&&!e.options.timeout||!1;if(e.options.retry!==!1&&!t){let t;t=typeof e.options.retry==`number`?e.options.retry:+!Xt(e.options.method);let n=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(n):an.has(n))){let n=typeof e.options.retryDelay==`function`?e.options.retryDelay(e):e.options.retryDelay||0;return n>0&&await new Promise(e=>setTimeout(e,n)),a(e.request,{...e.options,retry:t-1})}}let n=Jt(e);throw Error.captureStackTrace&&Error.captureStackTrace(n,a),n}let a=async function(a,o={}){let s={request:a,options:tn(a,o,e.defaults,n),response:void 0,error:void 0};if(s.options.method&&(s.options.method=s.options.method.toUpperCase()),s.options.onRequest&&(await rn(s,s.options.onRequest),s.options.headers instanceof n||(s.options.headers=new n(s.options.headers||{}))),typeof s.request==`string`&&(s.options.baseURL&&(s.request=De(s.request,s.options.baseURL)),s.options.query&&(s.request=kt(s.request,s.options.query),delete s.options.query),`query`in s.options&&delete s.options.query,`params`in s.options&&delete s.options.params),s.options.body&&Xt(s.options.method)){if(Zt(s.options.body)){let e=s.options.headers.get(`content-type`);typeof s.options.body!=`string`&&(s.options.body=e===`application/x-www-form-urlencoded`?new URLSearchParams(s.options.body).toString():JSON.stringify(s.options.body)),e||s.options.headers.set(`content-type`,`application/json`),s.options.headers.has(`accept`)||s.options.headers.set(`accept`,`application/json`)}else(`pipeTo`in s.options.body&&typeof s.options.body.pipeTo==`function`||typeof s.options.body.pipe==`function`)&&(`duplex`in s.options||(s.options.duplex=`half`))}let c;if(!s.options.signal&&s.options.timeout){let e=new r;c=setTimeout(()=>{let t=Error(`[TimeoutError]: The operation was aborted due to timeout`);t.name=`TimeoutError`,t.code=23,e.abort(t)},s.options.timeout),s.options.signal=e.signal}try{s.response=await t(s.request,s.options)}catch(e){return s.error=e,s.options.onRequestError&&await rn(s,s.options.onRequestError),await i(s)}finally{c&&clearTimeout(c)}if((s.response.body||s.response._bodyInit)&&!on.has(s.response.status)&&s.options.method!==`HEAD`){let e=(s.options.parseResponse?`json`:s.options.responseType)||en(s.response.headers.get(`content-type`)||``);switch(e){case`json`:{let e=await s.response.text(),t=s.options.parseResponse||Kt;s.response._data=t(e);break}case`stream`:s.response._data=s.response.body||s.response._bodyInit;break;default:s.response._data=await s.response[e]()}}return s.options.onResponse&&await rn(s,s.options.onResponse),!s.options.ignoreResponseError&&s.response.status>=400&&s.response.status<600?(s.options.onResponseError&&await rn(s,s.options.onResponseError),await i(s)):s.response},o=async function(e,t){return(await a(e,t))._data};return o.raw=a,o.native=(...e)=>t(...e),o.create=(t={},n={})=>sn({...e,...n,defaults:{...e.defaults,...n.defaults,...t}}),o}var cn=(function(){if(typeof globalThis<`u`)return globalThis;if(typeof self<`u`)return self;if(typeof window<`u`)return window;if(typeof global<`u`)return global;throw Error(`unable to locate global object`)})(),ln=cn.fetch?(...e)=>cn.fetch(...e):()=>Promise.reject(Error(`[ofetch] global.fetch is not supported!`)),un=cn.Headers,dn=cn.AbortController,fn=sn({fetch:ln,Headers:un,AbortController:dn}),pn=()=>window?.__NUXT__?.config||window?.useNuxtApp?.().payload?.config,mn=()=>pn().app,hn=()=>mn().baseURL,gn=()=>mn().buildAssetsDir,_n=(...e)=>jt(vn(),gn(),...e),vn=(...e)=>{let t=mn(),n=t.cdnURL||t.baseURL;return e.length?jt(n,...e):n};globalThis.__buildAssetsURL=_n,globalThis.__publicAssetsURL=vn,globalThis.$fetch||(globalThis.$fetch=fn.create({baseURL:hn()}));var yn=globalThis.$fetch;`global`in globalThis||(globalThis.global=globalThis);function bn(e,t){t.push(fe),e.vueApp.use(t);let n=!0,r=()=>{n=!1,t.render()};t.hooks?.hook(`dom:beforeRender`,e=>{e.shouldRender=!n}),e.hooks.hook(`page:start`,()=>{n=!0}),e.hooks.hook(`page:finish`,()=>{e.isHydrating||r()}),e.hooks.hook(`app:error`,r),e.hooks.hook(`app:suspense:resolve`,r);let i=t.push.bind(t);t.push=((t,n)=>{let r=i(t,n),a=r.dispose.bind(r);return r.dispose=()=>{let t=e[`~transitionPromise`];t?t.finally(a):a()},r})}function xn(e,t){if(typeof t==`function`&&t.key&&e.plugins.has(t.key))return;let n=typeof t==`function`?t(e):t,r=n.key||String(e.plugins.size+1);if(!e.plugins.get(r)){e.plugins.set(r,n);for(let t in n.hooks||{})e.hooks?.hook(t,n.hooks[t])}}function Sn(e,t={}){let n=!t.document,r=new Map,i={_entryCount:1,_h:0,plugins:new Map,resolvedOptions:t,ssr:n,entries:r,hooks:void 0,render:()=>e(i),use:e=>xn(i,e),push(e,t){let a=t?._index??i._entryCount++,o=t?{...t}:{};delete o.head,delete o.onRendered,delete o._index;let s={_i:a,input:e,options:o};return r.set(a,s),{_i:a,dispose(){r.delete(a)},patch(e){n?(s.input=e,delete s._tags):s._pending=e,r.has(a)||r.set(a,s)}}}};return t.init?.forEach(e=>e&&i.push(e)),i}var Cn=new Set([`link`,`style`,`script`,`noscript`]),wn=new Set([`title`,`titleTemplate`,`script`,`style`,`noscript`]),Tn=new Set([`base`,`meta`,`link`,`style`,`script`,`noscript`]),En=new Set([`title`,`base`,`htmlAttrs`,`bodyAttrs`,`meta`,`link`,`style`,`script`,`noscript`]),Dn=new Set([`base`,`title`,`titleTemplate`,`bodyAttrs`,`htmlAttrs`,`templateParams`]),On=new Set([`key`,`tagPosition`,`tagPriority`,`tagDuplicateStrategy`,`innerHTML`,`textContent`,`processTemplateParams`]),kn=new Set([`templateParams`,`htmlAttrs`,`bodyAttrs`]),An=new Set([`theme-color`,`google-site-verification`,`author`,`og:locale:alternate`,`og:image`,`og:video`,`og:audio`,`article:author`,`article:tag`,`book:author`,`book:tag`,`twitter:image`]),jn={critical:-8,high:-1,low:2},Mn=e=>typeof e==`number`?Number.isFinite(e):e;function Nn(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function Pn(e){let t=new se;for(let n in e||{})t.hook(n,e[n]);return t}function Z(e,t,n){if(e.hooks?._hooks?.[t]?.length)return e.hooks?.callHook(t,n)}function Fn(e,t,n){let r=e.push,i=e;i.ssr=!1,i.hooks=t,i.dirty=!!i.dirty,i.use=e=>xn(i,e),i.render=()=>n(i);function a(){t.callHook(`entries:updated`,i),i._b||i.render()}return i.invalidate=()=>{for(let e of i.entries.values())delete e._tags;i.dirty=!0,a()},i.push=(n,o)=>{let s=o?.onRendered?t.hook(`dom:rendered`,o.onRendered):void 0,c=r(n,o),l=e.entries.get(c._i);return l&&(l._o=n),i.dirty=!0,a(),{_i:c._i,patch(e){c.patch(e),i.dirty=!0,a()},dispose(){s?.(),e.entries.has(c._i)&&(c.dispose(),i.invalidate())}}},i}var In=/^(?:viewport|description|keywords|robots)$/,Ln=[`name`,`property`,`http-equiv`];function Rn(e){let t=e.indexOf(`:`);if(t===-1)return!1;let n=e.slice(t+1);return An.has(n)||n.startsWith(`og:image:`)||n.startsWith(`og:video:`)||n.startsWith(`og:audio:`)||n.startsWith(`twitter:image:`)}function zn(e){let{props:t,tag:n,key:r}=e;if(Dn.has(n))return n;if(n===`link`){if(t.rel===`canonical`)return`canonical`;if(t.rel===`alternate`&&t.hreflang)return`alternate:${t.hreflang}`}if(t.charset)return`charset`;if(n===`meta`)for(let e of Ln){let n=t[e];if(n!==void 0)return`meta:${n}${(typeof n!=`string`||!n.includes(`:`))&&!In.test(n)&&r?`:key:${r}`:``}`}return r?`${n}:key:${r}`:t.id?`${n}:id:${t.id}`:n===`link`&&t.rel&&t.href?`link:${t.rel}:${t.href}`:wn.has(n)&&(e.textContent||e.innerHTML)?`${n}:content:${e.textContent||e.innerHTML}`:void 0}function Bn(e){let t=e._h||e._d||e.textContent||e.innerHTML;if(t)return t;let n=Object.keys(e.props).sort(),r=`${e.tag}:`,i=``;for(let t of n)r+=`${i}${t}:${String(e.props[t])}`,i=`,`;return r}function Vn(e,t,n){if(n===`_resolver`)return e;typeof e==`function`&&(!n||n!==`titleTemplate`&&!n.startsWith(`on`))&&(e=e());let r=t?t(n,e):e;if(Array.isArray(r)){let e;for(let n=0;n<r.length;n++){let i=Vn(r[n],t);e?e[n]=i:i!==r[n]&&(e=r.slice(0,n),e[n]=i)}return e||r}if(r?.constructor===Object){let e;for(let n in r){let i=Nn(n),a=i?void 0:Vn(r[n],t,n);if(!e&&(i||a!==r[n])){e={};for(let t in r){if(t===n)break;e[t]=r[t]}}e&&!i&&(e[n]=a)}return e||r}return r}var Hn=/[\s"'<>/=\x00-\x1F\x7F]/;function Un(e,t){let n=e===`style`,r=n?new Map:new Set,i=e=>{if(e){if(n){let t=e.indexOf(`:`);t>0&&r.set(e.slice(0,t).trim(),e.slice(t+1).trim())}else e.split(` `).forEach(e=>e&&r.add(e))}};if(typeof t==`string`)(n?t.split(`;`):[t]).forEach(i);else if(Array.isArray(t))t.forEach(i);else if(t&&typeof t==`object`)for(let e in t){let a=t[e];a&&a!==`false`&&(n?r.set(e.trim(),String(a)):i(e))}return r}function Wn(e,t){if(e.props=e.props||{},!t)return e;if(e.tag===`templateParams`)return e.props=t,e;let n=Tn.has(e.tag)||e.tag===`htmlAttrs`||e.tag===`bodyAttrs`;for(let r in t){if(Nn(r))continue;let i=r.startsWith(`data-`),a=n&&!On.has(r),o=a&&!i?r.toLowerCase():r;if(a&&(!o||Hn.test(o)))continue;let s=t[r];if(s===null)e.props[o]=null;else if(r===`class`||r===`style`)e.props[r]=Un(r,s);else if(On.has(r)){if((r===`textContent`||r===`innerHTML`)&&typeof s==`object`){let n=t.type||`application/json`;(n.endsWith(`json`)||n===`speculationrules`||n===`importmap`)&&(e.props.type=n,e[r]=JSON.stringify(s))}else e[r]=s}else if(s!==void 0){let t=String(s),n=e.tag===`meta`&&o===`content`;e.props[o]=t===`true`||t===``?i||n?t:!0:!s&&i&&t===`false`?`false`:s}}return e}function Gn(e,t){let n;return t.length&&(n=(e,n)=>{for(let r=0;r<t.length;r++)n=t[r](e,n);return n},e=n(void 0,e)),Vn(e,n)}function Kn(e,t){let n=Wn({tag:e,props:{}},typeof t==`object`&&typeof t!=`function`?t:{[e===`script`||e===`noscript`||e===`style`?`innerHTML`:`textContent`]:t});if(n.key&&Cn.has(n.tag)&&(n.props[`data-hid`]=n._h=n.key),n.tag===`script`&&typeof n.innerHTML==`object`&&(n.innerHTML=JSON.stringify(n.innerHTML),n.props.type=n.props.type||`application/json`),Array.isArray(n.props.content)){let e=[];for(let t of n.props.content)e.push({...n,props:{...n.props,content:t}});return e}return n}function qn(e,t){if(Array.isArray(t))for(let n of t)e.push(n);else e.push(t)}function Jn(e,t){if(!e)return[];typeof e==`function`&&(e=e()),e=Gn(e,t);let n=[];for(let t in e){let r=e[t];if(r!==void 0){if(Array.isArray(r))for(let e of r)qn(n,Kn(t,e));else qn(n,Kn(t,r))}}return n}var Yn=/</g,Xn=/<\/script/g,Zn=(e,t)=>e._w===t._w?e._p-t._p:e._w-t._w,Qn=()=>100;function $n(e){for(let t in e)return!1;return!0}var er=/^tags:|:render/;function tr(e,t){let n=(t[`entries:resolve`]?.length||0)+(t[`entries:normalize`]?.length||0);if(e._h!==n){e._h=n;for(let t of e.entries.values())delete t._tags}}function nr(e){for(let t=0;t<e.length;t++){let n=e[t],r={...n.props};r.class instanceof Set&&(r.class=new Set(r.class)),r.style instanceof Map&&(r.style=new Map(r.style)),e[t]={...n,props:r}}}function rr(e,t){let n=e.tags,r=0;for(let t of e.tagMap.values())if(Array.isArray(t))for(let e of t)n[r++]=e;else n[r++]=t;n.length=r,t&&n.sort(Zn)}function ir(e){let t=!1;for(let n of e.tags.sort(Zn)){let r=n._d||Bn(n);if(!r)continue;let i=e.tagMap.get(r);if(!i)e.tagMap.set(r,n);else if((n.tagDuplicateStrategy||(kn.has(n.tag)?`merge`:null)||(n.key&&n.key===i.key?`merge`:null))===`merge`){let t={...i.props};for(let e in n.props)t[e]=e===`style`?new Map([...i.props.style||new Map,...n.props[e]]):e===`class`?new Set([...i.props.class||[],...n.props[e]]):n.props[e];e.tagMap.set(r,{...n,props:t})}else n._p>>10==i._p>>10&&n.tag===`meta`&&Rn(r)?(e.tagMap.set(r,Object.assign([...Array.isArray(i)?i:[i],n],n)),t=!0):(n._w===i._w?n._p>i._p:n._w<i._w)&&e.tagMap.set(r,n)}return t}function ar(e,t){let n=e.tagMap.get(`title`),r=e.tagMap.get(`titleTemplate`);if(t._title=n?.textContent,!r)return;let i=r.textContent;if(t._titleTemplate=i,!i)return;let a=typeof i==`function`?i(n?.textContent):i;typeof a==`string`&&!t.plugins.has(`template-params`)&&(a=a.replace(`%s`,n?.textContent||``)),n?a===null?e.tagMap.delete(`title`):e.tagMap.set(`title`,{...n,textContent:a}):e.tagMap.set(`titleTemplate`,{...r,tag:`title`,textContent:a})}function or(e){let t=0;for(let n of e){let{innerHTML:r,tag:i,props:a}=n;if(En.has(i)&&(!$n(a)||Mn(r)||Mn(n.textContent))&&(i!==`meta`||Mn(a.content)||a[`http-equiv`]||a.charset)){if(i===`script`&&(r||n.textContent)){let e=String(a.type),t=e.endsWith(`json`)||e===`importmap`||e===`speculationrules`,i=e=>t?(typeof e==`string`?e:JSON.stringify(e)).replace(Yn,`\\u003C`):typeof e==`string`?e.replace(Xn,`<\\/script`):e;n={...n},r&&(n.innerHTML=i(r)),n.textContent&&(n.textContent=i(n.textContent)),n._d=zn(n)}e[t++]=n}}return e.length=t,e}function sr(e,t){let n=t?.tagWeight??e.resolvedOptions._tagWeight??Qn,r={tagMap:new Map,tags:[]},i=e.hooks?._hooks||{};tr(e,i);for(let t of e.entries.values())t._pending!==void 0&&(t.input=t._pending,delete t._pending,delete t._tags,delete t._precomputedTags);let a;(i[`entries:resolve`]?.length||i[`entries:normalize`]?.length)&&(a=[...e.entries.values()],i[`entries:resolve`]?.length&&Z(e,`entries:resolve`,{entries:a,...r})),tr(e,i);for(let t of a||e.entries.values()){let a=t._tags;if(!a){if(t._precomputedTags&&n===e.resolvedOptions._tagWeight&&!i[`entries:normalize`]?.length&&!i[`entries:resolve`]?.length&&(!t.options||$n(t.options)))a=t._precomputedTags;else{if(a=Jn(t.input,e.resolvedOptions.propResolvers||[]),t.options&&!$n(t.options))for(let e of a)Object.assign(e,t.options);if(i[`entries:normalize`]?.length){let n={tags:a,entry:t};Z(e,`entries:normalize`,n),a=n.tags}for(let e=0;e<a.length;e++){let r=a[e];r._w=n(r),r._p=(t._i<<10)+e,r._d=zn(r),r._d||(r._h=Bn(r))}t._tags=a}}r.tags.push(...a)}for(let e in i)if(i[e]?.length&&er.test(e)){nr(r.tags);break}let o=ir(r);return ar(r,e),rr(r,o),Z(e,`tags:beforeResolve`,r),Z(e,`tags:resolve`,r),Z(e,`tags:afterResolve`,r),or(r.tags)}var cr=/\s+/;function lr(e={}){return t=>fr(t,e)}function ur(e){for(let t of e.entries.values())if(t._pending!==void 0)return!0;return!1}function dr(e,t){let n={_d:t,_t:t.title,_e:new Map([[`htmlAttrs`,t.documentElement],[`bodyAttrs`,t.body]]),_p:{},_s:{},_l:new Map};for(let t of e.entries.values())if(t._o!==void 0){let e=t._o;for(let t of[`bodyAttrs`,`htmlAttrs`]){let r=e[t]?.class;if(typeof r==`string`){let e=n._e.get(t);for(let i of r.split(cr))i&&(n._p[`${t}:attr:class:${i}`]=()=>e.classList.remove(i))}}}return n}function fr(e,t={}){let n=t.document||e.resolvedOptions.document,r=e._dom;if(!n||e._du||r&&r._d===n&&!e.dirty&&!ur(e))return!1;let i=n.defaultView;e._du=!0;let a=!1;try{let o=function(e,t,n){d._s[e]=!n&&f[e]||t,delete f[e]},s=function(e,t,n,r,i,a){let s=`${e}:event:${t}`,c=d._l.get(s);if(c&&c[0]===a&&c[1]===n&&c[2]===r){o(s,c[4]);return}c?.[4]();let l=`data-${t}`,u=(e=>r.call(i,e)),f=()=>{a.removeEventListener(n,u),i.getAttribute(l)===``&&i.removeAttribute(l),d._l.get(s)?.[3]===u&&d._l.delete(s)};a.addEventListener(n,u),d._l.set(s,[a,n,r,u,f]),i.setAttribute(l,``),o(s,f,!0)},c=function({id:e,$el:t,tag:n}){if(d._e.set(e,t),!n.tag.endsWith(`Attrs`)){let r=n.textContent;r!=null&&r!==``&&(r!==t.textContent&&(t.textContent=r),o(`${e}:text`,()=>{t.textContent===r&&(t.textContent=``)},!0));let i=n.innerHTML;i!=null&&i!==``&&(i!==t.innerHTML&&(t.innerHTML=i),o(`${e}:html`,()=>{t.innerHTML===i&&(t.innerHTML=``)},!0));let a=`${e}:el`;o(a,f[a]||(()=>{t?.remove(),d._e.delete(e)}))}for(let r in n.props){let a=n.props[r];if(r[0]===`o`&&r[1]===`n`&&typeof a==`function`){let o=r.slice(2);t?.dataset?.[`${r}fired`]&&a.call(t,new((i?.Event)||Event)(o)),s(e,r,o,a,t,n.tag===`bodyAttrs`&&i?i:t);continue}let c=`${e}:attr:${r}`;if(r===`class`&&a)for(let e of a){let n=`${c}:${e}`;o(n,f[n]||(()=>t.classList.remove(e))),t.classList.contains(e)||t.classList.add(e)}else if(r===`style`&&a)for(let[e,n]of a){let r=`${c}:${e}`;o(r,f[r]||(()=>t.style.removeProperty(e))),t.style.setProperty(e,n)}else a!==!1&&a!==null&&(t.getAttribute(r)!==a&&t.setAttribute(r,a===!0?``:String(a)),o(c,f[c]||(()=>t.removeAttribute(r))))}},l={shouldRender:!0,tags:[]};if(Z(e,`dom:beforeRender`,l),!l.shouldRender)return!1;let u=r;if(u?._d!==n){if(u){for(let e in u._s)u._s[e]();for(let e in u._p)u._p[e]();u._s=u._p={},u._e.clear(),u._l.clear()}u=void 0}u?u._p=u._s:u=dr(e,n),u._s={};let d=u,f=d._p,p=[],m={};e.dirty=!1;let h=sr(e,t.tagWeight?{tagWeight:t.tagWeight}:void 0),g=[],_={};for(let e of h){let t=_[e._d]||0,r=(t?`${e._d}:${t}`:e._d)||e._h,i={tag:e,id:r,shouldRender:!0};e.tag===`meta`&&e._d&&Rn(e._d)&&(_[e._d]=t+1),g.push(i),e.tag===`title`?(n.title=e.textContent,o(`title:`,()=>n.title=d._t)):(i.$el=d._e.get(r),i.$el?c(i):Tn.has(e.tag)&&p.push(i))}if(p.length){let e=new Set(d._e.values());for(let t of[...n.body.children,...n.head.children]){let n=t.tagName.toLowerCase();if(!Tn.has(n)||e.has(t))continue;let r={innerHTML:t.innerHTML};for(let e of t.getAttributeNames())r[e]=t.getAttribute(e);let i=Wn({tag:n,props:{}},r);i.key=t.getAttribute(`data-hid`)||void 0;let a=zn(i)||Bn(i),o=a,s=1;for(;d._e.has(o);)o=`${a}:${s++}`;d._e.set(o,t)}}for(let e of p){let t=d._e.get(e.id);e.$el=t||n.createElement(e.tag.tag),c(e),t||(m[e.tag.tagPosition||`head`]??=n.createDocumentFragment()).appendChild(e.$el)}m.head&&n.head.appendChild(m.head),m.bodyOpen&&n.body.insertBefore(m.bodyOpen,n.body.firstChild),m.bodyClose&&n.body.appendChild(m.bodyClose);for(let e in f)f[e]();e._dom=d,a=!0,Z(e,`dom:rendered`,{renders:g})}catch(t){throw e.dirty=!0,t}finally{e._du=!1}return a&&(e.dirty||ur(e))&&fr(e,t),a}var pr=e=>typeof e.tagPriority==`number`?e.tagPriority:100+(jn[e.tagPriority]||0);function mr(e={}){e.document=e.document||(typeof window<`u`?document:void 0);let t=e.render||lr({document:e.document}),n=Fn(Sn(t,{document:e.document,propResolvers:e.propResolvers,_tagWeight:pr,init:[]}),Pn(e.hooks),t);return e.plugins?.forEach(e=>n.use(e)),e.init?.forEach(e=>e&&n.push(e)),n}var hr=`usehead`;function gr(){if(v()){let e=B(hr);if(e)return e}throw Error(`useHead() was called without provide context, ensure you call it through the setup() function.`)}function _r(e){return{install(t){t.config.globalProperties.$unhead=e,t.config.globalProperties.$head=e,t.provide(hr,e)}}.install}function vr(e,t){return t&&typeof e==`function`&&(e.key=t),e}var yr=/\\/g,br=/</g,xr=/"/g,Sr=/%\w+(?:\.\w+)?/g,Cr=`%separator`;function wr(e,t,n=!1){let r;if(t===`s`||t===`pageTitle`)r=e.pageTitle;else if(t.includes(`.`)){let n=t.indexOf(`.`);r=e[t.substring(0,n)]?.[t.substring(n+1)]}else r=e[t];if(r!==void 0)return n?(r||``).replace(yr,`\\\\`).replace(br,`\\u003C`).replace(xr,`\\"`):r||``}function Tr(e,t,n,r=!1){if(typeof e!=`string`||!e.includes(`%`))return e;let i=e;try{i=decodeURI(e)}catch{}let a=i.match(Sr);if(!a)return e;let o=e.includes(Cr);return e=e.replace(Sr,e=>{if(e===Cr||!a.includes(e))return e;let n=wr(t,e.slice(1),r);return n===void 0?e:n}).trim(),o&&(e=e.split(Cr).map(e=>e.trim()).filter(e=>e!==``).join(n?` ${n} `:` `)),e}var Er=(e,t)=>e._w===t._w?e._p-t._p:e._w-t._w,Dr=e=>e.includes(`:key`)?e:e.split(`:`).join(`:key:`),Or=vr({key:`aliasSorting`,hooks:{"tags:resolve":e=>{let t=!1;for(let n of e.tags){let r=n.tagPriority;if(!r)continue;let i=String(r);if(i.startsWith(`before:`)){let r=Dr(i.slice(7)),a=e.tagMap.get(r);a&&(typeof a.tagPriority==`number`&&(n.tagPriority=a.tagPriority),n._p=a._p-1,t=!0)}else if(i.startsWith(`after:`)){let r=Dr(i.slice(6)),a=e.tagMap.get(r);a&&(typeof a.tagPriority==`number`&&(n.tagPriority=a.tagPriority),n._p=a._p+1,t=!0)}}t&&(e.tags=e.tags.sort(Er))}}}),kr=vr({key:`deprecations`,hooks:{"entries:normalize":({tags:e})=>{for(let t of e)t.props.children&&(t.innerHTML=t.props.children,delete t.props.children),t.props.hid&&(t.key=t.props.hid,delete t.props.hid),t.props.vmid&&(t.key=t.props.vmid,delete t.props.vmid),`body`in t.props&&(t.props.body&&(t.tagPosition=`bodyClose`),delete t.props.body),t.props.renderPriority!=null&&(t.tagPriority=t.props.renderPriority,delete t.props.renderPriority)}}});function Q(e){return typeof e?.then==`function`}var Ar=256;function jr(e,t){if(t===e.length)return;if(t===Ar){let n=Array(e.length),r=!1;for(;t<e.length;t++){let i=$(e[t]);n[t]=i,r||=Q(i)}return r?n:void 0}let n=$(e[t]);if(Q(n)){let r=Array(e.length);r[t]=n;for(let n=t+1;n<e.length;n++)r[n]=$(e[n]);return r}let r=jr(e,t+1);return r&&(r[t]=n),r}function Mr(e,t,n){if(n===t.length)return;if(n===Ar){let r=Array(t.length),i=!1;for(;n<t.length;n++){let a=$(e[t[n]]);r[n]=a,i||=Q(a)}return i?r:void 0}let r=$(e[t[n]]);if(Q(r)){let i=Array(t.length);i[n]=r;for(let r=n+1;r<t.length;r++)i[r]=$(e[t[r]]);return i}let i=Mr(e,t,n+1);return i&&(i[n]=r),i}function $(e){if(typeof e==`function`)return e;if(Q(e))return Promise.resolve(e).then($);if(Array.isArray(e)){let t=jr(e,0);return t?Promise.all(t):e}if(e?.constructor===Object){let t=Object.keys(e),n=Mr(e,t,0);if(n)return Promise.all(n).then(e=>Object.fromEntries(t.map((t,n)=>[t,e[n]])))}return e}var Nr=vr(e=>{let t=new WeakMap;return{key:`promises`,hooks:{"entries:resolve":n=>{for(let r=n.entries.length-1;r>=0;r--){let i=n.entries[r],a=i.input;if(t.get(i)===a){n.entries.splice(r,1);continue}let o=$(a);Q(o)?(t.set(i,a),n.entries.splice(r,1),Promise.resolve(o).then(n=>{t.get(i)===a&&(t.delete(i),i.input=n,delete i._tags,e.invalidate?.())},()=>{t.get(i)===a&&t.delete(i)})):t.delete(i)}}}}},`promises`),Pr={meta:`content`,link:`href`,htmlAttrs:`lang`},Fr=[`innerHTML`,`textContent`];function Ir(e,t,n,r=!1){return typeof e==`string`&&e.includes(`%`)?Tr(e,t,n,r):e}var Lr=vr(e=>({key:`template-params`,hooks:{"tags:resolve":({tagMap:t,tags:n})=>{let r=t.get(`templateParams`)?.props||{},i=r.separator||`|`;delete r.separator,r.pageTitle=Ir(r.pageTitle||e._title||``,r,i);for(let e of n){if(e.processTemplateParams===!1)continue;let t=Pr[e.tag];if(t&&typeof e.props[t]==`string`)e.props[t]=Ir(e.props[t],r,i);else if(e.processTemplateParams||e.tag===`titleTemplate`||e.tag===`title`)for(let t of Fr)typeof e[t]==`string`&&(e[t]=Ir(e[t],r,i,e.tag===`script`&&typeof e.props.type==`string`&&e.props.type.endsWith(`json`)))}e._templateParams=r,e._separator=i},"tags:afterResolve":({tagMap:t})=>{let n=t.get(`title`);n?.textContent&&n.processTemplateParams!==!1&&(n.textContent=Ir(n.textContent,e._templateParams,e._separator))}}}),`template-params`),Rr=Object.assign((e,t)=>M(t)?i(t):t,{_static:!0});function zr(e,t={}){let n=t.head||gr();return n.ssr?n.push(e||{},t):Br(n,e,t)}function Br(e,t,n={}){let r=ie();if(r&&!r.active)return{patch(){},dispose(){},_i:-1};let i=_e(!1);if(n.onRendered&&r){let e=n.onRendered;n={...n,onRendered:t=>r.run(()=>e(t))}}let a;return pe(()=>{let r=i.value?{}:Vn(t,Rr);a?a.patch(r):a=e.push(r,n)}),s()&&(d(()=>{a.dispose()}),ue(()=>{i.value=!0}),te(()=>{i.value=!1})),a}function Vr(e={}){let t=lr(),n,r=0;return n=mr({render:()=>{let e=++r;setTimeout(()=>{e===r&&t(n)},0)},...e}),n.install=_r(n),n}var Hr={disableDefaults:!0,plugins:[kr,Nr,Lr,Or]},Ur=L({name:`nuxt:head`,enforce:`pre`,setup(e){bn(e,Vr(Hr))}}),Wr=/(:\w+)\([^)]+\)/g,Gr=/(:\w+)[?+*]/g,Kr=/:\w+/g,qr=(e,t)=>t.path.replace(Wr,`$1`).replace(Gr,`$1`).replace(Kr,t=>e.params[t.slice(1)]?.toString()||``),Jr=(e,t)=>{let n=e.route.matched.find(t=>t.components?.default===e.Component.type),r=t??n?.meta.key??(n&&qr(e.route,n));return typeof r==`function`?r(e.route):r},Yr=(e,t)=>({default:()=>e?p(ge,e===!0?{}:e,t):t});function Xr(e){return Array.isArray(e)?e:[e]}var Zr=()=>({}),Qr=()=>location.protocol+`//`+location.host;function $r(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),Ke(n,``)}return Ke(n,e)+r+i}function ei(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=$r(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:`pop`,direction:u?u>0?`forward`:`back`:``})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){let{history:e}=window;e.state&&e.replaceState(U({},e.state,{scroll:Ye()}),``)}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),{pauseListeners:c,listen:l,destroy:d}}function ti(e,t,n,r=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:null}}function ni(e){let{history:t,location:n}=window,r={value:$r(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:Qr()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){let o=U({},t.state,ti(i.value.back,e,i.value.forward,!0),n,{position:i.value.position});a(e,o,!0),Oe(o.position,!0),r.value=e}function s(e,n){let o=U({},i.value,t.state,{forward:e,scroll:Ye()});a(o.current,o,!0),a(e,U({},ti(r.value,e,null),{position:o.position+1},n),!1),Oe(o.position),r.value=e}return{location:r,state:i,push:s,replace:o}}function ri(e){e=Ie(e);let t=ni(e),n=ei(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=U({location:``,base:e,go:r,createHref:Et.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}var ii={type:0,value:``},ai=/[a-zA-Z0-9_]/;function oi(e){if(!e)return[[]];if(e===`/`)return[[ii]];if(!Ne(e))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===0?a.push({type:0,value:l}):n===1||n===2||n===3?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;)switch(c=e[s++],n){case 0:c===`\\`?(r=n,n=4):c===`/`?(l&&d(),o()):c===`:`?(d(),n=1):f();break;case 4:f(),n=r;break;case 1:c===`(`?n=2:ai.test(c)?f():(d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case 2:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=3:u+=c;break;case 3:d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`)}return n===2&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}var si=`[^/]+?`,ci={sensitive:!1,strict:!1,start:!0,end:!0},li=/[.+*?^${}()[\]/\\]/g;function ui(e,t){let n=U({},ci,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[90];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=40+(n.sensitive?.25:0);if(o.type===0)r||(i+=`/`),i+=o.value.replace(li,`\\$&`),s+=40;else if(o.type===1){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||si;if(u!==si){s+=10;try{RegExp(`(${u})`)}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=20,c&&(s+=-8),n&&(s+=-20),u===`.*`&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===0)n+=e.value;else if(e.type===1){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if(vt(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=vt(c)?c.join(`/`):c;if(!l){if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`)}n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function di(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function fi(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=di(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(pi(r))return 1;if(pi(i))return-1}return i.length-r.length}function pi(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}var mi={strict:!1,end:!0,sensitive:!1};function hi(e,t,n){let r=ui(oi(e.path),n),i=U(r,{record:e,parent:t,children:[],alias:[]});return t&&!i.record.aliasOf==!t.record.aliasOf&&t.children.push(i),i}function gi(e,t){let n=[],r=new Map;t=qe(mi,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=vi(e);s.aliasOf=r&&r.record;let l=qe(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(vi(U({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&!Ne(u)){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=hi(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!bi(d)&&o(e.name)),wi(d)&&c(d),s.children){let e=s.children;for(let t=0;t<e.length;t++)a(e[t],d,r&&r.children[t])}r||=d}return f?()=>{o(f)}:W}function o(e){if(dt(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=Si(e,n);n.splice(t,0,e),e.record.name&&!bi(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw Ae(1,{location:e});s=i.record.name,a=U(_i(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&_i(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name,i.keys.forEach(e=>{e.optional&&!a[e.name]&&delete a[e.name]}));else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw Ae(1,{location:e,currentLocation:t});s=i.record.name,a=U({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:xi(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function _i(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function vi(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:yi(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function yi(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function bi(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function xi(e){return e.reduce((e,t)=>U(e,t.meta),{})}function Si(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;fi(e,t[i])<0?r=i:n=i+1}let i=Ci(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function Ci(e){let t=e;for(;t=t.parent;)if(wi(t)&&fi(e,t)===0)return t}function wi({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ti(e){let t=B(Ce),n=B(ze),i=r(()=>{let n=z(e.to);return t.resolve(n)}),a=r(()=>{let{matched:e}=i.value,{length:t}=e,r=e[t-1],a=n.matched;if(!r||!a.length)return-1;let o=a.findIndex(Fe.bind(null,r));if(o>-1)return o;let s=Ai(e[t-2]);return t>1&&Ai(r)===s&&a[a.length-1].path!==s?a.findIndex(Fe.bind(null,e[t-2])):o}),o=r(()=>a.value>-1&&ki(n.params,i.value.params)),s=r(()=>a.value>-1&&a.value===n.matched.length-1&&ut(n.params,i.value.params));function c(n={}){if(Oi(n)){let n=t[z(e.replace)?`replace`:`push`](z(e.to)).catch(W);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:i,href:r(()=>i.value.href),isActive:o,isExactActive:s,navigate:c}}function Ei(e){return e.length===1?e[0]:e}var Di=g({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:Ti,setup(e,{slots:t}){let n=ae(Ti(e)),{options:i}=B(Ce),a=r(()=>({[ji(e.activeClass,i.linkActiveClass,`router-link-active`)]:n.isActive,[ji(e.exactActiveClass,i.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&Ei(t.default(n));return e.custom?r:p(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:a.value},r)}}});function Oi(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(e.button===void 0||e.button===0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function ki(e,t){for(let n in t){let r=t[n],i=e[n];if(vt(r)){if(!vt(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}else if(r!==i)return!1}return!0}function Ai(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var ji=(e,t,n)=>e??t??n,Mi=g({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){let i=B(at),a=r(()=>e.route||i.value),o=B(mt,0),c=r(()=>{let e=z(o),{matched:t}=a.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),l=r(()=>a.value.matched[c.value]);_(mt,r(()=>c.value+1)),_(Je,l),_(at,a);let u=new Set;_(wt,u);let d=_e(),f=G,{app:m}=s().appContext;return P(()=>[d.value,l.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!Fe(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let r=a.value,i=e.name,o=l.value,s=o&&o.components[i];if(!s)return Ni(n.default,{Component:s,route:r});let c=o.props[i],h=c?c===!0?r.params:typeof c==`function`?c(r):c:null,g=e=>{e.component.isUnmounted&&(o.instances[i]=null)},_=e=>ee(()=>{if(f===r||a.value!==r||e.el.getRootNode()!==m._container.getRootNode())return;let t=f;f=r;for(let e of u)e(r,t)}),v=p(s,U({},h,t,{onVnodeUnmounted:g,onVnodeMounted:_,onVnodeUpdated:_,ref:d}));return Ni(n.default,{Component:v,route:r})||v}}});function Ni(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var Pi=Mi;function Fi(e){let t=e.matcher||gi(e.routes,e),n=e.parseQuery||ke,r=e.stringifyQuery||Pt,i=e.history,a=je(),o=je(),s=je(),c=re(G),l=re(0),u=G;Le&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let d=Ge.bind(null,e=>``+e),f=Ge.bind(null,At),p=Ge.bind(null,Mt);function m(e,n){let r,i;dt(e)?(r=t.getRecordMatcher(e),i=n):i=e;let a=t.addRoute(i,r);return l.value++,()=>{a(),l.value++}}function h(e){let n=t.getRecordMatcher(e);n&&(t.removeRoute(n),l.value++)}function g(){t.clearRoutes(),l.value++}function _(){return t.getRoutes().map(e=>e.record)}function v(e){return!!t.getRecordMatcher(e)}function y(e,a){if(l.value,typeof e==`string`){a||=e.startsWith(`/`)?G:c.value;let r=Me(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return U(r,o,{params:p(o.params),redirectedFrom:void 0,href:s})}a=U({},a||(e.path!=null&&e.path.startsWith(`/`)&&!(`name`in e&&e.name)?G:c.value));let o;if(e.path!=null)o=U({},e,{path:Me(n,e.path,a.path).path});else{let t=U({},e.params);for(let e in t)t[e]??delete t[e];o=U({},e,{params:f(t)}),a.params=f(a.params)}let s=t.resolve(o,a),u=e.hash||``;s.params=d(p(s.params));let m=Te(r,U({},e,{hash:$e(u),path:s.path})),h=i.createHref(m);return U({fullPath:m,hash:u,query:r===Pt?Re(e.query):e.query||{}},s,{redirectedFrom:void 0,href:h})}function b(e){return typeof e==`string`?Me(n,e,c.value.path):U({},e)}function x(e,t){if(u!==e)return Ae(8,{from:t,to:e})}function te(e){return w(e)}function S(e){return te(U(b(e),{replace:!0}))}function C(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=b(i):{path:i},i.params={}),U({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function w(e,t){let n=u=y(e),i=c.value,a=e.state,o=e.force,s=e.replace===!0,l=C(n,i);if(l)return w(U(b(l),{state:typeof l==`object`?U({},a,l.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&we(r,i,n)&&(f=Ae(16,{to:d,from:i}),ce(i,i,!0,!1)),(f?Promise.resolve(f):ne(d,i)).catch(e=>H(e)?H(e,2)?e:M(e):j(e,d,i)).then(e=>{if(e){if(H(e,2))return w(U({replace:s},b(e.to),{state:typeof e.to==`object`?U({},a,e.to.state):a,force:o}),t||d)}else e=O(d,i,!0,s,a);return D(d,i,e),e})}function T(e,t){let n=x(e,t);return n?Promise.reject(n):Promise.resolve()}function E(e){let t=P.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function ne(e,t){let n,[r,i,s]=Ve(e,t);n=Ee(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(V(r,e,t))});let c=T.bind(null,e,t);return n.push(c),I(n).then(()=>{n=[];for(let r of a.list())n.push(V(r,e,t));return n.push(c),I(n)}).then(()=>{n=Ee(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(V(r,e,t))});return n.push(c),I(n)}).then(()=>{n=[];for(let r of s)if(r.beforeEnter){if(vt(r.beforeEnter))for(let i of r.beforeEnter)n.push(V(i,e,t));else n.push(V(r.beforeEnter,e,t))}return n.push(c),I(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Ee(s,`beforeRouteEnter`,e,t,E),n.push(c),I(n))).then(()=>{n=[];for(let r of o.list())n.push(V(r,e,t));return n.push(c),I(n)}).catch(e=>H(e,8)?e:Promise.reject(e))}function D(e,t,n){s.list().forEach(r=>E(()=>r(e,t,n)))}function O(e,t,n,r,a){let o=x(e,t);if(o)return o;let s=t===G,l=Le?history.state:{};n&&(r||s?i.replace(e.fullPath,U({scroll:s&&l&&l.scroll},a)):i.push(e.fullPath,a)),c.value=e,ce(e,t,n,s),M()}let k;function ie(){k||=i.listen((e,t,n)=>{if(!F.listening)return;let r=y(e),a=C(r,F.currentRoute.value);if(a){w(U(a,{replace:!0,force:!0}),r).catch(W);return}u=r;let o=c.value;Le&&n.delta&&Pe(Ue(o.fullPath,n.delta)),ne(r,o).catch(e=>H(e,12)?e:H(e,2)?(w(U(b(e.to),{force:!0}),r).then(e=>{H(e,20)&&!n.delta&&n.type===`pop`&&i.go(-1,!1)}).catch(W),Promise.reject()):(n.delta&&i.go(-n.delta,!1),j(e,r,o))).then(e=>{e||=O(r,o,!1),e&&(n.delta&&!H(e,8)?i.go(-n.delta,!1):n.type===`pop`&&H(e,20)&&i.go(-1,!1)),D(r,o,e)}).catch(W)})}let ae=je(),oe=je(),A;function j(e,t,n){M(e);let r=oe.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function se(){return A&&c.value!==G?Promise.resolve():new Promise((e,t)=>{ae.add([e,t])})}function M(e){return A||(A=!e,ie(),ae.list().forEach(([t,n])=>e?n(e):t()),ae.reset()),e}function ce(t,n,r,i){let{scrollBehavior:a}=e;if(!Le||!a)return Promise.resolve();let o=!r&&Ot(Ue(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return ee().then(()=>a(t,n,o)).then(e=>t===c.value&&e&&Be(e)).catch(e=>t===c.value&&j(e,t,n))}let le=e=>i.go(e),N,P=new Set,F={currentRoute:c,listening:!0,addRoute:m,removeRoute:h,clearRoutes:g,hasRoute:v,getRoutes:_,resolve:y,options:e,push:te,replace:S,go:le,back:()=>le(-1),forward:()=>le(1),beforeEach:a.add,beforeResolve:o.add,afterEach:s.add,onError:oe.add,isReady:se,install(e){e.component(`RouterLink`,Di),e.component(`RouterView`,Pi),e.config.globalProperties.$router=F,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>z(c)}),Le&&!N&&c.value===G&&(N=!0,te(i.location).catch(e=>{}));let t={};for(let e in G)Object.defineProperty(t,e,{get:()=>c.value[e],enumerable:!0});e.provide(Ce,F),e.provide(ze,ye(t)),e.provide(at,c);let n=e.unmount;P.add(e),e.unmount=function(){P.delete(e),P.size<1&&(u=G,k&&k(),k=null,c.value=G,N=!1,A=!1),n()}}};function I(e){return e.reduce((e,t)=>e.then(()=>E(t)),Promise.resolve())}return F}var Ii=nt(async e=>{if(!e.meta?.validate)return;let t=await Promise.resolve(e.meta.validate(e));if(t!==!0)return K({fatal:!0,status:t&&(t.status||t.statusCode)||404,statusText:t&&(t.statusText||t.statusMessage)||`Page Not Found: ${e.fullPath}`,data:{path:e.fullPath}})}),Li=e({docsBase:w,reporters:C}),Ri=yn;function zi(e){return Zr(e)}var Bi;function Vi(){let e;return e=Ri(_n(`builds/meta/${N().app.buildId}.json`),{responseType:`json`}).then(e=>{if(!e||typeof e!=`object`||!Array.isArray(e.prerendered))throw Li.NUXT_E5004();return e}),Bi=e,e.catch(t=>{Bi===e&&(Bi=void 0),Li.NUXT_E5002({cause:t})}),e}function Hi(){return Bi||Vi()}function Ui(e){let t=typeof e==`string`?e:e.path;try{return zi(t)}catch(e){return Li.NUXT_E5003({path:t,cause:e}),{}}}var Wi=[Ii,nt(e=>{let t=Ui({path:e.path});if(t.redirect){let n=t.redirect.includes(`#`)?t.redirect:t.redirect+e.hash;return pt(n)?(window.location.href=n,!1):n}})],Gi={},Ki=[`install`,`website`,`readings`],qi=Object.assign({"../../content/docs/en/install.md":()=>X(()=>import(`./DLl_pn_F.js`).then(e=>e.default),[],import.meta.url),"../../content/docs/en/readings.md":()=>X(()=>import(`./Dz56DRZ7.js`).then(e=>e.default),[],import.meta.url),"../../content/docs/en/website.md":()=>X(()=>import(`./DT7XmrQw.js`).then(e=>e.default),[],import.meta.url)});function Ji(e,t){return(qi[`../../content/docs/${t}/${e}.md`]??qi[`../../content/docs/en/${e}.md`])()}var Yi={validate:e=>Ki.some(t=>t===e.params.slug)},Xi={redirect:`/docs/${Ki[0]}`},Zi=[{name:`customize`,path:`/customize`,component:()=>X(()=>import(`./nNFr3PcB.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)},{name:void 0,path:`/docs`,component:()=>X(()=>import(`./DSYkQlQa.js`),__vite__mapDeps([10,1,2,9,3,11]),import.meta.url),children:[{name:`docs-slug`,path:`:slug()`,meta:Yi||{},component:()=>X(()=>import(`./DTC_KzWZ.js`),__vite__mapDeps([12,2,1,9,3,5,6,13]),import.meta.url)},{name:`docs`,path:``,redirect:Xi?.redirect,component:()=>X(()=>import(`./HB7Qu17x.js`),__vite__mapDeps([14,1,2,13]),import.meta.url)}]},{name:`reference`,path:`/reference`,component:()=>X(()=>import(`./DGhFAXuQ.js`),__vite__mapDeps([15,1,2,3,5,11,7,6]),import.meta.url)},{name:`index`,path:`/`,component:()=>X(()=>import(`./nQF5Cd64.js`),__vite__mapDeps([16,1,2,9,3,5,6,11,7,8]),import.meta.url)}],Qi=/\/(?=$|[?#])/;function $i(e,t,n){let{pathname:r,search:i,hash:a}=t,o=e.indexOf(`#`);if(o>-1){let t=a.includes(e.slice(o))?e.slice(o).length:1,n=a.slice(t);return n[0]!==`/`&&(n=`/`+n),We(n,``)}let s=We(r,e),c=!n||Nt(s,n)?s:n;return c+(c.includes(`?`)?``:i)+a}var ea=L({name:`nuxt:router`,enforce:`pre`,async setup(e){let t=N().app.baseURL,n=q.history?.(t)??ri(t),r=q.routes?await q.routes(Zi)??Zi:Zi,i,a=Fi({...q,scrollBehavior:(e,t,n)=>{if(t===G)i=n;else if(q.scrollBehavior){if(a.options.scrollBehavior=q.scrollBehavior,`scrollRestoration`in window.history){let e=a.beforeEach(()=>{e(),window.history.scrollRestoration=`manual`})}return q.scrollBehavior(e,G,i||n)}},history:n,routes:r});`scrollRestoration`in window.history&&(window.history.scrollRestoration=`auto`),e.vueApp.use(a);let o=re(a.currentRoute.value);a.afterEach((e,t)=>{o.value=t}),Object.defineProperty(e.vueApp.config.globalProperties,"previousRoute",{get:()=>o.value});let s=$i(t,window.location,e.payload.path),c=We(window.location.pathname,t),l=re(a.currentRoute.value),u=()=>{l.value=a.currentRoute.value};a.afterEach((e,t)=>{let n=e.matched.at(-1)?.components?.default,r=t.matched.at(-1)?.components?.default;n===r?Jr({route:e,Component:{type:n}})===Jr({route:t,Component:{type:r}})&&u():e.matched.length<t.matched.length&&e.matched.every((e,n)=>e.components?.default===t.matched[n]?.components?.default)&&u()});let d={sync:u};for(let e in l.value)Object.defineProperty(d,e,{get:()=>l.value[e],enumerable:!0});e._route=ye(d),e._middleware||={global:[],named:{}};let f=St();a.afterEach(async(t,n,r)=>{delete e._processingMiddleware,!e.isHydrating&&f.value&&await e.runWithContext(Qe),r&&await e.callHook(`page:loading:end`)}),a.onError(async()=>{delete e._processingMiddleware,await e.callHook(`page:loading:end`)});try{await a.isReady()}catch(t){await lt(e,t)}let p=s===a.currentRoute.value.fullPath?a.currentRoute.value:a.resolve(s),m=a.currentRoute.value.fullPath,h=e.isHydrating&&e.payload.prerenderedAt&&e.payload.path&&s.replace(Qi,``)!==e.payload.path.replace(Qi,``)&&Nt(a.currentRoute.value.path,e.payload.path);u();function g(r){!e.isHydrating&&r.fullPath!==$i(t,window.location)&&n.push(r.fullPath)}a.beforeEach(t=>{if(!e.isHydrating&&Zr(t.path).noScripts)return window.location.assign(a.resolve(t.fullPath).href),!1}),a.beforeResolve(e=>{if(e.matched.length||Nt(e.path,c))return;let n=new URL(De(e.fullPath,t),window.location.href);if(n.origin===window.location.origin)return window.location.assign(n),!1});let _=e.payload.state._layout;return a.beforeEach(async(t,n)=>{await e.callHook(`page:loading:start`),t.meta=ae(t.meta),e.isHydrating&&_&&!I(t.meta.layout)&&(t.meta.layout=_),e._processingMiddleware=!0;{let r=new Set([...Wi,...e._middleware.global]);for(let e of t.matched){let t=e.meta.middleware;if(t)for(let e of Xr(t))r.add(e)}let i=Ui({path:t.path});if(i.appMiddleware)for(let e in i.appMiddleware)i.appMiddleware[e]?r.add(e):r.delete(e);for(let i of r){let r=typeof i==`string`?e._middleware.named[i]||await Gi[i]?.().then(e=>e.default||e):i;if(!r)throw it.NUXT_E2004({entry:String(i),validMiddleware:void 0});try{let i=await e.runWithContext(()=>r(t,n));if(!e.payload.serverRendered&&e.isHydrating&&(i===!1||i instanceof Error)){let t=i||K({status:404,statusText:`Page Not Found: ${s}`});return await e.runWithContext(()=>J(t)),!1}if(i===!0)continue;if(i===!1)return i;if(i)return Xe(i)&&i.fatal&&(await e.runWithContext(()=>J(i)),g(t)),i}catch(n){let r=K(n);return r.fatal&&(await e.runWithContext(()=>J(r)),g(t)),r}}}}),a.afterEach(t=>{if(t.matched.length===0&&!f.value)return e.runWithContext(()=>J(K({status:404,fatal:!1,statusText:`Page not found: ${t.fullPath}`,data:{path:t.fullPath}})))}),e.hooks.hookOnce(`app:created`,async()=>{try{if(`name`in p&&(p.name=void 0),a.currentRoute.value.fullPath===m){if(h){let t=a.resolve(e.payload.path);`name`in t&&(t.name=void 0),await a.replace({...t,force:!0});let n=()=>{e[`~restoreDeferredRoute`]&&(e[`~restoreDeferredRoute`]=void 0,a.currentRoute.value=a.resolve(s),u(),a.replace({...p,force:!0}).catch(()=>{}))};e[`~restoreDeferredRoute`]=n,e.hooks.hookOnce(`app:suspense:resolve`,n)}else await a.replace({...p,force:!0})}a.options.scrollBehavior=q.scrollBehavior}catch(t){await lt(e,t)}}),{provide:{router:a}}}}),ta=L(()=>{let e=Y();xt(()=>{e.beforeResolve(async()=>{await new Promise(e=>{setTimeout(e,100),requestAnimationFrame(()=>{setTimeout(e,0)})})})})}),na=L(e=>{let t;async function n(){let r;try{r=await Hi()}catch(e){let t=e;if(!(`status`in t&&(t.status===404||t.status===403)))throw t}t&&clearTimeout(t),t=setTimeout(n,k);try{let n=await yn(_n(`builds/latest.json`)+`?${Date.now()}`);n.id!==r?.id&&(e.hooks.callHook(`app:manifest:update`,n),t&&clearTimeout(t))}catch{}}xt(()=>{t=setTimeout(n,k)})});function ra(e={}){let t=e.path||window.location.pathname,n=new URL(t,window.location.href);if(n.host!==window.location.host)throw it.NUXT_E2010({path:t});if(n.protocol&&et(n.protocol))throw it.NUXT_E2002({toPath:t,protocol:n.protocol});let r={};try{r=JSON.parse(sessionStorage.getItem(`nuxt:reload`)||`{}`)}catch{}if(e.force||r?.path!==t||r?.expires<Date.now()){try{sessionStorage.setItem(`nuxt:reload`,JSON.stringify({path:t,expires:Date.now()+(e.ttl??1e4)}))}catch{}if(e.persistState)try{sessionStorage.setItem(`nuxt:reload:state`,JSON.stringify({state:D().payload.state}))}catch{}window.location.pathname===t?window.location.reload():window.location.href=t}}var ia=L({name:`nuxt:chunk-reload-crawler`,setup(e){let t=!0;e.hooks.hookOnce(`app:suspense:resolve`,()=>{t=!1}),e.hook(`app:chunkError`,()=>{t&&ct(navigator.userAgent)&&ra()})}}),aa=L({name:`nuxt:chunk-reload`,setup(e){let t=Y(),n=N(),r=new Set;t.beforeEach(()=>{r.clear()}),e.hook(`app:chunkError`,({error:e})=>{r.add(e)});function i(e){ra({path:He(n.app.baseURL,e.fullPath),persistState:!0})}e.hook(`app:manifest:update`,()=>{t.beforeResolve(i)}),t.onError((e,t)=>{r.has(e)&&i(t)})}}),oa=L({name:`nuxt:island-link-navigation`,setup(e){}}),sa=L({name:`nuxt:global-components`}),ca={},la=[`route`,`payload`,`island`,`hint`],ua=12,da={route:8,payload:8,island:4,hint:8};function fa(e={}){let t={...da,...e.concurrency},n=e.total??ua,r=e.canPrefetch,i=e.defer,a={route:[],payload:[],island:[],hint:[]},o=la.map(e=>a[e]),s=new WeakSet,c=new Map,l={route:0,payload:0,island:0,hint:0},u=0,d=new Map,f=new AbortController,p=new AbortController;p.abort();function m(e){c.get(e.key)===e&&c.delete(e.key)}function h(e){m(e),Promise.resolve().then(()=>e.run(p.signal,!1)).catch(()=>{})}function g(){if(!r||r())for(;u<n;){let e=la.find(e=>a[e].length&&l[e]<t[e]);if(!e)return;let n=a[e].shift();_(n,s.delete(n))}}function _(e,t){let n=e.scope===`app`?f:new AbortController;e.scope===`navigation`&&d.set(e,n),l[e.priority]++,u++;let r=!1,a=()=>{r||(r=!0,l[e.priority]--,u--,d.delete(e),m(e),g())};n.signal.addEventListener(`abort`,a,{once:!0});let o=()=>Promise.resolve().then(()=>e.run(n.signal,t)).then(a,a);i?i(o,t,e.priority):o()}let v=(e,t)=>t!==void 0&&e.group===t&&e.priority!==`hint`;return{schedule(e){let t=[];for(let n of Array.isArray(e)?e:[e])c.has(n.key)?h(n):(c.set(n.key,n),t.push(n));for(let e=t.length-1;e>=0;e--)a[t[e].priority].unshift(t[e]);g()},promote(e){for(let t of o){let n=[],r=[];for(let i of t)i.group===e&&s.add(i),(i.group===e?n:r).push(i);t.length=0,t.push(...n,...r)}g()},reset(e){for(let t of o)for(let n=t.length-1;n>=0;n--){let r=t[n];r.scope===`navigation`&&!v(r,e)&&(t.splice(n,1),h(r))}for(let[t,n]of[...d])v(t,e)||n.abort();g()},resume:g}}var pa=1e3;function ma(e,t,n){if(t||n===`route`)return e();let r=globalThis.scheduler;r?.postTask?r.postTask(e,{priority:`background`}).catch(()=>{}):tt(e,{timeout:pa})}function ha(e=D()){if(e._prefetch)return e._prefetch;let t=!1,n=fa({canPrefetch:()=>Ze()&&!t&&document.visibilityState!==`hidden`,defer:ma});e._prefetch=n,navigator.connection?.addEventListener?.(`change`,()=>n.resume()),document.addEventListener(`visibilitychange`,()=>n.resume());let r=e.$router;return r.beforeEach(()=>{t=!0}),r.afterEach(e=>{t=!1,n.reset(ht(e.fullPath))}),r.onError(()=>{t=!1,n.resume()}),n}var ga=L({name:`nuxt:prefetch`,setup(e){let t=Y();e.hooks.hook(`app:mounted`,()=>{t.beforeEach(async e=>{let t=e?.meta?.layout;typeof t==`string`&&t in ca&&await yt(ca[t])})});let{schedule:n}=ha(e);e.hooks.hook(`link:prefetch`,async e=>{if(Dt(e))return;let r=t.resolve(e);if(!r)return;let i=r.meta.layout,a=Xr(r.meta.middleware).filter(e=>typeof e==`string`);n({key:`route:chunks:${e}`,priority:`route`,scope:`navigation`,group:ht(e),run:e=>{if(e.aborted)return;let t=[];for(let e of a){let n=Gi[e];typeof n==`function`&&t.push(n())}return typeof i==`string`&&i in ca&&t.push(yt(ca[i])),Promise.all(t).catch(()=>{})}})})}}),_a=L(()=>{}),va=e({docsBase:w,reporters:C});function ya(e){let t=e||D();return t.ssrContext?.head||t.runWithContext(()=>{if(v()){let e=B(`usehead`);if(!e)throw va.NUXT_E6001();return e}})}function ba(e,t={}){return zr(e,{head:t.head||ya(t.nuxt),...t})}var xa=L(()=>{let e=N().app.baseURL;ba({style:[{key:`furifont-faces`,innerHTML:Rt.map(t=>`@font-face{font-family:"${t.family}";font-display:swap;font-weight:250 900;ascent-override:88%;descent-override:12%;line-gap-override:0%;src:url("${e}${Ft(t,`woff2`)}") format("woff2")}`).join(`
3
+ `)}]})}),Sa=[{code:`en`,name:`English`},{code:`ja`,name:`日本語`},{code:`zh-Hans`,name:`简体中文`},{code:`zh-Hant`,name:`繁體中文`}],Ca=`furifont:locale`;function wa(e){return Sa.some(t=>t.code===e)}function Ta(e){for(let t of e.map(e=>e.toLowerCase())){if(t.startsWith(`zh`))return/-(?:tw|hk|mo|hant)\b/.test(t)?`zh-Hant`:`zh-Hans`;if(t.startsWith(`ja`))return`ja`;if(t.startsWith(`en`))return`en`}return`en`}var Ea={meta:{title:`Furifont: furigana built into the font`,description:`A Japanese font that shows furigana by itself.`},nav:{demo:`Intro`,docs:`Docs`,customize:`Customize`,github:`GitHub repository`,light:`Switch to light`,dark:`Switch to dark`,language:`Language`,rubyOff:`Hide the ruby`,rubyOn:`Show the ruby`},footer:{fonts:`The fonts use the {license}. They come from Source Han Sans and Source Han Serif.`,data:`The readings come from {jmdict}, {jmnedict}, {kanjidic} (EDRDG) and {furigana}. They use the CC BY-SA 4.0 license.`,code:`The tools use the MIT license.`,source:`Source on GitHub`,made:`Made by {author}`,supported:`Supported by {vercel} and {sponsors}`,sponsors:`sponsors`},copied:`Copied`,shuffle:`Show another sample`,editable:`Sample text. You can edit it.`,scripts:{hiragana:`Hiragana`,hepburn:`Romaji`},faces:{sans:`Sans`,serif:`Serif`},hero:{title1:`Furigana,`,title2:`set by the font.`,body:`Furifont is a Japanese font that shows furigana on the font itself. With the ligatures to adopt to pronunciation of words. Works everywhere supporting custom fonts.`,download:`Download the fonts`,build:`Build your own`},notice:`Furigana might be incorrect due to the limits of fonts, so keep that in mind.`,sections:{try:`Try it`,how:`How it works`,selectors:`Choosing a reading`,download:`Download`,anyPage:`On Websites`},playground:{script:`Ruby letters`,face:`Font style`,size:`Size / {size}px`,weight:`Weight / {weight}`,ruby:`Furigana`,okurigana:`Okurigana readings`,okuriganaHint:`This requires JavaScript. Font cannot handle okurigana due to browser's limitations.`,textHint:`Click the text to edit it.`,copy:`Copy the text`},how:{build:{title:`Customized build`,body:`Furifont is compiled from a base font, Source Han Sans or Serif. A build step reads a dictionary of thousands of words and draws the ruby into new glyphs. The result is a normal font file. It needs no JavaScript and no plugin.`},ligatures:{title:`Ligatures do the work`,body:`For each word, the font holds a ligature. For example, 今日 becomes one glyph with きょう above it. The swap happens when the text is drawn, so the text itself does not change.`},longest:{title:`Longest word first`,body:`Furifont compares each group of kanji with a list of thousands of common words. It tries the longest word first. For example, it picks 日本語 before 日本. It reads 今日 as one word, きょう.`},bare:{title:`No ruby when unsure`,body:`A single kanji gets ruby only when one reading is clearly the most likely. 大人気 can be read だいにんき or おとなげ, so Furifont shows no ruby.`},okurigana:{title:`Opt-in Okurigana`,body:`Browsers shape each font script separately, so the font cannot see the kana after a kanji (which is called okurigana). We provide optional support for it through JavaScript annotation.`}},selectors:{body:`Some words have more than one common reading. Furifont shows the most common one. To choose another, put a variation selector (an invisible character) right after the first kanji. VS226 gives reading 1, VS227 gives reading 2, and so on. VS225 removes the ruby.`,lookUp:`Look up readings`,default:`Default`,reading2:`Reading 2 (VS227)`,none:`No ruby (VS225)`},downloads:{all:`Download all as zip`,family:`Family`,ruby:`Ruby`,variable:`Variable`,formats:`OTF and TTF are commonly used for installing on your computer. WOFF2 is optimized for websites. We recommend the variable fonts for the best experience. In some cases you may need the static weights for compatibility.`,buildOwn:`Or build your own font. You can choose another base font, a list with fewer or more words, other ruby letters, or other sizes.`},anyPage:{body:`You can use Furifont on any website. Lines with kanji get extra space for the ruby. If Furifont is installed on your computer, nothing downloads. If it is not, the font loads from this site.`,bookmarklet:`Bookmarklet`,bookmarkletHint:`Drag it to your bookmarks bar. On any page, click it to turn Furifont on. Click it again to turn Furifont off. Some sites, such as X and GitHub, do not let fonts load from other sites. On those sites, install Furifont on your computer.`,okurigana:`Okurigana readings`,okuriganaHint:`Picks the right reading of a kanji before its okurigana, such as 来 in 来る and 来ない.`,userscript:`Userscript`,install:`Install the userscript`,userscriptHint:`This works with Tampermonkey or Violentmonkey (browser add-ons that run small scripts). It turns Furifont on by itself on Japanese pages. It also works on sites that do not let fonts load from other sites. Its menu lets you switch to another Furifont font or turn it off.`,toast:{message:`Furifont could not load its font on this page. Some sites, such as X and GitHub, do not let fonts load from other sites. On those sites, you must install Furifont on your computer.`,download:`Download the fonts`,close:`Close`,outdated:`A newer version of Furifont is out.`,userscript:`Update the userscript`,bookmarklet:`Get the new bookmarklet`},menu:{okuriganaOn:`Okurigana readings: on`,okuriganaOff:`Okurigana readings: off`}},reference:{eyebrow:`Reference`,title:`Pick a reading`,body:`Furifont shows the most common reading of a word. To show another reading, put a variation selector (an invisible character) right after the first kanji of the word. VS226 gives reading 1, VS227 gives reading 2, and so on. After a single kanji, the selector chooses the reading of that kanji. VS225 shows the kanji with no ruby.`,search:`Search a word or kanji: 市場, 今日, 生`,searchLabel:`Search readings`,hint:`Click a reading to copy the word with its selector.`,unavailable:`The reference comes with the ready-made fonts, and it could not load here ({error}). Build the fonts with {command}, or open Customize.`,loading:`Loading`,words:`Words with several readings / {count}`,kanji:`Kanji / {count}`,copyWith:`Copy {text} with {selector}`,default:`default`},docs:{install:`Install the font`,website:`Use on your website`,readings:`Choose a reading`},customize:{connecting:`Connecting to furifont dev`,title:`Customize`,offline:{eyebrow:`Customize / offline`,title:`Build your own Furifont`,body:`Customize is a tool that runs on your computer. It reads your base fonts and saves the fonts that it builds. Start it in any folder. Then this page opens with a live preview, the dictionary, and a Build button. The new fonts go in {folder}.`,needs:`You need Node 22.18 or later (a free program that runs JavaScript tools).`,run:`Start Customize in any folder`},auth:{eyebrow:`Customize / locked`,title:`Enter the code from your terminal`,body:`{command} showed a six-digit code in your terminal (the window where you started it).`,code:`Code`,failed:`That code did not work. Check the terminal and try again.`,unlock:`Unlock`},sections:{preview:`Preview`,build:`Build`,dictionary:`Dictionary`,words:`Your words`},options:{family:`Font name`,base:`Base font`,baseHint:`The font to add ruby to. Use a font to download, such as Source Han Serif JP Bold, or the path to another font file on your computer.`,script:`Ruby letters`,hiragana:`Hiragana`,katakanaOn:`Kata on`,hepburn:`Romaji`,skip:`Skip the most common words`,skipHint:`These words get no ruby, because a reader already knows them. The newspaper word list is sorted by how often the words appear, in steps of 500 words.`,words:`Then add ruby to`,wordsHint:`The next words in the list. With the word lists below, {count} words get ruby.`,jlpt:`Skip JLPT words`,jlptHint:`Words on the JLPT lists (for the Japanese-Language Proficiency Test) up to this level get no ruby. N5 is the easiest level.`,none:`None`,sources:`Also include words from`,source:{spec1:{name:`Everyday words`,hint:`JMdict "spec1": common words that the other lists miss, such as 日本.`},ichi1:{name:`Basic words`,hint:`JMdict "ichi1": the most common words from the Ichimango list (a list of basic words).`},news1:{name:`Newspaper words`,hint:`JMdict "news1": the 12,000 words that appear most often in newspapers.`},gai1:{name:`Loanwords`,hint:`JMdict "gai1": common words that Japanese borrowed from other languages.`},places:{name:`Place names`,hint:`JMnedict: stations and places. Furifont uses them where no common word matches the text.`}},isolated:`Ruby on single kanji`,share:`Single kanji: how sure`,shareHint:`A single kanji gets ruby only when one reading makes up at least this share of its uses in the dictionary. Use a number from 0.5 to 1. A higher number gives ruby to fewer kanji.`,rubyScale:`Ruby size (× kanji)`,rubyGap:`Space above kanji (em)`,squeeze:`Narrowest squeeze (× normal)`,maxWidth:`Widest ruby (em)`,reset:`Reset to defaults`,resetHint:`Go back to the settings that Customize loaded. Your words stay.`},preview:{compiling:`Making a preview`,weight:`Preview weight`,size:`Preview size`,stats:`{glyphs} glyphs / {ms} ms`},build:{words:`Words`,places:`Places`,ambiguous:`Several readings`,lone:`Single kanji`,protected:`Your changes`,glyphs:`Ruby glyphs`,rules:`Rules`,planning:`Planning`,estimate:{woff2:`≈ {size} WOFF2`,otf:`{size} OTF`},formats:`Formats`,estimating:`Estimating the size`,run:`Build font`,save:`Save settings`},dictionary:{search:`Search the dictionary: 今日, 生`,results:`{count} words`,hint:`These words have several common readings. Pin one to make it the default reading.`,noTag:`not a common word`,restore:`Restore`,remove:`Never add ruby`},custom:{placeholder:`日[に]本[ほん] or 今日[きょう]`,label:`Word to add`,add:`Add word`,added:`Added / {count}`,pinned:`Pinned / {count}`,removed:`Never given ruby / {count}`,none:`None`,takeOut:`Remove {item}`}}},Da=Ea,Oa={en:async()=>Ea,ja:async()=>(await X(async()=>{let{default:e}=await import(`./jjE7wdAL.js`);return{default:e}},[],import.meta.url)).default,"zh-Hans":async()=>(await X(async()=>{let{default:e}=await import(`./Bs3Pv9Qv.js`);return{default:e}},[],import.meta.url)).default,"zh-Hant":async()=>(await X(async()=>{let{default:e}=await import(`./DA1XwGcq.js`);return{default:e}},[],import.meta.url)).default},ka=[Ur,ea,ta,na,ia,aa,oa,sa,ga,_a,xa,L(async e=>{let t=localStorage.getItem(Ca),n=wa(t)?t:Ta(navigator.languages);e.vueApp.use(zt({legacy:!1,locale:n,fallbackLocale:`en`,messages:{en:Da,[n]:await Oa[n]()}}))})];function Aa(e=s()){let t=e;t&&!t.sp&&(t.sp=[])}var ja={},Ma={class:`pointer-events-none absolute z-1 size-[11px] color-base`,viewBox:`0 0 11 11`,"aria-hidden":`true`};function Na(e,t){return T(),a(`svg`,Ma,[...t[0]||=[R(`path`,{d:`M5.5 0v11M0 5.5h11`,stroke:`currentColor`,"stroke-width":`1`},null,-1)]])}var Pa=Object.assign(Bt(ja,[[`render`,Na]]),{__name:`UiCross`});function Fa(){let{locale:e,availableLocales:t,setLocaleMessage:n}=It();return r({get:()=>e.value,set:async r=>{wa(r)&&(t.includes(r)||n(r,await Oa[r]()),e.value=r,localStorage.setItem(Ca,r))}})}var Ia={class:`relative flex items-center`},La=[`aria-label`],Ra=[`value`,`lang`],za=Object.assign(g({__name:`AppLanguageSelect`,setup(e){let t=Fa();return(e,n)=>(T(),a(`label`,Ia,[n[1]||=R(`span`,{class:`i-ph-translate pointer-events-none absolute left-2 text-sm color-muted`},null,-1),he(R(`select`,{"onUpdate:modelValue":n[0]||=e=>M(t)?t.value=e:null,"aria-label":e.$t(`nav.language`),class:`focus-ring no-ruby h-8 appearance-none rounded-none border border-base bg-base pl-7 pr-2 text-xs color-base transition-colors hover:border-strong`},[(T(!0),a(E,null,O(`LOCALES`in e?e.LOCALES:z(Sa),e=>(T(),a(`option`,{key:e.code,value:e.code,lang:e.code},f(e.name),9,Ra))),128))],8,La),[[be,z(t)]])]))}}),{__name:`AppLanguageSelect`}),Ba=e({docsBase:w,reporters:C}),Va=`$s`;function Ha(...e){let t=typeof e[e.length-1]==`string`?e.pop():void 0;typeof e[0]!=`string`&&e.unshift(t);let[n,r]=e;if(!n||typeof n!=`string`)throw Ba.NUXT_E7009({key:n});if(r!==void 0&&typeof r!=`function`)throw Ba.NUXT_E7007({type:typeof r});let i=Va+n,a=D(),o=y(a.payload.state,i);if(r&&(a._state[i]??={_default:r}),o.value===void 0&&r){let e=r();if(M(e))return a.payload.state[i]=e,o;o.value=e}return o}var Ua=`furifont:dark`;function Wa(){let e=Ha(`dark-mode`,()=>{let e=localStorage.getItem(Ua);return e?e===`true`:matchMedia(`(prefers-color-scheme: dark)`).matches});pe(()=>document.documentElement.classList.toggle(`dark`,e.value));function t(){e.value=!e.value,localStorage.setItem(Ua,String(e.value))}return{dark:ne(e),toggle:t}}var Ga=vn(`/logo.svg`),Ka={class:`sticky top-0 z-10 border-b border-base bg-base`},qa={class:`relative mx-auto flex h-14 max-w-6xl items-center gap-3 border-x border-base px-3 sm:gap-6 sm:px-6`},Ja={class:`flex items-center gap-1`},Ya={class:`ml-auto flex items-center gap-1`},Xa=[`href`,`aria-label`],Za=[`aria-label`],Qa=Object.assign(g({__name:`AppHeader`,setup(e){let{dark:t,toggle:n}=Wa(),r=[{to:`/`,label:`nav.demo`},{to:`/docs`,label:`nav.docs`},{to:`/customize`,label:`nav.customize`}];return(e,i)=>{let o=Pa,s=Ct,c=za;return T(),a(`header`,Ka,[R(`nav`,qa,[m(o,{class:`-bottom-[6px] -left-[6px]`}),m(o,{class:`-bottom-[6px] -right-[6px]`}),m(s,{to:`/`,class:`focus-ring flex items-center gap-2.5 font-mono text-sm font-medium`},{default:j(()=>[R(`img`,{src:Ga,alt:``,class:x([`size-6`,{invert:z(t)}]),"aria-hidden":`true`},null,2),i[1]||=R(`span`,{class:`hidden sm:inline`},`furifont`,-1)]),_:1}),R(`div`,Ja,[(T(),a(E,null,O(r,t=>m(s,{key:t.to,to:t.to,class:`focus-ring whitespace-nowrap px-1 py-1 font-mono text-xs uppercase tracking-[0.04em] color-muted transition-colors hover:color-base sm:px-2 sm:tracking-[0.12em]`,"active-class":`!color-base`},{default:j(()=>[oe(f(e.$t(t.label)),1)]),_:2},1032,[`to`])),64))]),R(`div`,Ya,[m(c),R(`a`,{href:`REPOSITORY`in e?e.REPOSITORY:z(Lt),target:`_blank`,rel:`noopener`,class:`btn-ghost focus-ring hidden w-9 px-0 sm:inline-flex`,"aria-label":e.$t(`nav.github`)},[...i[2]||=[R(`span`,{class:`i-ph-github-logo`},null,-1)]],8,Xa),R(`button`,{type:`button`,class:`btn-ghost focus-ring w-9 px-0`,"aria-label":z(t)?e.$t(`nav.light`):e.$t(`nav.dark`),onClick:i[0]||=(...e)=>z(n)&&z(n)(...e)},[R(`span`,{class:x(z(t)?`i-ph-sun`:`i-ph-moon`)},null,2)],8,Za)])])])}}}),{__name:`AppHeader`}),$a=(e=`RouteProvider`)=>g({name:e,props:{route:{type:Object,required:!0},vnode:Object,vnodeRef:Object,renderKey:String,trackRootNodes:Boolean,routeRecord:Object},setup(e){let t=e.renderKey,n=e.route,r={};for(let i in e.route)Object.defineProperty(r,i,{get:()=>t===e.renderKey?e.route[i]:n[i],enumerable:!0});return _(_t,ye(r)),()=>e.vnode?p(e.vnode,{ref:e.vnodeRef}):e.vnode}}),eo=$a(),to=new WeakMap,no=g({name:`NuxtPage`,inheritAttrs:!1,props:{name:{type:String},transition:{type:[Boolean,Object],default:void 0},keepalive:{type:[Boolean,Object],default:void 0},route:{type:Object},pageKey:{type:[Function,String],default:null}},setup(e,{attrs:t,slots:n,expose:r}){let i=D(),a=_e(),o=B(_t,null),s=new Set,c;r({pageRef:a});let l=B(st,null),u,f=i.deferHydration(),m=!1,h=!1,g,_=0;if(i.isHydrating){let e=i.hooks.hookOnce(`app:error`,f),t=Y().beforeEach(()=>{e(),t()})}e.pageKey&&P(()=>e.pageKey,(e,t)=>{e!==t&&i.callHook(`page:loading:start`)});let v=!1;{let e=Y().beforeResolve(()=>{v=!1});d(()=>{e(),f()})}return()=>p(Pi,{name:e.name,route:e.route,...t},{default:ao(t=>{let r=ro(o,t.route,t.Component),d=o&&o.matched.length===t.route.matched.length;if(!t.Component)return u&&!d&&!so(u)?u:(f(),e.transition??t.route.meta.pageTransition??!1?gt(rt([e.transition,t.route.meta.pageTransition,!1]),null).default():void 0);if(u&&l&&!so(u)&&!l.isCurrent(t.route))return u;if(r&&o&&(!l||l?.isCurrent(o)))return(d||u)&&!so(u)?u:null;let y=Jr(t,e.pageKey),b=io(o,t.route,t.Component);!i.isHydrating&&c===y&&!b&&ee(()=>{v||(v=!0,i.callHook(`page:loading:end`))}),m&&c!==y&&h&&_++,c=y;let x=!!(e.transition??t.route.meta.pageTransition??!1),te=x&&rt([e.transition,t.route.meta.pageTransition,!1,{onAfterLeave(){Tt(i),i.callHook(`page:transition:finish`,t.Component)}}]),S=e.keepalive??t.route.meta.keepalive??!1,C=t.Component.type,w=C.name||C.__name;t.route.meta.keepalive&&w&&s.add(w);let T;if(s.size>0&&e.keepalive==null&&(!S||typeof S==`object`&&S&&S.include)){let e=typeof S==`object`&&S?{...S}:{},t=e.include?Array.isArray(e.include)?e.include:[e.include]:[];T={...e,include:Array.from(new Set([...t,...s]))}}else T=S;return u=gt(x&&te,Yr(T,p(ve,{key:_,suspensible:!0,onPending:()=>{m=!0,x&&ot(i),g=i.callHook(`page:start`,t.Component)},onResolve:async()=>{m=!1,h=!0,i.isHydrating&&i[`~restoreDeferredRoute`]?.();try{await ee(),i._route.sync?.(),await g,await i.callHook(`page:finish`,t.Component),!v&&!b&&(v=!0,await i.callHook(`page:loading:end`))}finally{f()}}},{default:()=>{let e={key:y||void 0,vnode:n.default?oo(n.default,t):t.Component,route:t.route,renderKey:y||void 0,trackRootNodes:x,vnodeRef:a,routeRecord:void 0};if(!T)return p(eo,e);let r=C,i=to.get(r);return i||(i=$a(w),to.set(r,i)),p(i,e)}}))).default(),u})})}});function ro(e,t,n){if(!e)return!1;let r=t.matched.findIndex(e=>e.components?.default===n?.type);if(r===-1)return!1;let i=t.matched.slice(0,r).filter(e=>e.components?.default);if(!i.length)return!1;let a=e.matched.filter(e=>e.components?.default);return i.some((e,t)=>e.components?.default!==a[t]?.components?.default)||n&&Jr({route:t,Component:n})!==Jr({route:e,Component:n})}function io(e,t,n){return e?t.matched.findIndex(e=>e.components?.default===n?.type)<t.matched.length-1:!1}function ao(e){let t=(t=>{let r=e(t);return Array.isArray(r)?r:r==null||!n(r)?[o()]:[r]});return t._n=!0,t}function oo(e,t){let n=e(t);return n.length===1?p(n[0]):p(E,void 0,n)}function so(e){return!!e&&(!!e.suspense?.isUnmounted||!!e.component?.isUnmounted)}var co={class:`border-t border-base text-xs color-muted`},lo={class:`relative mx-auto max-w-6xl border-x border-base`},uo={class:`flex flex-wrap items-center justify-between gap-x-6 gap-y-3 px-6 py-5`},fo={class:`flex flex-wrap items-center gap-x-2`},po=[`href`],mo={class:`flex flex-col gap-3 border-t border-base px-6 py-5`},ho=[`href`],go=`underline underline-offset-3 hover:color-base`,_o=Object.assign(g({__name:`AppFooter`,setup(e){let n={jmdict:[`JMdict`,`https://www.edrdg.org/jmdict/j_jmdict.html`],jmnedict:[`JMnedict`,`https://www.edrdg.org/enamdict/enamdict_doc.html`],kanjidic:[`KANJIDIC2`,`https://www.edrdg.org/wiki/index.php/KANJIDIC_Project`],furigana:[`JmdictFurigana`,`https://github.com/Doublevil/JmdictFurigana`]};return(e,r)=>{let i=Pa,o=le(`i18n-t`);return T(),a(`footer`,co,[R(`div`,lo,[m(i,{class:`-left-[6px] -top-[6px]`}),m(i,{class:`-right-[6px] -top-[6px]`}),R(`div`,uo,[R(`p`,fo,[m(o,{keypath:`footer.made`,tag:`span`},{author:j(()=>[R(`a`,{class:x(go),href:`https://github.com/antfu`,target:`_blank`,rel:`noopener`},`@antfu`)]),_:1}),r[0]||=R(`span`,{"aria-hidden":`true`},`·`,-1),m(o,{keypath:`footer.supported`,tag:`span`},{vercel:j(()=>[R(`a`,{class:x(go),href:`https://vercel.com`,target:`_blank`,rel:`noopener`},`▲ Vercel`)]),sponsors:j(()=>[R(`a`,{class:x(go),href:`https://github.com/sponsors/antfu`,target:`_blank`,rel:`noopener`},f(e.$t(`footer.sponsors`)),1)]),_:1})]),R(`a`,{class:`inline-flex items-center gap-1.5 hover:color-base`,href:`REPOSITORY`in e?e.REPOSITORY:z(Lt),target:`_blank`,rel:`noopener`},[r[1]||=R(`span`,{class:`i-ph-github-logo`},null,-1),oe(` `+f(e.$t(`footer.source`)),1)],8,po)]),R(`div`,mo,[m(o,{keypath:`footer.fonts`,tag:`p`},{license:j(()=>[R(`a`,{class:x(go),href:`https://openfontlicense.org`,target:`_blank`,rel:`noopener`},`SIL Open Font License`)]),_:1}),m(o,{keypath:`footer.data`,tag:`p`},t({_:2},[O(n,(e,t)=>({name:t,fn:j(()=>[R(`a`,{class:x(go),href:e[1],target:`_blank`,rel:`noopener`},f(e[0]),9,ho)])}))]),1024),R(`p`,null,f(e.$t(`footer.code`)),1)])])])}}}),{__name:`AppFooter`});function vo(e,t){let n=Ha(e,()=>t(localStorage.getItem(e)));return r({get:()=>n.value,set:t=>{n.value=t,localStorage.setItem(e,String(t))}})}function yo(){let{t:e}=It(),t=vo(`furifont:face`,e=>e===`serif`?`serif`:`sans`),n=vo(`furifont:script`,e=>e===`hepburn`?`hepburn`:`hiragana`);return{face:t,script:n,ruby:vo(`furifont:ruby`,e=>e!==`false`),okurigana:vo(`furifont:okurigana`,e=>e!==`false`),family:r(()=>Rt.find(e=>e.face===t.value&&e.script===n.value)),faces:r(()=>[`sans`,`serif`].map(t=>({value:t,label:e(`faces.${t}`)}))),scripts:r(()=>[`hiragana`,`hepburn`].map(t=>({value:t,label:e(`scripts.${t}`)})))}}var bo={class:`min-h-screen overflow-x-clip bg-base color-base`},xo={class:`mx-auto max-w-6xl border-x border-base`},So=g({__name:`app`,setup(e){let{t,locale:n}=It();ba({htmlAttrs:{lang:n},title:()=>t(`meta.title`),meta:[{name:`description`,content:()=>t(`meta.description`)}]});let{family:r,ruby:i}=yo();return pe(()=>{let{style:e}=document.documentElement;e.setProperty(`--ff-font`,`"${r.value.family}"`),e.setProperty(`--ff-features`,i.value?`normal`:`"ss01"`)}),(e,t)=>{let n=Qa,r=no,i=_o;return T(),a(`div`,bo,[m(n),R(`main`,xo,[m(r)]),m(i)])}}}),Co={__name:`nuxt-error-page`,props:{error:Object},setup(e){let t=e.error,n=Number(t.statusCode||500),r=n===404,i=t.statusMessage??(r?`Page Not Found`:`Internal Server Error`),a=t.message||t.toString(),o=h(()=>X(()=>import(`./CEo6aVYN.js`),__vite__mapDeps([17,1,2,9,3,11,18]),import.meta.url)),s=h(()=>X(()=>import(`./DhRy_lmV.js`),__vite__mapDeps([19,1,2,11,20]),import.meta.url)),l=r?o:s;return(e,t)=>(T(),b(z(l),S(c({status:z(n),statusText:z(i),statusCode:z(n),statusMessage:z(i),description:z(a),stack:z(void 0)})),null,16))}},wo=()=>null,To={key:0},Eo={__name:`nuxt-root`,setup(e){let t=D(),n=t.deferHydration();if(t.isHydrating){let e=t.hooks.hookOnce(`app:error`,n),r=Y().beforeEach(()=>{e(),r()})}window.location.pathname,_(_t,ft()),t.hooks.callHookWith(e=>e.map(e=>e()),`vue:setup`,[]);let r=St();function i(e,n,r){let i=t.vueApp.config.errorHandler;if(i&&!i.__nuxt_default)try{i(e,n,r)}catch(e){console.error("[nuxt] Error in `app.config.errorHandler`",e)}}return l((e,n,r)=>{if(t.hooks.callHook(`vue:error`,e,n,r)?.catch(e=>console.error("[nuxt] Error in `vue:error` hook",e)),ct(navigator.userAgent))return bt(t,e),!1;if(Xe(e)&&(e.fatal||e.unhandled))return t.runWithContext(()=>J(e)),Aa(),i(e,n,r),!1}),(e,t)=>(T(),b(ve,{onResolve:z(n)},{default:j(()=>[z(!1)?(T(),a(`div`,To)):z(r)?(T(),b(z(Co),{key:1,error:z(r)},null,8,[`error`])):z(!1)?(T(),b(z(wo),{key:2,context:z(!1)},null,8,[`context`])):z(!1)?(T(),b(de(z(!1)),{key:3})):(T(),b(z(So),{key:4}))]),_:1},8,[`onResolve`]))}},Do;{let e;Do=async function(){if(e)return e;let t=!!(window.__NUXT__?.serverRendered??document.getElementById(`__NUXT_DATA__`)?.dataset.ssr===`true`),n=t?Se(Eo):xe(Eo),r=ce({vueApp:n});async function i(e){await r.callHook(`app:error`,e),r.payload.error||=K(e)}i.__nuxt_default=!0,n.config.errorHandler=i,r.hook(`app:suspense:resolve`,()=>{n.config.errorHandler===i&&(n.config.errorHandler=void 0)}),!t&&A.id&&r.hook(`app:suspense:resolve`,()=>{document.getElementById(A.id)?.remove()});try{await me(r,ka)}catch(e){i(e)}try{await r.hooks.callHook(`app:created`,n),await r.hooks.callHook(`app:beforeMount`,n),n.mount(F),await r.hooks.callHook(`app:mounted`,n),await ee()}catch(e){i(e)}return n},e=Do().catch(e=>{throw u.NUXT_E1009({cause:e}),e})}export{ba as a,Aa as i,no as n,Ki as o,Pa as r,Ji as s,yo as t};