From 45b861bc6b48953573f41475d30d7d242e35a9b3 Mon Sep 17 00:00:00 2001 From: SecureCloudGroup Date: Tue, 13 Oct 2026 10:39:18 -0400 Subject: [PATCH] build(deps-dev): bump the web group in /web with 5 updates, with the bundle rebuilt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit jsdom 30.1.1 → 30.1.2, lucide 1.49.0 → 1.53.0, marked 18.0.14 → 18.1.0, svelte 5.57.1 → 5.57.2, vite 8.3.2 → 8.3.4 (the same bumps as dependabot #504, whose web leg fails only because the committed bundle was not rebuilt: package-lock.json is a build-version input). svelte-check 0 / 0, vitest 644, bundle rebuilt with Node 22. --- .../web/_app/immutable/chunks/BChu7Pos.js | 3 + .../web/_app/immutable/chunks/BJLLtWYH.js | 3 - .../chunks/{CEPrmzat.js => Be3BkmPa.js} | 2 +- .../web/_app/immutable/chunks/BkiVJrb-.js | 1 + .../chunks/{1gl_kuJz.js => Bmlx8Ynu.js} | 2 +- .../web/_app/immutable/chunks/BxvjB08B.js | 1 - .../web/_app/immutable/chunks/CDAAYzUu.js | 1 + .../chunks/{CLNxzSSl.js => CJLE_wpt.js} | 2 +- .../chunks/{uFPkKLC1.js => CcVP_dcS.js} | 2 +- .../chunks/{tlN4Hcij.js => CeaAcbO3.js} | 2 +- .../chunks/{BtjCS6Y-.js => ChxMyhtI.js} | 2 +- .../web/_app/immutable/chunks/Cmegxfzj.js | 1 - .../web/_app/immutable/chunks/CoHYJ8BJ.js | 1 - .../chunks/{eN4Uq1pt.js => CwN7cGO4.js} | 2 +- .../web/_app/immutable/chunks/Czex3Sq4.js | 1 + .../web/_app/immutable/chunks/DETRq8nR.js | 1 + .../chunks/{BqUz5g-m.js => DQSrham4.js} | 2 +- .../chunks/{DKVRJME0.js => Di_L0eC6.js} | 2 +- .../chunks/{y2R953fa.js => DpD1lG2E.js} | 2 +- .../chunks/{kqW19h2g.js => UDuC8ICI.js} | 2 +- .../chunks/{CwtHPkdz.js => aIySO2My.js} | 2 +- .../web/_app/immutable/chunks/iVEGnMVT.js | 1 - .../chunks/{DV4tMnTy.js => itGxqfLQ.js} | 2 +- .../chunks/{DNdCTZZL.js => x-QSRA-u.js} | 2 +- .../web/_app/immutable/entry/app.C6nqrMm7.js | 2 + .../web/_app/immutable/entry/app.DIDA9xot.js | 2 - .../_app/immutable/entry/start.BbFbPWF3.js | 1 - .../_app/immutable/entry/start.TSJdo2Gi.js | 1 + .../nodes/{0.BC5_jvAz.js => 0.CAue6YlT.js} | 4 +- .../nodes/{1.CS-bGd13.js => 1.C7xJmJkE.js} | 2 +- .../web/_app/immutable/nodes/10.BoqtT515.js | 17 + .../web/_app/immutable/nodes/10.D2sVRYwK.js | 17 - .../nodes/{11.BQRO1JQZ.js => 11.SjX2dPtJ.js} | 2 +- .../nodes/{12.Dbly5ARM.js => 12.Cyl0pmDa.js} | 2 +- .../nodes/{13.wu6k-MKp.js => 13.Dk_SvHe1.js} | 2 +- .../nodes/{14.eFvvfdPp.js => 14.Dyt9LzQr.js} | 2 +- .../web/_app/immutable/nodes/15.BPdwRx9u.js | 1 - .../web/_app/immutable/nodes/15.CjnZ9tWk.js | 1 + .../web/_app/immutable/nodes/16.Djk9HcUS.js | 7 - .../web/_app/immutable/nodes/16.DuGhVinj.js | 7 + .../nodes/{17.CgukqYQt.js => 17.7MLgDNjt.js} | 4 +- .../nodes/{18.COwa8j3Q.js => 18.CZM1LVRi.js} | 2 +- .../nodes/{19.qPht_xNT.js => 19.Dn0rUkG4.js} | 2 +- .../nodes/{2.CiKgDIBB.js => 2.CBI0cuH1.js} | 2 +- .../nodes/{20.CcKNEGJ_.js => 20.DaQdc7Ir.js} | 2 +- .../nodes/{21.DHbFPEDf.js => 21.CJha6Vtp.js} | 4 +- .../nodes/{22.BfzGGdQN.js => 22.DueoGgfK.js} | 2 +- .../nodes/{23.BiQaWPwb.js => 23.BWQAnoZQ.js} | 2 +- .../nodes/{24.Denbgw47.js => 24.5tRnvpAR.js} | 2 +- .../nodes/{25.wN3Z1f3V.js => 25.a4i0kQk5.js} | 4 +- .../nodes/{26.BQ1Crg-Z.js => 26.Cws4L5Up.js} | 4 +- .../nodes/{27.CsA0vwdY.js => 27.dnMaooFk.js} | 2 +- .../nodes/{28.DEhKyuoz.js => 28.7m_3q5mX.js} | 4 +- .../nodes/{3.4LzSyiDB.js => 3.hrXXucw2.js} | 2 +- .../nodes/{4.BTxIooNG.js => 4.DwKXVaGA.js} | 2 +- .../nodes/{5.aXnt5v4U.js => 5.Cyfd-xHo.js} | 24 +- .../nodes/{6.C0SuaYab.js => 6.CqMhcdx_.js} | 4 +- .../nodes/{7.Dd3hmGbD.js => 7.rC1CBLEA.js} | 2 +- .../nodes/{8.CE6Gc_e3.js => 8.DlXaiCiv.js} | 2 +- .../nodes/{9.BeNo-nGH.js => 9.CAioKP6J.js} | 4 +- app/smartbrain_3000/web/_app/version.json | 2 +- app/smartbrain_3000/web/index.html | 42 +-- app/smartbrain_3000/web/service-worker.js | 2 +- web/package-lock.json | 339 +++++++++--------- web/package.json | 10 +- 65 files changed, 284 insertions(+), 299 deletions(-) create mode 100644 app/smartbrain_3000/web/_app/immutable/chunks/BChu7Pos.js delete mode 100644 app/smartbrain_3000/web/_app/immutable/chunks/BJLLtWYH.js rename app/smartbrain_3000/web/_app/immutable/chunks/{CEPrmzat.js => Be3BkmPa.js} (98%) create mode 100644 app/smartbrain_3000/web/_app/immutable/chunks/BkiVJrb-.js rename app/smartbrain_3000/web/_app/immutable/chunks/{1gl_kuJz.js => Bmlx8Ynu.js} (90%) delete mode 100644 app/smartbrain_3000/web/_app/immutable/chunks/BxvjB08B.js create mode 100644 app/smartbrain_3000/web/_app/immutable/chunks/CDAAYzUu.js rename app/smartbrain_3000/web/_app/immutable/chunks/{CLNxzSSl.js => CJLE_wpt.js} (78%) rename app/smartbrain_3000/web/_app/immutable/chunks/{uFPkKLC1.js => CcVP_dcS.js} (76%) rename app/smartbrain_3000/web/_app/immutable/chunks/{tlN4Hcij.js => CeaAcbO3.js} (93%) rename app/smartbrain_3000/web/_app/immutable/chunks/{BtjCS6Y-.js => ChxMyhtI.js} (65%) delete mode 100644 app/smartbrain_3000/web/_app/immutable/chunks/Cmegxfzj.js delete mode 100644 app/smartbrain_3000/web/_app/immutable/chunks/CoHYJ8BJ.js rename app/smartbrain_3000/web/_app/immutable/chunks/{eN4Uq1pt.js => CwN7cGO4.js} (65%) create mode 100644 app/smartbrain_3000/web/_app/immutable/chunks/Czex3Sq4.js create mode 100644 app/smartbrain_3000/web/_app/immutable/chunks/DETRq8nR.js rename app/smartbrain_3000/web/_app/immutable/chunks/{BqUz5g-m.js => DQSrham4.js} (94%) rename app/smartbrain_3000/web/_app/immutable/chunks/{DKVRJME0.js => Di_L0eC6.js} (84%) rename app/smartbrain_3000/web/_app/immutable/chunks/{y2R953fa.js => DpD1lG2E.js} (80%) rename app/smartbrain_3000/web/_app/immutable/chunks/{kqW19h2g.js => UDuC8ICI.js} (93%) rename app/smartbrain_3000/web/_app/immutable/chunks/{CwtHPkdz.js => aIySO2My.js} (79%) delete mode 100644 app/smartbrain_3000/web/_app/immutable/chunks/iVEGnMVT.js rename app/smartbrain_3000/web/_app/immutable/chunks/{DV4tMnTy.js => itGxqfLQ.js} (82%) rename app/smartbrain_3000/web/_app/immutable/chunks/{DNdCTZZL.js => x-QSRA-u.js} (96%) create mode 100644 app/smartbrain_3000/web/_app/immutable/entry/app.C6nqrMm7.js delete mode 100644 app/smartbrain_3000/web/_app/immutable/entry/app.DIDA9xot.js delete mode 100644 app/smartbrain_3000/web/_app/immutable/entry/start.BbFbPWF3.js create mode 100644 app/smartbrain_3000/web/_app/immutable/entry/start.TSJdo2Gi.js rename app/smartbrain_3000/web/_app/immutable/nodes/{0.BC5_jvAz.js => 0.CAue6YlT.js} (81%) rename app/smartbrain_3000/web/_app/immutable/nodes/{1.CS-bGd13.js => 1.C7xJmJkE.js} (63%) create mode 100644 app/smartbrain_3000/web/_app/immutable/nodes/10.BoqtT515.js delete mode 100644 app/smartbrain_3000/web/_app/immutable/nodes/10.D2sVRYwK.js rename app/smartbrain_3000/web/_app/immutable/nodes/{11.BQRO1JQZ.js => 11.SjX2dPtJ.js} (97%) rename app/smartbrain_3000/web/_app/immutable/nodes/{12.Dbly5ARM.js => 12.Cyl0pmDa.js} (97%) rename app/smartbrain_3000/web/_app/immutable/nodes/{13.wu6k-MKp.js => 13.Dk_SvHe1.js} (95%) rename app/smartbrain_3000/web/_app/immutable/nodes/{14.eFvvfdPp.js => 14.Dyt9LzQr.js} (93%) delete mode 100644 app/smartbrain_3000/web/_app/immutable/nodes/15.BPdwRx9u.js create mode 100644 app/smartbrain_3000/web/_app/immutable/nodes/15.CjnZ9tWk.js delete mode 100644 app/smartbrain_3000/web/_app/immutable/nodes/16.Djk9HcUS.js create mode 100644 app/smartbrain_3000/web/_app/immutable/nodes/16.DuGhVinj.js rename app/smartbrain_3000/web/_app/immutable/nodes/{17.CgukqYQt.js => 17.7MLgDNjt.js} (93%) rename app/smartbrain_3000/web/_app/immutable/nodes/{18.COwa8j3Q.js => 18.CZM1LVRi.js} (97%) rename app/smartbrain_3000/web/_app/immutable/nodes/{19.qPht_xNT.js => 19.Dn0rUkG4.js} (96%) rename app/smartbrain_3000/web/_app/immutable/nodes/{2.CiKgDIBB.js => 2.CBI0cuH1.js} (78%) rename app/smartbrain_3000/web/_app/immutable/nodes/{20.CcKNEGJ_.js => 20.DaQdc7Ir.js} (99%) rename app/smartbrain_3000/web/_app/immutable/nodes/{21.DHbFPEDf.js => 21.CJha6Vtp.js} (73%) rename app/smartbrain_3000/web/_app/immutable/nodes/{22.BfzGGdQN.js => 22.DueoGgfK.js} (96%) rename app/smartbrain_3000/web/_app/immutable/nodes/{23.BiQaWPwb.js => 23.BWQAnoZQ.js} (96%) rename app/smartbrain_3000/web/_app/immutable/nodes/{24.Denbgw47.js => 24.5tRnvpAR.js} (58%) rename app/smartbrain_3000/web/_app/immutable/nodes/{25.wN3Z1f3V.js => 25.a4i0kQk5.js} (52%) rename app/smartbrain_3000/web/_app/immutable/nodes/{26.BQ1Crg-Z.js => 26.Cws4L5Up.js} (66%) rename app/smartbrain_3000/web/_app/immutable/nodes/{27.CsA0vwdY.js => 27.dnMaooFk.js} (88%) rename app/smartbrain_3000/web/_app/immutable/nodes/{28.DEhKyuoz.js => 28.7m_3q5mX.js} (51%) rename app/smartbrain_3000/web/_app/immutable/nodes/{3.4LzSyiDB.js => 3.hrXXucw2.js} (66%) rename app/smartbrain_3000/web/_app/immutable/nodes/{4.BTxIooNG.js => 4.DwKXVaGA.js} (91%) rename app/smartbrain_3000/web/_app/immutable/nodes/{5.aXnt5v4U.js => 5.Cyfd-xHo.js} (72%) rename app/smartbrain_3000/web/_app/immutable/nodes/{6.C0SuaYab.js => 6.CqMhcdx_.js} (59%) rename app/smartbrain_3000/web/_app/immutable/nodes/{7.Dd3hmGbD.js => 7.rC1CBLEA.js} (99%) rename app/smartbrain_3000/web/_app/immutable/nodes/{8.CE6Gc_e3.js => 8.DlXaiCiv.js} (88%) rename app/smartbrain_3000/web/_app/immutable/nodes/{9.BeNo-nGH.js => 9.CAioKP6J.js} (79%) diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/BChu7Pos.js b/app/smartbrain_3000/web/_app/immutable/chunks/BChu7Pos.js new file mode 100644 index 00000000..dad7be1c --- /dev/null +++ b/app/smartbrain_3000/web/_app/immutable/chunks/BChu7Pos.js @@ -0,0 +1,3 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=Array.isArray,d=Array.prototype.indexOf,f=Array.prototype.includes,p=Array.from,m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyDescriptors,_=Object.prototype,v=Array.prototype,y=Object.getPrototypeOf,b=Object.isExtensible,x=()=>{};function S(e){return e()}function ee(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}var C=1024,w=2048,ne=4096,re=8192,ie=16384,ae=32768,oe=1<<25,se=65536,ce=1<<19,le=1<<20,ue=1<<25,de=1<<21,fe=1<<22,pe=1<<23,me=Symbol(`$state`),he=Symbol(`component`),ge=Symbol(`legacy props`),_e=Symbol(``),ve=Symbol(`attributes`),ye=Symbol(`class`),be=Symbol(`style`),xe=Symbol(`text`),Se=Symbol(`form reset`),Ce=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},we=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),Te={},T=Symbol(`uninitialized`),Ee=`http://www.w3.org/1999/xhtml`,De=`http://www.w3.org/2000/svg`,Oe=`http://www.w3.org/1998/Math/MathML`;function ke(){console.warn(`https://svelte.dev/e/derived_inert`)}function Ae(e){console.warn(`https://svelte.dev/e/hydratable_missing_but_expected`)}function je(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Me(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function Ne(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var E=!1;function D(e){E=e}var O;function k(e){if(e===null)throw je(),Te;return O=e}function Pe(){return k(z(O))}function Fe(e){if(E){if(z(O)!==null)throw je(),Te;O=e}}function Ie(e=1){if(E){for(var t=e,n=O;t--;)n=z(n);O=n}}function Le(e=!0){for(var t=0,n=O;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=z(n);e&&n.remove(),n=i}}function Re(e){if(!e||e.nodeType!==8)throw je(),Te;return e.data}function ze(e){return e===this.v}function Be(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ve(e){return!Be(e,this.v)}function He(e){throw Error(`https://svelte.dev/e/experimental_async_required`)}function Ue(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function We(){throw Error(`https://svelte.dev/e/missing_context`)}function Ge(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Ke(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function qe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Je(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Ye(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Xe(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ze(){throw Error(`https://svelte.dev/e/fork_discarded`)}function Qe(){throw Error(`https://svelte.dev/e/fork_timing`)}function $e(){throw Error(`https://svelte.dev/e/get_abort_signal_outside_reaction`)}function et(){throw Error(`https://svelte.dev/e/hydration_failed`)}function tt(e){throw Error(`https://svelte.dev/e/lifecycle_legacy_only`)}function nt(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function rt(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function it(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function at(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function ot(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var st=!1;function ct(){st=!0}function lt(e,t,n){let r={};return[()=>(n(r)||We(),e(r)),e=>t(r,e),()=>n(r)]}function ut(e){let t=e.p;for(;t!==null&&t.c===null;)t=t.p;return t?.c??null}function dt(e,t){return e===null&&Ue(t),e.c??=new Map(ut(e)||void 0)}var A=null;function ft(e){A=e}function pt(){return lt(mt,ht,gt)}function mt(e){return dt(A,`getContext`).get(e)}function ht(e,t){return dt(A,`setContext`).set(e,t),t}function gt(e){return dt(A,`hasContext`).has(e)}function _t(){return dt(A,`getAllContexts`)}function vt(e,t=!1,n){A={p:A,i:!1,c:null,e:null,s:e,x:null,r:q,l:st&&!t?{s:null,u:null,$:[]}:null}}function yt(e){var t=A,n=t.e;if(n!==null){t.e=null;for(var r of n)Jn(r)}return e!==void 0&&(t.x=e),t.i=!0,A=t.p,bt(e)}function bt(e={}){return m(e,he,{value:!0}),e}function xt(){return!st||A!==null&&A.l===null}var St=[];function Ct(){var e=St;St=[],ee(e)}function j(e){if(St.length===0&&!Xt){var t=St;queueMicrotask(()=>{t===St&&Ct()})}St.push(e)}function wt(){for(;St.length>0;)Ct()}var Tt=~(w|ne|C);function M(e,t){e.f=e.f&Tt|t}function Et(e){e.f&512||e.deps===null?M(e,C):M(e,ne)}function Dt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),M(e,C)}function Ot(e){E&&R(e)!==null&&Rn(e)}var kt=!1;function At(){kt||(kt=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[Se]?.()})},{capture:!0}))}function jt(e){var t=W,n=q;K(null),hr(null);try{return e()}finally{K(t),hr(n)}}function Mt(e,t,n,r=n){e.addEventListener(t,()=>jt(n));let i=e[Se];e[Se]=i?()=>{i(),r(!0)}:()=>r(!0),At()}function Nt(e,t,n,r){let i=xt()?Lt:Vt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=q,c=Pt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){B(e,s)}Ft()}}var d=It();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>zt(e))).then(u).catch(e=>B(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),Ft())}):f()}function Pt(){var e=q,t=W,n=A,r=N;return function(i=!0){hr(e),K(t),ft(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Ft(e=!0){hr(null),K(null),ft(null),e&&N?.deactivate()}function It(){var e=q,t=e.b,n=N,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Lt(e){var t=2|w;return q!==null&&(q.f|=ce),{ctx:A,deps:null,effects:null,equals:ze,f:t,fn:e,reactions:null,rv:0,v:T,wv:0,parent:q,ac:null}}var Rt=Symbol(`obsolete`);function zt(e,t,n){let r=q;r===null&&Ge();var i=void 0,a=gn(T),o=!W,s=new Set;return Qn(()=>{var t=q,n=te();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==Ce&&n.reject(e)}).finally(Ft)}catch(e){n.reject(e),Ft()}var c=N;if(o){if(t.f&32768)var l=It();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Rt);else for(let e of s.values())e.reject(Rt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Rt&&(c.activate(),t?(a.f|=pe,xn(a,t)):(a.f&8388608&&(a.f^=pe),xn(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),Kn(()=>{for(let e of s)e.reject(Rt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function Bt(e){let t=Lt(e);return _r(t),t}function Vt(e){let t=Lt(e);return t.equals=Ve,t}function Ht(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n{t.ac.abort(Ce),t.ac=null}),t.fn!==null&&(t.teardown=x),kr(t,0),rr(t))}function Kt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&Ar(t)}var qt=null,N=null,Jt=null,P=null,Yt=null,Xt=!1,Zt=!1,Qt=null,$t=null,en=0,tn=1,nn=class e{id=tn++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){qt===null?qt=this:(qt.#n=this,this.#t=qt),qt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)M(r,w),t(r);for(r of n.m)M(r,ne),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=C}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),M(e,w),this.schedule(e);for(let e of this.#d)M(e,ne),this.schedule(e);this.apply();for(var t=Qt=[],n=[],r=$t=[];this.#c.length>0;){en++>1e3&&(this.#S(),an());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw dn(e),this.#h()||this.discard(),t}}if(N=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Qt=null,$t=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)un(e,t);r.length>0&&N.#_();return}let a=this.#y();if(a)this.#x(n),this.#x(t),a.#b(this);else{this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),Jt=this,sn(n),sn(t),Jt=null,this.#s?.resolve();var o=N;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(F.clear(),o.#_())}}#v(e,t,n){e.f^=C;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=C:i&4?t.push(r):wr(r)&&(i&16&&this.#d.add(r),Ar(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),M(i,w),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),N=this,this.#_()}#x(e){for(var t=0;t{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=te()).promise}static ensure(){if(N===null){let t=N=new e;!Zt&&!Xt&&j(()=>{t.#e||t.flush()})}return N}apply(){P=null}schedule(e){Yt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?qt=e:t.#t=e,this.linked=!1}}};function rn(e){var t=Xt,n=Jt;Jt=null,Xt=!0;try{var r;for(e&&(rn(),r=e());;){if(wt(),N===null)return r;N.flush()}}finally{Xt=t,Jt=n}}function an(){try{Xe()}catch(e){B(e,Yt)}}var on=null;function sn(e){var t=e.length;if(t!==0){for(var n=0;n0)){F.clear();for(let e of on){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)on.has(n)&&(on.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Ar(n)}}on.clear()}}on=null}}function cn(e,t){if(e.reactions!==null)for(let n of e.reactions){let e=n.f;e&2?cn(n,t):e&131072&&(M(n,w),t.add(n))}}function ln(e){N.schedule(e)}function un(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),M(e,C);for(var n=e.first;n!==null;)un(n,t),n=n.next}}function dn(e){M(e,C);for(var t=e.first;t!==null;)dn(t),t=t.next}function fn(e){He(`fork`),N!==null&&Qe(),rn();var t=nn.ensure();t.is_fork=!0,P=new Map;var n=!1,r=t.settled();return e(),rn(),{commit:async()=>{if(n)await r;else{t.linked||Ze(),n=!0,t.is_fork=!1;for(var[e,[i]]of t.current)e.v=i,e.wv=Cr();rn(()=>{var e=new Set;for(var n of t.current.keys())cn(n,e);mn(e),Sn()}),t.flush(),await r}},discard:()=>{for(var e of t.current.keys())e.wv=Cr();!n&&t.linked&&t.discard()}}}var pn=new Set,F=new Map;function mn(e){pn=e}var hn=!1;function gn(e,t){return{f:0,v:e,reactions:null,equals:ze,rv:0,wv:0}}function _n(e,t){let n=gn(e,t);return _r(n),n}function vn(e,t=!1,n=!0){let r=gn(e);return t||(r.equals=Ve),st&&n&&A!==null&&A.l!==null&&(A.l.s??=[]).push(r),r}function I(e,t,n=!1){return W!==null&&(!G||W.f&131072)&&xt()&&W.f&4325394&&(gr===null||!gr.has(e))&&at(),xn(e,n?En(t):t,$t)}var yn=null,bn=0;function xn(e,t,n=null){if(!e.equals(t)){pr?F.set(e,t):F.has(e)||F.set(e,e.v);var r=nn.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Ut(t),P===null&&Et(t)}e.wv=Cr(),yn=null,bn=0,Tn(e,w,n),yn=null,xt()&&q!==null&&q.f&1024&&!(q.f&96)&&(X===null?vr([e]):X.push(e)),!r.is_fork&&pn.size>0&&!hn&&Sn()}return t}function Sn(){hn=!1;for(let e of pn){e.f&1024&&M(e,ne);let t;try{t=wr(e)}catch{t=!0}t&&Ar(e)}pn.clear()}function Cn(e,t=1){var n=Z(e),r=t===1?n++:n--;return I(e,n),r}function wn(e){I(e,e.v+1)}function Tn(e,t,n){var r=e.reactions;if(r!==null){var i=xt(),a=r.length;if(bn+=a,bn>1e5&&yn===null&&(yn=new Set),yn!==null){if(yn.has(e))return;yn.add(e)}for(var o=0;o{if(xr===o)return e();var t=W,n=xr;K(null),Sr(o);var r=e();return K(t),Sr(n),r};return r&&n.set(`length`,_n(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&rt();var i=n.get(t);return i===void 0?s(()=>{var e=_n(r.value,a);return n.set(t,e),e}):I(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>_n(T,a));n.set(t,e),wn(i)}}else I(r,T),wn(i);return!0},get(t,r,i){if(r===me)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||h(t,r)?.writable)&&(o=s(()=>_n(En(c?t[r]:T),a)),n.set(r,o)),o!==void 0){var l=Z(o);return l===T?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),i=n.get(t);if(i!==void 0){var a=Z(i);if(a===T)return;if(r&&`value`in r)r.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return r},has(e,t){if(t===me)return!0;var r=n.get(t),i=r!==void 0&&r.v!==T||Reflect.has(e,t);return(r!==void 0||q!==null&&(!i||h(e,t)?.writable))&&(r===void 0&&(r=s(()=>_n(i?En(e[t]):T,a)),n.set(t,r)),Z(r)===T)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;d_n(T,a)),n.set(d+``,f)):I(f,T)}if(l===void 0)(!u||h(e,t)?.writable)&&(l=s(()=>_n(void 0,a)),I(l,En(o)),n.set(t,l));else{u=l.v!==T;var p=s(()=>En(o));I(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var g=n.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&I(g,_+1)}wn(i)}return!0},ownKeys(e){Z(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==T});for(var[r,a]of n)a.v!==T&&!(r in e)&&t.push(r);return t},setPrototypeOf(){it()}})}function Dn(e){try{if(typeof e==`object`&&e&&me in e)return e[me]}catch{}return e}function On(e,t){return Object.is(Dn(e),Dn(t))}var kn,An,jn,Mn;function Nn(){if(kn===void 0){kn=window,An=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;jn=h(t,`firstChild`).get,Mn=h(t,`nextSibling`).get,b(e)&&(e[ye]=void 0,e[ve]=null,e[be]=void 0,e.__e=void 0),b(n)&&(n[xe]=void 0)}}function L(e=``){return document.createTextNode(e)}function R(e){return jn.call(e)}function z(e){return Mn.call(e)}function Pn(e,t){if(!E)return R(e);var n=R(O);if(n===null)n=O.appendChild(L());else if(t&&n.nodeType!==3){var r=L();return n?.before(r),k(r),r}return t&&Vn(n),k(n),n}function Fn(e,t=!1){if(!E){var n=R(e);return n instanceof Comment&&n.data===``?z(n):n}if(t){if(O?.nodeType!==3){var r=L();return O?.before(r),k(r),r}Vn(O)}return O}function In(e,t=!1){if(!E)return R(e);var n=Pn(e,t);return Fe(e),n}function Ln(e,t=1,n=!1){let r=E?O:e;for(var i;t--;)i=r,r=z(r);if(!E)return r;if(n){if(r?.nodeType!==3){var a=L();return r===null?i?.after(a):r.before(a),k(a),a}Vn(r)}return k(r),r}function Rn(e){e.textContent=``}function zn(){return!1}function Bn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function Vn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Hn(e){var t=q;if(t===null)return W.f|=pe,e;if(!(t.f&32768)&&!(t.f&4))throw e;B(e,t)}function B(e,t){if(e===Te)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function Un(e){q===null&&(W===null&&Ye(e),Je()),pr&&qe(e)}function Wn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function V(e,t){var n=q;n!==null&&n.f&8192&&(e|=re);var r={ctx:A,deps:null,nodes:null,f:e|w|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};N?.register_created_effect(r);var i=r;if(e&4)Qt===null?nn.ensure().schedule(r):Qt.push(r);else if(t!==null){try{Ar(r)}catch(e){throw U(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=se))}if(i!==null&&(i.parent=n,n!==null&&Wn(i,n),W!==null&&W.f&2&&!(e&64))){var a=W;(a.effects??=[]).push(i)}return r}function Gn(){return W!==null&&!G}function Kn(e){let t=V(8,null);return M(t,C),t.teardown=e,t}function qn(e){Un(`$effect`);var t=q.f;if(!W&&t&32&&A!==null&&!A.i){var n=A;(n.e??=[]).push(e)}else return Jn(e)}function Jn(e){return V(4|le,e)}function Yn(e){return Un(`$effect.pre`),V(8|le,e)}function Xn(e){nn.ensure();let t=V(64|ce,e);return(e={})=>new Promise(n=>{e.outro?sr(t,()=>{U(t),n(void 0)}):(U(t),n(void 0))})}function Zn(e){return V(4,e)}function Qn(e){return V(fe|ce,e)}function $n(e,t=0){return V(8|t,e)}function er(e,t=[],n=[],r=[]){Nt(r,t,n,t=>{V(8,()=>{e(...t.map(Z))})})}function tr(e,t=0){return V(16|t,e)}function H(e){return V(32|ce,e)}function nr(e){var t=e.teardown;if(t!==null){let n=pr,r=W;mr(!0),K(null);try{t.call(null)}catch(t){B(t,e.parent)}finally{mr(n),K(r)}}}function rr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&jt(()=>{e.abort(Ce)});var r=n.next;n.f&64?n.parent=null:U(n,t),n=r}}function ir(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||U(t),t=n}}function U(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(ar(e.nodes.start,e.nodes.end),n=!0),e.f|=oe,rr(e,t&&!n),kr(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();nr(e),e.f^=oe,e.f|=ie;var i=e.parent;i!==null&&i.first!==null&&or(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function ar(e,t){for(;e!==null;){var n=e===t?null:z(e);e.remove(),e=n}}function or(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function sr(e,t,n=!0){var r=[];e.f|=256,cr(e,r,!0);var i=()=>{n&&U(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function cr(e,t,n){if(!(e.f&8192)){e.f^=re;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);cr(i,t,o?n:!1)}i=a}}}function lr(e){e.f&=-257,ur(e,!0)}function ur(e,t){if(!(e.f&256)&&e.f&8192){e.f^=re,e.f&1024||(M(e,w),nn.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);ur(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function dr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:z(n);t.append(n),n=i}}var fr=null,pr=!1;function mr(e){pr=e}var W=null,G=!1;function K(e){W=e}var q=null;function hr(e){q=e}var gr=null;function _r(e){W!==null&&(W.f&2097152||W.f&2)&&(gr??=new Set).add(e)}var J=null,Y=0,X=null;function vr(e){X=e}var yr=1,br=0,xr=br;function Sr(e){xr=e}function Cr(){return++yr}function wr(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&P===null&&M(e,C)}return!1}function Tr(e,t,n=!0){var r=e.reactions;if(r!==null&&!(gr!==null&&gr.has(e)))for(var i=0;i{e.ac.abort(Ce)}),e.ac=null);try{e.f|=de;var u=e.fn,d=u();e.f|=ae;var f=Dr(e);if(xt()&&X!==null&&!G&&f!==null&&!(e.f&6146))for(var p=0;p0)for(t.length=Y+J.length,r=0;r{a.ac.abort(Ce),a.ac=null,M(a,w)}),Gt(a),kr(a,0)}}function kr(e,t){var n=e.deps;if(n!==null)for(var r=t;rn?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,j(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function Ur(e,t,n,r,i){var a={capture:r,passive:i},o=Hr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Kn(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function Wr(e,t,n){(t[zr]??={})[e]=n}function Gr(e){for(var t=0;t{qr=!1,Kr=null}));var o=0,s=Kr===e&&e[zr];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[zr]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){m(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=W,d=q;K(null),hr(null);try{for(var f,p=[];a!==null&&a!==t;){try{var h=a[zr]?.[r];h!=null&&(!a.disabled||e.target===a)&&h.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o{throw e});throw f}}finally{e[zr]=t,delete e.currentTarget,K(u),hr(d)}}}var Yr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Xr(e){return Yr?.createHTML(e)??e}function Zr(e){var t=Bn(`template`);return t.innerHTML=Xr(e.replaceAll(``,``)),t.content}function $(e,t){var n=q;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function Qr(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(``);return()=>{if(E)return $(O,null),O;i===void 0&&(i=Zr(a?e:``+e),n||(i=R(i)));var t=r||An?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=R(t),s=t.lastChild;$(o,s)}else $(t,t);return t}}function $r(e,t,n=`svg`){var r=!e.startsWith(``),i=!!(t&1),a=`<${n}>${r?e:``+e}`,o;return()=>{if(E)return $(O,null),O;if(!o){var e=R(Zr(a));if(i)for(o=document.createDocumentFragment();R(e);)o.appendChild(R(e));else o=R(e)}var t=o.cloneNode(!0);if(i){var n=R(t),r=t.lastChild;$(n,r)}else $(t,t);return t}}function ei(e,t){return $r(e,t,`svg`)}function ti(e=``){if(!E){var t=L(e+``);return $(t,t),t}var n=O;return n.nodeType===3?Vn(n):(n.before(n=L()),k(n)),$(n,n),n}function ni(){if(E)return $(O,null),O;var e=document.createDocumentFragment(),t=document.createComment(``),n=L();return e.append(t,n),$(t,n),e}function ri(e,t){if(E){var n=q;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=O),Pe()}else e!==null&&e.before(t)}function ii(){if(E&&O&&O.nodeType===8&&O.textContent?.startsWith(`$`)){let e=O.textContent.substring(1);return Pe(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function ai(e){let t=0,n=gn(0),r;return()=>{Gn()&&(Z(n),$n(()=>(t===0&&(r=Q(()=>e(()=>wn(n)))),t+=1,()=>{j(()=>{--t,t===0&&(r?.(),r=void 0,wn(n))})})))}}var oi=se|ce;function si(e,t,n,r){new ci(e,t,n,r)}var ci=class{parent;is_pending=!1;transform_error;#e;#t=E?O:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=ai(()=>(this.#m=gn(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=q;t.b=this,t.f|=128,n(e)},this.parent=q.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=tr(()=>{if(E){let e=Re(this.#t);Pe();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#_(t)}else t?this.#b():this.#g()}else this.#x()},oi),E&&(this.#e=O)}#g(){try{this.#a=H(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);j(r),t&&(this.#s=H(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{this.#y()||(t?Ne():(t=!0,n&&ot(),this.#s!==null&&sr(this.#s,()=>{this.#s=null}),this.#C(()=>{this.#x()})))};return{reset:r,invoke_onerror:()=>{if(!this.#y())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){B(e,this.#i&&this.#i.parent)}}}}#y(){return(this.#i.f&(ie|oe))!==0}#b(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=H(()=>e(this.#e)),j(()=>{if(!this.#y()){var e=this.#c=document.createDocumentFragment(),t=L(),n=!1;e.append(t),this.#a=this.#C(()=>{try{return H(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){B(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#S(N)):this.#u===0&&(this.#e.before(e),this.#c=null,sr(this.#o,()=>{this.#o=null}),this.#S(N))}}))}#x(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=H(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();dr(this.#a,e);let t=this.#n.pending;this.#o=H(()=>t(this.#e))}else this.#S(N)}catch(e){this.error(e)}}#S(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Dt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#C(e){var t=q,n=W,r=A;hr(this.#i),K(this.#i),ft(this.#i.ctx);try{return nn.ensure(),e()}finally{hr(t),K(n),ft(r)}}#w(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#S(t),this.#o&&sr(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#w(e,t)}update_pending_count(e,t){this.#w(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,j(()=>{this.#d=!1,this.#m&&xn(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),Z(this.#m)}error(e){if(e===Te||!this.#n.onerror&&!this.#n.failed)throw e;N?.is_fork?(this.#a&&N.skip_effect(this.#a),this.#o&&N.skip_effect(this.#o),this.#s&&N.skip_effect(this.#s),N.oncommit(()=>{this.#y()||this.#T(e)})):this.#T(e)}#T(e){this.#a&&=(U(this.#a),null),this.#o&&=(U(this.#o),null),this.#s&&=(U(this.#s),null),E&&(k(this.#t),Ie(),k(Le()));let t=this.#n.failed,n=e=>{if(this.#y())return;let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&!this.#y()&&(this.#s=this.#C(()=>{try{return H(()=>{var r=q;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return B(e,this.#i.parent),null}}))};j(()=>{if(!this.#y()){var t;try{t=this.transform_error(e)}catch(e){B(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>B(e,this.#i&&this.#i.parent)):n(t)}})}};function li(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[xe]??=e.nodeValue)&&(e[xe]=n,e.nodeValue=`${n}`)}function ui(e,t){return pi(e,t)}function di(e,t){Nn(),t.intro=t.intro??!1;let n=t.target,r=E,i=O;try{for(var a=R(n);a&&(a.nodeType!==8||a.data!==`[`);)a=z(a);if(!a)throw Te;D(!0),k(a);let r=pi(e,{...t,anchor:a});return D(!1),r}catch(r){if(r instanceof Error&&r.message.split(` +`).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw r;return r!==Te&&console.warn(`Failed to hydrate: `,r),t.recover===!1&&et(),Nn(),Rn(n),D(!1),ui(e,t)}finally{D(r),k(i)}}var fi=new Map;function pi(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){Nn();var c=void 0,l=Xn(()=>{var o=n??t.appendChild(L());si(o,{pending:()=>{}},t=>{vt({});var n=A;if(a&&(n.c=a),i&&(r.$$events=i),E&&$(t,null),c=e(t,r)||bt(),E&&(q.nodes.end=O,O===null||O.nodeType!==8||O.data!==`]`))throw je(),Te;yt()},s);var l=new Set,u=e=>{for(var n=0;n{for(var e of l)for(let n of[t,document]){var r=fi.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Jr),r.delete(e),r.size===0&&fi.delete(n)):r.set(e,i)}Vr.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return mi.set(c,l),c}var mi=new WeakMap;function hi(e,t){let n=mi.get(e);return n?(mi.delete(e),n(t)):Promise.resolve()}var gi=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)lr(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(lr(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(U(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();dr(r,t),t.append(L()),this.#n.set(e,{effect:r,fragment:t})}else U(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),sr(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(U(n.effect),this.#n.delete(e))};ensure(e,t){var n=N,r=zn();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=L();i.append(a),this.#n.set(e,{effect:H(()=>t(a)),fragment:i})}else this.#t.set(e,H(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else E&&(this.anchor=O),this.#a(n)}};function _i(e,t,n=!1){var r;E&&(r=O,Pe());var i=new gi(e),a=n?se:0;function o(e,t){if(E){var n=Re(r);if(e!==parseInt(n.substring(1))){var a=Le();k(a),i.anchor=a,D(!1),i.ensure(e,t),D(!0);return}}i.ensure(e,t)}tr(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function vi(e,t){return t}function yi(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;bi(e,p(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null&&e.pending.size===0;if(c){var l=n,u=l.parentNode;Rn(u),u.append(l),e.items.clear()}bi(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function bi(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var e=n();return u(e)?e:e==null?[]:p(e)}),f=new Map,m=!0;function h(e){if(!(_.effect.f&16384)){_.pending.delete(e);var n=Z(d);_.fallback=l,wi(_,n,o,t,r),l!==null&&(n.length===0?l.f&33554432?(l.f^=ue,Ei(l,null,o)):lr(l):sr(l,()=>{l=null}))}}function g(e){_.pending.delete(e)}var _={effect:tr(()=>{var e=Z(d),c=e.length;let u=!1;E&&Re(o)===`[!`!=(c===0)&&(o=Le(),k(o),D(!1),u=!0);for(var p=new Set,_=N,v=zn(),y=0;ya(o)):(l=H(()=>a(xi??=L())),l.f|=ue)),c>p.size&&Ke(``,``,``),E&&c>0&&k(Le()),!m){if(f.set(_,p),v){for(let[e,t]of s)p.has(e)||_.skip_effect(t.e);_.oncommit(h),_.ondiscard(g)}else h(_)}u&&D(!0),Z(d)}),flags:t,items:s,pending:f,outrogroups:null,fallback:l};m=!1,E&&(o=O)}function Ci(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function wi(e,t,n,r,i){var a=!!(r&8),o=t.length,s=e.items,c=Ci(e.effect.first),l,u=null,d,f=[],m=[],h,g,_,v;if(a)for(v=0;v0){var w=r&4&&o===0?n:null;if(a){for(v=0;v{if(d!==void 0)for(_ of d)_.nodes?.a?.apply()})}function Ti(e,t,n,r,i,a,o,s){var c=o&1?o&16?gn(n):vn(n,!1,!1):null,l=o&2?gn(i):null;return{v:c,i:l,e:H(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Ei(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=z(r);if(a.before(r),r===i)return;r=o}}function Di(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Oi(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;E&&(o=k(R(c)))}er(()=>{var e=q;if(s===(s=t()??``))E&&Pe();else if(n&&!E)e.nodes=null,c.innerHTML=s,s!==``&&$(R(c),c.lastChild);else if(e.nodes!==null&&(ar(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(E){for(var a=O.data,l=Pe(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=z(l);if(l===null)throw je(),Te;$(O,u),o=k(l)}else{var d=Bn(r?`svg`:i?`math`:`template`,r?De:i?Oe:void 0);d.innerHTML=s;var f=r||i?d:d.content;if($(R(f),f.lastChild),r||i)for(;R(f);)o.before(R(f));else o.before(f)}}})}function ki(e,t,...n){var r=new gi(e);tr(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},se)}function Ai(e){return(t,...n)=>{var r=e(...n),i;E?(i=O,Pe()):(i=R(Zr(r.render().trim())),t.before(i));let a=r.setup?.(i);$(i,i),typeof a==`function`&&Kn(a)}}function ji(e,t,n){var r;E&&(r=O,Pe());var i=new gi(e);tr(()=>{var e=t()??null;if(E&&Re(r)===`[`!=(e!==null)){var a=Le();k(a),i.anchor=a,D(!1),i.ensure(e,e&&(t=>n(t,e))),D(!0)}else i.ensure(e,e&&(t=>n(t,e)))},se)}function Mi(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t=0;){var s=o+a;(o===0||Fi.includes(r[o-1]))&&(s===r.length||Fi.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Li(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Ri(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function zi(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Ri)),i&&c.push(...Object.keys(i).map(Ri));var l=0,u=-1;let t=e.length;for(var d=0;d{t.every(Yi)||(`__defaultValue`in e&&Wi(e,!1),`__value`in e&&Gi(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),Kn(()=>{t.disconnect()})}function qi(e,t,n=t){var r=new WeakSet,i=!0;Mt(e,`change`,t=>{var i=t?`[selected]`:`:checked`,a;if(e.multiple)a=[].map.call(e.querySelectorAll(i),Ji);else{var o=e.querySelector(i)??e.querySelector(`option:not([disabled])`);a=o&&Ji(o)}n(a),e.__value=a,N!==null&&r.add(N)}),Zn(()=>{var a=t();if(e===document.activeElement){var o=N;if(r.has(o))return}if(Gi(e,a,i),i&&a===void 0){var s=e.querySelector(`:checked`);s!==null&&(a=Ji(s),n(a))}e.__value=a,i=!1})}function Ji(e){return`__value`in e?e.__value:e.value}function Yi(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var Xi=Symbol(`is custom element`),Zi=Symbol(`is html`),Qi=we?`link`:`LINK`,$i=we?`progress`:`PROGRESS`;function ea(e){if(E){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;ra(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;ra(e,`checked`,null),e.checked=r}}};e[Se]=n,j(n),At()}}function ta(e,t){var n=ia(e);n.value!==(n.value=t??void 0)&&(e.value!==t||t===0&&e.nodeName===$i)&&(e.value=t??``)}function na(e,t){var n=ia(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function ra(e,t,n,r){var i=ia(e);E&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Qi)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[_e]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&oa(e).has(t)?e[t]=n:e.setAttribute(t,n))}function ia(e){return e[ve]??={[Xi]:e.nodeName.includes(`-`),[Zi]:e.namespaceURI===Ee}}var aa=new Map;function oa(e){var t=e.getAttribute(`is`)||e.nodeName,n=aa.get(t);if(n)return n;aa.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=g(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=y(i)}return n}function sa(e,t,n=t){var r=new WeakSet;Mt(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=fa(e)?pa(a):a,n(a),N!==null&&r.add(N),await jr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(E&&e.defaultValue!==e.value||Q(t)==null&&e.value)&&(n(fa(e)?pa(e.value):e.value),N!==null&&r.add(N)),$n(()=>{var n=t();if(e===document.activeElement){var i=N;if(r.has(i))return}fa(e)&&n===pa(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}var ca=new Set;function la(e,t,n,r,i=r){var a=n.getAttribute(`type`)===`checkbox`,o=e;let s=!1;if(t!==null)for(var c of t)o=o[c]??=[];o.push(n),Mt(n,`change`,()=>{var e=n.__value;a&&(e=da(o,e,n.checked)),i(e)},()=>i(a?[]:null)),$n(()=>{var e=r();E&&n.defaultChecked!==n.checked?s=!0:a?(e||=[],n.checked=e.includes(n.__value)):n.checked=On(n.__value,e)}),Kn(()=>{var e=o.indexOf(n);e!==-1&&o.splice(e,1)}),ca.has(o)||(ca.add(o),j(()=>{o.sort((e,t)=>e.compareDocumentPosition(t)===4?-1:1),ca.delete(o)})),j(()=>{if(s){var e=a?da(o,e,n.checked):o.find(e=>e.checked)?.__value;i(e)}})}function ua(e,t,n=t){Mt(e,`change`,t=>{n(t?e.defaultChecked:e.checked)}),(E&&e.defaultChecked!==e.checked||Q(t)==null)&&n(e.checked),$n(()=>{e.checked=!!t()})}function da(e,t,n){for(var r=new Set,i=0;i{n(e.files)}),E&&e.files&&n(e.files),$n(()=>{e.files=t()})}var ha=new class e{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(e){this.#n=e}observe(e,t){var n=this.#e.get(e)||new Set;return n.add(t),this.#e.set(e,n),this.#r().observe(e,this.#n),()=>{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function ga(e,t,n){var r=ha.observe(e,()=>n(e[t]));Zn(()=>(Q(()=>n(e[t])),r))}function _a(e,t){return e===t||e?.[me]===t}function va(e=bt(),t,n,r){var i=A.r,a=q;return Zn(()=>{var o,s;return $n(()=>{o=s,s=r?.()||[],Q(()=>{_a(n(...s),e)||(t(e,...s),o&&_a(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&_a(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function ya(e,t,n,r,i){var a=()=>{r(n[e])};n.addEventListener(t,a),i?$n(()=>{n[e]=i()}):a(),(n===document.body||n===window||n===document)&&Kn(()=>{n.removeEventListener(t,a)})}function ba(e=!1){let t=A,n=t.l.u;if(!n)return;let r=()=>Fr(t.s);if(e){let e=0,n={},i=Lt(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>Z(i)}n.b.length&&Yn(()=>{xa(t,r),ee(n.b)}),qn(()=>{let e=Q(()=>n.m.map(S));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&qn(()=>{xa(t,r),ee(n.a)})}function xa(e,t){if(e.l.s)for(let t of e.l.s)Z(t);t()}var Sa=[];function Ca(e,t=x){let n=null,r=new Set;function i(t){if(Be(e,t)&&(e=t,n)){let t=!Sa.length;for(let t of r)t[1](),Sa.push(t,e);if(t){for(let e=0;e{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:a,subscribe:o}}var wa=!1;function Ta(e){var t=wa;try{return wa=!1,[e(),wa]}finally{wa=t}}function Ea(e,t,n,r){var i=!st||!!(n&2),a=!!(n&8),o=!!(n&16),s=r,c=!0,l=void 0,u=()=>o&&i?(l??=Lt(r),Z(l)):(c&&(c=!1,s=o?Q(r):r),s);let d;if(a){var f=me in e||ge in e;d=h(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=Ta(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&nt(t),d(p)));var g=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return g;if(d){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||m)&&d(t?g():e),e):g()})}var v=!1,y=(n&1?Lt:Vt)(()=>(v=!1,g()));a&&Z(y);var b=q;return(function(e,t){if(arguments.length>0){let n=t?Z(y):i&&a?En(e):e;return I(y,n),v=!0,s!==void 0&&(s=n),e}return pr&&v||b.f&16384?y.v:Z(y)})}function Da(e){return class extends Oa{constructor(t){super({component:e,...t})}}}var Oa=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=vn(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return Z(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===ge||(Z(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return I(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?di:ui)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),(!e?.props?.$$host||e.sync===!1)&&rn(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e!==`$set`&&e!==`$destroy`&&e!==`$on`&&m(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{hi(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}};function ka(e,t){if(He(`hydratable`),E){let t=window.__svelte?.h;if(t?.has(e))return t.get(e);Ae(e)}return t()}var Aa=s({afterUpdate:()=>La,beforeUpdate:()=>Ia,createContext:()=>pt,createEventDispatcher:()=>Fa,createRawSnippet:()=>Ai,flushSync:()=>rn,fork:()=>fn,getAbortSignal:()=>ja,getAllContexts:()=>_t,getContext:()=>mt,hasContext:()=>gt,hydratable:()=>ka,hydrate:()=>di,mount:()=>ui,onDestroy:()=>Na,onMount:()=>Ma,setContext:()=>ht,settled:()=>Mr,tick:()=>jr,unmount:()=>hi,untrack:()=>Q});function ja(){return W===null&&$e(),(W.ac??=new AbortController).signal}function Ma(e){A===null&&Ue(`onMount`),st&&A.l!==null?Ra(A).m.push(e):qn(()=>{let t=Q(e);if(typeof t==`function`)return t})}function Na(e){A===null&&Ue(`onDestroy`),Ma(()=>()=>Q(e))}function Pa(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Fa(){let e=A;return e===null&&Ue(`createEventDispatcher`),(t,n,r)=>{let i=e.s.$$events?.[t];if(i){let a=u(i)?i.slice():[i],o=Pa(t,n,r);for(let t of a)t.call(e.x,o);return!o.defaultPrevented}return!0}}function Ia(e){A===null&&Ue(`beforeUpdate`),A.l===null&&tt(`beforeUpdate`),Ra(A).b.push(e)}function La(e){A===null&&Ue(`afterUpdate`),A.l===null&&tt(`afterUpdate`),Ra(A).a.push(e)}function Ra(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}export{En as $,_i as A,Ur as B,Bi as C,Oi as D,ki as E,ei as F,er as G,Mr as H,ii as I,kn as J,qn as K,ti as L,ri as M,ni as N,Si as O,Qr as P,Ln as Q,Gr as R,Hi as S,ji as T,jr as U,Z as V,Q as W,Fn as X,Pn as Y,In as Z,na as _,Ea as a,Ot as at,Ki as b,ya as c,vt as ct,ua as d,Ie as dt,I as et,ma as f,Fe as ft,ra as g,l as gt,ea as h,s as ht,Da as i,Bt as it,li as j,vi as k,va as l,ht as lt,sa as m,o as mt,Na as n,Cn as nt,Ca as o,mt as ot,la as p,x as pt,Yn as q,Ma as r,Vt as rt,ba as s,yt as st,Aa as t,_n as tt,ga as u,ct as ut,ta as v,Pi as w,Gi as x,qi as y,Wr as z}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/BJLLtWYH.js b/app/smartbrain_3000/web/_app/immutable/chunks/BJLLtWYH.js deleted file mode 100644 index d1ffbce9..00000000 --- a/app/smartbrain_3000/web/_app/immutable/chunks/BJLLtWYH.js +++ /dev/null @@ -1,3 +0,0 @@ -var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=Array.isArray,d=Array.prototype.indexOf,f=Array.prototype.includes,p=Array.from,m=Object.defineProperty,h=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyDescriptors,_=Object.prototype,v=Array.prototype,y=Object.getPrototypeOf,b=Object.isExtensible,x=()=>{};function S(e){return e()}function ee(e){for(var t=0;t{e=n,t=r}),resolve:e,reject:t}}var C=1024,w=2048,ne=4096,re=8192,ie=16384,ae=32768,oe=1<<25,se=65536,ce=1<<19,le=1<<20,ue=1<<25,de=1<<21,fe=1<<22,pe=1<<23,me=Symbol(`$state`),he=Symbol(`component`),ge=Symbol(`legacy props`),_e=Symbol(``),ve=Symbol(`attributes`),ye=Symbol(`class`),be=Symbol(`style`),xe=Symbol(`text`),Se=Symbol(`form reset`),Ce=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},we=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),Te={},T=Symbol(`uninitialized`),Ee=`http://www.w3.org/1999/xhtml`,De=`http://www.w3.org/2000/svg`,Oe=`http://www.w3.org/1998/Math/MathML`;function ke(){console.warn(`https://svelte.dev/e/derived_inert`)}function Ae(e){console.warn(`https://svelte.dev/e/hydratable_missing_but_expected`)}function je(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Me(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function Ne(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var E=!1;function D(e){E=e}var O;function k(e){if(e===null)throw je(),Te;return O=e}function Pe(){return k(R(O))}function Fe(e){if(E){if(R(O)!==null)throw je(),Te;O=e}}function Ie(e=1){if(E){for(var t=e,n=O;t--;)n=R(n);O=n}}function Le(e=!0){for(var t=0,n=O;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=R(n);e&&n.remove(),n=i}}function Re(e){if(!e||e.nodeType!==8)throw je(),Te;return e.data}function ze(e){return e===this.v}function Be(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Ve(e){return!Be(e,this.v)}function He(e){throw Error(`https://svelte.dev/e/experimental_async_required`)}function Ue(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function We(){throw Error(`https://svelte.dev/e/missing_context`)}function Ge(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Ke(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function qe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Je(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Ye(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Xe(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ze(){throw Error(`https://svelte.dev/e/fork_discarded`)}function Qe(){throw Error(`https://svelte.dev/e/fork_timing`)}function $e(){throw Error(`https://svelte.dev/e/get_abort_signal_outside_reaction`)}function et(){throw Error(`https://svelte.dev/e/hydration_failed`)}function tt(e){throw Error(`https://svelte.dev/e/lifecycle_legacy_only`)}function nt(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function rt(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function it(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function at(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function ot(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var st=!1;function ct(){st=!0}function lt(e,t,n){let r={};return[()=>(n(r)||We(),e(r)),e=>t(r,e),()=>n(r)]}function ut(e){let t=e.p;for(;t!==null&&t.c===null;)t=t.p;return t?.c??null}function dt(e,t){return e===null&&Ue(t),e.c??=new Map(ut(e)||void 0)}var A=null;function ft(e){A=e}function pt(){return lt(mt,ht,gt)}function mt(e){return dt(A,`getContext`).get(e)}function ht(e,t){return dt(A,`setContext`).set(e,t),t}function gt(e){return dt(A,`hasContext`).has(e)}function _t(){return dt(A,`getAllContexts`)}function vt(e,t=!1,n){A={p:A,i:!1,c:null,e:null,s:e,x:null,r:K,l:st&&!t?{s:null,u:null,$:[]}:null}}function yt(e){var t=A,n=t.e;if(n!==null){t.e=null;for(var r of n)Yn(r)}return e!==void 0&&(t.x=e),t.i=!0,A=t.p,bt(e)}function bt(e={}){return m(e,he,{value:!0}),e}function xt(){return!st||A!==null&&A.l===null}var St=[];function Ct(){var e=St;St=[],ee(e)}function j(e){if(St.length===0&&!Xt){var t=St;queueMicrotask(()=>{t===St&&Ct()})}St.push(e)}function wt(){for(;St.length>0;)Ct()}var Tt=~(w|ne|C);function M(e,t){e.f=e.f&Tt|t}function Et(e){e.f&512||e.deps===null?M(e,C):M(e,ne)}function Dt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),M(e,C)}function Ot(e){E&&L(e)!==null&&zn(e)}var kt=!1;function At(){kt||(kt=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[Se]?.()})},{capture:!0}))}function jt(e){var t=U,n=K;G(null),q(null);try{return e()}finally{G(t),q(n)}}function Mt(e,t,n,r=n){e.addEventListener(t,()=>jt(n));let i=e[Se];e[Se]=i?()=>{i(),r(!0)}:()=>r(!0),At()}function Nt(e,t,n,r){let i=xt()?Lt:Vt;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=K,c=Pt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){z(e,s)}Ft()}}var d=It();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>zt(e))).then(u).catch(e=>z(e,s)).finally(d)}l?l.then(()=>{c(),f(),Ft()}):f()}function Pt(){var e=K,t=U,n=A,r=N;return function(i=!0){q(e),G(t),ft(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Ft(e=!0){q(null),G(null),ft(null),e&&N?.deactivate()}function It(){var e=K,t=e.b,n=N,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function Lt(e){var t=2|w;return K!==null&&(K.f|=ce),{ctx:A,deps:null,effects:null,equals:ze,f:t,fn:e,reactions:null,rv:0,v:T,wv:0,parent:K,ac:null}}var Rt=Symbol(`obsolete`);function zt(e,t,n){let r=K;r===null&&Ge();var i=void 0,a=_n(T),o=!U,s=new Set;return $n(()=>{var t=K,n=te();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==Ce&&n.reject(e)}).finally(Ft)}catch(e){n.reject(e),Ft()}var c=N;if(o){if(t.f&32768)var l=It();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Rt);else for(let e of s.values())e.reject(Rt);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Rt&&(c.activate(),t?(a.f|=pe,Sn(a,t)):(a.f&8388608&&(a.f^=pe),Sn(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),qn(()=>{for(let e of s)e.reject(Rt)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function Bt(e){let t=Lt(e);return vr(t),t}function Vt(e){let t=Lt(e);return t.equals=Ve,t}function Ht(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n{t.ac.abort(Ce),t.ac=null}),t.fn!==null&&(t.teardown=x),Ar(t,0),ir(t))}function Kt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&jr(t)}var qt=null,N=null,Jt=null,P=null,Yt=null,Xt=!1,Zt=!1,Qt=null,$t=null,en=0,tn=1,nn=class e{id=tn++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){qt===null?qt=this:(qt.#n=this,this.#t=qt),qt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)M(r,w),t(r);for(r of n.m)M(r,ne),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=C}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),M(e,w),this.schedule(e);for(let e of this.#d)M(e,ne),this.schedule(e);this.apply();for(var t=Qt=[],n=[],r=$t=[];this.#c.length>0;){en++>1e3&&(this.#S(),an());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw dn(e),this.#h()||this.discard(),t}}if(N=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Qt=null,$t=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)un(e,t);r.length>0&&N.#_();return}let a=this.#y();if(a){this.#x(n),this.#x(t),a.#b(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),Jt=this,sn(n),sn(t),Jt=null,this.#s?.resolve();var o=N;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(mn.clear(),o.#_())}#v(e,t,n){e.f^=C;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=C:i&4?t.push(r):Tr(r)&&(i&16&&this.#d.add(r),jr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),M(i,w),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),N=this,this.#_()}#x(e){for(var t=0;t{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=te()).promise}static ensure(){if(N===null){let t=N=new e;!Zt&&!Xt&&j(()=>{t.#e||t.flush()})}return N}apply(){P=null}schedule(e){if(Yt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?qt=e:t.#t=e,this.linked=!1}}};function rn(e){var t=Xt;Xt=!0;try{var n;for(e&&(N!==null&&!N.is_fork&&N.flush(),n=e());;){if(wt(),N===null)return n;N.flush()}}finally{Xt=t}}function an(){try{Xe()}catch(e){z(e,Yt)}}var on=null;function sn(e){var t=e.length;if(t!==0){for(var n=0;n0)){mn.clear();for(let e of on){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)on.has(n)&&(on.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||jr(n)}}on.clear()}}on=null}}function cn(e,t){if(e.reactions!==null)for(let n of e.reactions){let e=n.f;e&2?cn(n,t):e&131072&&(M(n,w),t.add(n))}}function ln(e){N.schedule(e)}function un(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),M(e,C);for(var n=e.first;n!==null;)un(n,t),n=n.next}}function dn(e){M(e,C);for(var t=e.first;t!==null;)dn(t),t=t.next}function fn(e){He(`fork`),N!==null&&Qe();var t=nn.ensure();t.is_fork=!0,P=new Map;var n=!1,r=t.settled();return rn(e),{commit:async()=>{if(n){await r;return}t.linked||Ze(),n=!0,t.is_fork=!1;for(var[e,[i]]of t.current)e.v=i,e.wv=wr();rn(()=>{var e=new Set;for(var n of t.current.keys())cn(n,e);hn(e),Cn()}),t.flush(),await r},discard:()=>{for(var e of t.current.keys())e.wv=wr();!n&&t.linked&&t.discard()}}}var pn=new Set,mn=new Map;function hn(e){pn=e}var gn=!1;function _n(e,t){return{f:0,v:e,reactions:null,equals:ze,rv:0,wv:0}}function vn(e,t){let n=_n(e,t);return vr(n),n}function yn(e,t=!1,n=!0){let r=_n(e);return t||(r.equals=Ve),st&&n&&A!==null&&A.l!==null&&(A.l.s??=[]).push(r),r}function F(e,t,n=!1){return U!==null&&(!W||U.f&131072)&&xt()&&U.f&4325394&&(_r===null||!_r.has(e))&&at(),Sn(e,n?Dn(t):t,$t)}var bn=null,xn=0;function Sn(e,t,n=null){if(!e.equals(t)){hr?mn.set(e,t):mn.has(e)||mn.set(e,e.v);var r=nn.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Ut(t),P===null&&Et(t)}e.wv=wr(),bn=null,xn=0,En(e,w,n),bn=null,xt()&&K!==null&&K.f&1024&&!(K.f&96)&&(X===null?yr([e]):X.push(e)),!r.is_fork&&pn.size>0&&!gn&&Cn()}return t}function Cn(){gn=!1;for(let e of pn){e.f&1024&&M(e,ne);let t;try{t=Tr(e)}catch{t=!0}t&&jr(e)}pn.clear()}function wn(e,t=1){var n=Z(e),r=t===1?n++:n--;return F(e,n),r}function Tn(e){F(e,e.v+1)}function En(e,t,n){var r=e.reactions;if(r!==null){var i=xt(),a=r.length;if(xn+=a,xn>1e5&&bn===null&&(bn=new Set),bn!==null){if(bn.has(e))return;bn.add(e)}for(var o=0;o{if(Sr===o)return e();var t=U,n=Sr;G(null),Cr(o);var r=e();return G(t),Cr(n),r};return r&&n.set(`length`,vn(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&rt();var i=n.get(t);return i===void 0?s(()=>{var e=vn(r.value,a);return n.set(t,e),e}):F(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>vn(T,a));n.set(t,e),Tn(i)}}else F(r,T),Tn(i);return!0},get(t,r,i){if(r===me)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||h(t,r)?.writable)&&(o=s(()=>vn(Dn(c?t[r]:T),a)),n.set(r,o)),o!==void 0){var l=Z(o);return l===T?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),i=n.get(t);if(i!==void 0){var a=Z(i);if(a===T)return;if(r&&`value`in r)r.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return r},has(e,t){if(t===me)return!0;var r=n.get(t),i=r!==void 0&&r.v!==T||Reflect.has(e,t);return(r!==void 0||K!==null&&(!i||h(e,t)?.writable))&&(r===void 0&&(r=s(()=>vn(i?Dn(e[t]):T,a)),n.set(t,r)),Z(r)===T)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;dvn(T,a)),n.set(d+``,f)):F(f,T)}if(l===void 0)(!u||h(e,t)?.writable)&&(l=s(()=>vn(void 0,a)),F(l,Dn(o)),n.set(t,l));else{u=l.v!==T;var p=s(()=>Dn(o));F(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var g=n.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&F(g,_+1)}Tn(i)}return!0},ownKeys(e){Z(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==T});for(var[r,a]of n)a.v!==T&&!(r in e)&&t.push(r);return t},setPrototypeOf(){it()}})}function On(e){try{if(typeof e==`object`&&e&&me in e)return e[me]}catch{}return e}function kn(e,t){return Object.is(On(e),On(t))}var An,jn,Mn,Nn;function Pn(){if(An===void 0){An=window,jn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Mn=h(t,`firstChild`).get,Nn=h(t,`nextSibling`).get,b(e)&&(e[ye]=void 0,e[ve]=null,e[be]=void 0,e.__e=void 0),b(n)&&(n[xe]=void 0)}}function I(e=``){return document.createTextNode(e)}function L(e){return Mn.call(e)}function R(e){return Nn.call(e)}function Fn(e,t){if(!E)return L(e);var n=L(O);if(n===null)n=O.appendChild(I());else if(t&&n.nodeType!==3){var r=I();return n?.before(r),k(r),r}return t&&Hn(n),k(n),n}function In(e,t=!1){if(!E){var n=L(e);return n instanceof Comment&&n.data===``?R(n):n}if(t){if(O?.nodeType!==3){var r=I();return O?.before(r),k(r),r}Hn(O)}return O}function Ln(e,t=!1){if(!E)return L(e);var n=Fn(e,t);return Fe(e),n}function Rn(e,t=1,n=!1){let r=E?O:e;for(var i;t--;)i=r,r=R(r);if(!E)return r;if(n){if(r?.nodeType!==3){var a=I();return r===null?i?.after(a):r.before(a),k(a),a}Hn(r)}return k(r),r}function zn(e){e.textContent=``}function Bn(){return!1}function Vn(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function Hn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Un(e){var t=K;if(t===null)return U.f|=pe,e;if(!(t.f&32768)&&!(t.f&4))throw e;z(e,t)}function z(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function Wn(e){K===null&&(U===null&&Ye(e),Je()),hr&&qe(e)}function Gn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function B(e,t){var n=K;n!==null&&n.f&8192&&(e|=re);var r={ctx:A,deps:null,nodes:null,f:e|w|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};N?.register_created_effect(r);var i=r;if(e&4)Qt===null?nn.ensure().schedule(r):Qt.push(r);else if(t!==null){try{jr(r)}catch(e){throw H(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=se))}if(i!==null&&(i.parent=n,n!==null&&Gn(i,n),U!==null&&U.f&2&&!(e&64))){var a=U;(a.effects??=[]).push(i)}return r}function Kn(){return U!==null&&!W}function qn(e){let t=B(8,null);return M(t,C),t.teardown=e,t}function Jn(e){Wn(`$effect`);var t=K.f;if(!U&&t&32&&A!==null&&!A.i){var n=A;(n.e??=[]).push(e)}else return Yn(e)}function Yn(e){return B(4|le,e)}function Xn(e){return Wn(`$effect.pre`),B(8|le,e)}function Zn(e){nn.ensure();let t=B(64|ce,e);return(e={})=>new Promise(n=>{e.outro?cr(t,()=>{H(t),n(void 0)}):(H(t),n(void 0))})}function Qn(e){return B(4,e)}function $n(e){return B(fe|ce,e)}function er(e,t=0){return B(8|t,e)}function tr(e,t=[],n=[],r=[]){Nt(r,t,n,t=>{B(8,()=>{e(...t.map(Z))})})}function nr(e,t=0){return B(16|t,e)}function V(e){return B(32|ce,e)}function rr(e){var t=e.teardown;if(t!==null){let n=hr,r=U;gr(!0),G(null);try{t.call(null)}catch(t){z(t,e.parent)}finally{gr(n),G(r)}}}function ir(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&jt(()=>{e.abort(Ce)});var r=n.next;n.f&64?n.parent=null:H(n,t),n=r}}function ar(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||H(t),t=n}}function H(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(or(e.nodes.start,e.nodes.end),n=!0),e.f|=oe,ir(e,t&&!n),Ar(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();rr(e),e.f^=oe,e.f|=ie;var i=e.parent;i!==null&&i.first!==null&&sr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function or(e,t){for(;e!==null;){var n=e===t?null:R(e);e.remove(),e=n}}function sr(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function cr(e,t,n=!0){var r=[];e.f|=256,lr(e,r,!0);var i=()=>{n&&H(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function lr(e,t,n){if(!(e.f&8192)){e.f^=re;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);lr(i,t,o?n:!1)}i=a}}}function ur(e){e.f&=-257,dr(e,!0)}function dr(e,t){if(!(e.f&256)&&e.f&8192){e.f^=re,e.f&1024||(M(e,w),nn.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);dr(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function fr(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:R(n);t.append(n),n=i}}var pr=null,mr=!1,hr=!1;function gr(e){hr=e}var U=null,W=!1;function G(e){U=e}var K=null;function q(e){K=e}var _r=null;function vr(e){U!==null&&(U.f&2097152||U.f&2)&&(_r??=new Set).add(e)}var J=null,Y=0,X=null;function yr(e){X=e}var br=1,xr=0,Sr=xr;function Cr(e){Sr=e}function wr(){return++br}function Tr(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;ie.wv)return!0}t&512&&P===null&&M(e,C)}return!1}function Er(e,t,n=!0){var r=e.reactions;if(r!==null&&!(_r!==null&&_r.has(e)))for(var i=0;i{e.ac.abort(Ce)}),e.ac=null);try{e.f|=de;var u=e.fn,d=u();e.f|=ae;var f=Or(e);if(xt()&&X!==null&&!W&&f!==null&&!(e.f&6146))for(var p=0;p0)for(t.length=Y+J.length,r=0;r{a.ac.abort(Ce),a.ac=null,M(a,w)}),Gt(a),Ar(a,0)}}function Ar(e,t){var n=e.deps;if(n!==null)for(var r=t;rn?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,j(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function Wr(e,t,n,r,i){var a={capture:r,passive:i},o=Ur(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&qn(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function Gr(e,t,n){(t[Br]??={})[e]=n}function Kr(e){for(var t=0;t{Jr=!1,qr=null}));var o=0,s=qr===e&&e[Br];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[Br]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){m(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=U,d=K;G(null),q(null);try{for(var f,p=[];a!==null&&a!==t;){try{var h=a[Br]?.[r];h!=null&&(!a.disabled||e.target===a)&&h.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o{throw e});throw f}}finally{e[Br]=t,delete e.currentTarget,G(u),q(d)}}}var Xr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Zr(e){return Xr?.createHTML(e)??e}function Qr(e){var t=Vn(`template`);return t.innerHTML=Zr(e.replaceAll(``,``)),t.content}function $(e,t){var n=K;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function $r(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(``);return()=>{if(E)return $(O,null),O;i===void 0&&(i=Qr(a?e:``+e),n||(i=L(i)));var t=r||jn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=L(t),s=t.lastChild;$(o,s)}else $(t,t);return t}}function ei(e,t,n=`svg`){var r=!e.startsWith(``),i=!!(t&1),a=`<${n}>${r?e:``+e}`,o;return()=>{if(E)return $(O,null),O;if(!o){var e=L(Qr(a));if(i)for(o=document.createDocumentFragment();L(e);)o.appendChild(L(e));else o=L(e)}var t=o.cloneNode(!0);if(i){var n=L(t),r=t.lastChild;$(n,r)}else $(t,t);return t}}function ti(e,t){return ei(e,t,`svg`)}function ni(e=``){if(!E){var t=I(e+``);return $(t,t),t}var n=O;return n.nodeType===3?Hn(n):(n.before(n=I()),k(n)),$(n,n),n}function ri(){if(E)return $(O,null),O;var e=document.createDocumentFragment(),t=document.createComment(``),n=I();return e.append(t,n),$(t,n),e}function ii(e,t){if(E){var n=K;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=O),Pe();return}e!==null&&e.before(t)}function ai(){if(E&&O&&O.nodeType===8&&O.textContent?.startsWith(`$`)){let e=O.textContent.substring(1);return Pe(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function oi(e){let t=0,n=_n(0),r;return()=>{Kn()&&(Z(n),er(()=>(t===0&&(r=Q(()=>e(()=>Tn(n)))),t+=1,()=>{j(()=>{--t,t===0&&(r?.(),r=void 0,Tn(n))})})))}}var si=se|ce;function ci(e,t,n,r){new li(e,t,n,r)}var li=class{parent;is_pending=!1;transform_error;#e;#t=E?O:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=oi(()=>(this.#m=_n(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=K;t.b=this,t.f|=128,n(e)},this.parent=K.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=nr(()=>{if(E){let e=this.#t;Pe();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#y():this.#g()}else this.#b()},si),E&&(this.#e=O)}#g(){try{this.#a=V(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);j(r),t&&(this.#s=V(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{if(t){Ne();return}t=!0,n&&ot(),this.#s!==null&&cr(this.#s,()=>{this.#s=null}),this.#S(()=>{this.#b()})};return{reset:r,invoke_onerror:()=>{try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){z(e,this.#i&&this.#i.parent)}}}}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=V(()=>e(this.#e)),j(()=>{var e=this.#c=document.createDocumentFragment(),t=I(),n=!1;if(e.append(t),this.#a=this.#S(()=>{try{return V(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){z(e,this.#i.parent)}return null}}),this.#a===null){this.#c=null,n&&this.#x(N);return}this.#u===0&&(this.#e.before(e),this.#c=null,cr(this.#o,()=>{this.#o=null}),this.#x(N))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=V(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();fr(this.#a,e);let t=this.#n.pending;this.#o=V(()=>t(this.#e))}else this.#x(N)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Dt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#S(e){var t=K,n=U,r=A;q(this.#i),G(this.#i),ft(this.#i.ctx);try{return nn.ensure(),e()}finally{q(t),G(n),ft(r)}}#C(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#C(e,t);return}this.#u+=e,this.#u===0&&(this.#x(t),this.#o&&cr(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#C(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,j(()=>{this.#d=!1,this.#m&&Sn(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),Z(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;N?.is_fork?(this.#a&&N.skip_effect(this.#a),this.#o&&N.skip_effect(this.#o),this.#s&&N.skip_effect(this.#s),N.oncommit(()=>{this.#w(e)})):this.#w(e)}#w(e){this.#a&&=(H(this.#a),null),this.#o&&=(H(this.#o),null),this.#s&&=(H(this.#s),null),E&&(k(this.#t),Ie(),k(Le()));let t=this.#n.failed,n=e=>{let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&(this.#s=this.#S(()=>{try{return V(()=>{var r=K;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return z(e,this.#i.parent),null}}))};j(()=>{var t;try{t=this.transform_error(e)}catch(e){z(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>z(e,this.#i&&this.#i.parent)):n(t)})}};function ui(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[xe]??=e.nodeValue)&&(e[xe]=n,e.nodeValue=`${n}`)}function di(e,t){return mi(e,t)}function fi(e,t){Pn(),t.intro=t.intro??!1;let n=t.target,r=E,i=O;try{for(var a=L(n);a&&(a.nodeType!==8||a.data!==`[`);)a=R(a);if(!a)throw Te;D(!0),k(a);let r=mi(e,{...t,anchor:a});return D(!1),r}catch(r){if(r instanceof Error&&r.message.split(` -`).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw r;return r!==Te&&console.warn(`Failed to hydrate: `,r),t.recover===!1&&et(),Pn(),zn(n),D(!1),di(e,t)}finally{D(r),k(i)}}var pi=new Map;function mi(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){Pn();var c=void 0,l=Zn(()=>{var o=n??t.appendChild(I());ci(o,{pending:()=>{}},t=>{vt({});var n=A;if(a&&(n.c=a),i&&(r.$$events=i),E&&$(t,null),c=e(t,r)||bt(),E&&(K.nodes.end=O,O===null||O.nodeType!==8||O.data!==`]`))throw je(),Te;yt()},s);var l=new Set,u=e=>{for(var n=0;n{for(var e of l)for(let n of[t,document]){var r=pi.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Yr),r.delete(e),r.size===0&&pi.delete(n)):r.set(e,i)}Hr.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return hi.set(c,l),c}var hi=new WeakMap;function gi(e,t){let n=hi.get(e);return n?(hi.delete(e),n(t)):Promise.resolve()}var _i=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)ur(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(ur(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(H(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();fr(r,t),t.append(I()),this.#n.set(e,{effect:r,fragment:t})}else H(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),cr(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(H(n.effect),this.#n.delete(e))};ensure(e,t){var n=N,r=Bn();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=I();i.append(a),this.#n.set(e,{effect:V(()=>t(a)),fragment:i})}else this.#t.set(e,V(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else E&&(this.anchor=O),this.#a(n)}};function vi(e,t,n=!1){var r;E&&(r=O,Pe());var i=new _i(e),a=n?se:0;function o(e,t){if(E){var n=Re(r);if(e!==parseInt(n.substring(1))){var a=Le();k(a),i.anchor=a,D(!1),i.ensure(e,t),D(!0);return}}i.ensure(e,t)}nr(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function yi(e,t){return t}function bi(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;xi(e,p(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null&&e.pending.size===0;if(c){var l=n,u=l.parentNode;zn(u),u.append(l),e.items.clear()}xi(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function xi(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i{var e=n();return u(e)?e:e==null?[]:p(e)}),f,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=l,Ti(v,f,o,t,r),l!==null&&(f.length===0?l.f&33554432?(l.f^=ue,Di(l,null,o)):ur(l):cr(l,()=>{l=null})))}function _(e){v.pending.delete(e)}var v={effect:nr(()=>{f=Z(d);var e=f.length;let c=!1;E&&Re(o)===`[!`!=(e===0)&&(o=Le(),k(o),D(!1),c=!0);for(var u=new Set,p=N,v=Bn(),y=0;ya(o)):(l=V(()=>a(Si??=I())),l.f|=ue)),e>u.size&&Ke(``,``,``),E&&e>0&&k(Le()),!h){if(m.set(p,u),v){for(let[e,t]of s)u.has(e)||p.skip_effect(t.e);p.oncommit(g),p.ondiscard(_)}else g(p)}c&&D(!0),Z(d)}),flags:t,items:s,pending:m,outrogroups:null,fallback:l};h=!1,E&&(o=O)}function wi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Ti(e,t,n,r,i){var a=!!(r&8),o=t.length,s=e.items,c=wi(e.effect.first),l,u=null,d,f=[],m=[],h,g,_,v;if(a)for(v=0;v0){var w=r&4&&o===0?n:null;if(a){for(v=0;v{if(d!==void 0)for(_ of d)_.nodes?.a?.apply()})}function Ei(e,t,n,r,i,a,o,s){var c=o&1?o&16?_n(n):yn(n,!1,!1):null,l=o&2?_n(i):null;return{v:c,i:l,e:V(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Di(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=R(r);if(a.before(r),r===i)return;r=o}}function Oi(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function ki(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;E&&(o=k(L(c)))}tr(()=>{var e=K;if(s===(s=t()??``)){E&&Pe();return}if(n&&!E){e.nodes=null,c.innerHTML=s,s!==``&&$(L(c),c.lastChild);return}if(e.nodes!==null&&(or(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(E){for(var a=O.data,l=Pe(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=R(l);if(l===null)throw je(),Te;$(O,u),o=k(l);return}var d=Vn(r?`svg`:i?`math`:`template`,r?De:i?Oe:void 0);d.innerHTML=s;var f=r||i?d:d.content;if($(L(f),f.lastChild),r||i)for(;L(f);)o.before(L(f));else o.before(f)}})}function Ai(e,t,...n){var r=new _i(e);nr(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},se)}function ji(e){return(t,...n)=>{var r=e(...n),i;E?(i=O,Pe()):(i=L(Qr(r.render().trim())),t.before(i));let a=r.setup?.(i);$(i,i),typeof a==`function`&&qn(a)}}function Mi(e,t,n){var r;E&&(r=O,Pe());var i=new _i(e);nr(()=>{var e=t()??null;if(E&&Re(r)===`[`!=(e!==null)){var a=Le();k(a),i.anchor=a,D(!1),i.ensure(e,e&&(t=>n(t,e))),D(!0);return}i.ensure(e,e&&(t=>n(t,e)))},se)}function Ni(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t=0;){var s=o+a;(o===0||Ii.includes(r[o-1]))&&(s===r.length||Ii.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Ri(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function zi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Bi(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(zi)),i&&c.push(...Object.keys(i).map(zi));var l=0,u=-1;let t=e.length;for(var d=0;d{t.every(Xi)||(`__defaultValue`in e&&Gi(e,!1),`__value`in e&&Ki(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),qn(()=>{t.disconnect()})}function Ji(e,t,n=t){var r=new WeakSet,i=!0;Mt(e,`change`,t=>{var i=t?`[selected]`:`:checked`,a;if(e.multiple)a=[].map.call(e.querySelectorAll(i),Yi);else{var o=e.querySelector(i)??e.querySelector(`option:not([disabled])`);a=o&&Yi(o)}n(a),e.__value=a,N!==null&&r.add(N)}),Qn(()=>{var a=t();if(e===document.activeElement){var o=N;if(r.has(o))return}if(Ki(e,a,i),i&&a===void 0){var s=e.querySelector(`:checked`);s!==null&&(a=Yi(s),n(a))}e.__value=a,i=!1})}function Yi(e){return`__value`in e?e.__value:e.value}function Xi(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var Zi=Symbol(`is custom element`),Qi=Symbol(`is html`),$i=we?`link`:`LINK`,ea=we?`progress`:`PROGRESS`;function ta(e){if(E){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;ia(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;ia(e,`checked`,null),e.checked=r}}};e[Se]=n,j(n),At()}}function na(e,t){var n=aa(e);n.value!==(n.value=t??void 0)&&(e.value!==t||t===0&&e.nodeName===ea)&&(e.value=t??``)}function ra(e,t){var n=aa(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function ia(e,t,n,r){var i=aa(e);E&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===$i)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[_e]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&sa(e).has(t)?e[t]=n:e.setAttribute(t,n))}function aa(e){return e[ve]??={[Zi]:e.nodeName.includes(`-`),[Qi]:e.namespaceURI===Ee}}var oa=new Map;function sa(e){var t=e.getAttribute(`is`)||e.nodeName,n=oa.get(t);if(n)return n;oa.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=g(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=y(i)}return n}function ca(e,t,n=t){var r=new WeakSet;Mt(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=pa(e)?ma(a):a,n(a),N!==null&&r.add(N),await Mr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(E&&e.defaultValue!==e.value||Q(t)==null&&e.value)&&(n(pa(e)?ma(e.value):e.value),N!==null&&r.add(N)),er(()=>{var n=t();if(e===document.activeElement){var i=N;if(r.has(i))return}pa(e)&&n===ma(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}var la=new Set;function ua(e,t,n,r,i=r){var a=n.getAttribute(`type`)===`checkbox`,o=e;let s=!1;if(t!==null)for(var c of t)o=o[c]??=[];o.push(n),Mt(n,`change`,()=>{var e=n.__value;a&&(e=fa(o,e,n.checked)),i(e)},()=>i(a?[]:null)),er(()=>{var e=r();if(E&&n.defaultChecked!==n.checked){s=!0;return}a?(e||=[],n.checked=e.includes(n.__value)):n.checked=kn(n.__value,e)}),qn(()=>{var e=o.indexOf(n);e!==-1&&o.splice(e,1)}),la.has(o)||(la.add(o),j(()=>{o.sort((e,t)=>e.compareDocumentPosition(t)===4?-1:1),la.delete(o)})),j(()=>{if(s){var e=a?fa(o,e,n.checked):o.find(e=>e.checked)?.__value;i(e)}})}function da(e,t,n=t){Mt(e,`change`,t=>{n(t?e.defaultChecked:e.checked)}),(E&&e.defaultChecked!==e.checked||Q(t)==null)&&n(e.checked),er(()=>{e.checked=!!t()})}function fa(e,t,n){for(var r=new Set,i=0;i{n(e.files)}),E&&e.files&&n(e.files),er(()=>{e.files=t()})}var ga=new class e{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(e){this.#n=e}observe(e,t){var n=this.#e.get(e)||new Set;return n.add(t),this.#e.set(e,n),this.#r().observe(e,this.#n),()=>{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function _a(e,t,n){var r=ga.observe(e,()=>n(e[t]));Qn(()=>(Q(()=>n(e[t])),r))}function va(e,t){return e===t||e?.[me]===t}function ya(e=bt(),t,n,r){var i=A.r,a=K;return Qn(()=>{var o,s;return er(()=>{o=s,s=r?.()||[],Q(()=>{va(n(...s),e)||(t(e,...s),o&&va(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&va(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function ba(e,t,n,r,i){var a=()=>{r(n[e])};n.addEventListener(t,a),i?er(()=>{n[e]=i()}):a(),(n===document.body||n===window||n===document)&&qn(()=>{n.removeEventListener(t,a)})}function xa(e=!1){let t=A,n=t.l.u;if(!n)return;let r=()=>Ir(t.s);if(e){let e=0,n={},i=Lt(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>Z(i)}n.b.length&&Xn(()=>{Sa(t,r),ee(n.b)}),Jn(()=>{let e=Q(()=>n.m.map(S));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&Jn(()=>{Sa(t,r),ee(n.a)})}function Sa(e,t){if(e.l.s)for(let t of e.l.s)Z(t);t()}var Ca=[];function wa(e,t=x){let n=null,r=new Set;function i(t){if(Be(e,t)&&(e=t,n)){let t=!Ca.length;for(let t of r)t[1](),Ca.push(t,e);if(t){for(let e=0;e{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:a,subscribe:o}}var Ta=!1;function Ea(e){var t=Ta;try{return Ta=!1,[e(),Ta]}finally{Ta=t}}function Da(e,t,n,r){var i=!st||!!(n&2),a=!!(n&8),o=!!(n&16),s=r,c=!0,l=void 0,u=()=>o&&i?(l??=Lt(r),Z(l)):(c&&(c=!1,s=o?Q(r):r),s);let d;if(a){var f=me in e||ge in e;d=h(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=Ea(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&nt(t),d(p)));var g=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return g;if(d){var _=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||_||m)&&d(t?g():e),e):g()})}var v=!1,y=(n&1?Lt:Vt)(()=>(v=!1,g()));a&&Z(y);var b=K;return(function(e,t){if(arguments.length>0){let n=t?Z(y):i&&a?Dn(e):e;return F(y,n),v=!0,s!==void 0&&(s=n),e}return hr&&v||b.f&16384?y.v:Z(y)})}function Oa(e){return class extends ka{constructor(t){super({component:e,...t})}}}var ka=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=yn(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return Z(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===ge||(Z(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return F(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?fi:di)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),(!e?.props?.$$host||e.sync===!1)&&rn(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e!==`$set`&&e!==`$destroy`&&e!==`$on`&&m(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{gi(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}};function Aa(e,t){if(He(`hydratable`),E){let t=window.__svelte?.h;if(t?.has(e))return t.get(e);Ae(e)}return t()}var ja=s({afterUpdate:()=>Ra,beforeUpdate:()=>La,createContext:()=>pt,createEventDispatcher:()=>Ia,createRawSnippet:()=>ji,flushSync:()=>rn,fork:()=>fn,getAbortSignal:()=>Ma,getAllContexts:()=>_t,getContext:()=>mt,hasContext:()=>gt,hydratable:()=>Aa,hydrate:()=>fi,mount:()=>di,onDestroy:()=>Pa,onMount:()=>Na,setContext:()=>ht,settled:()=>Nr,tick:()=>Mr,unmount:()=>gi,untrack:()=>Q});function Ma(){return U===null&&$e(),(U.ac??=new AbortController).signal}function Na(e){A===null&&Ue(`onMount`),st&&A.l!==null?za(A).m.push(e):Jn(()=>{let t=Q(e);if(typeof t==`function`)return t})}function Pa(e){A===null&&Ue(`onDestroy`),Na(()=>()=>Q(e))}function Fa(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Ia(){let e=A;return e===null&&Ue(`createEventDispatcher`),(t,n,r)=>{let i=e.s.$$events?.[t];if(i){let a=u(i)?i.slice():[i],o=Fa(t,n,r);for(let t of a)t.call(e.x,o);return!o.defaultPrevented}return!0}}function La(e){A===null&&Ue(`beforeUpdate`),A.l===null&&tt(`beforeUpdate`),za(A).b.push(e)}function Ra(e){A===null&&Ue(`afterUpdate`),A.l===null&&tt(`afterUpdate`),za(A).a.push(e)}function za(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}export{Dn as $,vi as A,Wr as B,Vi as C,ki as D,Ai as E,ti as F,tr as G,Nr as H,ai as I,An as J,Jn as K,ni as L,ii as M,ri as N,Ci as O,$r as P,Rn as Q,Kr as R,Ui as S,Mi as T,Mr as U,Z as V,Q as W,In as X,Fn as Y,Ln as Z,ra as _,Da as a,Ot as at,qi as b,ba as c,vt as ct,da as d,Ie as dt,F as et,ha as f,Fe as ft,ia as g,l as gt,ta as h,s as ht,Oa as i,Bt as it,ui as j,yi as k,ya as l,ht as lt,ca as m,o as mt,Pa as n,wn as nt,wa as o,mt as ot,ua as p,x as pt,Xn as q,Na as r,Vt as rt,xa as s,yt as st,ja as t,vn as tt,_a as u,ct as ut,na as v,Fi as w,Ki as x,Ji as y,Gr as z}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/CEPrmzat.js b/app/smartbrain_3000/web/_app/immutable/chunks/Be3BkmPa.js similarity index 98% rename from app/smartbrain_3000/web/_app/immutable/chunks/CEPrmzat.js rename to app/smartbrain_3000/web/_app/immutable/chunks/Be3BkmPa.js index 8348e012..d22c10da 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/CEPrmzat.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/Be3BkmPa.js @@ -1 +1 @@ -import{D as e,F as t,G as n,M as r,a as i,ct as a,ft as o,g as s,st as c}from"./BJLLtWYH.js";import"./xihTtKlq.js";var l={sun:``,moon:``,"sun-moon":``,"more-horizontal":``,x:``,check:``,"chevron-down":``,"chevron-right":``,search:``,plus:``,send:``,stop:``,copy:``,refresh:``,pencil:``,trash:``,upload:``,download:``,file:``,vault:``,link:``,lock:``,shield:``,warn:``,help:``,chat:``,book:``,tasks:``,clock:``,mail:``,activity:``,info:``,chart:``,sliders:``,monitor:``,"arrow-down":``,"arrow-up":``,mic:``,speaker:``,zap:``},u=t(``);function d(t,d){a(d,!0);let f=i(d,`size`,3,16),p=i(d,`label`,3,``);var m=u();e(m,()=>l[d.name],!0),o(m),n(()=>{s(m,`width`,f()),s(m,`height`,f()),s(m,`role`,p()?`img`:void 0),s(m,`aria-label`,p()||void 0),s(m,`aria-hidden`,!p()||void 0)}),r(t,m),c()}export{l as n,d as t}; \ No newline at end of file +import{D as e,F as t,G as n,M as r,a as i,ct as a,ft as o,g as s,st as c}from"./BChu7Pos.js";import"./xihTtKlq.js";var l={sun:``,moon:``,"sun-moon":``,"more-horizontal":``,x:``,check:``,"chevron-down":``,"chevron-right":``,search:``,plus:``,send:``,stop:``,copy:``,refresh:``,pencil:``,trash:``,upload:``,download:``,file:``,vault:``,link:``,lock:``,shield:``,warn:``,help:``,chat:``,book:``,tasks:``,clock:``,mail:``,activity:``,info:``,chart:``,sliders:``,monitor:``,"arrow-down":``,"arrow-up":``,mic:``,speaker:``,zap:``},u=t(``);function d(t,d){a(d,!0);let f=i(d,`size`,3,16),p=i(d,`label`,3,``);var m=u();e(m,()=>l[d.name],!0),o(m),n(()=>{s(m,`width`,f()),s(m,`height`,f()),s(m,`role`,p()?`img`:void 0),s(m,`aria-label`,p()||void 0),s(m,`aria-hidden`,!p()||void 0)}),r(t,m),c()}export{l as n,d as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/BkiVJrb-.js b/app/smartbrain_3000/web/_app/immutable/chunks/BkiVJrb-.js new file mode 100644 index 00000000..14e5c388 --- /dev/null +++ b/app/smartbrain_3000/web/_app/immutable/chunks/BkiVJrb-.js @@ -0,0 +1 @@ +import{$ as e}from"./BChu7Pos.js";import{t}from"./Czex3Sq4.js";import"./DETRq8nR.js";import{a as n,c as r,d as i,f as a,g as o,i as s,l as c,m as l,n as u,p as d,r as f,t as p,u as m,v as ee}from"./CQMDLFxa.js";function te(e){let t=[];if(typeof e.forEach==`function`)e.forEach(e=>t.push(e));else for(let n of e)t.push(n);let n=``,r=``;for(let e of t)e.type===`candidate-pair`&&(e.nominated||e.state===`succeeded`)&&(n=e.localCandidateId??``,r=e.remoteCandidateId??``);if(!n||!r)return`unknown`;let i=``,a=``;for(let e of t)e.id===n?i=e.candidateType??``:e.id===r&&(a=e.candidateType??``);return i===`relay`||a===`relay`?`relay`:i&&a?`direct`:`unknown`}var h=e({status:`idle`,detail:``,needsPairing:!1});function g(e,t=``){h.status=e,h.detail=t}var _=3e3,v=6e4,y=1e3,b=3e4,x=15e3,S=6,C=2e4,w=45e3,T=800,ne=`Desktop unreachable — it may be off or asleep. If it's on a VPN, turning the VPN off on the Desktop often fixes this — then Retry.`,E=`your Desktop is locked — unlock it there, then this phone reconnects`,re=class{pairing;pc=null;ws=null;channel=null;pending=new Map;ready=null;markReady=null;failReady=null;nonceB64=``;desktopVerified=!1;lockedHint=!1;seq=0;closed=!1;reconnects=0;connectTimer=null;pingTimer=null;verifyTimer=null;lastPong=0;offerSent=!1;iceWaitTimer=null;constructor(e){this.pairing=e}connect(){this.closed=!1,this.offerSent=!1,this.ready=new Promise((e,t)=>{this.markReady=e,this.failReady=t}),this.ready.catch(()=>{}),g(`connecting`),this.connectTimer=setTimeout(()=>this.onConnectFailure(),x),this.pc=new RTCPeerConnection({iceServers:this.pairing.iceServers}),this.pc.onconnectionstatechange=()=>this.onPcState(),this.channel=this.pc.createDataChannel(`sb-api`),this.channel.onopen=()=>this.startHandshake(),this.channel.onmessage=e=>this.onChannelMessage(String(e.data)),this.openSignaling()}openSignaling(){let e=new WebSocket(this.pairing.signalingUrl);this.ws=e,e.onopen=()=>{e.send(JSON.stringify({role:`phone`,desktop_id:this.pairing.desktopId})),this.iceWaitTimer=setTimeout(()=>void this.makeOffer(),T)},e.onerror=()=>g(`offline`,`can't reach the signaling service`),e.onmessage=e=>this.onSignal(String(e.data))}async makeOffer(){if(!this.pc||this.offerSent)return;this.offerSent=!0,this.iceWaitTimer&&=(clearTimeout(this.iceWaitTimer),null),await this.pc.setLocalDescription(await this.pc.createOffer()),await this.iceGatheringDone();let e=this.pc.localDescription?.sdp??``;this.send({type:`offer`,sdp:e})}iceGatheringDone(){let e=this.pc;return!e||e.iceGatheringState===`complete`?Promise.resolve():new Promise(t=>{let n=()=>{e.iceGatheringState===`complete`&&r()},r=()=>{e.removeEventListener(`icegatheringstatechange`,n),clearTimeout(i),t()},i=setTimeout(r,_);e.addEventListener(`icegatheringstatechange`,n)})}async onSignal(e){let t;try{t=JSON.parse(e)}catch{return}if(t.type===`ice`&&Array.isArray(t.iceServers)){if(this.pc&&!this.offerSent)try{this.pc.setConfiguration({iceServers:t.iceServers})}catch{}this.makeOffer()}else t.type===`answer`&&t.sdp&&this.pc?await this.pc.setRemoteDescription({type:`answer`,sdp:t.sdp}):t.type===`error`&&g(`offline`,t.detail||`the Desktop isn't reachable`)}startHandshake(){this.nonceB64=u(),this.send(void 0,c(this.nonceB64))}async onChannelMessage(e){let t;try{t=d(e)}catch{return}let r=t.type;if(r===`hello_ok`)return this.onHelloOk(t);if(r===`locked_challenge`&&!this.desktopVerified)this.send({type:`whoami`,device_id:this.pairing.deviceId});else if(r===`auth_error`&&t.reason===`locked`&&!this.desktopVerified)this.lockedHint=!0,this.onConnectFailure();else if(this.desktopVerified){if(r===`auth_ok`)return this.onAuthOk();if(r===`pong`)this.lastPong=Date.now();else if(r===`auth_error`)g(`offline`,t.reason===`locked`?E:`this device isn't authorized — re-pair`),this.failReady?.(Error(`auth_error`)),this.close();else{if(a(t))return this.onChunkFrame(t);typeof t.status==`number`&&this.resolvePending(n(t))}}}async onHelloOk(e){g(`verifying`);let t=this.pc?.localDescription?.sdp??``,n=this.pc?.remoteDescription?.sdp??``,i=!1;try{let r=await p(t,n);i=await f(this.pairing.desktopPubkey,this.nonceB64,r,String(e.signature??``))}catch{i=!1}!i||e.pubkey!==this.pairing.desktopPubkey?(g(`untrusted`,`couldn't verify your Desktop — connection blocked`),this.failReady?.(Error(`untrusted`)),this.close()):(this.desktopVerified=!0,this.send(void 0,r(this.pairing.deviceId,this.pairing.credential)))}async onAuthOk(){this.connectTimer&&=(clearTimeout(this.connectTimer),null),this.lastPong=Date.now(),this.pingTimer=setInterval(()=>this.pingTick(),C);let e=await this.connectionKind();g(e===`relay`?`connected-relay`:e===`direct`?`connected-direct`:`connected`),this.markReady?.()}async connectionKind(){if(!this.pc)return`unknown`;try{return te(await this.pc.getStats())}catch{return`unknown`}}pingTick(){this.closed||this.channel?.readyState!==`open`||(l(this.lastPong,Date.now(),w)?this.onConnectFailure():this.send(void 0,m(Date.now())))}onPcState(){let e=this.pc?.connectionState;this.closed||(e===`connected`&&(this.reconnects=0),e===`connected`&&(this.lockedHint=!1),(e===`failed`||e===`disconnected`)&&this.onConnectFailure())}onConnectFailure(){if(this.closed)return;if(this.teardown(),this.reconnects>=S){this.failTerminal();return}g(`reconnecting`,this.lockedHint?E:``);let e=Math.min(b,y*2**this.reconnects),t=e/2+e/2*Math.random();this.reconnects+=1,setTimeout(()=>{this.closed||this.connect()},t)}failTerminal(){this.closed=!0,this.teardown(),g(`offline`,this.lockedHint?E:ne)}async request(e,t,n,r){if(!this.ready)throw Error(`not connecting`);await this.ready;let a=String(++this.seq),o=i(a,e,t,n,r);return new Promise((e,t)=>{let n=setTimeout(()=>{this.pending.delete(a),t(Error(`remote request timed out`))},v);this.pending.set(a,{resolve:e,reject:t,timer:n,chunks:null});try{for(let e of o)this.channel?.send(e)}catch(e){clearTimeout(n),this.pending.delete(a),t(e instanceof Error?e:Error(`send failed`))}})}isLive(){let e=this.pc?.connectionState;return e===`new`||e===`connecting`||e===`connected`}verify(e=2500){if(this.closed)return;if(!this.isLive()||this.channel?.readyState!==`open`){this.onConnectFailure();return}if(this.lastPong===0)return;let t=this.lastPong;try{this.send(void 0,m(Date.now()))}catch{this.onConnectFailure();return}this.verifyTimer&&clearTimeout(this.verifyTimer),this.verifyTimer=setTimeout(()=>{this.verifyTimer=null,!this.closed&&this.lastPong===t&&this.onConnectFailure()},e)}onChunkFrame(e){let t=String(e.id??``),n=this.pending.get(t);if(!n)return;let r=s(n.chunks,e);r.error?(clearTimeout(n.timer),this.pending.delete(t),n.reject(Error(r.error))):r.done?this.resolvePending(r.done):(n.chunks=r.state??null,clearTimeout(n.timer),n.timer=setTimeout(()=>{this.pending.delete(t),n.reject(Error(`remote request timed out`))},v))}resolvePending(e){let t=this.pending.get(e.id);t&&(clearTimeout(t.timer),this.pending.delete(e.id),t.resolve(e))}send(e,t){let n=t??JSON.stringify(e);t&&this.channel?.readyState===`open`?this.channel.send(t):e&&this.ws?.send(n)}teardown(){this.connectTimer&&=(clearTimeout(this.connectTimer),null),this.iceWaitTimer&&=(clearTimeout(this.iceWaitTimer),null),this.pingTimer&&=(clearInterval(this.pingTimer),null),this.verifyTimer&&=(clearTimeout(this.verifyTimer),null),this.lastPong=0,this.desktopVerified=!1;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(Error(`connection dropped`));this.pending.clear();try{this.ws?.close()}catch{}try{this.pc?.close()}catch{}this.ws=this.pc=this.channel=null}close(){this.closed=!0,this.teardown()}},D=null;function O(e){return D?.close(),D=new re(e),D.connect(),D}function k(){D?.close(),D=null}function A(){return D}var j={"content-type":`application/json`};async function M(){try{return(await fetch(`/api/health?${ee}=1`,{cache:`no-store`,signal:AbortSignal.timeout(2e3)})).ok}catch{return!1}}async function N(){for(let e=0;e<3;e++)if(await new Promise(e=>setTimeout(e,700)),await M())return!0;return!1}async function P(e,t,n,r,i){let a=typeof e==`string`?e:e instanceof URL?e.href:e.url,o=new URL(a,i),s=o.pathname.startsWith(`/api`)||o.pathname.startsWith(`/mcp`);if(!n||!s||o.searchParams.has(`__direct`))return r(e,t);let c=new Request(e,t),l={};c.headers.forEach((e,t)=>l[t]=e);let u=[`GET`,`HEAD`].includes(c.method)?new Uint8Array:new Uint8Array(await c.arrayBuffer());try{let e=await n.request(c.method,o.pathname+o.search,l,u);return new Response(e.body,{status:e.status,headers:e.headers})}catch{return new Response(JSON.stringify({detail:`remote request failed`}),{status:503,headers:j})}}function F(e){let t=window.fetch.bind(window);window.fetch=(n,r)=>{if(h.status===`offline`){let t=typeof n==`string`?n:n instanceof URL?n.href:n.url,r=new URL(t,window.location.origin).pathname;(r.startsWith(`/api`)||r.startsWith(`/mcp`))&&O(e)}return P(n,r,A(),t,window.location.origin)}}var I=()=>{},L=new Promise(e=>{I=e});async function R(){try{await z()}finally{I()}}async function z(){if(typeof navigator>`u`||!(`serviceWorker`in navigator))return;let e=await o().catch(()=>null);if(!e){h.needsPairing=!(await M()||await N());return}if(await M())return;O(e),F(e);let t,n=()=>{t&&clearTimeout(t),t=void 0},r=()=>{n();let t=A();!t||h.status===`offline`||h.status===`reconnecting`||!t.isLive()?O(e):t.verify()};window.addEventListener(`pagehide`,()=>{n(),k()}),window.addEventListener(`pageshow`,r),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`?(n(),t=setTimeout(()=>{t=void 0,k()},18e4)):r()})}function B(){typeof navigator<`u`&&`serviceWorker`in navigator&&navigator.serviceWorker.ready.then(e=>e.update()).catch(()=>{})}var V=null;function H(e){V=e}function U(){V?.(),q()}var W=null;function G(e){W=e}function K(){W?.(),q()}function q(){typeof window<`u`&&window.location.pathname.startsWith(`/unlock`)||t(`/unlock`)}function J(e,t){e===423?U():e===401&&t?.code===`no_session`&&K()}var Y=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),X=class extends Error{status;code;constructor(e,t,n){super(t),this.status=e,this.code=n,this.name=`ApiError`}};async function Z(e,t={}){await L;let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t.headers??{}}}),r=n.status===204?null:await n.json().catch(()=>null);if(!n.ok){let e=r&&r.detail||`request failed (${n.status})`;throw J(n.status,r),new X(n.status,e,r?.code)}return r}function ie(e){return!!e&&e.unlocked&&e.session!==!1}function Q(e){console.assert(e instanceof Headers,`parseExportHeaders: real Headers instance required`),console.assert(typeof e.get==`function`,`parseExportHeaders: h.get missing`);let t=e.get(`x-sb-export-seq`),n=t===null?NaN:Number.parseInt(t,10),r=e.get(`x-sb-export-mode`);return{seq:Number.isFinite(n)?n:null,mode:r===`sealed`||r===`open`?r:null,unchanged:e.get(`x-sb-export-unchanged`)===`1`,rotatedKey:e.get(`x-sb-export-rotated-key`)===`1`,retired:e.get(`x-sb-export-retired`)===`1`}}function $(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}var ae={health:()=>Z(`/api/health`,{headers:$()?{"x-smartbrain-timezone":$()}:{}}),accountStatus:()=>Z(`/api/account/status`),installUpdate:()=>Z(`/api/update/install`,{method:`POST`,body:JSON.stringify({})}),setup:e=>Z(`/api/account/setup`,{method:`POST`,body:JSON.stringify({passphrase:e})}),unlock:e=>Z(`/api/account/unlock`,{method:`POST`,body:JSON.stringify(e)}),lock:()=>Z(`/api/account/lock`,{method:`POST`}),changePassphrase:(e,t)=>Z(`/api/account/passphrase`,{method:`POST`,body:JSON.stringify({current_passphrase:e,new_passphrase:t})}),resetPassphrase:(e,t)=>Z(`/api/account/passphrase/reset`,{method:`POST`,body:JSON.stringify({new_passphrase:e,recovery_key:t})}),exportData:e=>Z(`/api/export`,{method:`POST`,body:JSON.stringify({passphrase:e})}),backup:async e=>{await L;let t=await fetch(`/api/backup`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({passphrase:e})});if(!t.ok){let e=await t.json().catch(()=>null);throw new X(t.status,e?.detail||`backup failed (${t.status})`)}return t.blob()},restore:async e=>{await L;let t=await fetch(`/api/restore`,{method:`POST`,body:e}),n=await t.json().catch(()=>null);if(!t.ok)throw new X(t.status,n?.detail||`restore failed (${t.status})`);return n},listSecrets:()=>Z(`/api/secrets`),putSecret:(e,t)=>Z(`/api/secrets/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify({value:t})}),deleteSecret:e=>Z(`/api/secrets/${encodeURIComponent(e)}`,{method:`DELETE`}),localModels:(e=!1)=>Z(`/api/local-models${e?`?fresh=1`:``}`),listModels:()=>Z(`/api/models`),getRoutes:()=>Z(`/api/routes`),putRoutes:e=>Z(`/api/routes`,{method:`PUT`,body:JSON.stringify({routes:e})}),getContextLengths:()=>Z(`/api/model-context-lengths`),putContextLengths:e=>Z(`/api/model-context-lengths`,{method:`PUT`,body:JSON.stringify({lengths:e})}),getUsage:e=>{let t=new URLSearchParams;e?.since&&t.set(`since`,e.since),e?.until&&t.set(`until`,e.until);let n=t.toString();return Z(`/api/usage${n?`?${n}`:``}`)},putOllama:e=>Z(`/api/local-models/ollama`,{method:`PUT`,body:JSON.stringify({url:e})}),putMlx:(e,t)=>Z(`/api/local-models/mlx`,{method:`PUT`,body:JSON.stringify({url:e,api_key:t})}),putMlxe:(e,t)=>Z(`/api/local-models/mlxe`,{method:`PUT`,body:JSON.stringify({url:e,api_key:t})}),putClaudeCode:()=>Z(`/api/local-models/claudecode`,{method:`PUT`}),updateClaudeCode:()=>Z(`/api/local-models/claudecode/update`,{method:`POST`}),deleteLocalModel:e=>Z(`/api/local-models/${e}`,{method:`DELETE`}),chat:e=>Z(`/api/chat`,{method:`POST`,body:JSON.stringify(e)}),agentTurn:e=>Z(`/api/agent/turn`,{method:`POST`,body:JSON.stringify(e)}),feedback:(e,t)=>Z(`/api/feedback`,{method:`POST`,body:JSON.stringify({kind:e,conversation_id:t})}).catch(()=>void 0),agentResume:e=>Z(`/api/agent/resume/${encodeURIComponent(e)}`,{method:`POST`}),agentTurnStream:async(e,t)=>{await L;let n=await fetch(`/api/agent/turn/stream`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e),signal:t});if(!n.ok){let e=await n.json().catch(()=>null);throw J(n.status,e),new X(n.status,e?.detail||`stream failed (${n.status})`)}return n},agentTurnEvents:async e=>{await L;let t=await fetch(`/api/agent/turn/events`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>null);throw J(t.status,e),new X(t.status,e?.detail||`turn failed (${t.status})`)}return t},getWebSearch:()=>Z(`/api/websearch`),putWebSearch:e=>Z(`/api/websearch`,{method:`PUT`,body:JSON.stringify(e)}),getSelfImprove:()=>Z(`/api/selfimprove`),putSelfImprove:e=>Z(`/api/selfimprove`,{method:`PUT`,body:JSON.stringify(e)}),getOptimizer:()=>Z(`/api/selfimprove/optimizer`),putOptimizer:e=>Z(`/api/selfimprove/optimizer`,{method:`PUT`,body:JSON.stringify({enabled:e})}),listImprovements:()=>Z(`/api/selfimprove/improvements`),listConversations:(e={})=>{let t=new URLSearchParams;e.before&&t.set(`before`,e.before),e.limit&&t.set(`limit`,String(e.limit));let n=t.toString();return Z(`/api/conversations${n?`?${n}`:``}`)},createConversation:e=>Z(`/api/conversations`,{method:`POST`,body:JSON.stringify({title:e})}),getConversation:(e,t={})=>{let n=new URLSearchParams;t.before&&n.set(`before`,t.before),t.limit&&n.set(`limit`,String(t.limit));let r=n.toString();return Z(`/api/conversations/${encodeURIComponent(e)}${r?`?${r}`:``}`)},renameConversation:(e,t)=>Z(`/api/conversations/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({title:t})}),deleteConversation:e=>Z(`/api/conversations/${encodeURIComponent(e)}`,{method:`DELETE`}),deleteAllConversations:()=>Z(`/api/conversations`,{method:`DELETE`}),listTrash:()=>Z(`/api/conversations/trash`),emptyTrash:()=>Z(`/api/conversations/trash`,{method:`DELETE`}),restoreConversation:e=>Z(`/api/conversations/${encodeURIComponent(e)}/restore`,{method:`POST`}),addMessage:(e,t,n,r)=>Z(`/api/conversations/${encodeURIComponent(e)}/messages`,{method:`POST`,body:JSON.stringify(r?.length?{role:t,content:n,sources:r}:{role:t,content:n})}),listToolDefs:()=>Z(`/api/tools`),invokeTool:(e,t)=>Z(`/api/tools/invoke`,{method:`POST`,body:JSON.stringify({name:e,args:t})}),getAudit:(e=100)=>Z(`/api/audit?limit=${e}`),voiceStatus:(e=!1,t=!1)=>{let n=[e?`probe=1`:``,t?`prepare=1`:``].filter(Boolean).join(`&`);return Z(`/api/voice/status${n?`?${n}`:``}`)},appStatus:()=>Z(`/api/status/overview`),voiceTranscribe:async(e,t={})=>{await L;let n=new AbortController,r=setTimeout(()=>n.abort(),45e3),i;try{i=await fetch(t.partial?`/api/voice/transcribe?partial=1`:`/api/voice/transcribe`,{method:`POST`,headers:{"content-type":`audio/wav`,...t.keep?{"x-sb-voice-keep":`1`}:{}},body:e,signal:n.signal})}catch(e){throw n.signal.aborted?new X(504,`transcription timed out — try again`):e}finally{clearTimeout(r)}let a=await i.json().catch(()=>null);if(!i.ok)throw J(i.status,a),new X(i.status,a?.detail||`transcription failed (${i.status})`);return a},voiceSpeak:async e=>{await L;let t=await fetch(`/api/voice/speak`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:e})});return t.ok?t.blob():null},putVoiceConfig:e=>Z(`/api/local-models/voice`,{method:`PUT`,body:JSON.stringify(e)}),deleteVoiceConfig:()=>Z(`/api/local-models/voice`,{method:`DELETE`}),listPending:()=>Z(`/api/agent/pending`),approveAction:(e,t=null,n=!1)=>Z(`/api/agent/pending/${encodeURIComponent(e)}/approve`,{method:`POST`,body:JSON.stringify({confirm_tool:t,remember:n})}),denyAction:e=>Z(`/api/agent/pending/${encodeURIComponent(e)}/deny`,{method:`POST`}),listRemembered:()=>Z(`/api/agent/remembered`),forgetRemembered:(e,t=null)=>{let n=t?`?host=${encodeURIComponent(t)}`:``;return Z(`/api/agent/remembered/${encodeURIComponent(e)}${n}`,{method:`DELETE`})},listTasks:()=>Z(`/api/tasks`),addTask:e=>Z(`/api/tasks`,{method:`POST`,body:JSON.stringify(e)}),updateTask:(e,t)=>Z(`/api/tasks/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify(t)}),setTaskStatus:(e,t)=>Z(`/api/tasks/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({status:t})}),deleteTask:e=>Z(`/api/tasks/${encodeURIComponent(e)}`,{method:`DELETE`}),listSchedules:()=>Z(`/api/schedules`),addSchedule:e=>Z(`/api/schedules`,{method:`POST`,body:JSON.stringify(e)}),updateSchedule:(e,t)=>Z(`/api/schedules/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify(t)}),setScheduleEnabled:(e,t)=>Z(`/api/schedules/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({enabled:t})}),deleteSchedule:e=>Z(`/api/schedules/${encodeURIComponent(e)}`,{method:`DELETE`}),runSchedule:e=>Z(`/api/schedules/${encodeURIComponent(e)}/run`,{method:`POST`}),listScheduleRuns:e=>Z(`/api/schedules/${encodeURIComponent(e)}/runs`),recentScheduleRuns:()=>Z(`/api/schedules/runs/recent`),unseenScheduleUpdates:()=>Z(`/api/schedules/updates/unseen-count`),markScheduleUpdatesSeen:()=>Z(`/api/schedules/updates/seen`,{method:`POST`}),listMemories:()=>Z(`/api/memories`),addMemory:e=>Z(`/api/memories`,{method:`POST`,body:JSON.stringify({text:e})}),deleteMemory:e=>Z(`/api/memories/${encodeURIComponent(e)}`,{method:`DELETE`}),getProfile:()=>Z(`/api/profile`),setProfile:e=>Z(`/api/profile`,{method:`PUT`,body:JSON.stringify(e)}),listDocs:()=>Z(`/api/kb`),addDoc:(e,t)=>Z(`/api/kb`,{method:`POST`,body:JSON.stringify({title:e,content:t})}),ingestUrl:e=>Z(`/api/kb/ingest-url`,{method:`POST`,body:JSON.stringify({url:e})}),uploadDoc:e=>Z(`/api/kb/upload?filename=${encodeURIComponent(e.name)}`,{method:`POST`,body:e,headers:{"content-type":`application/octet-stream`}}),indexStatus:()=>Z(`/api/kb/index-status`),getDoc:e=>Z(`/api/kb/${encodeURIComponent(e)}`),renameDoc:(e,t)=>Z(`/api/kb/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({title:t})}),setDocTags:(e,t)=>Z(`/api/kb/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({tags:t})}),deleteDoc:e=>Z(`/api/kb/${encodeURIComponent(e)}`,{method:`DELETE`}),searchKb:(e,t=`hybrid`,n=10,r=``)=>Z(`/api/kb/search?${new URLSearchParams({q:e,mode:t,limit:String(n),...r?{vault:r}:{}}).toString()}`),reindexKb:()=>Z(`/api/kb/reindex`,{method:`POST`}),listVaults:()=>Z(`/api/vaults`),createVault:(e,t=``)=>Z(`/api/vaults`,{method:`POST`,body:JSON.stringify({name:e,description:t})}),updateVaultMeta:(e,t)=>Z(`/api/vaults/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteVault:(e,t={})=>{let n=t.remove_docs?`?remove_docs=1`:``;return Z(`/api/vaults/${encodeURIComponent(e)}${n}`,{method:`DELETE`})},getVault:e=>Z(`/api/vaults/${encodeURIComponent(e)}`),removeFromVault:(e,t)=>Z(`/api/vaults/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}`,{method:`DELETE`}),detachFromVault:(e,t)=>Z(`/api/vaults/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/detach`,{method:`POST`}),addToVault:(e,t)=>Z(`/api/vaults/${encodeURIComponent(e)}/documents`,{method:`POST`,body:JSON.stringify({doc_ids:t})}),listFeeds:()=>Z(`/api/feeds`),addFeed:(e,t=[])=>Z(`/api/feeds`,{method:`POST`,body:JSON.stringify(t.length?{url:e,tags:t}:{url:e})}),refreshFeed:e=>Z(`/api/feeds/${encodeURIComponent(e)}/refresh`,{method:`POST`}),deleteFeed:(e,t={})=>Z(`/api/feeds/${encodeURIComponent(e)}${t.remove_docs?`?remove_docs=1`:``}`,{method:`DELETE`}),exportVault:async(e,t,n=`sealed`)=>{await L;let r=await fetch(`/api/vaults/${encodeURIComponent(e)}/export`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({passphrase:t,mode:n})});if(!r.ok){let e=await r.json().catch(()=>null);throw new X(r.status,e?.detail||`export failed (${r.status})`)}let i=Q(r.headers);return{blob:await r.blob(),headers:i}},retireVault:async(e,t)=>{await L;let n=await fetch(`/api/vaults/${encodeURIComponent(e)}/retire`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({passphrase:t})});if(!n.ok){let e=await n.json().catch(()=>null);throw new X(n.status,e?.detail||`retire failed (${n.status})`)}let r=Q(n.headers);return{blob:await n.blob(),headers:r}},verifyHostedVault:e=>Z(`/api/vaults/${encodeURIComponent(e)}/verify-hosted`,{method:`POST`}),vaultKey:async(e,t)=>{await L;let n=await fetch(`/api/vaults/${encodeURIComponent(e)}/key`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({passphrase:t})}),r=await n.json().catch(()=>null);if(!n.ok)throw new X(n.status,r?.detail||`could not read the key`);return r.key},subscribeVault:e=>Z(`/api/vaults/subscribe`,{method:`POST`,body:JSON.stringify({url:e})}),importVault:async(e,t)=>{await L;let n=await fetch(`/api/vaults/import?key=${encodeURIComponent(t)}`,{method:`POST`,body:e,headers:{"content-type":`application/octet-stream`}}),r=await n.json().catch(()=>null);if(!n.ok)throw new X(n.status,r?.detail||`import failed`);return r},checkVaultUpdates:e=>Z(`/api/vaults/${encodeURIComponent(e)}/check-updates`,{method:`POST`}),updateVault:e=>Z(`/api/vaults/${encodeURIComponent(e)}/update`,{method:`POST`}),setSubscription:(e,t)=>Z(`/api/vaults/${encodeURIComponent(e)}/subscription`,{method:`PATCH`,body:JSON.stringify(t)}),trustVaultPublisher:(e,t,n)=>Z(`/api/vaults/${encodeURIComponent(e)}/trust-publisher`,{method:`POST`,body:JSON.stringify({offered_pubkey:t,passphrase:n})}),emailStatus:()=>Z(`/api/email/status`),emailConnect:(e,t)=>Z(`/api/email/connect`,{method:`POST`,body:JSON.stringify({client_id:e,client_secret:t})}),emailReconnect:()=>Z(`/api/email/reconnect`,{method:`POST`}),emailDisconnect:()=>Z(`/api/email/disconnect`,{method:`DELETE`}),emailMessages:(e=10)=>Z(`/api/email/messages?limit=${e}`),emailMessage:e=>Z(`/api/email/messages/${encodeURIComponent(e)}`),emailSend:(e,t,n)=>Z(`/api/email/send`,{method:`POST`,body:JSON.stringify({to:e,subject:t,body:n})}),mcpInfo:()=>Z(`/api/mcp`),mcpToken:()=>Z(`/api/mcp/token`),mcpNewToken:()=>Z(`/api/mcp/token`,{method:`POST`}),mcpRevokeToken:()=>Z(`/api/mcp/token`,{method:`DELETE`}),niMcpServers:()=>Z(`/api/ni/mcp-servers`),niMcpAdd:e=>Z(`/api/ni/mcp-servers`,{method:`POST`,body:JSON.stringify(e)}),niMcpUpdate:(e,t)=>Z(`/api/ni/mcp-servers/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify(t)}),niMcpDelete:e=>Z(`/api/ni/mcp-servers/${encodeURIComponent(e)}`,{method:`DELETE`}),niBoard:()=>Z(`/api/ni/board`),niImageDataUrl:async e=>{await L;let t=await fetch(e);if(!t.ok)throw new X(t.status,`image failed (${t.status})`);let n=(t.headers.get(`content-type`)||``).split(`;`)[0].trim();if(!Y.has(n))throw new X(415,`unexpected image type ${n||`(none)`}`);let r=new Uint8Array(await t.arrayBuffer()),i=``;for(let e=0;eZ(`/api/ni/items/${encodeURIComponent(e)}`),niValidate:(e,t,n,r)=>Z(`/api/ni/items/${encodeURIComponent(e)}/validate`,{method:`POST`,body:JSON.stringify({ok:t,...n?{note:n}:{},...r?{presentation_id:r}:{}})}),niRun:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/run`,{method:`POST`}),niCommission:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/commission`,{method:`POST`}),niActivate:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/activate`,{method:`POST`}),niSwitchFeed:(e,t)=>Z(`/api/ni/items/${encodeURIComponent(e)}/switch-feed`,{method:`POST`,body:JSON.stringify({url:t})}),niPatch:(e,t)=>Z(`/api/ni/items/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)}),niDelete:e=>Z(`/api/ni/items/${encodeURIComponent(e)}`,{method:`DELETE`}),niPutCredential:(e,t,n,r)=>Z(`/api/ni/items/${encodeURIComponent(e)}/credential`,{method:`PUT`,body:JSON.stringify({name:t,value:n,host:r})}),niIntake:(e,t)=>Z(`/api/ni/intake`,{method:`POST`,body:JSON.stringify(t?{request:e,source_url:t}:{request:e})}),niFlowPickSource:(e,t,n=!1)=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/pick-source`,{method:`POST`,body:JSON.stringify(n?{url:t,pasted:n}:{url:t})}),niFlowAccess:(e,t,n)=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/access`,{method:`POST`,body:JSON.stringify({...t===void 0?{}:{key:t},...n===void 0?{}:{email:n}})}),niFlowFix:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/fix`,{method:`POST`}),niRefine:(e,t)=>Z(`/api/ni/items/${encodeURIComponent(e)}/refine`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({note:t})}),niFlowAnswer:(e,t,n)=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/answer`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:t,value:n})}),niFlowReopen:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/reopen`,{method:`POST`}),niFindings:()=>Z(`/api/ni/findings`),niResolveFinding:e=>Z(`/api/ni/findings/${encodeURIComponent(e)}/resolve`,{method:`POST`}),niFlowRetry:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/retry`,{method:`POST`}),niPutParam:(e,t,n)=>Z(`/api/ni/items/${encodeURIComponent(e)}/param`,{method:`PUT`,body:JSON.stringify({name:t,value:n})}),niLibrary:()=>Z(`/api/ni/library`),niLibraryConnect:e=>Z(`/api/ni/library/connect`,{method:`POST`,body:JSON.stringify({url:e})}),niLibraryCheck:()=>Z(`/api/ni/library/check`,{method:`POST`}),niLibraryDisconnect:()=>Z(`/api/ni/library`,{method:`DELETE`}),niLibraryTrustKey:(e,t)=>Z(`/api/ni/library/trust-key`,{method:`POST`,body:JSON.stringify({offered_fingerprint:e,passphrase:t})}),niLibraryInstall:(e,t)=>Z(`/api/ni/library/install`,{method:`POST`,body:JSON.stringify({template_id:e,params:t})}),niApplyTemplateUpdate:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/apply-template-update`,{method:`POST`}),niL2Apply:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/l2-proposal/apply`,{method:`POST`}),niL2Dismiss:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/l2-proposal/dismiss`,{method:`POST`}),niRepairPolicy:(e,t)=>Z(`/api/ni/items/${encodeURIComponent(e)}/repair-policy`,{method:`POST`,body:JSON.stringify(t)}),libraryStatus:()=>Z(`/api/library/status`),libraryInstall:()=>Z(`/api/library/install`,{method:`POST`}),libraryTaxonomy:()=>Z(`/api/library/taxonomy`),librarySources:(e={})=>{let t=new URLSearchParams;e.q&&t.set(`q`,e.q),e.category&&t.set(`category`,e.category),e.subcategory&&t.set(`subcategory`,e.subcategory),e.tier&&t.set(`tier`,e.tier),e.status&&t.set(`status`,e.status),e.offset!==void 0&&t.set(`offset`,String(e.offset)),e.limit!==void 0&&t.set(`limit`,String(e.limit));let n=t.toString();return Z(`/api/library/sources${n?`?${n}`:``}`)},librarySource:e=>Z(`/api/library/sources/${encodeURIComponent(e)}`),libraryLocal:()=>Z(`/api/library/local`),libraryLocalAdd:e=>Z(`/api/library/local`,{method:`POST`,body:JSON.stringify(e)}),libraryLocalDelete:e=>Z(`/api/library/local/${encodeURIComponent(e)}`,{method:`DELETE`}),listDevices:()=>Z(`/api/devices`),createDevice:e=>Z(`/api/devices`,{method:`POST`,body:JSON.stringify({label:e})}),deleteDevice:e=>Z(`/api/devices/${encodeURIComponent(e)}`,{method:`DELETE`}),startPairCode:e=>Z(`/api/devices/pair-code`,{method:`POST`,body:JSON.stringify({label:e})}),cancelPairCode:()=>Z(`/api/devices/pair-code`,{method:`DELETE`}),pairCodeStatus:()=>Z(`/api/devices/pair-code`)};export{G as a,h as c,H as i,ae as n,R as o,ie as r,B as s,X as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/1gl_kuJz.js b/app/smartbrain_3000/web/_app/immutable/chunks/Bmlx8Ynu.js similarity index 90% rename from app/smartbrain_3000/web/_app/immutable/chunks/1gl_kuJz.js rename to app/smartbrain_3000/web/_app/immutable/chunks/Bmlx8Ynu.js index 2bb0cf9a..8ab10473 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/1gl_kuJz.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/Bmlx8Ynu.js @@ -1 +1 @@ -import{A as e,G as t,M as n,N as r,P as i,S as a,X as o,Z as s,a as c,g as l}from"./BJLLtWYH.js";import"./xihTtKlq.js";var u=i(`
`),d=i(``);function f(i,f){let p=c(f,`size`,3,18),m=c(f,`block`,3,!1),h=c(f,`label`,3,`Loading`);var g=r(),_=o(g),v=e=>{var r=u(),i=s(r);t(()=>{l(r,`aria-label`,h()),a(i,`width:${p()??``}px; height:${p()??``}px`)}),n(e,r)},y=e=>{var r=d();t(()=>{l(r,`aria-label`,h()),a(r,`width:${p()??``}px; height:${p()??``}px`)}),n(e,r)};e(_,e=>{m()?e(v):e(y,-1)}),n(i,g)}export{f as t}; \ No newline at end of file +import{A as e,G as t,M as n,N as r,P as i,S as a,X as o,Z as s,a as c,g as l}from"./BChu7Pos.js";import"./xihTtKlq.js";var u=i(`
`),d=i(``);function f(i,f){let p=c(f,`size`,3,18),m=c(f,`block`,3,!1),h=c(f,`label`,3,`Loading`);var g=r(),_=o(g),v=e=>{var r=u(),i=s(r);t(()=>{l(r,`aria-label`,h()),a(i,`width:${p()??``}px; height:${p()??``}px`)}),n(e,r)},y=e=>{var r=d();t(()=>{l(r,`aria-label`,h()),a(r,`width:${p()??``}px; height:${p()??``}px`)}),n(e,r)};e(_,e=>{m()?e(v):e(y,-1)}),n(i,g)}export{f as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/BxvjB08B.js b/app/smartbrain_3000/web/_app/immutable/chunks/BxvjB08B.js deleted file mode 100644 index 77a7c7cc..00000000 --- a/app/smartbrain_3000/web/_app/immutable/chunks/BxvjB08B.js +++ /dev/null @@ -1 +0,0 @@ -import{H as e,U as t,V as n,et as r,o as i,r as a,t as o,tt as s}from"./BJLLtWYH.js";var c=class{constructor(e,t){this.status=e,this.body=typeof t==`string`?{message:t}:t||{message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}},l=class{constructor(e,t){try{new Headers({location:t})}catch{throw Error(`Invalid redirect location ${JSON.stringify(t)}: this string contains characters that cannot be used in HTTP headers`)}this.status=e,this.location=t}},u=class extends Error{constructor(e,t,n){super(n),this.status=e,this.text=t}};new URL(`sveltekit-internal://`);function d(e,t){return e===`/`||t===`ignore`?e:t===`never`?e.endsWith(`/`)?e.slice(0,-1):e:t===`always`&&!e.endsWith(`/`)?e+`/`:e}function f(e){return e.split(`%25`).map(decodeURI).join(`%25`)}function p(e){for(let t in e)e[t]=decodeURIComponent(e[t]);return e}function m({href:e}){return e.split(`#`)[0]}function h(){}function g(...e){let t=5381;for(let n of e)if(typeof n==`string`){let e=n.length;for(;e;)t=t*33^n.charCodeAt(--e)}else if(ArrayBuffer.isView(n)){let e=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),r=e.length;for(;r;)t=t*33^e[--r]}else throw TypeError(`value must be a string or TypedArray`);return(t>>>0).toString(36)}new TextEncoder;function _(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e((e instanceof Request?e.method:t?.method||`GET`)!==`GET`&&y.delete(x(e)),v(e,t));var y=new Map;function ee(e,t){let n=x(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:e,...t}=JSON.parse(r.textContent);r.getAttribute(`data-b64`)!==null&&(e=_(e));let i=r.getAttribute(`data-ttl`);return i&&y.set(n,{body:e,init:t,ttl:1e3*Number(i)}),Promise.resolve(new Response(e,t))}return window.fetch(e,t)}function b(e,t,n){if(y.size>0){let t=x(e,n),r=y.get(t);if(r){if(performance.now(){let n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(e);if(n)return t.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),`(?:/([^]*))?`;let r=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(e);if(r)return t.push({name:r[1],matcher:r[2],optional:!0,rest:!1,chained:!0}),`(?:/([^/]+))?`;if(!e)return;let i=e.split(/\[(.+?)\](?!\])/);return`/`+i.map((e,n)=>{if(n%2){if(e.startsWith(`x+`))return se(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith(`u+`))return se(String.fromCharCode(...e.slice(2).split(`-`).map(e=>parseInt(e,16))));let[,r,a,o,s]=te.exec(e);return t.push({name:o,matcher:s,optional:!!r,rest:!!a,chained:a?n===1&&i[0]===``:!1}),a?`([^]*?)`:r?`([^/]*)?`:`([^/]+?)`}return se(e)}).join(``)}).join(``)}/?$`),params:t}}function ie(e){return e!==``&&!/^\([^)]+\)$/.test(e)}function ae(e){return e.slice(1).split(`/`).filter(ie)}function oe(e,t,n){let r={},i=e.slice(1),a=i.filter(e=>e!==void 0),o=0;for(let e=0;ee).join(`/`),o=0),c===void 0){if(s.rest)c=``;else continue}if(!s.matcher||n[s.matcher](c)){r[s.name]=c;let n=t[e+1],l=i[e+1];n&&!n.rest&&n.optional&&l&&s.chained&&(o=0),!n&&!l&&Object.keys(r).length===a.length&&(o=0);continue}if(s.optional&&s.chained){o++;continue}return}if(!o)return r}function se(e){return e.normalize().replace(/[[\]]/g,`\\$&`).replace(/%/g,`%25`).replace(/\//g,`%2[Ff]`).replace(/\?/g,`%3[Ff]`).replace(/#/g,`%23`).replace(/[.*+?^${}()|\\]/g,`\\$&`)}function ce({nodes:e,server_loads:t,dictionary:n,matchers:r}){let i=new Set(t);return Object.entries(n).map(([t,[n,i,s]])=>{let{pattern:c,params:l}=re(t),u={id:t,exec:e=>{let t=c.exec(e);if(t)return oe(t,l,r)},errors:[1,...s||[]].map(t=>e[t]),layouts:[0,...i||[]].map(o),leaf:a(n)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function a(t){let n=t<0;return n&&(t=~t),[n,e[t]]}function o(t){return t===void 0?t:[i.has(t),e[t]]}}function le(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function ue(e,t,n=JSON.stringify){let r=n(t);try{sessionStorage[e]=r}catch{}}var S=globalThis.__sveltekit_1sy6upb?.base??``,de=globalThis.__sveltekit_1sy6upb?.assets??S??``,fe=`ff854a7b818d747f`,pe=`sveltekit:snapshot`,me=`sveltekit:scroll`,he=`sveltekit:states`,C=`sveltekit:history`,w=`sveltekit:navigation`,T={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ge=location.origin;function _e(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){let e=document.getElementsByTagName(`base`);t=e.length?e[0].href:document.URL}return new URL(e,t)}function E(){return{x:pageXOffset,y:pageYOffset}}function D(e,t){return e.getAttribute(`data-sveltekit-${t}`)}var ve={...T,"":T.hover};function ye(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function be(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()===`A`&&e.hasAttribute(`href`))return e;e=ye(e)}}function xe(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){let e=location.hash.split(`#`)[1]||`/`;r.hash=`#${e}${r.hash}`}}catch{}let i=e instanceof SVGAElement?e.target.baseVal:e.target,a=!r||!!i||k(r,t,n)||(e.getAttribute(`rel`)||``).split(/\s+/).includes(`external`),o=r?.origin===ge&&e.hasAttribute(`download`);return{url:r,external:a,target:i,download:o}}function O(e){let t=null,n=null,r=null,i=null,a=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=D(s,`preload-code`)),i===null&&(i=D(s,`preload-data`)),t===null&&(t=D(s,`keepfocus`)),n===null&&(n=D(s,`noscroll`)),a===null&&(a=D(s,`reload`)),o===null&&(o=D(s,`replacestate`)),s=ye(s);function c(e){switch(e){case``:case`true`:return!0;case`off`:case`false`:return!1;default:return}}return{preload_code:ve[r??`off`],preload_data:ve[i??`off`],keepfocus:c(t),noscroll:c(n),reload:c(a),replace_state:c(o)}}function Se(e){let t=i(e),n=!0;function r(){n=!0,t.update(e=>e)}function a(e){n=!1,t.set(e)}function o(e){let r;return t.subscribe(t=>{(r===void 0||n&&t!==r)&&e(r=t)})}return{notify:r,set:a,subscribe:o}}var Ce={v:h};function we(){let{set:e,subscribe:t}=i(!1),n;async function r(){clearTimeout(n);try{let t=await fetch(`${de}/_app/version.json`,{headers:{pragma:`no-cache`,"cache-control":`no-cache`}});if(!t.ok)return!1;let r=(await t.json()).version!==fe;return r&&(e(!0),Ce.v(),clearTimeout(n)),r}catch{return!1}}return{subscribe:t,check:r}}function k(e,t,n){return e.origin!==ge||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Te(e){}var Ee=new Set([`load`,`prerender`,`csr`,`ssr`,`trailingSlash`,`config`]);[...Ee],[...new Set([...Ee])];function De(e){return e.filter(e=>e!=null)}function A(e,t){return e+`/`+t}function Oe(e){return e instanceof c||e instanceof u?e.status:500}function ke(e){return e instanceof u?e.text:`Internal Error`}var j,M,Ae,je=a.toString().includes(`$$`)||/function \w+\(\) \{\}/.test(a.toString()),Me=`a:`;je?(j={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Me)},M={current:null},Ae={current:!1}):(j=new class{#e=s({});get data(){return n(this.#e)}set data(e){r(this.#e,e)}#t=s(null);get form(){return n(this.#t)}set form(e){r(this.#t,e)}#n=s(null);get error(){return n(this.#n)}set error(e){r(this.#n,e)}#r=s({});get params(){return n(this.#r)}set params(e){r(this.#r,e)}#i=s({id:null});get route(){return n(this.#i)}set route(e){r(this.#i,e)}#a=s({});get state(){return n(this.#a)}set state(e){r(this.#a,e)}#o=s(-1);get status(){return n(this.#o)}set status(e){r(this.#o,e)}#s=s(new URL(Me));get url(){return n(this.#s)}set url(e){r(this.#s,e)}},M=new class{#e=s(null);get current(){return n(this.#e)}set current(e){r(this.#e,e)}},Ae=new class{#e=s(!1);get current(){return n(this.#e)}set current(e){r(this.#e,e)}},Ce.v=()=>Ae.current=!0);function Ne(e){Object.assign(j,e)}var{onMount:Pe,tick:Fe}=o,Ie=new Set([`icon`,`shortcut icon`,`apple-touch-icon`]),N=null,P=le(`sveltekit:scroll`)??{},F=le(`sveltekit:snapshot`)??{},I={url:Se({}),page:Se({}),navigating:i(null),updated:we()};function Le(e){P[e]=E()}function Re(e,t){let n=e+1;for(;P[n];)delete P[n],n+=1;for(n=t+1;F[n];)delete F[n],n+=1}function L(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(h)}async function ze(){if(`serviceWorker`in navigator){let e=await navigator.serviceWorker.getRegistration(S||`/`);e&&await e.update()}}var Be,Ve,R,z,He,B,Ue={},We={},V=[],H=[],U=null;function Ge(){U?.fork?.then(e=>e?.discard()),U=null,Q={element:void 0,href:void 0}}var Ke=new Map,qe=new Set,Je=new Set,W=new Set,G={branch:[],error:null,url:null,nav:null},Ye=!1,Xe=!1,Ze=!0,K=!1,q=!1,Qe=!1,$e=!1,et,J,Y,X,tt=new Set,nt=new Map,rt=new Map;async function it(e,t,n){if(globalThis.__sveltekit_1sy6upb.data){let{q:e={},p:t={},l:n={},f:r={}}=globalThis.__sveltekit_1sy6upb.data;for(let t in e)Ue[t]=e[t];for(let e in n)Ue[e]=n[e];for(let e in r)Ue[e]=r[e];for(let e in t)We[e]=t[e]}document.URL!==location.href&&(location.href=location.href),B=e,await e.hooks.init?.(),Be=ce(e),z=document.documentElement,He=t,Ve=e.nodes[0],R=e.nodes[1],Ve(),R(),J=history.state?.[C],Y=history.state?.[w],J||(J=Y=Date.now(),history.replaceState({...history.state,[C]:J,[w]:Y},``));let r=P[J];function i(){r&&(history.scrollRestoration=`manual`,scrollTo(r.x,r.y))}n?(i(),await Nt(He,n)):(await Z({type:`enter`,url:_e(B.hash?zt(new URL(location.href)):location.href),replace_state:!0}),i()),Mt()}function at(){V.length=0,$e=!1}function ot(e){H.some(e=>e?.snapshot)&&(F[e]=H.map(e=>e?.snapshot?.capture()))}function st(e){F[e]?.forEach((e,t)=>{H[t]?.snapshot?.restore(e)})}function ct(){Le(J),ue(me,P),ot(Y),ue(pe,F)}async function lt(e,n,r,i){let a,o;n.invalidateAll&&Ge(),await Z({type:`goto`,url:_e(e),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:r,nav_token:i,accept:()=>{if(n.invalidateAll){$e=!0,a=new Set;for(let[e,t]of nt)for(let[n,r]of t)r.resource?.reset(),a.add(A(e,n));o=new Set;for(let[e,t]of rt)for(let n of t.keys())o.add(A(e,n))}n.invalidate&&n.invalidate.forEach(jt)}}),n.invalidateAll&&t().then(t).then(()=>{for(let[e,t]of nt)for(let[n,{resource:r}]of t)a?.has(A(e,n))&&r.start();for(let[e,t]of rt)for(let[n,{resource:r}]of t)o?.has(A(e,n))&&r.reconnect()})}async function ut(e){if(e.id!==U?.id){Ge();let t={};tt.add(t),U={id:e.id,token:t,promise:bt({...e,preload:t}).then(e=>(tt.delete(t),e.type===`loaded`&&e.state.error&&Ge(),e)),fork:null}}return U.promise}async function dt(e){let t=(await wt(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(e=>e[1]()))}async function ft(e,t,n){let r={params:G.params,route:{id:G.route?.id??null},url:new URL(location.href)};if(G={...e.state,nav:r},Ne(e.props.page),et=new B.root({target:t,props:{...e.props,stores:I,components:H},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),n){let e={from:null,to:{...r,scroll:P[J]??E()},willUnload:!1,type:`enter`,complete:Promise.resolve()};W.forEach(t=>t(e))}st(Y),Xe=!0}async function pt({url:e,params:t,branch:n,errors:r,status:i,error:a,route:o,form:s}){let c=`never`;if(S&&(e.pathname===S||e.pathname===S+`/`))c=`always`;else for(let e of n)e?.slash!==void 0&&(c=e.slash);e.pathname=d(e.pathname,c),e.search=e.search;let l={type:`loaded`,state:{url:e,params:t,branch:n,error:a,route:o},props:{constructors:De(n).map(e=>e.node.component),page:Rt(j)}};s!==void 0&&(l.props.form=s);let u={},f=!j,p=0;for(let e=0;et(new URL(e))))return!0;return!1}function _t(e,t){return e?.type===`data`?e:e?.type===`skip`?t??null:null}function vt(e,t){if(!e)return new Set(t.searchParams.keys());let n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(let r of n){let i=e.searchParams.getAll(r),a=t.searchParams.getAll(r);i.every(e=>a.includes(e))&&a.every(e=>i.includes(e))&&n.delete(r)}return n}function yt({error:e,url:t,route:n,params:r}){return{type:`loaded`,state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Rt(j),constructors:[]}}}async function bt({id:e,invalidating:t,url:n,params:r,route:i,preload:a}){if(U?.id===e)return tt.delete(U.token),U.promise;let{errors:o,layouts:s,leaf:u}=i,d=[...s,u];o.forEach(e=>e?.().catch(h)),d.forEach(e=>e?.[1]().catch(h));let f=G.url?e!==Et(G.url):!1,p=G.route?i.id!==G.route.id:!1,m=vt(G.url,n),g=!1,_=d.map(async(e,t)=>{if(!e)return;let a=G.branch[t];return e[1]===a?.loader&&!gt(g,p,f,m,a.universal?.uses,r)?a:(g=!0,mt({loader:e[1],url:n,params:r,route:i,parent:async()=>{let e={};for(let n=0;nPromise.resolve({}),server_data_node:_t(null)}),{node:await R(),loader:R,universal:null,server:null,data:null}],status:e,error:t,errors:[],route:null})}catch(t){if(t instanceof l){await lt(new URL(t.location,location.href),{},0);return}let a=await B.get_error_template(),o=await $(t,{url:n,params:i,route:r}),s=a({status:e,message:String(o?.message??``).replace(/&/g,`&`).replace(//g,`>`)}),c=new DOMParser().parseFromString(s,`text/html`);throw document.documentElement.replaceChild(document.adoptNode(c.head),document.head),document.documentElement.replaceChild(document.adoptNode(c.body),document.body),t}}async function Ct(e){let t=e.href;if(Ke.has(t))return Ke.get(t);let n;try{let r=(async()=>{let t=await B.hooks.reroute({url:new URL(e),fetch:async(t,n)=>ht(t,n,e).promise})??e;if(typeof t==`string`){let n=new URL(e);B.hash?n.hash=t:n.pathname=t,t=n}return t})();Ke.set(t,r),n=await r}catch{Ke.delete(t);return}return n}async function wt(e,t){if(e&&!k(e,S,B.hash)){let n=await Ct(e);if(!n)return;let r=Tt(n);for(let n of Be){let i=n.exec(r);if(i)return{id:Et(e),invalidating:t,route:n,params:p(i),url:e}}}}function Tt(e){return f(B.hash?e.hash.replace(/^#/,``).replace(/[?#].+/,``):e.pathname.slice(S.length))||`/`}function Et(e){return(B.hash?e.hash.replace(/^#/,``):e.pathname)+e.search}function Dt({url:e,type:t,intent:n,delta:r,event:i,scroll:a}){let o=!1,s=Lt(G,n,e,t,a??null);r!==void 0&&(s.navigation.delta=r),i!==void 0&&(s.navigation.event=i);let c={...s.navigation,cancel:()=>{o=!0,s.reject(Error(`navigation cancelled`))}};return K||qe.forEach(e=>e(c)),o?null:s}async function Z({type:n,url:r,popped:i,keepfocus:a,noscroll:o,replace_state:s,state:c={},redirect_count:l=0,nav_token:d={},accept:f=h,block:p=h,event:m}){let g=X;X=d;let _=await wt(r,!1),v=n===`enter`?Lt(G,_,r,n):Dt({url:r,type:n,delta:i?.delta,intent:_,scroll:i?.scroll,event:m});if(!v){p(),X===d&&(X=g);return}let y=J,ee=Y;f(),K=!0,Xe&&v.navigation.type!==`enter`&&I.navigating.set(M.current=v.navigation);let b=_&&await bt(_);if(!b){if(k(r,S,B.hash))return await L(r,s);b=await Ot(r,{id:null},await $(new u(404,`Not Found`,`Not found: ${r.pathname}`),{url:r,params:{},route:{id:null}}),404,s)}if(r=_?.url||r,X!==d){v.reject(Error(`navigation aborted`));return}if(!b)return;if(b.type===`redirect`){if(l<20){await Z({type:n,url:new URL(b.location,r),popped:i,keepfocus:a,noscroll:o,replace_state:s,state:c,redirect_count:l+1,nav_token:d}),v.fulfil(void 0);return}if(b=await St({status:500,error:await $(Error(`Redirect loop`),{url:r,params:{},route:{id:null}}),url:r,route:{id:null}}),!b)return}else if(b.props.page.status>=400&&await I.updated.check())return await ze(),await L(r,s);if(at(),Le(y),ot(ee),b.props.page.url.pathname!==r.pathname&&(r.pathname=b.props.page.url.pathname),c=i?i.state:c,!i){let e=+!s,t={[C]:J+=e,[w]:Y+=e,[he]:c};(s?history.replaceState:history.pushState).call(history,t,``,r),s||Re(J,Y)}let x=_&&U?.id===_.id?U.fork:null;U?.fork&&!x?Ge():(U=null,Q={element:void 0,href:void 0}),b.props.page.state=c;let te;if(Xe){let t=(await Promise.all(Array.from(Je,e=>e(v.navigation)))).filter(e=>typeof e==`function`);if(t.length>0){function e(){t.forEach(e=>{W.delete(e)})}t.push(e),t.forEach(e=>{W.add(e)})}let n=v.navigation.to;G={...b.state,nav:{params:n.params,route:n.route,url:n.url}},b.props.page&&(b.props.page.url=r),!a&&document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur();let i=x&&await x;i?te=i.commit():(N=null,et.$set(b.props),N&&Object.assign(b.props.page,N),Ne(b.props.page),te=e?.()),Qe=!0}else await ft(b,He,!1);let{activeElement:ne}=document;if(await te,await t(),await t(),X!==d){v.reject(Error(`navigation aborted`));return}b.props.page&&N&&Object.assign(b.props.page,N);let re=null;if(Ze){let e=i?i.scroll:o?E():null;e?scrollTo(e.x,e.y):(re=r.hash&&document.getElementById(Bt(r)))?re.scrollIntoView():scrollTo(0,0)}let ie=document.activeElement!==ne&&document.activeElement!==document.body;!a&&!ie&&It(r,!re),Ze=!0,K=!1,v.fulfil(void 0),v.navigation.to&&(v.navigation.to.scroll=E()),W.forEach(e=>e(v.navigation)),n===`popstate`&&st(Y),I.navigating.set(M.current=null)}async function Ot(e,t,n,r,i){return e.origin===ge&&e.pathname===location.pathname&&!Ye?await St({status:r,error:n,url:e,route:t}):await L(e,i)}var Q={element:void 0,href:void 0};function kt(){let e,t;z.addEventListener(`mousemove`,t=>{let n=t.target;clearTimeout(e),e=setTimeout(()=>{i(n,T.hover)},20)});function n(e){e.defaultPrevented||i(e.composedPath()[0],T.tap)}z.addEventListener(`mousedown`,n),z.addEventListener(`touchstart`,n,{passive:!0});let r=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&(dt(new URL(t.target.href)),r.unobserve(t.target))},{threshold:0});async function i(e,n){let r=be(e,z),i=r===Q.element&&r?.href===Q.href&&n>=t;if(!r||i)return;let{url:a,external:o,download:s}=xe(r,S,B.hash);if(o||s)return;let c=O(r),l=a&&Et(G.url)===Et(a);if(!(c.reload||l)){if(n<=c.preload_data){Q={element:r,href:r.href},t=T.tap;let e=await wt(a,!1);if(!e)return;ut(e)}else n<=c.preload_code&&(Q={element:r,href:r.href},t=n,dt(a))}}function a(){r.disconnect();for(let e of z.querySelectorAll(`a`)){let{url:t,external:n,download:i}=xe(e,S,B.hash);if(n||i)continue;let a=O(e);a.reload||(a.preload_code===T.viewport&&r.observe(e),a.preload_code===T.eager&&dt(t))}}W.add(a),a()}function $(e,t){if(e instanceof c)return e.body;let n=Oe(e),r=ke(e);return B.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function At(e,t={}){return e=new URL(_e(e)),e.origin===ge?lt(e,t,0):Promise.reject(Error(`goto: invalid URL`))}function jt(e){if(typeof e==`function`)V.push(e);else{let{href:t}=new URL(e,location.href);V.push(e=>e.href===t)}}function Mt(){history.scrollRestoration=`manual`,addEventListener(`beforeunload`,e=>{let t=!1;if(ct(),!K){let e=Lt(G,void 0,null,`leave`),n={...e.navigation,cancel:()=>{t=!0,e.reject(Error(`navigation cancelled`))}};qe.forEach(e=>e(n))}t?(e.preventDefault(),e.returnValue=``):history.scrollRestoration=`auto`}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&ct()}),navigator.connection?.saveData||kt(),z.addEventListener(`click`,async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;let n=be(t.composedPath()[0],z);if(!n)return;let{url:r,external:i,target:a,download:o}=xe(n,S,B.hash);if(!r)return;if(a===`_parent`||a===`_top`){if(window.parent!==window)return}else if(a&&a!==`_self`)return;let s=O(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&r.protocol!==`https:`&&r.protocol!==`http:`||o)return;let[c,l]=(B.hash?r.hash.replace(/^#/,``):r.href).split(`#`),u=c===m(location);if(i||s.reload&&(!u||!l)){Dt({url:r,type:`link`,event:t})?K=!0:t.preventDefault();return}if(l!==void 0&&u){let[,i]=G.url.href.split(`#`);if(i===l){if(t.preventDefault(),l===``||l===`top`&&n.ownerDocument.getElementById(`top`)===null)scrollTo({top:0});else{let e=n.ownerDocument.getElementById(decodeURIComponent(l));e&&(e.scrollIntoView(),e.focus())}return}if(q=!0,Le(J),e(r),!s.replace_state)return;q=!1}t.preventDefault(),await new Promise(e=>{requestAnimationFrame(()=>{setTimeout(e,0)}),setTimeout(e,100)}),await Z({type:`link`,url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}),z.addEventListener(`submit`,e=>{if(e.defaultPrevented)return;let t=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if((n?.formTarget||t.target)===`_blank`||(n?.formMethod||t.method)!==`get`)return;let r=new URL(n?.hasAttribute(`formaction`)&&n?.formAction||t.action);if(k(r,S,!1))return;let i=e.target,a=O(i);if(a.reload)return;e.preventDefault(),e.stopPropagation();let o=new FormData(i,n);r.search=new URLSearchParams(o).toString(),Z({type:`form`,url:r,keepfocus:a.keepfocus,noscroll:a.noscroll,replace_state:a.replace_state??r.href===location.href,event:e})}),addEventListener(`popstate`,async t=>{if(!Ft){if(t.state?.[`sveltekit:history`]){let n=t.state[C];if(X={},n===J)return;let r=P[n],i=t.state[`sveltekit:states`]??{},a=new URL(t.state[`sveltekit:pageurl`]??location.href),o=t.state[w],s=G.url?m(location)===m(G.url):!1;if(o===Y&&(Qe||s)){i!==j.state&&(j.state=i),e(a),P[J]=E(),r&&scrollTo(r.x,r.y),J=n;return}let c=n-J;await Z({type:`popstate`,url:a,popped:{state:i,scroll:r,delta:c},accept:()=>{J=n,Y=o},block:()=>{history.go(-c)},nav_token:X,event:t})}else q||(e(new URL(location.href)),B.hash&&location.reload())}}),addEventListener(`hashchange`,()=>{q&&(q=!1,history.replaceState({...history.state,[C]:++J,[w]:Y},``,location.href))});for(let e of document.querySelectorAll(`link`))Ie.has(e.rel)&&(e.href=e.href);addEventListener(`pageshow`,e=>{e.persisted&&I.navigating.set(M.current=null)});function e(e){G.url=j.url=e,I.page.set(Rt(j)),I.page.notify()}}async function Nt(e,{status:t=200,error:n,node_ids:r,params:i,route:a,server_route:o,data:s,form:c}){Ye=!0;let u=new URL(location.href),d;({params:i={},route:a={id:null}}=await wt(u,!1)||{}),d=Be.find(({id:e})=>e===a.id);let f,p=!0;try{let e=r.map(async(t,n)=>{let r=s[n];return r?.uses&&(r.uses=Pt(r.uses)),mt({loader:B.nodes[t],url:u,params:i,route:a,parent:async()=>{let t={};for(let r=0;r{let a=history.state;Ft=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(a,``,e),t&&scrollTo(r,i),Ft=!1})}else{let e=document.body,t=e.getAttribute(`tabindex`);e.tabIndex=-1,e.focus({preventScroll:!0,focusVisible:!1}),t===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t)}let r=getSelection();if(r&&r.type!==`None`){let e=[];for(let t=0;t{if(r.rangeCount===e.length){for(let t=0;t{a=e,o=t});return s.catch(h),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:E()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:i},willUnload:!t,type:r,complete:s},fulfil:a,reject:o}}function Rt(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function zt(e){let t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function Bt(e){let t;if(B.hash){let[,,n]=e.hash.split(`#`,3);t=n??``}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Te as a,j as i,it as n,M as r,At as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/CDAAYzUu.js b/app/smartbrain_3000/web/_app/immutable/chunks/CDAAYzUu.js new file mode 100644 index 00000000..3e2038ed --- /dev/null +++ b/app/smartbrain_3000/web/_app/immutable/chunks/CDAAYzUu.js @@ -0,0 +1 @@ +import{ut as e}from"./BChu7Pos.js";e(); \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/CLNxzSSl.js b/app/smartbrain_3000/web/_app/immutable/chunks/CJLE_wpt.js similarity index 78% rename from app/smartbrain_3000/web/_app/immutable/chunks/CLNxzSSl.js rename to app/smartbrain_3000/web/_app/immutable/chunks/CJLE_wpt.js index 4ff2fecc..2f03afe1 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/CLNxzSSl.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/CJLE_wpt.js @@ -1 +1 @@ -import"./BJLLtWYH.js";import{i as e}from"./BxvjB08B.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t}; \ No newline at end of file +import"./BChu7Pos.js";import{i as e}from"./Czex3Sq4.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/uFPkKLC1.js b/app/smartbrain_3000/web/_app/immutable/chunks/CcVP_dcS.js similarity index 76% rename from app/smartbrain_3000/web/_app/immutable/chunks/uFPkKLC1.js rename to app/smartbrain_3000/web/_app/immutable/chunks/CcVP_dcS.js index 1f5af7f6..9f23e362 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/uFPkKLC1.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/CcVP_dcS.js @@ -1 +1 @@ -import{$ as e}from"./BJLLtWYH.js";var t=e({items:[]}),n=0;function r(e,r=`ok`,a=4e3){let o=++n;return t.items.push({id:o,msg:e,kind:r}),a>0&&setTimeout(()=>i(o),a),o}function i(e){let n=t.items.findIndex(t=>t.id===e);n>=0&&t.items.splice(n,1)}export{r as n,t as r,i as t}; \ No newline at end of file +import{$ as e}from"./BChu7Pos.js";var t=e({items:[]}),n=0;function r(e,r=`ok`,a=4e3){let o=++n;return t.items.push({id:o,msg:e,kind:r}),a>0&&setTimeout(()=>i(o),a),o}function i(e){let n=t.items.findIndex(t=>t.id===e);n>=0&&t.items.splice(n,1)}export{r as n,t as r,i as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/tlN4Hcij.js b/app/smartbrain_3000/web/_app/immutable/chunks/CeaAcbO3.js similarity index 93% rename from app/smartbrain_3000/web/_app/immutable/chunks/tlN4Hcij.js rename to app/smartbrain_3000/web/_app/immutable/chunks/CeaAcbO3.js index cdf016b6..97bfdac4 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/tlN4Hcij.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/CeaAcbO3.js @@ -1 +1 @@ -import{A as e,C as t,G as n,M as r,N as i,O as a,P as o,R as s,V as c,X as l,Z as u,a as d,ct as f,ft as p,g as m,j as h,st as g,z as _}from"./BJLLtWYH.js";import"./xihTtKlq.js";var v=o(` `),y=o(``),b=o(`
`);function x(o,s){f(s,!0);let x=d(s,`onselect`,3,()=>{}),S=d(s,`variant`,3,`pill`);var C=b();a(C,21,()=>s.tabs,e=>e.id,(a,o)=>{var d=i(),f=l(d),p=e=>{var i=v();let a;var l=u(i,!0);n(()=>{m(i,`href`,c(o).href),m(i,`aria-selected`,s.active===c(o).id),a=t(i,1,`svelte-126ak3w`,null,a,{active:s.active===c(o).id}),h(l,c(o).label)}),r(e,i)},g=e=>{var i=y();let a;var l=u(i,!0);n(()=>{m(i,`aria-selected`,s.active===c(o).id),a=t(i,1,`svelte-126ak3w`,null,a,{active:s.active===c(o).id}),h(l,c(o).label)}),_(`click`,i,()=>x()(c(o).id)),r(e,i)};e(f,e=>{c(o).href?e(p):e(g,-1)}),r(a,d)}),p(C),n(()=>t(C,1,`tabs ${S()??``}`,`svelte-126ak3w`)),r(o,C),g()}s([`click`]);export{x as t}; \ No newline at end of file +import{A as e,C as t,G as n,M as r,N as i,O as a,P as o,R as s,V as c,X as l,Z as u,a as d,ct as f,ft as p,g as m,j as h,st as g,z as _}from"./BChu7Pos.js";import"./xihTtKlq.js";var v=o(` `),y=o(``),b=o(`
`);function x(o,s){f(s,!0);let x=d(s,`onselect`,3,()=>{}),S=d(s,`variant`,3,`pill`);var C=b();a(C,21,()=>s.tabs,e=>e.id,(a,o)=>{var d=i(),f=l(d),p=e=>{var i=v();let a;var l=u(i,!0);n(()=>{m(i,`href`,c(o).href),m(i,`aria-selected`,s.active===c(o).id),a=t(i,1,`svelte-126ak3w`,null,a,{active:s.active===c(o).id}),h(l,c(o).label)}),r(e,i)},g=e=>{var i=y();let a;var l=u(i,!0);n(()=>{m(i,`aria-selected`,s.active===c(o).id),a=t(i,1,`svelte-126ak3w`,null,a,{active:s.active===c(o).id}),h(l,c(o).label)}),_(`click`,i,()=>x()(c(o).id)),r(e,i)};e(f,e=>{c(o).href?e(p):e(g,-1)}),r(a,d)}),p(C),n(()=>t(C,1,`tabs ${S()??``}`,`svelte-126ak3w`)),r(o,C),g()}s([`click`]);export{x as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/BtjCS6Y-.js b/app/smartbrain_3000/web/_app/immutable/chunks/ChxMyhtI.js similarity index 65% rename from app/smartbrain_3000/web/_app/immutable/chunks/BtjCS6Y-.js rename to app/smartbrain_3000/web/_app/immutable/chunks/ChxMyhtI.js index 7c10af2a..332f677e 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/BtjCS6Y-.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/ChxMyhtI.js @@ -1 +1 @@ -import{$ as e}from"./BJLLtWYH.js";import{n as t}from"./CoHYJ8BJ.js";var n=e({count:0});async function r(){try{n.count=(await t.listPending()).pending.length}catch{}}export{r as n,n as t}; \ No newline at end of file +import{$ as e}from"./BChu7Pos.js";import{n as t}from"./BkiVJrb-.js";var n=e({count:0});async function r(){try{n.count=(await t.listPending()).pending.length}catch{}}export{r as n,n as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/Cmegxfzj.js b/app/smartbrain_3000/web/_app/immutable/chunks/Cmegxfzj.js deleted file mode 100644 index 7af989c9..00000000 --- a/app/smartbrain_3000/web/_app/immutable/chunks/Cmegxfzj.js +++ /dev/null @@ -1 +0,0 @@ -import"./BxvjB08B.js"; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/CoHYJ8BJ.js b/app/smartbrain_3000/web/_app/immutable/chunks/CoHYJ8BJ.js deleted file mode 100644 index 069c8029..00000000 --- a/app/smartbrain_3000/web/_app/immutable/chunks/CoHYJ8BJ.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e}from"./BJLLtWYH.js";import{t}from"./BxvjB08B.js";import"./Cmegxfzj.js";import{a as n,c as r,d as i,f as a,g as o,i as s,l as c,m as l,n as u,p as d,r as f,t as p,u as m,v as ee}from"./CQMDLFxa.js";function te(e){let t=[];if(typeof e.forEach==`function`)e.forEach(e=>t.push(e));else for(let n of e)t.push(n);let n=``,r=``;for(let e of t)e.type===`candidate-pair`&&(e.nominated||e.state===`succeeded`)&&(n=e.localCandidateId??``,r=e.remoteCandidateId??``);if(!n||!r)return`unknown`;let i=``,a=``;for(let e of t)e.id===n?i=e.candidateType??``:e.id===r&&(a=e.candidateType??``);return i===`relay`||a===`relay`?`relay`:i&&a?`direct`:`unknown`}var h=e({status:`idle`,detail:``,needsPairing:!1});function g(e,t=``){h.status=e,h.detail=t}var _=3e3,v=6e4,y=1e3,b=3e4,x=15e3,S=6,C=2e4,w=45e3,T=800,ne=`Desktop unreachable — it may be off or asleep. If it's on a VPN, turning the VPN off on the Desktop often fixes this — then Retry.`,E=`your Desktop is locked — unlock it there, then this phone reconnects`,re=class{pairing;pc=null;ws=null;channel=null;pending=new Map;ready=null;markReady=null;failReady=null;nonceB64=``;desktopVerified=!1;lockedHint=!1;seq=0;closed=!1;reconnects=0;connectTimer=null;pingTimer=null;verifyTimer=null;lastPong=0;offerSent=!1;iceWaitTimer=null;constructor(e){this.pairing=e}connect(){this.closed=!1,this.offerSent=!1,this.ready=new Promise((e,t)=>{this.markReady=e,this.failReady=t}),this.ready.catch(()=>{}),g(`connecting`),this.connectTimer=setTimeout(()=>this.onConnectFailure(),x),this.pc=new RTCPeerConnection({iceServers:this.pairing.iceServers}),this.pc.onconnectionstatechange=()=>this.onPcState(),this.channel=this.pc.createDataChannel(`sb-api`),this.channel.onopen=()=>this.startHandshake(),this.channel.onmessage=e=>this.onChannelMessage(String(e.data)),this.openSignaling()}openSignaling(){let e=new WebSocket(this.pairing.signalingUrl);this.ws=e,e.onopen=()=>{e.send(JSON.stringify({role:`phone`,desktop_id:this.pairing.desktopId})),this.iceWaitTimer=setTimeout(()=>void this.makeOffer(),T)},e.onerror=()=>g(`offline`,`can't reach the signaling service`),e.onmessage=e=>this.onSignal(String(e.data))}async makeOffer(){if(!this.pc||this.offerSent)return;this.offerSent=!0,this.iceWaitTimer&&=(clearTimeout(this.iceWaitTimer),null),await this.pc.setLocalDescription(await this.pc.createOffer()),await this.iceGatheringDone();let e=this.pc.localDescription?.sdp??``;this.send({type:`offer`,sdp:e})}iceGatheringDone(){let e=this.pc;return!e||e.iceGatheringState===`complete`?Promise.resolve():new Promise(t=>{let n=()=>{e.iceGatheringState===`complete`&&r()},r=()=>{e.removeEventListener(`icegatheringstatechange`,n),clearTimeout(i),t()},i=setTimeout(r,_);e.addEventListener(`icegatheringstatechange`,n)})}async onSignal(e){let t;try{t=JSON.parse(e)}catch{return}if(t.type===`ice`&&Array.isArray(t.iceServers)){if(this.pc&&!this.offerSent)try{this.pc.setConfiguration({iceServers:t.iceServers})}catch{}this.makeOffer()}else t.type===`answer`&&t.sdp&&this.pc?await this.pc.setRemoteDescription({type:`answer`,sdp:t.sdp}):t.type===`error`&&g(`offline`,t.detail||`the Desktop isn't reachable`)}startHandshake(){this.nonceB64=u(),this.send(void 0,c(this.nonceB64))}async onChannelMessage(e){let t;try{t=d(e)}catch{return}let r=t.type;if(r===`hello_ok`)return this.onHelloOk(t);if(r===`locked_challenge`&&!this.desktopVerified){this.send({type:`whoami`,device_id:this.pairing.deviceId});return}if(r===`auth_error`&&t.reason===`locked`&&!this.desktopVerified){this.lockedHint=!0,this.onConnectFailure();return}if(this.desktopVerified){if(r===`auth_ok`)return this.onAuthOk();if(r===`pong`){this.lastPong=Date.now();return}if(r===`auth_error`){g(`offline`,t.reason===`locked`?E:`this device isn't authorized — re-pair`),this.failReady?.(Error(`auth_error`)),this.close();return}if(a(t))return this.onChunkFrame(t);typeof t.status==`number`&&this.resolvePending(n(t))}}async onHelloOk(e){g(`verifying`);let t=this.pc?.localDescription?.sdp??``,n=this.pc?.remoteDescription?.sdp??``,i=!1;try{let r=await p(t,n);i=await f(this.pairing.desktopPubkey,this.nonceB64,r,String(e.signature??``))}catch{i=!1}if(!i||e.pubkey!==this.pairing.desktopPubkey){g(`untrusted`,`couldn't verify your Desktop — connection blocked`),this.failReady?.(Error(`untrusted`)),this.close();return}this.desktopVerified=!0,this.send(void 0,r(this.pairing.deviceId,this.pairing.credential))}async onAuthOk(){this.connectTimer&&=(clearTimeout(this.connectTimer),null),this.lastPong=Date.now(),this.pingTimer=setInterval(()=>this.pingTick(),C);let e=await this.connectionKind();g(e===`relay`?`connected-relay`:e===`direct`?`connected-direct`:`connected`),this.markReady?.()}async connectionKind(){if(!this.pc)return`unknown`;try{return te(await this.pc.getStats())}catch{return`unknown`}}pingTick(){if(!(this.closed||this.channel?.readyState!==`open`)){if(l(this.lastPong,Date.now(),w)){this.onConnectFailure();return}this.send(void 0,m(Date.now()))}}onPcState(){let e=this.pc?.connectionState;this.closed||(e===`connected`&&(this.reconnects=0),e===`connected`&&(this.lockedHint=!1),(e===`failed`||e===`disconnected`)&&this.onConnectFailure())}onConnectFailure(){if(this.closed)return;if(this.teardown(),this.reconnects>=S){this.failTerminal();return}g(`reconnecting`,this.lockedHint?E:``);let e=Math.min(b,y*2**this.reconnects),t=e/2+e/2*Math.random();this.reconnects+=1,setTimeout(()=>{this.closed||this.connect()},t)}failTerminal(){this.closed=!0,this.teardown(),g(`offline`,this.lockedHint?E:ne)}async request(e,t,n,r){if(!this.ready)throw Error(`not connecting`);await this.ready;let a=String(++this.seq),o=i(a,e,t,n,r);return new Promise((e,t)=>{let n=setTimeout(()=>{this.pending.delete(a),t(Error(`remote request timed out`))},v);this.pending.set(a,{resolve:e,reject:t,timer:n,chunks:null});try{for(let e of o)this.channel?.send(e)}catch(e){clearTimeout(n),this.pending.delete(a),t(e instanceof Error?e:Error(`send failed`))}})}isLive(){let e=this.pc?.connectionState;return e===`new`||e===`connecting`||e===`connected`}verify(e=2500){if(this.closed)return;if(!this.isLive()||this.channel?.readyState!==`open`){this.onConnectFailure();return}if(this.lastPong===0)return;let t=this.lastPong;try{this.send(void 0,m(Date.now()))}catch{this.onConnectFailure();return}this.verifyTimer&&clearTimeout(this.verifyTimer),this.verifyTimer=setTimeout(()=>{this.verifyTimer=null,!this.closed&&this.lastPong===t&&this.onConnectFailure()},e)}onChunkFrame(e){let t=String(e.id??``),n=this.pending.get(t);if(!n)return;let r=s(n.chunks,e);if(r.error){clearTimeout(n.timer),this.pending.delete(t),n.reject(Error(r.error));return}if(r.done){this.resolvePending(r.done);return}n.chunks=r.state??null,clearTimeout(n.timer),n.timer=setTimeout(()=>{this.pending.delete(t),n.reject(Error(`remote request timed out`))},v)}resolvePending(e){let t=this.pending.get(e.id);t&&(clearTimeout(t.timer),this.pending.delete(e.id),t.resolve(e))}send(e,t){let n=t??JSON.stringify(e);t&&this.channel?.readyState===`open`?this.channel.send(t):e&&this.ws?.send(n)}teardown(){this.connectTimer&&=(clearTimeout(this.connectTimer),null),this.iceWaitTimer&&=(clearTimeout(this.iceWaitTimer),null),this.pingTimer&&=(clearInterval(this.pingTimer),null),this.verifyTimer&&=(clearTimeout(this.verifyTimer),null),this.lastPong=0,this.desktopVerified=!1;for(let[,e]of this.pending)clearTimeout(e.timer),e.reject(Error(`connection dropped`));this.pending.clear();try{this.ws?.close()}catch{}try{this.pc?.close()}catch{}this.ws=this.pc=this.channel=null}close(){this.closed=!0,this.teardown()}},D=null;function O(e){return D?.close(),D=new re(e),D.connect(),D}function k(){D?.close(),D=null}function A(){return D}var j={"content-type":`application/json`};async function M(){try{return(await fetch(`/api/health?${ee}=1`,{cache:`no-store`,signal:AbortSignal.timeout(2e3)})).ok}catch{return!1}}async function N(){for(let e=0;e<3;e++)if(await new Promise(e=>setTimeout(e,700)),await M())return!0;return!1}async function P(e,t,n,r,i){let a=typeof e==`string`?e:e instanceof URL?e.href:e.url,o=new URL(a,i),s=o.pathname.startsWith(`/api`)||o.pathname.startsWith(`/mcp`);if(!n||!s||o.searchParams.has(`__direct`))return r(e,t);let c=new Request(e,t),l={};c.headers.forEach((e,t)=>l[t]=e);let u=[`GET`,`HEAD`].includes(c.method)?new Uint8Array:new Uint8Array(await c.arrayBuffer());try{let e=await n.request(c.method,o.pathname+o.search,l,u);return new Response(e.body,{status:e.status,headers:e.headers})}catch{return new Response(JSON.stringify({detail:`remote request failed`}),{status:503,headers:j})}}function F(e){let t=window.fetch.bind(window);window.fetch=(n,r)=>{if(h.status===`offline`){let t=typeof n==`string`?n:n instanceof URL?n.href:n.url,r=new URL(t,window.location.origin).pathname;(r.startsWith(`/api`)||r.startsWith(`/mcp`))&&O(e)}return P(n,r,A(),t,window.location.origin)}}var I=()=>{},L=new Promise(e=>{I=e});async function R(){try{await z()}finally{I()}}async function z(){if(typeof navigator>`u`||!(`serviceWorker`in navigator))return;let e=await o().catch(()=>null);if(!e){h.needsPairing=!(await M()||await N());return}if(await M())return;O(e),F(e);let t,n=()=>{t&&clearTimeout(t),t=void 0},r=()=>{n();let t=A();if(!t||h.status===`offline`||h.status===`reconnecting`||!t.isLive()){O(e);return}t.verify()};window.addEventListener(`pagehide`,()=>{n(),k()}),window.addEventListener(`pageshow`,r),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`?(n(),t=setTimeout(()=>{t=void 0,k()},18e4)):r()})}function B(){typeof navigator<`u`&&`serviceWorker`in navigator&&navigator.serviceWorker.ready.then(e=>e.update()).catch(()=>{})}var V=null;function H(e){V=e}function U(){V?.(),q()}var W=null;function G(e){W=e}function K(){W?.(),q()}function q(){typeof window<`u`&&window.location.pathname.startsWith(`/unlock`)||t(`/unlock`)}function J(e,t){e===423?U():e===401&&t?.code===`no_session`&&K()}var Y=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),X=class extends Error{status;code;constructor(e,t,n){super(t),this.status=e,this.code=n,this.name=`ApiError`}};async function Z(e,t={}){await L;let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t.headers??{}}}),r=n.status===204?null:await n.json().catch(()=>null);if(!n.ok){let e=r&&r.detail||`request failed (${n.status})`;throw J(n.status,r),new X(n.status,e,r?.code)}return r}function ie(e){return!!e&&e.unlocked&&e.session!==!1}function Q(e){console.assert(e instanceof Headers,`parseExportHeaders: real Headers instance required`),console.assert(typeof e.get==`function`,`parseExportHeaders: h.get missing`);let t=e.get(`x-sb-export-seq`),n=t===null?NaN:Number.parseInt(t,10),r=e.get(`x-sb-export-mode`);return{seq:Number.isFinite(n)?n:null,mode:r===`sealed`||r===`open`?r:null,unchanged:e.get(`x-sb-export-unchanged`)===`1`,rotatedKey:e.get(`x-sb-export-rotated-key`)===`1`,retired:e.get(`x-sb-export-retired`)===`1`}}function $(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??``}catch{return``}}var ae={health:()=>Z(`/api/health`,{headers:$()?{"x-smartbrain-timezone":$()}:{}}),accountStatus:()=>Z(`/api/account/status`),installUpdate:()=>Z(`/api/update/install`,{method:`POST`,body:JSON.stringify({})}),setup:e=>Z(`/api/account/setup`,{method:`POST`,body:JSON.stringify({passphrase:e})}),unlock:e=>Z(`/api/account/unlock`,{method:`POST`,body:JSON.stringify(e)}),lock:()=>Z(`/api/account/lock`,{method:`POST`}),changePassphrase:(e,t)=>Z(`/api/account/passphrase`,{method:`POST`,body:JSON.stringify({current_passphrase:e,new_passphrase:t})}),resetPassphrase:(e,t)=>Z(`/api/account/passphrase/reset`,{method:`POST`,body:JSON.stringify({new_passphrase:e,recovery_key:t})}),exportData:e=>Z(`/api/export`,{method:`POST`,body:JSON.stringify({passphrase:e})}),backup:async e=>{await L;let t=await fetch(`/api/backup`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({passphrase:e})});if(!t.ok){let e=await t.json().catch(()=>null);throw new X(t.status,e?.detail||`backup failed (${t.status})`)}return t.blob()},restore:async e=>{await L;let t=await fetch(`/api/restore`,{method:`POST`,body:e}),n=await t.json().catch(()=>null);if(!t.ok)throw new X(t.status,n?.detail||`restore failed (${t.status})`);return n},listSecrets:()=>Z(`/api/secrets`),putSecret:(e,t)=>Z(`/api/secrets/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify({value:t})}),deleteSecret:e=>Z(`/api/secrets/${encodeURIComponent(e)}`,{method:`DELETE`}),localModels:(e=!1)=>Z(`/api/local-models${e?`?fresh=1`:``}`),listModels:()=>Z(`/api/models`),getRoutes:()=>Z(`/api/routes`),putRoutes:e=>Z(`/api/routes`,{method:`PUT`,body:JSON.stringify({routes:e})}),getContextLengths:()=>Z(`/api/model-context-lengths`),putContextLengths:e=>Z(`/api/model-context-lengths`,{method:`PUT`,body:JSON.stringify({lengths:e})}),getUsage:e=>{let t=new URLSearchParams;e?.since&&t.set(`since`,e.since),e?.until&&t.set(`until`,e.until);let n=t.toString();return Z(`/api/usage${n?`?${n}`:``}`)},putOllama:e=>Z(`/api/local-models/ollama`,{method:`PUT`,body:JSON.stringify({url:e})}),putMlx:(e,t)=>Z(`/api/local-models/mlx`,{method:`PUT`,body:JSON.stringify({url:e,api_key:t})}),putMlxe:(e,t)=>Z(`/api/local-models/mlxe`,{method:`PUT`,body:JSON.stringify({url:e,api_key:t})}),putClaudeCode:()=>Z(`/api/local-models/claudecode`,{method:`PUT`}),updateClaudeCode:()=>Z(`/api/local-models/claudecode/update`,{method:`POST`}),deleteLocalModel:e=>Z(`/api/local-models/${e}`,{method:`DELETE`}),chat:e=>Z(`/api/chat`,{method:`POST`,body:JSON.stringify(e)}),agentTurn:e=>Z(`/api/agent/turn`,{method:`POST`,body:JSON.stringify(e)}),feedback:(e,t)=>Z(`/api/feedback`,{method:`POST`,body:JSON.stringify({kind:e,conversation_id:t})}).catch(()=>void 0),agentResume:e=>Z(`/api/agent/resume/${encodeURIComponent(e)}`,{method:`POST`}),agentTurnStream:async(e,t)=>{await L;let n=await fetch(`/api/agent/turn/stream`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e),signal:t});if(!n.ok){let e=await n.json().catch(()=>null);throw J(n.status,e),new X(n.status,e?.detail||`stream failed (${n.status})`)}return n},agentTurnEvents:async e=>{await L;let t=await fetch(`/api/agent/turn/events`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>null);throw J(t.status,e),new X(t.status,e?.detail||`turn failed (${t.status})`)}return t},getWebSearch:()=>Z(`/api/websearch`),putWebSearch:e=>Z(`/api/websearch`,{method:`PUT`,body:JSON.stringify(e)}),getSelfImprove:()=>Z(`/api/selfimprove`),putSelfImprove:e=>Z(`/api/selfimprove`,{method:`PUT`,body:JSON.stringify(e)}),getOptimizer:()=>Z(`/api/selfimprove/optimizer`),putOptimizer:e=>Z(`/api/selfimprove/optimizer`,{method:`PUT`,body:JSON.stringify({enabled:e})}),listImprovements:()=>Z(`/api/selfimprove/improvements`),listConversations:(e={})=>{let t=new URLSearchParams;e.before&&t.set(`before`,e.before),e.limit&&t.set(`limit`,String(e.limit));let n=t.toString();return Z(`/api/conversations${n?`?${n}`:``}`)},createConversation:e=>Z(`/api/conversations`,{method:`POST`,body:JSON.stringify({title:e})}),getConversation:(e,t={})=>{let n=new URLSearchParams;t.before&&n.set(`before`,t.before),t.limit&&n.set(`limit`,String(t.limit));let r=n.toString();return Z(`/api/conversations/${encodeURIComponent(e)}${r?`?${r}`:``}`)},renameConversation:(e,t)=>Z(`/api/conversations/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({title:t})}),deleteConversation:e=>Z(`/api/conversations/${encodeURIComponent(e)}`,{method:`DELETE`}),deleteAllConversations:()=>Z(`/api/conversations`,{method:`DELETE`}),listTrash:()=>Z(`/api/conversations/trash`),emptyTrash:()=>Z(`/api/conversations/trash`,{method:`DELETE`}),restoreConversation:e=>Z(`/api/conversations/${encodeURIComponent(e)}/restore`,{method:`POST`}),addMessage:(e,t,n,r)=>Z(`/api/conversations/${encodeURIComponent(e)}/messages`,{method:`POST`,body:JSON.stringify(r?.length?{role:t,content:n,sources:r}:{role:t,content:n})}),listToolDefs:()=>Z(`/api/tools`),invokeTool:(e,t)=>Z(`/api/tools/invoke`,{method:`POST`,body:JSON.stringify({name:e,args:t})}),getAudit:(e=100)=>Z(`/api/audit?limit=${e}`),voiceStatus:(e=!1,t=!1)=>{let n=[e?`probe=1`:``,t?`prepare=1`:``].filter(Boolean).join(`&`);return Z(`/api/voice/status${n?`?${n}`:``}`)},appStatus:()=>Z(`/api/status/overview`),voiceTranscribe:async(e,t={})=>{await L;let n=new AbortController,r=setTimeout(()=>n.abort(),45e3),i;try{i=await fetch(t.partial?`/api/voice/transcribe?partial=1`:`/api/voice/transcribe`,{method:`POST`,headers:{"content-type":`audio/wav`,...t.keep?{"x-sb-voice-keep":`1`}:{}},body:e,signal:n.signal})}catch(e){throw n.signal.aborted?new X(504,`transcription timed out — try again`):e}finally{clearTimeout(r)}let a=await i.json().catch(()=>null);if(!i.ok)throw J(i.status,a),new X(i.status,a?.detail||`transcription failed (${i.status})`);return a},voiceSpeak:async e=>{await L;let t=await fetch(`/api/voice/speak`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:e})});return t.ok?t.blob():null},putVoiceConfig:e=>Z(`/api/local-models/voice`,{method:`PUT`,body:JSON.stringify(e)}),deleteVoiceConfig:()=>Z(`/api/local-models/voice`,{method:`DELETE`}),listPending:()=>Z(`/api/agent/pending`),approveAction:(e,t=null,n=!1)=>Z(`/api/agent/pending/${encodeURIComponent(e)}/approve`,{method:`POST`,body:JSON.stringify({confirm_tool:t,remember:n})}),denyAction:e=>Z(`/api/agent/pending/${encodeURIComponent(e)}/deny`,{method:`POST`}),listRemembered:()=>Z(`/api/agent/remembered`),forgetRemembered:(e,t=null)=>{let n=t?`?host=${encodeURIComponent(t)}`:``;return Z(`/api/agent/remembered/${encodeURIComponent(e)}${n}`,{method:`DELETE`})},listTasks:()=>Z(`/api/tasks`),addTask:e=>Z(`/api/tasks`,{method:`POST`,body:JSON.stringify(e)}),updateTask:(e,t)=>Z(`/api/tasks/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify(t)}),setTaskStatus:(e,t)=>Z(`/api/tasks/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({status:t})}),deleteTask:e=>Z(`/api/tasks/${encodeURIComponent(e)}`,{method:`DELETE`}),listSchedules:()=>Z(`/api/schedules`),addSchedule:e=>Z(`/api/schedules`,{method:`POST`,body:JSON.stringify(e)}),updateSchedule:(e,t)=>Z(`/api/schedules/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify(t)}),setScheduleEnabled:(e,t)=>Z(`/api/schedules/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({enabled:t})}),deleteSchedule:e=>Z(`/api/schedules/${encodeURIComponent(e)}`,{method:`DELETE`}),runSchedule:e=>Z(`/api/schedules/${encodeURIComponent(e)}/run`,{method:`POST`}),listScheduleRuns:e=>Z(`/api/schedules/${encodeURIComponent(e)}/runs`),recentScheduleRuns:()=>Z(`/api/schedules/runs/recent`),unseenScheduleUpdates:()=>Z(`/api/schedules/updates/unseen-count`),markScheduleUpdatesSeen:()=>Z(`/api/schedules/updates/seen`,{method:`POST`}),listMemories:()=>Z(`/api/memories`),addMemory:e=>Z(`/api/memories`,{method:`POST`,body:JSON.stringify({text:e})}),deleteMemory:e=>Z(`/api/memories/${encodeURIComponent(e)}`,{method:`DELETE`}),getProfile:()=>Z(`/api/profile`),setProfile:e=>Z(`/api/profile`,{method:`PUT`,body:JSON.stringify(e)}),listDocs:()=>Z(`/api/kb`),addDoc:(e,t)=>Z(`/api/kb`,{method:`POST`,body:JSON.stringify({title:e,content:t})}),ingestUrl:e=>Z(`/api/kb/ingest-url`,{method:`POST`,body:JSON.stringify({url:e})}),uploadDoc:e=>Z(`/api/kb/upload?filename=${encodeURIComponent(e.name)}`,{method:`POST`,body:e,headers:{"content-type":`application/octet-stream`}}),indexStatus:()=>Z(`/api/kb/index-status`),getDoc:e=>Z(`/api/kb/${encodeURIComponent(e)}`),renameDoc:(e,t)=>Z(`/api/kb/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({title:t})}),setDocTags:(e,t)=>Z(`/api/kb/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({tags:t})}),deleteDoc:e=>Z(`/api/kb/${encodeURIComponent(e)}`,{method:`DELETE`}),searchKb:(e,t=`hybrid`,n=10,r=``)=>Z(`/api/kb/search?${new URLSearchParams({q:e,mode:t,limit:String(n),...r?{vault:r}:{}}).toString()}`),reindexKb:()=>Z(`/api/kb/reindex`,{method:`POST`}),listVaults:()=>Z(`/api/vaults`),createVault:(e,t=``)=>Z(`/api/vaults`,{method:`POST`,body:JSON.stringify({name:e,description:t})}),updateVaultMeta:(e,t)=>Z(`/api/vaults/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteVault:(e,t={})=>{let n=t.remove_docs?`?remove_docs=1`:``;return Z(`/api/vaults/${encodeURIComponent(e)}${n}`,{method:`DELETE`})},getVault:e=>Z(`/api/vaults/${encodeURIComponent(e)}`),removeFromVault:(e,t)=>Z(`/api/vaults/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}`,{method:`DELETE`}),detachFromVault:(e,t)=>Z(`/api/vaults/${encodeURIComponent(e)}/documents/${encodeURIComponent(t)}/detach`,{method:`POST`}),addToVault:(e,t)=>Z(`/api/vaults/${encodeURIComponent(e)}/documents`,{method:`POST`,body:JSON.stringify({doc_ids:t})}),listFeeds:()=>Z(`/api/feeds`),addFeed:(e,t=[])=>Z(`/api/feeds`,{method:`POST`,body:JSON.stringify(t.length?{url:e,tags:t}:{url:e})}),refreshFeed:e=>Z(`/api/feeds/${encodeURIComponent(e)}/refresh`,{method:`POST`}),deleteFeed:(e,t={})=>Z(`/api/feeds/${encodeURIComponent(e)}${t.remove_docs?`?remove_docs=1`:``}`,{method:`DELETE`}),exportVault:async(e,t,n=`sealed`)=>{await L;let r=await fetch(`/api/vaults/${encodeURIComponent(e)}/export`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({passphrase:t,mode:n})});if(!r.ok){let e=await r.json().catch(()=>null);throw new X(r.status,e?.detail||`export failed (${r.status})`)}let i=Q(r.headers);return{blob:await r.blob(),headers:i}},retireVault:async(e,t)=>{await L;let n=await fetch(`/api/vaults/${encodeURIComponent(e)}/retire`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({passphrase:t})});if(!n.ok){let e=await n.json().catch(()=>null);throw new X(n.status,e?.detail||`retire failed (${n.status})`)}let r=Q(n.headers);return{blob:await n.blob(),headers:r}},verifyHostedVault:e=>Z(`/api/vaults/${encodeURIComponent(e)}/verify-hosted`,{method:`POST`}),vaultKey:async(e,t)=>{await L;let n=await fetch(`/api/vaults/${encodeURIComponent(e)}/key`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({passphrase:t})}),r=await n.json().catch(()=>null);if(!n.ok)throw new X(n.status,r?.detail||`could not read the key`);return r.key},subscribeVault:e=>Z(`/api/vaults/subscribe`,{method:`POST`,body:JSON.stringify({url:e})}),importVault:async(e,t)=>{await L;let n=await fetch(`/api/vaults/import?key=${encodeURIComponent(t)}`,{method:`POST`,body:e,headers:{"content-type":`application/octet-stream`}}),r=await n.json().catch(()=>null);if(!n.ok)throw new X(n.status,r?.detail||`import failed`);return r},checkVaultUpdates:e=>Z(`/api/vaults/${encodeURIComponent(e)}/check-updates`,{method:`POST`}),updateVault:e=>Z(`/api/vaults/${encodeURIComponent(e)}/update`,{method:`POST`}),setSubscription:(e,t)=>Z(`/api/vaults/${encodeURIComponent(e)}/subscription`,{method:`PATCH`,body:JSON.stringify(t)}),trustVaultPublisher:(e,t,n)=>Z(`/api/vaults/${encodeURIComponent(e)}/trust-publisher`,{method:`POST`,body:JSON.stringify({offered_pubkey:t,passphrase:n})}),emailStatus:()=>Z(`/api/email/status`),emailConnect:(e,t)=>Z(`/api/email/connect`,{method:`POST`,body:JSON.stringify({client_id:e,client_secret:t})}),emailReconnect:()=>Z(`/api/email/reconnect`,{method:`POST`}),emailDisconnect:()=>Z(`/api/email/disconnect`,{method:`DELETE`}),emailMessages:(e=10)=>Z(`/api/email/messages?limit=${e}`),emailMessage:e=>Z(`/api/email/messages/${encodeURIComponent(e)}`),emailSend:(e,t,n)=>Z(`/api/email/send`,{method:`POST`,body:JSON.stringify({to:e,subject:t,body:n})}),mcpInfo:()=>Z(`/api/mcp`),mcpToken:()=>Z(`/api/mcp/token`),mcpNewToken:()=>Z(`/api/mcp/token`,{method:`POST`}),mcpRevokeToken:()=>Z(`/api/mcp/token`,{method:`DELETE`}),niMcpServers:()=>Z(`/api/ni/mcp-servers`),niMcpAdd:e=>Z(`/api/ni/mcp-servers`,{method:`POST`,body:JSON.stringify(e)}),niMcpUpdate:(e,t)=>Z(`/api/ni/mcp-servers/${encodeURIComponent(e)}`,{method:`PUT`,body:JSON.stringify(t)}),niMcpDelete:e=>Z(`/api/ni/mcp-servers/${encodeURIComponent(e)}`,{method:`DELETE`}),niBoard:()=>Z(`/api/ni/board`),niImageDataUrl:async e=>{await L;let t=await fetch(e);if(!t.ok)throw new X(t.status,`image failed (${t.status})`);let n=(t.headers.get(`content-type`)||``).split(`;`)[0].trim();if(!Y.has(n))throw new X(415,`unexpected image type ${n||`(none)`}`);let r=new Uint8Array(await t.arrayBuffer()),i=``;for(let e=0;eZ(`/api/ni/items/${encodeURIComponent(e)}`),niValidate:(e,t,n,r)=>Z(`/api/ni/items/${encodeURIComponent(e)}/validate`,{method:`POST`,body:JSON.stringify({ok:t,...n?{note:n}:{},...r?{presentation_id:r}:{}})}),niRun:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/run`,{method:`POST`}),niCommission:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/commission`,{method:`POST`}),niActivate:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/activate`,{method:`POST`}),niSwitchFeed:(e,t)=>Z(`/api/ni/items/${encodeURIComponent(e)}/switch-feed`,{method:`POST`,body:JSON.stringify({url:t})}),niPatch:(e,t)=>Z(`/api/ni/items/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)}),niDelete:e=>Z(`/api/ni/items/${encodeURIComponent(e)}`,{method:`DELETE`}),niPutCredential:(e,t,n,r)=>Z(`/api/ni/items/${encodeURIComponent(e)}/credential`,{method:`PUT`,body:JSON.stringify({name:t,value:n,host:r})}),niIntake:(e,t)=>Z(`/api/ni/intake`,{method:`POST`,body:JSON.stringify(t?{request:e,source_url:t}:{request:e})}),niFlowPickSource:(e,t,n=!1)=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/pick-source`,{method:`POST`,body:JSON.stringify(n?{url:t,pasted:n}:{url:t})}),niFlowAccess:(e,t,n)=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/access`,{method:`POST`,body:JSON.stringify({...t===void 0?{}:{key:t},...n===void 0?{}:{email:n}})}),niFlowFix:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/fix`,{method:`POST`}),niRefine:(e,t)=>Z(`/api/ni/items/${encodeURIComponent(e)}/refine`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({note:t})}),niFlowAnswer:(e,t,n)=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/answer`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:t,value:n})}),niFlowReopen:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/reopen`,{method:`POST`}),niFindings:()=>Z(`/api/ni/findings`),niResolveFinding:e=>Z(`/api/ni/findings/${encodeURIComponent(e)}/resolve`,{method:`POST`}),niFlowRetry:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/flow/retry`,{method:`POST`}),niPutParam:(e,t,n)=>Z(`/api/ni/items/${encodeURIComponent(e)}/param`,{method:`PUT`,body:JSON.stringify({name:t,value:n})}),niLibrary:()=>Z(`/api/ni/library`),niLibraryConnect:e=>Z(`/api/ni/library/connect`,{method:`POST`,body:JSON.stringify({url:e})}),niLibraryCheck:()=>Z(`/api/ni/library/check`,{method:`POST`}),niLibraryDisconnect:()=>Z(`/api/ni/library`,{method:`DELETE`}),niLibraryTrustKey:(e,t)=>Z(`/api/ni/library/trust-key`,{method:`POST`,body:JSON.stringify({offered_fingerprint:e,passphrase:t})}),niLibraryInstall:(e,t)=>Z(`/api/ni/library/install`,{method:`POST`,body:JSON.stringify({template_id:e,params:t})}),niApplyTemplateUpdate:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/apply-template-update`,{method:`POST`}),niL2Apply:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/l2-proposal/apply`,{method:`POST`}),niL2Dismiss:e=>Z(`/api/ni/items/${encodeURIComponent(e)}/l2-proposal/dismiss`,{method:`POST`}),niRepairPolicy:(e,t)=>Z(`/api/ni/items/${encodeURIComponent(e)}/repair-policy`,{method:`POST`,body:JSON.stringify(t)}),libraryStatus:()=>Z(`/api/library/status`),libraryInstall:()=>Z(`/api/library/install`,{method:`POST`}),libraryTaxonomy:()=>Z(`/api/library/taxonomy`),librarySources:(e={})=>{let t=new URLSearchParams;e.q&&t.set(`q`,e.q),e.category&&t.set(`category`,e.category),e.subcategory&&t.set(`subcategory`,e.subcategory),e.tier&&t.set(`tier`,e.tier),e.status&&t.set(`status`,e.status),e.offset!==void 0&&t.set(`offset`,String(e.offset)),e.limit!==void 0&&t.set(`limit`,String(e.limit));let n=t.toString();return Z(`/api/library/sources${n?`?${n}`:``}`)},librarySource:e=>Z(`/api/library/sources/${encodeURIComponent(e)}`),libraryLocal:()=>Z(`/api/library/local`),libraryLocalAdd:e=>Z(`/api/library/local`,{method:`POST`,body:JSON.stringify(e)}),libraryLocalDelete:e=>Z(`/api/library/local/${encodeURIComponent(e)}`,{method:`DELETE`}),listDevices:()=>Z(`/api/devices`),createDevice:e=>Z(`/api/devices`,{method:`POST`,body:JSON.stringify({label:e})}),deleteDevice:e=>Z(`/api/devices/${encodeURIComponent(e)}`,{method:`DELETE`}),startPairCode:e=>Z(`/api/devices/pair-code`,{method:`POST`,body:JSON.stringify({label:e})}),cancelPairCode:()=>Z(`/api/devices/pair-code`,{method:`DELETE`}),pairCodeStatus:()=>Z(`/api/devices/pair-code`)};export{G as a,h as c,H as i,ae as n,R as o,ie as r,B as s,X as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/eN4Uq1pt.js b/app/smartbrain_3000/web/_app/immutable/chunks/CwN7cGO4.js similarity index 65% rename from app/smartbrain_3000/web/_app/immutable/chunks/eN4Uq1pt.js rename to app/smartbrain_3000/web/_app/immutable/chunks/CwN7cGO4.js index 1fd881e1..779ab5ce 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/eN4Uq1pt.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/CwN7cGO4.js @@ -1 +1 @@ -import{$ as e}from"./BJLLtWYH.js";import{n as t}from"./CoHYJ8BJ.js";var n=e({count:0});async function r(){try{n.count=(await t.unseenScheduleUpdates()).count}catch{}}export{n,r as t}; \ No newline at end of file +import{$ as e}from"./BChu7Pos.js";import{n as t}from"./BkiVJrb-.js";var n=e({count:0});async function r(){try{n.count=(await t.unseenScheduleUpdates()).count}catch{}}export{n,r as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/Czex3Sq4.js b/app/smartbrain_3000/web/_app/immutable/chunks/Czex3Sq4.js new file mode 100644 index 00000000..0ef1e845 --- /dev/null +++ b/app/smartbrain_3000/web/_app/immutable/chunks/Czex3Sq4.js @@ -0,0 +1 @@ +import{H as e,U as t,V as n,et as r,o as i,r as a,t as o,tt as s}from"./BChu7Pos.js";var c=class{constructor(e,t){this.status=e,this.body=typeof t==`string`?{message:t}:t||{message:`Error: ${e}`}}toString(){return JSON.stringify(this.body)}},l=class{constructor(e,t){try{new Headers({location:t})}catch{throw Error(`Invalid redirect location ${JSON.stringify(t)}: this string contains characters that cannot be used in HTTP headers`)}this.status=e,this.location=t}},u=class extends Error{constructor(e,t,n){super(n),this.status=e,this.text=t}};new URL(`sveltekit-internal://`);function d(e,t){return e===`/`||t===`ignore`?e:t===`never`?e.endsWith(`/`)?e.slice(0,-1):e:t===`always`&&!e.endsWith(`/`)?e+`/`:e}function f(e){return e.split(`%25`).map(decodeURI).join(`%25`)}function p(e){for(let t in e)e[t]=decodeURIComponent(e[t]);return e}function m({href:e}){return e.split(`#`)[0]}function h(){}function g(...e){let t=5381;for(let n of e)if(typeof n==`string`){let e=n.length;for(;e;)t=t*33^n.charCodeAt(--e)}else if(ArrayBuffer.isView(n)){let e=new Uint8Array(n.buffer,n.byteOffset,n.byteLength),r=e.length;for(;r;)t=t*33^e[--r]}else throw TypeError(`value must be a string or TypedArray`);return(t>>>0).toString(36)}new TextEncoder;function _(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e((e instanceof Request?e.method:t?.method||`GET`)!==`GET`&&y.delete(x(e)),v(e,t));var y=new Map;function ee(e,t){let n=x(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:e,...t}=JSON.parse(r.textContent);r.getAttribute(`data-b64`)!==null&&(e=_(e));let i=r.getAttribute(`data-ttl`);return i&&y.set(n,{body:e,init:t,ttl:1e3*Number(i)}),Promise.resolve(new Response(e,t))}return window.fetch(e,t)}function b(e,t,n){if(y.size>0){let t=x(e,n),r=y.get(t);if(r){if(performance.now(){let n=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(e);if(n)return t.push({name:n[1],matcher:n[2],optional:!1,rest:!0,chained:!0}),`(?:/([^]*))?`;let r=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(e);if(r)return t.push({name:r[1],matcher:r[2],optional:!0,rest:!1,chained:!0}),`(?:/([^/]+))?`;if(!e)return;let i=e.split(/\[(.+?)\](?!\])/);return`/`+i.map((e,n)=>{if(n%2){if(e.startsWith(`x+`))return se(String.fromCharCode(parseInt(e.slice(2),16)));if(e.startsWith(`u+`))return se(String.fromCharCode(...e.slice(2).split(`-`).map(e=>parseInt(e,16))));let[,r,a,o,s]=te.exec(e);return t.push({name:o,matcher:s,optional:!!r,rest:!!a,chained:a?n===1&&i[0]===``:!1}),a?`([^]*?)`:r?`([^/]*)?`:`([^/]+?)`}return se(e)}).join(``)}).join(``)}/?$`),params:t}}function ie(e){return e!==``&&!/^\([^)]+\)$/.test(e)}function ae(e){return e.slice(1).split(`/`).filter(ie)}function oe(e,t,n){let r={},i=e.slice(1),a=i.filter(e=>e!==void 0),o=0;for(let e=0;ee).join(`/`),o=0),c===void 0){if(s.rest)c=``;else continue}if(!s.matcher||n[s.matcher](c)){r[s.name]=c;let n=t[e+1],l=i[e+1];n&&!n.rest&&n.optional&&l&&s.chained&&(o=0),!n&&!l&&Object.keys(r).length===a.length&&(o=0)}else if(s.optional&&s.chained)o++;else return}if(!o)return r}function se(e){return e.normalize().replace(/[[\]]/g,`\\$&`).replace(/%/g,`%25`).replace(/\//g,`%2[Ff]`).replace(/\?/g,`%3[Ff]`).replace(/#/g,`%23`).replace(/[.*+?^${}()|\\]/g,`\\$&`)}function ce({nodes:e,server_loads:t,dictionary:n,matchers:r}){let i=new Set(t);return Object.entries(n).map(([t,[n,i,s]])=>{let{pattern:c,params:l}=re(t),u={id:t,exec:e=>{let t=c.exec(e);if(t)return oe(t,l,r)},errors:[1,...s||[]].map(t=>e[t]),layouts:[0,...i||[]].map(o),leaf:a(n)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function a(t){let n=t<0;return n&&(t=~t),[n,e[t]]}function o(t){return t===void 0?t:[i.has(t),e[t]]}}function le(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function ue(e,t,n=JSON.stringify){let r=n(t);try{sessionStorage[e]=r}catch{}}var S=globalThis.__sveltekit_1gwbtbf?.base??``,de=globalThis.__sveltekit_1gwbtbf?.assets??S??``,fe=`5f0d6708b54c1b7d`,pe=`sveltekit:snapshot`,me=`sveltekit:scroll`,he=`sveltekit:states`,C=`sveltekit:history`,w=`sveltekit:navigation`,T={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ge=location.origin;function _e(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){let e=document.getElementsByTagName(`base`);t=e.length?e[0].href:document.URL}return new URL(e,t)}function E(){return{x:pageXOffset,y:pageYOffset}}function D(e,t){return e.getAttribute(`data-sveltekit-${t}`)}var ve={...T,"":T.hover};function ye(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function be(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()===`A`&&e.hasAttribute(`href`))return e;e=ye(e)}}function xe(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){let e=location.hash.split(`#`)[1]||`/`;r.hash=`#${e}${r.hash}`}}catch{}let i=e instanceof SVGAElement?e.target.baseVal:e.target,a=!r||!!i||k(r,t,n)||(e.getAttribute(`rel`)||``).split(/\s+/).includes(`external`),o=r?.origin===ge&&e.hasAttribute(`download`);return{url:r,external:a,target:i,download:o}}function O(e){let t=null,n=null,r=null,i=null,a=null,o=null,s=e;for(;s&&s!==document.documentElement;)r===null&&(r=D(s,`preload-code`)),i===null&&(i=D(s,`preload-data`)),t===null&&(t=D(s,`keepfocus`)),n===null&&(n=D(s,`noscroll`)),a===null&&(a=D(s,`reload`)),o===null&&(o=D(s,`replacestate`)),s=ye(s);function c(e){switch(e){case``:case`true`:return!0;case`off`:case`false`:return!1;default:return}}return{preload_code:ve[r??`off`],preload_data:ve[i??`off`],keepfocus:c(t),noscroll:c(n),reload:c(a),replace_state:c(o)}}function Se(e){let t=i(e),n=!0;function r(){n=!0,t.update(e=>e)}function a(e){n=!1,t.set(e)}function o(e){let r;return t.subscribe(t=>{(r===void 0||n&&t!==r)&&e(r=t)})}return{notify:r,set:a,subscribe:o}}var Ce={v:h};function we(){let{set:e,subscribe:t}=i(!1),n;async function r(){clearTimeout(n);try{let t=await fetch(`${de}/_app/version.json`,{headers:{pragma:`no-cache`,"cache-control":`no-cache`}});if(!t.ok)return!1;let r=(await t.json()).version!==fe;return r&&(e(!0),Ce.v(),clearTimeout(n)),r}catch{return!1}}return{subscribe:t,check:r}}function k(e,t,n){return e.origin!==ge||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function Te(e){}var Ee=new Set([`load`,`prerender`,`csr`,`ssr`,`trailingSlash`,`config`]);[...Ee],[...new Set([...Ee])];function De(e){return e.filter(e=>e!=null)}function A(e,t){return e+`/`+t}function Oe(e){return e instanceof c||e instanceof u?e.status:500}function ke(e){return e instanceof u?e.text:`Internal Error`}var j,M,Ae,je=a.toString().includes(`$$`)||/function \w+\(\) \{\}/.test(a.toString()),Me=`a:`;je?(j={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Me)},M={current:null},Ae={current:!1}):(j=new class{#e=s({});get data(){return n(this.#e)}set data(e){r(this.#e,e)}#t=s(null);get form(){return n(this.#t)}set form(e){r(this.#t,e)}#n=s(null);get error(){return n(this.#n)}set error(e){r(this.#n,e)}#r=s({});get params(){return n(this.#r)}set params(e){r(this.#r,e)}#i=s({id:null});get route(){return n(this.#i)}set route(e){r(this.#i,e)}#a=s({});get state(){return n(this.#a)}set state(e){r(this.#a,e)}#o=s(-1);get status(){return n(this.#o)}set status(e){r(this.#o,e)}#s=s(new URL(Me));get url(){return n(this.#s)}set url(e){r(this.#s,e)}},M=new class{#e=s(null);get current(){return n(this.#e)}set current(e){r(this.#e,e)}},Ae=new class{#e=s(!1);get current(){return n(this.#e)}set current(e){r(this.#e,e)}},Ce.v=()=>Ae.current=!0);function Ne(e){Object.assign(j,e)}var{onMount:Pe,tick:Fe}=o,Ie=new Set([`icon`,`shortcut icon`,`apple-touch-icon`]),N=null,P=le(`sveltekit:scroll`)??{},F=le(`sveltekit:snapshot`)??{},I={url:Se({}),page:Se({}),navigating:i(null),updated:we()};function Le(e){P[e]=E()}function Re(e,t){let n=e+1;for(;P[n];)delete P[n],n+=1;for(n=t+1;F[n];)delete F[n],n+=1}function L(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(h)}async function ze(){if(`serviceWorker`in navigator){let e=await navigator.serviceWorker.getRegistration(S||`/`);e&&await e.update()}}var Be,Ve,R,z,He,B,Ue={},We={},V=[],H=[],U=null;function Ge(){U?.fork?.then(e=>e?.discard()),U=null,Q={element:void 0,href:void 0}}var Ke=new Map,qe=new Set,Je=new Set,W=new Set,G={branch:[],error:null,url:null,nav:null},Ye=!1,Xe=!1,Ze=!0,K=!1,q=!1,Qe=!1,$e=!1,et,J,Y,X,tt=new Set,nt=new Map,rt=new Map;async function it(e,t,n){if(globalThis.__sveltekit_1gwbtbf.data){let{q:e={},p:t={},l:n={},f:r={}}=globalThis.__sveltekit_1gwbtbf.data;for(let t in e)Ue[t]=e[t];for(let e in n)Ue[e]=n[e];for(let e in r)Ue[e]=r[e];for(let e in t)We[e]=t[e]}document.URL!==location.href&&(location.href=location.href),B=e,await e.hooks.init?.(),Be=ce(e),z=document.documentElement,He=t,Ve=e.nodes[0],R=e.nodes[1],Ve(),R(),J=history.state?.[C],Y=history.state?.[w],J||(J=Y=Date.now(),history.replaceState({...history.state,[C]:J,[w]:Y},``));let r=P[J];function i(){r&&(history.scrollRestoration=`manual`,scrollTo(r.x,r.y))}n?(i(),await Nt(He,n)):(await Z({type:`enter`,url:_e(B.hash?zt(new URL(location.href)):location.href),replace_state:!0}),i()),Mt()}function at(){V.length=0,$e=!1}function ot(e){H.some(e=>e?.snapshot)&&(F[e]=H.map(e=>e?.snapshot?.capture()))}function st(e){F[e]?.forEach((e,t)=>{H[t]?.snapshot?.restore(e)})}function ct(){Le(J),ue(me,P),ot(Y),ue(pe,F)}async function lt(e,n,r,i){let a,o;n.invalidateAll&&Ge(),await Z({type:`goto`,url:_e(e),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:r,nav_token:i,accept:()=>{if(n.invalidateAll){$e=!0,a=new Set;for(let[e,t]of nt)for(let[n,r]of t)r.resource?.reset(),a.add(A(e,n));o=new Set;for(let[e,t]of rt)for(let n of t.keys())o.add(A(e,n))}n.invalidate&&n.invalidate.forEach(jt)}}),n.invalidateAll&&t().then(t).then(()=>{for(let[e,t]of nt)for(let[n,{resource:r}]of t)a?.has(A(e,n))&&r.start();for(let[e,t]of rt)for(let[n,{resource:r}]of t)o?.has(A(e,n))&&r.reconnect()})}async function ut(e){if(e.id!==U?.id){Ge();let t={};tt.add(t),U={id:e.id,token:t,promise:bt({...e,preload:t}).then(e=>(tt.delete(t),e.type===`loaded`&&e.state.error&&Ge(),e)),fork:null}}return U.promise}async function dt(e){let t=(await wt(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(e=>e[1]()))}async function ft(e,t,n){let r={params:G.params,route:{id:G.route?.id??null},url:new URL(location.href)};if(G={...e.state,nav:r},Ne(e.props.page),et=new B.root({target:t,props:{...e.props,stores:I,components:H},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),n){let e={from:null,to:{...r,scroll:P[J]??E()},willUnload:!1,type:`enter`,complete:Promise.resolve()};W.forEach(t=>t(e))}st(Y),Xe=!0}async function pt({url:e,params:t,branch:n,errors:r,status:i,error:a,route:o,form:s}){let c=`never`;if(S&&(e.pathname===S||e.pathname===S+`/`))c=`always`;else for(let e of n)e?.slash!==void 0&&(c=e.slash);e.pathname=d(e.pathname,c),e.search=e.search;let l={type:`loaded`,state:{url:e,params:t,branch:n,error:a,route:o},props:{constructors:De(n).map(e=>e.node.component),page:Rt(j)}};s!==void 0&&(l.props.form=s);let u={},f=!j,p=0;for(let e=0;et(new URL(e))))return!0;return!1}function _t(e,t){return e?.type===`data`?e:e?.type===`skip`?t??null:null}function vt(e,t){if(!e)return new Set(t.searchParams.keys());let n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(let r of n){let i=e.searchParams.getAll(r),a=t.searchParams.getAll(r);i.every(e=>a.includes(e))&&a.every(e=>i.includes(e))&&n.delete(r)}return n}function yt({error:e,url:t,route:n,params:r}){return{type:`loaded`,state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Rt(j),constructors:[]}}}async function bt({id:e,invalidating:t,url:n,params:r,route:i,preload:a}){if(U?.id===e)return tt.delete(U.token),U.promise;let{errors:o,layouts:s,leaf:u}=i,d=[...s,u];o.forEach(e=>e?.().catch(h)),d.forEach(e=>e?.[1]().catch(h));let f=G.url?e!==Et(G.url):!1,p=G.route?i.id!==G.route.id:!1,m=vt(G.url,n),g=!1,_=d.map(async(e,t)=>{if(!e)return;let a=G.branch[t];return e[1]===a?.loader&&!gt(g,p,f,m,a.universal?.uses,r)?a:(g=!0,mt({loader:e[1],url:n,params:r,route:i,parent:async()=>{let e={};for(let n=0;nPromise.resolve({}),server_data_node:_t(null)}),{node:await R(),loader:R,universal:null,server:null,data:null}],status:e,error:t,errors:[],route:null})}catch(t){if(t instanceof l){await lt(new URL(t.location,location.href),{},0);return}let a=await B.get_error_template(),o=await $(t,{url:n,params:i,route:r}),s=a({status:e,message:String(o?.message??``).replace(/&/g,`&`).replace(//g,`>`)}),c=new DOMParser().parseFromString(s,`text/html`);throw document.documentElement.replaceChild(document.adoptNode(c.head),document.head),document.documentElement.replaceChild(document.adoptNode(c.body),document.body),t}}async function Ct(e){let t=e.href;if(Ke.has(t))return Ke.get(t);let n;try{let r=(async()=>{let t=await B.hooks.reroute({url:new URL(e),fetch:async(t,n)=>ht(t,n,e).promise})??e;if(typeof t==`string`){let n=new URL(e);B.hash?n.hash=t:n.pathname=t,t=n}return t})();Ke.set(t,r),n=await r}catch{Ke.delete(t);return}return n}async function wt(e,t){if(e&&!k(e,S,B.hash)){let n=await Ct(e);if(!n)return;let r=Tt(n);for(let n of Be){let i=n.exec(r);if(i)return{id:Et(e),invalidating:t,route:n,params:p(i),url:e}}}}function Tt(e){return f(B.hash?e.hash.replace(/^#/,``).replace(/[?#].+/,``):e.pathname.slice(S.length))||`/`}function Et(e){return(B.hash?e.hash.replace(/^#/,``):e.pathname)+e.search}function Dt({url:e,type:t,intent:n,delta:r,event:i,scroll:a}){let o=!1,s=Lt(G,n,e,t,a??null);r!==void 0&&(s.navigation.delta=r),i!==void 0&&(s.navigation.event=i);let c={...s.navigation,cancel:()=>{o=!0,s.reject(Error(`navigation cancelled`))}};return K||qe.forEach(e=>e(c)),o?null:s}async function Z({type:n,url:r,popped:i,keepfocus:a,noscroll:o,replace_state:s,state:c={},redirect_count:l=0,nav_token:d={},accept:f=h,block:p=h,event:m}){let g=X;X=d;let _=await wt(r,!1),v=n===`enter`?Lt(G,_,r,n):Dt({url:r,type:n,delta:i?.delta,intent:_,scroll:i?.scroll,event:m});if(!v){p(),X===d&&(X=g);return}let y=J,ee=Y;f(),K=!0,Xe&&v.navigation.type!==`enter`&&I.navigating.set(M.current=v.navigation);let b=_&&await bt(_);if(!b){if(k(r,S,B.hash))return await L(r,s);b=await Ot(r,{id:null},await $(new u(404,`Not Found`,`Not found: ${r.pathname}`),{url:r,params:{},route:{id:null}}),404,s)}if(r=_?.url||r,X!==d){v.reject(Error(`navigation aborted`));return}if(!b)return;if(b.type===`redirect`){if(l<20){await Z({type:n,url:new URL(b.location,r),popped:i,keepfocus:a,noscroll:o,replace_state:s,state:c,redirect_count:l+1,nav_token:d}),v.fulfil(void 0);return}if(b=await St({status:500,error:await $(Error(`Redirect loop`),{url:r,params:{},route:{id:null}}),url:r,route:{id:null}}),!b)return}else if(b.props.page.status>=400&&await I.updated.check())return await ze(),await L(r,s);if(at(),Le(y),ot(ee),b.props.page.url.pathname!==r.pathname&&(r.pathname=b.props.page.url.pathname),c=i?i.state:c,!i){let e=+!s,t={[C]:J+=e,[w]:Y+=e,[he]:c};(s?history.replaceState:history.pushState).call(history,t,``,r),s||Re(J,Y)}let x=_&&U?.id===_.id?U.fork:null;U?.fork&&!x?Ge():(U=null,Q={element:void 0,href:void 0}),b.props.page.state=c;let te;if(Xe){let t=(await Promise.all(Array.from(Je,e=>e(v.navigation)))).filter(e=>typeof e==`function`);if(t.length>0){function e(){t.forEach(e=>{W.delete(e)})}t.push(e),t.forEach(e=>{W.add(e)})}let n=v.navigation.to;G={...b.state,nav:{params:n.params,route:n.route,url:n.url}},b.props.page&&(b.props.page.url=r),!a&&document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur();let i=x&&await x;i?te=i.commit():(N=null,et.$set(b.props),N&&Object.assign(b.props.page,N),Ne(b.props.page),te=e?.()),Qe=!0}else await ft(b,He,!1);let{activeElement:ne}=document;if(await te,await t(),await t(),X!==d){v.reject(Error(`navigation aborted`));return}b.props.page&&N&&Object.assign(b.props.page,N);let re=null;if(Ze){let e=i?i.scroll:o?E():null;e?scrollTo(e.x,e.y):(re=r.hash&&document.getElementById(Bt(r)))?re.scrollIntoView():scrollTo(0,0)}let ie=document.activeElement!==ne&&document.activeElement!==document.body;!a&&!ie&&It(r,!re),Ze=!0,K=!1,v.fulfil(void 0),v.navigation.to&&(v.navigation.to.scroll=E()),W.forEach(e=>e(v.navigation)),n===`popstate`&&st(Y),I.navigating.set(M.current=null)}async function Ot(e,t,n,r,i){return e.origin===ge&&e.pathname===location.pathname&&!Ye?await St({status:r,error:n,url:e,route:t}):await L(e,i)}var Q={element:void 0,href:void 0};function kt(){let e,t;z.addEventListener(`mousemove`,t=>{let n=t.target;clearTimeout(e),e=setTimeout(()=>{i(n,T.hover)},20)});function n(e){e.defaultPrevented||i(e.composedPath()[0],T.tap)}z.addEventListener(`mousedown`,n),z.addEventListener(`touchstart`,n,{passive:!0});let r=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&(dt(new URL(t.target.href)),r.unobserve(t.target))},{threshold:0});async function i(e,n){let r=be(e,z),i=r===Q.element&&r?.href===Q.href&&n>=t;if(!r||i)return;let{url:a,external:o,download:s}=xe(r,S,B.hash);if(o||s)return;let c=O(r),l=a&&Et(G.url)===Et(a);if(!(c.reload||l)){if(n<=c.preload_data){Q={element:r,href:r.href},t=T.tap;let e=await wt(a,!1);if(!e)return;ut(e)}else n<=c.preload_code&&(Q={element:r,href:r.href},t=n,dt(a))}}function a(){r.disconnect();for(let e of z.querySelectorAll(`a`)){let{url:t,external:n,download:i}=xe(e,S,B.hash);if(n||i)continue;let a=O(e);a.reload||(a.preload_code===T.viewport&&r.observe(e),a.preload_code===T.eager&&dt(t))}}W.add(a),a()}function $(e,t){if(e instanceof c)return e.body;let n=Oe(e),r=ke(e);return B.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function At(e,t={}){return e=new URL(_e(e)),e.origin===ge?lt(e,t,0):Promise.reject(Error(`goto: invalid URL`))}function jt(e){if(typeof e==`function`)V.push(e);else{let{href:t}=new URL(e,location.href);V.push(e=>e.href===t)}}function Mt(){history.scrollRestoration=`manual`,addEventListener(`beforeunload`,e=>{let t=!1;if(ct(),!K){let e=Lt(G,void 0,null,`leave`),n={...e.navigation,cancel:()=>{t=!0,e.reject(Error(`navigation cancelled`))}};qe.forEach(e=>e(n))}t?(e.preventDefault(),e.returnValue=``):history.scrollRestoration=`auto`}),addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&ct()}),navigator.connection?.saveData||kt(),z.addEventListener(`click`,async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;let n=be(t.composedPath()[0],z);if(!n)return;let{url:r,external:i,target:a,download:o}=xe(n,S,B.hash);if(!r)return;if(a===`_parent`||a===`_top`){if(window.parent!==window)return}else if(a&&a!==`_self`)return;let s=O(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&r.protocol!==`https:`&&r.protocol!==`http:`||o)return;let[c,l]=(B.hash?r.hash.replace(/^#/,``):r.href).split(`#`),u=c===m(location);if(i||s.reload&&(!u||!l))Dt({url:r,type:`link`,event:t})?K=!0:t.preventDefault();else{if(l!==void 0&&u){let[,i]=G.url.href.split(`#`);if(i===l){if(t.preventDefault(),l===``||l===`top`&&n.ownerDocument.getElementById(`top`)===null)scrollTo({top:0});else{let e=n.ownerDocument.getElementById(decodeURIComponent(l));e&&(e.scrollIntoView(),e.focus())}return}if(q=!0,Le(J),e(r),!s.replace_state)return;q=!1}t.preventDefault(),await new Promise(e=>{requestAnimationFrame(()=>{setTimeout(e,0)}),setTimeout(e,100)}),await Z({type:`link`,url:r,keepfocus:s.keepfocus,noscroll:s.noscroll,replace_state:s.replace_state??r.href===location.href,event:t})}}),z.addEventListener(`submit`,e=>{if(e.defaultPrevented)return;let t=HTMLFormElement.prototype.cloneNode.call(e.target),n=e.submitter;if((n?.formTarget||t.target)===`_blank`||(n?.formMethod||t.method)!==`get`)return;let r=new URL(n?.hasAttribute(`formaction`)&&n?.formAction||t.action);if(k(r,S,!1))return;let i=e.target,a=O(i);if(a.reload)return;e.preventDefault(),e.stopPropagation();let o=new FormData(i,n);r.search=new URLSearchParams(o).toString(),Z({type:`form`,url:r,keepfocus:a.keepfocus,noscroll:a.noscroll,replace_state:a.replace_state??r.href===location.href,event:e})}),addEventListener(`popstate`,async t=>{if(!Ft){if(t.state?.[`sveltekit:history`]){let n=t.state[C];if(X={},n===J)return;let r=P[n],i=t.state[`sveltekit:states`]??{},a=new URL(t.state[`sveltekit:pageurl`]??location.href),o=t.state[w],s=G.url?m(location)===m(G.url):!1;if(o===Y&&(Qe||s)){i!==j.state&&(j.state=i),e(a),P[J]=E(),r&&scrollTo(r.x,r.y),J=n;return}let c=n-J;await Z({type:`popstate`,url:a,popped:{state:i,scroll:r,delta:c},accept:()=>{J=n,Y=o},block:()=>{history.go(-c)},nav_token:X,event:t})}else q||(e(new URL(location.href)),B.hash&&location.reload())}}),addEventListener(`hashchange`,()=>{q&&(q=!1,history.replaceState({...history.state,[C]:++J,[w]:Y},``,location.href))});for(let e of document.querySelectorAll(`link`))Ie.has(e.rel)&&(e.href=e.href);addEventListener(`pageshow`,e=>{e.persisted&&I.navigating.set(M.current=null)});function e(e){G.url=j.url=e,I.page.set(Rt(j)),I.page.notify()}}async function Nt(e,{status:t=200,error:n,node_ids:r,params:i,route:a,server_route:o,data:s,form:c}){Ye=!0;let u=new URL(location.href),d;({params:i={},route:a={id:null}}=await wt(u,!1)||{}),d=Be.find(({id:e})=>e===a.id);let f,p=!0;try{let e=r.map(async(t,n)=>{let r=s[n];return r?.uses&&(r.uses=Pt(r.uses)),mt({loader:B.nodes[t],url:u,params:i,route:a,parent:async()=>{let t={};for(let r=0;r{let a=history.state;Ft=!0,location.replace(new URL(`#${n}`,location.href)),history.replaceState(a,``,e),t&&scrollTo(r,i),Ft=!1})}else{let e=document.body,t=e.getAttribute(`tabindex`);e.tabIndex=-1,e.focus({preventScroll:!0,focusVisible:!1}),t===null?e.removeAttribute(`tabindex`):e.setAttribute(`tabindex`,t)}let r=getSelection();if(r&&r.type!==`None`){let e=[];for(let t=0;t{if(r.rangeCount===e.length){for(let t=0;t{a=e,o=t});return s.catch(h),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:E()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:i},willUnload:!t,type:r,complete:s},fulfil:a,reject:o}}function Rt(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function zt(e){let t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function Bt(e){let t;if(B.hash){let[,,n]=e.hash.split(`#`,3);t=n??``}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Te as a,j as i,it as n,M as r,At as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/DETRq8nR.js b/app/smartbrain_3000/web/_app/immutable/chunks/DETRq8nR.js new file mode 100644 index 00000000..155460f4 --- /dev/null +++ b/app/smartbrain_3000/web/_app/immutable/chunks/DETRq8nR.js @@ -0,0 +1 @@ +import"./Czex3Sq4.js"; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/BqUz5g-m.js b/app/smartbrain_3000/web/_app/immutable/chunks/DQSrham4.js similarity index 94% rename from app/smartbrain_3000/web/_app/immutable/chunks/BqUz5g-m.js rename to app/smartbrain_3000/web/_app/immutable/chunks/DQSrham4.js index 9f0e76f5..163747b4 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/BqUz5g-m.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/DQSrham4.js @@ -1 +1 @@ -import{A as e,C as t,E as n,G as r,K as i,M as a,N as o,P as s,R as c,V as l,X as u,Y as d,a as f,ct as p,et as m,ft as h,g,l as _,pt as v,st as y,tt as b,z as x}from"./BJLLtWYH.js";import"./xihTtKlq.js";var S=s(``);function C(s,c){p(c,!0);let C=f(c,`open`,3,!1),w=f(c,`label`,3,``),T=f(c,`alert`,3,!1),E=f(c,`size`,3,`sm`),D=f(c,`onclose`,3,()=>{}),O=f(c,`onkeydown`,3,()=>{}),k=b(null);i(()=>{if(!C())return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null;return l(k)?.focus(),()=>e?.focus()});function A(e){e.key===`Escape`?D()():O()(e)}var j=o(),M=u(j),N=e=>{var i=S(),o=d(i),s=d(o);n(s,()=>c.children??v),h(o),_(o,e=>m(k,e),()=>l(k)),h(i),r(()=>{t(o,1,`modal size-${E()??``}`,`svelte-ta60gp`),g(o,`role`,T()?`alertdialog`:`dialog`),g(o,`aria-label`,w())}),x(`click`,i,function(...e){D()?.apply(this,e)}),x(`keydown`,o,A),x(`click`,o,e=>e.stopPropagation()),a(e,i)};e(M,e=>{C()&&e(N)}),a(s,j),y()}c([`click`,`keydown`]);export{C as t}; \ No newline at end of file +import{A as e,C as t,E as n,G as r,K as i,M as a,N as o,P as s,R as c,V as l,X as u,Y as d,a as f,ct as p,et as m,ft as h,g,l as _,pt as v,st as y,tt as b,z as x}from"./BChu7Pos.js";import"./xihTtKlq.js";var S=s(``);function C(s,c){p(c,!0);let C=f(c,`open`,3,!1),w=f(c,`label`,3,``),T=f(c,`alert`,3,!1),E=f(c,`size`,3,`sm`),D=f(c,`onclose`,3,()=>{}),O=f(c,`onkeydown`,3,()=>{}),k=b(null);i(()=>{if(!C())return;let e=document.activeElement instanceof HTMLElement?document.activeElement:null;return l(k)?.focus(),()=>e?.focus()});function A(e){e.key===`Escape`?D()():O()(e)}var j=o(),M=u(j),N=e=>{var i=S(),o=d(i),s=d(o);n(s,()=>c.children??v),h(o),_(o,e=>m(k,e),()=>l(k)),h(i),r(()=>{t(o,1,`modal size-${E()??``}`,`svelte-ta60gp`),g(o,`role`,T()?`alertdialog`:`dialog`),g(o,`aria-label`,w())}),x(`click`,i,function(...e){D()?.apply(this,e)}),x(`keydown`,o,A),x(`click`,o,e=>e.stopPropagation()),a(e,i)};e(M,e=>{C()&&e(N)}),a(s,j),y()}c([`click`,`keydown`]);export{C as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/DKVRJME0.js b/app/smartbrain_3000/web/_app/immutable/chunks/Di_L0eC6.js similarity index 84% rename from app/smartbrain_3000/web/_app/immutable/chunks/DKVRJME0.js rename to app/smartbrain_3000/web/_app/immutable/chunks/Di_L0eC6.js index 7230b605..c9a63932 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/DKVRJME0.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/Di_L0eC6.js @@ -1 +1 @@ -import{t as e}from"./CoHYJ8BJ.js";function t(t){if(!(t instanceof e))return`Couldn't reach SmartBrain — check your connection and try again.`;let n=t.status;return n===423||t.code===`no_session`?``:n===502||n===503||n===504?`I couldn't reach the model just now — try again in a moment.`:n>=500?`Something went wrong on my end — please try again.`:t.message||`That didn't work — please try again.`}export{t}; \ No newline at end of file +import{t as e}from"./BkiVJrb-.js";function t(t){if(!(t instanceof e))return`Couldn't reach SmartBrain — check your connection and try again.`;let n=t.status;return n===423||t.code===`no_session`?``:n===502||n===503||n===504?`I couldn't reach the model just now — try again in a moment.`:n>=500?`Something went wrong on my end — please try again.`:t.message||`That didn't work — please try again.`}export{t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/y2R953fa.js b/app/smartbrain_3000/web/_app/immutable/chunks/DpD1lG2E.js similarity index 80% rename from app/smartbrain_3000/web/_app/immutable/chunks/y2R953fa.js rename to app/smartbrain_3000/web/_app/immutable/chunks/DpD1lG2E.js index fc6f9bbf..0a876c97 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/y2R953fa.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/DpD1lG2E.js @@ -1 +1 @@ -import{V as e,et as t,tt as n}from"./BJLLtWYH.js";import{a as r,i,n as a,t as o}from"./CoHYJ8BJ.js";var s=new class{#e=n(null);get status(){return e(this.#e)}set status(e){t(this.#e,e,!0)}#t=n(!1);get loading(){return e(this.#t)}set loading(e){t(this.#t,e,!0)}#n=n(``);get error(){return e(this.#n)}set error(e){t(this.#n,e,!0)}#r=null;load(){return this.#r||=this.#i(),this.#r}async#i(){this.loading=!0,this.error=``;try{this.status=await a.accountStatus()}catch(e){this.error=e instanceof o?e.message:`Cannot reach the backend.`}finally{this.loading=!1,this.#r=null}}};i(()=>{s.status&&(s.status.unlocked=!1)}),r(()=>{s.status&&(s.status.session=!1)});export{s as t}; \ No newline at end of file +import{V as e,et as t,tt as n}from"./BChu7Pos.js";import{a as r,i,n as a,t as o}from"./BkiVJrb-.js";var s=new class{#e=n(null);get status(){return e(this.#e)}set status(e){t(this.#e,e,!0)}#t=n(!1);get loading(){return e(this.#t)}set loading(e){t(this.#t,e,!0)}#n=n(``);get error(){return e(this.#n)}set error(e){t(this.#n,e,!0)}#r=null;load(){return this.#r||=this.#i(),this.#r}async#i(){this.loading=!0,this.error=``;try{this.status=await a.accountStatus()}catch(e){this.error=e instanceof o?e.message:`Cannot reach the backend.`}finally{this.loading=!1,this.#r=null}}};i(()=>{s.status&&(s.status.unlocked=!1)}),r(()=>{s.status&&(s.status.session=!1)});export{s as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/kqW19h2g.js b/app/smartbrain_3000/web/_app/immutable/chunks/UDuC8ICI.js similarity index 93% rename from app/smartbrain_3000/web/_app/immutable/chunks/kqW19h2g.js rename to app/smartbrain_3000/web/_app/immutable/chunks/UDuC8ICI.js index 25d6cfdc..c8ce657e 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/kqW19h2g.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/UDuC8ICI.js @@ -1 +1 @@ -import{A as e,C as t,E as n,G as r,M as i,N as a,P as o,Q as s,R as c,X as l,Y as u,a as d,ft as f,g as p,pt as m,z as h}from"./BJLLtWYH.js";import"./xihTtKlq.js";import{t as g}from"./CEPrmzat.js";var _=o(``),v=o(` `);function y(o,c){let y=d(c,`icon`,3,``),b=d(c,`kind`,3,``),x=d(c,`mono`,3,!1),S=d(c,`onclick`,3,void 0),C=d(c,`title`,3,``);var w=a(),T=l(w),E=a=>{var o=_();let l;var d=u(o),v=e=>{g(e,{get name(){return y()},size:13})};e(d,e=>{y()&&e(v)});var w=s(d,2);n(w,()=>c.children??m),f(o),r(()=>{l=t(o,1,`chip ${b()??``}`,`svelte-ogjsci`,l,{mono:x(),clicky:!0}),p(o,`title`,C())}),h(`click`,o,function(...e){S()?.apply(this,e)}),i(a,o)},D=a=>{var o=v();let l;var d=u(o),h=e=>{g(e,{get name(){return y()},size:13})};e(d,e=>{y()&&e(h)});var _=s(d,2);n(_,()=>c.children??m),f(o),r(()=>{l=t(o,1,`chip ${b()??``}`,`svelte-ogjsci`,l,{mono:x()}),p(o,`title`,C())}),i(a,o)};e(T,e=>{S()?e(E):e(D,-1)}),i(o,w)}c([`click`]);export{y as t}; \ No newline at end of file +import{A as e,C as t,E as n,G as r,M as i,N as a,P as o,Q as s,R as c,X as l,Y as u,a as d,ft as f,g as p,pt as m,z as h}from"./BChu7Pos.js";import"./xihTtKlq.js";import{t as g}from"./Be3BkmPa.js";var _=o(``),v=o(` `);function y(o,c){let y=d(c,`icon`,3,``),b=d(c,`kind`,3,``),x=d(c,`mono`,3,!1),S=d(c,`onclick`,3,void 0),C=d(c,`title`,3,``);var w=a(),T=l(w),E=a=>{var o=_();let l;var d=u(o),v=e=>{g(e,{get name(){return y()},size:13})};e(d,e=>{y()&&e(v)});var w=s(d,2);n(w,()=>c.children??m),f(o),r(()=>{l=t(o,1,`chip ${b()??``}`,`svelte-ogjsci`,l,{mono:x(),clicky:!0}),p(o,`title`,C())}),h(`click`,o,function(...e){S()?.apply(this,e)}),i(a,o)},D=a=>{var o=v();let l;var d=u(o),h=e=>{g(e,{get name(){return y()},size:13})};e(d,e=>{y()&&e(h)});var _=s(d,2);n(_,()=>c.children??m),f(o),r(()=>{l=t(o,1,`chip ${b()??``}`,`svelte-ogjsci`,l,{mono:x()}),p(o,`title`,C())}),i(a,o)};e(T,e=>{S()?e(E):e(D,-1)}),i(o,w)}c([`click`]);export{y as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/CwtHPkdz.js b/app/smartbrain_3000/web/_app/immutable/chunks/aIySO2My.js similarity index 79% rename from app/smartbrain_3000/web/_app/immutable/chunks/CwtHPkdz.js rename to app/smartbrain_3000/web/_app/immutable/chunks/aIySO2My.js index e8780db5..715cfd2e 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/CwtHPkdz.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/aIySO2My.js @@ -1 +1 @@ -import{$ as e}from"./BJLLtWYH.js";var t=e({current:null});function n(e){return new Promise(n=>{t.current={title:e.title??`Please confirm`,body:e.body,confirmLabel:e.confirmLabel??`Confirm`,danger:e.danger??!0,resolve:n}})}function r(e){let n=t.current;t.current=null,n&&n.resolve(e)}export{t as n,r,n as t}; \ No newline at end of file +import{$ as e}from"./BChu7Pos.js";var t=e({current:null});function n(e){return new Promise(n=>{t.current={title:e.title??`Please confirm`,body:e.body,confirmLabel:e.confirmLabel??`Confirm`,danger:e.danger??!0,resolve:n}})}function r(e){let n=t.current;t.current=null,n&&n.resolve(e)}export{t as n,r,n as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/iVEGnMVT.js b/app/smartbrain_3000/web/_app/immutable/chunks/iVEGnMVT.js deleted file mode 100644 index 5c556ea5..00000000 --- a/app/smartbrain_3000/web/_app/immutable/chunks/iVEGnMVT.js +++ /dev/null @@ -1 +0,0 @@ -import{ut as e}from"./BJLLtWYH.js";e(); \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/DV4tMnTy.js b/app/smartbrain_3000/web/_app/immutable/chunks/itGxqfLQ.js similarity index 82% rename from app/smartbrain_3000/web/_app/immutable/chunks/DV4tMnTy.js rename to app/smartbrain_3000/web/_app/immutable/chunks/itGxqfLQ.js index a257495b..8a840e39 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/DV4tMnTy.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/itGxqfLQ.js @@ -1 +1 @@ -import{A as e,E as t,G as n,M as r,P as i,Q as a,Y as o,Z as s,a as c,ft as l,j as u}from"./BJLLtWYH.js";import"./xihTtKlq.js";import{t as d}from"./CEPrmzat.js";var f=i(`

`),p=i(`
`),m=i(`

`);function h(i,h){let g=c(h,`body`,3,``);var _=m(),v=o(_),y=o(v);d(y,{get name(){return h.icon},size:24}),l(v);var b=a(v,2),x=s(b,!0),S=a(b,2),C=e=>{var t=f(),i=s(t,!0);n(()=>u(i,g())),r(e,t)};e(S,e=>{g()&&e(C)});var w=a(S,2),T=e=>{var n=p(),i=o(n);t(i,()=>h.children),l(n),r(e,n)};e(w,e=>{h.children&&e(T)}),l(_),n(()=>u(x,h.title)),r(i,_)}export{h as t}; \ No newline at end of file +import{A as e,E as t,G as n,M as r,P as i,Q as a,Y as o,Z as s,a as c,ft as l,j as u}from"./BChu7Pos.js";import"./xihTtKlq.js";import{t as d}from"./Be3BkmPa.js";var f=i(`

`),p=i(`
`),m=i(`

`);function h(i,h){let g=c(h,`body`,3,``);var _=m(),v=o(_),y=o(v);d(y,{get name(){return h.icon},size:24}),l(v);var b=a(v,2),x=s(b,!0),S=a(b,2),C=e=>{var t=f(),i=s(t,!0);n(()=>u(i,g())),r(e,t)};e(S,e=>{g()&&e(C)});var w=a(S,2),T=e=>{var n=p(),i=o(n);t(i,()=>h.children),l(n),r(e,n)};e(w,e=>{h.children&&e(T)}),l(_),n(()=>u(x,h.title)),r(i,_)}export{h as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/chunks/DNdCTZZL.js b/app/smartbrain_3000/web/_app/immutable/chunks/x-QSRA-u.js similarity index 96% rename from app/smartbrain_3000/web/_app/immutable/chunks/DNdCTZZL.js rename to app/smartbrain_3000/web/_app/immutable/chunks/x-QSRA-u.js index 07fc79e8..4fd95374 100644 --- a/app/smartbrain_3000/web/_app/immutable/chunks/DNdCTZZL.js +++ b/app/smartbrain_3000/web/_app/immutable/chunks/x-QSRA-u.js @@ -1,2 +1,2 @@ -import{A as e,C as t,E as n,G as r,M as i,N as a,P as o,Q as s,V as c,X as l,Y as u,Z as d,a as f,dt as p,ft as m,it as h,j as g,pt as _}from"./BJLLtWYH.js";import"./xihTtKlq.js";import{t as v}from"./CEPrmzat.js";var y=o(``),b=o(`
 
`),x=o(` Irreversible`),S=o(` Reversible`),C=o(`
`);function w(o,w){let T=f(w,`icon`,3,`pencil`),E=f(w,`tier`,3,`reviewed`),D=f(w,`promoted`,3,``),O=f(w,`scope`,3,``),k=f(w,`badge`,3,!0);var A=C();let j;var M=u(A),N=u(M);{let e=h(()=>E()===`irreversible`?`warn`:T());v(N,{get name(){return c(e)},size:16})}var P=s(N);m(M);var F=s(M,2),I=e=>{var t=y(),n=d(t,!0);r(()=>g(n,D())),i(e,t)};e(F,e=>{D()&&e(I)});var L=s(F,2),R=e=>{var t=b(),n=d(t,!0);r(()=>g(n,O())),i(e,t)};e(L,e=>{O()&&e(R)});var z=s(L,2),B=u(z),V=t=>{var n=a(),r=l(n),o=e=>{var t=x(),n=u(t);v(n,{name:`warn`,size:12}),p(),m(t),i(e,t)},s=e=>{var t=S(),n=u(t);v(n,{name:`refresh`,size:12}),p(),m(t),i(e,t)};e(r,e=>{E()===`irreversible`?e(o):e(s,-1)}),i(t,n)};e(B,e=>{k()&&e(V)});var H=s(B,4);n(H,()=>w.actions??_),m(z),m(A),r(()=>{j=t(A,1,`actioncard svelte-1v1vnro`,null,j,{irreversible:E()===`irreversible`}),g(P,` ${w.title??``}`)}),i(o,A)}function T(e){let t=e.toLowerCase();return t.includes(`ni_item`)?`monitor`:t.includes(`mail`)||t.includes(`email`)?`mail`:t.includes(`task`)?`tasks`:t.includes(`schedule`)?`clock`:t.includes(`kb`)||t.includes(`knowledge`)||t.includes(`note`)||t.includes(`doc`)?`book`:t.includes(`web`)||t.includes(`fetch`)||t.includes(`search`)?`search`:t.includes(`vault`)?`vault`:`pencil`}function E(e,t,n,r){console.assert(typeof e==`string`,`promotedLine: tool is string`),console.assert(t!==void 0,`promotedLine: args defined`);let i=e.toLowerCase();if(i===`remap_ni_item`)return`Re-maps this card against its already-approved source`;if(i===`start_ni_flow`||i===`resume_ni_flow`){let e=D(t);return e?`Fetches: ${e}`:`Builds a card from a source you pick — no fetch until you pick one`}if(i!==`create_ni_item`&&i!==`update_ni_item`)return null;let a=t;if(typeof t==`string`){if(!t.trim())return null;try{a=JSON.parse(t)}catch{return null}}if(!a||typeof a!=`object`||Array.isArray(a))return null;let o=a.source;if(!o||typeof o!=`object`||Array.isArray(o))return null;let s=o,c=s.url;if(typeof c==`string`&&c.length>0)return`Fetches: ${c}`;if(s.type===`internal.ni`)return`Combines: ${r&&r.length>0?r.join(`, `):`other cards`}`;let l=s.server_id,u=s.tool;return typeof l==`string`&&l.length>0&&typeof u==`string`&&u.length>0?`MCP: ${n??`your configured server`} → ${u}`:null}function D(e){console.assert(e!==void 0,`readSourceUrl: args defined`),console.assert(typeof e!=`function`,`readSourceUrl: args not a function`);let t=e;if(typeof e==`string`){if(!e.trim())return``;try{t=JSON.parse(e)}catch{return``}}if(!t||typeof t!=`object`||Array.isArray(t))return``;let n=t.source_url;return typeof n==`string`&&n.length>0?n:``}function O(e){let t=e;if(typeof e==`string`){if(!e.trim())return``;try{t=JSON.parse(e)}catch{return e}}return t&&typeof t==`object`&&!Array.isArray(t)?Object.entries(t).map(([e,t])=>`${e}: ${typeof t==`string`?t:JSON.stringify(t)}`).join(` +import{A as e,C as t,E as n,G as r,M as i,N as a,P as o,Q as s,V as c,X as l,Y as u,Z as d,a as f,dt as p,ft as m,it as h,j as g,pt as _}from"./BChu7Pos.js";import"./xihTtKlq.js";import{t as v}from"./Be3BkmPa.js";var y=o(``),b=o(`
 
`),x=o(` Irreversible`),S=o(` Reversible`),C=o(`
`);function w(o,w){let T=f(w,`icon`,3,`pencil`),E=f(w,`tier`,3,`reviewed`),D=f(w,`promoted`,3,``),O=f(w,`scope`,3,``),k=f(w,`badge`,3,!0);var A=C();let j;var M=u(A),N=u(M);{let e=h(()=>E()===`irreversible`?`warn`:T());v(N,{get name(){return c(e)},size:16})}var P=s(N);m(M);var F=s(M,2),I=e=>{var t=y(),n=d(t,!0);r(()=>g(n,D())),i(e,t)};e(F,e=>{D()&&e(I)});var L=s(F,2),R=e=>{var t=b(),n=d(t,!0);r(()=>g(n,O())),i(e,t)};e(L,e=>{O()&&e(R)});var z=s(L,2),B=u(z),V=t=>{var n=a(),r=l(n),o=e=>{var t=x(),n=u(t);v(n,{name:`warn`,size:12}),p(),m(t),i(e,t)},s=e=>{var t=S(),n=u(t);v(n,{name:`refresh`,size:12}),p(),m(t),i(e,t)};e(r,e=>{E()===`irreversible`?e(o):e(s,-1)}),i(t,n)};e(B,e=>{k()&&e(V)});var H=s(B,4);n(H,()=>w.actions??_),m(z),m(A),r(()=>{j=t(A,1,`actioncard svelte-1v1vnro`,null,j,{irreversible:E()===`irreversible`}),g(P,` ${w.title??``}`)}),i(o,A)}function T(e){let t=e.toLowerCase();return t.includes(`ni_item`)?`monitor`:t.includes(`mail`)||t.includes(`email`)?`mail`:t.includes(`task`)?`tasks`:t.includes(`schedule`)?`clock`:t.includes(`kb`)||t.includes(`knowledge`)||t.includes(`note`)||t.includes(`doc`)?`book`:t.includes(`web`)||t.includes(`fetch`)||t.includes(`search`)?`search`:t.includes(`vault`)?`vault`:`pencil`}function E(e,t,n,r){console.assert(typeof e==`string`,`promotedLine: tool is string`),console.assert(t!==void 0,`promotedLine: args defined`);let i=e.toLowerCase();if(i===`remap_ni_item`)return`Re-maps this card against its already-approved source`;if(i===`start_ni_flow`||i===`resume_ni_flow`){let e=D(t);return e?`Fetches: ${e}`:`Builds a card from a source you pick — no fetch until you pick one`}if(i!==`create_ni_item`&&i!==`update_ni_item`)return null;let a=t;if(typeof t==`string`){if(!t.trim())return null;try{a=JSON.parse(t)}catch{return null}}if(!a||typeof a!=`object`||Array.isArray(a))return null;let o=a.source;if(!o||typeof o!=`object`||Array.isArray(o))return null;let s=o,c=s.url;if(typeof c==`string`&&c.length>0)return`Fetches: ${c}`;if(s.type===`internal.ni`)return`Combines: ${r&&r.length>0?r.join(`, `):`other cards`}`;let l=s.server_id,u=s.tool;return typeof l==`string`&&l.length>0&&typeof u==`string`&&u.length>0?`MCP: ${n??`your configured server`} → ${u}`:null}function D(e){console.assert(e!==void 0,`readSourceUrl: args defined`),console.assert(typeof e!=`function`,`readSourceUrl: args not a function`);let t=e;if(typeof e==`string`){if(!e.trim())return``;try{t=JSON.parse(e)}catch{return``}}if(!t||typeof t!=`object`||Array.isArray(t))return``;let n=t.source_url;return typeof n==`string`&&n.length>0?n:``}function O(e){let t=e;if(typeof e==`string`){if(!e.trim())return``;try{t=JSON.parse(e)}catch{return e}}return t&&typeof t==`object`&&!Array.isArray(t)?Object.entries(t).map(([e,t])=>`${e}: ${typeof t==`string`?t:JSON.stringify(t)}`).join(` `):typeof e==`string`?e:JSON.stringify(e)}export{w as i,T as n,E as r,O as t}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/entry/app.C6nqrMm7.js b/app/smartbrain_3000/web/_app/immutable/entry/app.C6nqrMm7.js new file mode 100644 index 00000000..4b93c77d --- /dev/null +++ b/app/smartbrain_3000/web/_app/immutable/entry/app.C6nqrMm7.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.CAue6YlT.js","../chunks/BChu7Pos.js","../chunks/Czex3Sq4.js","../chunks/xihTtKlq.js","../chunks/DETRq8nR.js","../chunks/CJLE_wpt.js","../chunks/CQMDLFxa.js","../chunks/BkiVJrb-.js","../chunks/DpD1lG2E.js","../chunks/ChxMyhtI.js","../chunks/CwN7cGO4.js","../chunks/Be3BkmPa.js","../chunks/nF02aZGo.js","../chunks/CDAAYzUu.js","../chunks/aIySO2My.js","../chunks/DQSrham4.js","../assets/Modal.BsseWW9a.css","../chunks/CcVP_dcS.js","../chunks/UDuC8ICI.js","../assets/Chip.GYL4hQJn.css","../assets/0.B-xUN8PJ.css","../nodes/1.C7xJmJkE.js","../nodes/2.CBI0cuH1.js","../chunks/CeaAcbO3.js","../assets/Tabs.C-bXfTKf.css","../chunks/Bmlx8Ynu.js","../assets/Spinner.sZVMC3-s.css","../nodes/3.hrXXucw2.js","../nodes/4.DwKXVaGA.js","../chunks/Di_L0eC6.js","../chunks/x-QSRA-u.js","../assets/pendingCards.bTkY8p7D.css","../chunks/itGxqfLQ.js","../assets/EmptyState.BPkuzyS8.css","../assets/4.hNlXlqzt.css","../nodes/5.Cyfd-xHo.js","../chunks/jV_dy7U_.js","../chunks/Ce4TvoH5.js","../assets/5.D4p1wr8Z.css","../nodes/6.CqMhcdx_.js","../assets/6.5V9gTAey.css","../nodes/7.rC1CBLEA.js","../assets/7.CfVVSiDA.css","../nodes/8.DlXaiCiv.js","../assets/8.G9r3aFQF.css","../nodes/9.CAioKP6J.js","../chunks/DVFSua2J.js","../assets/9.Q4U0lmP1.css","../nodes/10.BoqtT515.js","../assets/10.XHcxur0F.css","../nodes/11.SjX2dPtJ.js","../assets/11.BvDUnXGQ.css","../nodes/12.Cyl0pmDa.js","../nodes/13.Dk_SvHe1.js","../assets/13.B-o8L9be.css","../nodes/14.Dyt9LzQr.js","../nodes/15.CjnZ9tWk.js","../nodes/16.DuGhVinj.js","../nodes/17.7MLgDNjt.js","../nodes/18.CZM1LVRi.js","../assets/18.DXKM_sCu.css","../nodes/19.Dn0rUkG4.js","../nodes/20.DaQdc7Ir.js","../assets/20.DcpVa2mn.css","../nodes/21.CJha6Vtp.js","../nodes/22.DueoGgfK.js","../nodes/23.BWQAnoZQ.js","../assets/23.BzfJDnUp.css","../nodes/24.5tRnvpAR.js","../assets/24.CpyRSDLr.css","../nodes/25.a4i0kQk5.js","../nodes/26.Cws4L5Up.js","../assets/26.MD5KWOLB.css","../nodes/27.dnMaooFk.js","../nodes/28.7m_3q5mX.js","../assets/28.CiTAHA42.css"])))=>i.map(i=>d[i]); +import{A as e,G as t,K as n,L as r,M as i,N as a,P as o,Q as s,T as c,U as l,V as u,X as d,Y as f,a as p,ct as m,et as h,ft as g,i as _,it as v,j as y,l as b,q as x,r as S,st as C,tt as w}from"../chunks/BChu7Pos.js";import"../chunks/xihTtKlq.js";var T=`modulepreload`,E=function(e,t){return new URL(e,t).href},D={},O=function(e){return e.pathname.endsWith(`.css`)},k=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},A=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=E(t,n);let r=s(t),i=O(r);return k(D,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:T,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},j={},M=o(`
`),N=o(` `,1);function P(o,_){m(_,!0);let T=p(_,`components`,23,()=>[]),E=p(_,`data_0`,3,null),D=p(_,`data_1`,3,null),O=p(_,`data_2`,3,null);x(()=>_.stores.page.set(_.page)),n(()=>{_.stores,_.page,_.constructors,T(),_.form,E(),D(),O(),_.stores.page.notify()});let k=w(!1),A=w(!1),j=w(null);S(()=>{let e=_.stores.page.subscribe(()=>{u(k)&&(h(A,!0),l().then(()=>{h(j,document.title||`untitled page`,!0)}))});return h(k,!0),e});let P=v(()=>_.constructors[2]);var F=N(),I=d(F),L=t=>{let n=v(()=>_.constructors[0]);var r=a(),o=d(r);c(o,()=>u(n),(t,n)=>{b(n(t,{get data(){return E()},get form(){return _.form},get params(){return _.page.params},children:(t,n)=>{var r=a(),o=d(r),s=e=>{let t=v(()=>_.constructors[1]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return D()},get form(){return _.form},get params(){return _.page.params},children:(e,t)=>{var n=a(),r=d(n);c(r,()=>u(P),(e,t)=>{b(t(e,{get data(){return O()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[2]=e,()=>T()?.[2])}),i(e,n)},$$slots:{default:!0}}),e=>T()[1]=e,()=>T()?.[1])}),i(e,n)},l=e=>{let t=v(()=>_.constructors[1]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return D()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),i(e,n)};e(o,e=>{_.constructors[2]?e(s):e(l,-1)}),i(t,r)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),i(t,r)},R=e=>{let t=v(()=>_.constructors[0]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return E()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),i(e,n)};e(I,e=>{_.constructors[1]?e(L):e(R,-1)});var z=s(I,2),B=n=>{var a=M(),o=f(a),s=e=>{var n=r();t(()=>y(n,u(j))),i(e,n)};e(o,e=>{u(A)&&e(s)}),g(a),i(n,a)};e(z,e=>{u(k)&&e(B)}),i(o,F),C()}var F=_(P),I=[()=>A(()=>import(`../nodes/0.CAue6YlT.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url),()=>A(()=>import(`../nodes/1.C7xJmJkE.js`),__vite__mapDeps([21,1,3,5,2]),import.meta.url),()=>A(()=>import(`../nodes/2.CBI0cuH1.js`),__vite__mapDeps([22,1,2,3,4,5,7,6,8,23,24,25,26]),import.meta.url),()=>A(()=>import(`../nodes/3.hrXXucw2.js`),__vite__mapDeps([27,1,2,3,4,7,6,8,13,25,26]),import.meta.url),()=>A(()=>import(`../nodes/4.DwKXVaGA.js`),__vite__mapDeps([28,1,2,3,4,7,6,8,9,11,14,18,19,25,26,29,30,31,32,33,34]),import.meta.url),()=>A(()=>import(`../nodes/5.Cyfd-xHo.js`),__vite__mapDeps([35,1,2,3,4,7,6,8,9,10,11,14,18,19,25,26,29,30,31,32,33,36,37,38]),import.meta.url),()=>A(()=>import(`../nodes/6.CqMhcdx_.js`),__vite__mapDeps([39,1,2,3,4,7,6,8,14,15,16,25,26,29,40]),import.meta.url),()=>A(()=>import(`../nodes/7.rC1CBLEA.js`),__vite__mapDeps([41,1,3,5,2,42]),import.meta.url),()=>A(()=>import(`../nodes/8.DlXaiCiv.js`),__vite__mapDeps([43,1,2,3,4,7,6,8,23,24,25,26,29,32,11,33,36,44]),import.meta.url),()=>A(()=>import(`../nodes/9.CAioKP6J.js`),__vite__mapDeps([45,1,2,3,4,7,6,8,11,14,15,16,18,19,25,26,29,32,33,36,46,47]),import.meta.url),()=>A(()=>import(`../nodes/10.BoqtT515.js`),__vite__mapDeps([48,1,2,3,4,7,6,8,11,14,15,16,17,18,19,25,26,29,32,33,36,49]),import.meta.url),()=>A(()=>import(`../nodes/11.SjX2dPtJ.js`),__vite__mapDeps([50,1,2,3,4,7,6,8,11,14,15,16,17,18,19,25,26,29,32,33,51]),import.meta.url),()=>A(()=>import(`../nodes/12.Cyl0pmDa.js`),__vite__mapDeps([52,1,3,6,12]),import.meta.url),()=>A(()=>import(`../nodes/13.Dk_SvHe1.js`),__vite__mapDeps([53,1,2,3,4,7,6,8,11,14,25,26,29,32,33,46,54]),import.meta.url),()=>A(()=>import(`../nodes/14.Dyt9LzQr.js`),__vite__mapDeps([55,1,2,3,4,7,6,8,11,14,23,24,25,26,29,36]),import.meta.url),()=>A(()=>import(`../nodes/15.CjnZ9tWk.js`),__vite__mapDeps([56,1,2,3,4,13,25,26]),import.meta.url),()=>A(()=>import(`../nodes/16.DuGhVinj.js`),__vite__mapDeps([57,1,3,7,2,4,6,14,29,36]),import.meta.url),()=>A(()=>import(`../nodes/17.7MLgDNjt.js`),__vite__mapDeps([58,1,3,7,2,4,6,14,29,36]),import.meta.url),()=>A(()=>import(`../nodes/18.CZM1LVRi.js`),__vite__mapDeps([59,1,3,7,2,4,6,14,29,60]),import.meta.url),()=>A(()=>import(`../nodes/19.Dn0rUkG4.js`),__vite__mapDeps([61,1,3,7,2,4,6,29]),import.meta.url),()=>A(()=>import(`../nodes/20.DaQdc7Ir.js`),__vite__mapDeps([62,1,3,7,2,4,6,18,11,19,29,63]),import.meta.url),()=>A(()=>import(`../nodes/21.CJha6Vtp.js`),__vite__mapDeps([64,1,3,7,2,4,6,29]),import.meta.url),()=>A(()=>import(`../nodes/22.DueoGgfK.js`),__vite__mapDeps([65,1,3,7,2,4,6,29]),import.meta.url),()=>A(()=>import(`../nodes/23.BWQAnoZQ.js`),__vite__mapDeps([66,1,3,7,2,4,6,25,26,29,67]),import.meta.url),()=>A(()=>import(`../nodes/24.5tRnvpAR.js`),__vite__mapDeps([68,1,3,7,2,4,6,8,18,11,19,25,26,29,36,37,69]),import.meta.url),()=>A(()=>import(`../nodes/25.a4i0kQk5.js`),__vite__mapDeps([70,1,3,7,2,4,6,18,11,19,25,26,29]),import.meta.url),()=>A(()=>import(`../nodes/26.Cws4L5Up.js`),__vite__mapDeps([71,1,2,3,4,7,6,8,25,26,72]),import.meta.url),()=>A(()=>import(`../nodes/27.dnMaooFk.js`),__vite__mapDeps([73,1,2,3,4,7,6,8]),import.meta.url),()=>A(()=>import(`../nodes/28.7m_3q5mX.js`),__vite__mapDeps([74,1,2,3,4,7,6,8,25,26,29,75]),import.meta.url)],L=[],R={"/":[3],"/activity":[4],"/chat":[5],"/email":[6],"/help":[7],"/info":[8],"/knowledge":[9],"/ni":[10],"/ni/library":[11],"/pair":[12],"/planner":[13],"/schedules":[14],"/settings":[15,[2]],"/settings/account":[16,[2]],"/settings/devices":[17,[2]],"/settings/mcp":[18,[2]],"/settings/memory":[19,[2]],"/settings/models":[20,[2]],"/settings/providers":[21,[2]],"/settings/router":[22,[2]],"/settings/selfimprove":[23,[2]],"/settings/status":[24,[2]],"/settings/web":[25,[2]],"/setup":[26],"/unlock":[27],"/usage":[28]},z={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},B=Object.fromEntries(Object.entries(z.transport).map(([e,t])=>[e,t.decode])),V=Object.fromEntries(Object.entries(z.transport).map(([e,t])=>[e,t.encode])),H=!1,U=(e,t)=>B[e](t),W=()=>A(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{U as decode,B as decoders,R as dictionary,V as encoders,W as get_error_template,H as hash,z as hooks,j as matchers,I as nodes,F as root,L as server_loads}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/entry/app.DIDA9xot.js b/app/smartbrain_3000/web/_app/immutable/entry/app.DIDA9xot.js deleted file mode 100644 index d0cb5d43..00000000 --- a/app/smartbrain_3000/web/_app/immutable/entry/app.DIDA9xot.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BC5_jvAz.js","../chunks/BJLLtWYH.js","../chunks/BxvjB08B.js","../chunks/xihTtKlq.js","../chunks/Cmegxfzj.js","../chunks/CLNxzSSl.js","../chunks/CQMDLFxa.js","../chunks/CoHYJ8BJ.js","../chunks/y2R953fa.js","../chunks/BtjCS6Y-.js","../chunks/eN4Uq1pt.js","../chunks/CEPrmzat.js","../chunks/nF02aZGo.js","../chunks/iVEGnMVT.js","../chunks/CwtHPkdz.js","../chunks/BqUz5g-m.js","../assets/Modal.BsseWW9a.css","../chunks/uFPkKLC1.js","../chunks/kqW19h2g.js","../assets/Chip.GYL4hQJn.css","../assets/0.B-xUN8PJ.css","../nodes/1.CS-bGd13.js","../nodes/2.CiKgDIBB.js","../chunks/tlN4Hcij.js","../assets/Tabs.C-bXfTKf.css","../chunks/1gl_kuJz.js","../assets/Spinner.sZVMC3-s.css","../nodes/3.4LzSyiDB.js","../nodes/4.BTxIooNG.js","../chunks/DKVRJME0.js","../chunks/DNdCTZZL.js","../assets/pendingCards.bTkY8p7D.css","../chunks/DV4tMnTy.js","../assets/EmptyState.BPkuzyS8.css","../assets/4.hNlXlqzt.css","../nodes/5.aXnt5v4U.js","../chunks/jV_dy7U_.js","../chunks/Ce4TvoH5.js","../assets/5.D4p1wr8Z.css","../nodes/6.C0SuaYab.js","../assets/6.5V9gTAey.css","../nodes/7.Dd3hmGbD.js","../assets/7.CfVVSiDA.css","../nodes/8.CE6Gc_e3.js","../assets/8.G9r3aFQF.css","../nodes/9.BeNo-nGH.js","../chunks/DVFSua2J.js","../assets/9.Q4U0lmP1.css","../nodes/10.D2sVRYwK.js","../assets/10.XHcxur0F.css","../nodes/11.BQRO1JQZ.js","../assets/11.BvDUnXGQ.css","../nodes/12.Dbly5ARM.js","../nodes/13.wu6k-MKp.js","../assets/13.B-o8L9be.css","../nodes/14.eFvvfdPp.js","../nodes/15.BPdwRx9u.js","../nodes/16.Djk9HcUS.js","../nodes/17.CgukqYQt.js","../nodes/18.COwa8j3Q.js","../assets/18.DXKM_sCu.css","../nodes/19.qPht_xNT.js","../nodes/20.CcKNEGJ_.js","../assets/20.DcpVa2mn.css","../nodes/21.DHbFPEDf.js","../nodes/22.BfzGGdQN.js","../nodes/23.BiQaWPwb.js","../assets/23.BzfJDnUp.css","../nodes/24.Denbgw47.js","../assets/24.CpyRSDLr.css","../nodes/25.wN3Z1f3V.js","../nodes/26.BQ1Crg-Z.js","../assets/26.MD5KWOLB.css","../nodes/27.CsA0vwdY.js","../nodes/28.DEhKyuoz.js","../assets/28.CiTAHA42.css"])))=>i.map(i=>d[i]); -import{A as e,G as t,K as n,L as r,M as i,N as a,P as o,Q as s,T as c,U as l,V as u,X as d,Y as f,a as p,ct as m,et as h,ft as g,i as _,it as v,j as y,l as b,q as x,r as S,st as C,tt as w}from"../chunks/BJLLtWYH.js";import"../chunks/xihTtKlq.js";var T=`modulepreload`,E=function(e,t){return new URL(e,t).href},D={},O=function(e){return e.pathname.endsWith(`.css`)},k=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=E(t,n);let r=s(t);if(r.href in D)return;D[r.href]=!0;let i=O(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:T,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},A={},j=o(`
`),M=o(` `,1);function N(o,_){m(_,!0);let T=p(_,`components`,23,()=>[]),E=p(_,`data_0`,3,null),D=p(_,`data_1`,3,null),O=p(_,`data_2`,3,null);x(()=>_.stores.page.set(_.page)),n(()=>{_.stores,_.page,_.constructors,T(),_.form,E(),D(),O(),_.stores.page.notify()});let k=w(!1),A=w(!1),N=w(null);S(()=>{let e=_.stores.page.subscribe(()=>{u(k)&&(h(A,!0),l().then(()=>{h(N,document.title||`untitled page`,!0)}))});return h(k,!0),e});let P=v(()=>_.constructors[2]);var F=M(),I=d(F),L=t=>{let n=v(()=>_.constructors[0]);var r=a(),o=d(r);c(o,()=>u(n),(t,n)=>{b(n(t,{get data(){return E()},get form(){return _.form},get params(){return _.page.params},children:(t,n)=>{var r=a(),o=d(r),s=e=>{let t=v(()=>_.constructors[1]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return D()},get form(){return _.form},get params(){return _.page.params},children:(e,t)=>{var n=a(),r=d(n);c(r,()=>u(P),(e,t)=>{b(t(e,{get data(){return O()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[2]=e,()=>T()?.[2])}),i(e,n)},$$slots:{default:!0}}),e=>T()[1]=e,()=>T()?.[1])}),i(e,n)},l=e=>{let t=v(()=>_.constructors[1]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return D()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),i(e,n)};e(o,e=>{_.constructors[2]?e(s):e(l,-1)}),i(t,r)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),i(t,r)},R=e=>{let t=v(()=>_.constructors[0]);var n=a(),r=d(n);c(r,()=>u(t),(e,t)=>{b(t(e,{get data(){return E()},get form(){return _.form},get params(){return _.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),i(e,n)};e(I,e=>{_.constructors[1]?e(L):e(R,-1)});var z=s(I,2),B=n=>{var a=j(),o=f(a),s=e=>{var n=r();t(()=>y(n,u(N))),i(e,n)};e(o,e=>{u(A)&&e(s)}),g(a),i(n,a)};e(z,e=>{u(k)&&e(B)}),i(o,F),C()}var P=_(N),F=[()=>k(()=>import(`../nodes/0.BC5_jvAz.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]),import.meta.url),()=>k(()=>import(`../nodes/1.CS-bGd13.js`),__vite__mapDeps([21,1,3,5,2]),import.meta.url),()=>k(()=>import(`../nodes/2.CiKgDIBB.js`),__vite__mapDeps([22,1,2,3,4,5,7,6,8,23,24,25,26]),import.meta.url),()=>k(()=>import(`../nodes/3.4LzSyiDB.js`),__vite__mapDeps([27,1,2,3,4,7,6,8,13,25,26]),import.meta.url),()=>k(()=>import(`../nodes/4.BTxIooNG.js`),__vite__mapDeps([28,1,2,3,4,7,6,8,9,11,14,18,19,25,26,29,30,31,32,33,34]),import.meta.url),()=>k(()=>import(`../nodes/5.aXnt5v4U.js`),__vite__mapDeps([35,1,2,3,4,7,6,8,9,10,11,14,18,19,25,26,29,30,31,32,33,36,37,38]),import.meta.url),()=>k(()=>import(`../nodes/6.C0SuaYab.js`),__vite__mapDeps([39,1,2,3,4,7,6,8,14,15,16,25,26,29,40]),import.meta.url),()=>k(()=>import(`../nodes/7.Dd3hmGbD.js`),__vite__mapDeps([41,1,3,5,2,42]),import.meta.url),()=>k(()=>import(`../nodes/8.CE6Gc_e3.js`),__vite__mapDeps([43,1,2,3,4,7,6,8,23,24,25,26,29,32,11,33,36,44]),import.meta.url),()=>k(()=>import(`../nodes/9.BeNo-nGH.js`),__vite__mapDeps([45,1,2,3,4,7,6,8,11,14,15,16,18,19,25,26,29,32,33,36,46,47]),import.meta.url),()=>k(()=>import(`../nodes/10.D2sVRYwK.js`),__vite__mapDeps([48,1,2,3,4,7,6,8,11,14,15,16,17,18,19,25,26,29,32,33,36,49]),import.meta.url),()=>k(()=>import(`../nodes/11.BQRO1JQZ.js`),__vite__mapDeps([50,1,2,3,4,7,6,8,11,14,15,16,17,18,19,25,26,29,32,33,51]),import.meta.url),()=>k(()=>import(`../nodes/12.Dbly5ARM.js`),__vite__mapDeps([52,1,3,6,12]),import.meta.url),()=>k(()=>import(`../nodes/13.wu6k-MKp.js`),__vite__mapDeps([53,1,2,3,4,7,6,8,11,14,25,26,29,32,33,46,54]),import.meta.url),()=>k(()=>import(`../nodes/14.eFvvfdPp.js`),__vite__mapDeps([55,1,2,3,4,7,6,8,11,14,23,24,25,26,29,36]),import.meta.url),()=>k(()=>import(`../nodes/15.BPdwRx9u.js`),__vite__mapDeps([56,1,2,3,4,13,25,26]),import.meta.url),()=>k(()=>import(`../nodes/16.Djk9HcUS.js`),__vite__mapDeps([57,1,3,7,2,4,6,14,29,36]),import.meta.url),()=>k(()=>import(`../nodes/17.CgukqYQt.js`),__vite__mapDeps([58,1,3,7,2,4,6,14,29,36]),import.meta.url),()=>k(()=>import(`../nodes/18.COwa8j3Q.js`),__vite__mapDeps([59,1,3,7,2,4,6,14,29,60]),import.meta.url),()=>k(()=>import(`../nodes/19.qPht_xNT.js`),__vite__mapDeps([61,1,3,7,2,4,6,29]),import.meta.url),()=>k(()=>import(`../nodes/20.CcKNEGJ_.js`),__vite__mapDeps([62,1,3,7,2,4,6,18,11,19,29,63]),import.meta.url),()=>k(()=>import(`../nodes/21.DHbFPEDf.js`),__vite__mapDeps([64,1,3,7,2,4,6,29]),import.meta.url),()=>k(()=>import(`../nodes/22.BfzGGdQN.js`),__vite__mapDeps([65,1,3,7,2,4,6,29]),import.meta.url),()=>k(()=>import(`../nodes/23.BiQaWPwb.js`),__vite__mapDeps([66,1,3,7,2,4,6,25,26,29,67]),import.meta.url),()=>k(()=>import(`../nodes/24.Denbgw47.js`),__vite__mapDeps([68,1,3,7,2,4,6,8,18,11,19,25,26,29,36,37,69]),import.meta.url),()=>k(()=>import(`../nodes/25.wN3Z1f3V.js`),__vite__mapDeps([70,1,3,7,2,4,6,18,11,19,25,26,29]),import.meta.url),()=>k(()=>import(`../nodes/26.BQ1Crg-Z.js`),__vite__mapDeps([71,1,2,3,4,7,6,8,25,26,72]),import.meta.url),()=>k(()=>import(`../nodes/27.CsA0vwdY.js`),__vite__mapDeps([73,1,2,3,4,7,6,8]),import.meta.url),()=>k(()=>import(`../nodes/28.DEhKyuoz.js`),__vite__mapDeps([74,1,2,3,4,7,6,8,25,26,29,75]),import.meta.url)],I=[],L={"/":[3],"/activity":[4],"/chat":[5],"/email":[6],"/help":[7],"/info":[8],"/knowledge":[9],"/ni":[10],"/ni/library":[11],"/pair":[12],"/planner":[13],"/schedules":[14],"/settings":[15,[2]],"/settings/account":[16,[2]],"/settings/devices":[17,[2]],"/settings/mcp":[18,[2]],"/settings/memory":[19,[2]],"/settings/models":[20,[2]],"/settings/providers":[21,[2]],"/settings/router":[22,[2]],"/settings/selfimprove":[23,[2]],"/settings/status":[24,[2]],"/settings/web":[25,[2]],"/setup":[26],"/unlock":[27],"/usage":[28]},R={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},z=Object.fromEntries(Object.entries(R.transport).map(([e,t])=>[e,t.decode])),B=Object.fromEntries(Object.entries(R.transport).map(([e,t])=>[e,t.encode])),V=!1,H=(e,t)=>z[e](t),U=()=>k(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{H as decode,z as decoders,L as dictionary,B as encoders,U as get_error_template,V as hash,R as hooks,A as matchers,F as nodes,P as root,I as server_loads}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/entry/start.BbFbPWF3.js b/app/smartbrain_3000/web/_app/immutable/entry/start.BbFbPWF3.js deleted file mode 100644 index 78f8ec29..00000000 --- a/app/smartbrain_3000/web/_app/immutable/entry/start.BbFbPWF3.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e,n as t}from"../chunks/BxvjB08B.js";export{e as load_css,t as start}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/entry/start.TSJdo2Gi.js b/app/smartbrain_3000/web/_app/immutable/entry/start.TSJdo2Gi.js new file mode 100644 index 00000000..744a931c --- /dev/null +++ b/app/smartbrain_3000/web/_app/immutable/entry/start.TSJdo2Gi.js @@ -0,0 +1 @@ +export{a as load_css,n as start}from"../chunks/Czex3Sq4.js"; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/nodes/0.BC5_jvAz.js b/app/smartbrain_3000/web/_app/immutable/nodes/0.CAue6YlT.js similarity index 81% rename from app/smartbrain_3000/web/_app/immutable/nodes/0.BC5_jvAz.js rename to app/smartbrain_3000/web/_app/immutable/nodes/0.CAue6YlT.js index 9d598126..d3f9cbe5 100644 --- a/app/smartbrain_3000/web/_app/immutable/nodes/0.BC5_jvAz.js +++ b/app/smartbrain_3000/web/_app/immutable/nodes/0.CAue6YlT.js @@ -1,7 +1,7 @@ -import{$ as e,A as t,B as n,C as r,E as i,G as a,J as o,K as s,L as c,M as l,N as u,O as d,P as f,Q as p,R as m,V as h,X as g,Y as _,Z as v,ct as y,dt as b,et as x,ft as S,g as C,h as ee,ht as w,it as T,j as E,m as te,n as ne,r as re,rt as D,s as O,st as k,tt as A,z as j}from"../chunks/BJLLtWYH.js";import{t as ie}from"../chunks/BxvjB08B.js";import"../chunks/xihTtKlq.js";import"../chunks/Cmegxfzj.js";import{t as M}from"../chunks/CLNxzSSl.js";import{_ as N,h as ae}from"../chunks/CQMDLFxa.js";import{c as P,n as F,o as oe,r as I,s as se}from"../chunks/CoHYJ8BJ.js";import{t as L}from"../chunks/y2R953fa.js";import{n as ce,t as le}from"../chunks/BtjCS6Y-.js";import{n as ue,t as de}from"../chunks/eN4Uq1pt.js";import{t as R}from"../chunks/CEPrmzat.js";import{t as fe}from"../chunks/nF02aZGo.js";import"../chunks/iVEGnMVT.js";import{n as z,r as B,t as pe}from"../chunks/CwtHPkdz.js";import{t as V}from"../chunks/BqUz5g-m.js";import{r as me,t as he}from"../chunks/uFPkKLC1.js";import{t as ge}from"../chunks/kqW19h2g.js";var _e=w({prerender:()=>!1,ssr:()=>!1});function ve(e,t,n){return!e||!t||e===t?`none`:n?`banner`:`reload`}function H(e){return e?`v${e}`:``}var U=e({mode:`system`});function W(){try{let e=localStorage.getItem(`theme`);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}function ye(e){let t=document.documentElement;e===`system`?t.removeAttribute(`data-theme`):t.dataset.theme=e}function be(){U.mode=W()}function xe(){U.mode=U.mode===`system`?`light`:U.mode===`light`?`dark`:`system`;try{U.mode===`system`?localStorage.removeItem(`theme`):localStorage.setItem(`theme`,U.mode)}catch{}ye(U.mode)}function G(e,t){return console.assert(typeof e==`string`&&e.length>0,`chipState requires a RemoteStatus`),console.assert(t===null||typeof t==`boolean`,`unlocked must be boolean | null`),(e===`connected`||e===`connected-direct`||e===`connected-relay`)&&t===!1?`locked`:e}var Se=f(` `),K=f(` `);function Ce(e,n){y(n,!0);let i=T(()=>G(P.status,L.status?.unlocked??null)),o={connecting:`Remote · connecting…`,verifying:`Remote · verifying Desktop…`,connected:`Remote · connected`,"connected-direct":`Remote · direct (P2P)`,"connected-relay":`Remote · relayed`,reconnecting:`Remote · reconnecting…`,untrusted:`Remote · BLOCKED`,offline:`Remote · unreachable`,locked:`Desktop locked`},s=T(()=>h(i)===`connected-direct`?`ok`:h(i)===`connected-relay`||h(i)===`locked`?`warn`:h(i)===`untrusted`?`bad`:`muted`),c=T(()=>h(i)===`connected-relay`?`Direct wasn't possible, so traffic goes through an encrypted relay that can't read it.`:h(i)===`untrusted`?`Couldn't verify your Desktop's identity — connection blocked. Re-pair if you reinstalled.`:h(i)===`locked`?`Your Desktop is locked. Tap to unlock — the bridge is up, but nothing here works until it's unlocked.`:P.detail);var d=u(),f=g(d),m=e=>{var n=u(),d=g(n),f=e=>{var t=Se(),n=_(t);R(n,{name:`lock`});var u=p(n);S(t),a(()=>{r(t,1,`remote-chip ${h(s)??``}`,`svelte-8oyh7k`),C(t,`title`,h(c)),E(u,` ${o[h(i)]??``}`)}),l(e,t)},m=e=>{var t=K(),n=v(t,!0);a(()=>{r(t,1,`remote-chip ${h(s)??``}`,`svelte-8oyh7k`),C(t,`title`,h(c)),E(n,o[h(i)]??h(i))}),l(e,t)};t(d,e=>{h(i)===`locked`?e(f):e(m,-1)}),l(e,n)};t(f,e=>{h(i)!==`idle`&&h(i)!==`untrusted`&&e(m)}),l(e,d),k()}function q(){return typeof window>`u`?!1:(window.matchMedia?.(`(display-mode: standalone)`)?.matches??!1)||window.navigator.standalone===!0}function J(){return typeof navigator>`u`?!1:/iphone|ipad|ipod|android/i.test(navigator.userAgent)}var we=f(`

`),Te=f(`

Pair this device

On your Desktop: Settings → Remote access → Pair a new phone, then enter the +import{$ as e,A as t,B as n,C as r,E as i,G as a,J as o,K as s,L as c,M as l,N as u,O as d,P as f,Q as p,R as m,V as h,X as g,Y as _,Z as v,ct as y,dt as b,et as x,ft as S,g as C,h as ee,ht as w,it as T,j as E,m as te,n as ne,r as re,rt as D,s as O,st as k,tt as A,z as j}from"../chunks/BChu7Pos.js";import{t as ie}from"../chunks/Czex3Sq4.js";import"../chunks/xihTtKlq.js";import"../chunks/DETRq8nR.js";import{t as M}from"../chunks/CJLE_wpt.js";import{_ as N,h as ae}from"../chunks/CQMDLFxa.js";import{c as P,n as F,o as oe,r as I,s as se}from"../chunks/BkiVJrb-.js";import{t as L}from"../chunks/DpD1lG2E.js";import{n as ce,t as le}from"../chunks/ChxMyhtI.js";import{n as ue,t as de}from"../chunks/CwN7cGO4.js";import{t as R}from"../chunks/Be3BkmPa.js";import{t as fe}from"../chunks/nF02aZGo.js";import"../chunks/CDAAYzUu.js";import{n as z,r as B,t as pe}from"../chunks/aIySO2My.js";import{t as V}from"../chunks/DQSrham4.js";import{r as me,t as he}from"../chunks/CcVP_dcS.js";import{t as ge}from"../chunks/UDuC8ICI.js";var _e=w({prerender:()=>!1,ssr:()=>!1});function ve(e,t,n){return!e||!t||e===t?`none`:n?`banner`:`reload`}function H(e){return e?`v${e}`:``}var U=e({mode:`system`});function W(){try{let e=localStorage.getItem(`theme`);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}function ye(e){let t=document.documentElement;e===`system`?t.removeAttribute(`data-theme`):t.dataset.theme=e}function be(){U.mode=W()}function xe(){U.mode=U.mode===`system`?`light`:U.mode===`light`?`dark`:`system`;try{U.mode===`system`?localStorage.removeItem(`theme`):localStorage.setItem(`theme`,U.mode)}catch{}ye(U.mode)}function G(e,t){return console.assert(typeof e==`string`&&e.length>0,`chipState requires a RemoteStatus`),console.assert(t===null||typeof t==`boolean`,`unlocked must be boolean | null`),(e===`connected`||e===`connected-direct`||e===`connected-relay`)&&t===!1?`locked`:e}var Se=f(` `),K=f(` `);function Ce(e,n){y(n,!0);let i=T(()=>G(P.status,L.status?.unlocked??null)),o={connecting:`Remote · connecting…`,verifying:`Remote · verifying Desktop…`,connected:`Remote · connected`,"connected-direct":`Remote · direct (P2P)`,"connected-relay":`Remote · relayed`,reconnecting:`Remote · reconnecting…`,untrusted:`Remote · BLOCKED`,offline:`Remote · unreachable`,locked:`Desktop locked`},s=T(()=>h(i)===`connected-direct`?`ok`:h(i)===`connected-relay`||h(i)===`locked`?`warn`:h(i)===`untrusted`?`bad`:`muted`),c=T(()=>h(i)===`connected-relay`?`Direct wasn't possible, so traffic goes through an encrypted relay that can't read it.`:h(i)===`untrusted`?`Couldn't verify your Desktop's identity — connection blocked. Re-pair if you reinstalled.`:h(i)===`locked`?`Your Desktop is locked. Tap to unlock — the bridge is up, but nothing here works until it's unlocked.`:P.detail);var d=u(),f=g(d),m=e=>{var n=u(),d=g(n),f=e=>{var t=Se(),n=_(t);R(n,{name:`lock`});var u=p(n);S(t),a(()=>{r(t,1,`remote-chip ${h(s)??``}`,`svelte-8oyh7k`),C(t,`title`,h(c)),E(u,` ${o[h(i)]??``}`)}),l(e,t)},m=e=>{var t=K(),n=v(t,!0);a(()=>{r(t,1,`remote-chip ${h(s)??``}`,`svelte-8oyh7k`),C(t,`title`,h(c)),E(n,o[h(i)]??h(i))}),l(e,t)};t(d,e=>{h(i)===`locked`?e(f):e(m,-1)}),l(e,n)};t(f,e=>{h(i)!==`idle`&&h(i)!==`untrusted`&&e(m)}),l(e,d),k()}function q(){return typeof window>`u`?!1:(window.matchMedia?.(`(display-mode: standalone)`)?.matches??!1)||window.navigator.standalone===!0}function J(){return typeof navigator>`u`?!1:/iphone|ipad|ipod|android/i.test(navigator.userAgent)}var we=f(`

`),Te=f(`

Pair this device

On your Desktop: Settings → Remote access → Pair a new phone, then enter the 6-character code here.

`,1),Ee=f(`

Set up SmartBrain on your phone

For a reliable, one-tap app that works from anywhere, add SmartBrain to your Home Screen first:

  • iOS: tap the Share button → Add to Home Screen.
  • Android: tap the ⋮ menu → Install app (or Add to Home screen).

`,1),De=f(`

Almost there

Open the SmartBrain icon from your Home Screen to finish setting up — you’ll enter a code there.

Don’t see it?

`,1),Y=f(`
`);function Oe(n,r){y(r,!0);let i=q(),o=A(e(typeof localStorage<`u`&&localStorage.getItem(`sb-installed`)===`1`)),s=A(``),c=A(!1),u=A(``);function d(){try{localStorage.setItem(`sb-installed`,`1`)}catch{}x(o,!0)}let f=T(()=>i||!J());async function m(){if(!h(c)){x(c,!0),x(u,``);try{await N(await fe(h(s))),window.location.assign(`/`)}catch(e){x(u,e instanceof Error?e.message:`pairing failed`,!0)}finally{x(c,!1)}}}var b=Y(),C=_(b),w=e=>{var n=Te(),r=p(g(n),4),i=_(r);ee(i),S(r);var o=p(r,2),d=_(o),f=v(d,!0);S(o);var y=p(o,2),b=e=>{var t=we(),n=v(t,!0);a(()=>E(n,h(u))),l(e,t)};t(y,e=>{h(u)&&e(b)}),a(()=>{d.disabled=h(c),E(f,h(c)?`Pairing…`:`Pair`)}),te(i,()=>h(s),e=>x(s,e)),j(`click`,d,m),l(e,n)},ne=e=>{var t=Ee(),n=p(g(t),6),r=v(n);j(`click`,r,d),l(e,t)},re=e=>{var t=De(),n=p(g(t),4),r=p(_(n));S(n),j(`click`,r,()=>x(o,!1)),l(e,t)};t(C,e=>{h(f)?e(w):h(o)?e(re,-1):e(ne,1)}),S(b),l(n,b),k()}m([`click`]);var X=f(` `,1);function ke(e,n){y(n,!1),O();var i=u(),o=g(i),s=e=>{V(e,{open:!0,alert:!0,get label(){return z.current.title},onclose:()=>B(!1),onkeydown:e=>{e.key===`Enter`&&B(!0)},children:(e,t)=>{var n=X(),i=g(n),o=v(i,!0),s=p(i,2),c=v(s,!0),u=p(s,2),d=_(u),f=p(d,2);let m;var h=v(f,!0);S(u),a(()=>{E(o,z.current.title),E(c,z.current.body),m=r(f,1,``,null,m,{danger:z.current.danger}),E(h,z.current.confirmLabel)}),j(`click`,d,()=>B(!1)),j(`click`,f,()=>B(!0)),l(e,n)},$$slots:{default:!0}})};t(o,e=>{z.current&&e(s)}),l(e,i),k()}m([`click`]);var Z=f(``),Q=f(`
`);function Ae(e,n){y(n,!1),O();var i=u(),o=g(i),s=e=>{var t=Q();d(t,5,()=>me.items,e=>e.id,(e,t)=>{var n=Z(),i=_(n);{let e=D(()=>h(t).kind===`ok`?`check`:`warn`);R(i,{get name(){return h(e)},size:14})}var o=p(i);S(n),a(()=>{r(n,1,`toast ${h(t).kind??``}`,`svelte-1cpok13`),E(o,` ${h(t).msg??``}`)}),j(`click`,n,()=>he(h(t).id)),l(e,n)}),S(t),l(e,t)};t(o,e=>{me.items.length>0&&e(s)}),l(e,i),k()}m([`click`]);var je=f(` `),Me=f(` SmartBrain_3000 `),Ne=f(``),Pe=f(``),Fe=f(` Help `,1),Ie=f(``),Le=f(` `),Re=f(` `),ze=f(``),Be=f(` Help`),Ve=f(` `),He=f(`Couldn’t reach the desktop app to start the install. Open the SmartBrain icon in your menu bar and choose Install update now. `,1),Ue=f(`SmartBrain is ready to install. Installing restarts it — under a minute, and you’ll unlock again afterwards. `,1),We=f(`
`),Ge=f(`
SmartBrain updated to while this page was open — reload to use the new version.
`),Ke=f(`
Your SmartBrain desktop app needs a one-time update to keep - updating itself automatically. Download the new app or run brew upgrade --cask smartbrain / scoop update smartbrain
`),qe=f(`

Can’t reach your Desktop

Still stuck? Re-pair this device.

`),Je=f(`

Can’t reach SmartBrain

First time on this device? Pair with a code.

`),Ye=f(` `),Xe=f(` `),Ze=f(``),Qe=f(` `,1),$e=f(`
`,1);function $(e,f){y(f,!0);let m=e=>{var n=Me(),r=p(_(n),2),i=p(_(r),2),o=e=>{var t=je(),n=v(t,!0);a(()=>E(n,h(te))),l(e,t)};t(i,e=>{h(te)&&e(o)}),S(r),S(n),l(e,n)},ee=e=>{var n=Fe(),r=g(n),i=_(r);R(i,{name:`help`}),b(),S(r);var o=p(r,2),s=_(o);R(s,{get name(){return Se[U.mode]}}),b(),S(o);var c=p(o,2),u=e=>{var t=Ne(),n=_(t);R(n,{name:`link`}),b(),S(t),j(`click`,t,at),l(e,t)};t(c,e=>{h(B)&&e(u)});var d=p(c,2),f=e=>{var t=Pe(),n=_(t);R(n,{name:`lock`});var r=p(n);S(t),a(()=>{t.disabled=h(w),E(r,` ${h(w)?`Locking…`:`Lock`}`)}),j(`click`,t,ot),l(e,t)},m=T(()=>I(L.status));t(d,e=>{h(m)&&e(f)}),a(()=>{C(o,`title`,`Theme: ${U.mode}`),C(o,`aria-label`,`Theme: ${U.mode}. Click to change.`)}),j(`click`,o,function(...e){xe?.apply(this,e)}),l(e,n)},w=A(!1),te=A(``),D=A(``),O=A(!1),N=A(!1),fe=T(()=>[`/chat`,`/help`,`/ni`].some(e=>M.url.pathname.startsWith(e))),z=[{href:`/chat`,label:`Chat`,icon:`chat`,remote:!0},{href:`/ni`,label:`Neural`,icon:`monitor`,remote:!0},{href:`/knowledge`,label:`Knowledge`,icon:`book`,remote:!0},{href:`/planner`,label:`Planner`,icon:`tasks`,remote:!0},{href:`/schedules`,label:`Schedules`,icon:`clock`,remote:!0},{href:`/email`,label:`Email`,icon:`mail`,remote:!0},{href:`/info`,label:`Info`,icon:`info`,remote:!0},{href:`/activity`,label:`Activity`,icon:`activity`,remote:!0},{href:`/usage`,label:`Usage`,icon:`chart`,remote:!0},{href:`/settings`,label:`Settings`,icon:`sliders`,remote:!1}],B=T(()=>P.status!==`idle`),V=T(()=>h(B)?z.filter(e=>e.remote):z),me=[`/chat`,`/ni`,`/knowledge`,`/info`],he=T(()=>h(V).filter(e=>me.includes(e.href))),_e=T(()=>h(V).filter(e=>!me.includes(e.href))),W=e=>M.url.pathname===e||M.url.pathname.startsWith(e+`/`),ye=typeof localStorage<`u`&&localStorage.getItem(`sbNav`)===`1`,G=T(()=>L.status?I(L.status):ye);s(()=>{L.status&&localStorage.setItem(`sbNav`,I(L.status)?`1`:`0`)});let Se={system:`sun-moon`,light:`sun`,dark:`moon`},K=e=>e===`/activity`&&le.count>0?le.count:e===`/chat`&&ue.count>0?ue.count:0,q=e=>e===`/activity`?`${le.count} awaiting approval`:`${ue.count} new scheduled updates`,J=T(()=>h(_e).reduce((e,t)=>e+K(t.href),0)),we=T(()=>[`/help`,`/pair`].some(e=>M.url.pathname.startsWith(e))),Te=T(()=>!!L.error&&L.status===null&&!h(we)),Ee=T(()=>P.needsPairing&&!h(we)),De=T(()=>P.status===`offline`&&!h(we)&&!h(Ee)),Y=null,X=A(``),Z=A(!1),Q=A(!1);ne(()=>{Y&&clearInterval(Y)}),re(async()=>{be(),se(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&it()}),window.addEventListener(`pageshow`,()=>void it()),await oe(),L.load();try{let e=await F.health();x(te,H(e.version),!0),$=e.version,et(e.update_ready),rt(),x(O,!!e.launcher_update_needed&&sessionStorage.getItem(`launcher-nudge-dismissed`)!==`1`,!0)}catch(e){console.warn(`startup health check failed:`,e)}});let $=``;function et(e){if(!e){x(X,``);return}localStorage.getItem(`update-dismissed`)!==e&&x(X,e,!0)}async function tt(){x(Z,!0),x(Q,!1);try{await F.installUpdate(),nt()}catch{x(Z,!1),x(Q,!0)}}function nt(){Y&&clearInterval(Y);let e=Date.now()+6e5;Y=setInterval(async()=>{if(Date.now()>e){Y&&clearInterval(Y),Y=null,x(Z,!1),x(Q,!0),rt();return}try{let e=await F.health();$&&e.version&&e.version!==$&&location.reload()}catch{}},2e3)}function rt(){Y=setInterval(async()=>{try{let e=await F.health();et(e.update_ready),$&&e.version&&e.version!==$&&(x(D,H(e.version),!0),Y&&clearInterval(Y))}catch{}},6e4)}async function it(e=0){try{let e=await F.health();et(e.update_ready);let t=ve($,e.version??``,!!L.status?.unlocked);t===`reload`?location.reload():t===`banner`&&(x(D,H(e.version),!0),Y&&clearInterval(Y))}catch{e<2&&setTimeout(()=>void it(e+1),4e3)}}s(()=>{let e=M.url.pathname;x(N,!1),I(L.status)&&(ce(),e.startsWith(`/chat`)||de())});async function at(){console.assert(typeof ae==`function`,`clearPairing import missing`),console.assert(typeof pe==`function`,`confirmDialog import missing`),await pe({title:`Unpair device`,body:`You'll need to pair again with a code to use SmartBrain here.`,confirmLabel:`Unpair`,danger:!0})&&(await ae(),window.location.assign(`/`))}async function ot(){x(w,!0);try{await F.lock()}catch{}finally{await L.load(),x(w,!1),ie(`/unlock`)}}var st=$e();n(`keydown`,o,e=>{e.key===`Escape`&&x(N,!1)}),n(`click`,o,e=>{h(N)&&!e.target.closest(`.more-sheet, .tab-more`)&&x(N,!1)});var ct=g(st),lt=e=>{var t=Ie();l(e,t)};t(ct,e=>{P.status===`untrusted`&&e(lt)});var ut=p(ct,2);let dt;var ft=_(ut),pt=e=>{var n=ze(),i=_(n);m(i);var o=p(i,2);d(o,21,()=>h(V),e=>e.href,(e,n)=>{var i=Re();let o;var s=_(i);R(s,{get name(){return h(n).icon}});var c=p(s),u=p(c),d=e=>{var t=Le(),r=v(t,!0);a((e,n)=>{C(t,`title`,e),E(r,n)},[()=>q(h(n).href),()=>K(h(n).href)]),l(e,t)},f=T(()=>K(h(n).href)>0);t(u,e=>{h(f)&&e(d)}),S(i),a((e,t)=>{o=r(i,1,`navitem`,null,o,{active:e}),C(i,`href`,h(n).href),C(i,`aria-current`,t),E(c,` ${h(n).label??``} `)},[()=>W(h(n).href),()=>W(h(n).href)?`page`:void 0]),l(e,i)}),S(o);var s=p(o,2),c=_(s);ee(c),S(s),S(n),l(e,n)};t(ft,e=>{h(G)&&e(pt)});var mt=p(ft,2),ht=_(mt);let gt;var _t=_(ht);m(_t);var vt=p(_t,4),yt=e=>{ge(e,{icon:`shield`,kind:`ok`,title:`Your data is encrypted at rest and never leaves this machine`,children:(e,t)=>{b();var n=c(`Encrypted · On-device`);l(e,n)},$$slots:{default:!0}})};t(vt,e=>{h(G)&&!h(B)&&e(yt)});var bt=p(vt,2);Ce(bt,{});var xt=p(bt,2),St=e=>{var t=Be(),n=_(t);R(n,{name:`help`}),b(),S(t),l(e,t)};t(xt,e=>{h(G)||e(St)}),S(ht);var Ct=p(ht,2);let wt;var Tt=_(Ct),Et=e=>{var n=We(),r=_(n),i=e=>{var t=Ve(),n=v(t);a(e=>E(n,`Installing SmartBrain ${e??``}. It restarts in a moment + updating itself automatically. Download the new app or run brew upgrade --cask smartbrain / scoop update smartbrain `),qe=f(`

Can’t reach your Desktop

Still stuck? Re-pair this device.

`),Je=f(`

Can’t reach SmartBrain

First time on this device? Pair with a code.

`),Ye=f(` `),Xe=f(` `),Ze=f(``),Qe=f(` `,1),$e=f(`
`,1);function $(e,f){y(f,!0);let m=e=>{var n=Me(),r=p(_(n),2),i=p(_(r),2),o=e=>{var t=je(),n=v(t,!0);a(()=>E(n,h(te))),l(e,t)};t(i,e=>{h(te)&&e(o)}),S(r),S(n),l(e,n)},ee=e=>{var n=Fe(),r=g(n),i=_(r);R(i,{name:`help`}),b(),S(r);var o=p(r,2),s=_(o);R(s,{get name(){return Se[U.mode]}}),b(),S(o);var c=p(o,2),u=e=>{var t=Ne(),n=_(t);R(n,{name:`link`}),b(),S(t),j(`click`,t,at),l(e,t)};t(c,e=>{h(B)&&e(u)});var d=p(c,2),f=e=>{var t=Pe(),n=_(t);R(n,{name:`lock`});var r=p(n);S(t),a(()=>{t.disabled=h(w),E(r,` ${h(w)?`Locking…`:`Lock`}`)}),j(`click`,t,ot),l(e,t)},m=T(()=>I(L.status));t(d,e=>{h(m)&&e(f)}),a(()=>{C(o,`title`,`Theme: ${U.mode}`),C(o,`aria-label`,`Theme: ${U.mode}. Click to change.`)}),j(`click`,o,function(...e){xe?.apply(this,e)}),l(e,n)},w=A(!1),te=A(``),D=A(``),O=A(!1),N=A(!1),fe=T(()=>[`/chat`,`/help`,`/ni`].some(e=>M.url.pathname.startsWith(e))),z=[{href:`/chat`,label:`Chat`,icon:`chat`,remote:!0},{href:`/ni`,label:`Neural`,icon:`monitor`,remote:!0},{href:`/knowledge`,label:`Knowledge`,icon:`book`,remote:!0},{href:`/planner`,label:`Planner`,icon:`tasks`,remote:!0},{href:`/schedules`,label:`Schedules`,icon:`clock`,remote:!0},{href:`/email`,label:`Email`,icon:`mail`,remote:!0},{href:`/info`,label:`Info`,icon:`info`,remote:!0},{href:`/activity`,label:`Activity`,icon:`activity`,remote:!0},{href:`/usage`,label:`Usage`,icon:`chart`,remote:!0},{href:`/settings`,label:`Settings`,icon:`sliders`,remote:!1}],B=T(()=>P.status!==`idle`),V=T(()=>h(B)?z.filter(e=>e.remote):z),me=[`/chat`,`/ni`,`/knowledge`,`/info`],he=T(()=>h(V).filter(e=>me.includes(e.href))),_e=T(()=>h(V).filter(e=>!me.includes(e.href))),W=e=>M.url.pathname===e||M.url.pathname.startsWith(e+`/`),ye=typeof localStorage<`u`&&localStorage.getItem(`sbNav`)===`1`,G=T(()=>L.status?I(L.status):ye);s(()=>{L.status&&localStorage.setItem(`sbNav`,I(L.status)?`1`:`0`)});let Se={system:`sun-moon`,light:`sun`,dark:`moon`},K=e=>e===`/activity`&&le.count>0?le.count:e===`/chat`&&ue.count>0?ue.count:0,q=e=>e===`/activity`?`${le.count} awaiting approval`:`${ue.count} new scheduled updates`,J=T(()=>h(_e).reduce((e,t)=>e+K(t.href),0)),we=T(()=>[`/help`,`/pair`].some(e=>M.url.pathname.startsWith(e))),Te=T(()=>!!L.error&&L.status===null&&!h(we)),Ee=T(()=>P.needsPairing&&!h(we)),De=T(()=>P.status===`offline`&&!h(we)&&!h(Ee)),Y=null,X=A(``),Z=A(!1),Q=A(!1);ne(()=>{Y&&clearInterval(Y)}),re(async()=>{be(),se(),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`&&it()}),window.addEventListener(`pageshow`,()=>void it()),await oe(),L.load();try{let e=await F.health();x(te,H(e.version),!0),$=e.version,et(e.update_ready),rt(),x(O,!!e.launcher_update_needed&&sessionStorage.getItem(`launcher-nudge-dismissed`)!==`1`,!0)}catch(e){console.warn(`startup health check failed:`,e)}});let $=``;function et(e){e?localStorage.getItem(`update-dismissed`)!==e&&x(X,e,!0):x(X,``)}async function tt(){x(Z,!0),x(Q,!1);try{await F.installUpdate(),nt()}catch{x(Z,!1),x(Q,!0)}}function nt(){Y&&clearInterval(Y);let e=Date.now()+6e5;Y=setInterval(async()=>{if(Date.now()>e)Y&&clearInterval(Y),Y=null,x(Z,!1),x(Q,!0),rt();else try{let e=await F.health();$&&e.version&&e.version!==$&&location.reload()}catch{}},2e3)}function rt(){Y=setInterval(async()=>{try{let e=await F.health();et(e.update_ready),$&&e.version&&e.version!==$&&(x(D,H(e.version),!0),Y&&clearInterval(Y))}catch{}},6e4)}async function it(e=0){try{let e=await F.health();et(e.update_ready);let t=ve($,e.version??``,!!L.status?.unlocked);t===`reload`?location.reload():t===`banner`&&(x(D,H(e.version),!0),Y&&clearInterval(Y))}catch{e<2&&setTimeout(()=>void it(e+1),4e3)}}s(()=>{let e=M.url.pathname;x(N,!1),I(L.status)&&(ce(),e.startsWith(`/chat`)||de())});async function at(){console.assert(typeof ae==`function`,`clearPairing import missing`),console.assert(typeof pe==`function`,`confirmDialog import missing`),await pe({title:`Unpair device`,body:`You'll need to pair again with a code to use SmartBrain here.`,confirmLabel:`Unpair`,danger:!0})&&(await ae(),window.location.assign(`/`))}async function ot(){x(w,!0);try{await F.lock()}catch{}finally{await L.load(),x(w,!1),ie(`/unlock`)}}var st=$e();n(`keydown`,o,e=>{e.key===`Escape`&&x(N,!1)}),n(`click`,o,e=>{h(N)&&!e.target.closest(`.more-sheet, .tab-more`)&&x(N,!1)});var ct=g(st),lt=e=>{var t=Ie();l(e,t)};t(ct,e=>{P.status===`untrusted`&&e(lt)});var ut=p(ct,2);let dt;var ft=_(ut),pt=e=>{var n=ze(),i=_(n);m(i);var o=p(i,2);d(o,21,()=>h(V),e=>e.href,(e,n)=>{var i=Re();let o;var s=_(i);R(s,{get name(){return h(n).icon}});var c=p(s),u=p(c),d=e=>{var t=Le(),r=v(t,!0);a((e,n)=>{C(t,`title`,e),E(r,n)},[()=>q(h(n).href),()=>K(h(n).href)]),l(e,t)},f=T(()=>K(h(n).href)>0);t(u,e=>{h(f)&&e(d)}),S(i),a((e,t)=>{o=r(i,1,`navitem`,null,o,{active:e}),C(i,`href`,h(n).href),C(i,`aria-current`,t),E(c,` ${h(n).label??``} `)},[()=>W(h(n).href),()=>W(h(n).href)?`page`:void 0]),l(e,i)}),S(o);var s=p(o,2),c=_(s);ee(c),S(s),S(n),l(e,n)};t(ft,e=>{h(G)&&e(pt)});var mt=p(ft,2),ht=_(mt);let gt;var _t=_(ht);m(_t);var vt=p(_t,4),yt=e=>{ge(e,{icon:`shield`,kind:`ok`,title:`Your data is encrypted at rest and never leaves this machine`,children:(e,t)=>{b();var n=c(`Encrypted · On-device`);l(e,n)},$$slots:{default:!0}})};t(vt,e=>{h(G)&&!h(B)&&e(yt)});var bt=p(vt,2);Ce(bt,{});var xt=p(bt,2),St=e=>{var t=Be(),n=_(t);R(n,{name:`help`}),b(),S(t),l(e,t)};t(xt,e=>{h(G)||e(St)}),S(ht);var Ct=p(ht,2);let wt;var Tt=_(Ct),Et=e=>{var n=We(),r=_(n),i=e=>{var t=Ve(),n=v(t);a(e=>E(n,`Installing SmartBrain ${e??``}. It restarts in a moment and this page will come back on its own.`),[()=>H(h(X))]),l(e,t)},o=e=>{var t=He(),n=p(g(t),2);j(`click`,n,()=>{x(Q,!1),x(X,``)}),l(e,t)},s=e=>{var t=Ue(),n=g(t),r=p(_(n)),i=v(r,!0);b(),S(n);var o=p(n,2),s=p(o,2);a(e=>E(i,e),[()=>H(h(X))]),j(`click`,o,tt),j(`click`,s,()=>{localStorage.setItem(`update-dismissed`,h(X)),x(X,``)}),l(e,t)};t(r,e=>{h(Z)?e(i):h(Q)?e(o,1):e(s,-1)}),S(n),l(e,n)};t(Tt,e=>{h(X)&&!h(D)&&e(Et)});var Dt=p(Tt,2),Ot=e=>{var t=Ge(),n=_(t),r=p(_(n)),i=v(r,!0);b(),S(n);var o=p(n,2),s=p(o,2);S(t),a(()=>E(i,h(D))),j(`click`,o,()=>location.reload()),j(`click`,s,()=>{x(D,``)}),l(e,t)};t(Dt,e=>{h(D)&&e(Ot)});var kt=p(Dt,2),At=e=>{var t=Ke(),n=p(_(t),6);S(t),j(`click`,n,()=>{x(O,!1),sessionStorage.setItem(`launcher-nudge-dismissed`,`1`)}),l(e,t)};t(kt,e=>{h(O)&&e(At)});var jt=p(kt,2),Mt=e=>{Oe(e,{})},Nt=e=>{var t=qe(),n=p(_(t),2),r=v(n,!0),i=p(n,2),o=v(i);b(2),S(t),a(()=>E(r,P.detail||`The remote connection couldn't be established.`)),j(`click`,o,()=>window.location.reload()),l(e,t)},Pt=e=>{var t=Je(),n=p(_(t),2),r=v(n,!0),i=p(n,2),o=v(i);b(2),S(t),a(()=>E(r,L.error)),j(`click`,o,()=>L.load()),l(e,t)},Ft=e=>{var t=u(),n=g(t);i(n,()=>f.children),l(e,t)};t(jt,e=>{h(Ee)?e(Mt):h(De)?e(Nt,1):h(Te)?e(Pt,2):e(Ft,-1)}),S(Ct),S(mt),S(ut);var It=p(ut,2),Lt=e=>{var n=Qe(),i=g(n),o=_(i);d(o,17,()=>h(he),e=>e.href,(e,n)=>{var i=Xe();let o;var s=_(i),c=e=>{var t=Ye(),r=v(t,!0);a((e,n)=>{C(t,`title`,e),E(r,n)},[()=>q(h(n).href),()=>K(h(n).href)]),l(e,t)},u=T(()=>K(h(n).href)>0);t(s,e=>{h(u)&&e(c)});var d=p(s,2);R(d,{get name(){return h(n).icon},size:20});var f=p(d);S(i),a((e,t)=>{o=r(i,1,`tab`,null,o,{active:e}),C(i,`href`,h(n).href),C(i,`aria-current`,t),E(f,` ${h(n).label??``}`)},[()=>W(h(n).href),()=>W(h(n).href)?`page`:void 0]),l(e,i)});var s=p(o,2),c=_(s),u=e=>{var t=Ye(),n=v(t,!0);a(()=>{C(t,`title`,`${h(J)} waiting`),E(n,h(J))}),l(e,t)};t(c,e=>{h(J)>0&&e(u)});var f=p(c,2);R(f,{name:`more-horizontal`,size:20}),b(),S(s),S(i);var m=p(i,2),y=e=>{var n=Ze(),i=_(n);d(i,17,()=>h(_e),e=>e.href,(e,n)=>{var i=Re();let o;var s=_(i);R(s,{get name(){return h(n).icon}});var c=p(s),u=p(c),d=e=>{var t=Le(),r=v(t,!0);a((e,n)=>{C(t,`title`,e),E(r,n)},[()=>q(h(n).href),()=>K(h(n).href)]),l(e,t)},f=T(()=>K(h(n).href)>0);t(u,e=>{h(f)&&e(d)}),S(i),a(e=>{o=r(i,1,`navitem`,null,o,{active:e}),C(i,`href`,h(n).href),E(c,` ${h(n).label??``} `)},[()=>W(h(n).href)]),l(e,i)});var o=p(i,4);ee(o),S(n),l(e,n)};t(m,e=>{h(N)&&e(y)}),a(()=>C(s,`aria-expanded`,h(N))),j(`click`,s,()=>x(N,!h(N))),l(e,n)};t(It,e=>{h(G)&&e(Lt)});var Rt=p(It,2);ke(Rt,{}),Ae(p(Rt,2),{}),a(()=>{dt=r(ut,1,`shell`,null,dt,{"with-side":h(G)}),gt=r(ht,1,`topstrip`,null,gt,{"no-side":!h(G)}),wt=r(Ct,1,``,null,wt,{wrap:!h(fe),"wrap-wide":h(fe)})}),l(e,st),k()}m([`click`]);export{$ as component,_e as universal}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/nodes/1.CS-bGd13.js b/app/smartbrain_3000/web/_app/immutable/nodes/1.C7xJmJkE.js similarity index 63% rename from app/smartbrain_3000/web/_app/immutable/nodes/1.CS-bGd13.js rename to app/smartbrain_3000/web/_app/immutable/nodes/1.C7xJmJkE.js index 65135225..a53ad862 100644 --- a/app/smartbrain_3000/web/_app/immutable/nodes/1.CS-bGd13.js +++ b/app/smartbrain_3000/web/_app/immutable/nodes/1.C7xJmJkE.js @@ -1 +1 @@ -import{G as e,M as t,P as n,Q as r,X as i,Z as a,ct as o,j as s,st as c}from"../chunks/BJLLtWYH.js";import"../chunks/xihTtKlq.js";import{t as l}from"../chunks/CLNxzSSl.js";var u=n(`

`,1);function d(n,d){o(d,!0);var f=u(),p=i(f),m=a(p,!0),h=r(p,2),g=a(h,!0);e(()=>{s(m,l.status),s(g,l.error?.message)}),t(n,f),c()}export{d as component}; \ No newline at end of file +import{G as e,M as t,P as n,Q as r,X as i,Z as a,ct as o,j as s,st as c}from"../chunks/BChu7Pos.js";import"../chunks/xihTtKlq.js";import{t as l}from"../chunks/CJLE_wpt.js";var u=n(`

`,1);function d(n,d){o(d,!0);var f=u(),p=i(f),m=a(p,!0),h=r(p,2),g=a(h,!0);e(()=>{s(m,l.status),s(g,l.error?.message)}),t(n,f),c()}export{d as component}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/nodes/10.BoqtT515.js b/app/smartbrain_3000/web/_app/immutable/nodes/10.BoqtT515.js new file mode 100644 index 00000000..3c65fda9 --- /dev/null +++ b/app/smartbrain_3000/web/_app/immutable/nodes/10.BoqtT515.js @@ -0,0 +1,17 @@ +import{$ as e,A as t,B as n,C as r,E as i,F as a,G as o,I as s,J as c,K as l,L as u,M as d,N as f,O as p,P as m,Q as h,R as g,S as _,V as v,X as y,Y as b,Z as x,a as S,at as C,b as w,ct as T,d as E,dt as D,et as O,ft as k,g as A,h as j,it as M,j as N,k as P,l as ee,m as F,n as te,pt as I,r as L,st as ne,tt as R,u as re,w as z,y as ie,z as B}from"../chunks/BChu7Pos.js";import{t as ae}from"../chunks/Czex3Sq4.js";import"../chunks/xihTtKlq.js";import"../chunks/DETRq8nR.js";import{n as V}from"../chunks/BkiVJrb-.js";import{t as H}from"../chunks/DpD1lG2E.js";import{n as oe,t as se}from"../chunks/Be3BkmPa.js";import{t as ce}from"../chunks/aIySO2My.js";import{t as le}from"../chunks/DQSrham4.js";import{n as U}from"../chunks/CcVP_dcS.js";import{t as ue}from"../chunks/UDuC8ICI.js";import{t as de}from"../chunks/Bmlx8Ynu.js";import{t as W}from"../chunks/Di_L0eC6.js";import{t as fe}from"../chunks/itGxqfLQ.js";import{i as pe,r as me}from"../chunks/jV_dy7U_.js";var he=6e4,ge=60*he,G=24*ge;function _e(e,t=new Date){console.assert(e===null||typeof e==`string`,`relTime: ts is string|null`),console.assert(t instanceof Date,`relTime: now must be a Date`);let n=me(e);if(!n)return`—`;let r=t.getTime()-n.getTime();return r<0||r<45e3?`just now`:r2*i}function ye(e){if(console.assert(typeof e.state==`string`,`cardState: state is string`),console.assert(typeof e.enabled==`boolean`,`cardState: enabled is boolean`),e.flow||e.state===`draft`)return`designing`;if(!e.enabled||e.state===`paused`)return`paused`;if(e.state===`broken`)return`broken`;if(e.state===`commissioning`){let t=e.awaiting_yes!=null||e.payload_slot!==`preview`;return e.payload!==null&&t?`verifying`:`empty`}return e.payload===null?`empty`:e.state===`failing`||e.state===`degraded`?`failing`:ve(e.payload_at,e.interval_minutes)?`stale`:`fresh`}function be(e){console.assert(typeof e.interval_minutes==`number`,`footerText: interval is number`),console.assert(e.payload_at===null||typeof e.payload_at==`string`,`footerText: payload_at shape`);let t=me(e.payload_at);return[t?`as of ${new Intl.DateTimeFormat(void 0,{timeStyle:`short`}).format(t)}`:`as of —`,e.awaiting_yes?.host??``,`every ${Math.max(1,e.interval_minutes)}m`].filter(e=>e.length>0).join(` · `)}function xe(e){console.assert(typeof e.id==`string`,`interpretationOf: a board row`);let t=e.interpretation,n=typeof t==`string`&&t.trim().length>0?t:``;return console.assert(n===``||n===t,`interpretationOf: verbatim or empty`),n}function Se(e,t){console.assert(e===void 0||typeof e==`string`,`cardSpan: size is a string or undefined`),console.assert(t==null||typeof t==`object`,`cardSpan: clir is an object or null`);let n=t&&typeof t==`object`?t.span:void 0,r=typeof n==`string`?/^[dp]([1-4])x([1-3])$/.exec(n):null;if(r)return{cols:Number(r[1])>=2?2:1,rows:Number(r[2])};switch(e){case`wide`:return{cols:2,rows:1};case`large`:return{cols:2,rows:2};case`tall`:return{cols:1,rows:2};default:return{cols:1,rows:1}}}function Ce(e,t){return console.assert(typeof e.state==`string`,`bodyShowsPanel: state is string`),console.assert(typeof t==`boolean`,`bodyShowsPanel: hasForm is boolean`),!t||e.flow||e.awaiting_yes&&e.payload||e.state!==`commissioning`||e.c2_ok?!1:e.payload!==null&&e.payload_slot!==`preview`}function we(e,t,n=``){return console.assert(typeof t==`boolean`,`formBoxChrome: hasForm is boolean`),console.assert(typeof e==`string`,`formBoxChrome: state is string`),t&&n===``&&(e===`fresh`||e===`stale`||e===`paused`)}var Te=m(``),Ee=m(` `),De=m(` `),K=m(``),Oe=m(`

`),ke=m(`

`),Ae=m(` `),je=m(` `),Me=m(` `,1),Ne=m(``),Pe=m(` `),Fe=m(`
`);function Ie(e,n){T(n,!0);let a=S(n,`cols`,3,1),s=S(n,`rows`,3,1),c=S(n,`preview`,3,!1),l=S(n,`footerText`,3,``),p=S(n,`interpretation`,3,``),m=S(n,`reason`,3,``),g=S(n,`rendered`,3,!1),_=S(n,`notice`,3,``),C=S(n,`fit`,3,null),w=M(()=>we(n.state,n.hasForm,_())),E=M(()=>C()?C().detail?`${C().chip}. ${C().detail}`:C().chip:``),O=M(()=>C()?C().detail?`${C().chip} · ${C().detail}`:C().chip:``);var j=Fe();let P;var ee=b(j);let F;var te=b(ee),L=e=>{var t=Te();d(e,t)},R=e=>{var t=Ee(),r=x(t,!0);o(()=>N(r,n.title)),d(e,t)};t(te,e=>{n.hasForm?e(L):e(R,-1)});var re=h(te,2),z=b(re),ie=e=>{var t=K(),n=b(t);ue(n,{kind:`warn`,get title(){return v(E)},children:(e,t)=>{var n=De(),r=x(n,!0);o(()=>N(r,C().chip)),d(e,n)},$$slots:{default:!0}}),k(t),d(e,t)};t(z,e=>{C()&&!v(w)&&e(ie)});var B=h(z,2);i(B,()=>n.chips??I);var ae=h(B,2),V=e=>{ue(e,{title:`This card reads its page in SmartBrain's own local page browser`,children:(e,t)=>{D();var n=u(`page browser`);d(e,n)},$$slots:{default:!0}})};t(ae,e=>{g()&&e(V)}),k(re),k(ee);var H=h(ee,2);let oe;var se=b(H);i(se,()=>n.children??I),k(H);var ce=h(H,2),le=e=>{var t=Oe(),n=x(t,!0);o(()=>N(n,_())),d(e,t)},U=e=>{var t=ke(),n=x(t,!0);o(()=>N(n,m())),d(e,t)};t(ce,e=>{_()?e(le):n.state===`failing`&&m()&&e(U,1)});var de=h(ce,2);i(de,()=>n.below??I);var W=h(de,2);let fe;var pe=b(W),me=e=>{var n=f(),r=y(n),i=e=>{var t=Ae(),n=b(t),r=x(n,!0),i=h(n,2),a=x(i);k(t),o(()=>{A(n,`title`,p()),N(r,p()),N(a,`· ${l()??``}`)}),d(e,t)},a=e=>{var t=je(),n=x(t,!0);o(()=>N(n,l())),d(e,t)};t(r,e=>{p()?e(i):e(a,-1)}),d(e,n)};t(pe,e=>{!n.hasForm&&l()&&e(me)});var he=h(pe,2),ge=e=>{var t=Ne(),n=b(t);ue(n,{kind:`warn`,get title(){return v(E)},children:(e,t)=>{var n=Me(),r=y(n),i=x(r,!0),a=h(r,2),s=x(a,!0);o(()=>{N(i,C().chip),N(s,v(O))}),d(e,n)},$$slots:{default:!0}}),k(t),d(e,t)};t(he,e=>{C()&&v(w)&&e(ge)});var G=h(he,2);i(G,()=>n.actions??I);var _e=h(G,2),ve=e=>{var t=Pe(),n=x(t,!0);o(()=>N(n,C().detail)),d(e,t)};t(_e,e=>{C()?.detail&&!v(w)&&e(ve)}),k(W),k(j),o(()=>{P=r(j,1,`card ni-card svelte-hyum9g`,null,P,{"cols-2":a()>=2,"rows-2":s()===2,"rows-3":s()>=3,form:v(w),preview:c()}),A(j,`data-state`,n.state),F=r(ee,1,`ni-head svelte-hyum9g`,null,F,{"has-fit":!!C()&&!v(w)}),oe=r(H,1,`ni-body svelte-hyum9g`,null,oe,{"ni-body-dim":n.state===`failing`}),fe=r(W,1,`ni-foot svelte-hyum9g`,null,fe,{"has-fit-line":!!C()?.detail&&!v(w),"has-fit-strip":!!C()&&v(w)})}),d(e,j),ne()}var Le=m(`
  • `),Re=m(`

    `),ze=m(`

    This page gets its data from a feed

      `);function Be(e,n){T(n,!0);let r=S(n,`busy`,3,!1),i=S(n,`error`,3,``);var a=ze(),s=h(b(a),2);p(s,21,()=>n.candidates,e=>e.url,(e,t)=>{var i=Le(),a=b(i),s=x(a,!0),c=h(a,2);k(i),o(()=>{A(a,`title`,v(t).url),N(s,v(t).url),c.disabled=r()}),B(`click`,c,()=>n.onSwitch(v(t).url)),d(e,i)}),k(s);var c=h(s,2),l=e=>{var t=Re(),n=x(t,!0);o(()=>N(n,i())),d(e,t)};t(c,e=>{i()&&e(l)}),k(a),d(e,a),ne()}g([`click`]);var Ve=new Set(`accent.accent-tint.badge-line.bg.border.border-strong.danger.elevated.faint.map-land.map-stroke.muted.ok.panel.row-hi.text.viz-axis.viz-band.viz-cat-1.viz-cat-2.viz-cat-3.viz-cat-4.viz-cat-5.viz-cat-6.viz-cat-other.viz-div-mid.viz-div-neg.viz-div-pos.viz-dot-ring.viz-fill.viz-grid.viz-interp.viz-line.viz-neg.viz-now.viz-now-line.viz-pos.viz-seq-1.viz-seq-2.viz-seq-3.viz-seq-4.viz-seq-5.viz-track.warn`.split(`.`));function He(e){return console.assert(Ve.size>0,`isTokenName: token set loaded`),typeof e==`string`&&Ve.has(e)}var Ue={hero:{px:31,wt:600,lh:38,tnum:!0,ladder:[31,28,24,20]},headline:{px:25,wt:600,lh:32,tnum:!0,ladder:[25,22,20,18]},display:{px:20,wt:600,lh:26,tnum:!0,ladder:[20,18,16]},name:{px:16,wt:600,lh:22,tnum:!1},row:{px:16,wt:400,lh:22,tnum:!0},"row-strong":{px:16,wt:600,lh:22,tnum:!0},title:{px:14,wt:600,lh:18,tnum:!1,max_lines:2},body:{px:14,wt:400,lh:19,tnum:!1},item:{px:14,wt:500,lh:19,tnum:!1},sub:{px:14,wt:400,lh:19,tnum:!0},delta:{px:14,wt:500,lh:19,tnum:!0},index:{px:14,wt:500,lh:19,tnum:!0},meta:{px:12,wt:400,lh:16,tnum:!0},badge:{px:12,wt:600,lh:16,tnum:!1},footer:{px:12,wt:400,lh:16,tnum:!0},label:{px:11,wt:500,lh:14,tnum:!0},tick:{px:11,wt:400,lh:14,tnum:!0}},We={line_w:2,interp_w:1.5,grid_w:1,now_w:1,dot_r:4,dot_ring:2,now_dot_r:4.5,now_dot_ring:2,track_h:4,ref_tick_h:14,ref_tick_w:1.5,label_offset:7,plot_min_share:.45,amplitude_min:{desktop:48,phone:36},past_alpha:.45,bar_gap:2,bar_end_r:4},Ge=.96875,Ke=class extends Error{code;constructor(e,t){super(t),this.code=e,this.name=`ClirError`}},qe=new Set([`stat`,`conditions`,`kv_grid`,`compare`,`bars`,`series_line`,`heatmap`,`event_curve`,`next_event`,`agenda`,`day_table`,`entity_list`,`ranked_list`,`table`,`text_brief`,`image`,`progress`,`map_lite`]),Je=new Set(Object.keys(Ue)),Ye=new Set([`data`,`lexicon`,`ask`,`title`,`key`,`code`]),Xe=new Set([`h:mm a`,`h a`,`ha_short`,`EEE`,`EEE d`,`MMM d`,`EEE MMM d`,`yyyy`,`MMM yyyy`,`MMM d, yyyy`,`MMM d, h:mm a`,`HH:mm`]),Ze=new Set([`sun`,`moon`,`cloud`,`cloud_sun`,`cloud_moon`,`rain`,`drizzle`,`snow`,`storm`,`fog`,`wind`,`alert`,`check`,`cross`,`clock`,`link_out`,`lock`,`unlock`,`pin`,`up`,`down`]),Qe=new Set([`text`,`time`,`rect`,`line`,`tri`,`dot`,`path`,`cells`,`image`,`basemap`,`icon`]),$e=new Set([`start`,`middle`,`end`]),et=new Set([`up`,`down`,`left`,`right`]);function q(e,t){throw new Ke(e,t)}function J(e,t,n=-1/0){return console.assert(typeof t==`string`,`requireNumber: where is string`),console.assert(typeof n==`number`,`requireNumber: min is number`),(typeof e!=`number`||!Number.isFinite(e)||e= ${n}, got ${String(e)}`),e}function tt(e){if(!Array.isArray(e)||e.length<2)return!1;let t=e[0];return t===`l`||t===`r`||t===`c`||t===`f`?e.length===2&&typeof e[1]==`number`&&Number.isFinite(e[1]):t===`m`&&e.length===4&&tt(e[1])&&tt(e[2])&&typeof e[3]==`number`&&Number.isFinite(e[3])}function Y(e,t){return console.assert(typeof t==`string`,`requireAnchor: where is string`),console.assert(t.length>0,`requireAnchor: where non-empty`),tt(e)||q(`bad_anchor`,`${t}: not a valid X anchor`),e}function X(e,t){return console.assert(typeof t==`string`,`requireTok: where is string`),console.assert(t.length>0,`requireTok: where non-empty`),He(e)||q(`bad_token`,`${t}: unknown token ${String(e)}`),e}function nt(e,t){return e==null?null:X(e,t)}function Z(e,t,n){return console.assert(typeof n==`string`,`requireEnum: where is string`),console.assert(t.size>0,`requireEnum: allowed non-empty`),(typeof e!=`string`||!t.has(e))&&q(`bad_enum`,`${n}: value ${String(e)} not allowed`),e}function rt(e,t){let n=Z(e.role,Je,`${t}.role`),r=J(e.px,`${t}.px`,11),i=Z(e.anchor??`start`,$e,`${t}.anchor`),a=Z(e.src??`data`,Ye,`${t}.src`),o=e.dir===`rtl`?`rtl`:`ltr`,s=Array.isArray(e.lines)?e.lines.map(String):[];return{k:`text`,id:J(e.id,`${t}.id`),x:Y(e.x,`${t}.x`),y:J(e.y,`${t}.y`),max_w:J(e.max_w,`${t}.max_w`,0),lines:s,role:n,px:r,tok:X(e.tok,`${t}.tok`),anchor:i,dir:o,src:a}}function it(e,t){let n=Z(e.role,Je,`${t}.role`),r=J(e.px,`${t}.px`,11),i=Z(e.anchor??`start`,$e,`${t}.anchor`),a=Z(e.fmt,Xe,`${t}.fmt`),o=e.tz===`viewer`?`viewer`:`card`;return{k:`time`,id:J(e.id,`${t}.id`),x:Y(e.x,`${t}.x`),y:J(e.y,`${t}.y`),max_w:J(e.max_w,`${t}.max_w`,0),t:String(e.t),fmt:a,tz:o,zone:String(e.zone),role:n,px:r,tok:X(e.tok,`${t}.tok`),anchor:i,show_zone:!!e.show_zone}}function at(e,t){return{k:`rect`,id:J(e.id,`${t}.id`),x0:Y(e.x0,`${t}.x0`),x1:Y(e.x1,`${t}.x1`),y0:J(e.y0,`${t}.y0`),y1:J(e.y1,`${t}.y1`),tok:X(e.tok,`${t}.tok`),r:typeof e.r==`number`?e.r:0,stroke:nt(e.stroke??null,`${t}.stroke`)}}function ot(e,t){return{k:`line`,id:J(e.id,`${t}.id`),x0:Y(e.x0,`${t}.x0`),y0:J(e.y0,`${t}.y0`),x1:Y(e.x1,`${t}.x1`),y1:J(e.y1,`${t}.y1`),tok:X(e.tok,`${t}.tok`),w:typeof e.w==`number`?e.w:1,dash:Array.isArray(e.dash)?e.dash.map(e=>Number(e)):null,gaps:Array.isArray(e.gaps)?e.gaps.map(e=>Number(e)):void 0}}function st(e,t){return{k:`tri`,id:J(e.id,`${t}.id`),x:Y(e.x,`${t}.x`),y:J(e.y,`${t}.y`),size:J(e.size,`${t}.size`,0),dir:Z(e.dir,et,`${t}.dir`),tok:X(e.tok,`${t}.tok`)}}function ct(e,t){return{k:`dot`,id:J(e.id,`${t}.id`),x:Y(e.x,`${t}.x`),y:J(e.y,`${t}.y`),r:J(e.r,`${t}.r`,0),tok:X(e.tok,`${t}.tok`),ring:nt(e.ring??null,`${t}.ring`),ring_w:typeof e.ring_w==`number`?e.ring_w:0}}function lt(e,t){(!e||typeof e!=`object`)&&q(`bad_box`,`${t}: missing`);let n=e;return{x0:Y(n.x0,`${t}.x0`),x1:Y(n.x1,`${t}.x1`),y0:J(n.y0,`${t}.y0`),y1:J(n.y1,`${t}.y1`)}}function ut(e,t){let n=Array.isArray(e.pts)?e.pts:[];n.length>400&&q(`too_many_points`,`${t}.pts > 400`);let r=Z(e.style??`solid`,new Set([`solid`,`interp`]),`${t}.style`);return{k:`path`,id:J(e.id,`${t}.id`),box:lt(e.box,`${t}.box`),pts:n.map(e=>((!Array.isArray(e)||e.length!==2)&&q(`bad_point`,`${t}.pts`),[Number(e[0]),Number(e[1])])),tok:X(e.tok,`${t}.tok`),w:typeof e.w==`number`?e.w:2,style:r,fill:nt(e.fill??null,`${t}.fill`)}}function dt(e,t){let n=Z(e.ramp??`seq`,new Set([`seq`,`div`]),`${t}.ramp`);return{k:`cells`,id:J(e.id,`${t}.id`),box:lt(e.box,`${t}.box`),cols:J(e.cols,`${t}.cols`,1),rows:J(e.rows,`${t}.rows`,1),v:Array.isArray(e.v)?e.v.map(e=>e==null?-1:Number(e)):[],ramp:n,steps:typeof e.steps==`number`?e.steps:5,gap:typeof e.gap==`number`?e.gap:1}}function ft(e,t){let n=Z(e.fit??`contain`,new Set([`cover`,`contain`]),`${t}.fit`),r=Array.isArray(e.crop)&&e.crop.length===4?[Number(e.crop[0]),Number(e.crop[1]),Number(e.crop[2]),Number(e.crop[3])]:null;return{k:`image`,id:J(e.id,`${t}.id`),box:lt(e.box,`${t}.box`),ref:String(e.ref??``),fit:n,crop:r}}function pt(e,t){let n=Array.isArray(e.bbox)&&e.bbox.length===4?[Number(e.bbox[0]),Number(e.bbox[1]),Number(e.bbox[2]),Number(e.bbox[3])]:[0,0,0,0];return{k:`basemap`,id:J(e.id,`${t}.id`),box:lt(e.box,`${t}.box`),asset:String(e.asset??`world110m`),bbox:n,land:X(e.land??`map-land`,`${t}.land`),stroke:X(e.stroke??`map-stroke`,`${t}.stroke`)}}function mt(e,t){return{k:`icon`,id:J(e.id,`${t}.id`),x:Y(e.x,`${t}.x`),y:J(e.y,`${t}.y`),size:J(e.size,`${t}.size`,0),name:Z(e.name,Ze,`${t}.name`),tok:X(e.tok,`${t}.tok`)}}var ht={text:rt,time:it,rect:at,line:ot,tri:st,dot:ct,path:ut,cells:dt,image:ft,basemap:pt,icon:mt};function gt(e,t){(!e||typeof e!=`object`)&&q(`bad_prim`,`${t}: not an object`);let n=e,r=n.k;return(typeof r!=`string`||!Qe.has(r))&&q(`bad_prim_kind`,`${t}.k: unknown kind ${String(r)}`),ht[r](n,t)}function Q(e){(!e||typeof e!=`object`)&&q(`bad_clir`,`clir: not an object`);let t=e;t.v!==1&&q(`bad_version`,`clir.v must be 1`);let n=Z(t.form,qe,`clir.form`),r=Array.isArray(t.prims)?t.prims:[];r.length>2e3&&q(`too_many_prims`,`clir.prims > 2000`);let i=new Set,a=[];r.forEach((e,t)=>{let n=gt(e,`clir.prims[${t}]`);i.has(n.id)&&q(`dup_prim_id`,`clir.prims[${t}]: dup id ${n.id}`),i.add(n.id),a.push(n)}),(typeof t.summary!=`string`||!t.summary)&&q(`bad_summary`,`clir.summary missing`);let o=t.bucket&&typeof t.bucket==`object`?t.bucket:{};return{v:1,form:n,variant:String(t.variant??``),cand:String(t.cand??``),plan:String(t.plan??``),span:String(t.span??``),bucket:{min_w:Number(o.min_w??0),max_w:Number(o.max_w??0),h:Number(o.h??0)},state:String(t.state??`ok`),prims:a,reading_order:Array.isArray(t.reading_order)?t.reading_order.map(Number):[],summary:t.summary,live:Array.isArray(t.live)?t.live.map(e=>({k:String(e.k??``),args:e.args??{}})):[],hitmap:Array.isArray(t.hitmap)?t.hitmap.map(e=>({prim:Number(e.prim??-1),label:String(e.label??``)})):[],dropped:Array.isArray(t.dropped)?t.dropped.map(String):[],ladder:Array.isArray(t.ladder)?t.ladder.map(String):[]}}function _t(e,t,n){if(console.assert(typeof t==`number`,`resolveX: left is number`),console.assert(typeof n==`number`,`resolveX: width is number`),e[0]===`l`)return t+e[1];if(e[0]===`r`)return t+n-e[1];if(e[0]===`c`)return t+n/2+e[1];if(e[0]===`f`)return t+e[1]*n;let r=_t(e[1],t,n);return r+(_t(e[2],t,n)-r)*e[3]}function vt(e,t,n){console.assert(Number.isFinite(n),`lerpAnchor: frac finite`),console.assert(Array.isArray(e)&&Array.isArray(t),`lerpAnchor: anchors arrays`);let r=e=>e===`l`||e===`r`||e===`c`||e===`f`;if(r(e[0])&&r(t[0])&&e[0]===t[0]&&e[0]!==`r`){let r=e[1],i=t[1];return[e[0],r+(i-r)*n]}if(e[0]===`r`&&t[0]===`r`){let r=e[1];return[`r`,r+(t[1]-r)*n]}return e[0]===`l`&&t[0]===`r`&&e[1]===0&&t[1]===0?[`f`,n]:[`m`,e,t,n]}function yt(e){if(console.assert(typeof e==`string`,`parseT: t is string`),console.assert(e.length>0,`parseT: t non-empty`),e.length===10){let[t,n,r]=e.split(`-`).map(Number);return{date:!0,y:t,m:n-1,d:r}}return Date.parse(e)}function bt(e){return typeof e==`number`?e:Date.UTC(e.y,e.m,e.d)}var xt=e=>new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour:`numeric`,minute:`2-digit`,second:`2-digit`,weekday:`short`,month:`short`,day:`numeric`,year:`numeric`,hour12:!1,hourCycle:`h23`});function St(e,t){let n=xt(t).formatToParts(new Date(e)),r={};for(let e of n)e.type!==`literal`&&(r[e.type]=e.value);return r}function Ct(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,timeZoneName:`short`,year:`numeric`}).formatToParts(new Date(e)).find(e=>e.type===`timeZoneName`)?.value??``;return n.startsWith(`GMT`)||n.startsWith(`UTC`)?n.replace(`GMT`,`UTC`).replace(`UTC+0`,`UTC`).replace(`UTC-0`,`UTC`):n}function wt(e,t,n,r){let i=yt(e),a=typeof i!=`number`,o=bt(i),s=St(o,a?`UTC`:n),c=Number(s.hour),l=c%12||12,u=c<12?`am`:`pm`,d=s.minute,f=c.toString().padStart(2,`0`),p=Number(s.day),m={"h:mm a":`${l}:${d} ${u}`,"h a":`${l} ${u}`,ha_short:`${l}${u[0]}`,EEE:s.weekday,"EEE d":`${s.weekday} ${p}`,"MMM d":`${s.month} ${p}`,"EEE MMM d":`${s.weekday} ${s.month} ${p}`,yyyy:s.year,"MMM yyyy":`${s.month} ${s.year}`,"MMM d, yyyy":`${s.month} ${p}, ${s.year}`,"MMM d, h:mm a":`${s.month} ${p}, ${l}:${d} ${u}`,"HH:mm":`${f}:${d}`}[t];if(m===void 0)throw new Ke(`bad_fmt`,`formatTime: unknown fmt ${t}`);return r&&!a?`${m} ${Ct(o,n)}`:m}function Tt(e,t){console.assert(typeof t==`string`,`timePrimText: viewerTz is string`),console.assert(e.k===`time`,`timePrimText: prim is time`);let n=e.tz===`card`?e.zone:t,r=e.show_zone&&n!==t;return wt(e.t,e.fmt,n,r)}function Et(e,t=`in_hm`){console.assert(Number.isFinite(e),`countdownText: seconds finite`),console.assert(typeof t==`string`,`countdownText: fmt is string`);let n=Math.trunc(e);if(n<=0)return`now`;let r=Math.floor((n+59)/60),i=Math.floor(r/1440),a=r%1440,o=Math.floor(a/60),s=a%60;if(t===`rel`||t===`in_dhm`&&i>=2){if(i>=2)return`in ${i} days`;if(i===1)return o===0?`in 1 day`:`in 1 d ${o} h`}o+=i*24;let c=o&&s?`${o} h ${s} m`:o?`${o} h`:`${s} min`;return t===`hm`?c:`in ${c}`}function Dt(e,t=`auto`){console.assert(Number.isFinite(e),`countUpText: seconds finite`),console.assert(typeof t==`string`,`countUpText: unit is string`);let n=Math.max(0,Math.trunc(e)),r=t===`auto`?n>=172800?`day`:n>=7200?`hour`:`minute`:t,i=Math.floor(n/{day:86400,hour:3600,minute:60}[r]),a={day:`day`,hour:`hour`,minute:`minute`}[r];return`${i.toLocaleString(`en-US`)} ${a}${i===1?``:`s`}`}function Ot(e){console.assert(Number.isFinite(e),`ageText: seconds finite`),console.assert(typeof e==`number`,`ageText: seconds number`);let t=Math.max(0,Math.trunc(e));return t<3600?`${Math.max(1,Math.floor(t/60))} min old`:t<172800?`${Math.floor(t/3600)} h old`:`${Math.floor(t/86400)} d old`}var kt=/^(,?)(?:\.(\d)([f%])|(d))$/;function At(e,t){console.assert(Number.isFinite(e),`numberText: v finite`),console.assert(typeof t==`string`,`numberText: fmt is string`);let n=kt.exec(t)??[null,`,`,`0`,`f`],r=n[1]===`,`,i=n[3]===`%`,a=n[4]===`d`||n[2]===void 0?0:Number(n[2]),o=(i?e*100:e).toLocaleString(`en-US`,{useGrouping:r,minimumFractionDigits:a,maximumFractionDigits:a});return i?`${o}%`:o}function jt(e,t){console.assert(Array.isArray(e),`activeVariant: variants array`),console.assert(Number.isFinite(t),`activeVariant: now finite`);let n=-1;for(let r=0;r=i)&&(a===null||t=i)&&(n=r)}return n<0?0:n}function Mt(e,t){let n=e.pts;if(!n.length)return null;let r=e.box,i=n[0][1];if(t>=n[n.length-1][0])i=n[n.length-1][1];else if(t>n[0][0])for(let e=1;e=r&&t<=o){i=o===r?a:a+(s-a)*(t-r)/(o-r);break}}return r.y0+i*(r.y1-r.y0)}function Nt(e,t){console.assert(Number.isFinite(t),`applyLive: now finite`),console.assert(e.v===1,`applyLive: clir v=1`);let n=structuredClone(e),r=new Map(n.prims.map(e=>[e.id,e])),i=new Set;for(let e of n.live)Pt(e,r,i,t);return n.prims=n.prims.filter(e=>!i.has(e.id)),n.reading_order=n.reading_order.filter(e=>!i.has(e)),n.live=[],n}function Pt(e,t,n,r){console.assert(typeof e.k==`string`,`runBinding: k is string`),console.assert(t instanceof Map,`runBinding: by is Map`);let i=e.args;if(e.k===`now_marker`)return Ft(i,t,n,r);if(e.k===`countdown`)return It(i,t,r);if(e.k===`count_up`)return Lt(i,t,r);if(e.k===`age`)return Rt(i,t,r);if(e.k===`extrapolate`)return zt(i,t,r);if(e.k===`timed_variants`)return Bt(i,n,r);if(e.k===`past_dim`)return Vt(i,t,r)}function Ft(e,t,n,r){let i=e.box,a=bt(yt(e.t0)),o=bt(yt(e.t1))-a,s=o>0?(r-a)/o:-1,c=e.prims??[];if(!(s>=0&&s<=1)){for(let e of c)n.add(e);return}let l=vt(i.x0,i.x1,s),u=typeof e.path==`number`?t.get(e.path):void 0,d=u&&u.k===`path`?Mt(u,s):null;for(let n of c){let r=t.get(n);r&&(r.k===`line`?(r.x0=l,r.x1=l,Array.isArray(e.gaps)&&(r.gaps=e.gaps)):r.k===`dot`||r.k===`tri`||r.k===`icon`?(r.x=l,d!==null&&r.k===`dot`&&(r.y=d)):(r.k===`text`||r.k===`time`)&&(r.x=l))}}function It(e,t,n){let r=t.get(e.prim);!r||r.k!==`text`&&r.k!==`time`||(r.lines=[Et((bt(yt(e.t))-n)/1e3,e.fmt||`in_hm`)])}function Lt(e,t,n){let r=t.get(e.prim);if(!r||r.k!==`text`&&r.k!==`time`)return;let i=bt(yt(e.t0)),a=e.unit||`auto`;r.lines=[Dt((n-i)/1e3,a)]}function Rt(e,t,n){let r=t.get(e.prim);!r||r.k!==`text`&&r.k!==`time`||(r.lines=[Ot((n-bt(yt(e.t)))/1e3)])}function zt(e,t,n){let r=t.get(e.prim);if(!r||r.k!==`text`&&r.k!==`time`)return;let i=bt(yt(e.t0));r.lines=[At(e.v0+e.rate_per_s*(n-i)/1e3,e.fmt||`,.0f`)]}function Bt(e,t,n){let r=e.variants??[];if(!r.length)return;let i=jt(r,n);for(let e=0;ee[0]-t[0]);let c=[[a,o]];for(let[e,t]of s){let n=[];for(let[r,i]of c)t<=r||e>=i?n.push([r,i]):(e>r&&n.push([r,e]),tt-e>1)}function Kt(e,t){console.assert(t.width>0,`renderModel: width > 0`),console.assert(Number.isFinite(t.now),`renderModel: now finite`);let n=Nt(e,t.now),r=new Map(n.prims.map(e=>[e.id,e])),i=[];for(let e of n.prims)if(e.k===`text`)i.push(Ut(e,t.width));else if(e.k===`time`){let n=e.lines??[Tt(e,t.viewerTz)],r={...e,lines:n};i.push(Ut(r,t.width))}else i.push({kind:`svg`,id:e.id,prim:e});for(let e of n.prims)e.k===`line`&&e.gaps&&e.gaps.length&&(e._segs=Gt(e,r,t.width));return{width:t.width,height:e.bucket.h,summary:n.summary,readingOrder:n.reading_order,hitmap:n.hitmap,ops:i}}var qt=`/ni/world110m.json`,Jt=null;function Yt(){if(console.assert(qt.startsWith(`/`),`loadWorld: same-origin asset`),console.assert(typeof fetch==`function`,`loadWorld: fetch available`),Jt)return Jt;let e=Xt().then(e=>(e.length===0&&(Jt=null),e));return Jt=e,e}async function Xt(){console.assert(qt.endsWith(`.json`),`fetchWorld: json asset`);try{let e=await fetch(qt);return console.assert(typeof e.ok==`boolean`,`fetchWorld: a response`),e.ok?Zt(await e.json()):[]}catch{return[]}}function Zt(e){console.assert(e!==void 0,`parseWorld: payload present`);let t=typeof e==`object`&&e&&`polys`in e?e.polys:null;if(!Array.isArray(t))return[];let n=t,r=[];for(let e of n){let t=Qt(e);if(t===null)return[];r.push(t)}return console.assert(r.length===n.length,`parseWorld: every ring kept`),r}function Qt(e){if(console.assert(e!==void 0,`ringPoints: ring present`),!Array.isArray(e)||e.length===0)return null;let t=e,n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2)return null;let t=e[0],r=e[1];if(typeof t!=`number`||typeof r!=`number`||!Number.isFinite(t)||!Number.isFinite(r))return null;n.push([t,r])}return console.assert(n.length===t.length,`ringPoints: every point kept`),n}function $t(e,t,n){console.assert(e.k===`basemap`,`mapPaths: basemap prim`),console.assert(t>=0,`mapPaths: width non-negative`);let r=e.box,i=_t(r.x0,0,t),a=_t(r.x1,0,t),[o,s,c,l]=e.bbox;if(!(c>o)||!(l>s))return[];let u=a-i,d=r.y1-r.y0,f=[];for(let e of n){if(en(e,o,s,c,l))continue;let t=e.map(([e,t])=>`${tn(i+(e-o)/(c-o)*u)},${tn(r.y0+(l-t)/(l-s)*d)}`);f.push(`M${t.join(` L`)}Z`)}return f}function en(e,t,n,r,i){console.assert(e.length>0,`missesBbox: non-empty ring`),console.assert(r>t&&i>n,`missesBbox: ordered bbox`);let a=1/0,o=-1/0,s=1/0,c=-1/0;for(let[t,n]of e)to&&(o=t),nc&&(c=n);return or||ci}function tn(e){console.assert(typeof e==`number`,`fmt: number`),console.assert(Number.isFinite(e),`fmt: finite number`);let t=e.toFixed(2).replace(/\.?0+$/,``);return t===`-0`||t===``?`0`:t}var nn={box:24,stroke:1.75,icons:{sun:[{t:`circle`,c:[12,12],r:4,fill:!1},{t:`poly`,pts:[[18.8,12],[21.2,12]],closed:!1,fill:!1},{t:`poly`,pts:[[16.808,16.808],[18.505,18.505]],closed:!1,fill:!1},{t:`poly`,pts:[[12,18.8],[12,21.2]],closed:!1,fill:!1},{t:`poly`,pts:[[7.192,16.808],[5.495,18.505]],closed:!1,fill:!1},{t:`poly`,pts:[[5.2,12],[2.8,12]],closed:!1,fill:!1},{t:`poly`,pts:[[7.192,7.192],[5.495,5.495]],closed:!1,fill:!1},{t:`poly`,pts:[[12,5.2],[12,2.8]],closed:!1,fill:!1},{t:`poly`,pts:[[16.808,7.192],[18.505,5.495]],closed:!1,fill:!1}],moon:[{t:`poly`,pts:[[4.122,13.389],[4.078,13.113],[4.044,12.836],[4.019,12.558],[4.005,12.279],[4,12],[4.005,11.721],[4.019,11.442],[4.044,11.164],[4.078,10.887],[4.122,10.611],[4.175,10.337],[4.238,10.065],[4.31,9.795],[4.392,9.528],[4.482,9.264],[4.583,9.003],[4.692,8.746],[4.81,8.493],[4.936,8.244],[5.072,8],[5.216,7.761],[5.368,7.526],[5.528,7.298],[5.696,7.075],[5.872,6.858],[6.055,6.647],[6.245,6.443],[6.443,6.245],[6.647,6.055],[6.858,5.872],[7.075,5.696],[7.298,5.528],[7.526,5.368],[7.761,5.216],[8,5.072],[8.244,4.936],[8.493,4.81],[8.746,4.692],[9.217,9.288],[9.204,9.044],[9.238,9.532],[9.2,8.8],[9.268,9.774],[9.204,8.556],[9.003,4.583],[9.306,10.016],[9.217,8.312],[9.238,8.068],[9.353,10.255],[9.268,7.826],[9.306,7.584],[9.408,10.493],[9.264,4.482],[9.353,7.345],[9.408,7.107],[9.471,10.729],[9.471,6.871],[9.528,4.392],[9.543,6.637],[9.543,10.963],[9.622,6.406],[9.71,6.178],[9.795,4.31],[9.805,5.953],[9.908,5.731],[9.622,11.194],[10.065,4.238],[10.019,5.514],[10.138,5.3],[10.337,4.175],[10.264,5.091],[9.71,11.422],[10.397,4.886],[10.537,4.686],[10.611,4.122],[10.684,4.49],[10.838,4.3],[10.887,4.078],[10.998,4.116],[9.805,11.647],[9.908,11.869],[10.019,12.086],[10.138,12.3],[10.264,12.509],[10.397,12.714],[10.537,12.914],[10.684,13.11],[10.838,13.3],[10.998,13.484],[11.165,13.663],[19.269,15.092],[19.047,15.195],[19.308,15.254],[11.337,13.835],[18.822,15.29],[18.594,15.378],[19.19,15.507],[18.363,15.457],[18.129,15.529],[19.064,15.756],[11.516,14.002],[17.893,15.592],[17.655,15.647],[18.928,16],[17.416,15.694],[17.174,15.732],[18.784,16.239],[11.7,14.162],[16.932,15.762],[16.688,15.783],[18.632,16.474],[16.444,15.796],[11.89,14.316],[16.2,15.8],[15.956,15.796],[18.472,16.702],[15.712,15.783],[12.086,14.463],[15.468,15.762],[18.304,16.925],[15.226,15.732],[12.286,14.603],[14.984,15.694],[14.745,15.647],[12.491,14.736],[14.507,15.592],[18.128,17.142],[14.271,15.529],[12.7,14.862],[14.037,15.457],[12.914,14.981],[13.806,15.378],[13.131,15.092],[13.578,15.29],[13.353,15.195],[17.945,17.353],[17.755,17.557],[17.557,17.755],[17.353,17.945],[17.142,18.128],[16.925,18.304],[16.702,18.472],[16.474,18.632],[16.239,18.784],[16,18.928],[15.756,19.064],[15.507,19.19],[15.254,19.308],[14.997,19.417],[14.736,19.518],[14.472,19.608],[14.205,19.69],[13.935,19.762],[13.663,19.825],[13.389,19.878],[13.113,19.922],[12.836,19.956],[12.558,19.981],[12.279,19.995],[12,20],[11.721,19.995],[11.442,19.981],[11.164,19.956],[10.887,19.922],[10.611,19.878],[10.337,19.825],[10.065,19.762],[9.795,19.69],[9.528,19.608],[9.264,19.518],[9.003,19.417],[8.746,19.308],[8.493,19.19],[8.244,19.064],[8,18.928],[7.761,18.784],[7.526,18.632],[7.298,18.472],[7.075,18.304],[6.858,18.128],[6.647,17.945],[6.443,17.755],[6.245,17.557],[6.055,17.353],[5.872,17.142],[5.696,16.925],[5.528,16.702],[5.368,16.474],[5.216,16.239],[5.072,16],[4.936,15.756],[4.81,15.507],[4.692,15.254],[4.583,14.997],[4.482,14.736],[4.392,14.472],[4.31,14.205],[4.238,13.935],[4.175,13.663]],closed:!0,fill:!1}],cloud:[{t:`poly`,pts:[[3.709,14.235],[3.737,13.971],[3.783,13.71],[3.847,13.453],[3.929,13.2],[4.029,12.954],[4.145,12.716],[4.277,12.486],[4.426,12.266],[4.589,12.057],[4.767,11.86],[4.957,11.676],[5.16,11.506],[5.375,11.35],[5.6,11.209],[5.834,11.085],[6.076,10.977],[6.326,10.886],[6.581,10.813],[6.84,10.758],[7.103,10.721],[7.367,10.702],[7.512,10.651],[7.549,10.304],[7.609,9.96],[7.694,9.622],[7.802,9.29],[7.932,8.966],[8.085,8.653],[8.26,8.35],[8.455,8.061],[8.67,7.786],[8.903,7.527],[9.154,7.284],[9.422,7.06],[9.704,6.855],[10,6.67],[10.308,6.506],[10.627,6.364],[10.955,6.245],[11.29,6.149],[11.632,6.076],[11.977,6.027],[12.326,6.003],[12.674,6.003],[13.023,6.027],[13.368,6.076],[13.71,6.149],[14.045,6.245],[14.373,6.364],[14.692,6.506],[15,6.67],[15.296,6.855],[15.578,7.06],[15.846,7.284],[16.097,7.527],[16.33,7.786],[16.545,8.061],[16.74,8.35],[16.915,8.653],[17.068,8.966],[17.198,9.29],[17.306,9.622],[17.391,9.96],[17.451,10.304],[17.576,10.62],[17.825,10.655],[18.071,10.707],[18.312,10.776],[18.549,10.862],[18.778,10.964],[19,11.082],[19.213,11.215],[19.416,11.363],[19.609,11.525],[19.79,11.699],[19.958,11.886],[20.112,12.084],[20.253,12.292],[20.379,12.51],[20.489,12.736],[20.583,12.969],[20.661,13.208],[20.721,13.452],[20.765,13.699],[20.791,13.949],[20.8,14.2],[20.791,14.451],[20.765,14.701],[20.721,14.948],[20.661,15.192],[20.583,15.431],[20.489,15.664],[20.379,15.89],[20.253,16.108],[20.112,16.316],[19.958,16.514],[19.79,16.701],[19.609,16.875],[19.416,17.037],[19.213,17.185],[19,17.318],[20.8,18.2],[18.778,17.436],[18.549,17.538],[18.312,17.624],[18.071,17.693],[17.825,17.745],[17.576,17.78],[17.326,17.798],[17.074,17.798],[16.824,17.78],[16.575,17.745],[16.329,17.693],[16.088,17.624],[15.851,17.538],[14.021,15.89],[15.622,17.436],[15.4,17.318],[14.147,16.108],[15.187,17.185],[14.288,16.316],[14.984,17.037],[14.791,16.875],[14.442,16.514],[14.61,16.701],[13.71,15.851],[13.368,15.924],[13.023,15.973],[12.674,15.997],[12.326,15.997],[11.977,15.973],[11.632,15.924],[10.411,16.943],[10.233,17.14],[10.574,16.734],[10.043,17.324],[10.723,16.514],[9.84,17.494],[11.29,15.851],[9.625,17.65],[10.855,16.284],[9.4,17.791],[9.166,17.915],[10.971,16.046],[8.924,18.023],[8.674,18.114],[11.071,15.8],[8.419,18.187],[6.581,18.187],[6.326,18.114],[6.076,18.023],[5.834,17.915],[5.6,17.791],[5.375,17.65],[3.7,18.2],[5.16,17.494],[4.957,17.324],[4.767,17.14],[4.589,16.943],[4.426,16.734],[4.277,16.514],[4.145,16.284],[4.029,16.046],[3.929,15.8],[3.847,15.547],[3.783,15.29],[3.737,15.029],[3.709,14.765],[3.7,14.5]],closed:!0,fill:!1}],cloud_sun:[{t:`circle`,c:[8.5,8.5],r:3,fill:!1},{t:`poly`,pts:[[4.964,12.036],[3.692,13.308]],closed:!1,fill:!1},{t:`poly`,pts:[[3.5,8.5],[1.7,8.5]],closed:!1,fill:!1},{t:`poly`,pts:[[4.964,4.964],[3.692,3.692]],closed:!1,fill:!1},{t:`poly`,pts:[[8.5,3.5],[8.5,1.7]],closed:!1,fill:!1},{t:`poly`,pts:[[12.036,4.964],[13.308,3.692]],closed:!1,fill:!1},{t:`poly`,pts:[[7.402,16.233],[7.424,16.016],[7.462,15.802],[7.515,15.591],[7.582,15.384],[7.663,15.183],[7.759,14.987],[7.867,14.799],[7.989,14.618],[8.123,14.447],[8.269,14.285],[8.425,14.134],[8.592,13.995],[8.768,13.867],[8.952,13.751],[9.144,13.649],[9.343,13.561],[9.547,13.487],[9.756,13.427],[9.969,13.381],[10.184,13.351],[10.401,13.336],[10.52,13.294],[10.55,13.009],[10.6,12.728],[10.669,12.45],[10.757,12.178],[10.864,11.912],[10.99,11.655],[11.133,11.407],[11.293,11.17],[11.469,10.945],[11.661,10.732],[11.867,10.533],[12.086,10.349],[12.317,10.181],[12.56,10.029],[12.813,9.895],[13.074,9.779],[13.343,9.681],[13.618,9.602],[13.898,9.542],[14.181,9.502],[14.467,9.482],[14.753,9.482],[15.039,9.502],[15.322,9.542],[15.602,9.602],[15.877,9.681],[16.146,9.779],[16.407,9.895],[16.66,10.029],[16.903,10.181],[17.134,10.349],[17.353,10.533],[17.559,10.732],[17.751,10.945],[17.927,11.17],[18.087,11.407],[18.23,11.655],[18.356,11.912],[18.463,12.178],[18.551,12.45],[18.62,12.728],[18.67,13.009],[18.773,13.268],[18.977,13.297],[19.178,13.34],[19.376,13.396],[19.57,13.467],[19.758,13.551],[19.94,13.647],[20.115,13.757],[20.281,13.878],[20.439,14.01],[20.587,14.153],[20.725,14.306],[20.852,14.469],[20.967,14.64],[21.07,14.818],[21.161,15.003],[21.238,15.194],[21.302,15.39],[21.351,15.59],[21.387,15.793],[21.409,15.998],[21.416,16.204],[21.409,16.41],[21.387,16.615],[21.351,16.818],[21.302,17.018],[21.238,17.214],[21.161,17.405],[21.07,17.59],[20.967,17.768],[20.852,17.939],[20.725,18.102],[20.587,18.255],[20.439,18.398],[20.281,18.53],[20.115,18.651],[19.94,18.761],[21.416,19.484],[19.758,18.857],[19.57,18.941],[19.376,19.012],[19.178,19.068],[18.977,19.111],[18.773,19.14],[18.567,19.154],[18.361,19.154],[18.155,19.14],[17.951,19.111],[17.75,19.068],[17.552,19.012],[17.358,18.941],[15.858,17.59],[17.17,18.857],[16.988,18.761],[15.961,17.768],[16.813,18.651],[16.076,17.939],[16.647,18.53],[16.489,18.398],[16.203,18.102],[16.341,18.255],[15.602,17.558],[15.322,17.618],[15.039,17.658],[14.753,17.678],[14.467,17.678],[14.181,17.658],[13.898,17.618],[12.897,18.453],[12.751,18.615],[13.031,18.282],[12.595,18.766],[13.153,18.101],[12.428,18.905],[13.618,17.558],[12.252,19.033],[13.261,17.913],[12.068,19.149],[11.876,19.251],[13.357,17.717],[11.677,19.339],[11.473,19.413],[13.438,17.516],[11.264,19.473],[9.756,19.473],[9.547,19.413],[9.343,19.339],[9.144,19.251],[8.952,19.149],[8.768,19.033],[7.394,19.484],[8.592,18.905],[8.425,18.766],[8.269,18.615],[8.123,18.453],[7.989,18.282],[7.867,18.101],[7.759,17.913],[7.663,17.717],[7.582,17.516],[7.515,17.309],[7.462,17.098],[7.424,16.884],[7.402,16.667],[7.394,16.45]],closed:!0,fill:!1}],cloud_moon:[{t:`poly`,pts:[[3.501,9.433],[3.454,9.258],[3.414,9.081],[3.379,8.903],[3.351,8.724],[3.328,8.544],[3.313,8.363],[3.303,8.181],[3.3,8],[3.303,7.819],[3.313,7.637],[3.328,7.456],[3.351,7.276],[3.379,7.097],[3.414,6.919],[3.454,6.742],[3.501,6.567],[3.555,6.393],[3.614,6.221],[3.679,6.052],[3.75,5.885],[3.826,5.72],[3.909,5.559],[3.997,5.4],[4.09,5.244],[4.189,5.092],[4.293,4.944],[4.402,4.799],[4.517,4.658],[4.636,4.521],[4.759,4.388],[4.888,4.259],[5.021,4.136],[5.158,4.017],[5.299,3.902],[5.444,3.793],[5.592,3.689],[5.744,3.59],[5.9,3.497],[6.059,3.409],[6.22,3.326],[6.385,3.25],[6.552,3.179],[6.721,3.114],[6.893,3.055],[7.067,3.001],[6.77,5.101],[6.745,5.26],[6.801,4.944],[6.837,4.787],[6.725,5.419],[6.878,4.632],[6.711,5.579],[6.925,4.479],[6.703,5.739],[6.977,4.327],[7.242,2.954],[7.035,4.177],[6.7,5.9],[7.098,4.029],[6.703,6.061],[7.166,3.883],[7.238,3.74],[7.419,2.914],[6.711,6.221],[7.316,3.6],[7.399,3.462],[6.725,6.381],[7.486,3.328],[7.597,2.879],[7.579,3.196],[6.745,6.54],[7.675,3.068],[7.776,2.851],[7.776,2.943],[6.77,6.699],[6.801,6.856],[6.837,7.013],[6.878,7.168],[6.925,7.321],[6.977,7.473],[7.035,7.623],[7.098,7.771],[7.166,7.917],[7.238,8.06],[7.316,8.2],[7.399,8.338],[7.486,8.472],[7.579,8.604],[7.675,8.732],[7.776,8.857],[7.882,8.978],[7.991,9.095],[8.105,9.209],[8.222,9.318],[8.343,9.424],[8.468,9.525],[8.596,9.621],[8.728,9.714],[13.171,10.102],[13.25,10.115],[13.023,10.165],[12.873,10.223],[8.862,9.801],[13.174,10.28],[12.721,10.275],[12.568,10.322],[9,9.884],[13.091,10.441],[12.413,10.363],[12.256,10.399],[9.14,9.962],[12.099,10.43],[13.003,10.6],[11.94,10.455],[9.283,10.034],[11.781,10.475],[9.429,10.102],[11.621,10.489],[12.91,10.756],[11.461,10.497],[9.577,10.165],[11.3,10.5],[9.727,10.223],[11.139,10.497],[10.979,10.489],[9.879,10.275],[10.819,10.475],[10.032,10.322],[10.66,10.455],[10.187,10.363],[10.501,10.43],[12.811,10.908],[10.344,10.399],[12.707,11.056],[12.598,11.201],[12.483,11.342],[12.364,11.479],[12.241,11.612],[12.112,11.741],[11.979,11.864],[11.842,11.983],[11.701,12.098],[11.556,12.207],[11.408,12.311],[11.256,12.41],[11.1,12.503],[10.941,12.591],[10.78,12.674],[10.615,12.75],[10.448,12.821],[10.279,12.886],[10.107,12.945],[9.933,12.999],[9.758,13.046],[9.581,13.086],[9.403,13.121],[9.224,13.149],[9.044,13.172],[8.863,13.187],[8.681,13.197],[8.5,13.2],[8.319,13.197],[8.137,13.187],[7.956,13.172],[7.776,13.149],[7.597,13.121],[7.419,13.086],[7.242,13.046],[7.067,12.999],[6.893,12.945],[6.721,12.886],[6.552,12.821],[6.385,12.75],[6.22,12.674],[6.059,12.591],[5.9,12.503],[5.744,12.41],[5.592,12.311],[5.444,12.207],[5.299,12.098],[5.158,11.983],[5.021,11.864],[4.888,11.741],[4.759,11.612],[4.636,11.479],[4.517,11.342],[4.402,11.201],[4.293,11.056],[4.189,10.908],[4.09,10.756],[3.997,10.6],[3.909,10.441],[3.826,10.28],[3.75,10.115],[3.679,9.948],[3.614,9.779],[3.555,9.607]],closed:!0,fill:!1},{t:`poly`,pts:[[7.402,16.233],[7.424,16.016],[7.462,15.802],[7.515,15.591],[7.582,15.384],[7.663,15.183],[7.759,14.987],[7.867,14.799],[7.989,14.618],[8.123,14.447],[8.269,14.285],[8.425,14.134],[8.592,13.995],[8.768,13.867],[8.952,13.751],[9.144,13.649],[9.343,13.561],[9.547,13.487],[9.756,13.427],[9.969,13.381],[10.184,13.351],[10.401,13.336],[10.52,13.294],[10.55,13.009],[10.6,12.728],[10.669,12.45],[10.757,12.178],[10.864,11.912],[10.99,11.655],[11.133,11.407],[11.293,11.17],[11.469,10.945],[11.661,10.732],[11.867,10.533],[12.086,10.349],[12.317,10.181],[12.56,10.029],[12.813,9.895],[13.074,9.779],[13.343,9.681],[13.618,9.602],[13.898,9.542],[14.181,9.502],[14.467,9.482],[14.753,9.482],[15.039,9.502],[15.322,9.542],[15.602,9.602],[15.877,9.681],[16.146,9.779],[16.407,9.895],[16.66,10.029],[16.903,10.181],[17.134,10.349],[17.353,10.533],[17.559,10.732],[17.751,10.945],[17.927,11.17],[18.087,11.407],[18.23,11.655],[18.356,11.912],[18.463,12.178],[18.551,12.45],[18.62,12.728],[18.67,13.009],[18.773,13.268],[18.977,13.297],[19.178,13.34],[19.376,13.396],[19.57,13.467],[19.758,13.551],[19.94,13.647],[20.115,13.757],[20.281,13.878],[20.439,14.01],[20.587,14.153],[20.725,14.306],[20.852,14.469],[20.967,14.64],[21.07,14.818],[21.161,15.003],[21.238,15.194],[21.302,15.39],[21.351,15.59],[21.387,15.793],[21.409,15.998],[21.416,16.204],[21.409,16.41],[21.387,16.615],[21.351,16.818],[21.302,17.018],[21.238,17.214],[21.161,17.405],[21.07,17.59],[20.967,17.768],[20.852,17.939],[20.725,18.102],[20.587,18.255],[20.439,18.398],[20.281,18.53],[20.115,18.651],[19.94,18.761],[21.416,19.484],[19.758,18.857],[19.57,18.941],[19.376,19.012],[19.178,19.068],[18.977,19.111],[18.773,19.14],[18.567,19.154],[18.361,19.154],[18.155,19.14],[17.951,19.111],[17.75,19.068],[17.552,19.012],[17.358,18.941],[15.858,17.59],[17.17,18.857],[16.988,18.761],[15.961,17.768],[16.813,18.651],[16.076,17.939],[16.647,18.53],[16.489,18.398],[16.203,18.102],[16.341,18.255],[15.602,17.558],[15.322,17.618],[15.039,17.658],[14.753,17.678],[14.467,17.678],[14.181,17.658],[13.898,17.618],[12.897,18.453],[12.751,18.615],[13.031,18.282],[12.595,18.766],[13.153,18.101],[12.428,18.905],[13.618,17.558],[12.252,19.033],[13.261,17.913],[12.068,19.149],[11.876,19.251],[13.357,17.717],[11.677,19.339],[11.473,19.413],[13.438,17.516],[11.264,19.473],[9.756,19.473],[9.547,19.413],[9.343,19.339],[9.144,19.251],[8.952,19.149],[8.768,19.033],[7.394,19.484],[8.592,18.905],[8.425,18.766],[8.269,18.615],[8.123,18.453],[7.989,18.282],[7.867,18.101],[7.759,17.913],[7.663,17.717],[7.582,17.516],[7.515,17.309],[7.462,17.098],[7.424,16.884],[7.402,16.667],[7.394,16.45]],closed:!0,fill:!1}],rain:[{t:`poly`,pts:[[4.538,11.011],[4.563,10.774],[4.605,10.539],[4.662,10.307],[4.736,10.08],[4.826,9.859],[4.93,9.644],[5.05,9.438],[5.183,9.24],[5.33,9.052],[5.49,8.874],[5.662,8.708],[5.844,8.555],[6.038,8.415],[6.24,8.288],[6.451,8.176],[6.669,8.079],[6.893,7.997],[7.123,7.932],[7.356,7.882],[7.593,7.849],[7.831,7.832],[7.961,7.786],[7.994,7.474],[8.048,7.164],[8.124,6.86],[8.221,6.561],[8.339,6.27],[8.477,5.987],[8.634,5.715],[8.809,5.455],[9.003,5.207],[9.213,4.974],[9.439,4.756],[9.68,4.554],[9.934,4.369],[10.2,4.203],[10.477,4.055],[10.764,3.928],[11.059,3.82],[11.361,3.734],[11.669,3.668],[11.98,3.625],[12.293,3.603],[12.607,3.603],[12.92,3.625],[13.231,3.668],[13.539,3.734],[13.841,3.82],[14.136,3.928],[14.423,4.055],[14.7,4.203],[14.966,4.369],[15.22,4.554],[15.461,4.756],[15.687,4.974],[15.897,5.207],[16.091,5.455],[16.266,5.715],[16.423,5.987],[16.561,6.27],[16.679,6.561],[16.776,6.86],[16.852,7.164],[16.906,7.474],[17.019,7.758],[17.243,7.789],[17.464,7.836],[17.681,7.899],[17.894,7.976],[18.1,8.068],[18.3,8.174],[18.492,8.294],[18.675,8.427],[18.848,8.572],[19.011,8.729],[19.162,8.897],[19.301,9.076],[19.428,9.263],[19.541,9.459],[19.64,9.662],[19.725,9.872],[19.794,10.087],[19.849,10.306],[19.888,10.529],[19.912,10.754],[19.92,10.98],[19.912,11.206],[19.888,11.431],[19.849,11.654],[19.794,11.873],[19.725,12.088],[19.64,12.298],[19.541,12.501],[19.428,12.697],[19.301,12.884],[19.162,13.063],[19.011,13.231],[18.848,13.388],[18.675,13.533],[18.492,13.666],[18.3,13.786],[19.92,14.58],[18.1,13.892],[17.894,13.984],[17.681,14.061],[17.464,14.124],[17.243,14.171],[17.019,14.202],[16.793,14.218],[16.567,14.218],[16.341,14.202],[16.117,14.171],[15.896,14.124],[15.679,14.061],[15.466,13.984],[13.819,12.501],[15.26,13.892],[15.06,13.786],[13.932,12.697],[14.868,13.666],[14.059,12.884],[14.685,13.533],[14.512,13.388],[14.198,13.063],[14.349,13.231],[13.539,12.466],[13.231,12.532],[12.92,12.575],[12.607,12.597],[12.293,12.597],[11.98,12.575],[11.669,12.532],[10.57,13.448],[10.41,13.626],[10.717,13.26],[10.238,13.792],[10.85,13.062],[10.056,13.945],[11.361,12.466],[9.862,14.085],[10.97,12.856],[9.66,14.212],[9.449,14.324],[11.074,12.641],[9.231,14.421],[9.007,14.503],[11.164,12.42],[8.777,14.568],[7.123,14.568],[6.893,14.503],[6.669,14.421],[6.451,14.324],[6.24,14.212],[6.038,14.085],[4.53,14.58],[5.844,13.945],[5.662,13.792],[5.49,13.626],[5.33,13.448],[5.183,13.26],[5.05,13.062],[4.93,12.856],[4.826,12.641],[4.736,12.42],[4.662,12.193],[4.605,11.961],[4.563,11.726],[4.538,11.489],[4.53,11.25]],closed:!0,fill:!1},{t:`poly`,pts:[[8.5,17.6],[6.9,21.6]],closed:!1,fill:!1},{t:`poly`,pts:[[12.5,17.6],[10.9,21.6]],closed:!1,fill:!1},{t:`poly`,pts:[[16.5,17.6],[14.9,21.6]],closed:!1,fill:!1}],drizzle:[{t:`poly`,pts:[[4.538,11.011],[4.563,10.774],[4.605,10.539],[4.662,10.307],[4.736,10.08],[4.826,9.859],[4.93,9.644],[5.05,9.438],[5.183,9.24],[5.33,9.052],[5.49,8.874],[5.662,8.708],[5.844,8.555],[6.038,8.415],[6.24,8.288],[6.451,8.176],[6.669,8.079],[6.893,7.997],[7.123,7.932],[7.356,7.882],[7.593,7.849],[7.831,7.832],[7.961,7.786],[7.994,7.474],[8.048,7.164],[8.124,6.86],[8.221,6.561],[8.339,6.27],[8.477,5.987],[8.634,5.715],[8.809,5.455],[9.003,5.207],[9.213,4.974],[9.439,4.756],[9.68,4.554],[9.934,4.369],[10.2,4.203],[10.477,4.055],[10.764,3.928],[11.059,3.82],[11.361,3.734],[11.669,3.668],[11.98,3.625],[12.293,3.603],[12.607,3.603],[12.92,3.625],[13.231,3.668],[13.539,3.734],[13.841,3.82],[14.136,3.928],[14.423,4.055],[14.7,4.203],[14.966,4.369],[15.22,4.554],[15.461,4.756],[15.687,4.974],[15.897,5.207],[16.091,5.455],[16.266,5.715],[16.423,5.987],[16.561,6.27],[16.679,6.561],[16.776,6.86],[16.852,7.164],[16.906,7.474],[17.019,7.758],[17.243,7.789],[17.464,7.836],[17.681,7.899],[17.894,7.976],[18.1,8.068],[18.3,8.174],[18.492,8.294],[18.675,8.427],[18.848,8.572],[19.011,8.729],[19.162,8.897],[19.301,9.076],[19.428,9.263],[19.541,9.459],[19.64,9.662],[19.725,9.872],[19.794,10.087],[19.849,10.306],[19.888,10.529],[19.912,10.754],[19.92,10.98],[19.912,11.206],[19.888,11.431],[19.849,11.654],[19.794,11.873],[19.725,12.088],[19.64,12.298],[19.541,12.501],[19.428,12.697],[19.301,12.884],[19.162,13.063],[19.011,13.231],[18.848,13.388],[18.675,13.533],[18.492,13.666],[18.3,13.786],[19.92,14.58],[18.1,13.892],[17.894,13.984],[17.681,14.061],[17.464,14.124],[17.243,14.171],[17.019,14.202],[16.793,14.218],[16.567,14.218],[16.341,14.202],[16.117,14.171],[15.896,14.124],[15.679,14.061],[15.466,13.984],[13.819,12.501],[15.26,13.892],[15.06,13.786],[13.932,12.697],[14.868,13.666],[14.059,12.884],[14.685,13.533],[14.512,13.388],[14.198,13.063],[14.349,13.231],[13.539,12.466],[13.231,12.532],[12.92,12.575],[12.607,12.597],[12.293,12.597],[11.98,12.575],[11.669,12.532],[10.57,13.448],[10.41,13.626],[10.717,13.26],[10.238,13.792],[10.85,13.062],[10.056,13.945],[11.361,12.466],[9.862,14.085],[10.97,12.856],[9.66,14.212],[9.449,14.324],[11.074,12.641],[9.231,14.421],[9.007,14.503],[11.164,12.42],[8.777,14.568],[7.123,14.568],[6.893,14.503],[6.669,14.421],[6.451,14.324],[6.24,14.212],[6.038,14.085],[4.53,14.58],[5.844,13.945],[5.662,13.792],[5.49,13.626],[5.33,13.448],[5.183,13.26],[5.05,13.062],[4.93,12.856],[4.826,12.641],[4.736,12.42],[4.662,12.193],[4.605,11.961],[4.563,11.726],[4.538,11.489],[4.53,11.25]],closed:!0,fill:!1},{t:`poly`,pts:[[8.5,18.4],[7.9,20]],closed:!1,fill:!1},{t:`poly`,pts:[[12.5,18.4],[11.9,20]],closed:!1,fill:!1},{t:`poly`,pts:[[16.5,18.4],[15.9,20]],closed:!1,fill:!1}],snow:[{t:`poly`,pts:[[4.538,11.011],[4.563,10.774],[4.605,10.539],[4.662,10.307],[4.736,10.08],[4.826,9.859],[4.93,9.644],[5.05,9.438],[5.183,9.24],[5.33,9.052],[5.49,8.874],[5.662,8.708],[5.844,8.555],[6.038,8.415],[6.24,8.288],[6.451,8.176],[6.669,8.079],[6.893,7.997],[7.123,7.932],[7.356,7.882],[7.593,7.849],[7.831,7.832],[7.961,7.786],[7.994,7.474],[8.048,7.164],[8.124,6.86],[8.221,6.561],[8.339,6.27],[8.477,5.987],[8.634,5.715],[8.809,5.455],[9.003,5.207],[9.213,4.974],[9.439,4.756],[9.68,4.554],[9.934,4.369],[10.2,4.203],[10.477,4.055],[10.764,3.928],[11.059,3.82],[11.361,3.734],[11.669,3.668],[11.98,3.625],[12.293,3.603],[12.607,3.603],[12.92,3.625],[13.231,3.668],[13.539,3.734],[13.841,3.82],[14.136,3.928],[14.423,4.055],[14.7,4.203],[14.966,4.369],[15.22,4.554],[15.461,4.756],[15.687,4.974],[15.897,5.207],[16.091,5.455],[16.266,5.715],[16.423,5.987],[16.561,6.27],[16.679,6.561],[16.776,6.86],[16.852,7.164],[16.906,7.474],[17.019,7.758],[17.243,7.789],[17.464,7.836],[17.681,7.899],[17.894,7.976],[18.1,8.068],[18.3,8.174],[18.492,8.294],[18.675,8.427],[18.848,8.572],[19.011,8.729],[19.162,8.897],[19.301,9.076],[19.428,9.263],[19.541,9.459],[19.64,9.662],[19.725,9.872],[19.794,10.087],[19.849,10.306],[19.888,10.529],[19.912,10.754],[19.92,10.98],[19.912,11.206],[19.888,11.431],[19.849,11.654],[19.794,11.873],[19.725,12.088],[19.64,12.298],[19.541,12.501],[19.428,12.697],[19.301,12.884],[19.162,13.063],[19.011,13.231],[18.848,13.388],[18.675,13.533],[18.492,13.666],[18.3,13.786],[19.92,14.58],[18.1,13.892],[17.894,13.984],[17.681,14.061],[17.464,14.124],[17.243,14.171],[17.019,14.202],[16.793,14.218],[16.567,14.218],[16.341,14.202],[16.117,14.171],[15.896,14.124],[15.679,14.061],[15.466,13.984],[13.819,12.501],[15.26,13.892],[15.06,13.786],[13.932,12.697],[14.868,13.666],[14.059,12.884],[14.685,13.533],[14.512,13.388],[14.198,13.063],[14.349,13.231],[13.539,12.466],[13.231,12.532],[12.92,12.575],[12.607,12.597],[12.293,12.597],[11.98,12.575],[11.669,12.532],[10.57,13.448],[10.41,13.626],[10.717,13.26],[10.238,13.792],[10.85,13.062],[10.056,13.945],[11.361,12.466],[9.862,14.085],[10.97,12.856],[9.66,14.212],[9.449,14.324],[11.074,12.641],[9.231,14.421],[9.007,14.503],[11.164,12.42],[8.777,14.568],[7.123,14.568],[6.893,14.503],[6.669,14.421],[6.451,14.324],[6.24,14.212],[6.038,14.085],[4.53,14.58],[5.844,13.945],[5.662,13.792],[5.49,13.626],[5.33,13.448],[5.183,13.26],[5.05,13.062],[4.93,12.856],[4.826,12.641],[4.736,12.42],[4.662,12.193],[4.605,11.961],[4.563,11.726],[4.538,11.489],[4.53,11.25]],closed:!0,fill:!1},{t:`circle`,c:[8.5,19.2],r:.9,fill:!0},{t:`circle`,c:[12.5,21],r:.9,fill:!0},{t:`circle`,c:[16.5,19.2],r:.9,fill:!0}],storm:[{t:`poly`,pts:[[4.538,11.011],[4.563,10.774],[4.605,10.539],[4.662,10.307],[4.736,10.08],[4.826,9.859],[4.93,9.644],[5.05,9.438],[5.183,9.24],[5.33,9.052],[5.49,8.874],[5.662,8.708],[5.844,8.555],[6.038,8.415],[6.24,8.288],[6.451,8.176],[6.669,8.079],[6.893,7.997],[7.123,7.932],[7.356,7.882],[7.593,7.849],[7.831,7.832],[7.961,7.786],[7.994,7.474],[8.048,7.164],[8.124,6.86],[8.221,6.561],[8.339,6.27],[8.477,5.987],[8.634,5.715],[8.809,5.455],[9.003,5.207],[9.213,4.974],[9.439,4.756],[9.68,4.554],[9.934,4.369],[10.2,4.203],[10.477,4.055],[10.764,3.928],[11.059,3.82],[11.361,3.734],[11.669,3.668],[11.98,3.625],[12.293,3.603],[12.607,3.603],[12.92,3.625],[13.231,3.668],[13.539,3.734],[13.841,3.82],[14.136,3.928],[14.423,4.055],[14.7,4.203],[14.966,4.369],[15.22,4.554],[15.461,4.756],[15.687,4.974],[15.897,5.207],[16.091,5.455],[16.266,5.715],[16.423,5.987],[16.561,6.27],[16.679,6.561],[16.776,6.86],[16.852,7.164],[16.906,7.474],[17.019,7.758],[17.243,7.789],[17.464,7.836],[17.681,7.899],[17.894,7.976],[18.1,8.068],[18.3,8.174],[18.492,8.294],[18.675,8.427],[18.848,8.572],[19.011,8.729],[19.162,8.897],[19.301,9.076],[19.428,9.263],[19.541,9.459],[19.64,9.662],[19.725,9.872],[19.794,10.087],[19.849,10.306],[19.888,10.529],[19.912,10.754],[19.92,10.98],[19.912,11.206],[19.888,11.431],[19.849,11.654],[19.794,11.873],[19.725,12.088],[19.64,12.298],[19.541,12.501],[19.428,12.697],[19.301,12.884],[19.162,13.063],[19.011,13.231],[18.848,13.388],[18.675,13.533],[18.492,13.666],[18.3,13.786],[19.92,14.58],[18.1,13.892],[17.894,13.984],[17.681,14.061],[17.464,14.124],[17.243,14.171],[17.019,14.202],[16.793,14.218],[16.567,14.218],[16.341,14.202],[16.117,14.171],[15.896,14.124],[15.679,14.061],[15.466,13.984],[13.819,12.501],[15.26,13.892],[15.06,13.786],[13.932,12.697],[14.868,13.666],[14.059,12.884],[14.685,13.533],[14.512,13.388],[14.198,13.063],[14.349,13.231],[13.539,12.466],[13.231,12.532],[12.92,12.575],[12.607,12.597],[12.293,12.597],[11.98,12.575],[11.669,12.532],[10.57,13.448],[10.41,13.626],[10.717,13.26],[10.238,13.792],[10.85,13.062],[10.056,13.945],[11.361,12.466],[9.862,14.085],[10.97,12.856],[9.66,14.212],[9.449,14.324],[11.074,12.641],[9.231,14.421],[9.007,14.503],[11.164,12.42],[8.777,14.568],[7.123,14.568],[6.893,14.503],[6.669,14.421],[6.451,14.324],[6.24,14.212],[6.038,14.085],[4.53,14.58],[5.844,13.945],[5.662,13.792],[5.49,13.626],[5.33,13.448],[5.183,13.26],[5.05,13.062],[4.93,12.856],[4.826,12.641],[4.736,12.42],[4.662,12.193],[4.605,11.961],[4.563,11.726],[4.538,11.489],[4.53,11.25]],closed:!0,fill:!1},{t:`poly`,pts:[[13.2,16],[10.6,19.6],[13.4,19.6],[11.2,23]],closed:!1,fill:!1}],fog:[{t:`poly`,pts:[[4,8],[20,8]],closed:!1,fill:!1},{t:`poly`,pts:[[3,12],[17,12]],closed:!1,fill:!1},{t:`poly`,pts:[[6,16],[21,16]],closed:!1,fill:!1},{t:`poly`,pts:[[5,20],[15,20]],closed:!1,fill:!1}],wind:[{t:`poly`,pts:[[3,9],[16.5,9],[16.5,9],[17.75,8.665],[18.665,7.75],[19,6.5],[18.665,5.25],[17.75,4.335],[16.5,4],[15.25,4.335],[14.335,5.25],[14,6.5]],closed:!1,fill:!1},{t:`poly`,pts:[[3,13],[19,13],[19,13],[20.25,13.335],[21.165,14.25],[21.5,15.5],[21.165,16.75],[20.25,17.665],[19,18],[17.75,17.665],[16.835,16.75],[16.5,15.5]],closed:!1,fill:!1},{t:`poly`,pts:[[3,17],[11,17]],closed:!1,fill:!1}],alert:[{t:`poly`,pts:[[12,3.5],[21.5,20],[2.5,20]],closed:!0,fill:!1},{t:`poly`,pts:[[12,9.5],[12,14.2]],closed:!1,fill:!1},{t:`circle`,c:[12,17.2],r:1,fill:!0}],check:[{t:`poly`,pts:[[4.5,12.5],[9.5,17.5],[19.5,6.5]],closed:!1,fill:!1}],cross:[{t:`poly`,pts:[[6,6],[18,18]],closed:!1,fill:!1},{t:`poly`,pts:[[18,6],[6,18]],closed:!1,fill:!1}],clock:[{t:`circle`,c:[12,12],r:9,fill:!1},{t:`poly`,pts:[[12,6.5],[12,12],[15.8,14.2]],closed:!1,fill:!1}],link_out:[{t:`poly`,pts:[[10,5],[5,5],[5,19],[19,19],[19,14]],closed:!1,fill:!1},{t:`poly`,pts:[[12,12],[19.5,4.5]],closed:!1,fill:!1},{t:`poly`,pts:[[14,4.5],[19.5,4.5],[19.5,10]],closed:!1,fill:!1}],lock:[{t:`poly`,pts:[[5,11],[19,11],[19,20.5],[5,20.5]],closed:!0,fill:!1},{t:`poly`,pts:[[8,11],[8,8],[8,8],[8.136,6.965],[8.536,6],[9.172,5.172],[10,4.536],[10.965,4.136],[12,4],[13.035,4.136],[14,4.536],[14.828,5.172],[15.464,6],[15.864,6.965],[16,8],[16,11]],closed:!1,fill:!1}],unlock:[{t:`poly`,pts:[[5,11],[19,11],[19,20.5],[5,20.5]],closed:!0,fill:!1},{t:`poly`,pts:[[8,11],[8,8],[8,8],[8.136,6.965],[8.536,6],[9.172,5.172],[10,4.536],[10.965,4.136],[12,4],[13.035,4.136],[14,4.536],[14.828,5.172],[15.464,6],[15.864,6.965],[16,8],[16,9]],closed:!1,fill:!1}],pin:[{t:`poly`,pts:[[6.371,12.75],[5.892,11.723],[5.599,10.629],[5.5,9.5],[5.599,8.371],[5.892,7.277],[6.371,6.25],[7.021,5.322],[7.822,4.521],[8.75,3.871],[9.777,3.392],[10.871,3.099],[12,3],[13.129,3.099],[14.223,3.392],[15.25,3.871],[16.178,4.521],[16.979,5.322],[17.629,6.25],[18.108,7.277],[18.401,8.371],[18.5,9.5],[18.401,10.629],[18.108,11.723],[17.629,12.75],[12,21.5]],closed:!0,fill:!1},{t:`circle`,c:[12,9.5],r:2.3,fill:!1}],up:[{t:`poly`,pts:[[12,19],[12,5]],closed:!1,fill:!1},{t:`poly`,pts:[[6,11],[12,5],[18,11]],closed:!1,fill:!1}],down:[{t:`poly`,pts:[[12,5],[12,19]],closed:!1,fill:!1},{t:`poly`,pts:[[6,13],[12,19],[18,13]],closed:!1,fill:!1}]}},rn=0;function an(e){console.assert(e!=null,`detectOverflows: root required`),console.assert(typeof e.querySelectorAll==`function`,`detectOverflows: root is an element`);let t=e.querySelectorAll(`.ni-t[data-max-w]`),n=0;for(let e of t){let t=Number(e.getAttribute(`data-max-w`));!Number.isFinite(t)||t<=0||e.scrollWidth>t+.5&&!e.hasAttribute(`data-ellipsis`)&&(e.setAttribute(`data-ellipsis`,``),n+=1,rn+=1)}return n}var on=m(`unrenderable`),sn=a(``),cn=a(``),ln=a(``),un=a(``),dn=a(``),fn=a(``),pn=a(``),mn=a(``),hn=a(``),gn=a(``),_n=a(``),vn=m(``),yn=m(` `),bn=m(`
      `),xn=m(`
      `);function Sn(n,r){let i=s();T(r,!0);function a(){let e=typeof window>`u`?null:window;return typeof e?.NI_NOW==`number`?e.NI_NOW:Date.now()}let c=R(e(a())),u=typeof window>`u`?null:window.setInterval(()=>{O(c,a(),!0)},15e3);te(()=>{u!==null&&window.clearInterval(u)});let m=M(()=>{try{return{ok:!0,clir:Q(r.clir)}}catch(e){return{ok:!1,why:e instanceof Ke?e.message:String(e)}}}),g=R(0),S=M(()=>v(m).ok?v(m).clir.bucket.min_w:0),C=M(()=>v(g)>v(S)?v(g):v(S)),w=M(()=>v(g)>0&&v(g)v(m).ok&&v(C)>0?Kt(v(m).clir,{width:v(C),now:v(c),viewerTz:r.viewerTz}):null),D=R(null);l(()=>{if(!v(D)||!v(E))return;let e=v(D),t=()=>{an(e)},n=typeof document>`u`?null:document.fonts;n&&typeof n.ready?.then==`function`?n.ready.then(t,t):t()});let j=R(null),F=M(()=>v(E)!==null&&v(E).ops.some(e=>B(e)?.k===`basemap`));l(()=>{if(!v(F))return;let e=!0;return Yt().then(t=>{e&&O(j,t)},()=>{e&&O(j,[])}),()=>{e=!1}});function I(e){console.assert(Number.isFinite(e),`fmt: finite number`);let t=e.toFixed(2).replace(/\.?0+$/,``);return t===`-0`||t===``?`0`:t}function L(e,t){return console.assert(t>=0,`rx: width non-negative`),_t(e,0,t)}function z(e){return console.assert(e.length>0,`tokVar: token required`),`var(--ni-${e})`}function ie(e){return e.kind===`text`}function B(e){return e.kind===`svg`?e.prim:null}function ae(e,t){console.assert(e.y1>=e.y0,`boxRect: ordered box`),console.assert(t>=0,`boxRect: width non-negative`);let n=L(e.x0,t),r=L(e.x1,t);return{x:n,y:e.y0,w:Math.max(0,r-n),h:Math.max(0,e.y1-e.y0)}}function V(e,t){console.assert(e.k===`tri`,`triPoints: tri prim`),console.assert(e.size>0,`triPoints: size positive`);let n=e.size*.866,r=L(e.x,t),i=e.y,a=e.size;return(e.dir===`up`?[[r-a/2,i+n/2],[r+a/2,i+n/2],[r,i-n/2]]:e.dir===`down`?[[r-a/2,i-n/2],[r+a/2,i-n/2],[r,i+n/2]]:e.dir===`left`?[[r+n/2,i-a/2],[r+n/2,i+a/2],[r-n/2,i]]:[[r-n/2,i-a/2],[r-n/2,i+a/2],[r+n/2,i]]).map(([e,t])=>`${I(e)},${I(t)}`).join(` `)}function H(e,t){console.assert(e.k===`path`,`pathD: path prim`),console.assert(Array.isArray(e.pts),`pathD: points array`);let n=e.box,r=L(n.x0,t),i=L(n.x1,t),a=e.pts.map(([e,t])=>[r+e*(i-r),n.y0+t*(n.y1-n.y0)]);if(a.length<2)return{line:``,fill:null};let o=`M`+a.map(([e,t])=>`${I(e)},${I(t)}`).join(` L`),s=a[0],c=a[a.length-1];return{line:o,fill:e.fill?`${o} L${I(c[0])},${I(n.y1)} L${I(s[0])},${I(n.y1)} Z`:null}}function oe(e,t,n){console.assert(e.length>0,`gapDash: segments required`),console.assert(t<=n,`gapDash: ordered ends`);let r=[0],i=t;for(let[t,n]of e)r.push(t-i,n-t),i=n;return r.push(n-i+1e3),r.map(I).join(` `)}function se(e,t,n){if(console.assert(n>0,`cellFill: steps positive`),console.assert(e>=0,`cellFill: value non-negative`),t===`seq`)return z(`viz-seq-${1+Math.round(e*4/Math.max(1,n-1))}`);let r=e/Math.max(1,n-1);return r<=.5?`color-mix(in srgb, ${z(`viz-div-mid`)} ${I(r*200)}%, ${z(`viz-div-neg`)})`:`color-mix(in srgb, ${z(`viz-div-pos`)} ${I((r-.5)*200)}%, ${z(`viz-div-mid`)})`}function ce(e,t){console.assert(e.k===`cells`,`cellsFor: cells prim`),console.assert(e.cols>0&&e.rows>0,`cellsFor: grid shape`);let n=e.box,r=L(n.x0,t),i=(L(n.x1,t)-r-e.gap*(e.cols-1))/e.cols,a=(n.y1-n.y0-e.gap*(e.rows-1))/e.rows,o=[];for(let t=0;t0,`iconScale: size positive`),console.assert(nn.box>0,`iconScale: icon box`),e.size/nn.box}function U(e){return console.assert(Array.isArray(e),`pointList: points array`),e.map(e=>`${I(e[0])},${I(e[1])}`).join(` `)}var ue=f(),de=y(ue),W=e=>{var t=on();o(()=>A(t,`title`,v(m).ok?`render failed`:v(m).why)),d(e,t)},fe=e=>{var n=xn();let r;var a=b(n);let s;var c=b(a);p(c,21,()=>v(E).ops,P,(e,n)=>{let r=M(()=>B(v(n)));var a=f(),s=y(a),c=e=>{var n=f(),a=y(n),s=e=>{let t=M(()=>v(r)),n=M(()=>ae({x0:v(t).x0,x1:v(t).x1,y0:v(t).y0,y1:v(t).y1},v(E).width));var i=sn();let a;o((e,n,r,o,s,c,l)=>{A(i,`x`,e),A(i,`y`,n),A(i,`width`,r),A(i,`height`,o),A(i,`rx`,s),a=_(i,``,a,{fill:c,stroke:l,opacity:v(t).alpha??1})},[()=>I(v(n).x),()=>I(v(n).y),()=>I(v(n).w),()=>I(v(n).h),()=>I(v(t).r),()=>z(v(t).tok),()=>v(t).stroke?z(v(t).stroke):`none`]),d(e,i)},c=e=>{let t=M(()=>v(r));var n=cn();let i;o((e,r,a,o,s,c,l)=>{A(n,`x1`,e),A(n,`y1`,r),A(n,`x2`,a),A(n,`y2`,o),i=_(n,``,i,{stroke:s,"stroke-width":c,"stroke-dasharray":l,opacity:v(t).alpha??1})},[()=>I(L(v(t).x0,v(E).width)),()=>I(v(t).y0),()=>I(L(v(t).x1,v(E).width)),()=>I(v(t).y1),()=>z(v(t).tok),()=>I(v(t).w),()=>v(t)._segs?oe(v(t)._segs,Math.min(v(t).y0,v(t).y1),Math.max(v(t).y0,v(t).y1)):v(t).dash?v(t).dash.map(I).join(` `):`none`]),d(e,n)},l=e=>{let t=M(()=>v(r));var n=ln();let i;o((e,r)=>{A(n,`points`,e),i=_(n,``,i,{fill:r,opacity:v(t).alpha??1})},[()=>V(v(t),v(E).width),()=>z(v(t).tok)]),d(e,n)},u=e=>{let n=M(()=>v(r));var i=dn();let a;var s=b(i),c=e=>{var t=un();let r;o((e,n,i,a)=>{A(t,`cx`,e),A(t,`cy`,n),A(t,`r`,i),r=_(t,``,r,{fill:a})},[()=>I(L(v(n).x,v(E).width)),()=>I(v(n).y),()=>I(v(n).r+v(n).ring_w),()=>z(v(n).ring)]),d(e,t)};t(s,e=>{v(n).ring&&e(c)});var l=h(s);let u;k(i),o((e,t,r,o)=>{a=_(i,``,a,{opacity:v(n).alpha??1}),A(l,`cx`,e),A(l,`cy`,t),A(l,`r`,r),u=_(l,``,u,{fill:o})},[()=>I(L(v(n).x,v(E).width)),()=>I(v(n).y),()=>I(v(n).r),()=>z(v(n).tok)]),d(e,i)},m=e=>{let n=M(()=>v(r)),i=M(()=>H(v(n),v(E).width));var a=pn();let s;var c=b(a),l=e=>{var t=fn();let r;o(e=>{A(t,`d`,v(i).fill),r=_(t,``,r,{fill:e,stroke:`none`})},[()=>z(v(n).fill)]),d(e,t)};t(c,e=>{v(i).fill&&v(n).fill&&e(l)});var u=h(c);let f;k(a),o((e,t)=>{s=_(a,``,s,{opacity:v(n).alpha??1}),A(u,`d`,v(i).line),f=_(u,``,f,{fill:`none`,stroke:e,"stroke-width":t,"stroke-dasharray":v(n).style===`interp`?`4 3`:`none`,"stroke-linejoin":`round`,"stroke-linecap":`round`})},[()=>z(v(n).tok),()=>I(v(n).w)]),d(e,a)},g=e=>{let t=M(()=>v(r));var n=hn();let i;p(n,21,()=>ce(v(t),v(E).width),P,(e,t)=>{var n=mn();o((e,r,i,a)=>{A(n,`x`,e),A(n,`y`,r),A(n,`width`,i),A(n,`height`,a),_(n,v(t).style)},[()=>I(v(t).x),()=>I(v(t).y),()=>I(v(t).w),()=>I(v(t).h)]),d(e,n)}),k(n),o(()=>i=_(n,``,i,{opacity:v(t).alpha??1})),d(e,n)},S=e=>{let n=M(()=>v(r)),a=M(()=>ae(v(n).box,v(E).width));var s=f(),c=y(s),l=e=>{var t=gn();let r;var s=b(t),c=x(s),l=h(s);let u;k(t),o((e,a,o,d,f,p,m)=>{r=_(t,``,r,{opacity:v(n).alpha??1}),A(s,`id`,`${i}-map-${v(n).id??``}`),A(c,`x`,e),A(c,`y`,a),A(c,`width`,o),A(c,`height`,d),A(l,`d`,f),A(l,`clip-path`,`url(#${i}-map-${v(n).id??``})`),u=_(l,``,u,{fill:p,stroke:m,"stroke-width":`0.75`,"stroke-linejoin":`round`})},[()=>I(v(a).x),()=>I(v(a).y),()=>I(v(a).w),()=>I(v(a).h),()=>$t(v(n),v(E).width,v(j)).join(` `),()=>z(v(n).land),()=>z(v(n).stroke)]),d(e,t)},u=e=>{var t=sn();let r;o((e,i,a,o,s,c)=>{A(t,`x`,e),A(t,`y`,i),A(t,`width`,a),A(t,`height`,o),r=_(t,``,r,{fill:s,stroke:c,"stroke-width":`0.75`,opacity:v(n).alpha??1})},[()=>I(v(a).x),()=>I(v(a).y),()=>I(v(a).w),()=>I(v(a).h),()=>z(v(n).land),()=>z(v(n).stroke)]),d(e,t)};t(c,e=>{v(j)&&v(j).length>0?e(l):e(u,-1)}),d(e,s)},C=e=>{let n=M(()=>v(r)),i=M(()=>le(v(n)));var a=hn();let s;p(a,21,()=>nn.icons[v(n).name]??[],P,(e,r)=>{var i=f(),a=y(i),s=e=>{var t=un();let i;o((e,n,r,a,o)=>{A(t,`cx`,e),A(t,`cy`,n),A(t,`r`,r),i=_(t,``,i,{fill:a,stroke:o})},[()=>I(v(r).c[0]),()=>I(v(r).c[1]),()=>I(v(r).r),()=>v(r).fill?z(v(n).tok):`none`,()=>v(r).fill?`none`:z(v(n).tok)]),d(e,t)},c=e=>{var t=ln();let i;o((e,n,r)=>{A(t,`points`,e),i=_(t,``,i,{fill:n,stroke:r})},[()=>U(v(r).pts),()=>v(r).fill?z(v(n).tok):`none`,()=>v(r).fill?`none`:z(v(n).tok)]),d(e,t)},l=e=>{var t=_n();let i;o((e,n)=>{A(t,`points`,e),i=_(t,``,i,{fill:`none`,stroke:n})},[()=>U(v(r).pts),()=>z(v(n).tok)]),d(e,t)};t(a,e=>{v(r).t===`circle`?e(s):v(r).closed?e(c,1):e(l,-1)}),d(e,i)}),k(a),o((e,t,r,i)=>{A(a,`transform`,`translate(${e??``},${t??``}) scale(${r??``})`),s=_(a,``,s,{fill:`none`,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,opacity:v(n).alpha??1})},[()=>I(L(v(n).x,v(E).width)-12*v(i)),()=>I(v(n).y-12*v(i)),()=>I(v(i)),()=>I(nn.stroke)]),d(e,a)};t(a,e=>{v(r).k===`rect`?e(s):v(r).k===`line`?e(c,1):v(r).k===`tri`?e(l,2):v(r).k===`dot`?e(u,3):v(r).k===`path`?e(m,4):v(r).k===`cells`?e(g,5):v(r).k===`basemap`?e(S,6):v(r).k===`icon`&&e(C,7)}),d(e,n)};t(s,e=>{v(r)&&e(c)}),d(e,a)}),k(c);var l=h(c,2);p(l,17,()=>v(E).ops,P,(e,n)=>{let r=M(()=>B(v(n)));var i=f(),a=y(i),s=e=>{let t=M(()=>v(r)),n=M(()=>ae(v(t).box,v(E).width));var i=vn();let a;o((e,n,r,o)=>a=_(i,``,a,{left:e,top:n,width:r,height:o,opacity:v(t).alpha??1}),[()=>`${I(v(n).x)??``}px`,()=>`${I(v(n).y)??``}px`,()=>`${I(v(n).w)??``}px`,()=>`${I(v(n).h)??``}px`]),d(e,i)};t(a,e=>{v(r)&&v(r).k===`image`&&e(s)}),d(e,i)});var u=h(l,2);p(u,17,()=>v(E).ops,P,(e,n)=>{var r=f(),i=y(r),a=e=>{var t=bn();let r;p(t,21,()=>v(n).lines,P,(e,t)=>{var n=yn(),r=x(n,!0);o(()=>N(r,v(t))),d(e,n)}),k(t),o((e,i,a,o,s,c,l)=>{A(t,`data-p`,v(n).id),A(t,`data-role`,v(n).role),A(t,`data-max-w`,e),A(t,`dir`,v(n).direction),r=_(t,``,r,{left:i,top:a,width:o,"font-size":s,"font-weight":v(n).wt,"line-height":c,color:l,"text-align":v(n).align,"font-variant-numeric":v(n).tnum?`tabular-nums`:`normal`,opacity:v(n).alpha}),t.dir=t.dir},[()=>I(v(n).width),()=>`${I(v(n).left)??``}px`,()=>`${I(v(n).top)??``}px`,()=>`${I(v(n).width)??``}px`,()=>`${I(v(n).px)??``}px`,()=>`${I(v(n).lh)??``}px`,()=>z(v(n).color)]),d(e,t)},s=M(()=>ie(v(n)));t(i,e=>{v(s)&&e(a)}),d(e,r)}),k(a),ee(a,e=>O(D,e),()=>v(D)),k(n),o((e,t,i,o,l,u,d,f)=>{r=_(n,``,r,{height:e}),A(a,`aria-label`,v(E).summary),A(a,`data-form`,v(m).clir.form),A(a,`data-span`,v(m).clir.span),s=_(a,``,s,{width:t,height:i,transform:o}),A(c,`width`,l),A(c,`height`,u),A(c,`viewBox`,`0 0 ${d??``} ${f??``}`)},[()=>`${I(v(E).height*v(w))??``}px`,()=>`${I(v(E).width)??``}px`,()=>`${I(v(E).height)??``}px`,()=>v(w)===1?null:`scale(${I(v(w))})`,()=>I(v(E).width),()=>I(v(E).height),()=>I(v(E).width),()=>I(v(E).height)]),re(n,`clientWidth`,e=>O(g,e)),d(e,n)};t(de,e=>{!v(m).ok||!v(E)?e(W):e(fe,-1)}),d(n,ue),ne()}var Cn=m(``),wn=m(` `),$=m(``);function Tn(e,n){T(n,!0);let r=R(null),i=R(!1);l(()=>{let e=n.src,t=!0;return O(r,null),O(i,!1),V.niImageDataUrl(e).then(e=>{t&&O(r,e,!0)},()=>{t&&O(i,!0)}),()=>{t=!1}});var a=f(),s=y(a),c=e=>{var t=Cn();o(()=>{A(t,`src`,v(r)),A(t,`alt`,n.alt)}),d(e,t)},u=e=>{var t=wn(),r=x(t,!0);o(()=>N(r,n.alt)),d(e,t)},p=e=>{var t=$();o(()=>A(t,`aria-label`,n.alt)),d(e,t)};t(s,e=>{v(r)?e(c):v(i)?e(u,1):e(p,-1)}),d(e,a),ne()}var En=100,Dn=8,On=2e3,kn=500,An=200,jn=200,Mn=/^\/api\/ni\/items\/[A-Za-z0-9-]+\/image(\?v=[\w.:+-]*)?$/,Nn=[`title`,`label`,`value`,`caption`],Pn=[`default`,`muted`,`accent`,`ok`,`warn`,`danger`],Fn=[`sm`,`md`,`lg`],In=[``,`accent`,`ok`,`warn`,`danger`],Ln=[`v`,`h`],Rn=[`sm`,`md`],zn=[`plain`,`compact`,`percent`,`currency`],Bn=[`line`,`bars`],Vn=new Set([`when`,`on_tap`]);function Hn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Un(e){return console.assert(e.type===`text`,`checkText: type must be text`),console.assert(typeof e==`object`,`checkText: node must be an object`),typeof e.value==`string`?e.value.length>On?`text.value exceeds 2000 chars`:Nn.includes(e.role)?Pn.includes(e.tone)?Fn.includes(e.size)?null:`text.size invalid`:`text.tone invalid`:`text.role invalid`:`text.value must be string`}function Wn(e){return console.assert(e.type===`number`,`checkNumber: type must be number`),console.assert(typeof e==`object`,`checkNumber: node must be an object`),typeof e.value!=`number`||!Number.isFinite(e.value)?`number.value must be finite`:zn.includes(e.format)?Pn.includes(e.tone)?Fn.includes(e.size)?e.unit!==void 0&&typeof e.unit!=`string`?`number.unit must be string`:null:`number.size invalid`:`number.tone invalid`:`number.format invalid`}function Gn(e){return console.assert(e.type===`chip`,`checkChip: type must be chip`),console.assert(typeof e==`object`,`checkChip: node must be an object`),typeof e.value==`string`?e.value.length>On?`chip.value exceeds 2000 chars`:In.includes(e.kind)?null:`chip.kind invalid`:`chip.value must be string`}function Kn(e){return console.assert(e.type===`bar`,`checkBar: type must be bar`),console.assert(typeof e==`object`,`checkBar: node must be an object`),typeof e.value!=`number`||!Number.isFinite(e.value)?`bar.value must be finite`:typeof e.max!=`number`||!Number.isFinite(e.max)||e.max<=0?`bar.max must be > 0`:Pn.includes(e.tone)?null:`bar.tone invalid`}function qn(e){return console.assert(e.type===`icon`,`checkIcon: type must be icon`),console.assert(typeof e==`object`,`checkIcon: node must be an object`),typeof e.name!=`string`||e.name.length===0?`icon.name must be non-empty string`:Pn.includes(e.tone)?null:`icon.tone invalid`}function Jn(e){console.assert(e.type===`spark`,`checkSpark: type must be spark`),console.assert(typeof e==`object`,`checkSpark: node must be an object`);let t=e.points;if(!Array.isArray(t))return`spark.points must be array`;if(t.length>kn)return`spark.points exceeds 500`;for(let e of t)if(typeof e==`number`){if(!Number.isFinite(e))return`spark.points value must be finite`}else{if(!Hn(e))return`spark.points entry must be number or {t, v}`;if(typeof e.v!=`number`||!Number.isFinite(e.v))return`spark.points.v must be finite`;if(e.t!==void 0&&typeof e.t!=`string`)return`spark.points.t must be string`}return Bn.includes(e.kind)?e.tone!==void 0&&!Pn.includes(e.tone)?`spark.tone invalid`:null:`spark.kind invalid`}function Yn(e){return console.assert(e.type===`image`,`checkImage: type must be image`),console.assert(typeof e==`object`,`checkImage: node must be an object`),typeof e.src==`string`?Mn.test(e.src)?typeof e.alt==`string`?e.alt.length>jn?`image.alt exceeds 200 chars`:null:`image.alt must be string`:`image.src must be /api/ni/items//image`:`image.src must be string`}function Xn(e){if(console.assert(e.type===`gauge`,`checkGauge: type must be gauge`),console.assert(typeof e==`object`,`checkGauge: node must be an object`),typeof e.value!=`number`||!Number.isFinite(e.value))return`gauge.value must be finite`;if(typeof e.min!=`number`||!Number.isFinite(e.min))return`gauge.min must be finite`;if(typeof e.max!=`number`||!Number.isFinite(e.max))return`gauge.max must be finite`;if(e.max<=e.min)return`gauge.max must be > gauge.min`;if(e.tone!==void 0&&!Pn.includes(e.tone))return`gauge.tone invalid`;if(e.label!==void 0){if(typeof e.label!=`string`)return`gauge.label must be string`;if(e.label.length>An)return`gauge.label exceeds 200 chars`}return null}function Zn(e){if(console.assert(typeof e==`object`&&!!e,`checkLeaf: object required`),console.assert(typeof e.type==`string`,`checkLeaf: type must be string`),`when`in e)return`when key must be stripped server-side`;let t=e.type;if(Vn.has(t))return`reserved type refused: ${t}`;if(t===`repeat`)return`repeat must be expanded server-side before rendering`;if(t===`divider`)return null;if(t===`text`)return Un(e);if(t===`number`)return Wn(e);if(t===`chip`)return Gn(e);if(t===`bar`)return Kn(e);if(t===`icon`)return qn(e);if(t===`image`)return Yn(e);if(t===`spark`)return Jn(e);if(t===`gauge`)return Xn(e);if(t===`stack`)return Ln.includes(e.dir)?Rn.includes(e.gap)?Array.isArray(e.children)?null:`stack.children must be array`:`stack.gap invalid`:`stack.dir invalid`;if(t===`grid`){let t=e.cols;return typeof t!=`number`||t<2||t>4||!Number.isInteger(t)?`grid.cols must be 2..4`:Array.isArray(e.children)?null:`grid.children must be array`}return`unknown node type: ${t}`}function Qn(e){if(console.assert(e!==void 0,`validateBoundScene: root defined`),console.assert(arguments.length===1,`validateBoundScene: one arg`),!Hn(e))return`scene must be an object`;let t=[{node:e,depth:1}],n=0;for(;t.length>0;){let e=t.pop();if(!e)break;let{node:r,depth:i}=e;if(n+=1,n>En)return`scene exceeds 100 nodes`;if(i>Dn)return`scene exceeds depth 8`;if(!Hn(r))return`child must be an object`;let a=Zn(r);if(a)return a;let o=r.type===`stack`||r.type===`grid`?r.children:null;if(Array.isArray(o))for(let e of o){if(!Hn(e))return`child must be an object`;t.push({node:e,depth:i+1})}}return null}var $n=new Intl.NumberFormat(void 0,{notation:`compact`,maximumFractionDigits:1}),er=new Intl.NumberFormat(void 0,{style:`percent`,maximumFractionDigits:1}),tr=new Intl.NumberFormat(void 0,{style:`currency`,currency:`USD`}),nr=new Intl.NumberFormat(void 0,{maximumFractionDigits:2}),rr=new Intl.NumberFormat(void 0,{maximumSignificantDigits:3});function ir(e,t,n){if(console.assert(typeof e==`number`,`formatNumber: value must be number`),console.assert(zn.includes(t),`formatNumber: format in enum`),!Number.isFinite(e))return`—`;if(t===`percent`)return er.format(e);if(t===`currency`)return tr.format(e);let r=t===`compact`?$n.format(e):(e!==0&&Math.abs(e)<1?rr:nr).format(e),i=typeof n==`string`?n.trim():``;return i?`${r} ${i}`:r}var ar=150,or=240;function sr(e){return console.assert(e!=null,`extractV: point defined`),console.assert(typeof e==`number`||typeof e==`object`,`extractV: number or object`),typeof e==`number`?e:e.v}function cr(e){console.assert(Array.isArray(e),`seriesRange: array required`),console.assert(e.length>0,`seriesRange: non-empty`);let t=1/0,n=-1/0;for(let r of e){let e=sr(r);en&&(n=e)}return{vmin:t,vmax:n}}function lr(e,t,n){return console.assert(Number.isFinite(e),`normalized: v finite`),console.assert(n>=t,`normalized: max >= min`),n===t?.5:(e-t)/(n-t)}function ur(e,t,n){console.assert(Array.isArray(e),`sparkPath: array required`),console.assert(t>0&&n>0,`sparkPath: positive dims`);let r=e.length;if(r===0)return``;let{vmin:i,vmax:a}=cr(e),o=[],s=r===1?1:r-1;for(let c=0;c0&&n>0,`sparkBars: positive dims`);let r=e.length;if(r===0)return[];let{vmin:i,vmax:a}=cr(e),o=t/r,s=[];for(let t=0;t0,`polar: r > 0`),console.assert(Number.isFinite(t),`polar: degrees finite`);let n=t*Math.PI/180;return{x:e*Math.cos(n),y:e*Math.sin(n)}}function pr(e,t,n,r){console.assert(Number.isFinite(e),`gaugeArc: value finite`),console.assert(n>t,`gaugeArc: max > min`);let i=(Math.min(n,Math.max(t,e))-t)/(n-t),a=i*or,o=fr(r,ar),s=fr(r,ar+a);if(i===0)return{d:`M ${o.x.toFixed(2)} ${o.y.toFixed(2)}`,pct:i};let c=+(a>180);return{d:`M ${o.x.toFixed(2)} ${o.y.toFixed(2)} A ${r} ${r} 0 ${c} 1 ${s.x.toFixed(2)} ${s.y.toFixed(2)}`,pct:i}}var mr=m(`unrenderable`),hr=m(`
      `),gr=m(`
      `),_r=m(`
      `),vr=m(` `),yr=m(` `),br=m(`
      `),xr=m(``),Sr=m(`·`),Cr=m(`—`),wr=a(``),Tr=a(``),Er=a(``),Dr=a(``),Or=m(`
      `),kr=m(`
      `);function Ar(e,n){T(n,!0);let r=M(()=>Qn(n.node)),i={default:`var(--text)`,muted:`var(--muted)`,accent:`var(--accent)`,ok:`var(--ok)`,warn:`var(--warn)`,danger:`var(--danger)`},a={title:`font-size: var(--f-section); font-weight: 650`,label:`font-size: var(--f-label); color: var(--muted)`,value:`font-size: var(--f-h2); font-variant-numeric: tabular-nums`,caption:`font-size: var(--f-meta); color: var(--muted)`},s={sm:`var(--f-label)`,md:`var(--f-h2)`,lg:`var(--f-h1)`},c={sm:`var(--s-2)`,md:`var(--s-4)`};function l(e){return console.assert(typeof e==`string`,`toneStyle: tone is string`),console.assert(e in i,`toneStyle: tone in enum`),e==="default"?``:`color: ${i[e]}`}function m(e,t){console.assert(e in a,`textStyle: role in enum`),console.assert(t in i,`textStyle: tone in enum`);let n=a[e];return t==="default"?n:`${n}; color: ${i[t]}`}function g(e,t){return console.assert(typeof e==`number`,`barPct: value is number`),console.assert(typeof t==`number`&&t>0,`barPct: max > 0`),Math.min(100,Math.max(0,e/t*100))}let S=pr(1,0,1,40).d;function C(e){return console.assert(e===void 0||e in i,`sparkColor: tone in enum`),console.assert(typeof i==`object`,`sparkColor: TONE_VAR present`),i[e&&e!=="default"?e:`accent`]}function w(e,t,n){return console.assert(typeof e==`number`,`clampValue: v is number`),console.assert(n>t,`clampValue: hi > lo`),Math.min(n,Math.max(t,e))}var E=f(),O=y(E),j=e=>{var t=mr();o(()=>A(t,`title`,v(r))),d(e,t)},ee=e=>{var t=hr();let r;p(t,21,()=>n.node.children,P,(e,t)=>{Ar(e,{get node(){return v(t)}})}),k(t),o(()=>r=_(t,``,r,{"flex-direction":n.node.dir===`v`?`column`:`row`,gap:c[n.node.gap]})),d(e,t)},F=e=>{var t=gr();let r;p(t,21,()=>n.node.children,P,(e,t)=>{Ar(e,{get node(){return v(t)}})}),k(t),o(()=>r=_(t,``,r,{"grid-template-columns":`repeat(${n.node.cols}, minmax(0, 1fr))`})),d(e,t)},te=e=>{var t=_r();d(e,t)},I=e=>{var t=vr(),r=x(t,!0);o(e=>{_(t,e),N(r,n.node.value)},[()=>m(n.node.role,n.node.tone)]),d(e,t)},L=e=>{var t=yr(),r=x(t,!0);o((e,n)=>{_(t,e),N(r,n)},[()=>`font-size: ${s[n.node.size]}; font-variant-numeric: tabular-nums; ${l(n.node.tone)}`,()=>ir(n.node.value,n.node.format,n.node.unit)]),d(e,t)},R=e=>{ue(e,{get kind(){return n.node.kind},children:(e,t)=>{D();var r=u();o(()=>N(r,n.node.value)),d(e,r)},$$slots:{default:!0}})},re=e=>{var t=br();A(t,`aria-valuemin`,0);var r=x(t);o((e,i)=>{A(t,`aria-valuenow`,e),A(t,`aria-valuemax`,n.node.max),_(r,i)},[()=>Math.min(n.node.max,Math.max(0,n.node.value)),()=>`width: ${g(n.node.value,n.node.max)}%; background: ${i[n.node.tone==="default"?`accent`:n.node.tone]}`]),d(e,t)},z=e=>{var r=f(),i=y(r),a=e=>{var t=xr(),r=b(t);se(r,{get name(){return n.node.name}}),k(t),o(e=>_(t,e),[()=>l(n.node.tone)]),d(e,t)},s=M(()=>Object.hasOwn(oe,n.node.name)),c=e=>{var t=Sr();o(()=>A(t,`title`,`unknown icon: ${n.node.name}`)),d(e,t)};t(i,e=>{v(s)?e(a):e(c,-1)}),d(e,r)},ie=e=>{Tn(e,{get src(){return n.node.src},get alt(){return n.node.alt}})},B=e=>{var r=f(),i=y(r),a=e=>{var t=Cr();d(e,t)},s=e=>{var r=Er();A(r,`viewBox`,`0 0 200 30`);var i=b(r),a=e=>{var t=wr();o(e=>A(t,`points`,e),[()=>ur(n.node.points,200,30)]),d(e,t)},s=e=>{var t=f(),r=y(t);p(r,17,()=>dr(n.node.points,200,30),P,(e,t)=>{var n=Tr();o(()=>{A(n,`x`,v(t).x),A(n,`y`,v(t).y),A(n,`width`,v(t).w),A(n,`height`,v(t).h)}),d(e,n)}),d(e,t)};t(i,e=>{n.node.kind===`line`?e(a):e(s,-1)}),k(r),o(e=>_(r,e),[()=>`color: ${C(n.node.tone)}`]),d(e,r)};t(i,e=>{n.node.points.length===0?e(a):e(s,-1)}),d(e,r)},ae=e=>{var r=kr(),i=b(r),a=b(i),s=h(a),c=e=>{var t=Dr();o(e=>A(t,`d`,e),[()=>pr(n.node.value,n.node.min,n.node.max,40).d]),d(e,t)},l=M(()=>pr(n.node.value,n.node.min,n.node.max,40).pct>0);t(s,e=>{v(l)&&e(c)}),k(i);var u=h(i,2),f=x(u,!0),p=h(u,2),m=e=>{var t=Or(),r=x(t,!0);o(()=>N(r,n.node.label)),d(e,t)};t(p,e=>{n.node.label&&e(m)}),k(r),o((e,t,r)=>{A(i,`aria-label`,n.node.label??`gauge`),A(i,`aria-valuenow`,e),A(i,`aria-valuemin`,n.node.min),A(i,`aria-valuemax`,n.node.max),_(i,t),A(a,`d`,S),N(f,r)},[()=>w(n.node.value,n.node.min,n.node.max),()=>`color: ${C(n.node.tone)}`,()=>ir(n.node.value,`plain`)]),d(e,r)};t(O,e=>{v(r)?e(j):n.node.type===`stack`?e(ee,1):n.node.type===`grid`?e(F,2):n.node.type===`divider`?e(te,3):n.node.type===`text`?e(I,4):n.node.type===`number`?e(L,5):n.node.type===`chip`?e(R,6):n.node.type===`bar`?e(re,7):n.node.type===`icon`?e(z,8):n.node.type===`image`?e(ie,9):n.node.type===`spark`?e(B,10):n.node.type===`gauge`&&e(ae,11)}),d(e,E),ne()}var jr=new Set([`downloading`,`verifying`,`unpacking`,`self-testing`]),Mr=12,Nr=5,Pr=`page browser is busy`,Fr=`The page browser is unavailable on this machine, so this card can't update here. This isn't a failure — Settings → Status shows why.`,Ir=`The page browser is busy — try again in a moment.`;function Lr(e){console.assert(e==null||typeof e==`object`,`browserWaitLabel: flow shape`);let t=e?.browser;if(!t||typeof t!=`object`||!jr.has(t.phase))return``;let n=Number.isFinite(t.pct)?Math.min(100,Math.max(0,Math.round(t.pct))):0;return console.assert(n>=0&&n<=100,`browserWaitLabel: pct clamped`),`Preparing the page browser (${n}%)…`}function Rr(e){console.assert(e==null||typeof e==`object`,`tapClause: flow shape`);let t=e?.tap;if(!t||typeof t!=`object`||t.render_notice!==!0)return``;let n=Number.isInteger(t.site_cap)&&t.site_cap>0?` (up to ${t.site_cap})`:``;return console.assert(n===``||n.startsWith(` (up to `),`tapClause: the cap reads as a parenthesis`),`If the page needs SmartBrain's page browser, that one visit may also load the sites it depends on${n}.`}function zr(e){console.assert(typeof e.id==`string`,`renderDraftSites: a board row`);let t=e.draft;if(!t||t.reason!==`render_sites`||!Array.isArray(t.sites))return null;let n=[];for(let e of t.sites.slice(1,13))typeof e==`string`&&e.trim()!==``&&!n.includes(e)&&n.push(e);return console.assert(n.length<=Mr,`renderDraftSites: capped`),n.length>0?n:null}function Br(e){console.assert(Number.isInteger(e),`alsoLoadsLine: a whole count`);let t=Math.max(0,Math.trunc(e));return console.assert(t>=0,`alsoLoadsLine: never negative`),`This page also loads ${t} other site${t===1?``:`s`}`}function Vr(e){console.assert(typeof e.id==`string`,`renderNotice: a board row`);let t=e.rendered===!0&&e.render?.unavailable===!0;return console.assert(typeof t==`boolean`,`renderNotice: a verdict`),t?Fr:``}function Hr(e){console.assert(typeof e.id==`string`,`feedCandidates: a board row`);let t=e.preview?.feed_candidates;if(!Array.isArray(t))return[];let n=[];for(let e of t.slice(0,Nr))e&&typeof e.url==`string`&&e.url.startsWith(`https://`)&&typeof e.site==`string`&&!n.some(t=>t.url===e.url)&&n.push({url:e.url,site:e.site});return console.assert(n.length<=Nr,`feedCandidates: capped`),n}var Ur={render_busy:`busy`,render_unavailable:`unavailable`};function Wr(e){console.assert(e.length>0,`capacityOfCode: a code`);let t=Object.hasOwn(Ur,e)?Ur[e]:``;return console.assert(t===``||t===`busy`||t===`unavailable`,`capacityOfCode: closed answer`),t}function Gr(e){if(console.assert(!0,`errorCapacity: the fallback sentence`),!(e instanceof Error))return``;let{status:t,code:n}=e,r=typeof n==`string`&&n!==``?Wr(n):t===409&&e.message.includes(Pr)?`busy`:``;return console.assert(r===``||r===`busy`||r===`unavailable`,`errorCapacity: closed answer`),r}function Kr(e){if(console.assert(e==null||typeof e==`object`,`replyCapacity: reply shape`),!e)return``;let t=e.code,n=typeof t==`string`&&t!==``?Wr(t):e.run===`busy`?`busy`:e.kind===`render_unavailable`?`unavailable`:``;return console.assert(n===``||n===`busy`||n===`unavailable`,`replyCapacity: closed answer`),n}function qr(e){console.assert(e===``||e===`busy`||e===`unavailable`,`capacityNote: closed input`);let t=e===`busy`?Ir:e===`unavailable`?Fr:``;return console.assert(t!==``||e===``,`capacityNote: every answer has its note`),t}function Jr(e){console.assert(e===``||e===`busy`||e===`unavailable`,`confirmedNote: closed input`);let t=e===`busy`?`Confirmed — the page browser is busy, so the card checks its data on its next update.`:e===`unavailable`?`Confirmed — the page browser is unavailable on this machine, so the card can't check its data yet. Settings → Status shows why.`:``;return console.assert(t!==``||e===``,`confirmedNote: every answer has its note`),t}var Yr=m(`
    • `),Xr=m(`

      `),Zr=m(`

        Activate is your OK for every update of this card to load exactly these sites.

        `);function Qr(e,n){T(n,!0);let r=S(n,`busy`,3,!1),i=S(n,`error`,3,``);var a=Zr(),s=b(a),c=x(s),l=h(s,2);p(l,20,()=>n.sites,e=>e,(e,t)=>{var n=Yr(),r=x(n,!0);o(()=>N(r,t)),d(e,n)}),k(l);var u=h(l,4),f=b(u),m=x(f,!0);k(u);var g=h(u,2),_=e=>{var t=Xr(),n=x(t,!0);o(()=>N(n,i())),d(e,t)};t(g,e=>{i()&&e(_)}),k(a),o(e=>{N(c,`${e??``}:`),f.disabled=r(),N(m,r()?`Activating…`:`Activate`)},[()=>Br(n.sites.length)]),B(`click`,f,function(...e){n.onActivate?.apply(this,e)}),d(e,a),ne()}g([`click`]);var $r={no:`May not answer your question`,partly:`May not fully answer your question`},ei={no:`This card may not answer your question.`,partly:`This card may not fully answer your question.`};function ti(e){if(console.assert(!0,`readFit: a positive label cap`),!e||typeof e!=`object`||Array.isArray(e))return null;let{verdict:t,missing:n}=e;if(t!==`no`&&t!==`partly`||!Array.isArray(n))return null;let r=n.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>e.trim()).slice(0,3);return console.assert(r.length<=3,`readFit: at most FIT_MAX_MISSING labels`),{verdict:t,missing:r}}function ni(e){let t=ti(e);if(!t)return null;let n=t.missing.length>0?`Missing: ${t.missing.join(`, `)}`:null;return console.assert($r[t.verdict].length>0,`fitText: a chip for every verdict`),console.assert(n===null||n.startsWith(`Missing: `),`fitText: the detail names what is missing`),{chip:$r[t.verdict],detail:n}}function ri(e){let t=ti(e);if(!t)return``;let n=t.missing.length>0?` It lacks: ${t.missing.join(`, `)}.`:``;return console.assert(ei[t.verdict].endsWith(`.`),`fitLine: a whole sentence for every verdict`),console.assert(n===``||n.endsWith(`.`),`fitLine: the lacks clause is a sentence`),`${ei[t.verdict]}${n}`}function ii(e){return console.assert(e===void 0||typeof e==`object`,`asClirFaces: shape is object|undefined`),!e||typeof e!=`object`||e.desktop===void 0&&e.phone===void 0?null:{desktop:e.desktop,phone:e.phone}}function ai(e){if(console.assert(e!==void 0,`verifyOptions: payload defined`),console.assert(!Array.isArray(e),`verifyOptions: payload is the board's one bound node, not a list`),!e||typeof e!=`object`)return[];let t=e,n=t.type===`form`?ii(t.clir):null;if(!n)return[];let r={id:`pick`,clir:n,summary:typeof t.summary==`string`?t.summary:``,why:``},i=(Array.isArray(t.alternatives)?t.alternatives.slice(0,1):[])[0],a=i?ii(i.clir):null;if(!i||!a)return[r];let o=typeof i.summary==`string`?i.summary:``;return[r,{id:`second`,clir:a,summary:o,why:o?`Shown differently: ${o}`:`A different design of the same data.`}]}var oi=[[`answer`,`answer`],[`select`,`quantity`],[`where`,`filter`],[`time`,`time`],[`order`,`order`],[`limit`,`limit`],[`agg`,`count`]];function si(e){if(console.assert(oi.length>0,`coverageChips: the closed clause table`),console.assert(!Array.isArray(e),`coverageChips: coverage is a clause map, not a list`),!e||typeof e!=`object`)return[];let t=e,n=[];for(let[e,r]of oi){let i=t[e];i===`approximated`?n.push(`${r} approximated`):i===`unbound`&&n.push(`${r} not found`)}return console.assert(n.length<=oi.length,`coverageChips: at most one chip per clause`),n}function ci(e){console.assert(e==null||typeof e==`object`,`optionMaxWidth: clir is an object or null`);let t=e&&typeof e==`object`?e.span:void 0,n=typeof t==`string`?/^([dp])([1-4])x([1-3])$/.exec(t):null;return console.assert(n===null||n[1]===`d`||n[1]===`p`,`optionMaxWidth: device is d or p`),n?n[1]===`p`?n[2]===`1`?`160px`:`398px`:n[2]===`1`?`calc(50% - var(--s-2))`:null:null}var li=m(`
        `),ui=m(`

        `),di=m(`

        `),fi=m(``),pi=m(`

        Reads as

        `),mi=m(``),hi=m(`
        `),gi=m(`

        This is live data — is it right?

        `);function _i(e,n){T(n,!0);let r=S(n,`busy`,3,!1),i=S(n,`interpretation`,3,``),a=S(n,`coverage`,3,void 0),s=S(n,`fit`,3,null),c=M(()=>ai(n.payload)),l=M(()=>v(c).find(e=>e.id===`pick`)??null),f=M(()=>v(c).find(e=>e.id===`second`)??null),m=M(()=>si(a())),g=M(()=>ri(s())),y=R(`desktop`);L(()=>{O(y,window.matchMedia?.(`(max-width: 560px)`)?.matches?`phone`:`desktop`,!0)});function C(){console.assert(v(y)===`desktop`||v(y)===`phone`,`toggleFace: known face before flip`);let e=v(y)===`desktop`?`phone`:`desktop`;console.assert(e!==v(y),`toggleFace: flips to the other face`),O(y,e,!0)}function w(e){return console.assert(e.id===`pick`||e.id===`second`,`faceOf: known option id`),console.assert(v(y)===`desktop`||v(y)===`phone`,`faceOf: known face`),v(y)===`phone`?e.clir.phone:e.clir.desktop}function E(){console.assert(typeof document<`u`,`isLightNow: DOM available`);let e=document.documentElement.dataset.theme;return e===`light`||e!==`dark`&&(typeof window>`u`?null:window.matchMedia?.(`(prefers-color-scheme: light)`))?.matches===!0}let A=R(!1),j,P=!1;L(()=>{O(A,E(),!0)});function ee(){console.assert(typeof v(A)==`boolean`,`toggleTheme: light is boolean`),console.assert(typeof document<`u`,`toggleTheme: DOM available`),P||=(j=document.documentElement.dataset.theme,!0),O(A,!v(A)),document.documentElement.dataset.theme=v(A)?`light`:`dark`}te(()=>{P&&typeof document<`u`&&(j===void 0?document.documentElement.removeAttribute(`data-theme`):document.documentElement.dataset.theme=j)});var F=gi(),I=h(b(F),2),re=b(I),z=x(re,!0),ie=h(re,2),ae=x(ie,!0);k(I);var V=h(I,2),H=e=>{let t=M(()=>w(v(l)));var r=li();let i;Sn(b(r),{get clir(){return v(t)},get viewerTz(){return n.viewerTz}}),k(r),o(e=>i=_(r,``,i,{"max-width":e}),[()=>ci(v(t))]),d(e,r)};t(V,e=>{v(l)&&e(H)});var oe=h(V,2),se=e=>{let t=M(()=>w(v(f)));var r=ui();let i;var a=b(r),s=x(a,!0);Sn(h(a,2),{get clir(){return v(t)},get viewerTz(){return n.viewerTz}}),k(r),o(e=>{i=_(r,``,i,{"max-width":e}),N(s,v(f).why)},[()=>ci(v(t))]),d(e,r)};t(oe,e=>{v(f)&&e(se)});var ce=h(oe,2),le=e=>{var t=di(),n=x(t,!0);o(()=>N(n,v(g))),d(e,t)};t(ce,e=>{v(g)&&e(le)});var U=h(ce,2),de=e=>{var n=pi(),r=h(b(n),2),a=x(r,!0),s=h(r,2),c=e=>{var t=fi();p(t,20,()=>v(m),e=>e,(e,t)=>{ue(e,{children:(e,n)=>{D();var r=u();o(()=>N(r,t)),d(e,r)},$$slots:{default:!0}})}),k(t),d(e,t)};t(s,e=>{v(m).length>0&&e(c)}),k(n),o(()=>N(a,i())),d(e,n)};t(U,e=>{i()&&e(de)});var W=h(U,2),fe=e=>{var i=hi(),a=b(i),s=x(a,!0),c=h(a,2),l=e=>{var t=mi();o(()=>t.disabled=r()),B(`click`,t,()=>n.onUse(`second`)),d(e,t)};t(c,e=>{v(f)&&e(l)});var u=h(c,2);k(i),o(()=>{a.disabled=r(),N(s,r()?`Checking…`:`Use this`),u.disabled=r()}),B(`click`,a,()=>n.onUse(`pick`)),B(`click`,u,function(...e){n.onWrong?.apply(this,e)}),d(e,i)};t(W,e=>{v(l)&&e(fe)}),k(F),o(()=>{re.disabled=r(),N(z,v(y)===`desktop`?`Desktop`:`Phone`),ie.disabled=r(),N(ae,v(A)?`Light`:`Dark`)}),B(`click`,re,C),B(`click`,ie,ee),d(e,F),ne()}g([`click`]);var vi={extract_miss:`couldn't find the expected data`,fetch_failed:`couldn't reach the source`,image_type:`not a supported image`,llm_requires_local:`needs a local model`,mcp_unavailable:`your MCP server didn't answer`,secret_missing:`credential problem`,secret_host_mismatch:`credential problem`,render_refused:`the page browser wouldn't open this address`,render_timeout:`the page took too long in the page browser`,render_blocked:`the site turned the page browser away`,render_offsite:`the page moved to a site this card doesn't allow`,render_confinement:`the page browser's safety checks stopped the read`,render_oversize:`the page was too big for the page browser`,render_engine:`the page browser couldn't read the page`};function yi(e){console.assert(e==null||typeof e==`string`,`friendlyErrorClass: cls is string|null|undefined`),console.assert(typeof vi==`object`,`friendlyErrorClass: map present`);let t=typeof e==`string`?e.trim():``;return t?vi[t]??t:``}function bi(e){if(console.assert(e==null||typeof e==`object`,`flowStageLabel: flow is object|null|undefined`),console.assert(e==null||typeof e.state==`string`,`flowStageLabel: state is string when flow present`),!e)return``;let t=e.state;return(t===`failed`||t===`unsupported`?``:Lr(e))||(t===`intent`?`Understanding your request…`:t===`source`?e.error===`awaiting_pick`?`Waiting for you to pick a source on the card`:`Finding the source…`:t===`awaiting_access`?`Needs your key or contact email`:t===`sampling`?`Reading a sample…`:t===`mapping`?`Choosing the data fields…`:t===`assembling`?`Building the card…`:t===`awaiting_credential`?`Needs your API key`:t===`awaiting_params`?`Needs a detail from you`:t===`ready`?`Building the card…`:``)}function xi(e){return console.assert(e==null||typeof e==`object`,`isFlowActive: flow is object|null|undefined`),console.assert(e==null||typeof e.state==`string`,`isFlowActive: state is string when flow present`),e?e.state!==`failed`&&e.state!==`unsupported`:!1}function Si(e){console.assert(typeof e==`object`&&!!e,`awaitingYesSource: a is object`),console.assert(typeof e.host==`string`&&typeof e.title==`string`,`awaitingYesSource: strings`);let t=e.from===`page`?`web page`:`dataset`,n=e.host.trim(),r=e.title.trim(),i=r!==``&&r.toLowerCase()!==n.toLowerCase();return n?i?`From the ${t} ${n} — ${r}`:`From the ${t} at ${n}`:i?`From the ${t} “${r}”`:`From a ${t}`}function Ci(e){console.assert(e===void 0||Array.isArray(e),`pickRows: array or undefined`);let t=e??[],n=new Set,r=e=>!n.has(e.url)&&(n.add(e.url),!0),i=t.filter(e=>e.kind===`library`&&r(e)),a=t.filter(e=>e.kind===`link`&&/^https:\/\//.test(e.url)&&r(e));return{sources:i,links:a,heading:i.length>0?`From the SmartBrain Library — tap the one that fits:`:a.length>0?`No SmartBrain Library source answers this yet.`:`No SmartBrain Library source answers this yet — paste a link to the data:`}}function wi(e){console.assert(typeof e.host==`string`,`linkWhat: host is string`);let t=e.found===`dataset`?`dataset`:`web page`;return e.host.trim()?`${e.host.trim()} · ${t}`:t}function Ti(e,t,n){console.assert(Array.isArray(e),`filterTemplates: templates is array`),console.assert(typeof t==`string`,`filterTemplates: query is string`);let r=t.trim().toLowerCase(),i=n.trim();return!r&&!i?e:e.filter(e=>{if(i&&e.category!==i)return!1;if(!r||e.title.toLowerCase().includes(r)||e.goal.toLowerCase().includes(r)||e.category.toLowerCase().includes(r))return!0;for(let t of e.tags)if(t.toLowerCase().includes(r))return!0;return!1})}function Ei(e){console.assert(Array.isArray(e),`templateCategories: templates is array`),console.assert(e.every(e=>typeof e==`object`),`templateCategories: entries are objects`);let t=new Set;for(let n of e){let e=n.category?.trim();e&&t.add(e)}return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function Di(e,t){console.assert(Array.isArray(e),`validateParamForm: params is array`),console.assert(typeof t==`object`&&!!t,`validateParamForm: values is object`);for(let n of e){if(n.kind===`secret`)continue;let e=t[n.name],r=typeof e==`string`?e.trim():``;if(r.length===0)return{name:n.name,message:`${n.label} is required.`};if(n.kind===`number`&&!Number.isFinite(Number(r)))return{name:n.name,message:`${n.label} must be a number.`}}return null}function Oi(e,t){console.assert(Array.isArray(e),`paramValuesForInstall: params is array`),console.assert(typeof t==`object`&&!!t,`paramValuesForInstall: values is object`);let n={};for(let r of e){if(r.kind===`secret`)continue;let e=t[r.name],i=typeof e==`string`?e.trim():``;i.length!==0&&(n[r.name]=r.kind===`number`?Number(i):i)}return n}function ki(e){console.assert(e==null||typeof e==`string`,`formatFingerprint: fp is string|null|undefined`),console.assert(!0,`formatFingerprint: total`);let t=typeof e==`string`?e.trim():``;return t?`Publisher ${t}`:`Unknown publisher`}function Ai(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ji(e){console.assert(e==null||typeof e==`object`,`stagesFromSpec: spec is object|null|undefined`),console.assert(!Array.isArray(e),`stagesFromSpec: spec is not an array`);let t={extract:null,transform:null};if(!Ai(e))return t;let n=e.pipeline;if(!Array.isArray(n))return t;for(let e of n)Ai(e)&&(e.op===`extract`&&Ai(e.paths)?t.extract===null&&(t.extract=e.paths):e.op===`transform`&&Array.isArray(e.apply)&&t.transform===null&&(t.transform=e.apply));return t}function Mi(e){if(console.assert(e===null||typeof e==`object`||e===void 0,`formatStageJson: value is object|null|undefined`),console.assert(!0,`formatStageJson: total`),e==null)return`(none)`;try{return JSON.stringify(e,null,2)}catch{return`(unserializable)`}}var Ni=m(`

        `),Pi=m(``),Fi=m(` `,1),Ii=m(`
        `),Li=m(`
        Needs your
        `),Ri=m(`
        `),zi=m(`
        Needs
        `),Bi=m(`

        Creation didn’t finish. Delete this card, or start again above.

        `),Vi=m(`
        `),Hi=m(`

        Is this what you asked for?

        `),Ui=m(`

        Confirmed — verifying, this card goes live after the next successful refresh.

        `),Wi=m(`

        This is live data — is it right?

        `),Gi=m(` `,1),Ki=m(` `,1),qi=m(``),Ji=m(`
        ⋯
        `),Yi=m(`
        `),Xi=m(`

        `),Zi=m(``),Qi=m(`
        `,1),$i=m(`
        `,1),ea=m(` `,1),ta=m(``),na=m(``),ra=m(`
        `),ia=m(`

        `),aa=m(`

        `,1),oa=m(`

        Finding a source for this…

        `),sa=m(`

        `),ca=m(`

        Needs your own free key — you'll paste it next

        `),la=m(`

        Asks for your contact email once

        `),ua=m(`
        `),da=m(`
        `),fa=m(`
      • `),pa=m(` `,1),ma=m(`

        `),ha=m(`

        `),ga=m(`Get one here, + then paste it below.`,1),_a=m(`

        `,1),va=m(`

        `,1),ya=m(`

        `),ba=m(`
        `),xa=m(`

        First run failed —

        `),Sa=m(`

        Waiting for the first run…

        `),Ca=m(` `,1),wa=m(`
        `),Ta=m(`

        `),Ea=m(` `,1),Da=m(` `,1),Oa=m(` `,1),ka=m(`

        Couldn’t load this proposal.

        `),Aa=m(`

        Current mapping

        extract

         

        transform

         

        Proposed mapping

        extract

         

        transform

         
        `),ja=m(` `,1),Ma=m(`

        `),Na=m(` `,1),Pa=m(` `,1),Fa=m(` `,1),Ia=m(` `,1),La=m(` `,1),Ra=m(` `,1),za=m(`

        No runs recorded yet.

        `),Ba=m(` `),Va=m(`
      • `),Ha=m(`
          `),Ua=m(` `,1),Wa=m(`

          The library publisher’s key changed — updates are blocked.

          Pinned (trusted)
          Offered (new)

          This is either the publisher rotating their key — or someone impersonating them. Verify + the offered fingerprint with the publisher out-of-band before trusting it.

          `),Ga=m(`
          `,1),Ka=m(`
        • `),qa=m(`
          — credential — you’ll add it on the card after install.
          `),Ja=m(``),Ya=m(`
          `,1),Xa=m(`
            `,1),Za=m(` `),Qa=m(`

            `),$a=m(`

            The library host has been unreachable for a while — checks are paused. Check now to retry.

            `),eo=m(``),to=m(``),no=m(`

            No templates match that search.

            `),ro=m(`

            `),io=m(`
            • `),ao=m(`
                `),oo=m(`
                `,1),so=m(` `,1),co=m(`

                Neural Interface

                Live data you asked for, on one board. Type it below — “show me AAPL every 5 minutes”.

                `,1);function lo(i,a){T(a,!0);let s=R(e([])),m=R(!1),g=R(``),_=R(null),S=R(!1),I=null,re=0,oe=R(null),me=R(``),he=`https://smartbrain.securecloudgroup.com/ni/library.json`,ge=R(!1),G=R(null),Te=R(!1),Ee=R(``),De=R(he),K=R(!1),Oe=R(``),ke=R(``),Ae=R(null),je=R(e({})),Me=R(!1),Ne=R(``),Pe=R(``),Fe=R(``),Le=R(!1),Re=R(``),ze=R(null),Ve=R(!1),He=R(null),Ue=R(null),We=R(!1),Ge=R(!1),Ke=M(()=>v(Ue)?ji(v(Ue).spec):{extract:null,transform:null}),qe=M(()=>qt(v(Ue))),Je=R(null),Ye=R(null),Xe=R(!1),Ze=R(!1),Qe=R(``),$e=R(!0),et=R(!1),q=R(null),J=R(``),tt=R(``),Y=R(``),X=R(``),nt=R(!1),Z=R(!1),rt=R(``),it=R(``),at=R(``),ot=R(``),st=R(null),ct=R(``),lt=R(``),ut=R(!1),dt=R(``),ft=R(null),pt=R(``),mt=R(!1);function ht(e){console.assert(v(ft)===null,`openRefine: one at a time`),O(ft,e,!0),O(pt,``)}async function gt(){if(!v(ft)||v(mt))return;let e=v(ft),t=v(pt).trim();if(!(t.length<3)){O(mt,!0);try{let n=await V.niRefine(e.id,t);O(ft,null),O(pt,``),U(n.kind===`cadence`?`Update schedule changed.`:n.kind===`source_change`?`Okay — pick a new source on the card.`:`Rebuilding the card from your note.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(mt,!1)}}}let Q=R(e({})),_t=R(``);async function vt(e,t){console.assert(e.flow?.state===`source`,`pickSource: pause required`);let n=(t??v(it)).trim();if(!(n.length<8)){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let r=await V.niFlowPickSource(e.id,n,t===void 0);O(it,``),U(r.needs&&r.needs.length>0?`This source needs one more thing — see the card.`:r.started===!1?`Source set — it starts as soon as a build slot frees up.`:`Source set — sampling it now.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t work — check the URL.`},!0)}finally{O(_,null)}}}async function yt(e){console.assert(e.flow?.state===`awaiting_access`,`giveAccess: pause required`);let t=e.flow?.access;if(!t)return;let n=v(at).trim(),r=v(ot).trim();if(!(t.key&&!n||t.contact&&!r)){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let i=await V.niFlowAccess(e.id,t.key?n:void 0,t.contact?r:void 0);O(at,``),O(ot,``),U(i.started?`Thanks — building the card now.`:`Saved.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t work — try again.`},!0)}finally{O(_,null)}}}async function bt(e){console.assert(typeof e.id==`string`,`answerDate: id required`);let t=v(_t).trim();if(t){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowAnswer(e.id,`supply_date`,t),O(_t,``),U(`Date set — building the card.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That date didn’t work — use YYYY-MM-DD.`},!0)}finally{O(_,null)}}}async function xt(e,t){console.assert(typeof e.id==`string`,`answerConsent: id required`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowAnswer(e.id,`model_consent`,t),U(t===`allow`?`Building the card.`:`Building the card on your local model.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function St(e){console.assert(typeof e.id==`string`,`reopenPick: id required`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowReopen(e.id),U(`Okay — pick a source below.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`Couldn’t reopen the pick.`},!0)}finally{O(_,null)}}function Ct(e){let t=e.target;for(let e of document.querySelectorAll(`details.ni-more[open]`))(!t||!e.contains(t)||t.closest(`.ni-more-menu`))&&(e.open=!1)}async function wt(e){O(_,e.id,!0);try{await V.niFlowFix(e.id),U(`Fixing — re-reading the card's source.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}function Tt(e){console.assert(v(st)===null,`openEdit: no other edit open`),O(st,e,!0),O(ct,e.title,!0),O(lt,String(e.interval_minutes),!0),O(dt,``)}function Et(){console.assert(v(ut)===!1,`closeEdit: not while saving`),O(st,null),O(ct,``),O(lt,``),O(dt,``)}async function Dt(){console.assert(v(st)!==null,`submitEdit: target required`);let e=v(st);if(!e||v(ut))return;let t=v(ct).trim(),n=parseInt(v(lt),10);if(!t||!Number.isFinite(n)||n<1)O(dt,`A name and a cadence of at least 1 minute are required.`);else{O(ut,!0),O(dt,``);try{await V.niPatch(e.id,{title:t,interval_minutes:n}),Et(),U(`Card updated.`),await $()}catch(e){O(dt,W(e),!0)}finally{O(ut,!1)}}}let Ot=R(``),kt=R(!1),At=R(``),jt=R(void 0);async function Mt(){console.assert(v(kt)===!1,`submitComposer: no concurrent submit`);let e=v(Ot).trim();if(!(e.length<3||v(kt))){O(kt,!0),O(At,``);try{let t=await V.niIntake(e);O(Ot,``),U(t.started===!1?`Card created — it starts as soon as a build slot frees up.`:`Card started — watch it build below.`),await $()}catch(e){O(At,W(e),!0)}finally{O(kt,!1)}}}async function Nt(e){console.assert(typeof e.id==`string`,`retryFlow: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let t=await V.niFlowRetry(e.id);U(t.started===!1?`Retry queued — it starts as soon as a build slot frees up.`:`Retrying the card build.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}let Pt=R(null),Ft=R(``),It=R(``),Lt=R(``),Rt=R(!1),zt=R(``),Bt=R(null),Vt=R(null),Ht=R(!1),Ut=R(``),Wt=M(()=>v(G)?.templates?Ti(v(G).templates,v(Oe),v(ke)):[]),Gt=M(()=>v(G)?.templates?Ei(v(G).templates):[]),Kt=M(()=>v(Ae)?Di(v(Ae).params,v(je)):null);function qt(e){if(console.assert(e===null||typeof e==`object`,`readProposedStages: detail is object|null`),console.assert(e===null||e.spec!==void 0,`readProposedStages: spec present when detail present`),!e)return{extract:null,transform:null};let t=e.spec._l2_proposal;if(!t||typeof t!=`object`||Array.isArray(t))return{extract:null,transform:null};let n=t.stages;if(!n||typeof n!=`object`||Array.isArray(n))return{extract:null,transform:null};let r=n;return{extract:r.extract&&typeof r.extract==`object`&&!Array.isArray(r.extract)?r.extract:null,transform:Array.isArray(r.transform)?r.transform:null}}async function Jt(){if(console.assert(typeof V.niLibrary==`function`,`openLibrary: niLibrary present`),console.assert(v(ge)===!1||v(ge)===!0,`openLibrary: libraryOpen boolean`),O(ge,!0),O(Ee,``),v(G)===null){O(Te,!0);try{O(G,await V.niLibrary(),!0),v(G).url&&O(De,v(G).url,!0)}catch(e){O(Ee,W(e),!0)}finally{O(Te,!1)}}}function Yt(){console.assert(v(K)===!1,`closeLibrary: never close while a request is in flight`),console.assert(v(Me)===!1,`closeLibrary: never close mid-install`),O(ge,!1),O(Oe,``),O(ke,``),O(Ae,null),O(je,{},!0),O(Ne,``),O(Pe,``),O(Fe,``),O(Re,``),O(Ee,``)}async function Xt(){console.assert(typeof v(De)==`string`,`connectLibrary: url is string`),console.assert(v(K)===!1,`connectLibrary: no concurrent request`);let e=v(De).trim();if(e&&!v(K)){O(K,!0),O(Ee,``);try{O(G,await V.niLibraryConnect(e),!0)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function Zt(){if(console.assert(v(G)?.connected===!0,`checkLibraryNow: only when connected`),console.assert(v(K)===!1,`checkLibraryNow: no concurrent request`),!v(K)){O(K,!0),O(Ee,``);try{O(G,await V.niLibraryCheck(),!0)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function Qt(){if(console.assert(v(G)?.connected===!0,`disconnectLibrary: only when connected`),console.assert(v(K)===!1,`disconnectLibrary: no concurrent request`),await ce({title:`Disconnect from this library?`,body:`Templates you already installed as items stay on your board. You can reconnect any time.`,confirmLabel:`Disconnect`,danger:!0})){O(K,!0),O(Ee,``);try{await V.niLibraryDisconnect(),O(G,{connected:!1},!0),O(Oe,``),O(ke,``)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function $t(){console.assert(!!v(G)?.blocked,`trustLibraryKey: only while blocked`),console.assert(typeof v(Fe)==`string`,`trustLibraryKey: passphrase is string`);let e=v(G)?.blocked?.offered_fingerprint;if(e&&v(Fe)&&!v(Le)){O(Le,!0),O(Re,``);try{O(G,await V.niLibraryTrustKey(e,v(Fe)),!0),O(Fe,``)}catch(e){O(Re,W(e),!0)}finally{O(Le,!1)}}}function en(e){console.assert(typeof e.id==`string`,`startInstall: template id is string`),console.assert(Array.isArray(e.params),`startInstall: params is array`),O(Ae,e,!0),O(je,{},!0),O(Ne,``),O(Pe,``)}function tn(){console.assert(v(Me)===!1,`cancelInstall: not while installing`),console.assert(typeof v(Ne)==`string`,`cancelInstall: installError is string`),O(Ae,null),O(je,{},!0),O(Ne,``)}async function nn(){console.assert(v(Ae)!==null,`submitInstall: template picked`),console.assert(v(Me)===!1,`submitInstall: no concurrent install`);let e=v(Ae);if(!e||v(Me))return;let t=Di(e.params,v(je));if(t)O(Ne,t.message,!0);else{O(Me,!0),O(Ne,``);try{let t=Oi(e.params,v(je)),n=(await V.niLibraryInstall(e.id,t)).needs_credentials?.length?` (credentials still needed)`:``;O(Pe,`Added as a draft — open its card to add credentials and Activate.${n}`),O(Ae,null),O(je,{},!0),await $()}catch(e){O(Ne,W(e),!0)}finally{O(Me,!1)}}}function rn(e){console.assert(e.template_update===!0,`openTemplateUpdate: chip must be present`),console.assert(v(ze)===null,`openTemplateUpdate: no other update prompt open`),O(ze,e,!0)}async function an(){console.assert(v(ze)!==null,`applyTemplateUpdate: target must be set`),console.assert(v(Ve)===!1,`applyTemplateUpdate: no concurrent apply`);let e=v(ze);if(e&&!v(Ve)){O(Ve,!0),O(_,e.id,!0);try{await V.niApplyTemplateUpdate(e.id),O(ze,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ve,!1),O(_,null)}}}function on(e){console.assert(e===null||typeof e==`object`,`readRepairPolicy: detail is object|null`),console.assert(e===null||e.spec!==void 0,`readRepairPolicy: spec present when detail present`);let t={l1:!0,l2_frontier:!1};if(!e)return t;let n=e.spec.repair_policy;if(!n||typeof n!=`object`||Array.isArray(n))return t;let r=n;return{l1:typeof r.l1==`boolean`?r.l1:t.l1,l2_frontier:typeof r.l2_frontier==`boolean`?r.l2_frontier:t.l2_frontier}}async function sn(e){console.assert(typeof e.id==`string`,`openRepair: id is string`),console.assert(v(Je)===null,`openRepair: no other repair modal open`),O(Je,e,!0),O(Ye,null),O(Qe,``),O(Xe,!0);try{O(Ye,await V.niItem(e.id),!0);let t=on(v(Ye));O($e,t.l1,!0),O(et,t.l2_frontier,!0)}catch(e){O(Qe,W(e),!0)}finally{O(Xe,!1)}}function cn(){console.assert(v(Ze)===!1,`closeRepair: not while save in flight`),console.assert(typeof v(Xe)==`boolean`,`closeRepair: repairLoading is boolean`),O(Je,null),O(Ye,null),O(Qe,``)}async function ln(){console.assert(v(Je)!==null,`saveRepair: a target must be set`),console.assert(v(Ze)===!1,`saveRepair: no concurrent save`);let e=v(Je);if(e&&!v(Ze)){O(Ze,!0),O(Qe,``);try{await V.niRepairPolicy(e.id,{l1:v($e),l2_frontier:v(et)}),O(Je,null),O(Ye,null)}catch(e){O(Qe,W(e),!0)}finally{O(Ze,!1)}}}async function un(e){console.assert(e.l2_proposal===!0,`openProposal: chip must be present`),console.assert(v(He)===null,`openProposal: no other proposal open`),O(He,e,!0),O(Ue,null),O(We,!0);try{O(Ue,await V.niItem(e.id),!0)}catch(e){let t=W(e);t&&O(g,t,!0),O(He,null)}finally{O(We,!1)}}function dn(){console.assert(v(Ge)===!1,`closeProposal: not while apply/dismiss in flight`),console.assert(typeof v(We)==`boolean`,`closeProposal: proposalLoading is boolean`),O(He,null),O(Ue,null)}async function fn(){console.assert(v(He)!==null,`applyProposal: a target must be set`),console.assert(v(Ge)===!1,`applyProposal: no concurrent apply`);let e=v(He);if(e&&!v(Ge)){O(Ge,!0),O(_,e.id,!0);try{await V.niL2Apply(e.id),O(He,null),O(Ue,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ge,!1),O(_,null)}}}async function pn(){console.assert(v(He)!==null,`dismissProposal: a target must be set`),console.assert(v(Ge)===!1,`dismissProposal: no concurrent dismiss`);let e=v(He);if(e&&!v(Ge)&&await ce({title:`Dismiss proposed fix?`,body:`Dismiss this proposed fix? It won't be offered again for this breakage.`,confirmLabel:`Dismiss`,danger:!0})){O(Ge,!0),O(_,e.id,!0);try{await V.niL2Dismiss(e.id),O(He,null),O(Ue,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ge,!1),O(_,null)}}}function mn(e){if(console.assert(e===null||typeof e==`object`,`hostFromSpec: detail is object|null`),console.assert(e===null||typeof e.spec==`object`,`hostFromSpec: spec present when detail present`),!e)return``;let t=e.spec.source;if(!t||typeof t!=`object`||Array.isArray(t))return``;let n=t.url;if(typeof n!=`string`||n.length===0)return``;try{return new URL(n).hostname}catch{return``}}function hn(e){if(console.assert(typeof e.state==`string`,`firstRunFailure: state is string`),console.assert(typeof e.consecutive_failures==`number`,`firstRunFailure: failures is number`),e.state!==`commissioning`&&e.state!==`live`&&e.state!==`degraded`&&e.state!==`failing`||e.payload!==null||e.consecutive_failures<=0)return{show:!1,friendly:``,raw:``,attempts:0,tried:``};let t=typeof e.last_status==`string`?e.last_status:``;return{show:!0,friendly:yi(t),raw:t,attempts:e.consecutive_failures,tried:_e(e.last_checked)}}async function gn(e,t){console.assert(typeof t.name==`string`,`openCredential: name is string`),console.assert(v(q)===null,`openCredential: no other credential modal open`),O(q,e,!0),O(J,t.name,!0),O(tt,t.label,!0),O(Y,``),O(X,``),O(rt,``),O(nt,!0);try{let t=await V.niItem(e.id);O(X,mn(t),!0)}catch(e){O(rt,W(e),!0)}finally{O(nt,!1)}}function _n(){console.assert(v(Z)===!1,`closeCredential: not while save in flight`),console.assert(typeof v(Y)==`string`,`closeCredential: value is string`),O(q,null),O(J,``),O(tt,``),O(Y,``),O(X,``),O(rt,``)}async function vn(){console.assert(v(q)!==null,`submitCredential: a target must be set`),console.assert(v(Z)===!1,`submitCredential: no concurrent save`);let e=v(q),t=v(Y),n=v(X).trim();if(e&&t&&n&&!v(Z)){O(Z,!0),O(rt,``);try{await V.niPutCredential(e.id,v(J),t,n);let r=v(tt);_n(),U(`Saved the ${r} key.`),await $()}catch(e){O(rt,W(e),!0)}finally{O(Z,!1)}}}function yn(e,t){console.assert(typeof t.name==`string`,`openParam: name is string`),console.assert(v(Pt)===null,`openParam: no other param modal open`),O(Pt,e,!0),O(Ft,t.name,!0),O(It,t.label,!0),O(Lt,``),O(zt,``)}function bn(){console.assert(v(Rt)===!1,`closeParam: not while save in flight`),O(Pt,null),O(Ft,``),O(It,``),O(Lt,``),O(zt,``)}async function xn(){console.assert(v(Pt)!==null,`submitParam: a target must be set`),console.assert(v(Rt)===!1,`submitParam: no concurrent save`);let e=v(Pt),t=v(Lt).trim();if(e&&t&&!v(Rt)){O(Rt,!0),O(zt,``);try{await V.niPutParam(e.id,v(Ft),t);let n=v(It);bn(),U(`Saved ${n}.`),await $()}catch(e){O(zt,W(e),!0)}finally{O(Rt,!1)}}}async function Cn(e){console.assert(typeof e.id==`string`,`openHistory: id is string`),console.assert(v(Bt)===null,`openHistory: no other history modal open`),O(Bt,e,!0),O(Vt,null),O(Ut,``),O(Ht,!0);try{O(Vt,await V.niItem(e.id),!0)}catch(e){O(Ut,W(e),!0)}finally{O(Ht,!1)}}function wn(){console.assert(typeof v(Ht)==`boolean`,`closeHistory: loading is boolean`),console.assert(v(Bt)===null||v(Bt)!==void 0,`closeHistory: target shape`),O(Bt,null),O(Vt,null),O(Ut,``)}async function $(){if(console.assert(typeof V.niBoard==`function`,`load: niBoard method present`),console.assert(Array.isArray(v(s)),`load: items array`),!H.status?.unlocked)return;let e=++re;try{let t=await V.niBoard();if(e!==re)return;O(s,[...t.items].sort((e,t)=>e.position-t.position),!0),O(g,``)}catch(t){if(e!==re)return;let n=W(t);n&&O(g,n,!0)}finally{e===re&&O(m,!0)}}function Tn(){console.assert(typeof document<`u`,`onVisible: DOM available`),console.assert(document.visibilityState!==void 0,`onVisible: visibilityState present`),document.visibilityState===`visible`&&$()}L(async()=>{H.status===null&&await H.load();let e=H.status;if(e&&!e.initialized)return ae(`/setup`);if(e&&!e.unlocked)return ae(`/unlock`);$(),I=setInterval(()=>{document.visibilityState===`visible`&&$()},1e4),document.addEventListener(`visibilitychange`,Tn),typeof location<`u`&&location.hash===`#templates`&&(history.replaceState(null,``,location.pathname+location.search),Jt())}),te(()=>{I&&clearInterval(I),document.removeEventListener(`visibilitychange`,Tn)}),l(()=>{console.assert(H.status?.unlocked!==void 0||H.status===null,`$effect: unlocked accessed`),console.assert(re>=0,`$effect: gen counter present`),H.status?.unlocked&&$()}),l(()=>{if(console.assert(Array.isArray(v(s)),`$effect fast-poll: items array`),console.assert(typeof xi==`function`,`$effect fast-poll: helper present`),!v(s).some(e=>xi(e.flow??null)))return;let e=setInterval(()=>{document.visibilityState===`visible`&&$()},3e3);return()=>clearInterval(e)});function En(e){console.assert(typeof e.state==`string`,`healthChip: state is string`),console.assert(typeof e.interval_minutes==`number`,`healthChip: interval is number`);let t=e.state;return t===`draft`?{kind:``,label:`Preview`}:t===`commissioning`&&e.awaiting_yes?{kind:`accent`,label:`Needs your OK`}:t===`commissioning`?{kind:`accent`,label:`Commissioning`}:t===`broken`?{kind:`danger`,label:`Broken`}:t===`failing`?{kind:`warn`,label:`Failing`}:t===`degraded`?{kind:`warn`,label:`Degraded`}:t===`paused`?{kind:``,label:`Paused`}:ve(e.payload_at,e.interval_minutes)?{kind:`warn`,label:`Stale`}:{kind:`ok`,label:`Live`}}async function Dn(e){console.assert(typeof e.id==`string`,`runNow: id is string`),console.assert(v(_)===null||v(_)===e.id,`runNow: busy id matches or null`),O(_,e.id,!0);try{let t=await V.niRun(e.id),n=Kr(t);n?U(qr(n)):t.status===`error`&&O(g,t.kind?`Run failed (${t.kind}).`:`Run failed.`,!0),await $()}catch(e){let t=Gr(e);if(t)U(qr(t));else{let t=W(e);t&&O(g,t,!0)}}finally{O(_,null)}}async function On(e){console.assert(typeof e.id==`string`,`togglePause: id is string`),console.assert(typeof e.enabled==`boolean`,`togglePause: enabled is boolean`),O(_,e.id,!0);try{await V.niPatch(e.id,{enabled:!e.enabled}),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function kn(e){if(console.assert(typeof e.id==`string`,`remove: id is string`),console.assert(typeof e.title==`string`,`remove: title is string`),await ce({title:`Delete this item?`,body:`Delete “${e.title}” from your Neural Interface? Its history is removed too.`,confirmLabel:`Delete`,danger:!0})){O(_,e.id,!0);try{await V.niDelete(e.id),O(s,v(s).filter(t=>t.id!==e.id),!0)}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}}async function An(e){console.assert(e.state===`draft`,`activate: only drafts`),console.assert(typeof e.id==`string`,`activate: id is string`),O(_,e.id,!0);try{await V.niCommission(e.id),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function jn(e){console.assert(e.draft?.reason===`render_sites`,`activateSites: a draft waiting for its sites`),console.assert(typeof e.id==`string`,`activateSites: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niActivate(e.id),U(`Activated — check the card's reading.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function Mn(e,t){console.assert(Hr(e).some(e=>e.url===t),`switchFeed: one of the card's feeds`),console.assert(typeof e.id==`string`,`switchFeed: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let n=await V.niSwitchFeed(e.id,t);U(n.started===!1?`Switching to the feed — it starts as soon as a build slot frees up.`:`Switching to the feed — rebuilding the card from it.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function Nn(e,t){console.assert(e.state===`commissioning`,`validateLooksRight: only commissioning`),console.assert(typeof e.id==`string`,`validateLooksRight: id is string`),O(_,e.id,!0);try{let n=await V.niValidate(e.id,!0,void 0,t);U(Jr(Kr(n))||(n.state===`live`?`Confirmed — the card is live.`:`Confirmed — verifying with a fresh refresh.`)),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function Pn(e){console.assert(e.state===`commissioning`,`declineReading: only commissioning`),console.assert(!!e.awaiting_yes,`declineReading: only a card awaiting the user's YES`),O(_,e.id,!0);try{let t=await V.niValidate(e.id,!1);U(t.repick===`repick`?`Pick another source — that one won't be offered again.`:`Looking for another source…`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}function Fn(e){console.assert(e.state===`commissioning`,`openWrongNote: only commissioning`),console.assert(v(oe)===null,`openWrongNote: no other note prompt open`),O(oe,e,!0),O(me,``)}async function In(){if(console.assert(v(oe)!==null,`submitWrongNote: a target must be set`),console.assert(typeof v(me)==`string`,`submitWrongNote: note is string`),!v(oe)||v(S))return;let e=v(oe);O(_,e.id,!0),O(S,!0);try{await V.niValidate(e.id,!1,v(me).trim()||void 0),O(oe,null),O(me,``),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null),O(S,!1)}}let Ln=R(!1),Rn=typeof window<`u`?window.matchMedia(`(max-width: 560px)`):null;function zn(){O(Ln,Rn?.matches??!1,!0)}L(()=>(zn(),Rn?.addEventListener(`change`,zn),()=>Rn?.removeEventListener(`change`,zn)));let Bn=(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}})();function Vn(e){if(console.assert(e!==void 0,`pickClir: payload defined`),console.assert(typeof v(Ln)==`boolean`,`pickClir: phoneLayout boolean`),!e||typeof e!=`object`)return null;let t=e;if(t.type!==`form`||!t.clir||typeof t.clir!=`object`)return null;let n=t.clir;return v(Ln)?n.phone??n.desktop??null:n.desktop??n.phone??null}var Hn=f();n(`click`,c,Ct);var Un=y(Hn),Wn=e=>{var i=co(),a=y(i),c=h(b(a),2);k(a);var l=h(a,4),T=b(l);j(T),ee(T,e=>O(jt,e),()=>v(jt));var te=h(T,2),I=x(te,!0);k(l);var L=h(l,2),ne=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(At))),d(e,t)};t(L,e=>{v(At)&&e(ne)});var R=h(L,2),re=e=>{de(e,{block:!0})},V=e=>{fe(e,{icon:`monitor`,title:`Nothing on your Neural Interface yet`,body:`Type what you want to watch in the box above — “show me AAPL every 5 minutes” — then approve the source on the card.`,children:(e,t)=>{var n=Pi();B(`click`,n,()=>v(jt)?.focus()),d(e,n)},$$slots:{default:!0}})},H=e=>{var i=wa();p(i,21,()=>v(s),e=>e.id,(e,i)=>{let a=M(()=>En(v(i))),s=M(()=>v(i).state===`draft`),c=M(()=>Vn(v(i).payload)),l=M(()=>Se(v(i).display?.size,v(c))),m=M(()=>ye(v(i))),g=M(()=>v(m)===`failing`?`${yi(v(i).last_status)} · last tried ${_e(v(i).last_checked)}`:``),S=M(()=>Vr(v(i))),C=M(()=>zr(v(i))),w=M(()=>ni(v(i).fit));{let T=e=>{var n=Fi(),r=y(n),s=e=>{ue(e,{get kind(){return v(a).kind},children:(e,t)=>{D();var n=u();o(()=>N(n,v(a).label)),d(e,n)},$$slots:{default:!0}})};t(r,e=>{v(m)!==`fresh`&&e(s)});var c=h(r,2),l=e=>{ue(e,{kind:``,title:`This card includes a language model's reading of the data, not pure arithmetic.`,children:(e,t)=>{D();var n=u(`Interpreted`);d(e,n)},$$slots:{default:!0}})};t(c,e=>{v(i).interpreted&&e(l)});var f=h(c,2),p=e=>{ue(e,{kind:`accent`,onclick:()=>rn(v(i)),title:`The library updated this card's template — click to review and apply`,children:(e,t)=>{D();var n=u(`Update available`);d(e,n)},$$slots:{default:!0}})};t(f,e=>{v(i).template_update&&e(p)});var g=h(f,2),_=e=>{ue(e,{kind:`accent`,onclick:()=>un(v(i)),title:`A proposed fix from Claude — click to review`,children:(e,t)=>{D();var n=u(`Fix proposed`);d(e,n)},$$slots:{default:!0}})};t(g,e=>{v(i).l2_proposal&&e(_)});var b=h(g,2),x=e=>{ue(e,{kind:``,title:`This card's template is no longer in the library`,children:(e,t)=>{D();var n=u(`No longer in library`);d(e,n)},$$slots:{default:!0}})};t(b,e=>{v(i).template_gone&&e(x)}),d(e,n)},E=e=>{var n=Fi(),r=y(n),a=e=>{var t=Ii(),n=b(t),r=x(n,!0);k(t),o(()=>{n.disabled=v(_)===v(i).id,N(r,v(_)===v(i).id?`Fixing…`:`Fix`)}),B(`click`,n,()=>wt(v(i))),d(e,t)};t(r,e=>{!v(i).shell&&!v(i).flow&&(v(i).state===`failing`||v(i).state===`broken`||v(i).state===`degraded`||v(i).state===`commissioning`&&v(i).consecutive_failures>0)&&e(a)});var l=h(r,2),u=e=>{var t=Ri();p(t,21,()=>v(i).needs_credentials,e=>e.name,(e,t)=>{var n=Li(),r=b(n),a=h(b(r)),s=x(a,!0),c=h(a,1,!0);k(r);var l=h(r,2);k(n),o(e=>{N(s,v(t).label),N(c,e),l.disabled=v(_)===v(i).id||v(q)!==null},[()=>v(t).label.toLowerCase().endsWith(`key`)?``:` key`]),B(`click`,l,()=>gn(v(i),v(t))),d(e,n)}),k(t),d(e,t)};t(l,e=>{v(i).needs_credentials&&v(i).needs_credentials.length>0&&e(u)});var m=h(l,2),g=e=>{var t=Ri();p(t,21,()=>v(i).needs_params,e=>e.name,(e,t)=>{var n=zi(),r=b(n),a=h(b(r)),s=x(a,!0);k(r);var c=h(r,2);k(n),o(()=>{N(s,v(t).label),c.disabled=v(_)===v(i).id||v(Pt)!==null}),B(`click`,c,()=>yn(v(i),v(t))),d(e,n)}),k(t),d(e,t)};t(m,e=>{v(i).needs_params&&v(i).needs_params.length>0&&e(g)});var S=h(m,2),w=e=>{var t=Bi();d(e,t)},T=e=>{{let t=M(()=>v(_)===v(i).id),n=M(()=>v(Q)[v(i).id]??``);Qr(e,{get sites(){return v(C)},get busy(){return v(t)},get error(){return v(n)},onActivate:()=>jn(v(i))})}},E=e=>{var t=Vi(),n=b(t),r=x(n,!0);k(t),o(()=>{n.disabled=v(_)===v(i).id,N(r,v(_)===v(i).id?`Activating…`:`Activate`)}),B(`click`,n,()=>An(v(i))),d(e,t)};t(S,e=>{v(s)&&v(i).shell&&(!v(i).flow||v(i).flow.state===`failed`||v(i).flow.state===`unsupported`)&&v(i).flow?.question?.kind!==`model_consent`?e(w):v(s)&&!v(i).shell&&!v(i).flow&&v(C)?e(T,1):v(s)&&!v(i).shell&&!v(i).flow&&e(E,2)});var D=h(S,2),O=e=>{let n=M(()=>Hr(v(i)));var r=Hi(),a=h(b(r),2),s=x(a,!0),c=h(a,2),l=b(c),u=x(l,!0),f=h(l,2);k(c);var p=h(c,2),m=e=>{{let t=M(()=>v(_)===v(i).id),r=M(()=>v(Q)[v(i).id]??``);Be(e,{get candidates(){return v(n)},get busy(){return v(t)},get error(){return v(r)},onSwitch:e=>Mn(v(i),e)})}};t(p,e=>{v(n).length>0&&e(m)}),k(r),o(e=>{N(s,e),l.disabled=v(_)===v(i).id,N(u,v(_)===v(i).id?`Checking…`:`Yes, that’s it`),f.disabled=v(_)===v(i).id},[()=>Si(v(i).awaiting_yes)]),B(`click`,l,()=>Nn(v(i))),B(`click`,f,()=>Pn(v(i))),d(e,r)},A=e=>{var n=f(),r=y(n),a=e=>{var t=Ui();d(e,t)},s=e=>{{let t=M(()=>v(_)===v(i).id),n=M(()=>xe(v(i))),r=M(()=>v(i).query?.coverage);_i(e,{get payload(){return v(i).payload},get viewerTz(){return Bn},get busy(){return v(t)},get interpretation(){return v(n)},get coverage(){return v(r)},get fit(){return v(i).fit},onUse:e=>Nn(v(i),e),onWrong:()=>Fn(v(i))})}},l=e=>{var t=Wi(),n=h(b(t),2),r=b(n),a=x(r,!0),s=h(r,2);k(n),k(t),o(()=>{r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Checking…`:`Looks right`),s.disabled=v(_)===v(i).id}),B(`click`,r,()=>Nn(v(i))),B(`click`,s,()=>Fn(v(i))),d(e,t)};t(r,e=>{v(i).c2_ok?e(a):v(c)?e(s,1):e(l,-1)}),d(e,n)};t(D,e=>{v(i).awaiting_yes&&v(i).payload&&!v(i).flow?e(O):v(i).state===`commissioning`&&v(i).payload&&v(i).payload_slot!==`preview`&&e(A,1)}),d(e,n)},P=e=>{var n=Ji(),r=b(n),a=e=>{var t=Gi(),n=y(t),r=h(n,2),a=x(r,!0);o(()=>{n.disabled=v(_)===v(i).id||v(Bt)!==null,r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Running…`:`Run now`)}),B(`click`,n,()=>Cn(v(i))),B(`click`,r,()=>Dn(v(i))),d(e,t)},s=M(()=>!we(v(m),!!v(c),v(S)));t(r,e=>{v(s)&&e(a)});var l=h(r,2),u=h(b(l),2),f=b(u),p=e=>{var t=Ki(),n=y(t),r=h(n,2),a=x(r,!0);o(()=>{n.disabled=v(_)===v(i).id||v(Bt)!==null,r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Running…`:`Run now`)}),B(`click`,n,()=>Cn(v(i))),B(`click`,r,()=>Dn(v(i))),d(e,t)},g=M(()=>we(v(m),!!v(c),v(S)));t(f,e=>{v(g)&&e(p)});var C=h(f,2),w=x(C,!0),T=h(C,2),E=h(T,2),D=e=>{var t=qi();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>ht(v(i))),d(e,t)};t(E,e=>{v(i).shell||e(D)});var O=h(E,2),A=h(O,2);k(u),k(l),k(n),o(()=>{C.disabled=v(_)===v(i).id,N(w,v(i).enabled?`Pause`:`Resume`),T.disabled=v(_)===v(i).id,O.disabled=v(_)===v(i).id,A.disabled=v(_)===v(i).id}),B(`click`,C,()=>On(v(i))),B(`click`,T,()=>Tt(v(i))),B(`click`,O,()=>sn(v(i))),B(`click`,A,()=>kn(v(i))),d(e,n)},ee=M(()=>!!v(c)),te=M(()=>v(s)||!!v(i).awaiting_yes),I=M(()=>be(v(i))),L=M(()=>xe(v(i))),ne=M(()=>v(i).rendered===!0);Ie(e,{get title(){return v(i).title},get state(){return v(m)},get hasForm(){return v(ee)},get cols(){return v(l).cols},get rows(){return v(l).rows},get preview(){return v(te)},get footerText(){return v(I)},get interpretation(){return v(L)},get reason(){return v(g)},get rendered(){return v(ne)},get notice(){return v(S)},get fit(){return v(w)},chips:T,below:E,actions:P,children:(e,a)=>{var l=Ca(),m=y(l),g=e=>{var t=Yi(),n=b(t);ue(n,{kind:``,children:(e,t)=>{D();var n=u();o(()=>N(n,v(i).born===`flow`||v(i).born===`recipe`?`Preview — real data, not updating yet`:`Preview — sample data`)),d(e,n)},$$slots:{default:!0}}),k(t),d(e,t)};t(m,e=>{v(s)&&!v(i).flow&&e(g)});var C=h(m,2),w=e=>{var a=f(),s=y(a),c=e=>{let a=M(()=>yi(v(i).flow.error??``)),s=M(()=>v(i).flow.question?.kind===`model_consent`?v(i).flow.question:null);var c=aa(),l=y(c),u=x(l,!0),f=h(l,2),p=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(i).flow.reason??v(a)??`Creation didn’t finish.`)),d(e,t)};t(f,e=>{v(s)||e(p)});var m=h(f,2),g=e=>{var n=Qi(),r=y(n),a=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(s).prompt)),d(e,t)};t(r,e=>{v(s).prompt&&e(a)});var c=h(r,2),l=b(c),u=x(l),f=h(l,2),p=e=>{var t=Zi();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>xt(v(i),`local`)),d(e,t)};t(f,e=>{v(s).local&&e(p)}),k(c),o(()=>{l.disabled=v(_)===v(i).id,N(u,`Build with ${v(s).model??``}`)}),B(`click`,l,()=>xt(v(i),`allow`)),d(e,n)};t(m,e=>{v(s)&&e(g)});var S=h(m,2),C=e=>{var r=$i(),a=y(r),s=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(i).flow.question.prompt)),d(e,t)};t(a,e=>{v(i).flow.question.prompt&&e(s)});var c=h(a,2),l=b(c);j(l);var u=h(l,2);k(c),o(()=>{l.disabled=v(_)===v(i).id,u.disabled=v(_)===v(i).id||!v(_t)}),n(`submit`,c,e=>{e.preventDefault(),bt(v(i))}),F(l,()=>v(_t),e=>O(_t,e)),d(e,r)};t(S,e=>{v(i).flow.question?.kind===`supply_date`&&e(C)});var w=h(S,2),T=e=>{var n=ra(),r=b(n),a=e=>{var t=ea(),n=y(t),r=h(n,2);o(()=>{n.disabled=v(_)===v(i).id,r.disabled=v(_)===v(i).id}),B(`click`,n,()=>wt(v(i))),B(`click`,r,()=>ht(v(i))),d(e,t)};t(r,e=>{v(i).shell||e(a)});var s=h(r,2),c=e=>{var t=ta(),n=x(t,!0);o(()=>{t.disabled=v(_)===v(i).id,N(n,v(_)===v(i).id?`Retrying…`:`Retry`)}),B(`click`,t,()=>Nt(v(i))),d(e,t)},l=M(()=>v(i).shell&&v(i).flow.reopen?.includes(`retry`));t(s,e=>{v(l)&&e(c)});var u=h(s,2),f=e=>{var t=na();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>St(v(i))),d(e,t)},p=M(()=>v(i).shell&&v(i).flow.reopen?.includes(`pick_source`));t(u,e=>{v(p)&&e(f)}),k(n),d(e,n)};t(w,e=>{v(s)||e(T)});var E=h(w,2),D=e=>{var t=ia(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(E,e=>{v(Q)[v(i).id]&&e(D)}),o(()=>{r(l,1,z(v(s)?`ni-note-head`:`ni-status-fail ni-note-head`),`svelte-7uuxge`),N(u,v(s)?`Build with a model outside this computer?`:v(i).flow.state===`unsupported`?`Can’t build this card yet`:`Setup failed`)}),d(e,c)},l=e=>{var t=oa();d(e,t)},m=e=>{let r=M(()=>Ci(v(i).flow.suggestions)),a=M(()=>Rr(v(i).flow));var s=ha(),c=b(s),l=x(c,!0),u=h(c,2),f=e=>{var n=da();p(n,21,()=>v(r).sources,e=>e.url,(e,n)=>{var r=ua(),a=b(r),s=x(a,!0),c=h(a,2),l=e=>{var t=sa(),r=x(t,!0);o(e=>N(r,e),[()=>v(n).evidence.join(` — `)]),d(e,t)};t(c,e=>{v(n).evidence&&v(n).evidence.length>0&&e(l)});var u=h(c,2),f=e=>{var t=ca();d(e,t)},p=M(()=>v(n).needs?.includes(`key`));t(u,e=>{v(p)&&e(f)});var m=h(u,2),g=e=>{var t=la();d(e,t)},y=M(()=>v(n).needs?.includes(`contact`));t(m,e=>{v(y)&&e(g)}),k(r),o(()=>{a.disabled=v(_)===v(i).id,A(a,`title`,v(n).url),N(s,v(n).title)}),B(`click`,a,()=>vt(v(i),v(n).url)),d(e,r)}),k(n),d(e,n)};t(u,e=>{v(r).sources.length>0&&e(f)});var m=h(u,2),g=e=>{var t=pa(),n=h(y(t),2);p(n,21,()=>v(r).links,e=>e.url,(e,t)=>{var n=fa(),r=b(n),i=b(r);se(i,{name:`link`,size:14});var a=h(i);k(r);var s=h(r,2),c=x(s,!0);k(n),o(e=>{A(r,`href`,v(t).url),N(a,` ${(v(t).title||v(t).host)??``}`),N(c,e)},[()=>wi(v(t))]),d(e,n)}),k(n),d(e,t)};t(m,e=>{v(r).links.length>0&&e(g)});var S=h(m,2),C=b(S);j(C);var w=h(C,2),T=e=>{var t=ma(),n=x(t,!0);o(()=>N(n,v(a))),d(e,t)};t(w,e=>{v(a)&&e(T)});var E=h(w,2);k(S);var D=h(S,2),P=e=>{var t=ia(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(D,e=>{v(Q)[v(i).id]&&e(P)}),k(s),o(e=>{N(l,v(r).heading),A(C,`placeholder`,v(r).links.length>0?`Found the data? Paste its link (https://…)`:`Or paste any web page or API URL (https://…)`),C.disabled=v(_)===v(i).id,E.disabled=e},[()=>v(_)===v(i).id||v(it).trim().length<8]),n(`submit`,S,e=>{e.preventDefault(),vt(v(i))}),F(C,()=>v(it),e=>O(it,e)),d(e,s)},g=e=>{let r=M(()=>v(i).flow.access);var a=ba(),s=b(a),c=e=>{var n=_a(),a=y(n),s=b(a),c=h(s),l=e=>{var t=ga(),n=y(t);D(),o(()=>A(n,`href`,v(r).key.docs_url)),d(e,t)},f=e=>{var t=u();o(()=>N(t,`Get one from ${(v(r).provider||v(r).host)??``}, then paste it below.`)),d(e,t)};t(c,e=>{v(r).key.docs_url?e(l):e(f,-1)});var p=h(c);k(a);var m=h(a,2);j(m),o(()=>{N(s,`${(v(r).provider||v(r).host)??``} needs your own free key. `),N(p,` SmartBrain sends it only to ${v(r).host??``}, over a secure connection.`),A(m,`placeholder`,`Your ${(v(r).provider||v(r).host)??``} key`),m.disabled=v(_)===v(i).id,A(m,`aria-label`,`Your key for ${v(r).host??``}`)}),F(m,()=>v(at),e=>O(at,e)),d(e,n)};t(s,e=>{v(r).key&&e(c)});var l=h(s,2),f=e=>{var t=va(),n=y(t),a=x(n),s=h(n,2);j(s),o(()=>{N(a,`${(v(r).provider||v(r).host)??``} asks automated requests for a contact + email. SmartBrain sends yours only to sources with this rule, and asks once.`),s.disabled=v(_)===v(i).id}),F(s,()=>v(ot),e=>O(ot,e)),d(e,t)};t(l,e=>{v(r).contact&&e(f)});var p=h(l,2),m=x(p,!0),g=h(p,2),S=e=>{var t=ya(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(g,e=>{v(Q)[v(i).id]&&e(S)}),k(a),o(e=>{p.disabled=e,N(m,v(_)===v(i).id?`Saving…`:`Continue`)},[()=>v(_)===v(i).id||!!v(r).key&&v(at).trim().length===0||v(r).contact&&v(ot).trim().length<6]),n(`submit`,a,e=>{e.preventDefault(),yt(v(i))}),d(e,a)},S=e=>{var t=ma(),n=x(t,!0);o(e=>N(n,e),[()=>bi(v(i).flow)]),d(e,t)};t(s,e=>{v(i).flow.state===`failed`||v(i).flow.state===`unsupported`?e(c):v(i).flow.state===`source`&&v(i).flow.suggestions===void 0?e(l,1):v(i).flow.state===`source`?e(m,2):v(i).flow.state===`awaiting_access`&&v(i).flow.access?e(g,3):e(S,-1)}),d(e,a)},T=e=>{var n=f(),r=y(n),a=e=>{},o=M(()=>Ce(v(i),!!v(c))),s=e=>{Sn(e,{get clir(){return v(c)},get viewerTz(){return Bn}})},l=e=>{Ar(e,{get node(){return v(i).payload}})};t(r,e=>{v(o)?e(a):v(c)?e(s,1):e(l,-1)}),d(e,n)},E=e=>{let n=M(()=>hn(v(i)));var r=f(),a=y(r),s=e=>{var t=xa(),r=h(b(t)),i=x(r),a=h(r);k(t),o(()=>{N(i,`${v(n).friendly??``} (${v(n).raw??``})`),N(a,`, + ${v(n).attempts??``} attempt${v(n).attempts===1?``:`s`} · last tried ${v(n).tried??``}`)}),d(e,t)},c=e=>{var t=Sa();d(e,t)};t(a,e=>{v(n).show?e(s):v(S)||e(c,1)}),d(e,r)};t(C,e=>{v(i).flow?e(w):v(i).payload?e(T,1):e(E,-1)}),d(e,l)},$$slots:{chips:!0,below:!0,actions:!0,default:!0}})}}),k(i),d(e,i)};t(R,e=>{v(m)?v(s).length===0?e(V,1):e(H,-1):e(re)});var ce=h(R,2),U=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(g))),d(e,t)};t(ce,e=>{v(g)&&e(U)});var W=h(ce,2),ve=e=>{le(e,{open:!0,label:`Refine this card`,onclose:()=>{O(ft,null),O(pt,``)},children:(e,t)=>{var n=Ea(),r=h(y(n),4);C(r);var i=h(r,2),a=b(i),s=h(a,2),c=x(s,!0);k(i),o(e=>{r.disabled=v(mt),s.disabled=e,N(c,v(mt)?`Sending…`:`Rebuild`)},[()=>v(mt)||v(pt).trim().length<3]),F(r,()=>v(pt),e=>O(pt,e)),B(`click`,a,()=>{O(ft,null),O(pt,``)}),B(`click`,s,()=>void gt()),d(e,n)},$$slots:{default:!0}})};t(W,e=>{v(ft)&&e(ve)});var J=h(W,2),Ct=e=>{le(e,{open:!0,label:`What went wrong?`,onclose:()=>{O(oe,null),O(me,``)},children:(e,t)=>{var n=Da(),r=h(y(n),4);C(r);var i=h(r,2),a=b(i),s=h(a,2),c=x(s,!0);k(i),o(()=>{a.disabled=v(S),s.disabled=v(S),N(c,v(S)?`Sending…`:`Send`)}),F(r,()=>v(me),e=>O(me,e)),B(`click`,a,()=>{O(oe,null),O(me,``)}),B(`click`,s,In),d(e,n)},$$slots:{default:!0}})};t(J,e=>{v(oe)&&e(Ct)});var Ft=h(J,2),qt=e=>{le(e,{open:!0,alert:!0,label:`Apply library update?`,onclose:()=>{v(Ve)||O(ze,null)},children:(e,t)=>{var n=Oa(),r=h(y(n),2),i=h(b(r)),a=x(i);D(),k(r);var s=h(r,2),c=b(s),l=h(c,2),u=x(l,!0);k(s),o(()=>{N(a,`“${v(ze).title??``}”`),c.disabled=v(Ve),l.disabled=v(Ve),N(u,v(Ve)?`Applying…`:`Apply update`)}),B(`click`,c,()=>{O(ze,null)}),B(`click`,l,an),d(e,n)},$$slots:{default:!0}})};t(Ft,e=>{v(ze)&&e(qt)});var Jt=h(Ft,2),on=e=>{le(e,{open:!0,size:`md`,label:`A proposed fix from Claude`,onclose:()=>{v(Ge)||dn()},children:(e,n)=>{var r=ja(),i=h(y(r),4),a=e=>{de(e,{block:!0})},s=e=>{var t=ka();d(e,t)},c=e=>{var t=Aa(),n=b(t),r=h(b(n),4),i=x(r,!0),a=h(r,4),s=x(a,!0);k(n);var c=h(n,2),l=h(b(c),4),u=x(l,!0),f=h(l,4),p=x(f,!0);k(c),k(t),o((e,t,n,r)=>{N(i,e),N(s,t),N(u,n),N(p,r)},[()=>Mi(v(Ke).extract),()=>Mi(v(Ke).transform),()=>Mi(v(qe).extract),()=>Mi(v(qe).transform)]),d(e,t)};t(i,e=>{v(We)?e(a):v(Ue)?e(c,-1):e(s,1)});var l=h(i,2),u=b(l),f=h(u,2),p=h(f,2),m=x(p,!0);k(l),o(()=>{u.disabled=v(Ge),f.disabled=v(Ge)||v(We)||!v(Ue),p.disabled=v(Ge)||v(We)||!v(Ue),N(m,v(Ge)?`Applying…`:`Apply`)}),B(`click`,u,dn),B(`click`,f,pn),B(`click`,p,fn),d(e,r)},$$slots:{default:!0}})};t(Jt,e=>{v(He)&&e(on)});var mn=h(Jt,2),$=e=>{le(e,{open:!0,label:`Repair settings`,onclose:()=>{v(Ze)||cn()},children:(e,n)=>{var r=Pa(),i=y(r),a=x(i),s=h(i,2),c=e=>{de(e,{block:!0})},l=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Qe)||`Couldn’t load this card.`)),d(e,t)},u=e=>{var n=Na(),r=h(y(n),2),i=b(r);j(i),D(2),k(r);var a=h(r,2),s=b(a);j(s),D(2),k(a);var c=h(a,2),l=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(Qe))),d(e,t)};t(c,e=>{v(Qe)&&e(l)}),o(()=>{i.disabled=v(Ze),s.disabled=v(Ze)}),E(i,()=>v($e),e=>O($e,e)),E(s,()=>v(et),e=>O(et,e)),d(e,n)};t(s,e=>{v(Xe)?e(c):v(Ye)?e(u,-1):e(l,1)});var f=h(s,2),p=b(f),m=h(p,2),g=x(m,!0);k(f),o(()=>{N(a,`Repair settings — “${v(Je).title??``}”`),p.disabled=v(Ze),m.disabled=v(Ze)||v(Xe)||!v(Ye),N(g,v(Ze)?`Saving…`:`Save`)}),B(`click`,p,cn),B(`click`,m,ln),d(e,r)},$$slots:{default:!0}})};t(mn,e=>{v(Je)&&e($)});var Tn=h(mn,2),Ln=e=>{le(e,{open:!0,label:`Add key`,onclose:()=>{v(Z)||_n()},children:(e,n)=>{var r=Ia(),i=y(r),a=x(i),s=h(i,4),c=e=>{de(e,{block:!0})},l=e=>{var n=Fa(),r=y(n),i=b(r),a=x(i,!0),s=h(i,2);j(s),k(r);var c=h(r,2),l=h(b(c),2);j(l),k(c);var u=h(c,2),f=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(rt))),d(e,t)};t(u,e=>{v(rt)&&e(f)}),o(()=>{N(a,v(tt)),s.disabled=v(Z),l.disabled=v(Z)}),F(s,()=>v(Y),e=>O(Y,e)),F(l,()=>v(X),e=>O(X,e)),d(e,n)};t(s,e=>{v(nt)?e(c):e(l,-1)});var u=h(s,2),f=b(u),p=h(f,2),m=x(p,!0);k(u),o(e=>{N(a,`Add key — ${v(tt)??``}`),f.disabled=v(Z),p.disabled=e,N(m,v(Z)?`Saving…`:`Save`)},[()=>v(Z)||v(nt)||!v(Y)||!v(X).trim()]),B(`click`,f,_n),B(`click`,p,vn),d(e,r)},$$slots:{default:!0}})};t(Tn,e=>{v(q)&&e(Ln)});var Rn=h(Tn,2),zn=e=>{le(e,{open:!0,label:`Fill in`,onclose:()=>{v(Rt)||bn()},children:(e,n)=>{var r=La(),i=y(r),a=x(i),s=h(i,4),c=b(s),l=x(c,!0),u=h(c,2);j(u),k(s);var f=h(s,2),p=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(zt))),d(e,t)};t(f,e=>{v(zt)&&e(p)});var m=h(f,2),g=b(m),_=h(g,2),S=x(_,!0);k(m),o(e=>{N(a,`Fill in — ${v(It)??``}`),N(l,v(It)),u.disabled=v(Rt),g.disabled=v(Rt),_.disabled=e,N(S,v(Rt)?`Saving…`:`Save`)},[()=>v(Rt)||!v(Lt).trim()]),F(u,()=>v(Lt),e=>O(Lt,e)),B(`click`,g,bn),B(`click`,_,xn),d(e,r)},$$slots:{default:!0}})};t(Rn,e=>{v(Pt)&&e(zn)});var Hn=h(Rn,2),Un=e=>{le(e,{open:!0,label:`Edit card`,onclose:()=>{v(ut)||Et()},children:(e,n)=>{var r=Ra(),i=y(r),a=x(i),s=h(i,2),c=h(b(s),2);j(c),k(s);var l=h(s,2),u=h(b(l),2);j(u),k(l);var f=h(l,2),p=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(dt))),d(e,t)};t(f,e=>{v(dt)&&e(p)});var m=h(f,2),g=b(m),_=h(g,2),S=x(_,!0);k(m),o(()=>{N(a,`Edit — ${v(st).title??``}`),c.disabled=v(ut),u.disabled=v(ut),g.disabled=v(ut),_.disabled=v(ut),N(S,v(ut)?`Saving…`:`Save`)}),F(c,()=>v(ct),e=>O(ct,e)),F(u,()=>v(lt),e=>O(lt,e)),B(`click`,g,Et),B(`click`,_,Dt),d(e,r)},$$slots:{default:!0}})};t(Hn,e=>{v(st)&&e(Un)});var Wn=h(Hn,2),Gn=e=>{le(e,{open:!0,label:`Run history`,onclose:wn,children:(e,n)=>{var r=Ua(),i=y(r),a=x(i),s=h(i,2),c=e=>{de(e,{block:!0})},l=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ut))),d(e,t)},u=e=>{var t=za();d(e,t)},f=e=>{var n=Ha();p(n,21,()=>v(Vt).runs,P,(e,n)=>{let r=M(()=>yi(v(n).error));var i=Va(),a=b(i),s=x(a,!0),c=h(a,2),l=x(c,!0),u=h(c,2),f=e=>{var t=Ba(),n=x(t);o(()=>N(n,`— ${v(r)??``}`)),d(e,t)};t(u,e=>{v(r)&&e(f)}),k(i),o((e,t)=>{N(s,e),N(l,t)},[()=>_e(v(n).ts),()=>pe(v(n).status)]),d(e,i)}),k(n),d(e,n)};t(s,e=>{v(Ht)?e(c):v(Ut)&&!v(Vt)?e(l,1):!v(Vt)||v(Vt).runs.length===0?e(u,2):e(f,-1)});var m=h(s,2),g=x(m);o(()=>N(a,`Recent runs — “${v(Bt).title??``}”`)),B(`click`,g,wn),d(e,r)},$$slots:{default:!0}})};t(Wn,e=>{v(Bt)&&e(Gn)});var Kn=h(Wn,2),qn=e=>{le(e,{open:!0,size:`lg`,label:`Global Library`,onclose:()=>{!v(K)&&!v(Me)&&Yt()},children:(e,n)=>{var r=so(),i=h(y(r),2),a=e=>{de(e,{block:!0})},s=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ee)||`Couldn't load the library.`)),d(e,t)},c=e=>{var n=Wa(),r=h(b(n),2),i=b(r),a=h(b(i),2),s=x(a,!0);k(i);var c=h(i,2),l=h(b(c),2),u=x(l,!0);k(c),k(r);var f=h(r,6),p=b(f);j(p);var m=h(p,2),g=x(m,!0);k(f);var _=h(f,2),y=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(Re))),d(e,t)};t(_,e=>{v(Re)&&e(y)}),k(n),o(()=>{N(s,v(G).fingerprint??`(unknown)`),N(u,v(G).blocked.offered_fingerprint),m.disabled=v(Le)||!v(Fe),N(g,v(Le)?`Pinning…`:`Trust new key`)}),B(`keydown`,p,e=>e.key===`Enter`&&v(Fe)&&$t()),F(p,()=>v(Fe),e=>O(Fe,e)),B(`click`,m,$t),d(e,n)},l=e=>{var n=Ga(),r=h(y(n),4),i=b(r);j(i),A(i,`placeholder`,he);var a=h(i,2),s=x(a,!0);k(r);var c=h(r,2),l=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(Ee))),d(e,t)};t(c,e=>{v(Ee)&&e(l)}),o(e=>{a.disabled=e,N(s,v(K)?`Connecting…`:`Connect`)},[()=>v(K)||!v(De).trim()]),B(`keydown`,i,e=>e.key===`Enter`&&!v(K)&&Xt()),F(i,()=>v(De),e=>O(De,e)),B(`click`,a,Xt),d(e,n)},m=e=>{let n=M(()=>v(Ae));var r=Xa(),i=y(r),a=b(i),s=h(a,2),c=x(s,!0);k(i);var l=h(i,2),u=x(l,!0),m=h(l,4);p(m,21,()=>v(n).sources,P,(e,t)=>{var n=Ka(),r=b(n),i=x(r,!0);k(n),o(()=>N(i,v(t).host?`${v(t).host}${v(t).path}`:v(t).type===`internal.kb`?`your knowledge base (no network)`:v(t).type===`model`?`generated by your local model (no fetch)`:v(t).type)),d(e,n)}),k(m);var g=h(m,2),_=e=>{var r=Ya(),i=h(y(r),2);p(i,21,()=>v(n).params,e=>e.name,(e,n)=>{var r=f(),i=y(r),a=e=>{var t=qa(),r=b(t),i=x(r,!0);D(2),k(t),o(()=>N(i,v(n).label)),d(e,t)},s=e=>{var t=Ja(),r=b(t),i=x(r,!0),a=h(r,2);j(a),k(t),o(()=>{N(i,v(n).label),A(a,`type`,v(n).kind===`number`?`number`:`text`),A(a,`placeholder`,v(n).label)}),F(a,()=>v(je)[v(n).name],e=>v(je)[v(n).name]=e),d(e,t)};t(i,e=>{v(n).kind===`secret`?e(a):e(s,-1)}),d(e,r)}),k(i),d(e,r)};t(g,e=>{v(n).params.length>0&&e(_)});var S=h(g,2),C=h(b(S),2),w=e=>{let t=M(()=>Vn(v(n).preview_payload));Sn(e,{get clir(){return v(t)},get viewerTz(){return Bn}})},T=M(()=>Vn(v(n).preview_payload)),E=e=>{Ar(e,{get node(){return v(n).preview_payload}})};t(C,e=>{v(T)?e(w):e(E,-1)}),k(S);var O=h(S,2),ee=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(Ne))),d(e,t)};t(O,e=>{v(Ne)&&e(ee)});var te=h(O,2),I=b(te),L=h(I,2),ne=x(L,!0);k(te),o(()=>{N(c,v(n).title),N(u,v(n).goal),I.disabled=v(Me),L.disabled=v(Me)||!!v(Kt),N(ne,v(Me)?`Installing…`:`Install as draft`)}),B(`click`,a,tn),B(`click`,I,tn),B(`click`,L,nn),d(e,r)},g=e=>{var n=oo(),r=y(n),i=b(r),a=x(i,!0),s=h(i,2),c=e=>{ue(e,{kind:``,children:(e,t)=>{D();var n=u();o(()=>N(n,`v${v(G).seq??``}`)),d(e,n)},$$slots:{default:!0}})};t(s,e=>{v(G).seq!==void 0&&e(c)});var l=h(s,2),f=e=>{var t=Za(),n=x(t);o(e=>N(n,`Last checked ${e??``}`),[()=>_e(v(G).last_checked)]),d(e,t)};t(l,e=>{v(G).last_checked&&e(f)});var m=h(l,4),g=x(m,!0),_=h(m,2);k(r);var S=h(r,2),C=e=>{var t=Qa(),n=x(t,!0);o(()=>N(n,v(Pe))),d(e,t)};t(S,e=>{v(Pe)&&e(C)});var T=h(S,2),E=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ee))),d(e,t)};t(T,e=>{v(Ee)&&e(E)});var ee=h(T,2),te=e=>{var t=Ta(),n=x(t);o(()=>N(n,`Last check failed: ${v(G).last_error??``}`)),d(e,t)},I=e=>{var t=$a();d(e,t)};t(ee,e=>{v(G).last_error?e(te):v(G).unreachable&&e(I,1)});var L=h(ee,2),ne=b(L);j(ne);var R=h(ne,2),re=e=>{var t=to(),n=b(t);n.value=n.__value=``;var r=h(n);p(r,16,()=>v(Gt),e=>e,(e,t)=>{var n=eo(),r=x(n,!0),i={};o(()=>{N(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),d(e,n)}),k(t),w(t),ie(t,()=>v(ke),e=>O(ke,e)),d(e,t)};t(R,e=>{v(Gt).length>0&&e(re)}),k(L);var z=h(L,2),ae=e=>{fe(e,{icon:`monitor`,title:`No templates yet`,body:`The library is connected but empty right now — try Check now.`})},V=e=>{var t=no();d(e,t)},H=e=>{var n=ao();p(n,21,()=>v(Wt),e=>e.id,(e,n)=>{var r=io(),i=b(r),a=b(i),s=x(a,!0),c=h(a,2);ue(c,{kind:``,children:(e,t)=>{D();var r=u();o(()=>N(r,v(n).category)),d(e,r)},$$slots:{default:!0}}),k(i);var l=h(i,2),f=x(l,!0),m=h(l,4);p(m,21,()=>v(n).sources,P,(e,t)=>{var n=Ka(),r=b(n),i=x(r,!0);k(n),o(()=>N(i,v(t).host?`${v(t).host}${v(t).path}`:v(t).type===`internal.kb`?`your knowledge base (no network)`:v(t).type===`model`?`generated by your local model (no fetch)`:v(t).type)),d(e,n)}),k(m);var g=h(m,2),_=e=>{var t=ro(),r=x(t,!0);o(()=>N(r,v(n).notes)),d(e,t)};t(g,e=>{v(n).notes&&e(_)});var y=h(g,2),S=b(y),C=e=>{let t=M(()=>Vn(v(n).preview_payload));Sn(e,{get clir(){return v(t)},get viewerTz(){return Bn}})},w=M(()=>Vn(v(n).preview_payload)),T=e=>{Ar(e,{get node(){return v(n).preview_payload}})};t(S,e=>{v(w)?e(C):e(T,-1)}),k(y);var E=h(y,2),O=x(E);k(r),o(()=>{N(s,v(n).title),N(f,v(n).goal)}),B(`click`,O,()=>en(v(n))),d(e,r)}),k(n),d(e,n)};t(z,e=>{(v(G).templates??[]).length===0?e(ae):v(Wt).length===0?e(V,1):e(H,-1)}),o(e=>{A(i,`title`,v(G).url??``),N(a,e),m.disabled=v(K),N(g,v(K)?`Checking…`:`Check now`),_.disabled=v(K)},[()=>ki(v(G).fingerprint)]),B(`click`,m,Zt),B(`click`,_,Qt),F(ne,()=>v(Oe),e=>O(Oe,e)),d(e,n)};t(i,e=>{v(Te)?e(a):v(G)?v(G).blocked?e(c,2):v(G).connected?v(Ae)?e(m,4):e(g,-1):e(l,3):e(s,1)});var _=h(i,2),S=x(_);o(()=>S.disabled=v(K)||v(Me)),B(`click`,S,Yt),d(e,r)},$$slots:{default:!0}})};t(Kn,e=>{v(ge)&&e(qn)}),o(e=>{T.disabled=v(kt),te.disabled=e,N(I,v(kt)?`Starting…`:`Create card`)},[()=>v(kt)||v(Ot).trim().length<3]),B(`click`,c,()=>ae(`/ni/library`)),n(`submit`,l,e=>{e.preventDefault(),Mt()}),F(T,()=>v(Ot),e=>O(Ot,e)),d(e,i)},Gn=e=>{de(e,{block:!0})};t(Un,e=>{H.status?.unlocked?e(Wn):e(Gn,-1)}),d(i,Hn),ne()}g([`click`,`keydown`]);export{lo as component}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/nodes/10.D2sVRYwK.js b/app/smartbrain_3000/web/_app/immutable/nodes/10.D2sVRYwK.js deleted file mode 100644 index 58a1d1f4..00000000 --- a/app/smartbrain_3000/web/_app/immutable/nodes/10.D2sVRYwK.js +++ /dev/null @@ -1,17 +0,0 @@ -import{$ as e,A as t,B as n,C as r,E as i,F as a,G as o,I as s,J as c,K as l,L as u,M as d,N as f,O as p,P as m,Q as h,R as g,S as _,V as v,X as y,Y as b,Z as x,a as S,at as C,b as w,ct as T,d as E,dt as D,et as O,ft as k,g as A,h as j,it as M,j as N,k as P,l as ee,m as F,n as te,pt as I,r as L,st as ne,tt as R,u as re,w as z,y as ie,z as B}from"../chunks/BJLLtWYH.js";import{t as ae}from"../chunks/BxvjB08B.js";import"../chunks/xihTtKlq.js";import"../chunks/Cmegxfzj.js";import{n as V}from"../chunks/CoHYJ8BJ.js";import{t as H}from"../chunks/y2R953fa.js";import{n as oe,t as se}from"../chunks/CEPrmzat.js";import{t as ce}from"../chunks/CwtHPkdz.js";import{t as le}from"../chunks/BqUz5g-m.js";import{n as U}from"../chunks/uFPkKLC1.js";import{t as ue}from"../chunks/kqW19h2g.js";import{t as de}from"../chunks/1gl_kuJz.js";import{t as W}from"../chunks/DKVRJME0.js";import{t as fe}from"../chunks/DV4tMnTy.js";import{i as pe,r as me}from"../chunks/jV_dy7U_.js";var he=6e4,ge=60*he,G=24*ge;function _e(e,t=new Date){console.assert(e===null||typeof e==`string`,`relTime: ts is string|null`),console.assert(t instanceof Date,`relTime: now must be a Date`);let n=me(e);if(!n)return`—`;let r=t.getTime()-n.getTime();return r<0||r<45e3?`just now`:r2*i}function ye(e){if(console.assert(typeof e.state==`string`,`cardState: state is string`),console.assert(typeof e.enabled==`boolean`,`cardState: enabled is boolean`),e.flow||e.state===`draft`)return`designing`;if(!e.enabled||e.state===`paused`)return`paused`;if(e.state===`broken`)return`broken`;if(e.state===`commissioning`){let t=e.awaiting_yes!=null||e.payload_slot!==`preview`;return e.payload!==null&&t?`verifying`:`empty`}return e.payload===null?`empty`:e.state===`failing`||e.state===`degraded`?`failing`:ve(e.payload_at,e.interval_minutes)?`stale`:`fresh`}function be(e){console.assert(typeof e.interval_minutes==`number`,`footerText: interval is number`),console.assert(e.payload_at===null||typeof e.payload_at==`string`,`footerText: payload_at shape`);let t=me(e.payload_at);return[t?`as of ${new Intl.DateTimeFormat(void 0,{timeStyle:`short`}).format(t)}`:`as of —`,e.awaiting_yes?.host??``,`every ${Math.max(1,e.interval_minutes)}m`].filter(e=>e.length>0).join(` · `)}function xe(e){console.assert(typeof e.id==`string`,`interpretationOf: a board row`);let t=e.interpretation,n=typeof t==`string`&&t.trim().length>0?t:``;return console.assert(n===``||n===t,`interpretationOf: verbatim or empty`),n}function Se(e,t){console.assert(e===void 0||typeof e==`string`,`cardSpan: size is a string or undefined`),console.assert(t==null||typeof t==`object`,`cardSpan: clir is an object or null`);let n=t&&typeof t==`object`?t.span:void 0,r=typeof n==`string`?/^[dp]([1-4])x([1-3])$/.exec(n):null;if(r)return{cols:Number(r[1])>=2?2:1,rows:Number(r[2])};switch(e){case`wide`:return{cols:2,rows:1};case`large`:return{cols:2,rows:2};case`tall`:return{cols:1,rows:2};default:return{cols:1,rows:1}}}function Ce(e,t){return console.assert(typeof e.state==`string`,`bodyShowsPanel: state is string`),console.assert(typeof t==`boolean`,`bodyShowsPanel: hasForm is boolean`),!t||e.flow||e.awaiting_yes&&e.payload||e.state!==`commissioning`||e.c2_ok?!1:e.payload!==null&&e.payload_slot!==`preview`}function we(e,t,n=``){return console.assert(typeof t==`boolean`,`formBoxChrome: hasForm is boolean`),console.assert(typeof e==`string`,`formBoxChrome: state is string`),t&&n===``&&(e===`fresh`||e===`stale`||e===`paused`)}var Te=m(``),Ee=m(` `),De=m(` `),K=m(``),Oe=m(`

                `),ke=m(`

                `),Ae=m(` `),je=m(` `),Me=m(` `,1),Ne=m(``),Pe=m(` `),Fe=m(`
                `);function Ie(e,n){T(n,!0);let a=S(n,`cols`,3,1),s=S(n,`rows`,3,1),c=S(n,`preview`,3,!1),l=S(n,`footerText`,3,``),p=S(n,`interpretation`,3,``),m=S(n,`reason`,3,``),g=S(n,`rendered`,3,!1),_=S(n,`notice`,3,``),C=S(n,`fit`,3,null),w=M(()=>we(n.state,n.hasForm,_())),E=M(()=>C()?C().detail?`${C().chip}. ${C().detail}`:C().chip:``),O=M(()=>C()?C().detail?`${C().chip} · ${C().detail}`:C().chip:``);var j=Fe();let P;var ee=b(j);let F;var te=b(ee),L=e=>{var t=Te();d(e,t)},R=e=>{var t=Ee(),r=x(t,!0);o(()=>N(r,n.title)),d(e,t)};t(te,e=>{n.hasForm?e(L):e(R,-1)});var re=h(te,2),z=b(re),ie=e=>{var t=K(),n=b(t);ue(n,{kind:`warn`,get title(){return v(E)},children:(e,t)=>{var n=De(),r=x(n,!0);o(()=>N(r,C().chip)),d(e,n)},$$slots:{default:!0}}),k(t),d(e,t)};t(z,e=>{C()&&!v(w)&&e(ie)});var B=h(z,2);i(B,()=>n.chips??I);var ae=h(B,2),V=e=>{ue(e,{title:`This card reads its page in SmartBrain's own local page browser`,children:(e,t)=>{D();var n=u(`page browser`);d(e,n)},$$slots:{default:!0}})};t(ae,e=>{g()&&e(V)}),k(re),k(ee);var H=h(ee,2);let oe;var se=b(H);i(se,()=>n.children??I),k(H);var ce=h(H,2),le=e=>{var t=Oe(),n=x(t,!0);o(()=>N(n,_())),d(e,t)},U=e=>{var t=ke(),n=x(t,!0);o(()=>N(n,m())),d(e,t)};t(ce,e=>{_()?e(le):n.state===`failing`&&m()&&e(U,1)});var de=h(ce,2);i(de,()=>n.below??I);var W=h(de,2);let fe;var pe=b(W),me=e=>{var n=f(),r=y(n),i=e=>{var t=Ae(),n=b(t),r=x(n,!0),i=h(n,2),a=x(i);k(t),o(()=>{A(n,`title`,p()),N(r,p()),N(a,`· ${l()??``}`)}),d(e,t)},a=e=>{var t=je(),n=x(t,!0);o(()=>N(n,l())),d(e,t)};t(r,e=>{p()?e(i):e(a,-1)}),d(e,n)};t(pe,e=>{!n.hasForm&&l()&&e(me)});var he=h(pe,2),ge=e=>{var t=Ne(),n=b(t);ue(n,{kind:`warn`,get title(){return v(E)},children:(e,t)=>{var n=Me(),r=y(n),i=x(r,!0),a=h(r,2),s=x(a,!0);o(()=>{N(i,C().chip),N(s,v(O))}),d(e,n)},$$slots:{default:!0}}),k(t),d(e,t)};t(he,e=>{C()&&v(w)&&e(ge)});var G=h(he,2);i(G,()=>n.actions??I);var _e=h(G,2),ve=e=>{var t=Pe(),n=x(t,!0);o(()=>N(n,C().detail)),d(e,t)};t(_e,e=>{C()?.detail&&!v(w)&&e(ve)}),k(W),k(j),o(()=>{P=r(j,1,`card ni-card svelte-hyum9g`,null,P,{"cols-2":a()>=2,"rows-2":s()===2,"rows-3":s()>=3,form:v(w),preview:c()}),A(j,`data-state`,n.state),F=r(ee,1,`ni-head svelte-hyum9g`,null,F,{"has-fit":!!C()&&!v(w)}),oe=r(H,1,`ni-body svelte-hyum9g`,null,oe,{"ni-body-dim":n.state===`failing`}),fe=r(W,1,`ni-foot svelte-hyum9g`,null,fe,{"has-fit-line":!!C()?.detail&&!v(w),"has-fit-strip":!!C()&&v(w)})}),d(e,j),ne()}var Le=m(`
              • `),Re=m(`

                `),ze=m(`

                This page gets its data from a feed

                  `);function Be(e,n){T(n,!0);let r=S(n,`busy`,3,!1),i=S(n,`error`,3,``);var a=ze(),s=h(b(a),2);p(s,21,()=>n.candidates,e=>e.url,(e,t)=>{var i=Le(),a=b(i),s=x(a,!0),c=h(a,2);k(i),o(()=>{A(a,`title`,v(t).url),N(s,v(t).url),c.disabled=r()}),B(`click`,c,()=>n.onSwitch(v(t).url)),d(e,i)}),k(s);var c=h(s,2),l=e=>{var t=Re(),n=x(t,!0);o(()=>N(n,i())),d(e,t)};t(c,e=>{i()&&e(l)}),k(a),d(e,a),ne()}g([`click`]);var Ve=new Set(`accent.accent-tint.badge-line.bg.border.border-strong.danger.elevated.faint.map-land.map-stroke.muted.ok.panel.row-hi.text.viz-axis.viz-band.viz-cat-1.viz-cat-2.viz-cat-3.viz-cat-4.viz-cat-5.viz-cat-6.viz-cat-other.viz-div-mid.viz-div-neg.viz-div-pos.viz-dot-ring.viz-fill.viz-grid.viz-interp.viz-line.viz-neg.viz-now.viz-now-line.viz-pos.viz-seq-1.viz-seq-2.viz-seq-3.viz-seq-4.viz-seq-5.viz-track.warn`.split(`.`));function He(e){return console.assert(Ve.size>0,`isTokenName: token set loaded`),typeof e==`string`&&Ve.has(e)}var Ue={hero:{px:31,wt:600,lh:38,tnum:!0,ladder:[31,28,24,20]},headline:{px:25,wt:600,lh:32,tnum:!0,ladder:[25,22,20,18]},display:{px:20,wt:600,lh:26,tnum:!0,ladder:[20,18,16]},name:{px:16,wt:600,lh:22,tnum:!1},row:{px:16,wt:400,lh:22,tnum:!0},"row-strong":{px:16,wt:600,lh:22,tnum:!0},title:{px:14,wt:600,lh:18,tnum:!1,max_lines:2},body:{px:14,wt:400,lh:19,tnum:!1},item:{px:14,wt:500,lh:19,tnum:!1},sub:{px:14,wt:400,lh:19,tnum:!0},delta:{px:14,wt:500,lh:19,tnum:!0},index:{px:14,wt:500,lh:19,tnum:!0},meta:{px:12,wt:400,lh:16,tnum:!0},badge:{px:12,wt:600,lh:16,tnum:!1},footer:{px:12,wt:400,lh:16,tnum:!0},label:{px:11,wt:500,lh:14,tnum:!0},tick:{px:11,wt:400,lh:14,tnum:!0}},We={line_w:2,interp_w:1.5,grid_w:1,now_w:1,dot_r:4,dot_ring:2,now_dot_r:4.5,now_dot_ring:2,track_h:4,ref_tick_h:14,ref_tick_w:1.5,label_offset:7,plot_min_share:.45,amplitude_min:{desktop:48,phone:36},past_alpha:.45,bar_gap:2,bar_end_r:4},Ge=.96875,Ke=class extends Error{code;constructor(e,t){super(t),this.code=e,this.name=`ClirError`}},qe=new Set([`stat`,`conditions`,`kv_grid`,`compare`,`bars`,`series_line`,`heatmap`,`event_curve`,`next_event`,`agenda`,`day_table`,`entity_list`,`ranked_list`,`table`,`text_brief`,`image`,`progress`,`map_lite`]),Je=new Set(Object.keys(Ue)),Ye=new Set([`data`,`lexicon`,`ask`,`title`,`key`,`code`]),Xe=new Set([`h:mm a`,`h a`,`ha_short`,`EEE`,`EEE d`,`MMM d`,`EEE MMM d`,`yyyy`,`MMM yyyy`,`MMM d, yyyy`,`MMM d, h:mm a`,`HH:mm`]),Ze=new Set([`sun`,`moon`,`cloud`,`cloud_sun`,`cloud_moon`,`rain`,`drizzle`,`snow`,`storm`,`fog`,`wind`,`alert`,`check`,`cross`,`clock`,`link_out`,`lock`,`unlock`,`pin`,`up`,`down`]),Qe=new Set([`text`,`time`,`rect`,`line`,`tri`,`dot`,`path`,`cells`,`image`,`basemap`,`icon`]),$e=new Set([`start`,`middle`,`end`]),et=new Set([`up`,`down`,`left`,`right`]);function q(e,t){throw new Ke(e,t)}function J(e,t,n=-1/0){return console.assert(typeof t==`string`,`requireNumber: where is string`),console.assert(typeof n==`number`,`requireNumber: min is number`),(typeof e!=`number`||!Number.isFinite(e)||e= ${n}, got ${String(e)}`),e}function tt(e){if(!Array.isArray(e)||e.length<2)return!1;let t=e[0];return t===`l`||t===`r`||t===`c`||t===`f`?e.length===2&&typeof e[1]==`number`&&Number.isFinite(e[1]):t===`m`&&e.length===4&&tt(e[1])&&tt(e[2])&&typeof e[3]==`number`&&Number.isFinite(e[3])}function Y(e,t){return console.assert(typeof t==`string`,`requireAnchor: where is string`),console.assert(t.length>0,`requireAnchor: where non-empty`),tt(e)||q(`bad_anchor`,`${t}: not a valid X anchor`),e}function X(e,t){return console.assert(typeof t==`string`,`requireTok: where is string`),console.assert(t.length>0,`requireTok: where non-empty`),He(e)||q(`bad_token`,`${t}: unknown token ${String(e)}`),e}function nt(e,t){return e==null?null:X(e,t)}function Z(e,t,n){return console.assert(typeof n==`string`,`requireEnum: where is string`),console.assert(t.size>0,`requireEnum: allowed non-empty`),(typeof e!=`string`||!t.has(e))&&q(`bad_enum`,`${n}: value ${String(e)} not allowed`),e}function rt(e,t){let n=Z(e.role,Je,`${t}.role`),r=J(e.px,`${t}.px`,11),i=Z(e.anchor??`start`,$e,`${t}.anchor`),a=Z(e.src??`data`,Ye,`${t}.src`),o=e.dir===`rtl`?`rtl`:`ltr`,s=Array.isArray(e.lines)?e.lines.map(String):[];return{k:`text`,id:J(e.id,`${t}.id`),x:Y(e.x,`${t}.x`),y:J(e.y,`${t}.y`),max_w:J(e.max_w,`${t}.max_w`,0),lines:s,role:n,px:r,tok:X(e.tok,`${t}.tok`),anchor:i,dir:o,src:a}}function it(e,t){let n=Z(e.role,Je,`${t}.role`),r=J(e.px,`${t}.px`,11),i=Z(e.anchor??`start`,$e,`${t}.anchor`),a=Z(e.fmt,Xe,`${t}.fmt`),o=e.tz===`viewer`?`viewer`:`card`;return{k:`time`,id:J(e.id,`${t}.id`),x:Y(e.x,`${t}.x`),y:J(e.y,`${t}.y`),max_w:J(e.max_w,`${t}.max_w`,0),t:String(e.t),fmt:a,tz:o,zone:String(e.zone),role:n,px:r,tok:X(e.tok,`${t}.tok`),anchor:i,show_zone:!!e.show_zone}}function at(e,t){return{k:`rect`,id:J(e.id,`${t}.id`),x0:Y(e.x0,`${t}.x0`),x1:Y(e.x1,`${t}.x1`),y0:J(e.y0,`${t}.y0`),y1:J(e.y1,`${t}.y1`),tok:X(e.tok,`${t}.tok`),r:typeof e.r==`number`?e.r:0,stroke:nt(e.stroke??null,`${t}.stroke`)}}function ot(e,t){return{k:`line`,id:J(e.id,`${t}.id`),x0:Y(e.x0,`${t}.x0`),y0:J(e.y0,`${t}.y0`),x1:Y(e.x1,`${t}.x1`),y1:J(e.y1,`${t}.y1`),tok:X(e.tok,`${t}.tok`),w:typeof e.w==`number`?e.w:1,dash:Array.isArray(e.dash)?e.dash.map(e=>Number(e)):null,gaps:Array.isArray(e.gaps)?e.gaps.map(e=>Number(e)):void 0}}function st(e,t){return{k:`tri`,id:J(e.id,`${t}.id`),x:Y(e.x,`${t}.x`),y:J(e.y,`${t}.y`),size:J(e.size,`${t}.size`,0),dir:Z(e.dir,et,`${t}.dir`),tok:X(e.tok,`${t}.tok`)}}function ct(e,t){return{k:`dot`,id:J(e.id,`${t}.id`),x:Y(e.x,`${t}.x`),y:J(e.y,`${t}.y`),r:J(e.r,`${t}.r`,0),tok:X(e.tok,`${t}.tok`),ring:nt(e.ring??null,`${t}.ring`),ring_w:typeof e.ring_w==`number`?e.ring_w:0}}function lt(e,t){(!e||typeof e!=`object`)&&q(`bad_box`,`${t}: missing`);let n=e;return{x0:Y(n.x0,`${t}.x0`),x1:Y(n.x1,`${t}.x1`),y0:J(n.y0,`${t}.y0`),y1:J(n.y1,`${t}.y1`)}}function ut(e,t){let n=Array.isArray(e.pts)?e.pts:[];n.length>400&&q(`too_many_points`,`${t}.pts > 400`);let r=Z(e.style??`solid`,new Set([`solid`,`interp`]),`${t}.style`);return{k:`path`,id:J(e.id,`${t}.id`),box:lt(e.box,`${t}.box`),pts:n.map(e=>((!Array.isArray(e)||e.length!==2)&&q(`bad_point`,`${t}.pts`),[Number(e[0]),Number(e[1])])),tok:X(e.tok,`${t}.tok`),w:typeof e.w==`number`?e.w:2,style:r,fill:nt(e.fill??null,`${t}.fill`)}}function dt(e,t){let n=Z(e.ramp??`seq`,new Set([`seq`,`div`]),`${t}.ramp`);return{k:`cells`,id:J(e.id,`${t}.id`),box:lt(e.box,`${t}.box`),cols:J(e.cols,`${t}.cols`,1),rows:J(e.rows,`${t}.rows`,1),v:Array.isArray(e.v)?e.v.map(e=>e==null?-1:Number(e)):[],ramp:n,steps:typeof e.steps==`number`?e.steps:5,gap:typeof e.gap==`number`?e.gap:1}}function ft(e,t){let n=Z(e.fit??`contain`,new Set([`cover`,`contain`]),`${t}.fit`),r=Array.isArray(e.crop)&&e.crop.length===4?[Number(e.crop[0]),Number(e.crop[1]),Number(e.crop[2]),Number(e.crop[3])]:null;return{k:`image`,id:J(e.id,`${t}.id`),box:lt(e.box,`${t}.box`),ref:String(e.ref??``),fit:n,crop:r}}function pt(e,t){let n=Array.isArray(e.bbox)&&e.bbox.length===4?[Number(e.bbox[0]),Number(e.bbox[1]),Number(e.bbox[2]),Number(e.bbox[3])]:[0,0,0,0];return{k:`basemap`,id:J(e.id,`${t}.id`),box:lt(e.box,`${t}.box`),asset:String(e.asset??`world110m`),bbox:n,land:X(e.land??`map-land`,`${t}.land`),stroke:X(e.stroke??`map-stroke`,`${t}.stroke`)}}function mt(e,t){return{k:`icon`,id:J(e.id,`${t}.id`),x:Y(e.x,`${t}.x`),y:J(e.y,`${t}.y`),size:J(e.size,`${t}.size`,0),name:Z(e.name,Ze,`${t}.name`),tok:X(e.tok,`${t}.tok`)}}var ht={text:rt,time:it,rect:at,line:ot,tri:st,dot:ct,path:ut,cells:dt,image:ft,basemap:pt,icon:mt};function gt(e,t){(!e||typeof e!=`object`)&&q(`bad_prim`,`${t}: not an object`);let n=e,r=n.k;return(typeof r!=`string`||!Qe.has(r))&&q(`bad_prim_kind`,`${t}.k: unknown kind ${String(r)}`),ht[r](n,t)}function Q(e){(!e||typeof e!=`object`)&&q(`bad_clir`,`clir: not an object`);let t=e;t.v!==1&&q(`bad_version`,`clir.v must be 1`);let n=Z(t.form,qe,`clir.form`),r=Array.isArray(t.prims)?t.prims:[];r.length>2e3&&q(`too_many_prims`,`clir.prims > 2000`);let i=new Set,a=[];r.forEach((e,t)=>{let n=gt(e,`clir.prims[${t}]`);i.has(n.id)&&q(`dup_prim_id`,`clir.prims[${t}]: dup id ${n.id}`),i.add(n.id),a.push(n)}),(typeof t.summary!=`string`||!t.summary)&&q(`bad_summary`,`clir.summary missing`);let o=t.bucket&&typeof t.bucket==`object`?t.bucket:{};return{v:1,form:n,variant:String(t.variant??``),cand:String(t.cand??``),plan:String(t.plan??``),span:String(t.span??``),bucket:{min_w:Number(o.min_w??0),max_w:Number(o.max_w??0),h:Number(o.h??0)},state:String(t.state??`ok`),prims:a,reading_order:Array.isArray(t.reading_order)?t.reading_order.map(Number):[],summary:t.summary,live:Array.isArray(t.live)?t.live.map(e=>({k:String(e.k??``),args:e.args??{}})):[],hitmap:Array.isArray(t.hitmap)?t.hitmap.map(e=>({prim:Number(e.prim??-1),label:String(e.label??``)})):[],dropped:Array.isArray(t.dropped)?t.dropped.map(String):[],ladder:Array.isArray(t.ladder)?t.ladder.map(String):[]}}function _t(e,t,n){if(console.assert(typeof t==`number`,`resolveX: left is number`),console.assert(typeof n==`number`,`resolveX: width is number`),e[0]===`l`)return t+e[1];if(e[0]===`r`)return t+n-e[1];if(e[0]===`c`)return t+n/2+e[1];if(e[0]===`f`)return t+e[1]*n;let r=_t(e[1],t,n);return r+(_t(e[2],t,n)-r)*e[3]}function vt(e,t,n){console.assert(Number.isFinite(n),`lerpAnchor: frac finite`),console.assert(Array.isArray(e)&&Array.isArray(t),`lerpAnchor: anchors arrays`);let r=e=>e===`l`||e===`r`||e===`c`||e===`f`;if(r(e[0])&&r(t[0])&&e[0]===t[0]&&e[0]!==`r`){let r=e[1],i=t[1];return[e[0],r+(i-r)*n]}if(e[0]===`r`&&t[0]===`r`){let r=e[1];return[`r`,r+(t[1]-r)*n]}return e[0]===`l`&&t[0]===`r`&&e[1]===0&&t[1]===0?[`f`,n]:[`m`,e,t,n]}function yt(e){if(console.assert(typeof e==`string`,`parseT: t is string`),console.assert(e.length>0,`parseT: t non-empty`),e.length===10){let[t,n,r]=e.split(`-`).map(Number);return{date:!0,y:t,m:n-1,d:r}}return Date.parse(e)}function bt(e){return typeof e==`number`?e:Date.UTC(e.y,e.m,e.d)}var xt=e=>new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour:`numeric`,minute:`2-digit`,second:`2-digit`,weekday:`short`,month:`short`,day:`numeric`,year:`numeric`,hour12:!1,hourCycle:`h23`});function St(e,t){let n=xt(t).formatToParts(new Date(e)),r={};for(let e of n)e.type!==`literal`&&(r[e.type]=e.value);return r}function Ct(e,t){let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,timeZoneName:`short`,year:`numeric`}).formatToParts(new Date(e)).find(e=>e.type===`timeZoneName`)?.value??``;return n.startsWith(`GMT`)||n.startsWith(`UTC`)?n.replace(`GMT`,`UTC`).replace(`UTC+0`,`UTC`).replace(`UTC-0`,`UTC`):n}function wt(e,t,n,r){let i=yt(e),a=typeof i!=`number`,o=bt(i),s=St(o,a?`UTC`:n),c=Number(s.hour),l=c%12||12,u=c<12?`am`:`pm`,d=s.minute,f=c.toString().padStart(2,`0`),p=Number(s.day),m={"h:mm a":`${l}:${d} ${u}`,"h a":`${l} ${u}`,ha_short:`${l}${u[0]}`,EEE:s.weekday,"EEE d":`${s.weekday} ${p}`,"MMM d":`${s.month} ${p}`,"EEE MMM d":`${s.weekday} ${s.month} ${p}`,yyyy:s.year,"MMM yyyy":`${s.month} ${s.year}`,"MMM d, yyyy":`${s.month} ${p}, ${s.year}`,"MMM d, h:mm a":`${s.month} ${p}, ${l}:${d} ${u}`,"HH:mm":`${f}:${d}`}[t];if(m===void 0)throw new Ke(`bad_fmt`,`formatTime: unknown fmt ${t}`);return r&&!a?`${m} ${Ct(o,n)}`:m}function Tt(e,t){console.assert(typeof t==`string`,`timePrimText: viewerTz is string`),console.assert(e.k===`time`,`timePrimText: prim is time`);let n=e.tz===`card`?e.zone:t,r=e.show_zone&&n!==t;return wt(e.t,e.fmt,n,r)}function Et(e,t=`in_hm`){console.assert(Number.isFinite(e),`countdownText: seconds finite`),console.assert(typeof t==`string`,`countdownText: fmt is string`);let n=Math.trunc(e);if(n<=0)return`now`;let r=Math.floor((n+59)/60),i=Math.floor(r/1440),a=r%1440,o=Math.floor(a/60),s=a%60;if(t===`rel`||t===`in_dhm`&&i>=2){if(i>=2)return`in ${i} days`;if(i===1)return o===0?`in 1 day`:`in 1 d ${o} h`}o+=i*24;let c=o&&s?`${o} h ${s} m`:o?`${o} h`:`${s} min`;return t===`hm`?c:`in ${c}`}function Dt(e,t=`auto`){console.assert(Number.isFinite(e),`countUpText: seconds finite`),console.assert(typeof t==`string`,`countUpText: unit is string`);let n=Math.max(0,Math.trunc(e)),r=t===`auto`?n>=172800?`day`:n>=7200?`hour`:`minute`:t,i=Math.floor(n/{day:86400,hour:3600,minute:60}[r]),a={day:`day`,hour:`hour`,minute:`minute`}[r];return`${i.toLocaleString(`en-US`)} ${a}${i===1?``:`s`}`}function Ot(e){console.assert(Number.isFinite(e),`ageText: seconds finite`),console.assert(typeof e==`number`,`ageText: seconds number`);let t=Math.max(0,Math.trunc(e));return t<3600?`${Math.max(1,Math.floor(t/60))} min old`:t<172800?`${Math.floor(t/3600)} h old`:`${Math.floor(t/86400)} d old`}var kt=/^(,?)(?:\.(\d)([f%])|(d))$/;function At(e,t){console.assert(Number.isFinite(e),`numberText: v finite`),console.assert(typeof t==`string`,`numberText: fmt is string`);let n=kt.exec(t)??[null,`,`,`0`,`f`],r=n[1]===`,`,i=n[3]===`%`,a=n[4]===`d`||n[2]===void 0?0:Number(n[2]),o=(i?e*100:e).toLocaleString(`en-US`,{useGrouping:r,minimumFractionDigits:a,maximumFractionDigits:a});return i?`${o}%`:o}function jt(e,t){console.assert(Array.isArray(e),`activeVariant: variants array`),console.assert(Number.isFinite(t),`activeVariant: now finite`);let n=-1;for(let r=0;r=i)&&(a===null||t=i)&&(n=r)}return n<0?0:n}function Mt(e,t){let n=e.pts;if(!n.length)return null;let r=e.box,i=n[0][1];if(t>=n[n.length-1][0])i=n[n.length-1][1];else if(t>n[0][0])for(let e=1;e=r&&t<=o){i=o===r?a:a+(s-a)*(t-r)/(o-r);break}}return r.y0+i*(r.y1-r.y0)}function Nt(e,t){console.assert(Number.isFinite(t),`applyLive: now finite`),console.assert(e.v===1,`applyLive: clir v=1`);let n=structuredClone(e),r=new Map(n.prims.map(e=>[e.id,e])),i=new Set;for(let e of n.live)Pt(e,r,i,t);return n.prims=n.prims.filter(e=>!i.has(e.id)),n.reading_order=n.reading_order.filter(e=>!i.has(e)),n.live=[],n}function Pt(e,t,n,r){console.assert(typeof e.k==`string`,`runBinding: k is string`),console.assert(t instanceof Map,`runBinding: by is Map`);let i=e.args;if(e.k===`now_marker`)return Ft(i,t,n,r);if(e.k===`countdown`)return It(i,t,r);if(e.k===`count_up`)return Lt(i,t,r);if(e.k===`age`)return Rt(i,t,r);if(e.k===`extrapolate`)return zt(i,t,r);if(e.k===`timed_variants`)return Bt(i,n,r);if(e.k===`past_dim`)return Vt(i,t,r)}function Ft(e,t,n,r){let i=e.box,a=bt(yt(e.t0)),o=bt(yt(e.t1))-a,s=o>0?(r-a)/o:-1,c=e.prims??[];if(!(s>=0&&s<=1)){for(let e of c)n.add(e);return}let l=vt(i.x0,i.x1,s),u=typeof e.path==`number`?t.get(e.path):void 0,d=u&&u.k===`path`?Mt(u,s):null;for(let n of c){let r=t.get(n);r&&(r.k===`line`?(r.x0=l,r.x1=l,Array.isArray(e.gaps)&&(r.gaps=e.gaps)):r.k===`dot`||r.k===`tri`||r.k===`icon`?(r.x=l,d!==null&&r.k===`dot`&&(r.y=d)):(r.k===`text`||r.k===`time`)&&(r.x=l))}}function It(e,t,n){let r=t.get(e.prim);!r||r.k!==`text`&&r.k!==`time`||(r.lines=[Et((bt(yt(e.t))-n)/1e3,e.fmt||`in_hm`)])}function Lt(e,t,n){let r=t.get(e.prim);if(!r||r.k!==`text`&&r.k!==`time`)return;let i=bt(yt(e.t0)),a=e.unit||`auto`;r.lines=[Dt((n-i)/1e3,a)]}function Rt(e,t,n){let r=t.get(e.prim);!r||r.k!==`text`&&r.k!==`time`||(r.lines=[Ot((n-bt(yt(e.t)))/1e3)])}function zt(e,t,n){let r=t.get(e.prim);if(!r||r.k!==`text`&&r.k!==`time`)return;let i=bt(yt(e.t0));r.lines=[At(e.v0+e.rate_per_s*(n-i)/1e3,e.fmt||`,.0f`)]}function Bt(e,t,n){let r=e.variants??[];if(!r.length)return;let i=jt(r,n);for(let e=0;ee[0]-t[0]);let c=[[a,o]];for(let[e,t]of s){let n=[];for(let[r,i]of c){if(t<=r||e>=i){n.push([r,i]);continue}e>r&&n.push([r,e]),tt-e>1)}function Kt(e,t){console.assert(t.width>0,`renderModel: width > 0`),console.assert(Number.isFinite(t.now),`renderModel: now finite`);let n=Nt(e,t.now),r=new Map(n.prims.map(e=>[e.id,e])),i=[];for(let e of n.prims)if(e.k===`text`)i.push(Ut(e,t.width));else if(e.k===`time`){let n=e.lines??[Tt(e,t.viewerTz)],r={...e,lines:n};i.push(Ut(r,t.width))}else i.push({kind:`svg`,id:e.id,prim:e});for(let e of n.prims)e.k===`line`&&e.gaps&&e.gaps.length&&(e._segs=Gt(e,r,t.width));return{width:t.width,height:e.bucket.h,summary:n.summary,readingOrder:n.reading_order,hitmap:n.hitmap,ops:i}}var qt=`/ni/world110m.json`,Jt=null;function Yt(){if(console.assert(qt.startsWith(`/`),`loadWorld: same-origin asset`),console.assert(typeof fetch==`function`,`loadWorld: fetch available`),Jt)return Jt;let e=Xt().then(e=>(e.length===0&&(Jt=null),e));return Jt=e,e}async function Xt(){console.assert(qt.endsWith(`.json`),`fetchWorld: json asset`);try{let e=await fetch(qt);return console.assert(typeof e.ok==`boolean`,`fetchWorld: a response`),e.ok?Zt(await e.json()):[]}catch{return[]}}function Zt(e){console.assert(e!==void 0,`parseWorld: payload present`);let t=typeof e==`object`&&e&&`polys`in e?e.polys:null;if(!Array.isArray(t))return[];let n=t,r=[];for(let e of n){let t=Qt(e);if(t===null)return[];r.push(t)}return console.assert(r.length===n.length,`parseWorld: every ring kept`),r}function Qt(e){if(console.assert(e!==void 0,`ringPoints: ring present`),!Array.isArray(e)||e.length===0)return null;let t=e,n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2)return null;let t=e[0],r=e[1];if(typeof t!=`number`||typeof r!=`number`||!Number.isFinite(t)||!Number.isFinite(r))return null;n.push([t,r])}return console.assert(n.length===t.length,`ringPoints: every point kept`),n}function $t(e,t,n){console.assert(e.k===`basemap`,`mapPaths: basemap prim`),console.assert(t>=0,`mapPaths: width non-negative`);let r=e.box,i=_t(r.x0,0,t),a=_t(r.x1,0,t),[o,s,c,l]=e.bbox;if(!(c>o)||!(l>s))return[];let u=a-i,d=r.y1-r.y0,f=[];for(let e of n){if(en(e,o,s,c,l))continue;let t=e.map(([e,t])=>`${tn(i+(e-o)/(c-o)*u)},${tn(r.y0+(l-t)/(l-s)*d)}`);f.push(`M${t.join(` L`)}Z`)}return f}function en(e,t,n,r,i){console.assert(e.length>0,`missesBbox: non-empty ring`),console.assert(r>t&&i>n,`missesBbox: ordered bbox`);let a=1/0,o=-1/0,s=1/0,c=-1/0;for(let[t,n]of e)to&&(o=t),nc&&(c=n);return or||ci}function tn(e){console.assert(typeof e==`number`,`fmt: number`),console.assert(Number.isFinite(e),`fmt: finite number`);let t=e.toFixed(2).replace(/\.?0+$/,``);return t===`-0`||t===``?`0`:t}var nn={box:24,stroke:1.75,icons:{sun:[{t:`circle`,c:[12,12],r:4,fill:!1},{t:`poly`,pts:[[18.8,12],[21.2,12]],closed:!1,fill:!1},{t:`poly`,pts:[[16.808,16.808],[18.505,18.505]],closed:!1,fill:!1},{t:`poly`,pts:[[12,18.8],[12,21.2]],closed:!1,fill:!1},{t:`poly`,pts:[[7.192,16.808],[5.495,18.505]],closed:!1,fill:!1},{t:`poly`,pts:[[5.2,12],[2.8,12]],closed:!1,fill:!1},{t:`poly`,pts:[[7.192,7.192],[5.495,5.495]],closed:!1,fill:!1},{t:`poly`,pts:[[12,5.2],[12,2.8]],closed:!1,fill:!1},{t:`poly`,pts:[[16.808,7.192],[18.505,5.495]],closed:!1,fill:!1}],moon:[{t:`poly`,pts:[[4.122,13.389],[4.078,13.113],[4.044,12.836],[4.019,12.558],[4.005,12.279],[4,12],[4.005,11.721],[4.019,11.442],[4.044,11.164],[4.078,10.887],[4.122,10.611],[4.175,10.337],[4.238,10.065],[4.31,9.795],[4.392,9.528],[4.482,9.264],[4.583,9.003],[4.692,8.746],[4.81,8.493],[4.936,8.244],[5.072,8],[5.216,7.761],[5.368,7.526],[5.528,7.298],[5.696,7.075],[5.872,6.858],[6.055,6.647],[6.245,6.443],[6.443,6.245],[6.647,6.055],[6.858,5.872],[7.075,5.696],[7.298,5.528],[7.526,5.368],[7.761,5.216],[8,5.072],[8.244,4.936],[8.493,4.81],[8.746,4.692],[9.217,9.288],[9.204,9.044],[9.238,9.532],[9.2,8.8],[9.268,9.774],[9.204,8.556],[9.003,4.583],[9.306,10.016],[9.217,8.312],[9.238,8.068],[9.353,10.255],[9.268,7.826],[9.306,7.584],[9.408,10.493],[9.264,4.482],[9.353,7.345],[9.408,7.107],[9.471,10.729],[9.471,6.871],[9.528,4.392],[9.543,6.637],[9.543,10.963],[9.622,6.406],[9.71,6.178],[9.795,4.31],[9.805,5.953],[9.908,5.731],[9.622,11.194],[10.065,4.238],[10.019,5.514],[10.138,5.3],[10.337,4.175],[10.264,5.091],[9.71,11.422],[10.397,4.886],[10.537,4.686],[10.611,4.122],[10.684,4.49],[10.838,4.3],[10.887,4.078],[10.998,4.116],[9.805,11.647],[9.908,11.869],[10.019,12.086],[10.138,12.3],[10.264,12.509],[10.397,12.714],[10.537,12.914],[10.684,13.11],[10.838,13.3],[10.998,13.484],[11.165,13.663],[19.269,15.092],[19.047,15.195],[19.308,15.254],[11.337,13.835],[18.822,15.29],[18.594,15.378],[19.19,15.507],[18.363,15.457],[18.129,15.529],[19.064,15.756],[11.516,14.002],[17.893,15.592],[17.655,15.647],[18.928,16],[17.416,15.694],[17.174,15.732],[18.784,16.239],[11.7,14.162],[16.932,15.762],[16.688,15.783],[18.632,16.474],[16.444,15.796],[11.89,14.316],[16.2,15.8],[15.956,15.796],[18.472,16.702],[15.712,15.783],[12.086,14.463],[15.468,15.762],[18.304,16.925],[15.226,15.732],[12.286,14.603],[14.984,15.694],[14.745,15.647],[12.491,14.736],[14.507,15.592],[18.128,17.142],[14.271,15.529],[12.7,14.862],[14.037,15.457],[12.914,14.981],[13.806,15.378],[13.131,15.092],[13.578,15.29],[13.353,15.195],[17.945,17.353],[17.755,17.557],[17.557,17.755],[17.353,17.945],[17.142,18.128],[16.925,18.304],[16.702,18.472],[16.474,18.632],[16.239,18.784],[16,18.928],[15.756,19.064],[15.507,19.19],[15.254,19.308],[14.997,19.417],[14.736,19.518],[14.472,19.608],[14.205,19.69],[13.935,19.762],[13.663,19.825],[13.389,19.878],[13.113,19.922],[12.836,19.956],[12.558,19.981],[12.279,19.995],[12,20],[11.721,19.995],[11.442,19.981],[11.164,19.956],[10.887,19.922],[10.611,19.878],[10.337,19.825],[10.065,19.762],[9.795,19.69],[9.528,19.608],[9.264,19.518],[9.003,19.417],[8.746,19.308],[8.493,19.19],[8.244,19.064],[8,18.928],[7.761,18.784],[7.526,18.632],[7.298,18.472],[7.075,18.304],[6.858,18.128],[6.647,17.945],[6.443,17.755],[6.245,17.557],[6.055,17.353],[5.872,17.142],[5.696,16.925],[5.528,16.702],[5.368,16.474],[5.216,16.239],[5.072,16],[4.936,15.756],[4.81,15.507],[4.692,15.254],[4.583,14.997],[4.482,14.736],[4.392,14.472],[4.31,14.205],[4.238,13.935],[4.175,13.663]],closed:!0,fill:!1}],cloud:[{t:`poly`,pts:[[3.709,14.235],[3.737,13.971],[3.783,13.71],[3.847,13.453],[3.929,13.2],[4.029,12.954],[4.145,12.716],[4.277,12.486],[4.426,12.266],[4.589,12.057],[4.767,11.86],[4.957,11.676],[5.16,11.506],[5.375,11.35],[5.6,11.209],[5.834,11.085],[6.076,10.977],[6.326,10.886],[6.581,10.813],[6.84,10.758],[7.103,10.721],[7.367,10.702],[7.512,10.651],[7.549,10.304],[7.609,9.96],[7.694,9.622],[7.802,9.29],[7.932,8.966],[8.085,8.653],[8.26,8.35],[8.455,8.061],[8.67,7.786],[8.903,7.527],[9.154,7.284],[9.422,7.06],[9.704,6.855],[10,6.67],[10.308,6.506],[10.627,6.364],[10.955,6.245],[11.29,6.149],[11.632,6.076],[11.977,6.027],[12.326,6.003],[12.674,6.003],[13.023,6.027],[13.368,6.076],[13.71,6.149],[14.045,6.245],[14.373,6.364],[14.692,6.506],[15,6.67],[15.296,6.855],[15.578,7.06],[15.846,7.284],[16.097,7.527],[16.33,7.786],[16.545,8.061],[16.74,8.35],[16.915,8.653],[17.068,8.966],[17.198,9.29],[17.306,9.622],[17.391,9.96],[17.451,10.304],[17.576,10.62],[17.825,10.655],[18.071,10.707],[18.312,10.776],[18.549,10.862],[18.778,10.964],[19,11.082],[19.213,11.215],[19.416,11.363],[19.609,11.525],[19.79,11.699],[19.958,11.886],[20.112,12.084],[20.253,12.292],[20.379,12.51],[20.489,12.736],[20.583,12.969],[20.661,13.208],[20.721,13.452],[20.765,13.699],[20.791,13.949],[20.8,14.2],[20.791,14.451],[20.765,14.701],[20.721,14.948],[20.661,15.192],[20.583,15.431],[20.489,15.664],[20.379,15.89],[20.253,16.108],[20.112,16.316],[19.958,16.514],[19.79,16.701],[19.609,16.875],[19.416,17.037],[19.213,17.185],[19,17.318],[20.8,18.2],[18.778,17.436],[18.549,17.538],[18.312,17.624],[18.071,17.693],[17.825,17.745],[17.576,17.78],[17.326,17.798],[17.074,17.798],[16.824,17.78],[16.575,17.745],[16.329,17.693],[16.088,17.624],[15.851,17.538],[14.021,15.89],[15.622,17.436],[15.4,17.318],[14.147,16.108],[15.187,17.185],[14.288,16.316],[14.984,17.037],[14.791,16.875],[14.442,16.514],[14.61,16.701],[13.71,15.851],[13.368,15.924],[13.023,15.973],[12.674,15.997],[12.326,15.997],[11.977,15.973],[11.632,15.924],[10.411,16.943],[10.233,17.14],[10.574,16.734],[10.043,17.324],[10.723,16.514],[9.84,17.494],[11.29,15.851],[9.625,17.65],[10.855,16.284],[9.4,17.791],[9.166,17.915],[10.971,16.046],[8.924,18.023],[8.674,18.114],[11.071,15.8],[8.419,18.187],[6.581,18.187],[6.326,18.114],[6.076,18.023],[5.834,17.915],[5.6,17.791],[5.375,17.65],[3.7,18.2],[5.16,17.494],[4.957,17.324],[4.767,17.14],[4.589,16.943],[4.426,16.734],[4.277,16.514],[4.145,16.284],[4.029,16.046],[3.929,15.8],[3.847,15.547],[3.783,15.29],[3.737,15.029],[3.709,14.765],[3.7,14.5]],closed:!0,fill:!1}],cloud_sun:[{t:`circle`,c:[8.5,8.5],r:3,fill:!1},{t:`poly`,pts:[[4.964,12.036],[3.692,13.308]],closed:!1,fill:!1},{t:`poly`,pts:[[3.5,8.5],[1.7,8.5]],closed:!1,fill:!1},{t:`poly`,pts:[[4.964,4.964],[3.692,3.692]],closed:!1,fill:!1},{t:`poly`,pts:[[8.5,3.5],[8.5,1.7]],closed:!1,fill:!1},{t:`poly`,pts:[[12.036,4.964],[13.308,3.692]],closed:!1,fill:!1},{t:`poly`,pts:[[7.402,16.233],[7.424,16.016],[7.462,15.802],[7.515,15.591],[7.582,15.384],[7.663,15.183],[7.759,14.987],[7.867,14.799],[7.989,14.618],[8.123,14.447],[8.269,14.285],[8.425,14.134],[8.592,13.995],[8.768,13.867],[8.952,13.751],[9.144,13.649],[9.343,13.561],[9.547,13.487],[9.756,13.427],[9.969,13.381],[10.184,13.351],[10.401,13.336],[10.52,13.294],[10.55,13.009],[10.6,12.728],[10.669,12.45],[10.757,12.178],[10.864,11.912],[10.99,11.655],[11.133,11.407],[11.293,11.17],[11.469,10.945],[11.661,10.732],[11.867,10.533],[12.086,10.349],[12.317,10.181],[12.56,10.029],[12.813,9.895],[13.074,9.779],[13.343,9.681],[13.618,9.602],[13.898,9.542],[14.181,9.502],[14.467,9.482],[14.753,9.482],[15.039,9.502],[15.322,9.542],[15.602,9.602],[15.877,9.681],[16.146,9.779],[16.407,9.895],[16.66,10.029],[16.903,10.181],[17.134,10.349],[17.353,10.533],[17.559,10.732],[17.751,10.945],[17.927,11.17],[18.087,11.407],[18.23,11.655],[18.356,11.912],[18.463,12.178],[18.551,12.45],[18.62,12.728],[18.67,13.009],[18.773,13.268],[18.977,13.297],[19.178,13.34],[19.376,13.396],[19.57,13.467],[19.758,13.551],[19.94,13.647],[20.115,13.757],[20.281,13.878],[20.439,14.01],[20.587,14.153],[20.725,14.306],[20.852,14.469],[20.967,14.64],[21.07,14.818],[21.161,15.003],[21.238,15.194],[21.302,15.39],[21.351,15.59],[21.387,15.793],[21.409,15.998],[21.416,16.204],[21.409,16.41],[21.387,16.615],[21.351,16.818],[21.302,17.018],[21.238,17.214],[21.161,17.405],[21.07,17.59],[20.967,17.768],[20.852,17.939],[20.725,18.102],[20.587,18.255],[20.439,18.398],[20.281,18.53],[20.115,18.651],[19.94,18.761],[21.416,19.484],[19.758,18.857],[19.57,18.941],[19.376,19.012],[19.178,19.068],[18.977,19.111],[18.773,19.14],[18.567,19.154],[18.361,19.154],[18.155,19.14],[17.951,19.111],[17.75,19.068],[17.552,19.012],[17.358,18.941],[15.858,17.59],[17.17,18.857],[16.988,18.761],[15.961,17.768],[16.813,18.651],[16.076,17.939],[16.647,18.53],[16.489,18.398],[16.203,18.102],[16.341,18.255],[15.602,17.558],[15.322,17.618],[15.039,17.658],[14.753,17.678],[14.467,17.678],[14.181,17.658],[13.898,17.618],[12.897,18.453],[12.751,18.615],[13.031,18.282],[12.595,18.766],[13.153,18.101],[12.428,18.905],[13.618,17.558],[12.252,19.033],[13.261,17.913],[12.068,19.149],[11.876,19.251],[13.357,17.717],[11.677,19.339],[11.473,19.413],[13.438,17.516],[11.264,19.473],[9.756,19.473],[9.547,19.413],[9.343,19.339],[9.144,19.251],[8.952,19.149],[8.768,19.033],[7.394,19.484],[8.592,18.905],[8.425,18.766],[8.269,18.615],[8.123,18.453],[7.989,18.282],[7.867,18.101],[7.759,17.913],[7.663,17.717],[7.582,17.516],[7.515,17.309],[7.462,17.098],[7.424,16.884],[7.402,16.667],[7.394,16.45]],closed:!0,fill:!1}],cloud_moon:[{t:`poly`,pts:[[3.501,9.433],[3.454,9.258],[3.414,9.081],[3.379,8.903],[3.351,8.724],[3.328,8.544],[3.313,8.363],[3.303,8.181],[3.3,8],[3.303,7.819],[3.313,7.637],[3.328,7.456],[3.351,7.276],[3.379,7.097],[3.414,6.919],[3.454,6.742],[3.501,6.567],[3.555,6.393],[3.614,6.221],[3.679,6.052],[3.75,5.885],[3.826,5.72],[3.909,5.559],[3.997,5.4],[4.09,5.244],[4.189,5.092],[4.293,4.944],[4.402,4.799],[4.517,4.658],[4.636,4.521],[4.759,4.388],[4.888,4.259],[5.021,4.136],[5.158,4.017],[5.299,3.902],[5.444,3.793],[5.592,3.689],[5.744,3.59],[5.9,3.497],[6.059,3.409],[6.22,3.326],[6.385,3.25],[6.552,3.179],[6.721,3.114],[6.893,3.055],[7.067,3.001],[6.77,5.101],[6.745,5.26],[6.801,4.944],[6.837,4.787],[6.725,5.419],[6.878,4.632],[6.711,5.579],[6.925,4.479],[6.703,5.739],[6.977,4.327],[7.242,2.954],[7.035,4.177],[6.7,5.9],[7.098,4.029],[6.703,6.061],[7.166,3.883],[7.238,3.74],[7.419,2.914],[6.711,6.221],[7.316,3.6],[7.399,3.462],[6.725,6.381],[7.486,3.328],[7.597,2.879],[7.579,3.196],[6.745,6.54],[7.675,3.068],[7.776,2.851],[7.776,2.943],[6.77,6.699],[6.801,6.856],[6.837,7.013],[6.878,7.168],[6.925,7.321],[6.977,7.473],[7.035,7.623],[7.098,7.771],[7.166,7.917],[7.238,8.06],[7.316,8.2],[7.399,8.338],[7.486,8.472],[7.579,8.604],[7.675,8.732],[7.776,8.857],[7.882,8.978],[7.991,9.095],[8.105,9.209],[8.222,9.318],[8.343,9.424],[8.468,9.525],[8.596,9.621],[8.728,9.714],[13.171,10.102],[13.25,10.115],[13.023,10.165],[12.873,10.223],[8.862,9.801],[13.174,10.28],[12.721,10.275],[12.568,10.322],[9,9.884],[13.091,10.441],[12.413,10.363],[12.256,10.399],[9.14,9.962],[12.099,10.43],[13.003,10.6],[11.94,10.455],[9.283,10.034],[11.781,10.475],[9.429,10.102],[11.621,10.489],[12.91,10.756],[11.461,10.497],[9.577,10.165],[11.3,10.5],[9.727,10.223],[11.139,10.497],[10.979,10.489],[9.879,10.275],[10.819,10.475],[10.032,10.322],[10.66,10.455],[10.187,10.363],[10.501,10.43],[12.811,10.908],[10.344,10.399],[12.707,11.056],[12.598,11.201],[12.483,11.342],[12.364,11.479],[12.241,11.612],[12.112,11.741],[11.979,11.864],[11.842,11.983],[11.701,12.098],[11.556,12.207],[11.408,12.311],[11.256,12.41],[11.1,12.503],[10.941,12.591],[10.78,12.674],[10.615,12.75],[10.448,12.821],[10.279,12.886],[10.107,12.945],[9.933,12.999],[9.758,13.046],[9.581,13.086],[9.403,13.121],[9.224,13.149],[9.044,13.172],[8.863,13.187],[8.681,13.197],[8.5,13.2],[8.319,13.197],[8.137,13.187],[7.956,13.172],[7.776,13.149],[7.597,13.121],[7.419,13.086],[7.242,13.046],[7.067,12.999],[6.893,12.945],[6.721,12.886],[6.552,12.821],[6.385,12.75],[6.22,12.674],[6.059,12.591],[5.9,12.503],[5.744,12.41],[5.592,12.311],[5.444,12.207],[5.299,12.098],[5.158,11.983],[5.021,11.864],[4.888,11.741],[4.759,11.612],[4.636,11.479],[4.517,11.342],[4.402,11.201],[4.293,11.056],[4.189,10.908],[4.09,10.756],[3.997,10.6],[3.909,10.441],[3.826,10.28],[3.75,10.115],[3.679,9.948],[3.614,9.779],[3.555,9.607]],closed:!0,fill:!1},{t:`poly`,pts:[[7.402,16.233],[7.424,16.016],[7.462,15.802],[7.515,15.591],[7.582,15.384],[7.663,15.183],[7.759,14.987],[7.867,14.799],[7.989,14.618],[8.123,14.447],[8.269,14.285],[8.425,14.134],[8.592,13.995],[8.768,13.867],[8.952,13.751],[9.144,13.649],[9.343,13.561],[9.547,13.487],[9.756,13.427],[9.969,13.381],[10.184,13.351],[10.401,13.336],[10.52,13.294],[10.55,13.009],[10.6,12.728],[10.669,12.45],[10.757,12.178],[10.864,11.912],[10.99,11.655],[11.133,11.407],[11.293,11.17],[11.469,10.945],[11.661,10.732],[11.867,10.533],[12.086,10.349],[12.317,10.181],[12.56,10.029],[12.813,9.895],[13.074,9.779],[13.343,9.681],[13.618,9.602],[13.898,9.542],[14.181,9.502],[14.467,9.482],[14.753,9.482],[15.039,9.502],[15.322,9.542],[15.602,9.602],[15.877,9.681],[16.146,9.779],[16.407,9.895],[16.66,10.029],[16.903,10.181],[17.134,10.349],[17.353,10.533],[17.559,10.732],[17.751,10.945],[17.927,11.17],[18.087,11.407],[18.23,11.655],[18.356,11.912],[18.463,12.178],[18.551,12.45],[18.62,12.728],[18.67,13.009],[18.773,13.268],[18.977,13.297],[19.178,13.34],[19.376,13.396],[19.57,13.467],[19.758,13.551],[19.94,13.647],[20.115,13.757],[20.281,13.878],[20.439,14.01],[20.587,14.153],[20.725,14.306],[20.852,14.469],[20.967,14.64],[21.07,14.818],[21.161,15.003],[21.238,15.194],[21.302,15.39],[21.351,15.59],[21.387,15.793],[21.409,15.998],[21.416,16.204],[21.409,16.41],[21.387,16.615],[21.351,16.818],[21.302,17.018],[21.238,17.214],[21.161,17.405],[21.07,17.59],[20.967,17.768],[20.852,17.939],[20.725,18.102],[20.587,18.255],[20.439,18.398],[20.281,18.53],[20.115,18.651],[19.94,18.761],[21.416,19.484],[19.758,18.857],[19.57,18.941],[19.376,19.012],[19.178,19.068],[18.977,19.111],[18.773,19.14],[18.567,19.154],[18.361,19.154],[18.155,19.14],[17.951,19.111],[17.75,19.068],[17.552,19.012],[17.358,18.941],[15.858,17.59],[17.17,18.857],[16.988,18.761],[15.961,17.768],[16.813,18.651],[16.076,17.939],[16.647,18.53],[16.489,18.398],[16.203,18.102],[16.341,18.255],[15.602,17.558],[15.322,17.618],[15.039,17.658],[14.753,17.678],[14.467,17.678],[14.181,17.658],[13.898,17.618],[12.897,18.453],[12.751,18.615],[13.031,18.282],[12.595,18.766],[13.153,18.101],[12.428,18.905],[13.618,17.558],[12.252,19.033],[13.261,17.913],[12.068,19.149],[11.876,19.251],[13.357,17.717],[11.677,19.339],[11.473,19.413],[13.438,17.516],[11.264,19.473],[9.756,19.473],[9.547,19.413],[9.343,19.339],[9.144,19.251],[8.952,19.149],[8.768,19.033],[7.394,19.484],[8.592,18.905],[8.425,18.766],[8.269,18.615],[8.123,18.453],[7.989,18.282],[7.867,18.101],[7.759,17.913],[7.663,17.717],[7.582,17.516],[7.515,17.309],[7.462,17.098],[7.424,16.884],[7.402,16.667],[7.394,16.45]],closed:!0,fill:!1}],rain:[{t:`poly`,pts:[[4.538,11.011],[4.563,10.774],[4.605,10.539],[4.662,10.307],[4.736,10.08],[4.826,9.859],[4.93,9.644],[5.05,9.438],[5.183,9.24],[5.33,9.052],[5.49,8.874],[5.662,8.708],[5.844,8.555],[6.038,8.415],[6.24,8.288],[6.451,8.176],[6.669,8.079],[6.893,7.997],[7.123,7.932],[7.356,7.882],[7.593,7.849],[7.831,7.832],[7.961,7.786],[7.994,7.474],[8.048,7.164],[8.124,6.86],[8.221,6.561],[8.339,6.27],[8.477,5.987],[8.634,5.715],[8.809,5.455],[9.003,5.207],[9.213,4.974],[9.439,4.756],[9.68,4.554],[9.934,4.369],[10.2,4.203],[10.477,4.055],[10.764,3.928],[11.059,3.82],[11.361,3.734],[11.669,3.668],[11.98,3.625],[12.293,3.603],[12.607,3.603],[12.92,3.625],[13.231,3.668],[13.539,3.734],[13.841,3.82],[14.136,3.928],[14.423,4.055],[14.7,4.203],[14.966,4.369],[15.22,4.554],[15.461,4.756],[15.687,4.974],[15.897,5.207],[16.091,5.455],[16.266,5.715],[16.423,5.987],[16.561,6.27],[16.679,6.561],[16.776,6.86],[16.852,7.164],[16.906,7.474],[17.019,7.758],[17.243,7.789],[17.464,7.836],[17.681,7.899],[17.894,7.976],[18.1,8.068],[18.3,8.174],[18.492,8.294],[18.675,8.427],[18.848,8.572],[19.011,8.729],[19.162,8.897],[19.301,9.076],[19.428,9.263],[19.541,9.459],[19.64,9.662],[19.725,9.872],[19.794,10.087],[19.849,10.306],[19.888,10.529],[19.912,10.754],[19.92,10.98],[19.912,11.206],[19.888,11.431],[19.849,11.654],[19.794,11.873],[19.725,12.088],[19.64,12.298],[19.541,12.501],[19.428,12.697],[19.301,12.884],[19.162,13.063],[19.011,13.231],[18.848,13.388],[18.675,13.533],[18.492,13.666],[18.3,13.786],[19.92,14.58],[18.1,13.892],[17.894,13.984],[17.681,14.061],[17.464,14.124],[17.243,14.171],[17.019,14.202],[16.793,14.218],[16.567,14.218],[16.341,14.202],[16.117,14.171],[15.896,14.124],[15.679,14.061],[15.466,13.984],[13.819,12.501],[15.26,13.892],[15.06,13.786],[13.932,12.697],[14.868,13.666],[14.059,12.884],[14.685,13.533],[14.512,13.388],[14.198,13.063],[14.349,13.231],[13.539,12.466],[13.231,12.532],[12.92,12.575],[12.607,12.597],[12.293,12.597],[11.98,12.575],[11.669,12.532],[10.57,13.448],[10.41,13.626],[10.717,13.26],[10.238,13.792],[10.85,13.062],[10.056,13.945],[11.361,12.466],[9.862,14.085],[10.97,12.856],[9.66,14.212],[9.449,14.324],[11.074,12.641],[9.231,14.421],[9.007,14.503],[11.164,12.42],[8.777,14.568],[7.123,14.568],[6.893,14.503],[6.669,14.421],[6.451,14.324],[6.24,14.212],[6.038,14.085],[4.53,14.58],[5.844,13.945],[5.662,13.792],[5.49,13.626],[5.33,13.448],[5.183,13.26],[5.05,13.062],[4.93,12.856],[4.826,12.641],[4.736,12.42],[4.662,12.193],[4.605,11.961],[4.563,11.726],[4.538,11.489],[4.53,11.25]],closed:!0,fill:!1},{t:`poly`,pts:[[8.5,17.6],[6.9,21.6]],closed:!1,fill:!1},{t:`poly`,pts:[[12.5,17.6],[10.9,21.6]],closed:!1,fill:!1},{t:`poly`,pts:[[16.5,17.6],[14.9,21.6]],closed:!1,fill:!1}],drizzle:[{t:`poly`,pts:[[4.538,11.011],[4.563,10.774],[4.605,10.539],[4.662,10.307],[4.736,10.08],[4.826,9.859],[4.93,9.644],[5.05,9.438],[5.183,9.24],[5.33,9.052],[5.49,8.874],[5.662,8.708],[5.844,8.555],[6.038,8.415],[6.24,8.288],[6.451,8.176],[6.669,8.079],[6.893,7.997],[7.123,7.932],[7.356,7.882],[7.593,7.849],[7.831,7.832],[7.961,7.786],[7.994,7.474],[8.048,7.164],[8.124,6.86],[8.221,6.561],[8.339,6.27],[8.477,5.987],[8.634,5.715],[8.809,5.455],[9.003,5.207],[9.213,4.974],[9.439,4.756],[9.68,4.554],[9.934,4.369],[10.2,4.203],[10.477,4.055],[10.764,3.928],[11.059,3.82],[11.361,3.734],[11.669,3.668],[11.98,3.625],[12.293,3.603],[12.607,3.603],[12.92,3.625],[13.231,3.668],[13.539,3.734],[13.841,3.82],[14.136,3.928],[14.423,4.055],[14.7,4.203],[14.966,4.369],[15.22,4.554],[15.461,4.756],[15.687,4.974],[15.897,5.207],[16.091,5.455],[16.266,5.715],[16.423,5.987],[16.561,6.27],[16.679,6.561],[16.776,6.86],[16.852,7.164],[16.906,7.474],[17.019,7.758],[17.243,7.789],[17.464,7.836],[17.681,7.899],[17.894,7.976],[18.1,8.068],[18.3,8.174],[18.492,8.294],[18.675,8.427],[18.848,8.572],[19.011,8.729],[19.162,8.897],[19.301,9.076],[19.428,9.263],[19.541,9.459],[19.64,9.662],[19.725,9.872],[19.794,10.087],[19.849,10.306],[19.888,10.529],[19.912,10.754],[19.92,10.98],[19.912,11.206],[19.888,11.431],[19.849,11.654],[19.794,11.873],[19.725,12.088],[19.64,12.298],[19.541,12.501],[19.428,12.697],[19.301,12.884],[19.162,13.063],[19.011,13.231],[18.848,13.388],[18.675,13.533],[18.492,13.666],[18.3,13.786],[19.92,14.58],[18.1,13.892],[17.894,13.984],[17.681,14.061],[17.464,14.124],[17.243,14.171],[17.019,14.202],[16.793,14.218],[16.567,14.218],[16.341,14.202],[16.117,14.171],[15.896,14.124],[15.679,14.061],[15.466,13.984],[13.819,12.501],[15.26,13.892],[15.06,13.786],[13.932,12.697],[14.868,13.666],[14.059,12.884],[14.685,13.533],[14.512,13.388],[14.198,13.063],[14.349,13.231],[13.539,12.466],[13.231,12.532],[12.92,12.575],[12.607,12.597],[12.293,12.597],[11.98,12.575],[11.669,12.532],[10.57,13.448],[10.41,13.626],[10.717,13.26],[10.238,13.792],[10.85,13.062],[10.056,13.945],[11.361,12.466],[9.862,14.085],[10.97,12.856],[9.66,14.212],[9.449,14.324],[11.074,12.641],[9.231,14.421],[9.007,14.503],[11.164,12.42],[8.777,14.568],[7.123,14.568],[6.893,14.503],[6.669,14.421],[6.451,14.324],[6.24,14.212],[6.038,14.085],[4.53,14.58],[5.844,13.945],[5.662,13.792],[5.49,13.626],[5.33,13.448],[5.183,13.26],[5.05,13.062],[4.93,12.856],[4.826,12.641],[4.736,12.42],[4.662,12.193],[4.605,11.961],[4.563,11.726],[4.538,11.489],[4.53,11.25]],closed:!0,fill:!1},{t:`poly`,pts:[[8.5,18.4],[7.9,20]],closed:!1,fill:!1},{t:`poly`,pts:[[12.5,18.4],[11.9,20]],closed:!1,fill:!1},{t:`poly`,pts:[[16.5,18.4],[15.9,20]],closed:!1,fill:!1}],snow:[{t:`poly`,pts:[[4.538,11.011],[4.563,10.774],[4.605,10.539],[4.662,10.307],[4.736,10.08],[4.826,9.859],[4.93,9.644],[5.05,9.438],[5.183,9.24],[5.33,9.052],[5.49,8.874],[5.662,8.708],[5.844,8.555],[6.038,8.415],[6.24,8.288],[6.451,8.176],[6.669,8.079],[6.893,7.997],[7.123,7.932],[7.356,7.882],[7.593,7.849],[7.831,7.832],[7.961,7.786],[7.994,7.474],[8.048,7.164],[8.124,6.86],[8.221,6.561],[8.339,6.27],[8.477,5.987],[8.634,5.715],[8.809,5.455],[9.003,5.207],[9.213,4.974],[9.439,4.756],[9.68,4.554],[9.934,4.369],[10.2,4.203],[10.477,4.055],[10.764,3.928],[11.059,3.82],[11.361,3.734],[11.669,3.668],[11.98,3.625],[12.293,3.603],[12.607,3.603],[12.92,3.625],[13.231,3.668],[13.539,3.734],[13.841,3.82],[14.136,3.928],[14.423,4.055],[14.7,4.203],[14.966,4.369],[15.22,4.554],[15.461,4.756],[15.687,4.974],[15.897,5.207],[16.091,5.455],[16.266,5.715],[16.423,5.987],[16.561,6.27],[16.679,6.561],[16.776,6.86],[16.852,7.164],[16.906,7.474],[17.019,7.758],[17.243,7.789],[17.464,7.836],[17.681,7.899],[17.894,7.976],[18.1,8.068],[18.3,8.174],[18.492,8.294],[18.675,8.427],[18.848,8.572],[19.011,8.729],[19.162,8.897],[19.301,9.076],[19.428,9.263],[19.541,9.459],[19.64,9.662],[19.725,9.872],[19.794,10.087],[19.849,10.306],[19.888,10.529],[19.912,10.754],[19.92,10.98],[19.912,11.206],[19.888,11.431],[19.849,11.654],[19.794,11.873],[19.725,12.088],[19.64,12.298],[19.541,12.501],[19.428,12.697],[19.301,12.884],[19.162,13.063],[19.011,13.231],[18.848,13.388],[18.675,13.533],[18.492,13.666],[18.3,13.786],[19.92,14.58],[18.1,13.892],[17.894,13.984],[17.681,14.061],[17.464,14.124],[17.243,14.171],[17.019,14.202],[16.793,14.218],[16.567,14.218],[16.341,14.202],[16.117,14.171],[15.896,14.124],[15.679,14.061],[15.466,13.984],[13.819,12.501],[15.26,13.892],[15.06,13.786],[13.932,12.697],[14.868,13.666],[14.059,12.884],[14.685,13.533],[14.512,13.388],[14.198,13.063],[14.349,13.231],[13.539,12.466],[13.231,12.532],[12.92,12.575],[12.607,12.597],[12.293,12.597],[11.98,12.575],[11.669,12.532],[10.57,13.448],[10.41,13.626],[10.717,13.26],[10.238,13.792],[10.85,13.062],[10.056,13.945],[11.361,12.466],[9.862,14.085],[10.97,12.856],[9.66,14.212],[9.449,14.324],[11.074,12.641],[9.231,14.421],[9.007,14.503],[11.164,12.42],[8.777,14.568],[7.123,14.568],[6.893,14.503],[6.669,14.421],[6.451,14.324],[6.24,14.212],[6.038,14.085],[4.53,14.58],[5.844,13.945],[5.662,13.792],[5.49,13.626],[5.33,13.448],[5.183,13.26],[5.05,13.062],[4.93,12.856],[4.826,12.641],[4.736,12.42],[4.662,12.193],[4.605,11.961],[4.563,11.726],[4.538,11.489],[4.53,11.25]],closed:!0,fill:!1},{t:`circle`,c:[8.5,19.2],r:.9,fill:!0},{t:`circle`,c:[12.5,21],r:.9,fill:!0},{t:`circle`,c:[16.5,19.2],r:.9,fill:!0}],storm:[{t:`poly`,pts:[[4.538,11.011],[4.563,10.774],[4.605,10.539],[4.662,10.307],[4.736,10.08],[4.826,9.859],[4.93,9.644],[5.05,9.438],[5.183,9.24],[5.33,9.052],[5.49,8.874],[5.662,8.708],[5.844,8.555],[6.038,8.415],[6.24,8.288],[6.451,8.176],[6.669,8.079],[6.893,7.997],[7.123,7.932],[7.356,7.882],[7.593,7.849],[7.831,7.832],[7.961,7.786],[7.994,7.474],[8.048,7.164],[8.124,6.86],[8.221,6.561],[8.339,6.27],[8.477,5.987],[8.634,5.715],[8.809,5.455],[9.003,5.207],[9.213,4.974],[9.439,4.756],[9.68,4.554],[9.934,4.369],[10.2,4.203],[10.477,4.055],[10.764,3.928],[11.059,3.82],[11.361,3.734],[11.669,3.668],[11.98,3.625],[12.293,3.603],[12.607,3.603],[12.92,3.625],[13.231,3.668],[13.539,3.734],[13.841,3.82],[14.136,3.928],[14.423,4.055],[14.7,4.203],[14.966,4.369],[15.22,4.554],[15.461,4.756],[15.687,4.974],[15.897,5.207],[16.091,5.455],[16.266,5.715],[16.423,5.987],[16.561,6.27],[16.679,6.561],[16.776,6.86],[16.852,7.164],[16.906,7.474],[17.019,7.758],[17.243,7.789],[17.464,7.836],[17.681,7.899],[17.894,7.976],[18.1,8.068],[18.3,8.174],[18.492,8.294],[18.675,8.427],[18.848,8.572],[19.011,8.729],[19.162,8.897],[19.301,9.076],[19.428,9.263],[19.541,9.459],[19.64,9.662],[19.725,9.872],[19.794,10.087],[19.849,10.306],[19.888,10.529],[19.912,10.754],[19.92,10.98],[19.912,11.206],[19.888,11.431],[19.849,11.654],[19.794,11.873],[19.725,12.088],[19.64,12.298],[19.541,12.501],[19.428,12.697],[19.301,12.884],[19.162,13.063],[19.011,13.231],[18.848,13.388],[18.675,13.533],[18.492,13.666],[18.3,13.786],[19.92,14.58],[18.1,13.892],[17.894,13.984],[17.681,14.061],[17.464,14.124],[17.243,14.171],[17.019,14.202],[16.793,14.218],[16.567,14.218],[16.341,14.202],[16.117,14.171],[15.896,14.124],[15.679,14.061],[15.466,13.984],[13.819,12.501],[15.26,13.892],[15.06,13.786],[13.932,12.697],[14.868,13.666],[14.059,12.884],[14.685,13.533],[14.512,13.388],[14.198,13.063],[14.349,13.231],[13.539,12.466],[13.231,12.532],[12.92,12.575],[12.607,12.597],[12.293,12.597],[11.98,12.575],[11.669,12.532],[10.57,13.448],[10.41,13.626],[10.717,13.26],[10.238,13.792],[10.85,13.062],[10.056,13.945],[11.361,12.466],[9.862,14.085],[10.97,12.856],[9.66,14.212],[9.449,14.324],[11.074,12.641],[9.231,14.421],[9.007,14.503],[11.164,12.42],[8.777,14.568],[7.123,14.568],[6.893,14.503],[6.669,14.421],[6.451,14.324],[6.24,14.212],[6.038,14.085],[4.53,14.58],[5.844,13.945],[5.662,13.792],[5.49,13.626],[5.33,13.448],[5.183,13.26],[5.05,13.062],[4.93,12.856],[4.826,12.641],[4.736,12.42],[4.662,12.193],[4.605,11.961],[4.563,11.726],[4.538,11.489],[4.53,11.25]],closed:!0,fill:!1},{t:`poly`,pts:[[13.2,16],[10.6,19.6],[13.4,19.6],[11.2,23]],closed:!1,fill:!1}],fog:[{t:`poly`,pts:[[4,8],[20,8]],closed:!1,fill:!1},{t:`poly`,pts:[[3,12],[17,12]],closed:!1,fill:!1},{t:`poly`,pts:[[6,16],[21,16]],closed:!1,fill:!1},{t:`poly`,pts:[[5,20],[15,20]],closed:!1,fill:!1}],wind:[{t:`poly`,pts:[[3,9],[16.5,9],[16.5,9],[17.75,8.665],[18.665,7.75],[19,6.5],[18.665,5.25],[17.75,4.335],[16.5,4],[15.25,4.335],[14.335,5.25],[14,6.5]],closed:!1,fill:!1},{t:`poly`,pts:[[3,13],[19,13],[19,13],[20.25,13.335],[21.165,14.25],[21.5,15.5],[21.165,16.75],[20.25,17.665],[19,18],[17.75,17.665],[16.835,16.75],[16.5,15.5]],closed:!1,fill:!1},{t:`poly`,pts:[[3,17],[11,17]],closed:!1,fill:!1}],alert:[{t:`poly`,pts:[[12,3.5],[21.5,20],[2.5,20]],closed:!0,fill:!1},{t:`poly`,pts:[[12,9.5],[12,14.2]],closed:!1,fill:!1},{t:`circle`,c:[12,17.2],r:1,fill:!0}],check:[{t:`poly`,pts:[[4.5,12.5],[9.5,17.5],[19.5,6.5]],closed:!1,fill:!1}],cross:[{t:`poly`,pts:[[6,6],[18,18]],closed:!1,fill:!1},{t:`poly`,pts:[[18,6],[6,18]],closed:!1,fill:!1}],clock:[{t:`circle`,c:[12,12],r:9,fill:!1},{t:`poly`,pts:[[12,6.5],[12,12],[15.8,14.2]],closed:!1,fill:!1}],link_out:[{t:`poly`,pts:[[10,5],[5,5],[5,19],[19,19],[19,14]],closed:!1,fill:!1},{t:`poly`,pts:[[12,12],[19.5,4.5]],closed:!1,fill:!1},{t:`poly`,pts:[[14,4.5],[19.5,4.5],[19.5,10]],closed:!1,fill:!1}],lock:[{t:`poly`,pts:[[5,11],[19,11],[19,20.5],[5,20.5]],closed:!0,fill:!1},{t:`poly`,pts:[[8,11],[8,8],[8,8],[8.136,6.965],[8.536,6],[9.172,5.172],[10,4.536],[10.965,4.136],[12,4],[13.035,4.136],[14,4.536],[14.828,5.172],[15.464,6],[15.864,6.965],[16,8],[16,11]],closed:!1,fill:!1}],unlock:[{t:`poly`,pts:[[5,11],[19,11],[19,20.5],[5,20.5]],closed:!0,fill:!1},{t:`poly`,pts:[[8,11],[8,8],[8,8],[8.136,6.965],[8.536,6],[9.172,5.172],[10,4.536],[10.965,4.136],[12,4],[13.035,4.136],[14,4.536],[14.828,5.172],[15.464,6],[15.864,6.965],[16,8],[16,9]],closed:!1,fill:!1}],pin:[{t:`poly`,pts:[[6.371,12.75],[5.892,11.723],[5.599,10.629],[5.5,9.5],[5.599,8.371],[5.892,7.277],[6.371,6.25],[7.021,5.322],[7.822,4.521],[8.75,3.871],[9.777,3.392],[10.871,3.099],[12,3],[13.129,3.099],[14.223,3.392],[15.25,3.871],[16.178,4.521],[16.979,5.322],[17.629,6.25],[18.108,7.277],[18.401,8.371],[18.5,9.5],[18.401,10.629],[18.108,11.723],[17.629,12.75],[12,21.5]],closed:!0,fill:!1},{t:`circle`,c:[12,9.5],r:2.3,fill:!1}],up:[{t:`poly`,pts:[[12,19],[12,5]],closed:!1,fill:!1},{t:`poly`,pts:[[6,11],[12,5],[18,11]],closed:!1,fill:!1}],down:[{t:`poly`,pts:[[12,5],[12,19]],closed:!1,fill:!1},{t:`poly`,pts:[[6,13],[12,19],[18,13]],closed:!1,fill:!1}]}},rn=0;function an(e){console.assert(e!=null,`detectOverflows: root required`),console.assert(typeof e.querySelectorAll==`function`,`detectOverflows: root is an element`);let t=e.querySelectorAll(`.ni-t[data-max-w]`),n=0;for(let e of t){let t=Number(e.getAttribute(`data-max-w`));!Number.isFinite(t)||t<=0||e.scrollWidth>t+.5&&!e.hasAttribute(`data-ellipsis`)&&(e.setAttribute(`data-ellipsis`,``),n+=1,rn+=1)}return n}var on=m(`unrenderable`),sn=a(``),cn=a(``),ln=a(``),un=a(``),dn=a(``),fn=a(``),pn=a(``),mn=a(``),hn=a(``),gn=a(``),_n=a(``),vn=m(``),yn=m(` `),bn=m(`
                  `),xn=m(`
                  `);function Sn(n,r){let i=s();T(r,!0);function a(){let e=typeof window>`u`?null:window;return typeof e?.NI_NOW==`number`?e.NI_NOW:Date.now()}let c=R(e(a())),u=typeof window>`u`?null:window.setInterval(()=>{O(c,a(),!0)},15e3);te(()=>{u!==null&&window.clearInterval(u)});let m=M(()=>{try{return{ok:!0,clir:Q(r.clir)}}catch(e){return{ok:!1,why:e instanceof Ke?e.message:String(e)}}}),g=R(0),S=M(()=>v(m).ok?v(m).clir.bucket.min_w:0),C=M(()=>v(g)>v(S)?v(g):v(S)),w=M(()=>v(g)>0&&v(g)v(m).ok&&v(C)>0?Kt(v(m).clir,{width:v(C),now:v(c),viewerTz:r.viewerTz}):null),D=R(null);l(()=>{if(!v(D)||!v(E))return;let e=v(D),t=()=>{an(e)},n=typeof document>`u`?null:document.fonts;n&&typeof n.ready?.then==`function`?n.ready.then(t,t):t()});let j=R(null),F=M(()=>v(E)!==null&&v(E).ops.some(e=>B(e)?.k===`basemap`));l(()=>{if(!v(F))return;let e=!0;return Yt().then(t=>{e&&O(j,t)},()=>{e&&O(j,[])}),()=>{e=!1}});function I(e){console.assert(Number.isFinite(e),`fmt: finite number`);let t=e.toFixed(2).replace(/\.?0+$/,``);return t===`-0`||t===``?`0`:t}function L(e,t){return console.assert(t>=0,`rx: width non-negative`),_t(e,0,t)}function z(e){return console.assert(e.length>0,`tokVar: token required`),`var(--ni-${e})`}function ie(e){return e.kind===`text`}function B(e){return e.kind===`svg`?e.prim:null}function ae(e,t){console.assert(e.y1>=e.y0,`boxRect: ordered box`),console.assert(t>=0,`boxRect: width non-negative`);let n=L(e.x0,t),r=L(e.x1,t);return{x:n,y:e.y0,w:Math.max(0,r-n),h:Math.max(0,e.y1-e.y0)}}function V(e,t){console.assert(e.k===`tri`,`triPoints: tri prim`),console.assert(e.size>0,`triPoints: size positive`);let n=e.size*.866,r=L(e.x,t),i=e.y,a=e.size;return(e.dir===`up`?[[r-a/2,i+n/2],[r+a/2,i+n/2],[r,i-n/2]]:e.dir===`down`?[[r-a/2,i-n/2],[r+a/2,i-n/2],[r,i+n/2]]:e.dir===`left`?[[r+n/2,i-a/2],[r+n/2,i+a/2],[r-n/2,i]]:[[r-n/2,i-a/2],[r-n/2,i+a/2],[r+n/2,i]]).map(([e,t])=>`${I(e)},${I(t)}`).join(` `)}function H(e,t){console.assert(e.k===`path`,`pathD: path prim`),console.assert(Array.isArray(e.pts),`pathD: points array`);let n=e.box,r=L(n.x0,t),i=L(n.x1,t),a=e.pts.map(([e,t])=>[r+e*(i-r),n.y0+t*(n.y1-n.y0)]);if(a.length<2)return{line:``,fill:null};let o=`M`+a.map(([e,t])=>`${I(e)},${I(t)}`).join(` L`),s=a[0],c=a[a.length-1];return{line:o,fill:e.fill?`${o} L${I(c[0])},${I(n.y1)} L${I(s[0])},${I(n.y1)} Z`:null}}function oe(e,t,n){console.assert(e.length>0,`gapDash: segments required`),console.assert(t<=n,`gapDash: ordered ends`);let r=[0],i=t;for(let[t,n]of e)r.push(t-i,n-t),i=n;return r.push(n-i+1e3),r.map(I).join(` `)}function se(e,t,n){if(console.assert(n>0,`cellFill: steps positive`),console.assert(e>=0,`cellFill: value non-negative`),t===`seq`)return z(`viz-seq-${1+Math.round(e*4/Math.max(1,n-1))}`);let r=e/Math.max(1,n-1);return r<=.5?`color-mix(in srgb, ${z(`viz-div-mid`)} ${I(r*200)}%, ${z(`viz-div-neg`)})`:`color-mix(in srgb, ${z(`viz-div-pos`)} ${I((r-.5)*200)}%, ${z(`viz-div-mid`)})`}function ce(e,t){console.assert(e.k===`cells`,`cellsFor: cells prim`),console.assert(e.cols>0&&e.rows>0,`cellsFor: grid shape`);let n=e.box,r=L(n.x0,t),i=(L(n.x1,t)-r-e.gap*(e.cols-1))/e.cols,a=(n.y1-n.y0-e.gap*(e.rows-1))/e.rows,o=[];for(let t=0;t0,`iconScale: size positive`),console.assert(nn.box>0,`iconScale: icon box`),e.size/nn.box}function U(e){return console.assert(Array.isArray(e),`pointList: points array`),e.map(e=>`${I(e[0])},${I(e[1])}`).join(` `)}var ue=f(),de=y(ue),W=e=>{var t=on();o(()=>A(t,`title`,v(m).ok?`render failed`:v(m).why)),d(e,t)},fe=e=>{var n=xn();let r;var a=b(n);let s;var c=b(a);p(c,21,()=>v(E).ops,P,(e,n)=>{let r=M(()=>B(v(n)));var a=f(),s=y(a),c=e=>{var n=f(),a=y(n),s=e=>{let t=M(()=>v(r)),n=M(()=>ae({x0:v(t).x0,x1:v(t).x1,y0:v(t).y0,y1:v(t).y1},v(E).width));var i=sn();let a;o((e,n,r,o,s,c,l)=>{A(i,`x`,e),A(i,`y`,n),A(i,`width`,r),A(i,`height`,o),A(i,`rx`,s),a=_(i,``,a,{fill:c,stroke:l,opacity:v(t).alpha??1})},[()=>I(v(n).x),()=>I(v(n).y),()=>I(v(n).w),()=>I(v(n).h),()=>I(v(t).r),()=>z(v(t).tok),()=>v(t).stroke?z(v(t).stroke):`none`]),d(e,i)},c=e=>{let t=M(()=>v(r));var n=cn();let i;o((e,r,a,o,s,c,l)=>{A(n,`x1`,e),A(n,`y1`,r),A(n,`x2`,a),A(n,`y2`,o),i=_(n,``,i,{stroke:s,"stroke-width":c,"stroke-dasharray":l,opacity:v(t).alpha??1})},[()=>I(L(v(t).x0,v(E).width)),()=>I(v(t).y0),()=>I(L(v(t).x1,v(E).width)),()=>I(v(t).y1),()=>z(v(t).tok),()=>I(v(t).w),()=>v(t)._segs?oe(v(t)._segs,Math.min(v(t).y0,v(t).y1),Math.max(v(t).y0,v(t).y1)):v(t).dash?v(t).dash.map(I).join(` `):`none`]),d(e,n)},l=e=>{let t=M(()=>v(r));var n=ln();let i;o((e,r)=>{A(n,`points`,e),i=_(n,``,i,{fill:r,opacity:v(t).alpha??1})},[()=>V(v(t),v(E).width),()=>z(v(t).tok)]),d(e,n)},u=e=>{let n=M(()=>v(r));var i=dn();let a;var s=b(i),c=e=>{var t=un();let r;o((e,n,i,a)=>{A(t,`cx`,e),A(t,`cy`,n),A(t,`r`,i),r=_(t,``,r,{fill:a})},[()=>I(L(v(n).x,v(E).width)),()=>I(v(n).y),()=>I(v(n).r+v(n).ring_w),()=>z(v(n).ring)]),d(e,t)};t(s,e=>{v(n).ring&&e(c)});var l=h(s);let u;k(i),o((e,t,r,o)=>{a=_(i,``,a,{opacity:v(n).alpha??1}),A(l,`cx`,e),A(l,`cy`,t),A(l,`r`,r),u=_(l,``,u,{fill:o})},[()=>I(L(v(n).x,v(E).width)),()=>I(v(n).y),()=>I(v(n).r),()=>z(v(n).tok)]),d(e,i)},m=e=>{let n=M(()=>v(r)),i=M(()=>H(v(n),v(E).width));var a=pn();let s;var c=b(a),l=e=>{var t=fn();let r;o(e=>{A(t,`d`,v(i).fill),r=_(t,``,r,{fill:e,stroke:`none`})},[()=>z(v(n).fill)]),d(e,t)};t(c,e=>{v(i).fill&&v(n).fill&&e(l)});var u=h(c);let f;k(a),o((e,t)=>{s=_(a,``,s,{opacity:v(n).alpha??1}),A(u,`d`,v(i).line),f=_(u,``,f,{fill:`none`,stroke:e,"stroke-width":t,"stroke-dasharray":v(n).style===`interp`?`4 3`:`none`,"stroke-linejoin":`round`,"stroke-linecap":`round`})},[()=>z(v(n).tok),()=>I(v(n).w)]),d(e,a)},g=e=>{let t=M(()=>v(r));var n=hn();let i;p(n,21,()=>ce(v(t),v(E).width),P,(e,t)=>{var n=mn();o((e,r,i,a)=>{A(n,`x`,e),A(n,`y`,r),A(n,`width`,i),A(n,`height`,a),_(n,v(t).style)},[()=>I(v(t).x),()=>I(v(t).y),()=>I(v(t).w),()=>I(v(t).h)]),d(e,n)}),k(n),o(()=>i=_(n,``,i,{opacity:v(t).alpha??1})),d(e,n)},S=e=>{let n=M(()=>v(r)),a=M(()=>ae(v(n).box,v(E).width));var s=f(),c=y(s),l=e=>{var t=gn();let r;var s=b(t),c=x(s),l=h(s);let u;k(t),o((e,a,o,d,f,p,m)=>{r=_(t,``,r,{opacity:v(n).alpha??1}),A(s,`id`,`${i}-map-${v(n).id??``}`),A(c,`x`,e),A(c,`y`,a),A(c,`width`,o),A(c,`height`,d),A(l,`d`,f),A(l,`clip-path`,`url(#${i}-map-${v(n).id??``})`),u=_(l,``,u,{fill:p,stroke:m,"stroke-width":`0.75`,"stroke-linejoin":`round`})},[()=>I(v(a).x),()=>I(v(a).y),()=>I(v(a).w),()=>I(v(a).h),()=>$t(v(n),v(E).width,v(j)).join(` `),()=>z(v(n).land),()=>z(v(n).stroke)]),d(e,t)},u=e=>{var t=sn();let r;o((e,i,a,o,s,c)=>{A(t,`x`,e),A(t,`y`,i),A(t,`width`,a),A(t,`height`,o),r=_(t,``,r,{fill:s,stroke:c,"stroke-width":`0.75`,opacity:v(n).alpha??1})},[()=>I(v(a).x),()=>I(v(a).y),()=>I(v(a).w),()=>I(v(a).h),()=>z(v(n).land),()=>z(v(n).stroke)]),d(e,t)};t(c,e=>{v(j)&&v(j).length>0?e(l):e(u,-1)}),d(e,s)},C=e=>{let n=M(()=>v(r)),i=M(()=>le(v(n)));var a=hn();let s;p(a,21,()=>nn.icons[v(n).name]??[],P,(e,r)=>{var i=f(),a=y(i),s=e=>{var t=un();let i;o((e,n,r,a,o)=>{A(t,`cx`,e),A(t,`cy`,n),A(t,`r`,r),i=_(t,``,i,{fill:a,stroke:o})},[()=>I(v(r).c[0]),()=>I(v(r).c[1]),()=>I(v(r).r),()=>v(r).fill?z(v(n).tok):`none`,()=>v(r).fill?`none`:z(v(n).tok)]),d(e,t)},c=e=>{var t=ln();let i;o((e,n,r)=>{A(t,`points`,e),i=_(t,``,i,{fill:n,stroke:r})},[()=>U(v(r).pts),()=>v(r).fill?z(v(n).tok):`none`,()=>v(r).fill?`none`:z(v(n).tok)]),d(e,t)},l=e=>{var t=_n();let i;o((e,n)=>{A(t,`points`,e),i=_(t,``,i,{fill:`none`,stroke:n})},[()=>U(v(r).pts),()=>z(v(n).tok)]),d(e,t)};t(a,e=>{v(r).t===`circle`?e(s):v(r).closed?e(c,1):e(l,-1)}),d(e,i)}),k(a),o((e,t,r,i)=>{A(a,`transform`,`translate(${e??``},${t??``}) scale(${r??``})`),s=_(a,``,s,{fill:`none`,"stroke-width":i,"stroke-linecap":`round`,"stroke-linejoin":`round`,opacity:v(n).alpha??1})},[()=>I(L(v(n).x,v(E).width)-12*v(i)),()=>I(v(n).y-12*v(i)),()=>I(v(i)),()=>I(nn.stroke)]),d(e,a)};t(a,e=>{v(r).k===`rect`?e(s):v(r).k===`line`?e(c,1):v(r).k===`tri`?e(l,2):v(r).k===`dot`?e(u,3):v(r).k===`path`?e(m,4):v(r).k===`cells`?e(g,5):v(r).k===`basemap`?e(S,6):v(r).k===`icon`&&e(C,7)}),d(e,n)};t(s,e=>{v(r)&&e(c)}),d(e,a)}),k(c);var l=h(c,2);p(l,17,()=>v(E).ops,P,(e,n)=>{let r=M(()=>B(v(n)));var i=f(),a=y(i),s=e=>{let t=M(()=>v(r)),n=M(()=>ae(v(t).box,v(E).width));var i=vn();let a;o((e,n,r,o)=>a=_(i,``,a,{left:e,top:n,width:r,height:o,opacity:v(t).alpha??1}),[()=>`${I(v(n).x)??``}px`,()=>`${I(v(n).y)??``}px`,()=>`${I(v(n).w)??``}px`,()=>`${I(v(n).h)??``}px`]),d(e,i)};t(a,e=>{v(r)&&v(r).k===`image`&&e(s)}),d(e,i)});var u=h(l,2);p(u,17,()=>v(E).ops,P,(e,n)=>{var r=f(),i=y(r),a=e=>{var t=bn();let r;p(t,21,()=>v(n).lines,P,(e,t)=>{var n=yn(),r=x(n,!0);o(()=>N(r,v(t))),d(e,n)}),k(t),o((e,i,a,o,s,c,l)=>{A(t,`data-p`,v(n).id),A(t,`data-role`,v(n).role),A(t,`data-max-w`,e),A(t,`dir`,v(n).direction),r=_(t,``,r,{left:i,top:a,width:o,"font-size":s,"font-weight":v(n).wt,"line-height":c,color:l,"text-align":v(n).align,"font-variant-numeric":v(n).tnum?`tabular-nums`:`normal`,opacity:v(n).alpha}),t.dir=t.dir},[()=>I(v(n).width),()=>`${I(v(n).left)??``}px`,()=>`${I(v(n).top)??``}px`,()=>`${I(v(n).width)??``}px`,()=>`${I(v(n).px)??``}px`,()=>`${I(v(n).lh)??``}px`,()=>z(v(n).color)]),d(e,t)},s=M(()=>ie(v(n)));t(i,e=>{v(s)&&e(a)}),d(e,r)}),k(a),ee(a,e=>O(D,e),()=>v(D)),k(n),o((e,t,i,o,l,u,d,f)=>{r=_(n,``,r,{height:e}),A(a,`aria-label`,v(E).summary),A(a,`data-form`,v(m).clir.form),A(a,`data-span`,v(m).clir.span),s=_(a,``,s,{width:t,height:i,transform:o}),A(c,`width`,l),A(c,`height`,u),A(c,`viewBox`,`0 0 ${d??``} ${f??``}`)},[()=>`${I(v(E).height*v(w))??``}px`,()=>`${I(v(E).width)??``}px`,()=>`${I(v(E).height)??``}px`,()=>v(w)===1?null:`scale(${I(v(w))})`,()=>I(v(E).width),()=>I(v(E).height),()=>I(v(E).width),()=>I(v(E).height)]),re(n,`clientWidth`,e=>O(g,e)),d(e,n)};t(de,e=>{!v(m).ok||!v(E)?e(W):e(fe,-1)}),d(n,ue),ne()}var Cn=m(``),wn=m(` `),$=m(``);function Tn(e,n){T(n,!0);let r=R(null),i=R(!1);l(()=>{let e=n.src,t=!0;return O(r,null),O(i,!1),V.niImageDataUrl(e).then(e=>{t&&O(r,e,!0)},()=>{t&&O(i,!0)}),()=>{t=!1}});var a=f(),s=y(a),c=e=>{var t=Cn();o(()=>{A(t,`src`,v(r)),A(t,`alt`,n.alt)}),d(e,t)},u=e=>{var t=wn(),r=x(t,!0);o(()=>N(r,n.alt)),d(e,t)},p=e=>{var t=$();o(()=>A(t,`aria-label`,n.alt)),d(e,t)};t(s,e=>{v(r)?e(c):v(i)?e(u,1):e(p,-1)}),d(e,a),ne()}var En=100,Dn=8,On=2e3,kn=500,An=200,jn=200,Mn=/^\/api\/ni\/items\/[A-Za-z0-9-]+\/image(\?v=[\w.:+-]*)?$/,Nn=[`title`,`label`,`value`,`caption`],Pn=[`default`,`muted`,`accent`,`ok`,`warn`,`danger`],Fn=[`sm`,`md`,`lg`],In=[``,`accent`,`ok`,`warn`,`danger`],Ln=[`v`,`h`],Rn=[`sm`,`md`],zn=[`plain`,`compact`,`percent`,`currency`],Bn=[`line`,`bars`],Vn=new Set([`when`,`on_tap`]);function Hn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Un(e){return console.assert(e.type===`text`,`checkText: type must be text`),console.assert(typeof e==`object`,`checkText: node must be an object`),typeof e.value==`string`?e.value.length>On?`text.value exceeds 2000 chars`:Nn.includes(e.role)?Pn.includes(e.tone)?Fn.includes(e.size)?null:`text.size invalid`:`text.tone invalid`:`text.role invalid`:`text.value must be string`}function Wn(e){return console.assert(e.type===`number`,`checkNumber: type must be number`),console.assert(typeof e==`object`,`checkNumber: node must be an object`),typeof e.value!=`number`||!Number.isFinite(e.value)?`number.value must be finite`:zn.includes(e.format)?Pn.includes(e.tone)?Fn.includes(e.size)?e.unit!==void 0&&typeof e.unit!=`string`?`number.unit must be string`:null:`number.size invalid`:`number.tone invalid`:`number.format invalid`}function Gn(e){return console.assert(e.type===`chip`,`checkChip: type must be chip`),console.assert(typeof e==`object`,`checkChip: node must be an object`),typeof e.value==`string`?e.value.length>On?`chip.value exceeds 2000 chars`:In.includes(e.kind)?null:`chip.kind invalid`:`chip.value must be string`}function Kn(e){return console.assert(e.type===`bar`,`checkBar: type must be bar`),console.assert(typeof e==`object`,`checkBar: node must be an object`),typeof e.value!=`number`||!Number.isFinite(e.value)?`bar.value must be finite`:typeof e.max!=`number`||!Number.isFinite(e.max)||e.max<=0?`bar.max must be > 0`:Pn.includes(e.tone)?null:`bar.tone invalid`}function qn(e){return console.assert(e.type===`icon`,`checkIcon: type must be icon`),console.assert(typeof e==`object`,`checkIcon: node must be an object`),typeof e.name!=`string`||e.name.length===0?`icon.name must be non-empty string`:Pn.includes(e.tone)?null:`icon.tone invalid`}function Jn(e){console.assert(e.type===`spark`,`checkSpark: type must be spark`),console.assert(typeof e==`object`,`checkSpark: node must be an object`);let t=e.points;if(!Array.isArray(t))return`spark.points must be array`;if(t.length>kn)return`spark.points exceeds 500`;for(let e of t){if(typeof e==`number`){if(!Number.isFinite(e))return`spark.points value must be finite`;continue}if(!Hn(e))return`spark.points entry must be number or {t, v}`;if(typeof e.v!=`number`||!Number.isFinite(e.v))return`spark.points.v must be finite`;if(e.t!==void 0&&typeof e.t!=`string`)return`spark.points.t must be string`}return Bn.includes(e.kind)?e.tone!==void 0&&!Pn.includes(e.tone)?`spark.tone invalid`:null:`spark.kind invalid`}function Yn(e){return console.assert(e.type===`image`,`checkImage: type must be image`),console.assert(typeof e==`object`,`checkImage: node must be an object`),typeof e.src==`string`?Mn.test(e.src)?typeof e.alt==`string`?e.alt.length>jn?`image.alt exceeds 200 chars`:null:`image.alt must be string`:`image.src must be /api/ni/items//image`:`image.src must be string`}function Xn(e){if(console.assert(e.type===`gauge`,`checkGauge: type must be gauge`),console.assert(typeof e==`object`,`checkGauge: node must be an object`),typeof e.value!=`number`||!Number.isFinite(e.value))return`gauge.value must be finite`;if(typeof e.min!=`number`||!Number.isFinite(e.min))return`gauge.min must be finite`;if(typeof e.max!=`number`||!Number.isFinite(e.max))return`gauge.max must be finite`;if(e.max<=e.min)return`gauge.max must be > gauge.min`;if(e.tone!==void 0&&!Pn.includes(e.tone))return`gauge.tone invalid`;if(e.label!==void 0){if(typeof e.label!=`string`)return`gauge.label must be string`;if(e.label.length>An)return`gauge.label exceeds 200 chars`}return null}function Zn(e){if(console.assert(typeof e==`object`&&!!e,`checkLeaf: object required`),console.assert(typeof e.type==`string`,`checkLeaf: type must be string`),`when`in e)return`when key must be stripped server-side`;let t=e.type;if(Vn.has(t))return`reserved type refused: ${t}`;if(t===`repeat`)return`repeat must be expanded server-side before rendering`;if(t===`divider`)return null;if(t===`text`)return Un(e);if(t===`number`)return Wn(e);if(t===`chip`)return Gn(e);if(t===`bar`)return Kn(e);if(t===`icon`)return qn(e);if(t===`image`)return Yn(e);if(t===`spark`)return Jn(e);if(t===`gauge`)return Xn(e);if(t===`stack`)return Ln.includes(e.dir)?Rn.includes(e.gap)?Array.isArray(e.children)?null:`stack.children must be array`:`stack.gap invalid`:`stack.dir invalid`;if(t===`grid`){let t=e.cols;return typeof t!=`number`||t<2||t>4||!Number.isInteger(t)?`grid.cols must be 2..4`:Array.isArray(e.children)?null:`grid.children must be array`}return`unknown node type: ${t}`}function Qn(e){if(console.assert(e!==void 0,`validateBoundScene: root defined`),console.assert(arguments.length===1,`validateBoundScene: one arg`),!Hn(e))return`scene must be an object`;let t=[{node:e,depth:1}],n=0;for(;t.length>0;){let e=t.pop();if(!e)break;let{node:r,depth:i}=e;if(n+=1,n>En)return`scene exceeds 100 nodes`;if(i>Dn)return`scene exceeds depth 8`;if(!Hn(r))return`child must be an object`;let a=Zn(r);if(a)return a;let o=r.type===`stack`||r.type===`grid`?r.children:null;if(Array.isArray(o))for(let e of o){if(!Hn(e))return`child must be an object`;t.push({node:e,depth:i+1})}}return null}var $n=new Intl.NumberFormat(void 0,{notation:`compact`,maximumFractionDigits:1}),er=new Intl.NumberFormat(void 0,{style:`percent`,maximumFractionDigits:1}),tr=new Intl.NumberFormat(void 0,{style:`currency`,currency:`USD`}),nr=new Intl.NumberFormat(void 0,{maximumFractionDigits:2}),rr=new Intl.NumberFormat(void 0,{maximumSignificantDigits:3});function ir(e,t,n){if(console.assert(typeof e==`number`,`formatNumber: value must be number`),console.assert(zn.includes(t),`formatNumber: format in enum`),!Number.isFinite(e))return`—`;if(t===`percent`)return er.format(e);if(t===`currency`)return tr.format(e);let r=t===`compact`?$n.format(e):(e!==0&&Math.abs(e)<1?rr:nr).format(e),i=typeof n==`string`?n.trim():``;return i?`${r} ${i}`:r}var ar=150,or=240;function sr(e){return console.assert(e!=null,`extractV: point defined`),console.assert(typeof e==`number`||typeof e==`object`,`extractV: number or object`),typeof e==`number`?e:e.v}function cr(e){console.assert(Array.isArray(e),`seriesRange: array required`),console.assert(e.length>0,`seriesRange: non-empty`);let t=1/0,n=-1/0;for(let r of e){let e=sr(r);en&&(n=e)}return{vmin:t,vmax:n}}function lr(e,t,n){return console.assert(Number.isFinite(e),`normalized: v finite`),console.assert(n>=t,`normalized: max >= min`),n===t?.5:(e-t)/(n-t)}function ur(e,t,n){console.assert(Array.isArray(e),`sparkPath: array required`),console.assert(t>0&&n>0,`sparkPath: positive dims`);let r=e.length;if(r===0)return``;let{vmin:i,vmax:a}=cr(e),o=[],s=r===1?1:r-1;for(let c=0;c0&&n>0,`sparkBars: positive dims`);let r=e.length;if(r===0)return[];let{vmin:i,vmax:a}=cr(e),o=t/r,s=[];for(let t=0;t0,`polar: r > 0`),console.assert(Number.isFinite(t),`polar: degrees finite`);let n=t*Math.PI/180;return{x:e*Math.cos(n),y:e*Math.sin(n)}}function pr(e,t,n,r){console.assert(Number.isFinite(e),`gaugeArc: value finite`),console.assert(n>t,`gaugeArc: max > min`);let i=(Math.min(n,Math.max(t,e))-t)/(n-t),a=i*or,o=fr(r,ar),s=fr(r,ar+a);if(i===0)return{d:`M ${o.x.toFixed(2)} ${o.y.toFixed(2)}`,pct:i};let c=+(a>180);return{d:`M ${o.x.toFixed(2)} ${o.y.toFixed(2)} A ${r} ${r} 0 ${c} 1 ${s.x.toFixed(2)} ${s.y.toFixed(2)}`,pct:i}}var mr=m(`unrenderable`),hr=m(`
                  `),gr=m(`
                  `),_r=m(`
                  `),vr=m(` `),yr=m(` `),br=m(`
                  `),xr=m(``),Sr=m(`·`),Cr=m(`—`),wr=a(``),Tr=a(``),Er=a(``),Dr=a(``),Or=m(`
                  `),kr=m(`
                  `);function Ar(e,n){T(n,!0);let r=M(()=>Qn(n.node)),i={default:`var(--text)`,muted:`var(--muted)`,accent:`var(--accent)`,ok:`var(--ok)`,warn:`var(--warn)`,danger:`var(--danger)`},a={title:`font-size: var(--f-section); font-weight: 650`,label:`font-size: var(--f-label); color: var(--muted)`,value:`font-size: var(--f-h2); font-variant-numeric: tabular-nums`,caption:`font-size: var(--f-meta); color: var(--muted)`},s={sm:`var(--f-label)`,md:`var(--f-h2)`,lg:`var(--f-h1)`},c={sm:`var(--s-2)`,md:`var(--s-4)`};function l(e){return console.assert(typeof e==`string`,`toneStyle: tone is string`),console.assert(e in i,`toneStyle: tone in enum`),e==="default"?``:`color: ${i[e]}`}function m(e,t){console.assert(e in a,`textStyle: role in enum`),console.assert(t in i,`textStyle: tone in enum`);let n=a[e];return t==="default"?n:`${n}; color: ${i[t]}`}function g(e,t){return console.assert(typeof e==`number`,`barPct: value is number`),console.assert(typeof t==`number`&&t>0,`barPct: max > 0`),Math.min(100,Math.max(0,e/t*100))}let S=pr(1,0,1,40).d;function C(e){return console.assert(e===void 0||e in i,`sparkColor: tone in enum`),console.assert(typeof i==`object`,`sparkColor: TONE_VAR present`),i[e&&e!=="default"?e:`accent`]}function w(e,t,n){return console.assert(typeof e==`number`,`clampValue: v is number`),console.assert(n>t,`clampValue: hi > lo`),Math.min(n,Math.max(t,e))}var E=f(),O=y(E),j=e=>{var t=mr();o(()=>A(t,`title`,v(r))),d(e,t)},ee=e=>{var t=hr();let r;p(t,21,()=>n.node.children,P,(e,t)=>{Ar(e,{get node(){return v(t)}})}),k(t),o(()=>r=_(t,``,r,{"flex-direction":n.node.dir===`v`?`column`:`row`,gap:c[n.node.gap]})),d(e,t)},F=e=>{var t=gr();let r;p(t,21,()=>n.node.children,P,(e,t)=>{Ar(e,{get node(){return v(t)}})}),k(t),o(()=>r=_(t,``,r,{"grid-template-columns":`repeat(${n.node.cols}, minmax(0, 1fr))`})),d(e,t)},te=e=>{var t=_r();d(e,t)},I=e=>{var t=vr(),r=x(t,!0);o(e=>{_(t,e),N(r,n.node.value)},[()=>m(n.node.role,n.node.tone)]),d(e,t)},L=e=>{var t=yr(),r=x(t,!0);o((e,n)=>{_(t,e),N(r,n)},[()=>`font-size: ${s[n.node.size]}; font-variant-numeric: tabular-nums; ${l(n.node.tone)}`,()=>ir(n.node.value,n.node.format,n.node.unit)]),d(e,t)},R=e=>{ue(e,{get kind(){return n.node.kind},children:(e,t)=>{D();var r=u();o(()=>N(r,n.node.value)),d(e,r)},$$slots:{default:!0}})},re=e=>{var t=br();A(t,`aria-valuemin`,0);var r=x(t);o((e,i)=>{A(t,`aria-valuenow`,e),A(t,`aria-valuemax`,n.node.max),_(r,i)},[()=>Math.min(n.node.max,Math.max(0,n.node.value)),()=>`width: ${g(n.node.value,n.node.max)}%; background: ${i[n.node.tone==="default"?`accent`:n.node.tone]}`]),d(e,t)},z=e=>{var r=f(),i=y(r),a=e=>{var t=xr(),r=b(t);se(r,{get name(){return n.node.name}}),k(t),o(e=>_(t,e),[()=>l(n.node.tone)]),d(e,t)},s=M(()=>Object.hasOwn(oe,n.node.name)),c=e=>{var t=Sr();o(()=>A(t,`title`,`unknown icon: ${n.node.name}`)),d(e,t)};t(i,e=>{v(s)?e(a):e(c,-1)}),d(e,r)},ie=e=>{Tn(e,{get src(){return n.node.src},get alt(){return n.node.alt}})},B=e=>{var r=f(),i=y(r),a=e=>{var t=Cr();d(e,t)},s=e=>{var r=Er();A(r,`viewBox`,`0 0 200 30`);var i=b(r),a=e=>{var t=wr();o(e=>A(t,`points`,e),[()=>ur(n.node.points,200,30)]),d(e,t)},s=e=>{var t=f(),r=y(t);p(r,17,()=>dr(n.node.points,200,30),P,(e,t)=>{var n=Tr();o(()=>{A(n,`x`,v(t).x),A(n,`y`,v(t).y),A(n,`width`,v(t).w),A(n,`height`,v(t).h)}),d(e,n)}),d(e,t)};t(i,e=>{n.node.kind===`line`?e(a):e(s,-1)}),k(r),o(e=>_(r,e),[()=>`color: ${C(n.node.tone)}`]),d(e,r)};t(i,e=>{n.node.points.length===0?e(a):e(s,-1)}),d(e,r)},ae=e=>{var r=kr(),i=b(r),a=b(i),s=h(a),c=e=>{var t=Dr();o(e=>A(t,`d`,e),[()=>pr(n.node.value,n.node.min,n.node.max,40).d]),d(e,t)},l=M(()=>pr(n.node.value,n.node.min,n.node.max,40).pct>0);t(s,e=>{v(l)&&e(c)}),k(i);var u=h(i,2),f=x(u,!0),p=h(u,2),m=e=>{var t=Or(),r=x(t,!0);o(()=>N(r,n.node.label)),d(e,t)};t(p,e=>{n.node.label&&e(m)}),k(r),o((e,t,r)=>{A(i,`aria-label`,n.node.label??`gauge`),A(i,`aria-valuenow`,e),A(i,`aria-valuemin`,n.node.min),A(i,`aria-valuemax`,n.node.max),_(i,t),A(a,`d`,S),N(f,r)},[()=>w(n.node.value,n.node.min,n.node.max),()=>`color: ${C(n.node.tone)}`,()=>ir(n.node.value,`plain`)]),d(e,r)};t(O,e=>{v(r)?e(j):n.node.type===`stack`?e(ee,1):n.node.type===`grid`?e(F,2):n.node.type===`divider`?e(te,3):n.node.type===`text`?e(I,4):n.node.type===`number`?e(L,5):n.node.type===`chip`?e(R,6):n.node.type===`bar`?e(re,7):n.node.type===`icon`?e(z,8):n.node.type===`image`?e(ie,9):n.node.type===`spark`?e(B,10):n.node.type===`gauge`&&e(ae,11)}),d(e,E),ne()}var jr=new Set([`downloading`,`verifying`,`unpacking`,`self-testing`]),Mr=12,Nr=5,Pr=`page browser is busy`,Fr=`The page browser is unavailable on this machine, so this card can't update here. This isn't a failure — Settings → Status shows why.`,Ir=`The page browser is busy — try again in a moment.`;function Lr(e){console.assert(e==null||typeof e==`object`,`browserWaitLabel: flow shape`);let t=e?.browser;if(!t||typeof t!=`object`||!jr.has(t.phase))return``;let n=Number.isFinite(t.pct)?Math.min(100,Math.max(0,Math.round(t.pct))):0;return console.assert(n>=0&&n<=100,`browserWaitLabel: pct clamped`),`Preparing the page browser (${n}%)…`}function Rr(e){console.assert(e==null||typeof e==`object`,`tapClause: flow shape`);let t=e?.tap;if(!t||typeof t!=`object`||t.render_notice!==!0)return``;let n=Number.isInteger(t.site_cap)&&t.site_cap>0?` (up to ${t.site_cap})`:``;return console.assert(n===``||n.startsWith(` (up to `),`tapClause: the cap reads as a parenthesis`),`If the page needs SmartBrain's page browser, that one visit may also load the sites it depends on${n}.`}function zr(e){console.assert(typeof e.id==`string`,`renderDraftSites: a board row`);let t=e.draft;if(!t||t.reason!==`render_sites`||!Array.isArray(t.sites))return null;let n=[];for(let e of t.sites.slice(1,13))typeof e==`string`&&e.trim()!==``&&!n.includes(e)&&n.push(e);return console.assert(n.length<=Mr,`renderDraftSites: capped`),n.length>0?n:null}function Br(e){console.assert(Number.isInteger(e),`alsoLoadsLine: a whole count`);let t=Math.max(0,Math.trunc(e));return console.assert(t>=0,`alsoLoadsLine: never negative`),`This page also loads ${t} other site${t===1?``:`s`}`}function Vr(e){console.assert(typeof e.id==`string`,`renderNotice: a board row`);let t=e.rendered===!0&&e.render?.unavailable===!0;return console.assert(typeof t==`boolean`,`renderNotice: a verdict`),t?Fr:``}function Hr(e){console.assert(typeof e.id==`string`,`feedCandidates: a board row`);let t=e.preview?.feed_candidates;if(!Array.isArray(t))return[];let n=[];for(let e of t.slice(0,Nr))e&&typeof e.url==`string`&&e.url.startsWith(`https://`)&&typeof e.site==`string`&&!n.some(t=>t.url===e.url)&&n.push({url:e.url,site:e.site});return console.assert(n.length<=Nr,`feedCandidates: capped`),n}var Ur={render_busy:`busy`,render_unavailable:`unavailable`};function Wr(e){console.assert(e.length>0,`capacityOfCode: a code`);let t=Object.hasOwn(Ur,e)?Ur[e]:``;return console.assert(t===``||t===`busy`||t===`unavailable`,`capacityOfCode: closed answer`),t}function Gr(e){if(console.assert(!0,`errorCapacity: the fallback sentence`),!(e instanceof Error))return``;let{status:t,code:n}=e,r=typeof n==`string`&&n!==``?Wr(n):t===409&&e.message.includes(Pr)?`busy`:``;return console.assert(r===``||r===`busy`||r===`unavailable`,`errorCapacity: closed answer`),r}function Kr(e){if(console.assert(e==null||typeof e==`object`,`replyCapacity: reply shape`),!e)return``;let t=e.code,n=typeof t==`string`&&t!==``?Wr(t):e.run===`busy`?`busy`:e.kind===`render_unavailable`?`unavailable`:``;return console.assert(n===``||n===`busy`||n===`unavailable`,`replyCapacity: closed answer`),n}function qr(e){console.assert(e===``||e===`busy`||e===`unavailable`,`capacityNote: closed input`);let t=e===`busy`?Ir:e===`unavailable`?Fr:``;return console.assert(t!==``||e===``,`capacityNote: every answer has its note`),t}function Jr(e){console.assert(e===``||e===`busy`||e===`unavailable`,`confirmedNote: closed input`);let t=e===`busy`?`Confirmed — the page browser is busy, so the card checks its data on its next update.`:e===`unavailable`?`Confirmed — the page browser is unavailable on this machine, so the card can't check its data yet. Settings → Status shows why.`:``;return console.assert(t!==``||e===``,`confirmedNote: every answer has its note`),t}var Yr=m(`
                • `),Xr=m(`

                  `),Zr=m(`

                    Activate is your OK for every update of this card to load exactly these sites.

                    `);function Qr(e,n){T(n,!0);let r=S(n,`busy`,3,!1),i=S(n,`error`,3,``);var a=Zr(),s=b(a),c=x(s),l=h(s,2);p(l,20,()=>n.sites,e=>e,(e,t)=>{var n=Yr(),r=x(n,!0);o(()=>N(r,t)),d(e,n)}),k(l);var u=h(l,4),f=b(u),m=x(f,!0);k(u);var g=h(u,2),_=e=>{var t=Xr(),n=x(t,!0);o(()=>N(n,i())),d(e,t)};t(g,e=>{i()&&e(_)}),k(a),o(e=>{N(c,`${e??``}:`),f.disabled=r(),N(m,r()?`Activating…`:`Activate`)},[()=>Br(n.sites.length)]),B(`click`,f,function(...e){n.onActivate?.apply(this,e)}),d(e,a),ne()}g([`click`]);var $r={no:`May not answer your question`,partly:`May not fully answer your question`},ei={no:`This card may not answer your question.`,partly:`This card may not fully answer your question.`};function ti(e){if(console.assert(!0,`readFit: a positive label cap`),!e||typeof e!=`object`||Array.isArray(e))return null;let{verdict:t,missing:n}=e;if(t!==`no`&&t!==`partly`||!Array.isArray(n))return null;let r=n.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>e.trim()).slice(0,3);return console.assert(r.length<=3,`readFit: at most FIT_MAX_MISSING labels`),{verdict:t,missing:r}}function ni(e){let t=ti(e);if(!t)return null;let n=t.missing.length>0?`Missing: ${t.missing.join(`, `)}`:null;return console.assert($r[t.verdict].length>0,`fitText: a chip for every verdict`),console.assert(n===null||n.startsWith(`Missing: `),`fitText: the detail names what is missing`),{chip:$r[t.verdict],detail:n}}function ri(e){let t=ti(e);if(!t)return``;let n=t.missing.length>0?` It lacks: ${t.missing.join(`, `)}.`:``;return console.assert(ei[t.verdict].endsWith(`.`),`fitLine: a whole sentence for every verdict`),console.assert(n===``||n.endsWith(`.`),`fitLine: the lacks clause is a sentence`),`${ei[t.verdict]}${n}`}function ii(e){return console.assert(e===void 0||typeof e==`object`,`asClirFaces: shape is object|undefined`),!e||typeof e!=`object`||e.desktop===void 0&&e.phone===void 0?null:{desktop:e.desktop,phone:e.phone}}function ai(e){if(console.assert(e!==void 0,`verifyOptions: payload defined`),console.assert(!Array.isArray(e),`verifyOptions: payload is the board's one bound node, not a list`),!e||typeof e!=`object`)return[];let t=e,n=t.type===`form`?ii(t.clir):null;if(!n)return[];let r={id:`pick`,clir:n,summary:typeof t.summary==`string`?t.summary:``,why:``},i=(Array.isArray(t.alternatives)?t.alternatives.slice(0,1):[])[0],a=i?ii(i.clir):null;if(!i||!a)return[r];let o=typeof i.summary==`string`?i.summary:``;return[r,{id:`second`,clir:a,summary:o,why:o?`Shown differently: ${o}`:`A different design of the same data.`}]}var oi=[[`answer`,`answer`],[`select`,`quantity`],[`where`,`filter`],[`time`,`time`],[`order`,`order`],[`limit`,`limit`],[`agg`,`count`]];function si(e){if(console.assert(oi.length>0,`coverageChips: the closed clause table`),console.assert(!Array.isArray(e),`coverageChips: coverage is a clause map, not a list`),!e||typeof e!=`object`)return[];let t=e,n=[];for(let[e,r]of oi){let i=t[e];i===`approximated`?n.push(`${r} approximated`):i===`unbound`&&n.push(`${r} not found`)}return console.assert(n.length<=oi.length,`coverageChips: at most one chip per clause`),n}function ci(e){console.assert(e==null||typeof e==`object`,`optionMaxWidth: clir is an object or null`);let t=e&&typeof e==`object`?e.span:void 0,n=typeof t==`string`?/^([dp])([1-4])x([1-3])$/.exec(t):null;return console.assert(n===null||n[1]===`d`||n[1]===`p`,`optionMaxWidth: device is d or p`),n?n[1]===`p`?n[2]===`1`?`160px`:`398px`:n[2]===`1`?`calc(50% - var(--s-2))`:null:null}var li=m(`
                    `),ui=m(`

                    `),di=m(`

                    `),fi=m(``),pi=m(`

                    Reads as

                    `),mi=m(``),hi=m(`
                    `),gi=m(`

                    This is live data — is it right?

                    `);function _i(e,n){T(n,!0);let r=S(n,`busy`,3,!1),i=S(n,`interpretation`,3,``),a=S(n,`coverage`,3,void 0),s=S(n,`fit`,3,null),c=M(()=>ai(n.payload)),l=M(()=>v(c).find(e=>e.id===`pick`)??null),f=M(()=>v(c).find(e=>e.id===`second`)??null),m=M(()=>si(a())),g=M(()=>ri(s())),y=R(`desktop`);L(()=>{O(y,window.matchMedia?.(`(max-width: 560px)`)?.matches?`phone`:`desktop`,!0)});function C(){console.assert(v(y)===`desktop`||v(y)===`phone`,`toggleFace: known face before flip`);let e=v(y)===`desktop`?`phone`:`desktop`;console.assert(e!==v(y),`toggleFace: flips to the other face`),O(y,e,!0)}function w(e){return console.assert(e.id===`pick`||e.id===`second`,`faceOf: known option id`),console.assert(v(y)===`desktop`||v(y)===`phone`,`faceOf: known face`),v(y)===`phone`?e.clir.phone:e.clir.desktop}function E(){console.assert(typeof document<`u`,`isLightNow: DOM available`);let e=document.documentElement.dataset.theme;return e===`light`||e!==`dark`&&(typeof window>`u`?null:window.matchMedia?.(`(prefers-color-scheme: light)`))?.matches===!0}let A=R(!1),j,P=!1;L(()=>{O(A,E(),!0)});function ee(){console.assert(typeof v(A)==`boolean`,`toggleTheme: light is boolean`),console.assert(typeof document<`u`,`toggleTheme: DOM available`),P||=(j=document.documentElement.dataset.theme,!0),O(A,!v(A)),document.documentElement.dataset.theme=v(A)?`light`:`dark`}te(()=>{P&&typeof document<`u`&&(j===void 0?document.documentElement.removeAttribute(`data-theme`):document.documentElement.dataset.theme=j)});var F=gi(),I=h(b(F),2),re=b(I),z=x(re,!0),ie=h(re,2),ae=x(ie,!0);k(I);var V=h(I,2),H=e=>{let t=M(()=>w(v(l)));var r=li();let i;Sn(b(r),{get clir(){return v(t)},get viewerTz(){return n.viewerTz}}),k(r),o(e=>i=_(r,``,i,{"max-width":e}),[()=>ci(v(t))]),d(e,r)};t(V,e=>{v(l)&&e(H)});var oe=h(V,2),se=e=>{let t=M(()=>w(v(f)));var r=ui();let i;var a=b(r),s=x(a,!0);Sn(h(a,2),{get clir(){return v(t)},get viewerTz(){return n.viewerTz}}),k(r),o(e=>{i=_(r,``,i,{"max-width":e}),N(s,v(f).why)},[()=>ci(v(t))]),d(e,r)};t(oe,e=>{v(f)&&e(se)});var ce=h(oe,2),le=e=>{var t=di(),n=x(t,!0);o(()=>N(n,v(g))),d(e,t)};t(ce,e=>{v(g)&&e(le)});var U=h(ce,2),de=e=>{var n=pi(),r=h(b(n),2),a=x(r,!0),s=h(r,2),c=e=>{var t=fi();p(t,20,()=>v(m),e=>e,(e,t)=>{ue(e,{children:(e,n)=>{D();var r=u();o(()=>N(r,t)),d(e,r)},$$slots:{default:!0}})}),k(t),d(e,t)};t(s,e=>{v(m).length>0&&e(c)}),k(n),o(()=>N(a,i())),d(e,n)};t(U,e=>{i()&&e(de)});var W=h(U,2),fe=e=>{var i=hi(),a=b(i),s=x(a,!0),c=h(a,2),l=e=>{var t=mi();o(()=>t.disabled=r()),B(`click`,t,()=>n.onUse(`second`)),d(e,t)};t(c,e=>{v(f)&&e(l)});var u=h(c,2);k(i),o(()=>{a.disabled=r(),N(s,r()?`Checking…`:`Use this`),u.disabled=r()}),B(`click`,a,()=>n.onUse(`pick`)),B(`click`,u,function(...e){n.onWrong?.apply(this,e)}),d(e,i)};t(W,e=>{v(l)&&e(fe)}),k(F),o(()=>{re.disabled=r(),N(z,v(y)===`desktop`?`Desktop`:`Phone`),ie.disabled=r(),N(ae,v(A)?`Light`:`Dark`)}),B(`click`,re,C),B(`click`,ie,ee),d(e,F),ne()}g([`click`]);var vi={extract_miss:`couldn't find the expected data`,fetch_failed:`couldn't reach the source`,image_type:`not a supported image`,llm_requires_local:`needs a local model`,mcp_unavailable:`your MCP server didn't answer`,secret_missing:`credential problem`,secret_host_mismatch:`credential problem`,render_refused:`the page browser wouldn't open this address`,render_timeout:`the page took too long in the page browser`,render_blocked:`the site turned the page browser away`,render_offsite:`the page moved to a site this card doesn't allow`,render_confinement:`the page browser's safety checks stopped the read`,render_oversize:`the page was too big for the page browser`,render_engine:`the page browser couldn't read the page`};function yi(e){console.assert(e==null||typeof e==`string`,`friendlyErrorClass: cls is string|null|undefined`),console.assert(typeof vi==`object`,`friendlyErrorClass: map present`);let t=typeof e==`string`?e.trim():``;return t?vi[t]??t:``}function bi(e){if(console.assert(e==null||typeof e==`object`,`flowStageLabel: flow is object|null|undefined`),console.assert(e==null||typeof e.state==`string`,`flowStageLabel: state is string when flow present`),!e)return``;let t=e.state;return(t===`failed`||t===`unsupported`?``:Lr(e))||(t===`intent`?`Understanding your request…`:t===`source`?e.error===`awaiting_pick`?`Waiting for you to pick a source on the card`:`Finding the source…`:t===`awaiting_access`?`Needs your key or contact email`:t===`sampling`?`Reading a sample…`:t===`mapping`?`Choosing the data fields…`:t===`assembling`?`Building the card…`:t===`awaiting_credential`?`Needs your API key`:t===`awaiting_params`?`Needs a detail from you`:t===`ready`?`Building the card…`:``)}function xi(e){return console.assert(e==null||typeof e==`object`,`isFlowActive: flow is object|null|undefined`),console.assert(e==null||typeof e.state==`string`,`isFlowActive: state is string when flow present`),e?e.state!==`failed`&&e.state!==`unsupported`:!1}function Si(e){console.assert(typeof e==`object`&&!!e,`awaitingYesSource: a is object`),console.assert(typeof e.host==`string`&&typeof e.title==`string`,`awaitingYesSource: strings`);let t=e.from===`page`?`web page`:`dataset`,n=e.host.trim(),r=e.title.trim(),i=r!==``&&r.toLowerCase()!==n.toLowerCase();return n?i?`From the ${t} ${n} — ${r}`:`From the ${t} at ${n}`:i?`From the ${t} “${r}”`:`From a ${t}`}function Ci(e){console.assert(e===void 0||Array.isArray(e),`pickRows: array or undefined`);let t=e??[],n=new Set,r=e=>!n.has(e.url)&&(n.add(e.url),!0),i=t.filter(e=>e.kind===`library`&&r(e)),a=t.filter(e=>e.kind===`link`&&/^https:\/\//.test(e.url)&&r(e));return{sources:i,links:a,heading:i.length>0?`From the SmartBrain Library — tap the one that fits:`:a.length>0?`No SmartBrain Library source answers this yet.`:`No SmartBrain Library source answers this yet — paste a link to the data:`}}function wi(e){console.assert(typeof e.host==`string`,`linkWhat: host is string`);let t=e.found===`dataset`?`dataset`:`web page`;return e.host.trim()?`${e.host.trim()} · ${t}`:t}function Ti(e,t,n){console.assert(Array.isArray(e),`filterTemplates: templates is array`),console.assert(typeof t==`string`,`filterTemplates: query is string`);let r=t.trim().toLowerCase(),i=n.trim();return!r&&!i?e:e.filter(e=>{if(i&&e.category!==i)return!1;if(!r||e.title.toLowerCase().includes(r)||e.goal.toLowerCase().includes(r)||e.category.toLowerCase().includes(r))return!0;for(let t of e.tags)if(t.toLowerCase().includes(r))return!0;return!1})}function Ei(e){console.assert(Array.isArray(e),`templateCategories: templates is array`),console.assert(e.every(e=>typeof e==`object`),`templateCategories: entries are objects`);let t=new Set;for(let n of e){let e=n.category?.trim();e&&t.add(e)}return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function Di(e,t){console.assert(Array.isArray(e),`validateParamForm: params is array`),console.assert(typeof t==`object`&&!!t,`validateParamForm: values is object`);for(let n of e){if(n.kind===`secret`)continue;let e=t[n.name],r=typeof e==`string`?e.trim():``;if(r.length===0)return{name:n.name,message:`${n.label} is required.`};if(n.kind===`number`&&!Number.isFinite(Number(r)))return{name:n.name,message:`${n.label} must be a number.`}}return null}function Oi(e,t){console.assert(Array.isArray(e),`paramValuesForInstall: params is array`),console.assert(typeof t==`object`&&!!t,`paramValuesForInstall: values is object`);let n={};for(let r of e){if(r.kind===`secret`)continue;let e=t[r.name],i=typeof e==`string`?e.trim():``;i.length!==0&&(n[r.name]=r.kind===`number`?Number(i):i)}return n}function ki(e){console.assert(e==null||typeof e==`string`,`formatFingerprint: fp is string|null|undefined`),console.assert(!0,`formatFingerprint: total`);let t=typeof e==`string`?e.trim():``;return t?`Publisher ${t}`:`Unknown publisher`}function Ai(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ji(e){console.assert(e==null||typeof e==`object`,`stagesFromSpec: spec is object|null|undefined`),console.assert(!Array.isArray(e),`stagesFromSpec: spec is not an array`);let t={extract:null,transform:null};if(!Ai(e))return t;let n=e.pipeline;if(!Array.isArray(n))return t;for(let e of n)Ai(e)&&(e.op===`extract`&&Ai(e.paths)?t.extract===null&&(t.extract=e.paths):e.op===`transform`&&Array.isArray(e.apply)&&t.transform===null&&(t.transform=e.apply));return t}function Mi(e){if(console.assert(e===null||typeof e==`object`||e===void 0,`formatStageJson: value is object|null|undefined`),console.assert(!0,`formatStageJson: total`),e==null)return`(none)`;try{return JSON.stringify(e,null,2)}catch{return`(unserializable)`}}var Ni=m(`

                    `),Pi=m(``),Fi=m(` `,1),Ii=m(`
                    `),Li=m(`
                    Needs your
                    `),Ri=m(`
                    `),zi=m(`
                    Needs
                    `),Bi=m(`

                    Creation didn’t finish. Delete this card, or start again above.

                    `),Vi=m(`
                    `),Hi=m(`

                    Is this what you asked for?

                    `),Ui=m(`

                    Confirmed — verifying, this card goes live after the next successful refresh.

                    `),Wi=m(`

                    This is live data — is it right?

                    `),Gi=m(` `,1),Ki=m(` `,1),qi=m(``),Ji=m(`
                    ⋯
                    `),Yi=m(`
                    `),Xi=m(`

                    `),Zi=m(``),Qi=m(`
                    `,1),$i=m(`
                    `,1),ea=m(` `,1),ta=m(``),na=m(``),ra=m(`
                    `),ia=m(`

                    `),aa=m(`

                    `,1),oa=m(`

                    Finding a source for this…

                    `),sa=m(`

                    `),ca=m(`

                    Needs your own free key — you'll paste it next

                    `),la=m(`

                    Asks for your contact email once

                    `),ua=m(`
                    `),da=m(`
                    `),fa=m(`
                  • `),pa=m(` `,1),ma=m(`

                    `),ha=m(`

                    `),ga=m(`Get one here, - then paste it below.`,1),_a=m(`

                    `,1),va=m(`

                    `,1),ya=m(`

                    `),ba=m(`
                    `),xa=m(`

                    First run failed —

                    `),Sa=m(`

                    Waiting for the first run…

                    `),Ca=m(` `,1),wa=m(`
                    `),Ta=m(`

                    `),Ea=m(` `,1),Da=m(` `,1),Oa=m(` `,1),ka=m(`

                    Couldn’t load this proposal.

                    `),Aa=m(`

                    Current mapping

                    extract

                     

                    transform

                     

                    Proposed mapping

                    extract

                     

                    transform

                     
                    `),ja=m(` `,1),Ma=m(`

                    `),Na=m(` `,1),Pa=m(` `,1),Fa=m(` `,1),Ia=m(` `,1),La=m(` `,1),Ra=m(` `,1),za=m(`

                    No runs recorded yet.

                    `),Ba=m(` `),Va=m(`
                  • `),Ha=m(`
                      `),Ua=m(` `,1),Wa=m(`

                      The library publisher’s key changed — updates are blocked.

                      Pinned (trusted)
                      Offered (new)

                      This is either the publisher rotating their key — or someone impersonating them. Verify - the offered fingerprint with the publisher out-of-band before trusting it.

                      `),Ga=m(`
                      `,1),Ka=m(`
                    • `),qa=m(`
                      — credential — you’ll add it on the card after install.
                      `),Ja=m(``),Ya=m(`
                      `,1),Xa=m(`
                        `,1),Za=m(` `),Qa=m(`

                        `),$a=m(`

                        The library host has been unreachable for a while — checks are paused. Check now to retry.

                        `),eo=m(``),to=m(``),no=m(`

                        No templates match that search.

                        `),ro=m(`

                        `),io=m(`
                        • `),ao=m(`
                            `),oo=m(`
                            `,1),so=m(` `,1),co=m(`

                            Neural Interface

                            Live data you asked for, on one board. Type it below — “show me AAPL every 5 minutes”.

                            `,1);function lo(i,a){T(a,!0);let s=R(e([])),m=R(!1),g=R(``),_=R(null),S=R(!1),I=null,re=0,oe=R(null),me=R(``),he=`https://smartbrain.securecloudgroup.com/ni/library.json`,ge=R(!1),G=R(null),Te=R(!1),Ee=R(``),De=R(he),K=R(!1),Oe=R(``),ke=R(``),Ae=R(null),je=R(e({})),Me=R(!1),Ne=R(``),Pe=R(``),Fe=R(``),Le=R(!1),Re=R(``),ze=R(null),Ve=R(!1),He=R(null),Ue=R(null),We=R(!1),Ge=R(!1),Ke=M(()=>v(Ue)?ji(v(Ue).spec):{extract:null,transform:null}),qe=M(()=>qt(v(Ue))),Je=R(null),Ye=R(null),Xe=R(!1),Ze=R(!1),Qe=R(``),$e=R(!0),et=R(!1),q=R(null),J=R(``),tt=R(``),Y=R(``),X=R(``),nt=R(!1),Z=R(!1),rt=R(``),it=R(``),at=R(``),ot=R(``),st=R(null),ct=R(``),lt=R(``),ut=R(!1),dt=R(``),ft=R(null),pt=R(``),mt=R(!1);function ht(e){console.assert(v(ft)===null,`openRefine: one at a time`),O(ft,e,!0),O(pt,``)}async function gt(){if(!v(ft)||v(mt))return;let e=v(ft),t=v(pt).trim();if(!(t.length<3)){O(mt,!0);try{let n=await V.niRefine(e.id,t);O(ft,null),O(pt,``),U(n.kind===`cadence`?`Update schedule changed.`:n.kind===`source_change`?`Okay — pick a new source on the card.`:`Rebuilding the card from your note.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(mt,!1)}}}let Q=R(e({})),_t=R(``);async function vt(e,t){console.assert(e.flow?.state===`source`,`pickSource: pause required`);let n=(t??v(it)).trim();if(!(n.length<8)){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let r=await V.niFlowPickSource(e.id,n,t===void 0);O(it,``),U(r.needs&&r.needs.length>0?`This source needs one more thing — see the card.`:r.started===!1?`Source set — it starts as soon as a build slot frees up.`:`Source set — sampling it now.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t work — check the URL.`},!0)}finally{O(_,null)}}}async function yt(e){console.assert(e.flow?.state===`awaiting_access`,`giveAccess: pause required`);let t=e.flow?.access;if(!t)return;let n=v(at).trim(),r=v(ot).trim();if(!(t.key&&!n||t.contact&&!r)){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let i=await V.niFlowAccess(e.id,t.key?n:void 0,t.contact?r:void 0);O(at,``),O(ot,``),U(i.started?`Thanks — building the card now.`:`Saved.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t work — try again.`},!0)}finally{O(_,null)}}}async function bt(e){console.assert(typeof e.id==`string`,`answerDate: id required`);let t=v(_t).trim();if(t){O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowAnswer(e.id,`supply_date`,t),O(_t,``),U(`Date set — building the card.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That date didn’t work — use YYYY-MM-DD.`},!0)}finally{O(_,null)}}}async function xt(e,t){console.assert(typeof e.id==`string`,`answerConsent: id required`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowAnswer(e.id,`model_consent`,t),U(t===`allow`?`Building the card.`:`Building the card on your local model.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function St(e){console.assert(typeof e.id==`string`,`reopenPick: id required`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niFlowReopen(e.id),U(`Okay — pick a source below.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`Couldn’t reopen the pick.`},!0)}finally{O(_,null)}}function Ct(e){let t=e.target;for(let e of document.querySelectorAll(`details.ni-more[open]`))(!t||!e.contains(t)||t.closest(`.ni-more-menu`))&&(e.open=!1)}async function wt(e){O(_,e.id,!0);try{await V.niFlowFix(e.id),U(`Fixing — re-reading the card's source.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}function Tt(e){console.assert(v(st)===null,`openEdit: no other edit open`),O(st,e,!0),O(ct,e.title,!0),O(lt,String(e.interval_minutes),!0),O(dt,``)}function Et(){console.assert(v(ut)===!1,`closeEdit: not while saving`),O(st,null),O(ct,``),O(lt,``),O(dt,``)}async function Dt(){console.assert(v(st)!==null,`submitEdit: target required`);let e=v(st);if(!e||v(ut))return;let t=v(ct).trim(),n=parseInt(v(lt),10);if(!t||!Number.isFinite(n)||n<1){O(dt,`A name and a cadence of at least 1 minute are required.`);return}O(ut,!0),O(dt,``);try{await V.niPatch(e.id,{title:t,interval_minutes:n}),Et(),U(`Card updated.`),await $()}catch(e){O(dt,W(e),!0)}finally{O(ut,!1)}}let Ot=R(``),kt=R(!1),At=R(``),jt=R(void 0);async function Mt(){console.assert(v(kt)===!1,`submitComposer: no concurrent submit`);let e=v(Ot).trim();if(!(e.length<3||v(kt))){O(kt,!0),O(At,``);try{let t=await V.niIntake(e);O(Ot,``),U(t.started===!1?`Card created — it starts as soon as a build slot frees up.`:`Card started — watch it build below.`),await $()}catch(e){O(At,W(e),!0)}finally{O(kt,!1)}}}async function Nt(e){console.assert(typeof e.id==`string`,`retryFlow: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let t=await V.niFlowRetry(e.id);U(t.started===!1?`Retry queued — it starts as soon as a build slot frees up.`:`Retrying the card build.`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}let Pt=R(null),Ft=R(``),It=R(``),Lt=R(``),Rt=R(!1),zt=R(``),Bt=R(null),Vt=R(null),Ht=R(!1),Ut=R(``),Wt=M(()=>v(G)?.templates?Ti(v(G).templates,v(Oe),v(ke)):[]),Gt=M(()=>v(G)?.templates?Ei(v(G).templates):[]),Kt=M(()=>v(Ae)?Di(v(Ae).params,v(je)):null);function qt(e){if(console.assert(e===null||typeof e==`object`,`readProposedStages: detail is object|null`),console.assert(e===null||e.spec!==void 0,`readProposedStages: spec present when detail present`),!e)return{extract:null,transform:null};let t=e.spec._l2_proposal;if(!t||typeof t!=`object`||Array.isArray(t))return{extract:null,transform:null};let n=t.stages;if(!n||typeof n!=`object`||Array.isArray(n))return{extract:null,transform:null};let r=n;return{extract:r.extract&&typeof r.extract==`object`&&!Array.isArray(r.extract)?r.extract:null,transform:Array.isArray(r.transform)?r.transform:null}}async function Jt(){if(console.assert(typeof V.niLibrary==`function`,`openLibrary: niLibrary present`),console.assert(v(ge)===!1||v(ge)===!0,`openLibrary: libraryOpen boolean`),O(ge,!0),O(Ee,``),v(G)===null){O(Te,!0);try{O(G,await V.niLibrary(),!0),v(G).url&&O(De,v(G).url,!0)}catch(e){O(Ee,W(e),!0)}finally{O(Te,!1)}}}function Yt(){console.assert(v(K)===!1,`closeLibrary: never close while a request is in flight`),console.assert(v(Me)===!1,`closeLibrary: never close mid-install`),O(ge,!1),O(Oe,``),O(ke,``),O(Ae,null),O(je,{},!0),O(Ne,``),O(Pe,``),O(Fe,``),O(Re,``),O(Ee,``)}async function Xt(){console.assert(typeof v(De)==`string`,`connectLibrary: url is string`),console.assert(v(K)===!1,`connectLibrary: no concurrent request`);let e=v(De).trim();if(e&&!v(K)){O(K,!0),O(Ee,``);try{O(G,await V.niLibraryConnect(e),!0)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function Zt(){if(console.assert(v(G)?.connected===!0,`checkLibraryNow: only when connected`),console.assert(v(K)===!1,`checkLibraryNow: no concurrent request`),!v(K)){O(K,!0),O(Ee,``);try{O(G,await V.niLibraryCheck(),!0)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function Qt(){if(console.assert(v(G)?.connected===!0,`disconnectLibrary: only when connected`),console.assert(v(K)===!1,`disconnectLibrary: no concurrent request`),await ce({title:`Disconnect from this library?`,body:`Templates you already installed as items stay on your board. You can reconnect any time.`,confirmLabel:`Disconnect`,danger:!0})){O(K,!0),O(Ee,``);try{await V.niLibraryDisconnect(),O(G,{connected:!1},!0),O(Oe,``),O(ke,``)}catch(e){O(Ee,W(e),!0)}finally{O(K,!1)}}}async function $t(){console.assert(!!v(G)?.blocked,`trustLibraryKey: only while blocked`),console.assert(typeof v(Fe)==`string`,`trustLibraryKey: passphrase is string`);let e=v(G)?.blocked?.offered_fingerprint;if(e&&v(Fe)&&!v(Le)){O(Le,!0),O(Re,``);try{O(G,await V.niLibraryTrustKey(e,v(Fe)),!0),O(Fe,``)}catch(e){O(Re,W(e),!0)}finally{O(Le,!1)}}}function en(e){console.assert(typeof e.id==`string`,`startInstall: template id is string`),console.assert(Array.isArray(e.params),`startInstall: params is array`),O(Ae,e,!0),O(je,{},!0),O(Ne,``),O(Pe,``)}function tn(){console.assert(v(Me)===!1,`cancelInstall: not while installing`),console.assert(typeof v(Ne)==`string`,`cancelInstall: installError is string`),O(Ae,null),O(je,{},!0),O(Ne,``)}async function nn(){console.assert(v(Ae)!==null,`submitInstall: template picked`),console.assert(v(Me)===!1,`submitInstall: no concurrent install`);let e=v(Ae);if(!e||v(Me))return;let t=Di(e.params,v(je));if(t){O(Ne,t.message,!0);return}O(Me,!0),O(Ne,``);try{let t=Oi(e.params,v(je)),n=(await V.niLibraryInstall(e.id,t)).needs_credentials?.length?` (credentials still needed)`:``;O(Pe,`Added as a draft — open its card to add credentials and Activate.${n}`),O(Ae,null),O(je,{},!0),await $()}catch(e){O(Ne,W(e),!0)}finally{O(Me,!1)}}function rn(e){console.assert(e.template_update===!0,`openTemplateUpdate: chip must be present`),console.assert(v(ze)===null,`openTemplateUpdate: no other update prompt open`),O(ze,e,!0)}async function an(){console.assert(v(ze)!==null,`applyTemplateUpdate: target must be set`),console.assert(v(Ve)===!1,`applyTemplateUpdate: no concurrent apply`);let e=v(ze);if(e&&!v(Ve)){O(Ve,!0),O(_,e.id,!0);try{await V.niApplyTemplateUpdate(e.id),O(ze,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ve,!1),O(_,null)}}}function on(e){console.assert(e===null||typeof e==`object`,`readRepairPolicy: detail is object|null`),console.assert(e===null||e.spec!==void 0,`readRepairPolicy: spec present when detail present`);let t={l1:!0,l2_frontier:!1};if(!e)return t;let n=e.spec.repair_policy;if(!n||typeof n!=`object`||Array.isArray(n))return t;let r=n;return{l1:typeof r.l1==`boolean`?r.l1:t.l1,l2_frontier:typeof r.l2_frontier==`boolean`?r.l2_frontier:t.l2_frontier}}async function sn(e){console.assert(typeof e.id==`string`,`openRepair: id is string`),console.assert(v(Je)===null,`openRepair: no other repair modal open`),O(Je,e,!0),O(Ye,null),O(Qe,``),O(Xe,!0);try{O(Ye,await V.niItem(e.id),!0);let t=on(v(Ye));O($e,t.l1,!0),O(et,t.l2_frontier,!0)}catch(e){O(Qe,W(e),!0)}finally{O(Xe,!1)}}function cn(){console.assert(v(Ze)===!1,`closeRepair: not while save in flight`),console.assert(typeof v(Xe)==`boolean`,`closeRepair: repairLoading is boolean`),O(Je,null),O(Ye,null),O(Qe,``)}async function ln(){console.assert(v(Je)!==null,`saveRepair: a target must be set`),console.assert(v(Ze)===!1,`saveRepair: no concurrent save`);let e=v(Je);if(e&&!v(Ze)){O(Ze,!0),O(Qe,``);try{await V.niRepairPolicy(e.id,{l1:v($e),l2_frontier:v(et)}),O(Je,null),O(Ye,null)}catch(e){O(Qe,W(e),!0)}finally{O(Ze,!1)}}}async function un(e){console.assert(e.l2_proposal===!0,`openProposal: chip must be present`),console.assert(v(He)===null,`openProposal: no other proposal open`),O(He,e,!0),O(Ue,null),O(We,!0);try{O(Ue,await V.niItem(e.id),!0)}catch(e){let t=W(e);t&&O(g,t,!0),O(He,null)}finally{O(We,!1)}}function dn(){console.assert(v(Ge)===!1,`closeProposal: not while apply/dismiss in flight`),console.assert(typeof v(We)==`boolean`,`closeProposal: proposalLoading is boolean`),O(He,null),O(Ue,null)}async function fn(){console.assert(v(He)!==null,`applyProposal: a target must be set`),console.assert(v(Ge)===!1,`applyProposal: no concurrent apply`);let e=v(He);if(e&&!v(Ge)){O(Ge,!0),O(_,e.id,!0);try{await V.niL2Apply(e.id),O(He,null),O(Ue,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ge,!1),O(_,null)}}}async function pn(){console.assert(v(He)!==null,`dismissProposal: a target must be set`),console.assert(v(Ge)===!1,`dismissProposal: no concurrent dismiss`);let e=v(He);if(e&&!v(Ge)&&await ce({title:`Dismiss proposed fix?`,body:`Dismiss this proposed fix? It won't be offered again for this breakage.`,confirmLabel:`Dismiss`,danger:!0})){O(Ge,!0),O(_,e.id,!0);try{await V.niL2Dismiss(e.id),O(He,null),O(Ue,null),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(Ge,!1),O(_,null)}}}function mn(e){if(console.assert(e===null||typeof e==`object`,`hostFromSpec: detail is object|null`),console.assert(e===null||typeof e.spec==`object`,`hostFromSpec: spec present when detail present`),!e)return``;let t=e.spec.source;if(!t||typeof t!=`object`||Array.isArray(t))return``;let n=t.url;if(typeof n!=`string`||n.length===0)return``;try{return new URL(n).hostname}catch{return``}}function hn(e){if(console.assert(typeof e.state==`string`,`firstRunFailure: state is string`),console.assert(typeof e.consecutive_failures==`number`,`firstRunFailure: failures is number`),e.state!==`commissioning`&&e.state!==`live`&&e.state!==`degraded`&&e.state!==`failing`||e.payload!==null||e.consecutive_failures<=0)return{show:!1,friendly:``,raw:``,attempts:0,tried:``};let t=typeof e.last_status==`string`?e.last_status:``;return{show:!0,friendly:yi(t),raw:t,attempts:e.consecutive_failures,tried:_e(e.last_checked)}}async function gn(e,t){console.assert(typeof t.name==`string`,`openCredential: name is string`),console.assert(v(q)===null,`openCredential: no other credential modal open`),O(q,e,!0),O(J,t.name,!0),O(tt,t.label,!0),O(Y,``),O(X,``),O(rt,``),O(nt,!0);try{let t=await V.niItem(e.id);O(X,mn(t),!0)}catch(e){O(rt,W(e),!0)}finally{O(nt,!1)}}function _n(){console.assert(v(Z)===!1,`closeCredential: not while save in flight`),console.assert(typeof v(Y)==`string`,`closeCredential: value is string`),O(q,null),O(J,``),O(tt,``),O(Y,``),O(X,``),O(rt,``)}async function vn(){console.assert(v(q)!==null,`submitCredential: a target must be set`),console.assert(v(Z)===!1,`submitCredential: no concurrent save`);let e=v(q),t=v(Y),n=v(X).trim();if(e&&t&&n&&!v(Z)){O(Z,!0),O(rt,``);try{await V.niPutCredential(e.id,v(J),t,n);let r=v(tt);_n(),U(`Saved the ${r} key.`),await $()}catch(e){O(rt,W(e),!0)}finally{O(Z,!1)}}}function yn(e,t){console.assert(typeof t.name==`string`,`openParam: name is string`),console.assert(v(Pt)===null,`openParam: no other param modal open`),O(Pt,e,!0),O(Ft,t.name,!0),O(It,t.label,!0),O(Lt,``),O(zt,``)}function bn(){console.assert(v(Rt)===!1,`closeParam: not while save in flight`),O(Pt,null),O(Ft,``),O(It,``),O(Lt,``),O(zt,``)}async function xn(){console.assert(v(Pt)!==null,`submitParam: a target must be set`),console.assert(v(Rt)===!1,`submitParam: no concurrent save`);let e=v(Pt),t=v(Lt).trim();if(e&&t&&!v(Rt)){O(Rt,!0),O(zt,``);try{await V.niPutParam(e.id,v(Ft),t);let n=v(It);bn(),U(`Saved ${n}.`),await $()}catch(e){O(zt,W(e),!0)}finally{O(Rt,!1)}}}async function Cn(e){console.assert(typeof e.id==`string`,`openHistory: id is string`),console.assert(v(Bt)===null,`openHistory: no other history modal open`),O(Bt,e,!0),O(Vt,null),O(Ut,``),O(Ht,!0);try{O(Vt,await V.niItem(e.id),!0)}catch(e){O(Ut,W(e),!0)}finally{O(Ht,!1)}}function wn(){console.assert(typeof v(Ht)==`boolean`,`closeHistory: loading is boolean`),console.assert(v(Bt)===null||v(Bt)!==void 0,`closeHistory: target shape`),O(Bt,null),O(Vt,null),O(Ut,``)}async function $(){if(console.assert(typeof V.niBoard==`function`,`load: niBoard method present`),console.assert(Array.isArray(v(s)),`load: items array`),!H.status?.unlocked)return;let e=++re;try{let t=await V.niBoard();if(e!==re)return;O(s,[...t.items].sort((e,t)=>e.position-t.position),!0),O(g,``)}catch(t){if(e!==re)return;let n=W(t);n&&O(g,n,!0)}finally{e===re&&O(m,!0)}}function Tn(){console.assert(typeof document<`u`,`onVisible: DOM available`),console.assert(document.visibilityState!==void 0,`onVisible: visibilityState present`),document.visibilityState===`visible`&&$()}L(async()=>{H.status===null&&await H.load();let e=H.status;if(e&&!e.initialized)return ae(`/setup`);if(e&&!e.unlocked)return ae(`/unlock`);$(),I=setInterval(()=>{document.visibilityState===`visible`&&$()},1e4),document.addEventListener(`visibilitychange`,Tn),typeof location<`u`&&location.hash===`#templates`&&(history.replaceState(null,``,location.pathname+location.search),Jt())}),te(()=>{I&&clearInterval(I),document.removeEventListener(`visibilitychange`,Tn)}),l(()=>{console.assert(H.status?.unlocked!==void 0||H.status===null,`$effect: unlocked accessed`),console.assert(re>=0,`$effect: gen counter present`),H.status?.unlocked&&$()}),l(()=>{if(console.assert(Array.isArray(v(s)),`$effect fast-poll: items array`),console.assert(typeof xi==`function`,`$effect fast-poll: helper present`),!v(s).some(e=>xi(e.flow??null)))return;let e=setInterval(()=>{document.visibilityState===`visible`&&$()},3e3);return()=>clearInterval(e)});function En(e){console.assert(typeof e.state==`string`,`healthChip: state is string`),console.assert(typeof e.interval_minutes==`number`,`healthChip: interval is number`);let t=e.state;return t===`draft`?{kind:``,label:`Preview`}:t===`commissioning`&&e.awaiting_yes?{kind:`accent`,label:`Needs your OK`}:t===`commissioning`?{kind:`accent`,label:`Commissioning`}:t===`broken`?{kind:`danger`,label:`Broken`}:t===`failing`?{kind:`warn`,label:`Failing`}:t===`degraded`?{kind:`warn`,label:`Degraded`}:t===`paused`?{kind:``,label:`Paused`}:ve(e.payload_at,e.interval_minutes)?{kind:`warn`,label:`Stale`}:{kind:`ok`,label:`Live`}}async function Dn(e){console.assert(typeof e.id==`string`,`runNow: id is string`),console.assert(v(_)===null||v(_)===e.id,`runNow: busy id matches or null`),O(_,e.id,!0);try{let t=await V.niRun(e.id),n=Kr(t);n?U(qr(n)):t.status===`error`&&O(g,t.kind?`Run failed (${t.kind}).`:`Run failed.`,!0),await $()}catch(e){let t=Gr(e);if(t)U(qr(t));else{let t=W(e);t&&O(g,t,!0)}}finally{O(_,null)}}async function On(e){console.assert(typeof e.id==`string`,`togglePause: id is string`),console.assert(typeof e.enabled==`boolean`,`togglePause: enabled is boolean`),O(_,e.id,!0);try{await V.niPatch(e.id,{enabled:!e.enabled}),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function kn(e){if(console.assert(typeof e.id==`string`,`remove: id is string`),console.assert(typeof e.title==`string`,`remove: title is string`),await ce({title:`Delete this item?`,body:`Delete “${e.title}” from your Neural Interface? Its history is removed too.`,confirmLabel:`Delete`,danger:!0})){O(_,e.id,!0);try{await V.niDelete(e.id),O(s,v(s).filter(t=>t.id!==e.id),!0)}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}}async function An(e){console.assert(e.state===`draft`,`activate: only drafts`),console.assert(typeof e.id==`string`,`activate: id is string`),O(_,e.id,!0);try{await V.niCommission(e.id),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function jn(e){console.assert(e.draft?.reason===`render_sites`,`activateSites: a draft waiting for its sites`),console.assert(typeof e.id==`string`,`activateSites: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{await V.niActivate(e.id),U(`Activated — check the card's reading.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function Mn(e,t){console.assert(Hr(e).some(e=>e.url===t),`switchFeed: one of the card's feeds`),console.assert(typeof e.id==`string`,`switchFeed: id is string`),O(_,e.id,!0),O(Q,{...v(Q),[e.id]:``},!0);try{let n=await V.niSwitchFeed(e.id,t);U(n.started===!1?`Switching to the feed — it starts as soon as a build slot frees up.`:`Switching to the feed — rebuilding the card from it.`),await $()}catch(t){O(Q,{...v(Q),[e.id]:W(t)||`That didn’t go through — try again.`},!0)}finally{O(_,null)}}async function Nn(e,t){console.assert(e.state===`commissioning`,`validateLooksRight: only commissioning`),console.assert(typeof e.id==`string`,`validateLooksRight: id is string`),O(_,e.id,!0);try{let n=await V.niValidate(e.id,!0,void 0,t);U(Jr(Kr(n))||(n.state===`live`?`Confirmed — the card is live.`:`Confirmed — verifying with a fresh refresh.`)),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}async function Pn(e){console.assert(e.state===`commissioning`,`declineReading: only commissioning`),console.assert(!!e.awaiting_yes,`declineReading: only a card awaiting the user's YES`),O(_,e.id,!0);try{let t=await V.niValidate(e.id,!1);U(t.repick===`repick`?`Pick another source — that one won't be offered again.`:`Looking for another source…`),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null)}}function Fn(e){console.assert(e.state===`commissioning`,`openWrongNote: only commissioning`),console.assert(v(oe)===null,`openWrongNote: no other note prompt open`),O(oe,e,!0),O(me,``)}async function In(){if(console.assert(v(oe)!==null,`submitWrongNote: a target must be set`),console.assert(typeof v(me)==`string`,`submitWrongNote: note is string`),!v(oe)||v(S))return;let e=v(oe);O(_,e.id,!0),O(S,!0);try{await V.niValidate(e.id,!1,v(me).trim()||void 0),O(oe,null),O(me,``),await $()}catch(e){let t=W(e);t&&O(g,t,!0)}finally{O(_,null),O(S,!1)}}let Ln=R(!1),Rn=typeof window<`u`?window.matchMedia(`(max-width: 560px)`):null;function zn(){O(Ln,Rn?.matches??!1,!0)}L(()=>(zn(),Rn?.addEventListener(`change`,zn),()=>Rn?.removeEventListener(`change`,zn)));let Bn=(()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}})();function Vn(e){if(console.assert(e!==void 0,`pickClir: payload defined`),console.assert(typeof v(Ln)==`boolean`,`pickClir: phoneLayout boolean`),!e||typeof e!=`object`)return null;let t=e;if(t.type!==`form`||!t.clir||typeof t.clir!=`object`)return null;let n=t.clir;return v(Ln)?n.phone??n.desktop??null:n.desktop??n.phone??null}var Hn=f();n(`click`,c,Ct);var Un=y(Hn),Wn=e=>{var i=co(),a=y(i),c=h(b(a),2);k(a);var l=h(a,4),T=b(l);j(T),ee(T,e=>O(jt,e),()=>v(jt));var te=h(T,2),I=x(te,!0);k(l);var L=h(l,2),ne=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(At))),d(e,t)};t(L,e=>{v(At)&&e(ne)});var R=h(L,2),re=e=>{de(e,{block:!0})},V=e=>{fe(e,{icon:`monitor`,title:`Nothing on your Neural Interface yet`,body:`Type what you want to watch in the box above — “show me AAPL every 5 minutes” — then approve the source on the card.`,children:(e,t)=>{var n=Pi();B(`click`,n,()=>v(jt)?.focus()),d(e,n)},$$slots:{default:!0}})},H=e=>{var i=wa();p(i,21,()=>v(s),e=>e.id,(e,i)=>{let a=M(()=>En(v(i))),s=M(()=>v(i).state===`draft`),c=M(()=>Vn(v(i).payload)),l=M(()=>Se(v(i).display?.size,v(c))),m=M(()=>ye(v(i))),g=M(()=>v(m)===`failing`?`${yi(v(i).last_status)} · last tried ${_e(v(i).last_checked)}`:``),S=M(()=>Vr(v(i))),C=M(()=>zr(v(i))),w=M(()=>ni(v(i).fit));{let T=e=>{var n=Fi(),r=y(n),s=e=>{ue(e,{get kind(){return v(a).kind},children:(e,t)=>{D();var n=u();o(()=>N(n,v(a).label)),d(e,n)},$$slots:{default:!0}})};t(r,e=>{v(m)!==`fresh`&&e(s)});var c=h(r,2),l=e=>{ue(e,{kind:``,title:`This card includes a language model's reading of the data, not pure arithmetic.`,children:(e,t)=>{D();var n=u(`Interpreted`);d(e,n)},$$slots:{default:!0}})};t(c,e=>{v(i).interpreted&&e(l)});var f=h(c,2),p=e=>{ue(e,{kind:`accent`,onclick:()=>rn(v(i)),title:`The library updated this card's template — click to review and apply`,children:(e,t)=>{D();var n=u(`Update available`);d(e,n)},$$slots:{default:!0}})};t(f,e=>{v(i).template_update&&e(p)});var g=h(f,2),_=e=>{ue(e,{kind:`accent`,onclick:()=>un(v(i)),title:`A proposed fix from Claude — click to review`,children:(e,t)=>{D();var n=u(`Fix proposed`);d(e,n)},$$slots:{default:!0}})};t(g,e=>{v(i).l2_proposal&&e(_)});var b=h(g,2),x=e=>{ue(e,{kind:``,title:`This card's template is no longer in the library`,children:(e,t)=>{D();var n=u(`No longer in library`);d(e,n)},$$slots:{default:!0}})};t(b,e=>{v(i).template_gone&&e(x)}),d(e,n)},E=e=>{var n=Fi(),r=y(n),a=e=>{var t=Ii(),n=b(t),r=x(n,!0);k(t),o(()=>{n.disabled=v(_)===v(i).id,N(r,v(_)===v(i).id?`Fixing…`:`Fix`)}),B(`click`,n,()=>wt(v(i))),d(e,t)};t(r,e=>{!v(i).shell&&!v(i).flow&&(v(i).state===`failing`||v(i).state===`broken`||v(i).state===`degraded`||v(i).state===`commissioning`&&v(i).consecutive_failures>0)&&e(a)});var l=h(r,2),u=e=>{var t=Ri();p(t,21,()=>v(i).needs_credentials,e=>e.name,(e,t)=>{var n=Li(),r=b(n),a=h(b(r)),s=x(a,!0),c=h(a,1,!0);k(r);var l=h(r,2);k(n),o(e=>{N(s,v(t).label),N(c,e),l.disabled=v(_)===v(i).id||v(q)!==null},[()=>v(t).label.toLowerCase().endsWith(`key`)?``:` key`]),B(`click`,l,()=>gn(v(i),v(t))),d(e,n)}),k(t),d(e,t)};t(l,e=>{v(i).needs_credentials&&v(i).needs_credentials.length>0&&e(u)});var m=h(l,2),g=e=>{var t=Ri();p(t,21,()=>v(i).needs_params,e=>e.name,(e,t)=>{var n=zi(),r=b(n),a=h(b(r)),s=x(a,!0);k(r);var c=h(r,2);k(n),o(()=>{N(s,v(t).label),c.disabled=v(_)===v(i).id||v(Pt)!==null}),B(`click`,c,()=>yn(v(i),v(t))),d(e,n)}),k(t),d(e,t)};t(m,e=>{v(i).needs_params&&v(i).needs_params.length>0&&e(g)});var S=h(m,2),w=e=>{var t=Bi();d(e,t)},T=e=>{{let t=M(()=>v(_)===v(i).id),n=M(()=>v(Q)[v(i).id]??``);Qr(e,{get sites(){return v(C)},get busy(){return v(t)},get error(){return v(n)},onActivate:()=>jn(v(i))})}},E=e=>{var t=Vi(),n=b(t),r=x(n,!0);k(t),o(()=>{n.disabled=v(_)===v(i).id,N(r,v(_)===v(i).id?`Activating…`:`Activate`)}),B(`click`,n,()=>An(v(i))),d(e,t)};t(S,e=>{v(s)&&v(i).shell&&(!v(i).flow||v(i).flow.state===`failed`||v(i).flow.state===`unsupported`)&&v(i).flow?.question?.kind!==`model_consent`?e(w):v(s)&&!v(i).shell&&!v(i).flow&&v(C)?e(T,1):v(s)&&!v(i).shell&&!v(i).flow&&e(E,2)});var D=h(S,2),O=e=>{let n=M(()=>Hr(v(i)));var r=Hi(),a=h(b(r),2),s=x(a,!0),c=h(a,2),l=b(c),u=x(l,!0),f=h(l,2);k(c);var p=h(c,2),m=e=>{{let t=M(()=>v(_)===v(i).id),r=M(()=>v(Q)[v(i).id]??``);Be(e,{get candidates(){return v(n)},get busy(){return v(t)},get error(){return v(r)},onSwitch:e=>Mn(v(i),e)})}};t(p,e=>{v(n).length>0&&e(m)}),k(r),o(e=>{N(s,e),l.disabled=v(_)===v(i).id,N(u,v(_)===v(i).id?`Checking…`:`Yes, that’s it`),f.disabled=v(_)===v(i).id},[()=>Si(v(i).awaiting_yes)]),B(`click`,l,()=>Nn(v(i))),B(`click`,f,()=>Pn(v(i))),d(e,r)},A=e=>{var n=f(),r=y(n),a=e=>{var t=Ui();d(e,t)},s=e=>{{let t=M(()=>v(_)===v(i).id),n=M(()=>xe(v(i))),r=M(()=>v(i).query?.coverage);_i(e,{get payload(){return v(i).payload},get viewerTz(){return Bn},get busy(){return v(t)},get interpretation(){return v(n)},get coverage(){return v(r)},get fit(){return v(i).fit},onUse:e=>Nn(v(i),e),onWrong:()=>Fn(v(i))})}},l=e=>{var t=Wi(),n=h(b(t),2),r=b(n),a=x(r,!0),s=h(r,2);k(n),k(t),o(()=>{r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Checking…`:`Looks right`),s.disabled=v(_)===v(i).id}),B(`click`,r,()=>Nn(v(i))),B(`click`,s,()=>Fn(v(i))),d(e,t)};t(r,e=>{v(i).c2_ok?e(a):v(c)?e(s,1):e(l,-1)}),d(e,n)};t(D,e=>{v(i).awaiting_yes&&v(i).payload&&!v(i).flow?e(O):v(i).state===`commissioning`&&v(i).payload&&v(i).payload_slot!==`preview`&&e(A,1)}),d(e,n)},P=e=>{var n=Ji(),r=b(n),a=e=>{var t=Gi(),n=y(t),r=h(n,2),a=x(r,!0);o(()=>{n.disabled=v(_)===v(i).id||v(Bt)!==null,r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Running…`:`Run now`)}),B(`click`,n,()=>Cn(v(i))),B(`click`,r,()=>Dn(v(i))),d(e,t)},s=M(()=>!we(v(m),!!v(c),v(S)));t(r,e=>{v(s)&&e(a)});var l=h(r,2),u=h(b(l),2),f=b(u),p=e=>{var t=Ki(),n=y(t),r=h(n,2),a=x(r,!0);o(()=>{n.disabled=v(_)===v(i).id||v(Bt)!==null,r.disabled=v(_)===v(i).id,N(a,v(_)===v(i).id?`Running…`:`Run now`)}),B(`click`,n,()=>Cn(v(i))),B(`click`,r,()=>Dn(v(i))),d(e,t)},g=M(()=>we(v(m),!!v(c),v(S)));t(f,e=>{v(g)&&e(p)});var C=h(f,2),w=x(C,!0),T=h(C,2),E=h(T,2),D=e=>{var t=qi();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>ht(v(i))),d(e,t)};t(E,e=>{v(i).shell||e(D)});var O=h(E,2),A=h(O,2);k(u),k(l),k(n),o(()=>{C.disabled=v(_)===v(i).id,N(w,v(i).enabled?`Pause`:`Resume`),T.disabled=v(_)===v(i).id,O.disabled=v(_)===v(i).id,A.disabled=v(_)===v(i).id}),B(`click`,C,()=>On(v(i))),B(`click`,T,()=>Tt(v(i))),B(`click`,O,()=>sn(v(i))),B(`click`,A,()=>kn(v(i))),d(e,n)},ee=M(()=>!!v(c)),te=M(()=>v(s)||!!v(i).awaiting_yes),I=M(()=>be(v(i))),L=M(()=>xe(v(i))),ne=M(()=>v(i).rendered===!0);Ie(e,{get title(){return v(i).title},get state(){return v(m)},get hasForm(){return v(ee)},get cols(){return v(l).cols},get rows(){return v(l).rows},get preview(){return v(te)},get footerText(){return v(I)},get interpretation(){return v(L)},get reason(){return v(g)},get rendered(){return v(ne)},get notice(){return v(S)},get fit(){return v(w)},chips:T,below:E,actions:P,children:(e,a)=>{var l=Ca(),m=y(l),g=e=>{var t=Yi(),n=b(t);ue(n,{kind:``,children:(e,t)=>{D();var n=u();o(()=>N(n,v(i).born===`flow`||v(i).born===`recipe`?`Preview — real data, not updating yet`:`Preview — sample data`)),d(e,n)},$$slots:{default:!0}}),k(t),d(e,t)};t(m,e=>{v(s)&&!v(i).flow&&e(g)});var C=h(m,2),w=e=>{var a=f(),s=y(a),c=e=>{let a=M(()=>yi(v(i).flow.error??``)),s=M(()=>v(i).flow.question?.kind===`model_consent`?v(i).flow.question:null);var c=aa(),l=y(c),u=x(l,!0),f=h(l,2),p=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(i).flow.reason??v(a)??`Creation didn’t finish.`)),d(e,t)};t(f,e=>{v(s)||e(p)});var m=h(f,2),g=e=>{var n=Qi(),r=y(n),a=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(s).prompt)),d(e,t)};t(r,e=>{v(s).prompt&&e(a)});var c=h(r,2),l=b(c),u=x(l),f=h(l,2),p=e=>{var t=Zi();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>xt(v(i),`local`)),d(e,t)};t(f,e=>{v(s).local&&e(p)}),k(c),o(()=>{l.disabled=v(_)===v(i).id,N(u,`Build with ${v(s).model??``}`)}),B(`click`,l,()=>xt(v(i),`allow`)),d(e,n)};t(m,e=>{v(s)&&e(g)});var S=h(m,2),C=e=>{var r=$i(),a=y(r),s=e=>{var t=Xi(),n=x(t,!0);o(()=>N(n,v(i).flow.question.prompt)),d(e,t)};t(a,e=>{v(i).flow.question.prompt&&e(s)});var c=h(a,2),l=b(c);j(l);var u=h(l,2);k(c),o(()=>{l.disabled=v(_)===v(i).id,u.disabled=v(_)===v(i).id||!v(_t)}),n(`submit`,c,e=>{e.preventDefault(),bt(v(i))}),F(l,()=>v(_t),e=>O(_t,e)),d(e,r)};t(S,e=>{v(i).flow.question?.kind===`supply_date`&&e(C)});var w=h(S,2),T=e=>{var n=ra(),r=b(n),a=e=>{var t=ea(),n=y(t),r=h(n,2);o(()=>{n.disabled=v(_)===v(i).id,r.disabled=v(_)===v(i).id}),B(`click`,n,()=>wt(v(i))),B(`click`,r,()=>ht(v(i))),d(e,t)};t(r,e=>{v(i).shell||e(a)});var s=h(r,2),c=e=>{var t=ta(),n=x(t,!0);o(()=>{t.disabled=v(_)===v(i).id,N(n,v(_)===v(i).id?`Retrying…`:`Retry`)}),B(`click`,t,()=>Nt(v(i))),d(e,t)},l=M(()=>v(i).shell&&v(i).flow.reopen?.includes(`retry`));t(s,e=>{v(l)&&e(c)});var u=h(s,2),f=e=>{var t=na();o(()=>t.disabled=v(_)===v(i).id),B(`click`,t,()=>St(v(i))),d(e,t)},p=M(()=>v(i).shell&&v(i).flow.reopen?.includes(`pick_source`));t(u,e=>{v(p)&&e(f)}),k(n),d(e,n)};t(w,e=>{v(s)||e(T)});var E=h(w,2),D=e=>{var t=ia(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(E,e=>{v(Q)[v(i).id]&&e(D)}),o(()=>{r(l,1,z(v(s)?`ni-note-head`:`ni-status-fail ni-note-head`),`svelte-7uuxge`),N(u,v(s)?`Build with a model outside this computer?`:v(i).flow.state===`unsupported`?`Can’t build this card yet`:`Setup failed`)}),d(e,c)},l=e=>{var t=oa();d(e,t)},m=e=>{let r=M(()=>Ci(v(i).flow.suggestions)),a=M(()=>Rr(v(i).flow));var s=ha(),c=b(s),l=x(c,!0),u=h(c,2),f=e=>{var n=da();p(n,21,()=>v(r).sources,e=>e.url,(e,n)=>{var r=ua(),a=b(r),s=x(a,!0),c=h(a,2),l=e=>{var t=sa(),r=x(t,!0);o(e=>N(r,e),[()=>v(n).evidence.join(` — `)]),d(e,t)};t(c,e=>{v(n).evidence&&v(n).evidence.length>0&&e(l)});var u=h(c,2),f=e=>{var t=ca();d(e,t)},p=M(()=>v(n).needs?.includes(`key`));t(u,e=>{v(p)&&e(f)});var m=h(u,2),g=e=>{var t=la();d(e,t)},y=M(()=>v(n).needs?.includes(`contact`));t(m,e=>{v(y)&&e(g)}),k(r),o(()=>{a.disabled=v(_)===v(i).id,A(a,`title`,v(n).url),N(s,v(n).title)}),B(`click`,a,()=>vt(v(i),v(n).url)),d(e,r)}),k(n),d(e,n)};t(u,e=>{v(r).sources.length>0&&e(f)});var m=h(u,2),g=e=>{var t=pa(),n=h(y(t),2);p(n,21,()=>v(r).links,e=>e.url,(e,t)=>{var n=fa(),r=b(n),i=b(r);se(i,{name:`link`,size:14});var a=h(i);k(r);var s=h(r,2),c=x(s,!0);k(n),o(e=>{A(r,`href`,v(t).url),N(a,` ${(v(t).title||v(t).host)??``}`),N(c,e)},[()=>wi(v(t))]),d(e,n)}),k(n),d(e,t)};t(m,e=>{v(r).links.length>0&&e(g)});var S=h(m,2),C=b(S);j(C);var w=h(C,2),T=e=>{var t=ma(),n=x(t,!0);o(()=>N(n,v(a))),d(e,t)};t(w,e=>{v(a)&&e(T)});var E=h(w,2);k(S);var D=h(S,2),P=e=>{var t=ia(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(D,e=>{v(Q)[v(i).id]&&e(P)}),k(s),o(e=>{N(l,v(r).heading),A(C,`placeholder`,v(r).links.length>0?`Found the data? Paste its link (https://…)`:`Or paste any web page or API URL (https://…)`),C.disabled=v(_)===v(i).id,E.disabled=e},[()=>v(_)===v(i).id||v(it).trim().length<8]),n(`submit`,S,e=>{e.preventDefault(),vt(v(i))}),F(C,()=>v(it),e=>O(it,e)),d(e,s)},g=e=>{let r=M(()=>v(i).flow.access);var a=ba(),s=b(a),c=e=>{var n=_a(),a=y(n),s=b(a),c=h(s),l=e=>{var t=ga(),n=y(t);D(),o(()=>A(n,`href`,v(r).key.docs_url)),d(e,t)},f=e=>{var t=u();o(()=>N(t,`Get one from ${(v(r).provider||v(r).host)??``}, then paste it below.`)),d(e,t)};t(c,e=>{v(r).key.docs_url?e(l):e(f,-1)});var p=h(c);k(a);var m=h(a,2);j(m),o(()=>{N(s,`${(v(r).provider||v(r).host)??``} needs your own free key. `),N(p,` SmartBrain sends it only to ${v(r).host??``}, over a secure connection.`),A(m,`placeholder`,`Your ${(v(r).provider||v(r).host)??``} key`),m.disabled=v(_)===v(i).id,A(m,`aria-label`,`Your key for ${v(r).host??``}`)}),F(m,()=>v(at),e=>O(at,e)),d(e,n)};t(s,e=>{v(r).key&&e(c)});var l=h(s,2),f=e=>{var t=va(),n=y(t),a=x(n),s=h(n,2);j(s),o(()=>{N(a,`${(v(r).provider||v(r).host)??``} asks automated requests for a contact - email. SmartBrain sends yours only to sources with this rule, and asks once.`),s.disabled=v(_)===v(i).id}),F(s,()=>v(ot),e=>O(ot,e)),d(e,t)};t(l,e=>{v(r).contact&&e(f)});var p=h(l,2),m=x(p,!0),g=h(p,2),S=e=>{var t=ya(),n=x(t,!0);o(()=>N(n,v(Q)[v(i).id])),d(e,t)};t(g,e=>{v(Q)[v(i).id]&&e(S)}),k(a),o(e=>{p.disabled=e,N(m,v(_)===v(i).id?`Saving…`:`Continue`)},[()=>v(_)===v(i).id||!!v(r).key&&v(at).trim().length===0||v(r).contact&&v(ot).trim().length<6]),n(`submit`,a,e=>{e.preventDefault(),yt(v(i))}),d(e,a)},S=e=>{var t=ma(),n=x(t,!0);o(e=>N(n,e),[()=>bi(v(i).flow)]),d(e,t)};t(s,e=>{v(i).flow.state===`failed`||v(i).flow.state===`unsupported`?e(c):v(i).flow.state===`source`&&v(i).flow.suggestions===void 0?e(l,1):v(i).flow.state===`source`?e(m,2):v(i).flow.state===`awaiting_access`&&v(i).flow.access?e(g,3):e(S,-1)}),d(e,a)},T=e=>{var n=f(),r=y(n),a=e=>{},o=M(()=>Ce(v(i),!!v(c))),s=e=>{Sn(e,{get clir(){return v(c)},get viewerTz(){return Bn}})},l=e=>{Ar(e,{get node(){return v(i).payload}})};t(r,e=>{v(o)?e(a):v(c)?e(s,1):e(l,-1)}),d(e,n)},E=e=>{let n=M(()=>hn(v(i)));var r=f(),a=y(r),s=e=>{var t=xa(),r=h(b(t)),i=x(r),a=h(r);k(t),o(()=>{N(i,`${v(n).friendly??``} (${v(n).raw??``})`),N(a,`, - ${v(n).attempts??``} attempt${v(n).attempts===1?``:`s`} · last tried ${v(n).tried??``}`)}),d(e,t)},c=e=>{var t=Sa();d(e,t)};t(a,e=>{v(n).show?e(s):v(S)||e(c,1)}),d(e,r)};t(C,e=>{v(i).flow?e(w):v(i).payload?e(T,1):e(E,-1)}),d(e,l)},$$slots:{chips:!0,below:!0,actions:!0,default:!0}})}}),k(i),d(e,i)};t(R,e=>{v(m)?v(s).length===0?e(V,1):e(H,-1):e(re)});var ce=h(R,2),U=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(g))),d(e,t)};t(ce,e=>{v(g)&&e(U)});var W=h(ce,2),ve=e=>{le(e,{open:!0,label:`Refine this card`,onclose:()=>{O(ft,null),O(pt,``)},children:(e,t)=>{var n=Ea(),r=h(y(n),4);C(r);var i=h(r,2),a=b(i),s=h(a,2),c=x(s,!0);k(i),o(e=>{r.disabled=v(mt),s.disabled=e,N(c,v(mt)?`Sending…`:`Rebuild`)},[()=>v(mt)||v(pt).trim().length<3]),F(r,()=>v(pt),e=>O(pt,e)),B(`click`,a,()=>{O(ft,null),O(pt,``)}),B(`click`,s,()=>void gt()),d(e,n)},$$slots:{default:!0}})};t(W,e=>{v(ft)&&e(ve)});var J=h(W,2),Ct=e=>{le(e,{open:!0,label:`What went wrong?`,onclose:()=>{O(oe,null),O(me,``)},children:(e,t)=>{var n=Da(),r=h(y(n),4);C(r);var i=h(r,2),a=b(i),s=h(a,2),c=x(s,!0);k(i),o(()=>{a.disabled=v(S),s.disabled=v(S),N(c,v(S)?`Sending…`:`Send`)}),F(r,()=>v(me),e=>O(me,e)),B(`click`,a,()=>{O(oe,null),O(me,``)}),B(`click`,s,In),d(e,n)},$$slots:{default:!0}})};t(J,e=>{v(oe)&&e(Ct)});var Ft=h(J,2),qt=e=>{le(e,{open:!0,alert:!0,label:`Apply library update?`,onclose:()=>{v(Ve)||O(ze,null)},children:(e,t)=>{var n=Oa(),r=h(y(n),2),i=h(b(r)),a=x(i);D(),k(r);var s=h(r,2),c=b(s),l=h(c,2),u=x(l,!0);k(s),o(()=>{N(a,`“${v(ze).title??``}”`),c.disabled=v(Ve),l.disabled=v(Ve),N(u,v(Ve)?`Applying…`:`Apply update`)}),B(`click`,c,()=>{O(ze,null)}),B(`click`,l,an),d(e,n)},$$slots:{default:!0}})};t(Ft,e=>{v(ze)&&e(qt)});var Jt=h(Ft,2),on=e=>{le(e,{open:!0,size:`md`,label:`A proposed fix from Claude`,onclose:()=>{v(Ge)||dn()},children:(e,n)=>{var r=ja(),i=h(y(r),4),a=e=>{de(e,{block:!0})},s=e=>{var t=ka();d(e,t)},c=e=>{var t=Aa(),n=b(t),r=h(b(n),4),i=x(r,!0),a=h(r,4),s=x(a,!0);k(n);var c=h(n,2),l=h(b(c),4),u=x(l,!0),f=h(l,4),p=x(f,!0);k(c),k(t),o((e,t,n,r)=>{N(i,e),N(s,t),N(u,n),N(p,r)},[()=>Mi(v(Ke).extract),()=>Mi(v(Ke).transform),()=>Mi(v(qe).extract),()=>Mi(v(qe).transform)]),d(e,t)};t(i,e=>{v(We)?e(a):v(Ue)?e(c,-1):e(s,1)});var l=h(i,2),u=b(l),f=h(u,2),p=h(f,2),m=x(p,!0);k(l),o(()=>{u.disabled=v(Ge),f.disabled=v(Ge)||v(We)||!v(Ue),p.disabled=v(Ge)||v(We)||!v(Ue),N(m,v(Ge)?`Applying…`:`Apply`)}),B(`click`,u,dn),B(`click`,f,pn),B(`click`,p,fn),d(e,r)},$$slots:{default:!0}})};t(Jt,e=>{v(He)&&e(on)});var mn=h(Jt,2),$=e=>{le(e,{open:!0,label:`Repair settings`,onclose:()=>{v(Ze)||cn()},children:(e,n)=>{var r=Pa(),i=y(r),a=x(i),s=h(i,2),c=e=>{de(e,{block:!0})},l=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Qe)||`Couldn’t load this card.`)),d(e,t)},u=e=>{var n=Na(),r=h(y(n),2),i=b(r);j(i),D(2),k(r);var a=h(r,2),s=b(a);j(s),D(2),k(a);var c=h(a,2),l=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(Qe))),d(e,t)};t(c,e=>{v(Qe)&&e(l)}),o(()=>{i.disabled=v(Ze),s.disabled=v(Ze)}),E(i,()=>v($e),e=>O($e,e)),E(s,()=>v(et),e=>O(et,e)),d(e,n)};t(s,e=>{v(Xe)?e(c):v(Ye)?e(u,-1):e(l,1)});var f=h(s,2),p=b(f),m=h(p,2),g=x(m,!0);k(f),o(()=>{N(a,`Repair settings — “${v(Je).title??``}”`),p.disabled=v(Ze),m.disabled=v(Ze)||v(Xe)||!v(Ye),N(g,v(Ze)?`Saving…`:`Save`)}),B(`click`,p,cn),B(`click`,m,ln),d(e,r)},$$slots:{default:!0}})};t(mn,e=>{v(Je)&&e($)});var Tn=h(mn,2),Ln=e=>{le(e,{open:!0,label:`Add key`,onclose:()=>{v(Z)||_n()},children:(e,n)=>{var r=Ia(),i=y(r),a=x(i),s=h(i,4),c=e=>{de(e,{block:!0})},l=e=>{var n=Fa(),r=y(n),i=b(r),a=x(i,!0),s=h(i,2);j(s),k(r);var c=h(r,2),l=h(b(c),2);j(l),k(c);var u=h(c,2),f=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(rt))),d(e,t)};t(u,e=>{v(rt)&&e(f)}),o(()=>{N(a,v(tt)),s.disabled=v(Z),l.disabled=v(Z)}),F(s,()=>v(Y),e=>O(Y,e)),F(l,()=>v(X),e=>O(X,e)),d(e,n)};t(s,e=>{v(nt)?e(c):e(l,-1)});var u=h(s,2),f=b(u),p=h(f,2),m=x(p,!0);k(u),o(e=>{N(a,`Add key — ${v(tt)??``}`),f.disabled=v(Z),p.disabled=e,N(m,v(Z)?`Saving…`:`Save`)},[()=>v(Z)||v(nt)||!v(Y)||!v(X).trim()]),B(`click`,f,_n),B(`click`,p,vn),d(e,r)},$$slots:{default:!0}})};t(Tn,e=>{v(q)&&e(Ln)});var Rn=h(Tn,2),zn=e=>{le(e,{open:!0,label:`Fill in`,onclose:()=>{v(Rt)||bn()},children:(e,n)=>{var r=La(),i=y(r),a=x(i),s=h(i,4),c=b(s),l=x(c,!0),u=h(c,2);j(u),k(s);var f=h(s,2),p=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(zt))),d(e,t)};t(f,e=>{v(zt)&&e(p)});var m=h(f,2),g=b(m),_=h(g,2),S=x(_,!0);k(m),o(e=>{N(a,`Fill in — ${v(It)??``}`),N(l,v(It)),u.disabled=v(Rt),g.disabled=v(Rt),_.disabled=e,N(S,v(Rt)?`Saving…`:`Save`)},[()=>v(Rt)||!v(Lt).trim()]),F(u,()=>v(Lt),e=>O(Lt,e)),B(`click`,g,bn),B(`click`,_,xn),d(e,r)},$$slots:{default:!0}})};t(Rn,e=>{v(Pt)&&e(zn)});var Hn=h(Rn,2),Un=e=>{le(e,{open:!0,label:`Edit card`,onclose:()=>{v(ut)||Et()},children:(e,n)=>{var r=Ra(),i=y(r),a=x(i),s=h(i,2),c=h(b(s),2);j(c),k(s);var l=h(s,2),u=h(b(l),2);j(u),k(l);var f=h(l,2),p=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(dt))),d(e,t)};t(f,e=>{v(dt)&&e(p)});var m=h(f,2),g=b(m),_=h(g,2),S=x(_,!0);k(m),o(()=>{N(a,`Edit — ${v(st).title??``}`),c.disabled=v(ut),u.disabled=v(ut),g.disabled=v(ut),_.disabled=v(ut),N(S,v(ut)?`Saving…`:`Save`)}),F(c,()=>v(ct),e=>O(ct,e)),F(u,()=>v(lt),e=>O(lt,e)),B(`click`,g,Et),B(`click`,_,Dt),d(e,r)},$$slots:{default:!0}})};t(Hn,e=>{v(st)&&e(Un)});var Wn=h(Hn,2),Gn=e=>{le(e,{open:!0,label:`Run history`,onclose:wn,children:(e,n)=>{var r=Ua(),i=y(r),a=x(i),s=h(i,2),c=e=>{de(e,{block:!0})},l=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ut))),d(e,t)},u=e=>{var t=za();d(e,t)},f=e=>{var n=Ha();p(n,21,()=>v(Vt).runs,P,(e,n)=>{let r=M(()=>yi(v(n).error));var i=Va(),a=b(i),s=x(a,!0),c=h(a,2),l=x(c,!0),u=h(c,2),f=e=>{var t=Ba(),n=x(t);o(()=>N(n,`— ${v(r)??``}`)),d(e,t)};t(u,e=>{v(r)&&e(f)}),k(i),o((e,t)=>{N(s,e),N(l,t)},[()=>_e(v(n).ts),()=>pe(v(n).status)]),d(e,i)}),k(n),d(e,n)};t(s,e=>{v(Ht)?e(c):v(Ut)&&!v(Vt)?e(l,1):!v(Vt)||v(Vt).runs.length===0?e(u,2):e(f,-1)});var m=h(s,2),g=x(m);o(()=>N(a,`Recent runs — “${v(Bt).title??``}”`)),B(`click`,g,wn),d(e,r)},$$slots:{default:!0}})};t(Wn,e=>{v(Bt)&&e(Gn)});var Kn=h(Wn,2),qn=e=>{le(e,{open:!0,size:`lg`,label:`Global Library`,onclose:()=>{!v(K)&&!v(Me)&&Yt()},children:(e,n)=>{var r=so(),i=h(y(r),2),a=e=>{de(e,{block:!0})},s=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ee)||`Couldn't load the library.`)),d(e,t)},c=e=>{var n=Wa(),r=h(b(n),2),i=b(r),a=h(b(i),2),s=x(a,!0);k(i);var c=h(i,2),l=h(b(c),2),u=x(l,!0);k(c),k(r);var f=h(r,6),p=b(f);j(p);var m=h(p,2),g=x(m,!0);k(f);var _=h(f,2),y=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(Re))),d(e,t)};t(_,e=>{v(Re)&&e(y)}),k(n),o(()=>{N(s,v(G).fingerprint??`(unknown)`),N(u,v(G).blocked.offered_fingerprint),m.disabled=v(Le)||!v(Fe),N(g,v(Le)?`Pinning…`:`Trust new key`)}),B(`keydown`,p,e=>e.key===`Enter`&&v(Fe)&&$t()),F(p,()=>v(Fe),e=>O(Fe,e)),B(`click`,m,$t),d(e,n)},l=e=>{var n=Ga(),r=h(y(n),4),i=b(r);j(i),A(i,`placeholder`,he);var a=h(i,2),s=x(a,!0);k(r);var c=h(r,2),l=e=>{var t=Ni(),n=x(t,!0);o(()=>N(n,v(Ee))),d(e,t)};t(c,e=>{v(Ee)&&e(l)}),o(e=>{a.disabled=e,N(s,v(K)?`Connecting…`:`Connect`)},[()=>v(K)||!v(De).trim()]),B(`keydown`,i,e=>e.key===`Enter`&&!v(K)&&Xt()),F(i,()=>v(De),e=>O(De,e)),B(`click`,a,Xt),d(e,n)},m=e=>{let n=M(()=>v(Ae));var r=Xa(),i=y(r),a=b(i),s=h(a,2),c=x(s,!0);k(i);var l=h(i,2),u=x(l,!0),m=h(l,4);p(m,21,()=>v(n).sources,P,(e,t)=>{var n=Ka(),r=b(n),i=x(r,!0);k(n),o(()=>N(i,v(t).host?`${v(t).host}${v(t).path}`:v(t).type===`internal.kb`?`your knowledge base (no network)`:v(t).type===`model`?`generated by your local model (no fetch)`:v(t).type)),d(e,n)}),k(m);var g=h(m,2),_=e=>{var r=Ya(),i=h(y(r),2);p(i,21,()=>v(n).params,e=>e.name,(e,n)=>{var r=f(),i=y(r),a=e=>{var t=qa(),r=b(t),i=x(r,!0);D(2),k(t),o(()=>N(i,v(n).label)),d(e,t)},s=e=>{var t=Ja(),r=b(t),i=x(r,!0),a=h(r,2);j(a),k(t),o(()=>{N(i,v(n).label),A(a,`type`,v(n).kind===`number`?`number`:`text`),A(a,`placeholder`,v(n).label)}),F(a,()=>v(je)[v(n).name],e=>v(je)[v(n).name]=e),d(e,t)};t(i,e=>{v(n).kind===`secret`?e(a):e(s,-1)}),d(e,r)}),k(i),d(e,r)};t(g,e=>{v(n).params.length>0&&e(_)});var S=h(g,2),C=h(b(S),2),w=e=>{let t=M(()=>Vn(v(n).preview_payload));Sn(e,{get clir(){return v(t)},get viewerTz(){return Bn}})},T=M(()=>Vn(v(n).preview_payload)),E=e=>{Ar(e,{get node(){return v(n).preview_payload}})};t(C,e=>{v(T)?e(w):e(E,-1)}),k(S);var O=h(S,2),ee=e=>{var t=Ma(),n=x(t,!0);o(()=>N(n,v(Ne))),d(e,t)};t(O,e=>{v(Ne)&&e(ee)});var te=h(O,2),I=b(te),L=h(I,2),ne=x(L,!0);k(te),o(()=>{N(c,v(n).title),N(u,v(n).goal),I.disabled=v(Me),L.disabled=v(Me)||!!v(Kt),N(ne,v(Me)?`Installing…`:`Install as draft`)}),B(`click`,a,tn),B(`click`,I,tn),B(`click`,L,nn),d(e,r)},g=e=>{var n=oo(),r=y(n),i=b(r),a=x(i,!0),s=h(i,2),c=e=>{ue(e,{kind:``,children:(e,t)=>{D();var n=u();o(()=>N(n,`v${v(G).seq??``}`)),d(e,n)},$$slots:{default:!0}})};t(s,e=>{v(G).seq!==void 0&&e(c)});var l=h(s,2),f=e=>{var t=Za(),n=x(t);o(e=>N(n,`Last checked ${e??``}`),[()=>_e(v(G).last_checked)]),d(e,t)};t(l,e=>{v(G).last_checked&&e(f)});var m=h(l,4),g=x(m,!0),_=h(m,2);k(r);var S=h(r,2),C=e=>{var t=Qa(),n=x(t,!0);o(()=>N(n,v(Pe))),d(e,t)};t(S,e=>{v(Pe)&&e(C)});var T=h(S,2),E=e=>{var t=Ta(),n=x(t,!0);o(()=>N(n,v(Ee))),d(e,t)};t(T,e=>{v(Ee)&&e(E)});var ee=h(T,2),te=e=>{var t=Ta(),n=x(t);o(()=>N(n,`Last check failed: ${v(G).last_error??``}`)),d(e,t)},I=e=>{var t=$a();d(e,t)};t(ee,e=>{v(G).last_error?e(te):v(G).unreachable&&e(I,1)});var L=h(ee,2),ne=b(L);j(ne);var R=h(ne,2),re=e=>{var t=to(),n=b(t);n.value=n.__value=``;var r=h(n);p(r,16,()=>v(Gt),e=>e,(e,t)=>{var n=eo(),r=x(n,!0),i={};o(()=>{N(r,t),i!==(i=t)&&(n.value=(n.__value=i)??``)}),d(e,n)}),k(t),w(t),ie(t,()=>v(ke),e=>O(ke,e)),d(e,t)};t(R,e=>{v(Gt).length>0&&e(re)}),k(L);var z=h(L,2),ae=e=>{fe(e,{icon:`monitor`,title:`No templates yet`,body:`The library is connected but empty right now — try Check now.`})},V=e=>{var t=no();d(e,t)},H=e=>{var n=ao();p(n,21,()=>v(Wt),e=>e.id,(e,n)=>{var r=io(),i=b(r),a=b(i),s=x(a,!0),c=h(a,2);ue(c,{kind:``,children:(e,t)=>{D();var r=u();o(()=>N(r,v(n).category)),d(e,r)},$$slots:{default:!0}}),k(i);var l=h(i,2),f=x(l,!0),m=h(l,4);p(m,21,()=>v(n).sources,P,(e,t)=>{var n=Ka(),r=b(n),i=x(r,!0);k(n),o(()=>N(i,v(t).host?`${v(t).host}${v(t).path}`:v(t).type===`internal.kb`?`your knowledge base (no network)`:v(t).type===`model`?`generated by your local model (no fetch)`:v(t).type)),d(e,n)}),k(m);var g=h(m,2),_=e=>{var t=ro(),r=x(t,!0);o(()=>N(r,v(n).notes)),d(e,t)};t(g,e=>{v(n).notes&&e(_)});var y=h(g,2),S=b(y),C=e=>{let t=M(()=>Vn(v(n).preview_payload));Sn(e,{get clir(){return v(t)},get viewerTz(){return Bn}})},w=M(()=>Vn(v(n).preview_payload)),T=e=>{Ar(e,{get node(){return v(n).preview_payload}})};t(S,e=>{v(w)?e(C):e(T,-1)}),k(y);var E=h(y,2),O=x(E);k(r),o(()=>{N(s,v(n).title),N(f,v(n).goal)}),B(`click`,O,()=>en(v(n))),d(e,r)}),k(n),d(e,n)};t(z,e=>{(v(G).templates??[]).length===0?e(ae):v(Wt).length===0?e(V,1):e(H,-1)}),o(e=>{A(i,`title`,v(G).url??``),N(a,e),m.disabled=v(K),N(g,v(K)?`Checking…`:`Check now`),_.disabled=v(K)},[()=>ki(v(G).fingerprint)]),B(`click`,m,Zt),B(`click`,_,Qt),F(ne,()=>v(Oe),e=>O(Oe,e)),d(e,n)};t(i,e=>{v(Te)?e(a):v(G)?v(G).blocked?e(c,2):v(G).connected?v(Ae)?e(m,4):e(g,-1):e(l,3):e(s,1)});var _=h(i,2),S=x(_);o(()=>S.disabled=v(K)||v(Me)),B(`click`,S,Yt),d(e,r)},$$slots:{default:!0}})};t(Kn,e=>{v(ge)&&e(qn)}),o(e=>{T.disabled=v(kt),te.disabled=e,N(I,v(kt)?`Starting…`:`Create card`)},[()=>v(kt)||v(Ot).trim().length<3]),B(`click`,c,()=>ae(`/ni/library`)),n(`submit`,l,e=>{e.preventDefault(),Mt()}),F(T,()=>v(Ot),e=>O(Ot,e)),d(e,i)},Gn=e=>{de(e,{block:!0})};t(Un,e=>{H.status?.unlocked?e(Wn):e(Gn,-1)}),d(i,Hn),ne()}g([`click`,`keydown`]);export{lo as component}; \ No newline at end of file diff --git a/app/smartbrain_3000/web/_app/immutable/nodes/11.BQRO1JQZ.js b/app/smartbrain_3000/web/_app/immutable/nodes/11.SjX2dPtJ.js similarity index 97% rename from app/smartbrain_3000/web/_app/immutable/nodes/11.BQRO1JQZ.js rename to app/smartbrain_3000/web/_app/immutable/nodes/11.SjX2dPtJ.js index a7ced232..57120a92 100644 --- a/app/smartbrain_3000/web/_app/immutable/nodes/11.BQRO1JQZ.js +++ b/app/smartbrain_3000/web/_app/immutable/nodes/11.SjX2dPtJ.js @@ -1,4 +1,4 @@ -import{$ as e,A as t,B as n,C as r,E as i,G as a,L as o,M as s,O as c,P as l,Q as u,R as d,V as f,X as p,Y as m,Z as h,a as g,b as _,ct as v,d as y,dt as b,et as x,ft as S,g as C,h as w,it as T,j as E,k as ee,m as D,pt as O,r as k,st as A,tt as j,y as te,z as M}from"../chunks/BJLLtWYH.js";import{t as N}from"../chunks/BxvjB08B.js";import"../chunks/xihTtKlq.js";import"../chunks/Cmegxfzj.js";import{n as P}from"../chunks/CoHYJ8BJ.js";import{t as F}from"../chunks/y2R953fa.js";import{t as ne}from"../chunks/CEPrmzat.js";import{t as re}from"../chunks/CwtHPkdz.js";import{t as ie}from"../chunks/BqUz5g-m.js";import{n as ae}from"../chunks/uFPkKLC1.js";import{t as I}from"../chunks/kqW19h2g.js";import{t as L}from"../chunks/1gl_kuJz.js";import{t as R}from"../chunks/DKVRJME0.js";import{t as oe}from"../chunks/DV4tMnTy.js";var z=l(`

                            `),B=l(`

                            `),V=l(`
                            `);function H(e,n){let r=g(n,`hint`,3,``),o=g(n,`error`,3,``);var c=V(),l=m(c),d=m(l),f=h(d,!0),p=u(d,2);i(p,()=>n.children??O),S(l);var _=u(l,2),v=e=>{var t=z(),n=h(t,!0);a(()=>E(n,o())),s(e,t)},y=e=>{var t=B(),n=h(t,!0);a(()=>E(n,r())),s(e,t)};t(_,e=>{o()?e(v):r()&&e(y,1)}),S(c),a(()=>E(f,n.label)),s(e,c)}var se=[{id:``,label:`All`},{id:`curated`,label:`Curated`},{id:`harvested`,label:`Harvested`},{id:`local`,label:`Mine`}],U={http_json:`JSON`,http_csv:`CSV`,http_xml:`XML`,rss:`RSS feed`,atom:`Atom feed`,gtfs:`Transit schedule (GTFS)`,gtfs_rt:`Transit realtime (GTFS-RT)`,gbfs:`Bike share (GBFS)`,ics:`Calendar (ICS)`,html:`Web page`,image:`Image`,text:`Text`},W={official:`Official`,primary:`Primary`,aggregator:`Aggregator`,community:`Community`},G={curated:`Curated`,provider_trusted:`Provider-trusted`,harvested:`Harvested`,local:`Yours`};function ce(e,t){return console.assert(typeof e==`string`,`statusLabel: status is string`),console.assert(typeof t==`string`,`statusLabel: auth is string`),e===`ok`?`Works`:e===`degraded`?`Degraded`:e===`failed`||e===`refused`?`Not working`:t===`none`?`Unchecked`:`Needs a key`}function le(e,t){return console.assert(typeof e==`string`,`statusChipKind: status is string`),console.assert(typeof t==`string`,`statusChipKind: auth is string`),e===`ok`?`ok`:e===`degraded`?`warn`:e===`failed`||e===`refused`?`danger`:``}function ue(e){return console.assert(typeof e==`string`,`authorityLabel: input is string`),console.assert(e in W,`authorityLabel: known enum`),W[e]??`Unknown`}function de(e){return console.assert(typeof e==`string`,`tierLabel: input is string`),console.assert(e in G,`tierLabel: known enum`),G[e]??e}function fe(e){return console.assert(typeof e==`string`,`accessKindLabel: input is string`),console.assert(e in U,`accessKindLabel: known enum`),U[e]??e}function pe(){console.assert(typeof U==`object`,`accessKindOptions: labels present`);let e=Object.keys(U);return console.assert(e.length>0,`accessKindOptions: at least one kind`),e.map(e=>({id:e,label:U[e]}))}var K={public_domain:`Public domain`,open_license:`Open license`,terms_allow:`Terms allow use`,unverified:`Terms not confirmed`};function me(e){return console.assert(typeof e==`string`,`termsLabel: input is string`),console.assert(!0,`termsLabel: total`),K[e]??e}function he(e,t){console.assert(typeof e==`string`,`labelCategory: id is string`),console.assert(Array.isArray(t),`labelCategory: tax is array`);let[n,r]=e.split(`/`),i=t.find(e=>e.id===n);if(!i)return e;let a=r?i.subcategories.find(e=>e.id===r):null;return r&&a?`${i.label} › ${a.label}`:i.label}function ge(e){console.assert(typeof e==`object`,`buildSearchQuery: opts is object`),console.assert(e.limit>0,`buildSearchQuery: limit is positive`);let t={offset:e.offset,limit:e.limit},n=e.q.trim();return n&&(t.q=n),e.category&&(t.category=e.category),e.subcategory&&(t.subcategory=e.subcategory),e.tier&&(t.tier=e.tier),t}function q(e){return console.assert(e==null||typeof e==`number`,`formatCount: number|null|undefined`),console.assert(!0,`formatCount: total`),typeof e!=`number`||!Number.isFinite(e)||e<0?`0`:Math.floor(e).toLocaleString(`en-US`)}function _e(e){console.assert(typeof e==`object`,`validateLocalForm: input is object`),console.assert(typeof e.name==`string`,`validateLocalForm: name is string`);let t=e.name.trim();if(t.length<2||t.length>120)return{field:`name`,message:`Give the source a name (2–120 characters).`};let n=e.url.trim();if(!n.startsWith(`https://`)||n.length>2e3)return{field:`url`,message:`The address must start with https://`};if(e.description.trim().length>600)return{field:`description`,message:`Keep the description under 600 characters.`};let r=e.category.trim();return!r||!r.includes(`/`)?{field:`category`,message:`Choose a category.`}:null}function ve(e,t){console.assert(typeof e==`object`,`rowCategoryPhrase: row is object`),console.assert(Array.isArray(t),`rowCategoryPhrase: tax is array`);let n=Array.isArray(e.categories)?e.categories:[];return n.length===0?``:n.slice(0,2).map(e=>he(e,t)).join(` · `)}var J={realtime:`Live`,minutes:`Every few minutes`,hourly:`Hourly`,daily:`Daily`,weekly:`Weekly`,monthly:`Monthly`,quarterly:`Every quarter`,annual:`Yearly`,irregular:`Whenever the provider publishes`,static:`Rarely changes`};function ye(e){console.assert(e==null||typeof e==`string`,`cadenceLabel: cadence is a string or empty`);let t=J[(e||`irregular`).trim()]??J.irregular;return console.assert(t.length>0,`cadenceLabel: never empty`),t}function be(e,t){if(console.assert(e==null||typeof e==`string`,`checkedOnLabel: iso is a string`),!e)return``;let n=Date.parse(e);if(Number.isNaN(n))return``;let r=new Intl.DateTimeFormat(t,{month:`short`,day:`numeric`,year:`numeric`}).format(n);return console.assert(r.length>0,`checkedOnLabel: formatted date is non-empty`),r}var xe=l(`

                            `),Se=l(``),Ce=l(`

                            `),we=l(``),Te=l(`

                            Browse the SmartBrain Library

                            About 18 MB. Takes a few seconds on a normal connection.

                            `),Ee=l(``),De=l(`
                            `),Oe=l(`
                            `),ke=l(``),Ae=l(` `),je=l(`
                          • `),Me=l(`

                            Your sources

                              `,1),Ne=l(`

                              Library

                              `),Pe=l(`

                              `),Fe=l(`
                                `,1),Ie=l(` `,1),Le=l(`
                                `),Re=l(`

                                Library

                                `,1),ze=l(`

                                `),Be=l(` `),Ve=l(` `,1),He=l(`
                                What it answers
                                `,1),Ue=l(`· e.g. `,1),We=l(`
                              • `),Ge=l(`
                                Parameters
                                  `,1),Ke=l(` · Read terms`,1),qe=l(`
                                • `),Je=l(`
                                  Example asks
                                    `,1),Ye=l(``),Xe=l(`

                                    Provider
                                    Address
                                    Needs a key
                                    Data format
                                    Terms
                                    How often it updates
                                    Last check
                                    `,1),Ze=l(`

                                    `,1),Qe=l(``),$e=l(``),et=l(``),tt=l(``),nt=l(``),rt=l(``),it=l(``),at=l(`

                                    `),ot=l(`

                                    Add a source