@promptctl/cc-candybar 1.7.0 → 1.7.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.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import e from"node:process";import{json as t}from"node:stream/consumers";import n,{createReadStream as r,existsSync as i,watch as a}from"node:fs";import o,{basename as s,dirname as c,join as l}from"node:path";import u,{homedir as d}from"node:os";import{spawn as f,spawnSync as p}from"node:child_process";import m from"node:net";import{URL as h,URLSearchParams as g,fileURLToPath as _}from"node:url";import{parseArgs as v}from"node:util";import{get as y}from"node:https";import{createHash as b}from"node:crypto";import{setTimeout as x}from"node:timers/promises";import{open as S,readFile as C,readdir as ee,stat as te}from"node:fs/promises";import{createInterface as w}from"node:readline";import{clearInterval as ne,setInterval as re}from"node:timers";import ie from"node:v8";var T=Object.create,E=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,oe=Object.getOwnPropertyNames,se=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty,D=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),le=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=oe(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ce.call(e,s)&&s!==n&&E(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ae(t,s))||r.enumerable});return e},ue=(e,t,n)=>(n=e==null?{}:T(se(e)),le(t||!e||!e.__esModule?E(n,`default`,{value:e,enumerable:!0}):n,e));function O(e,...t){process.env.CC_CANDYBAR_DEBUG&&console.error(`[DEBUG] ${e}`,...t)}const de={"click.pbcopy":1e3,"click.open":1e3},fe=new Map;function pe(e){let t=de[e];if(t===void 0)return{allowed:!0};let n=fe.get(e);if(n===void 0)return{allowed:!0};let r=Date.now()-n;return r>=t?{allowed:!0}:{allowed:!1,minIntervalMs:t,sinceLastMs:r}}function me(e){fe.set(e,Date.now())}function he(e,t,n){return{ok:!1,reason:`rate-limited`,stdout:``,stderr:``,exitCode:null,signal:null,error:`rate-limited: ${e} min interval ${t}ms, last start ${n}ms ago`}}let ge=null;function k(e){ge=e}async function _e(e){let t=pe(e.category);if(!t.allowed)return he(e.category,t.minIntervalMs,t.sinceLastMs);me(e.category);let n=Date.now();return ge?.onStart(e.category),new Promise(t=>{let r;try{r=f(e.bin,e.args??[],{cwd:e.cwd,env:e.env,stdio:[`pipe`,`pipe`,`pipe`]})}catch(r){ge?.onEnd(e.category,Date.now()-n),t({ok:!1,reason:`spawn-error`,stdout:``,stderr:``,exitCode:null,signal:null,error:r instanceof Error?r.message:String(r)});return}let i=``,a=``,o=!1,s=null,c=null,l=!1,u=r=>{o||(o=!0,s&&clearTimeout(s),c&&clearTimeout(c),ge?.onEnd(e.category,Date.now()-n),t(r))};r.stdout?.on(`data`,e=>{i+=e.toString(`utf8`)}),r.stderr?.on(`data`,e=>{a+=e.toString(`utf8`)}),r.on(`error`,e=>{u({ok:!1,reason:`spawn-error`,stdout:i,stderr:a,exitCode:null,signal:null,error:e.message})}),r.on(`close`,(e,t)=>{if(l){u({ok:!1,reason:`timeout`,stdout:i,stderr:a,exitCode:e,signal:t});return}if(e===0){u({ok:!0,stdout:i,stderr:a,exitCode:e});return}u({ok:!1,reason:t?`signal`:`non-zero`,stdout:i,stderr:a,exitCode:e,signal:t})}),e.timeoutMs&&e.timeoutMs>0&&(s=setTimeout(()=>{l=!0,r.pid!==void 0&&(r.kill(`SIGTERM`),c=setTimeout(()=>{r.kill(`SIGKILL`)},250))},e.timeoutMs)),e.stdinInput!==void 0&&r.stdin?r.stdin.end(e.stdinInput):r.stdin&&r.stdin.end()})}function ve(e){let t=pe(e.category);if(!t.allowed)return he(e.category,t.minIntervalMs,t.sinceLastMs);me(e.category);let n=Date.now();ge?.onStart(e.category);let r=[`pipe`,`pipe`,`pipe`];try{let t=p(e.bin,e.args??[],{cwd:e.cwd,env:e.env,input:e.stdinInput,timeout:e.timeoutMs&&e.timeoutMs>0?e.timeoutMs:void 0,stdio:r,encoding:`utf8`});ge?.onEnd(e.category,Date.now()-n);let i=typeof t.stdout==`string`?t.stdout:``,a=typeof t.stderr==`string`?t.stderr:``;if(t.error)return{ok:!1,reason:t.error.code===`ETIMEDOUT`?`timeout`:`spawn-error`,stdout:i,stderr:a,exitCode:null,signal:t.signal??null,error:t.error.message};if(t.status===0)return{ok:!0,stdout:i,stderr:a,exitCode:t.status};let o=e.timeoutMs!==void 0&&e.timeoutMs>0;return{ok:!1,reason:t.signal?o&&t.signal===`SIGTERM`?`timeout`:`signal`:`non-zero`,stdout:i,stderr:a,exitCode:t.status,signal:t.signal??null}}catch(t){return ge?.onEnd(e.category,Date.now()-n),{ok:!1,reason:`spawn-error`,stdout:``,stderr:``,exitCode:null,signal:null,error:t instanceof Error?t.message:String(t)}}}function ye(e){let t=pe(e.category);if(!t.allowed)return he(e.category,t.minIntervalMs,t.sinceLastMs);me(e.category);let n=Date.now();ge?.onStart(e.category);let r=be(e);return ge?.onEnd(e.category,Date.now()-n),r}function be(e){let t;try{t=f(e.bin,e.args??[],{cwd:e.cwd,env:e.env,detached:!0,stdio:`ignore`})}catch(e){return{ok:!1,reason:`spawn-error`,stdout:``,stderr:``,exitCode:null,signal:null,error:e instanceof Error?e.message:String(e)}}return t.once(`error`,()=>{}),t.pid===void 0?{ok:!1,reason:`spawn-error`,stdout:``,stderr:``,exitCode:null,signal:null,error:`spawn(${e.bin}): no pid (binary not found or unexecutable)`}:(t.unref(),{ok:!0,stdout:``,stderr:``,exitCode:null})}function xe(e){let t=process.env[e];return t&&t.length>0?t:void 0}function Se(){let e=xe(`XDG_STATE_HOME`)??o.join(u.homedir(),`.local`,`state`);return o.join(e,`cc-candybar`)}function Ce(){let e=xe(`XDG_CACHE_HOME`)??o.join(u.homedir(),`.cache`);return o.join(e,`cc-candybar`)}function we(){return Se()}function Te(){let e=process.env.CC_CANDYBAR_SOCKET;if(e)return e;let t=u.userInfo().uid;return o.join(`/tmp`,`cc-candybar-${t}`,`socket`)}function Ee(e){let t=o.dirname(e);n.mkdirSync(t,{recursive:!0,mode:448});let r=n.lstatSync(t);if(r.isSymbolicLink())throw Error(`socket parent is a symlink: ${t}`);if(!r.isDirectory())throw Error(`socket parent is not a directory: ${t}`);let i=u.userInfo().uid;if(typeof i==`number`&&r.uid!==i)throw Error(`socket parent is not owned by uid ${i}: ${t} (owner uid=${r.uid})`);if(r.mode&63)throw Error(`socket parent has unsafe permissions: ${t} (mode=${(r.mode&511).toString(8)}, expected 0700)`);try{if(n.lstatSync(e).isSymbolicLink())throw Error(`socket path is a symlink: ${e}`)}catch(e){if(e.code!==`ENOENT`)throw e}}function De(){return o.join(Se(),`pid`)}function Oe(){return o.join(Se(),`session-state.json`)}function ke(){return o.join(Se(),`spawn.lock`)}function A(){return o.join(Se(),`daemon.log`)}const Ae=1e4;function je(e){if(typeof e!=`number`||!Number.isFinite(e))return;let t=Math.floor(e);if(!(t<=0))return t>Ae?Ae:t}var Me=class extends Error{constructor(e){super(e),this.name=`ProtocolError`}};function Ne(e){let t=Buffer.from(JSON.stringify(e),`utf8`),n=Buffer.alloc(4);return n.writeUInt32BE(t.length,0),Buffer.concat([n,t])}function Pe(e,t){let n=Buffer.alloc(0);return function(r){for(n=Buffer.concat([n,r]);n.length>=4;){let r=n.readUInt32BE(0);if(r>16777216){t(new Me(`frame too large: ${r}`));return}if(n.length<4+r)return;let i=n.subarray(4,4+r);n=n.subarray(4+r);try{e(JSON.parse(i.toString(`utf8`)))}catch(e){let n=new Me(e instanceof Error?e.message:String(e));e instanceof Error&&(n.cause=e),t(n);return}}}}function Fe(e,t,n){return new Promise((r,i)=>{let a=!1,o=t=>{if(!a){a=!0,clearTimeout(s),e.removeAllListeners();try{t()}catch{}}},s=setTimeout(()=>{o(()=>{e.destroy(),i(Error(`TIMEOUT`))})},n),c=Pe(e=>o(()=>r(e)),e=>o(()=>i(e)));e.on(`data`,c),e.on(`error`,e=>o(()=>i(e))),e.on(`close`,()=>o(()=>i(Error(`socket closed before response`)))),e.write(Ne(t))})}async function Ie(e,t,n){let r=null;try{r=await Ve(Te(),t.connectMs);let i=await Fe(r,{v:3,...e},t.budgetMs);return ze(e.kind,i,n)}catch(e){return Be(e)}finally{r&&r.destroy()}}function Le(e,t){return typeof e==`string`?e:t}function Re(e){return typeof e==`number`&&Number.isInteger(e)&&e>=0?e:0}function ze(e,t,n){let r=t;if(r.ok===!0){let r=n(t);return r===void 0?{kind:`permanent`,cause:`malformed_response`,message:`ok response without payload for "${e}" request`}:{kind:`ok`,value:r}}let i=Le(r.error,`(no error message)`);switch(r.code){case`VERSION_MISMATCH`:return{kind:`permanent`,cause:`version_mismatch`,clientV:3,daemonV:Re(r.daemonV)};case`TIMEOUT`:return{kind:`transient`,cause:`timeout`,message:i};case`BAD_REQUEST`:return{kind:`permanent`,cause:`bad_request`,message:i};case`RENDER_FAILED`:return{kind:`permanent`,cause:`render_failed`,message:i};default:return{kind:`permanent`,cause:`malformed_response`,message:`unknown error code: ${String(r.code)}`}}}function Be(e){if(e instanceof Me||e instanceof SyntaxError)return{kind:`permanent`,cause:`malformed_response`,message:e instanceof Error?e.message:String(e)};let t=e instanceof Error?e.message:String(e);return t===`CONNECT_TIMEOUT`||t===`TIMEOUT`?{kind:`transient`,cause:`timeout`,message:t}:t.includes(`ECONNREFUSED`)||t.includes(`ENOENT`)||t.includes(`ENOTSOCK`)?{kind:`transient`,cause:`unreachable`,message:t}:{kind:`transient`,cause:`io_error`,message:t}}function Ve(e,t){return new Promise((n,r)=>{let i=m.createConnection({path:e}),a=setTimeout(()=>{i.destroy(),r(Error(`CONNECT_TIMEOUT`))},t);i.once(`connect`,()=>{clearTimeout(a),n(i)}),i.once(`error`,e=>{clearTimeout(a),r(e)})})}function He(e){if(e.kind===`transient`)return`daemon unavailable (${e.cause}: ${e.message})\nHint: daemon may not be running. Run \`cc-candybar\` once to spawn it.`;switch(e.cause){case`version_mismatch`:{let t=e.daemonV===0?`unknown`:`v${e.daemonV}`;return`daemon protocol mismatch (client v${e.clientV} ≠ daemon ${t})`}case`bad_request`:case`render_failed`:case`malformed_response`:return`daemon error (${e.cause}): ${e.message}`}}const Ue={connectMs:50,budgetMs:150},We={connectMs:50,budgetMs:200};function Ge(e){let t=e.output;return typeof t==`string`?t:void 0}function Ke(e,t,n,r){return Ie({kind:`render`,hookData:e,args:t,cwd:n,termCols:r},Ue,Ge)}function qe(e,t){return Ie({kind:`click`,verb:e,value:t},We,Ge)}function Je(t={}){if(tt()!==null)return;let n=t.spawn??nt,r=Qe();if(r.kind===`contended`){let t=Ye();t!==null&&t>2e3&&(e.stderr.write(`cc-candybar: spawn-lock held ${t}ms (likely crashed holder) — spawning unlocked\n`),Xe(n));return}if(r.kind===`error`){e.stderr.write(`cc-candybar: spawn-lock unavailable (${r.reason}) — spawning unlocked\n`),Xe(n);return}try{Xe(n)}finally{et()}}function Ye(){try{let e=n.statSync(ke());return Date.now()-e.mtimeMs}catch{return null}}function Xe(t){try{t()||e.stderr.write(`cc-candybar: daemon spawn returned false (unable to resolve script path?)
3
- `)}catch(t){e.stderr.write(`cc-candybar: daemon spawn failed: ${t.message}\n`)}}let Ze=null;function Qe(){let t=ke();for(let r=0;r<2;r++){try{let r=n.openSync(t,`wx`,384);try{n.writeSync(r,JSON.stringify({pid:e.pid,ts:Date.now()}))}catch{}return Ze={fd:r,path:t},{kind:`held`}}catch(e){let n=e.code;if(n!==`EEXIST`)return{kind:`error`,reason:`openSync(${t}): ${n??e.message}`}}if(!$e(t))return{kind:`contended`};try{n.unlinkSync(t)}catch(e){if(e.code!==`ENOENT`)return{kind:`error`,reason:`unlink stale spawn.lock: ${e.message}`}}}return{kind:`contended`}}function $e(e){try{let t=n.statSync(e);return Date.now()-t.mtimeMs>1e4}catch{return!0}}function et(){if(!Ze)return;let{fd:e,path:t}=Ze;Ze=null;try{n.closeSync(e)}catch{}try{n.unlinkSync(t)}catch{}}function tt(){try{return n.mkdirSync(we(),{recursive:!0}),null}catch(e){return`mkdir ${we()}: ${e.message}`}}function nt(){let t=e.execPath,n=e.argv[1];return n?ye({bin:t,args:[`--max-old-space-size=400`,n,`daemon`],category:`daemon-spawn`}).ok:!1}const rt=`cc-candybar`,it=`dispatch`,at=`set-state`,ot=`step-state`,st=`copy`,ct=`open-vscode`,lt=`show-config-error`,ut=`show-config-warning`;function dt(e){return e.map(encodeURIComponent).join(`/`)}function ft(e){return e.length===0?[]:e.split(`/`).map(decodeURIComponent)}function pt(e){return`${rt}://${it}/${e.map(e=>`e=${encodeURIComponent(`${e.verb}/${dt(e.args)}`)}`).join(`&`)}`}function mt(e){return new g(e).getAll(`e`).map(ht)}function ht(e){let t=e.indexOf(`/`);return t===-1?{verb:e,value:``}:{verb:e.slice(0,t),value:e.slice(t+1)}}const gt=`@promptctl/cc-candybar`,_t=`CCCandybarURLHandler`,vt=[];function yt(e){return/^[A-Za-z0-9_./=,:-]+$/.test(e)?e:`'${e.replace(/'/g,`'\\''`)}'`}function bt(e){return[`pnpm`,`dlx`,`${gt}@1.7.0`,...e.map(yt)].join(` `)}function xt(){return o.join(u.homedir(),`Applications`,`${_t}.app`)}function St(){return o.join(u.homedir(),`.claude`,`settings.json`)}function Ct(){if(process.platform!==`darwin`)throw Error(`URL handler installation requires macOS (found platform: ${process.platform}).`)}function wt(){return o.join(u.homedir(),`Library`,`Application Support`,`CCCandybar`)}function Tt(){return o.join(wt(),`url-handler.mjs`)}function Et(e,t,n){let r=e.replace(/"/g,`\\"`),i=t.replace(/"/g,`\\"`);return[`on open location L`,`\tdo shell script "NODE_PATH='${n.replace(/"/g,`\\"`)}' '${r}' '${i}' url-handle " & quoted form of L`,`end open location`].join(`
3
+ `)}catch(t){e.stderr.write(`cc-candybar: daemon spawn failed: ${t.message}\n`)}}let Ze=null;function Qe(){let t=ke();for(let r=0;r<2;r++){try{let r=n.openSync(t,`wx`,384);try{n.writeSync(r,JSON.stringify({pid:e.pid,ts:Date.now()}))}catch{}return Ze={fd:r,path:t},{kind:`held`}}catch(e){let n=e.code;if(n!==`EEXIST`)return{kind:`error`,reason:`openSync(${t}): ${n??e.message}`}}if(!$e(t))return{kind:`contended`};try{n.unlinkSync(t)}catch(e){if(e.code!==`ENOENT`)return{kind:`error`,reason:`unlink stale spawn.lock: ${e.message}`}}}return{kind:`contended`}}function $e(e){try{let t=n.statSync(e);return Date.now()-t.mtimeMs>1e4}catch{return!0}}function et(){if(!Ze)return;let{fd:e,path:t}=Ze;Ze=null;try{n.closeSync(e)}catch{}try{n.unlinkSync(t)}catch{}}function tt(){try{return n.mkdirSync(we(),{recursive:!0}),null}catch(e){return`mkdir ${we()}: ${e.message}`}}function nt(){let t=e.execPath,n=e.argv[1];return n?ye({bin:t,args:[`--max-old-space-size=400`,n,`daemon`],category:`daemon-spawn`}).ok:!1}const rt=`cc-candybar`,it=`dispatch`,at=`set-state`,ot=`step-state`,st=`copy`,ct=`open-vscode`,lt=`show-config-error`,ut=`show-config-warning`;function dt(e){return e.map(encodeURIComponent).join(`/`)}function ft(e){return e.length===0?[]:e.split(`/`).map(decodeURIComponent)}function pt(e){return`${rt}://${it}/${e.map(e=>`e=${encodeURIComponent(`${e.verb}/${dt(e.args)}`)}`).join(`&`)}`}function mt(e){return new g(e).getAll(`e`).map(ht)}function ht(e){let t=e.indexOf(`/`);return t===-1?{verb:e,value:``}:{verb:e.slice(0,t),value:e.slice(t+1)}}const gt=`@promptctl/cc-candybar`,_t=`CCCandybarURLHandler`,vt=[];function yt(e){return/^[A-Za-z0-9_./=,:-]+$/.test(e)?e:`'${e.replace(/'/g,`'\\''`)}'`}function bt(e){return[`pnpm`,`dlx`,`${gt}@1.7.2`,...e.map(yt)].join(` `)}function xt(){return o.join(u.homedir(),`Applications`,`${_t}.app`)}function St(){return o.join(u.homedir(),`.claude`,`settings.json`)}function Ct(){if(process.platform!==`darwin`)throw Error(`URL handler installation requires macOS (found platform: ${process.platform}).`)}function wt(){return o.join(u.homedir(),`Library`,`Application Support`,`CCCandybar`)}function Tt(){return o.join(wt(),`url-handler.mjs`)}function Et(e,t,n){let r=e.replace(/"/g,`\\"`),i=t.replace(/"/g,`\\"`);return[`on open location L`,`\tdo shell script "NODE_PATH='${n.replace(/"/g,`\\"`)}' '${r}' '${i}' url-handle " & quoted form of L`,`end open location`].join(`
4
4
  `)}function Dt(e){if(!e)throw Error(`install-url-handler: process.argv[1] not set`);return e.endsWith(`.mjs`)||e.endsWith(`.js`)?e:o.resolve(o.dirname(e),`..`,`dist`,`index.mjs`)}function Ot(){let e=Dt(process.argv[1]);if(!n.existsSync(e))throw Error(`install-url-handler: bundled dist not found at ${e}. Reinstall the package.`);n.mkdirSync(wt(),{recursive:!0});let t=Tt();return n.copyFileSync(e,t),t}function kt(){return[{key:`CFBundleIdentifier`,xml:`<string>com.cccandybar.url-handler</string>`},{key:`CFBundleURLTypes`,xml:[`<array>`,` <dict>`,` <key>CFBundleURLName</key>`,` <string>Claude Powerline Click Action</string>`,` <key>CFBundleURLSchemes</key>`,` <array>`,` <string>${rt}</string>`,` </array>`,` </dict>`,`</array>`].join(`
5
5
  `)}]}function At(){Ct();let e=Ot();process.stdout.write(`Copied dist to ${e}\n`);let t=Dt(process.argv[1]),r=o.join(o.dirname(t),`..`,`node_modules`);if(!n.existsSync(r))throw Error(`install-url-handler: node_modules not found at ${r}. Install deps first.`);let i=xt();n.mkdirSync(o.dirname(i),{recursive:!0}),n.existsSync(i)&&n.rmSync(i,{recursive:!0,force:!0}),process.stdout.write(`Building ${i}\n`);let a=ve({bin:`/usr/bin/osacompile`,args:[`-o`,i,`-e`,Et(process.execPath,e,r)],category:`install.osacompile`});if(!a.ok)throw process.stderr.write(a.stderr),Error(`osacompile failed (${a.reason})`);let s=o.join(i,`Contents`,`Info.plist`);for(let{key:e}of kt())ve({bin:`/usr/bin/plutil`,args:[`-remove`,e,s],category:`install.plutil`});for(let{key:e,xml:t}of kt()){let n=ve({bin:`/usr/bin/plutil`,args:[`-insert`,e,`-xml`,t,s],category:`install.plutil`});if(!n.ok)throw process.stderr.write(n.stderr),Error(`plutil -insert ${e} failed (${n.reason})`)}process.stdout.write(`Registering ${rt}:// with Launch Services\n`);let c=ve({bin:`/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister`,args:[`-f`,i],category:`install.lsregister`});if(!c.ok)throw process.stderr.write(c.stderr),Error(`lsregister failed (${c.reason})`);process.stdout.write(`✓ ${_t}.app installed and registered.\n`),process.stdout.write(` Test: open '${rt}://hello-world' && pbpaste\n`)}function jt(e,t=rt){let n=`${t}://`;if(!e.startsWith(n))throw Error(`expected ${n} scheme, got: ${e}`);let r=e.slice(n.length),i=r.indexOf(`/`);return i===-1?{verb:st,value:r}:{verb:decodeURIComponent(r.slice(0,i)),value:r.slice(i+1)}}async function Mt(e){e||(process.stderr.write(`url-handle: missing URL argument.
6
6
  `),process.exit(1));let t;try{t=jt(e)}catch(e){process.stderr.write(`url-handle: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}let n=await qe(t.verb,t.value);n.kind===`ok`&&process.exit(0),n.kind===`transient`&&(Je(),process.stderr.write(`url-handle: daemon unavailable (${n.cause}: ${n.message})\n`),process.exit(1)),process.stderr.write(Nt(n)+`
@@ -24,7 +24,7 @@ import e from"node:process";import{json as t}from"node:stream/consumers";import
24
24
  `+t+`}`}}return i.pop(),a=t,s}function p(e){if(e.length===0)return d(e,!0);let t=String.fromCodePoint(e.codePointAt(0));if(!n.isIdStartChar(t))return d(e,!0);for(let r=t.length;r<e.length;r++)if(!n.isIdContinueChar(String.fromCodePoint(e.codePointAt(r))))return d(e,!0);return e}function m(e){if(i.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);i.push(e);let t=a;a+=c;let n=[];for(let t=0;t<e.length;t++){let r=u(String(t),e);n.push(r===void 0?`null`:r)}let r;if(n.length===0)r=`[]`;else if(c===``)r=`[`+n.join(`,`)+`]`;else{let e=`,
25
25
  `+a,i=n.join(e);r=`[
26
26
  `+a+i+`,
27
- `+t+`]`}return i.pop(),a=t,r}}})),Wn=ue(D(((e,t)=>{t.exports={parse:z(),stringify:Un()}}))(),1);const Gn=`trimPrefix "/" (trimPrefix .project_dir .current_dir)`,Kn=` {{ if and (ne .home "") (or (eq .home .current_dir) (hasPrefix (printf "%s/" .home) .current_dir)) }}~{{ trimPrefix .home .current_dir }}{{ else }}{{ if or (eq .project_dir .current_dir) (hasPrefix (printf "%s/" .project_dir) .current_dir) }}{{ ternary (${Gn}) (basename .project_dir) (ne (${Gn}) "") }}{{ else }}{{ .current_dir }}{{ end }}{{ end }} `;function qn(e,t){return`{{ if ge (round ${e}) ${t} }}error{{ else }}{{ if ge (round ${e}) 50 }}warning{{ else }}panel{{ end }}{{ end }}`}function Jn(e){return`{{ if ge (round ${e}) 50 }}button-color-foreground{{ else }}foreground{{ end }}`}function Yn(e,t,n){return`{{ if lt ${e} 0 }}panel{{ else }}{{ if lt ${e} ${n} }}error{{ else }}{{ if lt ${e} ${t} }}warning{{ else }}panel{{ end }}{{ end }}{{ end }}`}function Xn(e,t){return`{{ if lt ${e} 0 }}foreground{{ else }}{{ if lt ${e} ${t} }}button-color-foreground{{ else }}foreground{{ end }}{{ end }}`}const Zn={globals:{palette:`catppuccin-latte`},variables:{current_dir:{kind:`input`,path:`workspace.current_dir`,default:`?`},project_dir:{kind:`input`,path:`workspace.project_dir`,default:``},transcript_path:{kind:`input`,path:`transcript_path`,default:``},"model.display_name":{kind:`input`,path:`model.display_name`,default:``},"session.id":{kind:`input`,path:`session_id`,default:``},version:{kind:`input`,path:`version`,default:``},"term.cols":{kind:`input`,path:`term.cols`,type:`number`,default:80},"hue.step":{kind:`literal`,value:14},home:{kind:`input`,path:`home`,default:``},"tmux.session":{kind:`input`,path:`tmux.session`,default:``},"git.repoName":{kind:`input`,path:`git.repoName`,default:``},"git.branch":{kind:`input`,path:`git.branch`,default:``},"git.sha":{kind:`input`,path:`git.sha`,default:``},"git.ahead":{kind:`input`,path:`git.ahead`,type:`number`,default:0},"git.behind":{kind:`input`,path:`git.behind`,type:`number`,default:0},"git.staged":{kind:`input`,path:`git.staged`,type:`number`,default:0},"git.unstaged":{kind:`input`,path:`git.unstaged`,type:`number`,default:0},"git.untracked":{kind:`input`,path:`git.untracked`,type:`number`,default:0},"git.conflicts":{kind:`input`,path:`git.conflicts`,type:`number`,default:0},"git.upstream":{kind:`input`,path:`git.upstream`,default:``},"git.stash":{kind:`input`,path:`git.stash`,type:`number`,default:0},"git.status":{kind:`input`,path:`git.status`,default:`clean`},"git.operation":{kind:`input`,path:`git.operation`,default:``},"git.timeSinceCommit":{kind:`input`,path:`git.timeSinceCommit`,type:`number`,default:0},"git.prNumber":{kind:`input`,path:`git.prNumber`,type:`number`,default:0},"git.prState":{kind:`input`,path:`git.prState`,default:``},"git.prUrl":{kind:`input`,path:`git.prUrl`,default:``},"git.prError":{kind:`input`,path:`git.prError`,default:``},"cache.expiresAt":{kind:`input`,path:`cache.expiresAt`,type:`number`,default:0},"session.cost":{kind:`input`,path:`session.cost`,type:`number`,default:0},"session.tokens":{kind:`input`,path:`session.tokens`,type:`number`,default:0},"today.cost":{kind:`input`,path:`today.cost`,type:`number`,default:0},"today.tokens":{kind:`input`,path:`today.tokens`,type:`number`,default:0},"today.budget.amount":{kind:`literal`,value:50},"today.budget.warningThreshold":{kind:`literal`,value:80},"block.nativeUtilization":{kind:`input`,path:`block.nativeUtilization`,type:`number`,default:0},"block.resetsAt":{kind:`input`,path:`block.resetsAt`,type:`number`,default:0},"block.budget.warningThreshold":{kind:`literal`,value:80},"weekly.percentage":{kind:`input`,path:`weekly.percentage`,type:`number`,default:0},"weekly.resetsAt":{kind:`input`,path:`weekly.resetsAt`,type:`number`,default:0},"weekly.budget.warningThreshold":{kind:`literal`,value:80},"burn.costPerHour":{kind:`input`,path:`burn.costPerHour`,type:`number`,default:-1},"block.etaMinutes":{kind:`input`,path:`block.etaMinutes`,type:`number`,default:-1},"weekly.etaMinutes":{kind:`input`,path:`weekly.etaMinutes`,type:`number`,default:-1},"burn.eta.warnMinutes":{kind:`literal`,value:60},"burn.eta.errorMinutes":{kind:`literal`,value:30},"speed.input":{kind:`input`,path:`speed.input`,type:`number`,default:-1},"speed.output":{kind:`input`,path:`speed.output`,type:`number`,default:-1},"speed.total":{kind:`input`,path:`speed.total`,type:`number`,default:-1},"speed.history":{kind:`input`,path:`speed.history`,type:`string`,default:``},"context.totalTokens":{kind:`input`,path:`context.totalTokens`,type:`number`,default:0},"context.contextLeft":{kind:`input`,path:`context.contextLeft`,type:`number`,default:100},"metrics.lastResponseTime":{kind:`input`,path:`metrics.lastResponseTime`,type:`number`,default:0},"metrics.responseTime":{kind:`input`,path:`metrics.responseTime`,type:`number`,default:0},"metrics.sessionDuration":{kind:`input`,path:`metrics.sessionDuration`,type:`number`,default:0},"metrics.messageCount":{kind:`input`,path:`metrics.messageCount`,type:`number`,default:0},"metrics.linesAdded":{kind:`input`,path:`metrics.linesAdded`,type:`number`,default:0},"metrics.linesRemoved":{kind:`input`,path:`metrics.linesRemoved`,type:`number`,default:0},activeStyle:{kind:`state`,key:`style`,default:``},stylePage:{kind:`state`,key:`style-page`,default:`-1`}},segments:{directory:{template:Kn,bg:`surface`,fg:`foreground`},model:{template:` ✱ {{ formatModelName .model.display_name }} `,bg:`panel`,fg:`foreground`,when:`{{ ne .model.display_name "" }}`},sessionId:{template:` ⌗{{ trunc 8 .session.id }} `,bg:`surface`,fg:`foreground`,when:`{{ ne .session.id "" }}`},version:{template:` ◈ v{{ .version }} `,bg:`surface`,fg:`foreground`,when:`{{ ne .version "" }}`},tmux:{template:` tmux:{{ .tmux.session | default "none" }} `,bg:`surface-active`,fg:`foreground`,when:`{{ ne .tmux.session "" }}`},git:{template:` {{ if ne .git.repoName "" }}{{ .git.repoName }} {{ end }}⎇ {{ .git.branch }}{{ if .git.sha }} ♯ {{ .git.sha }}{{ end }}{{ if or (gt .git.ahead 0) (gt .git.behind 0) }} {{ if gt .git.ahead 0 }}↑{{ .git.ahead }}{{ end }}{{ if gt .git.behind 0 }}↓{{ .git.behind }}{{ end }}{{ end }}{{ if or (gt .git.staged 0) (gt .git.unstaged 0) (gt .git.untracked 0) (gt .git.conflicts 0) }} ({{ printf "%s%s%s%s" (ternary (printf " +%v" .git.staged) "" (gt .git.staged 0)) (ternary (printf " ~%v" .git.unstaged) "" (gt .git.unstaged 0)) (ternary (printf " ?%v" .git.untracked) "" (gt .git.untracked 0)) (ternary (printf " !%v" .git.conflicts) "" (gt .git.conflicts 0)) | trim }}){{ end }}{{ if .git.upstream }} →{{ .git.upstream }}{{ end }}{{ if gt .git.stash 0 }} ⧇ {{ .git.stash }}{{ end }} {{ if eq .git.status "conflicts" }}⚠{{ else }}{{ if eq .git.status "dirty" }}●{{ else }}✓{{ end }}{{ end }} `,bg:`surface-active`,fg:`foreground`,when:`{{ ne .git.branch "" }}`},gitTaculous:{template:` (git){{ if ne .git.repoName "" }} {{ .git.repoName }}{{ end }}{{ if ne .git.operation "" }} [{{ .git.operation }}]{{ end }}{{ if ne .git.sha "" }} {{ .git.sha }}{{ end }}{{ if or (gt .git.staged 0) (gt .git.unstaged 0) (gt .git.untracked 0) (gt .git.conflicts 0) }} {{ if gt .git.staged 0 }}{{ green "S" }}{{ end }}{{ if or (gt .git.unstaged 0) (gt .git.untracked 0) }}{{ red "U" }}{{ end }}{{ if gt .git.conflicts 0 }}{{ red (printf "!%v" .git.conflicts) }}{{ end }}{{ end }} ⎇ {{ .git.branch }}{{ if ne .git.upstream "" }} [{{ .git.upstream }}{{ if or (gt .git.ahead 0) (gt .git.behind 0) }} {{ if gt .git.ahead 0 }}{{ green (printf "+%v" .git.ahead) }}{{ end }}{{ if and (gt .git.ahead 0) (gt .git.behind 0) }}/{{ end }}{{ if gt .git.behind 0 }}{{ red (printf "-%v" .git.behind) }}{{ end }}{{ end }}]{{ end }}{{ if gt .git.stash 0 }} ({{ .git.stash }} stashed){{ end }}{{ if gt .git.timeSinceCommit 0 }} ◷ {{ template "formatTimeSince" .git.timeSinceCommit }}{{ end }} `,bg:`surface-active`,fg:`foreground`,when:`{{ ne .git.branch "" }}`},gitPr:{template:`{{ if ne .git.prUrl "" }}{{ link .git.prUrl (printf " ⇆ #%v " .git.prNumber) }}{{ else }} ⚠ PR {{ end }}`,bg:`surface-active`,fg:`foreground`,when:`{{ or (ne .git.prUrl "") (ne .git.prError "") }}`},toolbar:{template:` {{ action "copySession" "⎘ id" }} {{ action "copyDir" "⎘ cwd" }} {{ action "openProject" "↗ proj" }} {{ action "openTranscript" "↗ log" }} `,bg:`surface`,fg:`foreground`},session:{template:` § {{ template "formatCost" .session.cost }} ({{ template "formatTokens" .session.tokens }}) `,bg:`surface`,fg:`foreground`},today:{template:` ☉ {{ template "formatCost" .today.cost }} ({{ template "formatTokens" .today.tokens }}){{ template "budgetStatus" (dict "cost" .today.cost "budget" .today.budget.amount "warn" .today.budget.warningThreshold) }} `,bg:`surface`,fg:`foreground`},block:{template:` ◱ {{ round .block.nativeUtilization }}% ({{ template "formatLongTimeRemaining" (minutesUntilReset .block.resetsAt) }}) `,bg:qn(`.block.nativeUtilization`,`.block.budget.warningThreshold`),fg:Jn(`.block.nativeUtilization`),when:`{{ gt .block.resetsAt 0 }}`},weekly:{template:` ◑ {{ round .weekly.percentage }}% ({{ template "formatLongTimeRemaining" (minutesUntilReset .weekly.resetsAt) }}) `,bg:qn(`.weekly.percentage`,`.weekly.budget.warningThreshold`),fg:Jn(`.weekly.percentage`),when:`{{ gt .weekly.resetsAt 0 }}`},burnrate:{template:` ⚡ {{ template "formatRate" .burn.costPerHour }} · {{ template "formatEta" .block.etaMinutes }} to 5h · {{ template "formatEta" .weekly.etaMinutes }} to wk `,bg:Yn(`.block.etaMinutes`,`.burn.eta.warnMinutes`,`.burn.eta.errorMinutes`),fg:Xn(`.block.etaMinutes`,`.burn.eta.warnMinutes`),when:`{{ or (gt .block.resetsAt 0) (gt .weekly.resetsAt 0) }}`},speed:{template:` ⇅ out {{ template "formatSpeed" .speed.output }} · in {{ template "formatSpeed" .speed.input }} · tot {{ template "formatSpeed" .speed.total }} `,bg:`panel`,fg:`foreground`,when:`{{ gt .session.tokens 0 }}`},tokenSparkline:{template:` ⚡ {{ sparkline .speed.history 24 }} `,bg:`panel`,fg:`foreground`,when:`{{ ne .speed.history "" }}`},cacheTimer:{template:` ◴ {{ if le (minutesUntilReset .cache.expiresAt) 0 }}cold{{ else }}{{ minutesUntilReset .cache.expiresAt }}m{{ end }} `,bg:`surface`,fg:`{{ if le (minutesUntilReset .cache.expiresAt) 8 }}error{{ else }}{{ if le (minutesUntilReset .cache.expiresAt) 20 }}warning{{ else }}foreground{{ end }}{{ end }}`,when:`{{ gt .cache.expiresAt 0 }}`},context:{template:` ◔ {{ formatInteger .context.totalTokens }} ({{ .context.contextLeft }}%) `,bg:`{{ if le .context.contextLeft 20 }}error{{ else }}{{ if le .context.contextLeft 40 }}warning{{ else }}surface-active{{ end }}{{ end }}`,fg:`{{ if le .context.contextLeft 40 }}button-color-foreground{{ else }}foreground{{ end }}`,when:`{{ gt .context.totalTokens 0 }}`},metrics:{template:`{{ if .metrics.lastResponseTime }} Δ {{ template "formatResponseTime" .metrics.lastResponseTime }}{{ end }}{{ if .metrics.responseTime }} ⧖ {{ template "formatResponseTime" .metrics.responseTime }}{{ end }}{{ if .metrics.sessionDuration }} ⧗ {{ template "formatDuration" .metrics.sessionDuration }}{{ end }}{{ if .metrics.messageCount }} ◆ {{ .metrics.messageCount }}{{ end }}{{ if .metrics.linesAdded }} + {{ .metrics.linesAdded }}{{ end }}{{ if .metrics.linesRemoved }} - {{ .metrics.linesRemoved }}{{ end }} `,bg:`panel`,fg:`foreground`,when:`{{ or .metrics.lastResponseTime .metrics.responseTime .metrics.sessionDuration .metrics.messageCount .metrics.linesAdded .metrics.linesRemoved }}`},styleControl:{template:`✦ {{ if .activeStyle }}{{ .activeStyle }}{{ else }}(default){{ end }} {{ action "openStyleMenu" "▸" }}`,bg:`surface`,fg:`foreground`},stylePicker:{template:`{{ picker "applyStyle" "stylePage" true false }}`,bg:`surface`,fg:`foreground`}},root:{kind:`container`,direction:`vertical`,children:[{kind:`container`,direction:`horizontal`,children:[{kind:`segment`,name:`directory`},{kind:`segment`,name:`git`},{kind:`segment`,name:`model`},{kind:`segment`,name:`session`},{kind:`segment`,name:`today`},{kind:`segment`,name:`context`},{kind:`segment`,name:`toolbar`},{kind:`segment`,name:`styleControl`}]},{kind:`segment`,name:`stylePicker`,when:`{{ ge (int .stylePage) 0 }}`}]},actions:{copySession:{copy:`{{ .session.id }}`},copyDir:{copy:`{{ .current_dir }}`},openProject:{open:`{{ .project_dir }}`},openTranscript:{open:`{{ .transcript_path }}`},openStyleMenu:{set:`style-page`,to:`0`},applyStyle:{set:`style`,from:`styles`},stylePage:{set:`style-page`,int:!0}},helpers:{formatCost:'{{ if lt . 0.01 }}<$0.01{{ else }}${{ printf "%.2f" . }}{{ end }}',formatTokenCount:`{{ if ge . 1000000 }}{{ printf "%.1f" (divf . 1000000) }}M{{ else if ge . 1000 }}{{ printf "%.1f" (divf . 1000) }}K{{ else }}{{ . }}{{ end }}`,formatTokens:`{{ template "formatTokenCount" . }} tokens`,formatRate:`{{ if lt . 0 }}—/hr{{ else }}{{ template "formatCost" . }}/hr{{ end }}`,formatEta:`{{ if lt . 0 }}—{{ else }}{{ template "formatLongTimeRemaining" . }}{{ end }}`,formatSpeed:`{{ if lt . 0 }}—{{ else }}{{ template "formatTokenCount" (round .) }}/s{{ end }}`,formatTokenBreakdown:`{{ $first := true }}{{ if gt .input 0 }}{{ template "formatTokenCount" .input }} in{{ $first = false }}{{ end }}{{ if gt .output 0 }}{{ if not $first }} + {{ end }}{{ template "formatTokenCount" .output }} out{{ $first = false }}{{ end }}{{ if or (gt .cacheCreation 0) (gt .cacheRead 0) }}{{ if not $first }} + {{ end }}{{ template "formatTokenCount" (add .cacheCreation .cacheRead) }} cached{{ $first = false }}{{ end }}{{ if $first }}0 tokens{{ end }}`,budgetStatus:`{{ if or (le .budget 0) (lt .cost 0) }}{{ else }}{{ $pct := minf 100 (mulf (divf .cost .budget) 100) }}{{ $p := printf "%.0f%%" $pct }}{{ if ge $pct .warn }} !{{ $p }}{{ else }}{{ if ge $pct 50 }} +{{ $p }}{{ else }} {{ $p }}{{ end }}{{ end }}{{ end }}`,formatTimeSince:`{{ if lt . 60 }}{{ . }}s{{ else if lt . 3600 }}{{ div . 60 }}m{{ else if lt . 86400 }}{{ div . 3600 }}h{{ else if lt . 604800 }}{{ div . 86400 }}d{{ else }}{{ div . 604800 }}w{{ end }}`,formatDuration:`{{ if lt . 60 }}{{ printf "%.0f" . }}s{{ else if lt . 3600 }}{{ printf "%.0f" (divf . 60) }}m{{ else if lt . 86400 }}{{ printf "%.1f" (divf . 3600) }}h{{ else }}{{ printf "%.1f" (divf . 86400) }}d{{ end }}`,formatResponseTime:`{{ if lt . 60 }}{{ printf "%.1f" . }}s{{ else }}{{ printf "%.1f" (divf . 60) }}m{{ end }}`,formatLongTimeRemaining:`{{ if ge . 1440 }}{{ $d := div . 1440 }}{{ $h := div (mod . 1440) 60 }}{{ if gt $h 0 }}{{ $d }}d {{ $h }}h{{ else }}{{ $d }}d{{ end }}{{ else if ge . 60 }}{{ $h := div . 60 }}{{ $m := mod . 60 }}{{ if gt $m 0 }}{{ $h }}h {{ $m }}m{{ else }}{{ $h }}h{{ end }}{{ else }}{{ . }}m{{ end }}`}};function Qn({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const $n=Qn();function er(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(`›`)?e:e.replace($n,``)}const tr=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],nr=[12288,12288,65281,65376,65504,65510],rr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],ir=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],ar=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],or=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},sr=tr[0],cr=tr.at(-1),lr=nr[0],ur=nr.at(-1);rr[0],rr.at(-1),ir[0],ir.at(-1);const dr=ar[0],fr=ar.at(-1),pr=19968,[mr,hr]=gr(ar);function gr(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(pr>=i&&pr<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}const _r=e=>e<sr||e>cr?!1:or(tr,e),vr=e=>e<lr||e>ur?!1:or(nr,e),yr=e=>e>=mr&&e<=hr?!0:e<dr||e>fr?!1:or(ar,e);function br(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function xr(e,{ambiguousAsWide:t=!1}={}){return br(e),vr(e)||yr(e)||t&&_r(e)?2:1}const Sr=new Intl.Segmenter,Cr=RegExp(`^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Mark}|\\p{Surrogate})+$`,`v`),wr=RegExp(`^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+`,`v`),Tr=RegExp(`^\\p{RGI_Emoji}$`,`v`),Er=/^[\d#*]\u20E3$/,Dr=/\p{Extended_Pictographic}/gu;function Or(e){if(e.length>50)return!1;if(Er.test(e))return!0;if(e.includes(`‍`)){let t=e.match(Dr);return t!==null&&t.length>=2}return!1}function kr(e){return e.replace(wr,``)}function Ar(e){return Cr.test(e)}function jr(e){return e>=4352&&e<=4447||e>=43360&&e<=43388}function Mr(e){return e>=4448&&e<=4519||e>=55216&&e<=55238}function Nr(e){return e>=4520&&e<=4607||e>=55243&&e<=55291}function Pr(e){return jr(e)||Mr(e)||Nr(e)}function Fr(e,t){let n=[];for(let t of e)Cr.test(t)||n.push(t.codePointAt(0));if(n.length===0)return;let r=0;for(let e=0;e<n.length;e++){let i=n[e];if(!Pr(i)){if(r===0)return;for(let i=e;i<n.length;i++)r+=xr(n[i],t);return r}if(jr(i)&&Mr(n[e+1])){r+=2,e+=Nr(n[e+2])?2:1;continue}r+=xr(i,t)}return r}function Ir(e,t){let n=0,r=!0;for(let i of e){if(r){r=!1;continue}i>=`＀`&&i<=`￯`&&(n+=xr(i.codePointAt(0),t))}return n}function Lr(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t,i=e;if(!r&&(i.includes(`\x1B`)||i.includes(`›`))&&(i=er(i)),i.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(i))return i.length;let a=0,o={ambiguousAsWide:!n};for(let{segment:e}of Sr.segment(i)){if(Ar(e))continue;if(Tr.test(e)||Or(e)){a+=2;continue}let t=kr(e),n=Fr(t,o);if(n!==void 0){a+=n;continue}let r=t.codePointAt(0);a+=xr(r,o),a+=Ir(t,o)}return a}const Rr=new Map;function B(e){if(e.length===0)return 0;if(e.length<=64){let t=Rr.get(e);if(t!==void 0)return t}let t=Lr(e);return e.length<=64&&(Rr.size>=4096&&Rr.clear(),Rr.set(e,t)),t}function V(e){return e}function zr(e){return e}function Br(e,t){if(t===0)return``;let n=B(e);return n===t?e:n<t?e+` `.repeat(t-n):Gr(e,t)}function Vr(e,t){if(t<=0)return[``,e];if(t>=B(e))return[e,``];let n=0,r=0;for(let i of e){let e=B(i);if(n+e>t)break;n+=e,r+=i.length}let i=e.slice(0,r),a=e.slice(r);return n<t?[i+` `.repeat(t-n),a]:[i,a]}function Hr(e,t){let n=0,r=0;for(let i of e){if(n>=t)break;let e=B(i);if(n+e>t)break;n+=e,r+=i.length}return zr(r)}function Ur(e,t){return t>=e.length?zr(e.length):zr(t+(e.codePointAt(t)>65535?2:1))}function Wr(e,t){if(t<=0)return zr(0);let n=e.charCodeAt(t-1);if(n>=56320&&n<=57343&&t>=2){let n=e.charCodeAt(t-2);if(n>=55296&&n<=56319)return zr(t-2)}return zr(t-1)}function Gr(e,t){let n=0,r=0;for(let i of e){let e=B(i);if(n+e>t)break;n+=e,r+=i.length}let i=e.slice(0,r),a=t-n;return a>0?i+` `.repeat(a):i}var Kr=class{name;dark;vars;constructor(e,t,n){this.name=e,this.dark=t,this.vars=new Map(n)}get(e){return this.vars.get(e)}};function qr(e){return e.toString(16).padStart(2,`0`)}function Jr(e,t){if(!Number.isInteger(t)||t<0||t>255)throw RangeError(`ColorRgba.${e} must be an integer in [0, 255]; got ${t}`)}var H=class e{red;green;blue;alpha;constructor(e,t,n,r=1){if(this.red=e,this.green=t,this.blue=n,this.alpha=r,Jr(`red`,e),Jr(`green`,t),Jr(`blue`,n),!Number.isFinite(r)||r<0||r>1)throw RangeError(`ColorRgba.alpha must be a finite number in [0, 1]; got ${r}`)}get hex(){let e=`#`+qr(this.red)+qr(this.green)+qr(this.blue);return this.alpha===1?e:e+qr(Math.round(this.alpha*255))}get rgb(){return this.alpha===1?`rgb(${this.red},${this.green},${this.blue})`:`rgba(${this.red},${this.green},${this.blue},${this.alpha})`}get normalized(){return[this.red/255,this.green/255,this.blue/255,this.alpha]}compositeOver(t){if(this.alpha===1)return this;let n=this.alpha;return new e(Math.round(t.red+(this.red-t.red)*n),Math.round(t.green+(this.green-t.green)*n),Math.round(t.blue+(this.blue-t.blue)*n),1)}},Yr=class{colors;matchCache=new Map;constructor(e){this.colors=e}get(e){return this.colors[e]}get size(){return this.colors.length}match(e){let t=`${e.red},${e.green},${e.blue},${e.alpha}`,n=this.matchCache.get(t);if(n!==void 0)return n;let r=0,i=1/0;for(let t=0;t<this.colors.length;t++){let n=this.colors[t],a=n.red-e.red,o=n.green-e.green,s=n.blue-e.blue,c=a*a+o*o+s*s;c<i&&(i=c,r=t)}return this.matchCache.set(t,r),r}},U;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.STANDARD=1]=`STANDARD`,e[e.EIGHT_BIT=2]=`EIGHT_BIT`,e[e.TRUECOLOR=3]=`TRUECOLOR`,e[e.WINDOWS=4]=`WINDOWS`})(U||={});const Xr={truecolor:U.TRUECOLOR,256:U.EIGHT_BIT,ansi:U.STANDARD,none:null,0:null,false:null,1:U.STANDARD,true:U.STANDARD,2:U.EIGHT_BIT,3:U.TRUECOLOR,"iTerm.app":U.TRUECOLOR,Apple_Terminal:U.EIGHT_BIT,vscode:U.TRUECOLOR,Tabby:U.TRUECOLOR,"xterm-kitty":U.TRUECOLOR,"xterm-ghostty":U.TRUECOLOR,wezterm:U.TRUECOLOR,alacritty:U.TRUECOLOR,foot:U.TRUECOLOR,contour:U.TRUECOLOR};function Zr(e={}){let t=e.env??(typeof process<`u`?process.env:{}),n=e.isTTY??(typeof process<`u`?process.stdout?.isTTY??!1:!1),r=t.NO_COLOR;if(r!==void 0&&r!==``)return null;let i=t.FORCE_COLOR;if(i!==void 0&&i!==``){let e=Xr[i];return e===void 0?U.STANDARD:e}if(!n)return null;let a=t.TERM??``;if(a===`dumb`||a===`unknown`)return null;let o=t.COLORTERM;if(o===`truecolor`||o===`24bit`)return U.TRUECOLOR;let s=Xr[a];if(s!==void 0)return s;let c=t.TERM_PROGRAM;if(c!==void 0){let e=Xr[c];if(e!==void 0)return e}return/-256(color)?$/i.test(a)?U.EIGHT_BIT:/-truecolor$/i.test(a)?U.TRUECOLOR:(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a),U.STANDARD)}function Qr(e,t){if(e===`auto`)return Zr(t);if(Object.hasOwn(Xr,e))return Xr[e];throw new $r(`Unknown color depth spec: ${JSON.stringify(e)} (expected "auto", "truecolor", "256", "ansi", or "none")`)}var $r=class extends Error{constructor(e){super(e),this.name=`ColorParseError`}};const ei=new Map;var W=class e{name;type;number;value;downgradeCache=new Map;constructor(e,t,n,r){this.name=e,this.type=t,this.number=n,this.value=r}get isDefault(){return this.type===U.DEFAULT}get isSystemDefined(){return this.type===U.STANDARD||this.type===U.WINDOWS}getAnsiCodes(e=!0){switch(this.type){case U.DEFAULT:return[e?`39`:`49`];case U.STANDARD:{let t=this.number;return e?t<8?[`${30+t}`]:[`${90+t-8}`]:t<8?[`${40+t}`]:[`${100+t-8}`]}case U.EIGHT_BIT:return[e?`38`:`48`,`5`,`${this.number}`];case U.TRUECOLOR:{let t=this.value;return[e?`38`:`48`,`2`,`${t.red}`,`${t.green}`,`${t.blue}`]}case U.WINDOWS:{let t=this.number;return e?t<8?[`${30+t}`]:[`${90+t-8}`]:t<8?[`${40+t}`]:[`${100+t-8}`]}}}flattenAlpha(t){if(this.type!==U.TRUECOLOR||!this.value)return this;let n=this.value.compositeOver(t);return n===this.value?this:e.fromRgba(n)}downgrade(e){if(this.type===U.DEFAULT||this.type<=e)return this;let t=this.downgradeCache.get(e);if(t)return t;let n=this.performDowngrade(e);return this.downgradeCache.set(e,n),n}getTruecolor(e,t=!0){switch(this.type){case U.TRUECOLOR:return this.value;case U.EIGHT_BIT:return mi.get(this.number);case U.STANDARD:return(e??hi).ansiColors.get(this.number);case U.DEFAULT:{let n=e??hi;return t?n.foregroundColor:n.backgroundColor}case U.WINDOWS:return(e??hi).ansiColors.get(this.number)}}static default(){return new e(`default`,U.DEFAULT)}static fromAnsi(t){let n=t<16?U.STANDARD:U.EIGHT_BIT;return new e(`color(${t})`,n,t)}static fromRgba(t){return new e(t.hex,U.TRUECOLOR,void 0,t)}static fromRgb(t,n,r){return e.fromRgba(new H(t,n,r))}static parse(e){let t=e.toLowerCase().trim(),n=ei.get(t);if(n)return n;let r=ai(t);return ei.set(t,r),r}performDowngrade(t){let n=this.getTruecolor();switch(t){case U.EIGHT_BIT:{let t=mi.match(n);return e.fromAnsi(t)}case U.STANDARD:{let t=pi.match(n);return new e(`color(${t})`,U.STANDARD,t)}case U.WINDOWS:case U.TRUECOLOR:return this;case U.DEFAULT:return e.default()}}};const ti=/^#([0-9a-f]{6})$/,ni=/^#([0-9a-f]{8})$/,ri=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,ii=/^color\((\d{1,3})\)$/;function ai(e){if(e===`default`||e===``)return W.default();let t=gi[e];if(t!==void 0)return new W(e,t<16?U.STANDARD:U.EIGHT_BIT,t);let n=ni.exec(e);if(n)return new W(e,U.TRUECOLOR,void 0,si(n[1]));let r=ti.exec(e);if(r)return new W(e,U.TRUECOLOR,void 0,oi(r[1]));let i=ri.exec(e);if(i){let t=parseInt(i[1],10),n=parseInt(i[2],10),r=parseInt(i[3],10);return new W(e,U.TRUECOLOR,void 0,new H(t,n,r))}let a=ii.exec(e);if(a){let t=parseInt(a[1],10);if(t>255)throw new $r(`ColorSpec number ${t} is out of range (0-255)`);return new W(e,t<16?U.STANDARD:U.EIGHT_BIT,t)}throw new $r(`Failed to parse color: "${e}"`)}function oi(e){return new H(parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16))}function si(e){return new H(parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16),parseInt(e.slice(6,8),16)/255)}function ci(e,t,n=.5){return new H(Math.round(e.red+(t.red-e.red)*n),Math.round(e.green+(t.green-e.green)*n),Math.round(e.blue+(t.blue-e.blue)*n),e.alpha+(t.alpha-e.alpha)*n)}var li=class{backgroundColor;foregroundColor;ansiColors;palette;constructor(e,t,n,r){this.backgroundColor=e,this.foregroundColor=t,this.ansiColors=n,this.palette=r}};function ui(){return[new H(0,0,0),new H(128,0,0),new H(0,128,0),new H(128,128,0),new H(0,0,128),new H(128,0,128),new H(0,128,128),new H(192,192,192),new H(128,128,128),new H(255,0,0),new H(0,255,0),new H(255,255,0),new H(0,0,255),new H(255,0,255),new H(0,255,255),new H(255,255,255)]}function di(){let e=ui(),t=[0,95,135,175,215,255];for(let n=0;n<6;n++)for(let r=0;r<6;r++)for(let i=0;i<6;i++)e.push(new H(t[n],t[r],t[i]));for(let t=0;t<24;t++){let n=8+10*t;e.push(new H(n,n,n))}return e}function fi(){return[new H(0,0,0),new H(0,0,128),new H(0,128,0),new H(0,128,128),new H(128,0,0),new H(128,0,128),new H(128,128,0),new H(192,192,192),new H(128,128,128),new H(0,0,255),new H(0,255,0),new H(0,255,255),new H(255,0,0),new H(255,0,255),new H(255,255,0),new H(255,255,255)]}const pi=new Yr(ui()),mi=new Yr(di());new Yr(fi());const hi=new li(new H(0,0,0),new H(255,255,255),pi,new Kr(`default`,!0,new Map)),gi={black:0,red:1,green:2,yellow:3,blue:4,magenta:5,cyan:6,white:7,bright_black:8,bright_red:9,bright_green:10,bright_yellow:11,bright_blue:12,bright_magenta:13,bright_cyan:14,bright_white:15,grey0:16,navy_blue:17,dark_blue:18,blue3:19,blue2:20,blue1:21,dark_green:22,deep_sky_blue4:23,deep_sky_blue5:24,deep_sky_blue6:25,dodger_blue3:26,dodger_blue2:27,green4:28,spring_green4:29,turquoise4:30,deep_sky_blue3:31,deep_sky_blue7:32,dodger_blue1:33,green3:34,spring_green3:35,dark_cyan:36,light_sea_green:37,deep_sky_blue2:38,deep_sky_blue1:39,green5:40,spring_green5:41,spring_green2:42,cyan3:43,dark_turquoise:44,turquoise2:45,green1:46,spring_green6:47,spring_green1:48,medium_spring_green:49,cyan2:50,cyan1:51,dark_red:52,deep_pink4:53,purple4:54,purple5:55,purple3:56,blue_violet:57,orange4:58,grey37:59,medium_purple4:60,slate_blue3:61,slate_blue4:62,royal_blue1:63,chartreuse4:64,dark_sea_green4:65,pale_turquoise4:66,steel_blue:67,steel_blue3:68,cornflower_blue:69,chartreuse3:70,dark_sea_green5:71,cadet_blue:72,cadet_blue2:73,sky_blue3:74,steel_blue1:75,chartreuse5:76,pale_green3:77,sea_green3:78,aquamarine3:79,medium_turquoise:80,steel_blue2:81,chartreuse2:82,sea_green2:83,sea_green1:84,sea_green4:85,aquamarine1:86,dark_slate_gray2:87,dark_red2:88,deep_pink5:89,dark_magenta:90,dark_magenta2:91,dark_violet:92,purple2:93,orange5:94,light_pink4:95,plum4:96,medium_purple3:97,medium_purple5:98,slate_blue1:99,yellow4:100,wheat4:101,grey53:102,light_slate_grey:103,medium_purple:104,light_slate_blue:105,yellow5:106,dark_olive_green3:107,dark_sea_green:108,light_sky_blue3:109,light_sky_blue4:110,sky_blue2:111,chartreuse6:112,dark_olive_green4:113,pale_green4:114,dark_sea_green3:115,dark_slate_gray3:116,sky_blue1:117,chartreuse1:118,light_green:119,light_green2:120,pale_green1:121,aquamarine2:122,dark_slate_gray1:123,red3:124,deep_pink6:125,medium_violet_red:126,magenta3:127,dark_violet2:128,purple:129,dark_orange3:130,indian_red:131,hot_pink3:132,medium_orchid3:133,medium_orchid:134,medium_purple2:135,dark_goldenrod:136,light_salmon3:137,rosy_brown:138,grey63:139,medium_purple6:140,medium_purple1:141,gold3:142,dark_khaki:143,navajo_white3:144,grey69:145,light_steel_blue3:146,light_steel_blue:147,yellow3:148,dark_olive_green5:149,dark_sea_green6:150,dark_sea_green2:151,light_cyan3:152,light_sky_blue1:153,green_yellow:154,dark_olive_green2:155,pale_green2:156,dark_sea_green7:157,dark_sea_green1:158,pale_turquoise1:159,red4:160,deep_pink3:161,deep_pink8:162,magenta4:163,magenta5:164,magenta2:165,dark_orange4:166,indian_red2:167,hot_pink4:168,hot_pink2:169,orchid:170,medium_orchid1:171,orange3:172,light_salmon4:173,light_pink3:174,pink3:175,plum3:176,violet:177,gold4:178,light_goldenrod3:179,tan:180,misty_rose3:181,thistle3:182,plum2:183,yellow6:184,khaki3:185,light_goldenrod2:186,light_yellow3:187,grey84:188,light_steel_blue1:189,yellow2:190,dark_olive_green1:191,dark_olive_green6:192,dark_sea_green8:193,honeydew2:194,light_cyan1:195,red1:196,deep_pink2:197,deep_pink1:198,deep_pink9:199,magenta6:200,magenta1:201,orange_red1:202,indian_red1:203,indian_red3:204,hot_pink5:205,hot_pink:206,medium_orchid2:207,dark_orange:208,salmon1:209,light_coral:210,pale_violet_red1:211,orchid2:212,orchid1:213,orange1:214,sandy_brown:215,light_salmon1:216,light_pink1:217,pink1:218,plum1:219,gold1:220,light_goldenrod4:221,light_goldenrod5:222,navajo_white1:223,misty_rose1:224,thistle1:225,yellow1:226,light_goldenrod1:227,khaki1:228,wheat1:229,cornsilk1:230,grey100:231,grey3:232,grey7:233,grey11:234,grey15:235,grey19:236,grey23:237,grey27:238,grey30:239,grey35:240,grey39:241,grey42:242,grey46:243,grey50:244,grey54:245,grey58:246,grey62:247,grey66:248,grey70:249,grey74:250,grey78:251,grey82:252,grey85:253,grey89:254,grey93:255};for(let[e,t]of Object.entries(gi))e.includes(`grey`)&&(gi[e.replace(`grey`,`gray`)]=t);Object.freeze({hueShift:0,chromaScale:1,lightnessScale:1,lightnessShift:0}),Object.freeze({hueShift:0,chromaScale:1,lightnessScale:-1,lightnessShift:1});function _i(e){return e.hueShift%360==0&&e.chromaScale===1&&e.lightnessScale===1&&e.lightnessShift===0}function vi(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function yi(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function bi(e){return e<0?0:e>1?1:e}const xi=1e-4,Si=1e-7;function Ci(e,t,n){return e>=-xi&&e<=1+xi&&t>=-xi&&t<=1+xi&&n>=-xi&&n<=1+xi}var wi=class e{l;c;h;alpha;constructor(e,t,n,r=1){if(this.l=e,this.c=t,this.h=n,this.alpha=r,!Number.isFinite(e))throw RangeError(`Oklch.l must be finite; got ${e}`);if(!Number.isFinite(t))throw RangeError(`Oklch.c must be finite; got ${t}`);if(!Number.isFinite(n))throw RangeError(`Oklch.h must be finite; got ${n}`);if(!Number.isFinite(r)||r<0||r>1)throw RangeError(`Oklch.alpha must be a finite number in [0,1]; got ${r}`)}static fromRgba(t){let[n,r,i,a]=t.normalized,o=vi(n),s=vi(r),c=vi(i),l=.4122214708*o+.5363325363*s+.0514459929*c,u=.2119034982*o+.6806995451*s+.1073969566*c,d=.0883024619*o+.2817188376*s+.6299787005*c,f=Math.cbrt(l),p=Math.cbrt(u),m=Math.cbrt(d),h=.2104542553*f+.793617785*p-.0040720468*m,g=1.9779984951*f-2.428592205*p+.4505937099*m,_=.0259040371*f+.7827717662*p-.808675766*m,v=Math.sqrt(g*g+_*_),y=180/Math.PI*Math.atan2(_,g);return y<0&&(y+=360),v<Si&&(y=0),new e(h,v,y,a)}toRgba(){let e=bi(this.l),t=Math.max(0,this.c),n=this.findInGamutChroma(e,t,this.h),{r,g:i,b:a}=this.toLinearRgb(e,n,this.h);return new H(Math.round(bi(yi(r))*255),Math.round(bi(yi(i))*255),Math.round(bi(yi(a))*255),this.alpha)}applyKey(t){if(_i(t))return this;let n=bi(this.l*t.lightnessScale+t.lightnessShift),r=Math.max(0,this.c*t.chromaScale),i=(this.h+t.hueShift)%360;return i<0&&(i+=360),r<Si&&(i=0),new e(n,r,i,this.alpha)}toLinearRgb(e,t,n){let r=Math.PI/180*n,i=t*Math.cos(r),a=t*Math.sin(r),o=e+.3963377774*i+.2158037573*a,s=e-.1055613458*i-.0638541728*a,c=e-.0894841775*i-1.291485548*a,l=o*o*o,u=s*s*s,d=c*c*c;return{r:4.0767416621*l-3.3077115913*u+.2309699292*d,g:-1.2684380046*l+2.6097574011*u-.3413193965*d,b:-.0041960863*l-.7034186147*u+1.707614701*d}}findInGamutChroma(e,t,n){let r=this.toLinearRgb(e,t,n);if(Ci(r.r,r.g,r.b))return t;let i=0,a=t;for(let t=0;t<24;t++){let t=(i+a)/2,r=this.toLinearRgb(e,t,n);Ci(r.r,r.g,r.b)?i=t:a=t}return i}};function Ti(e){let t=e.red/255,n=e.green/255,r=e.blue/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s=i-a;if(s===0)return{h:0,s:0,l:o};let c=s/(o>.5?2-i-a:i+a),l;return l=i===t?(n-r)/s%6:i===n?(r-t)/s+2:(t-n)/s+4,l=(l*60+360)%360,{h:l,s:c,l:o}}function Ei(e){let t=Math.round(e);return t<0?0:t>255?255:t}function Di(e){let{h:t,s:n,l:r}=e;if(n===0){let e=Ei(r*255);return new H(e,e,e)}let i=(1-Math.abs(2*r-1))*n,a=t/60,o=i*(1-Math.abs(a%2-1)),s=0,c=0,l=0;a<1?[s,c,l]=[i,o,0]:a<2?[s,c,l]=[o,i,0]:a<3?[s,c,l]=[0,i,o]:a<4?[s,c,l]=[0,o,i]:a<5?[s,c,l]=[o,0,i]:[s,c,l]=[i,0,o];let u=r-i/2;return new H(Ei((s+u)*255),Ei((c+u)*255),Ei((l+u)*255))}function Oi(e){return e<0?0:e>1?1:e}function ki(e,t){let n=Ti(e);return n.l=Oi(n.l-.1*t),Di(n)}function G(e,t,n){return ci(t,e,Oi(n))}function Ai(e){return ji(e)>.179?new H(0,0,0):new H(255,255,255)}function ji(e){let t=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(e.red)+.7152*t(e.green)+.0722*t(e.blue)}const Mi=/^(.+)-(darken|lighten)-(\d+)$/,Ni=/^(\d+(?:\.\d+)?)%$/;function Pi(e){let t=e.trim();if(t===``)return null;let[n,r,...i]=t.split(/\s+/);if(n===void 0||i.length>0)return null;let a=null;if(r!==void 0){let e=Ni.exec(r);if(e===null)return null;let t=parseFloat(e[1]);if(t<0||t>100)return null;a=t/100}let o=Mi.exec(n);if(o!==null){let e=parseInt(o[3],10);return{name:o[1],darkenLevels:o[2]===`darken`?e:-e,alpha:a}}return{name:n,darkenLevels:0,alpha:a}}var Fi=class{palette;constructor(e){this.palette=e}resolve(e,t){let n=Pi(e);if(n===null)return null;let r=this.lookupBase(n.name,t);if(r===null)return null;let i=ki(r,n.darkenLevels);return n.alpha===null?i:t?.against?G(i,t.against,n.alpha):null}lookupBase(e,t){return e===`auto`?t?.against?Ai(t.against):null:this.palette.get(e)??null}};const Ii=[`primary`,`secondary`,`accent`,`success`,`warning`,`error`];function Li(e,t,n){let r=new Map;r.set(`background`,n.background),r.set(`foreground`,n.foreground);for(let e of Ii)r.set(e,n[e]);r.set(`surface`,ci(n.background,n.foreground,.05));let i=Ai(n.background);for(let e of Ii){let t=n[e];r.set(`${e}-muted`,ci(t,n.background,.7)),r.set(`text-${e}`,G(t,i,.66)),r.set(`on-${e}`,Ai(t))}return new Kr(e,t,r)}const Ri={"atom-one-dark":{name:`atom-one-dark`,dark:!0,vars:{accent:`#A378C2`,"accent-darken-1":`#8E65AD`,"accent-darken-2":`#7A5299`,"accent-darken-3":`#674085`,"accent-lighten-1":`#B78BD6`,"accent-lighten-2":`#CC9FEC`,"accent-lighten-3":`#E2B3FF`,"accent-muted":`#4C425E`,background:`#282C34`,"background-darken-1":`#181C23`,"background-darken-2":`#050A14`,"background-darken-3":`#000000`,"background-lighten-1":`#383C44`,"background-lighten-2":`#494D56`,"background-lighten-3":`#5B5F68`,"block-cursor-background":`#61AFEF`,"block-cursor-blurred-background":`#61AFEF4C`,"block-cursor-blurred-foreground":`#ABB2BF`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#61AFEF`,"border-blurred":`#353B47`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#ABB2BF`,error:`#EF6262`,"error-darken-1":`#D84D50`,"error-darken-2":`#C1373E`,"error-darken-3":`#AA1F2E`,"error-lighten-1":`#FF7674`,"error-lighten-2":`#FF8B87`,"error-lighten-3":`#FFA09B`,"error-muted":`#643C41`,"footer-background":`#4F5666`,"footer-description-background":`#00000000`,"footer-description-foreground":`#ABB2BF`,"footer-foreground":`#ABB2BF`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#A378C2`,foreground:`#ABB2BF`,"foreground-darken-1":`#979DAA`,"foreground-darken-2":`#838A96`,"foreground-darken-3":`#707783`,"foreground-disabled":`#ABB2BF60`,"foreground-lighten-1":`#BFC6D3`,"foreground-lighten-2":`#D4DBE8`,"foreground-lighten-3":`#E9F0FE`,"foreground-muted":`#ABB2BF99`,"input-cursor-background":`#ABB2BF`,"input-cursor-foreground":`#282C34`,"input-selection-background":`#77C3FF66`,"link-background":`#00000000`,"link-background-hover":`#61AFEF`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#61AFEF`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#61AFEF`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#61AFEF`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#ABB2BF`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#ABB2BF`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#ABB2BF99`,panel:`#4F5666`,"panel-darken-1":`#3D4453`,"panel-darken-2":`#2C3342`,"panel-darken-3":`#1C2331`,"panel-lighten-1":`#616878`,"panel-lighten-2":`#737A8B`,"panel-lighten-3":`#868E9F`,primary:`#61AFEF`,"primary-background":`#4F5B6A`,"primary-background-darken-1":`#3F4D5D`,"primary-background-darken-2":`#303F50`,"primary-background-darken-3":`#303F50`,"primary-background-lighten-1":`#5E6A77`,"primary-background-lighten-2":`#6E7884`,"primary-background-lighten-3":`#7D8791`,"primary-darken-1":`#489BD9`,"primary-darken-2":`#2C87C4`,"primary-darken-3":`#0074AF`,"primary-lighten-1":`#77C3FF`,"primary-lighten-2":`#8ED8FF`,"primary-lighten-3":`#A4EDFF`,"primary-muted":`#39536C`,scrollbar:`#355674`,"scrollbar-active":`#61AFEF`,"scrollbar-background":`#181C23`,"scrollbar-background-active":`#181C23`,"scrollbar-background-hover":`#181C23`,"scrollbar-corner-color":`#181C23`,"scrollbar-hover":`#3C6589`,secondary:`#C678DD`,"secondary-background":`#5B5567`,"secondary-background-darken-1":`#4D465A`,"secondary-background-darken-2":`#3F374D`,"secondary-background-darken-3":`#3F374D`,"secondary-background-lighten-1":`#6A6475`,"secondary-background-lighten-2":`#787382`,"secondary-background-lighten-3":`#87828F`,"secondary-darken-1":`#B064C7`,"secondary-darken-2":`#9B50B3`,"secondary-darken-3":`#873D9E`,"secondary-lighten-1":`#DB8CF2`,"secondary-lighten-2":`#F1A0FF`,"secondary-lighten-3":`#FFB5FF`,"secondary-muted":`#574266`,success:`#62F062`,"success-darken-1":`#48DA4D`,"success-darken-2":`#29C438`,"success-darken-3":`#00AF22`,"success-lighten-1":`#7AFF76`,"success-lighten-2":`#91FF8A`,"success-lighten-3":`#A8FF9F`,"success-muted":`#396641`,surface:`#3B414D`,"surface-active":`#484E5B`,"surface-darken-1":`#2A303B`,"surface-darken-2":`#1A202B`,"surface-darken-3":`#09101B`,"surface-lighten-1":`#4C525E`,"surface-lighten-2":`#5E6471`,"surface-lighten-3":`#707684`,text:`#FFFFFFDD`,"text-accent":`#C2A5D6`,"text-disabled":`#FFFFFF60`,"text-error":`#F59797`,"text-muted":`#FFFFFF99`,"text-primary":`#96CAF4`,"text-secondary":`#D9A5E8`,"text-success":`#97F597`,"text-warning":`#E9CC92`,warning:`#DDB25B`,"warning-darken-1":`#C79D47`,"warning-darken-2":`#B28A34`,"warning-darken-3":`#9C7721`,"warning-lighten-1":`#F4C66E`,"warning-lighten-2":`#FFDB82`,"warning-lighten-3":`#FFF096`,"warning-muted":`#5E543F`}},"atom-one-light":{name:`atom-one-light`,dark:!1,vars:{accent:`#BE9232`,"accent-darken-1":`#A97E1D`,"accent-darken-2":`#936B01`,"accent-darken-3":`#7E5900`,"accent-lighten-1":`#D5A545`,"accent-lighten-2":`#EBB959`,"accent-lighten-3":`#FFCE6C`,"accent-muted":`#E8DABE`,background:`#FAFAFA`,"background-darken-1":`#E4E4E4`,"background-darken-2":`#CFCFCF`,"background-darken-3":`#BABABA`,"background-lighten-1":`#FFFFFF`,"background-lighten-2":`#FFFFFF`,"background-lighten-3":`#FFFFFF`,"block-cursor-background":`#4078F2`,"block-cursor-blurred-background":`#4078F24C`,"block-cursor-blurred-foreground":`#383A42`,"block-cursor-foreground":`#000000DD`,"block-hover-background":`#00000019`,boost:`#0000000A`,"boost-darken-1":`#0000000A`,"boost-darken-2":`#0000000A`,"boost-darken-3":`#0000000A`,"boost-lighten-1":`#1616160A`,"boost-lighten-2":`#2525250A`,"boost-lighten-3":`#3535350A`,border:`#4078F2`,"border-blurred":`#D8D8D8`,"button-color-foreground":`#000000DD`,"button-foreground":`#383A42`,error:`#F13F3F`,"error-darken-1":`#D9232D`,"error-darken-2":`#C1001D`,"error-darken-3":`#A9000D`,"error-lighten-1":`#FF5650`,"error-lighten-2":`#FF6C62`,"error-lighten-3":`#FF8275`,"error-muted":`#F7C1C1`,"footer-background":`#CCCCCC`,"footer-description-background":`#00000000`,"footer-description-foreground":`#383A42`,"footer-foreground":`#383A42`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#BF9232`,foreground:`#383A42`,"foreground-darken-1":`#272931`,"foreground-darken-2":`#181A21`,"foreground-darken-3":`#040612`,"foreground-disabled":`#383A4260`,"foreground-lighten-1":`#494B53`,"foreground-lighten-2":`#5A5C65`,"foreground-lighten-3":`#6D6F78`,"foreground-muted":`#383A4299`,"input-cursor-background":`#383A42`,"input-cursor-foreground":`#FAFAFA`,"input-selection-background":`#5C8AFF66`,"link-background":`#00000000`,"link-background-hover":`#4078F2`,"link-color":`#000000DD`,"link-color-hover":`#000000DD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#4078F2`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#4078F2`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#4078F2`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#383A42`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#383A42`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#383A4299`,panel:`#CCCCCC`,"panel-darken-1":`#B7B7B7`,"panel-darken-2":`#A3A3A3`,"panel-darken-3":`#8F8F8F`,"panel-lighten-1":`#E1E1E1`,"panel-lighten-2":`#F6F6F6`,"panel-lighten-3":`#FFFFFF`,primary:`#4078F2`,"primary-background":`#4078F2`,"primary-background-darken-1":`#1865DC`,"primary-background-darken-2":`#0053C6`,"primary-background-darken-3":`#0043B1`,"primary-background-lighten-1":`#5C8AFF`,"primary-background-lighten-2":`#759EFF`,"primary-background-lighten-3":`#8DB2FF`,"primary-darken-1":`#1865DC`,"primary-darken-2":`#0053C6`,"primary-darken-3":`#0043B1`,"primary-lighten-1":`#5C8AFF`,"primary-lighten-2":`#759EFF`,"primary-lighten-3":`#8DB2FF`,"primary-muted":`#C2D3F7`,scrollbar:`#A2B8E9`,"scrollbar-active":`#4078F2`,"scrollbar-background":`#E4E4E4`,"scrollbar-background-active":`#E4E4E4`,"scrollbar-background-hover":`#E4E4E4`,"scrollbar-corner-color":`#E4E4E4`,"scrollbar-hover":`#92AEEB`,secondary:`#A626A4`,"secondary-background":`#A626A4`,"secondary-background-darken-1":`#90008F`,"secondary-background-darken-2":`#7B007C`,"secondary-background-darken-3":`#670069`,"secondary-background-lighten-1":`#BB3EB8`,"secondary-background-lighten-2":`#D154CD`,"secondary-background-lighten-3":`#E769E2`,"secondary-darken-1":`#90008F`,"secondary-darken-2":`#7B007C`,"secondary-darken-3":`#670069`,"secondary-lighten-1":`#BB3EB8`,"secondary-lighten-2":`#D154CD`,"secondary-lighten-3":`#E769E2`,"secondary-muted":`#E0BAE0`,success:`#6BF23F`,"success-darken-1":`#52DC25`,"success-darken-2":`#36C600`,"success-darken-3":`#05B100`,"success-lighten-1":`#83FF55`,"success-lighten-2":`#9BFF6B`,"success-lighten-3":`#B2FF80`,"success-muted":`#CFF7C1`,surface:`#E0E0E0`,"surface-active":`#F1F1F1`,"surface-darken-1":`#CACACA`,"surface-darken-2":`#B6B6B6`,"surface-darken-3":`#A2A2A2`,"surface-lighten-1":`#F5F5F5`,"surface-lighten-2":`#FFFFFF`,"surface-lighten-3":`#FFFFFF`,text:`#000000DD`,"text-accent":`#7E6021`,"text-disabled":`#00000060`,"text-error":`#9F2929`,"text-muted":`#00000099`,"text-primary":`#2A4F9F`,"text-secondary":`#6D196C`,"text-success":`#479F29`,"text-warning":`#8E8F24`,warning:`#D7D938`,"warning-darken-1":`#C1C41C`,"warning-darken-2":`#ABAF00`,"warning-darken-3":`#969B00`,"warning-lighten-1":`#EEEE4E`,"warning-lighten-2":`#FFFF64`,"warning-lighten-3":`#FFFF79`,"warning-muted":`#EFF0BF`}},"catppuccin-frappe":{name:`catppuccin-frappe`,dark:!0,vars:{accent:`#F4B8E4`,"accent-darken-1":`#DEA3CE`,"accent-darken-2":`#C98FBA`,"accent-darken-3":`#B47BA5`,"accent-lighten-1":`#FFCCF9`,"accent-lighten-2":`#FFE2FF`,"accent-lighten-3":`#FFF7FF`,"accent-muted":`#6A5B75`,background:`#303446`,"background-darken-1":`#1F2435`,"background-darken-2":`#101424`,"background-darken-3":`#000016`,"background-lighten-1":`#404457`,"background-lighten-2":`#525669`,"background-lighten-3":`#64687C`,"block-cursor-background":`#CA9EE6`,"block-cursor-blurred-background":`#CA9EE64C`,"block-cursor-blurred-foreground":`#C6D0F5`,"block-cursor-foreground":`#292C3C`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#BABBF1`,"border-blurred":`#838BA7`,"button-color-foreground":`#303446`,"button-foreground":`#C6D0F5`,error:`#E68284`,"error-darken-1":`#D06E71`,"error-darken-2":`#BA5A5E`,"error-darken-3":`#A4474C`,"error-lighten-1":`#FD9697`,"error-lighten-2":`#FFAAAB`,"error-lighten-3":`#FFBFBF`,"error-muted":`#664B58`,"footer-background":`#51576D`,"footer-description-background":`#00000000`,"footer-description-foreground":`#C6D0F5`,"footer-foreground":`#C6D0F5`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#F4B8E4`,foreground:`#C6D0F5`,"foreground-darken-1":`#B1BBDF`,"foreground-darken-2":`#9CA7CA`,"foreground-darken-3":`#8993B5`,"foreground-disabled":`#C6D0F560`,"foreground-lighten-1":`#DBE5FF`,"foreground-lighten-2":`#F0FAFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#C6D0F599`,"input-cursor-background":`#F2D5CF`,"input-cursor-foreground":`#232634`,"input-selection-background":`#949CBB4C`,"link-background":`#00000000`,"link-background-hover":`#CA9EE6`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#CA9EE6`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#CA9EE6`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#CA9EE6`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#C6D0F5`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#C6D0F5`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#C6D0F599`,panel:`#51576D`,"panel-darken-1":`#3F455A`,"panel-darken-2":`#2E3448`,"panel-darken-3":`#1D2437`,"panel-lighten-1":`#63697F`,"panel-lighten-2":`#767B93`,"panel-lighten-3":`#898FA7`,primary:`#CA9EE6`,"primary-background":`#625F76`,"primary-background-darken-1":`#54516A`,"primary-background-darken-2":`#47435E`,"primary-background-darken-3":`#47435E`,"primary-background-lighten-1":`#706D82`,"primary-background-lighten-2":`#7E7B8E`,"primary-background-lighten-3":`#8C899A`,"primary-darken-1":`#B58AD0`,"primary-darken-2":`#A076BB`,"primary-darken-3":`#8C63A7`,"primary-lighten-1":`#DFB2FB`,"primary-lighten-2":`#F4C7FF`,"primary-lighten-3":`#FFDCFF`,"primary-muted":`#5E5376`,scrollbar:`#63547B`,"scrollbar-active":`#CA9EE6`,"scrollbar-background":`#1F2435`,"scrollbar-background-active":`#1F2435`,"scrollbar-background-hover":`#1F2435`,"scrollbar-corner-color":`#1F2435`,"scrollbar-hover":`#74618D`,secondary:`#EE9F76`,"secondary-background":`#666067`,"secondary-background-darken-1":`#59525A`,"secondary-background-darken-2":`#4C444D`,"secondary-background-darken-3":`#4C444D`,"secondary-background-lighten-1":`#746E75`,"secondary-background-lighten-2":`#817C82`,"secondary-background-lighten-3":`#8F8A8F`,"secondary-darken-1":`#D88B63`,"secondary-darken-2":`#C27750`,"secondary-darken-3":`#AC643E`,"secondary-lighten-1":`#FFB389`,"secondary-lighten-2":`#FFC89D`,"secondary-lighten-3":`#FFDDB1`,"secondary-muted":`#695454`,success:`#A6D189`,"success-darken-1":`#91BC75`,"success-darken-2":`#7DA762`,"success-darken-3":`#6A9350`,"success-lighten-1":`#BAE69C`,"success-lighten-2":`#CFFBB1`,"success-lighten-3":`#E5FFC5`,"success-muted":`#53635A`,surface:`#414559`,"surface-active":`#4F5267`,"surface-darken-1":`#303447`,"surface-darken-2":`#1F2436`,"surface-darken-3":`#101526`,"surface-lighten-1":`#52566B`,"surface-lighten-2":`#64687E`,"surface-lighten-3":`#777B91`,text:`#FFFFFFDD`,"text-accent":`#F7D0ED`,"text-disabled":`#FFFFFF60`,"text-error":`#EFACAD`,"text-muted":`#FFFFFF99`,"text-primary":`#DCBEEE`,"text-secondary":`#F4BFA4`,"text-success":`#C4E0B1`,"text-warning":`#EDDAB5`,warning:`#E4C890`,"warning-darken-1":`#CFB37C`,"warning-darken-2":`#BA9F69`,"warning-darken-3":`#A58B56`,"warning-lighten-1":`#FADCA4`,"warning-lighten-2":`#FFF2B8`,"warning-lighten-3":`#FFFFCD`,"warning-muted":`#66605C`}},"catppuccin-latte":{name:`catppuccin-latte`,dark:!1,vars:{accent:`#FD640B`,"accent-darken-1":`#E54F00`,"accent-darken-2":`#CC3900`,"accent-darken-3":`#B42200`,"accent-lighten-1":`#FF7825`,"accent-lighten-2":`#FF8D3A`,"accent-lighten-3":`#FFA24F`,"accent-muted":`#F3C6AE`,background:`#EFF1F5`,"background-darken-1":`#D9DBDF`,"background-darken-2":`#C4C6CA`,"background-darken-3":`#B0B2B5`,"background-lighten-1":`#FFFFFF`,"background-lighten-2":`#FFFFFF`,"background-lighten-3":`#FFFFFF`,"block-cursor-background":`#8839EF`,"block-cursor-blurred-background":`#8839EF4C`,"block-cursor-blurred-foreground":`#4C4F69`,"block-cursor-foreground":`#000000DD`,"block-hover-background":`#00000019`,boost:`#0000000A`,"boost-darken-1":`#0000000A`,"boost-darken-2":`#0000000A`,"boost-darken-3":`#0000000A`,"boost-lighten-1":`#1616160A`,"boost-lighten-2":`#2525250A`,"boost-lighten-3":`#3535350A`,border:`#8839EF`,"border-blurred":`#DEE1E7`,"button-color-foreground":`#EFF1F5`,"button-foreground":`#4C4F69`,error:`#D10F39`,"error-darken-1":`#BA0028`,"error-darken-2":`#A20019`,"error-darken-3":`#8A0008`,"error-lighten-1":`#EA324A`,"error-lighten-2":`#FF4B5B`,"error-lighten-3":`#FF626E`,"error-muted":`#E6ADBC`,"footer-background":`#CCD0DA`,"footer-description-background":`#00000000`,"footer-description-foreground":`#4C4F69`,"footer-foreground":`#4C4F69`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FE640B`,foreground:`#4C4F69`,"foreground-darken-1":`#3A3D56`,"foreground-darken-2":`#292D45`,"foreground-darken-3":`#191D34`,"foreground-disabled":`#4C4F6960`,"foreground-lighten-1":`#5E607B`,"foreground-lighten-2":`#70738F`,"foreground-lighten-3":`#8386A2`,"foreground-muted":`#4C4F6999`,"input-cursor-background":`#4C4F69`,"input-cursor-foreground":`#EFF1F5`,"input-selection-background":`#9E4DFF66`,"link-background":`#00000000`,"link-background-hover":`#8839EF`,"link-color":`#000000DD`,"link-color-hover":`#000000DD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#8839EF`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#8839EF`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#8839EF`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#4C4F69`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#4C4F69`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#4C4F6999`,panel:`#CCD0DA`,"panel-darken-1":`#B7BBC5`,"panel-darken-2":`#A3A6B0`,"panel-darken-3":`#8F939C`,"panel-lighten-1":`#E1E5EF`,"panel-lighten-2":`#F6FAFF`,"panel-lighten-3":`#FFFFFF`,primary:`#8839EF`,"primary-background":`#8839EF`,"primary-background-darken-1":`#7122D9`,"primary-background-darken-2":`#5901C3`,"primary-background-darken-3":`#4000AE`,"primary-background-lighten-1":`#9E4DFF`,"primary-background-lighten-2":`#B562FF`,"primary-background-lighten-3":`#CC76FF`,"primary-darken-1":`#7122D9`,"primary-darken-2":`#5901C3`,"primary-darken-3":`#4000AE`,"primary-lighten-1":`#9E4DFF`,"primary-lighten-2":`#B562FF`,"primary-lighten-3":`#CC76FF`,"primary-muted":`#D0B9F3`,scrollbar:`#B89AE5`,"scrollbar-active":`#8839EF`,"scrollbar-background":`#D9DBDF`,"scrollbar-background-active":`#D9DBDF`,"scrollbar-background-hover":`#D9DBDF`,"scrollbar-corner-color":`#D9DBDF`,"scrollbar-hover":`#B08AE7`,secondary:`#DB8A78`,"secondary-background":`#DB8A78`,"secondary-background-darken-1":`#C57665`,"secondary-background-darken-2":`#B06353`,"secondary-background-darken-3":`#9A5041`,"secondary-background-lighten-1":`#F29D8B`,"secondary-background-lighten-2":`#FFB29E`,"secondary-background-lighten-3":`#FFC7B3`,"secondary-darken-1":`#C57665`,"secondary-darken-2":`#B06353`,"secondary-darken-3":`#9A5041`,"secondary-lighten-1":`#F29D8B`,"secondary-lighten-2":`#FFB29E`,"secondary-lighten-3":`#FFC7B3`,"secondary-muted":`#E9D2CF`,success:`#40A02B`,"success-darken-1":`#278B14`,"success-darken-2":`#007800`,"success-darken-3":`#006400`,"success-lighten-1":`#56B43F`,"success-lighten-2":`#6BC952`,"success-lighten-3":`#81DE66`,"success-muted":`#BAD8B8`,surface:`#E6E9EF`,"surface-active":`#F7FAFF`,"surface-darken-1":`#D0D3D9`,"surface-darken-2":`#BCBFC4`,"surface-darken-3":`#A7AAB0`,"surface-lighten-1":`#FBFEFF`,"surface-lighten-2":`#FFFFFF`,"surface-lighten-3":`#FFFFFF`,text:`#000000DD`,"text-accent":`#A74207`,"text-disabled":`#00000060`,"text-error":`#8A0925`,"text-muted":`#00000099`,"text-primary":`#59259D`,"text-secondary":`#915B4F`,"text-success":`#2A691C`,"text-warning":`#935D13`,warning:`#DE8E1D`,"warning-darken-1":`#C77A00`,"warning-darken-2":`#B06700`,"warning-darken-3":`#9A5500`,"warning-lighten-1":`#F6A134`,"warning-lighten-2":`#FFB648`,"warning-lighten-3":`#FFCA5D`,"warning-muted":`#EAD3B4`}},"catppuccin-macchiato":{name:`catppuccin-macchiato`,dark:!0,vars:{accent:`#F5BDE6`,"accent-darken-1":`#DFA8D0`,"accent-darken-2":`#CA94BC`,"accent-darken-3":`#B580A7`,"accent-lighten-1":`#FFD1FB`,"accent-lighten-2":`#FFE7FF`,"accent-lighten-3":`#FFFCFF`,"accent-muted":`#62546D`,background:`#24273A`,"background-darken-1":`#141729`,"background-darken-2":`#00021A`,"background-darken-3":`#000007`,"background-lighten-1":`#34374B`,"background-lighten-2":`#45485C`,"background-lighten-3":`#57596F`,"block-cursor-background":`#C6A0F6`,"block-cursor-blurred-background":`#C6A0F64C`,"block-cursor-blurred-foreground":`#CAD3F5`,"block-cursor-foreground":`#1E2030`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#B7BDF8`,"border-blurred":`#737994`,"button-color-foreground":`#24273A`,"button-foreground":`#CAD3F5`,error:`#ED8796`,"error-darken-1":`#D67382`,"error-darken-2":`#C05F6F`,"error-darken-3":`#AB4C5D`,"error-lighten-1":`#FF9BA9`,"error-lighten-2":`#FFAFBE`,"error-lighten-3":`#FFC4D3`,"error-muted":`#604355`,"footer-background":`#494D64`,"footer-description-background":`#00000000`,"footer-description-foreground":`#CAD3F5`,"footer-foreground":`#CAD3F5`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#F5BDE6`,foreground:`#CAD3F5`,"foreground-darken-1":`#B5BEDF`,"foreground-darken-2":`#A0A9CA`,"foreground-darken-3":`#8C95B5`,"foreground-disabled":`#CAD3F560`,"foreground-lighten-1":`#DFE8FF`,"foreground-lighten-2":`#F4FDFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#CAD3F599`,"input-cursor-background":`#F4DBD6`,"input-cursor-foreground":`#181926`,"input-selection-background":`#838BA74C`,"link-background":`#00000000`,"link-background-hover":`#C6A0F6`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#C6A0F6`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#C6A0F6`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#C6A0F6`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#CAD3F5`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#CAD3F5`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#CAD3F599`,panel:`#494D64`,"panel-darken-1":`#373B51`,"panel-darken-2":`#262B40`,"panel-darken-3":`#161C2F`,"panel-lighten-1":`#5A5E76`,"panel-lighten-2":`#6D7189`,"panel-lighten-3":`#80849D`,primary:`#C6A0F6`,"primary-background":`#59566F`,"primary-background-darken-1":`#4A4762`,"primary-background-darken-2":`#3C3956`,"primary-background-darken-3":`#3C3956`,"primary-background-lighten-1":`#67657C`,"primary-background-lighten-2":`#767488`,"primary-background-lighten-3":`#858395`,"primary-darken-1":`#B08CE0`,"primary-darken-2":`#9C78CB`,"primary-darken-3":`#8865B6`,"primary-lighten-1":`#DBB4FF`,"primary-lighten-2":`#F1C9FF`,"primary-lighten-3":`#FFDEFF`,"primary-muted":`#544B72`,scrollbar:`#5B4D7B`,"scrollbar-active":`#C6A0F6`,"scrollbar-background":`#141729`,"scrollbar-background-active":`#141729`,"scrollbar-background-hover":`#141729`,"scrollbar-corner-color":`#141729`,"scrollbar-hover":`#6D5B8F`,secondary:`#F4A97F`,"secondary-background":`#5F5760`,"secondary-background-darken-1":`#514852`,"secondary-background-darken-2":`#433A44`,"secondary-background-darken-3":`#433A44`,"secondary-background-lighten-1":`#6D666E`,"secondary-background-lighten-2":`#7B757C`,"secondary-background-lighten-3":`#89838A`,"secondary-darken-1":`#DE946B`,"secondary-darken-2":`#C88159`,"secondary-darken-3":`#B26E47`,"secondary-lighten-1":`#FFBD92`,"secondary-lighten-2":`#FFD2A6`,"secondary-lighten-3":`#FFE7BB`,"secondary-muted":`#624E4E`,success:`#A6DA95`,"success-darken-1":`#91C481`,"success-darken-2":`#7DB06E`,"success-darken-3":`#6A9C5B`,"success-lighten-1":`#BAEFA9`,"success-lighten-2":`#CFFFBD`,"success-lighten-3":`#E5FFD2`,"success-muted":`#4B5C55`,surface:`#363A4F`,"surface-active":`#43475D`,"surface-darken-1":`#25293D`,"surface-darken-2":`#151A2D`,"surface-darken-3":`#03061D`,"surface-lighten-1":`#474B60`,"surface-lighten-2":`#595C73`,"surface-lighten-3":`#6B6F86`,text:`#FFFFFFDD`,"text-accent":`#F8D3EE`,"text-disabled":`#FFFFFF60`,"text-error":`#F3AFB9`,"text-muted":`#FFFFFF99`,"text-primary":`#D9C0F9`,"text-secondary":`#F8C6AA`,"text-success":`#C4E6B9`,"text-warning":`#F3E2BF`,warning:`#EED49F`,"warning-darken-1":`#D8BF8B`,"warning-darken-2":`#C3AA77`,"warning-darken-3":`#AE9664`,"warning-lighten-1":`#FFE9B3`,"warning-lighten-2":`#FFFEC7`,"warning-lighten-3":`#FFFFDD`,"warning-muted":`#605A58`}},"catppuccin-mocha":{name:`catppuccin-mocha`,dark:!0,vars:{accent:`#F9B387`,"accent-darken-1":`#E39E73`,"accent-darken-2":`#CD8A60`,"accent-darken-3":`#B7774E`,"accent-lighten-1":`#FFC79A`,"accent-lighten-2":`#FFDCAE`,"accent-lighten-3":`#FFF2C3`,"accent-muted":`#5B4642`,background:`#181825`,"background-darken-1":`#040216`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#272735`,"background-lighten-2":`#373746`,"background-lighten-3":`#484857`,"block-cursor-background":`#F5C2E7`,"block-cursor-blurred-background":`#F5C2E74C`,"block-cursor-blurred-foreground":`#CDD6F4`,"block-cursor-foreground":`#1E1E2E`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#B4BEFE`,"border-blurred":`#585B70`,"button-color-foreground":`#181825`,"button-foreground":`#CDD6F4`,error:`#F28FAD`,"error-darken-1":`#DB7A99`,"error-darken-2":`#C66785`,"error-darken-3":`#B05372`,"error-lighten-1":`#FFA3C1`,"error-lighten-2":`#FFB8D6`,"error-lighten-3":`#FFCDEB`,"error-muted":`#593B4D`,"footer-background":`#45475A`,"footer-description-background":`#00000000`,"footer-description-foreground":`#CDD6F4`,"footer-foreground":`#CDD6F4`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FAB387`,foreground:`#CDD6F4`,"foreground-darken-1":`#B8C1DE`,"foreground-darken-2":`#A3ACC9`,"foreground-darken-3":`#8F98B4`,"foreground-disabled":`#CDD6F460`,"foreground-lighten-1":`#E2EBFF`,"foreground-lighten-2":`#F7FFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#CDD6F499`,"input-cursor-background":`#F5E0DC`,"input-cursor-foreground":`#11111B`,"input-selection-background":`#9399B24C`,"link-background":`#00000000`,"link-background-hover":`#F5C2E7`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#F5C2E7`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#F5C2E7`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#F5C2E7`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#CDD6F4`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#CDD6F4`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#CDD6F499`,panel:`#45475A`,"panel-darken-1":`#333648`,"panel-darken-2":`#232637`,"panel-darken-3":`#131627`,"panel-lighten-1":`#56586C`,"panel-lighten-2":`#696A7F`,"panel-lighten-3":`#7B7D92`,primary:`#F5C2E7`,"primary-background":`#564F5E`,"primary-background-darken-1":`#474050`,"primary-background-darken-2":`#393142`,"primary-background-darken-3":`#393142`,"primary-background-lighten-1":`#655F6C`,"primary-background-lighten-2":`#746E7A`,"primary-background-lighten-3":`#837E88`,"primary-darken-1":`#DFADD1`,"primary-darken-2":`#CA99BD`,"primary-darken-3":`#B585A8`,"primary-lighten-1":`#FFD6FC`,"primary-lighten-2":`#FFECFF`,"primary-lighten-3":`#FFFFFF`,"primary-muted":`#5A4B5F`,scrollbar:`#644E69`,"scrollbar-active":`#F5C2E7`,"scrollbar-background":`#040216`,"scrollbar-background-active":`#040216`,"scrollbar-background-hover":`#040216`,"scrollbar-corner-color":`#040216`,"scrollbar-hover":`#7C627E`,secondary:`#CBA6F7`,"secondary-background":`#504C60`,"secondary-background-darken-1":`#413C52`,"secondary-background-darken-2":`#322D44`,"secondary-background-darken-3":`#322D44`,"secondary-background-lighten-1":`#605C6E`,"secondary-background-lighten-2":`#6F6C7C`,"secondary-background-lighten-3":`#7E7B8A`,"secondary-darken-1":`#B592E1`,"secondary-darken-2":`#A17ECC`,"secondary-darken-3":`#8C6BB7`,"secondary-lighten-1":`#E0BAFF`,"secondary-lighten-2":`#F6CFFF`,"secondary-lighten-3":`#FFE4FF`,"secondary-muted":`#4D4264`,success:`#ABE9B3`,"success-darken-1":`#96D39E`,"success-darken-2":`#82BE8B`,"success-darken-3":`#6EAA77`,"success-lighten-1":`#BFFEC7`,"success-lighten-2":`#D5FFDC`,"success-lighten-3":`#EAFFF2`,"success-muted":`#44564F`,surface:`#313244`,"surface-active":`#3E3F51`,"surface-darken-1":`#202233`,"surface-darken-2":`#111223`,"surface-darken-3":`#000014`,"surface-lighten-1":`#414255`,"surface-lighten-2":`#535467`,"surface-lighten-3":`#65667A`,text:`#FFFFFFDD`,"text-accent":`#FBCCAF`,"text-disabled":`#FFFFFF60`,"text-error":`#F6B5C8`,"text-muted":`#FFFFFF99`,"text-primary":`#F8D6EF`,"text-secondary":`#DCC4F9`,"text-success":`#C7F0CC`,"text-warning":`#FBECCA`,warning:`#FAE3B0`,"warning-darken-1":`#E4CD9B`,"warning-darken-2":`#CEB988`,"warning-darken-3":`#B9A574`,"warning-lighten-1":`#FFF8C4`,"warning-lighten-2":`#FFFFD9`,"warning-lighten-3":`#FFFFEF`,"warning-muted":`#5B544E`}},cyberpunk:{name:`cyberpunk`,dark:!0,vars:{background:`#070714`,"background-darken-1":`#03030A`,"background-darken-2":`#000003`,"background-darken-3":`#000000`,"background-lighten-1":`#11111E`,"background-lighten-2":`#1A1A2B`,"background-lighten-3":`#25253A`,foreground:`#E2E2FF`,"foreground-darken-1":`#CACAE4`,"foreground-darken-2":`#B3B3CC`,"foreground-darken-3":`#9C9CB5`,"foreground-disabled":`#E2E2FF60`,"foreground-lighten-1":`#EEEEFF`,"foreground-lighten-2":`#F6F6FF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#E2E2FF99`,primary:`#00E5FFD9`,"primary-darken-1":`#00CCE6D9`,"primary-darken-2":`#00B2CCD9`,"primary-darken-3":`#0099B3D9`,"primary-lighten-1":`#1AF0FFD9`,"primary-lighten-2":`#33F5FFD9`,"primary-lighten-3":`#4DFAFFD9`,"primary-muted":`#054A5BF4`,"primary-background":`#0A3340`,"primary-background-darken-1":`#072833`,"primary-background-darken-2":`#051E27`,"primary-background-darken-3":`#051E27`,"primary-background-lighten-1":`#0F404F`,"primary-background-lighten-2":`#154E5F`,"primary-background-lighten-3":`#1A5C6F`,secondary:`#FF1E8ECC`,"secondary-darken-1":`#E60A76CC`,"secondary-darken-2":`#CC005FCC`,"secondary-darken-3":`#B20048CC`,"secondary-lighten-1":`#FF3CA2CC`,"secondary-lighten-2":`#FF5AB6CC`,"secondary-lighten-3":`#FF78CACC`,"secondary-muted":`#510E39EF`,"secondary-background":`#3A0A28`,"secondary-background-darken-1":`#2E071F`,"secondary-background-darken-2":`#220517`,"secondary-background-darken-3":`#220517`,"secondary-background-lighten-1":`#470D33`,"secondary-background-lighten-2":`#54103F`,"secondary-background-lighten-3":`#61134B`,accent:`#EEFF00CC`,"accent-darken-1":`#D6E600CC`,"accent-darken-2":`#BECC00CC`,"accent-darken-3":`#A5B200CC`,"accent-lighten-1":`#FFFF26CC`,"accent-lighten-2":`#FFFF4DCC`,"accent-lighten-3":`#FFFF73CC`,"accent-muted":`#4C510EEF`,success:`#39FF14BF`,"success-darken-1":`#23E60ABF`,"success-darken-2":`#0FCC00BF`,"success-darken-3":`#00B200BF`,"success-lighten-1":`#4DFF32BF`,"success-lighten-2":`#69FF5ABF`,"success-lighten-3":`#87FF82BF`,"success-muted":`#164D14F0`,warning:`#FF6E00CC`,"warning-darken-1":`#E65800CC`,"warning-darken-2":`#CC4300CC`,"warning-darken-3":`#B23000CC`,"warning-lighten-1":`#FF8C26CC`,"warning-lighten-2":`#FFA54DCC`,"warning-lighten-3":`#FFBE73CC`,"warning-muted":`#51260EEF`,error:`#FF1133BF`,"error-darken-1":`#E6051EBF`,"error-darken-2":`#CC000CBF`,"error-darken-3":`#B20000BF`,"error-lighten-1":`#FF3758BF`,"error-lighten-2":`#FF5A78BF`,"error-lighten-3":`#FF7D96BF`,"error-muted":`#510A1DF0`,surface:`#0F0F22`,"surface-active":`#161630`,"surface-darken-1":`#08081A`,"surface-darken-2":`#040411`,"surface-darken-3":`#020209`,"surface-lighten-1":`#17172E`,"surface-lighten-2":`#1F1F3C`,"surface-lighten-3":`#28284A`,panel:`#0C0C1E`,"panel-darken-1":`#060614`,"panel-darken-2":`#03030C`,"panel-darken-3":`#010108`,"panel-lighten-1":`#14142C`,"panel-lighten-2":`#1C1C3A`,"panel-lighten-3":`#242448`,scrollbar:`#151535`,"scrollbar-active":`#00E5FFD9`,"scrollbar-background":`#040412`,"scrollbar-background-active":`#040412`,"scrollbar-background-hover":`#040412`,"scrollbar-corner-color":`#040412`,"scrollbar-hover":`#1F1F48`,"block-cursor-background":`#00E5FF`,"block-cursor-blurred-background":`#00E5FF4C`,"block-cursor-blurred-foreground":`#E2E2FF`,"block-cursor-foreground":`#070714`,"block-hover-background":`#00E5FF19`,boost:`#00E5FF0A`,"boost-darken-1":`#00CCE60A`,"boost-darken-2":`#00B2CC0A`,"boost-darken-3":`#0099B30A`,"boost-lighten-1":`#00E5FF0A`,"boost-lighten-2":`#00E5FF0A`,"boost-lighten-3":`#00E5FF0A`,border:`#00E5FFD9`,"border-blurred":`#1A1A35`,"button-color-foreground":`#070714`,"button-foreground":`#E2E2FF`,"footer-background":`#0C0C1E`,"footer-description-background":`#00000000`,"footer-description-foreground":`#E2E2FF`,"footer-foreground":`#E2E2FF`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#00E5FFD9`,"input-cursor-background":`#E2E2FF`,"input-cursor-foreground":`#070714`,"input-selection-background":`#00E5FF40`,"link-background":`#00000000`,"link-background-hover":`#00E5FFD9`,"link-color":`#E2E2FFDD`,"link-color-hover":`#070714`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#00E5FFD9`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#00E5FFD9`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#FF1E8ECC`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#E2E2FF`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#E2E2FF`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#E2E2FF99`,text:`#E2E2FFDD`,"text-accent":`#F4FF66CC`,"text-disabled":`#E2E2FF60`,"text-error":`#FF6677BF`,"text-muted":`#E2E2FF99`,"text-primary":`#66F0FFD9`,"text-secondary":`#FF80B0CC`,"text-success":`#80FF55BF`,"text-warning":`#FFB055CC`}},default:{name:`default`,dark:!0,vars:{accent:`#006FB8`,"accent-darken-1":`#005CA3`,"accent-darken-2":`#004B8F`,"accent-darken-3":`#003A7B`,"accent-lighten-1":`#3081CC`,"accent-lighten-2":`#4C95E2`,"accent-lighten-3":`#64A8F7`,"accent-muted":`#002137`,background:`#000000`,"background-darken-1":`#000000`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#161616`,"background-lighten-2":`#252525`,"background-lighten-3":`#353535`,"block-cursor-background":`#006FB8`,"block-cursor-blurred-background":`#006FB84C`,"block-cursor-blurred-foreground":`#FFFFFF`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#006FB8`,"border-blurred":`#191919`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#FFFFFF`,error:`#7F0000`,"error-darken-1":`#6A0000`,"error-darken-2":`#560000`,"error-darken-3":`#450000`,"error-lighten-1":`#961E12`,"error-lighten-2":`#AD3423`,"error-lighten-3":`#C44934`,"error-muted":`#260000`,"footer-background":`#242E35`,"footer-description-background":`#00000000`,"footer-description-foreground":`#FFFFFF`,"footer-foreground":`#FFFFFF`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#006FB8`,foreground:`#FFFFFF`,"foreground-darken-1":`#E9E9E9`,"foreground-darken-2":`#D4D4D4`,"foreground-darken-3":`#BFBFBF`,"foreground-disabled":`#FFFFFF60`,"foreground-lighten-1":`#FFFFFF`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#FFFFFF99`,"input-cursor-background":`#FFFFFF`,"input-cursor-foreground":`#000000`,"input-selection-background":`#3081CC66`,"link-background":`#00000000`,"link-background-hover":`#006FB8`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#006FB8`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#006FB8`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#006FB8`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#FFFFFF`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#FFFFFF`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#FFFFFF99`,panel:`#242E35`,"panel-darken-1":`#141E24`,"panel-darken-2":`#000D15`,"panel-darken-3":`#000000`,"panel-lighten-1":`#343E45`,"panel-lighten-2":`#454F57`,"panel-lighten-3":`#566169`,primary:`#006FB8`,"primary-background":`#26333D`,"primary-background-darken-1":`#13212C`,"primary-background-darken-2":`#00101B`,"primary-background-darken-3":`#00101B`,"primary-background-lighten-1":`#39454E`,"primary-background-lighten-2":`#4C575F`,"primary-background-lighten-3":`#5F6970`,"primary-darken-1":`#005CA3`,"primary-darken-2":`#004B8F`,"primary-darken-3":`#003A7B`,"primary-lighten-1":`#3081CC`,"primary-lighten-2":`#4C95E2`,"primary-lighten-3":`#64A8F7`,"primary-muted":`#002137`,scrollbar:`#002C49`,"scrollbar-active":`#006FB8`,"scrollbar-background":`#000000`,"scrollbar-background-active":`#000000`,"scrollbar-background-hover":`#000000`,"scrollbar-corner-color":`#000000`,"scrollbar-hover":`#00375C`,secondary:`#762671`,"secondary-background":`#342A33`,"secondary-background-darken-1":`#221721`,"secondary-background-darken-2":`#110510`,"secondary-background-darken-3":`#110510`,"secondary-background-lighten-1":`#463D45`,"secondary-background-lighten-2":`#585057`,"secondary-background-lighten-3":`#6A6269`,"secondary-darken-1":`#620F5E`,"secondary-darken-2":`#4E004C`,"secondary-darken-3":`#3B003A`,"secondary-lighten-1":`#8A3984`,"secondary-lighten-2":`#9E4C97`,"secondary-lighten-3":`#B360AB`,"secondary-muted":`#230B21`,success:`#008000`,"success-darken-1":`#006C00`,"success-darken-2":`#005900`,"success-darken-3":`#004600`,"success-lighten-1":`#29931C`,"success-lighten-2":`#42A832`,"success-lighten-3":`#58BD46`,"success-muted":`#002600`,surface:`#1E1E1E`,"surface-active":`#2A2A2A`,"surface-darken-1":`#0D0D0D`,"surface-darken-2":`#000000`,"surface-darken-3":`#000000`,"surface-lighten-1":`#2D2D2D`,"surface-lighten-2":`#3E3E3E`,"surface-lighten-3":`#4F4F4F`,text:`#FFFFFFDD`,"text-accent":`#569FD0`,"text-disabled":`#FFFFFF60`,"text-error":`#AB5656`,"text-muted":`#FFFFFF99`,"text-primary":`#569FD0`,"text-secondary":`#A46FA1`,"text-success":`#56AB56`,"text-warning":`#ABAB56`,warning:`#7F8000`,"warning-darken-1":`#6B6D00`,"warning-darken-2":`#575A00`,"warning-darken-3":`#454900`,"warning-lighten-1":`#94931E`,"warning-lighten-2":`#A9A734`,"warning-lighten-3":`#BFBB48`,"warning-muted":`#262600`}},dracula:{name:`dracula`,dark:!0,vars:{accent:`#FF79C6`,"accent-darken-1":`#E864B1`,"accent-darken-2":`#D24F9D`,"accent-darken-3":`#BC3989`,"accent-lighten-1":`#FF8DDA`,"accent-lighten-2":`#FFA3F0`,"accent-lighten-3":`#FFB8FF`,"accent-muted":`#684161`,background:`#282A36`,"background-darken-1":`#181A25`,"background-darken-2":`#050716`,"background-darken-3":`#000000`,"background-lighten-1":`#383A46`,"background-lighten-2":`#494B58`,"background-lighten-3":`#5B5D6A`,"block-cursor-background":`#BD93F9`,"block-cursor-blurred-background":`#BD93F94C`,"block-cursor-blurred-foreground":`#F8F8F2`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#BD93F9`,"border-blurred":`#252835`,"button-color-foreground":`#282A36`,"button-foreground":`#F8F8F2`,error:`#FE5555`,"error-darken-1":`#E63E43`,"error-darken-2":`#CE2332`,"error-darken-3":`#B70022`,"error-lighten-1":`#FF6A67`,"error-lighten-2":`#FF807A`,"error-lighten-3":`#FF958D`,"error-muted":`#68363F`,"footer-background":`#313442`,"footer-description-background":`#00000000`,"footer-description-foreground":`#F8F8F2`,"footer-foreground":`#F8F8F2`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FF79C6`,foreground:`#F8F8F2`,"foreground-darken-1":`#E2E2DC`,"foreground-darken-2":`#CDCDC7`,"foreground-darken-3":`#B8B8B3`,"foreground-disabled":`#F8F8F260`,"foreground-lighten-1":`#FFFFFF`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#F8F8F299`,"input-cursor-background":`#F8F8F2`,"input-cursor-foreground":`#282A36`,"input-selection-background":`#D2A7FF66`,"link-background":`#00000000`,"link-background-hover":`#BD93F9`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#BD93F9`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#BD93F9`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#BD93F9`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#F8F8F2`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#F8F8F2`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#F8F8F299`,panel:`#313442`,"panel-darken-1":`#202431`,"panel-darken-2":`#111421`,"panel-darken-3":`#000012`,"panel-lighten-1":`#414453`,"panel-lighten-2":`#535665`,"panel-lighten-3":`#656878`,primary:`#BD93F9`,"primary-background":`#5A566C`,"primary-background-darken-1":`#4C475F`,"primary-background-darken-2":`#3E3953`,"primary-background-darken-3":`#3E3953`,"primary-background-lighten-1":`#696579`,"primary-background-lighten-2":`#777486`,"primary-background-lighten-3":`#868393`,"primary-darken-1":`#A77FE3`,"primary-darken-2":`#936CCE`,"primary-darken-3":`#7E59B9`,"primary-lighten-1":`#D2A7FF`,"primary-lighten-2":`#E8BBFF`,"primary-lighten-3":`#FED0FF`,"primary-muted":`#544970`,scrollbar:`#5A4A79`,"scrollbar-active":`#BD93F9`,"scrollbar-background":`#181A25`,"scrollbar-background-active":`#181A25`,"scrollbar-background-hover":`#181A25`,"scrollbar-corner-color":`#181A25`,"scrollbar-hover":`#6A568F`,secondary:`#6272A4`,"secondary-background":`#4F5261`,"secondary-background-darken-1":`#3F4353`,"secondary-background-darken-2":`#303446`,"secondary-background-darken-3":`#303446`,"secondary-background-lighten-1":`#5E616F`,"secondary-background-lighten-2":`#6E707D`,"secondary-background-lighten-3":`#7D808B`,"secondary-darken-1":`#4E5F90`,"secondary-darken-2":`#3B4D7C`,"secondary-darken-3":`#283C69`,"secondary-lighten-1":`#7584B8`,"secondary-lighten-2":`#8998CD`,"secondary-lighten-3":`#9DACE2`,"secondary-muted":`#393F57`,success:`#50FA7B`,"success-darken-1":`#2FE467`,"success-darken-2":`#00CE53`,"success-darken-3":`#00B83F`,"success-lighten-1":`#6AFF8F`,"success-lighten-2":`#83FFA3`,"success-lighten-3":`#9BFFB8`,"success-muted":`#34684A`,surface:`#2B2E3B`,"surface-active":`#383B48`,"surface-darken-1":`#1B1E2A`,"surface-darken-2":`#0A0D1B`,"surface-darken-3":`#000009`,"surface-lighten-1":`#3B3E4C`,"surface-lighten-2":`#4C4F5D`,"surface-lighten-3":`#5E6170`,text:`#FFFFFFDD`,"text-accent":`#FFA6D9`,"text-disabled":`#FFFFFF60`,"text-error":`#FF8E8E`,"text-muted":`#FFFFFF99`,"text-primary":`#D3B7FB`,"text-secondary":`#97A1C2`,"text-success":`#8BFBA7`,"text-warning":`#FFD09D`,warning:`#FEB86C`,"warning-darken-1":`#E8A358`,"warning-darken-2":`#D18F45`,"warning-darken-3":`#BB7C33`,"warning-lighten-1":`#FFCC7F`,"warning-lighten-2":`#FFE193`,"warning-lighten-3":`#FFF7A7`,"warning-muted":`#685446`}},flexoki:{name:`flexoki`,dark:!0,vars:{accent:`#9B76C8`,"accent-darken-1":`#8663B3`,"accent-darken-2":`#72509E`,"accent-darken-3":`#5F3E8B`,"accent-lighten-1":`#AF89DD`,"accent-lighten-2":`#C49DF2`,"accent-lighten-3":`#D9B1FF`,"accent-muted":`#392D46`,background:`#100F0F`,"background-darken-1":`#000000`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#1F1F1F`,"background-lighten-2":`#2F2E2E`,"background-lighten-3":`#403F3F`,"block-cursor-background":`#205EA6`,"block-cursor-blurred-background":`#205EA64C`,"block-cursor-blurred-foreground":`#FFFCF0`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#205EA6`,"border-blurred":`#171614`,"button-color-foreground":`#FFFCF0`,"button-foreground":`#FFFCF0`,error:`#AE3029`,"error-darken-1":`#981818`,"error-darken-2":`#810007`,"error-darken-3":`#6B0000`,"error-lighten-1":`#C64539`,"error-lighten-2":`#DD594B`,"error-lighten-3":`#F46D5D`,"error-muted":`#3F1816`,"footer-background":`#282726`,"footer-description-background":`#00000000`,"footer-description-foreground":`#FFFCF0`,"footer-foreground":`#FFFCF0`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#9B76C8`,foreground:`#FFFCF0`,"foreground-darken-1":`#E9E6DA`,"foreground-darken-2":`#D4D1C5`,"foreground-darken-3":`#BFBCB1`,"foreground-disabled":`#FFFCF060`,"foreground-lighten-1":`#FFFFFF`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#FFFCF099`,"input-cursor-background":`#FFFCF0`,"input-cursor-foreground":`#5E409D`,"input-selection-background":`#6F6E6959`,"link-background":`#00000000`,"link-background-hover":`#205EA6`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#205EA6`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#205EA6`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#205EA6`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#FFFCF0`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#FFFCF0`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#FFFCF099`,panel:`#282726`,"panel-darken-1":`#181716`,"panel-darken-2":`#040200`,"panel-darken-3":`#000000`,"panel-lighten-1":`#383736`,"panel-lighten-2":`#494846`,"panel-lighten-3":`#5A5958`,primary:`#205EA6`,"primary-background":`#353C45`,"primary-background-darken-1":`#232B35`,"primary-background-darken-2":`#121A25`,"primary-background-darken-3":`#121A25`,"primary-background-lighten-1":`#474D56`,"primary-background-lighten-2":`#595E66`,"primary-background-lighten-3":`#6A6F76`,"primary-darken-1":`#004C91`,"primary-darken-2":`#003B7E`,"primary-darken-3":`#002B6B`,"primary-lighten-1":`#3C70BA`,"primary-lighten-2":`#5383CF`,"primary-lighten-3":`#6996E4`,"primary-muted":`#14263C`,scrollbar:`#0C2542`,"scrollbar-active":`#205EA6`,"scrollbar-background":`#000000`,"scrollbar-background-active":`#000000`,"scrollbar-background-hover":`#000000`,"scrollbar-corner-color":`#000000`,"scrollbar-hover":`#102F53`,secondary:`#24837B`,"secondary-background":`#364140`,"secondary-background-darken-1":`#24302F`,"secondary-background-darken-2":`#13201F`,"secondary-background-darken-3":`#13201F`,"secondary-background-lighten-1":`#485251`,"secondary-background-lighten-2":`#596262`,"secondary-background-lighten-3":`#6B7373`,"secondary-darken-1":`#006F68`,"secondary-darken-2":`#005D56`,"secondary-darken-3":`#004A44`,"secondary-lighten-1":`#3C968E`,"secondary-lighten-2":`#52AAA1`,"secondary-lighten-3":`#67BFB6`,"secondary-muted":`#16312F`,success:`#65800B`,"success-darken-1":`#526D00`,"success-darken-2":`#3E5A00`,"success-darken-3":`#2D4800`,"success-lighten-1":`#7A9324`,"success-lighten-2":`#8EA738`,"success-lighten-3":`#A3BB4C`,"success-muted":`#29300D`,surface:`#1C1B1A`,"surface-active":`#282726`,"surface-darken-1":`#0A0806`,"surface-darken-2":`#000000`,"surface-darken-3":`#000000`,"surface-lighten-1":`#2B2A29`,"surface-lighten-2":`#3B3A39`,"surface-lighten-3":`#4D4B4A`,text:`#FFFFFFDD`,"text-accent":`#BDA4DA`,"text-disabled":`#FFFFFF60`,"text-error":`#CA7671`,"text-muted":`#FFFFFF99`,"text-primary":`#6B94C4`,"text-secondary":`#6EADA7`,"text-success":`#9AAB5D`,"text-warning":`#C8AD57`,warning:`#AC8301`,"warning-darken-1":`#977000`,"warning-darken-2":`#815D00`,"warning-darken-3":`#6C4C00`,"warning-lighten-1":`#C39621`,"warning-lighten-2":`#D9AA37`,"warning-lighten-3":`#F0BE4B`,"warning-muted":`#3F310A`}},gruvbox:{name:`gruvbox`,dark:!0,vars:{accent:`#F9BD2F`,"accent-darken-1":`#E2A811`,"accent-darken-2":`#CB9400`,"accent-darken-3":`#B48100`,"accent-lighten-1":`#FFD146`,"accent-lighten-2":`#FFE65B`,"accent-lighten-3":`#FFFC70`,"accent-muted":`#67542A`,background:`#282828`,"background-darken-1":`#181818`,"background-darken-2":`#040404`,"background-darken-3":`#000000`,"background-lighten-1":`#383838`,"background-lighten-2":`#494949`,"background-lighten-3":`#5A5A5A`,"block-cursor-background":`#85A598`,"block-cursor-blurred-background":`#85A5984C`,"block-cursor-blurred-foreground":`#FBF1C7`,"block-cursor-foreground":`#FBF1C7`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#85A598`,"border-blurred":`#363230`,"button-color-foreground":`#282828`,"button-foreground":`#FBF1C7`,error:`#FA4934`,"error-darken-1":`#E23022`,"error-darken-2":`#C90D10`,"error-darken-3":`#B10000`,"error-lighten-1":`#FF5F45`,"error-lighten-2":`#FF7558`,"error-lighten-3":`#FF8B6B`,"error-muted":`#67312B`,"footer-background":`#504945`,"footer-description-background":`#00000000`,"footer-description-foreground":`#FBF1C7`,"footer-foreground":`#FBF1C7`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FABD2F`,foreground:`#FBF1C7`,"foreground-darken-1":`#E5DBB2`,"foreground-darken-2":`#D0C69E`,"foreground-darken-3":`#BBB28A`,"foreground-disabled":`#FBF1C760`,"foreground-lighten-1":`#FFFFDC`,"foreground-lighten-2":`#FFFFF1`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#FBF1C799`,"input-cursor-background":`#FBF1C7`,"input-cursor-foreground":`#282828`,"input-selection-background":`#689D6A40`,"link-background":`#00000000`,"link-background-hover":`#85A598`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#85A598`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#85A598`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#85A598`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#FBF1C7`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#FBF1C7`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#FBF1C799`,panel:`#504945`,"panel-darken-1":`#3E3834`,"panel-darken-2":`#2E2724`,"panel-darken-3":`#1E1815`,"panel-lighten-1":`#615A56`,"panel-lighten-2":`#746C68`,"panel-lighten-3":`#877F7B`,primary:`#85A598`,"primary-background":`#535755`,"primary-background-darken-1":`#444846`,"primary-background-darken-2":`#353A38`,"primary-background-darken-3":`#353A38`,"primary-background-lighten-1":`#626664`,"primary-background-lighten-2":`#717573`,"primary-background-lighten-3":`#808382`,"primary-darken-1":`#719184`,"primary-darken-2":`#5F7D71`,"primary-darken-3":`#4C6A5F`,"primary-lighten-1":`#98B9AB`,"primary-lighten-2":`#ACCEC0`,"primary-lighten-3":`#C1E3D5`,"primary-muted":`#434D49`,scrollbar:`#43504B`,"scrollbar-active":`#85A598`,"scrollbar-background":`#181818`,"scrollbar-background-active":`#181818`,"scrollbar-background-hover":`#181818`,"scrollbar-corner-color":`#181818`,"scrollbar-hover":`#4E5E58`,secondary:`#A89A85`,"secondary-background":`#585653`,"secondary-background-darken-1":`#494744`,"secondary-background-darken-2":`#3B3935`,"secondary-background-darken-3":`#3B3935`,"secondary-background-lighten-1":`#676562`,"secondary-background-lighten-2":`#757471`,"secondary-background-lighten-3":`#848380`,"secondary-darken-1":`#938671`,"secondary-darken-2":`#80735F`,"secondary-darken-3":`#6D604D`,"secondary-lighten-1":`#BCAE98`,"secondary-lighten-2":`#D1C2AC`,"secondary-lighten-3":`#E6D7C1`,"secondary-muted":`#4E4A43`,success:`#B7BB26`,"success-darken-1":`#A2A601`,"success-darken-2":`#8C9300`,"success-darken-3":`#777F00`,"success-lighten-1":`#CDCF3D`,"success-lighten-2":`#E4E453`,"success-lighten-3":`#FAFA68`,"success-muted":`#535427`,surface:`#3C3836`,"surface-active":`#494543`,"surface-darken-1":`#2B2725`,"surface-darken-2":`#1C1816`,"surface-darken-3":`#0A0300`,"surface-lighten-1":`#4D4846`,"surface-lighten-2":`#5F5A58`,"surface-lighten-3":`#716C6A`,text:`#FFFFFFDD`,"text-accent":`#FBD375`,"text-disabled":`#FFFFFF60`,"text-error":`#FC8679`,"text-muted":`#FFFFFF99`,"text-primary":`#AEC3BB`,"text-secondary":`#C5BCAE`,"text-success":`#D0D26F`,"text-warning":`#FEAB67`,warning:`#FD8019`,"warning-darken-1":`#E56C00`,"warning-darken-2":`#CD5800`,"warning-darken-3":`#B54500`,"warning-lighten-1":`#FF9430`,"warning-lighten-2":`#FFA845`,"warning-lighten-3":`#FFBD5A`,"warning-muted":`#684223`}},monokai:{name:`monokai`,dark:!0,vars:{accent:`#66D9EF`,"accent-darken-1":`#4DC3D9`,"accent-darken-2":`#31AFC4`,"accent-darken-3":`#009BB0`,"accent-lighten-1":`#7DEEFF`,"accent-lighten-2":`#94FFFF`,"accent-lighten-3":`#AAFFFF`,"accent-muted":`#395D5F`,background:`#272822`,"background-darken-1":`#171812`,"background-darken-2":`#020400`,"background-darken-3":`#000000`,"background-lighten-1":`#373831`,"background-lighten-2":`#484942`,"background-lighten-3":`#595A54`,"block-cursor-background":`#AE81FF`,"block-cursor-blurred-background":`#AE81FF4C`,"block-cursor-blurred-foreground":`#D6D6D6`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#AE81FF`,"border-blurred":`#282828`,"button-color-foreground":`#272822`,"button-foreground":`#D6D6D6`,error:`#F82672`,"error-darken-1":`#E1005F`,"error-darken-2":`#C9004E`,"error-darken-3":`#B1003D`,"error-lighten-1":`#FF4484`,"error-lighten-2":`#FF5D98`,"error-lighten-3":`#FF75AC`,"error-muted":`#66273A`,"footer-background":`#3E3D32`,"footer-description-background":`#00000000`,"footer-description-foreground":`#D6D6D6`,"footer-foreground":`#D6D6D6`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#66D9EF`,foreground:`#D6D6D6`,"foreground-darken-1":`#C1C1C1`,"foreground-darken-2":`#ACACAC`,"foreground-darken-3":`#989898`,"foreground-disabled":`#D6D6D660`,"foreground-lighten-1":`#EBEBEB`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#797979`,"input-cursor-background":`#D6D6D6`,"input-cursor-foreground":`#272822`,"input-selection-background":`#575B6190`,"link-background":`#00000000`,"link-background-hover":`#AE81FF`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#AE81FF`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#AE81FF`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#AE81FF`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#D6D6D6`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#D6D6D6`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#797979`,panel:`#3E3D32`,"panel-darken-1":`#2D2C22`,"panel-darken-2":`#1D1C12`,"panel-darken-3":`#0D0B00`,"panel-lighten-1":`#4F4E42`,"panel-lighten-2":`#616054`,"panel-lighten-3":`#737266`,primary:`#AE81FF`,"primary-background":`#58535F`,"primary-background-darken-1":`#494451`,"primary-background-darken-2":`#3B3543`,"primary-background-darken-3":`#3B3543`,"primary-background-lighten-1":`#67626D`,"primary-background-lighten-2":`#75717B`,"primary-background-lighten-3":`#848089`,"primary-darken-1":`#986DE9`,"primary-darken-2":`#835AD3`,"primary-darken-3":`#6E48BE`,"primary-lighten-1":`#C394FF`,"primary-lighten-2":`#D9A9FF`,"primary-lighten-3":`#EFBDFF`,"primary-muted":`#4F4264`,scrollbar:`#534270`,"scrollbar-active":`#AE81FF`,"scrollbar-background":`#171812`,"scrollbar-background-active":`#171812`,"scrollbar-background-hover":`#171812`,"scrollbar-corner-color":`#171812`,"scrollbar-hover":`#624C88`,secondary:`#F82672`,"secondary-background":`#61474D`,"secondary-background-darken-1":`#53373D`,"secondary-background-darken-2":`#46272E`,"secondary-background-darken-3":`#46272E`,"secondary-background-lighten-1":`#6F575D`,"secondary-background-lighten-2":`#7D676C`,"secondary-background-lighten-3":`#8B787C`,"secondary-darken-1":`#E1005F`,"secondary-darken-2":`#C9004E`,"secondary-darken-3":`#B1003D`,"secondary-lighten-1":`#FF4484`,"secondary-lighten-2":`#FF5D98`,"secondary-lighten-3":`#FF75AC`,"secondary-muted":`#66273A`,success:`#A5E22E`,"success-darken-1":`#90CC09`,"success-darken-2":`#7AB700`,"success-darken-3":`#64A300`,"success-lighten-1":`#BBF746`,"success-lighten-2":`#D2FF5D`,"success-lighten-3":`#E8FF72`,"success-muted":`#4D5F25`,surface:`#2E2E2E`,"surface-active":`#3B3B3B`,"surface-darken-1":`#1E1E1E`,"surface-darken-2":`#0D0D0D`,"surface-darken-3":`#000000`,"surface-lighten-1":`#3E3E3E`,"surface-lighten-2":`#4F4F4F`,"surface-lighten-3":`#616161`,text:`#FFFFFFDD`,"text-accent":`#9AE5F4`,"text-disabled":`#FFFFFF60`,"text-error":`#FB6FA1`,"text-muted":`#FFFFFF99`,"text-primary":`#C9ABFF`,"text-secondary":`#FB6FA1`,"text-success":`#C4EB75`,"text-warning":`#FDBA6B`,warning:`#FC971F`,"warning-darken-1":`#E58300`,"warning-darken-2":`#CD6F00`,"warning-darken-3":`#B65D00`,"warning-lighten-1":`#FFAB36`,"warning-lighten-2":`#FFBF4C`,"warning-lighten-3":`#FFD460`,"warning-muted":`#674921`}},nord:{name:`nord`,dark:!0,vars:{accent:`#B48EAD`,"accent-darken-1":`#9F7A98`,"accent-darken-2":`#8B6785`,"accent-darken-3":`#785572`,"accent-lighten-1":`#C8A1C1`,"accent-lighten-2":`#DDB6D6`,"accent-lighten-3":`#F3CAEB`,"accent-muted":`#564F60`,background:`#2E3440`,"background-darken-1":`#1E242F`,"background-darken-2":`#0E141F`,"background-darken-3":`#000010`,"background-lighten-1":`#3E4451`,"background-lighten-2":`#505663`,"background-lighten-3":`#626875`,"block-cursor-background":`#88C0D0`,"block-cursor-blurred-background":`#88C0D04C`,"block-cursor-blurred-foreground":`#D8DEE9`,"block-cursor-foreground":`#2E3440`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#88C0D0`,"border-blurred":`#353C4C`,"button-color-foreground":`#2E3440`,"button-foreground":`#D8DEE9`,error:`#BE616A`,"error-darken-1":`#A94D57`,"error-darken-2":`#933A46`,"error-darken-3":`#7E2735`,"error-lighten-1":`#D4747C`,"error-lighten-2":`#EB8890`,"error-lighten-3":`#FF9CA3`,"error-muted":`#59414C`,"footer-background":`#434C5E`,"footer-description-background":`#00000000`,"footer-description-foreground":`#D8DEE9`,"footer-foreground":`#D8DEE9`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#88C0D0`,foreground:`#D8DEE9`,"foreground-darken-1":`#C3C9D3`,"foreground-darken-2":`#AEB4BF`,"foreground-darken-3":`#9AA0AA`,"foreground-disabled":`#D8DEE960`,"foreground-lighten-1":`#EDF3FE`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#D8DEE999`,"input-cursor-background":`#D8DEE9`,"input-cursor-foreground":`#2E3440`,"input-selection-background":`#81A1C159`,"link-background":`#00000000`,"link-background-hover":`#88C0D0`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#88C0D0`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#88C0D0`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#88C0D0`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#D8DEE9`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#D8DEE9`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#D8DEE999`,panel:`#434C5E`,"panel-darken-1":`#313A4C`,"panel-darken-2":`#212A3A`,"panel-darken-3":`#111B2A`,"panel-lighten-1":`#545D70`,"panel-lighten-2":`#677083`,"panel-lighten-3":`#798396`,primary:`#88C0D0`,"primary-background":`#58646E`,"primary-background-darken-1":`#495661`,"primary-background-darken-2":`#3B4955`,"primary-background-darken-3":`#3B4955`,"primary-background-lighten-1":`#67717B`,"primary-background-lighten-2":`#757F88`,"primary-background-lighten-3":`#848D94`,"primary-darken-1":`#73ABBB`,"primary-darken-2":`#5F97A6`,"primary-darken-3":`#4B8393`,"primary-lighten-1":`#9CD4E5`,"primary-lighten-2":`#B1EAFA`,"primary-lighten-3":`#C6FFFF`,"primary-muted":`#495E6B`,scrollbar:`#48626F`,"scrollbar-active":`#88C0D0`,"scrollbar-background":`#1E242F`,"scrollbar-background-active":`#1E242F`,"scrollbar-background-hover":`#1E242F`,"scrollbar-corner-color":`#1E242F`,"scrollbar-hover":`#53727F`,secondary:`#81A1C1`,"secondary-background":`#57606C`,"secondary-background-darken-1":`#48525F`,"secondary-background-darken-2":`#3A4453`,"secondary-background-darken-3":`#3A4453`,"secondary-background-lighten-1":`#666E79`,"secondary-background-lighten-2":`#757C86`,"secondary-background-lighten-3":`#838A93`,"secondary-darken-1":`#6D8DAC`,"secondary-darken-2":`#597A98`,"secondary-darken-3":`#466784`,"secondary-lighten-1":`#95B5D5`,"secondary-lighten-2":`#A9C9EB`,"secondary-lighten-3":`#BEDEFF`,"secondary-muted":`#465466`,success:`#A3BE8C`,"success-darken-1":`#8FA978`,"success-darken-2":`#7B9565`,"success-darken-3":`#688253`,"success-lighten-1":`#B7D29F`,"success-lighten-2":`#CCE8B4`,"success-lighten-3":`#E1FDC8`,"success-muted":`#515D56`,surface:`#3B4252`,"surface-active":`#484F60`,"surface-darken-1":`#2A3140`,"surface-darken-2":`#1A212F`,"surface-darken-3":`#0A1120`,"surface-lighten-1":`#4C5364`,"surface-lighten-2":`#5E6576`,"surface-lighten-3":`#707889`,text:`#FFFFFFDD`,"text-accent":`#CDB4C8`,"text-disabled":`#FFFFFF60`,"text-error":`#D4969C`,"text-muted":`#FFFFFF99`,"text-primary":`#B0D5DF`,"text-secondary":`#ABC0D6`,"text-success":`#C2D4B3`,"text-warning":`#F1DCB2`,warning:`#EACB8B`,"warning-darken-1":`#D5B677`,"warning-darken-2":`#BFA264`,"warning-darken-3":`#AA8E51`,"warning-lighten-1":`#FFE09E`,"warning-lighten-2":`#FFF5B3`,"warning-lighten-3":`#FFFFC8`,"warning-muted":`#666156`}},"rose-pine":{name:`rose-pine`,dark:!0,vars:{accent:`#EBBCBA`,"accent-darken-1":`#D5A7A5`,"accent-darken-2":`#C09391`,"accent-darken-3":`#AB807E`,"accent-lighten-1":`#FFD0CE`,"accent-lighten-2":`#FFE5E3`,"accent-lighten-3":`#FFFBF9`,"accent-muted":`#584851`,background:`#191724`,"background-darken-1":`#060015`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#282634`,"background-lighten-2":`#383644`,"background-lighten-3":`#4A4756`,"block-cursor-background":`#C4A7E7`,"block-cursor-blurred-background":`#C4A7E74C`,"block-cursor-blurred-foreground":`#E0DEF4`,"block-cursor-foreground":`#191724`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#524F67`,"border-blurred":`#6E6A86`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#E0DEF4`,error:`#EA6F92`,"error-darken-1":`#D45A7E`,"error-darken-2":`#BE466B`,"error-darken-3":`#A83159`,"error-lighten-1":`#FF83A5`,"error-lighten-2":`#FF98BA`,"error-lighten-3":`#FFADCE`,"error-muted":`#583145`,"footer-background":`#26233A`,"footer-description-background":`#00000000`,"footer-description-foreground":`#E0DEF4`,"footer-foreground":`#E0DEF4`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#EBBCBA`,foreground:`#E0DEF4`,"foreground-darken-1":`#CAC9DE`,"foreground-darken-2":`#B6B4C9`,"foreground-darken-3":`#A2A0B4`,"foreground-disabled":`#E0DEF460`,"foreground-lighten-1":`#F5F3FF`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#E0DEF499`,"input-cursor-background":`#F4EDE8`,"input-cursor-foreground":`#191724`,"input-selection-background":`#403D52`,"link-background":`#00000000`,"link-background-hover":`#C4A7E7`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#C4A7E7`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#C4A7E7`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#C4A7E7`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#E0DEF4`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#E0DEF4`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#E0DEF499`,panel:`#26233A`,"panel-darken-1":`#161329`,"panel-darken-2":`#04001A`,"panel-darken-3":`#000008`,"panel-lighten-1":`#36324B`,"panel-lighten-2":`#47435D`,"panel-lighten-3":`#59556F`,primary:`#C4A7E7`,"primary-background":`#504B5D`,"primary-background-darken-1":`#413B4F`,"primary-background-darken-2":`#322C41`,"primary-background-darken-3":`#322C41`,"primary-background-lighten-1":`#605B6B`,"primary-background-lighten-2":`#6F6B7A`,"primary-background-lighten-3":`#7E7B88`,"primary-darken-1":`#AF93D1`,"primary-darken-2":`#9A7FBC`,"primary-darken-3":`#866CA8`,"primary-lighten-1":`#D9BBFC`,"primary-lighten-2":`#EED0FF`,"primary-lighten-3":`#FFE5FF`,"primary-muted":`#4C425E`,scrollbar:`#524269`,"scrollbar-active":`#C4A7E7`,"scrollbar-background":`#060015`,"scrollbar-background-active":`#060015`,"scrollbar-background-hover":`#060015`,"scrollbar-corner-color":`#060015`,"scrollbar-hover":`#65537E`,secondary:`#31748F`,"secondary-background":`#3E4452`,"secondary-background-darken-1":`#2D3443`,"secondary-background-darken-2":`#1C2434`,"secondary-background-darken-3":`#1C2434`,"secondary-background-lighten-1":`#4F5561`,"secondary-background-lighten-2":`#606570`,"secondary-background-lighten-3":`#717680`,"secondary-darken-1":`#17617B`,"secondary-darken-2":`#004F68`,"secondary-darken-3":`#003E56`,"secondary-lighten-1":`#4687A2`,"secondary-lighten-2":`#5B9AB7`,"secondary-lighten-3":`#70AECB`,"secondary-muted":`#203244`,success:`#9CCFD8`,"success-darken-1":`#87BAC3`,"success-darken-2":`#73A5AE`,"success-darken-3":`#60929A`,"success-lighten-1":`#B0E4ED`,"success-lighten-2":`#C5F9FF`,"success-lighten-3":`#DAFFFF`,"success-muted":`#404E5A`,surface:`#1F1D2E`,"surface-active":`#2B293B`,"surface-darken-1":`#100B1E`,"surface-darken-2":`#00000E`,"surface-darken-3":`#000000`,"surface-lighten-1":`#2F2C3E`,"surface-lighten-2":`#3F3D4F`,"surface-lighten-3":`#514E61`,text:`#FFFFFFDD`,"text-accent":`#F1D2D1`,"text-disabled":`#FFFFFF60`,"text-error":`#F19FB7`,"text-muted":`#FFFFFF99`,"text-primary":`#D8C4EF`,"text-secondary":`#77A3B5`,"text-success":`#BDDFE5`,"text-warning":`#F9D6A5`,warning:`#F5C177`,"warning-darken-1":`#DFAC63`,"warning-darken-2":`#C99850`,"warning-darken-3":`#B3853E`,"warning-lighten-1":`#FFD58A`,"warning-lighten-2":`#FFEB9E`,"warning-lighten-3":`#FFFFB3`,"warning-muted":`#5B4A3C`}},"rose-pine-dawn":{name:`rose-pine-dawn`,dark:!1,vars:{accent:`#D6827E`,"accent-darken-1":`#C16E6B`,"accent-darken-2":`#AB5B58`,"accent-darken-3":`#964847`,"accent-lighten-1":`#ED9591`,"accent-lighten-2":`#FFAAA5`,"accent-lighten-3":`#FFBEB9`,"accent-muted":`#EFD1CB`,background:`#FAF4ED`,"background-darken-1":`#E4DED7`,"background-darken-2":`#CFC9C2`,"background-darken-3":`#BAB5AE`,"background-lighten-1":`#FFFFFF`,"background-lighten-2":`#FFFFFF`,"background-lighten-3":`#FFFFFF`,"block-cursor-background":`#575279`,"block-cursor-blurred-background":`#907AA94C`,"block-cursor-blurred-foreground":`#575279`,"block-cursor-foreground":`#FAF4ED`,"block-hover-background":`#00000019`,boost:`#0000000A`,"boost-darken-1":`#0000000A`,"boost-darken-2":`#0000000A`,"boost-darken-3":`#0000000A`,"boost-lighten-1":`#1616160A`,"boost-lighten-2":`#2525250A`,"boost-lighten-3":`#3535350A`,border:`#CECACD`,"border-blurred":`#9893A5`,"button-color-foreground":`#000000DD`,"button-foreground":`#575279`,error:`#B4637A`,"error-darken-1":`#9E5067`,"error-darken-2":`#8A3D55`,"error-darken-3":`#752A43`,"error-lighten-1":`#C9768D`,"error-lighten-2":`#DF8AA0`,"error-lighten-3":`#F59EB5`,"error-muted":`#E5C8CA`,"footer-background":`#F2E9E1`,"footer-description-background":`#00000000`,"footer-description-foreground":`#575279`,"footer-foreground":`#575279`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#D7827E`,foreground:`#575279`,"foreground-darken-1":`#444066`,"foreground-darken-2":`#332F53`,"foreground-darken-3":`#222042`,"foreground-disabled":`#57527960`,"foreground-lighten-1":`#69648C`,"foreground-lighten-2":`#7C76A0`,"foreground-lighten-3":`#9089B4`,"foreground-muted":`#57527999`,"input-cursor-background":`#575279`,"input-cursor-foreground":`#FAF4ED`,"input-selection-background":`#DFDAD9`,"link-background":`#00000000`,"link-background-hover":`#907AA9`,"link-color":`#000000DD`,"link-color-hover":`#000000DD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#907AA9`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#907AA9`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#907AA9`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#575279`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#575279`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#57527999`,panel:`#F2E9E1`,"panel-darken-1":`#DCD3CB`,"panel-darken-2":`#C7BFB7`,"panel-darken-3":`#B3AAA3`,"panel-lighten-1":`#FFFEF6`,"panel-lighten-2":`#FFFFFF`,"panel-lighten-3":`#FFFFFF`,primary:`#907AA9`,"primary-background":`#907AA9`,"primary-background-darken-1":`#7C6795`,"primary-background-darken-2":`#695481`,"primary-background-darken-3":`#56436E`,"primary-background-lighten-1":`#A48DBD`,"primary-background-lighten-2":`#B8A1D2`,"primary-background-lighten-3":`#CDB5E7`,"primary-darken-1":`#7C6795`,"primary-darken-2":`#695481`,"primary-darken-3":`#56436E`,"primary-lighten-1":`#A48DBD`,"primary-lighten-2":`#B8A1D2`,"primary-lighten-3":`#CDB5E7`,"primary-muted":`#DACFD8`,scrollbar:`#C2B6C4`,"scrollbar-active":`#907AA9`,"scrollbar-background":`#E4DED7`,"scrollbar-background-active":`#E4DED7`,"scrollbar-background-hover":`#E4DED7`,"scrollbar-corner-color":`#E4DED7`,"scrollbar-hover":`#BAACC0`,secondary:`#286983`,"secondary-background":`#286983`,"secondary-background-darken-1":`#0A566F`,"secondary-background-darken-2":`#00455D`,"secondary-background-darken-3":`#00344B`,"secondary-background-lighten-1":`#3E7B96`,"secondary-background-lighten-2":`#538FAA`,"secondary-background-lighten-3":`#67A2BE`,"secondary-darken-1":`#0A566F`,"secondary-darken-2":`#00455D`,"secondary-darken-3":`#00344B`,"secondary-lighten-1":`#3E7B96`,"secondary-lighten-2":`#538FAA`,"secondary-lighten-3":`#67A2BE`,"secondary-muted":`#BBCACD`,success:`#56949F`,"success-darken-1":`#41808B`,"success-darken-2":`#2D6D78`,"success-darken-3":`#155B65`,"success-lighten-1":`#6AA7B3`,"success-lighten-2":`#7EBCC7`,"success-lighten-3":`#92D1DC`,"success-muted":`#C8D7D5`,surface:`#FFFAF3`,"surface-active":`#FFFFFF`,"surface-darken-1":`#E9E4DD`,"surface-darken-2":`#D4CFC8`,"surface-darken-3":`#BFBAB4`,"surface-lighten-1":`#FFFFFF`,"surface-lighten-2":`#FFFFFF`,"surface-lighten-3":`#FFFFFF`,text:`#000000DD`,"text-accent":`#8D5553`,"text-disabled":`#00000060`,"text-error":`#764150`,"text-muted":`#00000099`,"text-primary":`#5F506F`,"text-secondary":`#1A4556`,"text-success":`#386168`,"text-warning":`#9A6722`,warning:`#E99D34`,"warning-darken-1":`#D2891D`,"warning-darken-2":`#BC7600`,"warning-darken-3":`#A56300`,"warning-lighten-1":`#FFB148`,"warning-lighten-2":`#FFC55C`,"warning-lighten-3":`#FFDA70`,"warning-muted":`#F5D9B5`}},"rose-pine-moon":{name:`rose-pine-moon`,dark:!0,vars:{accent:`#EA9A97`,"accent-darken-1":`#D48683`,"accent-darken-2":`#BE7270`,"accent-darken-3":`#A95F5E`,"accent-lighten-1":`#FFAEAA`,"accent-lighten-2":`#FFC3BF`,"accent-lighten-3":`#FFD8D4`,"accent-muted":`#5E4553`,background:`#232136`,"background-darken-1":`#131125`,"background-darken-2":`#000017`,"background-darken-3":`#000001`,"background-lighten-1":`#333046`,"background-lighten-2":`#444158`,"background-lighten-3":`#56526A`,"block-cursor-background":`#C4A7E7`,"block-cursor-blurred-background":`#C4A7E74C`,"block-cursor-blurred-foreground":`#E0DEF4`,"block-cursor-foreground":`#232136`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#56526E`,"border-blurred":`#6E6A86`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#E0DEF4`,error:`#EA6F92`,"error-darken-1":`#D45A7E`,"error-darken-2":`#BE466B`,"error-darken-3":`#A83159`,"error-lighten-1":`#FF83A5`,"error-lighten-2":`#FF98BA`,"error-lighten-3":`#FFADCE`,"error-muted":`#5F3851`,"footer-background":`#393552`,"footer-description-background":`#00000000`,"footer-description-foreground":`#E0DEF4`,"footer-foreground":`#E0DEF4`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#EA9A97`,foreground:`#E0DEF4`,"foreground-darken-1":`#CAC9DE`,"foreground-darken-2":`#B6B4C9`,"foreground-darken-3":`#A2A0B4`,"foreground-disabled":`#E0DEF460`,"foreground-lighten-1":`#F5F3FF`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#E0DEF499`,"input-cursor-background":`#F4EDE8`,"input-cursor-foreground":`#232136`,"input-selection-background":`#44415A`,"link-background":`#00000000`,"link-background-hover":`#C4A7E7`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#C4A7E7`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#C4A7E7`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#C4A7E7`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#E0DEF4`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#E0DEF4`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#E0DEF499`,panel:`#393552`,"panel-darken-1":`#282440`,"panel-darken-2":`#17152F`,"panel-darken-3":`#080020`,"panel-lighten-1":`#4A4564`,"panel-lighten-2":`#5C5776`,"panel-lighten-3":`#6F6989`,primary:`#C4A7E7`,"primary-background":`#58536A`,"primary-background-darken-1":`#49445D`,"primary-background-darken-2":`#3B3550`,"primary-background-darken-3":`#3B3550`,"primary-background-lighten-1":`#676277`,"primary-background-lighten-2":`#757184`,"primary-background-lighten-3":`#848091`,"primary-darken-1":`#AF93D1`,"primary-darken-2":`#9A7FBC`,"primary-darken-3":`#866CA8`,"primary-lighten-1":`#D9BBFC`,"primary-lighten-2":`#EED0FF`,"primary-lighten-3":`#FFE5FF`,"primary-muted":`#53496B`,scrollbar:`#594D72`,"scrollbar-active":`#C4A7E7`,"scrollbar-background":`#131125`,"scrollbar-background-active":`#131125`,"scrollbar-background-hover":`#131125`,"scrollbar-corner-color":`#131125`,"scrollbar-hover":`#6B5C86`,secondary:`#3E8FB0`,"secondary-background":`#474F63`,"secondary-background-darken-1":`#374055`,"secondary-background-darken-2":`#273148`,"secondary-background-darken-3":`#273148`,"secondary-background-lighten-1":`#575F71`,"secondary-background-lighten-2":`#676E7E`,"secondary-background-lighten-3":`#787E8C`,"secondary-darken-1":`#237B9B`,"secondary-darken-2":`#006888`,"secondary-darken-3":`#005674`,"secondary-lighten-1":`#54A2C4`,"secondary-lighten-2":`#6AB7D9`,"secondary-lighten-3":`#80CBEE`,"secondary-muted":`#2B425A`,success:`#9CCFD8`,"success-darken-1":`#87BAC3`,"success-darken-2":`#73A5AE`,"success-darken-3":`#60929A`,"success-lighten-1":`#B0E4ED`,"success-lighten-2":`#C5F9FF`,"success-lighten-3":`#DAFFFF`,"success-muted":`#475566`,surface:`#2A273F`,"surface-active":`#37334C`,"surface-darken-1":`#19172E`,"surface-darken-2":`#0A021E`,"surface-darken-3":`#00000F`,"surface-lighten-1":`#3A3750`,"surface-lighten-2":`#4C4862`,"surface-lighten-3":`#5E5975`,text:`#FFFFFFDD`,"text-accent":`#F1BCBA`,"text-disabled":`#FFFFFF60`,"text-error":`#F19FB7`,"text-muted":`#FFFFFF99`,"text-primary":`#D8C4EF`,"text-secondary":`#7FB5CA`,"text-success":`#BDDFE5`,"text-warning":`#F9D6A5`,warning:`#F5C177`,"warning-darken-1":`#DFAC63`,"warning-darken-2":`#C99850`,"warning-darken-3":`#B3853E`,"warning-lighten-1":`#FFD58A`,"warning-lighten-2":`#FFEB9E`,"warning-lighten-3":`#FFFFB3`,"warning-muted":`#625149`}},"solarized-dark":{name:`solarized-dark`,dark:!0,vars:{accent:`#6C71C4`,"accent-darken-1":`#575EAF`,"accent-darken-2":`#424C9A`,"accent-darken-3":`#2D3B87`,"accent-lighten-1":`#8083D9`,"accent-lighten-2":`#9597EE`,"accent-lighten-3":`#AAABFF`,"accent-muted":`#204060`,background:`#002B36`,"background-darken-1":`#001B25`,"background-darken-2":`#000A17`,"background-darken-3":`#000000`,"background-lighten-1":`#143B46`,"background-lighten-2":`#274C58`,"background-lighten-3":`#3A5E6A`,"block-cursor-background":`#268BD2`,"block-cursor-blurred-background":`#268BD24C`,"block-cursor-blurred-foreground":`#839496`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#268BD2`,"border-blurred":`#00303C`,"button-color-foreground":`#FDF6E3`,"button-foreground":`#839496`,error:`#DB322F`,"error-darken-1":`#C3121E`,"error-darken-2":`#AB000D`,"error-darken-3":`#940000`,"error-lighten-1":`#F44940`,"error-lighten-2":`#FF6052`,"error-lighten-3":`#FF7564`,"error-muted":`#422D33`,"footer-background":`#268BD2`,"footer-description-background":`#00000000`,"footer-description-foreground":`#FDF6E3`,"footer-foreground":`#839496`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FDF6E3`,foreground:`#839496`,"foreground-darken-1":`#6F8082`,"foreground-darken-2":`#5D6D6F`,"foreground-darken-3":`#4B5B5D`,"foreground-disabled":`#83949660`,"foreground-lighten-1":`#96A7A9`,"foreground-lighten-2":`#AABCBE`,"foreground-lighten-3":`#BED0D3`,"foreground-muted":`#83949699`,"input-cursor-background":`#839496`,"input-cursor-foreground":`#002B36`,"input-selection-background":`#073642`,"link-background":`#00000000`,"link-background-hover":`#268BD2`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#268BD2`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#268BD2`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#268BD2`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#839496`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#839496`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#83949699`,panel:`#073642`,"panel-darken-1":`#002531`,"panel-darken-2":`#001721`,"panel-darken-3":`#000112`,"panel-lighten-1":`#1D4653`,"panel-lighten-2":`#305865`,"panel-lighten-3":`#436A78`,primary:`#268BD2`,"primary-background":`#2A5667`,"primary-background-darken-1":`#17475A`,"primary-background-darken-2":`#05394D`,"primary-background-darken-3":`#05394D`,"primary-background-lighten-1":`#3D6575`,"primary-background-lighten-2":`#507482`,"primary-background-lighten-3":`#62838F`,"primary-darken-1":`#0077BD`,"primary-darken-2":`#0065A8`,"primary-darken-3":`#005394`,"primary-lighten-1":`#459EE7`,"primary-lighten-2":`#5FB2FD`,"primary-lighten-3":`#77C7FF`,"primary-muted":`#0B4764`,scrollbar:`#0F476A`,"scrollbar-active":`#268BD2`,"scrollbar-background":`#001B25`,"scrollbar-background-active":`#001B25`,"scrollbar-background-hover":`#001B25`,"scrollbar-corner-color":`#001B25`,"scrollbar-hover":`#13537B`,secondary:`#2AA198`,"secondary-background":`#2B5960`,"secondary-background-darken-1":`#184A52`,"secondary-background-darken-2":`#063C44`,"secondary-background-darken-3":`#063C44`,"secondary-background-lighten-1":`#3E676E`,"secondary-background-lighten-2":`#50767C`,"secondary-background-lighten-3":`#63858A`,"secondary-darken-1":`#008C84`,"secondary-darken-2":`#007971`,"secondary-darken-3":`#00665F`,"secondary-lighten-1":`#44B5AB`,"secondary-lighten-2":`#5BCAC0`,"secondary-lighten-3":`#72DFD5`,"secondary-muted":`#0C4E53`,success:`#849900`,"success-darken-1":`#708500`,"success-darken-2":`#5B7200`,"success-darken-3":`#485F00`,"success-lighten-1":`#99AC22`,"success-lighten-2":`#AFC139`,"success-lighten-3":`#C4D64E`,"success-muted":`#274C25`,surface:`#073642`,"surface-active":`#19434F`,"surface-darken-1":`#002531`,"surface-darken-2":`#001721`,"surface-darken-3":`#000112`,"surface-lighten-1":`#1D4653`,"surface-lighten-2":`#305865`,"surface-lighten-3":`#436A78`,text:`#FFFFFFDD`,"text-accent":`#9DA1D8`,"text-disabled":`#FFFFFF60`,"text-error":`#E77775`,"text-muted":`#FFFFFF99`,"text-primary":`#6FB2E1`,"text-secondary":`#72C0BB`,"text-success":`#AEBB56`,"text-warning":`#DC8865`,warning:`#CA4B16`,"warning-darken-1":`#B33600`,"warning-darken-2":`#9C2000`,"warning-darken-3":`#850100`,"warning-lighten-1":`#E25F29`,"warning-lighten-2":`#FA733C`,"warning-lighten-3":`#FF874E`,"warning-muted":`#3C342C`}},"solarized-light":{name:`solarized-light`,dark:!1,vars:{accent:`#6C71C4`,"accent-darken-1":`#575EAF`,"accent-darken-2":`#424C9A`,"accent-darken-3":`#2D3B87`,"accent-lighten-1":`#8083D9`,"accent-lighten-2":`#9597EE`,"accent-lighten-3":`#AAABFF`,"accent-muted":`#D1CED9`,background:`#FDF6E3`,"background-darken-1":`#E7E0CD`,"background-darken-2":`#D2CBB9`,"background-darken-3":`#BDB6A4`,"background-lighten-1":`#FFFFF8`,"background-lighten-2":`#FFFFFF`,"background-lighten-3":`#FFFFFF`,"block-cursor-background":`#268BD2`,"block-cursor-blurred-background":`#268BD24C`,"block-cursor-blurred-foreground":`#586E75`,"block-cursor-foreground":`#000000DD`,"block-hover-background":`#00000019`,boost:`#0000000A`,"boost-darken-1":`#0000000A`,"boost-darken-2":`#0000000A`,"boost-darken-3":`#0000000A`,"boost-lighten-1":`#1616160A`,"boost-lighten-2":`#2525250A`,"boost-lighten-3":`#3535350A`,border:`#268BD2`,"border-blurred":`#E6E0CE`,"button-color-foreground":`#FDF6E3`,"button-foreground":`#586E75`,error:`#DB322F`,"error-darken-1":`#C3121E`,"error-darken-2":`#AB000D`,"error-darken-3":`#940000`,"error-lighten-1":`#F44940`,"error-lighten-2":`#FF6052`,"error-lighten-3":`#FF7564`,"error-muted":`#F3BBAD`,"footer-background":`#268BD2`,"footer-description-background":`#00000000`,"footer-description-foreground":`#FDF6E3`,"footer-foreground":`#586E75`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FDF6E3`,foreground:`#586E75`,"foreground-darken-1":`#465B62`,"foreground-darken-2":`#344950`,"foreground-darken-3":`#23383F`,"foreground-disabled":`#586E7560`,"foreground-lighten-1":`#6A8088`,"foreground-lighten-2":`#7D949B`,"foreground-lighten-3":`#91A8AF`,"foreground-muted":`#586E7599`,"input-cursor-background":`#586E75`,"input-cursor-foreground":`#FDF6E3`,"input-selection-background":`#459EE766`,"link-background":`#00000000`,"link-background-hover":`#268BD2`,"link-color":`#000000DD`,"link-color-hover":`#000000DD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#268BD2`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#268BD2`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#268BD2`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#586E75`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#586E75`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#586E7599`,panel:`#EEE8D5`,"panel-darken-1":`#D8D2C0`,"panel-darken-2":`#C3BEAB`,"panel-darken-3":`#AFA997`,"panel-lighten-1":`#FFFDEA`,"panel-lighten-2":`#FFFFFF`,"panel-lighten-3":`#FFFFFF`,primary:`#268BD2`,"primary-background":`#268BD2`,"primary-background-darken-1":`#0077BD`,"primary-background-darken-2":`#0065A8`,"primary-background-darken-3":`#005394`,"primary-background-lighten-1":`#459EE7`,"primary-background-lighten-2":`#5FB2FD`,"primary-background-lighten-3":`#77C7FF`,"primary-darken-1":`#0077BD`,"primary-darken-2":`#0065A8`,"primary-darken-3":`#005394`,"primary-lighten-1":`#459EE7`,"primary-lighten-2":`#5FB2FD`,"primary-lighten-3":`#77C7FF`,"primary-muted":`#BCD5DD`,scrollbar:`#99BECF`,"scrollbar-active":`#268BD2`,"scrollbar-background":`#E7E0CD`,"scrollbar-background-active":`#E7E0CD`,"scrollbar-background-hover":`#E7E0CD`,"scrollbar-corner-color":`#E7E0CD`,"scrollbar-hover":`#86B5CF`,secondary:`#2AA198`,"secondary-background":`#2AA198`,"secondary-background-darken-1":`#008C84`,"secondary-background-darken-2":`#007971`,"secondary-background-darken-3":`#00665F`,"secondary-background-lighten-1":`#44B5AB`,"secondary-background-lighten-2":`#5BCAC0`,"secondary-background-lighten-3":`#72DFD5`,"secondary-darken-1":`#008C84`,"secondary-darken-2":`#007971`,"secondary-darken-3":`#00665F`,"secondary-lighten-1":`#44B5AB`,"secondary-lighten-2":`#5BCAC0`,"secondary-lighten-3":`#72DFD5`,"secondary-muted":`#BDDCCC`,success:`#849900`,"success-darken-1":`#708500`,"success-darken-2":`#5B7200`,"success-darken-3":`#485F00`,"success-lighten-1":`#99AC22`,"success-lighten-2":`#AFC139`,"success-lighten-3":`#C4D64E`,"success-muted":`#D9DA9E`,surface:`#EEE8D5`,"surface-active":`#FFF9E5`,"surface-darken-1":`#D8D2C0`,"surface-darken-2":`#C3BEAB`,"surface-darken-3":`#AFA997`,"surface-lighten-1":`#FFFDEA`,"surface-lighten-2":`#FFFFFF`,"surface-lighten-3":`#FFFFFF`,text:`#000000DD`,"text-accent":`#474A81`,"text-disabled":`#00000060`,"text-error":`#91211F`,"text-muted":`#00000099`,"text-primary":`#195B8A`,"text-secondary":`#1B6A64`,"text-success":`#576400`,"text-warning":`#85310E`,warning:`#CA4B16`,"warning-darken-1":`#B33600`,"warning-darken-2":`#9C2000`,"warning-darken-3":`#850100`,"warning-lighten-1":`#E25F29`,"warning-lighten-2":`#FA733C`,"warning-lighten-3":`#FF874E`,"warning-muted":`#EEC2A5`}},"svg-export":{name:`svg-export`,dark:!0,vars:{accent:`#56B6C2`,"accent-darken-1":`#3EA1AD`,"accent-darken-2":`#238D99`,"accent-darken-3":`#007A85`,"accent-lighten-1":`#6CCAD6`,"accent-lighten-2":`#81DFEC`,"accent-lighten-3":`#97F5FF`,"accent-muted":`#365356`,background:`#292929`,"background-darken-1":`#191919`,"background-darken-2":`#050505`,"background-darken-3":`#000000`,"background-lighten-1":`#393939`,"background-lighten-2":`#4A4A4A`,"background-lighten-3":`#5C5C5C`,"block-cursor-background":`#61AFEF`,"block-cursor-blurred-background":`#61AFEF4C`,"block-cursor-blurred-foreground":`#C5C8C6`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#61AFEF`,"border-blurred":`#191919`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#C5C8C6`,error:`#CB555A`,"error-darken-1":`#B54048`,"error-darken-2":`#9F2C37`,"error-darken-3":`#891427`,"error-lighten-1":`#E2686C`,"error-lighten-2":`#F97D7F`,"error-lighten-3":`#FF9192`,"error-muted":`#593637`,"footer-background":`#2C343A`,"footer-description-background":`#00000000`,"footer-description-foreground":`#C5C8C6`,"footer-foreground":`#C5C8C6`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#56B6C2`,foreground:`#C5C8C6`,"foreground-darken-1":`#B0B3B1`,"foreground-darken-2":`#9C9F9D`,"foreground-darken-3":`#888B89`,"foreground-disabled":`#C5C8C660`,"foreground-lighten-1":`#D9DCDA`,"foreground-lighten-2":`#EFF2F0`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#C5C8C699`,"input-cursor-background":`#C5C8C6`,"input-cursor-foreground":`#292929`,"input-selection-background":`#77C3FF66`,"link-background":`#00000000`,"link-background-hover":`#61AFEF`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#61AFEF`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#61AFEF`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#61AFEF`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#C5C8C6`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#C5C8C6`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#C5C8C699`,panel:`#2C343A`,"panel-darken-1":`#1C2429`,"panel-darken-2":`#0C141A`,"panel-darken-3":`#000007`,"panel-lighten-1":`#3C444B`,"panel-lighten-2":`#4D565C`,"panel-lighten-3":`#5F686F`,primary:`#61AFEF`,"primary-background":`#4F5A61`,"primary-background-darken-1":`#404B53`,"primary-background-darken-2":`#313D46`,"primary-background-darken-3":`#313D46`,"primary-background-lighten-1":`#5F686F`,"primary-background-lighten-2":`#6E777D`,"primary-background-lighten-3":`#7E858B`,"primary-darken-1":`#489BD9`,"primary-darken-2":`#2C87C4`,"primary-darken-3":`#0074AF`,"primary-lighten-1":`#77C3FF`,"primary-lighten-2":`#8ED8FF`,"primary-lighten-3":`#A4EDFF`,"primary-muted":`#395164`,scrollbar:`#35556E`,"scrollbar-active":`#61AFEF`,"scrollbar-background":`#191919`,"scrollbar-background-active":`#191919`,"scrollbar-background-hover":`#191919`,"scrollbar-corner-color":`#191919`,"scrollbar-hover":`#3D6484`,secondary:`#C678DD`,"secondary-background":`#5C5260`,"secondary-background-darken-1":`#4E4352`,"secondary-background-darken-2":`#403444`,"secondary-background-darken-3":`#403444`,"secondary-background-lighten-1":`#6A616E`,"secondary-background-lighten-2":`#79707C`,"secondary-background-lighten-3":`#87808A`,"secondary-darken-1":`#B064C7`,"secondary-darken-2":`#9B50B3`,"secondary-darken-3":`#873D9E`,"secondary-lighten-1":`#DB8CF2`,"secondary-lighten-2":`#F1A0FF`,"secondary-lighten-3":`#FFB5FF`,"secondary-muted":`#58405F`,success:`#98C379`,"success-darken-1":`#83AE65`,"success-darken-2":`#709A53`,"success-darken-3":`#5C8641`,"success-lighten-1":`#ACD78C`,"success-lighten-2":`#C1EDA0`,"success-lighten-3":`#D6FFB4`,"success-muted":`#4A5741`,surface:`#1E1E1E`,"surface-active":`#2A2A2A`,"surface-darken-1":`#0D0D0D`,"surface-darken-2":`#000000`,"surface-darken-3":`#000000`,"surface-lighten-1":`#2D2D2D`,"surface-lighten-2":`#3E3E3E`,"surface-lighten-3":`#4F4F4F`,text:`#FFFFFFDD`,"text-accent":`#8FCED6`,"text-disabled":`#FFFFFF60`,"text-error":`#DD8E92`,"text-muted":`#FFFFFF99`,"text-primary":`#96CAF4`,"text-secondary":`#D9A5E8`,"text-success":`#BBD7A6`,"text-warning":`#EDD5A7`,warning:`#E4C07B`,"warning-darken-1":`#CFAB67`,"warning-darken-2":`#B99754`,"warning-darken-3":`#A48442`,"warning-lighten-1":`#FBD48E`,"warning-lighten-2":`#FFE9A2`,"warning-lighten-3":`#FFFFB7`,"warning-muted":`#615641`}},"textual-ansi":{name:`textual-ansi`,dark:!0,vars:{accent:`#0000FF`,"accent-darken-1":`#0000FF`,"accent-darken-2":`#0000FF`,"accent-darken-3":`#0000FF`,"accent-lighten-1":`#0000FF`,"accent-lighten-2":`#0000FF`,"accent-lighten-3":`#0000FF`,"accent-muted":`#0178D4`,background:`#121212`,"background-darken-1":`#121212`,"background-darken-2":`#121212`,"background-darken-3":`#121212`,"background-lighten-1":`#121212`,"background-lighten-2":`#121212`,"background-lighten-3":`#121212`,"block-cursor-background":`#000080`,"block-cursor-blurred-background":`#0000804C`,"block-cursor-blurred-foreground":`#E0E0E0`,"block-cursor-foreground":`#E0E0E0`,"block-hover-background":`#00000019`,boost:`#0178D4`,"boost-darken-1":`#0178D4`,"boost-darken-2":`#0178D4`,"boost-darken-3":`#0178D4`,"boost-lighten-1":`#0178D4`,"boost-lighten-2":`#0178D4`,"boost-lighten-3":`#0178D4`,border:`#0000FF`,"border-blurred":`#000080`,"button-color-foreground":`#E0E0E0`,"button-foreground":`#E0E0E0`,error:`#800000`,"error-darken-1":`#800000`,"error-darken-2":`#800000`,"error-darken-3":`#800000`,"error-lighten-1":`#800000`,"error-lighten-2":`#800000`,"error-lighten-3":`#800000`,"error-muted":`#0178D4`,"footer-background":`#121212`,"footer-description-background":`#00000000`,"footer-description-foreground":`#E0E0E0`,"footer-foreground":`#E0E0E0`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#0000FF`,foreground:`#E0E0E0`,"foreground-darken-1":`#E0E0E0`,"foreground-darken-2":`#E0E0E0`,"foreground-darken-3":`#E0E0E0`,"foreground-disabled":`#00000060`,"foreground-lighten-1":`#E0E0E0`,"foreground-lighten-2":`#E0E0E0`,"foreground-lighten-3":`#E0E0E0`,"foreground-muted":`#00000099`,"input-cursor-background":`#121212`,"input-cursor-foreground":`#E0E0E0`,"input-selection-background":`#000080`,"link-background":`#00000000`,"link-background-hover":`#000080`,"link-color":`#E0E0E0`,"link-color-hover":`#0178D4`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#000080`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#000080`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#000080`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#E0E0E0`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#E0E0E0`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#00000099`,panel:`#121212`,"panel-darken-1":`#121212`,"panel-darken-2":`#121212`,"panel-darken-3":`#121212`,"panel-lighten-1":`#121212`,"panel-lighten-2":`#121212`,"panel-lighten-3":`#121212`,primary:`#000080`,"primary-background":`#000080`,"primary-background-darken-1":`#000080`,"primary-background-darken-2":`#000080`,"primary-background-darken-3":`#000080`,"primary-background-lighten-1":`#000080`,"primary-background-lighten-2":`#000080`,"primary-background-lighten-3":`#000080`,"primary-darken-1":`#000080`,"primary-darken-2":`#000080`,"primary-darken-3":`#000080`,"primary-lighten-1":`#000080`,"primary-lighten-2":`#000080`,"primary-lighten-3":`#000080`,"primary-muted":`#0178D4`,scrollbar:`#000080`,"scrollbar-active":`#000080`,"scrollbar-background":`#121212`,"scrollbar-background-active":`#121212`,"scrollbar-background-hover":`#121212`,"scrollbar-corner-color":`#E0E0E0`,"scrollbar-hover":`#000040`,secondary:`#008080`,"secondary-background":`#008080`,"secondary-background-darken-1":`#008080`,"secondary-background-darken-2":`#008080`,"secondary-background-darken-3":`#008080`,"secondary-background-lighten-1":`#008080`,"secondary-background-lighten-2":`#008080`,"secondary-background-lighten-3":`#008080`,"secondary-darken-1":`#008080`,"secondary-darken-2":`#008080`,"secondary-darken-3":`#008080`,"secondary-lighten-1":`#008080`,"secondary-lighten-2":`#008080`,"secondary-lighten-3":`#008080`,"secondary-muted":`#0178D4`,success:`#008000`,"success-darken-1":`#008000`,"success-darken-2":`#008000`,"success-darken-3":`#008000`,"success-lighten-1":`#008000`,"success-lighten-2":`#008000`,"success-lighten-3":`#008000`,"success-muted":`#0178D4`,surface:`#121212`,"surface-active":`#131313`,"surface-darken-1":`#121212`,"surface-darken-2":`#121212`,"surface-darken-3":`#121212`,"surface-lighten-1":`#121212`,"surface-lighten-2":`#121212`,"surface-lighten-3":`#121212`,text:`#E0E0E0`,"text-accent":`#5656FF`,"text-disabled":`#E0E0E0`,"text-error":`#AB5656`,"text-muted":`#E0E0E0`,"text-primary":`#5656AB`,"text-secondary":`#56ABAB`,"text-success":`#56AB56`,"text-warning":`#ABAB56`,warning:`#808000`,"warning-darken-1":`#808000`,"warning-darken-2":`#808000`,"warning-darken-3":`#808000`,"warning-lighten-1":`#808000`,"warning-lighten-2":`#808000`,"warning-lighten-3":`#808000`,"warning-muted":`#0178D4`}},"textual-dark":{name:`textual-dark`,dark:!0,vars:{accent:`#FEA62B`,"accent-darken-1":`#E7920D`,"accent-darken-2":`#CF7E00`,"accent-darken-3":`#B86B00`,"accent-lighten-1":`#FFBA41`,"accent-lighten-2":`#FFCF56`,"accent-lighten-3":`#FFE46B`,"accent-muted":`#593E19`,background:`#121212`,"background-darken-1":`#000000`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#212121`,"background-lighten-2":`#313131`,"background-lighten-3":`#414141`,"block-cursor-background":`#0178D4`,"block-cursor-blurred-background":`#0178D44C`,"block-cursor-blurred-foreground":`#E0E0E0`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#0178D4`,"border-blurred":`#191919`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#E0E0E0`,error:`#B93C5B`,"error-darken-1":`#A32549`,"error-darken-2":`#8D0638`,"error-darken-3":`#780028`,"error-lighten-1":`#D0506D`,"error-lighten-2":`#E76580`,"error-lighten-3":`#FE7993`,"error-muted":`#441E27`,"footer-background":`#242F38`,"footer-description-background":`#00000000`,"footer-description-foreground":`#E0E0E0`,"footer-foreground":`#E0E0E0`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FFA62B`,foreground:`#E0E0E0`,"foreground-darken-1":`#CACACA`,"foreground-darken-2":`#B6B6B6`,"foreground-darken-3":`#A2A2A2`,"foreground-disabled":`#E0E0E060`,"foreground-lighten-1":`#F5F5F5`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#E0E0E099`,"input-cursor-background":`#E0E0E0`,"input-cursor-foreground":`#121212`,"input-selection-background":`#368AE966`,"link-background":`#00000000`,"link-background-hover":`#0178D4`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#0178D4`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#0178D4`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#0178D4`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#E0E0E0`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#E0E0E0`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#E0E0E099`,panel:`#242F38`,"panel-darken-1":`#141F27`,"panel-darken-2":`#000F18`,"panel-darken-3":`#000003`,"panel-lighten-1":`#343F49`,"panel-lighten-2":`#45505A`,"panel-lighten-3":`#57626D`,primary:`#0178D4`,"primary-background":`#33424E`,"primary-background-darken-1":`#21313E`,"primary-background-darken-2":`#0F212F`,"primary-background-darken-3":`#0F212F`,"primary-background-lighten-1":`#45525D`,"primary-background-lighten-2":`#57636D`,"primary-background-lighten-3":`#69747D`,"primary-darken-1":`#0065BE`,"primary-darken-2":`#0053AA`,"primary-darken-3":`#004295`,"primary-lighten-1":`#368AE9`,"primary-lighten-2":`#539EFF`,"primary-lighten-3":`#6DB2FF`,"primary-muted":`#0C304C`,scrollbar:`#003054`,"scrollbar-active":`#0178D4`,"scrollbar-background":`#000000`,"scrollbar-background-active":`#000000`,"scrollbar-background-hover":`#000000`,"scrollbar-corner-color":`#000000`,"scrollbar-hover":`#003C6A`,secondary:`#004578`,"secondary-background":`#333B42`,"secondary-background-darken-1":`#212A31`,"secondary-background-darken-2":`#0F1921`,"secondary-background-darken-3":`#0F1921`,"secondary-background-lighten-1":`#454C52`,"secondary-background-lighten-2":`#575E63`,"secondary-background-lighten-3":`#696F74`,"secondary-darken-1":`#003465`,"secondary-darken-2":`#002452`,"secondary-darken-3":`#001541`,"secondary-lighten-1":`#23568B`,"secondary-lighten-2":`#3B689F`,"secondary-lighten-3":`#507BB3`,"secondary-muted":`#0C2130`,success:`#4EBF71`,"success-darken-1":`#36AA5E`,"success-darken-2":`#18954B`,"success-darken-3":`#008139`,"success-lighten-1":`#64D484`,"success-lighten-2":`#7AE998`,"success-lighten-3":`#8FFFAC`,"success-muted":`#24452E`,surface:`#1E1E1E`,"surface-active":`#2A2A2A`,"surface-darken-1":`#0D0D0D`,"surface-darken-2":`#000000`,"surface-darken-3":`#000000`,"surface-lighten-1":`#2D2D2D`,"surface-lighten-2":`#3E3E3E`,"surface-lighten-3":`#4F4F4F`,text:`#FFFFFFDD`,"text-accent":`#FFC473`,"text-disabled":`#FFFFFF60`,"text-error":`#D17E92`,"text-muted":`#FFFFFF99`,"text-primary":`#57A5E2`,"text-secondary":`#5684A5`,"text-success":`#8AD4A1`,"text-warning":`#FFC473`,warning:`#FEA62B`,"warning-darken-1":`#E7920D`,"warning-darken-2":`#CF7E00`,"warning-darken-3":`#B86B00`,"warning-lighten-1":`#FFBA41`,"warning-lighten-2":`#FFCF56`,"warning-lighten-3":`#FFE46B`,"warning-muted":`#593E19`}},"textual-light":{name:`textual-light`,dark:!1,vars:{accent:`#FEA62B`,"accent-darken-1":`#E7920D`,"accent-darken-2":`#CF7E00`,"accent-darken-3":`#B86B00`,"accent-lighten-1":`#FFBA41`,"accent-lighten-2":`#FFCF56`,"accent-lighten-3":`#FFE46B`,"accent-muted":`#E9CEA9`,background:`#E0E0E0`,"background-darken-1":`#CACACA`,"background-darken-2":`#B6B6B6`,"background-darken-3":`#A2A2A2`,"background-lighten-1":`#F5F5F5`,"background-lighten-2":`#FFFFFF`,"background-lighten-3":`#FFFFFF`,"block-cursor-background":`#004578`,"block-cursor-blurred-background":`#0045784C`,"block-cursor-blurred-foreground":`#1F1F1F`,"block-cursor-foreground":`#000000DD`,"block-hover-background":`#00000019`,boost:`#0000000A`,"boost-darken-1":`#0000000A`,"boost-darken-2":`#0000000A`,"boost-darken-3":`#0000000A`,"boost-lighten-1":`#1616160A`,"boost-lighten-2":`#2525250A`,"boost-lighten-3":`#3535350A`,border:`#004578`,"border-blurred":`#D0D1D0`,"button-color-foreground":`#000000DD`,"button-foreground":`#1F1F1F`,error:`#B93C5B`,"error-darken-1":`#A32549`,"error-darken-2":`#8D0638`,"error-darken-3":`#780028`,"error-lighten-1":`#D0506D`,"error-lighten-2":`#E76580`,"error-lighten-3":`#FE7993`,"error-muted":`#D4AEB8`,"footer-background":`#D0D0D0`,"footer-description-background":`#00000000`,"footer-description-foreground":`#1F1F1F`,"footer-foreground":`#1F1F1F`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#0178D4`,foreground:`#1F1F1F`,"foreground-darken-1":`#0E0E0E`,"foreground-darken-2":`#000000`,"foreground-darken-3":`#000000`,"foreground-disabled":`#1F1F1F60`,"foreground-lighten-1":`#2E2E2E`,"foreground-lighten-2":`#3F3F3F`,"foreground-lighten-3":`#505050`,"foreground-muted":`#1F1F1F99`,"input-cursor-background":`#1F1F1F`,"input-cursor-foreground":`#E0E0E0`,"input-selection-background":`#23568B66`,"link-background":`#00000000`,"link-background-hover":`#004578`,"link-color":`#000000DD`,"link-color-hover":`#000000DD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#004578`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#004578`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#004578`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#1F1F1F`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#1F1F1F`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#1F1F1F99`,panel:`#D0D0D0`,"panel-darken-1":`#BBBBBB`,"panel-darken-2":`#A6A6A6`,"panel-darken-3":`#939393`,"panel-lighten-1":`#E5E5E5`,"panel-lighten-2":`#FAFAFA`,"panel-lighten-3":`#FFFFFF`,primary:`#004578`,"primary-background":`#004578`,"primary-background-darken-1":`#003465`,"primary-background-darken-2":`#002452`,"primary-background-darken-3":`#001541`,"primary-background-lighten-1":`#23568B`,"primary-background-lighten-2":`#3B689F`,"primary-background-lighten-3":`#507BB3`,"primary-darken-1":`#003465`,"primary-darken-2":`#002452`,"primary-darken-3":`#001541`,"primary-lighten-1":`#23568B`,"primary-lighten-2":`#3B689F`,"primary-lighten-3":`#507BB3`,"primary-muted":`#9CB1C0`,scrollbar:`#7994A9`,"scrollbar-active":`#004578`,"scrollbar-background":`#CACACA`,"scrollbar-background-active":`#CACACA`,"scrollbar-background-hover":`#CACACA`,"scrollbar-corner-color":`#CACACA`,"scrollbar-hover":`#6587A1`,secondary:`#0178D4`,"secondary-background":`#0178D4`,"secondary-background-darken-1":`#0065BE`,"secondary-background-darken-2":`#0053AA`,"secondary-background-darken-3":`#004295`,"secondary-background-lighten-1":`#368AE9`,"secondary-background-lighten-2":`#539EFF`,"secondary-background-lighten-3":`#6DB2FF`,"secondary-darken-1":`#0065BE`,"secondary-darken-2":`#0053AA`,"secondary-darken-3":`#004295`,"secondary-lighten-1":`#368AE9`,"secondary-lighten-2":`#539EFF`,"secondary-lighten-3":`#6DB2FF`,"secondary-muted":`#9DC0DC`,success:`#4EBF71`,"success-darken-1":`#36AA5E`,"success-darken-2":`#18954B`,"success-darken-3":`#008139`,"success-lighten-1":`#64D484`,"success-lighten-2":`#7AE998`,"success-lighten-3":`#8FFFAC`,"success-muted":`#B4D6BE`,surface:`#D8D8D8`,"surface-active":`#E8E8E8`,"surface-darken-1":`#C3C3C3`,"surface-darken-2":`#AEAEAE`,"surface-darken-3":`#9A9A9A`,"surface-lighten-1":`#EDEDED`,"surface-lighten-2":`#FFFFFF`,"surface-lighten-3":`#FFFFFF`,text:`#000000DD`,"text-accent":`#A86D1C`,"text-disabled":`#00000060`,"text-error":`#7A273C`,"text-muted":`#00000099`,"text-primary":`#002D4F`,"text-secondary":`#004F8B`,"text-success":`#337E4A`,"text-warning":`#A86D1C`,warning:`#FEA62B`,"warning-darken-1":`#E7920D`,"warning-darken-2":`#CF7E00`,"warning-darken-3":`#B86B00`,"warning-lighten-1":`#FFBA41`,"warning-lighten-2":`#FFCF56`,"warning-lighten-3":`#FFE46B`,"warning-muted":`#E9CEA9`}},"tokyo-night":{name:`tokyo-night`,dark:!0,vars:{accent:`#FE9E64`,"accent-darken-1":`#E78A51`,"accent-darken-2":`#D0763E`,"accent-darken-3":`#BA632C`,"accent-lighten-1":`#FFB277`,"accent-lighten-2":`#FFC78A`,"accent-lighten-3":`#FFDC9E`,"accent-muted":`#5E4238`,background:`#1A1B26`,"background-darken-1":`#070817`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#292A36`,"background-lighten-2":`#3A3A47`,"background-lighten-3":`#4B4B58`,"block-cursor-background":`#BB9AF7`,"block-cursor-blurred-background":`#BB9AF74C`,"block-cursor-blurred-foreground":`#A9B1D6`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#BB9AF7`,"border-blurred":`#1E2235`,"button-color-foreground":`#24283B`,"button-foreground":`#A9B1D6`,error:`#F6768E`,"error-darken-1":`#E0617A`,"error-darken-2":`#C94D68`,"error-darken-3":`#B33856`,"error-lighten-1":`#FF8AA1`,"error-lighten-2":`#FF9FB5`,"error-lighten-3":`#FFB4CA`,"error-muted":`#5C3645`,"footer-background":`#414868`,"footer-description-background":`#00000000`,"footer-description-foreground":`#A9B1D6`,"footer-foreground":`#A9B1D6`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FF9E64`,foreground:`#A9B1D6`,"foreground-darken-1":`#949CC1`,"foreground-darken-2":`#8189AC`,"foreground-darken-3":`#6D7698`,"foreground-disabled":`#A9B1D660`,"foreground-lighten-1":`#BDC5EB`,"foreground-lighten-2":`#D2DAFF`,"foreground-lighten-3":`#E7EFFF`,"foreground-muted":`#A9B1D699`,"input-cursor-background":`#A9B1D6`,"input-cursor-foreground":`#1A1B26`,"input-selection-background":`#D0AEFF66`,"link-background":`#00000000`,"link-background-hover":`#BB9AF7`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#BB9AF7`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#BB9AF7`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#BB9AF7`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#A9B1D6`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#A9B1D6`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#A9B1D699`,panel:`#414868`,"panel-darken-1":`#2F3755`,"panel-darken-2":`#1E2744`,"panel-darken-3":`#0C1733`,"panel-lighten-1":`#53597A`,"panel-lighten-2":`#656B8E`,"panel-lighten-3":`#787EA1`,primary:`#BB9AF7`,"primary-background":`#504D60`,"primary-background-darken-1":`#413D52`,"primary-background-darken-2":`#322E45`,"primary-background-darken-3":`#322E45`,"primary-background-lighten-1":`#605D6E`,"primary-background-lighten-2":`#6F6C7C`,"primary-background-lighten-3":`#7E7C8A`,"primary-darken-1":`#A686E1`,"primary-darken-2":`#9173CC`,"primary-darken-3":`#7D60B7`,"primary-lighten-1":`#D0AEFF`,"primary-lighten-2":`#E5C2FF`,"primary-lighten-3":`#FBD7FF`,"primary-muted":`#4A4164`,scrollbar:`#4F4270`,"scrollbar-active":`#BB9AF7`,"scrollbar-background":`#070817`,"scrollbar-background-active":`#070817`,"scrollbar-background-hover":`#070817`,"scrollbar-corner-color":`#070817`,"scrollbar-hover":`#615187`,secondary:`#7AA2F7`,"secondary-background":`#484E60`,"secondary-background-darken-1":`#383E52`,"secondary-background-darken-2":`#282F45`,"secondary-background-darken-3":`#282F45`,"secondary-background-lighten-1":`#585D6E`,"secondary-background-lighten-2":`#686D7C`,"secondary-background-lighten-3":`#787D8A`,"secondary-darken-1":`#648EE1`,"secondary-darken-2":`#4D7BCC`,"secondary-darken-3":`#3468B7`,"secondary-lighten-1":`#8FB6FF`,"secondary-lighten-2":`#A5CAFF`,"secondary-lighten-3":`#BBDFFF`,"secondary-muted":`#364364`,success:`#9ECE6A`,"success-darken-1":`#89B956`,"success-darken-2":`#75A443`,"success-darken-3":`#619030`,"success-lighten-1":`#B2E37D`,"success-lighten-2":`#C8F891`,"success-lighten-3":`#DDFFA6`,"success-muted":`#41503A`,surface:`#24283B`,"surface-active":`#313448`,"surface-darken-1":`#14182A`,"surface-darken-2":`#00031B`,"surface-darken-3":`#000009`,"surface-lighten-1":`#34384C`,"surface-lighten-2":`#45495E`,"surface-lighten-3":`#575A70`,text:`#FFFFFFDD`,"text-accent":`#FFBE98`,"text-disabled":`#FFFFFF60`,"text-error":`#F9A4B4`,"text-muted":`#FFFFFF99`,"text-primary":`#D2BCF9`,"text-secondary":`#A7C1F9`,"text-success":`#BEDE9C`,"text-warning":`#EACA9B`,warning:`#DFAF68`,"warning-darken-1":`#C99A55`,"warning-darken-2":`#B48742`,"warning-darken-3":`#9E7430`,"warning-lighten-1":`#F6C37B`,"warning-lighten-2":`#FFD88F`,"warning-lighten-3":`#FFEDA3`,"warning-muted":`#554739`}}},zi=Object.freeze(Object.keys(Ri).sort()),Bi=new Map;function Vi(){return zi}function Hi(e){if(!Ui(e))return null;let t=Bi.get(e);if(t!==void 0)return t;let n=Gi(Ri[e]);return Bi.set(e,n),n}function Ui(e){return Object.hasOwn(Ri,e)}function K(e){let t=Ri[e];return{name:t.name,dark:t.dark,bg:Wi(t,`background`),fg:Wi(t,`foreground`),primary:Wi(t,`primary`),secondary:Wi(t,`secondary`),accent:Wi(t,`accent`),success:Wi(t,`success`),warning:Wi(t,`warning`),error:Wi(t,`error`)}}function Wi(e,t){let n=e.vars[t];if(n===void 0)throw Error(`Theme ${e.name}: required base var "${t}" missing from data file`);return qi(n,e.name,t)}function Gi(e){let t=new Map;for(let[n,r]of Object.entries(e.vars))t.set(n,qi(r,e.name,n));return new Kr(e.name,e.dark,t)}const Ki=/^[0-9a-fA-F]+$/;function qi(e,t,n){let r=e.startsWith(`#`)?e.slice(1):e;if(r.length!==6&&r.length!==8||!Ki.test(r))throw Error(`Theme ${t}: var ${n} has invalid hex ${JSON.stringify(e)} (expected #RRGGBB or #RRGGBBAA)`);return r.length===6?oi(r):si(r)}function q(e){return new li(e.bg,e.fg,pi,Li(e.name,e.dark,{primary:e.primary,secondary:e.secondary,accent:e.accent,success:e.success,warning:e.warning,error:e.error,background:e.bg,foreground:e.fg}))}const Ji=q(K(`default`));q(K(`svg-export`)),q(K(`monokai`)),q(K(`nord`)),q(K(`gruvbox`)),q(K(`dracula`)),q(K(`tokyo-night`)),q(K(`flexoki`)),q(K(`cyberpunk`)),q(K(`catppuccin-mocha`)),q(K(`catppuccin-latte`)),q(K(`catppuccin-frappe`)),q(K(`catppuccin-macchiato`)),q(K(`solarized-dark`)),q(K(`solarized-light`)),q(K(`rose-pine`)),q(K(`rose-pine-moon`)),q(K(`rose-pine-dawn`)),q(K(`atom-one-dark`)),q(K(`atom-one-light`)),q(K(`textual-dark`)),q(K(`textual-light`)),q(K(`textual-ansi`));const Yi=new Set([`error`,`success`,`warning`]);function Xi(e){let t=e.indexOf(`-`);return t===-1?e:e.slice(0,t)}function Zi(e){return Yi.has(Xi(e))}function Qi(e,t,n){if(_i(t))return new Kr(n??e.name,e.dark,e.vars);let r={...t,hueShift:0},i=new Map;for(let[n,a]of e.vars){let e=Zi(n)?r:t;i.set(n,wi.fromRgba(a).applyKey(e).toRgba())}let a=i.get(`background`);if(a===void 0)throw Error(`transposePalette: palette "${e.name}" has no "background" var; cannot derive the dark flag without a background color.`);let o=wi.fromRgba(a).l<.5;return new Kr(n??e.name,o,i)}const $i=/[\x1b\x07\x9c]/g;function ea(e){return e.replace($i,``)}const ta=new H(0,0,0),na=[`bold`,`dim`,`italic`,`underline`,`blink`,`blink2`,`reverse`,`conceal`,`strike`,`underline2`,`frame`,`encircle`,`overline`],ra={bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],blink:[5,25],blink2:[6,25],reverse:[7,27],conceal:[8,28],strike:[9,29],underline2:[21,24],frame:[51,54],encircle:[52,54],overline:[53,55]},ia={b:`bold`,d:`dim`,i:`italic`,u:`underline`,s:`strike`,r:`reverse`,o:`overline`,uu:`underline2`};var aa=class extends Error{constructor(e){super(e),this.name=`StyleSyntaxError`}};const oa=new Map;var J=class e{color;bgcolor;bold;dim;italic;underline;blink;blink2;reverse;conceal;strike;underline2;frame;encircle;overline;link;meta;constructor(e){if(!e){this.color=void 0,this.bgcolor=void 0,this.bold=void 0,this.dim=void 0,this.italic=void 0,this.underline=void 0,this.blink=void 0,this.blink2=void 0,this.reverse=void 0,this.conceal=void 0,this.strike=void 0,this.underline2=void 0,this.frame=void 0,this.encircle=void 0,this.overline=void 0,this.link=void 0,this.meta=void 0;return}this.color=ua(e.color),this.bgcolor=ua(e.bgcolor),this.bold=e.bold,this.dim=e.dim,this.italic=e.italic,this.underline=e.underline,this.blink=e.blink,this.blink2=e.blink2,this.reverse=e.reverse,this.conceal=e.conceal,this.strike=e.strike,this.underline2=e.underline2,this.frame=e.frame,this.encircle=e.encircle,this.overline=e.overline,this.link=e.link,this.meta=e.meta}get isNull(){return this.color===void 0&&this.bgcolor===void 0&&this.bold===void 0&&this.dim===void 0&&this.italic===void 0&&this.underline===void 0&&this.blink===void 0&&this.blink2===void 0&&this.reverse===void 0&&this.conceal===void 0&&this.strike===void 0&&this.underline2===void 0&&this.frame===void 0&&this.encircle===void 0&&this.overline===void 0&&this.link===void 0&&this.meta===void 0}get transparentBackground(){return this.bgcolor===void 0||this.bgcolor.isDefault}get backgroundStyle(){return new e({bgcolor:this.bgcolor})}get withoutColor(){return new e({bold:this.bold,dim:this.dim,italic:this.italic,underline:this.underline,blink:this.blink,blink2:this.blink2,reverse:this.reverse,conceal:this.conceal,strike:this.strike,underline2:this.underline2,frame:this.frame,encircle:this.encircle,overline:this.overline,link:this.link,meta:this.meta})}withLink(t){return new e({color:this.color,bgcolor:this.bgcolor,bold:this.bold,dim:this.dim,italic:this.italic,underline:this.underline,blink:this.blink,blink2:this.blink2,reverse:this.reverse,conceal:this.conceal,strike:this.strike,underline2:this.underline2,frame:this.frame,encircle:this.encircle,overline:this.overline,link:t,meta:this.meta})}clearMetaAndLinks(){return new e({color:this.color,bgcolor:this.bgcolor,bold:this.bold,dim:this.dim,italic:this.italic,underline:this.underline,blink:this.blink,blink2:this.blink2,reverse:this.reverse,conceal:this.conceal,strike:this.strike,underline2:this.underline2,frame:this.frame,encircle:this.encircle,overline:this.overline})}add(t){return!t||t.isNull?this:this.isNull?t:new e({color:t.color??this.color,bgcolor:t.bgcolor??this.bgcolor,bold:t.bold??this.bold,dim:t.dim??this.dim,italic:t.italic??this.italic,underline:t.underline??this.underline,blink:t.blink??this.blink,blink2:t.blink2??this.blink2,reverse:t.reverse??this.reverse,conceal:t.conceal??this.conceal,strike:t.strike??this.strike,underline2:t.underline2??this.underline2,frame:t.frame??this.frame,encircle:t.encircle??this.encircle,overline:t.overline??this.overline,link:t.link??this.link,meta:t.meta&&this.meta?{...this.meta,...t.meta}:t.meta??this.meta})}equals(e){return this===e?!0:this.color?.name===e.color?.name&&this.bgcolor?.name===e.bgcolor?.name&&this.bold===e.bold&&this.dim===e.dim&&this.italic===e.italic&&this.underline===e.underline&&this.blink===e.blink&&this.blink2===e.blink2&&this.reverse===e.reverse&&this.conceal===e.conceal&&this.strike===e.strike&&this.underline2===e.underline2&&this.frame===e.frame&&this.encircle===e.encircle&&this.overline===e.overline&&this.link===e.link}toSgrCodes(e){if(this.isNull)return``;let t=[],n=ta,r=this.bgcolor?.flattenAlpha(n),i=r?.getTruecolor(void 0,!1)??n,a=this.color?.flattenAlpha(i);if(a){let n=e===void 0?a:a.downgrade(e);t.push(...n.getAnsiCodes(!0))}if(r){let n=e===void 0?r:r.downgrade(e);t.push(...n.getAnsiCodes(!1))}for(let e of na){let n=this[e];n===!0?t.push(`${ra[e][0]}`):n===!1&&t.push(`${ra[e][1]}`)}return t.join(`;`)}render(e,t){if(e.length===0)return``;if(this.isNull)return e;let n=this.toSgrCodes(t),r=n.length>0?`\x1b[${n}m${e}\x1b[0m`:e;return this.link&&(r=`\x1b]8;;${ea(this.link)}\x1b\\${r}\x1b]8;;\x1b\\`),r}getHtmlStyle(e){if(this.isNull)return``;let t=[];if(this.color){let n=this.color.getTruecolor(e,!0);t.push(`color: ${n.hex}`)}if(this.bgcolor){let n=this.bgcolor.getTruecolor(e,!1);t.push(`background-color: ${n.hex}`)}this.bold&&t.push(`font-weight: bold`),this.italic&&t.push(`font-style: italic`);let n=[];return this.underline&&n.push(`underline`),this.strike&&n.push(`line-through`),this.overline&&n.push(`overline`),n.length>0&&t.push(`text-decoration: ${n.join(` `)}`),this.dim&&t.push(`opacity: 0.5`),t.join(`; `)}toString(){if(this.isNull)return`none`;let e=[];for(let t of na)this[t]===!1&&e.push(`not ${t}`);for(let t of na)this[t]===!0&&e.push(t);return this.color&&e.push(this.color.name),this.bgcolor&&e.push(`on ${this.bgcolor.name}`),this.link&&e.push(`link ${this.link}`),e.join(` `)||`none`}static null(){return sa}static fromColor(t,n){return new e({color:t,bgcolor:n})}static fromMeta(t){return new e({meta:t})}static pickFirst(...e){for(let t of e)if(t!==void 0)return t;throw Error(`All arguments are undefined`)}static combine(e){let t=sa;for(let n of e)n&&(t=t.add(n));return t}static chain(...t){return e.combine(t)}static normalize(e){return e.trim().replace(/\s+/g,` `)}static parse(t){let n=e.normalize(t);if(n===``||n===`none`)return sa;let r=oa.get(n);if(r)return r;if(da&&n.includes(`.`)){let e=fa[n];if(e!==void 0)return oa.set(n,e),e}let i=la(n);return oa.set(n,i),i}};const sa=new J,ca=new Set(na);function la(e){let t=e.split(/\s+/),n={},r=0;for(;r<t.length;){let e=t[r];if(e===`not`){r++;let e=t[r];if(!e)throw new aa(`Expected attribute after "not" in style definition`);let i=ia[e]??e;if(!ca.has(i))throw new aa(`Invalid attribute: "${e}"`);n[i]=!1,r++;continue}if(e===`on`){r++;let e=t[r];if(!e)throw new aa(`Expected color after "on" in style definition`);try{n.bgcolor=W.parse(e)}catch{throw new aa(`Invalid background color: "${e}"`)}r++;continue}if(e===`link`){r++;let e=t[r];e&&(n.link=e),r++;continue}let i=ia[e]??e;if(ca.has(i)){n[i]=!0,r++;continue}try{n.color=W.parse(e)}catch{throw new aa(`Invalid style definition: "${e}"`)}r++}return new J(n)}function ua(e){if(e!==void 0)return e instanceof W?e:W.parse(e)}let da=!1;const fa={none:sa,reset:new J({color:W.default(),bgcolor:W.default(),bold:!1,dim:!1,italic:!1,underline:!1,blink:!1,blink2:!1,reverse:!1,conceal:!1,strike:!1,underline2:!1,frame:!1,encircle:!1,overline:!1}),bold:new J({bold:!0}),dim:new J({dim:!0}),italic:new J({italic:!0}),underline:new J({underline:!0}),blink:new J({blink:!0}),blink2:new J({blink2:!0}),reverse:new J({reverse:!0}),conceal:new J({conceal:!0}),strike:new J({strike:!0}),underline2:new J({underline2:!0}),frame:new J({frame:!0}),encircle:new J({encircle:!0}),overline:new J({overline:!0}),"table.header":new J({bold:!0}),"table.footer":new J({bold:!0}),"table.cell":sa,"table.title":new J({italic:!0}),"table.caption":new J({italic:!0,dim:!0}),"repr.str":J.parse(`green`),"repr.number":J.parse(`cyan`),"repr.bool":J.parse(`italic bright_magenta`),"repr.none":J.parse(`italic magenta`),"repr.url":J.parse(`not italic underline bright_blue`),"repr.uuid":J.parse(`bright_yellow`),"repr.error":J.parse(`bold red`),"repr.indent":J.parse(`dim green`),"repr.attrib_name":J.parse(`yellow`),"repr.attrib_value":J.parse(`magenta`),"repr.attrib_equal":J.parse(`bold`),"repr.tag_start":J.parse(`bold`),"repr.tag_name":J.parse(`bright_magenta`),"repr.tag_contents":J.parse(`default`),"repr.tag_end":J.parse(`bold`),"log.time":J.parse(`cyan dim`),"log.message":sa,"log.path":J.parse(`dim`),"log.line_no":J.parse(`cyan`),"log.level":sa,"rule.line":J.parse(`green`),"rule.text":J.parse(`bold`),"json.brace":J.parse(`bold`),"json.bool":J.parse(`italic bright_magenta`),"json.key":J.parse(`bold blue`),"json.null":J.parse(`italic magenta`),"json.number":J.parse(`cyan`),"json.str":J.parse(`green`),"markdown.h1":J.parse(`bold underline`),"markdown.h2":J.parse(`bold`),"markdown.h3":J.parse(`bold dim`),"markdown.h4":J.parse(`bold dim italic`),"markdown.code":J.parse(`cyan on grey11`),"markdown.hr":J.parse(`yellow`),"markdown.link":J.parse(`bright_blue`),"markdown.link_url":J.parse(`blue`),"progress.description":sa,"progress.percentage":J.parse(`cyan`),"progress.remaining":J.parse(`cyan`),"progress.elapsed":J.parse(`cyan`),"progress.spinner":J.parse(`green`),"progress.download":J.parse(`green`),"progress.filesize":J.parse(`green`),"progress.filesize.total":J.parse(`green`),"progress.data.speed":J.parse(`red`),"bar.back":J.parse(`grey23`),"bar.complete":J.parse(`magenta`),"bar.finished":J.parse(`green`),"bar.pulse":J.parse(`magenta`),tree:sa,"tree.guide":sa,"status.spinner":J.parse(`green`),"status.message":sa,prompt:J.parse(`bold`),"prompt.choices":J.parse(`magenta`),"prompt.default":J.parse(`cyan`),"inspect.attr":J.parse(`yellow italic`),"inspect.attr.dunder":J.parse(`yellow italic dim`),"inspect.callable":J.parse(`bold magenta`),"inspect.error":J.parse(`bold red`),"inspect.help":J.parse(`cyan`),"inspect.doc":J.parse(`dim`),"inspect.value.border":J.parse(`green`),"traceback.border":J.parse(`red`),"traceback.text":J.parse(`red`),"traceback.title":J.parse(`bold red`),"traceback.exc_type":J.parse(`bold bright_red`),"traceback.exc_value":sa,"traceback.offset":J.parse(`bold bright_red`),"scope.border":J.parse(`blue`),"scope.key":J.parse(`italic`),"scope.key.special":J.parse(`dim italic`),pretty:sa,"iso8601.date":J.parse(`cyan`),"iso8601.time":J.parse(`cyan`),"iso8601.timezone":J.parse(`bright_blue`)};da=!0;var pa;(function(e){e.BELL=`bell`,e.CARRIAGE_RETURN=`carriage_return`,e.HOME=`home`,e.CLEAR=`clear`,e.SHOW_CURSOR=`show_cursor`,e.HIDE_CURSOR=`hide_cursor`,e.ENABLE_ALT_SCREEN=`enable_alt_screen`,e.DISABLE_ALT_SCREEN=`disable_alt_screen`,e.CURSOR_UP=`cursor_up`,e.CURSOR_DOWN=`cursor_down`,e.CURSOR_FORWARD=`cursor_forward`,e.CURSOR_BACKWARD=`cursor_backward`,e.CURSOR_MOVE_TO_COLUMN=`cursor_move_to_column`,e.CURSOR_MOVE_TO=`cursor_move_to`,e.ERASE_IN_LINE=`erase_in_line`,e.SET_WINDOW_TITLE=`set_window_title`})(pa||={});var Y=class e{text;style;control;constructor(e,t,n){this.text=e,this.style=t,this.control=n}get cellLength(){return this.control?0:B(this.text)}get hasText(){return this.text.length>0}get isControl(){return this.control!==void 0}splitCells(t){if(t>=this.cellLength)return[this,new e(``)];if(t<=0)return[new e(``),this];let[n,r]=Vr(this.text,t);return[new e(n,this.style),new e(r,this.style)]}static _line;static line(){return e._line??=new e(`
27
+ `+t+`]`}return i.pop(),a=t,r}}})),Wn=ue(D(((e,t)=>{t.exports={parse:z(),stringify:Un()}}))(),1);const Gn=`trimPrefix "/" (trimPrefix .project_dir .current_dir)`,Kn=` {{ if and (ne .home "") (or (eq .home .current_dir) (hasPrefix (printf "%s/" .home) .current_dir)) }}~{{ trimPrefix .home .current_dir }}{{ else }}{{ if or (eq .project_dir .current_dir) (hasPrefix (printf "%s/" .project_dir) .current_dir) }}{{ ternary (${Gn}) (basename .project_dir) (ne (${Gn}) "") }}{{ else }}{{ .current_dir }}{{ end }}{{ end }} `;function qn(e,t){return`{{ if ge (round ${e}) ${t} }}error{{ else }}{{ if ge (round ${e}) 50 }}warning{{ else }}panel{{ end }}{{ end }}`}function Jn(e){return`{{ if ge (round ${e}) 50 }}button-color-foreground{{ else }}foreground{{ end }}`}function Yn(e,t,n){return`{{ if lt ${e} 0 }}panel{{ else }}{{ if lt ${e} ${n} }}error{{ else }}{{ if lt ${e} ${t} }}warning{{ else }}panel{{ end }}{{ end }}{{ end }}`}function Xn(e,t){return`{{ if lt ${e} 0 }}foreground{{ else }}{{ if lt ${e} ${t} }}button-color-foreground{{ else }}foreground{{ end }}{{ end }}`}const Zn={globals:{palette:`catppuccin-latte`},variables:{current_dir:{kind:`input`,path:`workspace.current_dir`,default:`?`},project_dir:{kind:`input`,path:`workspace.project_dir`,default:``},transcript_path:{kind:`input`,path:`transcript_path`,default:``},"model.display_name":{kind:`input`,path:`model.display_name`,default:``},"session.id":{kind:`input`,path:`session_id`,default:``},version:{kind:`input`,path:`version`,default:``},"term.cols":{kind:`input`,path:`term.cols`,type:`number`,default:80},"hue.step":{kind:`literal`,value:14},home:{kind:`input`,path:`home`,default:``},"tmux.session":{kind:`input`,path:`tmux.session`,default:``},"git.repoName":{kind:`input`,path:`git.repoName`,default:``},"git.branch":{kind:`input`,path:`git.branch`,default:``},"git.sha":{kind:`input`,path:`git.sha`,default:``},"git.ahead":{kind:`input`,path:`git.ahead`,type:`number`,default:0},"git.behind":{kind:`input`,path:`git.behind`,type:`number`,default:0},"git.staged":{kind:`input`,path:`git.staged`,type:`number`,default:0},"git.unstaged":{kind:`input`,path:`git.unstaged`,type:`number`,default:0},"git.untracked":{kind:`input`,path:`git.untracked`,type:`number`,default:0},"git.conflicts":{kind:`input`,path:`git.conflicts`,type:`number`,default:0},"git.upstream":{kind:`input`,path:`git.upstream`,default:``},"git.stash":{kind:`input`,path:`git.stash`,type:`number`,default:0},"git.status":{kind:`input`,path:`git.status`,default:`clean`},"git.operation":{kind:`input`,path:`git.operation`,default:``},"git.timeSinceCommit":{kind:`input`,path:`git.timeSinceCommit`,type:`number`,default:0},"git.prNumber":{kind:`input`,path:`git.prNumber`,type:`number`,default:0},"git.prState":{kind:`input`,path:`git.prState`,default:``},"git.prUrl":{kind:`input`,path:`git.prUrl`,default:``},"git.prError":{kind:`input`,path:`git.prError`,default:``},"cache.expiresAt":{kind:`input`,path:`cache.expiresAt`,type:`number`,default:0},"session.cost":{kind:`input`,path:`session.cost`,type:`number`,default:0},"session.tokens":{kind:`input`,path:`session.tokens`,type:`number`,default:0},"today.cost":{kind:`input`,path:`today.cost`,type:`number`,default:0},"today.tokens":{kind:`input`,path:`today.tokens`,type:`number`,default:0},"today.budget.amount":{kind:`literal`,value:50},"today.budget.warningThreshold":{kind:`literal`,value:80},"block.nativeUtilization":{kind:`input`,path:`block.nativeUtilization`,type:`number`,default:0},"block.resetsAt":{kind:`input`,path:`block.resetsAt`,type:`number`,default:0},"block.budget.warningThreshold":{kind:`literal`,value:80},"weekly.percentage":{kind:`input`,path:`weekly.percentage`,type:`number`,default:0},"weekly.resetsAt":{kind:`input`,path:`weekly.resetsAt`,type:`number`,default:0},"weekly.budget.warningThreshold":{kind:`literal`,value:80},"burn.costPerHour":{kind:`input`,path:`burn.costPerHour`,type:`number`,default:-1},"block.etaMinutes":{kind:`input`,path:`block.etaMinutes`,type:`number`,default:-1},"weekly.etaMinutes":{kind:`input`,path:`weekly.etaMinutes`,type:`number`,default:-1},"burn.eta.warnMinutes":{kind:`literal`,value:60},"burn.eta.errorMinutes":{kind:`literal`,value:30},"speed.input":{kind:`input`,path:`speed.input`,type:`number`,default:-1},"speed.output":{kind:`input`,path:`speed.output`,type:`number`,default:-1},"speed.total":{kind:`input`,path:`speed.total`,type:`number`,default:-1},"speed.history":{kind:`input`,path:`speed.history`,type:`string`,default:``},"context.totalTokens":{kind:`input`,path:`context.totalTokens`,type:`number`,default:0},"context.contextLeft":{kind:`input`,path:`context.contextLeft`,type:`number`,default:100},"metrics.lastResponseTime":{kind:`input`,path:`metrics.lastResponseTime`,type:`number`,default:0},"metrics.responseTime":{kind:`input`,path:`metrics.responseTime`,type:`number`,default:0},"metrics.sessionDuration":{kind:`input`,path:`metrics.sessionDuration`,type:`number`,default:0},"metrics.messageCount":{kind:`input`,path:`metrics.messageCount`,type:`number`,default:0},"metrics.linesAdded":{kind:`input`,path:`metrics.linesAdded`,type:`number`,default:0},"metrics.linesRemoved":{kind:`input`,path:`metrics.linesRemoved`,type:`number`,default:0},activeStyle:{kind:`state`,key:`style`,default:``},stylePage:{kind:`state`,key:`style-page`,default:`-1`}},segments:{directory:{template:Kn,bg:`surface`,fg:`foreground`},model:{template:` ✱ {{ formatModelName .model.display_name }} `,bg:`panel`,fg:`foreground`,when:`{{ ne .model.display_name "" }}`},sessionId:{template:` ⌗{{ trunc 8 .session.id }} `,bg:`surface`,fg:`foreground`,when:`{{ ne .session.id "" }}`},version:{template:` ◈ v{{ .version }} `,bg:`surface`,fg:`foreground`,when:`{{ ne .version "" }}`},tmux:{template:` tmux:{{ .tmux.session | default "none" }} `,bg:`surface-active`,fg:`foreground`,when:`{{ ne .tmux.session "" }}`},git:{template:` {{ if ne .git.repoName "" }}{{ .git.repoName }} {{ end }}⎇ {{ .git.branch }}{{ if .git.sha }} ♯ {{ .git.sha }}{{ end }}{{ if or (gt .git.ahead 0) (gt .git.behind 0) }} {{ if gt .git.ahead 0 }}↑{{ .git.ahead }}{{ end }}{{ if gt .git.behind 0 }}↓{{ .git.behind }}{{ end }}{{ end }}{{ if or (gt .git.staged 0) (gt .git.unstaged 0) (gt .git.untracked 0) (gt .git.conflicts 0) }} ({{ printf "%s%s%s%s" (ternary (printf " +%v" .git.staged) "" (gt .git.staged 0)) (ternary (printf " ~%v" .git.unstaged) "" (gt .git.unstaged 0)) (ternary (printf " ?%v" .git.untracked) "" (gt .git.untracked 0)) (ternary (printf " !%v" .git.conflicts) "" (gt .git.conflicts 0)) | trim }}){{ end }}{{ if .git.upstream }} →{{ .git.upstream }}{{ end }}{{ if gt .git.stash 0 }} ⧇ {{ .git.stash }}{{ end }} {{ if eq .git.status "conflicts" }}⚠{{ else }}{{ if eq .git.status "dirty" }}●{{ else }}✓{{ end }}{{ end }} `,bg:`surface-active`,fg:`foreground`,when:`{{ ne .git.branch "" }}`},gitaculous:{template:` (git){{ if ne .git.repoName "" }} {{ .git.repoName }}{{ end }}{{ if ne .git.operation "" }} [{{ .git.operation }}]{{ end }}{{ if ne .git.sha "" }} {{ .git.sha }}{{ end }}{{ if or (gt .git.staged 0) (gt .git.unstaged 0) (gt .git.untracked 0) (gt .git.conflicts 0) }} {{ if gt .git.staged 0 }}{{ green "S" }}{{ end }}{{ if or (gt .git.unstaged 0) (gt .git.untracked 0) }}{{ red "U" }}{{ end }}{{ if gt .git.conflicts 0 }}{{ red (printf "!%v" .git.conflicts) }}{{ end }}{{ end }} ⎇ {{ .git.branch }}{{ if ne .git.upstream "" }} [{{ .git.upstream }}{{ if or (gt .git.ahead 0) (gt .git.behind 0) }} {{ if gt .git.ahead 0 }}{{ green (printf "+%v" .git.ahead) }}{{ end }}{{ if and (gt .git.ahead 0) (gt .git.behind 0) }}/{{ end }}{{ if gt .git.behind 0 }}{{ red (printf "-%v" .git.behind) }}{{ end }}{{ end }}]{{ end }}{{ if gt .git.stash 0 }} ({{ .git.stash }} stashed){{ end }}{{ if gt .git.timeSinceCommit 0 }} ◷ {{ template "formatTimeSince" .git.timeSinceCommit }}{{ end }} `,bg:`surface-active`,fg:`foreground`,when:`{{ ne .git.branch "" }}`},gitPr:{template:`{{ if ne .git.prUrl "" }}{{ link .git.prUrl (printf " ⇆ #%v " .git.prNumber) }}{{ else }} ⚠ PR {{ end }}`,bg:`surface-active`,fg:`foreground`,when:`{{ or (ne .git.prUrl "") (ne .git.prError "") }}`},toolbar:{template:` {{ action "copySession" "⎘ id" }} {{ action "copyDir" "⎘ cwd" }} {{ action "openProject" "↗ proj" }} {{ action "openTranscript" "↗ log" }} `,bg:`surface`,fg:`foreground`},session:{template:` § {{ template "formatCost" .session.cost }} ({{ template "formatTokens" .session.tokens }}) `,bg:`surface`,fg:`foreground`},today:{template:` ☉ {{ template "formatCost" .today.cost }} ({{ template "formatTokens" .today.tokens }}){{ template "budgetStatus" (dict "cost" .today.cost "budget" .today.budget.amount "warn" .today.budget.warningThreshold) }} `,bg:`surface`,fg:`foreground`},block:{template:` ◱ {{ round .block.nativeUtilization }}% ({{ template "formatLongTimeRemaining" (minutesUntilReset .block.resetsAt) }}) `,bg:qn(`.block.nativeUtilization`,`.block.budget.warningThreshold`),fg:Jn(`.block.nativeUtilization`),when:`{{ gt .block.resetsAt 0 }}`},weekly:{template:` ◑ {{ round .weekly.percentage }}% ({{ template "formatLongTimeRemaining" (minutesUntilReset .weekly.resetsAt) }}) `,bg:qn(`.weekly.percentage`,`.weekly.budget.warningThreshold`),fg:Jn(`.weekly.percentage`),when:`{{ gt .weekly.resetsAt 0 }}`},burnrate:{template:` ⚡ {{ template "formatRate" .burn.costPerHour }} · {{ template "formatEta" .block.etaMinutes }} to 5h · {{ template "formatEta" .weekly.etaMinutes }} to wk `,bg:Yn(`.block.etaMinutes`,`.burn.eta.warnMinutes`,`.burn.eta.errorMinutes`),fg:Xn(`.block.etaMinutes`,`.burn.eta.warnMinutes`),when:`{{ or (gt .block.resetsAt 0) (gt .weekly.resetsAt 0) }}`},speed:{template:` ⇅ out {{ template "formatSpeed" .speed.output }} · in {{ template "formatSpeed" .speed.input }} · tot {{ template "formatSpeed" .speed.total }} `,bg:`panel`,fg:`foreground`,when:`{{ gt .session.tokens 0 }}`},tokenSparkline:{template:` ⚡ {{ sparkline .speed.history 24 }} `,bg:`panel`,fg:`foreground`,when:`{{ ne .speed.history "" }}`},cacheTimer:{template:` ◴ {{ if le (minutesUntilReset .cache.expiresAt) 0 }}cold{{ else }}{{ minutesUntilReset .cache.expiresAt }}m{{ end }} `,bg:`surface`,fg:`{{ if le (minutesUntilReset .cache.expiresAt) 8 }}error{{ else }}{{ if le (minutesUntilReset .cache.expiresAt) 20 }}warning{{ else }}foreground{{ end }}{{ end }}`,when:`{{ gt .cache.expiresAt 0 }}`},context:{template:` ◔ {{ formatInteger .context.totalTokens }} ({{ .context.contextLeft }}%) `,bg:`{{ if le .context.contextLeft 20 }}error{{ else }}{{ if le .context.contextLeft 40 }}warning{{ else }}surface-active{{ end }}{{ end }}`,fg:`{{ if le .context.contextLeft 40 }}button-color-foreground{{ else }}foreground{{ end }}`,when:`{{ gt .context.totalTokens 0 }}`},metrics:{template:`{{ if .metrics.lastResponseTime }} Δ {{ template "formatResponseTime" .metrics.lastResponseTime }}{{ end }}{{ if .metrics.responseTime }} ⧖ {{ template "formatResponseTime" .metrics.responseTime }}{{ end }}{{ if .metrics.sessionDuration }} ⧗ {{ template "formatDuration" .metrics.sessionDuration }}{{ end }}{{ if .metrics.messageCount }} ◆ {{ .metrics.messageCount }}{{ end }}{{ if .metrics.linesAdded }} + {{ .metrics.linesAdded }}{{ end }}{{ if .metrics.linesRemoved }} - {{ .metrics.linesRemoved }}{{ end }} `,bg:`panel`,fg:`foreground`,when:`{{ or .metrics.lastResponseTime .metrics.responseTime .metrics.sessionDuration .metrics.messageCount .metrics.linesAdded .metrics.linesRemoved }}`},styleControl:{template:`✦ {{ if .activeStyle }}{{ .activeStyle }}{{ else }}(default){{ end }} {{ action "openStyleMenu" "▸" }}`,bg:`surface`,fg:`foreground`},stylePicker:{template:`{{ picker "applyStyle" "stylePage" }}`,bg:`surface`,fg:`foreground`}},root:{kind:`container`,direction:`vertical`,children:[{kind:`container`,direction:`horizontal`,children:[{kind:`segment`,name:`directory`},{kind:`segment`,name:`git`},{kind:`segment`,name:`model`},{kind:`segment`,name:`session`},{kind:`segment`,name:`today`},{kind:`segment`,name:`context`},{kind:`segment`,name:`toolbar`},{kind:`segment`,name:`styleControl`}]},{kind:`segment`,name:`stylePicker`,when:`{{ ge (int .stylePage) 0 }}`}]},actions:{copySession:{copy:`{{ .session.id }}`},copyDir:{copy:`{{ .current_dir }}`},openProject:{open:`{{ .project_dir }}`},openTranscript:{open:`{{ .transcript_path }}`},openStyleMenu:{set:`style-page`,to:`0`},applyStyle:{set:`style`,from:`styles`},stylePage:{set:`style-page`,int:!0}},helpers:{formatCost:'{{ if lt . 0.01 }}<$0.01{{ else }}${{ printf "%.2f" . }}{{ end }}',formatTokenCount:`{{ if ge . 1000000 }}{{ printf "%.1f" (divf . 1000000) }}M{{ else if ge . 1000 }}{{ printf "%.1f" (divf . 1000) }}K{{ else }}{{ . }}{{ end }}`,formatTokens:`{{ template "formatTokenCount" . }} tokens`,formatRate:`{{ if lt . 0 }}—/hr{{ else }}{{ template "formatCost" . }}/hr{{ end }}`,formatEta:`{{ if lt . 0 }}—{{ else }}{{ template "formatLongTimeRemaining" . }}{{ end }}`,formatSpeed:`{{ if lt . 0 }}—{{ else }}{{ template "formatTokenCount" (round .) }}/s{{ end }}`,formatTokenBreakdown:`{{ $first := true }}{{ if gt .input 0 }}{{ template "formatTokenCount" .input }} in{{ $first = false }}{{ end }}{{ if gt .output 0 }}{{ if not $first }} + {{ end }}{{ template "formatTokenCount" .output }} out{{ $first = false }}{{ end }}{{ if or (gt .cacheCreation 0) (gt .cacheRead 0) }}{{ if not $first }} + {{ end }}{{ template "formatTokenCount" (add .cacheCreation .cacheRead) }} cached{{ $first = false }}{{ end }}{{ if $first }}0 tokens{{ end }}`,budgetStatus:`{{ if or (le .budget 0) (lt .cost 0) }}{{ else }}{{ $pct := minf 100 (mulf (divf .cost .budget) 100) }}{{ $p := printf "%.0f%%" $pct }}{{ if ge $pct .warn }} !{{ $p }}{{ else }}{{ if ge $pct 50 }} +{{ $p }}{{ else }} {{ $p }}{{ end }}{{ end }}{{ end }}`,formatTimeSince:`{{ if lt . 60 }}{{ . }}s{{ else if lt . 3600 }}{{ div . 60 }}m{{ else if lt . 86400 }}{{ div . 3600 }}h{{ else if lt . 604800 }}{{ div . 86400 }}d{{ else }}{{ div . 604800 }}w{{ end }}`,formatDuration:`{{ if lt . 60 }}{{ printf "%.0f" . }}s{{ else if lt . 3600 }}{{ printf "%.0f" (divf . 60) }}m{{ else if lt . 86400 }}{{ printf "%.1f" (divf . 3600) }}h{{ else }}{{ printf "%.1f" (divf . 86400) }}d{{ end }}`,formatResponseTime:`{{ if lt . 60 }}{{ printf "%.1f" . }}s{{ else }}{{ printf "%.1f" (divf . 60) }}m{{ end }}`,formatLongTimeRemaining:`{{ if ge . 1440 }}{{ $d := div . 1440 }}{{ $h := div (mod . 1440) 60 }}{{ if gt $h 0 }}{{ $d }}d {{ $h }}h{{ else }}{{ $d }}d{{ end }}{{ else if ge . 60 }}{{ $h := div . 60 }}{{ $m := mod . 60 }}{{ if gt $m 0 }}{{ $h }}h {{ $m }}m{{ else }}{{ $h }}h{{ end }}{{ else }}{{ . }}m{{ end }}`}};function Qn({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const $n=Qn();function er(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(`›`)?e:e.replace($n,``)}const tr=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],nr=[12288,12288,65281,65376,65504,65510],rr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],ir=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],ar=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],or=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},sr=tr[0],cr=tr.at(-1),lr=nr[0],ur=nr.at(-1);rr[0],rr.at(-1),ir[0],ir.at(-1);const dr=ar[0],fr=ar.at(-1),pr=19968,[mr,hr]=gr(ar);function gr(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(pr>=i&&pr<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}const _r=e=>e<sr||e>cr?!1:or(tr,e),vr=e=>e<lr||e>ur?!1:or(nr,e),yr=e=>e>=mr&&e<=hr?!0:e<dr||e>fr?!1:or(ar,e);function br(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function xr(e,{ambiguousAsWide:t=!1}={}){return br(e),vr(e)||yr(e)||t&&_r(e)?2:1}const Sr=new Intl.Segmenter,Cr=RegExp(`^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Format}|\\p{Mark}|\\p{Surrogate})+$`,`v`),wr=RegExp(`^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+`,`v`),Tr=RegExp(`^\\p{RGI_Emoji}$`,`v`),Er=/^[\d#*]\u20E3$/,Dr=/\p{Extended_Pictographic}/gu;function Or(e){if(e.length>50)return!1;if(Er.test(e))return!0;if(e.includes(`‍`)){let t=e.match(Dr);return t!==null&&t.length>=2}return!1}function kr(e){return e.replace(wr,``)}function Ar(e){return Cr.test(e)}function jr(e){return e>=4352&&e<=4447||e>=43360&&e<=43388}function Mr(e){return e>=4448&&e<=4519||e>=55216&&e<=55238}function Nr(e){return e>=4520&&e<=4607||e>=55243&&e<=55291}function Pr(e){return jr(e)||Mr(e)||Nr(e)}function Fr(e,t){let n=[];for(let t of e)Cr.test(t)||n.push(t.codePointAt(0));if(n.length===0)return;let r=0;for(let e=0;e<n.length;e++){let i=n[e];if(!Pr(i)){if(r===0)return;for(let i=e;i<n.length;i++)r+=xr(n[i],t);return r}if(jr(i)&&Mr(n[e+1])){r+=2,e+=Nr(n[e+2])?2:1;continue}r+=xr(i,t)}return r}function Ir(e,t){let n=0,r=!0;for(let i of e){if(r){r=!1;continue}i>=`＀`&&i<=`￯`&&(n+=xr(i.codePointAt(0),t))}return n}function Lr(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t,i=e;if(!r&&(i.includes(`\x1B`)||i.includes(`›`))&&(i=er(i)),i.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(i))return i.length;let a=0,o={ambiguousAsWide:!n};for(let{segment:e}of Sr.segment(i)){if(Ar(e))continue;if(Tr.test(e)||Or(e)){a+=2;continue}let t=kr(e),n=Fr(t,o);if(n!==void 0){a+=n;continue}let r=t.codePointAt(0);a+=xr(r,o),a+=Ir(t,o)}return a}const Rr=new Map;function B(e){if(e.length===0)return 0;if(e.length<=64){let t=Rr.get(e);if(t!==void 0)return t}let t=Lr(e);return e.length<=64&&(Rr.size>=4096&&Rr.clear(),Rr.set(e,t)),t}function V(e){return e}function zr(e){return e}function Br(e,t){if(t===0)return``;let n=B(e);return n===t?e:n<t?e+` `.repeat(t-n):Gr(e,t)}function Vr(e,t){if(t<=0)return[``,e];if(t>=B(e))return[e,``];let n=0,r=0;for(let i of e){let e=B(i);if(n+e>t)break;n+=e,r+=i.length}let i=e.slice(0,r),a=e.slice(r);return n<t?[i+` `.repeat(t-n),a]:[i,a]}function Hr(e,t){let n=0,r=0;for(let i of e){if(n>=t)break;let e=B(i);if(n+e>t)break;n+=e,r+=i.length}return zr(r)}function Ur(e,t){return t>=e.length?zr(e.length):zr(t+(e.codePointAt(t)>65535?2:1))}function Wr(e,t){if(t<=0)return zr(0);let n=e.charCodeAt(t-1);if(n>=56320&&n<=57343&&t>=2){let n=e.charCodeAt(t-2);if(n>=55296&&n<=56319)return zr(t-2)}return zr(t-1)}function Gr(e,t){let n=0,r=0;for(let i of e){let e=B(i);if(n+e>t)break;n+=e,r+=i.length}let i=e.slice(0,r),a=t-n;return a>0?i+` `.repeat(a):i}var Kr=class{name;dark;vars;constructor(e,t,n){this.name=e,this.dark=t,this.vars=new Map(n)}get(e){return this.vars.get(e)}};function qr(e){return e.toString(16).padStart(2,`0`)}function Jr(e,t){if(!Number.isInteger(t)||t<0||t>255)throw RangeError(`ColorRgba.${e} must be an integer in [0, 255]; got ${t}`)}var H=class e{red;green;blue;alpha;constructor(e,t,n,r=1){if(this.red=e,this.green=t,this.blue=n,this.alpha=r,Jr(`red`,e),Jr(`green`,t),Jr(`blue`,n),!Number.isFinite(r)||r<0||r>1)throw RangeError(`ColorRgba.alpha must be a finite number in [0, 1]; got ${r}`)}get hex(){let e=`#`+qr(this.red)+qr(this.green)+qr(this.blue);return this.alpha===1?e:e+qr(Math.round(this.alpha*255))}get rgb(){return this.alpha===1?`rgb(${this.red},${this.green},${this.blue})`:`rgba(${this.red},${this.green},${this.blue},${this.alpha})`}get normalized(){return[this.red/255,this.green/255,this.blue/255,this.alpha]}compositeOver(t){if(this.alpha===1)return this;let n=this.alpha;return new e(Math.round(t.red+(this.red-t.red)*n),Math.round(t.green+(this.green-t.green)*n),Math.round(t.blue+(this.blue-t.blue)*n),1)}},Yr=class{colors;matchCache=new Map;constructor(e){this.colors=e}get(e){return this.colors[e]}get size(){return this.colors.length}match(e){let t=`${e.red},${e.green},${e.blue},${e.alpha}`,n=this.matchCache.get(t);if(n!==void 0)return n;let r=0,i=1/0;for(let t=0;t<this.colors.length;t++){let n=this.colors[t],a=n.red-e.red,o=n.green-e.green,s=n.blue-e.blue,c=a*a+o*o+s*s;c<i&&(i=c,r=t)}return this.matchCache.set(t,r),r}},U;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.STANDARD=1]=`STANDARD`,e[e.EIGHT_BIT=2]=`EIGHT_BIT`,e[e.TRUECOLOR=3]=`TRUECOLOR`,e[e.WINDOWS=4]=`WINDOWS`})(U||={});const Xr={truecolor:U.TRUECOLOR,256:U.EIGHT_BIT,ansi:U.STANDARD,none:null,0:null,false:null,1:U.STANDARD,true:U.STANDARD,2:U.EIGHT_BIT,3:U.TRUECOLOR,"iTerm.app":U.TRUECOLOR,Apple_Terminal:U.EIGHT_BIT,vscode:U.TRUECOLOR,Tabby:U.TRUECOLOR,"xterm-kitty":U.TRUECOLOR,"xterm-ghostty":U.TRUECOLOR,wezterm:U.TRUECOLOR,alacritty:U.TRUECOLOR,foot:U.TRUECOLOR,contour:U.TRUECOLOR};function Zr(e={}){let t=e.env??(typeof process<`u`?process.env:{}),n=e.isTTY??(typeof process<`u`?process.stdout?.isTTY??!1:!1),r=t.NO_COLOR;if(r!==void 0&&r!==``)return null;let i=t.FORCE_COLOR;if(i!==void 0&&i!==``){let e=Xr[i];return e===void 0?U.STANDARD:e}if(!n)return null;let a=t.TERM??``;if(a===`dumb`||a===`unknown`)return null;let o=t.COLORTERM;if(o===`truecolor`||o===`24bit`)return U.TRUECOLOR;let s=Xr[a];if(s!==void 0)return s;let c=t.TERM_PROGRAM;if(c!==void 0){let e=Xr[c];if(e!==void 0)return e}return/-256(color)?$/i.test(a)?U.EIGHT_BIT:/-truecolor$/i.test(a)?U.TRUECOLOR:(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a),U.STANDARD)}function Qr(e,t){if(e===`auto`)return Zr(t);if(Object.hasOwn(Xr,e))return Xr[e];throw new $r(`Unknown color depth spec: ${JSON.stringify(e)} (expected "auto", "truecolor", "256", "ansi", or "none")`)}var $r=class extends Error{constructor(e){super(e),this.name=`ColorParseError`}};const ei=new Map;var W=class e{name;type;number;value;downgradeCache=new Map;constructor(e,t,n,r){this.name=e,this.type=t,this.number=n,this.value=r}get isDefault(){return this.type===U.DEFAULT}get isSystemDefined(){return this.type===U.STANDARD||this.type===U.WINDOWS}getAnsiCodes(e=!0){switch(this.type){case U.DEFAULT:return[e?`39`:`49`];case U.STANDARD:{let t=this.number;return e?t<8?[`${30+t}`]:[`${90+t-8}`]:t<8?[`${40+t}`]:[`${100+t-8}`]}case U.EIGHT_BIT:return[e?`38`:`48`,`5`,`${this.number}`];case U.TRUECOLOR:{let t=this.value;return[e?`38`:`48`,`2`,`${t.red}`,`${t.green}`,`${t.blue}`]}case U.WINDOWS:{let t=this.number;return e?t<8?[`${30+t}`]:[`${90+t-8}`]:t<8?[`${40+t}`]:[`${100+t-8}`]}}}flattenAlpha(t){if(this.type!==U.TRUECOLOR||!this.value)return this;let n=this.value.compositeOver(t);return n===this.value?this:e.fromRgba(n)}downgrade(e){if(this.type===U.DEFAULT||this.type<=e)return this;let t=this.downgradeCache.get(e);if(t)return t;let n=this.performDowngrade(e);return this.downgradeCache.set(e,n),n}getTruecolor(e,t=!0){switch(this.type){case U.TRUECOLOR:return this.value;case U.EIGHT_BIT:return mi.get(this.number);case U.STANDARD:return(e??hi).ansiColors.get(this.number);case U.DEFAULT:{let n=e??hi;return t?n.foregroundColor:n.backgroundColor}case U.WINDOWS:return(e??hi).ansiColors.get(this.number)}}static default(){return new e(`default`,U.DEFAULT)}static fromAnsi(t){let n=t<16?U.STANDARD:U.EIGHT_BIT;return new e(`color(${t})`,n,t)}static fromRgba(t){return new e(t.hex,U.TRUECOLOR,void 0,t)}static fromRgb(t,n,r){return e.fromRgba(new H(t,n,r))}static parse(e){let t=e.toLowerCase().trim(),n=ei.get(t);if(n)return n;let r=ai(t);return ei.set(t,r),r}performDowngrade(t){let n=this.getTruecolor();switch(t){case U.EIGHT_BIT:{let t=mi.match(n);return e.fromAnsi(t)}case U.STANDARD:{let t=pi.match(n);return new e(`color(${t})`,U.STANDARD,t)}case U.WINDOWS:case U.TRUECOLOR:return this;case U.DEFAULT:return e.default()}}};const ti=/^#([0-9a-f]{6})$/,ni=/^#([0-9a-f]{8})$/,ri=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,ii=/^color\((\d{1,3})\)$/;function ai(e){if(e===`default`||e===``)return W.default();let t=gi[e];if(t!==void 0)return new W(e,t<16?U.STANDARD:U.EIGHT_BIT,t);let n=ni.exec(e);if(n)return new W(e,U.TRUECOLOR,void 0,si(n[1]));let r=ti.exec(e);if(r)return new W(e,U.TRUECOLOR,void 0,oi(r[1]));let i=ri.exec(e);if(i){let t=parseInt(i[1],10),n=parseInt(i[2],10),r=parseInt(i[3],10);return new W(e,U.TRUECOLOR,void 0,new H(t,n,r))}let a=ii.exec(e);if(a){let t=parseInt(a[1],10);if(t>255)throw new $r(`ColorSpec number ${t} is out of range (0-255)`);return new W(e,t<16?U.STANDARD:U.EIGHT_BIT,t)}throw new $r(`Failed to parse color: "${e}"`)}function oi(e){return new H(parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16))}function si(e){return new H(parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16),parseInt(e.slice(6,8),16)/255)}function ci(e,t,n=.5){return new H(Math.round(e.red+(t.red-e.red)*n),Math.round(e.green+(t.green-e.green)*n),Math.round(e.blue+(t.blue-e.blue)*n),e.alpha+(t.alpha-e.alpha)*n)}var li=class{backgroundColor;foregroundColor;ansiColors;palette;constructor(e,t,n,r){this.backgroundColor=e,this.foregroundColor=t,this.ansiColors=n,this.palette=r}};function ui(){return[new H(0,0,0),new H(128,0,0),new H(0,128,0),new H(128,128,0),new H(0,0,128),new H(128,0,128),new H(0,128,128),new H(192,192,192),new H(128,128,128),new H(255,0,0),new H(0,255,0),new H(255,255,0),new H(0,0,255),new H(255,0,255),new H(0,255,255),new H(255,255,255)]}function di(){let e=ui(),t=[0,95,135,175,215,255];for(let n=0;n<6;n++)for(let r=0;r<6;r++)for(let i=0;i<6;i++)e.push(new H(t[n],t[r],t[i]));for(let t=0;t<24;t++){let n=8+10*t;e.push(new H(n,n,n))}return e}function fi(){return[new H(0,0,0),new H(0,0,128),new H(0,128,0),new H(0,128,128),new H(128,0,0),new H(128,0,128),new H(128,128,0),new H(192,192,192),new H(128,128,128),new H(0,0,255),new H(0,255,0),new H(0,255,255),new H(255,0,0),new H(255,0,255),new H(255,255,0),new H(255,255,255)]}const pi=new Yr(ui()),mi=new Yr(di());new Yr(fi());const hi=new li(new H(0,0,0),new H(255,255,255),pi,new Kr(`default`,!0,new Map)),gi={black:0,red:1,green:2,yellow:3,blue:4,magenta:5,cyan:6,white:7,bright_black:8,bright_red:9,bright_green:10,bright_yellow:11,bright_blue:12,bright_magenta:13,bright_cyan:14,bright_white:15,grey0:16,navy_blue:17,dark_blue:18,blue3:19,blue2:20,blue1:21,dark_green:22,deep_sky_blue4:23,deep_sky_blue5:24,deep_sky_blue6:25,dodger_blue3:26,dodger_blue2:27,green4:28,spring_green4:29,turquoise4:30,deep_sky_blue3:31,deep_sky_blue7:32,dodger_blue1:33,green3:34,spring_green3:35,dark_cyan:36,light_sea_green:37,deep_sky_blue2:38,deep_sky_blue1:39,green5:40,spring_green5:41,spring_green2:42,cyan3:43,dark_turquoise:44,turquoise2:45,green1:46,spring_green6:47,spring_green1:48,medium_spring_green:49,cyan2:50,cyan1:51,dark_red:52,deep_pink4:53,purple4:54,purple5:55,purple3:56,blue_violet:57,orange4:58,grey37:59,medium_purple4:60,slate_blue3:61,slate_blue4:62,royal_blue1:63,chartreuse4:64,dark_sea_green4:65,pale_turquoise4:66,steel_blue:67,steel_blue3:68,cornflower_blue:69,chartreuse3:70,dark_sea_green5:71,cadet_blue:72,cadet_blue2:73,sky_blue3:74,steel_blue1:75,chartreuse5:76,pale_green3:77,sea_green3:78,aquamarine3:79,medium_turquoise:80,steel_blue2:81,chartreuse2:82,sea_green2:83,sea_green1:84,sea_green4:85,aquamarine1:86,dark_slate_gray2:87,dark_red2:88,deep_pink5:89,dark_magenta:90,dark_magenta2:91,dark_violet:92,purple2:93,orange5:94,light_pink4:95,plum4:96,medium_purple3:97,medium_purple5:98,slate_blue1:99,yellow4:100,wheat4:101,grey53:102,light_slate_grey:103,medium_purple:104,light_slate_blue:105,yellow5:106,dark_olive_green3:107,dark_sea_green:108,light_sky_blue3:109,light_sky_blue4:110,sky_blue2:111,chartreuse6:112,dark_olive_green4:113,pale_green4:114,dark_sea_green3:115,dark_slate_gray3:116,sky_blue1:117,chartreuse1:118,light_green:119,light_green2:120,pale_green1:121,aquamarine2:122,dark_slate_gray1:123,red3:124,deep_pink6:125,medium_violet_red:126,magenta3:127,dark_violet2:128,purple:129,dark_orange3:130,indian_red:131,hot_pink3:132,medium_orchid3:133,medium_orchid:134,medium_purple2:135,dark_goldenrod:136,light_salmon3:137,rosy_brown:138,grey63:139,medium_purple6:140,medium_purple1:141,gold3:142,dark_khaki:143,navajo_white3:144,grey69:145,light_steel_blue3:146,light_steel_blue:147,yellow3:148,dark_olive_green5:149,dark_sea_green6:150,dark_sea_green2:151,light_cyan3:152,light_sky_blue1:153,green_yellow:154,dark_olive_green2:155,pale_green2:156,dark_sea_green7:157,dark_sea_green1:158,pale_turquoise1:159,red4:160,deep_pink3:161,deep_pink8:162,magenta4:163,magenta5:164,magenta2:165,dark_orange4:166,indian_red2:167,hot_pink4:168,hot_pink2:169,orchid:170,medium_orchid1:171,orange3:172,light_salmon4:173,light_pink3:174,pink3:175,plum3:176,violet:177,gold4:178,light_goldenrod3:179,tan:180,misty_rose3:181,thistle3:182,plum2:183,yellow6:184,khaki3:185,light_goldenrod2:186,light_yellow3:187,grey84:188,light_steel_blue1:189,yellow2:190,dark_olive_green1:191,dark_olive_green6:192,dark_sea_green8:193,honeydew2:194,light_cyan1:195,red1:196,deep_pink2:197,deep_pink1:198,deep_pink9:199,magenta6:200,magenta1:201,orange_red1:202,indian_red1:203,indian_red3:204,hot_pink5:205,hot_pink:206,medium_orchid2:207,dark_orange:208,salmon1:209,light_coral:210,pale_violet_red1:211,orchid2:212,orchid1:213,orange1:214,sandy_brown:215,light_salmon1:216,light_pink1:217,pink1:218,plum1:219,gold1:220,light_goldenrod4:221,light_goldenrod5:222,navajo_white1:223,misty_rose1:224,thistle1:225,yellow1:226,light_goldenrod1:227,khaki1:228,wheat1:229,cornsilk1:230,grey100:231,grey3:232,grey7:233,grey11:234,grey15:235,grey19:236,grey23:237,grey27:238,grey30:239,grey35:240,grey39:241,grey42:242,grey46:243,grey50:244,grey54:245,grey58:246,grey62:247,grey66:248,grey70:249,grey74:250,grey78:251,grey82:252,grey85:253,grey89:254,grey93:255};for(let[e,t]of Object.entries(gi))e.includes(`grey`)&&(gi[e.replace(`grey`,`gray`)]=t);Object.freeze({hueShift:0,chromaScale:1,lightnessScale:1,lightnessShift:0}),Object.freeze({hueShift:0,chromaScale:1,lightnessScale:-1,lightnessShift:1});function _i(e){return e.hueShift%360==0&&e.chromaScale===1&&e.lightnessScale===1&&e.lightnessShift===0}function vi(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function yi(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function bi(e){return e<0?0:e>1?1:e}const xi=1e-4,Si=1e-7;function Ci(e,t,n){return e>=-xi&&e<=1+xi&&t>=-xi&&t<=1+xi&&n>=-xi&&n<=1+xi}var wi=class e{l;c;h;alpha;constructor(e,t,n,r=1){if(this.l=e,this.c=t,this.h=n,this.alpha=r,!Number.isFinite(e))throw RangeError(`Oklch.l must be finite; got ${e}`);if(!Number.isFinite(t))throw RangeError(`Oklch.c must be finite; got ${t}`);if(!Number.isFinite(n))throw RangeError(`Oklch.h must be finite; got ${n}`);if(!Number.isFinite(r)||r<0||r>1)throw RangeError(`Oklch.alpha must be a finite number in [0,1]; got ${r}`)}static fromRgba(t){let[n,r,i,a]=t.normalized,o=vi(n),s=vi(r),c=vi(i),l=.4122214708*o+.5363325363*s+.0514459929*c,u=.2119034982*o+.6806995451*s+.1073969566*c,d=.0883024619*o+.2817188376*s+.6299787005*c,f=Math.cbrt(l),p=Math.cbrt(u),m=Math.cbrt(d),h=.2104542553*f+.793617785*p-.0040720468*m,g=1.9779984951*f-2.428592205*p+.4505937099*m,_=.0259040371*f+.7827717662*p-.808675766*m,v=Math.sqrt(g*g+_*_),y=180/Math.PI*Math.atan2(_,g);return y<0&&(y+=360),v<Si&&(y=0),new e(h,v,y,a)}toRgba(){let e=bi(this.l),t=Math.max(0,this.c),n=this.findInGamutChroma(e,t,this.h),{r,g:i,b:a}=this.toLinearRgb(e,n,this.h);return new H(Math.round(bi(yi(r))*255),Math.round(bi(yi(i))*255),Math.round(bi(yi(a))*255),this.alpha)}applyKey(t){if(_i(t))return this;let n=bi(this.l*t.lightnessScale+t.lightnessShift),r=Math.max(0,this.c*t.chromaScale),i=(this.h+t.hueShift)%360;return i<0&&(i+=360),r<Si&&(i=0),new e(n,r,i,this.alpha)}toLinearRgb(e,t,n){let r=Math.PI/180*n,i=t*Math.cos(r),a=t*Math.sin(r),o=e+.3963377774*i+.2158037573*a,s=e-.1055613458*i-.0638541728*a,c=e-.0894841775*i-1.291485548*a,l=o*o*o,u=s*s*s,d=c*c*c;return{r:4.0767416621*l-3.3077115913*u+.2309699292*d,g:-1.2684380046*l+2.6097574011*u-.3413193965*d,b:-.0041960863*l-.7034186147*u+1.707614701*d}}findInGamutChroma(e,t,n){let r=this.toLinearRgb(e,t,n);if(Ci(r.r,r.g,r.b))return t;let i=0,a=t;for(let t=0;t<24;t++){let t=(i+a)/2,r=this.toLinearRgb(e,t,n);Ci(r.r,r.g,r.b)?i=t:a=t}return i}};function Ti(e){let t=e.red/255,n=e.green/255,r=e.blue/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2,s=i-a;if(s===0)return{h:0,s:0,l:o};let c=s/(o>.5?2-i-a:i+a),l;return l=i===t?(n-r)/s%6:i===n?(r-t)/s+2:(t-n)/s+4,l=(l*60+360)%360,{h:l,s:c,l:o}}function Ei(e){let t=Math.round(e);return t<0?0:t>255?255:t}function Di(e){let{h:t,s:n,l:r}=e;if(n===0){let e=Ei(r*255);return new H(e,e,e)}let i=(1-Math.abs(2*r-1))*n,a=t/60,o=i*(1-Math.abs(a%2-1)),s=0,c=0,l=0;a<1?[s,c,l]=[i,o,0]:a<2?[s,c,l]=[o,i,0]:a<3?[s,c,l]=[0,i,o]:a<4?[s,c,l]=[0,o,i]:a<5?[s,c,l]=[o,0,i]:[s,c,l]=[i,0,o];let u=r-i/2;return new H(Ei((s+u)*255),Ei((c+u)*255),Ei((l+u)*255))}function Oi(e){return e<0?0:e>1?1:e}function ki(e,t){let n=Ti(e);return n.l=Oi(n.l-.1*t),Di(n)}function G(e,t,n){return ci(t,e,Oi(n))}function Ai(e){return ji(e)>.179?new H(0,0,0):new H(255,255,255)}function ji(e){let t=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(e.red)+.7152*t(e.green)+.0722*t(e.blue)}const Mi=/^(.+)-(darken|lighten)-(\d+)$/,Ni=/^(\d+(?:\.\d+)?)%$/;function Pi(e){let t=e.trim();if(t===``)return null;let[n,r,...i]=t.split(/\s+/);if(n===void 0||i.length>0)return null;let a=null;if(r!==void 0){let e=Ni.exec(r);if(e===null)return null;let t=parseFloat(e[1]);if(t<0||t>100)return null;a=t/100}let o=Mi.exec(n);if(o!==null){let e=parseInt(o[3],10);return{name:o[1],darkenLevels:o[2]===`darken`?e:-e,alpha:a}}return{name:n,darkenLevels:0,alpha:a}}var Fi=class{palette;constructor(e){this.palette=e}resolve(e,t){let n=Pi(e);if(n===null)return null;let r=this.lookupBase(n.name,t);if(r===null)return null;let i=ki(r,n.darkenLevels);return n.alpha===null?i:t?.against?G(i,t.against,n.alpha):null}lookupBase(e,t){return e===`auto`?t?.against?Ai(t.against):null:this.palette.get(e)??null}};const Ii=[`primary`,`secondary`,`accent`,`success`,`warning`,`error`];function Li(e,t,n){let r=new Map;r.set(`background`,n.background),r.set(`foreground`,n.foreground);for(let e of Ii)r.set(e,n[e]);r.set(`surface`,ci(n.background,n.foreground,.05));let i=Ai(n.background);for(let e of Ii){let t=n[e];r.set(`${e}-muted`,ci(t,n.background,.7)),r.set(`text-${e}`,G(t,i,.66)),r.set(`on-${e}`,Ai(t))}return new Kr(e,t,r)}const Ri={"atom-one-dark":{name:`atom-one-dark`,dark:!0,vars:{accent:`#A378C2`,"accent-darken-1":`#8E65AD`,"accent-darken-2":`#7A5299`,"accent-darken-3":`#674085`,"accent-lighten-1":`#B78BD6`,"accent-lighten-2":`#CC9FEC`,"accent-lighten-3":`#E2B3FF`,"accent-muted":`#4C425E`,background:`#282C34`,"background-darken-1":`#181C23`,"background-darken-2":`#050A14`,"background-darken-3":`#000000`,"background-lighten-1":`#383C44`,"background-lighten-2":`#494D56`,"background-lighten-3":`#5B5F68`,"block-cursor-background":`#61AFEF`,"block-cursor-blurred-background":`#61AFEF4C`,"block-cursor-blurred-foreground":`#ABB2BF`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#61AFEF`,"border-blurred":`#353B47`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#ABB2BF`,error:`#EF6262`,"error-darken-1":`#D84D50`,"error-darken-2":`#C1373E`,"error-darken-3":`#AA1F2E`,"error-lighten-1":`#FF7674`,"error-lighten-2":`#FF8B87`,"error-lighten-3":`#FFA09B`,"error-muted":`#643C41`,"footer-background":`#4F5666`,"footer-description-background":`#00000000`,"footer-description-foreground":`#ABB2BF`,"footer-foreground":`#ABB2BF`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#A378C2`,foreground:`#ABB2BF`,"foreground-darken-1":`#979DAA`,"foreground-darken-2":`#838A96`,"foreground-darken-3":`#707783`,"foreground-disabled":`#ABB2BF60`,"foreground-lighten-1":`#BFC6D3`,"foreground-lighten-2":`#D4DBE8`,"foreground-lighten-3":`#E9F0FE`,"foreground-muted":`#ABB2BF99`,"input-cursor-background":`#ABB2BF`,"input-cursor-foreground":`#282C34`,"input-selection-background":`#77C3FF66`,"link-background":`#00000000`,"link-background-hover":`#61AFEF`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#61AFEF`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#61AFEF`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#61AFEF`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#ABB2BF`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#ABB2BF`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#ABB2BF99`,panel:`#4F5666`,"panel-darken-1":`#3D4453`,"panel-darken-2":`#2C3342`,"panel-darken-3":`#1C2331`,"panel-lighten-1":`#616878`,"panel-lighten-2":`#737A8B`,"panel-lighten-3":`#868E9F`,primary:`#61AFEF`,"primary-background":`#4F5B6A`,"primary-background-darken-1":`#3F4D5D`,"primary-background-darken-2":`#303F50`,"primary-background-darken-3":`#303F50`,"primary-background-lighten-1":`#5E6A77`,"primary-background-lighten-2":`#6E7884`,"primary-background-lighten-3":`#7D8791`,"primary-darken-1":`#489BD9`,"primary-darken-2":`#2C87C4`,"primary-darken-3":`#0074AF`,"primary-lighten-1":`#77C3FF`,"primary-lighten-2":`#8ED8FF`,"primary-lighten-3":`#A4EDFF`,"primary-muted":`#39536C`,scrollbar:`#355674`,"scrollbar-active":`#61AFEF`,"scrollbar-background":`#181C23`,"scrollbar-background-active":`#181C23`,"scrollbar-background-hover":`#181C23`,"scrollbar-corner-color":`#181C23`,"scrollbar-hover":`#3C6589`,secondary:`#C678DD`,"secondary-background":`#5B5567`,"secondary-background-darken-1":`#4D465A`,"secondary-background-darken-2":`#3F374D`,"secondary-background-darken-3":`#3F374D`,"secondary-background-lighten-1":`#6A6475`,"secondary-background-lighten-2":`#787382`,"secondary-background-lighten-3":`#87828F`,"secondary-darken-1":`#B064C7`,"secondary-darken-2":`#9B50B3`,"secondary-darken-3":`#873D9E`,"secondary-lighten-1":`#DB8CF2`,"secondary-lighten-2":`#F1A0FF`,"secondary-lighten-3":`#FFB5FF`,"secondary-muted":`#574266`,success:`#62F062`,"success-darken-1":`#48DA4D`,"success-darken-2":`#29C438`,"success-darken-3":`#00AF22`,"success-lighten-1":`#7AFF76`,"success-lighten-2":`#91FF8A`,"success-lighten-3":`#A8FF9F`,"success-muted":`#396641`,surface:`#3B414D`,"surface-active":`#484E5B`,"surface-darken-1":`#2A303B`,"surface-darken-2":`#1A202B`,"surface-darken-3":`#09101B`,"surface-lighten-1":`#4C525E`,"surface-lighten-2":`#5E6471`,"surface-lighten-3":`#707684`,text:`#FFFFFFDD`,"text-accent":`#C2A5D6`,"text-disabled":`#FFFFFF60`,"text-error":`#F59797`,"text-muted":`#FFFFFF99`,"text-primary":`#96CAF4`,"text-secondary":`#D9A5E8`,"text-success":`#97F597`,"text-warning":`#E9CC92`,warning:`#DDB25B`,"warning-darken-1":`#C79D47`,"warning-darken-2":`#B28A34`,"warning-darken-3":`#9C7721`,"warning-lighten-1":`#F4C66E`,"warning-lighten-2":`#FFDB82`,"warning-lighten-3":`#FFF096`,"warning-muted":`#5E543F`}},"atom-one-light":{name:`atom-one-light`,dark:!1,vars:{accent:`#BE9232`,"accent-darken-1":`#A97E1D`,"accent-darken-2":`#936B01`,"accent-darken-3":`#7E5900`,"accent-lighten-1":`#D5A545`,"accent-lighten-2":`#EBB959`,"accent-lighten-3":`#FFCE6C`,"accent-muted":`#E8DABE`,background:`#FAFAFA`,"background-darken-1":`#E4E4E4`,"background-darken-2":`#CFCFCF`,"background-darken-3":`#BABABA`,"background-lighten-1":`#FFFFFF`,"background-lighten-2":`#FFFFFF`,"background-lighten-3":`#FFFFFF`,"block-cursor-background":`#4078F2`,"block-cursor-blurred-background":`#4078F24C`,"block-cursor-blurred-foreground":`#383A42`,"block-cursor-foreground":`#000000DD`,"block-hover-background":`#00000019`,boost:`#0000000A`,"boost-darken-1":`#0000000A`,"boost-darken-2":`#0000000A`,"boost-darken-3":`#0000000A`,"boost-lighten-1":`#1616160A`,"boost-lighten-2":`#2525250A`,"boost-lighten-3":`#3535350A`,border:`#4078F2`,"border-blurred":`#D8D8D8`,"button-color-foreground":`#000000DD`,"button-foreground":`#383A42`,error:`#F13F3F`,"error-darken-1":`#D9232D`,"error-darken-2":`#C1001D`,"error-darken-3":`#A9000D`,"error-lighten-1":`#FF5650`,"error-lighten-2":`#FF6C62`,"error-lighten-3":`#FF8275`,"error-muted":`#F7C1C1`,"footer-background":`#CCCCCC`,"footer-description-background":`#00000000`,"footer-description-foreground":`#383A42`,"footer-foreground":`#383A42`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#BF9232`,foreground:`#383A42`,"foreground-darken-1":`#272931`,"foreground-darken-2":`#181A21`,"foreground-darken-3":`#040612`,"foreground-disabled":`#383A4260`,"foreground-lighten-1":`#494B53`,"foreground-lighten-2":`#5A5C65`,"foreground-lighten-3":`#6D6F78`,"foreground-muted":`#383A4299`,"input-cursor-background":`#383A42`,"input-cursor-foreground":`#FAFAFA`,"input-selection-background":`#5C8AFF66`,"link-background":`#00000000`,"link-background-hover":`#4078F2`,"link-color":`#000000DD`,"link-color-hover":`#000000DD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#4078F2`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#4078F2`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#4078F2`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#383A42`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#383A42`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#383A4299`,panel:`#CCCCCC`,"panel-darken-1":`#B7B7B7`,"panel-darken-2":`#A3A3A3`,"panel-darken-3":`#8F8F8F`,"panel-lighten-1":`#E1E1E1`,"panel-lighten-2":`#F6F6F6`,"panel-lighten-3":`#FFFFFF`,primary:`#4078F2`,"primary-background":`#4078F2`,"primary-background-darken-1":`#1865DC`,"primary-background-darken-2":`#0053C6`,"primary-background-darken-3":`#0043B1`,"primary-background-lighten-1":`#5C8AFF`,"primary-background-lighten-2":`#759EFF`,"primary-background-lighten-3":`#8DB2FF`,"primary-darken-1":`#1865DC`,"primary-darken-2":`#0053C6`,"primary-darken-3":`#0043B1`,"primary-lighten-1":`#5C8AFF`,"primary-lighten-2":`#759EFF`,"primary-lighten-3":`#8DB2FF`,"primary-muted":`#C2D3F7`,scrollbar:`#A2B8E9`,"scrollbar-active":`#4078F2`,"scrollbar-background":`#E4E4E4`,"scrollbar-background-active":`#E4E4E4`,"scrollbar-background-hover":`#E4E4E4`,"scrollbar-corner-color":`#E4E4E4`,"scrollbar-hover":`#92AEEB`,secondary:`#A626A4`,"secondary-background":`#A626A4`,"secondary-background-darken-1":`#90008F`,"secondary-background-darken-2":`#7B007C`,"secondary-background-darken-3":`#670069`,"secondary-background-lighten-1":`#BB3EB8`,"secondary-background-lighten-2":`#D154CD`,"secondary-background-lighten-3":`#E769E2`,"secondary-darken-1":`#90008F`,"secondary-darken-2":`#7B007C`,"secondary-darken-3":`#670069`,"secondary-lighten-1":`#BB3EB8`,"secondary-lighten-2":`#D154CD`,"secondary-lighten-3":`#E769E2`,"secondary-muted":`#E0BAE0`,success:`#6BF23F`,"success-darken-1":`#52DC25`,"success-darken-2":`#36C600`,"success-darken-3":`#05B100`,"success-lighten-1":`#83FF55`,"success-lighten-2":`#9BFF6B`,"success-lighten-3":`#B2FF80`,"success-muted":`#CFF7C1`,surface:`#E0E0E0`,"surface-active":`#F1F1F1`,"surface-darken-1":`#CACACA`,"surface-darken-2":`#B6B6B6`,"surface-darken-3":`#A2A2A2`,"surface-lighten-1":`#F5F5F5`,"surface-lighten-2":`#FFFFFF`,"surface-lighten-3":`#FFFFFF`,text:`#000000DD`,"text-accent":`#7E6021`,"text-disabled":`#00000060`,"text-error":`#9F2929`,"text-muted":`#00000099`,"text-primary":`#2A4F9F`,"text-secondary":`#6D196C`,"text-success":`#479F29`,"text-warning":`#8E8F24`,warning:`#D7D938`,"warning-darken-1":`#C1C41C`,"warning-darken-2":`#ABAF00`,"warning-darken-3":`#969B00`,"warning-lighten-1":`#EEEE4E`,"warning-lighten-2":`#FFFF64`,"warning-lighten-3":`#FFFF79`,"warning-muted":`#EFF0BF`}},"catppuccin-frappe":{name:`catppuccin-frappe`,dark:!0,vars:{accent:`#F4B8E4`,"accent-darken-1":`#DEA3CE`,"accent-darken-2":`#C98FBA`,"accent-darken-3":`#B47BA5`,"accent-lighten-1":`#FFCCF9`,"accent-lighten-2":`#FFE2FF`,"accent-lighten-3":`#FFF7FF`,"accent-muted":`#6A5B75`,background:`#303446`,"background-darken-1":`#1F2435`,"background-darken-2":`#101424`,"background-darken-3":`#000016`,"background-lighten-1":`#404457`,"background-lighten-2":`#525669`,"background-lighten-3":`#64687C`,"block-cursor-background":`#CA9EE6`,"block-cursor-blurred-background":`#CA9EE64C`,"block-cursor-blurred-foreground":`#C6D0F5`,"block-cursor-foreground":`#292C3C`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#BABBF1`,"border-blurred":`#838BA7`,"button-color-foreground":`#303446`,"button-foreground":`#C6D0F5`,error:`#E68284`,"error-darken-1":`#D06E71`,"error-darken-2":`#BA5A5E`,"error-darken-3":`#A4474C`,"error-lighten-1":`#FD9697`,"error-lighten-2":`#FFAAAB`,"error-lighten-3":`#FFBFBF`,"error-muted":`#664B58`,"footer-background":`#51576D`,"footer-description-background":`#00000000`,"footer-description-foreground":`#C6D0F5`,"footer-foreground":`#C6D0F5`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#F4B8E4`,foreground:`#C6D0F5`,"foreground-darken-1":`#B1BBDF`,"foreground-darken-2":`#9CA7CA`,"foreground-darken-3":`#8993B5`,"foreground-disabled":`#C6D0F560`,"foreground-lighten-1":`#DBE5FF`,"foreground-lighten-2":`#F0FAFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#C6D0F599`,"input-cursor-background":`#F2D5CF`,"input-cursor-foreground":`#232634`,"input-selection-background":`#949CBB4C`,"link-background":`#00000000`,"link-background-hover":`#CA9EE6`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#CA9EE6`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#CA9EE6`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#CA9EE6`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#C6D0F5`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#C6D0F5`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#C6D0F599`,panel:`#51576D`,"panel-darken-1":`#3F455A`,"panel-darken-2":`#2E3448`,"panel-darken-3":`#1D2437`,"panel-lighten-1":`#63697F`,"panel-lighten-2":`#767B93`,"panel-lighten-3":`#898FA7`,primary:`#CA9EE6`,"primary-background":`#625F76`,"primary-background-darken-1":`#54516A`,"primary-background-darken-2":`#47435E`,"primary-background-darken-3":`#47435E`,"primary-background-lighten-1":`#706D82`,"primary-background-lighten-2":`#7E7B8E`,"primary-background-lighten-3":`#8C899A`,"primary-darken-1":`#B58AD0`,"primary-darken-2":`#A076BB`,"primary-darken-3":`#8C63A7`,"primary-lighten-1":`#DFB2FB`,"primary-lighten-2":`#F4C7FF`,"primary-lighten-3":`#FFDCFF`,"primary-muted":`#5E5376`,scrollbar:`#63547B`,"scrollbar-active":`#CA9EE6`,"scrollbar-background":`#1F2435`,"scrollbar-background-active":`#1F2435`,"scrollbar-background-hover":`#1F2435`,"scrollbar-corner-color":`#1F2435`,"scrollbar-hover":`#74618D`,secondary:`#EE9F76`,"secondary-background":`#666067`,"secondary-background-darken-1":`#59525A`,"secondary-background-darken-2":`#4C444D`,"secondary-background-darken-3":`#4C444D`,"secondary-background-lighten-1":`#746E75`,"secondary-background-lighten-2":`#817C82`,"secondary-background-lighten-3":`#8F8A8F`,"secondary-darken-1":`#D88B63`,"secondary-darken-2":`#C27750`,"secondary-darken-3":`#AC643E`,"secondary-lighten-1":`#FFB389`,"secondary-lighten-2":`#FFC89D`,"secondary-lighten-3":`#FFDDB1`,"secondary-muted":`#695454`,success:`#A6D189`,"success-darken-1":`#91BC75`,"success-darken-2":`#7DA762`,"success-darken-3":`#6A9350`,"success-lighten-1":`#BAE69C`,"success-lighten-2":`#CFFBB1`,"success-lighten-3":`#E5FFC5`,"success-muted":`#53635A`,surface:`#414559`,"surface-active":`#4F5267`,"surface-darken-1":`#303447`,"surface-darken-2":`#1F2436`,"surface-darken-3":`#101526`,"surface-lighten-1":`#52566B`,"surface-lighten-2":`#64687E`,"surface-lighten-3":`#777B91`,text:`#FFFFFFDD`,"text-accent":`#F7D0ED`,"text-disabled":`#FFFFFF60`,"text-error":`#EFACAD`,"text-muted":`#FFFFFF99`,"text-primary":`#DCBEEE`,"text-secondary":`#F4BFA4`,"text-success":`#C4E0B1`,"text-warning":`#EDDAB5`,warning:`#E4C890`,"warning-darken-1":`#CFB37C`,"warning-darken-2":`#BA9F69`,"warning-darken-3":`#A58B56`,"warning-lighten-1":`#FADCA4`,"warning-lighten-2":`#FFF2B8`,"warning-lighten-3":`#FFFFCD`,"warning-muted":`#66605C`}},"catppuccin-latte":{name:`catppuccin-latte`,dark:!1,vars:{accent:`#FD640B`,"accent-darken-1":`#E54F00`,"accent-darken-2":`#CC3900`,"accent-darken-3":`#B42200`,"accent-lighten-1":`#FF7825`,"accent-lighten-2":`#FF8D3A`,"accent-lighten-3":`#FFA24F`,"accent-muted":`#F3C6AE`,background:`#EFF1F5`,"background-darken-1":`#D9DBDF`,"background-darken-2":`#C4C6CA`,"background-darken-3":`#B0B2B5`,"background-lighten-1":`#FFFFFF`,"background-lighten-2":`#FFFFFF`,"background-lighten-3":`#FFFFFF`,"block-cursor-background":`#8839EF`,"block-cursor-blurred-background":`#8839EF4C`,"block-cursor-blurred-foreground":`#4C4F69`,"block-cursor-foreground":`#000000DD`,"block-hover-background":`#00000019`,boost:`#0000000A`,"boost-darken-1":`#0000000A`,"boost-darken-2":`#0000000A`,"boost-darken-3":`#0000000A`,"boost-lighten-1":`#1616160A`,"boost-lighten-2":`#2525250A`,"boost-lighten-3":`#3535350A`,border:`#8839EF`,"border-blurred":`#DEE1E7`,"button-color-foreground":`#EFF1F5`,"button-foreground":`#4C4F69`,error:`#D10F39`,"error-darken-1":`#BA0028`,"error-darken-2":`#A20019`,"error-darken-3":`#8A0008`,"error-lighten-1":`#EA324A`,"error-lighten-2":`#FF4B5B`,"error-lighten-3":`#FF626E`,"error-muted":`#E6ADBC`,"footer-background":`#CCD0DA`,"footer-description-background":`#00000000`,"footer-description-foreground":`#4C4F69`,"footer-foreground":`#4C4F69`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FE640B`,foreground:`#4C4F69`,"foreground-darken-1":`#3A3D56`,"foreground-darken-2":`#292D45`,"foreground-darken-3":`#191D34`,"foreground-disabled":`#4C4F6960`,"foreground-lighten-1":`#5E607B`,"foreground-lighten-2":`#70738F`,"foreground-lighten-3":`#8386A2`,"foreground-muted":`#4C4F6999`,"input-cursor-background":`#4C4F69`,"input-cursor-foreground":`#EFF1F5`,"input-selection-background":`#9E4DFF66`,"link-background":`#00000000`,"link-background-hover":`#8839EF`,"link-color":`#000000DD`,"link-color-hover":`#000000DD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#8839EF`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#8839EF`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#8839EF`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#4C4F69`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#4C4F69`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#4C4F6999`,panel:`#CCD0DA`,"panel-darken-1":`#B7BBC5`,"panel-darken-2":`#A3A6B0`,"panel-darken-3":`#8F939C`,"panel-lighten-1":`#E1E5EF`,"panel-lighten-2":`#F6FAFF`,"panel-lighten-3":`#FFFFFF`,primary:`#8839EF`,"primary-background":`#8839EF`,"primary-background-darken-1":`#7122D9`,"primary-background-darken-2":`#5901C3`,"primary-background-darken-3":`#4000AE`,"primary-background-lighten-1":`#9E4DFF`,"primary-background-lighten-2":`#B562FF`,"primary-background-lighten-3":`#CC76FF`,"primary-darken-1":`#7122D9`,"primary-darken-2":`#5901C3`,"primary-darken-3":`#4000AE`,"primary-lighten-1":`#9E4DFF`,"primary-lighten-2":`#B562FF`,"primary-lighten-3":`#CC76FF`,"primary-muted":`#D0B9F3`,scrollbar:`#B89AE5`,"scrollbar-active":`#8839EF`,"scrollbar-background":`#D9DBDF`,"scrollbar-background-active":`#D9DBDF`,"scrollbar-background-hover":`#D9DBDF`,"scrollbar-corner-color":`#D9DBDF`,"scrollbar-hover":`#B08AE7`,secondary:`#DB8A78`,"secondary-background":`#DB8A78`,"secondary-background-darken-1":`#C57665`,"secondary-background-darken-2":`#B06353`,"secondary-background-darken-3":`#9A5041`,"secondary-background-lighten-1":`#F29D8B`,"secondary-background-lighten-2":`#FFB29E`,"secondary-background-lighten-3":`#FFC7B3`,"secondary-darken-1":`#C57665`,"secondary-darken-2":`#B06353`,"secondary-darken-3":`#9A5041`,"secondary-lighten-1":`#F29D8B`,"secondary-lighten-2":`#FFB29E`,"secondary-lighten-3":`#FFC7B3`,"secondary-muted":`#E9D2CF`,success:`#40A02B`,"success-darken-1":`#278B14`,"success-darken-2":`#007800`,"success-darken-3":`#006400`,"success-lighten-1":`#56B43F`,"success-lighten-2":`#6BC952`,"success-lighten-3":`#81DE66`,"success-muted":`#BAD8B8`,surface:`#E6E9EF`,"surface-active":`#F7FAFF`,"surface-darken-1":`#D0D3D9`,"surface-darken-2":`#BCBFC4`,"surface-darken-3":`#A7AAB0`,"surface-lighten-1":`#FBFEFF`,"surface-lighten-2":`#FFFFFF`,"surface-lighten-3":`#FFFFFF`,text:`#000000DD`,"text-accent":`#A74207`,"text-disabled":`#00000060`,"text-error":`#8A0925`,"text-muted":`#00000099`,"text-primary":`#59259D`,"text-secondary":`#915B4F`,"text-success":`#2A691C`,"text-warning":`#935D13`,warning:`#DE8E1D`,"warning-darken-1":`#C77A00`,"warning-darken-2":`#B06700`,"warning-darken-3":`#9A5500`,"warning-lighten-1":`#F6A134`,"warning-lighten-2":`#FFB648`,"warning-lighten-3":`#FFCA5D`,"warning-muted":`#EAD3B4`}},"catppuccin-macchiato":{name:`catppuccin-macchiato`,dark:!0,vars:{accent:`#F5BDE6`,"accent-darken-1":`#DFA8D0`,"accent-darken-2":`#CA94BC`,"accent-darken-3":`#B580A7`,"accent-lighten-1":`#FFD1FB`,"accent-lighten-2":`#FFE7FF`,"accent-lighten-3":`#FFFCFF`,"accent-muted":`#62546D`,background:`#24273A`,"background-darken-1":`#141729`,"background-darken-2":`#00021A`,"background-darken-3":`#000007`,"background-lighten-1":`#34374B`,"background-lighten-2":`#45485C`,"background-lighten-3":`#57596F`,"block-cursor-background":`#C6A0F6`,"block-cursor-blurred-background":`#C6A0F64C`,"block-cursor-blurred-foreground":`#CAD3F5`,"block-cursor-foreground":`#1E2030`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#B7BDF8`,"border-blurred":`#737994`,"button-color-foreground":`#24273A`,"button-foreground":`#CAD3F5`,error:`#ED8796`,"error-darken-1":`#D67382`,"error-darken-2":`#C05F6F`,"error-darken-3":`#AB4C5D`,"error-lighten-1":`#FF9BA9`,"error-lighten-2":`#FFAFBE`,"error-lighten-3":`#FFC4D3`,"error-muted":`#604355`,"footer-background":`#494D64`,"footer-description-background":`#00000000`,"footer-description-foreground":`#CAD3F5`,"footer-foreground":`#CAD3F5`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#F5BDE6`,foreground:`#CAD3F5`,"foreground-darken-1":`#B5BEDF`,"foreground-darken-2":`#A0A9CA`,"foreground-darken-3":`#8C95B5`,"foreground-disabled":`#CAD3F560`,"foreground-lighten-1":`#DFE8FF`,"foreground-lighten-2":`#F4FDFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#CAD3F599`,"input-cursor-background":`#F4DBD6`,"input-cursor-foreground":`#181926`,"input-selection-background":`#838BA74C`,"link-background":`#00000000`,"link-background-hover":`#C6A0F6`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#C6A0F6`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#C6A0F6`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#C6A0F6`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#CAD3F5`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#CAD3F5`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#CAD3F599`,panel:`#494D64`,"panel-darken-1":`#373B51`,"panel-darken-2":`#262B40`,"panel-darken-3":`#161C2F`,"panel-lighten-1":`#5A5E76`,"panel-lighten-2":`#6D7189`,"panel-lighten-3":`#80849D`,primary:`#C6A0F6`,"primary-background":`#59566F`,"primary-background-darken-1":`#4A4762`,"primary-background-darken-2":`#3C3956`,"primary-background-darken-3":`#3C3956`,"primary-background-lighten-1":`#67657C`,"primary-background-lighten-2":`#767488`,"primary-background-lighten-3":`#858395`,"primary-darken-1":`#B08CE0`,"primary-darken-2":`#9C78CB`,"primary-darken-3":`#8865B6`,"primary-lighten-1":`#DBB4FF`,"primary-lighten-2":`#F1C9FF`,"primary-lighten-3":`#FFDEFF`,"primary-muted":`#544B72`,scrollbar:`#5B4D7B`,"scrollbar-active":`#C6A0F6`,"scrollbar-background":`#141729`,"scrollbar-background-active":`#141729`,"scrollbar-background-hover":`#141729`,"scrollbar-corner-color":`#141729`,"scrollbar-hover":`#6D5B8F`,secondary:`#F4A97F`,"secondary-background":`#5F5760`,"secondary-background-darken-1":`#514852`,"secondary-background-darken-2":`#433A44`,"secondary-background-darken-3":`#433A44`,"secondary-background-lighten-1":`#6D666E`,"secondary-background-lighten-2":`#7B757C`,"secondary-background-lighten-3":`#89838A`,"secondary-darken-1":`#DE946B`,"secondary-darken-2":`#C88159`,"secondary-darken-3":`#B26E47`,"secondary-lighten-1":`#FFBD92`,"secondary-lighten-2":`#FFD2A6`,"secondary-lighten-3":`#FFE7BB`,"secondary-muted":`#624E4E`,success:`#A6DA95`,"success-darken-1":`#91C481`,"success-darken-2":`#7DB06E`,"success-darken-3":`#6A9C5B`,"success-lighten-1":`#BAEFA9`,"success-lighten-2":`#CFFFBD`,"success-lighten-3":`#E5FFD2`,"success-muted":`#4B5C55`,surface:`#363A4F`,"surface-active":`#43475D`,"surface-darken-1":`#25293D`,"surface-darken-2":`#151A2D`,"surface-darken-3":`#03061D`,"surface-lighten-1":`#474B60`,"surface-lighten-2":`#595C73`,"surface-lighten-3":`#6B6F86`,text:`#FFFFFFDD`,"text-accent":`#F8D3EE`,"text-disabled":`#FFFFFF60`,"text-error":`#F3AFB9`,"text-muted":`#FFFFFF99`,"text-primary":`#D9C0F9`,"text-secondary":`#F8C6AA`,"text-success":`#C4E6B9`,"text-warning":`#F3E2BF`,warning:`#EED49F`,"warning-darken-1":`#D8BF8B`,"warning-darken-2":`#C3AA77`,"warning-darken-3":`#AE9664`,"warning-lighten-1":`#FFE9B3`,"warning-lighten-2":`#FFFEC7`,"warning-lighten-3":`#FFFFDD`,"warning-muted":`#605A58`}},"catppuccin-mocha":{name:`catppuccin-mocha`,dark:!0,vars:{accent:`#F9B387`,"accent-darken-1":`#E39E73`,"accent-darken-2":`#CD8A60`,"accent-darken-3":`#B7774E`,"accent-lighten-1":`#FFC79A`,"accent-lighten-2":`#FFDCAE`,"accent-lighten-3":`#FFF2C3`,"accent-muted":`#5B4642`,background:`#181825`,"background-darken-1":`#040216`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#272735`,"background-lighten-2":`#373746`,"background-lighten-3":`#484857`,"block-cursor-background":`#F5C2E7`,"block-cursor-blurred-background":`#F5C2E74C`,"block-cursor-blurred-foreground":`#CDD6F4`,"block-cursor-foreground":`#1E1E2E`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#B4BEFE`,"border-blurred":`#585B70`,"button-color-foreground":`#181825`,"button-foreground":`#CDD6F4`,error:`#F28FAD`,"error-darken-1":`#DB7A99`,"error-darken-2":`#C66785`,"error-darken-3":`#B05372`,"error-lighten-1":`#FFA3C1`,"error-lighten-2":`#FFB8D6`,"error-lighten-3":`#FFCDEB`,"error-muted":`#593B4D`,"footer-background":`#45475A`,"footer-description-background":`#00000000`,"footer-description-foreground":`#CDD6F4`,"footer-foreground":`#CDD6F4`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FAB387`,foreground:`#CDD6F4`,"foreground-darken-1":`#B8C1DE`,"foreground-darken-2":`#A3ACC9`,"foreground-darken-3":`#8F98B4`,"foreground-disabled":`#CDD6F460`,"foreground-lighten-1":`#E2EBFF`,"foreground-lighten-2":`#F7FFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#CDD6F499`,"input-cursor-background":`#F5E0DC`,"input-cursor-foreground":`#11111B`,"input-selection-background":`#9399B24C`,"link-background":`#00000000`,"link-background-hover":`#F5C2E7`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#F5C2E7`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#F5C2E7`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#F5C2E7`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#CDD6F4`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#CDD6F4`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#CDD6F499`,panel:`#45475A`,"panel-darken-1":`#333648`,"panel-darken-2":`#232637`,"panel-darken-3":`#131627`,"panel-lighten-1":`#56586C`,"panel-lighten-2":`#696A7F`,"panel-lighten-3":`#7B7D92`,primary:`#F5C2E7`,"primary-background":`#564F5E`,"primary-background-darken-1":`#474050`,"primary-background-darken-2":`#393142`,"primary-background-darken-3":`#393142`,"primary-background-lighten-1":`#655F6C`,"primary-background-lighten-2":`#746E7A`,"primary-background-lighten-3":`#837E88`,"primary-darken-1":`#DFADD1`,"primary-darken-2":`#CA99BD`,"primary-darken-3":`#B585A8`,"primary-lighten-1":`#FFD6FC`,"primary-lighten-2":`#FFECFF`,"primary-lighten-3":`#FFFFFF`,"primary-muted":`#5A4B5F`,scrollbar:`#644E69`,"scrollbar-active":`#F5C2E7`,"scrollbar-background":`#040216`,"scrollbar-background-active":`#040216`,"scrollbar-background-hover":`#040216`,"scrollbar-corner-color":`#040216`,"scrollbar-hover":`#7C627E`,secondary:`#CBA6F7`,"secondary-background":`#504C60`,"secondary-background-darken-1":`#413C52`,"secondary-background-darken-2":`#322D44`,"secondary-background-darken-3":`#322D44`,"secondary-background-lighten-1":`#605C6E`,"secondary-background-lighten-2":`#6F6C7C`,"secondary-background-lighten-3":`#7E7B8A`,"secondary-darken-1":`#B592E1`,"secondary-darken-2":`#A17ECC`,"secondary-darken-3":`#8C6BB7`,"secondary-lighten-1":`#E0BAFF`,"secondary-lighten-2":`#F6CFFF`,"secondary-lighten-3":`#FFE4FF`,"secondary-muted":`#4D4264`,success:`#ABE9B3`,"success-darken-1":`#96D39E`,"success-darken-2":`#82BE8B`,"success-darken-3":`#6EAA77`,"success-lighten-1":`#BFFEC7`,"success-lighten-2":`#D5FFDC`,"success-lighten-3":`#EAFFF2`,"success-muted":`#44564F`,surface:`#313244`,"surface-active":`#3E3F51`,"surface-darken-1":`#202233`,"surface-darken-2":`#111223`,"surface-darken-3":`#000014`,"surface-lighten-1":`#414255`,"surface-lighten-2":`#535467`,"surface-lighten-3":`#65667A`,text:`#FFFFFFDD`,"text-accent":`#FBCCAF`,"text-disabled":`#FFFFFF60`,"text-error":`#F6B5C8`,"text-muted":`#FFFFFF99`,"text-primary":`#F8D6EF`,"text-secondary":`#DCC4F9`,"text-success":`#C7F0CC`,"text-warning":`#FBECCA`,warning:`#FAE3B0`,"warning-darken-1":`#E4CD9B`,"warning-darken-2":`#CEB988`,"warning-darken-3":`#B9A574`,"warning-lighten-1":`#FFF8C4`,"warning-lighten-2":`#FFFFD9`,"warning-lighten-3":`#FFFFEF`,"warning-muted":`#5B544E`}},cyberpunk:{name:`cyberpunk`,dark:!0,vars:{background:`#070714`,"background-darken-1":`#03030A`,"background-darken-2":`#000003`,"background-darken-3":`#000000`,"background-lighten-1":`#11111E`,"background-lighten-2":`#1A1A2B`,"background-lighten-3":`#25253A`,foreground:`#E2E2FF`,"foreground-darken-1":`#CACAE4`,"foreground-darken-2":`#B3B3CC`,"foreground-darken-3":`#9C9CB5`,"foreground-disabled":`#E2E2FF60`,"foreground-lighten-1":`#EEEEFF`,"foreground-lighten-2":`#F6F6FF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#E2E2FF99`,primary:`#00E5FFD9`,"primary-darken-1":`#00CCE6D9`,"primary-darken-2":`#00B2CCD9`,"primary-darken-3":`#0099B3D9`,"primary-lighten-1":`#1AF0FFD9`,"primary-lighten-2":`#33F5FFD9`,"primary-lighten-3":`#4DFAFFD9`,"primary-muted":`#054A5BF4`,"primary-background":`#0A3340`,"primary-background-darken-1":`#072833`,"primary-background-darken-2":`#051E27`,"primary-background-darken-3":`#051E27`,"primary-background-lighten-1":`#0F404F`,"primary-background-lighten-2":`#154E5F`,"primary-background-lighten-3":`#1A5C6F`,secondary:`#FF1E8ECC`,"secondary-darken-1":`#E60A76CC`,"secondary-darken-2":`#CC005FCC`,"secondary-darken-3":`#B20048CC`,"secondary-lighten-1":`#FF3CA2CC`,"secondary-lighten-2":`#FF5AB6CC`,"secondary-lighten-3":`#FF78CACC`,"secondary-muted":`#510E39EF`,"secondary-background":`#3A0A28`,"secondary-background-darken-1":`#2E071F`,"secondary-background-darken-2":`#220517`,"secondary-background-darken-3":`#220517`,"secondary-background-lighten-1":`#470D33`,"secondary-background-lighten-2":`#54103F`,"secondary-background-lighten-3":`#61134B`,accent:`#EEFF00CC`,"accent-darken-1":`#D6E600CC`,"accent-darken-2":`#BECC00CC`,"accent-darken-3":`#A5B200CC`,"accent-lighten-1":`#FFFF26CC`,"accent-lighten-2":`#FFFF4DCC`,"accent-lighten-3":`#FFFF73CC`,"accent-muted":`#4C510EEF`,success:`#39FF14BF`,"success-darken-1":`#23E60ABF`,"success-darken-2":`#0FCC00BF`,"success-darken-3":`#00B200BF`,"success-lighten-1":`#4DFF32BF`,"success-lighten-2":`#69FF5ABF`,"success-lighten-3":`#87FF82BF`,"success-muted":`#164D14F0`,warning:`#FF6E00CC`,"warning-darken-1":`#E65800CC`,"warning-darken-2":`#CC4300CC`,"warning-darken-3":`#B23000CC`,"warning-lighten-1":`#FF8C26CC`,"warning-lighten-2":`#FFA54DCC`,"warning-lighten-3":`#FFBE73CC`,"warning-muted":`#51260EEF`,error:`#FF1133BF`,"error-darken-1":`#E6051EBF`,"error-darken-2":`#CC000CBF`,"error-darken-3":`#B20000BF`,"error-lighten-1":`#FF3758BF`,"error-lighten-2":`#FF5A78BF`,"error-lighten-3":`#FF7D96BF`,"error-muted":`#510A1DF0`,surface:`#0F0F22`,"surface-active":`#161630`,"surface-darken-1":`#08081A`,"surface-darken-2":`#040411`,"surface-darken-3":`#020209`,"surface-lighten-1":`#17172E`,"surface-lighten-2":`#1F1F3C`,"surface-lighten-3":`#28284A`,panel:`#0C0C1E`,"panel-darken-1":`#060614`,"panel-darken-2":`#03030C`,"panel-darken-3":`#010108`,"panel-lighten-1":`#14142C`,"panel-lighten-2":`#1C1C3A`,"panel-lighten-3":`#242448`,scrollbar:`#151535`,"scrollbar-active":`#00E5FFD9`,"scrollbar-background":`#040412`,"scrollbar-background-active":`#040412`,"scrollbar-background-hover":`#040412`,"scrollbar-corner-color":`#040412`,"scrollbar-hover":`#1F1F48`,"block-cursor-background":`#00E5FF`,"block-cursor-blurred-background":`#00E5FF4C`,"block-cursor-blurred-foreground":`#E2E2FF`,"block-cursor-foreground":`#070714`,"block-hover-background":`#00E5FF19`,boost:`#00E5FF0A`,"boost-darken-1":`#00CCE60A`,"boost-darken-2":`#00B2CC0A`,"boost-darken-3":`#0099B30A`,"boost-lighten-1":`#00E5FF0A`,"boost-lighten-2":`#00E5FF0A`,"boost-lighten-3":`#00E5FF0A`,border:`#00E5FFD9`,"border-blurred":`#1A1A35`,"button-color-foreground":`#070714`,"button-foreground":`#E2E2FF`,"footer-background":`#0C0C1E`,"footer-description-background":`#00000000`,"footer-description-foreground":`#E2E2FF`,"footer-foreground":`#E2E2FF`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#00E5FFD9`,"input-cursor-background":`#E2E2FF`,"input-cursor-foreground":`#070714`,"input-selection-background":`#00E5FF40`,"link-background":`#00000000`,"link-background-hover":`#00E5FFD9`,"link-color":`#E2E2FFDD`,"link-color-hover":`#070714`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#00E5FFD9`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#00E5FFD9`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#FF1E8ECC`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#E2E2FF`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#E2E2FF`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#E2E2FF99`,text:`#E2E2FFDD`,"text-accent":`#F4FF66CC`,"text-disabled":`#E2E2FF60`,"text-error":`#FF6677BF`,"text-muted":`#E2E2FF99`,"text-primary":`#66F0FFD9`,"text-secondary":`#FF80B0CC`,"text-success":`#80FF55BF`,"text-warning":`#FFB055CC`}},default:{name:`default`,dark:!0,vars:{accent:`#006FB8`,"accent-darken-1":`#005CA3`,"accent-darken-2":`#004B8F`,"accent-darken-3":`#003A7B`,"accent-lighten-1":`#3081CC`,"accent-lighten-2":`#4C95E2`,"accent-lighten-3":`#64A8F7`,"accent-muted":`#002137`,background:`#000000`,"background-darken-1":`#000000`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#161616`,"background-lighten-2":`#252525`,"background-lighten-3":`#353535`,"block-cursor-background":`#006FB8`,"block-cursor-blurred-background":`#006FB84C`,"block-cursor-blurred-foreground":`#FFFFFF`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#006FB8`,"border-blurred":`#191919`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#FFFFFF`,error:`#7F0000`,"error-darken-1":`#6A0000`,"error-darken-2":`#560000`,"error-darken-3":`#450000`,"error-lighten-1":`#961E12`,"error-lighten-2":`#AD3423`,"error-lighten-3":`#C44934`,"error-muted":`#260000`,"footer-background":`#242E35`,"footer-description-background":`#00000000`,"footer-description-foreground":`#FFFFFF`,"footer-foreground":`#FFFFFF`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#006FB8`,foreground:`#FFFFFF`,"foreground-darken-1":`#E9E9E9`,"foreground-darken-2":`#D4D4D4`,"foreground-darken-3":`#BFBFBF`,"foreground-disabled":`#FFFFFF60`,"foreground-lighten-1":`#FFFFFF`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#FFFFFF99`,"input-cursor-background":`#FFFFFF`,"input-cursor-foreground":`#000000`,"input-selection-background":`#3081CC66`,"link-background":`#00000000`,"link-background-hover":`#006FB8`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#006FB8`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#006FB8`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#006FB8`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#FFFFFF`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#FFFFFF`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#FFFFFF99`,panel:`#242E35`,"panel-darken-1":`#141E24`,"panel-darken-2":`#000D15`,"panel-darken-3":`#000000`,"panel-lighten-1":`#343E45`,"panel-lighten-2":`#454F57`,"panel-lighten-3":`#566169`,primary:`#006FB8`,"primary-background":`#26333D`,"primary-background-darken-1":`#13212C`,"primary-background-darken-2":`#00101B`,"primary-background-darken-3":`#00101B`,"primary-background-lighten-1":`#39454E`,"primary-background-lighten-2":`#4C575F`,"primary-background-lighten-3":`#5F6970`,"primary-darken-1":`#005CA3`,"primary-darken-2":`#004B8F`,"primary-darken-3":`#003A7B`,"primary-lighten-1":`#3081CC`,"primary-lighten-2":`#4C95E2`,"primary-lighten-3":`#64A8F7`,"primary-muted":`#002137`,scrollbar:`#002C49`,"scrollbar-active":`#006FB8`,"scrollbar-background":`#000000`,"scrollbar-background-active":`#000000`,"scrollbar-background-hover":`#000000`,"scrollbar-corner-color":`#000000`,"scrollbar-hover":`#00375C`,secondary:`#762671`,"secondary-background":`#342A33`,"secondary-background-darken-1":`#221721`,"secondary-background-darken-2":`#110510`,"secondary-background-darken-3":`#110510`,"secondary-background-lighten-1":`#463D45`,"secondary-background-lighten-2":`#585057`,"secondary-background-lighten-3":`#6A6269`,"secondary-darken-1":`#620F5E`,"secondary-darken-2":`#4E004C`,"secondary-darken-3":`#3B003A`,"secondary-lighten-1":`#8A3984`,"secondary-lighten-2":`#9E4C97`,"secondary-lighten-3":`#B360AB`,"secondary-muted":`#230B21`,success:`#008000`,"success-darken-1":`#006C00`,"success-darken-2":`#005900`,"success-darken-3":`#004600`,"success-lighten-1":`#29931C`,"success-lighten-2":`#42A832`,"success-lighten-3":`#58BD46`,"success-muted":`#002600`,surface:`#1E1E1E`,"surface-active":`#2A2A2A`,"surface-darken-1":`#0D0D0D`,"surface-darken-2":`#000000`,"surface-darken-3":`#000000`,"surface-lighten-1":`#2D2D2D`,"surface-lighten-2":`#3E3E3E`,"surface-lighten-3":`#4F4F4F`,text:`#FFFFFFDD`,"text-accent":`#569FD0`,"text-disabled":`#FFFFFF60`,"text-error":`#AB5656`,"text-muted":`#FFFFFF99`,"text-primary":`#569FD0`,"text-secondary":`#A46FA1`,"text-success":`#56AB56`,"text-warning":`#ABAB56`,warning:`#7F8000`,"warning-darken-1":`#6B6D00`,"warning-darken-2":`#575A00`,"warning-darken-3":`#454900`,"warning-lighten-1":`#94931E`,"warning-lighten-2":`#A9A734`,"warning-lighten-3":`#BFBB48`,"warning-muted":`#262600`}},dracula:{name:`dracula`,dark:!0,vars:{accent:`#FF79C6`,"accent-darken-1":`#E864B1`,"accent-darken-2":`#D24F9D`,"accent-darken-3":`#BC3989`,"accent-lighten-1":`#FF8DDA`,"accent-lighten-2":`#FFA3F0`,"accent-lighten-3":`#FFB8FF`,"accent-muted":`#684161`,background:`#282A36`,"background-darken-1":`#181A25`,"background-darken-2":`#050716`,"background-darken-3":`#000000`,"background-lighten-1":`#383A46`,"background-lighten-2":`#494B58`,"background-lighten-3":`#5B5D6A`,"block-cursor-background":`#BD93F9`,"block-cursor-blurred-background":`#BD93F94C`,"block-cursor-blurred-foreground":`#F8F8F2`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#BD93F9`,"border-blurred":`#252835`,"button-color-foreground":`#282A36`,"button-foreground":`#F8F8F2`,error:`#FE5555`,"error-darken-1":`#E63E43`,"error-darken-2":`#CE2332`,"error-darken-3":`#B70022`,"error-lighten-1":`#FF6A67`,"error-lighten-2":`#FF807A`,"error-lighten-3":`#FF958D`,"error-muted":`#68363F`,"footer-background":`#313442`,"footer-description-background":`#00000000`,"footer-description-foreground":`#F8F8F2`,"footer-foreground":`#F8F8F2`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FF79C6`,foreground:`#F8F8F2`,"foreground-darken-1":`#E2E2DC`,"foreground-darken-2":`#CDCDC7`,"foreground-darken-3":`#B8B8B3`,"foreground-disabled":`#F8F8F260`,"foreground-lighten-1":`#FFFFFF`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#F8F8F299`,"input-cursor-background":`#F8F8F2`,"input-cursor-foreground":`#282A36`,"input-selection-background":`#D2A7FF66`,"link-background":`#00000000`,"link-background-hover":`#BD93F9`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#BD93F9`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#BD93F9`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#BD93F9`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#F8F8F2`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#F8F8F2`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#F8F8F299`,panel:`#313442`,"panel-darken-1":`#202431`,"panel-darken-2":`#111421`,"panel-darken-3":`#000012`,"panel-lighten-1":`#414453`,"panel-lighten-2":`#535665`,"panel-lighten-3":`#656878`,primary:`#BD93F9`,"primary-background":`#5A566C`,"primary-background-darken-1":`#4C475F`,"primary-background-darken-2":`#3E3953`,"primary-background-darken-3":`#3E3953`,"primary-background-lighten-1":`#696579`,"primary-background-lighten-2":`#777486`,"primary-background-lighten-3":`#868393`,"primary-darken-1":`#A77FE3`,"primary-darken-2":`#936CCE`,"primary-darken-3":`#7E59B9`,"primary-lighten-1":`#D2A7FF`,"primary-lighten-2":`#E8BBFF`,"primary-lighten-3":`#FED0FF`,"primary-muted":`#544970`,scrollbar:`#5A4A79`,"scrollbar-active":`#BD93F9`,"scrollbar-background":`#181A25`,"scrollbar-background-active":`#181A25`,"scrollbar-background-hover":`#181A25`,"scrollbar-corner-color":`#181A25`,"scrollbar-hover":`#6A568F`,secondary:`#6272A4`,"secondary-background":`#4F5261`,"secondary-background-darken-1":`#3F4353`,"secondary-background-darken-2":`#303446`,"secondary-background-darken-3":`#303446`,"secondary-background-lighten-1":`#5E616F`,"secondary-background-lighten-2":`#6E707D`,"secondary-background-lighten-3":`#7D808B`,"secondary-darken-1":`#4E5F90`,"secondary-darken-2":`#3B4D7C`,"secondary-darken-3":`#283C69`,"secondary-lighten-1":`#7584B8`,"secondary-lighten-2":`#8998CD`,"secondary-lighten-3":`#9DACE2`,"secondary-muted":`#393F57`,success:`#50FA7B`,"success-darken-1":`#2FE467`,"success-darken-2":`#00CE53`,"success-darken-3":`#00B83F`,"success-lighten-1":`#6AFF8F`,"success-lighten-2":`#83FFA3`,"success-lighten-3":`#9BFFB8`,"success-muted":`#34684A`,surface:`#2B2E3B`,"surface-active":`#383B48`,"surface-darken-1":`#1B1E2A`,"surface-darken-2":`#0A0D1B`,"surface-darken-3":`#000009`,"surface-lighten-1":`#3B3E4C`,"surface-lighten-2":`#4C4F5D`,"surface-lighten-3":`#5E6170`,text:`#FFFFFFDD`,"text-accent":`#FFA6D9`,"text-disabled":`#FFFFFF60`,"text-error":`#FF8E8E`,"text-muted":`#FFFFFF99`,"text-primary":`#D3B7FB`,"text-secondary":`#97A1C2`,"text-success":`#8BFBA7`,"text-warning":`#FFD09D`,warning:`#FEB86C`,"warning-darken-1":`#E8A358`,"warning-darken-2":`#D18F45`,"warning-darken-3":`#BB7C33`,"warning-lighten-1":`#FFCC7F`,"warning-lighten-2":`#FFE193`,"warning-lighten-3":`#FFF7A7`,"warning-muted":`#685446`}},flexoki:{name:`flexoki`,dark:!0,vars:{accent:`#9B76C8`,"accent-darken-1":`#8663B3`,"accent-darken-2":`#72509E`,"accent-darken-3":`#5F3E8B`,"accent-lighten-1":`#AF89DD`,"accent-lighten-2":`#C49DF2`,"accent-lighten-3":`#D9B1FF`,"accent-muted":`#392D46`,background:`#100F0F`,"background-darken-1":`#000000`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#1F1F1F`,"background-lighten-2":`#2F2E2E`,"background-lighten-3":`#403F3F`,"block-cursor-background":`#205EA6`,"block-cursor-blurred-background":`#205EA64C`,"block-cursor-blurred-foreground":`#FFFCF0`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#205EA6`,"border-blurred":`#171614`,"button-color-foreground":`#FFFCF0`,"button-foreground":`#FFFCF0`,error:`#AE3029`,"error-darken-1":`#981818`,"error-darken-2":`#810007`,"error-darken-3":`#6B0000`,"error-lighten-1":`#C64539`,"error-lighten-2":`#DD594B`,"error-lighten-3":`#F46D5D`,"error-muted":`#3F1816`,"footer-background":`#282726`,"footer-description-background":`#00000000`,"footer-description-foreground":`#FFFCF0`,"footer-foreground":`#FFFCF0`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#9B76C8`,foreground:`#FFFCF0`,"foreground-darken-1":`#E9E6DA`,"foreground-darken-2":`#D4D1C5`,"foreground-darken-3":`#BFBCB1`,"foreground-disabled":`#FFFCF060`,"foreground-lighten-1":`#FFFFFF`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#FFFCF099`,"input-cursor-background":`#FFFCF0`,"input-cursor-foreground":`#5E409D`,"input-selection-background":`#6F6E6959`,"link-background":`#00000000`,"link-background-hover":`#205EA6`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#205EA6`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#205EA6`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#205EA6`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#FFFCF0`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#FFFCF0`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#FFFCF099`,panel:`#282726`,"panel-darken-1":`#181716`,"panel-darken-2":`#040200`,"panel-darken-3":`#000000`,"panel-lighten-1":`#383736`,"panel-lighten-2":`#494846`,"panel-lighten-3":`#5A5958`,primary:`#205EA6`,"primary-background":`#353C45`,"primary-background-darken-1":`#232B35`,"primary-background-darken-2":`#121A25`,"primary-background-darken-3":`#121A25`,"primary-background-lighten-1":`#474D56`,"primary-background-lighten-2":`#595E66`,"primary-background-lighten-3":`#6A6F76`,"primary-darken-1":`#004C91`,"primary-darken-2":`#003B7E`,"primary-darken-3":`#002B6B`,"primary-lighten-1":`#3C70BA`,"primary-lighten-2":`#5383CF`,"primary-lighten-3":`#6996E4`,"primary-muted":`#14263C`,scrollbar:`#0C2542`,"scrollbar-active":`#205EA6`,"scrollbar-background":`#000000`,"scrollbar-background-active":`#000000`,"scrollbar-background-hover":`#000000`,"scrollbar-corner-color":`#000000`,"scrollbar-hover":`#102F53`,secondary:`#24837B`,"secondary-background":`#364140`,"secondary-background-darken-1":`#24302F`,"secondary-background-darken-2":`#13201F`,"secondary-background-darken-3":`#13201F`,"secondary-background-lighten-1":`#485251`,"secondary-background-lighten-2":`#596262`,"secondary-background-lighten-3":`#6B7373`,"secondary-darken-1":`#006F68`,"secondary-darken-2":`#005D56`,"secondary-darken-3":`#004A44`,"secondary-lighten-1":`#3C968E`,"secondary-lighten-2":`#52AAA1`,"secondary-lighten-3":`#67BFB6`,"secondary-muted":`#16312F`,success:`#65800B`,"success-darken-1":`#526D00`,"success-darken-2":`#3E5A00`,"success-darken-3":`#2D4800`,"success-lighten-1":`#7A9324`,"success-lighten-2":`#8EA738`,"success-lighten-3":`#A3BB4C`,"success-muted":`#29300D`,surface:`#1C1B1A`,"surface-active":`#282726`,"surface-darken-1":`#0A0806`,"surface-darken-2":`#000000`,"surface-darken-3":`#000000`,"surface-lighten-1":`#2B2A29`,"surface-lighten-2":`#3B3A39`,"surface-lighten-3":`#4D4B4A`,text:`#FFFFFFDD`,"text-accent":`#BDA4DA`,"text-disabled":`#FFFFFF60`,"text-error":`#CA7671`,"text-muted":`#FFFFFF99`,"text-primary":`#6B94C4`,"text-secondary":`#6EADA7`,"text-success":`#9AAB5D`,"text-warning":`#C8AD57`,warning:`#AC8301`,"warning-darken-1":`#977000`,"warning-darken-2":`#815D00`,"warning-darken-3":`#6C4C00`,"warning-lighten-1":`#C39621`,"warning-lighten-2":`#D9AA37`,"warning-lighten-3":`#F0BE4B`,"warning-muted":`#3F310A`}},gruvbox:{name:`gruvbox`,dark:!0,vars:{accent:`#F9BD2F`,"accent-darken-1":`#E2A811`,"accent-darken-2":`#CB9400`,"accent-darken-3":`#B48100`,"accent-lighten-1":`#FFD146`,"accent-lighten-2":`#FFE65B`,"accent-lighten-3":`#FFFC70`,"accent-muted":`#67542A`,background:`#282828`,"background-darken-1":`#181818`,"background-darken-2":`#040404`,"background-darken-3":`#000000`,"background-lighten-1":`#383838`,"background-lighten-2":`#494949`,"background-lighten-3":`#5A5A5A`,"block-cursor-background":`#85A598`,"block-cursor-blurred-background":`#85A5984C`,"block-cursor-blurred-foreground":`#FBF1C7`,"block-cursor-foreground":`#FBF1C7`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#85A598`,"border-blurred":`#363230`,"button-color-foreground":`#282828`,"button-foreground":`#FBF1C7`,error:`#FA4934`,"error-darken-1":`#E23022`,"error-darken-2":`#C90D10`,"error-darken-3":`#B10000`,"error-lighten-1":`#FF5F45`,"error-lighten-2":`#FF7558`,"error-lighten-3":`#FF8B6B`,"error-muted":`#67312B`,"footer-background":`#504945`,"footer-description-background":`#00000000`,"footer-description-foreground":`#FBF1C7`,"footer-foreground":`#FBF1C7`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FABD2F`,foreground:`#FBF1C7`,"foreground-darken-1":`#E5DBB2`,"foreground-darken-2":`#D0C69E`,"foreground-darken-3":`#BBB28A`,"foreground-disabled":`#FBF1C760`,"foreground-lighten-1":`#FFFFDC`,"foreground-lighten-2":`#FFFFF1`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#FBF1C799`,"input-cursor-background":`#FBF1C7`,"input-cursor-foreground":`#282828`,"input-selection-background":`#689D6A40`,"link-background":`#00000000`,"link-background-hover":`#85A598`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#85A598`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#85A598`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#85A598`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#FBF1C7`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#FBF1C7`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#FBF1C799`,panel:`#504945`,"panel-darken-1":`#3E3834`,"panel-darken-2":`#2E2724`,"panel-darken-3":`#1E1815`,"panel-lighten-1":`#615A56`,"panel-lighten-2":`#746C68`,"panel-lighten-3":`#877F7B`,primary:`#85A598`,"primary-background":`#535755`,"primary-background-darken-1":`#444846`,"primary-background-darken-2":`#353A38`,"primary-background-darken-3":`#353A38`,"primary-background-lighten-1":`#626664`,"primary-background-lighten-2":`#717573`,"primary-background-lighten-3":`#808382`,"primary-darken-1":`#719184`,"primary-darken-2":`#5F7D71`,"primary-darken-3":`#4C6A5F`,"primary-lighten-1":`#98B9AB`,"primary-lighten-2":`#ACCEC0`,"primary-lighten-3":`#C1E3D5`,"primary-muted":`#434D49`,scrollbar:`#43504B`,"scrollbar-active":`#85A598`,"scrollbar-background":`#181818`,"scrollbar-background-active":`#181818`,"scrollbar-background-hover":`#181818`,"scrollbar-corner-color":`#181818`,"scrollbar-hover":`#4E5E58`,secondary:`#A89A85`,"secondary-background":`#585653`,"secondary-background-darken-1":`#494744`,"secondary-background-darken-2":`#3B3935`,"secondary-background-darken-3":`#3B3935`,"secondary-background-lighten-1":`#676562`,"secondary-background-lighten-2":`#757471`,"secondary-background-lighten-3":`#848380`,"secondary-darken-1":`#938671`,"secondary-darken-2":`#80735F`,"secondary-darken-3":`#6D604D`,"secondary-lighten-1":`#BCAE98`,"secondary-lighten-2":`#D1C2AC`,"secondary-lighten-3":`#E6D7C1`,"secondary-muted":`#4E4A43`,success:`#B7BB26`,"success-darken-1":`#A2A601`,"success-darken-2":`#8C9300`,"success-darken-3":`#777F00`,"success-lighten-1":`#CDCF3D`,"success-lighten-2":`#E4E453`,"success-lighten-3":`#FAFA68`,"success-muted":`#535427`,surface:`#3C3836`,"surface-active":`#494543`,"surface-darken-1":`#2B2725`,"surface-darken-2":`#1C1816`,"surface-darken-3":`#0A0300`,"surface-lighten-1":`#4D4846`,"surface-lighten-2":`#5F5A58`,"surface-lighten-3":`#716C6A`,text:`#FFFFFFDD`,"text-accent":`#FBD375`,"text-disabled":`#FFFFFF60`,"text-error":`#FC8679`,"text-muted":`#FFFFFF99`,"text-primary":`#AEC3BB`,"text-secondary":`#C5BCAE`,"text-success":`#D0D26F`,"text-warning":`#FEAB67`,warning:`#FD8019`,"warning-darken-1":`#E56C00`,"warning-darken-2":`#CD5800`,"warning-darken-3":`#B54500`,"warning-lighten-1":`#FF9430`,"warning-lighten-2":`#FFA845`,"warning-lighten-3":`#FFBD5A`,"warning-muted":`#684223`}},monokai:{name:`monokai`,dark:!0,vars:{accent:`#66D9EF`,"accent-darken-1":`#4DC3D9`,"accent-darken-2":`#31AFC4`,"accent-darken-3":`#009BB0`,"accent-lighten-1":`#7DEEFF`,"accent-lighten-2":`#94FFFF`,"accent-lighten-3":`#AAFFFF`,"accent-muted":`#395D5F`,background:`#272822`,"background-darken-1":`#171812`,"background-darken-2":`#020400`,"background-darken-3":`#000000`,"background-lighten-1":`#373831`,"background-lighten-2":`#484942`,"background-lighten-3":`#595A54`,"block-cursor-background":`#AE81FF`,"block-cursor-blurred-background":`#AE81FF4C`,"block-cursor-blurred-foreground":`#D6D6D6`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#AE81FF`,"border-blurred":`#282828`,"button-color-foreground":`#272822`,"button-foreground":`#D6D6D6`,error:`#F82672`,"error-darken-1":`#E1005F`,"error-darken-2":`#C9004E`,"error-darken-3":`#B1003D`,"error-lighten-1":`#FF4484`,"error-lighten-2":`#FF5D98`,"error-lighten-3":`#FF75AC`,"error-muted":`#66273A`,"footer-background":`#3E3D32`,"footer-description-background":`#00000000`,"footer-description-foreground":`#D6D6D6`,"footer-foreground":`#D6D6D6`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#66D9EF`,foreground:`#D6D6D6`,"foreground-darken-1":`#C1C1C1`,"foreground-darken-2":`#ACACAC`,"foreground-darken-3":`#989898`,"foreground-disabled":`#D6D6D660`,"foreground-lighten-1":`#EBEBEB`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#797979`,"input-cursor-background":`#D6D6D6`,"input-cursor-foreground":`#272822`,"input-selection-background":`#575B6190`,"link-background":`#00000000`,"link-background-hover":`#AE81FF`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#AE81FF`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#AE81FF`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#AE81FF`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#D6D6D6`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#D6D6D6`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#797979`,panel:`#3E3D32`,"panel-darken-1":`#2D2C22`,"panel-darken-2":`#1D1C12`,"panel-darken-3":`#0D0B00`,"panel-lighten-1":`#4F4E42`,"panel-lighten-2":`#616054`,"panel-lighten-3":`#737266`,primary:`#AE81FF`,"primary-background":`#58535F`,"primary-background-darken-1":`#494451`,"primary-background-darken-2":`#3B3543`,"primary-background-darken-3":`#3B3543`,"primary-background-lighten-1":`#67626D`,"primary-background-lighten-2":`#75717B`,"primary-background-lighten-3":`#848089`,"primary-darken-1":`#986DE9`,"primary-darken-2":`#835AD3`,"primary-darken-3":`#6E48BE`,"primary-lighten-1":`#C394FF`,"primary-lighten-2":`#D9A9FF`,"primary-lighten-3":`#EFBDFF`,"primary-muted":`#4F4264`,scrollbar:`#534270`,"scrollbar-active":`#AE81FF`,"scrollbar-background":`#171812`,"scrollbar-background-active":`#171812`,"scrollbar-background-hover":`#171812`,"scrollbar-corner-color":`#171812`,"scrollbar-hover":`#624C88`,secondary:`#F82672`,"secondary-background":`#61474D`,"secondary-background-darken-1":`#53373D`,"secondary-background-darken-2":`#46272E`,"secondary-background-darken-3":`#46272E`,"secondary-background-lighten-1":`#6F575D`,"secondary-background-lighten-2":`#7D676C`,"secondary-background-lighten-3":`#8B787C`,"secondary-darken-1":`#E1005F`,"secondary-darken-2":`#C9004E`,"secondary-darken-3":`#B1003D`,"secondary-lighten-1":`#FF4484`,"secondary-lighten-2":`#FF5D98`,"secondary-lighten-3":`#FF75AC`,"secondary-muted":`#66273A`,success:`#A5E22E`,"success-darken-1":`#90CC09`,"success-darken-2":`#7AB700`,"success-darken-3":`#64A300`,"success-lighten-1":`#BBF746`,"success-lighten-2":`#D2FF5D`,"success-lighten-3":`#E8FF72`,"success-muted":`#4D5F25`,surface:`#2E2E2E`,"surface-active":`#3B3B3B`,"surface-darken-1":`#1E1E1E`,"surface-darken-2":`#0D0D0D`,"surface-darken-3":`#000000`,"surface-lighten-1":`#3E3E3E`,"surface-lighten-2":`#4F4F4F`,"surface-lighten-3":`#616161`,text:`#FFFFFFDD`,"text-accent":`#9AE5F4`,"text-disabled":`#FFFFFF60`,"text-error":`#FB6FA1`,"text-muted":`#FFFFFF99`,"text-primary":`#C9ABFF`,"text-secondary":`#FB6FA1`,"text-success":`#C4EB75`,"text-warning":`#FDBA6B`,warning:`#FC971F`,"warning-darken-1":`#E58300`,"warning-darken-2":`#CD6F00`,"warning-darken-3":`#B65D00`,"warning-lighten-1":`#FFAB36`,"warning-lighten-2":`#FFBF4C`,"warning-lighten-3":`#FFD460`,"warning-muted":`#674921`}},nord:{name:`nord`,dark:!0,vars:{accent:`#B48EAD`,"accent-darken-1":`#9F7A98`,"accent-darken-2":`#8B6785`,"accent-darken-3":`#785572`,"accent-lighten-1":`#C8A1C1`,"accent-lighten-2":`#DDB6D6`,"accent-lighten-3":`#F3CAEB`,"accent-muted":`#564F60`,background:`#2E3440`,"background-darken-1":`#1E242F`,"background-darken-2":`#0E141F`,"background-darken-3":`#000010`,"background-lighten-1":`#3E4451`,"background-lighten-2":`#505663`,"background-lighten-3":`#626875`,"block-cursor-background":`#88C0D0`,"block-cursor-blurred-background":`#88C0D04C`,"block-cursor-blurred-foreground":`#D8DEE9`,"block-cursor-foreground":`#2E3440`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#88C0D0`,"border-blurred":`#353C4C`,"button-color-foreground":`#2E3440`,"button-foreground":`#D8DEE9`,error:`#BE616A`,"error-darken-1":`#A94D57`,"error-darken-2":`#933A46`,"error-darken-3":`#7E2735`,"error-lighten-1":`#D4747C`,"error-lighten-2":`#EB8890`,"error-lighten-3":`#FF9CA3`,"error-muted":`#59414C`,"footer-background":`#434C5E`,"footer-description-background":`#00000000`,"footer-description-foreground":`#D8DEE9`,"footer-foreground":`#D8DEE9`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#88C0D0`,foreground:`#D8DEE9`,"foreground-darken-1":`#C3C9D3`,"foreground-darken-2":`#AEB4BF`,"foreground-darken-3":`#9AA0AA`,"foreground-disabled":`#D8DEE960`,"foreground-lighten-1":`#EDF3FE`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#D8DEE999`,"input-cursor-background":`#D8DEE9`,"input-cursor-foreground":`#2E3440`,"input-selection-background":`#81A1C159`,"link-background":`#00000000`,"link-background-hover":`#88C0D0`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#88C0D0`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#88C0D0`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#88C0D0`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#D8DEE9`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#D8DEE9`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#D8DEE999`,panel:`#434C5E`,"panel-darken-1":`#313A4C`,"panel-darken-2":`#212A3A`,"panel-darken-3":`#111B2A`,"panel-lighten-1":`#545D70`,"panel-lighten-2":`#677083`,"panel-lighten-3":`#798396`,primary:`#88C0D0`,"primary-background":`#58646E`,"primary-background-darken-1":`#495661`,"primary-background-darken-2":`#3B4955`,"primary-background-darken-3":`#3B4955`,"primary-background-lighten-1":`#67717B`,"primary-background-lighten-2":`#757F88`,"primary-background-lighten-3":`#848D94`,"primary-darken-1":`#73ABBB`,"primary-darken-2":`#5F97A6`,"primary-darken-3":`#4B8393`,"primary-lighten-1":`#9CD4E5`,"primary-lighten-2":`#B1EAFA`,"primary-lighten-3":`#C6FFFF`,"primary-muted":`#495E6B`,scrollbar:`#48626F`,"scrollbar-active":`#88C0D0`,"scrollbar-background":`#1E242F`,"scrollbar-background-active":`#1E242F`,"scrollbar-background-hover":`#1E242F`,"scrollbar-corner-color":`#1E242F`,"scrollbar-hover":`#53727F`,secondary:`#81A1C1`,"secondary-background":`#57606C`,"secondary-background-darken-1":`#48525F`,"secondary-background-darken-2":`#3A4453`,"secondary-background-darken-3":`#3A4453`,"secondary-background-lighten-1":`#666E79`,"secondary-background-lighten-2":`#757C86`,"secondary-background-lighten-3":`#838A93`,"secondary-darken-1":`#6D8DAC`,"secondary-darken-2":`#597A98`,"secondary-darken-3":`#466784`,"secondary-lighten-1":`#95B5D5`,"secondary-lighten-2":`#A9C9EB`,"secondary-lighten-3":`#BEDEFF`,"secondary-muted":`#465466`,success:`#A3BE8C`,"success-darken-1":`#8FA978`,"success-darken-2":`#7B9565`,"success-darken-3":`#688253`,"success-lighten-1":`#B7D29F`,"success-lighten-2":`#CCE8B4`,"success-lighten-3":`#E1FDC8`,"success-muted":`#515D56`,surface:`#3B4252`,"surface-active":`#484F60`,"surface-darken-1":`#2A3140`,"surface-darken-2":`#1A212F`,"surface-darken-3":`#0A1120`,"surface-lighten-1":`#4C5364`,"surface-lighten-2":`#5E6576`,"surface-lighten-3":`#707889`,text:`#FFFFFFDD`,"text-accent":`#CDB4C8`,"text-disabled":`#FFFFFF60`,"text-error":`#D4969C`,"text-muted":`#FFFFFF99`,"text-primary":`#B0D5DF`,"text-secondary":`#ABC0D6`,"text-success":`#C2D4B3`,"text-warning":`#F1DCB2`,warning:`#EACB8B`,"warning-darken-1":`#D5B677`,"warning-darken-2":`#BFA264`,"warning-darken-3":`#AA8E51`,"warning-lighten-1":`#FFE09E`,"warning-lighten-2":`#FFF5B3`,"warning-lighten-3":`#FFFFC8`,"warning-muted":`#666156`}},"rose-pine":{name:`rose-pine`,dark:!0,vars:{accent:`#EBBCBA`,"accent-darken-1":`#D5A7A5`,"accent-darken-2":`#C09391`,"accent-darken-3":`#AB807E`,"accent-lighten-1":`#FFD0CE`,"accent-lighten-2":`#FFE5E3`,"accent-lighten-3":`#FFFBF9`,"accent-muted":`#584851`,background:`#191724`,"background-darken-1":`#060015`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#282634`,"background-lighten-2":`#383644`,"background-lighten-3":`#4A4756`,"block-cursor-background":`#C4A7E7`,"block-cursor-blurred-background":`#C4A7E74C`,"block-cursor-blurred-foreground":`#E0DEF4`,"block-cursor-foreground":`#191724`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#524F67`,"border-blurred":`#6E6A86`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#E0DEF4`,error:`#EA6F92`,"error-darken-1":`#D45A7E`,"error-darken-2":`#BE466B`,"error-darken-3":`#A83159`,"error-lighten-1":`#FF83A5`,"error-lighten-2":`#FF98BA`,"error-lighten-3":`#FFADCE`,"error-muted":`#583145`,"footer-background":`#26233A`,"footer-description-background":`#00000000`,"footer-description-foreground":`#E0DEF4`,"footer-foreground":`#E0DEF4`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#EBBCBA`,foreground:`#E0DEF4`,"foreground-darken-1":`#CAC9DE`,"foreground-darken-2":`#B6B4C9`,"foreground-darken-3":`#A2A0B4`,"foreground-disabled":`#E0DEF460`,"foreground-lighten-1":`#F5F3FF`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#E0DEF499`,"input-cursor-background":`#F4EDE8`,"input-cursor-foreground":`#191724`,"input-selection-background":`#403D52`,"link-background":`#00000000`,"link-background-hover":`#C4A7E7`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#C4A7E7`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#C4A7E7`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#C4A7E7`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#E0DEF4`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#E0DEF4`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#E0DEF499`,panel:`#26233A`,"panel-darken-1":`#161329`,"panel-darken-2":`#04001A`,"panel-darken-3":`#000008`,"panel-lighten-1":`#36324B`,"panel-lighten-2":`#47435D`,"panel-lighten-3":`#59556F`,primary:`#C4A7E7`,"primary-background":`#504B5D`,"primary-background-darken-1":`#413B4F`,"primary-background-darken-2":`#322C41`,"primary-background-darken-3":`#322C41`,"primary-background-lighten-1":`#605B6B`,"primary-background-lighten-2":`#6F6B7A`,"primary-background-lighten-3":`#7E7B88`,"primary-darken-1":`#AF93D1`,"primary-darken-2":`#9A7FBC`,"primary-darken-3":`#866CA8`,"primary-lighten-1":`#D9BBFC`,"primary-lighten-2":`#EED0FF`,"primary-lighten-3":`#FFE5FF`,"primary-muted":`#4C425E`,scrollbar:`#524269`,"scrollbar-active":`#C4A7E7`,"scrollbar-background":`#060015`,"scrollbar-background-active":`#060015`,"scrollbar-background-hover":`#060015`,"scrollbar-corner-color":`#060015`,"scrollbar-hover":`#65537E`,secondary:`#31748F`,"secondary-background":`#3E4452`,"secondary-background-darken-1":`#2D3443`,"secondary-background-darken-2":`#1C2434`,"secondary-background-darken-3":`#1C2434`,"secondary-background-lighten-1":`#4F5561`,"secondary-background-lighten-2":`#606570`,"secondary-background-lighten-3":`#717680`,"secondary-darken-1":`#17617B`,"secondary-darken-2":`#004F68`,"secondary-darken-3":`#003E56`,"secondary-lighten-1":`#4687A2`,"secondary-lighten-2":`#5B9AB7`,"secondary-lighten-3":`#70AECB`,"secondary-muted":`#203244`,success:`#9CCFD8`,"success-darken-1":`#87BAC3`,"success-darken-2":`#73A5AE`,"success-darken-3":`#60929A`,"success-lighten-1":`#B0E4ED`,"success-lighten-2":`#C5F9FF`,"success-lighten-3":`#DAFFFF`,"success-muted":`#404E5A`,surface:`#1F1D2E`,"surface-active":`#2B293B`,"surface-darken-1":`#100B1E`,"surface-darken-2":`#00000E`,"surface-darken-3":`#000000`,"surface-lighten-1":`#2F2C3E`,"surface-lighten-2":`#3F3D4F`,"surface-lighten-3":`#514E61`,text:`#FFFFFFDD`,"text-accent":`#F1D2D1`,"text-disabled":`#FFFFFF60`,"text-error":`#F19FB7`,"text-muted":`#FFFFFF99`,"text-primary":`#D8C4EF`,"text-secondary":`#77A3B5`,"text-success":`#BDDFE5`,"text-warning":`#F9D6A5`,warning:`#F5C177`,"warning-darken-1":`#DFAC63`,"warning-darken-2":`#C99850`,"warning-darken-3":`#B3853E`,"warning-lighten-1":`#FFD58A`,"warning-lighten-2":`#FFEB9E`,"warning-lighten-3":`#FFFFB3`,"warning-muted":`#5B4A3C`}},"rose-pine-dawn":{name:`rose-pine-dawn`,dark:!1,vars:{accent:`#D6827E`,"accent-darken-1":`#C16E6B`,"accent-darken-2":`#AB5B58`,"accent-darken-3":`#964847`,"accent-lighten-1":`#ED9591`,"accent-lighten-2":`#FFAAA5`,"accent-lighten-3":`#FFBEB9`,"accent-muted":`#EFD1CB`,background:`#FAF4ED`,"background-darken-1":`#E4DED7`,"background-darken-2":`#CFC9C2`,"background-darken-3":`#BAB5AE`,"background-lighten-1":`#FFFFFF`,"background-lighten-2":`#FFFFFF`,"background-lighten-3":`#FFFFFF`,"block-cursor-background":`#575279`,"block-cursor-blurred-background":`#907AA94C`,"block-cursor-blurred-foreground":`#575279`,"block-cursor-foreground":`#FAF4ED`,"block-hover-background":`#00000019`,boost:`#0000000A`,"boost-darken-1":`#0000000A`,"boost-darken-2":`#0000000A`,"boost-darken-3":`#0000000A`,"boost-lighten-1":`#1616160A`,"boost-lighten-2":`#2525250A`,"boost-lighten-3":`#3535350A`,border:`#CECACD`,"border-blurred":`#9893A5`,"button-color-foreground":`#000000DD`,"button-foreground":`#575279`,error:`#B4637A`,"error-darken-1":`#9E5067`,"error-darken-2":`#8A3D55`,"error-darken-3":`#752A43`,"error-lighten-1":`#C9768D`,"error-lighten-2":`#DF8AA0`,"error-lighten-3":`#F59EB5`,"error-muted":`#E5C8CA`,"footer-background":`#F2E9E1`,"footer-description-background":`#00000000`,"footer-description-foreground":`#575279`,"footer-foreground":`#575279`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#D7827E`,foreground:`#575279`,"foreground-darken-1":`#444066`,"foreground-darken-2":`#332F53`,"foreground-darken-3":`#222042`,"foreground-disabled":`#57527960`,"foreground-lighten-1":`#69648C`,"foreground-lighten-2":`#7C76A0`,"foreground-lighten-3":`#9089B4`,"foreground-muted":`#57527999`,"input-cursor-background":`#575279`,"input-cursor-foreground":`#FAF4ED`,"input-selection-background":`#DFDAD9`,"link-background":`#00000000`,"link-background-hover":`#907AA9`,"link-color":`#000000DD`,"link-color-hover":`#000000DD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#907AA9`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#907AA9`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#907AA9`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#575279`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#575279`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#57527999`,panel:`#F2E9E1`,"panel-darken-1":`#DCD3CB`,"panel-darken-2":`#C7BFB7`,"panel-darken-3":`#B3AAA3`,"panel-lighten-1":`#FFFEF6`,"panel-lighten-2":`#FFFFFF`,"panel-lighten-3":`#FFFFFF`,primary:`#907AA9`,"primary-background":`#907AA9`,"primary-background-darken-1":`#7C6795`,"primary-background-darken-2":`#695481`,"primary-background-darken-3":`#56436E`,"primary-background-lighten-1":`#A48DBD`,"primary-background-lighten-2":`#B8A1D2`,"primary-background-lighten-3":`#CDB5E7`,"primary-darken-1":`#7C6795`,"primary-darken-2":`#695481`,"primary-darken-3":`#56436E`,"primary-lighten-1":`#A48DBD`,"primary-lighten-2":`#B8A1D2`,"primary-lighten-3":`#CDB5E7`,"primary-muted":`#DACFD8`,scrollbar:`#C2B6C4`,"scrollbar-active":`#907AA9`,"scrollbar-background":`#E4DED7`,"scrollbar-background-active":`#E4DED7`,"scrollbar-background-hover":`#E4DED7`,"scrollbar-corner-color":`#E4DED7`,"scrollbar-hover":`#BAACC0`,secondary:`#286983`,"secondary-background":`#286983`,"secondary-background-darken-1":`#0A566F`,"secondary-background-darken-2":`#00455D`,"secondary-background-darken-3":`#00344B`,"secondary-background-lighten-1":`#3E7B96`,"secondary-background-lighten-2":`#538FAA`,"secondary-background-lighten-3":`#67A2BE`,"secondary-darken-1":`#0A566F`,"secondary-darken-2":`#00455D`,"secondary-darken-3":`#00344B`,"secondary-lighten-1":`#3E7B96`,"secondary-lighten-2":`#538FAA`,"secondary-lighten-3":`#67A2BE`,"secondary-muted":`#BBCACD`,success:`#56949F`,"success-darken-1":`#41808B`,"success-darken-2":`#2D6D78`,"success-darken-3":`#155B65`,"success-lighten-1":`#6AA7B3`,"success-lighten-2":`#7EBCC7`,"success-lighten-3":`#92D1DC`,"success-muted":`#C8D7D5`,surface:`#FFFAF3`,"surface-active":`#FFFFFF`,"surface-darken-1":`#E9E4DD`,"surface-darken-2":`#D4CFC8`,"surface-darken-3":`#BFBAB4`,"surface-lighten-1":`#FFFFFF`,"surface-lighten-2":`#FFFFFF`,"surface-lighten-3":`#FFFFFF`,text:`#000000DD`,"text-accent":`#8D5553`,"text-disabled":`#00000060`,"text-error":`#764150`,"text-muted":`#00000099`,"text-primary":`#5F506F`,"text-secondary":`#1A4556`,"text-success":`#386168`,"text-warning":`#9A6722`,warning:`#E99D34`,"warning-darken-1":`#D2891D`,"warning-darken-2":`#BC7600`,"warning-darken-3":`#A56300`,"warning-lighten-1":`#FFB148`,"warning-lighten-2":`#FFC55C`,"warning-lighten-3":`#FFDA70`,"warning-muted":`#F5D9B5`}},"rose-pine-moon":{name:`rose-pine-moon`,dark:!0,vars:{accent:`#EA9A97`,"accent-darken-1":`#D48683`,"accent-darken-2":`#BE7270`,"accent-darken-3":`#A95F5E`,"accent-lighten-1":`#FFAEAA`,"accent-lighten-2":`#FFC3BF`,"accent-lighten-3":`#FFD8D4`,"accent-muted":`#5E4553`,background:`#232136`,"background-darken-1":`#131125`,"background-darken-2":`#000017`,"background-darken-3":`#000001`,"background-lighten-1":`#333046`,"background-lighten-2":`#444158`,"background-lighten-3":`#56526A`,"block-cursor-background":`#C4A7E7`,"block-cursor-blurred-background":`#C4A7E74C`,"block-cursor-blurred-foreground":`#E0DEF4`,"block-cursor-foreground":`#232136`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#56526E`,"border-blurred":`#6E6A86`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#E0DEF4`,error:`#EA6F92`,"error-darken-1":`#D45A7E`,"error-darken-2":`#BE466B`,"error-darken-3":`#A83159`,"error-lighten-1":`#FF83A5`,"error-lighten-2":`#FF98BA`,"error-lighten-3":`#FFADCE`,"error-muted":`#5F3851`,"footer-background":`#393552`,"footer-description-background":`#00000000`,"footer-description-foreground":`#E0DEF4`,"footer-foreground":`#E0DEF4`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#EA9A97`,foreground:`#E0DEF4`,"foreground-darken-1":`#CAC9DE`,"foreground-darken-2":`#B6B4C9`,"foreground-darken-3":`#A2A0B4`,"foreground-disabled":`#E0DEF460`,"foreground-lighten-1":`#F5F3FF`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#E0DEF499`,"input-cursor-background":`#F4EDE8`,"input-cursor-foreground":`#232136`,"input-selection-background":`#44415A`,"link-background":`#00000000`,"link-background-hover":`#C4A7E7`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#C4A7E7`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#C4A7E7`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#C4A7E7`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#E0DEF4`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#E0DEF4`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#E0DEF499`,panel:`#393552`,"panel-darken-1":`#282440`,"panel-darken-2":`#17152F`,"panel-darken-3":`#080020`,"panel-lighten-1":`#4A4564`,"panel-lighten-2":`#5C5776`,"panel-lighten-3":`#6F6989`,primary:`#C4A7E7`,"primary-background":`#58536A`,"primary-background-darken-1":`#49445D`,"primary-background-darken-2":`#3B3550`,"primary-background-darken-3":`#3B3550`,"primary-background-lighten-1":`#676277`,"primary-background-lighten-2":`#757184`,"primary-background-lighten-3":`#848091`,"primary-darken-1":`#AF93D1`,"primary-darken-2":`#9A7FBC`,"primary-darken-3":`#866CA8`,"primary-lighten-1":`#D9BBFC`,"primary-lighten-2":`#EED0FF`,"primary-lighten-3":`#FFE5FF`,"primary-muted":`#53496B`,scrollbar:`#594D72`,"scrollbar-active":`#C4A7E7`,"scrollbar-background":`#131125`,"scrollbar-background-active":`#131125`,"scrollbar-background-hover":`#131125`,"scrollbar-corner-color":`#131125`,"scrollbar-hover":`#6B5C86`,secondary:`#3E8FB0`,"secondary-background":`#474F63`,"secondary-background-darken-1":`#374055`,"secondary-background-darken-2":`#273148`,"secondary-background-darken-3":`#273148`,"secondary-background-lighten-1":`#575F71`,"secondary-background-lighten-2":`#676E7E`,"secondary-background-lighten-3":`#787E8C`,"secondary-darken-1":`#237B9B`,"secondary-darken-2":`#006888`,"secondary-darken-3":`#005674`,"secondary-lighten-1":`#54A2C4`,"secondary-lighten-2":`#6AB7D9`,"secondary-lighten-3":`#80CBEE`,"secondary-muted":`#2B425A`,success:`#9CCFD8`,"success-darken-1":`#87BAC3`,"success-darken-2":`#73A5AE`,"success-darken-3":`#60929A`,"success-lighten-1":`#B0E4ED`,"success-lighten-2":`#C5F9FF`,"success-lighten-3":`#DAFFFF`,"success-muted":`#475566`,surface:`#2A273F`,"surface-active":`#37334C`,"surface-darken-1":`#19172E`,"surface-darken-2":`#0A021E`,"surface-darken-3":`#00000F`,"surface-lighten-1":`#3A3750`,"surface-lighten-2":`#4C4862`,"surface-lighten-3":`#5E5975`,text:`#FFFFFFDD`,"text-accent":`#F1BCBA`,"text-disabled":`#FFFFFF60`,"text-error":`#F19FB7`,"text-muted":`#FFFFFF99`,"text-primary":`#D8C4EF`,"text-secondary":`#7FB5CA`,"text-success":`#BDDFE5`,"text-warning":`#F9D6A5`,warning:`#F5C177`,"warning-darken-1":`#DFAC63`,"warning-darken-2":`#C99850`,"warning-darken-3":`#B3853E`,"warning-lighten-1":`#FFD58A`,"warning-lighten-2":`#FFEB9E`,"warning-lighten-3":`#FFFFB3`,"warning-muted":`#625149`}},"solarized-dark":{name:`solarized-dark`,dark:!0,vars:{accent:`#6C71C4`,"accent-darken-1":`#575EAF`,"accent-darken-2":`#424C9A`,"accent-darken-3":`#2D3B87`,"accent-lighten-1":`#8083D9`,"accent-lighten-2":`#9597EE`,"accent-lighten-3":`#AAABFF`,"accent-muted":`#204060`,background:`#002B36`,"background-darken-1":`#001B25`,"background-darken-2":`#000A17`,"background-darken-3":`#000000`,"background-lighten-1":`#143B46`,"background-lighten-2":`#274C58`,"background-lighten-3":`#3A5E6A`,"block-cursor-background":`#268BD2`,"block-cursor-blurred-background":`#268BD24C`,"block-cursor-blurred-foreground":`#839496`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#268BD2`,"border-blurred":`#00303C`,"button-color-foreground":`#FDF6E3`,"button-foreground":`#839496`,error:`#DB322F`,"error-darken-1":`#C3121E`,"error-darken-2":`#AB000D`,"error-darken-3":`#940000`,"error-lighten-1":`#F44940`,"error-lighten-2":`#FF6052`,"error-lighten-3":`#FF7564`,"error-muted":`#422D33`,"footer-background":`#268BD2`,"footer-description-background":`#00000000`,"footer-description-foreground":`#FDF6E3`,"footer-foreground":`#839496`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FDF6E3`,foreground:`#839496`,"foreground-darken-1":`#6F8082`,"foreground-darken-2":`#5D6D6F`,"foreground-darken-3":`#4B5B5D`,"foreground-disabled":`#83949660`,"foreground-lighten-1":`#96A7A9`,"foreground-lighten-2":`#AABCBE`,"foreground-lighten-3":`#BED0D3`,"foreground-muted":`#83949699`,"input-cursor-background":`#839496`,"input-cursor-foreground":`#002B36`,"input-selection-background":`#073642`,"link-background":`#00000000`,"link-background-hover":`#268BD2`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#268BD2`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#268BD2`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#268BD2`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#839496`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#839496`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#83949699`,panel:`#073642`,"panel-darken-1":`#002531`,"panel-darken-2":`#001721`,"panel-darken-3":`#000112`,"panel-lighten-1":`#1D4653`,"panel-lighten-2":`#305865`,"panel-lighten-3":`#436A78`,primary:`#268BD2`,"primary-background":`#2A5667`,"primary-background-darken-1":`#17475A`,"primary-background-darken-2":`#05394D`,"primary-background-darken-3":`#05394D`,"primary-background-lighten-1":`#3D6575`,"primary-background-lighten-2":`#507482`,"primary-background-lighten-3":`#62838F`,"primary-darken-1":`#0077BD`,"primary-darken-2":`#0065A8`,"primary-darken-3":`#005394`,"primary-lighten-1":`#459EE7`,"primary-lighten-2":`#5FB2FD`,"primary-lighten-3":`#77C7FF`,"primary-muted":`#0B4764`,scrollbar:`#0F476A`,"scrollbar-active":`#268BD2`,"scrollbar-background":`#001B25`,"scrollbar-background-active":`#001B25`,"scrollbar-background-hover":`#001B25`,"scrollbar-corner-color":`#001B25`,"scrollbar-hover":`#13537B`,secondary:`#2AA198`,"secondary-background":`#2B5960`,"secondary-background-darken-1":`#184A52`,"secondary-background-darken-2":`#063C44`,"secondary-background-darken-3":`#063C44`,"secondary-background-lighten-1":`#3E676E`,"secondary-background-lighten-2":`#50767C`,"secondary-background-lighten-3":`#63858A`,"secondary-darken-1":`#008C84`,"secondary-darken-2":`#007971`,"secondary-darken-3":`#00665F`,"secondary-lighten-1":`#44B5AB`,"secondary-lighten-2":`#5BCAC0`,"secondary-lighten-3":`#72DFD5`,"secondary-muted":`#0C4E53`,success:`#849900`,"success-darken-1":`#708500`,"success-darken-2":`#5B7200`,"success-darken-3":`#485F00`,"success-lighten-1":`#99AC22`,"success-lighten-2":`#AFC139`,"success-lighten-3":`#C4D64E`,"success-muted":`#274C25`,surface:`#073642`,"surface-active":`#19434F`,"surface-darken-1":`#002531`,"surface-darken-2":`#001721`,"surface-darken-3":`#000112`,"surface-lighten-1":`#1D4653`,"surface-lighten-2":`#305865`,"surface-lighten-3":`#436A78`,text:`#FFFFFFDD`,"text-accent":`#9DA1D8`,"text-disabled":`#FFFFFF60`,"text-error":`#E77775`,"text-muted":`#FFFFFF99`,"text-primary":`#6FB2E1`,"text-secondary":`#72C0BB`,"text-success":`#AEBB56`,"text-warning":`#DC8865`,warning:`#CA4B16`,"warning-darken-1":`#B33600`,"warning-darken-2":`#9C2000`,"warning-darken-3":`#850100`,"warning-lighten-1":`#E25F29`,"warning-lighten-2":`#FA733C`,"warning-lighten-3":`#FF874E`,"warning-muted":`#3C342C`}},"solarized-light":{name:`solarized-light`,dark:!1,vars:{accent:`#6C71C4`,"accent-darken-1":`#575EAF`,"accent-darken-2":`#424C9A`,"accent-darken-3":`#2D3B87`,"accent-lighten-1":`#8083D9`,"accent-lighten-2":`#9597EE`,"accent-lighten-3":`#AAABFF`,"accent-muted":`#D1CED9`,background:`#FDF6E3`,"background-darken-1":`#E7E0CD`,"background-darken-2":`#D2CBB9`,"background-darken-3":`#BDB6A4`,"background-lighten-1":`#FFFFF8`,"background-lighten-2":`#FFFFFF`,"background-lighten-3":`#FFFFFF`,"block-cursor-background":`#268BD2`,"block-cursor-blurred-background":`#268BD24C`,"block-cursor-blurred-foreground":`#586E75`,"block-cursor-foreground":`#000000DD`,"block-hover-background":`#00000019`,boost:`#0000000A`,"boost-darken-1":`#0000000A`,"boost-darken-2":`#0000000A`,"boost-darken-3":`#0000000A`,"boost-lighten-1":`#1616160A`,"boost-lighten-2":`#2525250A`,"boost-lighten-3":`#3535350A`,border:`#268BD2`,"border-blurred":`#E6E0CE`,"button-color-foreground":`#FDF6E3`,"button-foreground":`#586E75`,error:`#DB322F`,"error-darken-1":`#C3121E`,"error-darken-2":`#AB000D`,"error-darken-3":`#940000`,"error-lighten-1":`#F44940`,"error-lighten-2":`#FF6052`,"error-lighten-3":`#FF7564`,"error-muted":`#F3BBAD`,"footer-background":`#268BD2`,"footer-description-background":`#00000000`,"footer-description-foreground":`#FDF6E3`,"footer-foreground":`#586E75`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FDF6E3`,foreground:`#586E75`,"foreground-darken-1":`#465B62`,"foreground-darken-2":`#344950`,"foreground-darken-3":`#23383F`,"foreground-disabled":`#586E7560`,"foreground-lighten-1":`#6A8088`,"foreground-lighten-2":`#7D949B`,"foreground-lighten-3":`#91A8AF`,"foreground-muted":`#586E7599`,"input-cursor-background":`#586E75`,"input-cursor-foreground":`#FDF6E3`,"input-selection-background":`#459EE766`,"link-background":`#00000000`,"link-background-hover":`#268BD2`,"link-color":`#000000DD`,"link-color-hover":`#000000DD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#268BD2`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#268BD2`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#268BD2`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#586E75`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#586E75`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#586E7599`,panel:`#EEE8D5`,"panel-darken-1":`#D8D2C0`,"panel-darken-2":`#C3BEAB`,"panel-darken-3":`#AFA997`,"panel-lighten-1":`#FFFDEA`,"panel-lighten-2":`#FFFFFF`,"panel-lighten-3":`#FFFFFF`,primary:`#268BD2`,"primary-background":`#268BD2`,"primary-background-darken-1":`#0077BD`,"primary-background-darken-2":`#0065A8`,"primary-background-darken-3":`#005394`,"primary-background-lighten-1":`#459EE7`,"primary-background-lighten-2":`#5FB2FD`,"primary-background-lighten-3":`#77C7FF`,"primary-darken-1":`#0077BD`,"primary-darken-2":`#0065A8`,"primary-darken-3":`#005394`,"primary-lighten-1":`#459EE7`,"primary-lighten-2":`#5FB2FD`,"primary-lighten-3":`#77C7FF`,"primary-muted":`#BCD5DD`,scrollbar:`#99BECF`,"scrollbar-active":`#268BD2`,"scrollbar-background":`#E7E0CD`,"scrollbar-background-active":`#E7E0CD`,"scrollbar-background-hover":`#E7E0CD`,"scrollbar-corner-color":`#E7E0CD`,"scrollbar-hover":`#86B5CF`,secondary:`#2AA198`,"secondary-background":`#2AA198`,"secondary-background-darken-1":`#008C84`,"secondary-background-darken-2":`#007971`,"secondary-background-darken-3":`#00665F`,"secondary-background-lighten-1":`#44B5AB`,"secondary-background-lighten-2":`#5BCAC0`,"secondary-background-lighten-3":`#72DFD5`,"secondary-darken-1":`#008C84`,"secondary-darken-2":`#007971`,"secondary-darken-3":`#00665F`,"secondary-lighten-1":`#44B5AB`,"secondary-lighten-2":`#5BCAC0`,"secondary-lighten-3":`#72DFD5`,"secondary-muted":`#BDDCCC`,success:`#849900`,"success-darken-1":`#708500`,"success-darken-2":`#5B7200`,"success-darken-3":`#485F00`,"success-lighten-1":`#99AC22`,"success-lighten-2":`#AFC139`,"success-lighten-3":`#C4D64E`,"success-muted":`#D9DA9E`,surface:`#EEE8D5`,"surface-active":`#FFF9E5`,"surface-darken-1":`#D8D2C0`,"surface-darken-2":`#C3BEAB`,"surface-darken-3":`#AFA997`,"surface-lighten-1":`#FFFDEA`,"surface-lighten-2":`#FFFFFF`,"surface-lighten-3":`#FFFFFF`,text:`#000000DD`,"text-accent":`#474A81`,"text-disabled":`#00000060`,"text-error":`#91211F`,"text-muted":`#00000099`,"text-primary":`#195B8A`,"text-secondary":`#1B6A64`,"text-success":`#576400`,"text-warning":`#85310E`,warning:`#CA4B16`,"warning-darken-1":`#B33600`,"warning-darken-2":`#9C2000`,"warning-darken-3":`#850100`,"warning-lighten-1":`#E25F29`,"warning-lighten-2":`#FA733C`,"warning-lighten-3":`#FF874E`,"warning-muted":`#EEC2A5`}},"svg-export":{name:`svg-export`,dark:!0,vars:{accent:`#56B6C2`,"accent-darken-1":`#3EA1AD`,"accent-darken-2":`#238D99`,"accent-darken-3":`#007A85`,"accent-lighten-1":`#6CCAD6`,"accent-lighten-2":`#81DFEC`,"accent-lighten-3":`#97F5FF`,"accent-muted":`#365356`,background:`#292929`,"background-darken-1":`#191919`,"background-darken-2":`#050505`,"background-darken-3":`#000000`,"background-lighten-1":`#393939`,"background-lighten-2":`#4A4A4A`,"background-lighten-3":`#5C5C5C`,"block-cursor-background":`#61AFEF`,"block-cursor-blurred-background":`#61AFEF4C`,"block-cursor-blurred-foreground":`#C5C8C6`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#61AFEF`,"border-blurred":`#191919`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#C5C8C6`,error:`#CB555A`,"error-darken-1":`#B54048`,"error-darken-2":`#9F2C37`,"error-darken-3":`#891427`,"error-lighten-1":`#E2686C`,"error-lighten-2":`#F97D7F`,"error-lighten-3":`#FF9192`,"error-muted":`#593637`,"footer-background":`#2C343A`,"footer-description-background":`#00000000`,"footer-description-foreground":`#C5C8C6`,"footer-foreground":`#C5C8C6`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#56B6C2`,foreground:`#C5C8C6`,"foreground-darken-1":`#B0B3B1`,"foreground-darken-2":`#9C9F9D`,"foreground-darken-3":`#888B89`,"foreground-disabled":`#C5C8C660`,"foreground-lighten-1":`#D9DCDA`,"foreground-lighten-2":`#EFF2F0`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#C5C8C699`,"input-cursor-background":`#C5C8C6`,"input-cursor-foreground":`#292929`,"input-selection-background":`#77C3FF66`,"link-background":`#00000000`,"link-background-hover":`#61AFEF`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#61AFEF`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#61AFEF`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#61AFEF`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#C5C8C6`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#C5C8C6`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#C5C8C699`,panel:`#2C343A`,"panel-darken-1":`#1C2429`,"panel-darken-2":`#0C141A`,"panel-darken-3":`#000007`,"panel-lighten-1":`#3C444B`,"panel-lighten-2":`#4D565C`,"panel-lighten-3":`#5F686F`,primary:`#61AFEF`,"primary-background":`#4F5A61`,"primary-background-darken-1":`#404B53`,"primary-background-darken-2":`#313D46`,"primary-background-darken-3":`#313D46`,"primary-background-lighten-1":`#5F686F`,"primary-background-lighten-2":`#6E777D`,"primary-background-lighten-3":`#7E858B`,"primary-darken-1":`#489BD9`,"primary-darken-2":`#2C87C4`,"primary-darken-3":`#0074AF`,"primary-lighten-1":`#77C3FF`,"primary-lighten-2":`#8ED8FF`,"primary-lighten-3":`#A4EDFF`,"primary-muted":`#395164`,scrollbar:`#35556E`,"scrollbar-active":`#61AFEF`,"scrollbar-background":`#191919`,"scrollbar-background-active":`#191919`,"scrollbar-background-hover":`#191919`,"scrollbar-corner-color":`#191919`,"scrollbar-hover":`#3D6484`,secondary:`#C678DD`,"secondary-background":`#5C5260`,"secondary-background-darken-1":`#4E4352`,"secondary-background-darken-2":`#403444`,"secondary-background-darken-3":`#403444`,"secondary-background-lighten-1":`#6A616E`,"secondary-background-lighten-2":`#79707C`,"secondary-background-lighten-3":`#87808A`,"secondary-darken-1":`#B064C7`,"secondary-darken-2":`#9B50B3`,"secondary-darken-3":`#873D9E`,"secondary-lighten-1":`#DB8CF2`,"secondary-lighten-2":`#F1A0FF`,"secondary-lighten-3":`#FFB5FF`,"secondary-muted":`#58405F`,success:`#98C379`,"success-darken-1":`#83AE65`,"success-darken-2":`#709A53`,"success-darken-3":`#5C8641`,"success-lighten-1":`#ACD78C`,"success-lighten-2":`#C1EDA0`,"success-lighten-3":`#D6FFB4`,"success-muted":`#4A5741`,surface:`#1E1E1E`,"surface-active":`#2A2A2A`,"surface-darken-1":`#0D0D0D`,"surface-darken-2":`#000000`,"surface-darken-3":`#000000`,"surface-lighten-1":`#2D2D2D`,"surface-lighten-2":`#3E3E3E`,"surface-lighten-3":`#4F4F4F`,text:`#FFFFFFDD`,"text-accent":`#8FCED6`,"text-disabled":`#FFFFFF60`,"text-error":`#DD8E92`,"text-muted":`#FFFFFF99`,"text-primary":`#96CAF4`,"text-secondary":`#D9A5E8`,"text-success":`#BBD7A6`,"text-warning":`#EDD5A7`,warning:`#E4C07B`,"warning-darken-1":`#CFAB67`,"warning-darken-2":`#B99754`,"warning-darken-3":`#A48442`,"warning-lighten-1":`#FBD48E`,"warning-lighten-2":`#FFE9A2`,"warning-lighten-3":`#FFFFB7`,"warning-muted":`#615641`}},"textual-ansi":{name:`textual-ansi`,dark:!0,vars:{accent:`#0000FF`,"accent-darken-1":`#0000FF`,"accent-darken-2":`#0000FF`,"accent-darken-3":`#0000FF`,"accent-lighten-1":`#0000FF`,"accent-lighten-2":`#0000FF`,"accent-lighten-3":`#0000FF`,"accent-muted":`#0178D4`,background:`#121212`,"background-darken-1":`#121212`,"background-darken-2":`#121212`,"background-darken-3":`#121212`,"background-lighten-1":`#121212`,"background-lighten-2":`#121212`,"background-lighten-3":`#121212`,"block-cursor-background":`#000080`,"block-cursor-blurred-background":`#0000804C`,"block-cursor-blurred-foreground":`#E0E0E0`,"block-cursor-foreground":`#E0E0E0`,"block-hover-background":`#00000019`,boost:`#0178D4`,"boost-darken-1":`#0178D4`,"boost-darken-2":`#0178D4`,"boost-darken-3":`#0178D4`,"boost-lighten-1":`#0178D4`,"boost-lighten-2":`#0178D4`,"boost-lighten-3":`#0178D4`,border:`#0000FF`,"border-blurred":`#000080`,"button-color-foreground":`#E0E0E0`,"button-foreground":`#E0E0E0`,error:`#800000`,"error-darken-1":`#800000`,"error-darken-2":`#800000`,"error-darken-3":`#800000`,"error-lighten-1":`#800000`,"error-lighten-2":`#800000`,"error-lighten-3":`#800000`,"error-muted":`#0178D4`,"footer-background":`#121212`,"footer-description-background":`#00000000`,"footer-description-foreground":`#E0E0E0`,"footer-foreground":`#E0E0E0`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#0000FF`,foreground:`#E0E0E0`,"foreground-darken-1":`#E0E0E0`,"foreground-darken-2":`#E0E0E0`,"foreground-darken-3":`#E0E0E0`,"foreground-disabled":`#00000060`,"foreground-lighten-1":`#E0E0E0`,"foreground-lighten-2":`#E0E0E0`,"foreground-lighten-3":`#E0E0E0`,"foreground-muted":`#00000099`,"input-cursor-background":`#121212`,"input-cursor-foreground":`#E0E0E0`,"input-selection-background":`#000080`,"link-background":`#00000000`,"link-background-hover":`#000080`,"link-color":`#E0E0E0`,"link-color-hover":`#0178D4`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#000080`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#000080`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#000080`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#E0E0E0`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#E0E0E0`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#00000099`,panel:`#121212`,"panel-darken-1":`#121212`,"panel-darken-2":`#121212`,"panel-darken-3":`#121212`,"panel-lighten-1":`#121212`,"panel-lighten-2":`#121212`,"panel-lighten-3":`#121212`,primary:`#000080`,"primary-background":`#000080`,"primary-background-darken-1":`#000080`,"primary-background-darken-2":`#000080`,"primary-background-darken-3":`#000080`,"primary-background-lighten-1":`#000080`,"primary-background-lighten-2":`#000080`,"primary-background-lighten-3":`#000080`,"primary-darken-1":`#000080`,"primary-darken-2":`#000080`,"primary-darken-3":`#000080`,"primary-lighten-1":`#000080`,"primary-lighten-2":`#000080`,"primary-lighten-3":`#000080`,"primary-muted":`#0178D4`,scrollbar:`#000080`,"scrollbar-active":`#000080`,"scrollbar-background":`#121212`,"scrollbar-background-active":`#121212`,"scrollbar-background-hover":`#121212`,"scrollbar-corner-color":`#E0E0E0`,"scrollbar-hover":`#000040`,secondary:`#008080`,"secondary-background":`#008080`,"secondary-background-darken-1":`#008080`,"secondary-background-darken-2":`#008080`,"secondary-background-darken-3":`#008080`,"secondary-background-lighten-1":`#008080`,"secondary-background-lighten-2":`#008080`,"secondary-background-lighten-3":`#008080`,"secondary-darken-1":`#008080`,"secondary-darken-2":`#008080`,"secondary-darken-3":`#008080`,"secondary-lighten-1":`#008080`,"secondary-lighten-2":`#008080`,"secondary-lighten-3":`#008080`,"secondary-muted":`#0178D4`,success:`#008000`,"success-darken-1":`#008000`,"success-darken-2":`#008000`,"success-darken-3":`#008000`,"success-lighten-1":`#008000`,"success-lighten-2":`#008000`,"success-lighten-3":`#008000`,"success-muted":`#0178D4`,surface:`#121212`,"surface-active":`#131313`,"surface-darken-1":`#121212`,"surface-darken-2":`#121212`,"surface-darken-3":`#121212`,"surface-lighten-1":`#121212`,"surface-lighten-2":`#121212`,"surface-lighten-3":`#121212`,text:`#E0E0E0`,"text-accent":`#5656FF`,"text-disabled":`#E0E0E0`,"text-error":`#AB5656`,"text-muted":`#E0E0E0`,"text-primary":`#5656AB`,"text-secondary":`#56ABAB`,"text-success":`#56AB56`,"text-warning":`#ABAB56`,warning:`#808000`,"warning-darken-1":`#808000`,"warning-darken-2":`#808000`,"warning-darken-3":`#808000`,"warning-lighten-1":`#808000`,"warning-lighten-2":`#808000`,"warning-lighten-3":`#808000`,"warning-muted":`#0178D4`}},"textual-dark":{name:`textual-dark`,dark:!0,vars:{accent:`#FEA62B`,"accent-darken-1":`#E7920D`,"accent-darken-2":`#CF7E00`,"accent-darken-3":`#B86B00`,"accent-lighten-1":`#FFBA41`,"accent-lighten-2":`#FFCF56`,"accent-lighten-3":`#FFE46B`,"accent-muted":`#593E19`,background:`#121212`,"background-darken-1":`#000000`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#212121`,"background-lighten-2":`#313131`,"background-lighten-3":`#414141`,"block-cursor-background":`#0178D4`,"block-cursor-blurred-background":`#0178D44C`,"block-cursor-blurred-foreground":`#E0E0E0`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#0178D4`,"border-blurred":`#191919`,"button-color-foreground":`#FFFFFFDD`,"button-foreground":`#E0E0E0`,error:`#B93C5B`,"error-darken-1":`#A32549`,"error-darken-2":`#8D0638`,"error-darken-3":`#780028`,"error-lighten-1":`#D0506D`,"error-lighten-2":`#E76580`,"error-lighten-3":`#FE7993`,"error-muted":`#441E27`,"footer-background":`#242F38`,"footer-description-background":`#00000000`,"footer-description-foreground":`#E0E0E0`,"footer-foreground":`#E0E0E0`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FFA62B`,foreground:`#E0E0E0`,"foreground-darken-1":`#CACACA`,"foreground-darken-2":`#B6B6B6`,"foreground-darken-3":`#A2A2A2`,"foreground-disabled":`#E0E0E060`,"foreground-lighten-1":`#F5F5F5`,"foreground-lighten-2":`#FFFFFF`,"foreground-lighten-3":`#FFFFFF`,"foreground-muted":`#E0E0E099`,"input-cursor-background":`#E0E0E0`,"input-cursor-foreground":`#121212`,"input-selection-background":`#368AE966`,"link-background":`#00000000`,"link-background-hover":`#0178D4`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#0178D4`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#0178D4`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#0178D4`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#E0E0E0`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#E0E0E0`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#E0E0E099`,panel:`#242F38`,"panel-darken-1":`#141F27`,"panel-darken-2":`#000F18`,"panel-darken-3":`#000003`,"panel-lighten-1":`#343F49`,"panel-lighten-2":`#45505A`,"panel-lighten-3":`#57626D`,primary:`#0178D4`,"primary-background":`#33424E`,"primary-background-darken-1":`#21313E`,"primary-background-darken-2":`#0F212F`,"primary-background-darken-3":`#0F212F`,"primary-background-lighten-1":`#45525D`,"primary-background-lighten-2":`#57636D`,"primary-background-lighten-3":`#69747D`,"primary-darken-1":`#0065BE`,"primary-darken-2":`#0053AA`,"primary-darken-3":`#004295`,"primary-lighten-1":`#368AE9`,"primary-lighten-2":`#539EFF`,"primary-lighten-3":`#6DB2FF`,"primary-muted":`#0C304C`,scrollbar:`#003054`,"scrollbar-active":`#0178D4`,"scrollbar-background":`#000000`,"scrollbar-background-active":`#000000`,"scrollbar-background-hover":`#000000`,"scrollbar-corner-color":`#000000`,"scrollbar-hover":`#003C6A`,secondary:`#004578`,"secondary-background":`#333B42`,"secondary-background-darken-1":`#212A31`,"secondary-background-darken-2":`#0F1921`,"secondary-background-darken-3":`#0F1921`,"secondary-background-lighten-1":`#454C52`,"secondary-background-lighten-2":`#575E63`,"secondary-background-lighten-3":`#696F74`,"secondary-darken-1":`#003465`,"secondary-darken-2":`#002452`,"secondary-darken-3":`#001541`,"secondary-lighten-1":`#23568B`,"secondary-lighten-2":`#3B689F`,"secondary-lighten-3":`#507BB3`,"secondary-muted":`#0C2130`,success:`#4EBF71`,"success-darken-1":`#36AA5E`,"success-darken-2":`#18954B`,"success-darken-3":`#008139`,"success-lighten-1":`#64D484`,"success-lighten-2":`#7AE998`,"success-lighten-3":`#8FFFAC`,"success-muted":`#24452E`,surface:`#1E1E1E`,"surface-active":`#2A2A2A`,"surface-darken-1":`#0D0D0D`,"surface-darken-2":`#000000`,"surface-darken-3":`#000000`,"surface-lighten-1":`#2D2D2D`,"surface-lighten-2":`#3E3E3E`,"surface-lighten-3":`#4F4F4F`,text:`#FFFFFFDD`,"text-accent":`#FFC473`,"text-disabled":`#FFFFFF60`,"text-error":`#D17E92`,"text-muted":`#FFFFFF99`,"text-primary":`#57A5E2`,"text-secondary":`#5684A5`,"text-success":`#8AD4A1`,"text-warning":`#FFC473`,warning:`#FEA62B`,"warning-darken-1":`#E7920D`,"warning-darken-2":`#CF7E00`,"warning-darken-3":`#B86B00`,"warning-lighten-1":`#FFBA41`,"warning-lighten-2":`#FFCF56`,"warning-lighten-3":`#FFE46B`,"warning-muted":`#593E19`}},"textual-light":{name:`textual-light`,dark:!1,vars:{accent:`#FEA62B`,"accent-darken-1":`#E7920D`,"accent-darken-2":`#CF7E00`,"accent-darken-3":`#B86B00`,"accent-lighten-1":`#FFBA41`,"accent-lighten-2":`#FFCF56`,"accent-lighten-3":`#FFE46B`,"accent-muted":`#E9CEA9`,background:`#E0E0E0`,"background-darken-1":`#CACACA`,"background-darken-2":`#B6B6B6`,"background-darken-3":`#A2A2A2`,"background-lighten-1":`#F5F5F5`,"background-lighten-2":`#FFFFFF`,"background-lighten-3":`#FFFFFF`,"block-cursor-background":`#004578`,"block-cursor-blurred-background":`#0045784C`,"block-cursor-blurred-foreground":`#1F1F1F`,"block-cursor-foreground":`#000000DD`,"block-hover-background":`#00000019`,boost:`#0000000A`,"boost-darken-1":`#0000000A`,"boost-darken-2":`#0000000A`,"boost-darken-3":`#0000000A`,"boost-lighten-1":`#1616160A`,"boost-lighten-2":`#2525250A`,"boost-lighten-3":`#3535350A`,border:`#004578`,"border-blurred":`#D0D1D0`,"button-color-foreground":`#000000DD`,"button-foreground":`#1F1F1F`,error:`#B93C5B`,"error-darken-1":`#A32549`,"error-darken-2":`#8D0638`,"error-darken-3":`#780028`,"error-lighten-1":`#D0506D`,"error-lighten-2":`#E76580`,"error-lighten-3":`#FE7993`,"error-muted":`#D4AEB8`,"footer-background":`#D0D0D0`,"footer-description-background":`#00000000`,"footer-description-foreground":`#1F1F1F`,"footer-foreground":`#1F1F1F`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#0178D4`,foreground:`#1F1F1F`,"foreground-darken-1":`#0E0E0E`,"foreground-darken-2":`#000000`,"foreground-darken-3":`#000000`,"foreground-disabled":`#1F1F1F60`,"foreground-lighten-1":`#2E2E2E`,"foreground-lighten-2":`#3F3F3F`,"foreground-lighten-3":`#505050`,"foreground-muted":`#1F1F1F99`,"input-cursor-background":`#1F1F1F`,"input-cursor-foreground":`#E0E0E0`,"input-selection-background":`#23568B66`,"link-background":`#00000000`,"link-background-hover":`#004578`,"link-color":`#000000DD`,"link-color-hover":`#000000DD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#004578`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#004578`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#004578`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#1F1F1F`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#1F1F1F`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#1F1F1F99`,panel:`#D0D0D0`,"panel-darken-1":`#BBBBBB`,"panel-darken-2":`#A6A6A6`,"panel-darken-3":`#939393`,"panel-lighten-1":`#E5E5E5`,"panel-lighten-2":`#FAFAFA`,"panel-lighten-3":`#FFFFFF`,primary:`#004578`,"primary-background":`#004578`,"primary-background-darken-1":`#003465`,"primary-background-darken-2":`#002452`,"primary-background-darken-3":`#001541`,"primary-background-lighten-1":`#23568B`,"primary-background-lighten-2":`#3B689F`,"primary-background-lighten-3":`#507BB3`,"primary-darken-1":`#003465`,"primary-darken-2":`#002452`,"primary-darken-3":`#001541`,"primary-lighten-1":`#23568B`,"primary-lighten-2":`#3B689F`,"primary-lighten-3":`#507BB3`,"primary-muted":`#9CB1C0`,scrollbar:`#7994A9`,"scrollbar-active":`#004578`,"scrollbar-background":`#CACACA`,"scrollbar-background-active":`#CACACA`,"scrollbar-background-hover":`#CACACA`,"scrollbar-corner-color":`#CACACA`,"scrollbar-hover":`#6587A1`,secondary:`#0178D4`,"secondary-background":`#0178D4`,"secondary-background-darken-1":`#0065BE`,"secondary-background-darken-2":`#0053AA`,"secondary-background-darken-3":`#004295`,"secondary-background-lighten-1":`#368AE9`,"secondary-background-lighten-2":`#539EFF`,"secondary-background-lighten-3":`#6DB2FF`,"secondary-darken-1":`#0065BE`,"secondary-darken-2":`#0053AA`,"secondary-darken-3":`#004295`,"secondary-lighten-1":`#368AE9`,"secondary-lighten-2":`#539EFF`,"secondary-lighten-3":`#6DB2FF`,"secondary-muted":`#9DC0DC`,success:`#4EBF71`,"success-darken-1":`#36AA5E`,"success-darken-2":`#18954B`,"success-darken-3":`#008139`,"success-lighten-1":`#64D484`,"success-lighten-2":`#7AE998`,"success-lighten-3":`#8FFFAC`,"success-muted":`#B4D6BE`,surface:`#D8D8D8`,"surface-active":`#E8E8E8`,"surface-darken-1":`#C3C3C3`,"surface-darken-2":`#AEAEAE`,"surface-darken-3":`#9A9A9A`,"surface-lighten-1":`#EDEDED`,"surface-lighten-2":`#FFFFFF`,"surface-lighten-3":`#FFFFFF`,text:`#000000DD`,"text-accent":`#A86D1C`,"text-disabled":`#00000060`,"text-error":`#7A273C`,"text-muted":`#00000099`,"text-primary":`#002D4F`,"text-secondary":`#004F8B`,"text-success":`#337E4A`,"text-warning":`#A86D1C`,warning:`#FEA62B`,"warning-darken-1":`#E7920D`,"warning-darken-2":`#CF7E00`,"warning-darken-3":`#B86B00`,"warning-lighten-1":`#FFBA41`,"warning-lighten-2":`#FFCF56`,"warning-lighten-3":`#FFE46B`,"warning-muted":`#E9CEA9`}},"tokyo-night":{name:`tokyo-night`,dark:!0,vars:{accent:`#FE9E64`,"accent-darken-1":`#E78A51`,"accent-darken-2":`#D0763E`,"accent-darken-3":`#BA632C`,"accent-lighten-1":`#FFB277`,"accent-lighten-2":`#FFC78A`,"accent-lighten-3":`#FFDC9E`,"accent-muted":`#5E4238`,background:`#1A1B26`,"background-darken-1":`#070817`,"background-darken-2":`#000000`,"background-darken-3":`#000000`,"background-lighten-1":`#292A36`,"background-lighten-2":`#3A3A47`,"background-lighten-3":`#4B4B58`,"block-cursor-background":`#BB9AF7`,"block-cursor-blurred-background":`#BB9AF74C`,"block-cursor-blurred-foreground":`#A9B1D6`,"block-cursor-foreground":`#FFFFFFDD`,"block-hover-background":`#FFFFFF19`,boost:`#FFFFFF0A`,"boost-darken-1":`#E9E9E90A`,"boost-darken-2":`#D4D4D40A`,"boost-darken-3":`#BFBFBF0A`,"boost-lighten-1":`#FFFFFF0A`,"boost-lighten-2":`#FFFFFF0A`,"boost-lighten-3":`#FFFFFF0A`,border:`#BB9AF7`,"border-blurred":`#1E2235`,"button-color-foreground":`#24283B`,"button-foreground":`#A9B1D6`,error:`#F6768E`,"error-darken-1":`#E0617A`,"error-darken-2":`#C94D68`,"error-darken-3":`#B33856`,"error-lighten-1":`#FF8AA1`,"error-lighten-2":`#FF9FB5`,"error-lighten-3":`#FFB4CA`,"error-muted":`#5C3645`,"footer-background":`#414868`,"footer-description-background":`#00000000`,"footer-description-foreground":`#A9B1D6`,"footer-foreground":`#A9B1D6`,"footer-item-background":`#00000000`,"footer-key-background":`#00000000`,"footer-key-foreground":`#FF9E64`,foreground:`#A9B1D6`,"foreground-darken-1":`#949CC1`,"foreground-darken-2":`#8189AC`,"foreground-darken-3":`#6D7698`,"foreground-disabled":`#A9B1D660`,"foreground-lighten-1":`#BDC5EB`,"foreground-lighten-2":`#D2DAFF`,"foreground-lighten-3":`#E7EFFF`,"foreground-muted":`#A9B1D699`,"input-cursor-background":`#A9B1D6`,"input-cursor-foreground":`#1A1B26`,"input-selection-background":`#D0AEFF66`,"link-background":`#00000000`,"link-background-hover":`#BB9AF7`,"link-color":`#FFFFFFDD`,"link-color-hover":`#FFFFFFDD`,"markdown-h1-background":`#00000000`,"markdown-h1-color":`#BB9AF7`,"markdown-h2-background":`#00000000`,"markdown-h2-color":`#BB9AF7`,"markdown-h3-background":`#00000000`,"markdown-h3-color":`#BB9AF7`,"markdown-h4-background":`#00000000`,"markdown-h4-color":`#A9B1D6`,"markdown-h5-background":`#00000000`,"markdown-h5-color":`#A9B1D6`,"markdown-h6-background":`#00000000`,"markdown-h6-color":`#A9B1D699`,panel:`#414868`,"panel-darken-1":`#2F3755`,"panel-darken-2":`#1E2744`,"panel-darken-3":`#0C1733`,"panel-lighten-1":`#53597A`,"panel-lighten-2":`#656B8E`,"panel-lighten-3":`#787EA1`,primary:`#BB9AF7`,"primary-background":`#504D60`,"primary-background-darken-1":`#413D52`,"primary-background-darken-2":`#322E45`,"primary-background-darken-3":`#322E45`,"primary-background-lighten-1":`#605D6E`,"primary-background-lighten-2":`#6F6C7C`,"primary-background-lighten-3":`#7E7C8A`,"primary-darken-1":`#A686E1`,"primary-darken-2":`#9173CC`,"primary-darken-3":`#7D60B7`,"primary-lighten-1":`#D0AEFF`,"primary-lighten-2":`#E5C2FF`,"primary-lighten-3":`#FBD7FF`,"primary-muted":`#4A4164`,scrollbar:`#4F4270`,"scrollbar-active":`#BB9AF7`,"scrollbar-background":`#070817`,"scrollbar-background-active":`#070817`,"scrollbar-background-hover":`#070817`,"scrollbar-corner-color":`#070817`,"scrollbar-hover":`#615187`,secondary:`#7AA2F7`,"secondary-background":`#484E60`,"secondary-background-darken-1":`#383E52`,"secondary-background-darken-2":`#282F45`,"secondary-background-darken-3":`#282F45`,"secondary-background-lighten-1":`#585D6E`,"secondary-background-lighten-2":`#686D7C`,"secondary-background-lighten-3":`#787D8A`,"secondary-darken-1":`#648EE1`,"secondary-darken-2":`#4D7BCC`,"secondary-darken-3":`#3468B7`,"secondary-lighten-1":`#8FB6FF`,"secondary-lighten-2":`#A5CAFF`,"secondary-lighten-3":`#BBDFFF`,"secondary-muted":`#364364`,success:`#9ECE6A`,"success-darken-1":`#89B956`,"success-darken-2":`#75A443`,"success-darken-3":`#619030`,"success-lighten-1":`#B2E37D`,"success-lighten-2":`#C8F891`,"success-lighten-3":`#DDFFA6`,"success-muted":`#41503A`,surface:`#24283B`,"surface-active":`#313448`,"surface-darken-1":`#14182A`,"surface-darken-2":`#00031B`,"surface-darken-3":`#000009`,"surface-lighten-1":`#34384C`,"surface-lighten-2":`#45495E`,"surface-lighten-3":`#575A70`,text:`#FFFFFFDD`,"text-accent":`#FFBE98`,"text-disabled":`#FFFFFF60`,"text-error":`#F9A4B4`,"text-muted":`#FFFFFF99`,"text-primary":`#D2BCF9`,"text-secondary":`#A7C1F9`,"text-success":`#BEDE9C`,"text-warning":`#EACA9B`,warning:`#DFAF68`,"warning-darken-1":`#C99A55`,"warning-darken-2":`#B48742`,"warning-darken-3":`#9E7430`,"warning-lighten-1":`#F6C37B`,"warning-lighten-2":`#FFD88F`,"warning-lighten-3":`#FFEDA3`,"warning-muted":`#554739`}}},zi=Object.freeze(Object.keys(Ri).sort()),Bi=new Map;function Vi(){return zi}function Hi(e){if(!Ui(e))return null;let t=Bi.get(e);if(t!==void 0)return t;let n=Gi(Ri[e]);return Bi.set(e,n),n}function Ui(e){return Object.hasOwn(Ri,e)}function K(e){let t=Ri[e];return{name:t.name,dark:t.dark,bg:Wi(t,`background`),fg:Wi(t,`foreground`),primary:Wi(t,`primary`),secondary:Wi(t,`secondary`),accent:Wi(t,`accent`),success:Wi(t,`success`),warning:Wi(t,`warning`),error:Wi(t,`error`)}}function Wi(e,t){let n=e.vars[t];if(n===void 0)throw Error(`Theme ${e.name}: required base var "${t}" missing from data file`);return qi(n,e.name,t)}function Gi(e){let t=new Map;for(let[n,r]of Object.entries(e.vars))t.set(n,qi(r,e.name,n));return new Kr(e.name,e.dark,t)}const Ki=/^[0-9a-fA-F]+$/;function qi(e,t,n){let r=e.startsWith(`#`)?e.slice(1):e;if(r.length!==6&&r.length!==8||!Ki.test(r))throw Error(`Theme ${t}: var ${n} has invalid hex ${JSON.stringify(e)} (expected #RRGGBB or #RRGGBBAA)`);return r.length===6?oi(r):si(r)}function q(e){return new li(e.bg,e.fg,pi,Li(e.name,e.dark,{primary:e.primary,secondary:e.secondary,accent:e.accent,success:e.success,warning:e.warning,error:e.error,background:e.bg,foreground:e.fg}))}const Ji=q(K(`default`));q(K(`svg-export`)),q(K(`monokai`)),q(K(`nord`)),q(K(`gruvbox`)),q(K(`dracula`)),q(K(`tokyo-night`)),q(K(`flexoki`)),q(K(`cyberpunk`)),q(K(`catppuccin-mocha`)),q(K(`catppuccin-latte`)),q(K(`catppuccin-frappe`)),q(K(`catppuccin-macchiato`)),q(K(`solarized-dark`)),q(K(`solarized-light`)),q(K(`rose-pine`)),q(K(`rose-pine-moon`)),q(K(`rose-pine-dawn`)),q(K(`atom-one-dark`)),q(K(`atom-one-light`)),q(K(`textual-dark`)),q(K(`textual-light`)),q(K(`textual-ansi`));const Yi=new Set([`error`,`success`,`warning`]);function Xi(e){let t=e.indexOf(`-`);return t===-1?e:e.slice(0,t)}function Zi(e){return Yi.has(Xi(e))}function Qi(e,t,n){if(_i(t))return new Kr(n??e.name,e.dark,e.vars);let r={...t,hueShift:0},i=new Map;for(let[n,a]of e.vars){let e=Zi(n)?r:t;i.set(n,wi.fromRgba(a).applyKey(e).toRgba())}let a=i.get(`background`);if(a===void 0)throw Error(`transposePalette: palette "${e.name}" has no "background" var; cannot derive the dark flag without a background color.`);let o=wi.fromRgba(a).l<.5;return new Kr(n??e.name,o,i)}const $i=/[\x1b\x07\x9c]/g;function ea(e){return e.replace($i,``)}const ta=new H(0,0,0),na=[`bold`,`dim`,`italic`,`underline`,`blink`,`blink2`,`reverse`,`conceal`,`strike`,`underline2`,`frame`,`encircle`,`overline`],ra={bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],blink:[5,25],blink2:[6,25],reverse:[7,27],conceal:[8,28],strike:[9,29],underline2:[21,24],frame:[51,54],encircle:[52,54],overline:[53,55]},ia={b:`bold`,d:`dim`,i:`italic`,u:`underline`,s:`strike`,r:`reverse`,o:`overline`,uu:`underline2`};var aa=class extends Error{constructor(e){super(e),this.name=`StyleSyntaxError`}};const oa=new Map;var J=class e{color;bgcolor;bold;dim;italic;underline;blink;blink2;reverse;conceal;strike;underline2;frame;encircle;overline;link;meta;constructor(e){if(!e){this.color=void 0,this.bgcolor=void 0,this.bold=void 0,this.dim=void 0,this.italic=void 0,this.underline=void 0,this.blink=void 0,this.blink2=void 0,this.reverse=void 0,this.conceal=void 0,this.strike=void 0,this.underline2=void 0,this.frame=void 0,this.encircle=void 0,this.overline=void 0,this.link=void 0,this.meta=void 0;return}this.color=ua(e.color),this.bgcolor=ua(e.bgcolor),this.bold=e.bold,this.dim=e.dim,this.italic=e.italic,this.underline=e.underline,this.blink=e.blink,this.blink2=e.blink2,this.reverse=e.reverse,this.conceal=e.conceal,this.strike=e.strike,this.underline2=e.underline2,this.frame=e.frame,this.encircle=e.encircle,this.overline=e.overline,this.link=e.link,this.meta=e.meta}get isNull(){return this.color===void 0&&this.bgcolor===void 0&&this.bold===void 0&&this.dim===void 0&&this.italic===void 0&&this.underline===void 0&&this.blink===void 0&&this.blink2===void 0&&this.reverse===void 0&&this.conceal===void 0&&this.strike===void 0&&this.underline2===void 0&&this.frame===void 0&&this.encircle===void 0&&this.overline===void 0&&this.link===void 0&&this.meta===void 0}get transparentBackground(){return this.bgcolor===void 0||this.bgcolor.isDefault}get backgroundStyle(){return new e({bgcolor:this.bgcolor})}get withoutColor(){return new e({bold:this.bold,dim:this.dim,italic:this.italic,underline:this.underline,blink:this.blink,blink2:this.blink2,reverse:this.reverse,conceal:this.conceal,strike:this.strike,underline2:this.underline2,frame:this.frame,encircle:this.encircle,overline:this.overline,link:this.link,meta:this.meta})}withLink(t){return new e({color:this.color,bgcolor:this.bgcolor,bold:this.bold,dim:this.dim,italic:this.italic,underline:this.underline,blink:this.blink,blink2:this.blink2,reverse:this.reverse,conceal:this.conceal,strike:this.strike,underline2:this.underline2,frame:this.frame,encircle:this.encircle,overline:this.overline,link:t,meta:this.meta})}clearMetaAndLinks(){return new e({color:this.color,bgcolor:this.bgcolor,bold:this.bold,dim:this.dim,italic:this.italic,underline:this.underline,blink:this.blink,blink2:this.blink2,reverse:this.reverse,conceal:this.conceal,strike:this.strike,underline2:this.underline2,frame:this.frame,encircle:this.encircle,overline:this.overline})}add(t){return!t||t.isNull?this:this.isNull?t:new e({color:t.color??this.color,bgcolor:t.bgcolor??this.bgcolor,bold:t.bold??this.bold,dim:t.dim??this.dim,italic:t.italic??this.italic,underline:t.underline??this.underline,blink:t.blink??this.blink,blink2:t.blink2??this.blink2,reverse:t.reverse??this.reverse,conceal:t.conceal??this.conceal,strike:t.strike??this.strike,underline2:t.underline2??this.underline2,frame:t.frame??this.frame,encircle:t.encircle??this.encircle,overline:t.overline??this.overline,link:t.link??this.link,meta:t.meta&&this.meta?{...this.meta,...t.meta}:t.meta??this.meta})}equals(e){return this===e?!0:this.color?.name===e.color?.name&&this.bgcolor?.name===e.bgcolor?.name&&this.bold===e.bold&&this.dim===e.dim&&this.italic===e.italic&&this.underline===e.underline&&this.blink===e.blink&&this.blink2===e.blink2&&this.reverse===e.reverse&&this.conceal===e.conceal&&this.strike===e.strike&&this.underline2===e.underline2&&this.frame===e.frame&&this.encircle===e.encircle&&this.overline===e.overline&&this.link===e.link}toSgrCodes(e){if(this.isNull)return``;let t=[],n=ta,r=this.bgcolor?.flattenAlpha(n),i=r?.getTruecolor(void 0,!1)??n,a=this.color?.flattenAlpha(i);if(a){let n=e===void 0?a:a.downgrade(e);t.push(...n.getAnsiCodes(!0))}if(r){let n=e===void 0?r:r.downgrade(e);t.push(...n.getAnsiCodes(!1))}for(let e of na){let n=this[e];n===!0?t.push(`${ra[e][0]}`):n===!1&&t.push(`${ra[e][1]}`)}return t.join(`;`)}render(e,t){if(e.length===0)return``;if(this.isNull)return e;let n=this.toSgrCodes(t),r=n.length>0?`\x1b[${n}m${e}\x1b[0m`:e;return this.link&&(r=`\x1b]8;;${ea(this.link)}\x1b\\${r}\x1b]8;;\x1b\\`),r}getHtmlStyle(e){if(this.isNull)return``;let t=[];if(this.color){let n=this.color.getTruecolor(e,!0);t.push(`color: ${n.hex}`)}if(this.bgcolor){let n=this.bgcolor.getTruecolor(e,!1);t.push(`background-color: ${n.hex}`)}this.bold&&t.push(`font-weight: bold`),this.italic&&t.push(`font-style: italic`);let n=[];return this.underline&&n.push(`underline`),this.strike&&n.push(`line-through`),this.overline&&n.push(`overline`),n.length>0&&t.push(`text-decoration: ${n.join(` `)}`),this.dim&&t.push(`opacity: 0.5`),t.join(`; `)}toString(){if(this.isNull)return`none`;let e=[];for(let t of na)this[t]===!1&&e.push(`not ${t}`);for(let t of na)this[t]===!0&&e.push(t);return this.color&&e.push(this.color.name),this.bgcolor&&e.push(`on ${this.bgcolor.name}`),this.link&&e.push(`link ${this.link}`),e.join(` `)||`none`}static null(){return sa}static fromColor(t,n){return new e({color:t,bgcolor:n})}static fromMeta(t){return new e({meta:t})}static pickFirst(...e){for(let t of e)if(t!==void 0)return t;throw Error(`All arguments are undefined`)}static combine(e){let t=sa;for(let n of e)n&&(t=t.add(n));return t}static chain(...t){return e.combine(t)}static normalize(e){return e.trim().replace(/\s+/g,` `)}static parse(t){let n=e.normalize(t);if(n===``||n===`none`)return sa;let r=oa.get(n);if(r)return r;if(da&&n.includes(`.`)){let e=fa[n];if(e!==void 0)return oa.set(n,e),e}let i=la(n);return oa.set(n,i),i}};const sa=new J,ca=new Set(na);function la(e){let t=e.split(/\s+/),n={},r=0;for(;r<t.length;){let e=t[r];if(e===`not`){r++;let e=t[r];if(!e)throw new aa(`Expected attribute after "not" in style definition`);let i=ia[e]??e;if(!ca.has(i))throw new aa(`Invalid attribute: "${e}"`);n[i]=!1,r++;continue}if(e===`on`){r++;let e=t[r];if(!e)throw new aa(`Expected color after "on" in style definition`);try{n.bgcolor=W.parse(e)}catch{throw new aa(`Invalid background color: "${e}"`)}r++;continue}if(e===`link`){r++;let e=t[r];e&&(n.link=e),r++;continue}let i=ia[e]??e;if(ca.has(i)){n[i]=!0,r++;continue}try{n.color=W.parse(e)}catch{throw new aa(`Invalid style definition: "${e}"`)}r++}return new J(n)}function ua(e){if(e!==void 0)return e instanceof W?e:W.parse(e)}let da=!1;const fa={none:sa,reset:new J({color:W.default(),bgcolor:W.default(),bold:!1,dim:!1,italic:!1,underline:!1,blink:!1,blink2:!1,reverse:!1,conceal:!1,strike:!1,underline2:!1,frame:!1,encircle:!1,overline:!1}),bold:new J({bold:!0}),dim:new J({dim:!0}),italic:new J({italic:!0}),underline:new J({underline:!0}),blink:new J({blink:!0}),blink2:new J({blink2:!0}),reverse:new J({reverse:!0}),conceal:new J({conceal:!0}),strike:new J({strike:!0}),underline2:new J({underline2:!0}),frame:new J({frame:!0}),encircle:new J({encircle:!0}),overline:new J({overline:!0}),"table.header":new J({bold:!0}),"table.footer":new J({bold:!0}),"table.cell":sa,"table.title":new J({italic:!0}),"table.caption":new J({italic:!0,dim:!0}),"repr.str":J.parse(`green`),"repr.number":J.parse(`cyan`),"repr.bool":J.parse(`italic bright_magenta`),"repr.none":J.parse(`italic magenta`),"repr.url":J.parse(`not italic underline bright_blue`),"repr.uuid":J.parse(`bright_yellow`),"repr.error":J.parse(`bold red`),"repr.indent":J.parse(`dim green`),"repr.attrib_name":J.parse(`yellow`),"repr.attrib_value":J.parse(`magenta`),"repr.attrib_equal":J.parse(`bold`),"repr.tag_start":J.parse(`bold`),"repr.tag_name":J.parse(`bright_magenta`),"repr.tag_contents":J.parse(`default`),"repr.tag_end":J.parse(`bold`),"log.time":J.parse(`cyan dim`),"log.message":sa,"log.path":J.parse(`dim`),"log.line_no":J.parse(`cyan`),"log.level":sa,"rule.line":J.parse(`green`),"rule.text":J.parse(`bold`),"json.brace":J.parse(`bold`),"json.bool":J.parse(`italic bright_magenta`),"json.key":J.parse(`bold blue`),"json.null":J.parse(`italic magenta`),"json.number":J.parse(`cyan`),"json.str":J.parse(`green`),"markdown.h1":J.parse(`bold underline`),"markdown.h2":J.parse(`bold`),"markdown.h3":J.parse(`bold dim`),"markdown.h4":J.parse(`bold dim italic`),"markdown.code":J.parse(`cyan on grey11`),"markdown.hr":J.parse(`yellow`),"markdown.link":J.parse(`bright_blue`),"markdown.link_url":J.parse(`blue`),"progress.description":sa,"progress.percentage":J.parse(`cyan`),"progress.remaining":J.parse(`cyan`),"progress.elapsed":J.parse(`cyan`),"progress.spinner":J.parse(`green`),"progress.download":J.parse(`green`),"progress.filesize":J.parse(`green`),"progress.filesize.total":J.parse(`green`),"progress.data.speed":J.parse(`red`),"bar.back":J.parse(`grey23`),"bar.complete":J.parse(`magenta`),"bar.finished":J.parse(`green`),"bar.pulse":J.parse(`magenta`),tree:sa,"tree.guide":sa,"status.spinner":J.parse(`green`),"status.message":sa,prompt:J.parse(`bold`),"prompt.choices":J.parse(`magenta`),"prompt.default":J.parse(`cyan`),"inspect.attr":J.parse(`yellow italic`),"inspect.attr.dunder":J.parse(`yellow italic dim`),"inspect.callable":J.parse(`bold magenta`),"inspect.error":J.parse(`bold red`),"inspect.help":J.parse(`cyan`),"inspect.doc":J.parse(`dim`),"inspect.value.border":J.parse(`green`),"traceback.border":J.parse(`red`),"traceback.text":J.parse(`red`),"traceback.title":J.parse(`bold red`),"traceback.exc_type":J.parse(`bold bright_red`),"traceback.exc_value":sa,"traceback.offset":J.parse(`bold bright_red`),"scope.border":J.parse(`blue`),"scope.key":J.parse(`italic`),"scope.key.special":J.parse(`dim italic`),pretty:sa,"iso8601.date":J.parse(`cyan`),"iso8601.time":J.parse(`cyan`),"iso8601.timezone":J.parse(`bright_blue`)};da=!0;var pa;(function(e){e.BELL=`bell`,e.CARRIAGE_RETURN=`carriage_return`,e.HOME=`home`,e.CLEAR=`clear`,e.SHOW_CURSOR=`show_cursor`,e.HIDE_CURSOR=`hide_cursor`,e.ENABLE_ALT_SCREEN=`enable_alt_screen`,e.DISABLE_ALT_SCREEN=`disable_alt_screen`,e.CURSOR_UP=`cursor_up`,e.CURSOR_DOWN=`cursor_down`,e.CURSOR_FORWARD=`cursor_forward`,e.CURSOR_BACKWARD=`cursor_backward`,e.CURSOR_MOVE_TO_COLUMN=`cursor_move_to_column`,e.CURSOR_MOVE_TO=`cursor_move_to`,e.ERASE_IN_LINE=`erase_in_line`,e.SET_WINDOW_TITLE=`set_window_title`})(pa||={});var Y=class e{text;style;control;constructor(e,t,n){this.text=e,this.style=t,this.control=n}get cellLength(){return this.control?0:B(this.text)}get hasText(){return this.text.length>0}get isControl(){return this.control!==void 0}splitCells(t){if(t>=this.cellLength)return[this,new e(``)];if(t<=0)return[new e(``),this];let[n,r]=Vr(this.text,t);return[new e(n,this.style),new e(r,this.style)]}static _line;static line(){return e._line??=new e(`
28
28
  `)}static*applyStyle(t,n,r){for(let i of t){if(i.isControl){yield i;continue}let t=i.style;n&&(t=n.add(t)),r&&(t=t?t.add(r):r),yield new e(i.text,t,i.control)}}static*filterControl(e,t){for(let n of e)n.isControl===t&&(yield n)}static splitLines(t){let n=[],r=[];for(let i of t){if(i.isControl){r.push(i);continue}let t=i.text;if(!t.includes(`
29
29
  `)){r.push(i);continue}let a=t.split(`
30
30
  `);for(let t=0;t<a.length;t++){t>0&&(n.push(r),r=[]);let o=a[t];o.length>0&&r.push(new e(o,i.style))}}return r.length>0&&n.push(r),n}static adjustLineLength(t,n,r,i=!0){let a=e.getLineLength(t);if(a===n)return t;if(a<n)return i?[...t,new e(` `.repeat(n-a),r)]:t;let o=[],s=n;for(let e of t){if(e.isControl){o.push(e);continue}let t=e.cellLength;if(t<=s)o.push(e),s-=t;else{let[t]=e.splitCells(V(s));o.push(t),s=0;break}}return o}static getLineLength(e){let t=0;for(let n of e)n.isControl||(t+=n.cellLength);return t}static getShape(t){if(t.length===0)return[0,0];let n=0;for(let r of t){let t=e.getLineLength(r);t>n&&(n=t)}return[n,t.length]}static*mergeHorizontal(t,n=0){let r=0;for(let e of t)e.lines.length>r&&(r=e.lines.length);let i=n>0?[new e(` `.repeat(n))]:[];for(let n=0;n<r;n++){for(let r=0;r<t.length;r++){r>0&&(yield*i);let a=t[r];yield*e.adjustLineLength(a.lines[n]??[],a.width)}yield e.line()}}static*simplify(t){let n;for(let r of t){if(!n){n=r;continue}ma(n.style,r.style)&&!r.isControl&&!n.isControl?n=new e(n.text+r.text,n.style):(yield n,n=r)}n&&(yield n)}static*stripLinks(t){for(let n of t)n.style?.link?yield new e(n.text,n.style.clearMetaAndLinks(),n.control):yield n}static*stripStyles(t){for(let n of t)yield new e(n.text,void 0,n.control)}static*removeColor(t){for(let n of t)n.style?yield new e(n.text,n.style.withoutColor,n.control):yield n}static divide(e,t){if(t.length===0)return[e];let n=[],r=0,i=0,a=e[r];for(let o of t){let t=[];for(;a&&i+a.cellLength<=o;)a.isControl?t.push(a):(t.push(a),i+=a.cellLength),r++,a=e[r];if(a&&!a.isControl&&i<o){let e=V(o-i),[n,r]=a.splitCells(e);n.hasText&&t.push(n),i+=n.cellLength,a=r}n.push(t)}let o=[];for(a?.hasText&&o.push(a),r++;r<e.length;)o.push(e[r]),r++;return o.length>0&&n.push(o),n}static alignTop(t,n,r,i){let a=t.map(t=>e.adjustLineLength(t,n,i)),o=[new e(` `.repeat(n),i)];for(;a.length<r;)a.push([...o]);return a.slice(0,r)}static alignBottom(t,n,r,i){let a=t.map(t=>e.adjustLineLength(t,n,i)),o=[new e(` `.repeat(n),i)],s=Math.max(0,r-a.length),c=[];for(let e=0;e<s;e++)c.push([...o]);return c.push(...a),c.slice(0,r)}static alignMiddle(t,n,r,i){let a=t.map(t=>e.adjustLineLength(t,n,i)),o=[new e(` `.repeat(n),i)],s=Math.max(0,Math.floor((r-a.length)/2)),c=[];for(let e=0;e<s;e++)c.push([...o]);for(c.push(...a);c.length<r;)c.push([...o]);return c.slice(0,r)}static setShape(t,n,r,i){let a=t.map(t=>e.adjustLineLength(t,n,i)),o=[new e(` `.repeat(n),i)];for(;a.length<r;)a.push([...o]);return a.slice(0,r)}static splitAndCropLines(t,n,r=!0,i=!1,a){let o=e.splitLines(t),s=[];for(let t of o){let o=e.adjustLineLength(t,n,a,r);s.push(o),i&&s[s.length-1].push(e.line())}return s}};function ma(e,t){return e===t?!0:!e||!t?!1:e.equals(t)}var ha=class e{topLeft;top;topDivider;topRight;headLeft;headVertical;headRight;midLeft;mid;midVertical;midRight;bottomLeft;bottom;bottomDivider;bottomRight;left;right;vertical;constructor(e){this.topLeft=e.topLeft,this.top=e.top,this.topDivider=e.topDivider,this.topRight=e.topRight,this.headLeft=e.headLeft,this.headVertical=e.headVertical,this.headRight=e.headRight,this.midLeft=e.midLeft,this.mid=e.mid,this.midVertical=e.midVertical,this.midRight=e.midRight,this.bottomLeft=e.bottomLeft,this.bottom=e.bottom,this.bottomDivider=e.bottomDivider,this.bottomRight=e.bottomRight,this.left=e.left,this.right=e.right,this.vertical=e.vertical}getTop(e,t,n=!0){let r=[];n&&r.push(new Y(this.topLeft,t));for(let n=0;n<e.length;n++)n>0&&r.push(new Y(this.topDivider,t)),r.push(new Y(this.top.repeat(e[n]),t));return n&&r.push(new Y(this.topRight,t)),r.push(Y.line()),r}getRow(e,t,n,r=!0){let[i,a,o,s]=this.getRowChars(t),c=[];r&&c.push(new Y(i,n));for(let t=0;t<e.length;t++)t>0&&c.push(new Y(o,n)),c.push(new Y(a.repeat(e[t]),n));return r&&c.push(new Y(s,n)),c.push(Y.line()),c}getBottom(e,t,n=!0){let r=[];n&&r.push(new Y(this.bottomLeft,t));for(let n=0;n<e.length;n++)n>0&&r.push(new Y(this.bottomDivider,t)),r.push(new Y(this.bottom.repeat(e[n]),t));return n&&r.push(new Y(this.bottomRight,t)),r.push(Y.line()),r}substitute(e={}){return e.asciiOnly?ga:e.safe?this.safeSubstitute():this}safeSubstitute(){let t={"╭":`┌`,"╮":`┐`,"╰":`└`,"╯":`┘`},n=e=>t[e]??e;return new e({topLeft:n(this.topLeft),top:n(this.top),topDivider:n(this.topDivider),topRight:n(this.topRight),headLeft:n(this.headLeft),headVertical:n(this.headVertical),headRight:n(this.headRight),midLeft:n(this.midLeft),mid:n(this.mid),midVertical:n(this.midVertical),midRight:n(this.midRight),bottomLeft:n(this.bottomLeft),bottom:n(this.bottom),bottomDivider:n(this.bottomDivider),bottomRight:n(this.bottomRight),left:n(this.left),right:n(this.right),vertical:n(this.vertical)})}getRowChars(e){switch(e){case`head`:return[this.headLeft,this.mid,this.headVertical,this.headRight];case`row`:return[this.midLeft,this.mid,this.midVertical,this.midRight];case`mid`:return[this.midLeft,this.mid,this.midVertical,this.midRight];case`foot`:return[this.midLeft,this.mid,this.midVertical,this.midRight]}}};const ga=new ha({topLeft:`+`,top:`-`,topDivider:`+`,topRight:`+`,headLeft:`|`,headVertical:`|`,headRight:`|`,midLeft:`|`,mid:`-`,midVertical:`+`,midRight:`|`,bottomLeft:`+`,bottom:`-`,bottomDivider:`+`,bottomRight:`+`,left:`|`,right:`|`,vertical:`|`});new ha({topLeft:`+`,top:`-`,topDivider:`+`,topRight:`+`,headLeft:`|`,headVertical:`|`,headRight:`|`,midLeft:`+`,mid:`-`,midVertical:`+`,midRight:`+`,bottomLeft:`+`,bottom:`-`,bottomDivider:`+`,bottomRight:`+`,left:`|`,right:`|`,vertical:`|`}),new ha({topLeft:`+`,top:`-`,topDivider:`+`,topRight:`+`,headLeft:`|`,headVertical:`|`,headRight:`|`,midLeft:`+`,mid:`=`,midVertical:`+`,midRight:`+`,bottomLeft:`+`,bottom:`-`,bottomDivider:`+`,bottomRight:`+`,left:`|`,right:`|`,vertical:`|`}),new ha({topLeft:`┌`,top:`─`,topDivider:`┬`,topRight:`┐`,headLeft:`│`,headVertical:`│`,headRight:`│`,midLeft:`├`,mid:`─`,midVertical:`┼`,midRight:`┤`,bottomLeft:`└`,bottom:`─`,bottomDivider:`┴`,bottomRight:`┘`,left:`│`,right:`│`,vertical:`│`}),new ha({topLeft:`┌`,top:`─`,topDivider:`┬`,topRight:`┐`,headLeft:`│`,headVertical:`│`,headRight:`│`,midLeft:`╞`,mid:`═`,midVertical:`╪`,midRight:`╡`,bottomLeft:`└`,bottom:`─`,bottomDivider:`┴`,bottomRight:`┘`,left:`│`,right:`│`,vertical:`│`}),new ha({topLeft:` `,top:` `,topDivider:` `,topRight:` `,headLeft:` `,headVertical:` `,headRight:` `,midLeft:` `,mid:`─`,midVertical:`─`,midRight:` `,bottomLeft:` `,bottom:` `,bottomDivider:` `,bottomRight:` `,left:` `,right:` `,vertical:` `}),new ha({topLeft:` `,top:` `,topDivider:` `,topRight:` `,headLeft:` `,headVertical:` `,headRight:` `,midLeft:` `,mid:`━`,midVertical:`━`,midRight:` `,bottomLeft:` `,bottom:` `,bottomDivider:` `,bottomRight:` `,left:` `,right:` `,vertical:` `}),new ha({topLeft:` `,top:` `,topDivider:` `,topRight:` `,headLeft:` `,headVertical:` `,headRight:` `,midLeft:` `,mid:`═`,midVertical:`═`,midRight:` `,bottomLeft:` `,bottom:` `,bottomDivider:` `,bottomRight:` `,left:` `,right:` `,vertical:` `}),new ha({topLeft:` `,top:` `,topDivider:` `,topRight:` `,headLeft:` `,headVertical:` `,headRight:` `,midLeft:` `,mid:`─`,midVertical:` `,midRight:` `,bottomLeft:` `,bottom:`─`,bottomDivider:` `,bottomRight:` `,left:` `,right:` `,vertical:` `}),new ha({topLeft:` `,top:` `,topDivider:` `,topRight:` `,headLeft:` `,headVertical:` `,headRight:` `,midLeft:` `,mid:`─`,midVertical:` `,midRight:` `,bottomLeft:` `,bottom:` `,bottomDivider:` `,bottomRight:` `,left:` `,right:` `,vertical:` `}),new ha({topLeft:` `,top:` `,topDivider:` `,topRight:` `,headLeft:` `,headVertical:` `,headRight:` `,midLeft:` `,mid:`━`,midVertical:` `,midRight:` `,bottomLeft:` `,bottom:`━`,bottomDivider:` `,bottomRight:` `,left:` `,right:` `,vertical:` `}),new ha({topLeft:` `,top:`─`,topDivider:`─`,topRight:` `,headLeft:` `,headVertical:` `,headRight:` `,midLeft:` `,mid:`─`,midVertical:`─`,midRight:` `,bottomLeft:` `,bottom:`─`,bottomDivider:`─`,bottomRight:` `,left:` `,right:` `,vertical:` `}),new ha({topLeft:`╭`,top:`─`,topDivider:`┬`,topRight:`╮`,headLeft:`│`,headVertical:`│`,headRight:`│`,midLeft:`├`,mid:`─`,midVertical:`┼`,midRight:`┤`,bottomLeft:`╰`,bottom:`─`,bottomDivider:`┴`,bottomRight:`╯`,left:`│`,right:`│`,vertical:`│`}),new ha({topLeft:`┏`,top:`━`,topDivider:`┳`,topRight:`┓`,headLeft:`┃`,headVertical:`┃`,headRight:`┃`,midLeft:`┣`,mid:`━`,midVertical:`╋`,midRight:`┫`,bottomLeft:`┗`,bottom:`━`,bottomDivider:`┻`,bottomRight:`┛`,left:`┃`,right:`┃`,vertical:`┃`}),new ha({topLeft:`┏`,top:`━`,topDivider:`┯`,topRight:`┓`,headLeft:`┃`,headVertical:`│`,headRight:`┃`,midLeft:`┠`,mid:`─`,midVertical:`┼`,midRight:`┨`,bottomLeft:`┗`,bottom:`━`,bottomDivider:`┷`,bottomRight:`┛`,left:`┃`,right:`┃`,vertical:`│`}),new ha({topLeft:`┏`,top:`━`,topDivider:`┳`,topRight:`┓`,headLeft:`┃`,headVertical:`┃`,headRight:`┃`,midLeft:`┡`,mid:`━`,midVertical:`╇`,midRight:`┩`,bottomLeft:`└`,bottom:`─`,bottomDivider:`┴`,bottomRight:`┘`,left:`│`,right:`│`,vertical:`│`}),new ha({topLeft:`╔`,top:`═`,topDivider:`╦`,topRight:`╗`,headLeft:`║`,headVertical:`║`,headRight:`║`,midLeft:`╠`,mid:`═`,midVertical:`╬`,midRight:`╣`,bottomLeft:`╚`,bottom:`═`,bottomDivider:`╩`,bottomRight:`╝`,left:`║`,right:`║`,vertical:`║`}),new ha({topLeft:`╔`,top:`═`,topDivider:`╤`,topRight:`╗`,headLeft:`║`,headVertical:`│`,headRight:`║`,midLeft:`╟`,mid:`─`,midVertical:`┼`,midRight:`╢`,bottomLeft:`╚`,bottom:`═`,bottomDivider:`╧`,bottomRight:`╝`,left:`║`,right:`║`,vertical:`│`}),new ha({topLeft:` `,top:` `,topDivider:` `,topRight:` `,headLeft:`|`,headVertical:`|`,headRight:`|`,midLeft:`|`,mid:`-`,midVertical:`|`,midRight:`|`,bottomLeft:` `,bottom:` `,bottomDivider:` `,bottomRight:` `,left:`|`,right:`|`,vertical:`|`});const _a=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g;function va(e){return e.replace(_a,``)}function ya(e){let t=e.link;if(!t)return e;let n=ea(t);return n===t?e:e.withLink(n)}function ba(e){if(e===void 0)return sa;let t;if(typeof e==`string`)try{t=J.parse(e)}catch(e){if(e instanceof aa)return sa;throw e}else t=e;return ya(t)}var xa=class e{start;end;style;constructor(e,t,n){this.start=e,this.end=t,this.style=n}get hasLength(){return this.end>this.start}toString(){return`Span(${this.start}, ${this.end})`}split(t){return t<=this.start||t>=this.end?[this,void 0]:[new e(this.start,t,this.style),new e(t,this.end,this.style)]}move(t){return new e(this.start+t,this.end+t,this.style)}rightCrop(t){return t>=this.end?this:new e(this.start,Math.min(this.end,t),this.style)}extend(t){return new e(this.start,this.end+t,this.style)}},Sa=class e{_text;_spans;_style;_justify;_overflow;_end;_tabSize;_noWrap;constructor(e,t){this._text=e?va(e):``,this._spans=[],this._style=ba(t?.style),this._justify=t?.justify,this._overflow=t?.overflow,this._end=t?.end??`
@@ -81,51 +81,51 @@ Use 'override' annotation for methods overridden by subclass.`)}}var $i=aa(0),ea
81
81
  `)),r.push(...this.renderOptionRow(n[e],e,t));return r}renderNoMatchRow(e){let t=` ${Br(`(no matches)`,V(e))} `,n=this.disabled?new J({color:`#666666`,bgcolor:`#333333`,dim:!0}):new J({color:this.resolvePalette(`foreground`),bgcolor:this.resolvePalette(`surface`),dim:!0});return[new Y(` `,n),new Y(t,n),new Y(` `,n)]}renderOptionRow(e,t,n){let r=` ${Br(e.label,V(n))} `,i=e.idx===this.selectedIndex,a=t===this.highlightedIndex,o=this.disabled?new J({color:`#666666`,bgcolor:`#333333`,dim:!0}):a?new J({color:this.resolvePalette(`text-primary`),bgcolor:this.resolvePalette(`primary-muted`)}):i?new J({color:this.resolvePalette(`on-primary`),bgcolor:this.resolvePalette(`primary`)}):new J({color:this.resolvePalette(`foreground`),bgcolor:this.resolvePalette(`surface`)});return[new Y(` `,o),new Y(r,o),new Y(` `,o)]}maxLabelLen(){let e=0;for(let t of this.options){let n=B(t);n>e&&(e=n)}return e}measure(e){let t=this.maxLabelLen()+4;return{minimum:t,maximum:t}}resolvePalette(e){let t=this._theme.palette.get(e);return W.fromRgba(t)}}})();var Eo=function(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0},Do=function(e,t,n,r,i,a){function o(e){if(e!==void 0&&typeof e!=`function`)throw TypeError(`Function expected`);return e}for(var s=r.kind,c=s===`getter`?`get`:s===`setter`?`set`:`value`,l=!t&&e?r.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d,f=!1,p=n.length-1;p>=0;p--){var m={};for(var h in r)m[h]=h===`access`?{}:r[h];for(var h in r.access)m.access[h]=r.access[h];m.addInitializer=function(e){if(f)throw TypeError(`Cannot add initializers after decoration has completed`);a.push(o(e||null))};var g=(0,n[p])(s===`accessor`?{get:u.get,set:u.set}:u[c],m);if(s===`accessor`){if(g===void 0)continue;if(typeof g!=`object`||!g)throw TypeError(`Object expected`);(d=o(g.get))&&(u.get=d),(d=o(g.set))&&(u.set=d),(d=o(g.init))&&i.unshift(d)}else (d=o(g))&&(s===`field`?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,r.name,u),f=!0};(()=>{var e,t,n,r,i;let a=Qa,o=[],s,c=[],l=[],u,d=[],f=[],p,m=[],h=[],g,_=[],v=[],y,b=[],x=[],S,C=[],ee=[],te,w,ne,re;return class extends a{static{let ie=typeof Symbol==`function`&&Symbol.metadata?Object.create(a[Symbol.metadata]??null):void 0;s=[X.observable],u=[(e=X.observable).ref.bind(e)],p=[(t=X.observable).ref.bind(t)],g=[(n=X.observable).ref.bind(n)],y=[(r=X.observable).ref.bind(r)],S=[(i=X.observable).ref.bind(i)],te=[X.action],w=[X.action],ne=[X.action],re=[X.action],Do(this,null,s,{kind:`accessor`,name:`value`,static:!1,private:!1,access:{has:e=>`value`in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:ie},c,l),Do(this,null,u,{kind:`accessor`,name:`min`,static:!1,private:!1,access:{has:e=>`min`in e,get:e=>e.min,set:(e,t)=>{e.min=t}},metadata:ie},d,f),Do(this,null,p,{kind:`accessor`,name:`max`,static:!1,private:!1,access:{has:e=>`max`in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:ie},m,h),Do(this,null,g,{kind:`accessor`,name:`step`,static:!1,private:!1,access:{has:e=>`step`in e,get:e=>e.step,set:(e,t)=>{e.step=t}},metadata:ie},_,v),Do(this,null,y,{kind:`accessor`,name:`width`,static:!1,private:!1,access:{has:e=>`width`in e,get:e=>e.width,set:(e,t)=>{e.width=t}},metadata:ie},b,x),Do(this,null,S,{kind:`accessor`,name:`_theme`,static:!1,private:!1,access:{has:e=>`_theme`in e,get:e=>e._theme,set:(e,t)=>{e._theme=t}},metadata:ie},C,ee),Do(this,null,te,{kind:`method`,name:`setTheme`,static:!1,private:!1,access:{has:e=>`setTheme`in e,get:e=>e.setTheme},metadata:ie},null,o),Do(this,null,w,{kind:`method`,name:`handleKey`,static:!1,private:!1,access:{has:e=>`handleKey`in e,get:e=>e.handleKey},metadata:ie},null,o),Do(this,null,ne,{kind:`method`,name:`handleMouse`,static:!1,private:!1,access:{has:e=>`handleMouse`in e,get:e=>e.handleMouse},metadata:ie},null,o),Do(this,null,re,{kind:`method`,name:`setValue`,static:!1,private:!1,access:{has:e=>`setValue`in e,get:e=>e.setValue},metadata:ie},null,o),ie&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:ie})}id=Eo(this,o);focusable=!0;#e=Eo(this,c,void 0);get value(){return this.#e}set value(e){this.#e=e}#t=(Eo(this,l),Eo(this,d,void 0));get min(){return this.#t}set min(e){this.#t=e}#n=(Eo(this,f),Eo(this,m,void 0));get max(){return this.#n}set max(e){this.#n=e}#r=(Eo(this,h),Eo(this,_,void 0));get step(){return this.#r}set step(e){this.#r=e}#i=(Eo(this,v),Eo(this,b,void 0));get width(){return this.#i}set width(e){this.#i=e}#a=(Eo(this,x),Eo(this,C,void 0));get _theme(){return this.#a}set _theme(e){this.#a=e}_dragging=(Eo(this,ee),!1);constructor(e={}){super(),this.id=e.id??`slider-${Math.random().toString(36).slice(2,8)}`,this.min=e.min??0,this.max=e.max??100,this.step=e.step??1;let t=e.width??20;if(!Number.isInteger(t)||t<1)throw RangeError(`Slider width must be a positive integer; got ${t}`);this.width=t,this.value=Oo(e.value??this.min,this.min,this.max,this.step),this.disabled=e.disabled??!1,this._theme=e.theme??Ji}setTheme(e){this._theme=e}handleKey(e){if(!this.disabled)switch(e.key){case`left`:this.setValue(this.value-this.step),e.stop();return;case`right`:this.setValue(this.value+this.step),e.stop();return;case`home`:this.setValue(this.min),e.stop();return;case`end`:this.setValue(this.max),e.stop();return}}handleMouse(e){if(!this.disabled){if(e.type===`mouse_down`){this._dragging=!0,this.setValueFromMouseX(e.x);return}if(e.type===`mouse_move`){this._dragging&&this.setValueFromMouseX(e.x);return}if(e.type===`mouse_up`){let t=this._dragging;this._dragging=!1,t&&(this.setValueFromMouseX(e.x),this.emitSubmit());return}}}setValue(e){let t=Oo(e,this.min,this.max,this.step);t!==this.value&&(this.value=t,this.emitChange())}setValueFromMouseX(e){let t=this.bounds;if(!t)return;let n=Math.max(1,this.width-1),r=Math.max(0,Math.min(this.width-1,e-t.x))/n,i=this.min+r*(this.max-this.min);this.setValue(i)}render(e){let t=e.asciiOnly?`-`:`─`,n=e.asciiOnly?`*`:`●`,r=this.max-this.min,i=r===0?0:(this.value-this.min)/r,a=Math.round(i*(this.width-1)),o={underline:this.focused},s=this.disabled?new J({color:`#666666`,bgcolor:`#333333`,dim:!0,...o}):new J({color:this.resolvePalette(`primary`),...o}),c=this.disabled?new J({color:`#666666`,bgcolor:`#333333`,dim:!0,...o}):new J({color:this.resolvePalette(`surface`),...o}),l=this.disabled?new J({color:`#666666`,bgcolor:`#333333`,dim:!0,bold:!0,...o}):new J({color:this.resolvePalette(`primary`),bold:!0,...o}),u=[];a>0&&u.push(new Y(t.repeat(a),s)),u.push(new Y(n,l));let d=this.width-a-1;return d>0&&u.push(new Y(t.repeat(d),c)),u}measure(e){return{minimum:this.width,maximum:this.width}}resolvePalette(e){let t=this._theme.palette.get(e);return W.fromRgba(t)}}})();function Oo(e,t,n,r){let i=Math.max(t,Math.min(n,e));if(r<=0)return i;let a=t+Math.round((i-t)/r)*r;return Math.max(t,Math.min(n,a))}new TextEncoder,new TextDecoder(`utf-8`),new TextDecoder(`ascii`);function ko(e,t){if(!(e instanceof Sa))throw TypeError(`template function expected a RichText fragment, got ${typeof e==`object`?Object.prototype.toString.call(e):typeof e}`);let n=e.copy();return n.style=e.style.add(t),n}function Ao(e){return{fn:(t=>ko(t,e)),argTypes:[`liftable`],returnType:`T`}}function jo(){let e={};for(let t of Object.keys(gi))e[t]=Ao(new J({color:W.parse(t)}));return e}const Mo={fn:((e,t)=>{if(!Number.isInteger(e)||e<0||e>255)throw RangeError(`color index ${e} is out of range (0-255)`);return ko(t,new J({color:W.fromAnsi(e)}))}),argTypes:[`number`,`liftable`],returnType:`T`},No=/^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/,Po={fn:((e,t)=>{if(!No.test(e))throw RangeError(`hex expected #RRGGBB or #RRGGBBAA, got ${JSON.stringify(e)}`);return ko(t,new J({color:W.parse(e)}))}),argTypes:[`string`,`liftable`],returnType:`T`},Fo={fn:((e,t,n,r)=>ko(r,new J({color:W.fromRgb(e,t,n)}))),argTypes:[`number`,`number`,`number`,`liftable`],returnType:`T`},Io={fn:((e,t)=>ko(t,new J({bgcolor:W.parse(e)}))),argTypes:[`string`,`liftable`],returnType:`T`};function Lo(e,t){return new J({[e]:t})}function Ro(){let e={};for(let t of na)e[t]=Ao(Lo(t,!0)),e[`not_${t}`]=Ao(Lo(t,!1));for(let[t,n]of Object.entries(ia))e[t]=Ao(Lo(n,!0));return e}const zo={fn:((e,t)=>ko(t,J.parse(e))),argTypes:[`string`,`liftable`],returnType:`T`},Bo={fn:((e,t)=>ko(t,new J({link:e}))),argTypes:[`string`,`liftable`],returnType:`T`};function Vo(){return{...jo(),color:Mo,hex:Po,rgb:Fo,on:Io,...Ro(),link:Bo,style:zo}}const Ho=/^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/;function Uo(e){if(!Ho.test(e))throw RangeError(`palette background expected #RRGGBB or #RRGGBBAA, got ${JSON.stringify(e)}`);return W.parse(e).getTruecolor()}function Wo(e,t,n,r){let i=e.resolve(t,n===void 0?void 0:{against:n});if(i===null){let e=n===void 0?`; for specs with alpha or auto-contrast, use paletteOver`:``;throw Error(`palette spec ${JSON.stringify(t)} did not resolve — check the spec string is valid and the variable exists${e}`)}return ko(r,new J({color:W.fromRgba(i)}))}const Go=/^[A-Za-z_][A-Za-z0-9_]*$/;function Ko(e){let t={};for(let n of e.palette.vars.keys()){if(!Go.test(n))continue;let r=n;t[r]={fn:(t=>Wo(e,r,void 0,t)),argTypes:[`liftable`],returnType:`T`}}return t}function qo(e){return{fn:((t,n)=>Wo(e,t,void 0,n)),argTypes:[`string`,`liftable`],returnType:`T`}}function Jo(e){return{fn:((t,n,r)=>Wo(e,t,Uo(n),r)),argTypes:[`string`,`string`,`liftable`],returnType:`T`}}function Yo(e){return{fn:((t,n)=>Wo(e,`auto`,Uo(t),n)),argTypes:[`string`,`liftable`],returnType:`T`}}function Xo(e){return{...Ko(e),palette:qo(e),paletteOver:Jo(e),auto:Yo(e)}}function Zo(){return Vo()}new J({color:`red`,dim:!0});const Qo={dark:`textual-dark`,light:`textual-light`};function $o(e){return Qo[e]??e}function es(e,t){return e??t??`textual-dark`}function ts(){return Object.keys(Qo)}function ns(){return[...Vi(),...ts()]}const rs=[`powerline`,`capsule`,`plain`];function is(e){return rs.includes(e)}function as(e,t){let n=e??t??`powerline`;return is(n)?n:`powerline`}var os=class extends Error{file;issues;constructor(e,t){super(ls(e,t)),this.name=`ConfigError`,this.file=e,this.issues=t}};function Q(e,t){let n=0,r;for(let i of t){if(i===``||/^\d+$/.test(i))continue;let t=ss(e,n,i);if(t===-1)return r===void 0?void 0:cs(e,r);n=t,r=t}return r===void 0?void 0:cs(e,r)}function ss(e,t,n){let r=n.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`),i=RegExp(`(?:["']${r}["']|\\b${r}\\b)\\s*:`,`g`);i.lastIndex=t;let a=i.exec(e);return a?a.index:-1}function cs(e,t){let n=1;for(let r=0;r<t&&r<e.length;r++)e.charCodeAt(r)===10&&n++;return n}function ls(e,t){if(t.length===0)return`${e}: invalid config (no details)`;let n=[`Invalid config in ${e} (${t.length} issue${t.length===1?``:`s`}):`];for(let e of t){let t=[];e.line!==void 0&&t.push(`line ${e.line}${e.col===void 0?``:`:${e.col}`}`),e.path&&t.push(e.path);let r=t.length>0?`[${t.join(` • `)}] `:``;n.push(` ${r}${e.message}`)}return n.join(`
82
82
  `)}function us(e,t,n,r){let i=n[r];return typeof i==`string`?i:(e.issues.push({path:`${t}.${r}`,message:`${t}.${r} must be a string, got ${gs(i)}`,line:Q(e.source,[...t.split(`.`),r])}),null)}function ds(e,t,n,r){let i=n.default;if(i!==void 0){if(!(r===`string`&&typeof i==`string`||r===`number`&&typeof i==`number`||r===`boolean`&&typeof i==`boolean`)){e.issues.push({path:`${t}.default`,message:`default must be a ${r}, got ${gs(i)}`,line:Q(e.source,[...t.split(`.`),`default`])});return}return i}}function fs(e,t,n,r){let i=n[r];if(i!==void 0){if(typeof i!=`string`){e.issues.push({path:`${t}.${r}`,message:`${t}.${r} must be a string, got ${gs(i)}`,line:Q(e.source,[...t.split(`.`),r])});return}return i}}function ps(e,t,n){let r=fs(e,t,n,`palette`);if(r!==void 0){if(!e.allowedPalettes.has(r)){e.issues.push({path:`${t}.palette`,message:`Unknown palette "${r}". Expected one of: ${[...e.allowedPalettes].sort().join(`, `)}`,line:Q(e.source,[...t.split(`.`),`palette`])});return}return r}}function ms(e,t,n,r,i){let a=n[r];if(a!==void 0){if(typeof a!=`string`||!i.includes(a)){e.issues.push({path:`${t}.${r}`,message:`${t}.${r} must be one of: ${i.join(`, `)}; got ${_s(a)}`,line:Q(e.source,[...t.split(`.`),r])});return}return a}}function hs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function gs(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function _s(e){return typeof e==`string`?JSON.stringify(e):e===void 0?`undefined`:String(e)}function vs(e,t,n,r){return hs(r)?(bs(e,n,r,t.noun,new Set(Object.keys(t.fields))),ys(e,t.fields,n,r)):(e.issues.push({path:n,message:`${n} must be an object, got ${gs(r)}`,line:Q(e.source,n.split(`.`))}),null)}function ys(e,t,n,r){let i=t,a={},o=!0;for(let[t,s]of Object.entries(i)){let i=s.parse(e,n,t,r);i===void 0?s.required&&(o=!1):a[t]=i}return o?a:null}function bs(e,t,n,r,i){for(let a of Object.keys(n))i.has(a)||e.issues.push({path:`${t}.${a}`,message:`Unknown ${r} "${a}". Expected one of: ${[...i].join(`, `)}`,line:Q(e.source,[...t.split(`.`),a])})}function xs(e,t,n,r){if(!hs(r))return e.issues.push({path:n,message:`${t.noun} must be an object, got ${gs(r)}`,line:Q(e.source,n.split(`.`))}),null;let i=t.arms,a=Object.keys(i),o=Object.keys(r).filter(e=>e in i),s=Object.keys(r).filter(e=>!(e in i));for(let r of s)e.issues.push({path:`${n}.${r}`,message:`Unknown ${t.noun} key "${r}". Expected exactly one of: ${a.join(`, `)}`,line:Q(e.source,[...n.split(`.`),r])});if(o.length===0)return e.issues.push({path:n,message:`${t.noun} must declare exactly one of: ${a.join(`, `)}`,line:Q(e.source,n.split(`.`))}),null;if(o.length>1)return e.issues.push({path:n,message:`${t.noun} must declare exactly one of: ${a.join(`, `)} (found: ${o.join(`, `)})`,line:Q(e.source,n.split(`.`))}),null;let c=o[0];return i[c].parse(e,`${n}.${c}`,r[c])}function Ss(e,t,n,r){if(!hs(r))return e.issues.push({path:n,message:`${n} must be an object, got ${gs(r)}`,line:Q(e.source,n.split(`.`))}),null;let i=r[t.tag];if(typeof i!=`string`)return e.issues.push({path:`${n}.${t.tag}`,message:`${n}.${t.tag} must be a string, got ${gs(i)}`,line:Q(e.source,n.split(`.`))}),null;let a=t.arms;return i in a?a[i].parse(e,n,r):(e.issues.push({path:`${n}.${t.tag}`,message:`Unknown ${t.noun} "${i}". Expected one of: ${Object.keys(a).join(`, `)}`,line:Q(e.source,[...n.split(`.`),t.tag])}),null)}function Cs(e){return(...t)=>e()(...t)}function ws(e,...t){return(n,r,i)=>{let a=e(n,r,i);if(a===null)return null;for(let e of t){if(e.ok(a))continue;let{field:t,message:i}=e.issue(a),o=t===``?r:`${r}.${t}`;return n.issues.push({path:o,message:i,line:Q(n.source,o.split(`.`))}),null}return a}}function Ts(){return{required:!1,json:{type:`string`},parse:(e,t,n,r)=>fs(e,t,r,n)}}function Es(){return{required:!1,json:{type:`boolean`},parse:(e,t,n,r)=>{let i=r[n];if(i!==void 0){if(typeof i!=`boolean`){e.issues.push({path:`${t}.${n}`,message:`${n} must be a boolean, got ${gs(i)}`,line:Q(e.source,[n])});return}return i}}}}function Ds(){return{required:!1,json:{type:`string`},parse:(e,t,n,r)=>ps(e,t,r)}}function Os(){return{required:!0,json:{type:`string`},parse:(e,t,n,r)=>us(e,t,r,n)??void 0}}function ks(e){return{required:!1,json:{enum:[...e]},parse:(t,n,r,i)=>ms(t,n,i,r,e)}}function As(e,t={closed:!0}){let n=e,r={},i=[];for(let[e,t]of Object.entries(n))r[e]=t.json,t.required&&i.push(e);return{type:`object`,properties:r,...i.length>0&&{required:i},...t.closed&&{additionalProperties:!1}}}function js(e,t,n){let r=e,i={[t]:{const:n},...r.properties},a=[t,...r.required??[]];return{...r,properties:i,required:a}}function Ms(e){let t=e.arms;return{anyOf:Object.values(t).map(e=>e.json)}}function Ns(e){let t=e.arms;return{anyOf:Object.entries(t).map(([e,t])=>({type:`object`,properties:{[e]:t.json},required:[e],additionalProperties:!1}))}}function Ps(e,t=Zn){return{globals:{...t.globals,...e.globals??{}},variables:{...t.variables,...e.variables??{}},segments:{...t.segments,...e.segments??{}},root:e.root===void 0?t.root:e.root,actions:{...t.actions,...e.actions??{}},helpers:{...t.helpers,...e.helpers??{}}}}const Fs={noun:`globals key`,fields:{default_bg:Ts(),default_fg:Ts(),default_empty_value:Ts(),default_separator:Ts(),default_truncate_marker:Ts(),palette:Ds(),style:ks(rs)}};function Is(e,t){return t===void 0?{}:vs(e,Fs,`globals`,t)??{}}function Ls(e,t,n,r){return n.cache===void 0?(Rn.includes(r)&&e.issues.push({path:`${t}.cache`,message:`${r} variables must declare a cache policy (one of: ${R.join(`, `)})`,line:Q(e.source,t.split(`.`))}),null):Us(e,`${t}.cache`,n.cache)}function Rs(e,t,n){if(n.cache!==void 0)return Us(e,`${t}.cache`,n.cache)??void 0}function zs(e){return{required:!0,json:Ks(),parse:(t,n,r,i)=>Ls(t,n,i,e)??void 0}}function Bs(){return{required:!1,json:Ks(),parse:(e,t,n,r)=>Rs(e,t,r)}}function Vs(e,t,n){return e.issues.push({path:t,message:n,line:Q(e.source,t.split(`.`))}),null}const Hs={noun:`cache`,arms:{ttl:{json:{type:`string`},parse:(e,t,n)=>typeof n==`string`&&Js(n)?{ttl:n}:Vs(e,t,`cache.ttl must be a duration string like "5s", "100ms", "2m", "1h"; got ${_s(n)}`)},watch_file:{json:{type:`string`},parse:(e,t,n)=>typeof n==`string`&&n!==``?{watch_file:n}:Vs(e,t,`cache.watch_file must be a non-empty path string, got ${_s(n)}`)},depends_on:{json:{type:`array`,items:{type:`string`}},parse:(e,t,n)=>Array.isArray(n)&&n.every(e=>typeof e==`string`)?{depends_on:n}:Vs(e,t,`cache.depends_on must be an array of variable-name strings, got ${_s(n)}`)},key:{json:{type:`string`},parse:(e,t,n)=>typeof n==`string`&&n!==``?{key:n}:Vs(e,t,`cache.key must be a non-empty template string, got ${_s(n)}`)},never:{json:{const:!0},parse:(e,t,n)=>n===!0?{never:!0}:Vs(e,t,`cache.never must be the literal boolean true, got ${_s(n)}`)}}};function Us(e,t,n){return xs(e,Hs,t,n)}const Ws={noun:`time-variable cache`,arms:{ttl:Hs.arms.ttl}};function Gs(){return{required:!1,json:Ns(Ws),parse:(e,t,n,r)=>r.cache===void 0?void 0:xs(e,Ws,`${t}.cache`,r.cache)??void 0}}function Ks(){return Ns(Hs)}const qs=/^(\d+(?:\.\d+)?)(ms|s|m|h)$/;function Js(e){return qs.test(e)}function Ys(e,t,n){if(n===void 0)return{};if(!hs(n))return e.issues.push({path:t,message:`${t} must be an object, got ${gs(n)}`,line:Q(e.source,t.split(`.`))}),{};let r={};for(let[i,a]of Object.entries(n)){let n=Ss(e,lc,`${t}.${i}`,a);n!==null&&(r[i]=n)}return r}function Xs(){return{required:!0,json:{type:[`string`,`number`,`boolean`]},parse:(e,t,n,r)=>{let i=r.value;if(typeof i!=`string`&&typeof i!=`number`&&typeof i!=`boolean`){e.issues.push({path:`${t}.value`,message:`literal value must be string|number|boolean, got ${gs(i)}`,line:Q(e.source,t.split(`.`))});return}return i}}}function Zs(){return{required:!0,json:{enum:[...Ln]},parse:(e,t,n,r)=>{let i=r.field;if(typeof i!=`string`||!Ln.includes(i)){e.issues.push({path:`${t}.field`,message:`git field must be one of: ${Ln.join(`, `)}, got ${JSON.stringify(i)}`,line:Q(e.source,[...t.split(`.`),`field`])});return}return i}}}function Qs(){return{required:!1,json:{type:[`string`,`number`,`boolean`]},parse:(e,t,n,r)=>{let i=r.type;return ds(e,t,r,i===`number`||i===`boolean`||i===`string`?i:`string`)}}}const $s={value:Xs(),default:Ts()},ec={path:Os(),type:ks([`string`,`number`,`boolean`]),default:Qs()},tc={name:Os(),default:Ts()},nc={path:Os(),readMode:ks([`whole`,`first-line`]),regex:Ts(),cache:zs(`file`),default:Ts()},rc={command:Os(),regex:Ts(),cache:zs(`shell`),default:Ts()},ic={template:Os(),cache:Bs(),default:Ts()},ac={layout:Os(),cache:Gs(),default:Ts()},oc={field:Zs(),cache:zs(`git`),default:Ts()},sc={key:Os(),default:Ts()};function cc(e,t){return{json:js(As(t),`kind`,e),parse:(n,r,i)=>{let a=ys(n,t,r,i);return a===null?null:{kind:e,...a}}}}const lc={tag:`kind`,noun:`source kind`,arms:{literal:cc(`literal`,$s),input:cc(`input`,ec),env:cc(`env`,tc),file:cc(`file`,nc),shell:cc(`shell`,rc),template:cc(`template`,ic),time:cc(`time`,ac),git:cc(`git`,oc),state:cc(`state`,sc)}};function uc(){return Ms(lc)}function dc(){return{type:`object`,additionalProperties:uc()}}function fc(e,t){if(t===void 0)return{};if(!hs(t))return e.issues.push({path:`segments`,message:`segments must be an object, got ${gs(t)}`,line:Q(e.source,[`segments`])}),{};let n={};for(let[r,i]of Object.entries(t)){let t=vs(e,hc,`segments.${r}`,i);t!==null&&(n[r]=t)}return n}function pc(){return{required:!1,json:{anyOf:[{const:`auto`},{type:`integer`,minimum:1}]},parse:(e,t,n,r)=>{let i=r[n];if(i!==void 0){if(i===`auto`)return`auto`;if(typeof i==`number`&&Number.isInteger(i)&&i>0)return i;e.issues.push({path:`${t}.${n}`,message:`width must be "auto" or a positive integer, got ${_s(i)}`,line:Q(e.source,[...t.split(`.`),n])})}}}}function mc(){return{required:!1,json:dc(),parse:(e,t,n,r)=>{let i=r[n];if(i!==void 0)return Ys(e,`${t}.${n}`,i)}}}const hc={noun:`segment key`,fields:{template:Os(),width:pc(),justify:ks(zn),truncate:ks(Bn),bg:Ts(),fg:Ts(),when:Ts(),palette:Ds(),vars:mc()}},gc={kind:`container`,direction:`vertical`,children:[]};function _c(e){return{required:!0,json:{const:e},parse:()=>e}}function vc(){return{required:!0,json:{type:`string`},parse:(e,t,n,r)=>{let i=r[n];return typeof i==`string`&&i.length>0?i:(e.issues.push({path:`${t}.${n}`,message:`a segment node must have a non-empty "name" (a segment name), got ${_s(i)}`,line:Q(e.source,[`root`])}),``)}}}function yc(){return{required:!0,json:{enum:[...Pn]},parse:(e,t,n,r)=>{let i=r[n];return typeof i==`string`&&Pn.includes(i)?i:(e.issues.push({path:`${t}.${n}`,message:`a container "direction" must be one of: ${Pn.join(`, `)} (got ${JSON.stringify(i)})`,line:Q(e.source,[`root`])}),`vertical`)}}}function bc(e){return{required:!0,json:{type:`array`,items:{$ref:`#/definitions/LayoutNode`}},parse:(t,n,r,i)=>{let a=i[r];return Array.isArray(a)?a.map((i,a)=>e(t,`${n}.${r}[${a}]`,i)):(t.issues.push({path:`${n}.${r}`,message:`a container must have a "children" array of layout nodes, got ${gs(a)}`,line:Q(t.source,[`root`])}),[])}}}const xc={noun:`layout-node key`,fields:{kind:_c(`segment`),name:vc(),when:Ts()}},Sc={noun:`layout-node key`,fields:{kind:_c(`container`),direction:yc(),children:bc(Cs(()=>Dc)),when:Ts()}};function Cc(){return{required:!0,json:{type:`string`},parse:(e,t,n,r)=>{let i=r[n];return typeof i==`string`&&i.length>0?i:(e.issues.push({path:`${t}.${n}`,message:`a "seg" node must have a non-empty segment name, got ${_s(i)}`,line:Q(e.source,[`root`])}),``)}}}const wc={noun:`layout-node key`,fields:{seg:Cc(),when:Ts()}},Tc={noun:`layout-node key`,fields:{h:bc(Cs(()=>Dc)),when:Ts()}},Ec={noun:`layout-node key`,fields:{v:bc(Cs(()=>Dc)),when:Ts()}},Dc=(e,t,n)=>{if(typeof n==`string`)return n.length===0?(e.issues.push({path:t,message:`a bare-string layout node must be a non-empty segment name`,line:Q(e.source,[`root`])}),gc):{kind:`segment`,name:n};if(!hs(n))return e.issues.push({path:t,message:`a layout node must be a string (segment name) or an object with "kind" / "seg" / "h" / "v", got ${gs(n)}`,line:Q(e.source,[`root`])}),gc;if(n.kind===`container`)return vs(e,Sc,t,n)??gc;if(n.kind===`segment`)return vs(e,xc,t,n)??gc;if(n.kind===`cells`)return e.issues.push({path:t,message:`kind: "cells" is no longer supported — use the h-arm spelling instead:
83
83
  Old: { kind: "cells", segments: ["seg1", "seg2"] }
84
- New: { h: ["seg1", "seg2"] }`,line:Q(e.source,[`root`])}),gc;if(n.kind===`group`){let r=vs(e,Pc,t,n);return r===null?gc:(e.groups.push({name:r.name,label:r.label,...r.open!==void 0&&{open:r.open},...r.direction!==void 0&&{direction:r.direction},...r.key!==void 0&&{key:r.key},...r.bg!==void 0&&{bg:r.bg},...r.fg!==void 0&&{fg:r.fg},...r.when!==void 0&&{when:r.when},path:t}),Ic(r))}let r=`h`in n,i=`v`in n,a=`seg`in n;if(+!!r+ +!!i+ +!!a>1){let r=[`seg`,`h`,`v`].filter(e=>e in n);return e.issues.push({path:t,message:`a layout node may have exactly one of "seg", "h", or "v" — got ${r.map(e=>`"${e}"`).join(` and `)} together`,line:Q(e.source,[`root`])}),gc}if(a){let r=vs(e,wc,t,n);return r===null?gc:{kind:`segment`,name:r.seg,...r.when!==void 0&&{when:r.when}}}if(r){let r=vs(e,Tc,t,n);return r===null?gc:{kind:`container`,direction:`horizontal`,children:r.h,...r.when!==void 0&&{when:r.when}}}if(i){let r=vs(e,Ec,t,n);return r===null?gc:{kind:`container`,direction:`vertical`,children:r.v,...r.when!==void 0&&{when:r.when}}}return e.issues.push({path:`${t}.kind`,message:`a layout node "kind" must be "container", "segment", or "group", or use the terse A-grammar: a bare string, or an object with "seg", "h", or "v" (got ${JSON.stringify(n.kind)})`,line:Q(e.source,[`root`])}),gc},Oc=`groups.`,kc=`closed`,Ac=/^[A-Za-z_][A-Za-z0-9_]*$/;function jc(){return{required:!0,json:{type:`string`,pattern:Ac.source},parse:(e,t,n,r)=>{let i=r[n];if(typeof i!=`string`||!Ac.test(i)||i===kc){e.issues.push({path:`${t}.${n}`,message:`a group "name" must be an identifier (letters, digits, _; not starting with a digit) and not the reserved "${kc}", got ${_s(i)}`,line:Q(e.source,[`root`])});return}return i}}}function Mc(){return{required:!1,json:{type:`string`,minLength:1},parse:(e,t,n,r)=>{let i=r[n];if(i!==void 0){if(typeof i!=`string`||i===``||i.includes(`/`)){e.issues.push({path:`${t}.${n}`,message:`a group "key" must be a non-empty, slash-free SessionState key, got ${_s(i)}`,line:Q(e.source,[`root`])});return}return i}}}}function Nc(){return{required:!0,json:{type:`string`,pattern:`^[^\\n\\r]*$`},parse:(e,t,n,r)=>{let i=us(e,t,r,n);if(i!==null){if(/[\n\r]/.test(i)){e.issues.push({path:`${t}.${n}`,message:`${t}.${n}: group label must not contain newlines`,line:Q(e.source,[...t.split(`.`),n])});return}return i}}}}const Pc={noun:`layout-node key`,fields:{kind:_c(`group`),name:jc(),label:Nc(),open:Es(),direction:ks(Pn),key:Mc(),bg:Ts(),fg:Ts(),when:Ts(),children:bc(Cs(()=>Dc))}};function Fc(e){return e.key??`groups.`+e.name}function Ic(e){let t=Oc+e.name;return{kind:`container`,direction:`vertical`,children:[{kind:`segment`,name:t},{kind:`container`,direction:e.direction??`vertical`,children:e.children,when:`{{ eq .${t} "${e.name}" }}`}],...e.when!==void 0&&{when:e.when}}}function Lc(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}function Rc(e,t,n){e.issues.push({path:t,message:n,line:Q(e.source,[`root`])})}function zc(e,t){let n=e.groups;if(n.length===0)return;for(let n of[`variables`,`actions`,`segments`])for(let r of Object.keys(t[n]??{}))r.startsWith(`groups.`)&&Rc(e,`${n}.${r}`,`"${r}" is in the reserved "${Oc}" namespace (synthesized by group nodes) — rename it`);let r=new Set;for(let t of n)r.has(t.name)&&Rc(e,t.path,`duplicate group name "${t.name}" — group names must be unique (they name the synthesized state var, action, and toggle segment)`),r.add(t.name);for(let t of n)for(let r of n)t!==r&&t.path.startsWith(`${r.path}.`)&&Fc(t)===Fc(r)&&Rc(e,t.path,`group "${t.name}" shares key "${Fc(t)}" with its ancestor group "${r.name}" — a shared key holds ONE open group, so an ancestor and a descendant cannot share one. Sibling accordions share a key; nested groups use distinct keys.`);let i=new Map;for(let t of n){let n=Fc(t);if(i.has(n)||i.set(n,kc),t.open===!0){let r=i.get(n);r!==kc&&Rc(e,t.path,`groups "${r}" and "${t.name}" share key "${n}" and both declare open: true — a shared key holds one open group; pick one`),i.set(n,t.name)}}let a={},o={},s={};for(let e of n){let t=Oc+e.name,r=Fc(e),c=Lc(e.label),l=n.filter(t=>t!==e&&e.path.startsWith(t.path+`.`)).length,u=` `.repeat(l);a[t]={kind:`state`,key:r,default:i.get(r)},o[t]={set:r,cycle:[kc,e.name]},s[t]={template:`{{ action "${t}" "${u}▸ ${c}" "${u}▾ ${c}" }}`,...e.bg!==void 0&&{bg:e.bg},...e.fg!==void 0&&{fg:e.fg}}}t.variables={...t.variables??{},...a},t.actions={...t.actions??{},...o},t.segments={...t.segments??{},...s}}const Bc=[`themes`,`styles`],Vc=[`set`,`copy`,`open`];function Hc(e){return`set`in e}function Uc(e,t){if(t===void 0)return{};if(!hs(t))return Wc(e,`actions`,`actions must be an object, got ${gs(t)}`),{};let n=Object.create(null);for(let[r,i]of Object.entries(t)){let t=Gc(e,`actions.${r}`,i);t!==null&&(n[r]=t)}return n}function Wc(e,t,n){e.issues.push({path:t,message:n,line:Q(e.source,t.split(`.`))})}function Gc(e,t,n){if(!hs(n))return Wc(e,t,`${t} must be an action object, got ${gs(n)}`),null;let r=Vc.filter(e=>e in n);return r.length===1?Kc[r[0]](e,t,n):(Wc(e,t,`action must declare exactly one of: ${Vc.join(`, `)}${r.length>1?` (found: ${r.join(`, `)})`:``}`),null)}const Kc={set:ol,copy:qc(`copy`),open:qc(`open`)};function qc(e){return(t,n,r)=>{for(let i of Object.keys(r))i!==e&&Wc(t,`${n}.${i}`,`Unknown key "${i}" on a ${e} action. Expected only: ${e}`);let i=us(t,n,r,e);return i===null?null:{[e]:i}}}function Jc(e,t,n,r,i,a){let o=us(e,t,r,n);if(o===null)return null;let s=`${t}.${n}`;return o===``?(Wc(e,s,i),null):o.includes(`/`)?(Wc(e,s,a(o)),null):o}function Yc(e,t,n){return Jc(e,t,`set`,n,`set key must be non-empty (the SessionState key to write)`,e=>`set key "${e}" contains "/" — state keys must be slash-free`)}const Xc={to:sl()},Zc={from:cl()},Qc={min:dl(),max:dl(),by:dl()},$c={int:ul()},el={cycle:ll()},tl={ok:e=>e.min<e.max,issue:e=>({field:`min`,message:`min (${e.min}) must be less than max (${e.max})`})},nl={ok:e=>e.by!==0,issue:()=>({field:`by`,message:`by must be a non-zero integer (the per-click increment; negative steps down)`})};function rl(e,...t){let n=Object.keys(e),r=(t,n,r)=>ys(t,e,n,r),i=As(e);return{detect:n,allowed:[`set`,...n],label:n.join(`/`),json:{type:`object`,properties:{set:{type:`string`},...i.properties},required:[`set`,...i.required??[]],additionalProperties:!1},parse:t.length?ws(r,...t):r}}const il=[rl(Xc),rl(Zc),rl(Qc,tl,nl),rl($c),rl(el)],al=`a set action declares exactly one value source: "to" (a literal value), "from" (an option domain: ${Bc.join(`/`)}), "min"/"max"/"by" (a bounded step), "int" (an unbounded integer cursor), or "cycle" (an enumerated domain stepped in order)`;function ol(e,t,n){let r=Yc(e,t,n),i=il.filter(e=>e.detect.some(e=>e in n));if(i.length!==1)return Wc(e,t,`${al}${i.length>1?` — found: ${i.map(e=>e.label).join(`, `)}`:``}`),null;let a=i[0];for(let r of Object.keys(n))a.allowed.includes(r)||Wc(e,`${t}.${r}`,`Unknown key "${r}" on this set action. Expected one of: ${a.allowed.join(`, `)}`);let o=a.parse(e,t,n);return r===null||o===null?null:{set:r,...o}}function sl(){return{required:!0,json:{type:`string`},parse:(e,t,n,r)=>Jc(e,t,n,r,`set value must be non-empty — an empty value cannot be delivered on the set-state wire`,e=>`set value "${e}" contains "/" — set values must be slash-free`)??void 0}}function cl(){return{required:!0,json:{enum:[...Bc]},parse:(e,t,n,r)=>{let i=r[n];if(typeof i!=`string`||!Bc.includes(i)){Wc(e,`${t}.${n}`,`from must be one of: ${Bc.join(`, `)}, got ${_s(i)}`);return}return i}}}function ll(){return{required:!0,json:{type:`array`,items:{type:`string`,minLength:1},minItems:2,uniqueItems:!0},parse:(e,t,n,r)=>{let i=r[n],a=`${t}.${n}`;if(!Array.isArray(i)||i.some(e=>typeof e!=`string`)){Wc(e,a,`cycle must be an array of strings (the enumerated values a click steps through), got ${gs(i)}`);return}let o=i;if(o.length<2){Wc(e,a,`cycle needs at least two members (one member has no successor — use a literal "to")`);return}let s=o.some(e=>e===``),c=o.filter(e=>e.includes(`/`));if(s){Wc(e,a,`cycle members must be non-empty — an empty value cannot be delivered on the set-state wire`);return}if(c.length>0){Wc(e,a,`cycle member(s) ${c.map(e=>`"${e}"`).join(`, `)} contain "/" — set values must be slash-free`);return}if(new Set(o).size!==o.length){Wc(e,a,`cycle members must be unique — the successor of a duplicated member is ambiguous`);return}return o}}}function ul(){return{required:!0,json:{const:!0},parse:(e,t,n,r)=>{if(r[n]!==!0){Wc(e,`${t}.${n}`,`int must be the literal true (declares the key an unbounded integer cursor — a paged picker's page key), got ${_s(r[n])}`);return}return!0}}}function dl(){return{required:!0,json:{type:`integer`},parse:(e,t,n,r)=>{let i=r[n];if(typeof i!=`number`||!Number.isInteger(i)){Wc(e,`${t}.${n}`,`${n} must be an integer, got ${_s(i)}`);return}return i}}}function fl(e,t){if(t===void 0)return{};if(!hs(t))return e.issues.push({path:`helpers`,message:`helpers must be an object, got ${gs(t)}`,line:Q(e.source,[`helpers`])}),{};let n=Object.create(null);for(let[r,i]of Object.entries(t)){if(typeof i!=`string`){e.issues.push({path:`helpers.${r}`,message:`helpers.${r} must be a string template body, got ${_s(i)}`,line:Q(e.source,[`helpers`,r])});continue}n[r]=i}return n}const pl=/{{([\s\S]*?)}}/g,ml=/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|`[^`]*`/g,hl=/(?<![A-Za-z0-9_)])\.([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)*)/g;function gl(e){let t=new Set,n;for(pl.lastIndex=0;(n=pl.exec(e))!==null;){let e=n[1].replace(ml,``),r;for(hl.lastIndex=0;(r=hl.exec(e))!==null;)t.add(r[1])}return t}const _l=/\baction\s+$/;function vl(e){let t=new Set;pl.lastIndex=0;let n;for(;(n=pl.exec(e))!==null;){let e=n[1],r=0,i;for(ml.lastIndex=0;(i=ml.exec(e))!==null;)_l.test(e.slice(r,i.index))&&t.add(i[0].slice(1,-1)),r=i.index+i[0].length}return t}const yl=/\bpicker\s+$/;function bl(e){let t=new Set;pl.lastIndex=0;let n;for(;(n=pl.exec(e))!==null;){let e=n[1],r=0,i=0,a;for(ml.lastIndex=0;(a=ml.exec(e))!==null;)yl.test(e.slice(r,a.index))&&(i=2),i>0&&(t.add(a[0].slice(1,-1)),i--),r=a.index+a[0].length}return t}function xl(e,t){if(t.has(e))return!0;let n=`${e}.`;for(let e of t)if(e.startsWith(n))return!0;return!1}function Sl(e,t){let n=new Set(Object.keys(t.variables));for(let[e,r]of Object.entries(t.segments))if(r.vars)for(let t of Object.keys(r.vars))n.add(`${e}.${t}`);let r=Ol(e.source),i=Q(e.source,[r]);for(let a of Fn(t.root))a.when!==void 0&&Dl(e,`${r}.when`,a.when,n,{line:i}),a.kind===`segment`&&(Object.prototype.hasOwnProperty.call(t.segments,a.name)||e.issues.push({path:r,message:`${r} entry "${a.name}" does not match any declared segment`,line:i}));for(let[r,i]of Object.entries(t.variables))Tl(e,`variables.${r}`,i,n);for(let[r,i]of Object.entries(t.segments)){if(i.vars)for(let[t,a]of Object.entries(i.vars))Tl(e,`segments.${r}.vars.${t}`,a,n,r);for(let a of[`template`,`bg`,`fg`,`when`]){let o=i[a];if(typeof o==`string`){Dl(e,`segments.${r}.${a}`,o,n,{segCtx:r});for(let n of vl(o))Object.prototype.hasOwnProperty.call(t.actions,n)||e.issues.push({path:`segments.${r}.${a}`,message:`${a} references unknown action "${n}"`,line:Q(e.source,[`segments`,r,a])});for(let n of bl(o))Object.prototype.hasOwnProperty.call(t.actions,n)||e.issues.push({path:`segments.${r}.${a}`,message:`${a} references unknown action "${n}" (in a picker)`,line:Q(e.source,[`segments`,r,a])})}}}for(let[r,i]of Object.entries(t.variables))El(e,`variables.${r}`,i,n);for(let[r,i]of Object.entries(t.segments))if(i.vars)for(let[t,a]of Object.entries(i.vars))El(e,`segments.${r}.vars.${t}`,a,n,r);(Cl(t)||wl(t))&&!Object.prototype.hasOwnProperty.call(t.variables,`session.id`)&&e.issues.push({path:`variables.session.id`,message:`state reads and action set-writes require a global "session.id" variable (segment-local declarations do not satisfy this — declareState/set-state both read the global box; conventionally { kind: "input", path: "session_id" })`,line:Q(e.source,[`variables`])})}function Cl(e){for(let t of Object.values(e.variables))if(t.kind===`state`)return!0;for(let t of Object.values(e.segments))if(t.vars){for(let e of Object.values(t.vars))if(e.kind===`state`)return!0}return!1}function wl(e){return Object.values(e.actions).some(Hc)}function Tl(e,t,n,r,i){n.kind===`template`&&Dl(e,`${t}.template`,n.template,r,{segCtx:i}),In(n)&&n.cache&&`key`in n.cache&&Dl(e,`${t}.cache.key`,n.cache.key,r,{segCtx:i})}function El(e,t,n,r,i){if(In(n)&&n.cache&&`depends_on`in n.cache)for(let a=0;a<n.cache.depends_on.length;a++){let o=n.cache.depends_on[a];if(r.has(o))continue;let s=i===void 0?void 0:`${i}.${o}`,c=s!==void 0&&r.has(s)?` (segment-local vars are namespaced — write "${s}")`:``;e.issues.push({path:`${t}.cache.depends_on[${a}]`,message:`cache.depends_on references unknown variable "${o}"${c}`,line:Q(e.source,[...t.split(`.`),`cache`,`depends_on`])})}}function Dl(e,t,n,r,i){for(let a of gl(n)){if(xl(a,r))continue;let n=i?.segCtx===void 0?void 0:`${i.segCtx}.${a}`,o=n!==void 0&&xl(n,r)?` (segment-local vars are namespaced — write ".${n}")`:``;e.issues.push({path:t,message:`Template references unknown variable ".${a}"${o}`,line:i?.line??Q(e.source,t.split(`.`))})}}function Ol(e){try{let t=Wn.default.parse(e);if(hs(t)&&`root`in t)return`root`}catch{}return`layout`}function kl(e,t){let{graph:n,nodeInfo:r}=Al(t),i=new Map,a=[];for(let e of n.keys())i.set(e,0);for(let e of n.keys())if(i.get(e)===0&&o(e))return;function o(t){i.set(t,1),a.push(t);for(let s of n.get(t)??[]){let t=i.get(s);if(t===1){let t=a.indexOf(s),n=[...a.slice(t),s],i=n[0],o=r.get(i);return e.issues.push({path:o?.declarationPath??`variables.${i}`,message:`Dependency cycle: ${n.join(` → `)}`,line:Q(e.source,o?.linePathParts??[`variables`,i])}),!0}if(t===0&&o(s))return!0}return i.set(t,2),a.pop(),!1}}function Al(e){let t=new Set(Object.keys(e.variables)),n=new Map;for(let t of Object.keys(e.variables))n.set(t,{declarationPath:`variables.${t}`,linePathParts:[`variables`,t]});for(let[r,i]of Object.entries(e.segments))if(i.vars)for(let e of Object.keys(i.vars)){let i=`${r}.${e}`;t.add(i),n.set(i,{declarationPath:`segments.${r}.vars.${e}`,linePathParts:[`segments`,r,`vars`,e]})}let r=new Map;for(let e of t)r.set(e,new Set);let i=(e,n)=>{for(let i of gl(n)){if(t.has(i)){r.get(e).add(i);continue}let n=i.split(`.`)[0];n!==i&&t.has(n)&&r.get(e).add(n)}},a=(e,n)=>{if(n.kind===`template`&&i(e,n.template),In(n)&&(n.cache&&`key`in n.cache&&i(e,n.cache.key),n.cache&&`depends_on`in n.cache))for(let i of n.cache.depends_on)t.has(i)&&r.get(e).add(i)};for(let[t,n]of Object.entries(e.variables))a(t,n);for(let[t,n]of Object.entries(e.segments))if(n.vars)for(let[e,r]of Object.entries(n.vars))a(`${t}.${e}`,r);return{graph:r,nodeInfo:n}}const jl=[`json5`,`json`];function Ml(e){return e===`~`||e.startsWith(`~/`)||e.startsWith(`~\\`)?u.homedir()+e.slice(1):e}function Nl(e,t,n){if(n)return[n];let r=process.env.CC_CANDYBAR_CONFIG;if(r)return[Ml(r)];let i=t??process.cwd(),a=process.env.XDG_CONFIG_HOME??o.join(u.homedir(),`.config`);return[...e?jl.map(t=>o.join(e,`.cc-candybar.${t}`)):[],...jl.map(e=>o.join(i,`.cc-candybar.${e}`)),...jl.map(e=>o.join(a,`cc-candybar`,`config.${e}`))]}function Pl(e,t,r){return Nl(e,t,r).find(n.existsSync)??null}function Fl(e,t){let r=Nl(e,t),i=new Set,a=[];for(let e of r)i.has(e)||(i.add(e),n.existsSync(e)&&a.push(e));let s=new Map;for(let e of a){let t=o.dirname(e),n=o.basename(e).replace(/\.(json5|json)$/,``),r=o.join(t,n);s.has(r)||s.set(r,[]),s.get(r).push(e)}let c=[...s.values()].filter(e=>e.length>1);return c.length===0?null:`config-extension collision: ${c.map(e=>{let[t,...n]=e;return`${t} shadows ${n.join(`, `)}`}).join(`; `)} — remove the duplicate`}function Il(e,t=Zn,r){let i=e===null?``:n.readFileSync(e,`utf-8`);return{config:Ps(e===null?{}:Rl(e,i,r),t),source:i}}function Ll(e,t=`<config>`,n=``,r=new Set(ns())){let i=[],a={source:n,issues:i,allowedPalettes:r,groups:[]};if(Sl(a,e),kl(a,e),i.length>0)throw new os(t,i);return e}function Rl(e,t,n=new Set(ns())){let r=zl(e,t),i=[],a={source:t,issues:i,allowedPalettes:n,groups:[]};if(!hs(r))throw new os(e,[{path:``,message:`Config root must be an object, got ${gs(r)}`}]);let o=Bl(a,r);if(i.length>0)throw new os(e,i);return o}function zl(e,t){try{return Wn.default.parse(t)}catch(t){let n=t;throw new os(e,[{path:``,message:`JSON5 syntax error: ${n.message}`,line:n.lineNumber,col:n.columnNumber}])}}function Bl(e,t){for(let n of Object.keys(t))Vl.has(n)||e.issues.push({path:n,message:`Unknown top-level key "${n}". Expected one of: ${[...Vl].join(`, `)}`,line:Q(e.source,[n])});let n={};return t.globals!==void 0&&(n.globals=Is(e,t.globals)),t.variables!==void 0&&(n.variables=Ys(e,`variables`,t.variables)),t.segments!==void 0&&(n.segments=fc(e,t.segments)),t.layout!==void 0&&e.issues.push({path:`layout`,message:`"layout" is no longer supported — use "root" with the A-grammar instead.
84
+ New: { h: ["seg1", "seg2"] }`,line:Q(e.source,[`root`])}),gc;if(n.kind===`group`){let r=vs(e,Pc,t,n);return r===null?gc:(e.groups.push({name:r.name,label:r.label,...r.open!==void 0&&{open:r.open},...r.direction!==void 0&&{direction:r.direction},...r.key!==void 0&&{key:r.key},...r.bg!==void 0&&{bg:r.bg},...r.fg!==void 0&&{fg:r.fg},...r.when!==void 0&&{when:r.when},path:t}),Ic(r))}let r=`h`in n,i=`v`in n,a=`seg`in n;if(+!!r+ +!!i+ +!!a>1){let r=[`seg`,`h`,`v`].filter(e=>e in n);return e.issues.push({path:t,message:`a layout node may have exactly one of "seg", "h", or "v" — got ${r.map(e=>`"${e}"`).join(` and `)} together`,line:Q(e.source,[`root`])}),gc}if(a){let r=vs(e,wc,t,n);return r===null?gc:{kind:`segment`,name:r.seg,...r.when!==void 0&&{when:r.when}}}if(r){let r=vs(e,Tc,t,n);return r===null?gc:{kind:`container`,direction:`horizontal`,children:r.h,...r.when!==void 0&&{when:r.when}}}if(i){let r=vs(e,Ec,t,n);return r===null?gc:{kind:`container`,direction:`vertical`,children:r.v,...r.when!==void 0&&{when:r.when}}}return e.issues.push({path:`${t}.kind`,message:`a layout node "kind" must be "container", "segment", or "group", or use the terse A-grammar: a bare string, or an object with "seg", "h", or "v" (got ${JSON.stringify(n.kind)})`,line:Q(e.source,[`root`])}),gc},Oc=`groups.`,kc=`closed`,Ac=/^[A-Za-z_][A-Za-z0-9_]*$/;function jc(){return{required:!0,json:{type:`string`,pattern:Ac.source},parse:(e,t,n,r)=>{let i=r[n];if(typeof i!=`string`||!Ac.test(i)||i===kc){e.issues.push({path:`${t}.${n}`,message:`a group "name" must be an identifier (letters, digits, _; not starting with a digit) and not the reserved "${kc}", got ${_s(i)}`,line:Q(e.source,[`root`])});return}return i}}}function Mc(){return{required:!1,json:{type:`string`,minLength:1},parse:(e,t,n,r)=>{let i=r[n];if(i!==void 0){if(typeof i!=`string`||i===``||i.includes(`/`)){e.issues.push({path:`${t}.${n}`,message:`a group "key" must be a non-empty, slash-free SessionState key, got ${_s(i)}`,line:Q(e.source,[`root`])});return}return i}}}}function Nc(){return{required:!0,json:{type:`string`,pattern:`^[^\\n\\r]*$`},parse:(e,t,n,r)=>{let i=us(e,t,r,n);if(i!==null){if(/[\n\r]/.test(i)){e.issues.push({path:`${t}.${n}`,message:`${t}.${n}: group label must not contain newlines`,line:Q(e.source,[...t.split(`.`),n])});return}return i}}}}const Pc={noun:`layout-node key`,fields:{kind:_c(`group`),name:jc(),label:Nc(),open:Es(),direction:ks(Pn),key:Mc(),bg:Ts(),fg:Ts(),when:Ts(),children:bc(Cs(()=>Dc))}};function Fc(e){return e.key??`groups.`+e.name}function Ic(e){let t=Oc+e.name;return{kind:`container`,direction:`vertical`,children:[{kind:`segment`,name:t},{kind:`container`,direction:e.direction??`vertical`,children:e.children,when:`{{ eq .${t} "${e.name}" }}`}],...e.when!==void 0&&{when:e.when}}}function Lc(e){return e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}function Rc(e,t,n){e.issues.push({path:t,message:n,line:Q(e.source,[`root`])})}function zc(e,t){let n=e.groups;if(n.length===0)return;for(let n of[`variables`,`actions`,`segments`])for(let r of Object.keys(t[n]??{}))r.startsWith(`groups.`)&&Rc(e,`${n}.${r}`,`"${r}" is in the reserved "${Oc}" namespace (synthesized by group nodes) — rename it`);let r=new Set;for(let t of n)r.has(t.name)&&Rc(e,t.path,`duplicate group name "${t.name}" — group names must be unique (they name the synthesized state var, action, and toggle segment)`),r.add(t.name);for(let t of n)for(let r of n)t!==r&&t.path.startsWith(`${r.path}.`)&&Fc(t)===Fc(r)&&Rc(e,t.path,`group "${t.name}" shares key "${Fc(t)}" with its ancestor group "${r.name}" — a shared key holds ONE open group, so an ancestor and a descendant cannot share one. Sibling accordions share a key; nested groups use distinct keys.`);let i=new Map;for(let t of n){let n=Fc(t);if(i.has(n)||i.set(n,kc),t.open===!0){let r=i.get(n);r!==kc&&Rc(e,t.path,`groups "${r}" and "${t.name}" share key "${n}" and both declare open: true — a shared key holds one open group; pick one`),i.set(n,t.name)}}let a={},o={},s={};for(let e of n){let t=Oc+e.name,r=Fc(e),c=Lc(e.label),l=n.filter(t=>t!==e&&e.path.startsWith(t.path+`.`)).length,u=` `.repeat(l);a[t]={kind:`state`,key:r,default:i.get(r)},o[t]={set:r,cycle:[kc,e.name]},s[t]={template:`{{ action "${t}" "${u}▸ ${c}" "${u}▾ ${c}" }}`,...e.bg!==void 0&&{bg:e.bg},...e.fg!==void 0&&{fg:e.fg}}}t.variables={...t.variables??{},...a},t.actions={...t.actions??{},...o},t.segments={...t.segments??{},...s}}const Bc=[`themes`,`styles`],Vc=[`set`,`copy`,`open`];function Hc(e){return`set`in e}function Uc(e,t){if(t===void 0)return{};if(!hs(t))return Wc(e,`actions`,`actions must be an object, got ${gs(t)}`),{};let n=Object.create(null);for(let[r,i]of Object.entries(t)){let t=Gc(e,`actions.${r}`,i);t!==null&&(n[r]=t)}return n}function Wc(e,t,n){e.issues.push({path:t,message:n,line:Q(e.source,t.split(`.`))})}function Gc(e,t,n){if(!hs(n))return Wc(e,t,`${t} must be an action object, got ${gs(n)}`),null;let r=Vc.filter(e=>e in n);return r.length===1?Kc[r[0]](e,t,n):(Wc(e,t,`action must declare exactly one of: ${Vc.join(`, `)}${r.length>1?` (found: ${r.join(`, `)})`:``}`),null)}const Kc={set:ol,copy:qc(`copy`),open:qc(`open`)};function qc(e){return(t,n,r)=>{for(let i of Object.keys(r))i!==e&&Wc(t,`${n}.${i}`,`Unknown key "${i}" on a ${e} action. Expected only: ${e}`);let i=us(t,n,r,e);return i===null?null:{[e]:i}}}function Jc(e,t,n,r,i,a){let o=us(e,t,r,n);if(o===null)return null;let s=`${t}.${n}`;return o===``?(Wc(e,s,i),null):o.includes(`/`)?(Wc(e,s,a(o)),null):o}function Yc(e,t,n){return Jc(e,t,`set`,n,`set key must be non-empty (the SessionState key to write)`,e=>`set key "${e}" contains "/" — state keys must be slash-free`)}const Xc={to:sl()},Zc={from:cl()},Qc={min:dl(),max:dl(),by:dl()},$c={int:ul()},el={cycle:ll()},tl={ok:e=>e.min<e.max,issue:e=>({field:`min`,message:`min (${e.min}) must be less than max (${e.max})`})},nl={ok:e=>e.by!==0,issue:()=>({field:`by`,message:`by must be a non-zero integer (the per-click increment; negative steps down)`})};function rl(e,...t){let n=Object.keys(e),r=(t,n,r)=>ys(t,e,n,r),i=As(e);return{detect:n,allowed:[`set`,...n],label:n.join(`/`),json:{type:`object`,properties:{set:{type:`string`},...i.properties},required:[`set`,...i.required??[]],additionalProperties:!1},parse:t.length?ws(r,...t):r}}const il=[rl(Xc),rl(Zc),rl(Qc,tl,nl),rl($c),rl(el)],al=`a set action declares exactly one value source: "to" (a literal value), "from" (an option domain: ${Bc.join(`/`)}), "min"/"max"/"by" (a bounded step), "int" (an unbounded integer cursor), or "cycle" (an enumerated domain stepped in order)`;function ol(e,t,n){let r=Yc(e,t,n),i=il.filter(e=>e.detect.some(e=>e in n));if(i.length!==1)return Wc(e,t,`${al}${i.length>1?` — found: ${i.map(e=>e.label).join(`, `)}`:``}`),null;let a=i[0];for(let r of Object.keys(n))a.allowed.includes(r)||Wc(e,`${t}.${r}`,`Unknown key "${r}" on this set action. Expected one of: ${a.allowed.join(`, `)}`);let o=a.parse(e,t,n);return r===null||o===null?null:{set:r,...o}}function sl(){return{required:!0,json:{type:`string`},parse:(e,t,n,r)=>Jc(e,t,n,r,`set value must be non-empty — an empty value cannot be delivered on the set-state wire`,e=>`set value "${e}" contains "/" — set values must be slash-free`)??void 0}}function cl(){return{required:!0,json:{enum:[...Bc]},parse:(e,t,n,r)=>{let i=r[n];if(typeof i!=`string`||!Bc.includes(i)){Wc(e,`${t}.${n}`,`from must be one of: ${Bc.join(`, `)}, got ${_s(i)}`);return}return i}}}function ll(){return{required:!0,json:{type:`array`,items:{type:`string`,minLength:1},minItems:2,uniqueItems:!0},parse:(e,t,n,r)=>{let i=r[n],a=`${t}.${n}`;if(!Array.isArray(i)||i.some(e=>typeof e!=`string`)){Wc(e,a,`cycle must be an array of strings (the enumerated values a click steps through), got ${gs(i)}`);return}let o=i;if(o.length<2){Wc(e,a,`cycle needs at least two members (one member has no successor — use a literal "to")`);return}let s=o.some(e=>e===``),c=o.filter(e=>e.includes(`/`));if(s){Wc(e,a,`cycle members must be non-empty — an empty value cannot be delivered on the set-state wire`);return}if(c.length>0){Wc(e,a,`cycle member(s) ${c.map(e=>`"${e}"`).join(`, `)} contain "/" — set values must be slash-free`);return}if(new Set(o).size!==o.length){Wc(e,a,`cycle members must be unique — the successor of a duplicated member is ambiguous`);return}return o}}}function ul(){return{required:!0,json:{const:!0},parse:(e,t,n,r)=>{if(r[n]!==!0){Wc(e,`${t}.${n}`,`int must be the literal true (declares the key an unbounded integer cursor — a paged picker's page key), got ${_s(r[n])}`);return}return!0}}}function dl(){return{required:!0,json:{type:`integer`},parse:(e,t,n,r)=>{let i=r[n];if(typeof i!=`number`||!Number.isInteger(i)){Wc(e,`${t}.${n}`,`${n} must be an integer, got ${_s(i)}`);return}return i}}}function fl(e,t){if(t===void 0)return{};if(!hs(t))return e.issues.push({path:`helpers`,message:`helpers must be an object, got ${gs(t)}`,line:Q(e.source,[`helpers`])}),{};let n=Object.create(null);for(let[r,i]of Object.entries(t)){if(typeof i!=`string`){e.issues.push({path:`helpers.${r}`,message:`helpers.${r} must be a string template body, got ${_s(i)}`,line:Q(e.source,[`helpers`,r])});continue}n[r]=i}return n}const pl=/{{([\s\S]*?)}}/g,ml=/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|`[^`]*`/g,hl=/(?<![A-Za-z0-9_)])\.([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)*)/g;function gl(e){let t=new Set,n;for(pl.lastIndex=0;(n=pl.exec(e))!==null;){let e=n[1].replace(ml,``),r;for(hl.lastIndex=0;(r=hl.exec(e))!==null;)t.add(r[1])}return t}const _l=/\baction\s+$/;function vl(e){let t=new Set;pl.lastIndex=0;let n;for(;(n=pl.exec(e))!==null;){let e=n[1],r=0,i;for(ml.lastIndex=0;(i=ml.exec(e))!==null;)_l.test(e.slice(r,i.index))&&t.add(i[0].slice(1,-1)),r=i.index+i[0].length}return t}const yl=/\bpicker\s+$/;function bl(e){let t=new Set;pl.lastIndex=0;let n;for(;(n=pl.exec(e))!==null;){let e=n[1],r=0,i=0,a;for(ml.lastIndex=0;(a=ml.exec(e))!==null;)yl.test(e.slice(r,a.index))&&(i=2),i>0&&(t.add(a[0].slice(1,-1)),i--),r=a.index+a[0].length}return t}function xl(e,t){if(t.has(e))return!0;let n=`${e}.`;for(let e of t)if(e.startsWith(n))return!0;return!1}const Sl={gitTaculous:`gitaculous`};function Cl(e,t){let n=new Set(Object.keys(t.variables));for(let[e,r]of Object.entries(t.segments))if(r.vars)for(let t of Object.keys(r.vars))n.add(`${e}.${t}`);let r=kl(e.source),i=Q(e.source,[r]);for(let a of Fn(t.root))if(a.when!==void 0&&Ol(e,`${r}.when`,a.when,n,{line:i}),a.kind===`segment`&&!Object.prototype.hasOwnProperty.call(t.segments,a.name)){let t=Sl[a.name],n=t===void 0?``:` (the built-in segment "${a.name}" was renamed to "${t}" — update this reference)`;e.issues.push({path:r,message:`${r} entry "${a.name}" does not match any declared segment${n}`,line:i})}for(let[r,i]of Object.entries(t.variables))El(e,`variables.${r}`,i,n);for(let[r,i]of Object.entries(t.segments)){if(i.vars)for(let[t,a]of Object.entries(i.vars))El(e,`segments.${r}.vars.${t}`,a,n,r);for(let a of[`template`,`bg`,`fg`,`when`]){let o=i[a];if(typeof o==`string`){Ol(e,`segments.${r}.${a}`,o,n,{segCtx:r});for(let n of vl(o))Object.prototype.hasOwnProperty.call(t.actions,n)||e.issues.push({path:`segments.${r}.${a}`,message:`${a} references unknown action "${n}"`,line:Q(e.source,[`segments`,r,a])});for(let n of bl(o))Object.prototype.hasOwnProperty.call(t.actions,n)||e.issues.push({path:`segments.${r}.${a}`,message:`${a} references unknown action "${n}" (in a picker)`,line:Q(e.source,[`segments`,r,a])})}}}for(let[r,i]of Object.entries(t.variables))Dl(e,`variables.${r}`,i,n);for(let[r,i]of Object.entries(t.segments))if(i.vars)for(let[t,a]of Object.entries(i.vars))Dl(e,`segments.${r}.vars.${t}`,a,n,r);(wl(t)||Tl(t))&&!Object.prototype.hasOwnProperty.call(t.variables,`session.id`)&&e.issues.push({path:`variables.session.id`,message:`state reads and action set-writes require a global "session.id" variable (segment-local declarations do not satisfy this — declareState/set-state both read the global box; conventionally { kind: "input", path: "session_id" })`,line:Q(e.source,[`variables`])})}function wl(e){for(let t of Object.values(e.variables))if(t.kind===`state`)return!0;for(let t of Object.values(e.segments))if(t.vars){for(let e of Object.values(t.vars))if(e.kind===`state`)return!0}return!1}function Tl(e){return Object.values(e.actions).some(Hc)}function El(e,t,n,r,i){n.kind===`template`&&Ol(e,`${t}.template`,n.template,r,{segCtx:i}),In(n)&&n.cache&&`key`in n.cache&&Ol(e,`${t}.cache.key`,n.cache.key,r,{segCtx:i})}function Dl(e,t,n,r,i){if(In(n)&&n.cache&&`depends_on`in n.cache)for(let a=0;a<n.cache.depends_on.length;a++){let o=n.cache.depends_on[a];if(r.has(o))continue;let s=i===void 0?void 0:`${i}.${o}`,c=s!==void 0&&r.has(s)?` (segment-local vars are namespaced — write "${s}")`:``;e.issues.push({path:`${t}.cache.depends_on[${a}]`,message:`cache.depends_on references unknown variable "${o}"${c}`,line:Q(e.source,[...t.split(`.`),`cache`,`depends_on`])})}}function Ol(e,t,n,r,i){for(let a of gl(n)){if(xl(a,r))continue;let n=i?.segCtx===void 0?void 0:`${i.segCtx}.${a}`,o=n!==void 0&&xl(n,r)?` (segment-local vars are namespaced — write ".${n}")`:``;e.issues.push({path:t,message:`Template references unknown variable ".${a}"${o}`,line:i?.line??Q(e.source,t.split(`.`))})}}function kl(e){try{let t=Wn.default.parse(e);if(hs(t)&&`root`in t)return`root`}catch{}return`layout`}function Al(e,t){let{graph:n,nodeInfo:r}=jl(t),i=new Map,a=[];for(let e of n.keys())i.set(e,0);for(let e of n.keys())if(i.get(e)===0&&o(e))return;function o(t){i.set(t,1),a.push(t);for(let s of n.get(t)??[]){let t=i.get(s);if(t===1){let t=a.indexOf(s),n=[...a.slice(t),s],i=n[0],o=r.get(i);return e.issues.push({path:o?.declarationPath??`variables.${i}`,message:`Dependency cycle: ${n.join(` → `)}`,line:Q(e.source,o?.linePathParts??[`variables`,i])}),!0}if(t===0&&o(s))return!0}return i.set(t,2),a.pop(),!1}}function jl(e){let t=new Set(Object.keys(e.variables)),n=new Map;for(let t of Object.keys(e.variables))n.set(t,{declarationPath:`variables.${t}`,linePathParts:[`variables`,t]});for(let[r,i]of Object.entries(e.segments))if(i.vars)for(let e of Object.keys(i.vars)){let i=`${r}.${e}`;t.add(i),n.set(i,{declarationPath:`segments.${r}.vars.${e}`,linePathParts:[`segments`,r,`vars`,e]})}let r=new Map;for(let e of t)r.set(e,new Set);let i=(e,n)=>{for(let i of gl(n)){if(t.has(i)){r.get(e).add(i);continue}let n=i.split(`.`)[0];n!==i&&t.has(n)&&r.get(e).add(n)}},a=(e,n)=>{if(n.kind===`template`&&i(e,n.template),In(n)&&(n.cache&&`key`in n.cache&&i(e,n.cache.key),n.cache&&`depends_on`in n.cache))for(let i of n.cache.depends_on)t.has(i)&&r.get(e).add(i)};for(let[t,n]of Object.entries(e.variables))a(t,n);for(let[t,n]of Object.entries(e.segments))if(n.vars)for(let[e,r]of Object.entries(n.vars))a(`${t}.${e}`,r);return{graph:r,nodeInfo:n}}const Ml=[`json5`,`json`];function Nl(e){return e===`~`||e.startsWith(`~/`)||e.startsWith(`~\\`)?u.homedir()+e.slice(1):e}function Pl(e,t,n){if(n)return[n];let r=process.env.CC_CANDYBAR_CONFIG;if(r)return[Nl(r)];let i=t??process.cwd(),a=process.env.XDG_CONFIG_HOME??o.join(u.homedir(),`.config`);return[...e?Ml.map(t=>o.join(e,`.cc-candybar.${t}`)):[],...Ml.map(e=>o.join(i,`.cc-candybar.${e}`)),...Ml.map(e=>o.join(a,`cc-candybar`,`config.${e}`))]}function Fl(e,t,r){return Pl(e,t,r).find(n.existsSync)??null}function Il(e,t){let r=Pl(e,t),i=new Set,a=[];for(let e of r)i.has(e)||(i.add(e),n.existsSync(e)&&a.push(e));let s=new Map;for(let e of a){let t=o.dirname(e),n=o.basename(e).replace(/\.(json5|json)$/,``),r=o.join(t,n);s.has(r)||s.set(r,[]),s.get(r).push(e)}let c=[...s.values()].filter(e=>e.length>1);return c.length===0?null:`config-extension collision: ${c.map(e=>{let[t,...n]=e;return`${t} shadows ${n.join(`, `)}`}).join(`; `)} — remove the duplicate`}function Ll(e,t=Zn,r){let i=e===null?``:n.readFileSync(e,`utf-8`);return{config:Ps(e===null?{}:zl(e,i,r),t),source:i}}function Rl(e,t=`<config>`,n=``,r=new Set(ns())){let i=[],a={source:n,issues:i,allowedPalettes:r,groups:[]};if(Cl(a,e),Al(a,e),i.length>0)throw new os(t,i);return e}function zl(e,t,n=new Set(ns())){let r=Bl(e,t),i=[],a={source:t,issues:i,allowedPalettes:n,groups:[]};if(!hs(r))throw new os(e,[{path:``,message:`Config root must be an object, got ${gs(r)}`}]);let o=Vl(a,r);if(i.length>0)throw new os(e,i);return o}function Bl(e,t){try{return Wn.default.parse(t)}catch(t){let n=t;throw new os(e,[{path:``,message:`JSON5 syntax error: ${n.message}`,line:n.lineNumber,col:n.columnNumber}])}}function Vl(e,t){for(let n of Object.keys(t))Hl.has(n)||e.issues.push({path:n,message:`Unknown top-level key "${n}". Expected one of: ${[...Hl].join(`, `)}`,line:Q(e.source,[n])});let n={};return t.globals!==void 0&&(n.globals=Is(e,t.globals)),t.variables!==void 0&&(n.variables=Ys(e,`variables`,t.variables)),t.segments!==void 0&&(n.segments=fc(e,t.segments)),t.layout!==void 0&&e.issues.push({path:`layout`,message:`"layout" is no longer supported — use "root" with the A-grammar instead.
85
85
  Replace: layout: [["seg1", "seg2"], ["seg3"]]
86
86
  With: root: { v: [{ h: ["seg1", "seg2"] }, "seg3"] }
87
- Single-row example: root: { h: ["seg1", "seg2"] }`,line:Q(e.source,[`layout`])}),t.root!==void 0&&(n.root=Dc(e,`root`,t.root)),t.actions!==void 0&&(n.actions=Uc(e,t.actions)),t.helpers!==void 0&&(n.helpers=fl(e,t.helpers)),zc(e,n),n}const Vl=new Set([`globals`,`variables`,`segments`,`layout`,`root`,`actions`,`helpers`]),Hl=/"(?:cache_read_input_tokens|cache_creation_input_tokens)":[1-9]/;function Ul(e){let t;try{t=JSON.parse(e)}catch{return null}let n=t.message?.usage;if(!((n?.cache_read_input_tokens??0)>0||(n?.cache_creation_input_tokens??0)>0))return null;let r=t.timestamp==null?NaN:Date.parse(t.timestamp);return Number.isNaN(r)?null:r}async function Wl(e){let t=await Gl(e);return t.kind===`ok`?N(Math.floor((t.value+36e5)/1e3)):t}async function Gl(e){for(let t of[65536,1048576]){let n=await mn(e,t);if(n.kind!==`ok`)return n;let r=Kl(n.value.buf,n.value.fromStart);if(r!=null)return N(r);if(n.value.fromStart)return Bt}return Bt}function Kl(e,t){let n=e.toString(`utf8`).split(`
88
- `),r=+!t;for(let e=n.length-1;e>=r;e--){let t=n[e];if(!t||!Hl.test(t))continue;let r=Ul(t);if(r!=null)return r}return null}const ql=10*1e3;function Jl(e,t,n,r){let i=n-(t*1e3-r);if(i<3e5||e<=0)return;let a=e/i,o=(100-e)/a;return Math.max(0,Math.round(o/6e4))}function Yl(e,t){if(!(t<60))return e*3600/t}function Xl(e,t,n,r){let i=r-t;if(i<50||i>ql)return;let a=n-e;if(!(a<=0))return a*1e3/i}function Zl(e){let{prev:t,cur:n}=e;if(t===void 0)return;let r=Xl(t.input,t.atMs,n.input,n.atMs),i=Xl(t.output,t.atMs,n.output,n.atMs),a=Xl(t.total,t.atMs,n.total,n.atMs);if(!(r===void 0&&i===void 0&&a===void 0))return{...r!==void 0&&{input:r},...i!==void 0&&{output:i},...a!==void 0&&{total:a}}}function Ql(e){let{samples:t}=e,n=[];for(let e=1;e<t.length;e++){let r=t[e-1],i=t[e],a=i.atMs-r.atMs;if(a<50||a>ql)continue;let o=Xl(r.total,r.atMs,i.total,i.atMs);n.push(o??0)}if(n.length!==0)return n.join(`,`)}function $l(e){let t=new Map;for(let[n,r]of Object.entries(e.variables))t.set(n,r);for(let[n,r]of Object.entries(e.segments))if(r.vars)for(let[e,i]of Object.entries(r.vars))t.set(`${n}.${e}`,i);let n=[],r=new Set;for(let t of Fn(e.root)){if(t.when)for(let e of gl(t.when))n.push(e);if(t.kind!==`segment`)continue;let r=e.segments[t.name];if(r){for(let e of[r.template,r.when,r.bg,r.fg])if(e)for(let t of gl(e))n.push(t)}}let i=new Set;for(;n.length>0;){let e=n.pop();for(let a of eu(t,e)){if(r.has(a))continue;r.add(a);let e=t.get(a);if(e){if(e.kind===`input`)i.add(e.path);else if(e.kind===`template`)for(let t of gl(e.template))n.push(t)}}}return i}function eu(e,t){let n=t;for(;n.length>0;){if(e.has(n))return[n];let t=n.lastIndexOf(`.`);if(t<0)break;n=n.slice(0,t)}let r=`${t}.`,i=[];for(let t of e.keys())t.startsWith(r)&&i.push(t);return i}function tu(e,t){for(let n of e)if(n===t||n.startsWith(t+`.`))return!0;return!1}function nu(e){let t=t=>e.has(t),n=t(`git.staged`)||t(`git.unstaged`)||t(`git.untracked`)||t(`git.conflicts`);return{...t(`git.sha`)&&{showSha:!0},...n&&{showWorkingTree:!0},...t(`git.stash`)&&{showStashCount:!0},...t(`git.upstream`)&&{showUpstream:!0},...t(`git.repoName`)&&{showRepoName:!0},...t(`git.operation`)&&{showOperation:!0},...t(`git.timeSinceCommit`)&&{showTimeSinceCommit:!0},...(t(`git.prNumber`)||t(`git.prState`)||t(`git.prUrl`)||t(`git.prError`))&&{showPullRequest:!0}}}async function ru(e,t,n,r){let i=e=>tu(r,e),a=(t.clock??(()=>new Date))().getTime(),o=(e,t,n)=>t?n().catch(t=>P(`${e}: ${String(t)}`)):Promise.resolve(Bt),[s,c,l,u,d,f,p,m]=await Promise.all([o(`git`,i(`git`),()=>t.gitProvider.getGitInfo(n??e.workspace?.current_dir,nu(r),e.workspace?.project_dir)),o(`session`,i(`session.cost`)||i(`session.tokens`)||i(`burn`),()=>t.usageStore.getUsageInfo(e.session_id,e)),o(`today`,i(`today`),()=>t.usageStore.getTodayInfo(e)),o(`context`,i(`context`),()=>t.contextProvider.getContextInfo(e)),o(`metrics`,i(`metrics`)||i(`burn`),()=>t.metricsProvider.getMetricsInfo(e.session_id,e)),o(`tmux`,i(`tmux`),()=>t.tmuxService.getSessionId()),o(`cache`,i(`cache`),()=>Wl(e.transcript_path)),o(`speed`,i(`speed`),()=>t.usageStore.observeSpeed(e.session_id,e.transcript_path,a))]),h=[],g=e=>{if(e.kind===`failed`){h.push(e.reason);return}return e.kind===`ok`?e.value:void 0},_=ou(s);h.push(..._.failures);let v=g(c),y=g(l),b=g(u),x=g(d),S=g(f),C=g(p);for(let e of h)t.log(`warn`,`provider fetch failed: ${e}`);let ee=e.rate_limits?.five_hour,te=e.rate_limits?.seven_day,w=ee?Jl(ee.used_percentage,ee.resets_at,18e6,a):void 0,ne=te?Jl(te.used_percentage,te.resets_at,6048e5,a):void 0,re=v?.session.cost,ie=x?.sessionDuration,T=i(`burn`)&&re!=null&&ie!=null?Yl(re,ie):void 0,E=g(m),ae=E===void 0?void 0:Zl(E),oe=E===void 0?void 0:Ql(E),se=ae!==void 0||oe!==void 0?{...ae,...oe!==void 0&&{history:oe}}:void 0,ce=i(`theme`)?t.sessionState.get(e.session_id,`theme`):void 0,D=typeof ce==`string`?ce:void 0,le=au(process.env.HOME??process.env.USERPROFILE),ue=e.workspace?{...e.workspace,current_dir:au(e.workspace.current_dir)??``,project_dir:au(e.workspace.project_dir)??``}:e.workspace,O=v===void 0?void 0:iu({cost:v.session.cost,tokens:v.session.tokens}),de=y===void 0?void 0:{cost:y.cost,tokens:y.tokens},fe=x===void 0?void 0:iu({lastResponseTime:x.lastResponseTime,responseTime:x.responseTime,sessionDuration:x.sessionDuration,messageCount:x.messageCount,linesAdded:x.linesAdded,linesRemoved:x.linesRemoved});return{...e,...ue!==void 0&&{workspace:ue},...le!==void 0&&{home:le},..._.git!==void 0&&{git:_.git},...S!==void 0&&{tmux:{session:S}},...D!==void 0&&{theme:D},...O!==void 0&&{session:O},...de!==void 0&&{today:de},...T!==void 0&&{burn:{costPerHour:T}},...se!==void 0&&{speed:se},...i(`block`)&&ee!==void 0&&{block:{nativeUtilization:ee.used_percentage,resetsAt:ee.resets_at,...w!==void 0&&{etaMinutes:w}}},...te!==void 0&&{weekly:{percentage:te.used_percentage,resetsAt:te.resets_at,...ne!==void 0&&{etaMinutes:ne}}},...C!==void 0&&{cache:{expiresAt:C}},...b!==void 0&&{context:{totalTokens:b.totalTokens,contextLeft:b.contextLeftPercentage}},...fe!==void 0&&{metrics:fe}}}function iu(e){let t={},n=!1;for(let r of Object.keys(e)){let i=e[r];i!=null&&(t[r]=i,n=!0)}return n?t:void 0}function au(e){return e===void 0||e.length===0||o.sep!==`\\`?e:e.replace(/\\/g,`/`)}function ou(e){if(e.kind===`absent`)return{failures:[]};if(e.kind===`failed`)return{failures:[e.reason]};let t=e.value,n=[],r=(e,t)=>{if(!(t===void 0||t.kind===`absent`)){if(t.kind===`failed`){n.push(`git.${e}: ${t.reason}`);return}return t.value}},i=r(`aheadBehind`,t.aheadBehind),a=r(`sha`,t.sha),o=r(`operation`,t.operation),s=r(`timeSinceCommit`,t.timeSinceCommit),c=r(`stash`,t.stashCount),l=r(`upstream`,t.upstream),u=r(`repoName`,t.repoName),d=t.pullRequest,f={};return d?.kind===`ok`?(f.prNumber=d.value.number,f.prState=d.value.state,f.prUrl=d.value.url):d?.kind===`failed`&&(n.push(`git.pr: ${d.reason}`),f.prError=d.reason),{git:{branch:t.branch,status:t.status,...i!==void 0&&{ahead:i.ahead,behind:i.behind},...t.workingTree!==void 0&&{staged:t.workingTree.staged,unstaged:t.workingTree.unstaged,untracked:t.workingTree.untracked,conflicts:t.workingTree.conflicts},...a!==void 0&&{sha:a},...o!==void 0&&{operation:o},...s!==void 0&&{timeSinceCommit:s},...c!==void 0&&{stash:c},...l!==void 0&&{upstream:l},...u!==void 0&&{repoName:u},...f},failures:n}}function su(e){let t=typeof e;if(t===`string`||t===`number`||t===`boolean`)return t;throw TypeError(`Variable values must be string|number|boolean (got ${t})`)}function cu(e){return typeof e==`string`?e:String(e)}function lu(e){if(typeof e==`number`)return e;if(typeof e==`boolean`)return+!!e;let t=e.trim();if(t===``)throw TypeError(`Cannot cast empty string to number`);let n=Number(t);if(!Number.isFinite(n))throw TypeError(`Cannot cast ${JSON.stringify(e)} to number`);return n}function uu(e){if(typeof e==`boolean`)return e;if(typeof e==`number`){if(e===0||e===1)return e===1;throw TypeError(`Cannot cast number ${e} to bool (only 0 and 1 are accepted)`)}if(e===`true`)return!0;if(e===`false`)return!1;throw TypeError(`Cannot cast ${JSON.stringify(e)} to bool (expected "true" or "false")`)}var du=class extends Error{name=`TemplateError`;kind=`EvalError`;pos;source;constructor(e,t,n={}){super(e),this.pos=t,this.source=n.source}get sourceSnippet(){return this.source?vu(this.source,this.pos):``}toString(){let e=`${this.name}: ${this.message}\n at line ${this.pos.line}, column ${this.pos.column}`,t=this.sourceSnippet;return t?`${e}\n\n${t}`:e}},fu=class extends du{name=`ParseError`;kind=`ParseError`;expected;found;constructor(e,t,n={}){super(e,t,n),this.expected=n.expected,this.found=n.found}},pu=class extends du{name=`EvalError`;kind=`EvalError`},mu=class extends pu{name=`FuncNotFoundError`;kind=`FuncNotFoundError`;funcName;suggestions;constructor(e,t,n={}){let r=yu(e,n.available??[]),i=r.length===0?``:` (did you mean: ${r.join(`, `)}?)`;super(`function ${JSON.stringify(e)} is not registered${i}`,t,n),this.funcName=e,this.suggestions=r}},hu=class extends pu{name=`TypeMismatchError`;kind=`TypeMismatchError`;funcName;argIndex;expected;receivedSummary;constructor(e,t,n,r,i,a={}){super(`function ${JSON.stringify(e)} arg ${t}: expected ${n}, but a ${r} flowed in. Pass it through \`unstyled\` (or your engine's flatten function) to convert.`,i,a),this.funcName=e,this.argIndex=t,this.expected=n,this.receivedSummary=r}},gu=class extends pu{name=`MissingFieldError`;kind=`MissingFieldError`;path;constructor(e,t,n={}){super(`field "${e.join(`.`)}" not found on receiver`,t,n),this.path=e}},_u=class extends pu{name=`FailError`;kind=`FailError`;constructor(e,t={line:0,column:0,offset:0},n={}){super(e,t,n)}};function vu(e,t){let n=e.split(`
87
+ Single-row example: root: { h: ["seg1", "seg2"] }`,line:Q(e.source,[`layout`])}),t.root!==void 0&&(n.root=Dc(e,`root`,t.root)),t.actions!==void 0&&(n.actions=Uc(e,t.actions)),t.helpers!==void 0&&(n.helpers=fl(e,t.helpers)),zc(e,n),n}const Hl=new Set([`globals`,`variables`,`segments`,`layout`,`root`,`actions`,`helpers`]),Ul=/"(?:cache_read_input_tokens|cache_creation_input_tokens)":[1-9]/;function Wl(e){let t;try{t=JSON.parse(e)}catch{return null}let n=t.message?.usage;if(!((n?.cache_read_input_tokens??0)>0||(n?.cache_creation_input_tokens??0)>0))return null;let r=t.timestamp==null?NaN:Date.parse(t.timestamp);return Number.isNaN(r)?null:r}async function Gl(e){let t=await Kl(e);return t.kind===`ok`?N(Math.floor((t.value+36e5)/1e3)):t}async function Kl(e){for(let t of[65536,1048576]){let n=await mn(e,t);if(n.kind!==`ok`)return n;let r=ql(n.value.buf,n.value.fromStart);if(r!=null)return N(r);if(n.value.fromStart)return Bt}return Bt}function ql(e,t){let n=e.toString(`utf8`).split(`
88
+ `),r=+!t;for(let e=n.length-1;e>=r;e--){let t=n[e];if(!t||!Ul.test(t))continue;let r=Wl(t);if(r!=null)return r}return null}const Jl=10*1e3;function Yl(e,t,n,r){let i=n-(t*1e3-r);if(i<3e5||e<=0)return;let a=e/i,o=(100-e)/a;return Math.max(0,Math.round(o/6e4))}function Xl(e,t){if(!(t<60))return e*3600/t}function Zl(e,t,n,r){let i=r-t;if(i<50||i>Jl)return;let a=n-e;if(!(a<=0))return a*1e3/i}function Ql(e){let{prev:t,cur:n}=e;if(t===void 0)return;let r=Zl(t.input,t.atMs,n.input,n.atMs),i=Zl(t.output,t.atMs,n.output,n.atMs),a=Zl(t.total,t.atMs,n.total,n.atMs);if(!(r===void 0&&i===void 0&&a===void 0))return{...r!==void 0&&{input:r},...i!==void 0&&{output:i},...a!==void 0&&{total:a}}}function $l(e){let{samples:t}=e,n=[];for(let e=1;e<t.length;e++){let r=t[e-1],i=t[e],a=i.atMs-r.atMs;if(a<50||a>Jl)continue;let o=Zl(r.total,r.atMs,i.total,i.atMs);n.push(o??0)}if(n.length!==0)return n.join(`,`)}function eu(e){let t=new Map;for(let[n,r]of Object.entries(e.variables))t.set(n,r);for(let[n,r]of Object.entries(e.segments))if(r.vars)for(let[e,i]of Object.entries(r.vars))t.set(`${n}.${e}`,i);let n=[],r=new Set;for(let t of Fn(e.root)){if(t.when)for(let e of gl(t.when))n.push(e);if(t.kind!==`segment`)continue;let r=e.segments[t.name];if(r){for(let e of[r.template,r.when,r.bg,r.fg])if(e)for(let t of gl(e))n.push(t)}}let i=new Set;for(;n.length>0;){let e=n.pop();for(let a of tu(t,e)){if(r.has(a))continue;r.add(a);let e=t.get(a);if(e){if(e.kind===`input`)i.add(e.path);else if(e.kind===`template`)for(let t of gl(e.template))n.push(t)}}}return i}function tu(e,t){let n=t;for(;n.length>0;){if(e.has(n))return[n];let t=n.lastIndexOf(`.`);if(t<0)break;n=n.slice(0,t)}let r=`${t}.`,i=[];for(let t of e.keys())t.startsWith(r)&&i.push(t);return i}function nu(e,t){for(let n of e)if(n===t||n.startsWith(t+`.`))return!0;return!1}function ru(e){let t=t=>e.has(t),n=t(`git.staged`)||t(`git.unstaged`)||t(`git.untracked`)||t(`git.conflicts`);return{...t(`git.sha`)&&{showSha:!0},...n&&{showWorkingTree:!0},...t(`git.stash`)&&{showStashCount:!0},...t(`git.upstream`)&&{showUpstream:!0},...t(`git.repoName`)&&{showRepoName:!0},...t(`git.operation`)&&{showOperation:!0},...t(`git.timeSinceCommit`)&&{showTimeSinceCommit:!0},...(t(`git.prNumber`)||t(`git.prState`)||t(`git.prUrl`)||t(`git.prError`))&&{showPullRequest:!0}}}async function iu(e,t,n,r){let i=e=>nu(r,e),a=(t.clock??(()=>new Date))().getTime(),o=(e,t,n)=>t?n().catch(t=>P(`${e}: ${String(t)}`)):Promise.resolve(Bt),[s,c,l,u,d,f,p,m]=await Promise.all([o(`git`,i(`git`),()=>t.gitProvider.getGitInfo(n??e.workspace?.current_dir,ru(r),e.workspace?.project_dir)),o(`session`,i(`session.cost`)||i(`session.tokens`)||i(`burn`),()=>t.usageStore.getUsageInfo(e.session_id,e)),o(`today`,i(`today`),()=>t.usageStore.getTodayInfo(e)),o(`context`,i(`context`),()=>t.contextProvider.getContextInfo(e)),o(`metrics`,i(`metrics`)||i(`burn`),()=>t.metricsProvider.getMetricsInfo(e.session_id,e)),o(`tmux`,i(`tmux`),()=>t.tmuxService.getSessionId()),o(`cache`,i(`cache`),()=>Gl(e.transcript_path)),o(`speed`,i(`speed`),()=>t.usageStore.observeSpeed(e.session_id,e.transcript_path,a))]),h=[],g=e=>{if(e.kind===`failed`){h.push(e.reason);return}return e.kind===`ok`?e.value:void 0},_=su(s);h.push(..._.failures);let v=g(c),y=g(l),b=g(u),x=g(d),S=g(f),C=g(p);for(let e of h)t.log(`warn`,`provider fetch failed: ${e}`);let ee=e.rate_limits?.five_hour,te=e.rate_limits?.seven_day,w=ee?Yl(ee.used_percentage,ee.resets_at,18e6,a):void 0,ne=te?Yl(te.used_percentage,te.resets_at,6048e5,a):void 0,re=v?.session.cost,ie=x?.sessionDuration,T=i(`burn`)&&re!=null&&ie!=null?Xl(re,ie):void 0,E=g(m),ae=E===void 0?void 0:Ql(E),oe=E===void 0?void 0:$l(E),se=ae!==void 0||oe!==void 0?{...ae,...oe!==void 0&&{history:oe}}:void 0,ce=i(`theme`)?t.sessionState.get(e.session_id,`theme`):void 0,D=typeof ce==`string`?ce:void 0,le=ou(process.env.HOME??process.env.USERPROFILE),ue=e.workspace?{...e.workspace,current_dir:ou(e.workspace.current_dir)??``,project_dir:ou(e.workspace.project_dir)??``}:e.workspace,O=v===void 0?void 0:au({cost:v.session.cost,tokens:v.session.tokens}),de=y===void 0?void 0:{cost:y.cost,tokens:y.tokens},fe=x===void 0?void 0:au({lastResponseTime:x.lastResponseTime,responseTime:x.responseTime,sessionDuration:x.sessionDuration,messageCount:x.messageCount,linesAdded:x.linesAdded,linesRemoved:x.linesRemoved});return{...e,...ue!==void 0&&{workspace:ue},...le!==void 0&&{home:le},..._.git!==void 0&&{git:_.git},...S!==void 0&&{tmux:{session:S}},...D!==void 0&&{theme:D},...O!==void 0&&{session:O},...de!==void 0&&{today:de},...T!==void 0&&{burn:{costPerHour:T}},...se!==void 0&&{speed:se},...i(`block`)&&ee!==void 0&&{block:{nativeUtilization:ee.used_percentage,resetsAt:ee.resets_at,...w!==void 0&&{etaMinutes:w}}},...te!==void 0&&{weekly:{percentage:te.used_percentage,resetsAt:te.resets_at,...ne!==void 0&&{etaMinutes:ne}}},...C!==void 0&&{cache:{expiresAt:C}},...b!==void 0&&{context:{totalTokens:b.totalTokens,contextLeft:b.contextLeftPercentage}},...fe!==void 0&&{metrics:fe}}}function au(e){let t={},n=!1;for(let r of Object.keys(e)){let i=e[r];i!=null&&(t[r]=i,n=!0)}return n?t:void 0}function ou(e){return e===void 0||e.length===0||o.sep!==`\\`?e:e.replace(/\\/g,`/`)}function su(e){if(e.kind===`absent`)return{failures:[]};if(e.kind===`failed`)return{failures:[e.reason]};let t=e.value,n=[],r=(e,t)=>{if(!(t===void 0||t.kind===`absent`)){if(t.kind===`failed`){n.push(`git.${e}: ${t.reason}`);return}return t.value}},i=r(`aheadBehind`,t.aheadBehind),a=r(`sha`,t.sha),o=r(`operation`,t.operation),s=r(`timeSinceCommit`,t.timeSinceCommit),c=r(`stash`,t.stashCount),l=r(`upstream`,t.upstream),u=r(`repoName`,t.repoName),d=t.pullRequest,f={};return d?.kind===`ok`?(f.prNumber=d.value.number,f.prState=d.value.state,f.prUrl=d.value.url):d?.kind===`failed`&&(n.push(`git.pr: ${d.reason}`),f.prError=d.reason),{git:{branch:t.branch,status:t.status,...i!==void 0&&{ahead:i.ahead,behind:i.behind},...t.workingTree!==void 0&&{staged:t.workingTree.staged,unstaged:t.workingTree.unstaged,untracked:t.workingTree.untracked,conflicts:t.workingTree.conflicts},...a!==void 0&&{sha:a},...o!==void 0&&{operation:o},...s!==void 0&&{timeSinceCommit:s},...c!==void 0&&{stash:c},...l!==void 0&&{upstream:l},...u!==void 0&&{repoName:u},...f},failures:n}}function cu(e){let t=typeof e;if(t===`string`||t===`number`||t===`boolean`)return t;throw TypeError(`Variable values must be string|number|boolean (got ${t})`)}function lu(e){return typeof e==`string`?e:String(e)}function uu(e){if(typeof e==`number`)return e;if(typeof e==`boolean`)return+!!e;let t=e.trim();if(t===``)throw TypeError(`Cannot cast empty string to number`);let n=Number(t);if(!Number.isFinite(n))throw TypeError(`Cannot cast ${JSON.stringify(e)} to number`);return n}function du(e){if(typeof e==`boolean`)return e;if(typeof e==`number`){if(e===0||e===1)return e===1;throw TypeError(`Cannot cast number ${e} to bool (only 0 and 1 are accepted)`)}if(e===`true`)return!0;if(e===`false`)return!1;throw TypeError(`Cannot cast ${JSON.stringify(e)} to bool (expected "true" or "false")`)}var fu=class extends Error{name=`TemplateError`;kind=`EvalError`;pos;source;constructor(e,t,n={}){super(e),this.pos=t,this.source=n.source}get sourceSnippet(){return this.source?yu(this.source,this.pos):``}toString(){let e=`${this.name}: ${this.message}\n at line ${this.pos.line}, column ${this.pos.column}`,t=this.sourceSnippet;return t?`${e}\n\n${t}`:e}},pu=class extends fu{name=`ParseError`;kind=`ParseError`;expected;found;constructor(e,t,n={}){super(e,t,n),this.expected=n.expected,this.found=n.found}},mu=class extends fu{name=`EvalError`;kind=`EvalError`},hu=class extends mu{name=`FuncNotFoundError`;kind=`FuncNotFoundError`;funcName;suggestions;constructor(e,t,n={}){let r=bu(e,n.available??[]),i=r.length===0?``:` (did you mean: ${r.join(`, `)}?)`;super(`function ${JSON.stringify(e)} is not registered${i}`,t,n),this.funcName=e,this.suggestions=r}},gu=class extends mu{name=`TypeMismatchError`;kind=`TypeMismatchError`;funcName;argIndex;expected;receivedSummary;constructor(e,t,n,r,i,a={}){super(`function ${JSON.stringify(e)} arg ${t}: expected ${n}, but a ${r} flowed in. Pass it through \`unstyled\` (or your engine's flatten function) to convert.`,i,a),this.funcName=e,this.argIndex=t,this.expected=n,this.receivedSummary=r}},_u=class extends mu{name=`MissingFieldError`;kind=`MissingFieldError`;path;constructor(e,t,n={}){super(`field "${e.join(`.`)}" not found on receiver`,t,n),this.path=e}},vu=class extends mu{name=`FailError`;kind=`FailError`;constructor(e,t={line:0,column:0,offset:0},n={}){super(e,t,n)}};function yu(e,t){let n=e.split(`
89
89
  `),r=t.line-1,i=[];if(r-1>=0&&r-1<n.length&&i.push({num:r,text:n[r-1]??``}),r>=0&&r<n.length&&i.push({num:r+1,text:n[r]??``}),r+1<n.length&&i.push({num:r+2,text:n[r+1]??``}),i.length===0)return``;let a=String(i[i.length-1]?.num??1).length,o=[];for(let e of i)if(o.push(` ${String(e.num).padStart(a,` `)} | ${e.text}`),e.num===t.line){let e=` ${` `.repeat(a)} | `,n=` `.repeat(Math.max(0,t.column-1));o.push(`${e}${n}^`)}return o.join(`
90
- `)}function yu(e,t){if(t.length===0)return[];let n=t.map(t=>({name:t,dist:bu(e,t)})).sort((e,t)=>e.dist-t.dist),r=Math.max(2,Math.floor(e.length/2));return n.filter(e=>e.dist<=r).slice(0,3).map(e=>e.name)}function bu(e,t){if(e===t)return 0;let n=e.length,r=t.length;if(n===0)return r;if(r===0)return n;let i=Array(r+1),a=Array(r+1);for(let e=0;e<=r;e++)i[e]=e;for(let o=1;o<=n;o++){a[0]=o;for(let n=1;n<=r;n++){let r=e[o-1]===t[n-1]?0:1;a[n]=Math.min((a[n-1]??0)+1,(i[n]??0)+1,(i[n-1]??0)+r)}for(let e=0;e<=r;e++)i[e]=a[e]??0}return i[r]??0}function xu(e){throw Error(`unhandled node kind: ${JSON.stringify(e)}`)}const Su=new Map([[`if`,`If`],[`else`,`Else`],[`end`,`End`],[`range`,`Range`],[`with`,`With`],[`break`,`Break`],[`continue`,`Continue`],[`define`,`Define`],[`template`,`Template`],[`block`,`Block`],[`true`,`Bool`],[`false`,`Bool`],[`nil`,`Nil`]]),Cu={left:`{{`,right:`}}`};var wu=class{src;leftDelim;rightDelim;offset=0;line=1;column=1;mode=`text`;pending;constructor(e,t=Cu){this.src=e,this.leftDelim=t.left,this.rightDelim=t.right}pos(){return{line:this.line,column:this.column,offset:this.offset}}err(e,t,n={}){return new fu(e,t,{...n,source:this.src})}next(){if(this.pending){let e=this.pending;return this.pending=void 0,e}return this.read()}peek(){return this.pending||=this.read(),this.pending}read(){switch(this.mode){case`text`:return this.readText();case`action`:return this.readAction();case`done`:return this.makeToken(`EOF`,``,this.pos())}}readText(){if(this.offset>=this.src.length)return this.mode=`done`,this.makeToken(`EOF`,``,this.pos());let e=this.pos(),t=this.offset;for(;t<this.src.length&&!this.src.startsWith(this.leftDelim,t);)t+=1;let n=t<this.src.length&&this.src[t+this.leftDelim.length]===`-`,r=t;if(n)for(;r>this.offset&&Tu(this.src[r-1]??``);)--r;if(r>this.offset){let t=this.src.slice(this.offset,r);return this.advanceTo(r),this.makeToken(`Text`,t,e)}return this.advanceTo(t),this.emitLeftDelim(n)}emitLeftDelim(e){let t=this.pos();if(this.advanceBy(this.leftDelim.length),e)for(this.advanceBy(1);Tu(this.src[this.offset]??``);)this.advanceBy(1);return this.mode=`action`,this.src.startsWith(`/*`,this.offset)?this.readComment(t,e):this.makeToken(`LeftDelim`,e?`${this.leftDelim}-`:this.leftDelim,t,e?{trimLeft:!0}:{})}readComment(e,t){this.advanceBy(2);let n=this.offset,r=this.src.indexOf(`*/`,this.offset);if(r===-1)throw this.err(`unclosed comment`,e,{expected:`*/${this.rightDelim}`,found:`end of input`});this.advanceTo(r);let i=this.src.slice(n,r).trim();for(this.advanceBy(2);Tu(this.src[this.offset]??``);)this.advanceBy(1);let a=!1;if(this.src[this.offset]===`-`&&(a=!0,this.advanceBy(1)),!this.src.startsWith(this.rightDelim,this.offset))throw this.err(`expected \`${this.rightDelim}\` to close comment`,this.pos(),{expected:this.rightDelim,found:this.src[this.offset]??`end of input`});if(this.advanceBy(this.rightDelim.length),a)for(;Tu(this.src[this.offset]??``);)this.advanceBy(1);return this.mode=`text`,this.makeToken(`Comment`,i,e,{...t?{trimLeft:!0}:{},...a?{trimRight:!0}:{}})}readAction(){if(this.skipActionSpaces(),this.src.startsWith(`-${this.rightDelim}`,this.offset)){let e=this.pos();for(this.advanceBy(1+this.rightDelim.length),this.mode=`text`;Tu(this.src[this.offset]??``);)this.advanceBy(1);return this.makeToken(`RightDelim`,`-${this.rightDelim}`,e,{trimRight:!0})}if(this.src.startsWith(this.rightDelim,this.offset)){let e=this.pos();return this.advanceBy(this.rightDelim.length),this.mode=`text`,this.makeToken(`RightDelim`,this.rightDelim,e)}if(this.offset>=this.src.length)throw this.err(`unclosed action`,this.pos(),{expected:this.rightDelim,found:`end of input`});let e=this.src[this.offset],t=this.pos();switch(e){case`(`:return this.advanceBy(1),this.makeToken(`LeftParen`,`(`,t);case`)`:return this.advanceBy(1),this.makeToken(`RightParen`,`)`,t);case`|`:return this.advanceBy(1),this.makeToken(`Pipe`,`|`,t);case`,`:return this.advanceBy(1),this.makeToken(`Comma`,`,`,t);case`:`:if(this.src[this.offset+1]===`=`)return this.advanceBy(2),this.makeToken(`Declare`,`:=`,t);throw this.err("expected `:=`",t,{expected:`:=`,found:`:`});case`=`:return this.advanceBy(1),this.makeToken(`Assign`,`=`,t);case`"`:return this.readQuotedString(t);case"`":return this.readRawString(t);case`'`:return this.readChar(t)}if(e===`$`)return this.readVariable(t);if(e!==void 0&&(Du(e)||Eu(e)&&Du(this.src[this.offset+1]??``)||e===`.`&&Du(this.src[this.offset+1]??``)))return this.readNumber(t);if(e===`.`)return this.readDotOrField(t);if(e!==void 0&&Mu(e))return this.readIdentifier(t);throw this.err(`unexpected character ${JSON.stringify(e)}`,t,{found:e??`end of input`})}readQuotedString(e){let t=this.offset;for(this.advanceBy(1);this.offset<this.src.length;){let n=this.src[this.offset];if(n===`\\`){this.advanceBy(1),this.offset<this.src.length&&this.advanceBy(1);continue}if(n===`
90
+ `)}function bu(e,t){if(t.length===0)return[];let n=t.map(t=>({name:t,dist:xu(e,t)})).sort((e,t)=>e.dist-t.dist),r=Math.max(2,Math.floor(e.length/2));return n.filter(e=>e.dist<=r).slice(0,3).map(e=>e.name)}function xu(e,t){if(e===t)return 0;let n=e.length,r=t.length;if(n===0)return r;if(r===0)return n;let i=Array(r+1),a=Array(r+1);for(let e=0;e<=r;e++)i[e]=e;for(let o=1;o<=n;o++){a[0]=o;for(let n=1;n<=r;n++){let r=e[o-1]===t[n-1]?0:1;a[n]=Math.min((a[n-1]??0)+1,(i[n]??0)+1,(i[n-1]??0)+r)}for(let e=0;e<=r;e++)i[e]=a[e]??0}return i[r]??0}function Su(e){throw Error(`unhandled node kind: ${JSON.stringify(e)}`)}const Cu=new Map([[`if`,`If`],[`else`,`Else`],[`end`,`End`],[`range`,`Range`],[`with`,`With`],[`break`,`Break`],[`continue`,`Continue`],[`define`,`Define`],[`template`,`Template`],[`block`,`Block`],[`true`,`Bool`],[`false`,`Bool`],[`nil`,`Nil`]]),wu={left:`{{`,right:`}}`};var Tu=class{src;leftDelim;rightDelim;offset=0;line=1;column=1;mode=`text`;pending;constructor(e,t=wu){this.src=e,this.leftDelim=t.left,this.rightDelim=t.right}pos(){return{line:this.line,column:this.column,offset:this.offset}}err(e,t,n={}){return new pu(e,t,{...n,source:this.src})}next(){if(this.pending){let e=this.pending;return this.pending=void 0,e}return this.read()}peek(){return this.pending||=this.read(),this.pending}read(){switch(this.mode){case`text`:return this.readText();case`action`:return this.readAction();case`done`:return this.makeToken(`EOF`,``,this.pos())}}readText(){if(this.offset>=this.src.length)return this.mode=`done`,this.makeToken(`EOF`,``,this.pos());let e=this.pos(),t=this.offset;for(;t<this.src.length&&!this.src.startsWith(this.leftDelim,t);)t+=1;let n=t<this.src.length&&this.src[t+this.leftDelim.length]===`-`,r=t;if(n)for(;r>this.offset&&Eu(this.src[r-1]??``);)--r;if(r>this.offset){let t=this.src.slice(this.offset,r);return this.advanceTo(r),this.makeToken(`Text`,t,e)}return this.advanceTo(t),this.emitLeftDelim(n)}emitLeftDelim(e){let t=this.pos();if(this.advanceBy(this.leftDelim.length),e)for(this.advanceBy(1);Eu(this.src[this.offset]??``);)this.advanceBy(1);return this.mode=`action`,this.src.startsWith(`/*`,this.offset)?this.readComment(t,e):this.makeToken(`LeftDelim`,e?`${this.leftDelim}-`:this.leftDelim,t,e?{trimLeft:!0}:{})}readComment(e,t){this.advanceBy(2);let n=this.offset,r=this.src.indexOf(`*/`,this.offset);if(r===-1)throw this.err(`unclosed comment`,e,{expected:`*/${this.rightDelim}`,found:`end of input`});this.advanceTo(r);let i=this.src.slice(n,r).trim();for(this.advanceBy(2);Eu(this.src[this.offset]??``);)this.advanceBy(1);let a=!1;if(this.src[this.offset]===`-`&&(a=!0,this.advanceBy(1)),!this.src.startsWith(this.rightDelim,this.offset))throw this.err(`expected \`${this.rightDelim}\` to close comment`,this.pos(),{expected:this.rightDelim,found:this.src[this.offset]??`end of input`});if(this.advanceBy(this.rightDelim.length),a)for(;Eu(this.src[this.offset]??``);)this.advanceBy(1);return this.mode=`text`,this.makeToken(`Comment`,i,e,{...t?{trimLeft:!0}:{},...a?{trimRight:!0}:{}})}readAction(){if(this.skipActionSpaces(),this.src.startsWith(`-${this.rightDelim}`,this.offset)){let e=this.pos();for(this.advanceBy(1+this.rightDelim.length),this.mode=`text`;Eu(this.src[this.offset]??``);)this.advanceBy(1);return this.makeToken(`RightDelim`,`-${this.rightDelim}`,e,{trimRight:!0})}if(this.src.startsWith(this.rightDelim,this.offset)){let e=this.pos();return this.advanceBy(this.rightDelim.length),this.mode=`text`,this.makeToken(`RightDelim`,this.rightDelim,e)}if(this.offset>=this.src.length)throw this.err(`unclosed action`,this.pos(),{expected:this.rightDelim,found:`end of input`});let e=this.src[this.offset],t=this.pos();switch(e){case`(`:return this.advanceBy(1),this.makeToken(`LeftParen`,`(`,t);case`)`:return this.advanceBy(1),this.makeToken(`RightParen`,`)`,t);case`|`:return this.advanceBy(1),this.makeToken(`Pipe`,`|`,t);case`,`:return this.advanceBy(1),this.makeToken(`Comma`,`,`,t);case`:`:if(this.src[this.offset+1]===`=`)return this.advanceBy(2),this.makeToken(`Declare`,`:=`,t);throw this.err("expected `:=`",t,{expected:`:=`,found:`:`});case`=`:return this.advanceBy(1),this.makeToken(`Assign`,`=`,t);case`"`:return this.readQuotedString(t);case"`":return this.readRawString(t);case`'`:return this.readChar(t)}if(e===`$`)return this.readVariable(t);if(e!==void 0&&(Ou(e)||Du(e)&&Ou(this.src[this.offset+1]??``)||e===`.`&&Ou(this.src[this.offset+1]??``)))return this.readNumber(t);if(e===`.`)return this.readDotOrField(t);if(e!==void 0&&Nu(e))return this.readIdentifier(t);throw this.err(`unexpected character ${JSON.stringify(e)}`,t,{found:e??`end of input`})}readQuotedString(e){let t=this.offset;for(this.advanceBy(1);this.offset<this.src.length;){let n=this.src[this.offset];if(n===`\\`){this.advanceBy(1),this.offset<this.src.length&&this.advanceBy(1);continue}if(n===`
91
91
  `)throw this.err(`newline in interpreted string`,e,{found:`\\n`});if(n===`"`)return this.advanceBy(1),this.makeToken(`String`,this.src.slice(t,this.offset),e);this.advanceBy(1)}throw this.err(`unterminated string literal`,e,{expected:`"`,found:`end of input`})}readRawString(e){let t=this.offset;for(this.advanceBy(1);this.offset<this.src.length;){if(this.src[this.offset]==="`")return this.advanceBy(1),this.makeToken(`String`,this.src.slice(t,this.offset),e);this.advanceBy(1)}throw this.err(`unterminated raw string literal`,e,{expected:"`",found:`end of input`})}readChar(e){let t=this.offset;for(this.advanceBy(1);this.offset<this.src.length;){let n=this.src[this.offset];if(n===`\\`){this.advanceBy(1),this.offset<this.src.length&&this.advanceBy(1);continue}if(n===`
92
- `)throw this.err(`newline in rune literal`,e,{found:`\\n`});if(n===`'`)return this.advanceBy(1),this.makeToken(`Char`,this.src.slice(t,this.offset),e);this.advanceBy(1)}throw this.err(`unterminated rune literal`,e,{expected:`'`,found:`end of input`})}readNumber(e){let t=this.offset;if(Eu(this.src[this.offset]??``)&&this.advanceBy(1),this.src[this.offset]===`0`&&this.offset+1<this.src.length){let n=this.src[this.offset+1];if(n===`x`||n===`X`){for(this.advanceBy(2);Ou(this.src[this.offset]??``)||this.src[this.offset]===`_`;)this.advanceBy(1);if(this.src[this.offset]===`.`||this.src[this.offset]===`p`||this.src[this.offset]===`P`)for(;this.isHexFloatTail(this.src[this.offset]??``);)this.advanceBy(1);return this.finishNumber(t,e)}if(n===`o`||n===`O`){for(this.advanceBy(2);ku(this.src[this.offset]??``)||this.src[this.offset]===`_`;)this.advanceBy(1);return this.finishNumber(t,e)}if(n===`b`||n===`B`){for(this.advanceBy(2);Au(this.src[this.offset]??``)||this.src[this.offset]===`_`;)this.advanceBy(1);return this.finishNumber(t,e)}}for(;Du(this.src[this.offset]??``)||this.src[this.offset]===`_`;)this.advanceBy(1);if(this.src[this.offset]===`.`)for(this.advanceBy(1);Du(this.src[this.offset]??``)||this.src[this.offset]===`_`;)this.advanceBy(1);if(this.src[this.offset]===`e`||this.src[this.offset]===`E`)for(this.advanceBy(1),Eu(this.src[this.offset]??``)&&this.advanceBy(1);Du(this.src[this.offset]??``);)this.advanceBy(1);return this.src[this.offset]===`i`&&this.advanceBy(1),this.finishNumber(t,e)}isHexFloatTail(e){return Ou(e)||e===`.`||e===`p`||e===`P`||e===`+`||e===`-`||e===`_`}finishNumber(e,t){if(this.offset===e)throw this.err(`expected number`,t,{expected:`digit`});return this.makeToken(`Number`,this.src.slice(e,this.offset),t)}readVariable(e){let t=this.offset;for(this.advanceBy(1);Nu(this.src[this.offset]??``);)this.advanceBy(1);for(;this.src[this.offset]===`.`&&Mu(this.src[this.offset+1]??``);)for(this.advanceBy(1);Nu(this.src[this.offset]??``);)this.advanceBy(1);return this.makeToken(`Variable`,this.src.slice(t,this.offset),e)}readDotOrField(e){let t=this.offset;if(this.advanceBy(1),!Mu(this.src[this.offset]??``))return this.makeToken(`Dot`,`.`,e);for(;Nu(this.src[this.offset]??``);)this.advanceBy(1);for(;this.src[this.offset]===`.`&&Mu(this.src[this.offset+1]??``);)for(this.advanceBy(1);Nu(this.src[this.offset]??``);)this.advanceBy(1);return this.makeToken(`Field`,this.src.slice(t,this.offset),e)}readIdentifier(e){let t=this.offset;for(;Nu(this.src[this.offset]??``);)this.advanceBy(1);let n=this.src.slice(t,this.offset),r=Su.get(n);return r?this.makeToken(r,n,e):this.makeToken(`Identifier`,n,e)}skipActionSpaces(){for(;this.offset<this.src.length;){let e=this.src[this.offset];if(e===` `||e===` `||e===`\r`||e===`
92
+ `)throw this.err(`newline in rune literal`,e,{found:`\\n`});if(n===`'`)return this.advanceBy(1),this.makeToken(`Char`,this.src.slice(t,this.offset),e);this.advanceBy(1)}throw this.err(`unterminated rune literal`,e,{expected:`'`,found:`end of input`})}readNumber(e){let t=this.offset;if(Du(this.src[this.offset]??``)&&this.advanceBy(1),this.src[this.offset]===`0`&&this.offset+1<this.src.length){let n=this.src[this.offset+1];if(n===`x`||n===`X`){for(this.advanceBy(2);ku(this.src[this.offset]??``)||this.src[this.offset]===`_`;)this.advanceBy(1);if(this.src[this.offset]===`.`||this.src[this.offset]===`p`||this.src[this.offset]===`P`)for(;this.isHexFloatTail(this.src[this.offset]??``);)this.advanceBy(1);return this.finishNumber(t,e)}if(n===`o`||n===`O`){for(this.advanceBy(2);Au(this.src[this.offset]??``)||this.src[this.offset]===`_`;)this.advanceBy(1);return this.finishNumber(t,e)}if(n===`b`||n===`B`){for(this.advanceBy(2);ju(this.src[this.offset]??``)||this.src[this.offset]===`_`;)this.advanceBy(1);return this.finishNumber(t,e)}}for(;Ou(this.src[this.offset]??``)||this.src[this.offset]===`_`;)this.advanceBy(1);if(this.src[this.offset]===`.`)for(this.advanceBy(1);Ou(this.src[this.offset]??``)||this.src[this.offset]===`_`;)this.advanceBy(1);if(this.src[this.offset]===`e`||this.src[this.offset]===`E`)for(this.advanceBy(1),Du(this.src[this.offset]??``)&&this.advanceBy(1);Ou(this.src[this.offset]??``);)this.advanceBy(1);return this.src[this.offset]===`i`&&this.advanceBy(1),this.finishNumber(t,e)}isHexFloatTail(e){return ku(e)||e===`.`||e===`p`||e===`P`||e===`+`||e===`-`||e===`_`}finishNumber(e,t){if(this.offset===e)throw this.err(`expected number`,t,{expected:`digit`});return this.makeToken(`Number`,this.src.slice(e,this.offset),t)}readVariable(e){let t=this.offset;for(this.advanceBy(1);Pu(this.src[this.offset]??``);)this.advanceBy(1);for(;this.src[this.offset]===`.`&&Nu(this.src[this.offset+1]??``);)for(this.advanceBy(1);Pu(this.src[this.offset]??``);)this.advanceBy(1);return this.makeToken(`Variable`,this.src.slice(t,this.offset),e)}readDotOrField(e){let t=this.offset;if(this.advanceBy(1),!Nu(this.src[this.offset]??``))return this.makeToken(`Dot`,`.`,e);for(;Pu(this.src[this.offset]??``);)this.advanceBy(1);for(;this.src[this.offset]===`.`&&Nu(this.src[this.offset+1]??``);)for(this.advanceBy(1);Pu(this.src[this.offset]??``);)this.advanceBy(1);return this.makeToken(`Field`,this.src.slice(t,this.offset),e)}readIdentifier(e){let t=this.offset;for(;Pu(this.src[this.offset]??``);)this.advanceBy(1);let n=this.src.slice(t,this.offset),r=Cu.get(n);return r?this.makeToken(r,n,e):this.makeToken(`Identifier`,n,e)}skipActionSpaces(){for(;this.offset<this.src.length;){let e=this.src[this.offset];if(e===` `||e===` `||e===`\r`||e===`
93
93
  `)this.advanceBy(1);else return}}advanceBy(e){for(let t=0;t<e;t++){let e=this.src[this.offset];this.offset+=1,e===`
94
- `?(this.line+=1,this.column=1):this.column+=1}}advanceTo(e){for(;this.offset<e;)this.advanceBy(1)}makeToken(e,t,n,r={}){return Object.freeze({type:e,value:t,pos:n,...r.trimLeft===void 0?{}:{trimLeft:r.trimLeft},...r.trimRight===void 0?{}:{trimRight:r.trimRight}})}};function Tu(e){return e===` `||e===` `||e===`\r`||e===`
95
- `}function Eu(e){return e===`+`||e===`-`}function Du(e){return e>=`0`&&e<=`9`}function Ou(e){return Du(e)||e>=`a`&&e<=`f`||e>=`A`&&e<=`F`}function ku(e){return e>=`0`&&e<=`7`}function Au(e){return e===`0`||e===`1`}function ju(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`}function Mu(e){return ju(e)||e===`_`}function Nu(e){return Mu(e)||Du(e)}function Pu(e,t){return new Fu(e,t).parseTemplate()}var Fu=class{lex;buf=[];defines=new Map;source;rangeDepth=0;constructor(e,t){this.source=e,this.lex=t?new wu(e,t):new wu(e)}peek(e=0){for(;this.buf.length<=e;)this.buf.push(this.lex.next());return this.buf[e]}next(){return this.buf.length>0?this.buf.shift():this.lex.next()}expect(e,t){let n=this.next();if(n.type!==e)throw this.errAt(n,`expected ${t}`,{expected:t,found:Ru(n)});return n}errAt(e,t,n={}){return new fu(t,e.pos,{...n,source:this.source})}parseTemplate(){let e=this.parseList();if(this.peek().type!==`EOF`){let e=this.peek(),t=this.peek(1);if(e.type===`LeftDelim`&&(t.type===`Else`||t.type===`End`)){let n=t.type===`Else`?`else`:`end`;throw this.errAt(e,`unexpected \`{{${n}}}\` outside of \`if\`, \`range\`, \`with\`, or \`block\``,{found:`{{${n}}}`})}throw this.errAt(e,`unexpected ${Ru(e)}`,{found:Ru(e)})}return{root:e,defines:this.defines,source:this.source}}parseList(){let e=this.peek().pos,t=[];for(;;){let n=this.peek();if(n.type===`EOF`)break;if(n.type===`Text`){this.next(),t.push({type:`Text`,pos:n.pos,text:n.value});continue}if(n.type===`Comment`){this.next();let e=Lu(n);t.push({type:`Comment`,pos:n.pos,text:n.value,trim:e});continue}if(n.type===`LeftDelim`){let n=this.peek(1).type;if(n===`Else`||n===`End`)return Iu(e,t);let r=this.parseAction();r!==null&&t.push(r);continue}throw this.errAt(n,`unexpected ${Ru(n)} at top level`,{found:Ru(n)})}return Iu(e,t)}parseAction(){let e=this.expect(`LeftDelim`,"`{{`"),t=e.trimLeft===!0,n=this.peek();switch(n.type){case`If`:return this.next(),this.parseBranch(`If`,e.pos,t);case`Range`:return this.next(),this.parseBranch(`Range`,e.pos,t);case`With`:return this.next(),this.parseBranch(`With`,e.pos,t);case`Break`:return this.next(),this.parseBreakOrContinue(`Break`,e.pos,t);case`Continue`:return this.next(),this.parseBreakOrContinue(`Continue`,e.pos,t);case`Template`:return this.next(),this.parseTemplateInvocation(e.pos,t);case`Block`:return this.next(),this.parseBlock(e.pos,t);case`Define`:return this.next(),this.parseDefine(e.pos,t),null;case`RightDelim`:throw this.errAt(n,`empty action`,{expected:`pipeline`});default:{let n=this.parsePipeline(),r=this.expect(`RightDelim`,"`}}`");return{type:`Action`,pos:e.pos,pipe:n,trim:{trimLeft:t,trimRight:r.trimRight===!0}}}}}parseBranch(e,t,n){let r=this.parsePipeline();this.expect(`RightDelim`,"`}}`"),e===`Range`&&(this.rangeDepth+=1);let i=this.parseList();e===`Range`&&--this.rangeDepth;let a=this.parseElsePart(),o={trimLeft:n,trimRight:a.endConsumed?a.endRight:this.consumeEnd()},s=a.list?{pipe:r,list:i,elseList:a.list,trim:o}:{pipe:r,list:i,trim:o};switch(e){case`If`:return{type:`If`,pos:t,...s};case`Range`:return{type:`Range`,pos:t,...s};case`With`:return{type:`With`,pos:t,...s}}}parseBreakOrContinue(e,t,n){if(this.rangeDepth===0)throw new fu(`{{${e===`Break`?`break`:`continue`}}} outside of {{range}}`,t,{source:this.source});let r={trimLeft:n,trimRight:this.expect(`RightDelim`,"`}}`").trimRight===!0};return e===`Break`?{type:`Break`,pos:t,trim:r}:{type:`Continue`,pos:t,trim:r}}parseElsePart(){if(this.peek().type!==`LeftDelim`||this.peek(1).type!==`Else`)return{list:void 0,endRight:!1,endConsumed:!1};let e=this.next();if(this.next(),this.peek().type===`If`){this.next();let t=this.parseBranch(`If`,e.pos,e.trimLeft===!0);return{list:{type:`List`,pos:e.pos,nodes:[t]},endRight:t.trim.trimRight,endConsumed:!0}}return this.expect(`RightDelim`,"`}}`"),{list:this.parseList(),endRight:!1,endConsumed:!1}}consumeEnd(){return this.expect(`LeftDelim`,"`{{end}}`"),this.expect(`End`,"`end`"),this.expect(`RightDelim`,"`}}`").trimRight===!0}parseTemplateInvocation(e,t){let n=this.parseQuotedName(),r=this.peek().type===`RightDelim`?void 0:this.parsePipeline(),i={trimLeft:t,trimRight:this.expect(`RightDelim`,"`}}`").trimRight===!0};return r?{type:`Template`,pos:e,name:n,pipe:r,trim:i}:{type:`Template`,pos:e,name:n,trim:i}}parseBlock(e,t){let n=this.parseQuotedName(),r=this.peek().type===`RightDelim`?void 0:this.parsePipeline();this.expect(`RightDelim`,"`}}`");let i=this.rangeDepth;this.rangeDepth=0;let a=this.parseList();this.rangeDepth=i;let o={trimLeft:t,trimRight:this.consumeEnd()};return this.defines.has(n)||this.defines.set(n,a),r?{type:`Block`,pos:e,name:n,pipe:r,list:a,trim:o}:{type:`Block`,pos:e,name:n,list:a,trim:o}}parseDefine(e,t){let n=this.parseQuotedName();this.expect(`RightDelim`,"`}}`");let r=this.rangeDepth;this.rangeDepth=0;let i=this.parseList();if(this.rangeDepth=r,this.consumeEnd(),this.defines.has(n))throw new fu(`redefinition of template ${JSON.stringify(n)}`,i.pos,{source:this.source});this.defines.set(n,i)}parseQuotedName(){let e=this.next();if(e.type!==`String`)throw this.errAt(e,`expected template name (quoted string)`,{expected:`string`,found:Ru(e)});return Ku(e.value,e.pos,this.source)}parsePipeline(){let e=this.peek().pos,t=this.tryParseDecls(),n=[this.parseCommand()];for(;this.peek().type===`Pipe`;){this.next();let e=this.peek();if(!zu(e.type))throw this.errAt(e,"missing command after `|`",{expected:`command`,found:Ru(e)});n.push(this.parseCommand())}return{type:`Pipe`,pos:e,decls:t?.vars??[],isAssign:t?.isAssign??!1,cmds:n}}tryParseDecls(){if(this.peek().type!==`Variable`)return;let e=1;for(;this.peek(e).type===`Comma`;){if(this.peek(e+1).type!==`Variable`)return;e+=2}let t=this.peek(e).type;if(t!==`Declare`&&t!==`Assign`)return;let n=[Bu(this.next())];for(;this.peek().type===`Comma`;)this.next(),n.push(Bu(this.expect(`Variable`,`$variable`)));return{vars:n,isAssign:this.next().type===`Assign`}}parseCommand(){let e=this.peek().pos,t=[this.parsePrimary()];for(;zu(this.peek().type);)t.push(this.parsePrimary());return{type:`Command`,pos:e,args:t}}parsePrimary(){let e=this.next();switch(e.type){case`Dot`:return{type:`Dot`,pos:e.pos};case`Field`:return{type:`Field`,pos:e.pos,idents:e.value.slice(1).split(`.`)};case`Variable`:return Bu(e);case`Identifier`:return{type:`Identifier`,pos:e.pos,ident:e.value};case`String`:return{type:`String`,pos:e.pos,raw:e.value,value:Ku(e.value,e.pos,this.source)};case`Number`:return Hu(e);case`Char`:return Uu(e,this.source);case`Bool`:return{type:`Bool`,pos:e.pos,value:e.value===`true`};case`Nil`:return{type:`Nil`,pos:e.pos};case`LeftParen`:return this.parseChainOrPipe(e.pos);default:throw this.errAt(e,`expected command argument, found ${Ru(e)}`,{expected:`command argument`,found:Ru(e)})}}parseChainOrPipe(e){let t=this.parsePipeline(),n=this.expect(`RightParen`,"`)`"),r=[],i=n.pos.offset+1,a=this.peek();return a.type===`Field`&&a.pos.offset===i&&(this.next(),r.push(...a.value.slice(1).split(`.`))),r.length===0?t:{type:`Chain`,pos:e,node:t,fields:r}}};function Iu(e,t){return{type:`List`,pos:e,nodes:t}}function Lu(e){return{trimLeft:e.trimLeft===!0,trimRight:e.trimRight===!0}}function Ru(e){return e.type===`EOF`?`end of input`:e.value||e.type}function zu(e){switch(e){case`Dot`:case`Field`:case`Variable`:case`Identifier`:case`String`:case`Number`:case`Char`:case`Bool`:case`Nil`:case`LeftParen`:return!0;default:return!1}}function Bu(e){return{type:`Variable`,pos:e.pos,idents:Vu(e.value)}}function Vu(e){let t=e.indexOf(`.`);return t===-1?[e]:[e.slice(0,t),...e.slice(t+1).split(`.`)]}function Hu(e){let t=e.value,n=t.replace(/_/g,``),r=n.toLowerCase().endsWith(`i`),i=r?n.slice(0,-1):n,a=!r&&(i.includes(`.`)||!i.startsWith(`0x`)&&!i.startsWith(`0X`)&&/[eE]/.test(i)||(i.startsWith(`0x`)||i.startsWith(`0X`))&&/[pP]/.test(i)),o=!r&&!a,s={type:`Number`,pos:e.pos,text:t,isInt:o,isUint:!1,isFloat:a,isComplex:r};if(o){let e=Wu(i);return{...s,intValue:e}}if(a){let e=Gu(i);return{...s,floatValue:e}}let c=Gu(i);return{...s,complexValue:[0,c]}}function Uu(e,t){let n=qu(e.value,e.pos,t);return{type:`Number`,pos:e.pos,text:e.value,isInt:!0,isUint:!1,isFloat:!1,isComplex:!1,intValue:BigInt(n)}}function Wu(e){let t=1n,n=e;return n.startsWith(`+`)?n=n.slice(1):n.startsWith(`-`)&&(t=-1n,n=n.slice(1)),t*BigInt(n)}function Gu(e){return Number(e)}function Ku(e,t,n){if(e.startsWith("`"))return e.slice(1,-1);let r=``;for(let i=1;i<e.length-1;i++){let a=e[i];if(a!==`\\`){r+=a;continue}let o=e[++i];switch(o){case`n`:r+=`
96
- `;break;case`t`:r+=` `;break;case`r`:r+=`\r`;break;case`\\`:r+=`\\`;break;case`"`:r+=`"`;break;case`'`:r+=`'`;break;case`a`:r+=`\x07`;break;case`b`:r+=`\b`;break;case`f`:r+=`\f`;break;case`v`:r+=`\v`;break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:{let t=o+(e[i+1]??``)+(e[i+2]??``);i+=2,r+=String.fromCodePoint(Number.parseInt(t,8));break}case`x`:{let t=(e[i+1]??``)+(e[i+2]??``);i+=2,r+=String.fromCodePoint(Number.parseInt(t,16));break}case`u`:{let t=e.slice(i+1,i+5);i+=4,r+=String.fromCodePoint(Number.parseInt(t,16));break}case`U`:{let t=e.slice(i+1,i+9);i+=8,r+=String.fromCodePoint(Number.parseInt(t,16));break}default:throw new fu(`bad escape sequence \\${o}`,t,{expected:`valid escape sequence`,found:`\\${o}`,source:n})}}return r}function qu(e,t,n){let r=Ku(`"${e.slice(1,-1).replace(/"/g,`\\"`)}"`,t,n);if(r.length===0)throw new fu(`empty rune literal`,t,{source:n});return r.codePointAt(0)??0}const Ju=Symbol(`go-template-js.MISSING`);function Yu(e,t){if(e==null)return Ju;if(e instanceof Map)return e.has(t)?e.get(t):Ju;if(Array.isArray(e))return Ju;if(typeof e==`object`){let n=e;return t in n?n[t]:Ju}return Ju}function Xu(e,t){let n=e;for(let e of t){if(n===Ju)return Ju;n=Yu(n,e)}return n}function Zu(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||e===void 0||t===void 0||typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length?e.every((e,n)=>Zu(e,t[n])):!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Zu(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>Zu(e[n],t[n])):!1}return!1}const Qu=new WeakSet;function $u(e){return Qu.add(e),e}function ed(e){return Qu.has(e)}function td(e){return e==null||e===!1?!1:typeof e==`number`?e!==0&&!Number.isNaN(e):typeof e==`bigint`?e!==0n:typeof e==`string`||Array.isArray(e)?e.length>0:e instanceof Map||e instanceof Set?e.size>0:typeof e==`object`?Object.keys(e).length>0:!!e}function nd(e){return{eq:{fn:(e,...t)=>t.some(t=>ad(e,t)),argTypes:[`comparable`]},ne:{fn:(e,t)=>!ad(e,t),argTypes:[`comparable`,`comparable`]},lt:{fn:(e,t)=>od(e,t)<0,argTypes:[`ordered`,`ordered`]},le:{fn:(e,t)=>od(e,t)<=0,argTypes:[`ordered`,`ordered`]},gt:{fn:(e,t)=>od(e,t)>0,argTypes:[`ordered`,`ordered`]},ge:{fn:(e,t)=>od(e,t)>=0,argTypes:[`ordered`,`ordered`]},len:{fn:e=>sd(e),argTypes:[`sized`]},index:{fn:(e,...t)=>{let n=e;for(let e of t)n=cd(n,e);return n},argTypes:[`collection`,`index-key`]},slice:{fn:(e,...t)=>{let n=t.length>=1?Number(t[0]):0,r=t.length>=2?Number(t[1]):void 0;return e.slice(n,r)},argTypes:[`sliceable`,`number`]},print:{fn:(...t)=>dd(t,e),argTypes:[`stringifiable`],returnType:`string`},println:{fn:(...t)=>`${dd(t,e)}\n`,argTypes:[`stringifiable`],returnType:`string`},printf:{fn:(t,...n)=>bd(t,n,e),argTypes:[`string`,`stringifiable`],returnType:`string`},call:{fn:(e,...t)=>e(...t),argTypes:[`callable`,`value`]},html:{fn:(...t)=>md(dd(t,e)),argTypes:[`stringifiable`],returnType:`string`},js:{fn:(...t)=>_d(dd(t,e)),argTypes:[`stringifiable`],returnType:`string`},urlquery:{fn:(...t)=>yd(dd(t,e)),argTypes:[`stringifiable`],returnType:`string`},not:{fn:e=>!td(e),argTypes:[`truthy`]}}}function rd(){return{and:$u({argTypes:[`truthy`],fn:(...e)=>{let t=!0;for(let n of e)if(t=n(),!td(t))return t;return t}}),or:$u({argTypes:[`truthy`],fn:(...e)=>{let t=!1;for(let n of e)if(t=n(),td(t))return t;return t}})}}function id(e){return{...nd(e),...rd()}}function ad(e,t){return typeof e==`number`&&typeof t==`bigint`?BigInt(e)===t:typeof e==`bigint`&&typeof t==`number`?e===BigInt(t):Zu(e,t)}function od(e,t){if(typeof e==`bigint`&&typeof t==`bigint`)return e===t?0:e<t?-1:1;if(typeof e==`bigint`||typeof t==`bigint`){let n=typeof e==`bigint`?e:BigInt(Math.trunc(Number(e))),r=typeof t==`bigint`?t:BigInt(Math.trunc(Number(t)));return n===r?0:n<r?-1:1}let n=e,r=t;return n===r?0:n<r?-1:1}function sd(e){return typeof e==`string`||Array.isArray(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function cd(e,t){if(Array.isArray(e)){let n=Number(t);if(!Number.isInteger(n))throw Error(`index: array index must be integer, got ${ld(t)}`);if(n<0||n>=e.length)throw Error(`index: out of range [${n}] with length ${e.length}`);return e[n]}if(e instanceof Map)return e.get(t);if(typeof e==`string`)return e[Number(t)];if(typeof e==`object`&&e){if(typeof t!=`string`)throw Error(`index: object index must be string, got ${ld(t)}`);return e[t]}throw Error(`index: cannot index ${ld(e)}`)}function ld(e){return e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:e instanceof Map?`Map`:typeof e}function ud(e){return e==null?`<nil>`:typeof e==`string`?`string`:typeof e==`boolean`?`bool`:typeof e==`bigint`?`int64`:typeof e==`number`?Number.isInteger(e)?`int`:`float64`:Array.isArray(e)?`[]interface {}`:e instanceof Map||typeof e==`object`?`map[string]interface {}`:typeof e}function dd(e,t){let n=``,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=typeof a==`string`;i>0&&!r&&!o&&(n+=` `),n+=fd(a,t),r=o}return n}function fd(e,t){return e==null?`<nil>`:typeof e==`string`?e:t(e)}const pd={"\0":`�`,'"':`&#34;`,"'":`&#39;`,"&":`&amp;`,"<":`&lt;`,">":`&gt;`};function md(e){return e.replace(/[\0"'&<>]/g,e=>pd[e]??e)}const hd={"\\":`\\\\`,"'":`\\'`,'"':`\\"`,"<":`\\u003C`,">":`\\u003E`,"&":`\\u0026`,"=":`\\u003D`},gd=/^[\p{L}\p{M}\p{N}\p{P}\p{S}]$/u;function _d(e){let t=``;for(let n of e){let e=hd[n];if(e!==void 0){t+=e;continue}let r=n.codePointAt(0);if(r<32||r>=128&&!gd.test(n)){t+=`\\u${r.toString(16).toUpperCase().padStart(4,`0`)}`;continue}t+=n}return t}const vd=new TextEncoder;function yd(e){let t=``,n=vd.encode(e);for(let e of n)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===45||e===46||e===95||e===126?t+=String.fromCharCode(e):e===32?t+=`+`:t+=`%${e.toString(16).toUpperCase().padStart(2,`0`)}`;return t}function bd(e,t,n){let r=``,i=0,a=0;for(;a<e.length;){let o=e[a];if(o!==`%`){r+=o,a+=1;continue}if(e[a+1]===`%`){r+=`%`,a+=2;continue}let s=a+1;for(;s<e.length&&`+-# 0`.includes(e[s]??``);)s+=1;for(;s<e.length&&e[s]!==void 0&&/[0-9]/.test(e[s]);)s+=1;if(e[s]===`.`)for(s+=1;s<e.length&&e[s]!==void 0&&/[0-9]/.test(e[s]);)s+=1;let c=e[s],l=e.slice(a+1,s),u=t[i++];r+=xd(c??``,l,u,n),a=s+1}return r}function xd(e,t,n,r){switch(e){case`s`:return typeof n==`string`?Sd(t,n):Sd(t,fd(n,r));case`d`:return typeof n!=`number`&&typeof n!=`bigint`?`%!${e}(${ud(n)}=${fd(n,r)})`:Sd(t,String(typeof n==`bigint`?n:Math.trunc(n)));case`v`:return Sd(t,Cd(n));case`q`:return Sd(t,JSON.stringify(fd(n,r)));case`f`:{if(typeof n!=`number`&&typeof n!=`bigint`)return`%!${e}(${ud(n)}=${fd(n,r)})`;let i=t.includes(`.`)?Number(t.split(`.`)[1]):6;return Sd(t,Number(n).toFixed(i))}case`t`:return Sd(t,td(n)?`true`:`false`);case`x`:if(typeof n==`string`){let e=new TextEncoder().encode(n),r=``;for(let t of e)r+=t.toString(16).padStart(2,`0`);return Sd(t,r)}return typeof n!=`number`&&typeof n!=`bigint`?`%!${e}(${ud(n)}=${fd(n,r)})`:typeof n==`bigint`?Sd(t,n.toString(16)):Sd(t,Math.trunc(n).toString(16));default:return`%!${e}(${ud(n)}=${fd(n,r)})`}}function Sd(e,t){let n=e.match(/^([+\-# 0]*)/)?.[1]??``,r=e.slice(n.length).match(/^(\d+)/);if(!r)return t;let i=Number(r[1]);if(t.length>=i)return t;let a=` `.repeat(i-t.length);return n.includes(`-`)?t+a:a+t}function Cd(e){return e==null?`<nil>`:typeof e==`string`?e:typeof e==`bigint`?e.toString():Array.isArray(e)?`[${e.map(Cd).join(` `)}]`:e instanceof Map?`map[${[...e.entries()].map(([e,t])=>`${Cd(e)}:${Cd(t)}`).join(` `)}]`:typeof e==`object`?`{${Object.values(e).map(Cd).join(` `)}}`:String(e)}function wd(e){return{dot:e,root:e,parent:void 0,vars:new Map}}function Td(e,t){return{dot:t,root:e.root,parent:e,vars:new Map}}function Ed(e,t){let n=e;for(;n!==void 0;){if(n.vars.has(t))return{found:!0,value:n.vars.get(t)};n=n.parent}return{found:!1}}function Dd(e,t,n){e.vars.set(t,n)}const Od=new Set([`default`,`zero`,`error`]);function kd(e){if(e===void 0)return`default`;if(Od.has(e))return e;throw Error(`EngineConfig.missingKey: expected "default" | "zero" | "error", got ${Ad(e)}`)}function Ad(e){return typeof e==`string`?JSON.stringify(e):e===null?`null`:e===void 0?`undefined`:typeof e==`bigint`?`${e}n`:typeof e==`number`||typeof e==`boolean`?String(e):typeof e==`symbol`?e.toString():typeof e==`function`?`[Function]`:`[${typeof e}]`}function jd(e){if(e!==void 0){if(typeof e!=`object`||!e)throw Error(`EngineConfig.delims: expected { left, right } object, got ${Ad(e)}`);if(typeof e.left!=`string`||e.left.length===0)throw Error(`EngineConfig.delims.left: expected non-empty string, got ${Ad(e.left)}`);if(typeof e.right!=`string`||e.right.length===0)throw Error(`EngineConfig.delims.right: expected non-empty string, got ${Ad(e.right)}`);return{left:e.left,right:e.right}}}const Md=Object.freeze({kind:`break`}),Nd=Object.freeze({kind:`continue`}),Pd={kind:`none`};let Fd;(class e{source;_evaluate;constructor(e,t){this.source=e,this._evaluate=t}static{Fd=(t,n)=>new e(t,n)}evaluate(e){return this._evaluate(e)}});var Id=class{fromString;toString;funcs;missingKey;delims;constructor(e){this.fromString=e.fromString;let t=Object.hasOwn(e,`toString`)?e.toString:void 0;this.toString=t??Gd,this.missingKey=kd(e.missingKey),this.delims=jd(e.delims),this.funcs={...id(this.toString),...e.funcs??{}}}parse(e){let t=Pu(e,this.delims);return Fd(t.source,e=>this.evalParsed(t,e))}compile(e){let t=this.parse(e);return e=>t.evaluate(e)}evaluate(e,t){return e.evaluate(t)}evalParsed(e,t){let n=[],r=wd(t),i={out:n,defines:e.defines,source:e.source};return this.evalList(e.root,r,i),n}evalList(e,t,n){for(let r of e.nodes)this.evalNode(r,t,n)}evalNode(e,t,n){switch(e.type){case`Text`:n.out.push(this.fromString(e.text));return;case`Comment`:return;case`Action`:{let r=this.evalAction(e,t,n);e.pipe.decls.length===0&&this.emitFromValue(r,n);return}case`List`:this.evalList(e,t,n);return;case`If`:this.evalIf(e,t,n);return;case`Range`:this.evalRange(e,t,n);return;case`With`:this.evalWith(e,t,n);return;case`Break`:throw Md;case`Continue`:throw Nd;case`Template`:this.evalTemplateInvoke(e,t,n);return;case`Block`:this.evalBlock(e,t,n);return;case`Pipe`:case`Command`:case`Identifier`:case`Field`:case`Variable`:case`Chain`:case`Dot`:case`Nil`:case`Bool`:case`Number`:case`String`:throw new pu(`unexpected ${e.type} at statement position`,e.pos,{source:n.source});default:xu(e)}}evalIf(e,t,n){td(this.evalPipe(e.pipe,t,n))?this.evalList(e.list,t,n):e.elseList&&this.evalList(e.elseList,t,n)}evalWith(e,t,n){let r=this.evalPipe(e.pipe,t,n);if(td(r)){let i=Td(t,r);this.evalList(e.list,i,n)}else e.elseList&&this.evalList(e.elseList,t,n)}evalRange(e,t,n){let r=this.evalPipeWithoutDecls(e.pipe,t,n),i=e.pipe.decls,a=$d(r);try{if(a.length===0){e.elseList&&this.evalList(e.elseList,t,n);return}for(let[r,o]of a){let a=Td(t,o);if(i.length===1)Dd(a,i[0]?.idents[0]??`$`,o);else if(i.length>=2){let e=i[0]?.idents[0]??`$`,t=i[1]?.idents[0]??`$`;Dd(a,e,r),Dd(a,t,o)}try{this.evalList(e.list,a,n)}catch(e){if(e===Nd)continue;throw e}}}catch(e){if(e===Md)return;throw e}}evalTemplateInvoke(e,t,n){let r=n.defines.get(e.name);if(!r)throw new pu(`template ${JSON.stringify(e.name)} is not defined`,e.pos,{source:n.source});let i=Td(t,e.pipe?this.evalPipe(e.pipe,t,n):t.dot);this.evalList(r,i,n)}evalBlock(e,t,n){let r=Td(t,e.pipe?this.evalPipe(e.pipe,t,n):t.dot),i=n.defines.get(e.name)??e.list;this.evalList(i,r,n)}evalAction(e,t,n){return this.evalPipe(e.pipe,t,n)}evalPipe(e,t,n){if(e.cmds.length===0)throw new pu(`empty pipeline`,e.pos,{source:n.source});let r=this.evalCommand(e.cmds[0],t,n,Pd);for(let i=1;i<e.cmds.length;i++){let a=e.cmds[i];r=this.evalCommand(a,t,n,{kind:`value`,value:r})}if(e.decls.length>0)for(let n of e.decls)Dd(t,n.idents[0]??`$`,r);return r}evalPipeWithoutDecls(e,t,n){let r={type:`Pipe`,pos:e.pos,decls:[],isAssign:!1,cmds:e.cmds};return this.evalPipe(r,t,n)}evalCommand(e,t,n,r){if(e.args.length===0)throw new pu(`empty command`,e.pos,{source:n.source});let i=e.args[0];if(i.type!==`Identifier`){if(e.args.length>1)throw new pu(`cannot apply arguments to a ${i.type} primary; only functions take arguments`,e.pos,{source:n.source});return this.evalPrimary(i,t,n)}let a=this.funcs[i.ident];if(!a)throw new mu(i.ident,i.pos,{source:n.source,available:Object.keys(this.funcs)});let o=e.args.slice(1),s=ed(a),c=o.map(e=>s?()=>this.evalPrimary(e,t,n):this.evalPrimary(e,t,n));if(r.kind===`value`){let e=r.value;c.push(s?()=>e:e)}Vd(i.ident,a.argTypes,c,e.pos,n.source,this.toString,a.argTypePattern,this.fromString);try{return a.fn(...c)}catch(t){throw t instanceof hu?new hu(t.funcName,t.argIndex,t.expected,t.receivedSummary,e.pos,{source:n.source}):t instanceof _u?new _u(t.message,e.pos,{source:n.source}):t}}evalPrimary(e,t,n){switch(e.type){case`Dot`:return t.dot;case`Nil`:return null;case`Bool`:return e.value;case`Number`:return nf(e);case`String`:return e.value;case`Field`:return this.resolveFieldChain(t.dot,e.idents,e.pos,n);case`Variable`:return this.resolveVariable(e.idents,t,e.pos,n);case`Identifier`:{let t=this.funcs[e.ident];if(!t)throw new mu(e.ident,e.pos,{source:n.source,available:Object.keys(this.funcs)});return Vd(e.ident,t.argTypes,[],e.pos,n.source,this.toString,t.argTypePattern,this.fromString),t.fn()}case`Chain`:return this.resolveFieldChain(this.evalPrimary(e.node,t,n),e.fields,e.pos,n);case`Pipe`:return this.evalPipe(e,t,n);default:throw new pu(`cannot evaluate ${e.type} as a value`,e.pos,{source:n.source})}}resolveFieldChain(e,t,n,r){let i=Xu(e,t);if(i!==Ju)return i;if(this.missingKey===`error`)throw new gu(t,n,{source:r.source})}resolveVariable(e,t,n,r){let i=e[0]??`$`;if(i===`$`){let i=e.slice(1);return i.length===0?t.root:this.resolveFieldChain(t.root,i,n,r)}let a=Ed(t,i);if(!a.found)throw new pu(`undefined variable ${i}`,n,{source:r.source});let o=e.slice(1);return o.length===0?a.value:this.resolveFieldChain(a.value,o,n,r)}emitFromValue(e,t){if(e==null){t.out.push(this.fromString(`<no value>`));return}if(typeof e==`string`){t.out.push(this.fromString(e));return}if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`){t.out.push(this.fromString(String(e)));return}if(Array.isArray(e)){t.out.push(this.fromString(Ld(e)));return}if(e instanceof Map){t.out.push(this.fromString(Rd(e)));return}t.out.push(e)}};function Ld(e){return`[${e.map(zd).join(` `)}]`}function Rd(e){let t=[];for(let[n,r]of e)t.push(`${zd(n)}:${zd(r)}`);return`map[${t.join(` `)}]`}function zd(e){return e==null?`<nil>`:Array.isArray(e)?Ld(e):e instanceof Map?Rd(e):String(e)}function Bd(e){return new Id(e)}function Vd(e,t,n,r,i,a=Gd,o,s=Wd){let c=Hd(t,o),l=-1,u=-1;for(let t=0;t<n.length;t++){let o=c(t),d=n[t];if(!Ud(o,d,a))throw new hu(e,t+1,Zd(o),Qd(d),r,{source:i});if(o===`liftable`&&typeof d==`string`&&(n[t]=s(d)),o===`int`?n[t]=Math.trunc(Number(d)):o===`float`&&(n[t]=Number(d)),o===`ordered`){if(l===-1)l=t;else if(!Jd(n[l],d))throw new hu(e,t+1,`${Zd(`ordered`)} of the same kind as ${Qd(n[l])}`,Qd(d),r,{source:i})}if(o===`comparable`){if(u===-1)u=t;else if(!Yd(n[u],d))throw new hu(e,t+1,`${Zd(`comparable`)} of the same kind as ${Qd(n[u])}`,Qd(d),r,{source:i})}}}function Hd(e,t){if(e.length===0)return()=>`value`;if(t===`alternating`){let t=e.length;return n=>e[n%t]}let n=e[e.length-1];return t=>t<e.length?e[t]:n}function Ud(e,t,n){switch(e){case`truthy`:case`reflective`:case`value`:return!0;case`string`:return typeof t==`string`;case`number`:return typeof t==`number`||typeof t==`bigint`;case`int`:return typeof t==`number`&&Number.isFinite(t)||typeof t==`bigint`&&Number.isSafeInteger(Number(t));case`float`:return typeof t==`number`||typeof t==`bigint`&&Number.isFinite(Number(t));case`bool`:return typeof t==`boolean`;case`ordered`:return typeof t==`string`||typeof t==`number`||typeof t==`bigint`||typeof t==`boolean`;case`T`:return t!=null&&typeof t!=`string`&&typeof t!=`number`&&typeof t!=`boolean`&&typeof t!=`bigint`&&typeof t!=`symbol`;case`list`:return Array.isArray(t);case`dict`:return Kd(t);case`sized`:return typeof t==`string`||Array.isArray(t)||t instanceof Map||t instanceof Set||Kd(t);case`comparable`:return t==null||typeof t==`string`||typeof t==`number`||typeof t==`bigint`||typeof t==`boolean`||Array.isArray(t)||t instanceof Map||t instanceof Set||Kd(t);case`callable`:return typeof t==`function`;case`collection`:return typeof t==`string`||Array.isArray(t)||t instanceof Map||Kd(t);case`index-key`:return typeof t==`string`||typeof t==`number`||typeof t==`bigint`;case`sliceable`:return typeof t==`string`||Array.isArray(t);case`stringifiable`:if(typeof t==`string`)return!0;try{return n(t),!0}catch{return!1}case`liftable`:return typeof t==`string`||t!=null&&typeof t!=`number`&&typeof t!=`boolean`&&typeof t!=`bigint`&&typeof t!=`symbol`;case`serializable`:return qd(t)}}function Wd(e){return e}function Gd(e){if(typeof e==`string`)return e;if(e==null)return`<nil>`;if(typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`)return String(e);throw new hu(`<engine.toString>`,1,`string (or a consumer-supplied toString that flattens T)`,Qd(e),{line:0,column:0,offset:0})}function Kd(e){if(typeof e!=`object`||!e||Array.isArray(e)||e instanceof Map||e instanceof Set)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function qd(e){try{return JSON.stringify(e)!==void 0}catch{return!1}}function Jd(e,t){return typeof e==typeof t||typeof e==`number`&&typeof t==`bigint`||typeof e==`bigint`&&typeof t==`number`}function Yd(e,t){let n=Xd(e),r=Xd(t);return n===`nil`||r===`nil`?!0:n===r}function Xd(e){return e==null?`nil`:typeof e==`string`?`string`:typeof e==`number`||typeof e==`bigint`?`number`:typeof e==`boolean`?`boolean`:Array.isArray(e)?`array`:e instanceof Map?`map`:e instanceof Set?`set`:`object`}function Zd(e){switch(e){case`int`:return`integer (finite number or safe-integer bigint)`;case`float`:return`float (number, including NaN/Infinity, or finite-convertible bigint)`;case`T`:return`T (consumer-defined fragment)`;case`ordered`:return`orderable primitive`;case`list`:return`list`;case`dict`:return`dict (plain object)`;case`sized`:return`sized value (string, list, map, set, or dict)`;case`comparable`:return`comparable value (orderable primitive, nil, list, dict, Map, or Set)`;case`stringifiable`:return`stringifiable value (string or convertible via the engine's toString)`;case`liftable`:return`liftable value (T or string, the latter lifted via the engine's fromString)`;case`callable`:return`callable (function value)`;case`collection`:return`collection (string, array, Map, or dict)`;case`index-key`:return`index key (number, bigint, or string)`;case`sliceable`:return`sliceable value (string or array)`;case`serializable`:return`JSON-serializable value`;case`truthy`:case`reflective`:case`value`:case`string`:case`number`:case`bool`:return e}}function Qd(e){return e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:e instanceof Map?`Map`:typeof e}function $d(e){return e==null?[]:Array.isArray(e)?e.map((e,t)=>[t,e]):typeof e==`string`?[...e].map((e,t)=>[t,e]):e instanceof Map?ef([...e.entries()]):e instanceof Set?[...e.values()].map((e,t)=>[t,e]):typeof e==`object`?ef(Object.entries(e)):[]}function ef(e){return[...e].sort((e,t)=>tf(e[0],t[0]))}function tf(e,t){if((typeof e==`number`||typeof e==`bigint`)&&(typeof t==`number`||typeof t==`bigint`)){let n=typeof e==`bigint`?Number(e):e,r=typeof t==`bigint`?Number(t):t;return n===r?0:n<r?-1:1}let n=String(e),r=String(t);return n===r?0:n<r?-1:1}function nf(e){if(e.intValue!==void 0){let t=e.intValue;return t>=BigInt(-(2**53-1))&&t<=BigInt(2**53-1)?Number(t):t}if(e.floatValue!==void 0)return e.floatValue;if(e.complexValue!==void 0)return e.complexValue;throw Error(`internal: NumberNode has none of intValue/floatValue/complexValue — parser invariant violated`)}function rf(e){if(!/^[+-]?\d+$/.test(e))return 0;let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}function af(e){if(typeof e==`number`)return e;if(typeof e==`bigint`)return Number(e);if(typeof e==`string`){let t=Number.parseFloat(e);return Number.isNaN(t)?0:t}return typeof e==`boolean`?+!!e:0}function of(e){if(e===``)return null;let t=1,n=e;return n[0]===`+`?n=n.slice(1):n[0]===`-`&&(t=-1,n=n.slice(1)),n===``?null:/^0x[0-9a-fA-F]+$/i.test(n)?{sign:t,digits:n.slice(2),base:16}:/^0b[01]+$/i.test(n)?{sign:t,digits:n.slice(2),base:2}:/^0o[0-7]+$/i.test(n)?{sign:t,digits:n.slice(2),base:8}:n===`0`?{sign:t,digits:`0`,base:10}:n[0]===`0`?/^0[0-7]+$/.test(n)?{sign:t,digits:n.slice(1),base:8}:null:/^[0-9]+$/.test(n)?{sign:t,digits:n,base:10}:null}function sf(e){if(typeof e==`number`)return Math.trunc(e);if(typeof e==`bigint`)return Number(e);if(typeof e==`string`){let t=of(e);if(t===null)return 0;let n=Number.parseInt(t.digits,t.base);return Number.isNaN(n)?0:t.sign*n}return typeof e==`boolean`?+!!e:0}function cf(e){if(typeof e==`bigint`)return e;if(typeof e==`number`)return BigInt(Math.trunc(e));if(typeof e==`string`){let t=of(e);if(t===null)return 0n;let n=t.base===16?`0x`:t.base===2?`0b`:t.base===8?`0o`:``,r=BigInt(n+t.digits);return t.sign===-1?-r:r}return typeof e==`boolean`&&e?1n:0n}function lf(e){if(!/^[+-]?[0-7]+$/.test(e))return 0;let t=e[0]===`-`?-1:1,n=e[0]===`+`||e[0]===`-`?e.slice(1):e,r=Number.parseInt(n,8);return Number.isNaN(r)?0:t*r}function uf(e){return JSON.stringify(e)??`null`}function df(e){return typeof e==`string`?e:Cd(e)}function ff(e){return e.map(df)}function pf(){return{atoi:{fn:e=>rf(e),argTypes:[`string`],returnType:`number`},int:{fn:e=>sf(e),argTypes:[`value`],returnType:`number`},int64:{fn:e=>cf(e),argTypes:[`value`]},float64:{fn:e=>af(e),argTypes:[`value`],returnType:`number`},toString:{fn:e=>df(e),argTypes:[`value`],returnType:`string`},toStrings:{fn:e=>ff(e),argTypes:[`list`]},toDecimal:{fn:e=>lf(e),argTypes:[`string`],returnType:`number`},toRawJson:{fn:e=>uf(e),argTypes:[`serializable`],returnType:`string`}}}const mf={h:36e11,m:6e10,s:1e9,ms:1e6,us:1e3,µs:1e3,ns:1};function hf(e){if(e===`0`)return 0;let t=!1,n=e;if(n.startsWith(`-`)?(t=!0,n=n.slice(1)):n.startsWith(`+`)&&(n=n.slice(1)),!n)return NaN;let r=0,i=/^(\d+(?:\.\d+)?)(ns|µs|us|ms|[smh])/;for(;n.length>0;){let e=i.exec(n);if(!e)return NaN;let t=parseFloat(e[1]??`0`),a=e[2];r+=t*mf[a],n=n.slice(e[0].length)}return t?-r:r}function gf(e){if(e===0)return`0s`;let t=!1,n=e;n<0&&(t=!0,n=-n);let r;return r=n<mf.us?`${Math.floor(n)}ns`:n<mf.ms?_f(n,mf.us,3,`µs`):n<mf.s?_f(n,mf.ms,6,`ms`):vf(n),t?`-${r}`:r}function _f(e,t,n,r){let i=Math.floor(e/t),a=Math.round(e%t);return a===0?`${i}${r}`:`${i}.${String(a).padStart(n,`0`).replace(/0+$/,``)}${r}`}function vf(e){let t=Math.floor(e/mf.h);e-=t*mf.h;let n=Math.floor(e/mf.m);e-=n*mf.m;let r=Math.floor(e/mf.s),i=e-r*mf.s,a=i===0?`${r}s`:`${r}.${String(Math.round(i)).padStart(9,`0`).replace(/0+$/,``)}s`;return t>0?`${t}h${n}m${a}`:n>0?`${n}m${a}`:a}function yf(e){return e*mf.s}function bf(e){if(e instanceof Date)return e;if(typeof e==`bigint`)return new Date(Number(e)*1e3);if(typeof e==`number`)return new Date(e*1e3);if(typeof e==`string`){let t=new Date(e);if(!Number.isNaN(t.getTime()))return t;throw Error(`sprig: cannot parse date value ${JSON.stringify(e)}`)}throw Error(`sprig: unsupported date type: ${typeof e}`)}function xf(e,t){let n=t().getTime()-bf(e).getTime();return gf(Math.round(n/1e3)*1e9)}const Sf=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Cf=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wf=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],Tf=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function Ef(e){return e<10?`0${e}`:String(e)}function Df(e){return e<10?`00${e}`:e<100?`0${e}`:String(e)}function Of(e){return e<10?` ${e}`:String(e)}function kf(e){let t=e>=0?`+`:`-`,n=Math.abs(e);return`${t}${Ef(Math.floor(n/60))}${Ef(n%60)}`}function Af(e){let t=e>=0?`+`:`-`,n=Math.abs(e);return`${t}${Ef(Math.floor(n/60))}:${Ef(n%60)}`}function jf(e){return`${e>=0?`+`:`-`}${Ef(Math.floor(Math.abs(e)/60))}`}function Mf(e){return e===0?`Z`:kf(e)}function Nf(e){return e===0?`Z`:Af(e)}function Pf(e){return e===0?`Z`:jf(e)}function Ff(e,t,n){let r=e*1e6,i=String(r).padStart(9,`0`).slice(0,t);return n?i.replace(/0+$/,``):i}const If=[[`.000000000`,e=>`.${Ff(e.ms,9,!1)}`],[`.999999999`,e=>{let t=Ff(e.ms,9,!0);return t?`.${t}`:``}],[`.000000`,e=>`.${Ff(e.ms,6,!1)}`],[`.999999`,e=>{let t=Ff(e.ms,6,!0);return t?`.${t}`:``}],[`.000`,e=>`.${Df(e.ms)}`],[`.999`,e=>{let t=Df(e.ms).replace(/0+$/,``);return t?`.${t}`:``}],[`January`,e=>Sf[e.month-1]??`January`],[`Monday`,e=>wf[e.weekday]??`Monday`],[`Z07:00`,e=>Nf(e.offsetMinutes)],[`-07:00`,e=>Af(e.offsetMinutes)],[`Z0700`,e=>Mf(e.offsetMinutes)],[`-0700`,e=>kf(e.offsetMinutes)],[`2006`,e=>String(e.year)],[`Jan`,e=>Cf[e.month-1]??`Jan`],[`Mon`,e=>Tf[e.weekday]??`Mon`],[`MST`,e=>e.tzAbbr],[`-07`,e=>jf(e.offsetMinutes)],[`Z07`,e=>Pf(e.offsetMinutes)],[`15`,e=>Ef(e.hour)],[`01`,e=>Ef(e.month)],[`02`,e=>Ef(e.day)],[`_2`,e=>Of(e.day)],[`03`,e=>Ef(e.hour12)],[`04`,e=>Ef(e.minute)],[`05`,e=>Ef(e.second)],[`06`,e=>Ef(e.year%100)],[`PM`,e=>e.hour>=12?`PM`:`AM`],[`pm`,e=>e.hour>=12?`pm`:`am`],[`1`,e=>String(e.month)],[`2`,e=>String(e.day)],[`3`,e=>String(e.hour12)],[`4`,e=>String(e.minute)],[`5`,e=>String(e.second)]];function Lf(e,t){let n=``,r=0;for(;r<e.length;){let i=!1;for(let[a,o]of If)if(e.startsWith(a,r)){n+=o(t),r+=a.length,i=!0;break}i||(n+=e[r++])}return n}const Rf={year:`numeric`,month:`2-digit`,day:`2-digit`,weekday:`long`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1};function zf(e){let t=new Map;for(let n of e)t.set(n.type,n.value);return t}const Bf=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function Vf(e,t){let n;try{new Intl.DateTimeFormat(`en-US`,{timeZone:t}),n=t}catch{n=`UTC`}let r=zf(new Intl.DateTimeFormat(`en-US`,{...Rf,timeZone:n}).formatToParts(e)),i=parseInt(r.get(`hour`)??`0`,10)%24,a=zf(new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`short`}).formatToParts(e)).get(`timeZoneName`)??n,o=Hf(zf(new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`shortOffset`}).formatToParts(e)).get(`timeZoneName`)??`GMT`),s=Bf.indexOf(r.get(`weekday`)??`Sunday`);return{year:parseInt(r.get(`year`)??`2000`,10),month:parseInt(r.get(`month`)??`1`,10),day:parseInt(r.get(`day`)??`1`,10),weekday:s===-1?0:s,hour:i,hour12:i%12||12,minute:parseInt(r.get(`minute`)??`0`,10),second:parseInt(r.get(`second`)??`0`,10),ms:e.getUTCMilliseconds(),tzAbbr:a,offsetMinutes:o}}function Hf(e){if(e===`GMT`||e===`UTC`)return 0;let t=e.match(/^GMT([+-])(\d{1,2})(?::(\d{2}))?$/);if(!t)return 0;let n=t[1]===`+`?1:-1,r=parseInt(t[2]??`0`,10),i=parseInt(t[3]??`0`,10);return n*(r*60+i)}function Uf(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function Wf(e,t){return Lf(e,Vf(bf(t),Uf()))}function Gf(e,t,n){return Lf(e,Vf(bf(t),n))}function Kf(e,t){let n=bf(t),r=hf(e);return Number.isNaN(r)?n:new Date(n.getTime()+r/1e6)}function qf(e){if(typeof e==`string`){let t=parseInt(e,10);return Number.isNaN(t)?`0s`:gf(yf(t))}return typeof e==`bigint`?gf(yf(Number(e))):typeof e==`number`?gf(yf(e)):`0s`}const Jf=36e11*24*365,Yf=36e11*24*30,Xf=36e11*24,Zf=36e11,Qf=6e10,$f=1e9;function ep(e){let t=hf(String(e));if(Number.isNaN(t))return`0s`;let n=Math.abs(t);return n>Jf?`${Math.floor(n/Jf)}y`:n>Yf?`${Math.floor(n/Yf)}mo`:n>Xf?`${Math.floor(n/Xf)}d`:n>Zf?`${Math.floor(n/Zf)}h`:n>Qf?`${Math.floor(n/Qf)}m`:n>$f?`${Math.floor(n/$f)}s`:`0s`}function tp(e){let t=Vf(bf(e),Uf());return`${t.year}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)}`}function np(e,t){let n=Vf(bf(e),t);return`${n.year}-${String(n.month).padStart(2,`0`)}-${String(n.day).padStart(2,`0`)}`}function rp(e){return e()}const ip=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],ap=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function op(){return{year:2e3,month:1,day:1,hour:0,minute:0,second:0,ms:0,offsetMinutes:0,isPM:!1,hour12:!1}}function sp(e,t,n){return[e.slice(t,t+n),t+n]}function cp(e,t,n,r){let i=t;for(;i<e.length&&i-t<r&&e.charCodeAt(i)>=48&&e.charCodeAt(i)<=57;)i++;if(i-t<n)throw Error(`sprig toDate: expected ${n}-${r} digits at pos ${t}`);return[parseInt(e.slice(t,i),10),i]}function lp(e,t){for(let[n,r]of ip.entries())if(e.startsWith(r,t))return[n+1,t+r.length];throw Error(`sprig toDate: expected month name at pos ${t}`)}function up(e,t){for(let[n,r]of ap.entries())if(e.startsWith(r,t))return[n+1,t+r.length];throw Error(`sprig toDate: expected short month name at pos ${t}`)}function dp(e,t){for(let n of[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`])if(e.startsWith(n,t))return t+n.length;throw Error(`sprig toDate: expected weekday name at pos ${t}`)}function fp(e,t){for(let n of[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`])if(e.startsWith(n,t))return t+n.length;throw Error(`sprig toDate: expected short weekday name at pos ${t}`)}function pp(e,t){if(e[t]===` `){let[n,r]=cp(e,t+1,1,1);return[n,r]}return cp(e,t,1,2)}function mp(e,t,n){let r=e[t]===`+`?1:e[t]===`-`?-1:0;if(r===0)throw Error(`sprig toDate: expected +/- at pos ${t}`);let i=t+1,[a,o]=cp(e,i,2,2);i=o;let s=0;if(n&&e[i]===`:`){let[t,n]=cp(e,i+1,2,2);s=t,i=n}else if(!n){let[t,n]=cp(e,i,2,2);s=t,i=n}return[r*(a*60+s),i]}function hp(e,t,n,r){if(e[t]===`Z`)return[0,t+1];if(r){let n=e[t]===`+`?1:e[t]===`-`?-1:0;if(n===0)throw Error(`sprig toDate: expected Z or +/- at pos ${t}`);let[r,i]=cp(e,t+1,2,2);return[n*r*60,i]}return mp(e,t,n)}function gp(e,t){let n=t;for(;n<e.length&&e.charCodeAt(n)>=65&&e.charCodeAt(n)<=90;)n++;if(n===t)throw Error(`sprig toDate: expected timezone abbreviation at pos ${t}`);return n}function _p(e,t,n){let[r,i]=sp(e,t,n),a=parseInt(r.padEnd(9,`0`),10);return[Math.round(a/1e6),i]}function vp(e,t,n,r){let i={...r};switch(e){case`January`:{let[e,r]=lp(t,n);return i.month=e,[r,i]}case`Monday`:return[dp(t,n),i];case`Jan`:{let[e,r]=up(t,n);return i.month=e,[r,i]}case`Mon`:return[fp(t,n),i];case`2006`:{let[e,r]=cp(t,n,4,4);return i.year=e,[r,i]}case`06`:{let[e,r]=cp(t,n,2,2);return i.year=e<70?2e3+e:1900+e,[r,i]}case`01`:{let[e,r]=cp(t,n,2,2);return i.month=e,[r,i]}case`1`:{let[e,r]=cp(t,n,1,2);return i.month=e,[r,i]}case`_2`:{let[e,r]=pp(t,n);return i.day=e,[r,i]}case`02`:{let[e,r]=cp(t,n,2,2);return i.day=e,[r,i]}case`2`:{let[e,r]=cp(t,n,1,2);return i.day=e,[r,i]}case`15`:{let[e,r]=cp(t,n,2,2);return i.hour=e,[r,i]}case`03`:{let[e,r]=cp(t,n,2,2);return i.hour=e,i.hour12=!0,[r,i]}case`3`:{let[e,r]=cp(t,n,1,2);return i.hour=e,i.hour12=!0,[r,i]}case`04`:{let[e,r]=cp(t,n,2,2);return i.minute=e,[r,i]}case`4`:{let[e,r]=cp(t,n,1,2);return i.minute=e,[r,i]}case`05`:{let[e,r]=cp(t,n,2,2);return i.second=e,[r,i]}case`5`:{let[e,r]=cp(t,n,1,2);return i.second=e,[r,i]}case`PM`:case`pm`:{let e=t.slice(n,n+2).toLowerCase();if(e!==`am`&&e!==`pm`)throw Error(`sprig toDate: expected AM/PM at pos ${n}, got ${JSON.stringify(t.slice(n,n+2))}`);return i.isPM=e===`pm`,i.hour12=!0,[n+2,i]}case`MST`:return[gp(t,n),i];case`-0700`:{let[e,r]=mp(t,n,!1);return i.offsetMinutes=e,[r,i]}case`-07:00`:{let[e,r]=mp(t,n,!0);return i.offsetMinutes=e,[r,i]}case`-07`:{let e=t[n]===`+`?1:t[n]===`-`?-1:0;if(e===0)throw Error(`sprig toDate: expected +/- at pos ${n}`);let[r,a]=cp(t,n+1,2,2);return i.offsetMinutes=e*r*60,[a,i]}case`Z0700`:{let[e,r]=hp(t,n,!1,!1);return i.offsetMinutes=e,[r,i]}case`Z07:00`:{let[e,r]=hp(t,n,!0,!1);return i.offsetMinutes=e,[r,i]}case`Z07`:{let[e,r]=hp(t,n,!1,!0);return i.offsetMinutes=e,[r,i]}case`.000000000`:{if(t[n]!==`.`)throw Error(`sprig toDate: expected . at pos ${n}`);let[e,r]=_p(t,n+1,9);return i.ms=e,[r,i]}case`.999999999`:{if(t[n]!==`.`)return[n,i];let e=n+1,r=e;for(;r<t.length&&t.charCodeAt(r)>=48&&t.charCodeAt(r)<=57;)r++;let a=t.slice(e,r).padEnd(9,`0`);return i.ms=Math.round(parseInt(a,10)/1e6),[r,i]}case`.000000`:{if(t[n]!==`.`)throw Error(`sprig toDate: expected . at pos ${n}`);let[e,r]=_p(t,n+1,6);return i.ms=e,[r,i]}case`.999999`:{if(t[n]!==`.`)return[n,i];let e=n+1,r=e;for(;r<t.length&&t.charCodeAt(r)>=48&&t.charCodeAt(r)<=57;)r++;let a=t.slice(e,r).padEnd(9,`0`);return i.ms=Math.round(parseInt(a,10)/1e6),[r,i]}case`.000`:{if(t[n]!==`.`)throw Error(`sprig toDate: expected . at pos ${n}`);let[e,r]=_p(t,n+1,3);return i.ms=e,[r,i]}case`.999`:{if(t[n]!==`.`)return[n,i];let e=n+1,r=e;for(;r<t.length&&t.charCodeAt(r)>=48&&t.charCodeAt(r)<=57;)r++;let a=t.slice(e,r).padEnd(3,`0`);return i.ms=parseInt(a,10),[r,i]}}throw Error(`sprig toDate: unhandled token ${e}`)}const yp=`.000000000,.999999999,.000000,.999999,.000,.999,January,Monday,Z07:00,-07:00,Z0700,-0700,2006,Jan,Mon,MST,-07,Z07,15,01,02,_2,03,04,05,06,PM,pm,1,2,3,4,5`.split(`,`);function bp(e,t){let n=0,r=0,i=op();for(;n<e.length;){let a=!1;for(let o of yp)if(e.startsWith(o,n)){let[e,s]=vp(o,t,r,i);r=e,i=s,n+=o.length,a=!0;break}if(!a){let i=e.charAt(n);if(t[r]!==i)throw Error(`sprig toDate: expected ${JSON.stringify(i)} at pos ${r}, got ${JSON.stringify(t[r])}`);n++,r++}}if(r!==t.length)throw Error(`sprig toDate: extra characters at pos ${r}: ${JSON.stringify(t.slice(r))}`);if(i.hour12){let e=i.hour%12;i.hour=i.isPM?e+12:e}let a=Date.UTC(i.year,i.month-1,i.day,i.hour,i.minute,i.second,i.ms)-i.offsetMinutes*60*1e3;return new Date(a)}function xp(e,t){return bp(e,t)}function Sp(e){return String(Math.floor(bf(e).getTime()/1e3))}function Cp(e=()=>new Date){return{now:{fn:()=>rp(e),argTypes:[]},date:{fn:(e,t)=>Wf(e,t),argTypes:[`string`,`value`]},dateInZone:{fn:(e,t,n)=>Gf(e,t,n),argTypes:[`string`,`value`,`string`]},dateModify:{fn:(e,t)=>Kf(e,t),argTypes:[`string`,`value`]},htmlDate:{fn:e=>tp(e),argTypes:[`value`]},htmlDateInZone:{fn:(e,t)=>np(e,t),argTypes:[`value`,`string`]},duration:{fn:e=>qf(e),argTypes:[`value`]},durationRound:{fn:e=>ep(e),argTypes:[`value`]},toDate:{fn:(e,t)=>xp(e,t),argTypes:[`string`,`string`]},ago:{fn:t=>xf(t,e),argTypes:[`value`]},unixEpoch:{fn:e=>Sp(e),argTypes:[`value`]}}}function wp(e){return e==null||e===!1?!0:typeof e==`number`?e===0||Number.isNaN(e):typeof e==`bigint`?e===0n:typeof e==`string`||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:typeof e==`object`?Object.keys(e).length===0:!1}function Tp(...e){for(let t of e)if(!wp(t))return t}function Ep(e,t){return wp(t)?e:t}function Dp(e){return JSON.parse(e)}function Op(e,t,n){return td(n)?e:t}function kp(e){return JSON.stringify(e)??`null`}function Ap(e){return JSON.stringify(e,null,2)??`null`}function jp(){return{default:{fn:(e,t)=>Ep(e,t),argTypes:[`value`,`truthy`]},empty:{fn:e=>wp(e),argTypes:[`truthy`]},coalesce:{fn:(...e)=>Tp(...e),argTypes:[`truthy`]},ternary:{fn:(e,t,n)=>Op(e,t,n),argTypes:[`value`,`value`,`truthy`]},fromJson:{fn:e=>Dp(e),argTypes:[`string`]},toJson:{fn:e=>kp(e),argTypes:[`serializable`],returnType:`string`},toPrettyJson:{fn:e=>Ap(e),argTypes:[`serializable`],returnType:`string`}}}function Mp(...e){let t={};for(let n=0;n<e.length;n+=2)t[e[n]]=e[n+1];return t}function Np(e,t){return e[t]}function Pp(e,t){return t in e}function Fp(e){return Object.keys(e)}function Ip(e,...t){let n={...e};for(let e of t)for(let[t,r]of Object.entries(e))t in n||(n[t]=r);return n}function Lp(e,...t){let n={...e};for(let e of t)Object.assign(n,e);return n}function Rp(e,...t){let n=new Set(t),r={};for(let[t,i]of Object.entries(e))n.has(t)||(r[t]=i);return r}function zp(e,...t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Bp(e,...t){let n=[];for(let r of t)e in r&&n.push(r[e]);return n}function Vp(e,t,n){return e[t]=n,e}function Hp(e,t){return delete e[t],e}function Up(e){return Object.values(e)}function Wp(){return{dict:{fn:(...e)=>Mp(...e),argTypes:[`string`,`value`],argTypePattern:`alternating`},get:{fn:(e,t)=>Np(e,t),argTypes:[`dict`,`string`]},set:{fn:(e,t,n)=>Vp(e,t,n),argTypes:[`dict`,`string`,`value`]},unset:{fn:(e,t)=>Hp(e,t),argTypes:[`dict`,`string`]},keys:{fn:e=>Fp(e),argTypes:[`dict`]},values:{fn:e=>Up(e),argTypes:[`dict`]},pluck:{fn:(e,...t)=>Bp(e,...t),argTypes:[`string`,`dict`]},pick:{fn:(e,...t)=>zp(e,...t),argTypes:[`dict`,`string`]},omit:{fn:(e,...t)=>Rp(e,...t),argTypes:[`dict`,`string`]},hasKey:{fn:(e,t)=>Pp(e,t),argTypes:[`dict`,`string`]},merge:{fn:(e,...t)=>Ip(e,...t),argTypes:[`dict`]},mergeOverwrite:{fn:(e,...t)=>Lp(e,...t),argTypes:[`dict`]}}}new TextEncoder,new Map(Array.from(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`).map((e,t)=>[e,t])),new TextDecoder,new TextEncoder,new TextDecoder,new TextEncoder;function Gp(...e){for(let t of e)if(wp(t))return!1;return!0}function Kp(...e){for(let t of e)if(!wp(t))return!0;return!1}function qp(e,t){return[...e,t]}function Jp(e,t){let n=Math.max(1,Math.trunc(Number(e))),r=[];for(let e=0;e<t.length;e+=n)r.push(t.slice(e,e+n));return r}function Yp(e){return e.filter(e=>!wp(e))}function Xp(...e){let t=[];for(let n of e)t.push(...n);return t}const Zp={line:0,column:0,offset:0};function Qp(e,t,n,r){return new hu(e,t,n,r,Zp)}function $p(...e){if(e.length<3)throw Qp(`dig`,0,`at least 3 arguments (...keys, default, dict)`,`${e.length} argument${e.length===1?``:`s`}`);let t=e[e.length-1],n=e[e.length-2],r=e.slice(0,-2);if(!tm(t))throw Qp(`dig`,e.length-1,`dict`,nm(t));for(let e=0;e<r.length;e++)if(typeof r[e]!=`string`)throw Qp(`dig`,e,`string`,nm(r[e]));return em(t,n,r,e.length)}function em(e,t,n,r){let i=n[0];if(!Object.hasOwn(e,i))return t;let a=e[i];if(n.length===1)return a;if(!tm(a))throw Qp(`dig`,r-1,`dict at intermediate key`,nm(a));return em(a,t,n.slice(1),r)}function tm(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Map)&&!(e instanceof Set)}function nm(e){return e===null?`null`:Array.isArray(e)?`array`:e instanceof Map?`Map`:e instanceof Set?`Set`:typeof e}function rm(e){return e[0]}function im(e,t){return t.some(t=>Zu(t,e))}function am(e){return e.slice(0,-1)}function om(e){return e[e.length-1]}function sm(e){return Array.isArray(e)||typeof e==`string`?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function cm(...e){return e}function lm(e,t){return[t,...e]}function um(e){return e.slice(1)}function dm(e){return[...e].reverse()}function fm(e,t,n){let r=t===void 0?0:Number(t),i=n===void 0?e.length:Number(n);return e.slice(r,i)}function pm(e){let t=[];for(let n of e)n!=null&&t.push(String(n));return t.sort()}function mm(e){let t=[];for(let n of e)t.some(e=>Zu(e,n))||t.push(n);return t}function hm(e,...t){return e.filter(e=>!t.some(t=>Zu(t,e)))}function gm(){return{list:{fn:(...e)=>cm(...e),argTypes:[`value`]},first:{fn:e=>rm(e),argTypes:[`list`]},last:{fn:e=>om(e),argTypes:[`list`]},rest:{fn:e=>um(e),argTypes:[`list`]},initial:{fn:e=>am(e),argTypes:[`list`]},len:{fn:e=>sm(e),argTypes:[`sized`]},reverse:{fn:e=>dm(e),argTypes:[`list`]},uniq:{fn:e=>mm(e),argTypes:[`list`]},without:{fn:(e,...t)=>hm(e,...t),argTypes:[`list`,`value`]},has:{fn:(e,t)=>im(e,t),argTypes:[`value`,`list`]},compact:{fn:e=>Yp(e),argTypes:[`list`]},slice:{fn:(e,t,n)=>fm(e,t,n),argTypes:[`list`,`number`,`number`]},concat:{fn:(...e)=>Xp(...e),argTypes:[`list`]},chunk:{fn:(e,t)=>Jp(e,t),argTypes:[`number`,`list`]},prepend:{fn:(e,t)=>lm(e,t),argTypes:[`list`,`value`]},append:{fn:(e,t)=>qp(e,t),argTypes:[`list`,`value`]},sortAlpha:{fn:e=>pm(e),argTypes:[`list`],returnType:`list`},push:{fn:(e,t)=>qp(e,t),argTypes:[`list`,`value`]},tuple:{fn:(...e)=>cm(...e),argTypes:[`value`]},dig:{fn:(...e)=>$p(...e),argTypes:[`value`]},all:{fn:(...e)=>Gp(...e),argTypes:[`truthy`],returnType:`bool`},any:{fn:(...e)=>Kp(...e),argTypes:[`truthy`],returnType:`bool`}}}function _m(...e){return e.reduce((e,t)=>e+t,0)}function vm(e){return e+1}function ym(e){return e+1}function bm(...e){return e.reduce((e,t)=>e+t,0)}function xm(e){return Math.ceil(e)}function Sm(e,t){return Math.trunc(e/t)}function Cm(e,t){return e/t}function wm(e){return Math.floor(e)}function Tm(...e){return e.reduce((e,t)=>t>e?t:e,-1/0)}function Em(...e){return e.reduce((e,t)=>Math.max(e,t),-1/0)}function Dm(...e){return e.reduce((e,t)=>t<e?t:e,1/0)}function Om(...e){return e.reduce((e,t)=>Math.min(e,t),1/0)}function km(e,t){return e%t}function Am(...e){return e.reduce((e,t)=>e*t,1)}function jm(...e){return e.reduce((e,t)=>e*t,1)}function Mm(e,t=0){let n=10**t;return Math.sign(e)*Math.round(Math.abs(e)*n)/n}function Nm(e,t,n){let r=[];if(t<e){if(n>=0)return r;for(let i=e;i>t;i+=n)r.push(i);return r}if(n<=0)return r;for(let i=e;i<t;i+=n)r.push(i);return r}function Pm(...e){let t=1;switch(e.length){case 0:return``;case 1:{let n=e[0];return n<1&&(t=-1),Nm(1,n+t,t).join(` `)}case 2:{let t=e[0],n=e[1],r=n<t?-1:1;return Nm(t,n+r,r).join(` `)}case 3:{let n=e[0],r=e[1],i=e[2];return i<n&&(t=-1,r>0)?``:Nm(n,i+t,r).join(` `)}default:return``}}function Fm(e,t){return e-t}function Im(e,t){return e-t}function Lm(e){return Nm(0,e,e<0?-1:1)}function Rm(){return{add:{fn:(...e)=>_m(...e),argTypes:[`int`]},sub:{fn:(e,t)=>Fm(e,t),argTypes:[`int`,`int`]},mul:{fn:(...e)=>Am(...e),argTypes:[`int`]},div:{fn:(e,t)=>Sm(e,t),argTypes:[`int`,`int`]},mod:{fn:(e,t)=>km(e,t),argTypes:[`int`,`int`]},min:{fn:(...e)=>Dm(...e),argTypes:[`int`]},max:{fn:(...e)=>Tm(...e),argTypes:[`int`]},floor:{fn:e=>wm(e),argTypes:[`float`]},ceil:{fn:e=>xm(e),argTypes:[`float`]},round:{fn:(e,t)=>Mm(e,t),argTypes:[`float`,`int`]},addf:{fn:(...e)=>bm(...e),argTypes:[`float`]},subf:{fn:(e,t)=>Im(e,t),argTypes:[`float`,`float`]},mulf:{fn:(...e)=>jm(...e),argTypes:[`float`]},divf:{fn:(e,t)=>Cm(e,t),argTypes:[`float`,`float`]},add1:{fn:e=>vm(e),argTypes:[`int`]},add1f:{fn:e=>ym(e),argTypes:[`float`]},maxf:{fn:(...e)=>Em(...e),argTypes:[`float`]},minf:{fn:(...e)=>Om(...e),argTypes:[`float`]},biggest:{fn:(...e)=>Tm(...e),argTypes:[`int`]},seq:{fn:(...e)=>Pm(...e),argTypes:[`int`],returnType:`string`},until:{fn:e=>Lm(e),argTypes:[`int`],returnType:`list`},untilStep:{fn:(e,t,n)=>Nm(e,t,n),argTypes:[`int`,`int`,`int`],returnType:`list`}}}Array.from({length:95},(e,t)=>String.fromCharCode(t+32)).join(``);function zm(e,t){let n=Number(e);return t.length<=n||n<4?t:`${t.slice(0,n-3)}...`}function Bm(e,t,n){let r=Number(e),i=Number(t);return i<7||n.length<i||r<0||r>n.length-i+1?n:`...${n.slice(r,r+i-6)}...`}const $={Invalid:0,Number:1,UpperCase:2,Alphabet:3,Connector:4,Punct:5,Other:6},Vm=/^[-_\s]$/,Hm=/^\p{P}$/u,Um=/^\p{L}$/u,Wm=/^\p{Lu}$/u,Gm=/^\p{N}$/u;function Km(e){return e!==void 0&&Vm.test(e)}function qm(e){return e!==void 0&&Um.test(e)}function Jm(e){return e!==void 0&&Wm.test(e)}function Ym(e){return e!==void 0&&Gm.test(e)}function Xm(e){return e!==void 0&&Hm.test(e)}function Zm(e,t){if(t>=e.length)return{word:{wt:$.Invalid,text:``},next:t};let n=e[t],r=t+1;if(Km(n)){for(;r<e.length&&Km(e[r]);)r++;return{word:{wt:$.Connector,text:e.slice(t,r).join(``)},next:r}}if(Xm(n)){for(;r<e.length&&Xm(e[r]);)r++;return{word:{wt:$.Punct,text:e.slice(t,r).join(``)},next:r}}if(Jm(n)){if(r>=e.length)return{word:{wt:$.UpperCase,text:n},next:r};if(Jm(e[r])){let n=r;for(;n<e.length&&Jm(e[n]);)n++;return n<e.length&&qm(e[n])?{word:{wt:$.UpperCase,text:e.slice(t,n-1).join(``)},next:n-1}:{word:{wt:$.UpperCase,text:e.slice(t,n).join(``)},next:n}}if(qm(e[r])){let n=r+1;for(;n<e.length&&qm(e[n])&&!Jm(e[n]);)n++;return{word:{wt:$.UpperCase,text:e.slice(t,n).join(``)},next:n}}return{word:{wt:$.UpperCase,text:n},next:r}}if(qm(n)){for(;r<e.length&&qm(e[r])&&!Jm(e[r]);)r++;return{word:{wt:$.Alphabet,text:e.slice(t,r).join(``)},next:r}}if(Ym(n)){for(;r<e.length&&Ym(e[r]);)r++;return{word:{wt:$.Number,text:e.slice(t,r).join(``)},next:r}}for(;r<e.length&&!Km(e[r])&&!qm(e[r])&&!Ym(e[r])&&!Xm(e[r]);)r++;return{word:{wt:$.Other,text:e.slice(t,r).join(``)},next:r}}function Qm(e,t,n){if(t.wt!==$.UpperCase&&t.wt!==$.Connector){e.push(t.text);return}for(let r of t.text)Km(r)?e.push(n):Jm(r)?e.push(r.toLowerCase()):e.push(r)}function $m(e,t){if(e.length===0)return``;let n=Array.from(e),r=[],{word:i,next:a}=Zm(n,0);for(;a<n.length;){i.wt!==$.Connector&&Qm(r,i,t);let e=i,o=i;if({word:i,next:a}=Zm(n,a),e.wt===$.Number){for(;i.wt===$.Alphabet||i.wt===$.Number;)Qm(r,i,t),{word:i,next:a}=Zm(n,a);i.wt!==$.Invalid&&i.wt!==$.Punct&&i.wt!==$.Connector&&r.push(t);continue}if(e.wt===$.Connector){Qm(r,o,t);continue}if(e.wt===$.Punct)continue;if(i.wt!==$.Number){i.wt!==$.Connector&&i.wt!==$.Punct&&r.push(t);continue}if(a>=n.length)continue;let s=i;if({word:i,next:a}=Zm(n,a),i.wt!==$.Alphabet){Qm(r,s,t),i.wt!==$.Connector&&i.wt!==$.Punct&&r.push(t);continue}for(r.push(t),Qm(r,s,t);i.wt===$.Alphabet||i.wt===$.Number;)Qm(r,i,t),{word:i,next:a}=Zm(n,a);i.wt!==$.Invalid&&i.wt!==$.Connector&&i.wt!==$.Punct&&r.push(t)}return Qm(r,i,t),r.join(``).toLowerCase()}function eh(e){if(e.length===0)return``;let t=Array.from(e),n=[],r=0,i=``;for(;r<t.length;){if(i=t[r],r++,!Km(i)){i=i.toUpperCase();break}n.push(i)}if(r>=t.length)return t.length>0&&n.push(i),n.join(``);for(;r<t.length;){let e=i;if(i=t[r],r++,Km(i)&&Km(e)){n.push(e);continue}Km(e)?i=i.toUpperCase():(i=i.toLowerCase(),n.push(e))}return n.push(i),n.join(``)}function th(e){return eh(e)}function nh(...e){return e.join(` `)}function rh(e,t){return t.includes(e)}function ih(e,t){return t.startsWith(e)}function ah(e,t){return t.endsWith(e)}function oh(e,t){let n=` `.repeat(Math.max(0,Number(e)));return t.split(`
94
+ `?(this.line+=1,this.column=1):this.column+=1}}advanceTo(e){for(;this.offset<e;)this.advanceBy(1)}makeToken(e,t,n,r={}){return Object.freeze({type:e,value:t,pos:n,...r.trimLeft===void 0?{}:{trimLeft:r.trimLeft},...r.trimRight===void 0?{}:{trimRight:r.trimRight}})}};function Eu(e){return e===` `||e===` `||e===`\r`||e===`
95
+ `}function Du(e){return e===`+`||e===`-`}function Ou(e){return e>=`0`&&e<=`9`}function ku(e){return Ou(e)||e>=`a`&&e<=`f`||e>=`A`&&e<=`F`}function Au(e){return e>=`0`&&e<=`7`}function ju(e){return e===`0`||e===`1`}function Mu(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`}function Nu(e){return Mu(e)||e===`_`}function Pu(e){return Nu(e)||Ou(e)}function Fu(e,t){return new Iu(e,t).parseTemplate()}var Iu=class{lex;buf=[];defines=new Map;source;rangeDepth=0;constructor(e,t){this.source=e,this.lex=t?new Tu(e,t):new Tu(e)}peek(e=0){for(;this.buf.length<=e;)this.buf.push(this.lex.next());return this.buf[e]}next(){return this.buf.length>0?this.buf.shift():this.lex.next()}expect(e,t){let n=this.next();if(n.type!==e)throw this.errAt(n,`expected ${t}`,{expected:t,found:zu(n)});return n}errAt(e,t,n={}){return new pu(t,e.pos,{...n,source:this.source})}parseTemplate(){let e=this.parseList();if(this.peek().type!==`EOF`){let e=this.peek(),t=this.peek(1);if(e.type===`LeftDelim`&&(t.type===`Else`||t.type===`End`)){let n=t.type===`Else`?`else`:`end`;throw this.errAt(e,`unexpected \`{{${n}}}\` outside of \`if\`, \`range\`, \`with\`, or \`block\``,{found:`{{${n}}}`})}throw this.errAt(e,`unexpected ${zu(e)}`,{found:zu(e)})}return{root:e,defines:this.defines,source:this.source}}parseList(){let e=this.peek().pos,t=[];for(;;){let n=this.peek();if(n.type===`EOF`)break;if(n.type===`Text`){this.next(),t.push({type:`Text`,pos:n.pos,text:n.value});continue}if(n.type===`Comment`){this.next();let e=Ru(n);t.push({type:`Comment`,pos:n.pos,text:n.value,trim:e});continue}if(n.type===`LeftDelim`){let n=this.peek(1).type;if(n===`Else`||n===`End`)return Lu(e,t);let r=this.parseAction();r!==null&&t.push(r);continue}throw this.errAt(n,`unexpected ${zu(n)} at top level`,{found:zu(n)})}return Lu(e,t)}parseAction(){let e=this.expect(`LeftDelim`,"`{{`"),t=e.trimLeft===!0,n=this.peek();switch(n.type){case`If`:return this.next(),this.parseBranch(`If`,e.pos,t);case`Range`:return this.next(),this.parseBranch(`Range`,e.pos,t);case`With`:return this.next(),this.parseBranch(`With`,e.pos,t);case`Break`:return this.next(),this.parseBreakOrContinue(`Break`,e.pos,t);case`Continue`:return this.next(),this.parseBreakOrContinue(`Continue`,e.pos,t);case`Template`:return this.next(),this.parseTemplateInvocation(e.pos,t);case`Block`:return this.next(),this.parseBlock(e.pos,t);case`Define`:return this.next(),this.parseDefine(e.pos,t),null;case`RightDelim`:throw this.errAt(n,`empty action`,{expected:`pipeline`});default:{let n=this.parsePipeline(),r=this.expect(`RightDelim`,"`}}`");return{type:`Action`,pos:e.pos,pipe:n,trim:{trimLeft:t,trimRight:r.trimRight===!0}}}}}parseBranch(e,t,n){let r=this.parsePipeline();this.expect(`RightDelim`,"`}}`"),e===`Range`&&(this.rangeDepth+=1);let i=this.parseList();e===`Range`&&--this.rangeDepth;let a=this.parseElsePart(),o={trimLeft:n,trimRight:a.endConsumed?a.endRight:this.consumeEnd()},s=a.list?{pipe:r,list:i,elseList:a.list,trim:o}:{pipe:r,list:i,trim:o};switch(e){case`If`:return{type:`If`,pos:t,...s};case`Range`:return{type:`Range`,pos:t,...s};case`With`:return{type:`With`,pos:t,...s}}}parseBreakOrContinue(e,t,n){if(this.rangeDepth===0)throw new pu(`{{${e===`Break`?`break`:`continue`}}} outside of {{range}}`,t,{source:this.source});let r={trimLeft:n,trimRight:this.expect(`RightDelim`,"`}}`").trimRight===!0};return e===`Break`?{type:`Break`,pos:t,trim:r}:{type:`Continue`,pos:t,trim:r}}parseElsePart(){if(this.peek().type!==`LeftDelim`||this.peek(1).type!==`Else`)return{list:void 0,endRight:!1,endConsumed:!1};let e=this.next();if(this.next(),this.peek().type===`If`){this.next();let t=this.parseBranch(`If`,e.pos,e.trimLeft===!0);return{list:{type:`List`,pos:e.pos,nodes:[t]},endRight:t.trim.trimRight,endConsumed:!0}}return this.expect(`RightDelim`,"`}}`"),{list:this.parseList(),endRight:!1,endConsumed:!1}}consumeEnd(){return this.expect(`LeftDelim`,"`{{end}}`"),this.expect(`End`,"`end`"),this.expect(`RightDelim`,"`}}`").trimRight===!0}parseTemplateInvocation(e,t){let n=this.parseQuotedName(),r=this.peek().type===`RightDelim`?void 0:this.parsePipeline(),i={trimLeft:t,trimRight:this.expect(`RightDelim`,"`}}`").trimRight===!0};return r?{type:`Template`,pos:e,name:n,pipe:r,trim:i}:{type:`Template`,pos:e,name:n,trim:i}}parseBlock(e,t){let n=this.parseQuotedName(),r=this.peek().type===`RightDelim`?void 0:this.parsePipeline();this.expect(`RightDelim`,"`}}`");let i=this.rangeDepth;this.rangeDepth=0;let a=this.parseList();this.rangeDepth=i;let o={trimLeft:t,trimRight:this.consumeEnd()};return this.defines.has(n)||this.defines.set(n,a),r?{type:`Block`,pos:e,name:n,pipe:r,list:a,trim:o}:{type:`Block`,pos:e,name:n,list:a,trim:o}}parseDefine(e,t){let n=this.parseQuotedName();this.expect(`RightDelim`,"`}}`");let r=this.rangeDepth;this.rangeDepth=0;let i=this.parseList();if(this.rangeDepth=r,this.consumeEnd(),this.defines.has(n))throw new pu(`redefinition of template ${JSON.stringify(n)}`,i.pos,{source:this.source});this.defines.set(n,i)}parseQuotedName(){let e=this.next();if(e.type!==`String`)throw this.errAt(e,`expected template name (quoted string)`,{expected:`string`,found:zu(e)});return qu(e.value,e.pos,this.source)}parsePipeline(){let e=this.peek().pos,t=this.tryParseDecls(),n=[this.parseCommand()];for(;this.peek().type===`Pipe`;){this.next();let e=this.peek();if(!Bu(e.type))throw this.errAt(e,"missing command after `|`",{expected:`command`,found:zu(e)});n.push(this.parseCommand())}return{type:`Pipe`,pos:e,decls:t?.vars??[],isAssign:t?.isAssign??!1,cmds:n}}tryParseDecls(){if(this.peek().type!==`Variable`)return;let e=1;for(;this.peek(e).type===`Comma`;){if(this.peek(e+1).type!==`Variable`)return;e+=2}let t=this.peek(e).type;if(t!==`Declare`&&t!==`Assign`)return;let n=[Vu(this.next())];for(;this.peek().type===`Comma`;)this.next(),n.push(Vu(this.expect(`Variable`,`$variable`)));return{vars:n,isAssign:this.next().type===`Assign`}}parseCommand(){let e=this.peek().pos,t=[this.parsePrimary()];for(;Bu(this.peek().type);)t.push(this.parsePrimary());return{type:`Command`,pos:e,args:t}}parsePrimary(){let e=this.next();switch(e.type){case`Dot`:return{type:`Dot`,pos:e.pos};case`Field`:return{type:`Field`,pos:e.pos,idents:e.value.slice(1).split(`.`)};case`Variable`:return Vu(e);case`Identifier`:return{type:`Identifier`,pos:e.pos,ident:e.value};case`String`:return{type:`String`,pos:e.pos,raw:e.value,value:qu(e.value,e.pos,this.source)};case`Number`:return Uu(e);case`Char`:return Wu(e,this.source);case`Bool`:return{type:`Bool`,pos:e.pos,value:e.value===`true`};case`Nil`:return{type:`Nil`,pos:e.pos};case`LeftParen`:return this.parseChainOrPipe(e.pos);default:throw this.errAt(e,`expected command argument, found ${zu(e)}`,{expected:`command argument`,found:zu(e)})}}parseChainOrPipe(e){let t=this.parsePipeline(),n=this.expect(`RightParen`,"`)`"),r=[],i=n.pos.offset+1,a=this.peek();return a.type===`Field`&&a.pos.offset===i&&(this.next(),r.push(...a.value.slice(1).split(`.`))),r.length===0?t:{type:`Chain`,pos:e,node:t,fields:r}}};function Lu(e,t){return{type:`List`,pos:e,nodes:t}}function Ru(e){return{trimLeft:e.trimLeft===!0,trimRight:e.trimRight===!0}}function zu(e){return e.type===`EOF`?`end of input`:e.value||e.type}function Bu(e){switch(e){case`Dot`:case`Field`:case`Variable`:case`Identifier`:case`String`:case`Number`:case`Char`:case`Bool`:case`Nil`:case`LeftParen`:return!0;default:return!1}}function Vu(e){return{type:`Variable`,pos:e.pos,idents:Hu(e.value)}}function Hu(e){let t=e.indexOf(`.`);return t===-1?[e]:[e.slice(0,t),...e.slice(t+1).split(`.`)]}function Uu(e){let t=e.value,n=t.replace(/_/g,``),r=n.toLowerCase().endsWith(`i`),i=r?n.slice(0,-1):n,a=!r&&(i.includes(`.`)||!i.startsWith(`0x`)&&!i.startsWith(`0X`)&&/[eE]/.test(i)||(i.startsWith(`0x`)||i.startsWith(`0X`))&&/[pP]/.test(i)),o=!r&&!a,s={type:`Number`,pos:e.pos,text:t,isInt:o,isUint:!1,isFloat:a,isComplex:r};if(o){let e=Gu(i);return{...s,intValue:e}}if(a){let e=Ku(i);return{...s,floatValue:e}}let c=Ku(i);return{...s,complexValue:[0,c]}}function Wu(e,t){let n=Ju(e.value,e.pos,t);return{type:`Number`,pos:e.pos,text:e.value,isInt:!0,isUint:!1,isFloat:!1,isComplex:!1,intValue:BigInt(n)}}function Gu(e){let t=1n,n=e;return n.startsWith(`+`)?n=n.slice(1):n.startsWith(`-`)&&(t=-1n,n=n.slice(1)),t*BigInt(n)}function Ku(e){return Number(e)}function qu(e,t,n){if(e.startsWith("`"))return e.slice(1,-1);let r=``;for(let i=1;i<e.length-1;i++){let a=e[i];if(a!==`\\`){r+=a;continue}let o=e[++i];switch(o){case`n`:r+=`
96
+ `;break;case`t`:r+=` `;break;case`r`:r+=`\r`;break;case`\\`:r+=`\\`;break;case`"`:r+=`"`;break;case`'`:r+=`'`;break;case`a`:r+=`\x07`;break;case`b`:r+=`\b`;break;case`f`:r+=`\f`;break;case`v`:r+=`\v`;break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:{let t=o+(e[i+1]??``)+(e[i+2]??``);i+=2,r+=String.fromCodePoint(Number.parseInt(t,8));break}case`x`:{let t=(e[i+1]??``)+(e[i+2]??``);i+=2,r+=String.fromCodePoint(Number.parseInt(t,16));break}case`u`:{let t=e.slice(i+1,i+5);i+=4,r+=String.fromCodePoint(Number.parseInt(t,16));break}case`U`:{let t=e.slice(i+1,i+9);i+=8,r+=String.fromCodePoint(Number.parseInt(t,16));break}default:throw new pu(`bad escape sequence \\${o}`,t,{expected:`valid escape sequence`,found:`\\${o}`,source:n})}}return r}function Ju(e,t,n){let r=qu(`"${e.slice(1,-1).replace(/"/g,`\\"`)}"`,t,n);if(r.length===0)throw new pu(`empty rune literal`,t,{source:n});return r.codePointAt(0)??0}const Yu=Symbol(`go-template-js.MISSING`);function Xu(e,t){if(e==null)return Yu;if(e instanceof Map)return e.has(t)?e.get(t):Yu;if(Array.isArray(e))return Yu;if(typeof e==`object`){let n=e;return t in n?n[t]:Yu}return Yu}function Zu(e,t){let n=e;for(let e of t){if(n===Yu)return Yu;n=Xu(n,e)}return n}function Qu(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||e===void 0||t===void 0||typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length?e.every((e,n)=>Qu(e,t[n])):!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Qu(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>Qu(e[n],t[n])):!1}return!1}const $u=new WeakSet;function ed(e){return $u.add(e),e}function td(e){return $u.has(e)}function nd(e){return e==null||e===!1?!1:typeof e==`number`?e!==0&&!Number.isNaN(e):typeof e==`bigint`?e!==0n:typeof e==`string`||Array.isArray(e)?e.length>0:e instanceof Map||e instanceof Set?e.size>0:typeof e==`object`?Object.keys(e).length>0:!!e}function rd(e){return{eq:{fn:(e,...t)=>t.some(t=>od(e,t)),argTypes:[`comparable`]},ne:{fn:(e,t)=>!od(e,t),argTypes:[`comparable`,`comparable`]},lt:{fn:(e,t)=>sd(e,t)<0,argTypes:[`ordered`,`ordered`]},le:{fn:(e,t)=>sd(e,t)<=0,argTypes:[`ordered`,`ordered`]},gt:{fn:(e,t)=>sd(e,t)>0,argTypes:[`ordered`,`ordered`]},ge:{fn:(e,t)=>sd(e,t)>=0,argTypes:[`ordered`,`ordered`]},len:{fn:e=>cd(e),argTypes:[`sized`]},index:{fn:(e,...t)=>{let n=e;for(let e of t)n=ld(n,e);return n},argTypes:[`collection`,`index-key`]},slice:{fn:(e,...t)=>{let n=t.length>=1?Number(t[0]):0,r=t.length>=2?Number(t[1]):void 0;return e.slice(n,r)},argTypes:[`sliceable`,`number`]},print:{fn:(...t)=>fd(t,e),argTypes:[`stringifiable`],returnType:`string`},println:{fn:(...t)=>`${fd(t,e)}\n`,argTypes:[`stringifiable`],returnType:`string`},printf:{fn:(t,...n)=>xd(t,n,e),argTypes:[`string`,`stringifiable`],returnType:`string`},call:{fn:(e,...t)=>e(...t),argTypes:[`callable`,`value`]},html:{fn:(...t)=>hd(fd(t,e)),argTypes:[`stringifiable`],returnType:`string`},js:{fn:(...t)=>vd(fd(t,e)),argTypes:[`stringifiable`],returnType:`string`},urlquery:{fn:(...t)=>bd(fd(t,e)),argTypes:[`stringifiable`],returnType:`string`},not:{fn:e=>!nd(e),argTypes:[`truthy`]}}}function id(){return{and:ed({argTypes:[`truthy`],fn:(...e)=>{let t=!0;for(let n of e)if(t=n(),!nd(t))return t;return t}}),or:ed({argTypes:[`truthy`],fn:(...e)=>{let t=!1;for(let n of e)if(t=n(),nd(t))return t;return t}})}}function ad(e){return{...rd(e),...id()}}function od(e,t){return typeof e==`number`&&typeof t==`bigint`?BigInt(e)===t:typeof e==`bigint`&&typeof t==`number`?e===BigInt(t):Qu(e,t)}function sd(e,t){if(typeof e==`bigint`&&typeof t==`bigint`)return e===t?0:e<t?-1:1;if(typeof e==`bigint`||typeof t==`bigint`){let n=typeof e==`bigint`?e:BigInt(Math.trunc(Number(e))),r=typeof t==`bigint`?t:BigInt(Math.trunc(Number(t)));return n===r?0:n<r?-1:1}let n=e,r=t;return n===r?0:n<r?-1:1}function cd(e){return typeof e==`string`||Array.isArray(e)?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function ld(e,t){if(Array.isArray(e)){let n=Number(t);if(!Number.isInteger(n))throw Error(`index: array index must be integer, got ${ud(t)}`);if(n<0||n>=e.length)throw Error(`index: out of range [${n}] with length ${e.length}`);return e[n]}if(e instanceof Map)return e.get(t);if(typeof e==`string`)return e[Number(t)];if(typeof e==`object`&&e){if(typeof t!=`string`)throw Error(`index: object index must be string, got ${ud(t)}`);return e[t]}throw Error(`index: cannot index ${ud(e)}`)}function ud(e){return e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:e instanceof Map?`Map`:typeof e}function dd(e){return e==null?`<nil>`:typeof e==`string`?`string`:typeof e==`boolean`?`bool`:typeof e==`bigint`?`int64`:typeof e==`number`?Number.isInteger(e)?`int`:`float64`:Array.isArray(e)?`[]interface {}`:e instanceof Map||typeof e==`object`?`map[string]interface {}`:typeof e}function fd(e,t){let n=``,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=typeof a==`string`;i>0&&!r&&!o&&(n+=` `),n+=pd(a,t),r=o}return n}function pd(e,t){return e==null?`<nil>`:typeof e==`string`?e:t(e)}const md={"\0":`�`,'"':`&#34;`,"'":`&#39;`,"&":`&amp;`,"<":`&lt;`,">":`&gt;`};function hd(e){return e.replace(/[\0"'&<>]/g,e=>md[e]??e)}const gd={"\\":`\\\\`,"'":`\\'`,'"':`\\"`,"<":`\\u003C`,">":`\\u003E`,"&":`\\u0026`,"=":`\\u003D`},_d=/^[\p{L}\p{M}\p{N}\p{P}\p{S}]$/u;function vd(e){let t=``;for(let n of e){let e=gd[n];if(e!==void 0){t+=e;continue}let r=n.codePointAt(0);if(r<32||r>=128&&!_d.test(n)){t+=`\\u${r.toString(16).toUpperCase().padStart(4,`0`)}`;continue}t+=n}return t}const yd=new TextEncoder;function bd(e){let t=``,n=yd.encode(e);for(let e of n)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===45||e===46||e===95||e===126?t+=String.fromCharCode(e):e===32?t+=`+`:t+=`%${e.toString(16).toUpperCase().padStart(2,`0`)}`;return t}function xd(e,t,n){let r=``,i=0,a=0;for(;a<e.length;){let o=e[a];if(o!==`%`){r+=o,a+=1;continue}if(e[a+1]===`%`){r+=`%`,a+=2;continue}let s=a+1;for(;s<e.length&&`+-# 0`.includes(e[s]??``);)s+=1;for(;s<e.length&&e[s]!==void 0&&/[0-9]/.test(e[s]);)s+=1;if(e[s]===`.`)for(s+=1;s<e.length&&e[s]!==void 0&&/[0-9]/.test(e[s]);)s+=1;let c=e[s],l=e.slice(a+1,s),u=t[i++];r+=Sd(c??``,l,u,n),a=s+1}return r}function Sd(e,t,n,r){switch(e){case`s`:return typeof n==`string`?Cd(t,n):Cd(t,pd(n,r));case`d`:return typeof n!=`number`&&typeof n!=`bigint`?`%!${e}(${dd(n)}=${pd(n,r)})`:Cd(t,String(typeof n==`bigint`?n:Math.trunc(n)));case`v`:return Cd(t,wd(n));case`q`:return Cd(t,JSON.stringify(pd(n,r)));case`f`:{if(typeof n!=`number`&&typeof n!=`bigint`)return`%!${e}(${dd(n)}=${pd(n,r)})`;let i=t.includes(`.`)?Number(t.split(`.`)[1]):6;return Cd(t,Number(n).toFixed(i))}case`t`:return Cd(t,nd(n)?`true`:`false`);case`x`:if(typeof n==`string`){let e=new TextEncoder().encode(n),r=``;for(let t of e)r+=t.toString(16).padStart(2,`0`);return Cd(t,r)}return typeof n!=`number`&&typeof n!=`bigint`?`%!${e}(${dd(n)}=${pd(n,r)})`:typeof n==`bigint`?Cd(t,n.toString(16)):Cd(t,Math.trunc(n).toString(16));default:return`%!${e}(${dd(n)}=${pd(n,r)})`}}function Cd(e,t){let n=e.match(/^([+\-# 0]*)/)?.[1]??``,r=e.slice(n.length).match(/^(\d+)/);if(!r)return t;let i=Number(r[1]);if(t.length>=i)return t;let a=` `.repeat(i-t.length);return n.includes(`-`)?t+a:a+t}function wd(e){return e==null?`<nil>`:typeof e==`string`?e:typeof e==`bigint`?e.toString():Array.isArray(e)?`[${e.map(wd).join(` `)}]`:e instanceof Map?`map[${[...e.entries()].map(([e,t])=>`${wd(e)}:${wd(t)}`).join(` `)}]`:typeof e==`object`?`{${Object.values(e).map(wd).join(` `)}}`:String(e)}function Td(e){return{dot:e,root:e,parent:void 0,vars:new Map}}function Ed(e,t){return{dot:t,root:e.root,parent:e,vars:new Map}}function Dd(e,t){let n=e;for(;n!==void 0;){if(n.vars.has(t))return{found:!0,value:n.vars.get(t)};n=n.parent}return{found:!1}}function Od(e,t,n){e.vars.set(t,n)}const kd=new Set([`default`,`zero`,`error`]);function Ad(e){if(e===void 0)return`default`;if(kd.has(e))return e;throw Error(`EngineConfig.missingKey: expected "default" | "zero" | "error", got ${jd(e)}`)}function jd(e){return typeof e==`string`?JSON.stringify(e):e===null?`null`:e===void 0?`undefined`:typeof e==`bigint`?`${e}n`:typeof e==`number`||typeof e==`boolean`?String(e):typeof e==`symbol`?e.toString():typeof e==`function`?`[Function]`:`[${typeof e}]`}function Md(e){if(e!==void 0){if(typeof e!=`object`||!e)throw Error(`EngineConfig.delims: expected { left, right } object, got ${jd(e)}`);if(typeof e.left!=`string`||e.left.length===0)throw Error(`EngineConfig.delims.left: expected non-empty string, got ${jd(e.left)}`);if(typeof e.right!=`string`||e.right.length===0)throw Error(`EngineConfig.delims.right: expected non-empty string, got ${jd(e.right)}`);return{left:e.left,right:e.right}}}const Nd=Object.freeze({kind:`break`}),Pd=Object.freeze({kind:`continue`}),Fd={kind:`none`};let Id;(class e{source;_evaluate;constructor(e,t){this.source=e,this._evaluate=t}static{Id=(t,n)=>new e(t,n)}evaluate(e){return this._evaluate(e)}});var Ld=class{fromString;toString;funcs;missingKey;delims;constructor(e){this.fromString=e.fromString;let t=Object.hasOwn(e,`toString`)?e.toString:void 0;this.toString=t??Kd,this.missingKey=Ad(e.missingKey),this.delims=Md(e.delims),this.funcs={...ad(this.toString),...e.funcs??{}}}parse(e){let t=Fu(e,this.delims);return Id(t.source,e=>this.evalParsed(t,e))}compile(e){let t=this.parse(e);return e=>t.evaluate(e)}evaluate(e,t){return e.evaluate(t)}evalParsed(e,t){let n=[],r=Td(t),i={out:n,defines:e.defines,source:e.source};return this.evalList(e.root,r,i),n}evalList(e,t,n){for(let r of e.nodes)this.evalNode(r,t,n)}evalNode(e,t,n){switch(e.type){case`Text`:n.out.push(this.fromString(e.text));return;case`Comment`:return;case`Action`:{let r=this.evalAction(e,t,n);e.pipe.decls.length===0&&this.emitFromValue(r,n);return}case`List`:this.evalList(e,t,n);return;case`If`:this.evalIf(e,t,n);return;case`Range`:this.evalRange(e,t,n);return;case`With`:this.evalWith(e,t,n);return;case`Break`:throw Nd;case`Continue`:throw Pd;case`Template`:this.evalTemplateInvoke(e,t,n);return;case`Block`:this.evalBlock(e,t,n);return;case`Pipe`:case`Command`:case`Identifier`:case`Field`:case`Variable`:case`Chain`:case`Dot`:case`Nil`:case`Bool`:case`Number`:case`String`:throw new mu(`unexpected ${e.type} at statement position`,e.pos,{source:n.source});default:Su(e)}}evalIf(e,t,n){nd(this.evalPipe(e.pipe,t,n))?this.evalList(e.list,t,n):e.elseList&&this.evalList(e.elseList,t,n)}evalWith(e,t,n){let r=this.evalPipe(e.pipe,t,n);if(nd(r)){let i=Ed(t,r);this.evalList(e.list,i,n)}else e.elseList&&this.evalList(e.elseList,t,n)}evalRange(e,t,n){let r=this.evalPipeWithoutDecls(e.pipe,t,n),i=e.pipe.decls,a=ef(r);try{if(a.length===0){e.elseList&&this.evalList(e.elseList,t,n);return}for(let[r,o]of a){let a=Ed(t,o);if(i.length===1)Od(a,i[0]?.idents[0]??`$`,o);else if(i.length>=2){let e=i[0]?.idents[0]??`$`,t=i[1]?.idents[0]??`$`;Od(a,e,r),Od(a,t,o)}try{this.evalList(e.list,a,n)}catch(e){if(e===Pd)continue;throw e}}}catch(e){if(e===Nd)return;throw e}}evalTemplateInvoke(e,t,n){let r=n.defines.get(e.name);if(!r)throw new mu(`template ${JSON.stringify(e.name)} is not defined`,e.pos,{source:n.source});let i=Ed(t,e.pipe?this.evalPipe(e.pipe,t,n):t.dot);this.evalList(r,i,n)}evalBlock(e,t,n){let r=Ed(t,e.pipe?this.evalPipe(e.pipe,t,n):t.dot),i=n.defines.get(e.name)??e.list;this.evalList(i,r,n)}evalAction(e,t,n){return this.evalPipe(e.pipe,t,n)}evalPipe(e,t,n){if(e.cmds.length===0)throw new mu(`empty pipeline`,e.pos,{source:n.source});let r=this.evalCommand(e.cmds[0],t,n,Fd);for(let i=1;i<e.cmds.length;i++){let a=e.cmds[i];r=this.evalCommand(a,t,n,{kind:`value`,value:r})}if(e.decls.length>0)for(let n of e.decls)Od(t,n.idents[0]??`$`,r);return r}evalPipeWithoutDecls(e,t,n){let r={type:`Pipe`,pos:e.pos,decls:[],isAssign:!1,cmds:e.cmds};return this.evalPipe(r,t,n)}evalCommand(e,t,n,r){if(e.args.length===0)throw new mu(`empty command`,e.pos,{source:n.source});let i=e.args[0];if(i.type!==`Identifier`){if(e.args.length>1)throw new mu(`cannot apply arguments to a ${i.type} primary; only functions take arguments`,e.pos,{source:n.source});return this.evalPrimary(i,t,n)}let a=this.funcs[i.ident];if(!a)throw new hu(i.ident,i.pos,{source:n.source,available:Object.keys(this.funcs)});let o=e.args.slice(1),s=td(a),c=o.map(e=>s?()=>this.evalPrimary(e,t,n):this.evalPrimary(e,t,n));if(r.kind===`value`){let e=r.value;c.push(s?()=>e:e)}Hd(i.ident,a.argTypes,c,e.pos,n.source,this.toString,a.argTypePattern,this.fromString);try{return a.fn(...c)}catch(t){throw t instanceof gu?new gu(t.funcName,t.argIndex,t.expected,t.receivedSummary,e.pos,{source:n.source}):t instanceof vu?new vu(t.message,e.pos,{source:n.source}):t}}evalPrimary(e,t,n){switch(e.type){case`Dot`:return t.dot;case`Nil`:return null;case`Bool`:return e.value;case`Number`:return rf(e);case`String`:return e.value;case`Field`:return this.resolveFieldChain(t.dot,e.idents,e.pos,n);case`Variable`:return this.resolveVariable(e.idents,t,e.pos,n);case`Identifier`:{let t=this.funcs[e.ident];if(!t)throw new hu(e.ident,e.pos,{source:n.source,available:Object.keys(this.funcs)});return Hd(e.ident,t.argTypes,[],e.pos,n.source,this.toString,t.argTypePattern,this.fromString),t.fn()}case`Chain`:return this.resolveFieldChain(this.evalPrimary(e.node,t,n),e.fields,e.pos,n);case`Pipe`:return this.evalPipe(e,t,n);default:throw new mu(`cannot evaluate ${e.type} as a value`,e.pos,{source:n.source})}}resolveFieldChain(e,t,n,r){let i=Zu(e,t);if(i!==Yu)return i;if(this.missingKey===`error`)throw new _u(t,n,{source:r.source})}resolveVariable(e,t,n,r){let i=e[0]??`$`;if(i===`$`){let i=e.slice(1);return i.length===0?t.root:this.resolveFieldChain(t.root,i,n,r)}let a=Dd(t,i);if(!a.found)throw new mu(`undefined variable ${i}`,n,{source:r.source});let o=e.slice(1);return o.length===0?a.value:this.resolveFieldChain(a.value,o,n,r)}emitFromValue(e,t){if(e==null){t.out.push(this.fromString(`<no value>`));return}if(typeof e==`string`){t.out.push(this.fromString(e));return}if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`){t.out.push(this.fromString(String(e)));return}if(Array.isArray(e)){t.out.push(this.fromString(Rd(e)));return}if(e instanceof Map){t.out.push(this.fromString(zd(e)));return}t.out.push(e)}};function Rd(e){return`[${e.map(Bd).join(` `)}]`}function zd(e){let t=[];for(let[n,r]of e)t.push(`${Bd(n)}:${Bd(r)}`);return`map[${t.join(` `)}]`}function Bd(e){return e==null?`<nil>`:Array.isArray(e)?Rd(e):e instanceof Map?zd(e):String(e)}function Vd(e){return new Ld(e)}function Hd(e,t,n,r,i,a=Kd,o,s=Gd){let c=Ud(t,o),l=-1,u=-1;for(let t=0;t<n.length;t++){let o=c(t),d=n[t];if(!Wd(o,d,a))throw new gu(e,t+1,Qd(o),$d(d),r,{source:i});if(o===`liftable`&&typeof d==`string`&&(n[t]=s(d)),o===`int`?n[t]=Math.trunc(Number(d)):o===`float`&&(n[t]=Number(d)),o===`ordered`){if(l===-1)l=t;else if(!Yd(n[l],d))throw new gu(e,t+1,`${Qd(`ordered`)} of the same kind as ${$d(n[l])}`,$d(d),r,{source:i})}if(o===`comparable`){if(u===-1)u=t;else if(!Xd(n[u],d))throw new gu(e,t+1,`${Qd(`comparable`)} of the same kind as ${$d(n[u])}`,$d(d),r,{source:i})}}}function Ud(e,t){if(e.length===0)return()=>`value`;if(t===`alternating`){let t=e.length;return n=>e[n%t]}let n=e[e.length-1];return t=>t<e.length?e[t]:n}function Wd(e,t,n){switch(e){case`truthy`:case`reflective`:case`value`:return!0;case`string`:return typeof t==`string`;case`number`:return typeof t==`number`||typeof t==`bigint`;case`int`:return typeof t==`number`&&Number.isFinite(t)||typeof t==`bigint`&&Number.isSafeInteger(Number(t));case`float`:return typeof t==`number`||typeof t==`bigint`&&Number.isFinite(Number(t));case`bool`:return typeof t==`boolean`;case`ordered`:return typeof t==`string`||typeof t==`number`||typeof t==`bigint`||typeof t==`boolean`;case`T`:return t!=null&&typeof t!=`string`&&typeof t!=`number`&&typeof t!=`boolean`&&typeof t!=`bigint`&&typeof t!=`symbol`;case`list`:return Array.isArray(t);case`dict`:return qd(t);case`sized`:return typeof t==`string`||Array.isArray(t)||t instanceof Map||t instanceof Set||qd(t);case`comparable`:return t==null||typeof t==`string`||typeof t==`number`||typeof t==`bigint`||typeof t==`boolean`||Array.isArray(t)||t instanceof Map||t instanceof Set||qd(t);case`callable`:return typeof t==`function`;case`collection`:return typeof t==`string`||Array.isArray(t)||t instanceof Map||qd(t);case`index-key`:return typeof t==`string`||typeof t==`number`||typeof t==`bigint`;case`sliceable`:return typeof t==`string`||Array.isArray(t);case`stringifiable`:if(typeof t==`string`)return!0;try{return n(t),!0}catch{return!1}case`liftable`:return typeof t==`string`||t!=null&&typeof t!=`number`&&typeof t!=`boolean`&&typeof t!=`bigint`&&typeof t!=`symbol`;case`serializable`:return Jd(t)}}function Gd(e){return e}function Kd(e){if(typeof e==`string`)return e;if(e==null)return`<nil>`;if(typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`)return String(e);throw new gu(`<engine.toString>`,1,`string (or a consumer-supplied toString that flattens T)`,$d(e),{line:0,column:0,offset:0})}function qd(e){if(typeof e!=`object`||!e||Array.isArray(e)||e instanceof Map||e instanceof Set)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Jd(e){try{return JSON.stringify(e)!==void 0}catch{return!1}}function Yd(e,t){return typeof e==typeof t||typeof e==`number`&&typeof t==`bigint`||typeof e==`bigint`&&typeof t==`number`}function Xd(e,t){let n=Zd(e),r=Zd(t);return n===`nil`||r===`nil`?!0:n===r}function Zd(e){return e==null?`nil`:typeof e==`string`?`string`:typeof e==`number`||typeof e==`bigint`?`number`:typeof e==`boolean`?`boolean`:Array.isArray(e)?`array`:e instanceof Map?`map`:e instanceof Set?`set`:`object`}function Qd(e){switch(e){case`int`:return`integer (finite number or safe-integer bigint)`;case`float`:return`float (number, including NaN/Infinity, or finite-convertible bigint)`;case`T`:return`T (consumer-defined fragment)`;case`ordered`:return`orderable primitive`;case`list`:return`list`;case`dict`:return`dict (plain object)`;case`sized`:return`sized value (string, list, map, set, or dict)`;case`comparable`:return`comparable value (orderable primitive, nil, list, dict, Map, or Set)`;case`stringifiable`:return`stringifiable value (string or convertible via the engine's toString)`;case`liftable`:return`liftable value (T or string, the latter lifted via the engine's fromString)`;case`callable`:return`callable (function value)`;case`collection`:return`collection (string, array, Map, or dict)`;case`index-key`:return`index key (number, bigint, or string)`;case`sliceable`:return`sliceable value (string or array)`;case`serializable`:return`JSON-serializable value`;case`truthy`:case`reflective`:case`value`:case`string`:case`number`:case`bool`:return e}}function $d(e){return e===null?`null`:e===void 0?`undefined`:Array.isArray(e)?`array`:e instanceof Map?`Map`:typeof e}function ef(e){return e==null?[]:Array.isArray(e)?e.map((e,t)=>[t,e]):typeof e==`string`?[...e].map((e,t)=>[t,e]):e instanceof Map?tf([...e.entries()]):e instanceof Set?[...e.values()].map((e,t)=>[t,e]):typeof e==`object`?tf(Object.entries(e)):[]}function tf(e){return[...e].sort((e,t)=>nf(e[0],t[0]))}function nf(e,t){if((typeof e==`number`||typeof e==`bigint`)&&(typeof t==`number`||typeof t==`bigint`)){let n=typeof e==`bigint`?Number(e):e,r=typeof t==`bigint`?Number(t):t;return n===r?0:n<r?-1:1}let n=String(e),r=String(t);return n===r?0:n<r?-1:1}function rf(e){if(e.intValue!==void 0){let t=e.intValue;return t>=BigInt(-(2**53-1))&&t<=BigInt(2**53-1)?Number(t):t}if(e.floatValue!==void 0)return e.floatValue;if(e.complexValue!==void 0)return e.complexValue;throw Error(`internal: NumberNode has none of intValue/floatValue/complexValue — parser invariant violated`)}function af(e){if(!/^[+-]?\d+$/.test(e))return 0;let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}function of(e){if(typeof e==`number`)return e;if(typeof e==`bigint`)return Number(e);if(typeof e==`string`){let t=Number.parseFloat(e);return Number.isNaN(t)?0:t}return typeof e==`boolean`?+!!e:0}function sf(e){if(e===``)return null;let t=1,n=e;return n[0]===`+`?n=n.slice(1):n[0]===`-`&&(t=-1,n=n.slice(1)),n===``?null:/^0x[0-9a-fA-F]+$/i.test(n)?{sign:t,digits:n.slice(2),base:16}:/^0b[01]+$/i.test(n)?{sign:t,digits:n.slice(2),base:2}:/^0o[0-7]+$/i.test(n)?{sign:t,digits:n.slice(2),base:8}:n===`0`?{sign:t,digits:`0`,base:10}:n[0]===`0`?/^0[0-7]+$/.test(n)?{sign:t,digits:n.slice(1),base:8}:null:/^[0-9]+$/.test(n)?{sign:t,digits:n,base:10}:null}function cf(e){if(typeof e==`number`)return Math.trunc(e);if(typeof e==`bigint`)return Number(e);if(typeof e==`string`){let t=sf(e);if(t===null)return 0;let n=Number.parseInt(t.digits,t.base);return Number.isNaN(n)?0:t.sign*n}return typeof e==`boolean`?+!!e:0}function lf(e){if(typeof e==`bigint`)return e;if(typeof e==`number`)return BigInt(Math.trunc(e));if(typeof e==`string`){let t=sf(e);if(t===null)return 0n;let n=t.base===16?`0x`:t.base===2?`0b`:t.base===8?`0o`:``,r=BigInt(n+t.digits);return t.sign===-1?-r:r}return typeof e==`boolean`&&e?1n:0n}function uf(e){if(!/^[+-]?[0-7]+$/.test(e))return 0;let t=e[0]===`-`?-1:1,n=e[0]===`+`||e[0]===`-`?e.slice(1):e,r=Number.parseInt(n,8);return Number.isNaN(r)?0:t*r}function df(e){return JSON.stringify(e)??`null`}function ff(e){return typeof e==`string`?e:wd(e)}function pf(e){return e.map(ff)}function mf(){return{atoi:{fn:e=>af(e),argTypes:[`string`],returnType:`number`},int:{fn:e=>cf(e),argTypes:[`value`],returnType:`number`},int64:{fn:e=>lf(e),argTypes:[`value`]},float64:{fn:e=>of(e),argTypes:[`value`],returnType:`number`},toString:{fn:e=>ff(e),argTypes:[`value`],returnType:`string`},toStrings:{fn:e=>pf(e),argTypes:[`list`]},toDecimal:{fn:e=>uf(e),argTypes:[`string`],returnType:`number`},toRawJson:{fn:e=>df(e),argTypes:[`serializable`],returnType:`string`}}}const hf={h:36e11,m:6e10,s:1e9,ms:1e6,us:1e3,µs:1e3,ns:1};function gf(e){if(e===`0`)return 0;let t=!1,n=e;if(n.startsWith(`-`)?(t=!0,n=n.slice(1)):n.startsWith(`+`)&&(n=n.slice(1)),!n)return NaN;let r=0,i=/^(\d+(?:\.\d+)?)(ns|µs|us|ms|[smh])/;for(;n.length>0;){let e=i.exec(n);if(!e)return NaN;let t=parseFloat(e[1]??`0`),a=e[2];r+=t*hf[a],n=n.slice(e[0].length)}return t?-r:r}function _f(e){if(e===0)return`0s`;let t=!1,n=e;n<0&&(t=!0,n=-n);let r;return r=n<hf.us?`${Math.floor(n)}ns`:n<hf.ms?vf(n,hf.us,3,`µs`):n<hf.s?vf(n,hf.ms,6,`ms`):yf(n),t?`-${r}`:r}function vf(e,t,n,r){let i=Math.floor(e/t),a=Math.round(e%t);return a===0?`${i}${r}`:`${i}.${String(a).padStart(n,`0`).replace(/0+$/,``)}${r}`}function yf(e){let t=Math.floor(e/hf.h);e-=t*hf.h;let n=Math.floor(e/hf.m);e-=n*hf.m;let r=Math.floor(e/hf.s),i=e-r*hf.s,a=i===0?`${r}s`:`${r}.${String(Math.round(i)).padStart(9,`0`).replace(/0+$/,``)}s`;return t>0?`${t}h${n}m${a}`:n>0?`${n}m${a}`:a}function bf(e){return e*hf.s}function xf(e){if(e instanceof Date)return e;if(typeof e==`bigint`)return new Date(Number(e)*1e3);if(typeof e==`number`)return new Date(e*1e3);if(typeof e==`string`){let t=new Date(e);if(!Number.isNaN(t.getTime()))return t;throw Error(`sprig: cannot parse date value ${JSON.stringify(e)}`)}throw Error(`sprig: unsupported date type: ${typeof e}`)}function Sf(e,t){let n=t().getTime()-xf(e).getTime();return _f(Math.round(n/1e3)*1e9)}const Cf=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],wf=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Tf=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],Ef=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function Df(e){return e<10?`0${e}`:String(e)}function Of(e){return e<10?`00${e}`:e<100?`0${e}`:String(e)}function kf(e){return e<10?` ${e}`:String(e)}function Af(e){let t=e>=0?`+`:`-`,n=Math.abs(e);return`${t}${Df(Math.floor(n/60))}${Df(n%60)}`}function jf(e){let t=e>=0?`+`:`-`,n=Math.abs(e);return`${t}${Df(Math.floor(n/60))}:${Df(n%60)}`}function Mf(e){return`${e>=0?`+`:`-`}${Df(Math.floor(Math.abs(e)/60))}`}function Nf(e){return e===0?`Z`:Af(e)}function Pf(e){return e===0?`Z`:jf(e)}function Ff(e){return e===0?`Z`:Mf(e)}function If(e,t,n){let r=e*1e6,i=String(r).padStart(9,`0`).slice(0,t);return n?i.replace(/0+$/,``):i}const Lf=[[`.000000000`,e=>`.${If(e.ms,9,!1)}`],[`.999999999`,e=>{let t=If(e.ms,9,!0);return t?`.${t}`:``}],[`.000000`,e=>`.${If(e.ms,6,!1)}`],[`.999999`,e=>{let t=If(e.ms,6,!0);return t?`.${t}`:``}],[`.000`,e=>`.${Of(e.ms)}`],[`.999`,e=>{let t=Of(e.ms).replace(/0+$/,``);return t?`.${t}`:``}],[`January`,e=>Cf[e.month-1]??`January`],[`Monday`,e=>Tf[e.weekday]??`Monday`],[`Z07:00`,e=>Pf(e.offsetMinutes)],[`-07:00`,e=>jf(e.offsetMinutes)],[`Z0700`,e=>Nf(e.offsetMinutes)],[`-0700`,e=>Af(e.offsetMinutes)],[`2006`,e=>String(e.year)],[`Jan`,e=>wf[e.month-1]??`Jan`],[`Mon`,e=>Ef[e.weekday]??`Mon`],[`MST`,e=>e.tzAbbr],[`-07`,e=>Mf(e.offsetMinutes)],[`Z07`,e=>Ff(e.offsetMinutes)],[`15`,e=>Df(e.hour)],[`01`,e=>Df(e.month)],[`02`,e=>Df(e.day)],[`_2`,e=>kf(e.day)],[`03`,e=>Df(e.hour12)],[`04`,e=>Df(e.minute)],[`05`,e=>Df(e.second)],[`06`,e=>Df(e.year%100)],[`PM`,e=>e.hour>=12?`PM`:`AM`],[`pm`,e=>e.hour>=12?`pm`:`am`],[`1`,e=>String(e.month)],[`2`,e=>String(e.day)],[`3`,e=>String(e.hour12)],[`4`,e=>String(e.minute)],[`5`,e=>String(e.second)]];function Rf(e,t){let n=``,r=0;for(;r<e.length;){let i=!1;for(let[a,o]of Lf)if(e.startsWith(a,r)){n+=o(t),r+=a.length,i=!0;break}i||(n+=e[r++])}return n}const zf={year:`numeric`,month:`2-digit`,day:`2-digit`,weekday:`long`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1};function Bf(e){let t=new Map;for(let n of e)t.set(n.type,n.value);return t}const Vf=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`];function Hf(e,t){let n;try{new Intl.DateTimeFormat(`en-US`,{timeZone:t}),n=t}catch{n=`UTC`}let r=Bf(new Intl.DateTimeFormat(`en-US`,{...zf,timeZone:n}).formatToParts(e)),i=parseInt(r.get(`hour`)??`0`,10)%24,a=Bf(new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`short`}).formatToParts(e)).get(`timeZoneName`)??n,o=Uf(Bf(new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`shortOffset`}).formatToParts(e)).get(`timeZoneName`)??`GMT`),s=Vf.indexOf(r.get(`weekday`)??`Sunday`);return{year:parseInt(r.get(`year`)??`2000`,10),month:parseInt(r.get(`month`)??`1`,10),day:parseInt(r.get(`day`)??`1`,10),weekday:s===-1?0:s,hour:i,hour12:i%12||12,minute:parseInt(r.get(`minute`)??`0`,10),second:parseInt(r.get(`second`)??`0`,10),ms:e.getUTCMilliseconds(),tzAbbr:a,offsetMinutes:o}}function Uf(e){if(e===`GMT`||e===`UTC`)return 0;let t=e.match(/^GMT([+-])(\d{1,2})(?::(\d{2}))?$/);if(!t)return 0;let n=t[1]===`+`?1:-1,r=parseInt(t[2]??`0`,10),i=parseInt(t[3]??`0`,10);return n*(r*60+i)}function Wf(){return Intl.DateTimeFormat().resolvedOptions().timeZone}function Gf(e,t){return Rf(e,Hf(xf(t),Wf()))}function Kf(e,t,n){return Rf(e,Hf(xf(t),n))}function qf(e,t){let n=xf(t),r=gf(e);return Number.isNaN(r)?n:new Date(n.getTime()+r/1e6)}function Jf(e){if(typeof e==`string`){let t=parseInt(e,10);return Number.isNaN(t)?`0s`:_f(bf(t))}return typeof e==`bigint`?_f(bf(Number(e))):typeof e==`number`?_f(bf(e)):`0s`}const Yf=36e11*24*365,Xf=36e11*24*30,Zf=36e11*24,Qf=36e11,$f=6e10,ep=1e9;function tp(e){let t=gf(String(e));if(Number.isNaN(t))return`0s`;let n=Math.abs(t);return n>Yf?`${Math.floor(n/Yf)}y`:n>Xf?`${Math.floor(n/Xf)}mo`:n>Zf?`${Math.floor(n/Zf)}d`:n>Qf?`${Math.floor(n/Qf)}h`:n>$f?`${Math.floor(n/$f)}m`:n>ep?`${Math.floor(n/ep)}s`:`0s`}function np(e){let t=Hf(xf(e),Wf());return`${t.year}-${String(t.month).padStart(2,`0`)}-${String(t.day).padStart(2,`0`)}`}function rp(e,t){let n=Hf(xf(e),t);return`${n.year}-${String(n.month).padStart(2,`0`)}-${String(n.day).padStart(2,`0`)}`}function ip(e){return e()}const ap=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],op=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function sp(){return{year:2e3,month:1,day:1,hour:0,minute:0,second:0,ms:0,offsetMinutes:0,isPM:!1,hour12:!1}}function cp(e,t,n){return[e.slice(t,t+n),t+n]}function lp(e,t,n,r){let i=t;for(;i<e.length&&i-t<r&&e.charCodeAt(i)>=48&&e.charCodeAt(i)<=57;)i++;if(i-t<n)throw Error(`sprig toDate: expected ${n}-${r} digits at pos ${t}`);return[parseInt(e.slice(t,i),10),i]}function up(e,t){for(let[n,r]of ap.entries())if(e.startsWith(r,t))return[n+1,t+r.length];throw Error(`sprig toDate: expected month name at pos ${t}`)}function dp(e,t){for(let[n,r]of op.entries())if(e.startsWith(r,t))return[n+1,t+r.length];throw Error(`sprig toDate: expected short month name at pos ${t}`)}function fp(e,t){for(let n of[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`])if(e.startsWith(n,t))return t+n.length;throw Error(`sprig toDate: expected weekday name at pos ${t}`)}function pp(e,t){for(let n of[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`])if(e.startsWith(n,t))return t+n.length;throw Error(`sprig toDate: expected short weekday name at pos ${t}`)}function mp(e,t){if(e[t]===` `){let[n,r]=lp(e,t+1,1,1);return[n,r]}return lp(e,t,1,2)}function hp(e,t,n){let r=e[t]===`+`?1:e[t]===`-`?-1:0;if(r===0)throw Error(`sprig toDate: expected +/- at pos ${t}`);let i=t+1,[a,o]=lp(e,i,2,2);i=o;let s=0;if(n&&e[i]===`:`){let[t,n]=lp(e,i+1,2,2);s=t,i=n}else if(!n){let[t,n]=lp(e,i,2,2);s=t,i=n}return[r*(a*60+s),i]}function gp(e,t,n,r){if(e[t]===`Z`)return[0,t+1];if(r){let n=e[t]===`+`?1:e[t]===`-`?-1:0;if(n===0)throw Error(`sprig toDate: expected Z or +/- at pos ${t}`);let[r,i]=lp(e,t+1,2,2);return[n*r*60,i]}return hp(e,t,n)}function _p(e,t){let n=t;for(;n<e.length&&e.charCodeAt(n)>=65&&e.charCodeAt(n)<=90;)n++;if(n===t)throw Error(`sprig toDate: expected timezone abbreviation at pos ${t}`);return n}function vp(e,t,n){let[r,i]=cp(e,t,n),a=parseInt(r.padEnd(9,`0`),10);return[Math.round(a/1e6),i]}function yp(e,t,n,r){let i={...r};switch(e){case`January`:{let[e,r]=up(t,n);return i.month=e,[r,i]}case`Monday`:return[fp(t,n),i];case`Jan`:{let[e,r]=dp(t,n);return i.month=e,[r,i]}case`Mon`:return[pp(t,n),i];case`2006`:{let[e,r]=lp(t,n,4,4);return i.year=e,[r,i]}case`06`:{let[e,r]=lp(t,n,2,2);return i.year=e<70?2e3+e:1900+e,[r,i]}case`01`:{let[e,r]=lp(t,n,2,2);return i.month=e,[r,i]}case`1`:{let[e,r]=lp(t,n,1,2);return i.month=e,[r,i]}case`_2`:{let[e,r]=mp(t,n);return i.day=e,[r,i]}case`02`:{let[e,r]=lp(t,n,2,2);return i.day=e,[r,i]}case`2`:{let[e,r]=lp(t,n,1,2);return i.day=e,[r,i]}case`15`:{let[e,r]=lp(t,n,2,2);return i.hour=e,[r,i]}case`03`:{let[e,r]=lp(t,n,2,2);return i.hour=e,i.hour12=!0,[r,i]}case`3`:{let[e,r]=lp(t,n,1,2);return i.hour=e,i.hour12=!0,[r,i]}case`04`:{let[e,r]=lp(t,n,2,2);return i.minute=e,[r,i]}case`4`:{let[e,r]=lp(t,n,1,2);return i.minute=e,[r,i]}case`05`:{let[e,r]=lp(t,n,2,2);return i.second=e,[r,i]}case`5`:{let[e,r]=lp(t,n,1,2);return i.second=e,[r,i]}case`PM`:case`pm`:{let e=t.slice(n,n+2).toLowerCase();if(e!==`am`&&e!==`pm`)throw Error(`sprig toDate: expected AM/PM at pos ${n}, got ${JSON.stringify(t.slice(n,n+2))}`);return i.isPM=e===`pm`,i.hour12=!0,[n+2,i]}case`MST`:return[_p(t,n),i];case`-0700`:{let[e,r]=hp(t,n,!1);return i.offsetMinutes=e,[r,i]}case`-07:00`:{let[e,r]=hp(t,n,!0);return i.offsetMinutes=e,[r,i]}case`-07`:{let e=t[n]===`+`?1:t[n]===`-`?-1:0;if(e===0)throw Error(`sprig toDate: expected +/- at pos ${n}`);let[r,a]=lp(t,n+1,2,2);return i.offsetMinutes=e*r*60,[a,i]}case`Z0700`:{let[e,r]=gp(t,n,!1,!1);return i.offsetMinutes=e,[r,i]}case`Z07:00`:{let[e,r]=gp(t,n,!0,!1);return i.offsetMinutes=e,[r,i]}case`Z07`:{let[e,r]=gp(t,n,!1,!0);return i.offsetMinutes=e,[r,i]}case`.000000000`:{if(t[n]!==`.`)throw Error(`sprig toDate: expected . at pos ${n}`);let[e,r]=vp(t,n+1,9);return i.ms=e,[r,i]}case`.999999999`:{if(t[n]!==`.`)return[n,i];let e=n+1,r=e;for(;r<t.length&&t.charCodeAt(r)>=48&&t.charCodeAt(r)<=57;)r++;let a=t.slice(e,r).padEnd(9,`0`);return i.ms=Math.round(parseInt(a,10)/1e6),[r,i]}case`.000000`:{if(t[n]!==`.`)throw Error(`sprig toDate: expected . at pos ${n}`);let[e,r]=vp(t,n+1,6);return i.ms=e,[r,i]}case`.999999`:{if(t[n]!==`.`)return[n,i];let e=n+1,r=e;for(;r<t.length&&t.charCodeAt(r)>=48&&t.charCodeAt(r)<=57;)r++;let a=t.slice(e,r).padEnd(9,`0`);return i.ms=Math.round(parseInt(a,10)/1e6),[r,i]}case`.000`:{if(t[n]!==`.`)throw Error(`sprig toDate: expected . at pos ${n}`);let[e,r]=vp(t,n+1,3);return i.ms=e,[r,i]}case`.999`:{if(t[n]!==`.`)return[n,i];let e=n+1,r=e;for(;r<t.length&&t.charCodeAt(r)>=48&&t.charCodeAt(r)<=57;)r++;let a=t.slice(e,r).padEnd(3,`0`);return i.ms=parseInt(a,10),[r,i]}}throw Error(`sprig toDate: unhandled token ${e}`)}const bp=`.000000000,.999999999,.000000,.999999,.000,.999,January,Monday,Z07:00,-07:00,Z0700,-0700,2006,Jan,Mon,MST,-07,Z07,15,01,02,_2,03,04,05,06,PM,pm,1,2,3,4,5`.split(`,`);function xp(e,t){let n=0,r=0,i=sp();for(;n<e.length;){let a=!1;for(let o of bp)if(e.startsWith(o,n)){let[e,s]=yp(o,t,r,i);r=e,i=s,n+=o.length,a=!0;break}if(!a){let i=e.charAt(n);if(t[r]!==i)throw Error(`sprig toDate: expected ${JSON.stringify(i)} at pos ${r}, got ${JSON.stringify(t[r])}`);n++,r++}}if(r!==t.length)throw Error(`sprig toDate: extra characters at pos ${r}: ${JSON.stringify(t.slice(r))}`);if(i.hour12){let e=i.hour%12;i.hour=i.isPM?e+12:e}let a=Date.UTC(i.year,i.month-1,i.day,i.hour,i.minute,i.second,i.ms)-i.offsetMinutes*60*1e3;return new Date(a)}function Sp(e,t){return xp(e,t)}function Cp(e){return String(Math.floor(xf(e).getTime()/1e3))}function wp(e=()=>new Date){return{now:{fn:()=>ip(e),argTypes:[]},date:{fn:(e,t)=>Gf(e,t),argTypes:[`string`,`value`]},dateInZone:{fn:(e,t,n)=>Kf(e,t,n),argTypes:[`string`,`value`,`string`]},dateModify:{fn:(e,t)=>qf(e,t),argTypes:[`string`,`value`]},htmlDate:{fn:e=>np(e),argTypes:[`value`]},htmlDateInZone:{fn:(e,t)=>rp(e,t),argTypes:[`value`,`string`]},duration:{fn:e=>Jf(e),argTypes:[`value`]},durationRound:{fn:e=>tp(e),argTypes:[`value`]},toDate:{fn:(e,t)=>Sp(e,t),argTypes:[`string`,`string`]},ago:{fn:t=>Sf(t,e),argTypes:[`value`]},unixEpoch:{fn:e=>Cp(e),argTypes:[`value`]}}}function Tp(e){return e==null||e===!1?!0:typeof e==`number`?e===0||Number.isNaN(e):typeof e==`bigint`?e===0n:typeof e==`string`||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:typeof e==`object`?Object.keys(e).length===0:!1}function Ep(...e){for(let t of e)if(!Tp(t))return t}function Dp(e,t){return Tp(t)?e:t}function Op(e){return JSON.parse(e)}function kp(e,t,n){return nd(n)?e:t}function Ap(e){return JSON.stringify(e)??`null`}function jp(e){return JSON.stringify(e,null,2)??`null`}function Mp(){return{default:{fn:(e,t)=>Dp(e,t),argTypes:[`value`,`truthy`]},empty:{fn:e=>Tp(e),argTypes:[`truthy`]},coalesce:{fn:(...e)=>Ep(...e),argTypes:[`truthy`]},ternary:{fn:(e,t,n)=>kp(e,t,n),argTypes:[`value`,`value`,`truthy`]},fromJson:{fn:e=>Op(e),argTypes:[`string`]},toJson:{fn:e=>Ap(e),argTypes:[`serializable`],returnType:`string`},toPrettyJson:{fn:e=>jp(e),argTypes:[`serializable`],returnType:`string`}}}function Np(...e){let t={};for(let n=0;n<e.length;n+=2)t[e[n]]=e[n+1];return t}function Pp(e,t){return e[t]}function Fp(e,t){return t in e}function Ip(e){return Object.keys(e)}function Lp(e,...t){let n={...e};for(let e of t)for(let[t,r]of Object.entries(e))t in n||(n[t]=r);return n}function Rp(e,...t){let n={...e};for(let e of t)Object.assign(n,e);return n}function zp(e,...t){let n=new Set(t),r={};for(let[t,i]of Object.entries(e))n.has(t)||(r[t]=i);return r}function Bp(e,...t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Vp(e,...t){let n=[];for(let r of t)e in r&&n.push(r[e]);return n}function Hp(e,t,n){return e[t]=n,e}function Up(e,t){return delete e[t],e}function Wp(e){return Object.values(e)}function Gp(){return{dict:{fn:(...e)=>Np(...e),argTypes:[`string`,`value`],argTypePattern:`alternating`},get:{fn:(e,t)=>Pp(e,t),argTypes:[`dict`,`string`]},set:{fn:(e,t,n)=>Hp(e,t,n),argTypes:[`dict`,`string`,`value`]},unset:{fn:(e,t)=>Up(e,t),argTypes:[`dict`,`string`]},keys:{fn:e=>Ip(e),argTypes:[`dict`]},values:{fn:e=>Wp(e),argTypes:[`dict`]},pluck:{fn:(e,...t)=>Vp(e,...t),argTypes:[`string`,`dict`]},pick:{fn:(e,...t)=>Bp(e,...t),argTypes:[`dict`,`string`]},omit:{fn:(e,...t)=>zp(e,...t),argTypes:[`dict`,`string`]},hasKey:{fn:(e,t)=>Fp(e,t),argTypes:[`dict`,`string`]},merge:{fn:(e,...t)=>Lp(e,...t),argTypes:[`dict`]},mergeOverwrite:{fn:(e,...t)=>Rp(e,...t),argTypes:[`dict`]}}}new TextEncoder,new Map(Array.from(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`).map((e,t)=>[e,t])),new TextDecoder,new TextEncoder,new TextDecoder,new TextEncoder;function Kp(...e){for(let t of e)if(Tp(t))return!1;return!0}function qp(...e){for(let t of e)if(!Tp(t))return!0;return!1}function Jp(e,t){return[...e,t]}function Yp(e,t){let n=Math.max(1,Math.trunc(Number(e))),r=[];for(let e=0;e<t.length;e+=n)r.push(t.slice(e,e+n));return r}function Xp(e){return e.filter(e=>!Tp(e))}function Zp(...e){let t=[];for(let n of e)t.push(...n);return t}const Qp={line:0,column:0,offset:0};function $p(e,t,n,r){return new gu(e,t,n,r,Qp)}function em(...e){if(e.length<3)throw $p(`dig`,0,`at least 3 arguments (...keys, default, dict)`,`${e.length} argument${e.length===1?``:`s`}`);let t=e[e.length-1],n=e[e.length-2],r=e.slice(0,-2);if(!nm(t))throw $p(`dig`,e.length-1,`dict`,rm(t));for(let e=0;e<r.length;e++)if(typeof r[e]!=`string`)throw $p(`dig`,e,`string`,rm(r[e]));return tm(t,n,r,e.length)}function tm(e,t,n,r){let i=n[0];if(!Object.hasOwn(e,i))return t;let a=e[i];if(n.length===1)return a;if(!nm(a))throw $p(`dig`,r-1,`dict at intermediate key`,rm(a));return tm(a,t,n.slice(1),r)}function nm(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Map)&&!(e instanceof Set)}function rm(e){return e===null?`null`:Array.isArray(e)?`array`:e instanceof Map?`Map`:e instanceof Set?`Set`:typeof e}function im(e){return e[0]}function am(e,t){return t.some(t=>Qu(t,e))}function om(e){return e.slice(0,-1)}function sm(e){return e[e.length-1]}function cm(e){return Array.isArray(e)||typeof e==`string`?e.length:e instanceof Map||e instanceof Set?e.size:Object.keys(e).length}function lm(...e){return e}function um(e,t){return[t,...e]}function dm(e){return e.slice(1)}function fm(e){return[...e].reverse()}function pm(e,t,n){let r=t===void 0?0:Number(t),i=n===void 0?e.length:Number(n);return e.slice(r,i)}function mm(e){let t=[];for(let n of e)n!=null&&t.push(String(n));return t.sort()}function hm(e){let t=[];for(let n of e)t.some(e=>Qu(e,n))||t.push(n);return t}function gm(e,...t){return e.filter(e=>!t.some(t=>Qu(t,e)))}function _m(){return{list:{fn:(...e)=>lm(...e),argTypes:[`value`]},first:{fn:e=>im(e),argTypes:[`list`]},last:{fn:e=>sm(e),argTypes:[`list`]},rest:{fn:e=>dm(e),argTypes:[`list`]},initial:{fn:e=>om(e),argTypes:[`list`]},len:{fn:e=>cm(e),argTypes:[`sized`]},reverse:{fn:e=>fm(e),argTypes:[`list`]},uniq:{fn:e=>hm(e),argTypes:[`list`]},without:{fn:(e,...t)=>gm(e,...t),argTypes:[`list`,`value`]},has:{fn:(e,t)=>am(e,t),argTypes:[`value`,`list`]},compact:{fn:e=>Xp(e),argTypes:[`list`]},slice:{fn:(e,t,n)=>pm(e,t,n),argTypes:[`list`,`number`,`number`]},concat:{fn:(...e)=>Zp(...e),argTypes:[`list`]},chunk:{fn:(e,t)=>Yp(e,t),argTypes:[`number`,`list`]},prepend:{fn:(e,t)=>um(e,t),argTypes:[`list`,`value`]},append:{fn:(e,t)=>Jp(e,t),argTypes:[`list`,`value`]},sortAlpha:{fn:e=>mm(e),argTypes:[`list`],returnType:`list`},push:{fn:(e,t)=>Jp(e,t),argTypes:[`list`,`value`]},tuple:{fn:(...e)=>lm(...e),argTypes:[`value`]},dig:{fn:(...e)=>em(...e),argTypes:[`value`]},all:{fn:(...e)=>Kp(...e),argTypes:[`truthy`],returnType:`bool`},any:{fn:(...e)=>qp(...e),argTypes:[`truthy`],returnType:`bool`}}}function vm(...e){return e.reduce((e,t)=>e+t,0)}function ym(e){return e+1}function bm(e){return e+1}function xm(...e){return e.reduce((e,t)=>e+t,0)}function Sm(e){return Math.ceil(e)}function Cm(e,t){return Math.trunc(e/t)}function wm(e,t){return e/t}function Tm(e){return Math.floor(e)}function Em(...e){return e.reduce((e,t)=>t>e?t:e,-1/0)}function Dm(...e){return e.reduce((e,t)=>Math.max(e,t),-1/0)}function Om(...e){return e.reduce((e,t)=>t<e?t:e,1/0)}function km(...e){return e.reduce((e,t)=>Math.min(e,t),1/0)}function Am(e,t){return e%t}function jm(...e){return e.reduce((e,t)=>e*t,1)}function Mm(...e){return e.reduce((e,t)=>e*t,1)}function Nm(e,t=0){let n=10**t;return Math.sign(e)*Math.round(Math.abs(e)*n)/n}function Pm(e,t,n){let r=[];if(t<e){if(n>=0)return r;for(let i=e;i>t;i+=n)r.push(i);return r}if(n<=0)return r;for(let i=e;i<t;i+=n)r.push(i);return r}function Fm(...e){let t=1;switch(e.length){case 0:return``;case 1:{let n=e[0];return n<1&&(t=-1),Pm(1,n+t,t).join(` `)}case 2:{let t=e[0],n=e[1],r=n<t?-1:1;return Pm(t,n+r,r).join(` `)}case 3:{let n=e[0],r=e[1],i=e[2];return i<n&&(t=-1,r>0)?``:Pm(n,i+t,r).join(` `)}default:return``}}function Im(e,t){return e-t}function Lm(e,t){return e-t}function Rm(e){return Pm(0,e,e<0?-1:1)}function zm(){return{add:{fn:(...e)=>vm(...e),argTypes:[`int`]},sub:{fn:(e,t)=>Im(e,t),argTypes:[`int`,`int`]},mul:{fn:(...e)=>jm(...e),argTypes:[`int`]},div:{fn:(e,t)=>Cm(e,t),argTypes:[`int`,`int`]},mod:{fn:(e,t)=>Am(e,t),argTypes:[`int`,`int`]},min:{fn:(...e)=>Om(...e),argTypes:[`int`]},max:{fn:(...e)=>Em(...e),argTypes:[`int`]},floor:{fn:e=>Tm(e),argTypes:[`float`]},ceil:{fn:e=>Sm(e),argTypes:[`float`]},round:{fn:(e,t)=>Nm(e,t),argTypes:[`float`,`int`]},addf:{fn:(...e)=>xm(...e),argTypes:[`float`]},subf:{fn:(e,t)=>Lm(e,t),argTypes:[`float`,`float`]},mulf:{fn:(...e)=>Mm(...e),argTypes:[`float`]},divf:{fn:(e,t)=>wm(e,t),argTypes:[`float`,`float`]},add1:{fn:e=>ym(e),argTypes:[`int`]},add1f:{fn:e=>bm(e),argTypes:[`float`]},maxf:{fn:(...e)=>Dm(...e),argTypes:[`float`]},minf:{fn:(...e)=>km(...e),argTypes:[`float`]},biggest:{fn:(...e)=>Em(...e),argTypes:[`int`]},seq:{fn:(...e)=>Fm(...e),argTypes:[`int`],returnType:`string`},until:{fn:e=>Rm(e),argTypes:[`int`],returnType:`list`},untilStep:{fn:(e,t,n)=>Pm(e,t,n),argTypes:[`int`,`int`,`int`],returnType:`list`}}}Array.from({length:95},(e,t)=>String.fromCharCode(t+32)).join(``);function Bm(e,t){let n=Number(e);return t.length<=n||n<4?t:`${t.slice(0,n-3)}...`}function Vm(e,t,n){let r=Number(e),i=Number(t);return i<7||n.length<i||r<0||r>n.length-i+1?n:`...${n.slice(r,r+i-6)}...`}const $={Invalid:0,Number:1,UpperCase:2,Alphabet:3,Connector:4,Punct:5,Other:6},Hm=/^[-_\s]$/,Um=/^\p{P}$/u,Wm=/^\p{L}$/u,Gm=/^\p{Lu}$/u,Km=/^\p{N}$/u;function qm(e){return e!==void 0&&Hm.test(e)}function Jm(e){return e!==void 0&&Wm.test(e)}function Ym(e){return e!==void 0&&Gm.test(e)}function Xm(e){return e!==void 0&&Km.test(e)}function Zm(e){return e!==void 0&&Um.test(e)}function Qm(e,t){if(t>=e.length)return{word:{wt:$.Invalid,text:``},next:t};let n=e[t],r=t+1;if(qm(n)){for(;r<e.length&&qm(e[r]);)r++;return{word:{wt:$.Connector,text:e.slice(t,r).join(``)},next:r}}if(Zm(n)){for(;r<e.length&&Zm(e[r]);)r++;return{word:{wt:$.Punct,text:e.slice(t,r).join(``)},next:r}}if(Ym(n)){if(r>=e.length)return{word:{wt:$.UpperCase,text:n},next:r};if(Ym(e[r])){let n=r;for(;n<e.length&&Ym(e[n]);)n++;return n<e.length&&Jm(e[n])?{word:{wt:$.UpperCase,text:e.slice(t,n-1).join(``)},next:n-1}:{word:{wt:$.UpperCase,text:e.slice(t,n).join(``)},next:n}}if(Jm(e[r])){let n=r+1;for(;n<e.length&&Jm(e[n])&&!Ym(e[n]);)n++;return{word:{wt:$.UpperCase,text:e.slice(t,n).join(``)},next:n}}return{word:{wt:$.UpperCase,text:n},next:r}}if(Jm(n)){for(;r<e.length&&Jm(e[r])&&!Ym(e[r]);)r++;return{word:{wt:$.Alphabet,text:e.slice(t,r).join(``)},next:r}}if(Xm(n)){for(;r<e.length&&Xm(e[r]);)r++;return{word:{wt:$.Number,text:e.slice(t,r).join(``)},next:r}}for(;r<e.length&&!qm(e[r])&&!Jm(e[r])&&!Xm(e[r])&&!Zm(e[r]);)r++;return{word:{wt:$.Other,text:e.slice(t,r).join(``)},next:r}}function $m(e,t,n){if(t.wt!==$.UpperCase&&t.wt!==$.Connector){e.push(t.text);return}for(let r of t.text)qm(r)?e.push(n):Ym(r)?e.push(r.toLowerCase()):e.push(r)}function eh(e,t){if(e.length===0)return``;let n=Array.from(e),r=[],{word:i,next:a}=Qm(n,0);for(;a<n.length;){i.wt!==$.Connector&&$m(r,i,t);let e=i,o=i;if({word:i,next:a}=Qm(n,a),e.wt===$.Number){for(;i.wt===$.Alphabet||i.wt===$.Number;)$m(r,i,t),{word:i,next:a}=Qm(n,a);i.wt!==$.Invalid&&i.wt!==$.Punct&&i.wt!==$.Connector&&r.push(t);continue}if(e.wt===$.Connector){$m(r,o,t);continue}if(e.wt===$.Punct)continue;if(i.wt!==$.Number){i.wt!==$.Connector&&i.wt!==$.Punct&&r.push(t);continue}if(a>=n.length)continue;let s=i;if({word:i,next:a}=Qm(n,a),i.wt!==$.Alphabet){$m(r,s,t),i.wt!==$.Connector&&i.wt!==$.Punct&&r.push(t);continue}for(r.push(t),$m(r,s,t);i.wt===$.Alphabet||i.wt===$.Number;)$m(r,i,t),{word:i,next:a}=Qm(n,a);i.wt!==$.Invalid&&i.wt!==$.Connector&&i.wt!==$.Punct&&r.push(t)}return $m(r,i,t),r.join(``).toLowerCase()}function th(e){if(e.length===0)return``;let t=Array.from(e),n=[],r=0,i=``;for(;r<t.length;){if(i=t[r],r++,!qm(i)){i=i.toUpperCase();break}n.push(i)}if(r>=t.length)return t.length>0&&n.push(i),n.join(``);for(;r<t.length;){let e=i;if(i=t[r],r++,qm(i)&&qm(e)){n.push(e);continue}qm(e)?i=i.toUpperCase():(i=i.toLowerCase(),n.push(e))}return n.push(i),n.join(``)}function nh(e){return th(e)}function rh(...e){return e.join(` `)}function ih(e,t){return t.includes(e)}function ah(e,t){return t.startsWith(e)}function oh(e,t){return t.endsWith(e)}function sh(e,t){let n=` `.repeat(Math.max(0,Number(e)));return t.split(`
97
97
  `).map(e=>n+e).join(`
98
- `)}function sh(e){return e.split(/\s+/).filter(e=>e.length>0).map(e=>(e[0]??``).toUpperCase()).join(``)}function ch(e,t){let n=[];for(let e of t){if(typeof e==`object`&&e)throw Qp(`join`,2,`list of strings/primitives`,`list element of type ${lh(e)}`);n.push(String(e))}return n.join(e)}function lh(e){return Array.isArray(e)?`array`:e instanceof Map?`Map`:e instanceof Set?`Set`:`object`}function uh(e){return $m(e,`-`)}function dh(e){return e.toLowerCase()}function fh(e,t){return`\n${oh(e,t)}`}function ph(e){return e.replace(/\s+/g,``)}function mh(e,t,n){return n===1||n===1n?e:t}function hh(...e){return e.map(e=>`"${e}"`).join(` `)}function gh(e){return e.replace(/[\\.+*?()|[\]{}^$]/g,`\\$&`)}function _h(e,t){let n=Math.max(0,Number(e));return t.repeat(n)}function vh(e,t,n){return n.split(e).join(t)}function yh(e){return $m(e,`_`)}function bh(e,t){let n=t.split(e),r={};for(let e=0;e<n.length;e++)r[`_${e}`]=n[e];return r}function xh(e,t){return t.split(e)}function Sh(e,t,n){let r=Ch(n,e,typeof t==`bigint`?Number(t):t),i={};for(let e=0;e<r.length;e++)i[`_${e}`]=r[e]??``;return i}function Ch(e,t,n){if(n===0)return[];let r=t===``?Array.from(e):e.split(t);if(n<0||r.length<=n)return r;let i=r.slice(0,n-1),a=r.slice(n-1).join(t);return[...i,a]}function wh(...e){return e.map(e=>`'${e}'`).join(` `)}function Th(e,t,n){let r=Math.max(0,Number(e)),i=t==null?n.length:Number(t);return i>n.length&&(i=n.length),r>i&&(r=i),n.slice(r,i)}function Eh(e){let t=``;for(let n of e)Dh(n)?t+=n.toLowerCase():Oh(n)?t+=n.toUpperCase():t+=n;return t}function Dh(e){return e!==e.toLowerCase()&&e===e.toUpperCase()}function Oh(e){return e!==e.toUpperCase()&&e===e.toLowerCase()}function kh(e){return e.replace(/\b([a-zA-Z])/g,e=>e.toUpperCase())}function Ah(e){return e.trim()}function jh(e,t){if(e.length===0)return t;let n=new Set([...e]),r=0;for(;r<t.length&&n.has(t[r]);)r+=1;let i=t.length;for(;i>r&&n.has(t[i-1]);)--i;return t.slice(r,i)}function Mh(e,t){return t.startsWith(e)?t.slice(e.length):t}function Nh(e,t){return t.endsWith(e)?t.slice(0,t.length-e.length):t}function Ph(e,t){let n=Number(e);if(Number.isNaN(n))return t;if(n<0){let e=-n;return e>=t.length?t:t.slice(t.length-e)}return n>=t.length?t:t.slice(0,n)}function Fh(e){return e.replace(/\b([A-Z])/g,e=>e.toLowerCase())}function Ih(e){return e.toUpperCase()}function Lh(e,t){return Rh(Number(e),`
99
- `,t)}function Rh(e,t,n){if(!Number.isFinite(e)||e<=0)return n;let r=[];for(let t of n.split(`
100
- `)){let n=``;for(let i of t.split(/\s+/))i.length!==0&&(n.length===0?n=i:n.length+1+i.length<=e?n+=` ${i}`:(r.push(n),n=i));n.length>0&&r.push(n)}return r.join(t)}function zh(e,t,n){return Rh(Number(e),t,n)}function Bh(){return{abbrev:{fn:(e,t)=>zm(e,t),argTypes:[`number`,`string`]},abbrevboth:{fn:(e,t,n)=>Bm(e,t,n),argTypes:[`number`,`number`,`string`]},camelcase:{fn:e=>th(e),argTypes:[`string`],returnType:`string`},cat:{fn:(...e)=>nh(...e),argTypes:[`string`]},contains:{fn:(e,t)=>rh(e,t),argTypes:[`string`,`string`]},hasPrefix:{fn:(e,t)=>ih(e,t),argTypes:[`string`,`string`]},hasSuffix:{fn:(e,t)=>ah(e,t),argTypes:[`string`,`string`]},indent:{fn:(e,t)=>oh(e,t),argTypes:[`number`,`string`]},initials:{fn:e=>sh(e),argTypes:[`string`]},join:{fn:(e,t)=>ch(e,t),argTypes:[`string`,`list`]},kebabcase:{fn:e=>uh(e),argTypes:[`string`],returnType:`string`},lower:{fn:e=>dh(e),argTypes:[`string`]},nindent:{fn:(e,t)=>fh(e,t),argTypes:[`number`,`string`]},nospace:{fn:e=>ph(e),argTypes:[`string`],returnType:`string`},plural:{fn:(e,t,n)=>mh(e,t,n),argTypes:[`string`,`string`,`number`],returnType:`string`},quote:{fn:(...e)=>hh(...e),argTypes:[`string`]},regexQuoteMeta:{fn:e=>gh(e),argTypes:[`string`],returnType:`string`},repeat:{fn:(e,t)=>_h(e,t),argTypes:[`number`,`string`]},replace:{fn:(e,t,n)=>vh(e,t,n),argTypes:[`string`,`string`,`string`]},snakecase:{fn:e=>yh(e),argTypes:[`string`],returnType:`string`},split:{fn:(e,t)=>bh(e,t),argTypes:[`string`,`string`]},splitList:{fn:(e,t)=>xh(e,t),argTypes:[`string`,`string`]},splitn:{fn:(e,t,n)=>Sh(e,t,n),argTypes:[`string`,`number`,`string`],returnType:`dict`},squote:{fn:(...e)=>wh(...e),argTypes:[`string`]},substr:{fn:(e,t,n)=>Th(e,t,n),argTypes:[`number`,`number`,`string`]},swapcase:{fn:e=>Eh(e),argTypes:[`string`],returnType:`string`},title:{fn:e=>kh(e),argTypes:[`string`]},trim:{fn:e=>Ah(e),argTypes:[`string`]},trimAll:{fn:(e,t)=>jh(e,t),argTypes:[`string`,`string`]},trimPrefix:{fn:(e,t)=>Mh(e,t),argTypes:[`string`,`string`]},trimSuffix:{fn:(e,t)=>Nh(e,t),argTypes:[`string`,`string`]},trunc:{fn:(e,t)=>Ph(e,t),argTypes:[`number`,`string`]},untitle:{fn:e=>Fh(e),argTypes:[`string`]},upper:{fn:e=>Ih(e),argTypes:[`string`]},wrap:{fn:(e,t)=>Lh(e,t),argTypes:[`number`,`string`]},wrapWith:{fn:(e,t,n)=>zh(e,t,n),argTypes:[`number`,`string`,`string`]}}}const Vh=/^(?:(?:global|apac|au|eu|us|us-east-\d|us-west-\d|eu-west-\d|eu-central-\d)\.)?(?:anthropic\.|azure_ai\/|bedrock\/|vertex_ai\/)?claude-(?:(?<family>opus|sonnet|haiku)-(?<newMajor>\d+)(?:-(?<newMinor>\d))?|(?<oldMajor>\d+)(?:-(?<oldMinor>\d))?-(?<oldFamily>opus|sonnet|haiku))(?:[-@]\d{8})?(?:-v\d+:\d+)?(?:-latest)?$/i,Hh=/^(?<family>opus|sonnet|haiku)\s+(?<major>\d+)(?:\.(?<minor>\d))?$/i;function Uh(e){if(!e)return`Claude`;let t=e.trim().replace(/\s*\([^)]*\)\s*$/,``).replace(/\s*\[[^\]]*\]\s*$/,``).trim(),n=t.match(Vh);if(n?.groups){let{family:e,newMajor:t,newMinor:r,oldMajor:i,oldMinor:a,oldFamily:o}=n.groups,s=e||o,c=t||i,l=r||a;if(s&&c)return`${s.charAt(0).toUpperCase()+s.slice(1).toLowerCase()} ${l?`${c}.${l}`:c}`}let r=t.match(Hh);if(r?.groups){let e=r.groups.family,t=r.groups.major,n=r.groups.minor;return`${e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()} ${n?`${t}.${n}`:t}`}return t||e}function Wh(e){let t=e.match(Hh);if(!t?.groups)return e;let n=t.groups.family,r=t.groups.major,i=t.groups.minor;return`${n.charAt(0).toUpperCase()}${i?`${r}.${i}`:r}`}function Gh(e){return e.toLocaleString()}const Kh=[`▁`,`▂`,`▃`,`▄`,`▅`,`▆`,`▇`,`█`],qh=Kh.length;function Jh(e,t){let n=t===void 0?e:t<=0?[]:e.slice(-t);if(n.length===0)return``;let r=n[0],i=n[0];for(let e of n)e<r&&(r=e),e>i&&(i=e);let a=i-r,o=``;for(let e of n){let t=a===0?0:Math.round((e-r)/a*(qh-1));o+=Kh[t]}return o}function Yh(e){let t=[];for(let n of e.split(`,`)){let e=n.trim();if(e===``)continue;let r=Number(e);if(!Number.isFinite(r))throw TypeError(`sparkline: non-numeric series element ${JSON.stringify(n)}`);t.push(r)}return t}const Xh=ns(),Zh=[...rs];function Qh(e){if(typeof e==`bigint`){if(e>BigInt(2**53-1)||e<BigInt(-(2**53-1)))throw TypeError(`Numeric argument ${e}n is outside JS safe-integer range (|v| > Number.MAX_SAFE_INTEGER = ${2**53-1}); Number(v) would lose precision or overflow. Pass a value within ±Number.MAX_SAFE_INTEGER.`);return Number(e)}return e}function $h(){return{basename:{fn:e=>s(e),argTypes:[`string`]},dirname:{fn:e=>c(e),argTypes:[`string`]},int:{fn:e=>lu(e),argTypes:[`value`]},string:{fn:e=>cu(e),argTypes:[`value`]},bool:{fn:e=>uu(e),argTypes:[`value`]},urlEncode:{fn:e=>encodeURIComponent(e),argTypes:[`string`]},themes:{fn:()=>Xh,argTypes:[]},styles:{fn:()=>Zh,argTypes:[]},sparkline:{fn:(e,t)=>Jh(Yh(e),t),argTypes:[`string`,`int`]}}}function eg(e=()=>new Date){return{minutesUntilReset:{fn:t=>Math.round(Math.max(0,Qh(t)*1e3-e().getTime())/6e4),argTypes:[`number`]},formatInteger:{fn:e=>Gh(Qh(e)),argTypes:[`number`]},round:{fn:e=>Math.round(Qh(e)),argTypes:[`number`]},formatModelName:{fn:e=>Uh(e),argTypes:[`string`]},shortenModelName:{fn:e=>Wh(e),argTypes:[`string`]}}}function tg(e,t,n=()=>new Date){return Bd({fromString:e=>new Sa(e),toString:e=>e.plain,clock:n,missingKey:`error`,funcs:{...jp(),...Bh(),...gm(),...Rm(),...Cp(n),...pf(),...Wp(),...Zo(),...e===void 0?{}:Xo(e),...$h(),...eg(n),...t??{}}})}function ng(e){return rg(e,new Set(e.names()),``)}function rg(e,t,n){return new Proxy(Object.create(null),{has(e,r){if(typeof r!=`string`)return!1;let i=n?`${n}.${r}`:r;if(t.has(i))return!0;let a=`${i}.`;for(let e of t)if(e.startsWith(a))return!0;return!1},get(r,i){if(typeof i!=`string`)return;let a=n?`${n}.${i}`:i;if(t.has(a))return e.read(a);let o=`${a}.`;for(let n of t)if(n.startsWith(o))return rg(e,t,a)}})}function ig(e,t){return t.kind!==`ttl`||t.durationMs>=500?t:(O(`declareShell "${e}": ttl ${t.durationMs}ms below floor 500ms; clamping`),{kind:`ttl`,durationMs:500})}function ag(e){let t=/^(\d+(?:\.\d+)?)(ms|s|m|h)$/.exec(e);if(!t)throw RangeError(`Invalid duration: "${e}"`);let n=parseFloat(t[1]);switch(t[2]){case`ms`:return n;case`s`:return n*1e3;case`m`:return n*6e4;case`h`:return n*36e5;default:throw RangeError(`Unexpected duration unit: "${t[2]}"`)}}async function og(e){let t=await _e({bin:`/bin/sh`,args:[`-c`,e],category:`user-shell`});return t.ok?{stdout:t.stdout,exitCode:t.exitCode??0}:{stdout:t.stdout,exitCode:t.exitCode??1}}async function sg(e,t,n){let r;try{r=await C(e,`utf8`)}catch{return{error:`file unreadable: ${e}`}}if(n!==void 0){let t=new RegExp(n).exec(r);return t?.[1]?{content:t[1].replace(/\n/g,` `)}:{error:`regex no-match in "${e}"`}}return t===`first-line`?{content:(r.split(`
101
- `)[0]??``).trim()}:{content:r.replace(/\n/g,` `).trim()}}const cg=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],lg=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],ug=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],dg=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function fg(e,t){let n=[[`2006`,e=>String(e.getFullYear())],[`January`,e=>cg[e.getMonth()]],[`Monday`,e=>ug[e.getDay()]],[`Jan`,e=>lg[e.getMonth()]],[`Mon`,e=>dg[e.getDay()]],[`15`,e=>String(e.getHours()).padStart(2,`0`)],[`06`,e=>String(e.getFullYear()%100).padStart(2,`0`)],[`01`,e=>String(e.getMonth()+1).padStart(2,`0`)],[`02`,e=>String(e.getDate()).padStart(2,`0`)],[`04`,e=>String(e.getMinutes()).padStart(2,`0`)],[`05`,e=>String(e.getSeconds()).padStart(2,`0`)],[`PM`,e=>e.getHours()<12?`AM`:`PM`],[`pm`,e=>e.getHours()<12?`am`:`pm`],[`1`,e=>String(e.getMonth()+1)],[`2`,e=>String(e.getDate())],[`3`,e=>String(e.getHours()%12||12)],[`4`,e=>String(e.getMinutes())],[`5`,e=>String(e.getSeconds())]],r=``,i=0;for(;i<e.length;){let a=!1;for(let[o,s]of n)if(e.startsWith(o,i)){r+=s(t),i+=o.length,a=!0;break}a||(r+=e[i],i++)}return r}const pg={branch:`string`,sha:`string`,dirty:`boolean`,ahead:`number`,behind:`number`,stash:`number`};function mg(e,t,n,r){if(e===null){if(n!==void 0)return n;let e=pg[t];try{return vg(r,e)}catch{return yg(e)}}switch(t){case`branch`:return e.branch===`detached`?``:e.branch;case`sha`:return Vt(e.sha,``);case`dirty`:return e.status!==`clean`;case`ahead`:return Vt(e.aheadBehind,{ahead:0,behind:0}).ahead;case`behind`:return Vt(e.aheadBehind,{ahead:0,behind:0}).behind;case`stash`:return Vt(e.stashCount,0)}}var hg=class{watchers=new Map;subscribe(e,t){let n=this.watchers.get(e);if(!n){let t=new Set,r;try{r=a(e,()=>{for(let e of t)e()})}catch{return()=>{}}n={watcher:r,callbacks:t},this.watchers.set(e,n)}return n.callbacks.add(t),()=>this.unsubscribe(e,t)}unsubscribe(e,t){let n=this.watchers.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(n.watcher.close(),this.watchers.delete(e)))}dispose(){for(let{watcher:e}of this.watchers.values())e.close();this.watchers.clear()}size(){return this.watchers.size}},gg=class{buckets=new Map;subscribe(e,t){let n=this.buckets.get(e);if(!n){let t=new Set;n={timer:re(()=>{for(let e of t)e()},e),callbacks:t},this.buckets.set(e,n)}return n.callbacks.add(t),()=>this.unsubscribe(e,t)}unsubscribe(e,t){let n=this.buckets.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(ne(n.timer),this.buckets.delete(e)))}dispose(){for(let{timer:e}of this.buckets.values())ne(e);this.buckets.clear()}bucketCount(){return this.buckets.size}};function _g(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=n[e]}return n}function vg(e,t){if(typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`)throw TypeError(`Expected string|number|boolean from payload, got ${typeof e}`);return t===`string`?cu(e):t===`number`?lu(e):uu(e)}function yg(e){return e===`number`?0:e===`boolean`?!1:``}var bg=class{inputMetas=new Map;lastErrors=new Map;watchMgr=new hg;ttlMgr=new gg;gitSubscriptions=new Map;cleanups=[];inFlight=new Set;engine=tg();gitProvider;ownsGitProvider;sessionState;constructor(e,t=``,n,r){this.store=e,this.defaultEmptyValue=t,n?(this.gitProvider=n,this.ownsGitProvider=!1):(this.gitProvider=new on({sanityIntervalMs:0}),this.ownsGitProvider=!0),this.sessionState=r}get variableStore(){return this.store}declareLiteral(e,t){this.store.defineBox(e,su(t),t)}declareInput(e,t,n,r){let i=r===void 0?this.defaultFor(n):r;this.store.defineBox(e,n,i),this.inputMetas.set(e,{path:t,varDefault:r})}declareEnv(e,t,n){let r=process.env[t];if(r!==void 0){this.store.defineBox(e,`string`,r);return}let i=n===void 0?typeof this.defaultEmptyValue==`string`?this.defaultEmptyValue:``:n;this.store.defineBox(e,`string`,i),this.recordError(e,`env var "${t}" is not set`)}declareShell(e,t,n){let r=ig(e,n.cache);this.store.defineBox(e,`string`,this.stringInitial(n.varDefault));let i=()=>void this.updateFromShell(e,t,n.regex,n.varDefault);i(),this.registerCachePolicy(e,r,i)}declareFile(e,t,n){this.store.defineBox(e,`string`,this.stringInitial(n.varDefault));let r=()=>void this.updateFromFile(e,t,n.readMode,n.regex,n.varDefault);r(),this.registerCachePolicy(e,n.cache,r)}declareTemplate(e,t,n={}){let r=this.engine.parse(t);this.store.defineComputed(e,`string`,t=>{let i=ng(this.store);try{let t=r.evaluate(i).map(e=>e.plain).join(``);return this.lastErrors.delete(e),t}catch(t){return this.recordError(e,t instanceof Error?t.message:String(t)),this.stringInitial(n.varDefault)}}),this.store.read(e)}declareTime(e,t){let n=t.ttlMs??1e3;this.store.defineBox(e,`string`,(e=>{try{return fg(t.format,e)}catch{return this.stringInitial(t.varDefault)}})(new Date));let r=this.ttlMgr.subscribe(n,()=>{try{this.store.setBox(e,fg(t.format,new Date)),this.lastErrors.delete(e)}catch(n){this.applyFallback(e,`string`,t.varDefault,n instanceof Error?n.message:String(n))}});this.cleanups.push(r)}declareGit(e,t){let n=pg[t.field],r=t.varDefault===void 0?yg(n):vg(t.varDefault,n);this.store.defineBox(e,n,r);let i=this.gitSubscriptions.get(t.cwd);if(!i){let e=new Map;i={fieldSubs:e,unsubscribe:this.gitProvider.subscribe(t.cwd,t=>{this.store.runInAction(()=>{for(let[n,r]of e)for(let{name:e,varDefault:i}of r)this.store.setBox(e,mg(t,n,i,this.defaultEmptyValue))})})},this.gitSubscriptions.set(t.cwd,i)}let a=i.fieldSubs.get(t.field);a||(a=[],i.fieldSubs.set(t.field,a)),a.push({name:e,varDefault:t.varDefault})}declareState(e,t){if(!this.sessionState)throw Error(`declareState("${e}"): SourceRegistry was constructed without a SessionState — state-kind variables require a SessionState (the daemon provides one; tests must supply one)`);let n=this.sessionState,r=t.varDefault??this.stringInitial(void 0);this.store.defineComputed(e,`string`,e=>{let i=e(`session.id`);if(typeof i!=`string`||!i)return r;let a=n.get(i,t.key);return a===null?r:a})}applyInput(e){this.store.runInAction(()=>{for(let[t,n]of this.inputMetas){let r=_g(e,n.path),i=this.store.getType(t);if(r!==void 0)try{this.store.setBox(t,vg(r,i)),this.lastErrors.delete(t)}catch(e){this.applyFallback(t,i,n.varDefault,e instanceof Error?e.message:String(e))}else this.applyFallback(t,i,n.varDefault,`input path "${n.path}" not found in payload`)}})}getLastError(e){return this.lastErrors.get(e)}dispose(){for(let e of this.cleanups)e();this.cleanups.length=0;for(let e of this.gitSubscriptions.values())e.unsubscribe();this.gitSubscriptions.clear(),this.watchMgr.dispose(),this.ttlMgr.dispose(),this.ownsGitProvider&&this.gitProvider.close()}registerCachePolicy(e,t,n){switch(t.kind){case`never`:break;case`ttl`:{let e=this.ttlMgr.subscribe(t.durationMs,n);this.cleanups.push(e);break}case`watch_file`:{let e=this.watchMgr.subscribe(t.path,n);this.cleanups.push(e);break}case`key`:{let e=this.engine.parse(t.template),r=(0,X.reaction)(()=>{let t=ng(this.store);try{return e.evaluate(t).map(e=>e.plain).join(``)}catch{return``}},n);this.cleanups.push(r);break}case`depends_on`:{let e=(0,X.reaction)(()=>t.varNames.map(e=>String(this.store.read(e))).join(`,`),n);this.cleanups.push(e);break}}}async updateFromShell(e,t,n,r){if(!this.inFlight.has(e)){this.inFlight.add(e);try{let{stdout:i,exitCode:a}=await og(t);if(a!==0){this.applyFallback(e,`string`,r,`shell "${t}" exited with code ${a}`);return}if(n!==void 0){let a=new RegExp(n).exec(i);if(!a?.[1]){this.applyFallback(e,`string`,r,`regex no-match in output of "${t}"`);return}this.store.setBox(e,a[1].replace(/\n/g,` `))}else this.store.setBox(e,i.replace(/\n/g,` `).trim());this.lastErrors.delete(e)}finally{this.inFlight.delete(e)}}}async updateFromFile(e,t,n,r,i){if(!this.inFlight.has(e)){this.inFlight.add(e);try{let a=await sg(t,n,r);if(a.error!==void 0){this.applyFallback(e,`string`,i,a.error);return}this.store.setBox(e,a.content??``),this.lastErrors.delete(e)}finally{this.inFlight.delete(e)}}}applyFallback(e,t,n,r){if(this.recordError(e,r),n!==void 0){this.store.setBox(e,n);return}try{this.store.setBox(e,vg(this.defaultEmptyValue,t))}catch{this.store.setBox(e,yg(t))}}defaultFor(e){try{return vg(this.defaultEmptyValue,e)}catch{return yg(e)}}stringInitial(e){return e===void 0?typeof this.defaultEmptyValue==`string`?this.defaultEmptyValue:``:e}recordError(e,t){this.lastErrors.set(e,{timestamp:Date.now(),message:t})}};function xg(e,t){switch(e){case`capsule`:return new ka;case`plain`:return new Aa(t===void 0?{}:{separator:t});case`powerline`:return new Oa;default:return e}}function Sg(e,t){if(e.length===0)return``;let n=xg(t.style,t.separator);if(Number.isFinite(t.width)){let r=Na(new Ga([...e],{joiner:n}),{width:t.width,colorSystem:t.colorCompatibility});return r.endsWith(`
102
- `)?r.slice(0,-1):r}return Na(new Ca([...e],n),{colorSystem:t.colorCompatibility})}const Cg=new Map,wg=new Map;function Tg(e){let t=$o(e),n=Cg.get(t);if(n!==void 0)return n;let r=Hi(t);if(r===null)throw Error(`Palette "${e}" (resolved "${t}") did not resolve in the theme registry — allowed names and the registry are inconsistent`);let i=new Fi(r);return Cg.set(t,i),i}function Eg(e,t){let n=`${e.palette.name} ${t}`,r=wg.get(n);if(r!==void 0)return r;let i={hueShift:t,chromaScale:1,lightnessScale:1,lightnessShift:0},a=new Fi(Qi(e.palette,i));return wg.set(n,a),a}function Dg(e,t){let n=[],r=[],i=()=>{if(!r.length)return;let e=Og(r,t);e.plain.length>0&&n.push(e),r=[]};for(let a of e)if(a.style.link){i();let e=Og([a],t);e.plain.length>0&&n.push(e)}else r.push(a);return i(),n}function Og(e,t){let n=t!==void 0&&!t.isNull?e.map(e=>kg(e,t)):e,r=Sa.fromFragments(n);return r.end=``,r.noWrap=!0,n.length===1?r.style=n[0].style:t!==void 0&&!t.isNull&&(r.style=t),r}function kg(e,t){let n=e.copy();return n.style=t.add(e.style),n}function Ag(e,t){return e===void 0?!0:e.evaluate(t).map(e=>e.plain).join(``)!==`false`}function jg(e,t){let n=Sa.fromFragments(e);return n.end=``,n.noWrap=!0,t!==void 0&&!t.isNull&&(n.style=t),n}function Mg(e,t){let{width:n,justify:r,truncate:i,truncateMarker:a=`…`,baseStyle:o}=t;if(e.length===0)return[];let s=jg(e,o);return n===`auto`||(s.cellLength>n?s.truncate(n,{mode:i,marker:a}):s.cellLength<n&&s.align(r,n)),[s]}var Ng=class extends Error{constructor(e,t){super(`Invalid ${t} color spec: ${JSON.stringify(e)}`),this.name=`ColorSpecError`}};function Pg(e,t,n,r){let i=Fg(t,r),a=i===void 0?void 0:Ig(e,i,void 0,`bg`),o=Fg(n,r),s=o===void 0?void 0:Ig(e,o,a,`fg`);return new J({bgcolor:a===void 0?void 0:W.fromRgba(a),color:s===void 0?void 0:W.fromRgba(s)})}function Fg(e,t){if(e!==void 0)return e.evaluate(t).map(e=>e.plain).join(``)}function Ig(e,t,n,r){let i=e.resolve(t.trim(),n===void 0?void 0:{against:n});if(i===null)throw new Ng(t,r);return i}function Lg(e){return e===`themes`?ns():rs}function Rg(e,t,n){let r=new Map;for(let[i,a]of Object.entries(t))r.set(i,zg(e,i,a,n));return r}function zg(e,t,n,r){if(`set`in n){let e=r.get(n.set)??n.set;return`to`in n?{kind:`set-literal`,key:n.set,value:n.to,stateVar:e}:`from`in n?{kind:`set-option`,key:n.set,stateVar:e,options:[...Lg(n.from)]}:`int`in n?{kind:`set-int`,key:n.set,stateVar:e}:`cycle`in n?{kind:`set-cycle`,key:n.set,stateVar:e,members:n.cycle}:{kind:`set-bounded`,key:n.set,by:n.by}}return`copy`in n?{kind:`copy`,text:Bg(e,n.copy,t)}:{kind:`open`,target:Bg(e,n.open,t)}}function Bg(e,t,n){try{return e(t)}catch(e){throw Error(`Template parse error in actions.${n}: ${e.message}`,{cause:e})}}function Vg(e,t){return e.has(t)?cu(e.read(t)):``}function Hg(e,t){return e.evaluate(t).map(e=>e.plain).join(``)}function Ug(e,t,n){let r=new Sa(e,{style:new J({link:t,bold:n})});return r.noWrap=!0,r.end=``,r}function Wg(e,t){return Math.max(e.members.indexOf(Vg(t,e.stateVar)),0)}function Gg(e,t,n,r,i){switch(e.kind){case`set-literal`:{let t=Vg(r,e.stateVar);return{effect:{verb:at,args:[i,e.key,e.value]},active:t===e.value}}case`set-option`:{let a=n??t,o=Vg(r,e.stateVar);return{effect:{verb:at,args:[i,e.key,a]},active:o===a}}case`set-int`:{let a=n??t,o=Vg(r,e.stateVar);return{effect:{verb:at,args:[i,e.key,a]},active:o===a}}case`set-cycle`:{let t=e.members[(Wg(e,r)+1)%e.members.length];return{effect:{verb:at,args:[i,e.key,t]},active:!1}}case`set-bounded`:return{effect:{verb:ot,args:[i,e.key,String(e.by)]},active:!1};case`copy`:return{effect:{verb:st,args:[Hg(e.text,ng(r))]},active:!1};case`open`:return{effect:{verb:ct,args:[Hg(e.target,ng(r))]},active:!1}}}function Kg(e,t,n,r){if(n.length===0)throw Error(`action "${e}" needs a display (the clickable text)`);if(t.kind===`set-cycle`){if(n.length!==1&&n.length!==t.members.length)throw Error(`action "${e}" cycles ${t.members.length} members; bind one display per member (${t.members.length}) or one static display, got ${n.length}`);return{display:n.length===1?n[0]:n[Wg(t,r)],boundValue:void 0}}if(n.length>2)throw Error(`action "${e}" takes a display and an optional bound value, got ${n.length} arguments (per-state displays are a cycle action's form)`);return{display:n[0],boundValue:n[1]}}function qg(e,t,n){let r=n.compiled.get(e);if(!r)throw Error(`action "${e}" is not declared in this config`);let i=n.store,{display:a,boundValue:o}=Kg(e,r,t,i),{effect:s,active:c}=Gg(r,a,o,i,Vg(i,`session.id`));return Ug(a,pt([s]),c)}function Jg(e){return{action:{fn:(t,...n)=>qg(t,n,e),argTypes:[`string`,`string`],returnType:`T`}}}function Yg(e){return new Sa(e).cellLength}function Xg(e,t,n){if(!Number.isFinite(t))return e.length>0?[e.map((e,t)=>t)]:[];let r=Math.max(1,t-n),i=[],a=[],o=0;for(let t=0;t<e.length;t++){let n=e[t];a.length===0?(a=[t],o=n):o+1+n<=r?(a.push(t),o+=1+n):(i.push(a),a=[t],o=n)}return a.length>0&&i.push(a),i}function Zg(e,t){let n=[];for(let t of e)n.length>0&&n.push(new Sa(` `)),n.push(t);let r=Sa.fromFragments(n);return r.noWrap=t,r.end=``,r}function Qg(e,t,n,r){let i=e.compiled.get(t);if(!i||i.kind!==n)throw Error(`picker references action "${t}" which must be ${r}, got ${i?`a ${i.kind} action`:`no such action`}`);return i}function $g(e,t,n,r,i){let a=Qg(i,e,`set-option`,`a set-option action ({ set, from })`),o=Qg(i,t,`set-int`,`an int action ({ set, int: true })`),s=i.store,c=Vg(s,`session.id`),l=Vg(s,a.stateVar),u=a.options.map(Yg),d=r?lu(s.read(`term.cols`)):1/0,f=Yg(`✕`)+1,p=Yg(`←`)+1+Yg(`→`)+1,m=Xg(u,d,f),h=m.length>1?Xg(u,d,f+p):m,g=parseInt(Vg(s,o.stateVar),10),_=Number.isInteger(g)?Math.max(0,Math.min(g,h.length-1)):0,v=h[_]??[],y=e=>pt([{verb:at,args:[c,o.key,String(e)]}]),b=e=>pt([{verb:at,args:[c,a.key,e,...n?[o.key,`-1`]:[]]}]),x=[Ug(`✕`,y(-1),!1)];_>0&&x.push(Ug(`←`,y(_-1),!1));for(let e of v){let t=a.options[e];x.push(Ug(t,b(t),t===l))}return _<h.length-1&&x.push(Ug(`→`,y(_+1),!1)),Zg(x,r)}function e_(e){return{picker:{fn:(t,n,r,i)=>$g(t,n,r,i,e),argTypes:[`string`,`string`,`bool`,`bool`],returnType:`T`}}}function t_(e){let t=[],n=[];for(let r of e){if(!r.contains(`
98
+ `)}function ch(e){return e.split(/\s+/).filter(e=>e.length>0).map(e=>(e[0]??``).toUpperCase()).join(``)}function lh(e,t){let n=[];for(let e of t){if(typeof e==`object`&&e)throw $p(`join`,2,`list of strings/primitives`,`list element of type ${uh(e)}`);n.push(String(e))}return n.join(e)}function uh(e){return Array.isArray(e)?`array`:e instanceof Map?`Map`:e instanceof Set?`Set`:`object`}function dh(e){return eh(e,`-`)}function fh(e){return e.toLowerCase()}function ph(e,t){return`\n${sh(e,t)}`}function mh(e){return e.replace(/\s+/g,``)}function hh(e,t,n){return n===1||n===1n?e:t}function gh(...e){return e.map(e=>`"${e}"`).join(` `)}function _h(e){return e.replace(/[\\.+*?()|[\]{}^$]/g,`\\$&`)}function vh(e,t){let n=Math.max(0,Number(e));return t.repeat(n)}function yh(e,t,n){return n.split(e).join(t)}function bh(e){return eh(e,`_`)}function xh(e,t){let n=t.split(e),r={};for(let e=0;e<n.length;e++)r[`_${e}`]=n[e];return r}function Sh(e,t){return t.split(e)}function Ch(e,t,n){let r=wh(n,e,typeof t==`bigint`?Number(t):t),i={};for(let e=0;e<r.length;e++)i[`_${e}`]=r[e]??``;return i}function wh(e,t,n){if(n===0)return[];let r=t===``?Array.from(e):e.split(t);if(n<0||r.length<=n)return r;let i=r.slice(0,n-1),a=r.slice(n-1).join(t);return[...i,a]}function Th(...e){return e.map(e=>`'${e}'`).join(` `)}function Eh(e,t,n){let r=Math.max(0,Number(e)),i=t==null?n.length:Number(t);return i>n.length&&(i=n.length),r>i&&(r=i),n.slice(r,i)}function Dh(e){let t=``;for(let n of e)Oh(n)?t+=n.toLowerCase():kh(n)?t+=n.toUpperCase():t+=n;return t}function Oh(e){return e!==e.toLowerCase()&&e===e.toUpperCase()}function kh(e){return e!==e.toUpperCase()&&e===e.toLowerCase()}function Ah(e){return e.replace(/\b([a-zA-Z])/g,e=>e.toUpperCase())}function jh(e){return e.trim()}function Mh(e,t){if(e.length===0)return t;let n=new Set([...e]),r=0;for(;r<t.length&&n.has(t[r]);)r+=1;let i=t.length;for(;i>r&&n.has(t[i-1]);)--i;return t.slice(r,i)}function Nh(e,t){return t.startsWith(e)?t.slice(e.length):t}function Ph(e,t){return t.endsWith(e)?t.slice(0,t.length-e.length):t}function Fh(e,t){let n=Number(e);if(Number.isNaN(n))return t;if(n<0){let e=-n;return e>=t.length?t:t.slice(t.length-e)}return n>=t.length?t:t.slice(0,n)}function Ih(e){return e.replace(/\b([A-Z])/g,e=>e.toLowerCase())}function Lh(e){return e.toUpperCase()}function Rh(e,t){return zh(Number(e),`
99
+ `,t)}function zh(e,t,n){if(!Number.isFinite(e)||e<=0)return n;let r=[];for(let t of n.split(`
100
+ `)){let n=``;for(let i of t.split(/\s+/))i.length!==0&&(n.length===0?n=i:n.length+1+i.length<=e?n+=` ${i}`:(r.push(n),n=i));n.length>0&&r.push(n)}return r.join(t)}function Bh(e,t,n){return zh(Number(e),t,n)}function Vh(){return{abbrev:{fn:(e,t)=>Bm(e,t),argTypes:[`number`,`string`]},abbrevboth:{fn:(e,t,n)=>Vm(e,t,n),argTypes:[`number`,`number`,`string`]},camelcase:{fn:e=>nh(e),argTypes:[`string`],returnType:`string`},cat:{fn:(...e)=>rh(...e),argTypes:[`string`]},contains:{fn:(e,t)=>ih(e,t),argTypes:[`string`,`string`]},hasPrefix:{fn:(e,t)=>ah(e,t),argTypes:[`string`,`string`]},hasSuffix:{fn:(e,t)=>oh(e,t),argTypes:[`string`,`string`]},indent:{fn:(e,t)=>sh(e,t),argTypes:[`number`,`string`]},initials:{fn:e=>ch(e),argTypes:[`string`]},join:{fn:(e,t)=>lh(e,t),argTypes:[`string`,`list`]},kebabcase:{fn:e=>dh(e),argTypes:[`string`],returnType:`string`},lower:{fn:e=>fh(e),argTypes:[`string`]},nindent:{fn:(e,t)=>ph(e,t),argTypes:[`number`,`string`]},nospace:{fn:e=>mh(e),argTypes:[`string`],returnType:`string`},plural:{fn:(e,t,n)=>hh(e,t,n),argTypes:[`string`,`string`,`number`],returnType:`string`},quote:{fn:(...e)=>gh(...e),argTypes:[`string`]},regexQuoteMeta:{fn:e=>_h(e),argTypes:[`string`],returnType:`string`},repeat:{fn:(e,t)=>vh(e,t),argTypes:[`number`,`string`]},replace:{fn:(e,t,n)=>yh(e,t,n),argTypes:[`string`,`string`,`string`]},snakecase:{fn:e=>bh(e),argTypes:[`string`],returnType:`string`},split:{fn:(e,t)=>xh(e,t),argTypes:[`string`,`string`]},splitList:{fn:(e,t)=>Sh(e,t),argTypes:[`string`,`string`]},splitn:{fn:(e,t,n)=>Ch(e,t,n),argTypes:[`string`,`number`,`string`],returnType:`dict`},squote:{fn:(...e)=>Th(...e),argTypes:[`string`]},substr:{fn:(e,t,n)=>Eh(e,t,n),argTypes:[`number`,`number`,`string`]},swapcase:{fn:e=>Dh(e),argTypes:[`string`],returnType:`string`},title:{fn:e=>Ah(e),argTypes:[`string`]},trim:{fn:e=>jh(e),argTypes:[`string`]},trimAll:{fn:(e,t)=>Mh(e,t),argTypes:[`string`,`string`]},trimPrefix:{fn:(e,t)=>Nh(e,t),argTypes:[`string`,`string`]},trimSuffix:{fn:(e,t)=>Ph(e,t),argTypes:[`string`,`string`]},trunc:{fn:(e,t)=>Fh(e,t),argTypes:[`number`,`string`]},untitle:{fn:e=>Ih(e),argTypes:[`string`]},upper:{fn:e=>Lh(e),argTypes:[`string`]},wrap:{fn:(e,t)=>Rh(e,t),argTypes:[`number`,`string`]},wrapWith:{fn:(e,t,n)=>Bh(e,t,n),argTypes:[`number`,`string`,`string`]}}}const Hh=/^(?:(?:global|apac|au|eu|us|us-east-\d|us-west-\d|eu-west-\d|eu-central-\d)\.)?(?:anthropic\.|azure_ai\/|bedrock\/|vertex_ai\/)?claude-(?:(?<family>opus|sonnet|haiku)-(?<newMajor>\d+)(?:-(?<newMinor>\d))?|(?<oldMajor>\d+)(?:-(?<oldMinor>\d))?-(?<oldFamily>opus|sonnet|haiku))(?:[-@]\d{8})?(?:-v\d+:\d+)?(?:-latest)?$/i,Uh=/^(?<family>opus|sonnet|haiku)\s+(?<major>\d+)(?:\.(?<minor>\d))?$/i;function Wh(e){if(!e)return`Claude`;let t=e.trim().replace(/\s*\([^)]*\)\s*$/,``).replace(/\s*\[[^\]]*\]\s*$/,``).trim(),n=t.match(Hh);if(n?.groups){let{family:e,newMajor:t,newMinor:r,oldMajor:i,oldMinor:a,oldFamily:o}=n.groups,s=e||o,c=t||i,l=r||a;if(s&&c)return`${s.charAt(0).toUpperCase()+s.slice(1).toLowerCase()} ${l?`${c}.${l}`:c}`}let r=t.match(Uh);if(r?.groups){let e=r.groups.family,t=r.groups.major,n=r.groups.minor;return`${e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()} ${n?`${t}.${n}`:t}`}return t||e}function Gh(e){let t=e.match(Uh);if(!t?.groups)return e;let n=t.groups.family,r=t.groups.major,i=t.groups.minor;return`${n.charAt(0).toUpperCase()}${i?`${r}.${i}`:r}`}function Kh(e){return e.toLocaleString()}const qh=[`▁`,`▂`,`▃`,`▄`,`▅`,`▆`,`▇`,`█`],Jh=qh.length;function Yh(e,t){let n=t===void 0?e:t<=0?[]:e.slice(-t);if(n.length===0)return``;let r=n[0],i=n[0];for(let e of n)e<r&&(r=e),e>i&&(i=e);let a=i-r,o=``;for(let e of n){let t=a===0?0:Math.round((e-r)/a*(Jh-1));o+=qh[t]}return o}function Xh(e){let t=[];for(let n of e.split(`,`)){let e=n.trim();if(e===``)continue;let r=Number(e);if(!Number.isFinite(r))throw TypeError(`sparkline: non-numeric series element ${JSON.stringify(n)}`);t.push(r)}return t}const Zh=ns(),Qh=[...rs];function $h(e){if(typeof e==`bigint`){if(e>BigInt(2**53-1)||e<BigInt(-(2**53-1)))throw TypeError(`Numeric argument ${e}n is outside JS safe-integer range (|v| > Number.MAX_SAFE_INTEGER = ${2**53-1}); Number(v) would lose precision or overflow. Pass a value within ±Number.MAX_SAFE_INTEGER.`);return Number(e)}return e}function eg(){return{basename:{fn:e=>s(e),argTypes:[`string`]},dirname:{fn:e=>c(e),argTypes:[`string`]},int:{fn:e=>uu(e),argTypes:[`value`]},string:{fn:e=>lu(e),argTypes:[`value`]},bool:{fn:e=>du(e),argTypes:[`value`]},urlEncode:{fn:e=>encodeURIComponent(e),argTypes:[`string`]},themes:{fn:()=>Zh,argTypes:[]},styles:{fn:()=>Qh,argTypes:[]},sparkline:{fn:(e,t)=>Yh(Xh(e),t),argTypes:[`string`,`int`]}}}function tg(e=()=>new Date){return{minutesUntilReset:{fn:t=>Math.round(Math.max(0,$h(t)*1e3-e().getTime())/6e4),argTypes:[`number`]},formatInteger:{fn:e=>Kh($h(e)),argTypes:[`number`]},round:{fn:e=>Math.round($h(e)),argTypes:[`number`]},formatModelName:{fn:e=>Wh(e),argTypes:[`string`]},shortenModelName:{fn:e=>Gh(e),argTypes:[`string`]}}}function ng(e,t,n=()=>new Date){return Vd({fromString:e=>new Sa(e),toString:e=>e.plain,clock:n,missingKey:`error`,funcs:{...Mp(),...Vh(),..._m(),...zm(),...wp(n),...mf(),...Gp(),...Zo(),...e===void 0?{}:Xo(e),...eg(),...tg(n),...t??{}}})}function rg(e){return ig(e,new Set(e.names()),``)}function ig(e,t,n){return new Proxy(Object.create(null),{has(e,r){if(typeof r!=`string`)return!1;let i=n?`${n}.${r}`:r;if(t.has(i))return!0;let a=`${i}.`;for(let e of t)if(e.startsWith(a))return!0;return!1},get(r,i){if(typeof i!=`string`)return;let a=n?`${n}.${i}`:i;if(t.has(a))return e.read(a);let o=`${a}.`;for(let n of t)if(n.startsWith(o))return ig(e,t,a)}})}function ag(e,t){return t.kind!==`ttl`||t.durationMs>=500?t:(O(`declareShell "${e}": ttl ${t.durationMs}ms below floor 500ms; clamping`),{kind:`ttl`,durationMs:500})}function og(e){let t=/^(\d+(?:\.\d+)?)(ms|s|m|h)$/.exec(e);if(!t)throw RangeError(`Invalid duration: "${e}"`);let n=parseFloat(t[1]);switch(t[2]){case`ms`:return n;case`s`:return n*1e3;case`m`:return n*6e4;case`h`:return n*36e5;default:throw RangeError(`Unexpected duration unit: "${t[2]}"`)}}async function sg(e){let t=await _e({bin:`/bin/sh`,args:[`-c`,e],category:`user-shell`});return t.ok?{stdout:t.stdout,exitCode:t.exitCode??0}:{stdout:t.stdout,exitCode:t.exitCode??1}}async function cg(e,t,n){let r;try{r=await C(e,`utf8`)}catch{return{error:`file unreadable: ${e}`}}if(n!==void 0){let t=new RegExp(n).exec(r);return t?.[1]?{content:t[1].replace(/\n/g,` `)}:{error:`regex no-match in "${e}"`}}return t===`first-line`?{content:(r.split(`
101
+ `)[0]??``).trim()}:{content:r.replace(/\n/g,` `).trim()}}const lg=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],ug=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],dg=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],fg=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function pg(e,t){let n=[[`2006`,e=>String(e.getFullYear())],[`January`,e=>lg[e.getMonth()]],[`Monday`,e=>dg[e.getDay()]],[`Jan`,e=>ug[e.getMonth()]],[`Mon`,e=>fg[e.getDay()]],[`15`,e=>String(e.getHours()).padStart(2,`0`)],[`06`,e=>String(e.getFullYear()%100).padStart(2,`0`)],[`01`,e=>String(e.getMonth()+1).padStart(2,`0`)],[`02`,e=>String(e.getDate()).padStart(2,`0`)],[`04`,e=>String(e.getMinutes()).padStart(2,`0`)],[`05`,e=>String(e.getSeconds()).padStart(2,`0`)],[`PM`,e=>e.getHours()<12?`AM`:`PM`],[`pm`,e=>e.getHours()<12?`am`:`pm`],[`1`,e=>String(e.getMonth()+1)],[`2`,e=>String(e.getDate())],[`3`,e=>String(e.getHours()%12||12)],[`4`,e=>String(e.getMinutes())],[`5`,e=>String(e.getSeconds())]],r=``,i=0;for(;i<e.length;){let a=!1;for(let[o,s]of n)if(e.startsWith(o,i)){r+=s(t),i+=o.length,a=!0;break}a||(r+=e[i],i++)}return r}const mg={branch:`string`,sha:`string`,dirty:`boolean`,ahead:`number`,behind:`number`,stash:`number`};function hg(e,t,n,r){if(e===null){if(n!==void 0)return n;let e=mg[t];try{return yg(r,e)}catch{return bg(e)}}switch(t){case`branch`:return e.branch===`detached`?``:e.branch;case`sha`:return Vt(e.sha,``);case`dirty`:return e.status!==`clean`;case`ahead`:return Vt(e.aheadBehind,{ahead:0,behind:0}).ahead;case`behind`:return Vt(e.aheadBehind,{ahead:0,behind:0}).behind;case`stash`:return Vt(e.stashCount,0)}}var gg=class{watchers=new Map;subscribe(e,t){let n=this.watchers.get(e);if(!n){let t=new Set,r;try{r=a(e,()=>{for(let e of t)e()})}catch{return()=>{}}n={watcher:r,callbacks:t},this.watchers.set(e,n)}return n.callbacks.add(t),()=>this.unsubscribe(e,t)}unsubscribe(e,t){let n=this.watchers.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(n.watcher.close(),this.watchers.delete(e)))}dispose(){for(let{watcher:e}of this.watchers.values())e.close();this.watchers.clear()}size(){return this.watchers.size}},_g=class{buckets=new Map;subscribe(e,t){let n=this.buckets.get(e);if(!n){let t=new Set;n={timer:re(()=>{for(let e of t)e()},e),callbacks:t},this.buckets.set(e,n)}return n.callbacks.add(t),()=>this.unsubscribe(e,t)}unsubscribe(e,t){let n=this.buckets.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(ne(n.timer),this.buckets.delete(e)))}dispose(){for(let{timer:e}of this.buckets.values())ne(e);this.buckets.clear()}bucketCount(){return this.buckets.size}};function vg(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n)return;n=n[e]}return n}function yg(e,t){if(typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`)throw TypeError(`Expected string|number|boolean from payload, got ${typeof e}`);return t===`string`?lu(e):t===`number`?uu(e):du(e)}function bg(e){return e===`number`?0:e===`boolean`?!1:``}var xg=class{inputMetas=new Map;lastErrors=new Map;watchMgr=new gg;ttlMgr=new _g;gitSubscriptions=new Map;cleanups=[];inFlight=new Set;engine=ng();gitProvider;ownsGitProvider;sessionState;constructor(e,t=``,n,r){this.store=e,this.defaultEmptyValue=t,n?(this.gitProvider=n,this.ownsGitProvider=!1):(this.gitProvider=new on({sanityIntervalMs:0}),this.ownsGitProvider=!0),this.sessionState=r}get variableStore(){return this.store}declareLiteral(e,t){this.store.defineBox(e,cu(t),t)}declareInput(e,t,n,r){let i=r===void 0?this.defaultFor(n):r;this.store.defineBox(e,n,i),this.inputMetas.set(e,{path:t,varDefault:r})}declareEnv(e,t,n){let r=process.env[t];if(r!==void 0){this.store.defineBox(e,`string`,r);return}let i=n===void 0?typeof this.defaultEmptyValue==`string`?this.defaultEmptyValue:``:n;this.store.defineBox(e,`string`,i),this.recordError(e,`env var "${t}" is not set`)}declareShell(e,t,n){let r=ag(e,n.cache);this.store.defineBox(e,`string`,this.stringInitial(n.varDefault));let i=()=>void this.updateFromShell(e,t,n.regex,n.varDefault);i(),this.registerCachePolicy(e,r,i)}declareFile(e,t,n){this.store.defineBox(e,`string`,this.stringInitial(n.varDefault));let r=()=>void this.updateFromFile(e,t,n.readMode,n.regex,n.varDefault);r(),this.registerCachePolicy(e,n.cache,r)}declareTemplate(e,t,n={}){let r=this.engine.parse(t);this.store.defineComputed(e,`string`,t=>{let i=rg(this.store);try{let t=r.evaluate(i).map(e=>e.plain).join(``);return this.lastErrors.delete(e),t}catch(t){return this.recordError(e,t instanceof Error?t.message:String(t)),this.stringInitial(n.varDefault)}}),this.store.read(e)}declareTime(e,t){let n=t.ttlMs??1e3;this.store.defineBox(e,`string`,(e=>{try{return pg(t.format,e)}catch{return this.stringInitial(t.varDefault)}})(new Date));let r=this.ttlMgr.subscribe(n,()=>{try{this.store.setBox(e,pg(t.format,new Date)),this.lastErrors.delete(e)}catch(n){this.applyFallback(e,`string`,t.varDefault,n instanceof Error?n.message:String(n))}});this.cleanups.push(r)}declareGit(e,t){let n=mg[t.field],r=t.varDefault===void 0?bg(n):yg(t.varDefault,n);this.store.defineBox(e,n,r);let i=this.gitSubscriptions.get(t.cwd);if(!i){let e=new Map;i={fieldSubs:e,unsubscribe:this.gitProvider.subscribe(t.cwd,t=>{this.store.runInAction(()=>{for(let[n,r]of e)for(let{name:e,varDefault:i}of r)this.store.setBox(e,hg(t,n,i,this.defaultEmptyValue))})})},this.gitSubscriptions.set(t.cwd,i)}let a=i.fieldSubs.get(t.field);a||(a=[],i.fieldSubs.set(t.field,a)),a.push({name:e,varDefault:t.varDefault})}declareState(e,t){if(!this.sessionState)throw Error(`declareState("${e}"): SourceRegistry was constructed without a SessionState — state-kind variables require a SessionState (the daemon provides one; tests must supply one)`);let n=this.sessionState,r=t.varDefault??this.stringInitial(void 0);this.store.defineComputed(e,`string`,e=>{let i=e(`session.id`);if(typeof i!=`string`||!i)return r;let a=n.get(i,t.key);return a===null?r:a})}applyInput(e){this.store.runInAction(()=>{for(let[t,n]of this.inputMetas){let r=vg(e,n.path),i=this.store.getType(t);if(r!==void 0)try{this.store.setBox(t,yg(r,i)),this.lastErrors.delete(t)}catch(e){this.applyFallback(t,i,n.varDefault,e instanceof Error?e.message:String(e))}else this.applyFallback(t,i,n.varDefault,`input path "${n.path}" not found in payload`)}})}getLastError(e){return this.lastErrors.get(e)}dispose(){for(let e of this.cleanups)e();this.cleanups.length=0;for(let e of this.gitSubscriptions.values())e.unsubscribe();this.gitSubscriptions.clear(),this.watchMgr.dispose(),this.ttlMgr.dispose(),this.ownsGitProvider&&this.gitProvider.close()}registerCachePolicy(e,t,n){switch(t.kind){case`never`:break;case`ttl`:{let e=this.ttlMgr.subscribe(t.durationMs,n);this.cleanups.push(e);break}case`watch_file`:{let e=this.watchMgr.subscribe(t.path,n);this.cleanups.push(e);break}case`key`:{let e=this.engine.parse(t.template),r=(0,X.reaction)(()=>{let t=rg(this.store);try{return e.evaluate(t).map(e=>e.plain).join(``)}catch{return``}},n);this.cleanups.push(r);break}case`depends_on`:{let e=(0,X.reaction)(()=>t.varNames.map(e=>String(this.store.read(e))).join(`,`),n);this.cleanups.push(e);break}}}async updateFromShell(e,t,n,r){if(!this.inFlight.has(e)){this.inFlight.add(e);try{let{stdout:i,exitCode:a}=await sg(t);if(a!==0){this.applyFallback(e,`string`,r,`shell "${t}" exited with code ${a}`);return}if(n!==void 0){let a=new RegExp(n).exec(i);if(!a?.[1]){this.applyFallback(e,`string`,r,`regex no-match in output of "${t}"`);return}this.store.setBox(e,a[1].replace(/\n/g,` `))}else this.store.setBox(e,i.replace(/\n/g,` `).trim());this.lastErrors.delete(e)}finally{this.inFlight.delete(e)}}}async updateFromFile(e,t,n,r,i){if(!this.inFlight.has(e)){this.inFlight.add(e);try{let a=await cg(t,n,r);if(a.error!==void 0){this.applyFallback(e,`string`,i,a.error);return}this.store.setBox(e,a.content??``),this.lastErrors.delete(e)}finally{this.inFlight.delete(e)}}}applyFallback(e,t,n,r){if(this.recordError(e,r),n!==void 0){this.store.setBox(e,n);return}try{this.store.setBox(e,yg(this.defaultEmptyValue,t))}catch{this.store.setBox(e,bg(t))}}defaultFor(e){try{return yg(this.defaultEmptyValue,e)}catch{return bg(e)}}stringInitial(e){return e===void 0?typeof this.defaultEmptyValue==`string`?this.defaultEmptyValue:``:e}recordError(e,t){this.lastErrors.set(e,{timestamp:Date.now(),message:t})}};function Sg(e,t){switch(e){case`capsule`:return new ka;case`plain`:return new Aa(t===void 0?{}:{separator:t});case`powerline`:return new Oa;default:return e}}function Cg(e,t){if(e.length===0)return``;let n=Sg(t.style,t.separator);if(Number.isFinite(t.width)){let r=Na(new Ga([...e],{joiner:n}),{width:t.width,colorSystem:t.colorCompatibility});return r.endsWith(`
102
+ `)?r.slice(0,-1):r}return Na(new Ca([...e],n),{colorSystem:t.colorCompatibility})}const wg=new Map,Tg=new Map;function Eg(e){let t=$o(e),n=wg.get(t);if(n!==void 0)return n;let r=Hi(t);if(r===null)throw Error(`Palette "${e}" (resolved "${t}") did not resolve in the theme registry — allowed names and the registry are inconsistent`);let i=new Fi(r);return wg.set(t,i),i}function Dg(e,t){let n=`${e.palette.name} ${t}`,r=Tg.get(n);if(r!==void 0)return r;let i={hueShift:t,chromaScale:1,lightnessScale:1,lightnessShift:0},a=new Fi(Qi(e.palette,i));return Tg.set(n,a),a}function Og(e,t){let n=[],r=[],i=()=>{if(!r.length)return;let e=kg(r,t);e.plain.length>0&&n.push(e),r=[]};for(let a of e)if(a.style.link){i();let e=kg([a],t);e.plain.length>0&&n.push(e)}else r.push(a);return i(),n}function kg(e,t){let n=t!==void 0&&!t.isNull?e.map(e=>Ag(e,t)):e,r=Sa.fromFragments(n);return r.end=``,r.noWrap=!0,n.length===1?r.style=n[0].style:t!==void 0&&!t.isNull&&(r.style=t),r}function Ag(e,t){let n=e.copy();return n.style=t.add(e.style),n}function jg(e,t){return e===void 0?!0:e.evaluate(t).map(e=>e.plain).join(``)!==`false`}function Mg(e,t){let n=Sa.fromFragments(e);return n.end=``,n.noWrap=!0,t!==void 0&&!t.isNull&&(n.style=t),n}function Ng(e,t){let{width:n,justify:r,truncate:i,truncateMarker:a=`…`,baseStyle:o}=t;if(e.length===0)return[];let s=Mg(e,o);return n===`auto`||(s.cellLength>n?s.truncate(n,{mode:i,marker:a}):s.cellLength<n&&s.align(r,n)),[s]}var Pg=class extends Error{constructor(e,t){super(`Invalid ${t} color spec: ${JSON.stringify(e)}`),this.name=`ColorSpecError`}};function Fg(e,t,n,r){let i=Ig(t,r),a=i===void 0?void 0:Lg(e,i,void 0,`bg`),o=Ig(n,r),s=o===void 0?void 0:Lg(e,o,a,`fg`);return new J({bgcolor:a===void 0?void 0:W.fromRgba(a),color:s===void 0?void 0:W.fromRgba(s)})}function Ig(e,t){if(e!==void 0)return e.evaluate(t).map(e=>e.plain).join(``)}function Lg(e,t,n,r){let i=e.resolve(t.trim(),n===void 0?void 0:{against:n});if(i===null)throw new Pg(t,r);return i}function Rg(e){return e===`themes`?ns():rs}function zg(e,t,n){let r=new Map;for(let[i,a]of Object.entries(t))r.set(i,Bg(e,i,a,n));return r}function Bg(e,t,n,r){if(`set`in n){let e=r.get(n.set)??n.set;return`to`in n?{kind:`set-literal`,key:n.set,value:n.to,stateVar:e}:`from`in n?{kind:`set-option`,key:n.set,stateVar:e,options:[...Rg(n.from)]}:`int`in n?{kind:`set-int`,key:n.set,stateVar:e}:`cycle`in n?{kind:`set-cycle`,key:n.set,stateVar:e,members:n.cycle}:{kind:`set-bounded`,key:n.set,by:n.by}}return`copy`in n?{kind:`copy`,text:Vg(e,n.copy,t)}:{kind:`open`,target:Vg(e,n.open,t)}}function Vg(e,t,n){try{return e(t)}catch(e){throw Error(`Template parse error in actions.${n}: ${e.message}`,{cause:e})}}function Hg(e,t){return e.has(t)?lu(e.read(t)):``}function Ug(e,t){return e.evaluate(t).map(e=>e.plain).join(``)}function Wg(e,t,n){let r=new Sa(e,{style:new J({link:t,bold:n})});return r.noWrap=!0,r.end=``,r}function Gg(e,t){return Math.max(e.members.indexOf(Hg(t,e.stateVar)),0)}function Kg(e,t,n,r,i){switch(e.kind){case`set-literal`:{let t=Hg(r,e.stateVar);return{effect:{verb:at,args:[i,e.key,e.value]},active:t===e.value}}case`set-option`:{let a=n??t,o=Hg(r,e.stateVar);return{effect:{verb:at,args:[i,e.key,a]},active:o===a}}case`set-int`:{let a=n??t,o=Hg(r,e.stateVar);return{effect:{verb:at,args:[i,e.key,a]},active:o===a}}case`set-cycle`:{let t=e.members[(Gg(e,r)+1)%e.members.length];return{effect:{verb:at,args:[i,e.key,t]},active:!1}}case`set-bounded`:return{effect:{verb:ot,args:[i,e.key,String(e.by)]},active:!1};case`copy`:return{effect:{verb:st,args:[Ug(e.text,rg(r))]},active:!1};case`open`:return{effect:{verb:ct,args:[Ug(e.target,rg(r))]},active:!1}}}function qg(e,t,n,r){if(n.length===0)throw Error(`action "${e}" needs a display (the clickable text)`);if(t.kind===`set-cycle`){if(n.length!==1&&n.length!==t.members.length)throw Error(`action "${e}" cycles ${t.members.length} members; bind one display per member (${t.members.length}) or one static display, got ${n.length}`);return{display:n.length===1?n[0]:n[Gg(t,r)],boundValue:void 0}}if(n.length>2)throw Error(`action "${e}" takes a display and an optional bound value, got ${n.length} arguments (per-state displays are a cycle action's form)`);return{display:n[0],boundValue:n[1]}}function Jg(e,t,n){let r=n.compiled.get(e);if(!r)throw Error(`action "${e}" is not declared in this config`);let i=n.store,{display:a,boundValue:o}=qg(e,r,t,i),{effect:s,active:c}=Kg(r,a,o,i,Hg(i,`session.id`));return Wg(a,pt([s]),c)}function Yg(e){return{action:{fn:(t,...n)=>Jg(t,n,e),argTypes:[`string`,`string`],returnType:`T`}}}function Xg(e){return new Sa(e).cellLength}function Zg(e,t,n){if(!Number.isFinite(t))return e.length>0?[e.map((e,t)=>t)]:[];let r=Math.max(1,t-n),i=[],a=[],o=0;for(let t=0;t<e.length;t++){let n=e[t];a.length===0?(a=[t],o=n):o+1+n<=r?(a.push(t),o+=1+n):(i.push(a),a=[t],o=n)}return a.length>0&&i.push(a),i}function Qg(e,t){let n=[];for(let t of e)n.length>0&&n.push(new Sa(` `)),n.push(t);let r=Sa.fromFragments(n);return r.noWrap=t,r.end=``,r}function $g(e,t,n,r){let i=e.compiled.get(t);if(!i||i.kind!==n)throw Error(`picker references action "${t}" which must be ${r}, got ${i?`a ${i.kind} action`:`no such action`}`);return i}function e_(e,t,n,r,i){let a=$g(i,e,`set-option`,`a set-option action ({ set, from })`),o=$g(i,t,`set-int`,`an int action ({ set, int: true })`),s=i.store,c=Hg(s,`session.id`),l=Hg(s,a.stateVar),u=a.options.map(Xg),d=r?uu(s.read(`term.cols`)):1/0,f=Xg(`✕`)+1,p=Xg(`←`)+1+Xg(`→`)+1,m=Zg(u,d,f),h=m.length>1?Zg(u,d,f+p):m,g=parseInt(Hg(s,o.stateVar),10),_=Number.isInteger(g)?Math.max(0,Math.min(g,h.length-1)):0,v=h[_]??[],y=e=>pt([{verb:at,args:[c,o.key,String(e)]}]),b=e=>pt([{verb:at,args:[c,a.key,e,...n?[o.key,`-1`]:[]]}]),x=[Wg(`✕`,y(-1),!1)];_>0&&x.push(Wg(`←`,y(_-1),!1));for(let e of v){let t=a.options[e];x.push(Wg(t,b(t),t===l))}return _<h.length-1&&x.push(Wg(`→`,y(_+1),!1)),Qg(x,r)}function t_(e){return{picker:{fn:(t,n,r,i)=>e_(t,n,r===!0,i===!0,e),argTypes:[`string`,`string`,`bool`,`bool`],returnType:`T`}}}function n_(e){let t=[],n=[];for(let r of e){if(!r.contains(`
103
103
  `)){n.push(r);continue}let e=r.split(`
104
- `);n.push(e[0]);for(let r=1;r<e.length;r++)t.push(n),n=[e[r]]}return t.push(n),t}function n_(e,t){switch(e){case`vertical`:return t.flatMap(e=>e);case`horizontal`:{let e=t.reduce((e,t)=>Math.max(e,t.length),0),n=[];for(let r=0;r<e;r++)n.push(t.flatMap(e=>e[r]??[]));return n}}}const r_={container:{compile(e,t){return{kind:`container`,direction:e.direction,when:t.when,children:e.children.map((e,n)=>t.compileChild(e,`${t.path}.children[${n}]`))}},render(e,t){return n_(e.direction,e.children.map(e=>t.renderChild(e,t.visible)))}},segment:{compile(e,t){return{kind:`segment`,when:t.when,name:e.name}},render(e,t){let n=t.lookupSegment(e.name);if(!n)throw Error(`Layout segment "${e.name}" has no matching segment`);let{seg:r,compiled:i}=n,a=t.nextHueShift();if(!t.visible)return[];try{if(!Ag(i.when,t.scope))return[];let n=Pg(Eg(i.paletteResolver??t.basePalette,a),i.bg,i.fg,t.scope),o=t_(Dg(i.template.evaluate(t.scope),n)).map(e=>Mg(e,{width:r.width??`auto`,justify:r.justify??`left`,truncate:r.truncate??`right`,baseStyle:n}));return t.perSegmentSink!==void 0&&t.perSegmentSink.set(e.name,o.flat()),o}catch(t){return[[new Sa(`⚠ ${e.name}: ${t.message??String(t)}`)]]}}}};function i_(e){return r_[e]}function a_(e){if(`ttl`in e)return{kind:`ttl`,durationMs:ag(e.ttl)};if(`watch_file`in e)return{kind:`watch_file`,path:e.watch_file};if(`depends_on`in e)return{kind:`depends_on`,varNames:e.depends_on};if(`key`in e)return{kind:`key`,template:e.key};if(`never`in e)return{kind:`never`};throw Error(`Unknown CacheDecl discriminator — loader invariant violated: ${JSON.stringify(e)}`)}function o_(e,t,n,r){switch(n.kind){case`literal`:e.declareLiteral(t,n.value);break;case`input`:e.declareInput(t,n.path,n.type??`string`,n.default);break;case`env`:e.declareEnv(t,n.name,n.default);break;case`file`:e.declareFile(t,n.path,{readMode:n.readMode,regex:n.regex,cache:a_(n.cache),varDefault:n.default});break;case`shell`:e.declareShell(t,n.command,{regex:n.regex,cache:a_(n.cache),varDefault:n.default});break;case`template`:e.declareTemplate(t,n.template,{varDefault:n.default});break;case`time`:e.declareTime(t,{format:n.layout,ttlMs:n.cache?ag(n.cache.ttl):void 0,varDefault:n.default});break;case`git`:e.declareGit(t,{field:n.field,cwd:r,varDefault:n.default});break;case`state`:e.declareState(t,{key:n.key,...n.default!==void 0&&{varDefault:n.default}});break}}function s_(e,t){let n=``;for(let[r,i]of Object.entries(t)){let t=`{{ define "${r}" }}${i}{{ end }}`;try{e.parse(t)}catch(e){throw Error(`Template parse error in helpers.${r}: ${e.message}`,{cause:e})}n+=t}return n}function c_(e,t,n){let r=n?.cwd??process.cwd(),i={store:t.variableStore,compiled:new Map},a=tg(void 0,{...Jg(i),...e_(i)},n?.clock),o=s_(a,e.helpers),s=e=>a.parse(o+e),c=new Map;for(let[t,n]of Object.entries(e.variables))n.kind===`state`&&!c.has(n.key)&&c.set(n.key,t);for(let[t,n]of Object.entries(e.segments))if(n.vars)for(let[e,r]of Object.entries(n.vars))r.kind===`state`&&!c.has(r.key)&&c.set(r.key,`${t}.${e}`);i.compiled=Rg(s,e.actions,c);let l=[];for(let[n,i]of Object.entries(e.variables))try{o_(t,n,i,r)}catch(e){l.push(`Variable "${n}": ${e.message??String(e)}`)}for(let[n,i]of Object.entries(e.segments))if(i.vars)for(let[e,a]of Object.entries(i.vars))try{o_(t,`${n}.${e}`,a,r)}catch(t){l.push(`Variable "${n}.${e}": ${t.message??String(t)}`)}let u=Object.create(null);for(let[t,n]of Object.entries(e.segments)){let e=(e,n)=>{try{return s(e)}catch(e){throw Error(`Template parse error in segments.${t}.${n}: ${e.message}`,{cause:e})}};u[t]={when:n.when===void 0?void 0:e(n.when,`when`),template:e(n.template,`template`),bg:n.bg===void 0?void 0:e(n.bg,`bg`),fg:n.fg===void 0?void 0:e(n.fg,`fg`),paletteResolver:n.palette===void 0?void 0:Tg(n.palette)}}let d=(e,t,n)=>{try{return s(e)}catch(e){throw Error(`Template parse error in ${t}.${n}: ${e.message}`,{cause:e})}},f=(e,t)=>{let n={path:t,when:e.when===void 0?void 0:d(e.when,t,`when`),compileChild:f};return i_(e.kind).compile(e,n)};return{segments:u,root:f(e.root,`root`),loadWarnings:l}}function l_(e,t,n,r,i,a,o,s){r.applyInput({...i,term:{cols:o.width}});let c=ng(n),l=n.has(`hue.step`)?Number(n.read(`hue.step`)):0,u=Number.isFinite(l)?l:0;s?.clear();let d={value:0},f=()=>{let e=d.value*u;return d.value+=1,e},p=n=>{let r=e.segments[n],i=t.segments[n];return r!==void 0&&i!==void 0?{seg:r,compiled:i}:void 0},m=(e,t)=>{let n={scope:c,basePalette:a,visible:t&&Ag(e.when,c),nextHueShift:f,perSegmentSink:s,lookupSegment:p,renderChild:m};return i_(e.kind).render(e,n)};return m(t.root,!0).map(e=>Sg(e,o)).join(`
105
- `)}const u_=ns(),d_=new Set(u_),f_=new Set(rs),p_=e=>e?d_.has(e)?{ok:!0,value:e}:{ok:!1,reason:`unknown theme "${e}" (have: ${u_.join(`, `)})`}:{ok:!1,reason:`theme name is required`},m_=e=>e?f_.has(e)?{ok:!0,value:e}:{ok:!1,reason:`unknown style "${e}" (have: ${rs.join(`, `)})`}:{ok:!1,reason:`style name is required`},h_=new Set([`1`,`true`]),g_=new Set([`0`,`false`]),__=new Map([[`style`,{validator:m_,permanent:!0}],[`theme`,{validator:p_,permanent:!0}],[`toolbar-expanded`,{validator:e=>h_.has(e)?{ok:!0,value:`1`}:g_.has(e)?{ok:!0,value:``}:{ok:!1,reason:`expected boolean-ish (1, 0, true, false), got "${e}"`},permanent:!0}]]);function v_(){return[...__.keys()]}function y_(e,t,n){if(t===`int`)return w_(`menu page "${e}"`);if(t===`range`){let t=n.flatMap(e=>e.kind===`range`?[e.min]:[]),r=n.flatMap(e=>e.kind===`range`?[e.max]:[]);return T_(Math.min(...t),Math.max(...r),`stepper "${e}"`)}return S_([...new Set(n.flatMap(e=>e.kind===`allow-list`?e.allowed:[]))],`state "${e}"`)}function b_(e,t){if(!e)throw Error(`registerStateValidator: key is required`);if(e.includes(`/`))throw Error(`registerStateValidator: key "${e}" contains "/" — the set-state wire shape splits on "/" so a slash-bearing key cannot be addressed. Use a slash-free key.`);let n=__.get(e);if(n){if(n.permanent)throw Error(`registerStateValidator: key "${e}" is a built-in state key and cannot be re-claimed (built-in keys: ${[...x_()].join(`, `)})`);if(n.kind!==t.kind)throw Error(`registerStateValidator: key "${e}" is already a ${n.kind} state key; cannot also register it as ${t.kind}. A state key has one key shape — a menu page index (int) and a button allow-list cannot share a key.`);n.specs.push(t),n.validator=y_(e,n.kind,n.specs)}else{let n=[t];__.set(e,{permanent:!1,kind:t.kind,validator:y_(e,t.kind,n),specs:n})}let r=!0;return()=>{if(!r)return;r=!1;let n=__.get(e);if(!n||n.permanent)return;let i=n.specs.indexOf(t);i>=0&&n.specs.splice(i,1),n.specs.length===0?__.delete(e):n.validator=y_(e,n.kind,n.specs)}}function x_(){let e=[];for(let[t,n]of __)n.permanent&&e.push(t);return e}function S_(e,t){let n=e.filter(e=>e.includes(`/`));if(n.length>0)throw Error(`makeAllowListValidator(${t}): values contain "/" — the set-state wire shape splits values on "/" so slash-bearing options cannot be addressed. Offending values: ${n.join(`, `)}`);if(e.includes(``))throw Error(`makeAllowListValidator(${t}): empty string is not a writable option — the validator rejects empty input before the allow-list check, so an "" in the allowed list could be rendered but never delivered. Remove "" from the allowed list.`);let r=new Set(e),i=[...e];return e=>e?r.has(e)?{ok:!0,value:e}:{ok:!1,reason:`unknown ${t} "${e}" (have: ${i.join(`, `)})`}:{ok:!1,reason:`${t} value is required`}}const C_=/^-?\d+$/;function w_(e){return t=>{if(!t)return{ok:!1,reason:`${e} value is required`};if(!C_.test(t))return{ok:!1,reason:`${e} must be an integer, got "${t}"`};let n=t[0]===`-`,r=(n?t.slice(1):t).replace(/^0+/,``);return r===``?{ok:!0,value:`0`}:{ok:!0,value:n?`-${r}`:r}}}function T_(e,t,n){return r=>r?C_.test(r)?{ok:!0,value:String(Math.max(e,Math.min(t,parseInt(r,10))))}:{ok:!1,reason:`${n} must be an integer, got "${r}"`}:{ok:!1,reason:`${n} value is required`}}function E_(e){return e===`themes`?u_:rs}function D_(e,t){let n=t.filter(e=>e.kind===`range`),r=t.some(e=>e.kind===`int`),i=t.flatMap(e=>e.kind===`allow-list`?e.allowed:[]);if(n.length===0&&!r)return{kind:`allow-list`,allowed:[...new Set(i)]};let a=i.filter(e=>!C_.test(e));if(a.length>0)throw Error(`deriveActionValidators: key "${e}" is an integer spec (a paged cursor or a bounded value) but a click writes non-integer value(s) to it (${a.join(`, `)}). A state key has one key shape — point that click at a distinct key, or write an integer.`);if(r&&n.length>0)throw Error(`deriveActionValidators: key "${e}" is declared as both a paged cursor (int) and a bounded value (range) — a state key has one key shape. Use distinct keys.`);if(n.length>0){let t=Math.min(...n.map(e=>e.min)),r=Math.max(...n.map(e=>e.max)),a=i.filter(e=>{let n=parseInt(e,10);return n<t||n>r});if(a.length>0)throw Error(`deriveActionValidators: key "${e}" is a bounded range [${t},${r}] but a click writes out-of-range value(s) to it (${a.join(`, `)}). The range gate would clamp them, storing a different value than the click renders — write an in-range integer, or point that click at a distinct key.`);return{kind:`range`,min:t,max:r,seed:j_(n[0].seed,t,r)}}return{kind:`int`}}function O_(e){let t=new Set(x_());return e.filter(e=>e.spec.kind!==`allow-list`||!t.has(e.key))}function k_(e){let t=new Map;for(let{key:n,spec:r}of e){let e=t.get(n);e?e.push(r):t.set(n,[r])}return[...t].map(([e,t])=>({key:e,spec:D_(e,t)}))}function A_(e,t){return`set`in e?`to`in e?[{key:e.set,spec:{kind:`allow-list`,allowed:[e.to]}}]:`from`in e?[{key:e.set,spec:{kind:`allow-list`,allowed:E_(e.from)}}]:`int`in e?[{key:e.set,spec:{kind:`int`}}]:`cycle`in e?[{key:e.set,spec:{kind:`allow-list`,allowed:e.cycle}}]:[{key:e.set,spec:{kind:`range`,min:e.min,max:e.max,seed:j_(t.get(e.set),e.min,e.max)}}]:[]}function j_(e,t,n){return e===void 0?t:Math.max(t,Math.min(n,e))}function M_(e){let t=new Map;for(let n of Object.values(e.variables)){if(n.kind!==`state`)continue;let e=n.default;e!==void 0&&C_.test(e)&&t.set(n.key,parseInt(e,10))}return t}function N_(e){let t=M_(e);return O_(Object.values(e.actions).flatMap(e=>A_(e,t)))}function P_(e){return k_(N_(e))}function F_(e,t){let n=__.get(e);return n?n.validator(t):{ok:!1,reason:`unknown state key "${e}" (have: ${v_().join(`, `)})`}}function I_(e){let t=__.get(e);if(!t||t.permanent||t.kind!==`range`)return null;let n=t.specs.flatMap(e=>e.kind===`range`?[e]:[]);if(n.length===0)return null;let r=Math.min(...n.map(e=>e.min)),i=Math.max(...n.map(e=>e.max));return{min:r,max:i,seed:j_(n[0].seed,r,i)}}var L_=class{kind=`box`;cell;lastSetAt;constructor(e,t,n){this.name=e,this.type=t,z_(e,t,n,`initial value`),this.cell=X.observable.box(n,{deep:!1}),this.lastSetAt=Date.now()}read(){return this.cell.get()}set(e){z_(this.name,this.type,e,`set value`),this.cell.set(e),this.lastSetAt=Date.now()}lastUpdatedMs(){return this.lastSetAt}},R_=class{kind=`computed`;cell;constructor(e,t,n){this.name=e,this.type=t,this.cell=(0,X.computed)(()=>{let e=n();return z_(this.name,this.type,e,`computed result`),e},{keepAlive:!0})}read(){return this.cell.get()}lastUpdatedMs(){return null}};function z_(e,t,n,r){let i=su(n);if(i!==t)throw TypeError(`Variable "${e}": ${r} type ${i} does not match declared type ${t}`)}var B_=class{nodes=new Map;defineBox(e,t,n){this.assertNotDefined(e),this.nodes.set(e,new L_(e,t,n))}defineComputed(e,t,n){this.assertNotDefined(e);let r=e=>this.read(e);this.nodes.set(e,new R_(e,t,()=>n(r)))}read(e){return this.requireNode(e).read()}setBox(e,t){let n=this.requireNode(e);if(n.kind!==`box`)throw TypeError(`Variable "${e}" is a ${n.kind}, not a box (use defineBox to create a settable variable)`);(0,X.runInAction)(()=>n.set(t))}runInAction(e){(0,X.runInAction)(e)}has(e){return this.nodes.has(e)}getType(e){return this.requireNode(e).type}getKind(e){return this.requireNode(e).kind}getNode(e){let t=this.requireNode(e);return{name:t.name,type:t.type,kind:t.kind,read:()=>t.read(),lastUpdatedMs:()=>t.lastUpdatedMs()}}names(){return[...this.nodes.keys()]}requireNode(e){let t=this.nodes.get(e);if(!t)throw ReferenceError(`Unknown variable "${e}"`);return t}assertNotDefined(e){if(this.nodes.has(e))throw Error(`Variable "${e}" is already declared`)}};function V_(e,t,n){return e+`\0`+t+`\0`+(n??``)}var H_=class{entries=new Map;deps;maxEntries;constructor(e,t={}){this.deps=e,this.maxEntries=t.maxEntries??256}getOrCreate(e,t,n){let r=V_(e,t,n),i=this.entries.get(r);if(i)return this.entries.delete(r),this.entries.set(r,i),i;let a={projectDir:e,cwd:t,configFile:n,configFilePath:null,lastError:null,lastWarning:null,state:null,watcher:null};if(this.reloadInto(a),this.entries.set(r,a),this.entries.size>this.maxEntries){let e=this.entries.keys().next().value;if(e!==void 0){let t=this.entries.get(e);t?.state?.registry.dispose(),t?.state?.validatorDisposers.forEach(e=>e()),t?.watcher?.release(),this.entries.delete(e)}}return a}reloadInto(e){let t=Pl(e.projectDir,e.cwd,e.configFile);e.lastWarning=Fl(e.projectDir,e.cwd);let n;try{n=this.buildState(e,t)}catch(n){e.lastError=n instanceof os||n instanceof Error?n.message:String(n),this.refreshWatcher(e,t);return}if(e.state?.registry.dispose(),e.state?.validatorDisposers.forEach(e=>e()),e.lastError=null,e.state=n,n.compiled.loadWarnings.length>0){let t=n.compiled.loadWarnings.join(`
104
+ `);n.push(e[0]);for(let r=1;r<e.length;r++)t.push(n),n=[e[r]]}return t.push(n),t}function r_(e,t){switch(e){case`vertical`:return t.flatMap(e=>e);case`horizontal`:{let e=t.reduce((e,t)=>Math.max(e,t.length),0),n=[];for(let r=0;r<e;r++)n.push(t.flatMap(e=>e[r]??[]));return n}}}const i_={container:{compile(e,t){return{kind:`container`,direction:e.direction,when:t.when,children:e.children.map((e,n)=>t.compileChild(e,`${t.path}.children[${n}]`))}},render(e,t){return r_(e.direction,e.children.map(e=>t.renderChild(e,t.visible)))}},segment:{compile(e,t){return{kind:`segment`,when:t.when,name:e.name}},render(e,t){let n=t.lookupSegment(e.name);if(!n)throw Error(`Layout segment "${e.name}" has no matching segment`);let{seg:r,compiled:i}=n,a=t.nextHueShift();if(!t.visible)return[];try{if(!jg(i.when,t.scope))return[];let n=Fg(Dg(i.paletteResolver??t.basePalette,a),i.bg,i.fg,t.scope),o=n_(Og(i.template.evaluate(t.scope),n)).map(e=>Ng(e,{width:r.width??`auto`,justify:r.justify??`left`,truncate:r.truncate??`right`,baseStyle:n}));return t.perSegmentSink!==void 0&&t.perSegmentSink.set(e.name,o.flat()),o}catch(t){return[[new Sa(`⚠ ${e.name}: ${t.message??String(t)}`)]]}}}};function a_(e){return i_[e]}function o_(e){if(`ttl`in e)return{kind:`ttl`,durationMs:og(e.ttl)};if(`watch_file`in e)return{kind:`watch_file`,path:e.watch_file};if(`depends_on`in e)return{kind:`depends_on`,varNames:e.depends_on};if(`key`in e)return{kind:`key`,template:e.key};if(`never`in e)return{kind:`never`};throw Error(`Unknown CacheDecl discriminator — loader invariant violated: ${JSON.stringify(e)}`)}function s_(e,t,n,r){switch(n.kind){case`literal`:e.declareLiteral(t,n.value);break;case`input`:e.declareInput(t,n.path,n.type??`string`,n.default);break;case`env`:e.declareEnv(t,n.name,n.default);break;case`file`:e.declareFile(t,n.path,{readMode:n.readMode,regex:n.regex,cache:o_(n.cache),varDefault:n.default});break;case`shell`:e.declareShell(t,n.command,{regex:n.regex,cache:o_(n.cache),varDefault:n.default});break;case`template`:e.declareTemplate(t,n.template,{varDefault:n.default});break;case`time`:e.declareTime(t,{format:n.layout,ttlMs:n.cache?og(n.cache.ttl):void 0,varDefault:n.default});break;case`git`:e.declareGit(t,{field:n.field,cwd:r,varDefault:n.default});break;case`state`:e.declareState(t,{key:n.key,...n.default!==void 0&&{varDefault:n.default}});break}}function c_(e,t){let n=``;for(let[r,i]of Object.entries(t)){let t=`{{ define "${r}" }}${i}{{ end }}`;try{e.parse(t)}catch(e){throw Error(`Template parse error in helpers.${r}: ${e.message}`,{cause:e})}n+=t}return n}function l_(e,t,n){let r=n?.cwd??process.cwd(),i={store:t.variableStore,compiled:new Map},a=ng(void 0,{...Yg(i),...t_(i)},n?.clock),o=c_(a,e.helpers),s=e=>a.parse(o+e),c=new Map;for(let[t,n]of Object.entries(e.variables))n.kind===`state`&&!c.has(n.key)&&c.set(n.key,t);for(let[t,n]of Object.entries(e.segments))if(n.vars)for(let[e,r]of Object.entries(n.vars))r.kind===`state`&&!c.has(r.key)&&c.set(r.key,`${t}.${e}`);i.compiled=zg(s,e.actions,c);let l=[];for(let[n,i]of Object.entries(e.variables))try{s_(t,n,i,r)}catch(e){l.push(`Variable "${n}": ${e.message??String(e)}`)}for(let[n,i]of Object.entries(e.segments))if(i.vars)for(let[e,a]of Object.entries(i.vars))try{s_(t,`${n}.${e}`,a,r)}catch(t){l.push(`Variable "${n}.${e}": ${t.message??String(t)}`)}let u=Object.create(null);for(let[t,n]of Object.entries(e.segments)){let e=(e,n)=>{try{return s(e)}catch(e){throw Error(`Template parse error in segments.${t}.${n}: ${e.message}`,{cause:e})}};u[t]={when:n.when===void 0?void 0:e(n.when,`when`),template:e(n.template,`template`),bg:n.bg===void 0?void 0:e(n.bg,`bg`),fg:n.fg===void 0?void 0:e(n.fg,`fg`),paletteResolver:n.palette===void 0?void 0:Eg(n.palette)}}let d=(e,t,n)=>{try{return s(e)}catch(e){throw Error(`Template parse error in ${t}.${n}: ${e.message}`,{cause:e})}},f=(e,t)=>{let n={path:t,when:e.when===void 0?void 0:d(e.when,t,`when`),compileChild:f};return a_(e.kind).compile(e,n)};return{segments:u,root:f(e.root,`root`),loadWarnings:l}}function u_(e,t,n,r,i,a,o,s){r.applyInput({...i,term:{cols:o.width}});let c=rg(n),l=n.has(`hue.step`)?Number(n.read(`hue.step`)):0,u=Number.isFinite(l)?l:0;s?.clear();let d={value:0},f=()=>{let e=d.value*u;return d.value+=1,e},p=n=>{let r=e.segments[n],i=t.segments[n];return r!==void 0&&i!==void 0?{seg:r,compiled:i}:void 0},m=(e,t)=>{let n={scope:c,basePalette:a,visible:t&&jg(e.when,c),nextHueShift:f,perSegmentSink:s,lookupSegment:p,renderChild:m};return a_(e.kind).render(e,n)};return m(t.root,!0).map(e=>Cg(e,o)).join(`
105
+ `)}const d_=ns(),f_=new Set(d_),p_=new Set(rs),m_=e=>e?f_.has(e)?{ok:!0,value:e}:{ok:!1,reason:`unknown theme "${e}" (have: ${d_.join(`, `)})`}:{ok:!1,reason:`theme name is required`},h_=e=>e?p_.has(e)?{ok:!0,value:e}:{ok:!1,reason:`unknown style "${e}" (have: ${rs.join(`, `)})`}:{ok:!1,reason:`style name is required`},g_=new Set([`1`,`true`]),__=new Set([`0`,`false`]),v_=new Map([[`style`,{validator:h_,permanent:!0}],[`theme`,{validator:m_,permanent:!0}],[`toolbar-expanded`,{validator:e=>g_.has(e)?{ok:!0,value:`1`}:__.has(e)?{ok:!0,value:``}:{ok:!1,reason:`expected boolean-ish (1, 0, true, false), got "${e}"`},permanent:!0}]]);function y_(){return[...v_.keys()]}function b_(e,t,n){if(t===`int`)return T_(`menu page "${e}"`);if(t===`range`){let t=n.flatMap(e=>e.kind===`range`?[e.min]:[]),r=n.flatMap(e=>e.kind===`range`?[e.max]:[]);return E_(Math.min(...t),Math.max(...r),`stepper "${e}"`)}return C_([...new Set(n.flatMap(e=>e.kind===`allow-list`?e.allowed:[]))],`state "${e}"`)}function x_(e,t){if(!e)throw Error(`registerStateValidator: key is required`);if(e.includes(`/`))throw Error(`registerStateValidator: key "${e}" contains "/" — the set-state wire shape splits on "/" so a slash-bearing key cannot be addressed. Use a slash-free key.`);let n=v_.get(e);if(n){if(n.permanent)throw Error(`registerStateValidator: key "${e}" is a built-in state key and cannot be re-claimed (built-in keys: ${[...S_()].join(`, `)})`);if(n.kind!==t.kind)throw Error(`registerStateValidator: key "${e}" is already a ${n.kind} state key; cannot also register it as ${t.kind}. A state key has one key shape — a menu page index (int) and a button allow-list cannot share a key.`);n.specs.push(t),n.validator=b_(e,n.kind,n.specs)}else{let n=[t];v_.set(e,{permanent:!1,kind:t.kind,validator:b_(e,t.kind,n),specs:n})}let r=!0;return()=>{if(!r)return;r=!1;let n=v_.get(e);if(!n||n.permanent)return;let i=n.specs.indexOf(t);i>=0&&n.specs.splice(i,1),n.specs.length===0?v_.delete(e):n.validator=b_(e,n.kind,n.specs)}}function S_(){let e=[];for(let[t,n]of v_)n.permanent&&e.push(t);return e}function C_(e,t){let n=e.filter(e=>e.includes(`/`));if(n.length>0)throw Error(`makeAllowListValidator(${t}): values contain "/" — the set-state wire shape splits values on "/" so slash-bearing options cannot be addressed. Offending values: ${n.join(`, `)}`);if(e.includes(``))throw Error(`makeAllowListValidator(${t}): empty string is not a writable option — the validator rejects empty input before the allow-list check, so an "" in the allowed list could be rendered but never delivered. Remove "" from the allowed list.`);let r=new Set(e),i=[...e];return e=>e?r.has(e)?{ok:!0,value:e}:{ok:!1,reason:`unknown ${t} "${e}" (have: ${i.join(`, `)})`}:{ok:!1,reason:`${t} value is required`}}const w_=/^-?\d+$/;function T_(e){return t=>{if(!t)return{ok:!1,reason:`${e} value is required`};if(!w_.test(t))return{ok:!1,reason:`${e} must be an integer, got "${t}"`};let n=t[0]===`-`,r=(n?t.slice(1):t).replace(/^0+/,``);return r===``?{ok:!0,value:`0`}:{ok:!0,value:n?`-${r}`:r}}}function E_(e,t,n){return r=>r?w_.test(r)?{ok:!0,value:String(Math.max(e,Math.min(t,parseInt(r,10))))}:{ok:!1,reason:`${n} must be an integer, got "${r}"`}:{ok:!1,reason:`${n} value is required`}}function D_(e){return e===`themes`?d_:rs}function O_(e,t){let n=t.filter(e=>e.kind===`range`),r=t.some(e=>e.kind===`int`),i=t.flatMap(e=>e.kind===`allow-list`?e.allowed:[]);if(n.length===0&&!r)return{kind:`allow-list`,allowed:[...new Set(i)]};let a=i.filter(e=>!w_.test(e));if(a.length>0)throw Error(`deriveActionValidators: key "${e}" is an integer spec (a paged cursor or a bounded value) but a click writes non-integer value(s) to it (${a.join(`, `)}). A state key has one key shape — point that click at a distinct key, or write an integer.`);if(r&&n.length>0)throw Error(`deriveActionValidators: key "${e}" is declared as both a paged cursor (int) and a bounded value (range) — a state key has one key shape. Use distinct keys.`);if(n.length>0){let t=Math.min(...n.map(e=>e.min)),r=Math.max(...n.map(e=>e.max)),a=i.filter(e=>{let n=parseInt(e,10);return n<t||n>r});if(a.length>0)throw Error(`deriveActionValidators: key "${e}" is a bounded range [${t},${r}] but a click writes out-of-range value(s) to it (${a.join(`, `)}). The range gate would clamp them, storing a different value than the click renders — write an in-range integer, or point that click at a distinct key.`);return{kind:`range`,min:t,max:r,seed:M_(n[0].seed,t,r)}}return{kind:`int`}}function k_(e){let t=new Set(S_());return e.filter(e=>e.spec.kind!==`allow-list`||!t.has(e.key))}function A_(e){let t=new Map;for(let{key:n,spec:r}of e){let e=t.get(n);e?e.push(r):t.set(n,[r])}return[...t].map(([e,t])=>({key:e,spec:O_(e,t)}))}function j_(e,t){return`set`in e?`to`in e?[{key:e.set,spec:{kind:`allow-list`,allowed:[e.to]}}]:`from`in e?[{key:e.set,spec:{kind:`allow-list`,allowed:D_(e.from)}}]:`int`in e?[{key:e.set,spec:{kind:`int`}}]:`cycle`in e?[{key:e.set,spec:{kind:`allow-list`,allowed:e.cycle}}]:[{key:e.set,spec:{kind:`range`,min:e.min,max:e.max,seed:M_(t.get(e.set),e.min,e.max)}}]:[]}function M_(e,t,n){return e===void 0?t:Math.max(t,Math.min(n,e))}function N_(e){let t=new Map;for(let n of Object.values(e.variables)){if(n.kind!==`state`)continue;let e=n.default;e!==void 0&&w_.test(e)&&t.set(n.key,parseInt(e,10))}return t}function P_(e){let t=N_(e);return k_(Object.values(e.actions).flatMap(e=>j_(e,t)))}function F_(e){return A_(P_(e))}function I_(e,t){let n=v_.get(e);return n?n.validator(t):{ok:!1,reason:`unknown state key "${e}" (have: ${y_().join(`, `)})`}}function L_(e){let t=v_.get(e);if(!t||t.permanent||t.kind!==`range`)return null;let n=t.specs.flatMap(e=>e.kind===`range`?[e]:[]);if(n.length===0)return null;let r=Math.min(...n.map(e=>e.min)),i=Math.max(...n.map(e=>e.max));return{min:r,max:i,seed:M_(n[0].seed,r,i)}}var R_=class{kind=`box`;cell;lastSetAt;constructor(e,t,n){this.name=e,this.type=t,B_(e,t,n,`initial value`),this.cell=X.observable.box(n,{deep:!1}),this.lastSetAt=Date.now()}read(){return this.cell.get()}set(e){B_(this.name,this.type,e,`set value`),this.cell.set(e),this.lastSetAt=Date.now()}lastUpdatedMs(){return this.lastSetAt}},z_=class{kind=`computed`;cell;constructor(e,t,n){this.name=e,this.type=t,this.cell=(0,X.computed)(()=>{let e=n();return B_(this.name,this.type,e,`computed result`),e},{keepAlive:!0})}read(){return this.cell.get()}lastUpdatedMs(){return null}};function B_(e,t,n,r){let i=cu(n);if(i!==t)throw TypeError(`Variable "${e}": ${r} type ${i} does not match declared type ${t}`)}var V_=class{nodes=new Map;defineBox(e,t,n){this.assertNotDefined(e),this.nodes.set(e,new R_(e,t,n))}defineComputed(e,t,n){this.assertNotDefined(e);let r=e=>this.read(e);this.nodes.set(e,new z_(e,t,()=>n(r)))}read(e){return this.requireNode(e).read()}setBox(e,t){let n=this.requireNode(e);if(n.kind!==`box`)throw TypeError(`Variable "${e}" is a ${n.kind}, not a box (use defineBox to create a settable variable)`);(0,X.runInAction)(()=>n.set(t))}runInAction(e){(0,X.runInAction)(e)}has(e){return this.nodes.has(e)}getType(e){return this.requireNode(e).type}getKind(e){return this.requireNode(e).kind}getNode(e){let t=this.requireNode(e);return{name:t.name,type:t.type,kind:t.kind,read:()=>t.read(),lastUpdatedMs:()=>t.lastUpdatedMs()}}names(){return[...this.nodes.keys()]}requireNode(e){let t=this.nodes.get(e);if(!t)throw ReferenceError(`Unknown variable "${e}"`);return t}assertNotDefined(e){if(this.nodes.has(e))throw Error(`Variable "${e}" is already declared`)}};function H_(e,t,n){return e+`\0`+t+`\0`+(n??``)}var U_=class{entries=new Map;deps;maxEntries;constructor(e,t={}){this.deps=e,this.maxEntries=t.maxEntries??256}getOrCreate(e,t,n){let r=H_(e,t,n),i=this.entries.get(r);if(i)return this.entries.delete(r),this.entries.set(r,i),i;let a={projectDir:e,cwd:t,configFile:n,configFilePath:null,lastError:null,lastWarning:null,state:null,watcher:null};if(this.reloadInto(a),this.entries.set(r,a),this.entries.size>this.maxEntries){let e=this.entries.keys().next().value;if(e!==void 0){let t=this.entries.get(e);t?.state?.registry.dispose(),t?.state?.validatorDisposers.forEach(e=>e()),t?.watcher?.release(),this.entries.delete(e)}}return a}reloadInto(e){let t=Fl(e.projectDir,e.cwd,e.configFile);e.lastWarning=Il(e.projectDir,e.cwd);let n;try{n=this.buildState(e,t)}catch(n){e.lastError=n instanceof os||n instanceof Error?n.message:String(n),this.refreshWatcher(e,t);return}if(e.state?.registry.dispose(),e.state?.validatorDisposers.forEach(e=>e()),e.lastError=null,e.state=n,n.compiled.loadWarnings.length>0){let t=n.compiled.loadWarnings.join(`
106
106
  `);e.lastWarning=e.lastWarning?e.lastWarning+`
107
- `+t:t}this.refreshWatcher(e,t)}buildState(e,t){let{config:n,source:r}=Il(t),i=Ll(n,t??`<default>`,r),a=new B_,o=new bg(a,i.globals.default_empty_value??``,this.deps.gitService,this.deps.sessionState),s,c=[];try{s=c_(i,o,{cwd:e.cwd});for(let{key:e,spec:t}of P_(i))c.push(b_(e,t))}catch(e){for(let e of c)e();throw o.dispose(),e}return{config:i,store:a,registry:o,compiled:s,neededInputPaths:$l(i),lastRenderCellsBySegment:new Map,validatorDisposers:c}}refreshWatcher(e,t){(t!==e.configFilePath||e.watcher===null)&&(e.configFilePath=t,this.rebindWatcher(e,t))}rebindWatcher(e,t){e.watcher&&=(e.watcher.release(),null);let r=Nl(e.projectDir,e.cwd,e.configFile),i=new Map;for(let e of r){let t=o.dirname(e);if(!n.existsSync(t))continue;let r=o.basename(e);i.has(t)||i.set(t,new Set),i.get(t).add(r)}let a=[...i.entries()].map(([e,t])=>({path:e,filenames:[...t]})),s=`config:${e.projectDir}:${e.cwd}:${e.configFile??``}:${t??`<none>`}`;e.watcher=this.deps.watchers.acquire(s,{files:t===null?[]:[t],dirs:a},()=>this.onConfigChanged(e))}onConfigChanged(e){M(`info`,`config change detected for entry projectDir=${e.projectDir} cwd=${e.cwd}`),this.reloadInto(e)}get size(){return this.entries.size}firstPopulatedState(){for(let e of this.entries.values())if(e.state!==null)return e.state;return null}};const U_=16384;var W_=class{startedAt=new Date;requestsTotal=0;requestsErrored=0;requestsTimedOut=0;inFlight=0;watchersOpened=0;watchersClosed=0;watchersEvicted=0;subprocessTotal=0;subprocessInFlight=0;subprocessCount=new Map;subprocessHistogram=new Map;subprocessHistogramRotator=new Map;rollingTimestamps=[];rollingHead=0;launchStats={onStart:e=>{this.subprocessTotal++,this.subprocessInFlight++,this.subprocessCount.set(e,(this.subprocessCount.get(e)??0)+1),this.recordRollingNow()},onEnd:(e,t)=>{this.subprocessInFlight=Math.max(0,this.subprocessInFlight-1),this.recordDuration(e,t)}};recordRollingNow(){let e=Date.now();if(this.rollingTimestamps.length<U_){this.rollingTimestamps.push(e);return}this.rollingTimestamps[this.rollingHead]=e,this.rollingHead=(this.rollingHead+1)%U_}recordDuration(e,t){let n=this.subprocessHistogram.get(e);if(n||(n=[],this.subprocessHistogram.set(e,n)),n.length<16){n.push(t);return}let r=(this.subprocessHistogramRotator.get(e)??0)%16;n[r]=t,this.subprocessHistogramRotator.set(e,r+1)}snapshotSubprocesses(){let e=Date.now()-6e4,t=0;for(let n of this.rollingTimestamps)n>=e&&t++;let n={};for(let[e,t]of this.subprocessCount)t>0&&(n[e]=t);let r={},i={};for(let[e,t]of this.subprocessHistogram){if(t.length===0)continue;let n=[...t].sort((e,t)=>e-t),a=Math.floor(n.length*.5),o=Math.min(n.length-1,Math.floor(n.length*.99)),s=n[a],c=n[o];s!==void 0&&(r[e]=s),c!==void 0&&(i[e]=c)}return{total:this.subprocessTotal,inFlight:this.subprocessInFlight,lastMinute:t,byCategory:n,p50DurationMs:r,p99DurationMs:i}}snapshot(e){let t=process.memoryUsage();return{pid:process.pid,version:3,startedAt:this.startedAt.toISOString(),uptimeSec:Math.floor((Date.now()-this.startedAt.getTime())/1e3),rssBytes:t.rss,heapUsedBytes:t.heapUsed,heapTotalBytes:t.heapTotal,externalBytes:t.external,arrayBuffersBytes:t.arrayBuffers,requests:{total:this.requestsTotal,errored:this.requestsErrored,timedOut:this.requestsTimedOut,inFlight:this.inFlight},gitCache:e.gitCache,usageCache:e.usageCache,renderCache:{size:e.renderCacheSize},watchers:{active:e.watchersActive,opened:this.watchersOpened,closed:this.watchersClosed,evicted:this.watchersEvicted},subprocesses:this.snapshotSubprocesses(),nextRestartReason:e.nextRestartReason??null}}};const G_=(parseInt(process.env.CC_CANDYBAR_RSS_LIMIT_MB??``,10)||512)*1024*1024;function K_(e){let t=e.rssLimitBytes??G_,n=e.snapshotsKeep??3,r=!1;function i(){if(r)return!0;let i=e.rssBytes();if(i<=t)return!1;r=!0,e.log(`warn`,`RSS ${i} > limit ${t}; writing heap snapshot then shutting down`);try{let t=new Date(e.now()).toISOString().replace(/[:.]/g,`-`),r=o.join(e.snapshotDir,`heap-${t}-${e.pid}.heapsnapshot`),i=e.writeHeapSnapshot(r);e.log(`info`,`heap snapshot written: ${i}`),q_(e.listSnapshots(),n,e.removeFile)}catch(t){e.log(`warn`,`heap snapshot failed: ${t.message}`)}return e.shutdown(0),!0}function a(){let n=e.rssBytes();return n>t*.75?`rss ${n} approaching limit ${t}`:null}function s(e=6e4){let t=setInterval(()=>{i()},e);return t.unref(),{disarm:()=>clearInterval(t)}}return{checkRss:i,describeNextRestart:a,arm:s}}function q_(e,t,n){let r=[...e].sort((e,t)=>{let n=e.slice(e.lastIndexOf(`/`)+1);return t.slice(t.lastIndexOf(`/`)+1).localeCompare(n)});for(let e of r.slice(t))try{n(e)}catch{}}function J_(e,t,r={}){let i=we();return{now:()=>Date.now(),pid:process.pid,snapshotDir:i,log:M,rssBytes:()=>process.memoryUsage().rss,writeHeapSnapshot:e=>ie.writeHeapSnapshot(e),listSnapshots:()=>{try{return n.readdirSync(i).filter(e=>e.startsWith(`heap-`)&&e.endsWith(`.heapsnapshot`)).map(e=>o.join(i,e))}catch{return[]}},removeFile:e=>n.unlinkSync(e),shutdown:t,startedAtMs:e,...r}}const Y_=`CC_CANDYBAR_PARENT_PID`;function X_(e){let t=e[Y_];if(t===void 0)return{kind:`outlives-nobody`};let n=Number.parseInt(t,10);if(!Number.isInteger(n)||n<=0)throw Error(`${Y_} must be a positive integer pid, got ${JSON.stringify(t)}`);return{kind:`anchored`,pid:n}}function Z_(e){if(e.anchor.kind===`outlives-nobody`)return{disarm:()=>{}};let{pid:t}=e.anchor,n=setInterval(()=>{e.isAlive(t)||e.onOrphaned(`spawner pid ${t} gone`)},e.intervalMs??1e3);return n.unref(),{disarm:()=>clearInterval(n)}}function Q_(t){try{return e.kill(t,0),!0}catch(e){return e.code===`EPERM`}}const $_={load:()=>({}),save:()=>{},flush:()=>{}};function ev(e){let t=new Map;for(let[n,r]of Object.entries(e))t.set(n,new Map(Object.entries(r)));return t}var tv=class{sessions;storage;atom=(0,X.createAtom)(`SessionState`);constructor(e=$_,t=256){this.maxSessions=t,this.storage=e,this.sessions=new Map,this.hydrateFromStorage()}useStorage(e){this.storage=e,this.hydrateFromStorage()}hydrateFromStorage(){this.sessions=ev(this.storage.load()),this.evictOldest(),this.persist()}get(e,t){this.atom.reportObserved();let n=this.sessions.get(e);return n?(this.touch(e,n),n.get(t)??null):null}set(e,t,n){this.setBatch(e,[{key:t,value:n}])}setBatch(e,t){t.length!==0&&(0,X.runInAction)(()=>{let n=this.sessions.get(e)??new Map;for(let{key:e,value:r}of t)n.set(e,r);this.touch(e,n),this.evictOldest(),this.persist(),this.atom.reportChanged()})}clear(e,t){(0,X.runInAction)(()=>{let n=this.sessions.get(e);n&&(n.delete(t),n.size===0?this.sessions.delete(e):this.touch(e,n)),this.persist(),this.atom.reportChanged()})}prune(e){(0,X.runInAction)(()=>{for(let t of this.sessions.keys())e.has(t)||this.sessions.delete(t);this.persist(),this.atom.reportChanged()})}touch(e,t){this.sessions.delete(e),this.sessions.set(e,t)}evictOldest(){let e=this.sessions.size-this.maxSessions;if(!(e<=0)){for(let t of this.sessions.keys())if(this.sessions.delete(t),--e===0)break}}flush(){this.storage.flush()}persist(){this.storage.save(this.serialize())}serialize(){let e=Object.create(null);for(let[t,n]of this.sessions)e[t]=Object.fromEntries(n);return e}};const nv=(e,t)=>O(t);function rv(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;for(let t of Object.values(e)){if(typeof t!=`object`||!t||Array.isArray(t))return!1;for(let e of Object.values(t))if(typeof e!=`string`)return!1}return!0}var iv=class{timer=null;pending=null;constructor(e,t=500,n=nv){this.filePath=e,this.debounceMs=t,this.logger=n}load(){let e;try{e=n.readFileSync(this.filePath,`utf8`)}catch(e){let t=e.code;return t!==`ENOENT`&&this.logger(`warn`,`session-state read failed (${t}); starting empty`),{}}try{let t=JSON.parse(e);return rv(t)?t:(this.logger(`warn`,`session-state load: unexpected shape, starting empty`),{})}catch{return this.logger(`warn`,`session-state load: corrupt JSON, starting empty`),{}}}save(e){this.pending=e,!this.timer&&(this.timer=setTimeout(()=>this.flush(),this.debounceMs),this.timer.unref())}flush(){if(this.timer&&=(clearTimeout(this.timer),null),this.pending===null)return;let e=this.pending;try{n.mkdirSync(o.dirname(this.filePath),{recursive:!0});let t=`${this.filePath}.tmp`;n.writeFileSync(t,JSON.stringify(e),{mode:384}),n.chmodSync(t,384),n.renameSync(t,this.filePath),this.pending=null}catch(e){this.logger(`warn`,`session-state save failed: ${e.message}`)}}},av=class extends Error{constructor(e){super(e),this.name=`BadVerbArgs`}};function ov(e){if(!e)throw new av(`session id is required`);if(e.includes(`/`)||e.includes(`..`))throw new av(`invalid session id "${e}"`);return e}function sv(e){return cv(()=>decodeURIComponent(e))}function cv(e){try{return e()}catch(e){throw e instanceof URIError?new av(`malformed wire encoding: ${e.message}`):e}}function lv(e,t){let n=ve({bin:`/usr/bin/pbcopy`,stdinInput:e,category:`click.pbcopy`});if(!n.ok){if(n.reason===`rate-limited`){t.dlog(`warn`,`click.pbcopy rate-limited: ${n.error??``}`);return}throw Error(`pbcopy failed (${n.reason}, exit ${n.exitCode??`null`})`)}}const uv=(e,t)=>lv(sv(e),t),dv=(e,t)=>{let n=ve({bin:`/usr/bin/open`,args:[`-a`,`Visual Studio Code`,sv(e)],category:`click.open`});if(!n.ok){if(n.reason===`rate-limited`){t.dlog(`warn`,`click.open rate-limited: ${n.error??``}`);return}throw Error(`open -a "Visual Studio Code" failed (${n.reason}, exit ${n.exitCode??`null`})`)}},fv=(e,t)=>lv(sv(e),t),pv=(e,t)=>lv(sv(e),t),mv=(e,t)=>{let n=ov(sv(e));t.sessionState.get(n,`toolbar-expanded`)?t.sessionState.clear(n,`toolbar-expanded`):t.sessionState.set(n,`toolbar-expanded`,`1`)},hv=(e,t)=>{let[n=``,...r]=cv(()=>ft(e)),i=ov(n);if(r.length===0)throw new av(`set-state: <key>/<value> is required (have keys: ${v_().join(`, `)})`);if(r.length%2!=0)throw new av(`set-state: expected even-count <key>/<value> pairs, got ${r.length} segment(s) after session id (have keys: ${v_().join(`, `)})`);let a=[];for(let e=0;e<r.length;e+=2){let t=r[e],n=r[e+1];if(!t)throw new av(`set-state: empty key at pair ${e/2+1} (expected <sessionId>/<key>/<value>[/<key>/<value>...] segments)`);let i=F_(t,n);if(!i.ok)throw new av(`set-state: pair ${e/2+1}: ${i.reason}`);a.push({key:t,value:i.value})}t.sessionState.setBatch(i,a);let o=a.map(e=>`${e.key}=${e.value}`).join(` `);t.dlog(`info`,`set-state: ${o} (session=${i})`)},gv=/^-?\d+$/;function _v(e,t,n){return e>n?t:e<t?n:e}const vv=(e,t)=>{let[n=``,r=``,i=``]=cv(()=>ft(e)),a=ov(n);if(!r)throw new av(`step-state: <key> is required (shape: <sessionId>/<key>/<by>)`);if(!gv.test(i))throw new av(`step-state: delta must be an integer, got "${i}"`);let o=parseInt(i,10),s=I_(r);if(!s)throw new av(`step-state: key "${r}" is not a bounded (range) state key (have keys: ${v_().join(`, `)})`);let c=t.sessionState.get(a,r),l=c&&gv.test(c)?Math.max(s.min,Math.min(s.max,parseInt(c,10))):s.seed,u=_v(l+o,s.min,s.max),d=F_(r,String(u));if(!d.ok)throw new av(`step-state: ${d.reason}`);t.sessionState.set(a,r,d.value),t.dlog(`info`,`step-state: ${r} ${l}→${d.value} (by ${o}, session=${a})`)},yv=`config-override`,bv=new Map([[st,uv],[`load-config`,(e,t)=>{let n=e.indexOf(`/`);if(n===-1)throw new av(`load-config: expected <sessionId>/<path> (missing separator)`);let r=ov(cv(()=>decodeURIComponent(e.slice(0,n)))),i=cv(()=>decodeURIComponent(e.slice(n+1))).trim();if(i!==``){if(!i.startsWith(`/`))throw new av(`load-config: path must be absolute, got "${i}"`);if(!/\.(json5?|json)$/.test(i))throw new av(`load-config: path must end with .json5 or .json, got "${i}"`)}i===``?(t.sessionState.clear(r,yv),t.dlog(`info`,`load-config: override cleared (session=${r})`)):(t.sessionState.set(r,yv,i),t.dlog(`info`,`load-config: ${i} (session=${r})`))}],[ct,dv],[at,hv],[ot,vv],[lt,fv],[ut,pv],[`toolbar-toggle`,mv]]),xv=(e,t)=>{let n=[],r=!1,i=null;for(let{verb:a,value:o}of mt(e)){if(!i&&(a===`set-state`||a===`step-state`||a===`toolbar-toggle`)){let e=ft(o);e.length>0&&e[0]&&(i=e[0])}let e=bv.get(a);if(!e){n.push(`unknown effect verb "${a}"`);continue}try{e(o,t)}catch(e){e instanceof av||(r=!0),n.push(`${a}: ${e instanceof Error?e.message:String(e)}`)}}if(n.length>0){i&&t.sessionState.set(i,`click.error`,n.join(`
108
- `));let e=`dispatch: ${n.join(`; `)}`;throw r?Error(e):new av(e)}},Sv=new Map([...bv,[it,xv]]);Object.freeze([...Sv.keys()]);const Cv=new Set([`hook_event_name`,`session_id`,`session_name`,`transcript_path`,`cwd`,`model`,`workspace`,`version`,`output_style`,`cost`,`context_window`,`exceeds_200k_tokens`,`effort`,`thinking`,`rate_limits`,`vim`,`agent`,`worktree`]),wv=[[`session_id`,`string`],[`transcript_path`,`string`],[`cwd`,`string`],[`model`,`object`],[`model.id`,`string`],[`model.display_name`,`string`],[`workspace`,`object`],[`workspace.current_dir`,`string`],[`workspace.project_dir`,`string`]];function Tv(e){let t={missingRequired:[],typeMismatches:[],unknownTopLevelFields:[]},n=typeof e==`object`&&e&&!Array.isArray(e)?e:{};for(let[e,r]of wv){let i=Ev(n,e);if(i==null)t.missingRequired.push(e);else{let n=Array.isArray(i)?`array`:typeof i;(r===`object`?n!==`object`:n!==r)&&t.typeMismatches.push({path:e,expected:r,got:n})}}for(let e of Object.keys(n))Cv.has(e)||t.unknownTopLevelFields.push(e);return{data:e,report:t}}function Ev(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n||Array.isArray(n))return;n=n[e]}return n}function Dv(e,t){switch(e){case`vars`:return{what:e,vars:Ov(t)};case`segments`:return{what:e,segments:Mv(t)};case`config`:return{what:e,config:Fv(t)}}}function Ov(e){if(e===null)return[];let{store:t,registry:n,config:r}=e,i=Av(r),a=t.names().sort(),o=[];for(let e of a){let r=t.getNode(e),a=n.getLastError(e);o.push({name:e,source:i.get(e)??null,type:r.type,value:r.read(),lastError:a===void 0?null:{timestampMs:a.timestamp,message:a.message},ageMs:kv(r.lastUpdatedMs())})}return o}function kv(e){return e===null?null:Math.max(0,Date.now()-e)}function Av(e){let t=new Map;for(let[n,r]of Object.entries(e.variables))t.set(n,jv(r));for(let[n,r]of Object.entries(e.segments))if(r.vars)for(let[e,i]of Object.entries(r.vars))t.set(`${n}.${e}`,jv(i));return t}function jv(e){return e.kind}function Mv(e){if(e===null)return[];let{store:t,config:n,lastRenderBySegment:r}=e,i=new Set(t.names()),a=Nv(n),o=[];for(let e of a){let t=n.segments[e];t&&o.push({name:e,template:t.template,referencedVars:Pv(t.template,i),lastRender:r.get(e)??null})}return o}function Nv(e){let t=[],n=new Set;for(let r of Fn(e.root))r.kind===`segment`&&e.segments[r.name]&&!n.has(r.name)&&(t.push(r.name),n.add(r.name));for(let r of Object.keys(e.segments))n.has(r)||(t.push(r),n.add(r));return t}function Pv(e,t){let n=new Set;for(let r of gl(e)){if(t.has(r)){n.add(r);continue}let e=r.split(`.`);for(;e.length>1;){e.pop();let r=e.join(`.`);if(t.has(r)){n.add(r);break}}}return Array.from(n).sort()}function Fv(e){return e===null?null:e.config}const Iv=[`vars`,`segments`,`config`];function Lv(e){return typeof e==`string`&&Iv.includes(e)}function Rv(e){return Math.max(1,e-45)}var zv=class{thresholds={LOW:50,MEDIUM:80};getContextUsageThresholds(){return this.thresholds}ratioPercentages(e,t){let n=Math.min(100,Math.max(0,Math.round(e/t*100)));return{percentage:n,contextLeftPercentage:Math.max(0,100-n)}}calculateContextFromHookData(e){let t=e.context_window;if(!t?.current_usage)return O(`No current_usage in hook data, falling back to transcript parsing`),null;let n=t.current_usage,r=t.context_window_size,i=(n.input_tokens||0)+(n.cache_creation_input_tokens||0)+(n.cache_read_input_tokens||0);O(`Native current_usage: input=${n.input_tokens}, cache_create=${n.cache_creation_input_tokens}, cache_read=${n.cache_read_input_tokens}, total=${i} (limit: ${r})`);let a=this.ratioPercentages(i,r);return{totalTokens:i,maxTokens:r,percentage:t.used_percentage==null?a.percentage:Math.round(t.used_percentage),contextLeftPercentage:t.remaining_percentage==null?a.contextLeftPercentage:Math.round(t.remaining_percentage)}}async calculateContextTokensFromTranscript(e,t){try{O(`Calculating context tokens from transcript: ${e}`);let n=await yn(e);if(n.length===0)return O(`No entries in transcript`),Bt;let r=null;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t&&t.message?.usage?.input_tokens&&t.isSidechain!==!0){r=t,O(`Context segment: Found most recent entry at ${t.timestamp.toISOString()}, stopping search`);break}}if(r?.message?.usage){let e=r.message.usage,n=(e.input_tokens||0)+(e.cache_read_input_tokens||0)+(e.cache_creation_input_tokens||0);return O(`Most recent main chain context: ${n} tokens (limit: ${t})`),N({totalTokens:n,maxTokens:t,...this.ratioPercentages(n,t)})}return O(`No main chain entries with usage data found`),Bt}catch(e){return P(`context transcript: ${e instanceof Error?e.message:String(e)}`)}}async getContextInfo(e){let t=this.calculateContextFromHookData(e);if(t)return N(t);let n=e.context_window?.context_window_size??2e5;return this.calculateContextTokensFromTranscript(e.transcript_path,n)}};function Bv(e){let t=e.type||e.message?.role||e.message?.type,n=e.type===`user`&&e.message?.firstContentType===`tool_result`;return t===`user`&&!n}var Vv=class{calculateMessageCount(e){return e.filter(Bv).length}calculateLastResponseTime(e){if(e.length===0)return null;let t=e.slice(-20),n=null,r=null;for(let e of t){let t=e.type||e.message?.role||e.message?.type;if(Bv(e))n=e.timestamp;else if(t===`assistant`&&n){let t=(e.timestamp.getTime()-n.getTime())/1e3;t>.1&&t<300&&(r=t)}}return r}async getMetricsInfo(e,t){try{if(O(`Getting metrics from hook data for session: ${e}`),!t.cost)return Bt;let n=(await yn(t.transcript_path)).filter(e=>!e.isSidechain),r=this.calculateMessageCount(n),i=this.calculateLastResponseTime(n);return N({responseTime:t.cost.total_api_duration_ms/1e3,lastResponseTime:i,sessionDuration:t.cost.total_duration_ms/1e3,messageCount:r,linesAdded:t.cost.total_lines_added,linesRemoved:t.cost.total_lines_removed})}catch(t){return P(`metrics (${e}): ${t instanceof Error?t.message:String(t)}`)}}};const Hv=new Map;function Uv(e){if(!e)return``;let t=e.indexOf(`,`);return t<0?e:e.slice(0,t)}var Wv=class{async getSessionId(){if(!process.env.TMUX_PANE)return Bt;let e=Uv(process.env.TMUX),t=Hv.get(e);if(t!==void 0)return t;O(`Getting tmux session ID, TMUX_PANE: ${process.env.TMUX_PANE}`);let n=await _e({bin:`tmux`,args:[`display-message`,`-p`,`#S`],timeoutMs:1e3,category:`tmux`}),r=n.ok?n.stdout.trim()?N(n.stdout.trim()):Bt:P(`tmux display-message: ${n.reason}`);return Hv.set(e,r),r}isInTmux(){return!!process.env.TMUX_PANE}};function Gv(e){return e<32||e===127||e>=128&&e<=159}function Kv(e,t){let n=``;for(let t of e)n+=Gv(t.codePointAt(0)??0)?` `:t;n=n.replace(/\s+/g,` `).trim();let r=``,i=0;for(let e of n){if(i===t)return r.replace(/.$/u,`…`);r+=e,i++}return r}const qv=`\x1B[38;2;255;255;255m`,Jv=`\x1B[48;2;200;40;40m`,Yv=`\x1B[0m`,Xv=new W_;k(Xv.launchStats);const Zv=new $t({counters:Xv,logger:M}),Qv=new on({watchers:Zv,logger:M}),$v=new Nn,ey=new tv,ty=new zv,ny=new Vv,ry=new Wv,iy=new H_({gitService:Qv,sessionState:ey,watchers:Zv});function ay(){n.mkdirSync(we(),{recursive:!0}),Ee(Te()),ey.useStorage(new iv(Oe(),500,M)),e.on(`uncaughtException`,e=>{M(`error`,`uncaughtException: ${e.stack||e.message}`),vy(1)}),e.on(`unhandledRejection`,e=>{M(`error`,`unhandledRejection: ${String(e)}`),vy(1)});for(let t of[`SIGINT`,`SIGTERM`,`SIGHUP`])e.on(t,()=>{M(`info`,`received ${t}, shutting down`),vy(0)});Z_({anchor:X_(e.env),isAlive:Q_,onOrphaned:e=>{M(`info`,`parent watchdog: ${e}; shutting down`),vy(0)}}),oy(m.createServer({allowHalfOpen:!1},e=>{yy(e)}),Te(),!1)}function oy(t,n,r){t.removeAllListeners(`error`),t.once(`error`,i=>{if(i.code!==`EADDRINUSE`){M(`error`,`server error: ${i.message}`),vy(1);return}if(r){M(`info`,`lost rebind race; another daemon is alive — exiting`),e.exit(0);return}sy(t,n)}),t.listen(n,()=>uy(n))}async function sy(t,r){await ly(r)&&(M(`info`,`another daemon is listening on socket — exiting`),e.exit(0)),await ly(r)&&(M(`info`,`race: another daemon claimed the socket during recovery — exiting`),e.exit(0)),M(`warn`,`stale socket from crashed daemon — unlinking and rebinding`);try{n.unlinkSync(r)}catch(e){if(e.code!==`ENOENT`){M(`error`,`cannot unlink stale socket ${r}: ${e.message}`),vy(1);return}}oy(t,r,!0)}function cy(e){return new Promise(t=>{let n=m.connect(e),r=!1,i=null,a=e=>{r||(r=!0,i&&clearTimeout(i),n.removeAllListeners(),n.destroy(),t(e))};n.once(`connect`,()=>a(`alive`)),n.once(`error`,e=>{let t=e.code;a(t===`ECONNREFUSED`||t===`ENOENT`||t===`ENOTSOCK`?`dead`:`unknown`)}),i=setTimeout(()=>a(`unknown`),50),i.unref()})}async function ly(e){return await cy(e)!==`dead`}function uy(t){try{n.chmodSync(t,384)}catch(e){M(`warn`,`chmod socket failed: ${e.message}`)}my(),M(`info`,`daemon up: pid=${e.pid} v=3 sock=${t}`),dy(),py()}function dy(){let t=import.meta.url,r=[];t.startsWith(`file://`)&&r.push(_(t)),e.argv[1]&&r.push(e.argv[1]);let i=new Map;for(let e of r)try{i.set(e,n.statSync(e).mtimeMs)}catch{}if(i.size===0)return;let a=setInterval(()=>{for(let[e,t]of i)try{if(n.statSync(e).mtimeMs!==t){M(`info`,`binary mtime changed (${e}); shutting down`),clearInterval(a),vy(0);return}}catch(e){M(`warn`,`bin stat failed: ${e.message}`)}},6e4);a.unref()}let fy=null;function py(){fy=K_(J_(Xv.startedAt.getTime(),e=>vy(e))),fy.arm()}function my(){let t=JSON.stringify({pid:e.pid,version:3,binPath:e.argv[1],startedAt:new Date().toISOString()});try{n.writeFileSync(De(),t,{mode:384}),n.chmodSync(De(),384)}catch(e){M(`warn`,`pidfile write failed: ${e.message}`)}}function hy(){try{n.unlinkSync(De())}catch{}}let gy=0,_y=!1;function vy(t){if(!_y){_y=!0,setTimeout(()=>e.kill(e.pid,`SIGKILL`),500);try{Qv.close()}catch(e){M(`warn`,`gitService close failed: ${e.message}`)}try{$v.close()}catch(e){M(`warn`,`usageStore close failed: ${e.message}`)}try{Zv.closeAll()}catch(e){M(`warn`,`watcherRegistry close failed: ${e.message}`)}try{ey.flush()}catch(e){M(`warn`,`sessionState flush failed: ${e.message}`)}hy(),zt(),e.exit(t)}}function yy(e){gy++,Xv.inFlight=gy;let t=!1,n=(n,r)=>{if(t){r!==null&&M(`warn`,`exit-after-flush dropped: an earlier responder settled this socket`);return}t=!0;let i=r===null?void 0:()=>vy(r);try{e.end(Ne(n),i)}catch(e){M(`warn`,`response write failed: ${e.message}`),i?.()}},r=setTimeout(()=>{Xv.requestsTimedOut++,n({ok:!1,error:`request exceeded 200ms`,code:`TIMEOUT`,daemonV:3},null)},200),i=Pe(e=>{xy(e).then(e=>n(e.resp,e.exitAfterFlush)).catch(e=>{M(`error`,`handler threw: ${e?.stack||e}`),n({ok:!1,error:String(e?.message||e),code:`RENDER_FAILED`,daemonV:3},null)})},e=>{M(`warn`,`frame parse failed: ${e.message}`),n({ok:!1,error:e.message,code:`BAD_REQUEST`,daemonV:3},null)});e.on(`data`,i),e.on(`error`,e=>{M(`warn`,`socket error: ${e.message}`)}),e.on(`close`,()=>{clearTimeout(r),gy=Math.max(0,gy-1),Xv.inFlight=gy})}const by=e=>({resp:e,exitAfterFlush:null});async function xy(e){if(!e||typeof e!=`object`||typeof e.v!=`number`)return by({ok:!1,error:`malformed request`,code:`BAD_REQUEST`,daemonV:3});if(e.v!==3)return e.v>3?M(`info`,`version mismatch: client=${e.v} > daemon=3; binary likely upgraded — exiting after the response flushes`):M(`info`,`version mismatch: client=${e.v} < daemon=3; client is stale — staying up`),{resp:{ok:!1,error:`protocol v${e.v} not supported (daemon at v3)`,code:`VERSION_MISMATCH`,daemonV:3},exitAfterFlush:e.v>3?0:null};if(e.kind===`shutdown`)return{resp:{ok:!0,output:``},exitAfterFlush:0};if(e.kind===`stats`)return by({ok:!0,stats:Xv.snapshot({gitCache:Qv.getStats(),usageCache:$v.getStats(),renderCacheSize:iy.size,watchersActive:Zv.size(),nextRestartReason:fy?.describeNextRestart()??null})});if(e.kind===`render`){Xv.requestsTotal++;let t=Date.now();try{let{report:n}=Tv(e.hookData);for(let e of n.unknownTopLevelFields)M(`info`,`schema: unknown field '${e}' — Anthropic may have added it`);let r=[];for(let e of n.missingRequired)r.push(`missing required field '${e}'`);for(let{path:e,expected:t,got:i}of n.typeMismatches)r.push(`field '${e}' expected ${t}, got ${i}`);if(e.cwd===``&&r.push(`request 'cwd' is empty`),r.length>0)return Xv.requestsErrored++,M(`warn`,`BAD_REQUEST: ${r.join(`; `)}`),by({ok:!1,error:`malformed hookData: ${r.join(`; `)}`,code:`BAD_REQUEST`,daemonV:3});let i=e.hookData.workspace.project_dir,{configFile:a,unknownFlagsError:o}=wy(e.args),s=e.hookData.session_id,c=ey.get(s,`config-override`)??a,l=iy.getOrCreate(i,e.cwd,c),u=je(e.termCols),d=Rv(u??120),f={...Oy,width:d},p=``;if(l.state!==null){let t=await ru(e.hookData,My,e.cwd,l.state.neededInputPaths),n=Tg(es(ey.get(e.hookData.session_id,`theme`),l.state.config.globals.palette));f.style=as(ey.get(e.hookData.session_id,`style`),l.state.config.globals.style),p=l_(l.state.config,l.state.compiled,l.state.store,l.state.registry,t,n,f,l.state.lastRenderCellsBySegment)}let m=ey.get(e.hookData.session_id,`click.error`);m&&ey.clear(e.hookData.session_id,`click.error`);let h=[o,l.lastError,m].filter(Boolean).join(`
109
- `)||null,g=Ey(p,h,l.lastWarning),_=Date.now()-t,v=Qv.getStats(),y=$v.getStats();return M(`info`,`render sid=${e.hookData.session_id??`?`} took=${_}ms termCols=${u??`?`} width=${d} git=${v.size}/${v.hits}h/${v.misses}m usage=${y.size}/${y.hits}h/${y.misses}m err=${l.lastError?`Y`:`N`} warn=${l.lastWarning?`Y`:`N`}`),by({ok:!0,output:g+`
110
- `})}catch(e){throw Xv.requestsErrored++,e}}if(e.kind===`click`)return by(await Ny(e.verb,e.value));if(e.kind===`debug`){if(!Lv(e.what))return by({ok:!1,error:`unknown debug 'what': ${String(e.what)} (have: ${Iv.join(`, `)})`,code:`BAD_REQUEST`,daemonV:3});let t=iy.firstPopulatedState(),n=t===null?null:{store:t.store,registry:t.registry,config:t.config,compiled:t.compiled,lastRenderBySegment:e.what===`segments`?jy(t.lastRenderCellsBySegment):Ay};return by({ok:!0,debug:Dv(e.what,n)})}return by({ok:!1,error:`unknown kind`,code:`BAD_REQUEST`,daemonV:3})}const Sy=`\x1B]8;;`,Cy=`\x1B]8;;\x1B\\`;function wy(e){let{values:t,tokens:n}=v({args:e.slice(1),options:{config:{type:`string`}},strict:!1,tokens:!0,allowPositionals:!0}),r=[...new Set((n??[]).filter(e=>e.kind===`option`&&e.name!==`config`).map(e=>`--${e.name}`))],i=t.config;return{configFile:i===void 0?void 0:Ml(i),unknownFlagsError:r.length>0?`Unknown flags: ${r.join(`, `)}`:null}}function Ty(e,t,n,r){let i=pt([{verb:e,args:[t]}]),a=t.split(/\r\n|\r|\n/).map(e=>Kv(e,120)).filter(Boolean).slice(0,8);return a.length===0?``:[`${Sy}${i}\\${n}${r} ⚠ ${a[0]} ${Yv}${Cy}`,...a.slice(1).map(e=>`${Sy}${i}\\${n}${r} ${e} ${Yv}${Cy}`)].join(`
111
- `)}function Ey(e,t,n){let r=[];if(t&&r.push(Ty(lt,t,Jv,qv)),n&&r.push(Ty(ut,n,`\x1B[48;2;220;160;40m`,`\x1B[38;2;0;0;0m`)),r.length===0)return e;let i=r.join(`
112
- `);return e?`${i}\n${e}`:i}const Dy={sessionState:ey,dlog:M},Oy={style:`powerline`,colorCompatibility:`truecolor`},ky={...Oy,width:1/0},Ay=new Map;function jy(e){let t=new Map;for(let[n,r]of e)t.set(n,Sg(r,ky));return t}const My={gitProvider:Qv,usageStore:$v,contextProvider:ty,metricsProvider:ny,tmuxService:ry,sessionState:ey,log:M,clock:()=>new Date};function Ny(e,t){let n=Sv.get(e);if(!n)return{ok:!1,error:`unknown click verb: ${e}`,code:`BAD_REQUEST`,daemonV:3};try{return n(t,Dy),{ok:!0,output:``}}catch(e){let t=e instanceof av?`BAD_REQUEST`:`RENDER_FAILED`;return{ok:!1,error:String(e instanceof Error?e.message:e),code:t,daemonV:3}}}const Py={connectMs:200,budgetMs:500};async function Fy(t){let n=t.includes(`--json`),r=await Iy();if(r.kind!==`ok`&&(e.stderr.write(`daemon-stats: ${He(r)}\n`),e.exit(1)),n){e.stdout.write(JSON.stringify(r.value,null,2)+`
113
- `);return}e.stdout.write(By(r.value))}function Iy(){return Ie({kind:`stats`},Py,e=>`stats`in e?e.stats:void 0)}function Ly(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`}function Ry(e,t){let n=e+t;return n===0?`n/a`:`${(e/n*100).toFixed(1)}%`}function zy(e){return e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m${e%60}s`:`${Math.floor(e/3600)}h${Math.floor(e%3600/60)}m`}function By(e){let t=[];t.push(`cc-candybar daemon stats`),t.push(``),t.push(`process`),t.push(` pid ${e.pid}`),t.push(` version ${e.version}`),t.push(` startedAt ${e.startedAt}`),t.push(` uptime ${zy(e.uptimeSec)}`),t.push(` rss ${Ly(e.rssBytes)}`),t.push(` heapUsed ${Ly(e.heapUsedBytes)}`),t.push(` heapTotal ${Ly(e.heapTotalBytes)}`),t.push(` external ${Ly(e.externalBytes)}`),t.push(` arrayBuffers ${Ly(e.arrayBuffersBytes)}`),t.push(``),t.push(`requests`),t.push(` total ${e.requests.total}`),t.push(` errored ${e.requests.errored}`),t.push(` timedOut ${e.requests.timedOut}`),t.push(` inFlight ${e.requests.inFlight}`),t.push(``),t.push(`gitCache`),t.push(` size ${e.gitCache.size}`),t.push(` hit rate ${Ry(e.gitCache.hits,e.gitCache.misses)} (${e.gitCache.hits} / ${e.gitCache.hits+e.gitCache.misses})`),t.push(` invalidations ${e.gitCache.invalidations}`),t.push(``),t.push(`usageCache`),t.push(` size ${e.usageCache.size}`),t.push(` hit rate ${Ry(e.usageCache.hits,e.usageCache.misses)} (${e.usageCache.hits} / ${e.usageCache.hits+e.usageCache.misses})`),t.push(` sweeps ${e.usageCache.sweeps}`),t.push(``),t.push(`renderCache`),t.push(` size ${e.renderCache.size}`),t.push(`watchers`),t.push(` active ${e.watchers.active}`),t.push(` opened ${e.watchers.opened}`),t.push(` closed ${e.watchers.closed}`),t.push(` evicted ${e.watchers.evicted}`),t.push(``),t.push(`subprocesses`),t.push(` total ${e.subprocesses.total}`),t.push(` inFlight ${e.subprocesses.inFlight}`),t.push(` lastMinute ${e.subprocesses.lastMinute}`);let n=Object.entries(e.subprocesses.byCategory),r=n.reduce((e,[t])=>Math.max(e,t.length),13);for(let[i,a]of n){let n=e.subprocesses.p50DurationMs[i],o=e.subprocesses.p99DurationMs[i],s=n!==void 0&&o!==void 0?` (p50 ${n}ms · p99 ${o}ms)`:``;t.push(` ${i.padEnd(r)} ${a}${s}`)}return e.nextRestartReason&&(t.push(``),t.push(`nextRestart ${e.nextRestartReason}`)),t.join(`
107
+ `+t:t}this.refreshWatcher(e,t)}buildState(e,t){let{config:n,source:r}=Ll(t),i=Rl(n,t??`<default>`,r),a=new V_,o=new xg(a,i.globals.default_empty_value??``,this.deps.gitService,this.deps.sessionState),s,c=[];try{s=l_(i,o,{cwd:e.cwd});for(let{key:e,spec:t}of F_(i))c.push(x_(e,t))}catch(e){for(let e of c)e();throw o.dispose(),e}return{config:i,store:a,registry:o,compiled:s,neededInputPaths:eu(i),lastRenderCellsBySegment:new Map,validatorDisposers:c}}refreshWatcher(e,t){(t!==e.configFilePath||e.watcher===null)&&(e.configFilePath=t,this.rebindWatcher(e,t))}rebindWatcher(e,t){e.watcher&&=(e.watcher.release(),null);let r=Pl(e.projectDir,e.cwd,e.configFile),i=new Map;for(let e of r){let t=o.dirname(e);if(!n.existsSync(t))continue;let r=o.basename(e);i.has(t)||i.set(t,new Set),i.get(t).add(r)}let a=[...i.entries()].map(([e,t])=>({path:e,filenames:[...t]})),s=`config:${e.projectDir}:${e.cwd}:${e.configFile??``}:${t??`<none>`}`;e.watcher=this.deps.watchers.acquire(s,{files:t===null?[]:[t],dirs:a},()=>this.onConfigChanged(e))}onConfigChanged(e){M(`info`,`config change detected for entry projectDir=${e.projectDir} cwd=${e.cwd}`),this.reloadInto(e)}get size(){return this.entries.size}firstPopulatedState(){for(let e of this.entries.values())if(e.state!==null)return e.state;return null}};const W_=16384;var G_=class{startedAt=new Date;requestsTotal=0;requestsErrored=0;requestsTimedOut=0;inFlight=0;watchersOpened=0;watchersClosed=0;watchersEvicted=0;subprocessTotal=0;subprocessInFlight=0;subprocessCount=new Map;subprocessHistogram=new Map;subprocessHistogramRotator=new Map;rollingTimestamps=[];rollingHead=0;launchStats={onStart:e=>{this.subprocessTotal++,this.subprocessInFlight++,this.subprocessCount.set(e,(this.subprocessCount.get(e)??0)+1),this.recordRollingNow()},onEnd:(e,t)=>{this.subprocessInFlight=Math.max(0,this.subprocessInFlight-1),this.recordDuration(e,t)}};recordRollingNow(){let e=Date.now();if(this.rollingTimestamps.length<W_){this.rollingTimestamps.push(e);return}this.rollingTimestamps[this.rollingHead]=e,this.rollingHead=(this.rollingHead+1)%W_}recordDuration(e,t){let n=this.subprocessHistogram.get(e);if(n||(n=[],this.subprocessHistogram.set(e,n)),n.length<16){n.push(t);return}let r=(this.subprocessHistogramRotator.get(e)??0)%16;n[r]=t,this.subprocessHistogramRotator.set(e,r+1)}snapshotSubprocesses(){let e=Date.now()-6e4,t=0;for(let n of this.rollingTimestamps)n>=e&&t++;let n={};for(let[e,t]of this.subprocessCount)t>0&&(n[e]=t);let r={},i={};for(let[e,t]of this.subprocessHistogram){if(t.length===0)continue;let n=[...t].sort((e,t)=>e-t),a=Math.floor(n.length*.5),o=Math.min(n.length-1,Math.floor(n.length*.99)),s=n[a],c=n[o];s!==void 0&&(r[e]=s),c!==void 0&&(i[e]=c)}return{total:this.subprocessTotal,inFlight:this.subprocessInFlight,lastMinute:t,byCategory:n,p50DurationMs:r,p99DurationMs:i}}snapshot(e){let t=process.memoryUsage();return{pid:process.pid,version:3,startedAt:this.startedAt.toISOString(),uptimeSec:Math.floor((Date.now()-this.startedAt.getTime())/1e3),rssBytes:t.rss,heapUsedBytes:t.heapUsed,heapTotalBytes:t.heapTotal,externalBytes:t.external,arrayBuffersBytes:t.arrayBuffers,requests:{total:this.requestsTotal,errored:this.requestsErrored,timedOut:this.requestsTimedOut,inFlight:this.inFlight},gitCache:e.gitCache,usageCache:e.usageCache,renderCache:{size:e.renderCacheSize},watchers:{active:e.watchersActive,opened:this.watchersOpened,closed:this.watchersClosed,evicted:this.watchersEvicted},subprocesses:this.snapshotSubprocesses(),nextRestartReason:e.nextRestartReason??null}}};const K_=(parseInt(process.env.CC_CANDYBAR_RSS_LIMIT_MB??``,10)||512)*1024*1024;function q_(e){let t=e.rssLimitBytes??K_,n=e.snapshotsKeep??3,r=!1;function i(){if(r)return!0;let i=e.rssBytes();if(i<=t)return!1;r=!0,e.log(`warn`,`RSS ${i} > limit ${t}; writing heap snapshot then shutting down`);try{let t=new Date(e.now()).toISOString().replace(/[:.]/g,`-`),r=o.join(e.snapshotDir,`heap-${t}-${e.pid}.heapsnapshot`),i=e.writeHeapSnapshot(r);e.log(`info`,`heap snapshot written: ${i}`),J_(e.listSnapshots(),n,e.removeFile)}catch(t){e.log(`warn`,`heap snapshot failed: ${t.message}`)}return e.shutdown(0),!0}function a(){let n=e.rssBytes();return n>t*.75?`rss ${n} approaching limit ${t}`:null}function s(e=6e4){let t=setInterval(()=>{i()},e);return t.unref(),{disarm:()=>clearInterval(t)}}return{checkRss:i,describeNextRestart:a,arm:s}}function J_(e,t,n){let r=[...e].sort((e,t)=>{let n=e.slice(e.lastIndexOf(`/`)+1);return t.slice(t.lastIndexOf(`/`)+1).localeCompare(n)});for(let e of r.slice(t))try{n(e)}catch{}}function Y_(e,t,r={}){let i=we();return{now:()=>Date.now(),pid:process.pid,snapshotDir:i,log:M,rssBytes:()=>process.memoryUsage().rss,writeHeapSnapshot:e=>ie.writeHeapSnapshot(e),listSnapshots:()=>{try{return n.readdirSync(i).filter(e=>e.startsWith(`heap-`)&&e.endsWith(`.heapsnapshot`)).map(e=>o.join(i,e))}catch{return[]}},removeFile:e=>n.unlinkSync(e),shutdown:t,startedAtMs:e,...r}}const X_=`CC_CANDYBAR_PARENT_PID`;function Z_(e){let t=e[X_];if(t===void 0)return{kind:`outlives-nobody`};let n=Number.parseInt(t,10);if(!Number.isInteger(n)||n<=0)throw Error(`${X_} must be a positive integer pid, got ${JSON.stringify(t)}`);return{kind:`anchored`,pid:n}}function Q_(e){if(e.anchor.kind===`outlives-nobody`)return{disarm:()=>{}};let{pid:t}=e.anchor,n=setInterval(()=>{e.isAlive(t)||e.onOrphaned(`spawner pid ${t} gone`)},e.intervalMs??1e3);return n.unref(),{disarm:()=>clearInterval(n)}}function $_(t){try{return e.kill(t,0),!0}catch(e){return e.code===`EPERM`}}const ev={load:()=>({}),save:()=>{},flush:()=>{}};function tv(e){let t=new Map;for(let[n,r]of Object.entries(e))t.set(n,new Map(Object.entries(r)));return t}var nv=class{sessions;storage;atom=(0,X.createAtom)(`SessionState`);constructor(e=ev,t=256){this.maxSessions=t,this.storage=e,this.sessions=new Map,this.hydrateFromStorage()}useStorage(e){this.storage=e,this.hydrateFromStorage()}hydrateFromStorage(){this.sessions=tv(this.storage.load()),this.evictOldest(),this.persist()}get(e,t){this.atom.reportObserved();let n=this.sessions.get(e);return n?(this.touch(e,n),n.get(t)??null):null}set(e,t,n){this.setBatch(e,[{key:t,value:n}])}setBatch(e,t){t.length!==0&&(0,X.runInAction)(()=>{let n=this.sessions.get(e)??new Map;for(let{key:e,value:r}of t)n.set(e,r);this.touch(e,n),this.evictOldest(),this.persist(),this.atom.reportChanged()})}clear(e,t){(0,X.runInAction)(()=>{let n=this.sessions.get(e);n&&(n.delete(t),n.size===0?this.sessions.delete(e):this.touch(e,n)),this.persist(),this.atom.reportChanged()})}prune(e){(0,X.runInAction)(()=>{for(let t of this.sessions.keys())e.has(t)||this.sessions.delete(t);this.persist(),this.atom.reportChanged()})}touch(e,t){this.sessions.delete(e),this.sessions.set(e,t)}evictOldest(){let e=this.sessions.size-this.maxSessions;if(!(e<=0)){for(let t of this.sessions.keys())if(this.sessions.delete(t),--e===0)break}}flush(){this.storage.flush()}persist(){this.storage.save(this.serialize())}serialize(){let e=Object.create(null);for(let[t,n]of this.sessions)e[t]=Object.fromEntries(n);return e}};const rv=(e,t)=>O(t);function iv(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;for(let t of Object.values(e)){if(typeof t!=`object`||!t||Array.isArray(t))return!1;for(let e of Object.values(t))if(typeof e!=`string`)return!1}return!0}var av=class{timer=null;pending=null;constructor(e,t=500,n=rv){this.filePath=e,this.debounceMs=t,this.logger=n}load(){let e;try{e=n.readFileSync(this.filePath,`utf8`)}catch(e){let t=e.code;return t!==`ENOENT`&&this.logger(`warn`,`session-state read failed (${t}); starting empty`),{}}try{let t=JSON.parse(e);return iv(t)?t:(this.logger(`warn`,`session-state load: unexpected shape, starting empty`),{})}catch{return this.logger(`warn`,`session-state load: corrupt JSON, starting empty`),{}}}save(e){this.pending=e,!this.timer&&(this.timer=setTimeout(()=>this.flush(),this.debounceMs),this.timer.unref())}flush(){if(this.timer&&=(clearTimeout(this.timer),null),this.pending===null)return;let e=this.pending;try{n.mkdirSync(o.dirname(this.filePath),{recursive:!0});let t=`${this.filePath}.tmp`;n.writeFileSync(t,JSON.stringify(e),{mode:384}),n.chmodSync(t,384),n.renameSync(t,this.filePath),this.pending=null}catch(e){this.logger(`warn`,`session-state save failed: ${e.message}`)}}},ov=class extends Error{constructor(e){super(e),this.name=`BadVerbArgs`}};function sv(e){if(!e)throw new ov(`session id is required`);if(e.includes(`/`)||e.includes(`..`))throw new ov(`invalid session id "${e}"`);return e}function cv(e){return lv(()=>decodeURIComponent(e))}function lv(e){try{return e()}catch(e){throw e instanceof URIError?new ov(`malformed wire encoding: ${e.message}`):e}}function uv(e,t){let n=ve({bin:`/usr/bin/pbcopy`,stdinInput:e,category:`click.pbcopy`});if(!n.ok){if(n.reason===`rate-limited`){t.dlog(`warn`,`click.pbcopy rate-limited: ${n.error??``}`);return}throw Error(`pbcopy failed (${n.reason}, exit ${n.exitCode??`null`})`)}}const dv=(e,t)=>uv(cv(e),t),fv=(e,t)=>{let n=ve({bin:`/usr/bin/open`,args:[`-a`,`Visual Studio Code`,cv(e)],category:`click.open`});if(!n.ok){if(n.reason===`rate-limited`){t.dlog(`warn`,`click.open rate-limited: ${n.error??``}`);return}throw Error(`open -a "Visual Studio Code" failed (${n.reason}, exit ${n.exitCode??`null`})`)}},pv=(e,t)=>uv(cv(e),t),mv=(e,t)=>uv(cv(e),t),hv=(e,t)=>{let n=sv(cv(e));t.sessionState.get(n,`toolbar-expanded`)?t.sessionState.clear(n,`toolbar-expanded`):t.sessionState.set(n,`toolbar-expanded`,`1`)},gv=(e,t)=>{let[n=``,...r]=lv(()=>ft(e)),i=sv(n);if(r.length===0)throw new ov(`set-state: <key>/<value> is required (have keys: ${y_().join(`, `)})`);if(r.length%2!=0)throw new ov(`set-state: expected even-count <key>/<value> pairs, got ${r.length} segment(s) after session id (have keys: ${y_().join(`, `)})`);let a=[];for(let e=0;e<r.length;e+=2){let t=r[e],n=r[e+1];if(!t)throw new ov(`set-state: empty key at pair ${e/2+1} (expected <sessionId>/<key>/<value>[/<key>/<value>...] segments)`);let i=I_(t,n);if(!i.ok)throw new ov(`set-state: pair ${e/2+1}: ${i.reason}`);a.push({key:t,value:i.value})}t.sessionState.setBatch(i,a);let o=a.map(e=>`${e.key}=${e.value}`).join(` `);t.dlog(`info`,`set-state: ${o} (session=${i})`)},_v=/^-?\d+$/;function vv(e,t,n){return e>n?t:e<t?n:e}const yv=(e,t)=>{let[n=``,r=``,i=``]=lv(()=>ft(e)),a=sv(n);if(!r)throw new ov(`step-state: <key> is required (shape: <sessionId>/<key>/<by>)`);if(!_v.test(i))throw new ov(`step-state: delta must be an integer, got "${i}"`);let o=parseInt(i,10),s=L_(r);if(!s)throw new ov(`step-state: key "${r}" is not a bounded (range) state key (have keys: ${y_().join(`, `)})`);let c=t.sessionState.get(a,r),l=c&&_v.test(c)?Math.max(s.min,Math.min(s.max,parseInt(c,10))):s.seed,u=vv(l+o,s.min,s.max),d=I_(r,String(u));if(!d.ok)throw new ov(`step-state: ${d.reason}`);t.sessionState.set(a,r,d.value),t.dlog(`info`,`step-state: ${r} ${l}→${d.value} (by ${o}, session=${a})`)},bv=`config-override`,xv=new Map([[st,dv],[`load-config`,(e,t)=>{let n=e.indexOf(`/`);if(n===-1)throw new ov(`load-config: expected <sessionId>/<path> (missing separator)`);let r=sv(lv(()=>decodeURIComponent(e.slice(0,n)))),i=lv(()=>decodeURIComponent(e.slice(n+1))).trim();if(i!==``){if(!i.startsWith(`/`))throw new ov(`load-config: path must be absolute, got "${i}"`);if(!/\.(json5?|json)$/.test(i))throw new ov(`load-config: path must end with .json5 or .json, got "${i}"`)}i===``?(t.sessionState.clear(r,bv),t.dlog(`info`,`load-config: override cleared (session=${r})`)):(t.sessionState.set(r,bv,i),t.dlog(`info`,`load-config: ${i} (session=${r})`))}],[ct,fv],[at,gv],[ot,yv],[lt,pv],[ut,mv],[`toolbar-toggle`,hv]]),Sv=(e,t)=>{let n=[],r=!1,i=null;for(let{verb:a,value:o}of mt(e)){if(!i&&(a===`set-state`||a===`step-state`||a===`toolbar-toggle`)){let e=ft(o);e.length>0&&e[0]&&(i=e[0])}let e=xv.get(a);if(!e){n.push(`unknown effect verb "${a}"`);continue}try{e(o,t)}catch(e){e instanceof ov||(r=!0),n.push(`${a}: ${e instanceof Error?e.message:String(e)}`)}}if(n.length>0){i&&t.sessionState.set(i,`click.error`,n.join(`
108
+ `));let e=`dispatch: ${n.join(`; `)}`;throw r?Error(e):new ov(e)}},Cv=new Map([...xv,[it,Sv]]);Object.freeze([...Cv.keys()]);const wv=new Set([`hook_event_name`,`session_id`,`session_name`,`transcript_path`,`cwd`,`model`,`workspace`,`version`,`output_style`,`cost`,`context_window`,`exceeds_200k_tokens`,`effort`,`thinking`,`rate_limits`,`vim`,`agent`,`worktree`]),Tv=[[`session_id`,`string`],[`transcript_path`,`string`],[`cwd`,`string`],[`model`,`object`],[`model.id`,`string`],[`model.display_name`,`string`],[`workspace`,`object`],[`workspace.current_dir`,`string`],[`workspace.project_dir`,`string`]];function Ev(e){let t={missingRequired:[],typeMismatches:[],unknownTopLevelFields:[]},n=typeof e==`object`&&e&&!Array.isArray(e)?e:{};for(let[e,r]of Tv){let i=Dv(n,e);if(i==null)t.missingRequired.push(e);else{let n=Array.isArray(i)?`array`:typeof i;(r===`object`?n!==`object`:n!==r)&&t.typeMismatches.push({path:e,expected:r,got:n})}}for(let e of Object.keys(n))wv.has(e)||t.unknownTopLevelFields.push(e);return{data:e,report:t}}function Dv(e,t){let n=e;for(let e of t.split(`.`)){if(typeof n!=`object`||!n||Array.isArray(n))return;n=n[e]}return n}function Ov(e,t){switch(e){case`vars`:return{what:e,vars:kv(t)};case`segments`:return{what:e,segments:Nv(t)};case`config`:return{what:e,config:Iv(t)}}}function kv(e){if(e===null)return[];let{store:t,registry:n,config:r}=e,i=jv(r),a=t.names().sort(),o=[];for(let e of a){let r=t.getNode(e),a=n.getLastError(e);o.push({name:e,source:i.get(e)??null,type:r.type,value:r.read(),lastError:a===void 0?null:{timestampMs:a.timestamp,message:a.message},ageMs:Av(r.lastUpdatedMs())})}return o}function Av(e){return e===null?null:Math.max(0,Date.now()-e)}function jv(e){let t=new Map;for(let[n,r]of Object.entries(e.variables))t.set(n,Mv(r));for(let[n,r]of Object.entries(e.segments))if(r.vars)for(let[e,i]of Object.entries(r.vars))t.set(`${n}.${e}`,Mv(i));return t}function Mv(e){return e.kind}function Nv(e){if(e===null)return[];let{store:t,config:n,lastRenderBySegment:r}=e,i=new Set(t.names()),a=Pv(n),o=[];for(let e of a){let t=n.segments[e];t&&o.push({name:e,template:t.template,referencedVars:Fv(t.template,i),lastRender:r.get(e)??null})}return o}function Pv(e){let t=[],n=new Set;for(let r of Fn(e.root))r.kind===`segment`&&e.segments[r.name]&&!n.has(r.name)&&(t.push(r.name),n.add(r.name));for(let r of Object.keys(e.segments))n.has(r)||(t.push(r),n.add(r));return t}function Fv(e,t){let n=new Set;for(let r of gl(e)){if(t.has(r)){n.add(r);continue}let e=r.split(`.`);for(;e.length>1;){e.pop();let r=e.join(`.`);if(t.has(r)){n.add(r);break}}}return Array.from(n).sort()}function Iv(e){return e===null?null:e.config}const Lv=[`vars`,`segments`,`config`];function Rv(e){return typeof e==`string`&&Lv.includes(e)}function zv(e){return Math.max(1,e-2)}var Bv=class{thresholds={LOW:50,MEDIUM:80};getContextUsageThresholds(){return this.thresholds}ratioPercentages(e,t){let n=Math.min(100,Math.max(0,Math.round(e/t*100)));return{percentage:n,contextLeftPercentage:Math.max(0,100-n)}}calculateContextFromHookData(e){let t=e.context_window;if(!t?.current_usage)return O(`No current_usage in hook data, falling back to transcript parsing`),null;let n=t.current_usage,r=t.context_window_size,i=(n.input_tokens||0)+(n.cache_creation_input_tokens||0)+(n.cache_read_input_tokens||0);O(`Native current_usage: input=${n.input_tokens}, cache_create=${n.cache_creation_input_tokens}, cache_read=${n.cache_read_input_tokens}, total=${i} (limit: ${r})`);let a=this.ratioPercentages(i,r);return{totalTokens:i,maxTokens:r,percentage:t.used_percentage==null?a.percentage:Math.round(t.used_percentage),contextLeftPercentage:t.remaining_percentage==null?a.contextLeftPercentage:Math.round(t.remaining_percentage)}}async calculateContextTokensFromTranscript(e,t){try{O(`Calculating context tokens from transcript: ${e}`);let n=await yn(e);if(n.length===0)return O(`No entries in transcript`),Bt;let r=null;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t&&t.message?.usage?.input_tokens&&t.isSidechain!==!0){r=t,O(`Context segment: Found most recent entry at ${t.timestamp.toISOString()}, stopping search`);break}}if(r?.message?.usage){let e=r.message.usage,n=(e.input_tokens||0)+(e.cache_read_input_tokens||0)+(e.cache_creation_input_tokens||0);return O(`Most recent main chain context: ${n} tokens (limit: ${t})`),N({totalTokens:n,maxTokens:t,...this.ratioPercentages(n,t)})}return O(`No main chain entries with usage data found`),Bt}catch(e){return P(`context transcript: ${e instanceof Error?e.message:String(e)}`)}}async getContextInfo(e){let t=this.calculateContextFromHookData(e);if(t)return N(t);let n=e.context_window?.context_window_size??2e5;return this.calculateContextTokensFromTranscript(e.transcript_path,n)}};function Vv(e){let t=e.type||e.message?.role||e.message?.type,n=e.type===`user`&&e.message?.firstContentType===`tool_result`;return t===`user`&&!n}var Hv=class{calculateMessageCount(e){return e.filter(Vv).length}calculateLastResponseTime(e){if(e.length===0)return null;let t=e.slice(-20),n=null,r=null;for(let e of t){let t=e.type||e.message?.role||e.message?.type;if(Vv(e))n=e.timestamp;else if(t===`assistant`&&n){let t=(e.timestamp.getTime()-n.getTime())/1e3;t>.1&&t<300&&(r=t)}}return r}async getMetricsInfo(e,t){try{if(O(`Getting metrics from hook data for session: ${e}`),!t.cost)return Bt;let n=(await yn(t.transcript_path)).filter(e=>!e.isSidechain),r=this.calculateMessageCount(n),i=this.calculateLastResponseTime(n);return N({responseTime:t.cost.total_api_duration_ms/1e3,lastResponseTime:i,sessionDuration:t.cost.total_duration_ms/1e3,messageCount:r,linesAdded:t.cost.total_lines_added,linesRemoved:t.cost.total_lines_removed})}catch(t){return P(`metrics (${e}): ${t instanceof Error?t.message:String(t)}`)}}};const Uv=new Map;function Wv(e){if(!e)return``;let t=e.indexOf(`,`);return t<0?e:e.slice(0,t)}var Gv=class{async getSessionId(){if(!process.env.TMUX_PANE)return Bt;let e=Wv(process.env.TMUX),t=Uv.get(e);if(t!==void 0)return t;O(`Getting tmux session ID, TMUX_PANE: ${process.env.TMUX_PANE}`);let n=await _e({bin:`tmux`,args:[`display-message`,`-p`,`#S`],timeoutMs:1e3,category:`tmux`}),r=n.ok?n.stdout.trim()?N(n.stdout.trim()):Bt:P(`tmux display-message: ${n.reason}`);return Uv.set(e,r),r}isInTmux(){return!!process.env.TMUX_PANE}};function Kv(e){return e<32||e===127||e>=128&&e<=159}function qv(e,t){let n=``;for(let t of e)n+=Kv(t.codePointAt(0)??0)?` `:t;n=n.replace(/\s+/g,` `).trim();let r=``,i=0;for(let e of n){if(i===t)return r.replace(/.$/u,`…`);r+=e,i++}return r}const Jv=`\x1B[38;2;255;255;255m`,Yv=`\x1B[48;2;200;40;40m`,Xv=`\x1B[0m`,Zv=new G_;k(Zv.launchStats);const Qv=new $t({counters:Zv,logger:M}),$v=new on({watchers:Qv,logger:M}),ey=new Nn,ty=new nv,ny=new Bv,ry=new Hv,iy=new Gv,ay=new U_({gitService:$v,sessionState:ty,watchers:Qv});function oy(){n.mkdirSync(we(),{recursive:!0}),Ee(Te()),ty.useStorage(new av(Oe(),500,M)),e.on(`uncaughtException`,e=>{M(`error`,`uncaughtException: ${e.stack||e.message}`),yy(1)}),e.on(`unhandledRejection`,e=>{M(`error`,`unhandledRejection: ${String(e)}`),yy(1)});for(let t of[`SIGINT`,`SIGTERM`,`SIGHUP`])e.on(t,()=>{M(`info`,`received ${t}, shutting down`),yy(0)});Q_({anchor:Z_(e.env),isAlive:$_,onOrphaned:e=>{M(`info`,`parent watchdog: ${e}; shutting down`),yy(0)}}),sy(m.createServer({allowHalfOpen:!1},e=>{by(e)}),Te(),!1)}function sy(t,n,r){t.removeAllListeners(`error`),t.once(`error`,i=>{if(i.code!==`EADDRINUSE`){M(`error`,`server error: ${i.message}`),yy(1);return}if(r){M(`info`,`lost rebind race; another daemon is alive — exiting`),e.exit(0);return}cy(t,n)}),t.listen(n,()=>dy(n))}async function cy(t,r){await uy(r)&&(M(`info`,`another daemon is listening on socket — exiting`),e.exit(0)),await uy(r)&&(M(`info`,`race: another daemon claimed the socket during recovery — exiting`),e.exit(0)),M(`warn`,`stale socket from crashed daemon — unlinking and rebinding`);try{n.unlinkSync(r)}catch(e){if(e.code!==`ENOENT`){M(`error`,`cannot unlink stale socket ${r}: ${e.message}`),yy(1);return}}sy(t,r,!0)}function ly(e){return new Promise(t=>{let n=m.connect(e),r=!1,i=null,a=e=>{r||(r=!0,i&&clearTimeout(i),n.removeAllListeners(),n.destroy(),t(e))};n.once(`connect`,()=>a(`alive`)),n.once(`error`,e=>{let t=e.code;a(t===`ECONNREFUSED`||t===`ENOENT`||t===`ENOTSOCK`?`dead`:`unknown`)}),i=setTimeout(()=>a(`unknown`),50),i.unref()})}async function uy(e){return await ly(e)!==`dead`}function dy(t){try{n.chmodSync(t,384)}catch(e){M(`warn`,`chmod socket failed: ${e.message}`)}hy(),M(`info`,`daemon up: pid=${e.pid} v=3 sock=${t}`),fy(),my()}function fy(){let t=import.meta.url,r=[];t.startsWith(`file://`)&&r.push(_(t)),e.argv[1]&&r.push(e.argv[1]);let i=new Map;for(let e of r)try{i.set(e,n.statSync(e).mtimeMs)}catch{}if(i.size===0)return;let a=setInterval(()=>{for(let[e,t]of i)try{if(n.statSync(e).mtimeMs!==t){M(`info`,`binary mtime changed (${e}); shutting down`),clearInterval(a),yy(0);return}}catch(e){M(`warn`,`bin stat failed: ${e.message}`)}},6e4);a.unref()}let py=null;function my(){py=q_(Y_(Zv.startedAt.getTime(),e=>yy(e))),py.arm()}function hy(){let t=JSON.stringify({pid:e.pid,version:3,binPath:e.argv[1],startedAt:new Date().toISOString()});try{n.writeFileSync(De(),t,{mode:384}),n.chmodSync(De(),384)}catch(e){M(`warn`,`pidfile write failed: ${e.message}`)}}function gy(){try{n.unlinkSync(De())}catch{}}let _y=0,vy=!1;function yy(t){if(!vy){vy=!0,setTimeout(()=>e.kill(e.pid,`SIGKILL`),500);try{$v.close()}catch(e){M(`warn`,`gitService close failed: ${e.message}`)}try{ey.close()}catch(e){M(`warn`,`usageStore close failed: ${e.message}`)}try{Qv.closeAll()}catch(e){M(`warn`,`watcherRegistry close failed: ${e.message}`)}try{ty.flush()}catch(e){M(`warn`,`sessionState flush failed: ${e.message}`)}gy(),zt(),e.exit(t)}}function by(e){_y++,Zv.inFlight=_y;let t=!1,n=(n,r)=>{if(t){r!==null&&M(`warn`,`exit-after-flush dropped: an earlier responder settled this socket`);return}t=!0;let i=r===null?void 0:()=>yy(r);try{e.end(Ne(n),i)}catch(e){M(`warn`,`response write failed: ${e.message}`),i?.()}},r=setTimeout(()=>{Zv.requestsTimedOut++,n({ok:!1,error:`request exceeded 200ms`,code:`TIMEOUT`,daemonV:3},null)},200),i=Pe(e=>{Sy(e).then(e=>n(e.resp,e.exitAfterFlush)).catch(e=>{M(`error`,`handler threw: ${e?.stack||e}`),n({ok:!1,error:String(e?.message||e),code:`RENDER_FAILED`,daemonV:3},null)})},e=>{M(`warn`,`frame parse failed: ${e.message}`),n({ok:!1,error:e.message,code:`BAD_REQUEST`,daemonV:3},null)});e.on(`data`,i),e.on(`error`,e=>{M(`warn`,`socket error: ${e.message}`)}),e.on(`close`,()=>{clearTimeout(r),_y=Math.max(0,_y-1),Zv.inFlight=_y})}const xy=e=>({resp:e,exitAfterFlush:null});async function Sy(e){if(!e||typeof e!=`object`||typeof e.v!=`number`)return xy({ok:!1,error:`malformed request`,code:`BAD_REQUEST`,daemonV:3});if(e.v!==3)return e.v>3?M(`info`,`version mismatch: client=${e.v} > daemon=3; binary likely upgraded — exiting after the response flushes`):M(`info`,`version mismatch: client=${e.v} < daemon=3; client is stale — staying up`),{resp:{ok:!1,error:`protocol v${e.v} not supported (daemon at v3)`,code:`VERSION_MISMATCH`,daemonV:3},exitAfterFlush:e.v>3?0:null};if(e.kind===`shutdown`)return{resp:{ok:!0,output:``},exitAfterFlush:0};if(e.kind===`stats`)return xy({ok:!0,stats:Zv.snapshot({gitCache:$v.getStats(),usageCache:ey.getStats(),renderCacheSize:ay.size,watchersActive:Qv.size(),nextRestartReason:py?.describeNextRestart()??null})});if(e.kind===`render`){Zv.requestsTotal++;let t=Date.now();try{let{report:n}=Ev(e.hookData);for(let e of n.unknownTopLevelFields)M(`info`,`schema: unknown field '${e}' — Anthropic may have added it`);let r=[];for(let e of n.missingRequired)r.push(`missing required field '${e}'`);for(let{path:e,expected:t,got:i}of n.typeMismatches)r.push(`field '${e}' expected ${t}, got ${i}`);if(e.cwd===``&&r.push(`request 'cwd' is empty`),r.length>0)return Zv.requestsErrored++,M(`warn`,`BAD_REQUEST: ${r.join(`; `)}`),xy({ok:!1,error:`malformed hookData: ${r.join(`; `)}`,code:`BAD_REQUEST`,daemonV:3});let i=e.hookData.workspace.project_dir,{configFile:a,unknownFlagsError:o}=Ty(e.args),s=e.hookData.session_id,c=ty.get(s,`config-override`)??a,l=ay.getOrCreate(i,e.cwd,c),u=je(e.termCols),d=zv(u??120),f={...ky,width:d},p=``;if(l.state!==null){let t=await iu(e.hookData,Ny,e.cwd,l.state.neededInputPaths),n=Eg(es(ty.get(e.hookData.session_id,`theme`),l.state.config.globals.palette));f.style=as(ty.get(e.hookData.session_id,`style`),l.state.config.globals.style),p=u_(l.state.config,l.state.compiled,l.state.store,l.state.registry,t,n,f,l.state.lastRenderCellsBySegment)}let m=ty.get(e.hookData.session_id,`click.error`);m&&ty.clear(e.hookData.session_id,`click.error`);let h=[o,l.lastError,m].filter(Boolean).join(`
109
+ `)||null,g=Dy(p,h,l.lastWarning),_=Date.now()-t,v=$v.getStats(),y=ey.getStats();return M(`info`,`render sid=${e.hookData.session_id??`?`} took=${_}ms termCols=${u??`?`} width=${d} git=${v.size}/${v.hits}h/${v.misses}m usage=${y.size}/${y.hits}h/${y.misses}m err=${l.lastError?`Y`:`N`} warn=${l.lastWarning?`Y`:`N`}`),xy({ok:!0,output:g+`
110
+ `})}catch(e){throw Zv.requestsErrored++,e}}if(e.kind===`click`)return xy(await Py(e.verb,e.value));if(e.kind===`debug`){if(!Rv(e.what))return xy({ok:!1,error:`unknown debug 'what': ${String(e.what)} (have: ${Lv.join(`, `)})`,code:`BAD_REQUEST`,daemonV:3});let t=ay.firstPopulatedState(),n=t===null?null:{store:t.store,registry:t.registry,config:t.config,compiled:t.compiled,lastRenderBySegment:e.what===`segments`?My(t.lastRenderCellsBySegment):jy};return xy({ok:!0,debug:Ov(e.what,n)})}return xy({ok:!1,error:`unknown kind`,code:`BAD_REQUEST`,daemonV:3})}const Cy=`\x1B]8;;`,wy=`\x1B]8;;\x1B\\`;function Ty(e){let{values:t,tokens:n}=v({args:e.slice(1),options:{config:{type:`string`}},strict:!1,tokens:!0,allowPositionals:!0}),r=[...new Set((n??[]).filter(e=>e.kind===`option`&&e.name!==`config`).map(e=>`--${e.name}`))],i=t.config;return{configFile:i===void 0?void 0:Nl(i),unknownFlagsError:r.length>0?`Unknown flags: ${r.join(`, `)}`:null}}function Ey(e,t,n,r){let i=pt([{verb:e,args:[t]}]),a=t.split(/\r\n|\r|\n/).map(e=>qv(e,120)).filter(Boolean).slice(0,8);return a.length===0?``:[`${Cy}${i}\\${n}${r} ⚠ ${a[0]} ${Xv}${wy}`,...a.slice(1).map(e=>`${Cy}${i}\\${n}${r} ${e} ${Xv}${wy}`)].join(`
111
+ `)}function Dy(e,t,n){let r=[];if(t&&r.push(Ey(lt,t,Yv,Jv)),n&&r.push(Ey(ut,n,`\x1B[48;2;220;160;40m`,`\x1B[38;2;0;0;0m`)),r.length===0)return e;let i=r.join(`
112
+ `);return e?`${i}\n${e}`:i}const Oy={sessionState:ty,dlog:M},ky={style:`powerline`,colorCompatibility:`truecolor`},Ay={...ky,width:1/0},jy=new Map;function My(e){let t=new Map;for(let[n,r]of e)t.set(n,Cg(r,Ay));return t}const Ny={gitProvider:$v,usageStore:ey,contextProvider:ny,metricsProvider:ry,tmuxService:iy,sessionState:ty,log:M,clock:()=>new Date};function Py(e,t){let n=Cv.get(e);if(!n)return{ok:!1,error:`unknown click verb: ${e}`,code:`BAD_REQUEST`,daemonV:3};try{return n(t,Oy),{ok:!0,output:``}}catch(e){let t=e instanceof ov?`BAD_REQUEST`:`RENDER_FAILED`;return{ok:!1,error:String(e instanceof Error?e.message:e),code:t,daemonV:3}}}const Fy={connectMs:200,budgetMs:500};async function Iy(t){let n=t.includes(`--json`),r=await Ly();if(r.kind!==`ok`&&(e.stderr.write(`daemon-stats: ${He(r)}\n`),e.exit(1)),n){e.stdout.write(JSON.stringify(r.value,null,2)+`
113
+ `);return}e.stdout.write(Vy(r.value))}function Ly(){return Ie({kind:`stats`},Fy,e=>`stats`in e?e.stats:void 0)}function Ry(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/1024/1024).toFixed(1)}MB`}function zy(e,t){let n=e+t;return n===0?`n/a`:`${(e/n*100).toFixed(1)}%`}function By(e){return e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m${e%60}s`:`${Math.floor(e/3600)}h${Math.floor(e%3600/60)}m`}function Vy(e){let t=[];t.push(`cc-candybar daemon stats`),t.push(``),t.push(`process`),t.push(` pid ${e.pid}`),t.push(` version ${e.version}`),t.push(` startedAt ${e.startedAt}`),t.push(` uptime ${By(e.uptimeSec)}`),t.push(` rss ${Ry(e.rssBytes)}`),t.push(` heapUsed ${Ry(e.heapUsedBytes)}`),t.push(` heapTotal ${Ry(e.heapTotalBytes)}`),t.push(` external ${Ry(e.externalBytes)}`),t.push(` arrayBuffers ${Ry(e.arrayBuffersBytes)}`),t.push(``),t.push(`requests`),t.push(` total ${e.requests.total}`),t.push(` errored ${e.requests.errored}`),t.push(` timedOut ${e.requests.timedOut}`),t.push(` inFlight ${e.requests.inFlight}`),t.push(``),t.push(`gitCache`),t.push(` size ${e.gitCache.size}`),t.push(` hit rate ${zy(e.gitCache.hits,e.gitCache.misses)} (${e.gitCache.hits} / ${e.gitCache.hits+e.gitCache.misses})`),t.push(` invalidations ${e.gitCache.invalidations}`),t.push(``),t.push(`usageCache`),t.push(` size ${e.usageCache.size}`),t.push(` hit rate ${zy(e.usageCache.hits,e.usageCache.misses)} (${e.usageCache.hits} / ${e.usageCache.hits+e.usageCache.misses})`),t.push(` sweeps ${e.usageCache.sweeps}`),t.push(``),t.push(`renderCache`),t.push(` size ${e.renderCache.size}`),t.push(`watchers`),t.push(` active ${e.watchers.active}`),t.push(` opened ${e.watchers.opened}`),t.push(` closed ${e.watchers.closed}`),t.push(` evicted ${e.watchers.evicted}`),t.push(``),t.push(`subprocesses`),t.push(` total ${e.subprocesses.total}`),t.push(` inFlight ${e.subprocesses.inFlight}`),t.push(` lastMinute ${e.subprocesses.lastMinute}`);let n=Object.entries(e.subprocesses.byCategory),r=n.reduce((e,[t])=>Math.max(e,t.length),13);for(let[i,a]of n){let n=e.subprocesses.p50DurationMs[i],o=e.subprocesses.p99DurationMs[i],s=n!==void 0&&o!==void 0?` (p50 ${n}ms · p99 ${o}ms)`:``;t.push(` ${i.padEnd(r)} ${a}${s}`)}return e.nextRestartReason&&(t.push(``),t.push(`nextRestart ${e.nextRestartReason}`)),t.join(`
114
114
  `)+`
115
- `}const Vy={connectMs:200,budgetMs:500};async function Hy(t,n){let r=n.includes(`--json`),i=await Uy(t);if(i.kind!==`ok`&&(e.stderr.write(`${t}: ${He(i)}\n`),e.exit(1)),r){e.stdout.write(JSON.stringify(i.value,null,2)+`
116
- `);return}e.stdout.write(Wy(i.value))}function Uy(e){return Ie({kind:`debug`,what:e},Vy,e=>`debug`in e?e.debug:void 0)}function Wy(e){switch(e.what){case`vars`:return Gy(e.vars);case`segments`:return Ky(e.segments);case`config`:return qy(e.config);default:return e}}function Gy(e){if(e.length===0)return`no variables (DSL not active)
117
- `;let t=[`variables (${e.length})`,``],n=e.reduce((e,t)=>Math.max(e,t.name.length),4),r=e.reduce((e,t)=>Math.max(e,(t.source??`—`).length),6);for(let i of e){let e=i.ageMs===null?``:` ${Yy(i.ageMs)}`,a=i.lastError?` ✗ ${i.lastError.message}`:``;t.push(` ${i.name.padEnd(n)} ${(i.source??`—`).padEnd(r)} ${i.type.padEnd(7)} ${Jy(i.value)}${e}${a}`)}return t.join(`
115
+ `}const Hy={connectMs:200,budgetMs:500};async function Uy(t,n){let r=n.includes(`--json`),i=await Wy(t);if(i.kind!==`ok`&&(e.stderr.write(`${t}: ${He(i)}\n`),e.exit(1)),r){e.stdout.write(JSON.stringify(i.value,null,2)+`
116
+ `);return}e.stdout.write(Gy(i.value))}function Wy(e){return Ie({kind:`debug`,what:e},Hy,e=>`debug`in e?e.debug:void 0)}function Gy(e){switch(e.what){case`vars`:return Ky(e.vars);case`segments`:return qy(e.segments);case`config`:return Jy(e.config);default:return e}}function Ky(e){if(e.length===0)return`no variables (DSL not active)
117
+ `;let t=[`variables (${e.length})`,``],n=e.reduce((e,t)=>Math.max(e,t.name.length),4),r=e.reduce((e,t)=>Math.max(e,(t.source??`—`).length),6);for(let i of e){let e=i.ageMs===null?``:` ${Xy(i.ageMs)}`,a=i.lastError?` ✗ ${i.lastError.message}`:``;t.push(` ${i.name.padEnd(n)} ${(i.source??`—`).padEnd(r)} ${i.type.padEnd(7)} ${Yy(i.value)}${e}${a}`)}return t.join(`
118
118
  `)+`
119
- `}function Ky(e){if(e.length===0)return`no segments (DSL not active)
119
+ `}function qy(e){if(e.length===0)return`no segments (DSL not active)
120
120
  `;let t=[`segments (${e.length})`,``];for(let n of e)t.push(` ${n.name}`),t.push(` template ${n.template}`),n.referencedVars.length>0&&t.push(` vars ${n.referencedVars.join(`, `)}`),n.lastRender!==null&&t.push(` last ${n.lastRender}`);return t.join(`
121
121
  `)+`
122
- `}function qy(e){return e===null?`config: DSL not active
122
+ `}function Jy(e){return e===null?`config: DSL not active
123
123
  `:JSON.stringify(e,null,2)+`
124
- `}function Jy(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>60?t.slice(0,57)+`…`:t}function Yy(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m`}function Xy(e){let t=o.resolve(e),r;try{r=n.readFileSync(t,`utf-8`)}catch(t){return{kind:`unreadable`,path:e,message:t instanceof Error?t.message:String(t)}}try{let{config:e}=Il(t);Ll(e,t,r)}catch(e){if(e instanceof os)return{kind:`invalid`,message:e.message};throw e}return{kind:`valid`,path:e}}function Zy(t){let n=t[0];(n===void 0||n===``)&&(e.stderr.write(`lint: missing <path>
124
+ `}function Yy(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>60?t.slice(0,57)+`…`:t}function Xy(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m`}function Zy(e){let t=o.resolve(e),r;try{r=n.readFileSync(t,`utf-8`)}catch(t){return{kind:`unreadable`,path:e,message:t instanceof Error?t.message:String(t)}}try{let{config:e}=Ll(t);Rl(e,t,r)}catch(e){if(e instanceof os)return{kind:`invalid`,message:e.message};throw e}return{kind:`valid`,path:e}}function Qy(t){let n=t[0];(n===void 0||n===``)&&(e.stderr.write(`lint: missing <path>
125
125
  Usage: cc-candybar lint <config-file>
126
- `),e.exit(2)),$y(Xy(n))}function Qy(t){switch(t.kind){case`valid`:return{stream:e.stdout,text:`✓ ${t.path}: config valid\n`,code:0};case`invalid`:return{stream:e.stderr,text:t.message+`
127
- `,code:1};case`unreadable`:return{stream:e.stderr,text:`lint: cannot read ${t.path}: ${t.message}\n`,code:2}}}function $y(t){let n=Qy(t);n.stream.write(n.text),e.exit(n.code)}function eb(){let e=nb();return e===null?null:n.readFileSync(e,`utf-8`)}function tb(){let t=eb();t===null&&(e.stderr.write("schema: bundled schema not found (expected schema/cc-candybar.schema.json). Run `pnpm gen:schema` from a source checkout.\n"),e.exit(2)),e.stdout.write(t),e.exit(0)}function nb(){let t=o.join(`schema`,`cc-candybar.schema.json`),r=e.argv[1];if(r===void 0)return null;let i=o.dirname(o.resolve(r));for(;;){let e=o.join(i,t);if(n.existsSync(e))return e;let r=o.dirname(i);if(r===i)return null;i=r}}const rb=`${Jv}${qv}`;function ib(e){return`${rb}⚠ cc-candybar: ${ab(e)}${Yv}\n`}function ab(e){switch(e.cause){case`version_mismatch`:{let t=e.daemonV===0?`unknown`:`v${e.daemonV}`;return`protocol mismatch (client v${e.clientV} ≠ daemon ${t})`}case`bad_request`:return`daemon rejected request: ${Kv(e.message,60)}`;case`render_failed`:return`render failed: ${Kv(e.message,60)}`;case`malformed_response`:return`malformed daemon response: ${Kv(e.message,60)}`}}function ob(e){switch(e.kind){case`ok`:return{output:e.value,kick:!1,debug:null};case`transient`:return{output:`
128
- `,kick:!0,debug:`daemon unavailable (transient: ${e.cause}: ${e.message}) — kicking daemon`};case`permanent`:return{output:ib(e),kick:!1,debug:`daemon refused request (permanent: ${e.cause}) — not kicking`}}}function sb(){let t=e.env.COLUMNS;if(t){let e=parseInt(t,10);if(!isNaN(e)&&e>0)return e}let n=e.stderr.columns;if(n&&n>0)return n}function cb(){console.log(`
126
+ `),e.exit(2)),eb(Zy(n))}function $y(t){switch(t.kind){case`valid`:return{stream:e.stdout,text:`✓ ${t.path}: config valid\n`,code:0};case`invalid`:return{stream:e.stderr,text:t.message+`
127
+ `,code:1};case`unreadable`:return{stream:e.stderr,text:`lint: cannot read ${t.path}: ${t.message}\n`,code:2}}}function eb(t){let n=$y(t);n.stream.write(n.text),e.exit(n.code)}function tb(){let e=rb();return e===null?null:n.readFileSync(e,`utf-8`)}function nb(){let t=tb();t===null&&(e.stderr.write("schema: bundled schema not found (expected schema/cc-candybar.schema.json). Run `pnpm gen:schema` from a source checkout.\n"),e.exit(2)),e.stdout.write(t),e.exit(0)}function rb(){let t=o.join(`schema`,`cc-candybar.schema.json`),r=e.argv[1];if(r===void 0)return null;let i=o.dirname(o.resolve(r));for(;;){let e=o.join(i,t);if(n.existsSync(e))return e;let r=o.dirname(i);if(r===i)return null;i=r}}const ib=`${Yv}${Jv}`;function ab(e){return`${ib}⚠ cc-candybar: ${ob(e)}${Xv}\n`}function ob(e){switch(e.cause){case`version_mismatch`:{let t=e.daemonV===0?`unknown`:`v${e.daemonV}`;return`protocol mismatch (client v${e.clientV} ≠ daemon ${t})`}case`bad_request`:return`daemon rejected request: ${qv(e.message,60)}`;case`render_failed`:return`render failed: ${qv(e.message,60)}`;case`malformed_response`:return`malformed daemon response: ${qv(e.message,60)}`}}function sb(e){switch(e.kind){case`ok`:return{output:e.value,kick:!1,debug:null};case`transient`:return{output:`
128
+ `,kick:!0,debug:`daemon unavailable (transient: ${e.cause}: ${e.message}) — kicking daemon`};case`permanent`:return{output:ab(e),kick:!1,debug:`daemon refused request (permanent: ${e.cause}) — not kicking`}}}function cb(){let t=e.env.COLUMNS;if(t){let e=parseInt(t,10);if(!isNaN(e)&&e>0)return e}let n=e.stderr.columns;if(n&&n>0)return n}function lb(){console.log(`
129
129
  cc-candybar - Beautiful powerline statusline for Claude Code
130
130
 
131
131
  Usage: cc-candybar [options]
@@ -166,7 +166,7 @@ Config tooling:
166
166
  config [--json] The effective merged config. (All three query the
167
167
  running daemon; none spawn one.)
168
168
 
169
- `)}async function lb(){try{(e.argv.includes(`--help`)||e.argv.includes(`-h`))&&(cb(),e.exit(0));let n=e.argv[2];if(n===`install`&&(Pt(e.argv.slice(3)),e.exit(0)),n===`install-url-handler`&&(At(),e.exit(0)),n===`url-handle`){await Mt(e.argv[3]);return}if(n===`daemon`){ay();return}if(n===`daemon-stats`&&(await Fy(e.argv.slice(3)),e.exit(0)),n===`lint`){Zy(e.argv.slice(3));return}if(n===`schema`){tb();return}Lv(n)&&(await Hy(n,e.argv.slice(3)),e.exit(0)),e.stdin.isTTY===!0&&(console.error(`Error: This tool requires input from Claude Code
169
+ `)}async function ub(){try{(e.argv.includes(`--help`)||e.argv.includes(`-h`))&&(lb(),e.exit(0));let n=e.argv[2];if(n===`install`&&(Pt(e.argv.slice(3)),e.exit(0)),n===`install-url-handler`&&(At(),e.exit(0)),n===`url-handle`){await Mt(e.argv[3]);return}if(n===`daemon`){oy();return}if(n===`daemon-stats`&&(await Iy(e.argv.slice(3)),e.exit(0)),n===`lint`){Qy(e.argv.slice(3));return}if(n===`schema`){nb();return}Rv(n)&&(await Uy(n,e.argv.slice(3)),e.exit(0)),e.stdin.isTTY===!0&&(console.error(`Error: This tool requires input from Claude Code
170
170
 
171
171
  cc-candybar is designed to be used as a Claude Code statusLine command.
172
172
  It reads hook data from stdin and outputs formatted statusline.
@@ -182,4 +182,4 @@ Add to ~/.claude/settings.json:
182
182
  Run with --help for more options.
183
183
 
184
184
  To test output manually:
185
- echo '{"session_id":"test-session","workspace":{"project_dir":"/path/to/project"},"model":{"id":"claude-sonnet-4-5","display_name":"Claude"}}' | cc-candybar --style=powerline`),e.exit(1)),O(`Working directory: ${e.cwd()}`),O(`Process args:`,e.argv);let r=await t(e.stdin);O(`Received hook data:`,JSON.stringify(r,null,2)),r||(console.error(`Error: No input data received from stdin`),cb(),e.exit(1));let i=ob(await Ke(r,e.argv,e.cwd(),sb()));i.debug!==null&&O(i.debug),i.kick&&Je(),e.stdout.write(i.output),e.exit(0)}catch(t){let n=t instanceof Error?t.message:String(t);console.error(`Error generating statusline:`,n),e.exit(1)}}lb();export{};
185
+ echo '{"session_id":"test-session","workspace":{"project_dir":"/path/to/project"},"model":{"id":"claude-sonnet-4-5","display_name":"Claude"}}' | cc-candybar --style=powerline`),e.exit(1)),O(`Working directory: ${e.cwd()}`),O(`Process args:`,e.argv);let r=await t(e.stdin);O(`Received hook data:`,JSON.stringify(r,null,2)),r||(console.error(`Error: No input data received from stdin`),lb(),e.exit(1));let i=sb(await Ke(r,e.argv,e.cwd(),cb()));i.debug!==null&&O(i.debug),i.kick&&Je(),e.stdout.write(i.output),e.exit(0)}catch(t){let n=t instanceof Error?t.message:String(t);console.error(`Error generating statusline:`,n),e.exit(1)}}ub();export{};