@vheins/local-memory-mcp 0.5.24 → 0.5.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,78 +0,0 @@
1
- (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible;function d(e){return typeof e==`function`}var f=()=>{};function p(e){return e()}function m(e){for(var t=0;t<e.length;t++)e[t]()}function h(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function g(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var _=1024,v=2048,y=4096,b=8192,x=16384,S=32768,C=1<<25,w=65536,T=1<<19,E=1<<20,D=1<<25,ee=65536,te=1<<21,ne=1<<22,re=1<<23,ie=Symbol(`$state`),ae=Symbol(`legacy props`),oe=Symbol(``),se=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ce=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function le(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function ue(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function de(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function fe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function pe(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function me(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function he(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function ge(e){throw Error(`https://svelte.dev/e/lifecycle_legacy_only`)}function _e(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function ve(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function ye(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function be(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function xe(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Se={},Ce=Symbol(),we=`http://www.w3.org/1999/xhtml`,Te=`http://www.w3.org/2000/svg`,Ee=`http://www.w3.org/1998/Math/MathML`;function De(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Oe(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function ke(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var O=!1;function Ae(e){O=e}var k;function je(e){if(e===null)throw De(),Se;return k=e}function Me(){return je(Sn(k))}function A(e){if(O){if(Sn(k)!==null)throw De(),Se;k=e}}function Ne(e=1){if(O){for(var t=e,n=k;t--;)n=Sn(n);k=n}}function Pe(e=!0){for(var t=0,n=k;;){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=Sn(n);e&&n.remove(),n=i}}function Fe(e){if(!e||e.nodeType!==8)throw De(),Se;return e.data}function Ie(e){return e===this.v}function Le(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Re(e){return!Le(e,this.v)}var ze=!1,Be=!1;function Ve(){Be=!0}var He=null;function Ue(e){He=e}function We(e,t=!1,n){He={p:He,i:!1,c:null,e:null,s:e,x:null,r:B,l:Be&&!t?{s:null,u:null,$:[]}:null}}function Ge(e){var t=He,n=t.e;if(n!==null){t.e=null;for(var r of n)zn(r)}return e!==void 0&&(t.x=e),t.i=!0,He=t.p,e??{}}function Ke(){return!Be||He!==null&&He.l===null}var qe=[];function Je(){var e=qe;qe=[],m(e)}function Ye(e){if(qe.length===0&&!bt){var t=qe;queueMicrotask(()=>{t===qe&&Je()})}qe.push(e)}function Xe(){for(;qe.length>0;)Je()}function Ze(e){var t=B;if(t===null)return z.f|=re,e;if(!(t.f&32768)&&!(t.f&4))throw e;Qe(e,t)}function Qe(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var $e=~(v|y|_);function et(e,t){e.f=e.f&$e|t}function tt(e){e.f&512||e.deps===null?et(e,_):et(e,y)}function nt(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=ee,nt(t.deps))}function rt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),nt(e.deps),et(e,_)}function it(e,t,n){if(e==null)return t(void 0),n&&n(void 0),f;let r=H(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}var at=[];function ot(e,t){return{subscribe:j(e,t).subscribe}}function j(e,t=f){let n=null,r=new Set;function i(t){if(Le(e,t)&&(e=t,n)){let t=!at.length;for(let t of r)t[1](),at.push(t,e);if(t){for(let e=0;e<at.length;e+=2)at[e][0](at[e+1]);at.length=0}}}function a(t){i(t(e))}function o(o,s=f){let c=[o,s];return r.add(c),r.size===1&&(n=t(i,a)||f),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:a,subscribe:o}}function st(e,t,n){let r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw Error(`derived() expects stores as input, got a falsy value`);let a=t.length<2;return ot(n,(e,n)=>{let o=!1,s=[],c=0,l=f,u=()=>{if(c)return;l();let i=t(r?s[0]:s,e,n);a?e(i):l=typeof i==`function`?i:f},d=i.map((e,t)=>it(e,e=>{s[t]=e,c&=~(1<<t),o&&u()},()=>{c|=1<<t}));return o=!0,u(),function(){m(d),l(),o=!1}})}function M(e){let t;return it(e,e=>t=e)(),t}var ct=!1,lt=!1,ut=Symbol();function N(e,t,n){let r=n[t]??={store:null,source:on(void 0),unsubscribe:f};if(r.store!==e&&!(ut in n))if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=f;else{var i=!0;r.unsubscribe=it(e,e=>{i?r.source.v=e:sn(r.source,e)}),i=!1}return e&&ut in n?M(e):V(r.source)}function dt(e,t){return pt(e,t),t}function ft(){let e={};function t(){Ln(()=>{for(var t in e)e[t].unsubscribe();i(e,ut,{enumerable:!1,value:!0})})}return[e,t]}function pt(e,t){ct=!0;try{e.set(t)}finally{ct=!1}}function mt(e,t,n){return pt(e,n),t}function ht(e){var t=lt;try{return lt=!1,[e(),lt]}finally{lt=t}}var gt=new Set,P=null,_t=null,vt=null,yt=null,bt=!1,xt=!1,St=null,Ct=null,wt=0,Tt=1,Et=class e{id=Tt++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=new Map;#r=new Map;#i=null;#a=[];#o=[];#s=new Set;#c=new Set;#l=new Map;is_fork=!1;#u=!1;#d=new Set;#f(){return this.is_fork||this.#r.size>0}#p(){for(let n of this.#d)for(let r of n.#r.keys()){for(var e=!1,t=r;t.parent!==null;){if(this.#l.has(t)){e=!0;break}t=t.parent}if(!e)return!0}return!1}skip_effect(e){this.#l.has(e)||this.#l.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#l.get(e);if(t){this.#l.delete(e);for(var n of t.d)et(n,v),this.schedule(n);for(n of t.m)et(n,y),this.schedule(n)}}#m(){if(wt++>1e3&&(gt.delete(this),Ot()),!this.#f()){for(let e of this.#s)this.#c.delete(e),et(e,v),this.schedule(e);for(let e of this.#c)et(e,y),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=St=[],r=[],i=Ct=[];for(let e of t)try{this.#h(e,n,r)}catch(t){throw Ft(e),t}if(P=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(St=null,Ct=null,this.#f()||this.#p()){this.#g(r),this.#g(n);for(let[e,t]of this.#l)Pt(e,t)}else{this.#n.size===0&&gt.delete(this),this.#s.clear(),this.#c.clear();for(let e of this.#e)e(this);this.#e.clear(),_t=this,At(r),At(n),_t=null,this.#i?.resolve()}var o=P;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(gt.add(o),o.#m()),gt.has(this)||this.#_()}#h(e,t,n){e.f^=_;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#l.has(r))&&r.fn!==null){a?r.f^=_:i&4?t.push(r):ze&&i&16777224?n.push(r):Er(r)&&(i&16&&this.#c.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}}}#g(e){for(var t=0;t<e.length;t+=1)rt(e[t],this.#s,this.#c)}capture(e,t,n=!1){t!==Ce&&!this.previous.has(e)&&this.previous.set(e,t),e.f&8388608||(this.current.set(e,[e.v,n]),vt?.set(e,e.v))}activate(){P=this}deactivate(){P=null,vt=null}flush(){try{xt=!0,P=this,this.#m()}finally{wt=0,yt=null,St=null,Ct=null,xt=!1,P=null,vt=null,tn.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),gt.delete(this)}register_created_effect(e){this.#o.push(e)}#_(){for(let l of gt){var e=l.id<this.id,t=[];for(let[r,[i,a]]of this.current){if(l.current.has(r)){var n=l.current.get(r)[0];if(e&&i!==n)l.current.set(r,[i,a]);else continue}t.push(r)}var r=[...l.current.keys()].filter(e=>!this.current.has(e));if(r.length===0)e&&l.discard();else if(t.length>0){l.activate();var i=new Set,a=new Map;for(var o of t)jt(o,r,i,a);a=new Map;var s=[...l.current.keys()].filter(e=>this.current.has(e)?this.current.get(e)[0]!==e:!0);for(let e of this.#o)!(e.f&155648)&&Mt(e,s,a)&&(e.f&4194320?(et(e,v),l.schedule(e)):l.#s.add(e));if(l.#a.length>0){l.apply();for(var c of l.#a)l.#h(c,[],[]);l.#a=[]}l.deactivate()}}for(let e of gt)e.#d.has(this)&&(e.#d.delete(this),e.#d.size===0&&!e.#f()&&(e.activate(),e.#m()))}increment(e,t){let n=this.#n.get(t)??0;if(this.#n.set(t,n+1),e){let e=this.#r.get(t)??0;this.#r.set(t,e+1)}}decrement(e,t,n){let r=this.#n.get(t)??0;if(r===1?this.#n.delete(t):this.#n.set(t,r-1),e){let e=this.#r.get(t)??0;e===1?this.#r.delete(t):this.#r.set(t,e-1)}this.#u||n||(this.#u=!0,Ye(()=>{this.#u=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#s.add(t);for(let e of t)this.#c.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=h()).promise}static ensure(){if(P===null){let t=P=new e;xt||(gt.add(P),bt||Ye(()=>{P===t&&t.flush()}))}return P}apply(){if(!ze||!this.is_fork&&gt.size===1){vt=null;return}vt=new Map;for(let[e,[t]]of this.current)vt.set(e,t);for(let n of gt)if(!(n===this||n.is_fork)){var e=!1,t=!1;if(n.id<this.id)for(let[r,[,i]]of n.current)i||(e||=this.current.has(r),t||=!this.current.has(r));if(e&&t)this.#d.add(n);else for(let[e,t]of n.previous)vt.has(e)||vt.set(e,t)}}schedule(e){if(yt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(St!==null&&t===B&&(ze||(z===null||!(z.f&2))&&!ct))return;if(n&96){if(!(n&1024))return;t.f^=_}}this.#a.push(t)}};function Dt(e){var t=bt;bt=!0;try{var n;for(e&&(P!==null&&!P.is_fork&&P.flush(),n=e());;){if(Xe(),P===null)return n;P.flush()}}finally{bt=t}}function Ot(){try{he()}catch(e){Qe(e,yt)}}var kt=null;function At(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Er(r)&&(kt=new Set,jr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&er(r),kt?.size>0)){tn.clear();for(let e of kt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)kt.has(n)&&(kt.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)}}kt.clear()}}kt=null}}function jt(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?jt(i,t,n,r):e&4194320&&!(e&2048)&&Mt(i,t,r)&&(et(i,v),Nt(i))}}function Mt(e,t,r){let i=r.get(e);if(i!==void 0)return i;if(e.deps!==null)for(let i of e.deps){if(n.call(t,i))return!0;if(i.f&2&&Mt(i,t,r))return r.set(i,!0),!0}return r.set(e,!1),!1}function Nt(e){P.schedule(e)}function Pt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),et(e,_);for(var n=e.first;n!==null;)Pt(n,t),n=n.next}}function Ft(e){et(e,_);for(var t=e.first;t!==null;)Ft(t),t=t.next}function It(e){let t=0,n=rn(0),r;return()=>{In()&&(V(n),Kn(()=>(t===0&&(r=H(()=>e(()=>un(n)))),t+=1,()=>{Ye(()=>{--t,t===0&&(r?.(),r=void 0,un(n))})})))}}var Lt=w|T;function Rt(e,t,n,r){new zt(e,t,n,r)}var zt=class{parent;is_pending=!1;transform_error;#e;#t=O?k: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=It(()=>(this.#m=rn(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=B;t.b=this,t.f|=128,n(e)},this.parent=B.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=qn(()=>{if(O){let e=this.#t;Me();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},Lt),O&&(this.#e=k)}#g(){try{this.#a=Jn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=Jn(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Jn(()=>e(this.#e)),Ye(()=>{var e=this.#c=document.createDocumentFragment(),t=bn();e.append(t),this.#a=this.#x(()=>Jn(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,tr(this.#o,()=>{this.#o=null}),this.#b(P))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Jn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();ar(this.#a,e);let t=this.#n.pending;this.#o=Jn(()=>t(this.#e))}else this.#b(P)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){rt(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=B,n=z,r=He;mr(this.#i),pr(this.#i),Ue(this.#i.ctx);try{return Et.ensure(),e()}catch(e){return Ze(e),null}finally{mr(t),pr(n),Ue(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&tr(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Ye(()=>{this.#d=!1,this.#m&&cn(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),V(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(Qn(this.#a),null),this.#o&&=(Qn(this.#o),null),this.#s&&=(Qn(this.#s),null),O&&(je(this.#t),Ne(),je(Pe()));var r=!1,i=!1;let a=()=>{if(r){ke();return}r=!0,i&&xe(),this.#s!==null&&tr(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){Qe(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return Jn(()=>{var t=B;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return Qe(e,this.#i.parent),null}}))};Ye(()=>{var t;try{t=this.transform_error(e)}catch(e){Qe(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>Qe(e,this.#i&&this.#i.parent)):o(t)})}};function Bt(e,t,n,r){let i=Ke()?Wt:qt;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=B,s=Vt(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||Qe(e,o)}Ht()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=Ut();function d(){Promise.all(n.map(e=>Gt(e))).then(e=>l([...t.map(i),...e])).catch(e=>Qe(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),Ht()}):d()}function Vt(){var e=B,t=z,n=He,r=P;return function(i=!0){mr(e),pr(t),Ue(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Ht(e=!0){mr(null),pr(null),Ue(null),e&&P?.deactivate()}function Ut(){var e=B,t=e.b,n=P,r=t.is_rendered();return t.update_pending_count(1,n),n.increment(r,e),(i=!1)=>{t.update_pending_count(-1,n),n.decrement(r,e,i)}}function Wt(e){var t=2|v,n=z!==null&&z.f&2?z:null;return B!==null&&(B.f|=T),{ctx:He,deps:null,effects:null,equals:Ie,f:t,fn:e,reactions:null,rv:0,v:Ce,wv:0,parent:n??B,ac:null}}function Gt(e,t,n){let r=B;r===null&&ue();var i=void 0,a=rn(Ce),o=!z,s=new Map;return Gn(()=>{var t=B,n=h();i=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(Ht)}catch(e){n.reject(e),Ht()}var c=P;if(o){if(t.f&32768)var l=Ut();if(r.b.is_rendered())s.get(c)?.reject(se),s.delete(c);else{for(let e of s.values())e.reject(se);s.clear()}s.set(c,n)}let u=(e,n=void 0)=>{if(l&&l(n===se),!(n===se||t.f&16384)){if(c.activate(),n)a.f|=re,cn(a,n);else{a.f&8388608&&(a.f^=re),cn(a,e);for(let[e,t]of s){if(s.delete(e),e===c)break;t.reject(se)}}c.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),Ln(()=>{for(let e of s.values())e.reject(se)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function Kt(e){let t=Wt(e);return ze||gr(t),t}function qt(e){let t=Wt(e);return t.equals=Re,t}function Jt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Qn(t[n])}}function Yt(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function Xt(e){var t,n=B;mr(Yt(e));try{e.f&=~ee,Jt(e),t=Or(e)}finally{mr(n)}return t}function Zt(e){var t=e.v,n=Xt(e);if(!e.equals(n)&&(e.wv=Tr(),(!P?.is_fork||e.deps===null)&&(e.v=n,P?.capture(e,t,!0),e.deps===null))){et(e,_);return}ur||(vt===null?tt(e):(In()||P?.is_fork)&&vt.set(e,n))}function Qt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(se),t.teardown=f,t.ac=null,Ar(t,0),Xn(t))}function $t(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&jr(t)}var en=new Set,tn=new Map,nn=!1;function rn(e,t){return{f:0,v:e,reactions:null,equals:Ie,rv:0,wv:0}}function an(e,t){let n=rn(e,t);return gr(n),n}function on(e,t=!1,n=!0){let r=rn(e);return t||(r.equals=Re),Be&&n&&He!==null&&He.l!==null&&(He.l.s??=[]).push(r),r}function sn(e,t,r=!1){return z!==null&&(!fr||z.f&131072)&&Ke()&&z.f&4325394&&(hr===null||!n.call(hr,e))&&be(),cn(e,r?fn(t):t,Ct)}function cn(e,t,n=null){if(!e.equals(t)){var r=e.v;ur?tn.set(e,t):tn.set(e,r),e.v=t;var i=Et.ensure();if(i.capture(e,r),e.f&2){let t=e;e.f&2048&&Xt(t),vt===null&&tt(t)}e.wv=Tr(),dn(e,v,n),Ke()&&B!==null&&B.f&1024&&!(B.f&96)&&(yr===null?br([e]):yr.push(e)),!i.is_fork&&en.size>0&&!nn&&ln()}return t}function ln(){nn=!1;for(let e of en)e.f&1024&&et(e,y),Er(e)&&jr(e);en.clear()}function un(e){sn(e,e.v+1)}function dn(e,t,n){var r=e.reactions;if(r!==null)for(var i=Ke(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===B)){var l=(c&v)===0;if(l&&et(s,t),c&2){var u=s;vt?.delete(u),c&65536||(c&512&&(s.f|=ee),dn(u,y,n))}else if(l){var d=s;c&16&&kt!==null&&kt.add(d),n===null?Nt(d):n.push(d)}}}}function fn(t){if(typeof t!=`object`||!t||ie in t)return t;let n=l(t);if(n!==s&&n!==c)return t;var r=new Map,i=e(t),o=an(0),u=null,d=Cr,f=e=>{if(Cr===d)return e();var t=z,n=Cr;pr(null),wr(d);var r=e();return pr(t),wr(n),r};return i&&r.set(`length`,an(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&ve();var i=r.get(t);return i===void 0?f(()=>{var e=an(n.value,u);return r.set(t,e),e}):sn(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>an(Ce,u));r.set(t,e),un(o)}}else sn(n,Ce),un(o);return!0},get(e,n,i){if(n===ie)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>an(fn(s?e[n]:Ce),u)),r.set(n,o)),o!==void 0){var c=V(o);return c===Ce?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){var n=Reflect.getOwnPropertyDescriptor(e,t);if(n&&`value`in n){var i=r.get(t);i&&(n.value=V(i))}else if(n===void 0){var a=r.get(t),o=a?.v;if(a!==void 0&&o!==Ce)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return n},has(e,t){if(t===ie)return!0;var n=r.get(t),i=n!==void 0&&n.v!==Ce||Reflect.has(e,t);return(n!==void 0||B!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>an(i?fn(e[t]):Ce,u)),r.set(t,n)),V(n)===Ce)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;d<c.v;d+=1){var p=r.get(d+``);p===void 0?d in e&&(p=f(()=>an(Ce,u)),r.set(d+``,p)):sn(p,Ce)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>an(void 0,u)),sn(c,fn(n)),r.set(t,c));else{l=c.v!==Ce;var m=f(()=>fn(n));sn(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&sn(g,_+1)}un(o)}return!0},ownKeys(e){V(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==Ce});for(var[n,i]of r)i.v!==Ce&&!(n in e)&&t.push(n);return t},setPrototypeOf(){ye()}})}function pn(e){try{if(typeof e==`object`&&e&&ie in e)return e[ie]}catch{}return e}function mn(e,t){return Object.is(pn(e),pn(t))}var hn,gn,_n,vn;function yn(){if(hn===void 0){hn=window,gn=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;_n=a(t,`firstChild`).get,vn=a(t,`nextSibling`).get,u(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),u(n)&&(n.__t=void 0)}}function bn(e=``){return document.createTextNode(e)}function xn(e){return _n.call(e)}function Sn(e){return vn.call(e)}function F(e,t){if(!O)return xn(e);var n=xn(k);if(n===null)n=k.appendChild(bn());else if(t&&n.nodeType!==3){var r=bn();return n?.before(r),je(r),r}return t&&En(n),je(n),n}function I(e,t=!1){if(!O){var n=xn(e);return n instanceof Comment&&n.data===``?Sn(n):n}if(t){if(k?.nodeType!==3){var r=bn();return k?.before(r),je(r),r}En(k)}return k}function L(e,t=1,n=!1){let r=O?k:e;for(var i;t--;)i=r,r=Sn(r);if(!O)return r;if(n){if(r?.nodeType!==3){var a=bn();return r===null?i?.after(a):r.before(a),je(a),a}En(r)}return je(r),r}function Cn(e){e.textContent=``}function wn(){return!ze||kt!==null?!1:(B.f&S)!==0}function Tn(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function En(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 Dn(e,t){if(t){let t=document.body;e.autofocus=!0,Ye(()=>{document.activeElement===t&&e.focus()})}}function On(e){O&&xn(e)!==null&&Cn(e)}var kn=!1;function An(){kn||(kn=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function jn(e){var t=z,n=B;pr(null),mr(null);try{return e()}finally{pr(t),mr(n)}}function Mn(e,t,n,r=n){e.addEventListener(t,()=>jn(n));let i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),An()}function Nn(e){B===null&&(z===null&&me(e),pe()),ur&&fe(e)}function Pn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Fn(e,t){var n=B;n!==null&&n.f&8192&&(e|=b);var r={ctx:He,deps:null,nodes:null,f:e|v|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};P?.register_created_effect(r);var i=r;if(e&4)St===null?Et.ensure().schedule(r):St.push(r);else if(t!==null){try{jr(r)}catch(e){throw Qn(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|=w))}if(i!==null&&(i.parent=n,n!==null&&Pn(i,n),z!==null&&z.f&2&&!(e&64))){var a=z;(a.effects??=[]).push(i)}return r}function In(){return z!==null&&!fr}function Ln(e){let t=Fn(8,null);return et(t,_),t.teardown=e,t}function Rn(e){Nn(`$effect`);var t=B.f;if(!z&&t&32&&!(t&32768)){var n=He;(n.e??=[]).push(e)}else return zn(e)}function zn(e){return Fn(4|E,e)}function Bn(e){return Nn(`$effect.pre`),Fn(8|E,e)}function Vn(e){Et.ensure();let t=Fn(64|T,e);return(e={})=>new Promise(n=>{e.outro?tr(t,()=>{Qn(t),n(void 0)}):(Qn(t),n(void 0))})}function Hn(e){return Fn(4,e)}function Un(e,t){var n=He,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=Kn(()=>{if(e(),!r.ran){r.ran=!0;var n=B;try{mr(n.parent),H(t)}finally{mr(n)}}})}function Wn(){var e=He;Kn(()=>{for(var t of e.l.$){t.deps();var n=t.effect;n.f&1024&&n.deps!==null&&et(n,y),Er(n)&&jr(n),t.ran=!1}})}function Gn(e){return Fn(ne|T,e)}function Kn(e,t=0){return Fn(8|t,e)}function R(e,t=[],n=[],r=[]){Bt(r,t,n,t=>{Fn(8,()=>e(...t.map(V)))})}function qn(e,t=0){return Fn(16|t,e)}function Jn(e){return Fn(32|T,e)}function Yn(e){var t=e.teardown;if(t!==null){let e=ur,n=z;dr(!0),pr(null);try{t.call(null)}finally{dr(e),pr(n)}}}function Xn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&jn(()=>{e.abort(se)});var r=n.next;n.f&64?n.parent=null:Qn(n,t),n=r}}function Zn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Qn(t),t=n}}function Qn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&($n(e.nodes.start,e.nodes.end),n=!0),et(e,C),Xn(e,t&&!n),Ar(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Yn(e),e.f^=C,e.f|=x;var i=e.parent;i!==null&&i.first!==null&&er(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function $n(e,t){for(;e!==null;){var n=e===t?null:Sn(e);e.remove(),e=n}}function er(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 tr(e,t,n=!0){var r=[];nr(e,r,!0);var i=()=>{n&&Qn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function nr(e,t,n){if(!(e.f&8192)){e.f^=b;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,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;nr(i,t,o?n:!1),i=a}}}function rr(e){ir(e,!0)}function ir(e,t){if(e.f&8192){e.f^=b,e.f&1024||(et(e,v),Et.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;ir(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 ar(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Sn(n);t.append(n),n=i}}var or=null;function sr(e){var t=or;try{if(or=new Set,H(e),t!==null)for(var n of or)t.add(n);return or}finally{or=t}}function cr(e){for(var t of sr(e))cn(t,t.v)}var lr=!1,ur=!1;function dr(e){ur=e}var z=null,fr=!1;function pr(e){z=e}var B=null;function mr(e){B=e}var hr=null;function gr(e){z!==null&&(!ze||z.f&2)&&(hr===null?hr=[e]:hr.push(e))}var _r=null,vr=0,yr=null;function br(e){yr=e}var xr=1,Sr=0,Cr=Sr;function wr(e){Cr=e}function Tr(){return++xr}function Er(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ee),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Er(a)&&Zt(a),a.wv>e.wv)return!0}t&512&&vt===null&&et(e,_)}return!1}function Dr(e,t,r=!0){var i=e.reactions;if(i!==null&&!(!ze&&hr!==null&&n.call(hr,e)))for(var a=0;a<i.length;a++){var o=i[a];o.f&2?Dr(o,t,!1):t===o&&(r?et(o,v):o.f&1024&&et(o,y),Nt(o))}}function Or(e){var t=_r,n=vr,r=yr,i=z,a=hr,o=He,s=fr,c=Cr,l=e.f;_r=null,vr=0,yr=null,z=l&96?null:e,hr=null,Ue(e.ctx),fr=!1,Cr=++Sr,e.ac!==null&&(jn(()=>{e.ac.abort(se)}),e.ac=null);try{e.f|=te;var u=e.fn,d=u();e.f|=S;var f=e.deps,p=P?.is_fork;if(_r!==null){var m;if(p||Ar(e,vr),f!==null&&vr>0)for(f.length=vr+_r.length,m=0;m<_r.length;m++)f[vr+m]=_r[m];else e.deps=f=_r;if(In()&&e.f&512)for(m=vr;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&vr<f.length&&(Ar(e,vr),f.length=vr);if(Ke()&&yr!==null&&!fr&&f!==null&&!(e.f&6146))for(m=0;m<yr.length;m++)Dr(yr[m],e);if(i!==null&&i!==e){if(Sr++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Sr;if(t!==null)for(let e of t)e.rv=Sr;yr!==null&&(r===null?r=yr:r.push(...yr))}return e.f&8388608&&(e.f^=re),d}catch(e){return Ze(e)}finally{e.f^=te,_r=t,vr=n,yr=r,z=i,hr=a,Ue(o),fr=s,Cr=c}}function kr(e,r){let i=r.reactions;if(i!==null){var a=t.call(i,e);if(a!==-1){var o=i.length-1;o===0?i=r.reactions=null:(i[a]=i[o],i.pop())}}if(i===null&&r.f&2&&(_r===null||!n.call(_r,r))){var s=r;s.f&512&&(s.f^=512,s.f&=~ee),tt(s),Qt(s),Ar(s,0)}}function Ar(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)kr(e,n[r])}function jr(e){var t=e.f;if(!(t&16384)){et(e,_);var n=B,r=lr;B=e,lr=!0;try{t&16777232?Zn(e):Xn(e),Yn(e);var i=Or(e);e.teardown=typeof i==`function`?i:null,e.wv=xr}finally{lr=r,B=n}}}async function Mr(){if(ze)return new Promise(e=>{requestAnimationFrame(()=>e()),setTimeout(()=>e())});await Promise.resolve(),Dt()}function V(e){var t=(e.f&2)!=0;if(or?.add(e),z!==null&&!fr&&!(B!==null&&B.f&16384)&&(hr===null||!n.call(hr,e))){var r=z.deps;if(z.f&2097152)e.rv<Sr&&(e.rv=Sr,_r===null&&r!==null&&r[vr]===e?vr++:_r===null?_r=[e]:_r.push(e));else{(z.deps??=[]).push(e);var i=e.reactions;i===null?e.reactions=[z]:n.call(i,z)||i.push(z)}}if(ur&&tn.has(e))return tn.get(e);if(t){var a=e;if(ur){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||Pr(a))&&(o=Xt(a)),tn.set(a,o),o}var s=(a.f&512)==0&&!fr&&z!==null&&(lr||(z.f&512)!=0),c=(a.f&S)===0;Er(a)&&(s&&(a.f|=512),Zt(a)),s&&!c&&($t(a),Nr(a))}if(vt?.has(e))return vt.get(e);if(e.f&8388608)throw e.v;return e.v}function Nr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&($t(t),Nr(t))}function Pr(e){if(e.v===Ce)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(tn.has(t)||t.f&2&&Pr(t))return!0;return!1}function H(e){var t=fr;try{return fr=!0,e()}finally{fr=t}}function U(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(ie in e)Fr(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&ie in n&&Fr(n)}}}function Fr(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{Fr(e[n],t)}catch{}let n=l(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=o(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var Ir=[`touchstart`,`touchmove`];function Lr(e){return Ir.includes(e)}var Rr=Symbol(`events`),zr=new Set,Br=new Set;function Vr(e,t,n,r={}){function i(e){if(r.capture||Ur.call(t,e),!e.cancelBubble)return jn(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?Ye(()=>{t.addEventListener(e,i,r)}):t.addEventListener(e,i,r),i}function W(e,t,n,r,i){var a={capture:r,passive:i},o=Vr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Ln(()=>{t.removeEventListener(e,o,a)})}var Hr=null;function Ur(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],o=a[0]||e.target;Hr=e;var s=0,c=Hr===e&&e[Rr];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[Rr]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=z,f=B;pr(null),mr(null);try{for(var p,m=[];o!==null;){var h=o.assignedSlot||o.parentNode||o.host||null;try{var g=o[Rr]?.[r];g!=null&&(!o.disabled||e.target===o)&&g.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble||h===t||h===null)break;o=h}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Rr]=t,delete e.currentTarget,pr(d),mr(f)}}}var Wr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function Gr(e){return Wr?.createHTML(e)??e}function Kr(e){var t=Tn(`template`);return t.innerHTML=Gr(e.replaceAll(`<!>`,`<!---->`)),t.content}function qr(e,t){var n=B;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function G(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(O)return qr(k,null),k;i===void 0&&(i=Kr(a?e:`<!>`+e),n||(i=xn(i)));var t=r||gn?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=xn(t),s=t.lastChild;qr(o,s)}else qr(t,t);return t}}function Jr(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(O)return qr(k,null),k;if(!o){var e=xn(Kr(a));if(i)for(o=document.createDocumentFragment();xn(e);)o.appendChild(xn(e));else o=xn(e)}var t=o.cloneNode(!0);if(i){var n=xn(t),r=t.lastChild;qr(n,r)}else qr(t,t);return t}}function Yr(e,t){return Jr(e,t,`svg`)}function Xr(){if(O)return qr(k,null),k;var e=document.createDocumentFragment(),t=document.createComment(``),n=bn();return e.append(t,n),qr(t,n),e}function K(e,t){if(O){var n=B;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=k),Me();return}e!==null&&e.before(t)}var Zr=!0;function q(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function Qr(e,t){return ei(e,t)}var $r=new Map;function ei(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){yn();var l=void 0,u=Vn(()=>{var u=n??t.appendChild(bn());Rt(u,{pending:()=>{}},t=>{We({});var n=He;if(o&&(n.c=o),a&&(i.$$events=a),O&&qr(t,null),Zr=s,l=e(t,i)||{},Zr=!0,O&&(B.nodes.end=k,k===null||k.nodeType!==8||k.data!==`]`))throw De(),Se;Ge()},c);var d=new Set,f=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!d.has(r)){d.add(r);var i=Lr(r);for(let e of[t,document]){var a=$r.get(e);a===void 0&&(a=new Map,$r.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Ur,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return f(r(zr)),Br.add(f),()=>{for(var e of d)for(let n of[t,document]){var r=$r.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,Ur),r.delete(e),r.size===0&&$r.delete(n)):r.set(e,i)}Br.delete(f),u!==n&&u.parentNode?.removeChild(u)}});return ti.set(l,u),l}var ti=new WeakMap,ni=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)rr(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(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&&(Qn(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();ar(r,t),t.append(bn()),this.#n.set(e,{effect:r,fragment:t})}else Qn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),tr(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)||(Qn(n.effect),this.#n.delete(e))};ensure(e,t){var n=P,r=wn();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=bn();i.append(a),this.#n.set(e,{effect:Jn(()=>t(a)),fragment:i})}else this.#t.set(e,Jn(()=>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 O&&(this.anchor=k),this.#a(n)}};function J(e,t,n=!1){var r;O&&(r=k,Me());var i=new ni(e),a=n?w:0;function o(e,t){if(O){var n=Fe(r);if(e!==parseInt(n.substring(1))){var a=Pe();je(a),i.anchor=a,Ae(!1),i.ensure(e,t),Ae(!0);return}}i.ensure(e,t)}qn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Y(e,t){return t}function ri(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c<a;c++){let n=t[c];tr(n,()=>{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;ii(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else --s},!1)}if(s===0){var l=i.length===0&&n!==null;if(l){var u=n,d=u.parentNode;Cn(d),d.append(u),e.items.clear()}ii(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function ii(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<t.length;i++){var a=t[i];r?.has(a)?(a.f|=D,ar(a,document.createDocumentFragment())):Qn(t[i],n)}}var ai;function X(t,n,i,a,o,s=null){var c=t,l=new Map;if(n&4){var u=t;c=O?je(xn(u)):u.appendChild(bn())}O&&Me();var d=null,f=qt(()=>{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,si(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=D,li(d,null,c)):rr(d):tr(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:qn(()=>{p=V(f);var e=p.length;let t=!1;O&&Fe(c)===`[!`!=(e===0)&&(c=Pe(),je(c),Ae(!1),t=!0);for(var r=new Set,u=P,v=wn(),y=0;y<e;y+=1){O&&k.nodeType===8&&k.data===`]`&&(c=k,t=!0,Ae(!1));var b=p[y],x=a(b,y),S=h?null:l.get(x);S?(S.v&&cn(S.v,b),S.i&&cn(S.i,y),v&&u.unskip_effect(S.e)):(S=ci(l,h?c:ai??=bn(),b,x,y,o,n,i),h||(S.e.f|=D),l.set(x,S)),r.add(x)}if(e===0&&s&&!d&&(h?d=Jn(()=>s(c)):(d=Jn(()=>s(ai??=bn())),d.f|=D)),e>r.size&&de(``,``,``),O&&e>0&&je(Pe()),!h)if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u);t&&Ae(!0),V(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,O&&(c=k)}function oi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function si(e,t,n,i,a){var o=(i&8)!=0,s=t.length,c=e.items,l=oi(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v<s;v+=1)h=t[v],g=a(h,v),_=c.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<s;v+=1){if(h=t[v],g=a(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(rr(_),o&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432)if(_.f^=D,_===l)li(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),ui(e,d,_),ui(e,_,y),li(_,y,n),d=_,p=[],m=[],l=oi(d.next);continue}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],C=p[p.length-1];for(x=0;x<p.length;x+=1)li(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);ui(e,S.prev,C.next),ui(e,d,S),ui(e,C,b),l=b,d=C,--v,p=[],m=[]}else u.delete(_),li(_,l,n),ui(e,_.prev,_.next),ui(e,_,d===null?e.effect.first:d.next),ui(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=oi(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=oi(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(ii(e,r(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var w=[];if(u!==void 0)for(_ of u)_.f&8192||w.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&w.push(l),l=oi(l.next);var T=w.length;if(T>0){var E=i&4&&s===0?n:null;if(o){for(v=0;v<T;v+=1)w[v].nodes?.a?.measure();for(v=0;v<T;v+=1)w[v].nodes?.a?.fix()}ri(e,w,E)}}o&&Ye(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function ci(e,t,n,r,i,a,o,s){var c=o&1?o&16?rn(n):on(n,!1,!1):null,l=o&2?rn(i):null;return{v:c,i:l,e:Jn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function li(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=Sn(r);if(a.before(r),r===i)return;r=o}}function ui(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function di(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;O&&(o=je(xn(c)))}R(()=>{var e=B;if(s===(s=t()??``)){O&&Me();return}if(n&&!O){e.nodes=null,c.innerHTML=s,s!==``&&qr(xn(c),c.lastChild);return}if(e.nodes!==null&&($n(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(O){for(var a=k.data,l=Me(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=Sn(l);if(l===null)throw De(),Se;qr(k,u),o=je(l);return}var d=Tn(r?`svg`:i?`math`:`template`,r?Te:i?Ee:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(qr(xn(f),f.lastChild),r||i)for(;xn(f);)o.before(xn(f));else o.before(f)}})}var fi=()=>performance.now(),pi={tick:e=>requestAnimationFrame(e),now:()=>fi(),tasks:new Set};function mi(){let e=pi.now();pi.tasks.forEach(t=>{t.c(e)||(pi.tasks.delete(t),t.f())}),pi.tasks.size!==0&&pi.tick(mi)}function hi(e){let t;return pi.tasks.size===0&&pi.tick(mi),{promise:new Promise(n=>{pi.tasks.add(t={c:e,f:n})}),abort(){pi.tasks.delete(t)}}}function gi(e,t){jn(()=>{e.dispatchEvent(new CustomEvent(t))})}function _i(e){if(e===`float`)return`cssFloat`;if(e===`offset`)return`cssOffset`;if(e.startsWith(`--`))return e;let t=e.split(`-`);return t.length===1?t[0]:t[0]+t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join(``)}function vi(e){let t={},n=e.split(`;`);for(let e of n){let[n,r]=e.split(`:`);if(!n||r===void 0)break;let i=_i(n.trim());t[i]=r.trim()}return t}var yi=e=>e;function bi(e,t,n,r){var i=(e&1)!=0,a=(e&2)!=0,o=i&&a,s=(e&4)!=0,c=o?`both`:i?`in`:`out`,l,u=t.inert,d=t.style.overflow,f,p;function m(){return jn(()=>l??=n()(t,r?.()??{},{direction:c}))}var h={is_global:s,in(){if(t.inert=u,!i){p?.abort(),p?.reset?.();return}a||f?.abort(),f=xi(t,m(),p,1,()=>{gi(t,`introend`),f?.abort(),f=l=void 0,t.style.overflow=d})},out(e){if(!a){e?.(),l=void 0;return}t.inert=!0,p=xi(t,m(),f,0,()=>{gi(t,`outroend`),e?.()})},stop:()=>{f?.abort(),p?.abort()}},g=B;if((g.nodes.t??=[]).push(h),i&&Zr){var _=s;if(!_){for(var v=g.parent;v&&v.f&65536;)for(;(v=v.parent)&&!(v.f&16););_=!v||(v.f&32768)!=0}_&&Hn(()=>{H(()=>h.in())})}}function xi(e,t,n,r,i){var a=r===1;if(d(t)){var o,s=!1;return Ye(()=>{s||(o=xi(e,t({direction:a?`in`:`out`}),n,r,i))}),{abort:()=>{s=!0,o?.abort()},deactivate:()=>o.deactivate(),reset:()=>o.reset(),t:()=>o.t()}}if(n?.deactivate(),!t?.duration&&!t?.delay)return gi(e,a?`introstart`:`outrostart`),i(),{abort:f,deactivate:f,reset:f,t:()=>r};let{delay:c=0,css:l,tick:u,easing:p=yi}=t;var m=[];if(a&&n===void 0&&(u&&u(0,1),l)){var h=vi(l(0,1));m.push(h,h)}var g=()=>1-r,_=e.animate(m,{duration:c,fill:`forwards`});return _.onfinish=()=>{_.cancel(),gi(e,a?`introstart`:`outrostart`);var o=n?.t()??1-r;n?.abort();var s=r-o,c=t.duration*Math.abs(s),d=[];if(c>0){var f=!1;if(l)for(var m=Math.ceil(c/(1e3/60)),h=0;h<=m;h+=1){var v=o+s*p(h/m),y=vi(l(v,1-v));d.push(y),f||=y.overflow===`hidden`}f&&(e.style.overflow=`hidden`),g=()=>{var e=_.currentTime;return o+s*p(e/c)},u&&hi(()=>{if(_.playState!==`running`)return!1;var e=g();return u(e,1-e),!0})}_=e.animate(d,{duration:c,fill:`forwards`}),_.onfinish=()=>{g=()=>r,u?.(r,1-r),i()}},{abort:()=>{_&&(_.cancel(),_.effect=null,_.onfinish=f)},deactivate:()=>{i=f},reset:()=>{r===0&&u?.(1,0)},t:()=>g()}}function Si(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<i;t++)e[t]&&(n=Si(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ci(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Si(e))&&(r&&(r+=` `),r+=t);return r}function wi(e){return typeof e==`object`?Ci(e):e??``}var Ti=[...`
2
- \r\f\xA0\v`];function Ei(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Ti.includes(r[o-1]))&&(s===r.length||Ti.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Di(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 Oi(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function ki(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(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Oi)),i&&c.push(...Object.keys(i).map(Oi));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Oi(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Di(r)),i&&(n+=Di(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Ai(e,t,n,r,i,a){var o=e.__className;if(O||o!==n||o===void 0){var s=Ei(n,r,a);(!O||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e.__className=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function ji(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Mi(e,t,n,r){var i=e.__style;if(O||i!==t){var a=ki(t,r);(!O||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e.__style=t}else r&&(Array.isArray(r)?(ji(e,n?.[0],r[0]),ji(e,n?.[1],r[1],`important`)):ji(e,n,r));return r}function Ni(t,n,r=!1){if(t.multiple){if(n==null)return;if(!e(n))return Oe();for(var i of t.options)i.selected=n.includes(Ii(i));return}for(i of t.options)if(mn(Ii(i),n)){i.selected=!0;return}(!r||n!==void 0)&&(t.selectedIndex=-1)}function Pi(e){var t=new MutationObserver(()=>{Ni(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),Ln(()=>{t.disconnect()})}function Fi(e,t,n=t){var r=new WeakSet,i=!0;Mn(e,`change`,t=>{var i=t?`[selected]`:`:checked`,a;if(e.multiple)a=[].map.call(e.querySelectorAll(i),Ii);else{var o=e.querySelector(i)??e.querySelector(`option:not([disabled])`);a=o&&Ii(o)}n(a),e.__value=a,P!==null&&r.add(P)}),Hn(()=>{var a=t();if(e===document.activeElement){var o=ze?_t:P;if(r.has(o))return}if(Ni(e,a,i),i&&a===void 0){var s=e.querySelector(`:checked`);s!==null&&(a=Ii(s),n(a))}e.__value=a,i=!1}),Pi(e)}function Ii(e){return`__value`in e?e.__value:e.value}var Li=Symbol(`is custom element`),Ri=Symbol(`is html`),zi=ce?`link`:`LINK`,Bi=ce?`progress`:`PROGRESS`;function Vi(e){if(O){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Wi(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Wi(e,`checked`,null),e.checked=r}}};e.__on_r=n,Ye(n),An()}}function Hi(e,t){var n=Gi(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==Bi)||(e.value=t??``)}function Ui(e,t){var n=Gi(e);n.checked!==(n.checked=t??void 0)&&(e.checked=t)}function Wi(e,t,n,r){var i=Gi(e);O&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===zi)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[oe]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&qi(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Gi(e){return e.__attributes??={[Li]:e.nodeName.includes(`-`),[Ri]:e.namespaceURI===we}}var Ki=new Map;function qi(e){var t=e.getAttribute(`is`)||e.nodeName,n=Ki.get(t);if(n)return n;Ki.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&n.push(s);i=l(i)}return n}function Ji(e,t,n=t){var r=new WeakSet;Mn(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=Yi(e)?Xi(a):a,n(a),P!==null&&r.add(P),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))}}}),(O&&e.defaultValue!==e.value||H(t)==null&&e.value)&&(n(Yi(e)?Xi(e.value):e.value),P!==null&&r.add(P)),Kn(()=>{var n=t();if(e===document.activeElement){var i=ze?_t:P;if(r.has(i))return}Yi(e)&&n===Xi(e.value)||e.type===`date`&&!n&&!e.value||n!==e.value&&(e.value=n??``)})}function Yi(e){var t=e.type;return t===`number`||t===`range`}function Xi(e){return e===``?null:+e}function Zi(e,t,n){var r=a(e,t);r&&r.set&&(e[t]=n,Ln(()=>{e[t]=null}))}function Qi(e,t){return e===t||e?.[ie]===t}function $i(e={},t,n,r){var i=He.r,a=B;return Hn(()=>{var o,s;return Kn(()=>{o=s,s=r?.()||[],H(()=>{e!==n(...s)&&(t(e,...s),o&&Qi(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&&Qi(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function ea(e){return function(...t){return t[0].stopPropagation(),e?.apply(this,t)}}function ta(e){return function(...t){return t[0].preventDefault(),e?.apply(this,t)}}function na(e=!1){let t=He,n=t.l.u;if(!n)return;let r=()=>U(t.s);if(e){let e=0,n={},i=Wt(()=>{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=()=>V(i)}n.b.length&&Bn(()=>{ra(t,r),m(n.b)}),Rn(()=>{let e=H(()=>n.m.map(p));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&Rn(()=>{ra(t,r),m(n.a)})}function ra(e,t){if(e.l.s)for(let t of e.l.s)V(t);t()}function ia(t,n){var r=t.$$events?.[n.type];for(var i of e(r)?r.slice():r==null?[]:[r])i.call(this,n)}function Z(e,t,n,r){var i=!Be||(n&2)!=0,o=(n&8)!=0,s=(n&16)!=0,c=r,l=!0,u=()=>(l&&(l=!1,c=s?H(r):r),c);let d;if(o){var f=ie in e||ae in e;d=a(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;o?[p,m]=ht(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&_e(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(l=!0,n)}:()=>{var n=e[t];return n!==void 0&&(c=void 0),n===void 0?c:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?Wt:qt)(()=>(_=!1,h()));o&&V(v);var y=B;return(function(e,t){if(arguments.length>0){let n=t?V(v):i&&o?fn(e):e;return sn(v,n),_=!0,c!==void 0&&(c=n),e}return ur&&_||y.f&16384?v.v:V(v)})}function aa(e){He===null&&le(`onMount`),Be&&He.l!==null?ua(He).m.push(e):Rn(()=>{let t=H(e);if(typeof t==`function`)return t})}function oa(e){He===null&&le(`onDestroy`),aa(()=>()=>H(e))}function sa(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function ca(){let t=He;return t===null&&le(`createEventDispatcher`),(n,r,i)=>{let a=t.s.$$events?.[n];if(a){let o=e(a)?a.slice():[a],s=sa(n,r,i);for(let e of o)e.call(t.x,s);return!s.defaultPrevented}return!0}}function la(e){He===null&&le(`afterUpdate`),He.l===null&&ge(`afterUpdate`),ua(He).a.push(e)}function ua(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`),Ve();var da=j(`light`),fa=j(`dashboard`),pa=j([]),ma=j(null),ha=j(!1),ga=j([]),_a=j(``),va=j(null),ya=j(null),ba=j([]),xa=j(0),Sa=j(1),Ca=j(25),wa=j(``),Ta=j(``),Ea=j(null),Da=j(null),Oa=j(`updated_at`),ka=j(`desc`),Aa=j(new Set),ja=j(``),Ma=j([]),Na=j(1),Pa=j(20),Fa=j(0),Ia=j(null),La=st([pa,ga,_a],([e,t,n])=>{let r=n?e.filter(e=>e.repo.toLowerCase().includes(n.toLowerCase())):e;return{pinned:r.filter(e=>t.includes(e.repo)).sort((e,n)=>t.indexOf(e.repo)-t.indexOf(n.repo)),unpinned:r.filter(e=>!t.includes(e.repo))}}),Ra=st([xa,Ca],([e,t])=>Math.max(1,Math.ceil(e/t)));function za(){let e=localStorage.getItem(`theme`)||`light`;da.set(e),document.documentElement.classList.toggle(`dark`,e===`dark`),ha.set(localStorage.getItem(`repoSidebarCollapsed`)===`1`);try{let e=localStorage.getItem(`pinnedRepos`);ga.set(e?JSON.parse(e):[])}catch{ga.set([])}let t=localStorage.getItem(`activeTab`);t&&fa.set(t),da.subscribe(e=>{localStorage.setItem(`theme`,e),document.documentElement.classList.toggle(`dark`,e===`dark`)}),ha.subscribe(e=>{localStorage.setItem(`repoSidebarCollapsed`,e?`1`:`0`)}),ga.subscribe(e=>{localStorage.setItem(`pinnedRepos`,JSON.stringify(e))}),fa.subscribe(e=>{localStorage.setItem(`activeTab`,e)})}async function Ba(e,t){let n=await fetch(e,t);if(!n.ok){let e=await n.json().catch(()=>({error:n.statusText}));throw Error(e.error||`HTTP ${n.status}`)}return n.json()}var Va={health:()=>Ba(`/api/health`),repos:()=>Ba(`/api/repos`),stats:e=>Ba(`/api/stats${e?`?repo=${encodeURIComponent(e)}`:``}`),recentActions:(e,t,n)=>{let r=`/api/recent-actions?page=${t}&pageSize=${n}`;return e&&(r+=`&repo=${encodeURIComponent(e)}`),Ba(r)},memories:e=>{let t=new URLSearchParams({repo:e.repo});return e.type&&t.set(`type`,e.type),e.search&&t.set(`search`,e.search),e.minImportance!=null&&t.set(`minImportance`,String(e.minImportance)),e.maxImportance!=null&&t.set(`maxImportance`,String(e.maxImportance)),e.sortBy&&t.set(`sortBy`,e.sortBy),e.sortOrder&&t.set(`sortOrder`,e.sortOrder),e.page&&t.set(`page`,String(e.page)),e.pageSize&&t.set(`pageSize`,String(e.pageSize)),Ba(`/api/memories?${t}`)},memoryById:e=>Ba(`/api/memories/${e}`),createMemory:e=>Ba(`/api/memories`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),updateMemory:(e,t)=>Ba(`/api/memories/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),deleteMemory:e=>Ba(`/api/memories/${e}`,{method:`DELETE`}),bulkImportMemories:(e,t)=>Ba(`/api/memories/bulk-import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({repo:e,items:t})}),bulkMemoryAction:(e,t,n)=>Ba(`/api/memories/bulk-action`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:e,ids:t,updates:n})}),tasks:e=>{let t=new URLSearchParams({repo:e.repo});return e.status&&t.set(`status`,e.status),e.search&&t.set(`search`,e.search),e.page&&t.set(`page`,String(e.page)),e.pageSize&&t.set(`pageSize`,String(e.pageSize)),Ba(`/api/tasks?${t}`)},taskById:e=>Ba(`/api/tasks/${e}`),taskTimeStats:e=>Ba(`/api/tasks/stats/time?repo=${encodeURIComponent(e)}`),updateTask:(e,t)=>Ba(`/api/tasks/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),createTask:e=>Ba(`/api/tasks`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),deleteTask:e=>Ba(`/api/tasks/${e}`,{method:`DELETE`}),bulkImportTasks:(e,t)=>Ba(`/api/tasks/bulk-import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({repo:e,items:t})}),updateTaskComment:(e,t)=>Ba(`/api/task-comments/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({comment:t})}),deleteTaskComment:e=>Ba(`/api/task-comments/${e}`,{method:`DELETE`}),export:e=>Ba(`/api/export?repo=${encodeURIComponent(e)}`),capabilities:()=>Ba(`/api/capabilities`),callTool:(e,t)=>Ba(`/api/tools/${encodeURIComponent(e)}/call`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)})},Ha=[{id:`dashboard`,label:`Dashboard`,icon:`layout-dashboard`},{id:`activity`,label:`Activity`,icon:`activity`},{id:`memories`,label:`Memories`,icon:`brain`},{id:`tasks`,label:`Tasks`,icon:`clipboard-list`},{id:`reference`,label:`Reference`,icon:`book-open`}];function Ua(e){let{subscribe:t,set:n,update:r}=j({mobileMenuOpen:!1,selectedMemory:null,selectedTask:null,drawerOpen:!1,selectedReference:null,referenceDrawerOpen:!1,memoryDrawerOpen:!1,memoryDrawerItem:null,bulkImportOpen:!1,bulkImportTarget:`memories`,addTaskModalOpen:!1,newTask:{task_code:``,title:``,phase:``,description:``,status:`pending`,priority:3},capabilities:null,referenceSearch:``,referenceFilter:`all`});async function i(){try{let e=await Va.repos();if(pa.set(e.repos||[]),e.repos?.length>0){let t=localStorage.getItem(`selectedRepo`),n=e.repos.find(e=>e.repo===t)?t:e.repos[0].repo;ma.set(n),localStorage.setItem(`selectedRepo`,n)}}catch(e){console.error(`Failed to load repos:`,e)}}async function a(){try{let e=await Va.health();Ia.set(e)}catch{Ia.set(null)}}async function o(){let e=M(ma);if(e){try{let t=await Va.stats(e);va.set(t)}catch(e){console.error(`Failed to load stats:`,e)}try{let t=await Va.taskTimeStats(e);ya.set(t)}catch{}}}async function s(e,t=!1){let n=M(ma);if(!n)return;let r=e??M(Na);try{let e=await Va.recentActions(n,r,M(Pa));t?Ma.update(t=>[...t,...e.actions||[]]):Ma.set(e.actions||[]),Na.set(e.pagination?.page??r),Fa.set(e.pagination?.totalItems??0)}catch(e){console.error(`Failed to load recent actions:`,e)}}async function c(){M(ma)&&await Promise.all([o(),s()])}async function l(t){ma.set(t),await c(),e.memoryList?.refresh(),e.kanbanBoard?.loadTasks(t),r(e=>({...e,mobileMenuOpen:!1}))}async function u(){await a(),await c();let t=M(fa),n=M(ma);t===`memories`&&e.memoryList?.refresh(),t===`tasks`&&n&&e.kanbanBoard?.loadTasks(n)}async function d(n){fa.set(n);let i=M(ma);if(n===`memories`)setTimeout(()=>e.memoryList?.refresh(),50);else if(n===`tasks`&&i)setTimeout(()=>e.kanbanBoard?.loadTasks(i),50);else if(n===`reference`&&!M({subscribe:t}).capabilities)try{let e=await Va.capabilities();r(t=>({...t,capabilities:e}))}catch{}}function f(e){r(t=>({...t,bulkImportTarget:e,bulkImportOpen:!0}))}function p(e,t){r(n=>({...n,selectedReference:{type:e,data:t},referenceDrawerOpen:!0}))}function m(e){r(t=>({...t,memoryDrawerItem:e,memoryDrawerOpen:!0}))}function h(){r(e=>({...e,memoryDrawerItem:null,memoryDrawerOpen:!0}))}function g(t){e.memoryList?.refresh()}function _(t){e.memoryList?.refresh()}async function v(e){r(t=>({...t,selectedTask:e,selectedMemory:null,drawerOpen:!0}));try{let n=await Va.taskById(e.id);M({subscribe:t}).selectedTask?.id===n.id&&r(e=>({...e,selectedTask:n}))}catch(e){console.error(`Failed to fetch full task details:`,e)}}function y(){r(e=>({...e,drawerOpen:!1})),setTimeout(()=>{r(e=>({...e,selectedMemory:null,selectedTask:null}))},300)}function b(t){r(e=>({...e,selectedTask:t}));let n=M(ma);n&&e.kanbanBoard?.loadTasks(n)}async function x(){let n=M(ma),{newTask:i}=M({subscribe:t});if(!(!n||!i.task_code||!i.title))try{await Va.createTask({...i,repo:n}),r(e=>({...e,addTaskModalOpen:!1,newTask:{task_code:``,title:``,phase:``,description:``,status:`pending`,priority:3}})),e.kanbanBoard?.loadTasks(n)}catch(e){alert(`Failed to create task: `+e.message)}}function S(e){let t=e.target?.tagName;t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||(e.key===`Escape`&&y(),(e.key===`r`||e.key===`R`)&&u())}function C(){r(e=>({...e,mobileMenuOpen:!e.mobileMenuOpen}))}function w(e){r(t=>({...t,referenceSearch:e}))}function T(e){r(t=>({...t,referenceFilter:e}))}function E(e){r(t=>({...t,referenceDrawerOpen:e}))}function D(e){r(t=>({...t,memoryDrawerOpen:e}))}function ee(e){r(t=>({...t,addTaskModalOpen:e}))}function te(e){r(t=>({...t,bulkImportOpen:e}))}return{subscribe:t,set:n,update:r,TABS:Ha,sidebarCollapsed:st(ha,e=>e),filteredTools:st({subscribe:t},e=>(e.capabilities?.tools||[]).filter(t=>(e.referenceFilter===`all`||e.referenceFilter===`tools`)&&(!e.referenceSearch||t.name.toLowerCase().includes(e.referenceSearch.toLowerCase())||(t.description||``).toLowerCase().includes(e.referenceSearch.toLowerCase())))),filteredPrompts:st({subscribe:t},e=>(e.capabilities?.prompts||[]).filter(t=>(e.referenceFilter===`all`||e.referenceFilter===`prompts`)&&(!e.referenceSearch||t.name.toLowerCase().includes(e.referenceSearch.toLowerCase())||(t.description||``).toLowerCase().includes(e.referenceSearch.toLowerCase())))),filteredResources:st({subscribe:t},e=>(e.capabilities?.resources||[]).filter(t=>(e.referenceFilter===`all`||e.referenceFilter===`resources`)&&(!e.referenceSearch||t.name.toLowerCase().includes(e.referenceSearch.toLowerCase())||(t.description||``).toLowerCase().includes(e.referenceSearch.toLowerCase())))),loadRepos:i,loadHealth:a,loadData:c,loadStats:o,loadRecentActions:s,onRepoSelect:l,onRefresh:u,onTabChange:d,openBulkImport:f,openReferenceDrawer:p,openMemoryDrawer:m,openNewMemoryDrawer:h,handleMemorySaved:g,handleMemoryDeleted:_,openTaskDrawer:v,closeDrawer:y,handleTaskUpdated:b,createTask:x,onKeyDown:S,toggleMobileMenu:C,setReferenceSearch:w,setReferenceFilter:T,toggleReferenceDrawer:E,toggleMemoryDrawer:D,toggleAddTaskModal:ee,toggleBulkImport:te}}function Wa(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ga=Wa();function Ka(e){Ga=e}var qa={exec:()=>null};function Ja(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Xa.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Ya=(()=>{try{return!0}catch{return!1}})(),Xa={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Za=/^(?:[ \t]*(?:\n|$))+/,Qa=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,$a=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,eo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,to=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,no=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ro=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,io=Ja(ro).replace(/bull/g,no).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ao=Ja(ro).replace(/bull/g,no).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),oo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,so=/^[^\n]+/,co=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,lo=Ja(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,co).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),uo=Ja(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,no).getRegex(),fo=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,po=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,mo=Ja(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,po).replace(`tag`,fo).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ho=Ja(oo).replace(`hr`,eo).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,fo).getRegex(),go={blockquote:Ja(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ho).getRegex(),code:Qa,def:lo,fences:$a,heading:to,hr:eo,html:mo,lheading:io,list:uo,newline:Za,paragraph:ho,table:qa,text:so},_o=Ja(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,eo).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,fo).getRegex(),vo={...go,lheading:ao,table:_o,paragraph:Ja(oo).replace(`hr`,eo).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,_o).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,fo).getRegex()},yo={...go,html:Ja(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,po).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qa,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ja(oo).replace(`hr`,eo).replace(`heading`,` *#{1,6} *[^
3
- ]`).replace(`lheading`,io).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},bo=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xo=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,So=/^( {2,}|\\)\n(?!\s*$)/,Co=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,wo=/[\p{P}\p{S}]/u,To=/[\s\p{P}\p{S}]/u,Eo=/[^\s\p{P}\p{S}]/u,Do=Ja(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,To).getRegex(),Oo=/(?!~)[\p{P}\p{S}]/u,ko=/(?!~)[\s\p{P}\p{S}]/u,Ao=/(?:[^\s\p{P}\p{S}]|~)/u,jo=Ja(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Ya?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Mo=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,No=Ja(Mo,`u`).replace(/punct/g,wo).getRegex(),Po=Ja(Mo,`u`).replace(/punct/g,Oo).getRegex(),Fo=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Io=Ja(Fo,`gu`).replace(/notPunctSpace/g,Eo).replace(/punctSpace/g,To).replace(/punct/g,wo).getRegex(),Lo=Ja(Fo,`gu`).replace(/notPunctSpace/g,Ao).replace(/punctSpace/g,ko).replace(/punct/g,Oo).getRegex(),Ro=Ja(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Eo).replace(/punctSpace/g,To).replace(/punct/g,wo).getRegex(),zo=Ja(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,wo).getRegex(),Bo=Ja(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Eo).replace(/punctSpace/g,To).replace(/punct/g,wo).getRegex(),Vo=Ja(/\\(punct)/,`gu`).replace(/punct/g,wo).getRegex(),Ho=Ja(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Uo=Ja(po).replace(`(?:-->|$)`,`-->`).getRegex(),Wo=Ja(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Uo).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Go=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ko=Ja(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Go).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qo=Ja(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Go).replace(`ref`,co).getRegex(),Jo=Ja(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,co).getRegex(),Yo=Ja(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,qo).replace(`nolink`,Jo).getRegex(),Xo=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Zo={_backpedal:qa,anyPunctuation:Vo,autolink:Ho,blockSkip:jo,br:So,code:xo,del:qa,delLDelim:qa,delRDelim:qa,emStrongLDelim:No,emStrongRDelimAst:Io,emStrongRDelimUnd:Ro,escape:bo,link:Ko,nolink:Jo,punctuation:Do,reflink:qo,reflinkSearch:Yo,tag:Wo,text:Co,url:qa},Qo={...Zo,link:Ja(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Go).getRegex(),reflink:Ja(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Go).getRegex()},$o={...Zo,emStrongRDelimAst:Lo,emStrongLDelim:Po,delLDelim:zo,delRDelim:Bo,url:Ja(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Xo).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ja(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Xo).getRegex()},es={...$o,br:Ja(So).replace(`{2,}`,`*`).getRegex(),text:Ja($o.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},ts={normal:go,gfm:vo,pedantic:yo},ns={normal:Zo,gfm:$o,breaks:es,pedantic:Qo},rs={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},is=e=>rs[e];function as(e,t){if(t){if(Xa.escapeTest.test(e))return e.replace(Xa.escapeReplace,is)}else if(Xa.escapeTestNoEncode.test(e))return e.replace(Xa.escapeReplaceNoEncode,is);return e}function os(e){try{e=encodeURI(e).replace(Xa.percentDecode,`%`)}catch{return null}return e}function ss(e,t){let n=e.replace(Xa.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Xa.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(Xa.slashPipe,`|`);return n}function cs(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function ls(e){let t=e.split(`
4
- `),n=t.length-1;for(;n>=0&&!t[n].trim();)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
5
- `)}function us(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function ds(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function fs(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function ps(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
6
- `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
7
- `)}var ms=class{options;rules;lexer;constructor(e){this.options=e||Ga}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:ls(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=ps(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=cs(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:cs(t[0],`
8
- `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:cs(t[0],`
9
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=cs(t[0],`
10
- `).split(`
11
- `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
12
- `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
13
- $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
14
- ${s}`:s,r=r?`${r}
15
- ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
16
- `+e.join(`
17
- `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
18
- `+e.join(`
19
- `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
20
- `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=ds(t[2].split(`
21
- `,1)[0],t[1].length),l=e.split(`
22
- `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
23
- `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
24
- `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
25
- `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
26
- `+l}u=!l.trim(),r+=p+`
27
- `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=ls(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:cs(t[0],`
28
- `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=ss(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
29
- `):[],a={type:`table`,raw:cs(t[0],`
30
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(ss(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:cs(t[0],`
31
- `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
32
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=cs(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=us(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),fs(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return fs(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},hs=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ga,this.options.tokenizer=this.options.tokenizer||new ms,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Xa,block:ts.normal,inline:ns.normal};this.options.pedantic?(t.block=ts.pedantic,t.inline=ns.pedantic):this.options.gfm&&(t.block=ts.gfm,this.options.breaks?t.inline=ns.breaks:t.inline=ns.gfm),this.tokenizer.rules=t}static get rules(){return{block:ts,inline:ns}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Xa.carriageReturn,`
33
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Xa.tabCharGlobal,` `).replace(Xa.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
34
- `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
35
- `)?``:`
36
- `)+r.raw,n.text+=`
37
- `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
38
- `)?``:`
39
- `)+r.raw,n.text+=`
40
- `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
41
- `)?``:`
42
- `)+r.raw,a.text+=`
43
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
44
- `)?``:`
45
- `)+r.raw,n.text+=`
46
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},gs=class{options;parser;constructor(e){this.options=e||Ga}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Xa.notSpaceStart)?.[0],i=e.replace(Xa.endingNewline,``)+`
47
- `;return r?`<pre><code class="language-`+as(r)+`">`+(n?i:as(i,!0))+`</code></pre>
48
- `:`<pre><code>`+(n?i:as(i,!0))+`</code></pre>
49
- `}blockquote({tokens:e}){return`<blockquote>
50
- ${this.parser.parse(e)}</blockquote>
51
- `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
52
- `}hr(e){return`<hr>
53
- `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
54
- `+r+`</`+i+`>
55
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
56
- `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
57
- `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
58
- <thead>
59
- `+t+`</thead>
60
- `+r+`</table>
61
- `}tablerow({text:e}){return`<tr>
62
- ${e}</tr>
63
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
64
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${as(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=os(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+as(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=os(e);if(i===null)return as(n);e=i;let a=`<img src="${e}" alt="${as(n)}"`;return t&&(a+=` title="${as(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:as(e.text)}},_s=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},vs=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ga,this.options.renderer=this.options.renderer||new gs,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _s}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},ys=class{options;block;constructor(e){this.options=e||Ga}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?hs.lex:hs.lexInline}provideParser(e=this.block){return e?vs.parse:vs.parseInline}},bs=new class{defaults=Wa();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=vs;Renderer=gs;TextRenderer=_s;Lexer=hs;Tokenizer=ms;Hooks=ys;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new gs(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ms(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ys;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];ys.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&ys.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return hs.lex(e,t??this.defaults)}parser(e,t){return vs.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?hs.lex:hs.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?vs.parse:vs.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?hs.lex:hs.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?vs.parse:vs.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
65
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+as(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function xs(e,t){return bs.parse(e,t)}xs.options=xs.setOptions=function(e){return bs.setOptions(e),xs.defaults=bs.defaults,Ka(xs.defaults),xs},xs.getDefaults=Wa,xs.defaults=Ga,xs.use=function(...e){return bs.use(...e),xs.defaults=bs.defaults,Ka(xs.defaults),xs},xs.walkTokens=function(e,t){return bs.walkTokens(e,t)},xs.parseInline=bs.parseInline,xs.Parser=vs,xs.parser=vs.parse,xs.Renderer=gs,xs.TextRenderer=_s,xs.Lexer=hs,xs.lexer=hs.lex,xs.Tokenizer=ms,xs.Hooks=ys,xs.parse=xs,xs.options,xs.setOptions,xs.use,xs.walkTokens,xs.parseInline,vs.parse,hs.lex;var{entries:Ss,setPrototypeOf:Cs,isFrozen:ws,getPrototypeOf:Ts,getOwnPropertyDescriptor:Es}=Object,{freeze:Ds,seal:Os,create:ks}=Object,{apply:As,construct:js}=typeof Reflect<`u`&&Reflect;Ds||=function(e){return e},Os||=function(e){return e},As||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},js||=function(e){return new e(...[...arguments].slice(1))};var Ms=Ks(Array.prototype.forEach),Ns=Ks(Array.prototype.lastIndexOf),Ps=Ks(Array.prototype.pop),Fs=Ks(Array.prototype.push),Is=Ks(Array.prototype.splice),Ls=Ks(String.prototype.toLowerCase),Rs=Ks(String.prototype.toString),zs=Ks(String.prototype.match),Bs=Ks(String.prototype.replace),Vs=Ks(String.prototype.indexOf),Hs=Ks(String.prototype.trim),Us=Ks(Object.prototype.hasOwnProperty),Ws=Ks(RegExp.prototype.test),Gs=qs(TypeError);function Ks(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return As(e,t,n)}}function qs(e){return function(){return js(e,[...arguments])}}function Q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ls;Cs&&Cs(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ws(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Js(e){for(let t=0;t<e.length;t++)Us(e,t)||(e[t]=null);return e}function Ys(e){let t=ks(null);for(let[n,r]of Ss(e))Us(e,n)&&(Array.isArray(r)?t[n]=Js(r):r&&typeof r==`object`&&r.constructor===Object?t[n]=Ys(r):t[n]=r);return t}function Xs(e,t){for(;e!==null;){let n=Es(e,t);if(n){if(n.get)return Ks(n.get);if(typeof n.value==`function`)return Ks(n.value)}e=Ts(e)}function n(){return null}return n}var Zs=Ds(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Qs=Ds(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),$s=Ds([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),ec=Ds([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),tc=Ds(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),nc=Ds([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),rc=Ds([`#text`]),ic=Ds(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot`.split(`.`)),ac=Ds(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),oc=Ds(`accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),sc=Ds([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),cc=Os(/\{\{[\w\W]*|[\w\W]*\}\}/gm),lc=Os(/<%[\w\W]*|[\w\W]*%>/gm),uc=Os(/\$\{[\w\W]*/gm),dc=Os(/^data-[\-\w.\u00B7-\uFFFF]+$/),fc=Os(/^aria-[\-\w]+$/),pc=Os(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mc=Os(/^(?:\w+script|data):/i),hc=Os(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gc=Os(/^html$/i),_c=Os(/^[a-z][.\w]*(-[.\w]+)+$/i),vc=Object.freeze({__proto__:null,ARIA_ATTR:fc,ATTR_WHITESPACE:hc,CUSTOM_ELEMENT:_c,DATA_ATTR:dc,DOCTYPE_NAME:gc,ERB_EXPR:lc,IS_ALLOWED_URI:pc,IS_SCRIPT_OR_DATA:mc,MUSTACHE_EXPR:cc,TMPLIT_EXPR:uc}),yc={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bc=function(){return typeof window>`u`?null:window},xc=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Sc=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Cc(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bc(),t=e=>Cc(e);if(t.version=`3.3.3`,t.removed=[],!e||!e.document||e.document.nodeType!==yc.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:c,NodeFilter:l,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=c.prototype,h=Xs(m,`cloneNode`),g=Xs(m,`remove`),_=Xs(m,`nextSibling`),v=Xs(m,`childNodes`),y=Xs(m,`parentNode`);if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let b,x=``,{implementation:S,createNodeIterator:C,createDocumentFragment:w,getElementsByTagName:T}=n,{importNode:E}=r,D=Sc();t.isSupported=typeof Ss==`function`&&typeof y==`function`&&S&&S.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ee,ERB_EXPR:te,TMPLIT_EXPR:ne,DATA_ATTR:re,ARIA_ATTR:ie,IS_SCRIPT_OR_DATA:ae,ATTR_WHITESPACE:oe,CUSTOM_ELEMENT:se}=vc,{IS_ALLOWED_URI:ce}=vc,le=null,ue=Q({},[...Zs,...Qs,...$s,...tc,...rc]),de=null,fe=Q({},[...ic,...ac,...oc,...sc]),pe=Object.seal(ks(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),me=null,he=null,ge=Object.seal(ks(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),_e=!0,ve=!0,ye=!1,be=!0,xe=!1,Se=!0,Ce=!1,we=!1,Te=!1,Ee=!1,De=!1,Oe=!1,ke=!0,O=!1,Ae=!0,k=!1,je={},Me=null,A=Q({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Ne=null,Pe=Q({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Fe=null,Ie=Q({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Le=`http://www.w3.org/1998/Math/MathML`,Re=`http://www.w3.org/2000/svg`,ze=`http://www.w3.org/1999/xhtml`,Be=ze,Ve=!1,He=null,Ue=Q({},[Le,Re,ze],Rs),We=Q({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ge=Q({},[`annotation-xml`]),Ke=Q({},[`title`,`style`,`font`,`a`,`script`]),qe=null,Je=[`application/xhtml+xml`,`text/html`],Ye=null,Xe=null,Ze=n.createElement(`form`),Qe=function(e){return e instanceof RegExp||e instanceof Function},$e=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Xe&&Xe===e)){if((!e||typeof e!=`object`)&&(e={}),e=Ys(e),qe=Je.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Ye=qe===`application/xhtml+xml`?Rs:Ls,le=Us(e,`ALLOWED_TAGS`)?Q({},e.ALLOWED_TAGS,Ye):ue,de=Us(e,`ALLOWED_ATTR`)?Q({},e.ALLOWED_ATTR,Ye):fe,He=Us(e,`ALLOWED_NAMESPACES`)?Q({},e.ALLOWED_NAMESPACES,Rs):Ue,Fe=Us(e,`ADD_URI_SAFE_ATTR`)?Q(Ys(Ie),e.ADD_URI_SAFE_ATTR,Ye):Ie,Ne=Us(e,`ADD_DATA_URI_TAGS`)?Q(Ys(Pe),e.ADD_DATA_URI_TAGS,Ye):Pe,Me=Us(e,`FORBID_CONTENTS`)?Q({},e.FORBID_CONTENTS,Ye):A,me=Us(e,`FORBID_TAGS`)?Q({},e.FORBID_TAGS,Ye):Ys({}),he=Us(e,`FORBID_ATTR`)?Q({},e.FORBID_ATTR,Ye):Ys({}),je=Us(e,`USE_PROFILES`)?e.USE_PROFILES:!1,_e=e.ALLOW_ARIA_ATTR!==!1,ve=e.ALLOW_DATA_ATTR!==!1,ye=e.ALLOW_UNKNOWN_PROTOCOLS||!1,be=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xe=e.SAFE_FOR_TEMPLATES||!1,Se=e.SAFE_FOR_XML!==!1,Ce=e.WHOLE_DOCUMENT||!1,Ee=e.RETURN_DOM||!1,De=e.RETURN_DOM_FRAGMENT||!1,Oe=e.RETURN_TRUSTED_TYPE||!1,Te=e.FORCE_BODY||!1,ke=e.SANITIZE_DOM!==!1,O=e.SANITIZE_NAMED_PROPS||!1,Ae=e.KEEP_CONTENT!==!1,k=e.IN_PLACE||!1,ce=e.ALLOWED_URI_REGEXP||pc,Be=e.NAMESPACE||ze,We=e.MATHML_TEXT_INTEGRATION_POINTS||We,Ge=e.HTML_INTEGRATION_POINTS||Ge,pe=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Qe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(pe.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Qe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(pe.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements==`boolean`&&(pe.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),xe&&(ve=!1),De&&(Ee=!0),je&&(le=Q({},rc),de=ks(null),je.html===!0&&(Q(le,Zs),Q(de,ic)),je.svg===!0&&(Q(le,Qs),Q(de,ac),Q(de,sc)),je.svgFilters===!0&&(Q(le,$s),Q(de,ac),Q(de,sc)),je.mathMl===!0&&(Q(le,tc),Q(de,oc),Q(de,sc))),Us(e,`ADD_TAGS`)||(ge.tagCheck=null),Us(e,`ADD_ATTR`)||(ge.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS==`function`?ge.tagCheck=e.ADD_TAGS:(le===ue&&(le=Ys(le)),Q(le,e.ADD_TAGS,Ye))),e.ADD_ATTR&&(typeof e.ADD_ATTR==`function`?ge.attributeCheck=e.ADD_ATTR:(de===fe&&(de=Ys(de)),Q(de,e.ADD_ATTR,Ye))),e.ADD_URI_SAFE_ATTR&&Q(Fe,e.ADD_URI_SAFE_ATTR,Ye),e.FORBID_CONTENTS&&(Me===A&&(Me=Ys(Me)),Q(Me,e.FORBID_CONTENTS,Ye)),e.ADD_FORBID_CONTENTS&&(Me===A&&(Me=Ys(Me)),Q(Me,e.ADD_FORBID_CONTENTS,Ye)),Ae&&(le[`#text`]=!0),Ce&&Q(le,[`html`,`head`,`body`]),le.table&&(Q(le,[`tbody`]),delete me.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Gs(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Gs(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);b=e.TRUSTED_TYPES_POLICY,x=b.createHTML(``)}else b===void 0&&(b=xc(p,i)),b!==null&&typeof x==`string`&&(x=b.createHTML(``));Ds&&Ds(e),Xe=e}},et=Q({},[...Qs,...$s,...ec]),tt=Q({},[...tc,...nc]),nt=function(e){let t=y(e);(!t||!t.tagName)&&(t={namespaceURI:Be,tagName:`template`});let n=Ls(e.tagName),r=Ls(t.tagName);return He[e.namespaceURI]?e.namespaceURI===Re?t.namespaceURI===ze?n===`svg`:t.namespaceURI===Le?n===`svg`&&(r===`annotation-xml`||We[r]):!!et[n]:e.namespaceURI===Le?t.namespaceURI===ze?n===`math`:t.namespaceURI===Re?n===`math`&&Ge[r]:!!tt[n]:e.namespaceURI===ze?t.namespaceURI===Re&&!Ge[r]||t.namespaceURI===Le&&!We[r]?!1:!tt[n]&&(Ke[n]||!et[n]):!!(qe===`application/xhtml+xml`&&He[e.namespaceURI]):!1},rt=function(e){Fs(t.removed,{element:e});try{y(e).removeChild(e)}catch{g(e)}},it=function(e,n){try{Fs(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Fs(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Ee||De)try{rt(n)}catch{}else try{n.setAttribute(e,``)}catch{}},at=function(e){let t=null,r=null;if(Te)e=`<remove></remove>`+e;else{let t=zs(e,/^[\r\n\t ]+/);r=t&&t[0]}qe===`application/xhtml+xml`&&Be===ze&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=b?b.createHTML(e):e;if(Be===ze)try{t=new f().parseFromString(i,qe)}catch{}if(!t||!t.documentElement){t=S.createDocument(Be,`template`,null);try{t.documentElement.innerHTML=Ve?x:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Be===ze?T.call(t,Ce?`html`:`body`)[0]:Ce?t.documentElement:a},ot=function(e){return C.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},j=function(e){return e instanceof d&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof u)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},st=function(e){return typeof s==`function`&&e instanceof s};function M(e,n,r){Ms(e,e=>{e.call(t,n,r,Xe)})}let ct=function(e){let n=null;if(M(D.beforeSanitizeElements,e,null),j(e))return rt(e),!0;let r=Ye(e.nodeName);if(M(D.uponSanitizeElement,e,{tagName:r,allowedTags:le}),Se&&e.hasChildNodes()&&!st(e.firstElementChild)&&Ws(/<[/\w!]/g,e.innerHTML)&&Ws(/<[/\w!]/g,e.textContent)||e.nodeType===yc.progressingInstruction||Se&&e.nodeType===yc.comment&&Ws(/<[/\w]/g,e.data))return rt(e),!0;if(!(ge.tagCheck instanceof Function&&ge.tagCheck(r))&&(!le[r]||me[r])){if(!me[r]&&ut(r)&&(pe.tagNameCheck instanceof RegExp&&Ws(pe.tagNameCheck,r)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(r)))return!1;if(Ae&&!Me[r]){let t=y(e)||e.parentNode,n=v(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=h(n[i],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,_(e))}}}return rt(e),!0}return e instanceof c&&!nt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ws(/<\/no(script|embed|frames)/i,e.innerHTML)?(rt(e),!0):(xe&&e.nodeType===yc.text&&(n=e.textContent,Ms([ee,te,ne],e=>{n=Bs(n,e,` `)}),e.textContent!==n&&(Fs(t.removed,{element:e.cloneNode()}),e.textContent=n)),M(D.afterSanitizeElements,e,null),!1)},lt=function(e,t,r){if(he[t]||ke&&(t===`id`||t===`name`)&&(r in n||r in Ze))return!1;if(!(ve&&!he[t]&&Ws(re,t))&&!(_e&&Ws(ie,t))&&!(ge.attributeCheck instanceof Function&&ge.attributeCheck(t,e))){if(!de[t]||he[t]){if(!(ut(e)&&(pe.tagNameCheck instanceof RegExp&&Ws(pe.tagNameCheck,e)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(e))&&(pe.attributeNameCheck instanceof RegExp&&Ws(pe.attributeNameCheck,t)||pe.attributeNameCheck instanceof Function&&pe.attributeNameCheck(t,e))||t===`is`&&pe.allowCustomizedBuiltInElements&&(pe.tagNameCheck instanceof RegExp&&Ws(pe.tagNameCheck,r)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(r))))return!1}else if(!Fe[t]&&!Ws(ce,Bs(r,oe,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Vs(r,`data:`)===0&&Ne[e])&&!(ye&&!Ws(ae,Bs(r,oe,``)))&&r)return!1}return!0},ut=function(e){return e!==`annotation-xml`&&zs(e,se)},N=function(e){M(D.beforeSanitizeAttributes,e,null);let{attributes:n}=e;if(!n||j(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:de,forceKeepAttr:void 0},i=n.length;for(;i--;){let{name:a,namespaceURI:o,value:s}=n[i],c=Ye(a),l=s,u=a===`value`?l:Hs(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,M(D.uponSanitizeAttribute,e,r),u=r.attrValue,O&&(c===`id`||c===`name`)&&(it(a,e),u=`user-content-`+u),Se&&Ws(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,u)){it(a,e);continue}if(c===`attributename`&&zs(u,`href`)){it(a,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){it(a,e);continue}if(!be&&Ws(/\/>/i,u)){it(a,e);continue}xe&&Ms([ee,te,ne],e=>{u=Bs(u,e,` `)});let d=Ye(e.nodeName);if(!lt(d,c,u)){it(a,e);continue}if(b&&typeof p==`object`&&typeof p.getAttributeType==`function`&&!o)switch(p.getAttributeType(d,c)){case`TrustedHTML`:u=b.createHTML(u);break;case`TrustedScriptURL`:u=b.createScriptURL(u);break}if(u!==l)try{o?e.setAttributeNS(o,a,u):e.setAttribute(a,u),j(e)?rt(e):Ps(t.removed)}catch{it(a,e)}}M(D.afterSanitizeAttributes,e,null)},dt=function e(t){let n=null,r=ot(t);for(M(D.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)M(D.uponSanitizeShadowNode,n,null),ct(n),N(n),n.content instanceof a&&e(n.content);M(D.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,c=null,l=null;if(Ve=!e,Ve&&(e=`<!-->`),typeof e!=`string`&&!st(e))if(typeof e.toString==`function`){if(e=e.toString(),typeof e!=`string`)throw Gs(`dirty is not a string, aborting`)}else throw Gs(`toString is not a function`);if(!t.isSupported)return e;if(we||$e(n),t.removed=[],typeof e==`string`&&(k=!1),k){if(e.nodeName){let t=Ye(e.nodeName);if(!le[t]||me[t])throw Gs(`root node is forbidden and cannot be sanitized in-place`)}}else if(e instanceof s)i=at(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===yc.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o);else{if(!Ee&&!xe&&!Ce&&e.indexOf(`<`)===-1)return b&&Oe?b.createHTML(e):e;if(i=at(e),!i)return Ee?null:Oe?x:``}i&&Te&&rt(i.firstChild);let u=ot(k?e:i);for(;c=u.nextNode();)ct(c),N(c),c.content instanceof a&&dt(c.content);if(k)return e;if(Ee){if(De)for(l=w.call(i.ownerDocument);i.firstChild;)l.appendChild(i.firstChild);else l=i;return(de.shadowroot||de.shadowrootmode)&&(l=E.call(r,l,!0)),l}let d=Ce?i.outerHTML:i.innerHTML;return Ce&&le[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ws(gc,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
66
- `+d),xe&&Ms([ee,te,ne],e=>{d=Bs(d,e,` `)}),b&&Oe?b.createHTML(d):d},t.setConfig=function(){$e(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),we=!0},t.clearConfig=function(){Xe=null,we=!1},t.isValidAttribute=function(e,t,n){return Xe||$e({}),lt(Ye(e),Ye(t),n)},t.addHook=function(e,t){typeof t==`function`&&Fs(D[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Ns(D[e],t);return n===-1?void 0:Is(D[e],n,1)[0]}return Ps(D[e])},t.removeHooks=function(e){D[e]=[]},t.removeAllHooks=function(){D=Sc()},t}var wc=Cc();function Tc(e){let t=new Date(e),n=Math.floor((new Date().getTime()-t.getTime())/1e3);return n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<604800?`${Math.floor(n/86400)}d ago`:t.toLocaleDateString()}function Ec(e){return e?e>=1e6?(e/1e6).toFixed(1)+`M`:e>=1e3?(e/1e3).toFixed(1)+`k`:e.toString():`0`}function Dc(e){if(!e||e<=0)return`0m`;if(e<60)return`${Math.round(e)}s`;let t=e/60;if(t<60)return`${Math.round(t)}m`;let n=t/60;return n<24?`${Math.round(n)}h`:`${Math.round(n/24)}d`}function Oc(e){return e.split(/[\/\-_.]/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()||``).join(``).slice(0,2)||`RP`}function kc(e){return{backlog:`status-backlog`,pending:`status-pending`,in_progress:`status-inprogress`,completed:`status-completed`,blocked:`status-blocked`,canceled:`status-canceled`}[e]||`status-default`}function Ac(e){return{backlog:`Backlog`,pending:`To Do`,in_progress:`In Progress`,completed:`Completed`,blocked:`Blocked`,canceled:`Canceled`}[e]||e}function jc(e){return{1:`Low`,2:`Normal`,3:`Medium`,4:`High`,5:`Critical`}[e]||String(e)}function Mc(e){try{let t=xs.parse(e||``);return wc.sanitize(t)}catch{return e||``}}function Nc(e,t){let n=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t,i.click(),URL.revokeObjectURL(r)}function Pc(e,t){if(!e.length)return;let n=Object.keys(e[0]),r=[n.join(`,`),...e.map(e=>n.map(t=>JSON.stringify(e[t]??``)).join(`,`))].join(`
67
- `),i=new Blob([r],{type:`text/csv`}),a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=t,o.click(),URL.revokeObjectURL(a)}function Fc(e,t){let n;return((...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)})}async function Ic(e){if(!e)return!1;try{return await navigator.clipboard.writeText(e),!0}catch(e){return console.error(`Failed to copy text: `,e),!1}}function Lc(e){let t=null;function n(t){ma.set(t),localStorage.setItem(`selectedRepo`,t),e&&e(t)}function r(e,t){t.preventDefault(),t.stopPropagation(),ga.update(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}function i(){ha.update(e=>!e)}function a(e,n){t=e,n.dataTransfer&&(n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,e)),n.currentTarget.classList.add(`opacity-50`)}function o(e,n){!t||t===e||(n.preventDefault(),n.dataTransfer&&(n.dataTransfer.dropEffect=`move`))}function s(e,n){n.preventDefault();let r=t||n.dataTransfer?.getData(`text/plain`);!r||r===e||(ga.update(t=>{let n=t.filter(e=>e!==r),i=n.indexOf(e);return n.splice(i,0,r),n}),t=null)}function c(e){t=null,e.currentTarget.classList.remove(`opacity-50`),document.querySelectorAll(`.repo-item.drag-over`).forEach(e=>e.classList.remove(`drag-over`))}return{selectRepo:n,togglePin:r,toggleCollapse:i,onDragStart:a,onDragOver:o,onDrop:s,onDragEnd:c,getRepoInitials:Oc}}var Rc=Yr(`<circle cx="12" cy="12" r="10"></circle><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path><path d="M12 17h.01"></path>`,1),zc=Yr(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><!></svg>`);function $(e,t){let n=Z(t,`name`,8),r=Z(t,`size`,8,16),i=Z(t,`strokeWidth`,8,1.75),a=Z(t,`className`,8,``),o={brain:`<path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"/><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"/><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"/><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"/><path d="M3.477 10.896a4 4 0 0 1 .585-.396"/><path d="M19.938 10.5a4 4 0 0 1 .585.396"/><path d="M6 18a4 4 0 0 1-1.967-.516"/><path d="M19.967 17.484A4 4 0 0 1 18 18"/>`,"layout-dashboard":`<rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/>`,database:`<ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5V19A9 3 0 0 0 21 19V5"/><path d="M3 12A9 3 0 0 0 21 12"/>`,"clipboard-list":`<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="M12 11h4"/><path d="M12 16h4"/><path d="M8 11h.01"/><path d="M8 16h.01"/>`,"book-open":`<path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/>`,"refresh-cw":`<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>`,sun:`<circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/>`,moon:`<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>`,menu:`<line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="18" y2="18"/>`,"chevron-left":`<path d="m15 18-6-6 6-6"/>`,"chevron-right":`<path d="m9 18 6-6-6-6"/>`,"chevron-down":`<path d="m6 9 6 6 6-6"/>`,x:`<path d="M18 6 6 18"/><path d="m6 6 12 12"/>`,plus:`<path d="M5 12h14"/><path d="M12 5v14"/>`,search:`<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>`,pin:`<path d="M12.586 2.586a2 2 0 0 1 2.828 0l2 2a2 2 0 0 1 0 2.828l-1.793 1.793-.914 4.57a1 1 0 0 1-.271.51l-1.414 1.414a1 1 0 0 1-1.414 0l-2.122-2.121-4.172 4.171a1 1 0 1 1-1.414-1.414l4.171-4.172-2.12-2.12a1 1 0 0 1 0-1.415l1.413-1.414a1 1 0 0 1 .51-.27l4.57-.915 1.792-1.793Z"/>`,star:`<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/>`,edit:`<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4Z"/>`,trash:`<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>`,copy:`<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>`,"external-link":`<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>`,filter:`<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/>`,sliders:`<line x1="4" x2="4" y1="21" y2="14"/><line x1="4" x2="4" y1="6" y2="3"/><line x1="12" x2="12" y1="21" y2="12"/><line x1="12" x2="12" y1="6" y2="3"/><line x1="20" x2="20" y1="21" y2="16"/><line x1="20" x2="20" y1="10" y2="3"/><line x1="1" x2="7" y1="14" y2="14"/><line x1="9" x2="15" y1="12" y2="12"/><line x1="17" x2="23" y1="16" y2="16"/>`,"circle-dot":`<circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="1"/>`,"circle-check":`<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>`,"circle-x":`<circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/>`,"circle-pause":`<circle cx="12" cy="12" r="10"/><line x1="10" x2="10" y1="15" y2="9"/><line x1="14" x2="14" y1="15" y2="9"/>`,"circle-pause-alt":`<circle cx="12" cy="12" r="10"/><path d="M10 9v6"/><path d="M14 9v6"/>`,"triangle-alert":`<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/>`,check:`<path d="M20 6 9 17l-5-5"/>`,info:`<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>`,zap:`<path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"/>`,activity:`<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"/>`,memory:`<path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"/><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"/>`,"git-branch":`<line x1="6" x2="6" y1="3" y2="15"/><circle cx="18" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><path d="M18 9a9 9 0 0 1-9 9"/>`,tag:`<path d="M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"/><circle cx="7.5" cy="7.5" r=".5" fill="currentColor"/>`,user:`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>`,bot:`<path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M15 13v2"/><path d="M9 13v2"/>`,code:`<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>`,terminal:`<polyline points="4 17 10 11 4 5"/><line x1="12" x2="20" y1="19" y2="19"/>`,"file-text":`<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>`,layers:`<path d="m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"/><path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"/><path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"/>`,cpu:`<rect x="4" y="4" width="16" height="16" rx="2"/><rect x="9" y="9" width="6" height="6"/><path d="M15 2v2"/><path d="M15 20v2"/><path d="M2 15h2"/><path d="M2 9h2"/><path d="M20 15h2"/><path d="M20 9h2"/><path d="M9 2v2"/><path d="M9 20v2"/>`,clock:`<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>`,calendar:`<rect width="18" height="18" x="3" y="4" rx="2" ry="2"/><line x1="16" x2="16" y1="2" y2="6"/><line x1="8" x2="8" y1="2" y2="6"/><line x1="3" x2="21" y1="10" y2="10"/>`,"arrow-up":`<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>`,"arrow-down":`<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>`,"arrow-right":`<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>`,"trending-up":`<polyline points="22 7 13.5 15.5 8.5 10.5 2 17"/><polyline points="16 7 22 7 22 13"/>`,"bar-chart":`<line x1="12" x2="12" y1="20" y2="10"/><line x1="18" x2="18" y1="20" y2="4"/><line x1="6" x2="6" y1="20" y2="16"/>`,list:`<line x1="8" x2="21" y1="6" y2="6"/><line x1="8" x2="21" y1="12" y2="12"/><line x1="8" x2="21" y1="18" y2="18"/><line x1="3" x2="3.01" y1="6" y2="6"/><line x1="3" x2="3.01" y1="12" y2="12"/><line x1="3" x2="3.01" y1="18" y2="18"/>`,tool:`<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/>`,columns:`<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="12" x2="12" y1="3" y2="21"/>`,sparkle:`<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>`,settings:`<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/>`,wifi:`<path d="M5 12.55a11 11 0 0 1 14.08 0"/><path d="M1.42 9a16 16 0 0 1 21.16 0"/><path d="M8.53 16.11a6 6 0 0 1 6.95 0"/><line x1="12" x2="12.01" y1="20" y2="20"/>`,hash:`<line x1="4" x2="20" y1="9" y2="9"/><line x1="4" x2="20" y1="15" y2="15"/><line x1="10" x2="8" y1="3" y2="21"/><line x1="16" x2="14" y1="3" y2="21"/>`,inbox:`<polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>`,archive:`<rect width="20" height="5" x="2" y="3" rx="1"/><path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"/><path d="M10 12h4"/>`};var s=zc(),c=F(s),l=e=>{var t=Xr();di(I(t),()=>(U(n()),H(()=>o[n()])),void 0,!0),K(e,t)},u=e=>{var t=Rc();Ne(2),K(e,t)};J(c,e=>{U(n()),H(()=>o[n()])?e(l):e(u,-1)}),A(s),R(()=>{Wi(s,`width`,r()),Wi(s,`height`,r()),Wi(s,`stroke-width`,i()),Ai(s,0,wi(a()))}),K(e,s)}var Bc=G(`<div class="flex items-center gap-2"><div class="brand-icon svelte-vbr9x3"><!></div> <div><div class="font-bold text-sm" style="color:var(--color-text);letter-spacing:-0.02em;">Memory MCP</div> <div class="section-label" style="font-size:0.6rem;margin-top:0;">Dashboard</div></div></div>`),Vc=G(`<div class="brand-icon svelte-vbr9x3" style="margin:auto;"><!></div>`),Hc=G(`<div class="p-3" style="border-bottom: 1px solid var(--color-border);"><div class="search-wrapper svelte-vbr9x3"><span class="search-icon svelte-vbr9x3"><!></span> <input class="form-input search-input svelte-vbr9x3" type="text" placeholder="Search repos…"/></div></div>`),Uc=G(`<div class="repo-active-indicator"></div>`),Wc=G(`<span class="task-badge active svelte-vbr9x3"><!> </span>`),Gc=G(`<span class="task-badge todo svelte-vbr9x3"><!> </span>`),Kc=G(`<span class="task-badge blocked svelte-vbr9x3"><!> </span>`),qc=G(`<span class="task-badge backlog svelte-vbr9x3"><!> </span>`),Jc=G(`<div class="task-badges svelte-vbr9x3"><!> <!> <!> <!></div>`),Yc=G(`<div role="button" tabindex="0" draggable="true"><!> <div class="repo-avatar"> <span class="pin-star svelte-vbr9x3">★</span></div> <div class="min-w-0 flex-1"><div class="truncate font-semibold" style="font-size:0.82rem;color:var(--color-text);"> </div> <div class="truncate flex items-center gap-1" style="font-size:0.68rem;color:var(--color-text-muted);margin-bottom:2px;"><!> </div> <!></div> <button class="pin-btn svelte-vbr9x3" title="Unpin" aria-label="Unpin repository"><!></button></div>`),Xc=G(`<div class="group-label svelte-vbr9x3"><!> Pinned</div> <!>`,1),Zc=G(`<div class="group-label svelte-vbr9x3" style="margin-top:6px;"><!> All</div>`),Qc=G(`<div class="repo-active-indicator"></div>`),$c=G(`<span class="task-badge active svelte-vbr9x3"><!> </span>`),el=G(`<span class="task-badge todo svelte-vbr9x3"><!> </span>`),tl=G(`<span class="task-badge blocked svelte-vbr9x3"><!> </span>`),nl=G(`<span class="task-badge backlog svelte-vbr9x3"><!> </span>`),rl=G(`<div class="task-badges svelte-vbr9x3"><!> <!> <!> <!></div>`),il=G(`<div role="button" tabindex="0"><!> <div class="repo-avatar"> </div> <div class="min-w-0 flex-1"><div class="truncate font-semibold" style="font-size:0.82rem;color:var(--color-text);"> </div> <div class="truncate flex items-center gap-1" style="font-size:0.68rem;color:var(--color-text-muted);margin-bottom:2px;"><!> </div> <!></div> <button class="pin-btn svelte-vbr9x3" title="Pin" aria-label="Pin repository"><!></button></div>`),al=G(`<!> <!>`,1),ol=G(`<div style="text-align:center;padding:24px 16px;color:var(--color-text-muted);"><!> <div style="font-size:0.82rem;margin-top:8px;">No repositories found</div></div>`),sl=G(`<div class="flex items-center justify-between px-2 py-1 mb-1"><span class="section-label">Repositories</span> <span class="repo-count-chip svelte-vbr9x3"> </span></div> <!> <!> <!>`,1),cl=G(`<div class="repo-active-indicator"></div>`),ll=G(`<div role="button" tabindex="0"><!> <div class="repo-avatar" style="margin:auto;"> </div></div>`),ul=G(`<aside style="border-right: 1px solid var(--color-border);"><div class="sidebar-header svelte-vbr9x3" style="border-bottom: 1px solid var(--color-border);"><!> <button class="btn btn-ghost btn-icon btn-sm collapse-btn svelte-vbr9x3"><span><!></span></button></div> <!> <div class="overflow-y-auto flex-1 p-2" style="scrollbar-width: thin;"><!></div></aside>`);function dl(e,t){We(t,!1);let n=()=>N(ha,`$isRepoSidebarCollapsed`,s),r=()=>N(_a,`$repoSearchQuery`,s),i=()=>N(pa,`$availableRepos`,s),a=()=>N(La,`$orderedRepos`,s),o=()=>N(ma,`$currentRepo`,s),[s,c]=ft(),l=on(),u=Lc(Z(t,`onRepoSelect`,8,()=>{})());Un(()=>n(),()=>{sn(l,n())}),Wn(),na();var d=ul();let f;var p=F(d),m=F(p),h=e=>{var t=Bc(),n=F(t);$(F(n),{name:`brain`,size:14,strokeWidth:1.75}),A(n),Ne(2),A(t),K(e,t)},g=e=>{var t=Vc();$(F(t),{name:`brain`,size:14,strokeWidth:1.75}),A(t),K(e,t)};J(m,e=>{V(l)?e(g,-1):e(h)});var _=L(m,2),v=F(_);$(F(v),{name:`chevron-left`,size:14,strokeWidth:2}),A(v),A(_),A(p);var y=L(p,2),b=e=>{var t=Hc(),n=F(t),i=F(n);$(F(i),{name:`search`,size:13,strokeWidth:2}),A(i);var a=L(i,2);Vi(a),A(n),A(t),Ji(a,r,e=>dt(_a,e)),K(e,t)};J(y,e=>{V(l)||e(b)});var x=L(y,2),S=F(x),C=e=>{var t=sl(),n=I(t),r=L(F(n),2),s=F(r,!0);A(r),A(n);var c=L(n,2),l=e=>{var t=Xc(),n=I(t);$(F(n),{name:`star`,size:10,strokeWidth:2}),Ne(),A(n),X(L(n,2),1,()=>(a(),H(()=>a().pinned)),Y,(e,t)=>{var n=Yc();let r;var i=F(n),a=e=>{K(e,Uc())};J(i,e=>{o(),V(t),H(()=>o()===V(t).repo)&&e(a)});var s=L(i,2),c=F(s);Ne(),A(s);var l=L(s,2),d=F(l),f=F(d,!0);A(d);var p=L(d,2),m=F(p);$(m,{name:`database`,size:9,strokeWidth:2});var h=L(m);A(p);var g=L(p,2),_=e=>{var n=Jc(),r=F(n),i=e=>{var n=Wc(),r=F(n);$(r,{name:`zap`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).in_progress_count))??``}`)),K(e,n)};J(r,e=>{V(t),H(()=>V(t).in_progress_count)&&e(i)});var a=L(r,2),o=e=>{var n=Gc(),r=F(n);$(r,{name:`circle-dot`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).pending_count))??``}`)),K(e,n)};J(a,e=>{V(t),H(()=>V(t).pending_count)&&e(o)});var s=L(a,2),c=e=>{var n=Kc(),r=F(n);$(r,{name:`triangle-alert`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).blocked_count))??``}`)),K(e,n)};J(s,e=>{V(t),H(()=>V(t).blocked_count)&&e(c)});var l=L(s,2),u=e=>{var n=qc(),r=F(n);$(r,{name:`archive`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).backlog_count))??``}`)),K(e,n)};J(l,e=>{V(t),H(()=>V(t).backlog_count)&&e(u)}),A(n),K(e,n)};J(g,e=>{V(t),H(()=>(V(t).in_progress_count||0)+(V(t).pending_count||0)+(V(t).blocked_count||0)+(V(t).backlog_count||0)>0)&&e(_)}),A(l);var v=L(l,2);$(F(v),{name:`pin`,size:12,strokeWidth:1.75}),A(v),A(n),R(e=>{r=Ai(n,1,`repo-item svelte-vbr9x3`,null,r,{active:o()===V(t).repo}),Wi(n,`title`,`${(V(t),H(()=>V(t).repo))??``} • ${(V(t),H(()=>V(t).memory_count))??``} memories`),q(c,`${e??``} `),q(f,(V(t),H(()=>V(t).repo))),q(h,` ${(V(t),H(()=>V(t).memory_count))??``} memories`)},[()=>(V(t),H(()=>u.getRepoInitials(V(t).repo)))]),W(`click`,v,e=>u.togglePin(V(t).repo,e)),W(`click`,n,()=>u.selectRepo(V(t).repo)),W(`keydown`,n,e=>(e.key===`Enter`||e.key===` `)&&u.selectRepo(V(t).repo)),W(`dragstart`,n,e=>u.onDragStart(V(t).repo,e)),W(`dragover`,n,e=>u.onDragOver(V(t).repo,e)),W(`drop`,n,e=>u.onDrop(V(t).repo,e)),W(`dragend`,n,function(...e){u.onDragEnd?.apply(this,e)}),K(e,n)}),K(e,t)};J(c,e=>{a(),H(()=>a().pinned.length>0)&&e(l)});var d=L(c,2),f=e=>{var t=al(),n=I(t),r=e=>{var t=Zc();$(F(t),{name:`layers`,size:10,strokeWidth:2}),Ne(),A(t),K(e,t)};J(n,e=>{a(),H(()=>a().pinned.length>0)&&e(r)}),X(L(n,2),1,()=>(a(),H(()=>a().unpinned)),Y,(e,t)=>{var n=il();let r;var i=F(n),a=e=>{K(e,Qc())};J(i,e=>{o(),V(t),H(()=>o()===V(t).repo)&&e(a)});var s=L(i,2),c=F(s,!0);A(s);var l=L(s,2),d=F(l),f=F(d,!0);A(d);var p=L(d,2),m=F(p);$(m,{name:`database`,size:9,strokeWidth:2});var h=L(m);A(p);var g=L(p,2),_=e=>{var n=rl(),r=F(n),i=e=>{var n=$c(),r=F(n);$(r,{name:`zap`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).in_progress_count))??``}`)),K(e,n)};J(r,e=>{V(t),H(()=>V(t).in_progress_count)&&e(i)});var a=L(r,2),o=e=>{var n=el(),r=F(n);$(r,{name:`circle-dot`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).pending_count))??``}`)),K(e,n)};J(a,e=>{V(t),H(()=>V(t).pending_count)&&e(o)});var s=L(a,2),c=e=>{var n=tl(),r=F(n);$(r,{name:`triangle-alert`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).blocked_count))??``}`)),K(e,n)};J(s,e=>{V(t),H(()=>V(t).blocked_count)&&e(c)});var l=L(s,2),u=e=>{var n=nl(),r=F(n);$(r,{name:`archive`,size:8,strokeWidth:2});var i=L(r);A(n),R(()=>q(i,` ${(V(t),H(()=>V(t).backlog_count))??``}`)),K(e,n)};J(l,e=>{V(t),H(()=>V(t).backlog_count)&&e(u)}),A(n),K(e,n)};J(g,e=>{V(t),H(()=>(V(t).in_progress_count||0)+(V(t).pending_count||0)+(V(t).blocked_count||0)+(V(t).backlog_count||0)>0)&&e(_)}),A(l);var v=L(l,2);$(F(v),{name:`pin`,size:12,strokeWidth:1.75}),A(v),A(n),R(e=>{r=Ai(n,1,`repo-item svelte-vbr9x3`,null,r,{active:o()===V(t).repo}),Wi(n,`title`,`${(V(t),H(()=>V(t).repo))??``} • ${(V(t),H(()=>V(t).memory_count))??``} memories`),q(c,e),q(f,(V(t),H(()=>V(t).repo))),q(h,` ${(V(t),H(()=>V(t).memory_count))??``} memories`)},[()=>(V(t),H(()=>u.getRepoInitials(V(t).repo)))]),W(`click`,v,e=>u.togglePin(V(t).repo,e)),W(`click`,n,()=>u.selectRepo(V(t).repo)),W(`keydown`,n,e=>(e.key===`Enter`||e.key===` `)&&u.selectRepo(V(t).repo)),K(e,n)}),K(e,t)};J(d,e=>{a(),H(()=>a().unpinned.length>0)&&e(f)});var p=L(d,2),m=e=>{var t=ol();$(F(t),{name:`inbox`,size:24,strokeWidth:1.5}),Ne(2),A(t),K(e,t)};J(p,e=>{i(),H(()=>i().length===0)&&e(m)}),R(()=>q(s,(i(),H(()=>i().length)))),K(e,t)},w=e=>{var t=Xr();X(I(t),1,i,Y,(e,t)=>{var n=ll();let r;var i=F(n),a=e=>{K(e,cl())};J(i,e=>{o(),V(t),H(()=>o()===V(t).repo)&&e(a)});var s=L(i,2),c=F(s,!0);A(s),A(n),R(e=>{r=Ai(n,1,`repo-item collapsed`,null,r,{active:o()===V(t).repo}),Wi(n,`title`,(V(t),H(()=>V(t).repo))),q(c,e)},[()=>(V(t),H(()=>u.getRepoInitials(V(t).repo)))]),W(`click`,n,()=>u.selectRepo(V(t).repo)),W(`keydown`,n,e=>(e.key===`Enter`||e.key===` `)&&u.selectRepo(V(t).repo)),K(e,n)}),K(e,t)};J(S,e=>{V(l)?e(w,-1):e(C)}),A(x),A(d),R(()=>{f=Ai(d,1,`sidebar glass-strong flex flex-col`,null,f,{collapsed:V(l)}),Wi(_,`title`,V(l)?`Expand sidebar`:`Collapse sidebar`),Wi(_,`aria-label`,V(l)?`Expand`:`Collapse`),Mi(v,`transition: transform 0.3s ease; display:inline-flex; transform: rotate(${V(l)?`180deg`:`0deg`})`)}),W(`click`,_,function(...e){u.toggleCollapse?.apply(this,e)}),K(e,d),Ge(),c()}var fl=`https://github.com/vheins/local-memory-mcp`,pl=`https://www.npmjs.com/package/@vheins/local-memory-mcp`;function ml(e){let t=j(30),n=j(!1),r=j(null),i=j(!0),a;function o(e){return e>=1e6?(e/1e6).toFixed(1)+`M`:e>=1e3?(e/1e3).toFixed(1)+`k`:String(e)}async function s(){try{let e=await fetch(`https://api.npmjs.org/downloads/point/last-month/@vheins/local-memory-mcp`);if(e.ok){let t=await e.json();r.set(t.downloads??null)}}catch{r.set(null)}finally{i.set(!1)}}function c(){da.update(e=>e===`dark`?`light`:`dark`)}function l(){clearInterval(a),t.set(30),a=setInterval(()=>{t.update(t=>t<=1?(e(),30):t-1)},1e3)}async function u(){n.set(!0),e(),l(),setTimeout(()=>n.set(!1),800)}function d(){clearInterval(a)}return{countdownSeconds:t,refreshing:n,npmDownloads:r,npmLoading:i,formatDownloads:o,fetchNpmDownloads:s,toggleTheme:c,startCountdown:l,manualRefresh:u,getRepoInitials:Oc,destroy:d}}var hl=G(`<div class="flex items-center gap-1 svelte-2va9hf" style="font-size:0.65rem;color:var(--color-text-muted);"><!> <span class="svelte-2va9hf"> </span></div>`),gl=G(`<div class="flex items-center gap-2 svelte-2va9hf"><div style="width:30px;height:30px;border-radius:8px;background:linear-gradient(135deg,#0ea5e9,#6366f1);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:11px;color:white;flex-shrink:0;box-shadow:0 4px 10px rgba(14,165,233,0.28);" class="svelte-2va9hf"> </div> <div class="svelte-2va9hf"><div class="font-semibold svelte-2va9hf" style="font-size:0.82rem;color:var(--color-text);max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"> </div> <!></div></div>`),_l=G(`<div style="font-size:0.85rem;color:var(--color-text-muted);" class="flex items-center gap-2 svelte-2va9hf"><!> <span class="svelte-2va9hf">Select a repository</span></div>`),vl=G(`<span class="ext-link-label npm-dl-skeleton svelte-2va9hf"></span>`),yl=G(`<span class="ext-link-label npm-dl-badge svelte-2va9hf"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="svelte-2va9hf"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M7 10l5 5 5-5M12 15V3" class="svelte-2va9hf"></path></svg> </span>`),bl=G(`<span class="ext-link-label svelte-2va9hf">npm</span>`),xl=G(`<div class="flex items-center gap-2 svelte-2va9hf"><div class="status-dot status-dot-online svelte-2va9hf"></div> <span style="font-size:0.72rem;font-weight:600;color:var(--color-text-muted);" class="svelte-2va9hf">Online</span> <span style="font-size:0.65rem;color:var(--color-text-muted);background:rgba(100,116,139,0.1);padding:1px 6px;border-radius:9999px;border:1px solid rgba(100,116,139,0.15);" class="svelte-2va9hf"> </span></div>`),Sl=G(`<span class="flex items-center gap-1 svelte-2va9hf" style="font-size:0.65rem;color:var(--color-text-muted);max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"><!> </span>`),Cl=G(`<header class="top-bar glass-strong svelte-2va9hf" style="border-bottom: 1px solid var(--color-border); z-index: 30;"><div class="flex items-center justify-between svelte-2va9hf" style="padding: 10px 20px; min-height: 60px;"><div class="flex items-center gap-3 svelte-2va9hf"><button class="btn btn-ghost btn-icon svelte-2va9hf" aria-label="Toggle menu" style="display:none;" id="mobileMenuBtn"><!></button> <!></div> <div class="flex items-center gap-2 svelte-2va9hf"><div class="ext-links-group svelte-2va9hf"><a target="_blank" rel="noopener noreferrer" class="ext-link-btn svelte-2va9hf" title="View on GitHub" aria-label="GitHub repository" id="githubLink"><svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" class="svelte-2va9hf"><path d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" class="svelte-2va9hf"></path></svg> <span class="ext-link-label svelte-2va9hf">GitHub</span></a> <div class="ext-link-divider svelte-2va9hf"></div> <a target="_blank" rel="noopener noreferrer" class="ext-link-btn ext-link-star svelte-2va9hf" title="Star on GitHub" aria-label="Star on GitHub" id="githubStarBtn"><svg width="13" height="13" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" class="svelte-2va9hf"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" class="svelte-2va9hf"></path></svg> <span class="ext-link-label svelte-2va9hf">Star</span></a> <div class="ext-link-divider svelte-2va9hf"></div> <a target="_blank" rel="noopener noreferrer" class="ext-link-btn ext-link-npm svelte-2va9hf" title="View on npm" aria-label="npm package" id="npmLink"><svg width="18" height="11" viewBox="0 0 18 7" fill="currentColor" aria-hidden="true" class="svelte-2va9hf"><path d="M0 0h18v6H9V7H5V6H0V0zm1 5h2V1h1v4h1V1h1v5h4V1h1v4h1V1h1v4h1V1h2v5H1V5z" class="svelte-2va9hf"></path></svg> <!></a></div> <div style="width:1px;height:20px;background:var(--color-border);opacity:0.6;" class="svelte-2va9hf"></div> <!> <div class="flex items-center gap-2 svelte-2va9hf"><div class="countdown-bar svelte-2va9hf"><div class="countdown-track svelte-2va9hf"><div class="countdown-fill svelte-2va9hf"></div></div> <span class="countdown-label svelte-2va9hf"> </span></div> <button title="Refresh now" aria-label="Refresh"><span><!></span></button></div> <button class="btn btn-ghost btn-icon btn-sm svelte-2va9hf" title="Toggle theme" aria-label="Toggle theme"><!></button> <!></div></div></header>`);function wl(e,t){We(t,!1);let n=()=>N(_,`$countdownSeconds`,u),r=()=>N(pa,`$availableRepos`,u),i=()=>N(ma,`$currentRepo`,u),a=()=>N(b,`$npmLoading`,u),o=()=>N(y,`$npmDownloads`,u),s=()=>N(Ia,`$healthData`,u),c=()=>N(v,`$refreshing`,u),l=()=>N(da,`$theme`,u),[u,d]=ft(),f=on(),p=on(),m=on(),h=Z(t,`onRefresh`,8,()=>{}),g=Z(t,`onToggleMobileMenu`,8,()=>{}),{countdownSeconds:_,refreshing:v,npmDownloads:y,npmLoading:b,formatDownloads:x,fetchNpmDownloads:S,toggleTheme:C,startCountdown:w,manualRefresh:T,getRepoInitials:E,destroy:D}=ml(h());aa(()=>{w(),S()}),oa(()=>D()),Un(()=>n(),()=>{sn(f,n()/30*100)}),Un(()=>n(),()=>{sn(p,n()<=5?`#ef4444`:n()<=10?`#f97316`:`#0ea5e9`)}),Un(()=>(r(),i()),()=>{sn(m,r().find(e=>e.repo===i()))}),Wn(),na();var ee=Cl(),te=F(ee),ne=F(te),re=F(ne);$(F(re),{name:`menu`,size:18,strokeWidth:2}),A(re);var ie=L(re,2),ae=e=>{var t=gl(),n=F(t),r=F(n,!0);A(n);var a=L(n,2),o=F(a),s=F(o,!0);A(o);var c=L(o,2),l=e=>{var t=hl(),n=F(t);$(n,{name:`database`,size:10,strokeWidth:2});var r=L(n,2),i=F(r);A(r),A(t),R(()=>q(i,`${(V(m),H(()=>V(m).memory_count||0))??``} memories`)),K(e,t)};J(c,e=>{V(m)&&e(l)}),A(a),A(t),R(e=>{q(r,e),q(s,i())},[()=>(i(),H(()=>E(i())))]),K(e,t)},oe=e=>{var t=_l();$(F(t),{name:`brain`,size:14,strokeWidth:1.75}),Ne(2),A(t),K(e,t)};J(ie,e=>{i()?e(ae):e(oe,-1)}),A(ne);var se=L(ne,2),ce=F(se),le=F(ce),ue=L(le,4),de=L(ue,4),fe=L(F(de),2),pe=e=>{K(e,vl())},me=e=>{var t=yl(),n=L(F(t));A(t),R(e=>q(n,` ${e??``}/mo`),[()=>(o(),H(()=>x(o())))]),K(e,t)},he=e=>{K(e,bl())};J(fe,e=>{a()?e(pe):o()===null?e(he,-1):e(me,1)}),A(de),A(ce);var ge=L(ce,4),_e=e=>{var t=xl(),n=L(F(t),4),r=F(n);A(n),A(t),R(()=>q(r,`v${(s(),H(()=>s().version))??``}`)),K(e,t)};J(ge,e=>{s()&&e(_e)});var ve=L(ge,2),ye=F(ve),be=F(ye),xe=F(be);A(be);var Se=L(be,2),Ce=F(Se);A(Se),A(ye);var we=L(ye,2);let Te;var Ee=F(we);let De;$(F(Ee),{name:`refresh-cw`,size:14,strokeWidth:2.5}),A(Ee),A(we),A(ve);var Oe=L(ve,2),ke=F(Oe),O=e=>{$(e,{name:`sun`,size:16,strokeWidth:1.75})},Ae=e=>{$(e,{name:`moon`,size:16,strokeWidth:1.75})};J(ke,e=>{l()===`dark`?e(O):e(Ae,-1)}),A(Oe);var k=L(Oe,2),je=e=>{var t=Sl(),n=F(t);$(n,{name:`database`,size:10,strokeWidth:2});var r=L(n);A(t),R(e=>{Wi(t,`title`,(s(),H(()=>s().dbPath))),q(r,` ${e??``}`)},[()=>(s(),H(()=>s().dbPath.split(/[/\\]/).pop()))]),K(e,t)};J(k,e=>{s(),H(()=>s()?.dbPath)&&e(je)}),A(se),A(te),A(ee),R(()=>{Wi(le,`href`,fl),Wi(ue,`href`,`https://github.com/vheins/local-memory-mcp/stargazers`),Wi(de,`href`,pl),Mi(xe,`width:${V(f)??``}%;background:${V(p)??``};`),Mi(Se,`color:${n()<=5?`#ef4444`:`var(--color-text-muted)`};`),q(Ce,`${n()??``}s`),Te=Ai(we,1,`btn btn-ghost btn-icon btn-sm svelte-2va9hf`,null,Te,{refreshing:c()}),De=Ai(Ee,1,`svelte-2va9hf`,null,De,{"animate-spin":c()})}),W(`click`,re,function(...e){g()?.apply(this,e)}),W(`click`,we,T),W(`click`,Oe,C),K(e,ee),Ge(),d()}var Tl={1:`#94a3b8`,2:`#3b82f6`,3:`#f59e0b`,4:`#f97316`,5:`#ef4444`},El={backlog:`archive`,pending:`circle-dot`,in_progress:`zap`,completed:`circle-check`,blocked:`circle-x`,canceled:`circle-pause-alt`},Dl={backlog:`#64748b`,pending:`#0ea5e9`,in_progress:`#a855f7`,completed:`#10b981`,blocked:`#ef4444`,canceled:`#f59e0b`};function Ol(e){return e?e.replace(/<[^>]*>/g,``).replace(/!\[.*?\]\(.*?\)/g,``).replace(/\[([^\]]+)\]\(.*?\)/g,`$1`).replace(/```[\s\S]*?```/g,``).replace(/`([^`]+)`/g,`$1`).replace(/[#*~_-]/g,``).replace(/\s+/g,` `).trim():``}var kl=G(`<span class="phase-chip svelte-1797zcc"> </span>`),Al=G(`<div class="task-desc svelte-1797zcc"> </div>`),jl=G(`<div class="agent-row svelte-1797zcc"><div class="agent-avatar svelte-1797zcc"><!></div> <span class="agent-name svelte-1797zcc"> </span></div>`),Ml=G(`<span></span>`),Nl=G(`<div class="token-row svelte-1797zcc"><span class="token-badge svelte-1797zcc"><!> </span></div>`),Pl=G(`<div class="task-card animate-fade-in svelte-1797zcc" role="button" tabindex="0"><div class="priority-bar svelte-1797zcc"></div> <div class="card-header svelte-1797zcc"><div class="code-row svelte-1797zcc"><span class="status-icon-dot svelte-1797zcc"><!></span> <span class="task-code-text svelte-1797zcc"> </span></div> <!></div> <div class="task-title svelte-1797zcc"> </div> <!> <div class="card-footer svelte-1797zcc"><!> <div class="time-row svelte-1797zcc"><!> <span> </span></div></div> <!></div>`);function Fl(e,t){We(t,!1);let n=on(),r=on(),i=on(),a=on(),o=Z(t,`task`,8);Un(()=>U(o()),()=>{sn(n,Tl[o().priority]||`#94a3b8`)}),Un(()=>U(o()),()=>{sn(r,El[o().status]||`circle-dot`)}),Un(()=>U(o()),()=>{sn(i,Dl[o().status]||`#94a3b8`)}),Un(()=>U(o()),()=>{sn(a,Ol(o().description))}),Wn(),na();var s=Pl(),c=F(s),l=L(c,2),u=F(l),d=F(u);$(F(d),{get name(){return V(r)},size:11,strokeWidth:2.5}),A(d);var f=L(d,2),p=F(f,!0);A(f),A(u);var m=L(u,2),h=e=>{var t=kl(),n=F(t,!0);A(t),R(()=>q(n,(U(o()),H(()=>o().phase)))),K(e,t)};J(m,e=>{U(o()),H(()=>o().phase)&&e(h)}),A(l);var g=L(l,2),_=F(g,!0);A(g);var v=L(g,2),y=e=>{var t=Al(),n=F(t,!0);A(t),R(()=>q(n,V(a))),K(e,t)};J(v,e=>{V(a)&&e(y)});var b=L(v,2),x=F(b),S=e=>{var t=jl(),n=F(t);$(F(n),{name:`bot`,size:9,strokeWidth:2}),A(n);var r=L(n,2),i=F(r,!0);A(r),A(t),R(()=>q(i,(U(o()),H(()=>o().agent)))),K(e,t)},C=e=>{K(e,Ml())};J(x,e=>{U(o()),H(()=>o().agent)?e(S):e(C,-1)});var w=L(x,2),T=F(w);$(T,{name:`clock`,size:10,strokeWidth:2});var E=L(T,2),D=F(E,!0);A(E),A(w),A(b);var ee=L(b,2),te=e=>{var t=Nl(),n=F(t),r=F(n);$(r,{name:`cpu`,size:9,strokeWidth:2});var i=L(r);A(n),A(t),R(e=>q(i,` ~${e??``} tokens`),[()=>(U(o()),H(()=>o().est_tokens>=1e3?(o().est_tokens/1e3).toFixed(1)+`k`:o().est_tokens))]),K(e,t)};J(ee,e=>{U(o()),H(()=>o().est_tokens&&o().est_tokens>0)&&e(te)}),A(s),R(e=>{Mi(c,`background:${V(n)??``};`),Mi(d,`color:${V(i)??``};`),q(p,(U(o()),H(()=>o().task_code))),q(_,(U(o()),H(()=>o().title))),q(D,e)},[()=>(U(Tc),U(o()),H(()=>Tc(o().updated_at)))]),W(`click`,s,function(e){ia.call(this,t,e)}),W(`keydown`,s,function(e){ia.call(this,t,e)}),K(e,s),Ge()}var Il=[{status:`backlog`,label:`Backlog`,bg:`rgba(100,116,139,0.07)`,border:`rgba(100,116,139,0.18)`,icon:`archive`,color:`#64748b`},{status:`pending`,label:`To Do`,bg:`rgba(14,165,233,0.06)`,border:`rgba(14,165,233,0.18)`,icon:`circle-dot`,color:`#0ea5e9`},{status:`in_progress`,label:`In Progress`,bg:`rgba(168,85,247,0.07)`,border:`rgba(168,85,247,0.18)`,icon:`zap`,color:`#a855f7`},{status:`completed`,label:`Completed`,bg:`rgba(16,185,129,0.06)`,border:`rgba(16,185,129,0.18)`,icon:`circle-check`,color:`#10b981`}];function Ll(){let e={},t={};Il.forEach(n=>{e[n.status]={page:1,pageSize:20,hasMore:!0},t[n.status]=[]});let{subscribe:n,update:r}=j({loadingCols:new Set,pagination:e,columnTasks:t,draggedTask:null,sourceCol:null,dragOverCol:null});async function i(e,t,i){let a=M({subscribe:n});if(a.loadingCols.has(t))return;r(e=>{let n=new Set(e.loadingCols);return n.add(t),{...e,loadingCols:n}});let o=a.pagination[t];try{let n=await Va.tasks({repo:e,status:t,search:i,page:o.page,pageSize:o.pageSize});r(e=>{let r=o.page===1?n.tasks||[]:[...e.columnTasks[t]||[],...n.tasks||[]];return{...e,columnTasks:{...e.columnTasks,[t]:r},pagination:{...e.pagination,[t]:{...o,hasMore:(n.tasks?.length||0)>=o.pageSize}}}})}catch(e){console.error(`Failed to load ${t}:`,e)}finally{r(e=>{let n=new Set(e.loadingCols);return n.delete(t),{...e,loadingCols:n}})}}async function a(e,t){e&&(r(e=>{let t={...e.pagination},n={...e.columnTasks};return Il.forEach(e=>{t[e.status]={page:1,pageSize:20,hasMore:!0},n[e.status]=[]}),{...e,pagination:t,columnTasks:n}}),await Promise.all(Il.map(n=>i(e,n.status,t))))}async function o(e){let t=M(ma),n=M(ja);t&&(r(t=>({...t,pagination:{...t.pagination,[e]:{...t.pagination[e],page:t.pagination[e].page+1}}})),await i(t,e,n))}function s(e,t,n){e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.id)),r(e=>({...e,draggedTask:t,sourceCol:n}))}function c(e,t){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`);let i=M({subscribe:n});!i.draggedTask||i.sourceCol===t||r(e=>({...e,dragOverCol:t}))}function l(e){r(t=>t.dragOverCol===e?{...t,dragOverCol:null}:t)}async function u(e){let t=M(ma),i=M(ja),{draggedTask:o,sourceCol:s}=M({subscribe:n});if(r(e=>({...e,dragOverCol:null,draggedTask:null,sourceCol:null})),!(!o||!s||s===e)){r(t=>{let n={...t.columnTasks};return n[s]=n[s].filter(e=>e.id!==o.id),n[e]=[{...o,status:e},...n[e]||[]],{...t,columnTasks:n}});try{await Va.updateTask(o.id,{status:e})}catch(e){console.error(`Failed to move task:`,e),t&&a(t,i)}}}async function d(e){let t=M(ma);if(t)try{let n=await Va.export(t),r=`${t.replace(/\//g,`_`)}_tasks_export`;e===`json`?Nc(n.tasks||[],r+`.json`):Pc(n.tasks||[],r+`.csv`)}catch(e){alert(`Export failed: `+e.message)}}return aa(()=>{let e=!0,t=ma.subscribe(e=>{let t=M(ja);e&&a(e,t)}),n,r=ja.subscribe(t=>{if(e)return;let r=M(ma);r&&(clearTimeout(n),n=setTimeout(()=>{a(r,t)},150))});return e=!1,()=>{t(),r(),clearTimeout(n)}}),{subscribe:n,loadTasks:a,loadMore:o,handleDragStart:s,handleDragOver:c,handleDragLeave:l,handleDrop:u,handleExport:d}}var Rl=G(`<div class="skeleton" style="height:80px;border-radius:12px;"></div> <div class="skeleton" style="height:60px;border-radius:12px;"></div>`,1),zl=G(`<div class="empty-col svelte-173w724"><span><!></span> <div style="font-size:0.75rem;color:var(--color-text-muted);margin-top:6px;">No tasks</div></div>`),Bl=G(`<div draggable="true" style="cursor: grab;"><!></div>`),Vl=G(`<span class="animate-spin"><!></span>`),Hl=G(`<button class="btn btn-ghost btn-sm w-full" style="margin-top:4px;justify-content:center;"><!> </button>`),Ul=G(`<!> <!>`,1),Wl=G(`<div><div class="flex items-center gap-2 mb-3"><span><!></span> <span style="font-size:0.78rem;font-weight:700;color:var(--color-text);"> </span> <span class="col-count svelte-173w724"> </span></div> <div class="flex flex-col" style="gap:8px;overflow-y:auto;max-height:calc(100vh - 340px);padding-right:2px;"><!></div></div>`),Gl=G(`<div><div class="flex items-center justify-between mb-4"><div class="search-wrap svelte-173w724"><span class="search-icon-inner svelte-173w724"><!></span> <input class="form-input" style="padding-left:32px;width:220px;font-size:0.8rem;" type="text" placeholder="Search tasks…"/></div> <div class="flex gap-2"><div class="flex gap-1 mr-1"><button class="btn btn-ghost btn-sm" title="Export JSON"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> JSON</button> <button class="btn btn-ghost btn-sm" title="Export CSV"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> CSV</button></div> <div style="width:1px;height:24px;background:var(--color-border);margin:0 4px;"></div> <button class="btn btn-ghost btn-sm" title="Bulk Import"><!> Import</button> <button class="btn btn-accent btn-sm"><!> Add Task</button></div></div> <div class="kanban-board" style="padding-bottom:16px;"></div></div>`);function Kl(e,t){We(t,!1);let n=()=>N(ja,`$taskSearch`,i),r=()=>N(u,`$kanbanState`,i),[i,a]=ft(),o=Z(t,`onTaskClick`,8,()=>{}),s=Z(t,`onAddTask`,8,()=>{}),c=Z(t,`onBulkImport`,8,()=>{}),l=Ll(),u={subscribe:l.subscribe};function d(e){l.loadTasks(e,n())}var f={loadTasks:d};na();var p=Gl(),m=F(p),h=F(m),g=F(h);$(F(g),{name:`search`,size:13,strokeWidth:2}),A(g);var _=L(g,2);Vi(_),A(h);var v=L(h,2),y=F(v),b=F(y),x=L(b,2);A(y);var S=L(y,4);$(F(S),{name:`upload`,size:14,strokeWidth:2.5}),Ne(),A(S);var C=L(S,2);$(F(C),{name:`plus`,size:14,strokeWidth:2.5}),Ne(),A(C),A(v),A(m);var w=L(m,2);X(w,5,()=>Il,Y,(e,t)=>{var n=Wl(),i=F(n),a=F(i);$(F(a),{get name(){return V(t),H(()=>V(t).icon)},size:13,strokeWidth:2}),A(a);var s=L(a,2),c=F(s,!0);A(s);var u=L(s,2),d=F(u);A(u),A(i);var f=L(i,2),p=F(f),m=e=>{var n=Xr(),i=I(n),a=e=>{var t=Rl();Ne(2),K(e,t)},o=Kt(()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status)))),s=e=>{var n=zl(),r=F(n);$(F(r),{get name(){return V(t),H(()=>V(t).icon)},size:22,strokeWidth:1.25}),A(r),Ne(2),A(n),R(()=>Mi(r,`color:${(V(t),H(()=>V(t).color))??``};opacity:0.5;`)),K(e,n)};J(i,e=>{V(o)?e(a):e(s,-1)}),K(e,n)},h=e=>{var n=Ul(),i=I(n);X(i,1,()=>(r(),V(t),H(()=>r().columnTasks[V(t).status])),e=>e.id,(e,n)=>{var r=Bl();Fl(F(r),{get task(){return V(n)},$$events:{click:()=>o()(V(n))}}),A(r),W(`dragstart`,r,e=>l.handleDragStart(e,V(n),V(t).status)),K(e,r)});var a=L(i,2),s=e=>{var n=Hl(),i=F(n),a=e=>{var t=Vl();$(F(t),{name:`refresh-cw`,size:12,strokeWidth:2}),A(t),K(e,t)},o=Kt(()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status)))),s=e=>{$(e,{name:`chevron-down`,size:12,strokeWidth:2})};J(i,e=>{V(o)?e(a):e(s,-1)});var c=L(i);A(n),R((e,t)=>{n.disabled=e,q(c,` ${t??``}`)},[()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status))),()=>(r(),V(t),H(()=>r().loadingCols.has(V(t).status)?`Loading…`:`Load more`))]),W(`click`,n,()=>l.loadMore(V(t).status)),K(e,n)};J(a,e=>{r(),V(t),H(()=>r().pagination[V(t).status]?.hasMore)&&e(s)}),K(e,n)};J(p,e=>{r(),V(t),H(()=>(r().columnTasks[V(t).status]||[]).length===0)?e(m):e(h,-1)}),A(f),A(n),R(()=>{Ai(n,1,`kanban-col ${(r(),V(t),H(()=>r().dragOverCol===V(t).status?`drag-over`:``))??``}`,`svelte-173w724`),Mi(n,`background:${(V(t),H(()=>V(t).bg))??``};border:1px solid ${(V(t),H(()=>V(t).border))??``};padding:12px;border-radius:16px;transition: border-color 0.2s;`),Mi(a,`color:${(V(t),H(()=>V(t).color))??``};display:flex;flex-shrink:0;`),q(c,(V(t),H(()=>V(t).label))),Mi(u,`margin-left:auto;background:${(V(t),H(()=>V(t).bg))??``};color:${(V(t),H(()=>V(t).color))??``};border:1px solid ${(V(t),H(()=>V(t).border))??``};`),q(d,`${(r(),V(t),H(()=>r().columnTasks[V(t).status]?.length||0))??``}${(r(),V(t),H(()=>r().pagination[V(t).status]?.hasMore?`+`:``))??``}`)}),W(`dragover`,n,e=>l.handleDragOver(e,V(t).status)),W(`dragleave`,n,()=>l.handleDragLeave(V(t).status)),W(`drop`,n,()=>l.handleDrop(V(t).status)),K(e,n)}),A(w),A(p),Ji(_,n,e=>dt(ja,e)),W(`click`,b,()=>l.handleExport(`json`)),W(`click`,x,()=>l.handleExport(`csv`)),W(`click`,S,function(...e){c()?.apply(this,e)}),W(`click`,C,function(...e){s()?.apply(this,e)}),K(e,p),Zi(t,`loadTasks`,d);var T=Ge(f);return a(),T}var ql={code_fact:`#a855f7`,decision:`#3b82f6`,mistake:`#ef4444`,pattern:`#10b981`,agent_handoff:`#f97316`,agent_registered:`#84cc16`,file_claim:`#06b6d4`,task_archive:`#78716c`},Jl={code_fact:`Code Facts`,decision:`Decisions`,mistake:`Mistakes`,pattern:`Patterns`,agent_handoff:`Handoffs`,agent_registered:`Registered`,file_claim:`Claims`,task_archive:`Archives`};function Yl(){return{summaryItems:st(va,e=>[{label:`Total Memories`,val:e?.total??`—`,icon:`layers`,color:`#0ea5e9`,glow:`rgba(14,165,233,0.12)`},{label:`Avg Importance`,val:e?.avgImportance?Number(e.avgImportance).toFixed(1):`—`,icon:`star`,color:`#f59e0b`,glow:`rgba(245,158,11,0.12)`},{label:`Total Hits`,val:e?.totalHitCount??`—`,icon:`mouse-pointer-2`,color:`#10b981`,glow:`rgba(16,185,129,0.12)`},{label:`Expiring Soon`,val:e?.expiringSoon??`—`,icon:`clock`,color:`#ef4444`,glow:`rgba(239,68,68,0.12)`}]),byTypeStats:st(va,e=>e?.byType?Object.entries(e.byType).filter(([e,t])=>t>0).map(([e,t])=>({type:e,count:t,color:ql[e]||`#64748b`,label:Jl[e]||e})):[])}}var Xl=G(`<div class="stat-card svelte-1imzu92"><div class="svelte-1imzu92"><!></div> <div class="svelte-1imzu92"> </div> <div style="font-size:0.6rem;font-weight:700;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-top:2px;" class="svelte-1imzu92"> </div></div>`),Zl=G(`<div class="flex items-center gap-2 glassy-badge svelte-1imzu92"><div class="indicator-dot svelte-1imzu92"></div> <span class="count svelte-1imzu92"> </span> <span class="label svelte-1imzu92"> </span></div>`),Ql=G(`<div style="margin-top:4px;" class="svelte-1imzu92"><div class="stat-label svelte-1imzu92" style="font-size:0.6rem;margin-bottom:6px;">By Type</div> <div style="display:flex;flex-wrap:wrap;gap:8px;" class="svelte-1imzu92"></div></div>`),$l=G(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(130px, 1fr));gap:10px;margin-bottom:12px;" class="svelte-1imzu92"></div> <!>`,1);function eu(e,t){We(t,!1);let n=()=>N(o,`$summaryItems`,i),r=()=>N(s,`$byTypeStats`,i),[i,a]=ft(),{summaryItems:o,byTypeStats:s}=Yl();na();var c=$l(),l=I(c);X(l,5,n,Y,(e,t)=>{var n=Xl(),r=F(n);$(F(r),{get name(){return V(t).icon},size:14,strokeWidth:1.75}),A(r);var i=L(r,2),a=F(i,!0);A(i);var o=L(i,2),s=F(o,!0);A(o),A(n),R(()=>{Mi(n,`text-align:center;background:${V(t).glow??``};border:1px solid ${V(t).glow??``};padding:10px 8px;`),Mi(r,`display:flex;justify-content:center;margin-bottom:2px;color:${V(t).color??``};opacity:0.8;`),Mi(i,`font-size:1.25rem;font-weight:900;color:${V(t).color??``};line-height:1;letter-spacing:-0.03em;`),q(a,V(t).val),q(s,V(t).label)}),K(e,n)}),A(l);var u=L(l,2),d=e=>{var t=Ql(),n=L(F(t),2);X(n,5,r,Y,(e,t)=>{var n=Zl(),r=L(F(n),2),i=F(r,!0);A(r);var a=L(r,2),o=F(a,!0);A(a),A(n),R(()=>{Mi(n,`--badge-color: ${V(t).color??``};`),q(i,V(t).count),q(o,V(t).label)}),K(e,n)}),A(n),A(t),K(e,t)};J(u,e=>{r().length>0&&e(d)}),K(e,c),Ge(),a()}var tu=G(`<div class="stat-card"><div><!></div> <div> </div> <div style="font-size:0.6rem;font-weight:700;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-top:2px;"> </div></div>`),nu=G(`<div style="display:grid;grid-template-columns:repeat(auto-fit, minmax(120px, 1fr));gap:10px;width:100%;"></div>`);function ru(e,t){We(t,!1);let n=()=>N(va,`$dashboardStats`,r),[r,i]=ft(),a=on(),o=on();Un(()=>n(),()=>{sn(a,n()?.taskStats)}),Un(()=>V(a),()=>{sn(o,[{label:`Total`,val:V(a)?.total??0,icon:`layers`,color:`#6366f1`,glow:`rgba(99,102,241,0.12)`},{label:`Backlog`,val:V(a)?.backlog??0,icon:`inbox`,color:`#64748b`,glow:`rgba(100,116,139,0.12)`},{label:`To Do`,val:V(a)?.todo??0,icon:`circle-dot`,color:`#0ea5e9`,glow:`rgba(14,165,233,0.12)`},{label:`Active`,val:V(a)?.inProgress??0,icon:`zap`,color:`#a855f7`,glow:`rgba(168,85,247,0.12)`},{label:`Done`,val:V(a)?.completed??0,icon:`circle-check`,color:`#10b981`,glow:`rgba(16,185,129,0.12)`}])}),Wn(),na();var s=Xr(),c=I(s),l=e=>{var t=nu();X(t,5,()=>V(o),Y,(e,t)=>{var n=tu(),r=F(n);$(F(r),{get name(){return V(t),H(()=>V(t).icon)},size:14,strokeWidth:1.75}),A(r);var i=L(r,2),a=F(i,!0);A(i);var o=L(i,2),s=F(o,!0);A(o),A(n),R(()=>{Mi(n,`text-align:center;background:${(V(t),H(()=>V(t).glow))??``};border:1px solid ${(V(t),H(()=>V(t).glow))??``};padding:10px 8px;`),Mi(r,`display:flex;justify-content:center;margin-bottom:2px;color:${(V(t),H(()=>V(t).color))??``};opacity:0.8;`),Mi(i,`font-size:1.25rem;font-weight:900;color:${(V(t),H(()=>V(t).color))??``};line-height:1;letter-spacing:-0.03em;`),q(a,(V(t),H(()=>V(t).val))),q(s,(V(t),H(()=>V(t).label)))}),K(e,n)}),A(t),K(e,t)};J(c,e=>{V(a)&&e(l)}),K(e,s),Ge(),i()}var iu=[{key:`daily`,label:`Today`},{key:`weekly`,label:`Week`},{key:`monthly`,label:`Month`},{key:`overall`,label:`All`}];function au(){let e=j(`daily`),t=st([ya,e],([e,t])=>e?.[t]),n=st(t,e=>e?.history||[]);return{activePeriod:e,periodData:t,history:n,maxVal:st(n,e=>Math.max(1,...e.map(e=>Math.max(e.created||0,e.completed||0)))),setActivePeriod:t=>e.set(t)}}var ou=G(`<button style="padding:4px 10px;font-size:0.65rem;"> </button>`),su=G(`<div class="flex-1 flex flex-col items-center group relative" style="height:100%;"><div class="flex h-full w-full items-end justify-center gap-[2px]"><div class="bar created-bar"></div> <div class="bar completed-bar"></div></div> <div class="absolute bottom-full mb-1 bg-slate-800 text-white p-1.5 rounded text-[10px] hidden group-hover:block z-10 whitespace-nowrap shadow-lg"><div class="font-bold border-b border-slate-600 mb-1"> </div> <div> </div> <div> </div></div> <div class="absolute bottom-0 translate-y-[20px] text-[8px] text-slate-400 whitespace-nowrap overflow-hidden max-w-full"> </div></div>`),cu=G(`<div class="mt-4 pt-4 border-t border-dashed" style="border-color:var(--color-border);"><div class="flex items-center justify-between mb-3"><div style="font-size:0.65rem;font-weight:700;color:var(--color-text-muted);text-transform:uppercase;letter-spacing:0.05em;">Throughput vs Inflow</div> <div class="flex gap-2"><div class="flex items-center gap-1"><div style="width:8px;height:8px;border-radius:2px;background:#10b981;"></div> <span style="font-size:0.6rem;color:var(--color-text-muted);">Created</span></div> <div class="flex items-center gap-1"><div style="width:8px;height:8px;border-radius:2px;background:#6366f1;"></div> <span style="font-size:0.6rem;color:var(--color-text-muted);">Completed</span></div></div></div> <div style="height:120px;display:flex;align-items:flex-end;gap:4px;padding-bottom:20px;position:relative;"></div></div>`),lu=G(`<div class="mt-4 pt-4 border-t border-dashed flex items-center justify-center" style="border-color:var(--color-border);height:140px;color:var(--color-text-muted);font-size:0.75rem;">No trend data available for this period</div>`),uu=G(`<div class="glass card animate-fade-in"><div class="flex items-center justify-between mb-3"><div><div style="font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;color:#6366f1;">Task Stats</div> <div style="font-size:0.75rem;color:var(--color-text-muted);">Performance over time</div></div> <div class="flex gap-1" style="background:rgba(241,245,249,0.8);padding:3px;border-radius:10px;"></div></div> <div style="display:grid;grid-template-columns:repeat(2,1fr);gap:10px;"><div style="background:rgba(99,102,241,0.08);border:1px solid rgba(99,102,241,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#6366f1;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Completed</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div> <div style="background:rgba(16,185,129,0.08);border:1px solid rgba(16,185,129,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#10b981;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Added</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div> <div style="background:rgba(56,189,248,0.08);border:1px solid rgba(56,189,248,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#0ea5e9;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Tokens</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div> <div style="background:rgba(245,158,11,0.08);border:1px solid rgba(245,158,11,0.15);border-radius:12px;padding:12px;"><div style="font-size:0.65rem;color:#f59e0b;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px;">Avg Time</div> <div style="font-size:1.5rem;font-weight:800;color:var(--color-text);line-height:1;"> </div></div></div> <!></div>`);function du(e,t){We(t,!1);let n=()=>N(c,`$activePeriod`,o),r=()=>N(l,`$periodData`,o),i=()=>N(u,`$history`,o),a=()=>N(d,`$maxVal`,o),[o,s]=ft(),{activePeriod:c,periodData:l,history:u,maxVal:d,setActivePeriod:f}=au();na();var p=uu(),m=F(p),h=L(F(m),2);X(h,5,()=>iu,Y,(e,t)=>{var r=ou();let i;var a=F(r,!0);A(r),R(()=>{i=Ai(r,1,`tab-btn`,null,i,{active:n()===V(t).key}),q(a,V(t).label)}),W(`click`,r,()=>f(V(t).key)),K(e,r)}),A(h),A(m);var g=L(m,2),_=F(g),v=L(F(_),2),y=F(v,!0);A(v),A(_);var b=L(_,2),x=L(F(b),2),S=F(x,!0);A(x),A(b);var C=L(b,2),w=L(F(C),2),T=F(w,!0);A(w),A(C);var E=L(C,2),D=L(F(E),2),ee=F(D,!0);A(D),A(E),A(g);var te=L(g,2),ne=e=>{var t=cu(),n=L(F(t),2);X(n,5,i,Y,(e,t)=>{var n=su(),r=F(n),i=F(r),o=L(i,2);A(r);var s=L(r,2),c=F(s),l=F(c,!0);A(c);var u=L(c,2),d=F(u);A(u);var f=L(u,2),p=F(f);A(f),A(s);var m=L(s,2),h=F(m,!0);A(m),A(n),R(e=>{Mi(i,`width:35%; height:${(V(t).created||0)/a()*100}%; background:#10b981; border-radius:3px 3px 0 0; opacity:0.8; transition: height 0.3s ease;`),Mi(o,`width:35%; height:${(V(t).completed||0)/a()*100}%; background:#6366f1; border-radius:3px 3px 0 0; opacity:0.8; transition: height 0.3s ease;`),q(l,V(t).label),q(d,`Added: ${V(t).created??``}`),q(p,`Done: ${V(t).completed??``}`),q(h,e)},[()=>V(t).label.includes(`:00`)?V(t).label.split(`:`)[0]:V(t).label.replace(`2026-`,``).replace(`2025-`,``)]),K(e,n)}),A(n),A(t),K(e,t)},re=e=>{K(e,lu())};J(te,e=>{r()?.history&&r().history.length>0?e(ne):e(re,-1)}),A(p),R((e,t)=>{q(y,r()?.completed??`—`),q(S,r()?.added??`—`),q(T,e),q(ee,t)},[()=>r()?.tokens?Ec(r().tokens):`—`,()=>r()?.avgDuration?Dc(r().avgDuration):`—`]),K(e,p),Ge(),s()}function fu(){let e=!1;async function t(t=M(ma)){if(!t){ba.set([]);return}e=!0;try{let e=await Va.memories({repo:t,type:M(Ta)||void 0,search:M(wa)||void 0,minImportance:M(Ea)||void 0,maxImportance:M(Da)||void 0,sortBy:M(Oa),sortOrder:M(ka),page:M(Sa),pageSize:M(Ca)});ba.set(e.memories||[]),xa.set(e.pagination?.totalItems||0)}catch(e){console.error(`Failed to load memories:`,e)}finally{e=!1}}let n=Fc(()=>{Sa.set(1),t()},300);function r(){n()}function i(){Sa.set(1),t()}function a(e){let n=M(Ra);e<1||e>n||(Sa.set(e),t())}function o(e){M(Oa)===e?ka.update(e=>e===`desc`?`asc`:`desc`):(Oa.set(e),ka.set(`desc`)),t()}function s(e){Aa.update(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function c(){Aa.update(e=>{let t=M(ba);return e.size===t.length?new Set:new Set(t.map(e=>e.id))})}async function l(e,t=M(ma)){if(t)try{let n=await Va.export(t),r=`${t.replace(`/`,`_`)}_export`;e===`json`?Nc(n,r+`.json`):Pc(n.memories||[],r+`.csv`)}catch(e){console.error(`Export failed:`,e)}}async function u(e,n){if(n&&n.stopPropagation(),confirm(`Delete memory "${e.title}"?`))try{await Va.deleteMemory(e.id),t()}catch(e){alert(`Failed to delete: `+e.message)}}async function d(){let e=M(Aa);if(e.size!==0&&confirm(`Are you sure you want to delete ${e.size} memories?`))try{await Va.bulkMemoryAction(`delete`,Array.from(e)),Aa.set(new Set),t()}catch(e){alert(`Failed to delete: `+e.message)}}async function f(){let e=M(Aa);if(e.size!==0)try{await Va.bulkMemoryAction(`archive`,Array.from(e)),Aa.set(new Set),t()}catch(e){alert(`Failed to archive: `+e.message)}}return{get loading(){return e},loadMemories:t,onSearchInput:r,onFilterChange:i,goToPage:a,toggleSort:o,toggleSelect:s,toggleSelectAll:c,handleExport:l,handleDeleteRow:u,handleBulkDelete:d,handleBulkArchive:f}}var pu=[`code_fact`,`decision`,`mistake`,`pattern`,`agent_handoff`,`agent_registered`,`file_claim`,`task_archive`],mu={code_fact:`Code Fact`,decision:`Decision`,mistake:`Mistake`,pattern:`Pattern`,agent_handoff:`Handoff`,agent_registered:`Registered`,file_claim:`File Claim`,task_archive:`Task Archive`},hu={1:`#64748b`,2:`#3b82f6`,3:`#f59e0b`,4:`#f97316`,5:`#ef4444`},gu={1:`rgba(100,116,139,0.12)`,2:`rgba(59,130,246,0.12)`,3:`rgba(245,158,11,0.12)`,4:`rgba(249,115,22,0.12)`,5:`rgba(239,68,68,0.12)`},_u=G(`<option> </option>`),vu=G(`<option> </option>`),yu=G(`<option> </option>`),bu=G(`<tr><td colspan="7" class="mem-td svelte-83aj9g"><div class="skeleton" style="height:20px;border-radius:6px;"></div></td></tr>`),xu=G(`<tr><td colspan="7" class="mem-td svelte-83aj9g" style="padding:40px;text-align:center;color:var(--color-text-muted);"><div style="font-size:2rem;margin-bottom:8px;">🔍</div> No memories found</td></tr>`),Su=G(`<span style="font-size:0.6rem;background:rgba(99,102,241,0.1);color:#6366f1;padding:1px 5px;border-radius:9999px;"> </span>`),Cu=G(`<div style="margin-top:3px;display:flex;gap:4px;flex-wrap:wrap;"></div>`),wu=G(`<tr><td class="mem-td svelte-83aj9g"><input type="checkbox"/></td><td class="mem-td svelte-83aj9g" style="max-width:300px;"><div class="truncate font-semibold" style="font-size:0.82rem;color:var(--color-text);"> </div> <!></td><td class="mem-td svelte-83aj9g"><span> </span></td><td class="mem-td svelte-83aj9g" style="text-align:center;"><span> </span></td><td class="mem-td svelte-83aj9g" style="font-size:0.75rem;color:var(--color-text-muted);white-space:nowrap;"> </td><td class="mem-td svelte-83aj9g" style="text-align:center;font-size:0.75rem;font-weight:600;color:var(--color-text-muted);"> </td><td class="mem-td row-actions svelte-83aj9g"><button class="row-action-btn edit-btn svelte-83aj9g" title="Edit / View" aria-label="Edit memory"><!></button> <button class="row-action-btn delete-btn svelte-83aj9g" title="Delete" aria-label="Delete memory"><!></button></td></tr>`),Tu=G(`<button> </button>`),Eu=G(`<div class="flex items-center justify-between mt-3"><span style="font-size:0.75rem;color:var(--color-text-muted);"> </span> <div class="flex gap-1"><button class="btn btn-ghost btn-sm">«</button> <button class="btn btn-ghost btn-sm">‹</button> <!> <button class="btn btn-ghost btn-sm">›</button> <button class="btn btn-ghost btn-sm">»</button></div></div>`),Du=G(`<div class="bulk-actions-bar svelte-83aj9g"><span><b> </b> selected</span> <div style="width:12px;"></div> <button class="btn btn-sm" style="background:rgba(120,120,120,0.2);color:inherit;">Cancel</button> <button class="btn btn-sm" style="background:#52525b;color:white;border:none;">Archive</button> <button class="btn btn-sm btn-accent" style="background:#ef4444;color:white;border:none;">Delete</button></div>`),Ou=G(`<div><div class="flex items-center gap-2 mb-3" style="flex-wrap:wrap;"><div style="position:relative;flex:1;min-width:160px;"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--color-text-muted);"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg> <input class="form-input" style="padding-left:32px;font-size:0.8rem;" type="text" placeholder="Search memories..."/></div> <select class="form-select" style="width:140px;font-size:0.8rem;"><option>All Types</option><!></select> <select class="form-select" style="width:100px;font-size:0.8rem;"><option>Min Imp.</option><!></select> <select class="form-select" style="width:100px;font-size:0.8rem;"></select> <div class="flex gap-1"><button class="btn btn-ghost btn-sm" title="Export JSON"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> JSON</button> <button class="btn btn-ghost btn-sm" title="Export CSV"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> CSV</button> <div style="width:1px;height:14px;background:var(--color-border);margin:auto 4px;"></div> <button class="btn btn-ghost btn-sm" title="Bulk Import"><!> Import</button></div> <button class="btn btn-accent btn-sm" id="newMemoryBtn" style="margin-left:auto;"><!> New Memory</button></div> <div style="font-size:0.72rem;color:var(--color-text-muted);margin-bottom:8px;"> </div> <div class="mem-table-wrap svelte-83aj9g"><table class="mem-table svelte-83aj9g"><thead><tr class="mem-thead-row svelte-83aj9g"><th class="mem-th svelte-83aj9g" style="width:36px;"><input type="checkbox" aria-label="Select all"/></th><th class="mem-th sortable svelte-83aj9g"> </th><th class="mem-th svelte-83aj9g">Type</th><th class="mem-th svelte-83aj9g" style="text-align:center;cursor:pointer;"> </th><th class="mem-th sortable svelte-83aj9g"> </th><th class="mem-th svelte-83aj9g" style="text-align:center;">Hits</th><th class="mem-th svelte-83aj9g" style="width:80px;"></th></tr></thead><tbody><!></tbody></table></div> <!> <!></div>`);function ku(e,t){We(t,!1);let n=()=>N(ba,`$memories`,p),r=()=>N(Aa,`$selectedMemoryIds`,p),i=()=>N(wa,`$memoriesSearch`,p),a=()=>N(Ta,`$memoriesTypeFilter`,p),o=()=>N(Ea,`$memoriesImportanceMin`,p),s=()=>N(Ca,`$memoriesPageSize`,p),c=()=>N(xa,`$memoriesTotal`,p),l=()=>N(Oa,`$memoriesSortBy`,p),u=()=>N(ka,`$memoriesSortOrder`,p),d=()=>N(Ra,`$memoriesTotalPages`,p),f=()=>N(Sa,`$memoriesPage`,p),[p,m]=ft(),h=on(),g=Z(t,`onMemoryClick`,8,()=>{}),_=Z(t,`onNewMemory`,8,()=>{}),v=Z(t,`onBulkImport`,8,()=>{}),y=fu();function b(){y.loadMemories()}Un(()=>(n(),r()),()=>{sn(h,n().length>0&&r().size===n().length)}),Wn();var x={refresh:b};na();var S=Ou(),C=F(S),w=F(C),T=L(F(w),2);Vi(T),A(w);var E=L(w,2),D=F(E);D.value=D.__value=``,X(L(D),1,()=>pu,Y,(e,t)=>{var n=_u(),r=F(n,!0);A(n);var i={};R(()=>{q(r,(U(mu),V(t),H(()=>mu[V(t)]))),i!==(i=V(t))&&(n.value=(n.__value=V(t))??``)}),K(e,n)}),A(E);var ee=L(E,2),te=F(ee);te.value=(te.__value=null,``),X(L(te),0,()=>[1,2,3,4,5],Y,(e,t)=>{var n=vu(),r=F(n,!0);A(n);var i={};R(()=>{q(r,t),i!==(i=t)&&(n.value=(n.__value=t)??``)}),K(e,n)}),A(ee);var ne=L(ee,2);X(ne,4,()=>[10,25,50,100],Y,(e,t)=>{var n=yu(),r=F(n);A(n);var i={};R(()=>{q(r,`${t??``} / page`),i!==(i=t)&&(n.value=(n.__value=t)??``)}),K(e,n)}),A(ne);var re=L(ne,2),ie=F(re),ae=L(ie,2),oe=L(ae,4);$(F(oe),{name:`upload`,size:13,strokeWidth:2}),Ne(),A(oe),A(re);var se=L(re,2);$(F(se),{name:`plus`,size:13,strokeWidth:2.5}),Ne(),A(se),A(C);var ce=L(C,2),le=F(ce);A(ce);var ue=L(ce,2),de=F(ue),fe=F(de),pe=F(fe),me=F(pe),he=F(me);Vi(he),A(me);var ge=L(me),_e=F(ge);A(ge);var ve=L(ge,2),ye=F(ve);A(ve);var be=L(ve),xe=F(be);A(be),Ne(2),A(pe),A(fe);var Se=L(fe),Ce=F(Se),we=e=>{var t=Xr();X(I(t),0,()=>[,,,,,],Y,(e,t)=>{K(e,bu())}),K(e,t)},Te=e=>{K(e,xu())},Ee=e=>{var i=Xr();X(I(i),1,n,e=>e.id,(e,n)=>{var i=wu();let a;var o=F(i),s=F(o);Vi(s),A(o);var c=L(o),l=F(c),u=F(l,!0);A(l);var d=L(l,2),f=e=>{var t=Cu();X(t,5,()=>(V(n),H(()=>V(n).tags.slice(0,3))),Y,(e,t)=>{var n=Su(),r=F(n,!0);A(n),R(()=>q(r,V(t))),K(e,n)}),A(t),K(e,t)};J(d,e=>{V(n),H(()=>V(n).tags?.length)&&e(f)}),A(c);var p=L(c),m=F(p),h=F(m,!0);A(m),A(p);var _=L(p),v=F(_),b=F(v,!0);A(v),A(_);var x=L(_),S=F(x,!0);A(x);var C=L(x),w=F(C,!0);A(C);var T=L(C),E=F(T);$(F(E),{name:`edit-2`,size:13,strokeWidth:2}),A(E);var D=L(E,2);$(F(D),{name:`trash-2`,size:13,strokeWidth:2}),A(D),A(T),A(i),R((e,t,r)=>{a=Ai(i,1,`mem-row svelte-83aj9g`,null,a,e),Ui(s,t),q(u,(V(n),H(()=>V(n).title))),Ai(m,1,`type-chip type-${(V(n),H(()=>V(n).type))??``}`,`svelte-83aj9g`),q(h,(U(mu),V(n),H(()=>mu[V(n).type]||V(n).type))),Mi(v,`display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:8px;font-size:0.75rem;font-weight:700;background:${(U(gu),V(n),H(()=>gu[V(n).importance]||gu[1]))??``};color:${(U(hu),V(n),H(()=>hu[V(n).importance]||hu[1]))??``};`),q(b,(V(n),H(()=>V(n).importance))),q(S,r),q(w,(V(n),H(()=>V(n).hit_count??0)))},[()=>({selected:r().has(V(n).id)}),()=>(r(),V(n),H(()=>r().has(V(n).id))),()=>(U(Tc),V(n),H(()=>Tc(V(n).updated_at)))]),W(`change`,s,()=>y.toggleSelect(V(n).id)),W(`click`,o,ea(function(e){ia.call(this,t,e)})),W(`click`,E,()=>g()(V(n))),W(`click`,D,e=>y.handleDeleteRow(V(n),e)),W(`click`,T,ea(function(e){ia.call(this,t,e)})),W(`click`,i,()=>g()(V(n))),K(e,i)}),K(e,i)};J(Ce,e=>{H(()=>y.loading)?e(we):(n(),H(()=>n().length===0)?e(Te,1):e(Ee,-1))}),A(Se),A(de),A(ue);var De=L(ue,2),Oe=e=>{var t=Eu(),n=F(t),r=F(n);A(n);var i=L(n,2),a=F(i),o=L(a,2),s=L(o,2);X(s,1,()=>(d(),f(),H(()=>Array.from({length:Math.min(5,d())},(e,t)=>Math.max(1,Math.min(f()-2,d()-4))+t))),Y,(e,t)=>{var n=Tu();let r;var i=F(n,!0);A(n),R(()=>{r=Ai(n,1,`btn btn-sm`,null,r,{"btn-primary":V(t)===f(),"btn-ghost":V(t)!==f()}),q(i,V(t))}),W(`click`,n,()=>y.goToPage(V(t))),K(e,n)});var c=L(s,2),l=L(c,2);A(i),A(t),R(()=>{q(r,`Page ${f()??``} of ${d()??``}`),a.disabled=f()<=1,o.disabled=f()<=1,c.disabled=f()>=d(),l.disabled=f()>=d()}),W(`click`,a,()=>y.goToPage(1)),W(`click`,o,()=>y.goToPage(f()-1)),W(`click`,c,()=>y.goToPage(f()+1)),W(`click`,l,()=>y.goToPage(d())),K(e,t)};J(De,e=>{d()>1&&e(Oe)});var ke=L(De,2),O=e=>{var t=Du(),n=F(t),i=F(n),a=F(i,!0);A(i),Ne(),A(n);var o=L(n,4),s=L(o,2),c=L(s,2);A(t),R(()=>q(a,(r(),H(()=>r().size)))),W(`click`,o,()=>Aa.set(new Set)),W(`click`,s,()=>y.handleBulkArchive()),W(`click`,c,()=>y.handleBulkDelete()),K(e,t)};J(ke,e=>{r(),H(()=>r().size>0)&&e(O)}),A(S),R(()=>{q(le,`${c()??``} memories
68
- ${(r(),H(()=>r().size>0?`· ${r().size} selected`:``))??``}`),Ui(he,V(h)),q(_e,`Title ${l()===`title`?u()===`desc`?`↓`:`↑`:``}`),q(ye,`Imp. ${l()===`importance`?u()===`desc`?`↓`:`↑`:``}`),q(xe,`Updated ${l()===`updated_at`?u()===`desc`?`↓`:`↑`:``}`)}),Ji(T,i,e=>dt(wa,e)),W(`input`,T,()=>y.onSearchInput()),Fi(E,a,e=>dt(Ta,e)),W(`change`,E,()=>y.onFilterChange()),Fi(ee,o,e=>dt(Ea,e)),W(`change`,ee,()=>y.onFilterChange()),Fi(ne,s,e=>dt(Ca,e)),W(`change`,ne,()=>{Sa.set(1),y.loadMemories()}),W(`click`,ie,()=>y.handleExport(`json`)),W(`click`,ae,()=>y.handleExport(`csv`)),W(`click`,oe,function(...e){v()?.apply(this,e)}),W(`click`,se,function(...e){_()?.apply(this,e)}),W(`change`,he,()=>y.toggleSelectAll()),W(`click`,ge,()=>y.toggleSort(`title`)),W(`click`,ve,()=>y.toggleSort(`importance`)),W(`click`,be,()=>y.toggleSort(`updated_at`)),K(e,S),Zi(t,`refresh`,b);var Ae=Ge(x);return m(),Ae}function Au(e){let t=j({expandedResponses:new Set,isLoadingMore:!1,hasReachedStart:!1}),{subscribe:n,update:r}=t,i={search:{icon:`search`,label:`Search`,gradient:`linear-gradient(135deg,#3b82f6,#2563eb)`,color:`#3b82f6`,bgAlpha:`rgba(59,130,246,0.12)`},read:{icon:`book-open`,label:`Read`,gradient:`linear-gradient(135deg,#10b981,#059669)`,color:`#10b981`,bgAlpha:`rgba(16,185,129,0.12)`},write:{icon:`edit`,label:`Created`,gradient:`linear-gradient(135deg,#6366f1,#4f46e5)`,color:`#6366f1`,bgAlpha:`rgba(99,102,241,0.12)`},update:{icon:`refresh-cw`,label:`Updated`,gradient:`linear-gradient(135deg,#f59e0b,#d97706)`,color:`#f59e0b`,bgAlpha:`rgba(245,158,11,0.12)`},delete:{icon:`trash`,label:`Deleted`,gradient:`linear-gradient(135deg,#ef4444,#dc2626)`,color:`#ef4444`,bgAlpha:`rgba(239,68,68,0.12)`},agent_handoff:{icon:`bot`,label:`Handoff`,gradient:`linear-gradient(135deg,#0ea5e9,#6366f1)`,color:`#0ea5e9`,bgAlpha:`rgba(14,165,233,0.12)`},agent_registered:{icon:`sparkle`,label:`Registered`,gradient:`linear-gradient(135deg,#a855f7,#6366f1)`,color:`#a855f7`,bgAlpha:`rgba(168,85,247,0.12)`},list:{icon:`list`,label:`List`,gradient:`linear-gradient(135deg,#64748b,#475569)`,color:`#64748b`,bgAlpha:`rgba(100,116,139,0.12)`}};function a(e){return i[e]??{icon:`activity`,label:e,gradient:`linear-gradient(135deg,#64748b,#475569)`,color:`#64748b`,bgAlpha:`rgba(100,116,139,0.12)`}}function o(e){if(e.action===`search`)return{main:e.query?`"${e.query}"`:`Query`,sub:e.result_count==null?`Searching memories...`:`${e.result_count} result${e.result_count===1?``:`s`} found`};if(e.task_id){let t={write:`Created`,update:`Updated`,delete:`Deleted`};return{main:e.task_title||e.task_code||e.task_id.substring(0,8),sub:e.task_code?`${t[e.action]||e.action} Task · ${e.task_code}`:(t[e.action]||e.action)+` Task`}}let t={write:`Stored`,update:`Updated`,delete:`Deleted`,read:`Read`,agent_handoff:`Handoff`,agent_registered:`Registered`},n=e.memory_type?`[${e.memory_type}]`:``;return{main:e.memory_title||(e.memory_id?e.memory_id.substring(0,8)+`…`:`—`),sub:[t[e.action]||e.action,n].filter(Boolean).join(` `)}}function s(e){if(!e)return{text:``,isLong:!1};let t=e;try{let n=typeof e==`string`?JSON.parse(e):e;if(n.content&&Array.isArray(n.content))t=n.content.filter(e=>e.type===`text`).map(e=>e.text).join(`
69
- `);else if(Array.isArray(n))if(n.length===0)t=`No items found.`;else{let e=n[0],r=e.task_code||e.task_id,i=e.memory_id||e.memory_type,a=r?`task`:i?`memory`:`item`;t=`Found ${n.length} ${a}${n.length>1?`s`:``}:\n`+n.slice(0,5).map(e=>`- ${e.title||e.task_code||e.name||e.id||`Untitled`}`).join(`
70
- `)+(n.length>5?`\n... and ${n.length-5} more`:``)}else if(n.tasks&&Array.isArray(n.tasks))t=`Found ${n.tasks.length} tasks:\n`+n.tasks.slice(0,5).map(e=>`- [${e.task_code}] ${e.title}`).join(`
71
- `)+(n.tasks.length>5?`\n... and ${n.tasks.length-5} more`:``);else if(n.results&&Array.isArray(n.results))t=`Found ${n.results.length} results:\n`+n.results.slice(0,5).map(e=>`- ${e.title||e.content?.substring(0,40)+`...`}`).join(`
72
- `)+(n.results.length>5?`\n... and ${n.results.length-5} more`:``);else if(typeof n==`object`&&n){let e=Object.keys(n);t=e.length>5?`{ ${e.slice(0,4).map(e=>`${e}: …`).join(`, `)}, +${e.length-4} more }`:JSON.stringify(n,null,2)}else t=String(n)}catch{t=e}return{text:t,isLong:t.length>400||t.split(`
73
- `).length>8}}let c=st(Ma,e=>{let t=[];return[...e].reverse().forEach(e=>{let n=new Date(e.created_at),r=new Date,i=new Date;i.setDate(r.getDate()-1);let a=n.toLocaleDateString(void 0,{month:`long`,day:`numeric`,year:`numeric`});n.toDateString()===r.toDateString()?a=`Today`:n.toDateString()===i.toDateString()&&(a=`Yesterday`);let o=t[t.length-1];o&&o.date===a?o.items.push(e):t.push({date:a,items:[e]})}),t});function l(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}function u(e){r(t=>{let n=new Set(t.expandedResponses);return n.has(e)?n.delete(e):n.add(e),{...t,expandedResponses:n}})}function d(e,t=`smooth`){e&&e.scrollTo({top:e.scrollHeight,behavior:t})}async function f(n,i){let a=M(t);if(!i||a.isLoadingMore||a.hasReachedStart)return;let o=M(Ma),s=M(Fa),c=M(Na);if(i.scrollTop<50&&o.length<s){r(e=>({...e,isLoadingMore:!0}));let t=i.scrollHeight;await e(c+1,!0),i&&setTimeout(()=>{i.scrollTop=i.scrollHeight-t},0);let n=M(Ma);r(e=>({...e,isLoadingMore:!1,hasReachedStart:n.length>=s}))}}return{subscribe:n,state:t,groupedActions:c,recentActions:Ma,recentActionsPage:Na,getConfig:a,getLabel:o,parseResponse:s,formatTime:l,renderMarkdown:Mc,toggleExpand:u,scrollToBottom:d,handleScroll:f}}var ju=G(`<div class="load-more-spinner svelte-h6z84x"><!> <span>Loading older history...</span></div>`),Mu=G(`<div style="text-align:center;padding:80px 20px;color:var(--color-text-muted);"><!> <div style="font-size:1rem;margin-top:16px;font-weight:600;">No activity found</div> <div style="font-size:0.875rem;opacity:0.7;">Events will appear here as they happen.</div></div>`),Nu=G(`<div class="action-sub svelte-h6z84x"> </div>`),Pu=G(`<button class="read-more-btn svelte-h6z84x"> </button>`),Fu=G(`<div class="bubble-row bubble-row-left animate-slide-in-left svelte-h6z84x"><div class="chat-avatar mcp-avatar svelte-h6z84x"><!></div> <div class="bubble-wrap svelte-h6z84x"><div class="tail tail-left svelte-h6z84x"></div> <div class="chat-bubble chat-bubble-mcp svelte-h6z84x" style="--bubble-bg-light: #ffffff; --bubble-bg-dark: #202c33;"><div class="mcp-sender svelte-h6z84x">MCP Node</div> <div class="markdown-body"></div> <!> <div class="bubble-meta svelte-h6z84x"><span class="bubble-time svelte-h6z84x"> </span></div></div></div></div>`),Iu=G(`<div class="bubble-row bubble-row-right animate-slide-in-right svelte-h6z84x"><div class="bubble-wrap svelte-h6z84x"><div class="chat-bubble chat-bubble-action svelte-h6z84x" style="--bubble-bg-light: #dcf8c6; --bubble-bg-dark: #056162;"><div class="action-badge svelte-h6z84x"><!> <span> </span></div> <div class="action-main svelte-h6z84x"> </div> <!> <div class="bubble-meta svelte-h6z84x"><span class="bubble-time svelte-h6z84x"> </span> <span class="bubble-status svelte-h6z84x"><!></span></div></div> <div class="tail tail-right svelte-h6z84x"></div></div> <div class="chat-avatar agent-avatar svelte-h6z84x"><!></div></div> <!>`,1),Lu=G(`<div class="date-header svelte-h6z84x"><span class="svelte-h6z84x"> </span></div> <!>`,1),Ru=G(`<div class="chat-container-viewport svelte-h6z84x"><div class="chat-container svelte-h6z84x"><!> <!></div></div>`);function zu(e,t){We(t,!1);let n=()=>N(d,`$recentActionsPage`,o),r=()=>N(f,`$handlerState`,o),i=()=>N(u,`$recentActions`,o),a=()=>N(l,`$groupedActions`,o),[o,s]=ft(),c=Au(Z(t,`onLoadPage`,8,async()=>{})()),{groupedActions:l,recentActions:u,recentActionsPage:d}=c,f=c,p=on(void 0);la(()=>{n()<=1&&!r().isLoadingMore&&i().length>0&&c.scrollToBottom(V(p),`instant`)}),aa(()=>(Mr().then(()=>{c.scrollToBottom(V(p),`instant`),V(p)&&V(p).addEventListener(`scroll`,e=>c.handleScroll(e,V(p)))}),()=>{V(p)&&V(p).removeEventListener(`scroll`,e=>c.handleScroll(e,V(p)))})),na();var m=Ru(),h=F(m),g=F(h),_=e=>{var t=ju();$(F(t),{name:`refresh-cw`,size:14,className:`animate-spin`}),Ne(2),A(t),K(e,t)};J(g,e=>{r(),H(()=>r().isLoadingMore)&&e(_)});var v=L(g,2),y=e=>{var t=Mu();$(F(t),{name:`activity`,size:48,strokeWidth:1}),Ne(4),A(t),K(e,t)},b=e=>{var t=Xr();X(I(t),1,a,Y,(e,t)=>{var n=Lu(),i=I(n),a=F(i),o=F(a,!0);A(a),A(i),X(L(i,2),1,()=>(V(t),H(()=>V(t).items)),e=>e.id,(e,t)=>{let n=qt(()=>(V(t),H(()=>c.getLabel(V(t))))),i=qt(()=>(V(t),H(()=>c.getConfig(V(t).action))));var a=Iu(),o=I(a),s=F(o),l=F(s),u=F(l),d=F(u);$(d,{get name(){return U(V(i)),H(()=>V(i).icon)},size:10,strokeWidth:2.5});var f=L(d,2),p=F(f,!0);A(f),A(u);var m=L(u,2),h=F(m,!0);A(m);var g=L(m,2),_=e=>{var t=Nu(),r=F(t,!0);A(t),R(()=>q(r,(U(V(n)),H(()=>V(n).sub)))),K(e,t)};J(g,e=>{U(V(n)),H(()=>V(n).sub)&&e(_)});var v=L(g,2),y=F(v),b=F(y,!0);A(y);var x=L(y,2);$(F(x),{name:`check-check`,size:12,strokeWidth:2}),A(x),A(v),A(l),Ne(2),A(s);var S=L(s,2);$(F(S),{name:`bot`,size:14,strokeWidth:2}),A(S),A(o);var C=L(o,2),w=e=>{let n=qt(()=>(V(t),H(()=>c.parseResponse(V(t).response)))),i=qt(()=>(r(),V(t),H(()=>r().expandedResponses.has(V(t).id))));var a=Fu(),o=F(a);$(F(o),{name:`cpu`,size:14,strokeWidth:2}),A(o);var s=L(o,2),l=L(F(s),2),u=L(F(l),2);di(u,()=>(U(V(n)),H(()=>c.renderMarkdown(V(n).text))),!0),A(u);var d=L(u,2),f=e=>{var n=Pu(),r=F(n,!0);A(n),R(()=>q(r,V(i)?`Show less`:`Read more`)),W(`click`,n,()=>c.toggleExpand(V(t).id)),K(e,n)};J(d,e=>{U(V(n)),H(()=>V(n).isLong)&&e(f)});var p=L(d,2),m=F(p),h=F(m,!0);A(m),A(p),A(l),A(s),A(a),R(e=>{Mi(u,`font-size:0.82rem; ${(U(V(i)),U(V(n)),H(()=>!V(i)&&V(n).isLong?`max-height: 200px; overflow: hidden; mask-image: linear-gradient(to bottom, black 70%, transparent 100%);`:``))??``}`),q(h,e)},[()=>(V(t),H(()=>c.formatTime(V(t).created_at)))]),K(e,a)};J(C,e=>{V(t),H(()=>V(t).response)&&e(w)}),R(e=>{Mi(u,`color:${(U(V(i)),H(()=>V(i).color))??``};background:${(U(V(i)),H(()=>V(i).bgAlpha))??``};`),q(p,(U(V(i)),H(()=>V(i).label))),q(h,(U(V(n)),H(()=>V(n).main))),q(b,e)},[()=>(V(t),H(()=>c.formatTime(V(t).created_at)))]),K(e,a)}),R(()=>q(o,(V(t),H(()=>V(t).date)))),K(e,n)}),K(e,t)};J(v,e=>{i(),H(()=>i().length===0)?e(y):e(b,-1)}),A(h),A(m),$i(m,e=>sn(p,e),()=>V(p)),K(e,m),Ge(),s()}var Bu={backlog:[{next:`pending`,label:`Move to To Do`,color:`#0ea5e9`}],pending:[{next:`in_progress`,label:`Start Progress`,color:`#a855f7`}],in_progress:[{next:`completed`,label:`Mark Complete`,color:`#10b981`},{next:`blocked`,label:`Mark Blocked`,color:`#ef4444`}],blocked:[{next:`in_progress`,label:`Resume Progress`,color:`#a855f7`}],completed:[],canceled:[]};function Vu(){let{subscribe:e,update:t,set:n}=j({memory:null,task:null,editingTitle:!1,editingDescription:!1,editTitle:``,editDescription:``,newComment:``,postingComment:!1,editingCommentId:null,editCommentText:``,savingComment:!1,contentCopied:!1,descCopied:!1}),r=st({subscribe:e},e=>e.task?`task`:e.memory?`memory`:null);async function i(e){await Ic(e)&&(t(e=>({...e,contentCopied:!0})),setTimeout(()=>t(e=>({...e,contentCopied:!1})),2e3))}async function a(e){await Ic(e)&&(t(e=>({...e,descCopied:!0})),setTimeout(()=>t(e=>({...e,descCopied:!1})),2e3))}async function o(n,r,i){let a=M({subscribe:e});if(a.task)try{await Va.updateTask(a.task.id,{[n]:r});let e={...a.task,[n]:r};t(t=>({...t,task:e})),i(e)}catch(e){throw console.error(`Failed to update task field ${String(n)}:`,e),e}}async function s(n){let r=M({subscribe:e}).editTitle.trim();r&&(await o(`title`,r,n),t(e=>({...e,editingTitle:!1})))}async function c(n){await o(`description`,M({subscribe:e}).editDescription,n),t(e=>({...e,editingDescription:!1}))}async function l(e,t){await o(`status`,e,t)}async function u(n){let r=M({subscribe:e});if(!(!r.task||!r.newComment.trim())){t(e=>({...e,postingComment:!0}));try{await Va.updateTask(r.task.id,{comment:r.newComment.trim()});let e=await Va.taskById(r.task.id);e&&(t(t=>({...t,task:e,newComment:``})),n(e))}catch(e){console.error(`Failed to post comment:`,e)}finally{t(e=>({...e,postingComment:!1}))}}}async function d(n){let r=M({subscribe:e});if(!(!r.editingCommentId||!r.editCommentText.trim())){t(e=>({...e,savingComment:!0}));try{if(await Va.updateTaskComment(r.editingCommentId,r.editCommentText.trim()),r.task){let e=await Va.taskById(r.task.id);e&&(t(t=>({...t,task:e})),n(e))}t(e=>({...e,editingCommentId:null,editCommentText:``}))}catch(e){console.error(`Failed to update comment:`,e)}finally{t(e=>({...e,savingComment:!1}))}}}async function f(n,r){let i=M({subscribe:e});if(confirm(`Delete this comment?`))try{if(await Va.deleteTaskComment(n),i.task){let e=await Va.taskById(i.task.id);e&&(t(t=>({...t,task:e})),r(e))}}catch(e){console.error(`Failed to delete comment:`,e)}}async function p(t,n){let r=M({subscribe:e});if(r.task&&confirm(`Are you sure you want to delete this task?`))try{await Va.deleteTask(r.task.id),t(r.task.id),n()}catch(e){alert(`Error deleting task: `+e.message)}}return{subscribe:e,mode:r,setMemory:e=>t(t=>({...t,memory:e,task:null})),setTask:e=>{t(e?t=>({...t,task:e,memory:null,editTitle:e.title,editDescription:e.description||``,editingTitle:!1,editingDescription:!1,newComment:``,editingCommentId:null}):e=>({...e,task:null}))},toggleEditTitle:e=>t(t=>({...t,editingTitle:e})),toggleEditDescription:e=>t(t=>({...t,editingDescription:e})),setEditTitle:e=>t(t=>({...t,editTitle:e})),setEditDescription:e=>t(t=>({...t,editDescription:e})),setNewComment:e=>t(t=>({...t,newComment:e})),startEditComment:e=>t(t=>({...t,editingCommentId:e.id,editCommentText:e.comment})),cancelEditComment:()=>t(e=>({...e,editingCommentId:null,editCommentText:``})),setEditCommentText:e=>t(t=>({...t,editCommentText:e})),handleCopyContent:i,handleCopyDesc:a,saveTitle:s,saveDescription:c,advanceStatus:l,postComment:u,saveEditComment:d,deleteComment:f,deleteTask:p,handleCommentKeydown:(e,t)=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&u(t)},reset:()=>{t(e=>({...e,memory:null,task:null,editingTitle:!1,editingDescription:!1,editTitle:``,editDescription:``,newComment:``,editingCommentId:null,editCommentText:``,postingComment:!1,savingComment:!1,contentCopied:!1,descCopied:!1}))},handleTitleKeydown:(e,n)=>{e.key===`Enter`&&s(n),e.key===`Escape`&&t(e=>({...e,editingTitle:!1}))}}}var Hu=G(`<div><span style="margin-bottom:8px;display:inline-flex;"> </span> <div class="drawer-title svelte-9n99wb"> </div></div>`),Uu=G(`<div style="display:flex;gap:6px;align-items:center;"><input class="form-input" style="font-size:0.95rem;font-weight:700;flex:1;"/> <button class="btn btn-accent" style="padding:4px 10px;font-size:0.75rem;">Save</button> <button class="btn btn-ghost" style="padding:4px 10px;font-size:0.75rem;">✕</button></div>`),Wu=G(`<div class="drawer-title editable-title svelte-9n99wb" title="Click to edit title" role="button" tabindex="0"> <span class="edit-hint svelte-9n99wb">✏️</span></div>`),Gu=G(`<div style="flex:1;min-width:0;"><div style="display:flex;align-items:center;gap:8px;margin-bottom:6px;"><span> </span> <span style="font-size:0.7rem;font-weight:700;color:var(--color-text-muted);"> </span></div> <!></div>`),Ku=G(`<div class="meta-cell svelte-9n99wb"><div class="meta-label svelte-9n99wb"> </div> <div class="meta-value svelte-9n99wb"> </div></div>`),qu=G(`<span class="tag-chip svelte-9n99wb"> </span>`),Ju=G(`<div style="margin-bottom:16px;"><div class="section-label svelte-9n99wb">Tags</div> <div style="display:flex;flex-wrap:wrap;gap:6px;"></div></div>`),Yu=G(`<div style="margin-top:16px;"><div class="section-label svelte-9n99wb">Metadata</div> <pre class="json-pre svelte-9n99wb"> </pre></div>`),Xu=G(`<div class="meta-grid svelte-9n99wb" style="margin-bottom:16px;"></div> <!> <div><div class="section-label svelte-9n99wb" style="display:flex; justify-content:space-between; align-items:center;"><span>Content</span> <button class="btn btn-ghost btn-icon" title="Copy to clipboard" style="width:20px; height:20px; padding:0; border:none; background:transparent;"><!></button></div> <div class="markdown-body md-card svelte-9n99wb"></div></div> <!>`,1),Zu=G(`<button class="btn"> </button>`),Qu=G(`<div style="margin-bottom:16px;display:flex;flex-wrap:wrap;gap:8px;"></div>`),$u=G(`<button class="btn btn-ghost" style="color: #ef4444;"><svg style="margin-right:4px;" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg> Delete Task</button>`),ed=G(`<div class="meta-cell svelte-9n99wb"><div class="meta-label svelte-9n99wb"> </div> <div class="meta-value svelte-9n99wb"> </div></div>`),td=G(`<button class="btn btn-ghost" style="padding:1px 6px;font-size:0.68rem;border-radius:4px;">Edit</button>`),nd=G(`<textarea class="form-textarea" rows="8" style="font-size:0.82rem;font-family:'JetBrains Mono',monospace;"></textarea> <div style="display:flex;gap:6px;margin-top:6px;"><button class="btn btn-accent" style="font-size:0.78rem;">Save</button> <button class="btn btn-ghost" style="font-size:0.78rem;">Cancel</button></div>`,1),rd=G(`<div class="markdown-body md-card svelte-9n99wb"></div>`),id=G(`<div style="color:var(--color-text-muted);font-size:0.82rem;font-style:italic;">No description yet. Click Edit to add one.</div>`),ad=G(`<span style="font-size:0.65rem;color:var(--color-text-muted);"> </span>`),od=G(`<button class="btn btn-ghost" style="padding:1px 5px;font-size:0.65rem;" title="Edit comment">✏️</button> <button class="btn btn-ghost" style="padding:1px 5px;font-size:0.65rem;color:#ef4444;" title="Delete comment">🗑</button>`,1),sd=G(`<textarea class="form-textarea" rows="3" style="font-size:0.8rem;margin-bottom:6px;"></textarea> <div style="display:flex;gap:6px;"><button class="btn btn-accent" style="font-size:0.75rem;"> </button> <button class="btn btn-ghost" style="font-size:0.75rem;">Cancel</button></div>`,1),cd=G(`<div class="markdown-body" style="font-size:0.78rem;color:var(--color-text);line-height:1.5;"></div>`),ld=G(`<div class="comment-card svelte-9n99wb"><div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;"><div style="display:flex;align-items:center;gap:6px;"><div class="comment-avatar svelte-9n99wb"> </div> <span style="font-size:0.72rem;font-weight:600;color:var(--color-text);"> </span> <!></div> <div style="display:flex;align-items:center;gap:8px;"><span style="font-size:0.65rem;color:var(--color-text-muted);"> </span> <!></div></div> <!></div>`),ud=G(`<div style="display:flex;flex-direction:column;gap:8px;margin-bottom:12px;"></div>`),dd=G(`<!> <div style="margin-bottom:16px;"><div class="section-label svelte-9n99wb">Status</div> <div style="display:flex; justify-content:space-between; align-items:center;"><span style="font-size:0.85rem; padding: 4px 10px;"> </span> <!></div></div> <div class="meta-grid svelte-9n99wb" style="margin-bottom:16px;"></div> <div style="margin-bottom:16px;"><div class="section-label svelte-9n99wb" style="display:flex;align-items:center;gap:6px;width:100%;"><span style="flex:1;">Description</span> <button class="btn btn-ghost btn-icon" title="Copy to clipboard" style="width:20px; height:20px; padding:0; border:none; background:transparent; margin-right:4px;"><!></button> <!></div> <!></div> <div><div class="section-label svelte-9n99wb"> </div> <div class="comment-compose svelte-9n99wb" style="margin-bottom:16px;"><textarea class="form-textarea" placeholder="Add a comment or status note…" rows="2" style="font-size:0.82rem;resize:vertical;"></textarea> <div style="display:flex;justify-content:space-between;align-items:center;margin-top:6px;"><span style="font-size:0.65rem;color:var(--color-text-muted);">Ctrl+Enter to submit</span> <button class="btn btn-accent" style="font-size:0.78rem;"> </button></div></div> <!></div>`,1),fd=G(`<div class="drawer-overlay" role="button" tabindex="0"></div> <div class="drawer-panel animate-fade-in" role="dialog" aria-modal="true" tabindex="-1"><div class="drawer-header svelte-9n99wb"><!> <button class="btn btn-ghost btn-icon" aria-label="Close" style="flex-shrink:0;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M18 6 6 18M6 6l12 12"></path></svg></button></div> <div class="drawer-body svelte-9n99wb"><!> <!></div></div>`,1);function pd(e,t){We(t,!1);let n=()=>N(p,`$mode`,i),r=()=>N(f,`$handler`,i),[i,a]=ft(),o=Z(t,`memory`,8,null),s=Z(t,`task`,8,null),c=Z(t,`open`,8,!1),l=Z(t,`onClose`,8,()=>{}),u=Z(t,`onTaskUpdated`,8,()=>{}),d=Z(t,`onTaskDeleted`,8,()=>{}),f=Vu(),{mode:p}=f;Un(()=>(U(c()),U(o()),U(s())),()=>{c()?(f.setMemory(o()),f.setTask(s())):f.reset()}),Wn(),na();var m=Xr(),h=I(m),g=e=>{var i=fd(),a=I(i),o=L(a,2),s=F(o),c=F(s),p=e=>{var t=Hu(),n=F(t),i=F(n,!0);A(n);var a=L(n,2),o=F(a,!0);A(a),A(t),R(()=>{Ai(n,1,`type-chip type-${(r(),H(()=>r().memory.type))??``}`,`svelte-9n99wb`),q(i,(r(),H(()=>r().memory.type))),q(o,(r(),H(()=>r().memory.title)))}),K(e,t)},m=e=>{var t=Gu(),n=F(t),i=F(n),a=F(i,!0);A(i);var o=L(i,2),s=F(o,!0);A(o),A(n);var c=L(n,2),l=e=>{var t=Uu(),n=F(t);Vi(n),Dn(n,!0);var i=L(n,2),a=L(i,2);A(t),Ji(n,()=>r().editTitle,e=>mt(f,H(r).editTitle=e,H(r))),W(`keydown`,n,e=>f.handleTitleKeydown(e,u())),W(`click`,i,()=>f.saveTitle(u())),W(`click`,a,()=>f.toggleEditTitle(!1)),K(e,t)},d=e=>{var t=Wu(),n=F(t);Ne(),A(t),R(()=>q(n,`${(r(),H(()=>r().task?.title??``))??``} `)),W(`click`,t,()=>f.toggleEditTitle(!0)),K(e,t)};J(c,e=>{r(),H(()=>r().editingTitle)?e(l):e(d,-1)}),A(t),R((e,t)=>{Ai(i,1,`status-chip ${e??``}`,`svelte-9n99wb`),q(a,t),q(s,(r(),H(()=>r().task.task_code)))},[()=>(U(kc),r(),H(()=>kc(r().task.status))),()=>(U(Ac),r(),H(()=>Ac(r().task.status)))]),K(e,t)};J(c,e=>{n(),r(),H(()=>n()===`memory`&&r().memory)?e(p):(n(),r(),H(()=>n()===`task`&&r().task)&&e(m,1))});var h=L(c,2);A(s);var g=L(s,2),_=F(g),v=e=>{var t=Xu(),n=I(t);X(n,5,()=>(r(),U(Tc),H(()=>[{label:`Importance`,val:r().memory.importance},{label:`Hit Count`,val:r().memory.hit_count??0},{label:`Created`,val:Tc(r().memory.created_at)},{label:`Updated`,val:Tc(r().memory.updated_at)}])),Y,(e,t)=>{var n=Ku(),r=F(n),i=F(r,!0);A(r);var a=L(r,2),o=F(a,!0);A(a),A(n),R(()=>{q(i,(V(t),H(()=>V(t).label))),q(o,(V(t),H(()=>V(t).val)))}),K(e,n)}),A(n);var i=L(n,2),a=e=>{var t=Ju(),n=L(F(t),2);X(n,5,()=>(r(),H(()=>r().memory.tags)),Y,(e,t)=>{var n=qu(),r=F(n,!0);A(n),R(()=>q(r,V(t))),K(e,n)}),A(n),A(t),K(e,t)};J(i,e=>{r(),H(()=>r().memory.tags?.length)&&e(a)});var o=L(i,2),s=F(o),c=L(F(s),2),l=F(c);{let e=qt(()=>(r(),H(()=>r().contentCopied?`check`:`copy`))),t=qt(()=>(r(),H(()=>r().contentCopied?`text-success`:``)));$(l,{get name(){return V(e)},size:12,strokeWidth:2,get className(){return V(t)}})}A(c),A(s);var u=L(s,2);di(u,()=>(U(Mc),r(),H(()=>Mc(r().memory?.content||``))),!0),A(u),A(o);var d=L(o,2),p=e=>{var t=Yu(),n=L(F(t),2),i=F(n,!0);A(n),A(t),R(e=>q(i,e),[()=>(r(),H(()=>JSON.stringify(r().memory.metadata,null,2)))]),K(e,t)},m=Kt(()=>(r(),H(()=>r().memory.metadata&&Object.keys(r().memory.metadata).length>0)));J(d,e=>{V(m)&&e(p)}),W(`click`,c,()=>f.handleCopyContent(r().memory?.content||``)),K(e,t)};J(_,e=>{n(),r(),H(()=>n()===`memory`&&r().memory)&&e(v)});var y=L(_,2),b=e=>{var t=dd(),n=I(t),i=e=>{var t=Qu();X(t,5,()=>(U(Bu),r(),H(()=>Bu[r().task.status])),Y,(e,t)=>{var n=Zu(),r=F(n,!0);A(n),R(()=>{Mi(n,`background:${(V(t),H(()=>V(t).color))??``};color:#fff;border:none;padding:6px 14px;font-size:0.78rem;font-weight:700;border-radius:8px;cursor:pointer;`),q(r,(V(t),H(()=>V(t).label)))}),W(`click`,n,()=>f.advanceStatus(V(t).next,u())),K(e,n)}),A(t),K(e,t)};J(n,e=>{U(Bu),r(),H(()=>Bu[r().task.status]?.length)&&e(i)});var a=L(n,2),o=L(F(a),2),s=F(o),c=F(s,!0);A(s);var p=L(s,2),m=e=>{var t=$u();W(`click`,t,()=>f.deleteTask(d(),l())),K(e,t)};J(p,e=>{r(),H(()=>r().task?.status!==`completed`)&&e(m)}),A(o),A(a);var h=L(a,2);X(h,5,()=>(U(jc),r(),U(Tc),H(()=>[{label:`Priority`,val:jc(r().task.priority)},{label:`Phase`,val:r().task.phase||`—`},{label:`Agent`,val:r().task.agent||`—`},{label:`Updated`,val:Tc(r().task.updated_at)}])),Y,(e,t)=>{var n=ed(),r=F(n),i=F(r,!0);A(r);var a=L(r,2),o=F(a,!0);A(a),A(n),R(()=>{q(i,(V(t),H(()=>V(t).label))),q(o,(V(t),H(()=>V(t).val)))}),K(e,n)}),A(h);var g=L(h,2),_=F(g),v=L(F(_),2),y=F(v);{let e=qt(()=>(r(),H(()=>r().descCopied?`check`:`copy`))),t=qt(()=>(r(),H(()=>r().descCopied?`text-success`:``)));$(y,{get name(){return V(e)},size:12,strokeWidth:2,get className(){return V(t)}})}A(v);var b=L(v,2),x=e=>{var t=td();W(`click`,t,()=>f.toggleEditDescription(!0)),K(e,t)};J(b,e=>{r(),H(()=>!r().editingDescription)&&e(x)}),A(_);var S=L(_,2),C=e=>{var t=nd(),n=I(t);On(n);var i=L(n,2),a=F(i),o=L(a,2);A(i),Ji(n,()=>r().editDescription,e=>mt(f,H(r).editDescription=e,H(r))),W(`click`,a,()=>f.saveDescription(u())),W(`click`,o,()=>f.toggleEditDescription(!1)),K(e,t)},w=e=>{var t=rd();di(t,()=>(U(Mc),r(),H(()=>Mc(r().task.description))),!0),A(t),K(e,t)},T=e=>{K(e,id())};J(S,e=>{r(),H(()=>r().editingDescription)?e(C):(r(),H(()=>r().task?.description)?e(w,1):e(T,-1))}),A(g);var E=L(g,2),D=F(E),ee=F(D);A(D);var te=L(D,2),ne=F(te);On(ne);var re=L(ne,2),ie=L(F(re),2),ae=F(ie,!0);A(ie),A(re),A(te);var oe=L(te,2),se=e=>{var t=ud();X(t,5,()=>(r(),H(()=>r().task.comments)),e=>e.id,(e,t)=>{var n=ld(),i=F(n),a=F(i),o=F(a),s=F(o,!0);A(o);var c=L(o,2),l=F(c,!0);A(c);var d=L(c,2),p=e=>{var n=ad(),r=F(n);A(n),R((e,t)=>q(r,`${e??``} → ${t??``}`),[()=>(U(Ac),V(t),H(()=>Ac(V(t).previous_status))),()=>(U(Ac),V(t),H(()=>Ac(V(t).next_status)))]),K(e,n)};J(d,e=>{V(t),H(()=>V(t).previous_status&&V(t).next_status)&&e(p)}),A(a);var m=L(a,2),h=F(m),g=F(h,!0);A(h);var _=L(h,2),v=e=>{var n=od(),r=I(n),i=L(r,2);W(`click`,r,()=>f.startEditComment(V(t))),W(`click`,i,()=>f.deleteComment(V(t).id,u())),K(e,n)};J(_,e=>{V(t),H(()=>V(t).id)&&e(v)}),A(m),A(i);var y=L(i,2),b=e=>{var t=sd(),n=I(t);On(n);var i=L(n,2),a=F(i),o=F(a,!0);A(a);var s=L(a,2);A(i),R(()=>{a.disabled=(r(),H(()=>r().savingComment)),q(o,(r(),H(()=>r().savingComment?`Saving…`:`Save`)))}),Ji(n,()=>r().editCommentText,e=>mt(f,H(r).editCommentText=e,H(r))),W(`click`,a,()=>f.saveEditComment(u())),W(`click`,s,function(...e){f.cancelEditComment?.apply(this,e)}),K(e,t)},x=e=>{var n=cd();di(n,()=>(U(Mc),V(t),H(()=>Mc(V(t).comment))),!0),A(n),K(e,n)};J(y,e=>{r(),V(t),H(()=>r().editingCommentId===V(t).id)?e(b):e(x,-1)}),A(n),R((e,n)=>{q(s,e),q(l,(V(t),H(()=>V(t).agent||`Unknown`))),q(g,n)},[()=>(V(t),H(()=>(V(t).agent||`U`).charAt(0).toUpperCase())),()=>(U(Tc),V(t),H(()=>Tc(V(t).created_at)))]),K(e,n)}),A(t),K(e,t)};J(oe,e=>{r(),H(()=>r().task.comments?.length)&&e(se)}),A(E),R((e,t,n)=>{Ai(s,1,`status-chip ${e??``}`,`svelte-9n99wb`),q(c,t),q(ee,`Activity (${(r(),H(()=>r().task.comments?.length??0))??``})`),ie.disabled=n,q(ae,(r(),H(()=>r().postingComment?`Posting…`:`Post Comment`)))},[()=>(U(kc),r(),H(()=>kc(r().task?.status||`pending`))),()=>(U(Ac),r(),H(()=>Ac(r().task?.status||``))),()=>(r(),H(()=>r().postingComment||!r().newComment.trim()))]),W(`click`,v,()=>f.handleCopyDesc(r().task?.description||``)),Ji(ne,()=>r().newComment,e=>mt(f,H(r).newComment=e,H(r))),W(`keydown`,ne,e=>f.handleCommentKeydown(e,u())),W(`click`,ie,()=>f.postComment(u())),K(e,t)};J(y,e=>{n(),r(),H(()=>n()===`task`&&r().task)&&e(b)}),A(g),A(o),W(`click`,a,function(...e){l()?.apply(this,e)}),W(`click`,h,function(...e){l()?.apply(this,e)}),W(`click`,o,ea(function(e){ia.call(this,t,e)})),K(e,i)};J(h,e=>{c()&&n()&&e(g)}),K(e,m),Ge(),a()}function md(){let e=j({item:null,toolArgs:{},toolRunning:!1,toolResult:null,toolError:null,copied:!1}),{subscribe:t,update:n}=e,r=st(e,e=>e.item?.type?e.item.type.charAt(0).toUpperCase()+e.item.type.slice(1):``);function i(t,r){M(e).item!==t&&n(e=>{let n={};return t&&t.type===`tool`&&t.data?.inputSchema?.properties?.repo&&r&&(n.repo=r),{...e,item:t,toolArgs:n,toolResult:null,toolError:null,toolRunning:!1}})}function a(e,t){n(n=>({...n,toolArgs:{...n.toolArgs,[e]:t}}))}async function o(){let t=M(e),r=t.item;if(!(!r||r.type!==`tool`)){n(e=>({...e,toolRunning:!0,toolResult:null,toolError:null}));try{let e={};if(r.data.inputSchema?.properties){for(let[n,r]of Object.entries(t.toolArgs))if(!(r===void 0||r===``))try{e[n]=JSON.parse(r)}catch{e[n]=r}}let i=await Va.callTool(r.data.name,e);n(e=>({...e,toolResult:JSON.stringify(i,null,2)}))}catch(e){n(t=>({...t,toolError:e.message}))}finally{n(e=>({...e,toolRunning:!1}))}}}async function s(e){await Ic(e)&&(n(e=>({...e,copied:!0})),setTimeout(()=>n(e=>({...e,copied:!1})),2e3))}function c(e,t){e.target===e.currentTarget&&t()}function l(e){e.stopPropagation()}function u(){n(e=>({...e,item:null,toolArgs:{},toolRunning:!1,toolResult:null,toolError:null,copied:!1}))}return{subscribe:t,typeLabel:r,setItem:i,setToolArg:a,runTool:o,copyToClipboardWrapper:s,handleOverlayClick:c,handlePanelClick:l,reset:u}}var hd=G(`<div class="drawer-section svelte-17ad9lv"><div class="section-label svelte-17ad9lv">Description</div> <div class="markdown-body md-card svelte-17ad9lv"></div></div>`),gd=G(`<span style="font-size: 0.6rem; color: #ef4444; font-weight: bold; background: rgba(239, 68, 68, 0.1); padding: 2px 4px; border-radius: 4px;">REQ</span>`),_d=G(`<div style="font-size: 0.75rem; color: var(--color-text-muted); margin-bottom: 6px; line-height: 1.2;"> </div>`),vd=G(`<div style="border: 1px solid var(--color-border); border-radius: 4px; padding: 8px 10px; margin-bottom: 6px; background: rgba(0,0,0,0.01);"><div style="display:flex; justify-content:space-between; align-items:center; margin-bottom: 4px;"><span style="color: var(--color-text); font-family: monospace; font-size: 0.8rem; font-weight: 600;"> </span> <div style="display:flex; gap: 8px; align-items: center;"><span style="font-size: 0.7rem; color: var(--color-text-muted);"> </span> <!></div></div> <!> <input type="text" class="form-input" style="font-size:0.8rem; padding: 4px 8px; border-radius: 4px; min-height: 28px;"/></div>`),yd=G(`<div class="section-label svelte-17ad9lv">Playground (Input Parameters)</div> <!>`,1),bd=G(`<div class="section-label svelte-17ad9lv">Playground</div> <div style="font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 8px;">No arguments required.</div>`,1),xd=G(`<div style="margin-top: 12px; border: 1px solid #fecaca; background: #fef2f2; color: #ef4444; padding: 12px; border-radius: 8px; font-size: 0.85rem;"><strong>Error:</strong> </div>`),Sd=G(`<div style="margin-top: 12px;" class="drawer-section svelte-17ad9lv"><div class="section-label svelte-17ad9lv" style="display:flex; justify-content:space-between; align-items:center;"><span>Response</span> <button class="btn btn-ghost btn-icon" title="Copy to clipboard" style="width:24px; height:24px; padding:0; border:none; background:transparent;"><!></button></div> <div class="md-card markdown-body svelte-17ad9lv" style="padding: 1px 16px;"></div></div>`),Cd=G(`<div class="drawer-section svelte-17ad9lv"><!> <div style="margin-top: 8px;"><button class="btn btn-accent" style="width:100%"> </button></div> <!> <!></div>`),wd=G(`<span style="font-size: 0.7rem; color: #ef4444; font-weight: bold;">REQUIRED</span>`),Td=G(`<div style="font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 6px;"> </div>`),Ed=G(`<div style="border: 1px solid var(--color-border); border-radius: 8px; padding: 12px; margin-bottom: 8px; background: rgba(0,0,0,0.02);"><div style="display:flex; justify-content:space-between; align-items:flex-start; margin-bottom: 4px;"><strong style="color: var(--color-text); font-family: monospace;"> </strong> <!></div> <!></div>`),Dd=G(`<div style="font-size: 0.85rem; color: var(--color-text-muted); font-style: italic;">No arguments.</div>`),Od=G(`<div class="drawer-section svelte-17ad9lv"><div class="section-label svelte-17ad9lv">Arguments</div> <!> <!></div>`),kd=G(`<div class="md-card svelte-17ad9lv" style="margin-bottom: 8px;"><div style="font-size: 0.7rem; font-weight: bold; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 8px;"> </div> <div class="markdown-body"></div></div>`),Ad=G(`<div class="drawer-section svelte-17ad9lv"><div class="section-label svelte-17ad9lv">Template</div> <!></div>`),jd=G(`<div style="font-size: 0.85rem; margin-bottom: 8px;"><span style="color: var(--color-text-muted);">URI:</span> <code style="font-size: 0.8rem; background: var(--color-bg); padding: 2px 4px; border-radius: 4px; border: 1px solid var(--color-border);"> </code></div>`),Md=G(`<div style="font-size: 0.85rem;"><span style="color: var(--color-text-muted);">MIME Type:</span> <span> </span></div>`),Nd=G(`<div class="drawer-section svelte-17ad9lv"><div class="section-label svelte-17ad9lv">Details</div> <!> <!></div>`),Pd=G(`<div class="drawer-overlay" style="z-index: 100;"></div> <div class="drawer-panel animate-fade-in" role="dialog" aria-modal="true" tabindex="-1" style="z-index: 101;"><div class="drawer-header svelte-17ad9lv"><div style="flex:1; min-width:0; padding-right:16px;"><span class="type-chip svelte-17ad9lv" style="margin-bottom:8px;display:inline-flex;"> </span> <div class="drawer-title svelte-17ad9lv"> </div></div> <button class="btn btn-ghost btn-icon" aria-label="Close" style="flex-shrink:0;"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M18 6 6 18M6 6l12 12"></path></svg></button></div> <div class="drawer-body svelte-17ad9lv"><!> <!> <!> <!> <!></div></div>`,1);function Fd(e,t){We(t,!1);let n=()=>N(ma,`$currentRepo`,a),r=()=>N(d,`$state`,a),i=()=>N(f,`$typeLabel`,a),[a,o]=ft(),s=Z(t,`item`,8,null),c=Z(t,`open`,8,!1),l=Z(t,`onClose`,8,()=>{}),u=md(),d=u,f=u.typeLabel;Un(()=>(U(c()),U(s()),n()),()=>{c()?u.setItem(s(),n()):u.reset()}),Wn(),na();var p=Xr(),m=I(p),h=e=>{var t=Pd(),n=I(t),a=L(n,2),o=F(a),s=F(o),c=F(s),d=F(c,!0);A(c);var f=L(c,2),p=F(f,!0);A(f),A(s);var m=L(s,2);A(o);var h=L(o,2),_=F(h),v=e=>{var t=hd(),n=L(F(t),2);di(n,()=>(U(Mc),r(),H(()=>Mc(r().item.data.description))),!0),A(n),A(t),K(e,t)};J(_,e=>{r(),H(()=>r().item.data.description)&&e(v)});var y=L(_,2),b=e=>{var t=Cd(),n=F(t),i=e=>{var t=yd();X(L(I(t),2),1,()=>(r(),H(()=>Object.entries(r().item.data.inputSchema.properties))),Y,(e,t)=>{var n=Kt(()=>g(V(t),2));let i=()=>V(n)[0],a=()=>V(n)[1];var o=vd(),s=F(o),c=F(s),l=F(c,!0);A(c);var d=L(c,2),f=F(d),p=F(f,!0);A(f);var m=L(f,2),h=e=>{K(e,gd())},_=Kt(()=>(r(),i(),H(()=>r().item.data.inputSchema.required?.includes(i()))));J(m,e=>{V(_)&&e(h)}),A(d),A(s);var v=L(s,2),y=e=>{var t=_d(),n=F(t,!0);A(t),R(()=>q(n,(a(),H(()=>a().description)))),K(e,t)};J(v,e=>{a(),H(()=>a().description)&&e(y)});var b=L(v,2);Vi(b),A(o),R(()=>{q(l,i()),q(p,(a(),H(()=>a().type))),Wi(b,`placeholder`,`Value for ${i()}`),Hi(b,(r(),i(),H(()=>r().toolArgs[i()]||``)))}),W(`input`,b,e=>u.setToolArg(i(),e.currentTarget.value)),K(e,o)}),K(e,t)},a=Kt(()=>(r(),H(()=>r().item.data.inputSchema?.properties&&Object.keys(r().item.data.inputSchema.properties).length>0))),o=e=>{var t=bd();Ne(2),K(e,t)};J(n,e=>{V(a)?e(i):e(o,-1)});var s=L(n,2),c=F(s),l=F(c,!0);A(c),A(s);var d=L(s,2),f=e=>{var t=xd(),n=L(F(t));A(t),R(()=>q(n,` ${(r(),H(()=>r().toolError))??``}`)),K(e,t)};J(d,e=>{r(),H(()=>r().toolError)&&e(f)});var p=L(d,2),m=e=>{var t=Sd(),n=F(t),i=L(F(n),2),a=F(i);{let e=qt(()=>(r(),H(()=>r().copied?`check`:`copy`))),t=qt(()=>(r(),H(()=>r().copied?`text-success`:``)));$(a,{get name(){return V(e)},size:14,strokeWidth:2,get className(){return V(t)}})}A(i),A(n);var o=L(n,2);di(o,()=>(U(Mc),r(),H(()=>Mc("```json\n"+r().toolResult+"\n```"))),!0),A(o),A(t),W(`click`,i,()=>u.copyToClipboardWrapper(r().toolResult||``)),K(e,t)};J(p,e=>{r(),H(()=>r().toolResult)&&e(m)}),A(t),R(()=>{c.disabled=(r(),H(()=>r().toolRunning)),q(l,(r(),H(()=>r().toolRunning?`Running...`:`Submit`)))}),W(`click`,c,()=>u.runTool()),K(e,t)};J(y,e=>{r(),H(()=>r().item.type===`tool`)&&e(b)});var x=L(y,2),S=e=>{var t=Od(),n=L(F(t),2);X(n,1,()=>(r(),H(()=>r().item.data.arguments)),Y,(e,t)=>{var n=Ed(),r=F(n),i=F(r),a=F(i,!0);A(i);var o=L(i,2),s=e=>{K(e,wd())};J(o,e=>{V(t),H(()=>V(t).required)&&e(s)}),A(r);var c=L(r,2),l=e=>{var n=Td(),r=F(n,!0);A(n),R(()=>q(r,(V(t),H(()=>V(t).description)))),K(e,n)};J(c,e=>{V(t),H(()=>V(t).description)&&e(l)}),A(n),R(()=>q(a,(V(t),H(()=>V(t).name)))),K(e,n)});var i=L(n,2),a=e=>{K(e,Dd())};J(i,e=>{r(),H(()=>r().item.data.arguments.length===0)&&e(a)}),A(t),K(e,t)};J(x,e=>{r(),H(()=>r().item.type===`prompt`&&r().item.data.arguments)&&e(S)});var C=L(x,2),w=e=>{var t=Ad();X(L(F(t),2),1,()=>(r(),H(()=>r().item.data.messages)),Y,(e,t)=>{var n=kd(),r=F(n),i=F(r);A(r);var a=L(r,2);di(a,()=>(U(Mc),V(t),H(()=>Mc(V(t).content?.text||V(t).content||``))),!0),A(a),A(n),R(()=>q(i,`Role: ${(V(t),H(()=>V(t).role))??``}`)),K(e,n)}),A(t),K(e,t)};J(C,e=>{r(),H(()=>r().item.type===`prompt`&&r().item.data.messages&&r().item.data.messages.length>0)&&e(w)});var T=L(C,2),E=e=>{var t=Nd(),n=L(F(t),2),i=e=>{var t=jd(),n=L(F(t),2),i=F(n,!0);A(n),A(t),R(()=>q(i,(r(),H(()=>r().item.data.uri)))),K(e,t)};J(n,e=>{r(),H(()=>r().item.data.uri)&&e(i)});var a=L(n,2),o=e=>{var t=Md(),n=L(F(t),2),i=F(n,!0);A(n),A(t),R(()=>q(i,(r(),H(()=>r().item.data.mimeType)))),K(e,t)};J(a,e=>{r(),H(()=>r().item.data.mimeType)&&e(o)}),A(t),K(e,t)};J(T,e=>{r(),H(()=>r().item.type===`resource`)&&e(E)}),A(h),A(a),R(()=>{q(d,i()),q(p,(r(),H(()=>r().item.data.name)))}),W(`click`,n,e=>u.handleOverlayClick(e,l())),W(`click`,m,function(...e){l()?.apply(this,e)}),W(`click`,a,function(...e){u.handlePanelClick?.apply(this,e)}),K(e,t)};J(m,e=>{U(c()),r(),H(()=>c()&&r().item)&&e(h)}),K(e,p),Ge(),o()}function Id(e){let t=j({title:``,type:`code_fact`,content:``,importance:3,tags:``,agent:``,model:``}),n=j(!1),r=j(!1),i=j(!1),a=j(``),o=j(!1),s=null;function c(e){s=e,e?(t.set({title:e.title,type:e.type,content:e.content,importance:e.importance,tags:(e.tags||[]).join(`, `),agent:e.agent||``,model:e.model||``}),n.set(!1)):(t.set({title:``,type:`code_fact`,content:``,importance:3,tags:``,agent:``,model:``}),n.set(!0)),o.set(!1),a.set(``),r.set(!1),i.set(!1)}function l(e){return e.split(`,`).map(e=>e.trim()).filter(Boolean)}async function u(){let n=M(t);if(!n.title.trim()||!n.content.trim()){a.set(`Title and Content are required.`);return}r.set(!0),a.set(``);try{let t=M(ma),r={title:n.title.trim(),type:n.type,content:n.content.trim(),importance:Number(n.importance),tags:l(n.tags),agent:n.agent.trim()||void 0,model:n.model.trim()||void 0,repo:t,scope:{repo:t}},i;if(s)await Va.updateMemory(s.id,r),i={...s,...r,updated_at:new Date().toISOString()};else{let e=await Va.createMemory(r);i={...r,id:e.id,hit_count:0,recall_count:0,created_at:new Date().toISOString(),updated_at:new Date().toISOString()}}e.onSaved(i),e.onClose()}catch(e){a.set(e.message||`Failed to save memory.`)}finally{r.set(!1)}}async function d(){if(s&&confirm(`Permanently delete this memory? This cannot be undone.`)){i.set(!0),a.set(``);try{await Va.deleteMemory(s.id),e.onDeleted(s.id),e.onClose()}catch(e){a.set(e.message||`Failed to delete memory.`)}finally{i.set(!1)}}}return{form:t,editing:n,saving:r,deleting:i,error:a,previewMode:o,reset:c,save:u,deleteMemory:d,startEditing:()=>{n.set(!0),o.set(!1)},cancelEdit:()=>{s?(c(s),n.set(!1)):e.onClose()},togglePreview:()=>o.update(e=>!e)}}var Ld=G(`<div style="font-size:0.62rem;font-weight:700;text-transform:uppercase;letter-spacing:0.07em;color:var(--color-text-muted);margin-bottom:6px;"> </div> <input class="form-input mem-title-input svelte-intd6h" placeholder="Memory title…"/>`,1),Rd=G(`<span style="margin-bottom:8px;display:inline-flex;"> </span> <div class="drawer-title svelte-intd6h"> </div>`,1),zd=G(`<button class="btn btn-ghost btn-sm" title="Edit memory" aria-label="Edit"><!> <span>Edit</span></button> <button class="btn btn-ghost btn-sm" style="color:#ef4444;" title="Delete memory" aria-label="Delete"><!> <span> </span></button>`,1),Bd=G(`<div class="mem-error svelte-intd6h"> </div>`),Vd=G(`<div class="meta-cell svelte-intd6h"><div class="meta-label svelte-intd6h"> </div> <div class="meta-value svelte-intd6h"> </div></div>`),Hd=G(`<span class="tag-chip svelte-intd6h"> </span>`),Ud=G(`<div style="margin-bottom:16px;"><div class="section-label svelte-intd6h">Tags</div> <div style="display:flex;flex-wrap:wrap;gap:6px;"></div></div>`),Wd=G(`<div style="margin-top:16px;"><div class="section-label svelte-intd6h">Metadata</div> <pre class="json-pre svelte-intd6h"> </pre></div>`),Gd=G(`<div class="meta-grid svelte-intd6h" style="margin-bottom:16px;"></div> <!> <div><div class="section-label svelte-intd6h">Content</div> <div class="markdown-body md-card svelte-intd6h"></div></div> <!>`,1),Kd=G(`<option> </option>`),qd=G(`<span> </span>`),Jd=G(`<span style="color:var(--color-text-muted);font-style:italic;">Nothing to preview yet…</span>`),Yd=G(`<div class="markdown-body md-card svelte-intd6h" style="min-height:200px;"><!></div>`),Xd=G(`<textarea id="mem_content" class="form-textarea" rows="10" style="font-family:'JetBrains Mono',monospace;font-size:0.82rem;resize:vertical;" placeholder="Write memory content in Markdown…"></textarea>`),Zd=G(`<div class="mem-form svelte-intd6h"><div class="form-row-2 svelte-intd6h"><div><label for="mem_type" class="form-label svelte-intd6h">Type *</label> <select id="mem_type" class="form-select"></select></div> <div><label for="mem_importance" class="form-label svelte-intd6h">Importance <span class="importance-badge svelte-intd6h"> </span></label> <input id="mem_importance" type="range" min="1" max="5" step="1" class="importance-slider svelte-intd6h"/> <div class="importance-ticks svelte-intd6h"></div></div></div> <div><label for="mem_tags" class="form-label svelte-intd6h">Tags <span style="font-weight:400;font-style:italic;">(comma separated)</span></label> <input id="mem_tags" class="form-input" placeholder="react, typescript, architecture…"/></div> <div class="form-row-2 svelte-intd6h"><div><label for="mem_agent" class="form-label svelte-intd6h">Agent</label> <input id="mem_agent" class="form-input" placeholder="e.g. claude-opus"/></div> <div><label for="mem_model" class="form-label svelte-intd6h">Model</label> <input id="mem_model" class="form-input" placeholder="e.g. claude-3-opus"/></div></div> <div><div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;"><label for="mem_content" class="form-label svelte-intd6h" style="margin-bottom:0;">Content * <span style="font-weight:400;color:var(--color-text-muted);">(Markdown supported)</span></label> <button type="button" class="btn btn-ghost btn-sm"><!> </button></div> <!></div></div>`),Qd=G(`<div class="mem-footer svelte-intd6h"><button class="btn btn-ghost">Cancel</button> <button class="btn btn-accent"><!> </button></div>`),$d=G(`<div class="drawer-overlay" role="button" tabindex="0"></div> <div class="drawer-panel animate-fade-in" role="dialog" aria-modal="true" tabindex="-1"><div class="mem-header svelte-intd6h"><div style="flex:1;min-width:0;"><!></div> <div class="mem-header-actions svelte-intd6h"><!> <button class="btn btn-ghost btn-icon" aria-label="Close"><!></button></div></div> <div class="drawer-body svelte-intd6h"><!> <!></div> <!></div>`,1);function ef(e,t){We(t,!1);let n=()=>N(y,`$editing`,c),r=()=>N(v,`$form`,c),i=()=>N(x,`$deleting`,c),a=()=>N(S,`$error`,c),o=()=>N(C,`$previewMode`,c),s=()=>N(b,`$saving`,c),[c,l]=ft(),u=on(),d=on(),f=Z(t,`memory`,8,null),p=Z(t,`open`,8,!1),m=Z(t,`onClose`,8,()=>{}),h=Z(t,`onSaved`,8,()=>{}),g=Z(t,`onDeleted`,8,()=>{}),_=Id({onSaved:h(),onDeleted:g(),onClose:m()}),{form:v,editing:y,saving:b,deleting:x,error:S,previewMode:C}=_;Un(()=>U(f()),()=>{sn(u,f()===null)}),Un(()=>(U(f()),n()),()=>{sn(d,!!f()&&!n())}),Un(()=>(U(p()),U(f())),()=>{(p()||f()!==void 0)&&p()&&_.reset(f())}),Wn(),na();var w=Xr(),T=I(w),E=e=>{var c=$d(),l=I(c),d=L(l,2),p=F(d),h=F(p),g=F(h),y=e=>{var t=Ld(),n=I(t),i=F(n,!0);A(n);var a=L(n,2);Vi(a),R(()=>q(i,V(u)?`✦ New Memory`:`✏️ Edit Memory`)),Ji(a,()=>r().title,e=>(mt(v,H(r).title=e,H(r)),cr(()=>{}))),K(e,t)},b=e=>{var t=Rd(),n=I(t),r=F(n,!0);A(n);var i=L(n,2),a=F(i,!0);A(i),R(()=>{Ai(n,1,`type-chip type-${(U(f()),H(()=>f().type))??``}`,`svelte-intd6h`),q(r,(U(mu),U(f()),H(()=>mu[f().type]||f().type))),q(a,(U(f()),H(()=>f().title)))}),K(e,t)};J(g,e=>{V(u)||n()?e(y):f()&&e(b,1)}),A(h);var x=L(h,2),S=F(x),C=e=>{var t=zd(),n=I(t);$(F(n),{name:`edit`,size:14,strokeWidth:2}),Ne(2),A(n);var r=L(n,2),a=F(r);$(a,{name:`trash-2`,size:14,strokeWidth:2});var o=L(a,2),s=F(o,!0);A(o),A(r),R(()=>{r.disabled=i(),q(s,i()?`Deleting…`:`Delete`)}),W(`click`,n,function(...e){_.startEditing?.apply(this,e)}),W(`click`,r,function(...e){_.deleteMemory?.apply(this,e)}),K(e,t)};J(S,e=>{f()&&!n()&&e(C)});var w=L(S,2);$(F(w),{name:`x`,size:18,strokeWidth:2.5}),A(w),A(x),A(p);var T=L(p,2),E=F(T),D=e=>{var t=Bd(),n=F(t,!0);A(t),R(()=>q(n,a())),K(e,t)};J(E,e=>{a()&&e(D)});var ee=L(E,2),te=e=>{var t=Gd(),n=I(t);X(n,5,()=>(U(f()),U(Tc),H(()=>[{label:`Importance`,val:f().importance},{label:`Hit Count`,val:f().hit_count??0},{label:`Created`,val:Tc(f().created_at)},{label:`Updated`,val:Tc(f().updated_at)}])),Y,(e,t)=>{var n=Vd(),r=F(n),i=F(r,!0);A(r);var a=L(r,2),o=F(a,!0);A(a),A(n),R(()=>{q(i,(V(t),H(()=>V(t).label))),q(o,(V(t),H(()=>V(t).val)))}),K(e,n)}),A(n);var r=L(n,2),i=e=>{var t=Ud(),n=L(F(t),2);X(n,5,()=>(U(f()),H(()=>f().tags)),Y,(e,t)=>{var n=Hd(),r=F(n,!0);A(n),R(()=>q(r,V(t))),K(e,n)}),A(n),A(t),K(e,t)};J(r,e=>{U(f()),H(()=>f().tags?.length)&&e(i)});var a=L(r,2),o=L(F(a),2);di(o,()=>(U(Mc),U(f()),H(()=>Mc(f().content))),!0),A(o),A(a);var s=L(a,2),c=e=>{var t=Wd(),n=L(F(t),2),r=F(n,!0);A(n),A(t),R(e=>q(r,e),[()=>(U(f()),H(()=>JSON.stringify(f().metadata,null,2)))]),K(e,t)},l=Kt(()=>(U(f()),H(()=>f().metadata&&Object.keys(f().metadata).length>0)));J(s,e=>{V(l)&&e(c)}),K(e,t)},ne=e=>{var t=Zd(),n=F(t),i=F(n),a=L(F(i),2);X(a,5,()=>pu,Y,(e,t)=>{var n=Kd(),r=F(n,!0);A(n);var i={};R(()=>{q(r,(U(mu),V(t),H(()=>mu[V(t)]))),i!==(i=V(t))&&(n.value=(n.__value=V(t))??``)}),K(e,n)}),A(a),A(i);var s=L(i,2),c=F(s),l=L(F(c)),u=F(l,!0);A(l),A(c);var d=L(c,2);Vi(d);var f=L(d,2);X(f,4,()=>[1,2,3,4,5],Y,(e,t)=>{var n=qd();let i;var a=F(n,!0);A(n),R(()=>{i=Ai(n,1,`svelte-intd6h`,null,i,{active:r().importance>=t}),q(a,t)}),K(e,n)}),A(f),A(s),A(n);var p=L(n,2),m=L(F(p),2);Vi(m),A(p);var h=L(p,2),g=F(h),y=L(F(g),2);Vi(y),A(g);var b=L(g,2),x=L(F(b),2);Vi(x),A(b),A(h);var S=L(h,2),C=F(S),w=L(F(C),2),T=F(w);{let e=qt(()=>o()?`edit`:`eye`);$(T,{get name(){return V(e)},size:12,strokeWidth:2})}var E=L(T);A(w),A(C);var D=L(C,2),ee=e=>{var t=Yd(),n=F(t),i=e=>{var t=Xr();di(I(t),()=>(U(Mc),r(),H(()=>Mc(r().content)))),K(e,t)},a=Kt(()=>(r(),H(()=>r().content.trim()))),o=e=>{K(e,Jd())};J(n,e=>{V(a)?e(i):e(o,-1)}),A(t),K(e,t)},te=e=>{var t=Xd();On(t),Ji(t,()=>r().content,e=>(mt(v,H(r).content=e,H(r)),cr(()=>{}))),K(e,t)};J(D,e=>{o()?e(ee):e(te,-1)}),A(S),A(t),R(()=>{Mi(l,`background:${(U(gu),r(),H(()=>gu[r().importance]))??``};color:${(U(hu),r(),H(()=>hu[r().importance]))??``};`),q(u,(r(),H(()=>r().importance))),Mi(d,`accent-color:${(U(hu),r(),H(()=>hu[r().importance]))??``};`),q(E,` ${o()?`Edit`:`Preview`}`)}),Fi(a,()=>r().type,e=>(mt(v,H(r).type=e,H(r)),cr(()=>{}))),Ji(d,()=>r().importance,e=>(mt(v,H(r).importance=e,H(r)),cr(()=>{}))),Ji(m,()=>r().tags,e=>(mt(v,H(r).tags=e,H(r)),cr(()=>{}))),Ji(y,()=>r().agent,e=>(mt(v,H(r).agent=e,H(r)),cr(()=>{}))),Ji(x,()=>r().model,e=>(mt(v,H(r).model=e,H(r)),cr(()=>{}))),W(`click`,w,function(...e){_.togglePreview?.apply(this,e)}),K(e,t)};J(ee,e=>{f()&&!n()?e(te):e(ne,-1)}),A(T);var re=L(T,2),ie=e=>{var t=Qd(),n=F(t),r=L(n,2),i=F(r);{let e=qt(()=>s()?`loader`:`save`);$(i,{get name(){return V(e)},size:14,strokeWidth:2})}var a=L(i);A(r),A(t),R(()=>{r.disabled=s(),q(a,` ${s()?`Saving…`:V(u)?`Create Memory`:`Save Changes`}`)}),W(`click`,n,function(...e){_.cancelEdit?.apply(this,e)}),W(`click`,r,function(...e){_.save?.apply(this,e)}),K(e,t)};J(re,e=>{(V(u)||n())&&e(ie)}),A(d),W(`click`,l,function(...e){m()?.apply(this,e)}),W(`click`,w,function(...e){m()?.apply(this,e)}),W(`click`,d,ea(function(e){ia.call(this,t,e)})),K(e,c)};J(T,e=>{p()&&e(E)}),K(e,w),Ge(),l()}var tf=e=>e;function nf(e){let t=e-1;return t*t*t+1}function rf(e,{delay:t=0,duration:n=400,easing:r=tf}={}){let i=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:r,css:e=>`opacity: ${e*i}`}}function af(e,{delay:t=0,duration:n=400,easing:r=nf,start:i=0,opacity:a=0}={}){let o=getComputedStyle(e),s=+o.opacity,c=o.transform===`none`?``:o.transform,l=1-i,u=s*(1-a);return{delay:t,duration:n,easing:r,css:(e,t)=>`
74
- transform: ${c} scale(${1-l*t});
75
- opacity: ${s-u*t}
76
- `}}var of={memories:`title,type,content,importance
77
- Example Memory,fact,This is an example memory content,3`,tasks:`task_code,title,phase,description,status,priority
78
- TSK-001,Example Task,Phase 1,Example task description,todo,3`};function sf(e){let t=j(null),n=j([]),r=j([]),i=j(``),a=j(``),o=j(!1),s=j(!1);function c(){t.set(null),n.set([]),r.set([]),i.set(``),a.set(``),o.set(!1)}function l(){s.set(!1),c(),e.onClose&&e.onClose()}function u(){s.set(!0)}function d(e){let t=e.split(/\r?\n/).filter(e=>e.trim()!==``);if(t.length===0)return{headers:[],rows:[]};let n=e=>{let t=[],n=``,r=!1;for(let i=0;i<e.length;i++){let a=e[i];a===`"`&&e[i+1]===`"`?(n+=`"`,i++):a===`"`?r=!r:a===`,`&&!r?(t.push(n.trim()),n=``):n+=a}return t.push(n.trim()),t},r=n(t[0]).filter(e=>e!==``);return{headers:r,rows:t.slice(1).map(n).map(e=>{let t={};return r.forEach((n,r)=>{let i=n.toLowerCase().replace(/[^a-z0-9_]/g,`_`);t[i]=e[r]}),t})}}function f(e){if(a.set(``),!e.name.endsWith(`.csv`)){a.set(`Please select a valid .csv file.`);return}t.set(e),i.set(e.name);let o=new FileReader;o.onload=e=>{let t=e.target?.result,i=d(t);r.set(i.headers),n.set(i.rows),i.rows.length===0&&a.set(`CSV file appears to be empty or missing headers.`)},o.readAsText(e)}function p(e){let t=e.target.files?.[0];t&&f(t)}function m(e){e.preventDefault();let t=e.dataTransfer?.files?.[0];t&&f(t)}function h(){let t=of[e.importTarget],n=new Blob([t],{type:`text/csv;charset=utf-8;`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.setAttribute(`href`,r),i.setAttribute(`download`,`example_${e.importTarget}.csv`),i.style.visibility=`hidden`,document.body.appendChild(i),i.click(),document.body.removeChild(i)}async function g(){let t=[];if(n.subscribe(e=>t=e)(),a.set(``),t.length===0){a.set(`No data to import.`);return}o.set(!0);try{let n=0;n=e.importTarget===`memories`?(await Va.bulkImportMemories(e.repo,t)).count:(await Va.bulkImportTasks(e.repo,t)).count,alert(`Imported ${n} ${e.importTarget} successfully.`),e.onSuccess&&e.onSuccess(),l()}catch(e){a.set(e.message||`Import failed`)}finally{o.set(!1)}}return{file:t,csvData:n,headers:r,fileName:i,errorMsg:a,isSubmitting:o,isOpen:s,open:u,close:l,handleFileSelect:p,handleFileDrop:m,downloadExample:h,handleImport:g,setFile:e=>t.set(e),setCsvData:e=>n.set(e)}}var cf=G(`<div class="drop-zone svelte-lenod"><div class="drop-zone-content svelte-lenod"><div style="color: var(--color-text-muted)" class="svelte-lenod"><!></div> <p class="svelte-lenod">Drag and drop your <strong class="svelte-lenod">.csv</strong> file here</p> <span class="text-xs text-slate-500 mb-4 svelte-lenod">or click to browse from your computer</span> <label class="btn btn-primary btn-md cursor-pointer svelte-lenod">Select CSV File <input type="file" accept=".csv" class="hidden svelte-lenod"/></label></div></div> <div class="mt-6 flex flex-col items-center svelte-lenod"><p class="text-[0.8rem] text-slate-400 mb-2 svelte-lenod">Need a starting point?</p> <button class="btn btn-ghost btn-sm svelte-lenod"><!> </button></div>`,1),lf=G(`<th class="svelte-lenod"> </th>`),uf=G(`<td class="svelte-lenod"> </td>`),df=G(`<tr class="svelte-lenod"></tr>`),ff=G(`<div class="file-info flex items-center justify-between p-3 bg-blue-500/5 border border-blue-500/20 rounded-lg mb-4 svelte-lenod"><div class="flex items-center gap-3 svelte-lenod"><div style="color: #0ea5e9; display: flex;" class="svelte-lenod"><!></div> <div class="svelte-lenod"><div class="text-sm font-semibold svelte-lenod"> </div> <div class="text-[0.7rem] text-slate-400 svelte-lenod"> </div></div></div> <button class="btn btn-ghost btn-sm text-red-500 svelte-lenod">Change File</button></div> <div class="preview-container svelte-lenod"><div class="preview-header svelte-lenod"><span class="svelte-lenod">Data Preview (First 5 rows)</span></div> <div class="table-wrapper svelte-lenod"><table class="svelte-lenod"><thead class="svelte-lenod"><tr class="svelte-lenod"></tr></thead><tbody class="svelte-lenod"></tbody></table></div></div>`,1),pf=G(`<div class="error-msg flex items-center gap-2 svelte-lenod"><!> <span class="svelte-lenod"> </span></div>`),mf=G(`<div class="spinner svelte-lenod"></div> Importing...`,1),hf=G(`<!> Start Import`,1),gf=G(`<div class="modal-backdrop svelte-lenod"><div class="modal-content svelte-lenod"><div class="modal-header svelte-lenod"><div class="flex items-center gap-2 svelte-lenod"><div class="header-icon svelte-lenod" style="color: #0ea5e9"><!></div> <h3 class="svelte-lenod"> </h3></div> <button class="btn btn-ghost btn-sm close-btn svelte-lenod"><!></button></div> <div class="modal-body svelte-lenod"><div class="p-6 svelte-lenod"><!> <!></div></div> <div class="modal-footer svelte-lenod"><button class="btn btn-ghost svelte-lenod">Cancel</button> <button class="btn btn-primary svelte-lenod"><!></button></div></div></div>`);function _f(e,t){We(t,!1);let n=()=>N(x,`$file`,l),r=()=>N(S,`$csvData`,l),i=()=>N(C,`$headers`,l),a=()=>N(w,`$fileName`,l),o=()=>N(T,`$errorMsg`,l),s=()=>N(E,`$isSubmitting`,l),c=()=>N(D,`$composableIsOpen`,l),[l,u]=ft(),d=on(),f=on(),p=on(),m=on(),h=on(),g=on(),_=Z(t,`repo`,8),v=Z(t,`importTarget`,8,`memories`),y=Z(t,`isOpen`,12,!1),b=ca(),{file:x,csvData:S,headers:C,fileName:w,errorMsg:T,isSubmitting:E,isOpen:D,close:ee,handleFileSelect:te,handleFileDrop:ne,downloadExample:re,handleImport:ie,setFile:ae,setCsvData:oe}=sf({repo:_(),importTarget:v(),onSuccess:()=>b(`success`),onClose:()=>{y(!1),b(`close`)}});Un(()=>U(y()),()=>{y()?D.set(!0):D.set(!1)}),Un(()=>n(),()=>{sn(d,n())}),Un(()=>r(),()=>{sn(f,r())}),Un(()=>i(),()=>{sn(p,i())}),Un(()=>a(),()=>{sn(m,a())}),Un(()=>o(),()=>{sn(h,o())}),Un(()=>s(),()=>{sn(g,s())}),Wn(),na();var se=Xr(),ce=I(se),le=e=>{var n=gf(),r=F(n),i=F(r),a=F(i),o=F(a);$(F(o),{name:`upload-cloud`,size:18}),A(o);var s=L(o,2),c=F(s);A(s),A(a);var l=L(a,2);$(F(l),{name:`x`,size:18,strokeWidth:2}),A(l),A(i);var u=L(i,2),_=F(u),y=F(_),b=e=>{var n=cf(),r=I(n),i=F(r),a=F(i);$(F(a),{name:`file-up`,size:48,strokeWidth:1}),A(a);var o=L(a,6),s=L(F(o));A(o),A(i),A(r);var c=L(r,2),l=L(F(c),2),u=F(l);$(u,{name:`download`,size:14,className:`mr-2`});var d=L(u);A(l),A(c),R(()=>q(d,` Download Example ${v()===`memories`?`Memories`:`Tasks`} CSV`)),W(`change`,s,te),W(`dragover`,r,ta(function(e){ia.call(this,t,e)})),W(`drop`,r,ne),W(`click`,l,re),K(e,n)},x=e=>{var t=ff(),n=I(t),r=F(n),i=F(r);$(F(i),{name:`file-type-2`,size:24}),A(i);var a=L(i,2),o=F(a),s=F(o,!0);A(o);var c=L(o,2),l=F(c);A(c),A(a),A(r);var u=L(r,2);A(n);var d=L(n,2),h=L(F(d),2),g=F(h),_=F(g),v=F(_);X(v,5,()=>V(p),Y,(e,t)=>{var n=lf(),r=F(n,!0);A(n),R(()=>q(r,V(t))),K(e,n)}),A(v),A(_);var y=L(_);X(y,5,()=>(V(f),H(()=>V(f).slice(0,5))),Y,(e,t)=>{var n=df();X(n,5,()=>V(p),Y,(e,n)=>{var r=uf(),i=F(r,!0);A(r),R(e=>q(i,e),[()=>(V(t),V(n),H(()=>V(t)[V(n).toLowerCase().replace(/[^a-z0-9_]/g,`_`)]||``))]),K(e,r)}),A(n),K(e,n)}),A(y),A(g),A(h),A(d),R(()=>{q(s,V(m)),q(l,`${(V(f),H(()=>V(f).length))??``} rows found`)}),W(`click`,u,()=>{ae(null),oe([])}),K(e,t)};J(y,e=>{V(d)?e(x,-1):e(b)});var S=L(y,2),C=e=>{var t=pf(),n=F(t);$(n,{name:`alert-circle`,size:16});var r=L(n,2),i=F(r,!0);A(r),A(t),R(()=>q(i,V(h))),K(e,t)};J(S,e=>{V(h)&&e(C)}),A(_),A(u);var w=L(u,2),T=F(w),E=L(T,2),D=F(E),se=e=>{var t=mf();Ne(),K(e,t)},ce=e=>{var t=hf();$(I(t),{name:`check`,size:16,className:`mr-2`}),Ne(),K(e,t)};J(D,e=>{V(g)?e(se):e(ce,-1)}),A(E),A(w),A(r),A(n),R(()=>{q(c,`Bulk Import ${v()===`memories`?`Memories`:`Tasks`}`),T.disabled=V(g),E.disabled=(V(g),V(f),H(()=>V(g)||V(f).length===0))}),W(`click`,l,ee),W(`click`,T,ee),W(`click`,E,ie),bi(3,r,()=>af,()=>({duration:200,start:.95})),W(`click`,r,ea(function(e){ia.call(this,t,e)})),bi(3,n,()=>rf,()=>({duration:200})),W(`click`,n,ee),K(e,n)};J(ce,e=>{c()&&e(le)}),K(e,se),Ge(),u()}var vf=G(`<option> </option>`),yf=G(`<option> </option>`),bf=G(`<div class="drawer-overlay" style="display:flex;align-items:center;justify-content:center;z-index:60;" role="button" tabindex="0"><div class="glass card animate-fade-in" style="width:500px;max-width:95vw;border:1px solid var(--color-border);" role="dialog" aria-modal="true" tabindex="-1"><div class="flex items-center gap-2" style="margin-bottom:16px;"><!> <span style="font-size:0.9rem;font-weight:700;color:var(--color-text);">New Task</span></div> <div style="display:flex;flex-direction:column;gap:10px;"><div style="display:grid;grid-template-columns:1fr 1fr;gap:10px;"><div><label for="new_task_code" style="font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted);display:block;margin-bottom:4px;">Task Code *</label> <input id="new_task_code" class="form-input" placeholder="TASK-001"/></div> <div><label for="new_task_phase" style="font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted);display:block;margin-bottom:4px;">Phase</label> <input id="new_task_phase" class="form-input" placeholder="Implementation"/></div></div> <div><label for="new_task_title" style="font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted);display:block;margin-bottom:4px;">Title *</label> <input id="new_task_title" class="form-input" placeholder="Task title"/></div> <div><label for="new_task_description" style="font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted);display:block;margin-bottom:4px;">Description</label> <textarea id="new_task_description" class="form-textarea" placeholder="Task description..." rows="4"></textarea></div> <div style="display:grid;grid-template-columns:1fr 1fr;gap:10px;"><div><label for="new_task_status" style="font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted);display:block;margin-bottom:4px;">Status</label> <select id="new_task_status" class="form-select"></select></div> <div><label for="new_task_priority" style="font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:var(--color-text-muted);display:block;margin-bottom:4px;">Priority</label> <select id="new_task_priority" class="form-select"></select></div></div></div> <div class="flex justify-between" style="margin-top:16px;"><button class="btn btn-ghost">Cancel</button> <button class="btn btn-accent">Create Task</button></div></div></div>`);function xf(e,t){We(t,!1);let n=Z(t,`open`,8,!1),r=Z(t,`newTask`,12),i=Z(t,`onClose`,8,()=>{}),a=Z(t,`onSave`,8,()=>{});na();var o=Xr(),s=I(o),c=e=>{var n=bf(),o=F(n),s=F(o);$(F(s),{name:`plus`,size:16,strokeWidth:2}),Ne(2),A(s);var c=L(s,2),l=F(c),u=F(l),d=L(F(u),2);Vi(d),A(u);var f=L(u,2),p=L(F(f),2);Vi(p),A(f),A(l);var m=L(l,2),h=L(F(m),2);Vi(h),A(m);var g=L(m,2),_=L(F(g),2);On(_),A(g);var v=L(g,2),y=F(v),b=L(F(y),2);X(b,4,()=>[`backlog`,`pending`,`in_progress`],Y,(e,t)=>{var n=vf(),r=F(n,!0);A(n);var i={};R(e=>{q(r,e),i!==(i=t)&&(n.value=(n.__value=t)??``)},[()=>(U(Ac),H(()=>Ac(t)))]),K(e,n)}),A(b),A(y);var x=L(y,2),S=L(F(x),2);X(S,4,()=>[1,2,3,4,5],Y,(e,t)=>{var n=yf(),r=F(n,!0);A(n);var i={};R(e=>{q(r,e),i!==(i=t)&&(n.value=(n.__value=t)??``)},[()=>(U(jc),H(()=>jc(t)))]),K(e,n)}),A(S),A(x),A(v),A(c);var C=L(c,2),w=F(C),T=L(w,2);A(C),A(o),A(n),Ji(d,()=>r().task_code,e=>(r(r().task_code=e,!0),cr(()=>{}))),Ji(p,()=>r().phase,e=>(r(r().phase=e,!0),cr(()=>{}))),Ji(h,()=>r().title,e=>(r(r().title=e,!0),cr(()=>{}))),Ji(_,()=>r().description,e=>(r(r().description=e,!0),cr(()=>{}))),Fi(b,()=>r().status,e=>(r(r().status=e,!0),cr(()=>{}))),Fi(S,()=>r().priority,e=>(r(r().priority=e,!0),cr(()=>{}))),W(`click`,w,function(...e){i()?.apply(this,e)}),W(`click`,T,function(...e){a()?.apply(this,e)}),W(`click`,o,ea(function(e){ia.call(this,t,e)})),W(`click`,n,function(...e){i()?.apply(this,e)}),K(e,n)};J(s,e=>{n()&&e(c)}),K(e,o),Ge()}var Sf=G(`<span class="ref-total-badge svelte-w0wd5z"> </span>`),Cf=G(`<button class="ref-clear-btn svelte-w0wd5z"><!></button>`),wf=G(`<button><!> <span> </span> <span class="ref-cat-count svelte-w0wd5z"> </span></button>`),Tf=G(`<div style="padding:40px;text-align:center;"><div class="skeleton" style="height:60px;border-radius:12px;margin-bottom:10px;"></div> <div class="skeleton" style="height:60px;border-radius:12px;margin-bottom:10px;"></div> <div class="skeleton" style="height:60px;border-radius:12px;"></div></div>`),Ef=G(`<div class="ref-card-desc svelte-w0wd5z"> </div>`),Df=G(`<code class="ref-param-tag svelte-w0wd5z"> </code>`),Of=G(`<code class="ref-param-tag ref-param-more svelte-w0wd5z"> </code>`),kf=G(`<div class="ref-params svelte-w0wd5z"><!> <!></div>`),Af=G(`<div class="ref-card ref-card-tool animate-fade-in svelte-w0wd5z" role="button" tabindex="0"><div class="ref-card-top svelte-w0wd5z"><span class="ref-type-badge ref-type-tool svelte-w0wd5z"><!> Tool</span></div> <div class="ref-card-name svelte-w0wd5z"> </div> <!> <!></div>`),jf=G(`<div class="ref-section-header svelte-w0wd5z"><!> <span>Tools</span> <span class="ref-section-count svelte-w0wd5z"> </span></div> <div class="ref-grid svelte-w0wd5z"></div>`,1),Mf=G(`<div class="ref-card-desc svelte-w0wd5z"> </div>`),Nf=G(`<div class="ref-card ref-card-prompt animate-fade-in svelte-w0wd5z" role="button" tabindex="0"><div class="ref-card-top svelte-w0wd5z"><span class="ref-type-badge ref-type-prompt svelte-w0wd5z"><!> Prompt</span></div> <div class="ref-card-name svelte-w0wd5z"> </div> <!></div>`),Pf=G(`<div class="ref-section-header svelte-w0wd5z"><!> <span>Prompts</span> <span class="ref-section-count svelte-w0wd5z"> </span></div> <div class="ref-grid svelte-w0wd5z"></div>`,1),Ff=G(`<div class="ref-card-desc svelte-w0wd5z"> </div>`),If=G(`<div class="ref-params svelte-w0wd5z"><code class="ref-param-tag svelte-w0wd5z" style="background:var(--color-bg);border:1px solid var(--color-border);"> </code></div>`),Lf=G(`<div class="ref-card ref-card-resource animate-fade-in svelte-w0wd5z" role="button" tabindex="0"><div class="ref-card-top svelte-w0wd5z"><span class="ref-type-badge ref-type-resource svelte-w0wd5z"><!> Resource</span></div> <div class="ref-card-name svelte-w0wd5z"> </div> <!> <!></div>`),Rf=G(`<div class="ref-section-header svelte-w0wd5z"><!> <span>Resources</span> <span class="ref-section-count svelte-w0wd5z"> </span></div> <div class="ref-grid svelte-w0wd5z"></div>`,1),zf=G(`<div style="text-align:center;padding:48px 16px;color:var(--color-text-muted);"><!> <div style="font-size:0.82rem;margin-top:10px;"> </div></div>`),Bf=G(`<!> <!> <!> <!>`,1),Vf=G(`<div class="animate-fade-in"><div class="glass card" style="margin-bottom:16px;padding:14px 18px;"><div class="ref-header svelte-w0wd5z"><div class="flex items-center gap-2"><!> <span style="font-size:0.9rem;font-weight:800;color:var(--color-text);letter-spacing:-0.02em;">MCP Reference</span> <!></div> <div class="ref-search-wrap svelte-w0wd5z"><span class="ref-search-icon svelte-w0wd5z"><!></span> <input class="form-input ref-search-input svelte-w0wd5z" type="text" placeholder="Search tools &amp; prompts…"/> <!></div></div></div> <div class="ref-body svelte-w0wd5z"><div class="glass ref-sidebar svelte-w0wd5z"><div class="ref-sidebar-label svelte-w0wd5z">Category</div> <!></div> <div class="ref-main svelte-w0wd5z"><!></div></div></div>`);function Hf(e,t){We(t,!1);let n=()=>N(p(),`$appState`,o),r=()=>N(m(),`$filteredTools`,o),i=()=>N(h(),`$filteredPrompts`,o),a=()=>N(_(),`$filteredResources`,o),[o,s]=ft(),c=on(),l=on(),u=on(),d=on(),f=Z(t,`handler`,8),p=Z(t,`appState`,8),m=Z(t,`filteredTools`,8),h=Z(t,`filteredPrompts`,8),_=Z(t,`filteredResources`,8);Un(()=>n(),()=>{sn(c,n())}),Un(()=>r(),()=>{sn(l,r())}),Un(()=>i(),()=>{sn(u,i())}),Un(()=>a(),()=>{sn(d,a())}),Wn(),na();var v=Vf(),y=F(v),b=F(y),x=F(b),S=F(x);$(S,{name:`book-open`,size:15,strokeWidth:1.75});var C=L(S,4),w=e=>{var t=Sf(),n=F(t);A(t),R(()=>q(n,`${(V(c),H(()=>(V(c).capabilities.tools?.length||0)+(V(c).capabilities.prompts?.length||0)))??``} items`)),K(e,t)};J(C,e=>{V(c),H(()=>V(c).capabilities)&&e(w)}),A(x);var T=L(x,2),E=F(T);$(F(E),{name:`search`,size:12,strokeWidth:2}),A(E);var D=L(E,2);Vi(D);var ee=L(D,2),te=e=>{var t=Cf();$(F(t),{name:`x`,size:11,strokeWidth:2.5}),A(t),W(`click`,t,()=>f().setReferenceSearch(``)),K(e,t)};J(ee,e=>{V(c),H(()=>V(c).referenceSearch)&&e(te)}),A(T),A(b),A(y);var ne=L(y,2),re=F(ne);X(L(F(re),2),1,()=>(V(c),H(()=>[{id:`all`,icon:`layers`,label:`All`,count:(V(c).capabilities?.tools?.length||0)+(V(c).capabilities?.prompts?.length||0)+(V(c).capabilities?.resources?.length||0)},{id:`tools`,icon:`tool`,label:`Tools`,count:V(c).capabilities?.tools?.length||0},{id:`prompts`,icon:`sparkle`,label:`Prompts`,count:V(c).capabilities?.prompts?.length||0},{id:`resources`,icon:`database`,label:`Resources`,count:V(c).capabilities?.resources?.length||0}])),Y,(e,t)=>{var n=wf();let r;var i=F(n);$(i,{get name(){return V(t),H(()=>V(t).icon)},size:13,strokeWidth:1.75});var a=L(i,2),o=F(a,!0);A(a);var s=L(a,2),l=F(s,!0);A(s),A(n),R(()=>{r=Ai(n,1,`ref-cat-btn svelte-w0wd5z`,null,r,{active:V(c).referenceFilter===V(t).id}),q(o,(V(t),H(()=>V(t).label))),q(l,(V(t),H(()=>V(t).count)))}),W(`click`,n,()=>f().setReferenceFilter(V(t).id)),K(e,n)}),A(re);var ie=L(re,2),ae=F(ie),oe=e=>{K(e,Tf())},se=e=>{var t=Bf(),n=I(t),r=e=>{var t=jf(),n=I(t),r=F(n);$(r,{name:`tool`,size:13,strokeWidth:1.75});var i=L(r,4),a=F(i,!0);A(i),A(n);var o=L(n,2);X(o,5,()=>V(l),Y,(e,t)=>{var n=Af(),r=F(n),i=F(r);$(F(i),{name:`tool`,size:10,strokeWidth:2}),Ne(),A(i),A(r);var a=L(r,2),o=F(a,!0);A(a);var s=L(a,2),c=e=>{var n=Ef(),r=F(n,!0);A(n),R(()=>q(r,(V(t),H(()=>V(t).description)))),K(e,n)};J(s,e=>{V(t),H(()=>V(t).description)&&e(c)});var l=L(s,2),u=e=>{var n=kf(),r=F(n);X(r,1,()=>(V(t),H(()=>Object.entries(V(t).inputSchema.properties).slice(0,4))),Y,(e,t)=>{var n=Kt(()=>g(V(t),1));let r=()=>V(n)[0];var i=Df(),a=F(i,!0);A(i),R(()=>q(a,r())),K(e,i)});var i=L(r,2),a=e=>{var n=Of(),r=F(n);A(n),R(e=>q(r,`+${e??``}`),[()=>(V(t),H(()=>Object.keys(V(t).inputSchema.properties).length-4))]),K(e,n)},o=Kt(()=>(V(t),H(()=>Object.keys(V(t).inputSchema.properties).length>4)));J(i,e=>{V(o)&&e(a)}),A(n),K(e,n)};J(l,e=>{V(t),H(()=>V(t).inputSchema?.properties)&&e(u)}),A(n),R(()=>q(o,(V(t),H(()=>V(t).name)))),W(`click`,n,()=>f().openReferenceDrawer(`tool`,V(t))),K(e,n)}),A(o),R(()=>q(a,(V(l),H(()=>V(l).length)))),K(e,t)};J(n,e=>{V(l),H(()=>V(l).length>0)&&e(r)});var i=L(n,2),a=e=>{var t=Pf(),n=I(t),r=F(n);$(r,{name:`sparkle`,size:13,strokeWidth:1.75});var i=L(r,4),a=F(i,!0);A(i),A(n);var o=L(n,2);X(o,5,()=>V(u),Y,(e,t)=>{var n=Nf(),r=F(n),i=F(r);$(F(i),{name:`sparkle`,size:10,strokeWidth:2}),Ne(),A(i),A(r);var a=L(r,2),o=F(a,!0);A(a);var s=L(a,2),c=e=>{var n=Mf(),r=F(n,!0);A(n),R(()=>q(r,(V(t),H(()=>V(t).description)))),K(e,n)};J(s,e=>{V(t),H(()=>V(t).description)&&e(c)}),A(n),R(()=>q(o,(V(t),H(()=>V(t).name)))),W(`click`,n,()=>f().openReferenceDrawer(`prompt`,V(t))),K(e,n)}),A(o),R(()=>{Mi(n,`margin-top:${(V(l),H(()=>V(l).length>0?`20px`:`0`))??``}`),q(a,(V(u),H(()=>V(u).length)))}),K(e,t)};J(i,e=>{V(u),H(()=>V(u).length>0)&&e(a)});var o=L(i,2),s=e=>{var t=Rf(),n=I(t),r=F(n);$(r,{name:`database`,size:13,strokeWidth:1.75});var i=L(r,4),a=F(i,!0);A(i),A(n);var o=L(n,2);X(o,5,()=>V(d),Y,(e,t)=>{var n=Lf(),r=F(n),i=F(r);$(F(i),{name:`database`,size:10,strokeWidth:2}),Ne(),A(i),A(r);var a=L(r,2),o=F(a,!0);A(a);var s=L(a,2),c=e=>{var n=Ff(),r=F(n,!0);A(n),R(()=>q(r,(V(t),H(()=>V(t).description)))),K(e,n)};J(s,e=>{V(t),H(()=>V(t).description)&&e(c)});var l=L(s,2),u=e=>{var n=If(),r=F(n),i=F(r,!0);A(r),A(n),R(()=>q(i,(V(t),H(()=>V(t).uri)))),K(e,n)};J(l,e=>{V(t),H(()=>V(t).uri)&&e(u)}),A(n),R(()=>q(o,(V(t),H(()=>V(t).name)))),W(`click`,n,()=>f().openReferenceDrawer(`resource`,V(t))),K(e,n)}),A(o),R(()=>{Mi(n,`margin-top:${(V(l),V(u),H(()=>V(l).length>0||V(u).length>0?`20px`:`0`))??``}`),q(a,(V(d),H(()=>V(d).length)))}),K(e,t)};J(o,e=>{V(d),H(()=>V(d).length>0)&&e(s)});var p=L(o,2),m=e=>{var t=zf(),n=F(t);$(n,{name:`search`,size:28,strokeWidth:1.25});var r=L(n,2),i=F(r);A(r),A(t),R(()=>q(i,`No results for "${(V(c),H(()=>V(c).referenceSearch))??``}"`)),K(e,t)};J(p,e=>{V(l),V(u),V(d),H(()=>V(l).length===0&&V(u).length===0&&V(d).length===0)&&e(m)}),K(e,t)};J(ae,e=>{V(c),H(()=>!V(c).capabilities)?e(oe):e(se,-1)}),A(ie),A(ne),A(v),Ji(D,()=>n().referenceSearch,e=>mt(p(),H(n).referenceSearch=e,H(n))),K(e,v),Ge(),s()}var Uf=G(`<div class="drawer-overlay" style="z-index:38;" role="button" tabindex="0"></div> <div style="position:fixed;top:0;left:0;width:280px;height:100dvh;z-index:39;display:flex;flex-direction:column;"><!></div>`,1),Wf=G(`<div style="text-align:center;padding:80px 20px;" class="animate-fade-in"><div style="display:inline-flex;width:72px;height:72px;border-radius:20px;background:linear-gradient(135deg,rgba(14,165,233,0.15),rgba(99,102,241,0.15));border:1px solid rgba(14,165,233,0.2);align-items:center;justify-content:center;margin-bottom:20px;" class="animate-float"><!></div> <div style="font-size:1.25rem;font-weight:800;color:var(--color-text);margin-bottom:8px;letter-spacing:-0.02em;">No Repository Selected</div> <div style="color:var(--color-text-muted);font-size:0.875rem;">Select a repository from the sidebar to get started.</div></div>`),Gf=G(`<button><!> <span> </span></button>`),Kf=G(`<div style="display:grid;grid-template-columns:1fr;gap:12px;align-items:start;" class="dashboard-grid svelte-1m88iwd"><div style="display:flex;flex-direction:column;gap:12px;"><div class="glass card hover-glow" style="padding:16px;"><div class="section-label" style="margin-bottom:10px;">Memory Overview</div> <!></div> <div class="glass card hover-glow" style="padding:16px;"><div class="section-label" style="margin-bottom:10px;">Task Overview</div> <!></div> <!></div></div>`),qf=G(`<div class="glass card animate-fade-in" style="height:calc(100vh - 180px);display:flex;flex-direction:column;padding:0;overflow:hidden;border-radius:24px;"><div style="padding:16px 20px;border-bottom:1px solid var(--color-border);display:flex;align-items:center;justify-content:space-between;background:rgba(255,255,255,0.05);"><div class="flex items-center gap-3"><div style="width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,var(--color-primary),var(--color-accent));display:flex;align-items:center;justify-content:center;color:white;box-shadow:0 4px 12px var(--glow-primary);"><!></div> <div><div style="font-size:0.95rem;font-weight:800;color:var(--color-text);letter-spacing:-0.01em;">Recent Activity</div> <div style="font-size:0.68rem;color:var(--color-text-muted);font-weight:600;"> </div></div></div></div> <div style="flex:1;overflow-y:auto;padding:24px 32px;background:rgba(0,0,0,0.02);"><!></div></div>`),Jf=G(`<div class="glass card hover-glow animate-fade-in"><div class="flex items-center gap-2" style="margin-bottom:16px;"><!> <div class="section-label">Memory Explorer</div></div> <!></div>`),Yf=G(`<div class="animate-fade-in"><div class="glass card hover-glow" style="margin-bottom:20px;"><div class="flex items-center gap-2" style="margin-bottom:16px;"><!> <div class="stat-label">Memory Overview</div></div> <!></div></div>`),Xf=G(`<div style="margin-bottom:20px;"><div class="tab-nav" style="display:inline-flex;"></div></div> <!> <!> <!> <!> <!>`,1),Zf=G(`<div class="app-layout"><!> <div><!> <!> <div id="dashboardShell" style="padding: 20px; min-height: 100vh;"><!></div></div></div> <!> <!> <!> <!> <!>`,1);function Qf(e,t){We(t,!1);let n=()=>N(g,`$sidebarCollapsed`,s),r=()=>N(f,`$appState`,s),i=()=>N(ma,`$currentRepo`,s),a=()=>N(fa,`$activeTab`,s),o=()=>N(Fa,`$recentActionsTotalItems`,s),[s,c]=ft(),l=on(),u=on(),d=Ua({get kanbanBoard(){return V(l)},get memoryList(){return V(u)}}),f={subscribe:d.subscribe,set:d.set,update:d.update},{filteredTools:p,filteredPrompts:m,filteredResources:h,sidebarCollapsed:g,TABS:_}=d;aa(async()=>{za(),await d.loadRepos(),await d.loadHealth(),await d.loadData()}),na();var v=Zf();W(`keydown`,hn,function(...e){d.onKeyDown?.apply(this,e)});var y=I(v),b=F(y);dl(b,{get onRepoSelect(){return d.onRepoSelect}});var x=L(b,2);let S;var C=F(x);wl(C,{get onRefresh(){return d.onRefresh},get onToggleMobileMenu(){return d.toggleMobileMenu}});var w=L(C,2),T=e=>{var t=Uf(),n=I(t),r=L(n,2);dl(F(r),{get onRepoSelect(){return d.onRepoSelect}}),A(r),W(`click`,n,()=>d.toggleMobileMenu()),K(e,t)};J(w,e=>{r().mobileMenuOpen&&e(T)});var E=L(w,2),D=F(E),ee=e=>{var t=Wf(),n=F(t);$(F(n),{name:`brain`,size:32,strokeWidth:1.5,className:``}),A(n),Ne(4),A(t),K(e,t)},te=e=>{var t=Xf(),n=I(t),r=F(n);X(r,5,()=>_,Y,(e,t)=>{var n=Gf();let r;var i=F(n);$(i,{get name(){return V(t).icon},size:14,strokeWidth:1.75});var o=L(i,2),s=F(o,!0);A(o),A(n),R(()=>{r=Ai(n,1,`tab-btn`,null,r,{active:a()===V(t).id}),Wi(n,`id`,`tab-${V(t).id??``}`),q(s,V(t).label)}),W(`click`,n,()=>d.onTabChange(V(t).id)),K(e,n)}),A(r),A(n);var i=L(n,2),s=e=>{var t=Kf(),n=F(t),r=F(n);eu(L(F(r),2),{}),A(r);var i=L(r,2);ru(L(F(i),2),{}),A(i),du(L(i,2),{}),A(n),A(t),K(e,t)};J(i,e=>{a()===`dashboard`&&e(s)});var c=L(i,2),g=e=>{var t=qf(),n=F(t),r=F(n),i=F(r);$(F(i),{name:`activity`,size:18,strokeWidth:2.2}),A(i);var a=L(i,2),s=L(F(a),2),c=F(s);A(s),A(a),A(r),A(n);var l=L(n,2);zu(F(l),{get onLoadPage(){return d.loadRecentActions}}),A(l),A(t),R(()=>q(c,`${o()??``} events tracked`)),K(e,t)};J(c,e=>{a()===`activity`&&e(g)});var v=L(c,2),y=e=>{var t=Jf(),n=F(t);$(F(n),{name:`brain`,size:14,strokeWidth:1.75}),Ne(2),A(n),$i(ku(L(n,2),{get onMemoryClick(){return d.openMemoryDrawer},get onNewMemory(){return d.openNewMemoryDrawer},onBulkImport:()=>d.openBulkImport(`memories`),$$legacy:!0}),e=>sn(u,e),()=>V(u)),A(t),K(e,t)};J(v,e=>{a()===`memories`&&e(y)});var b=L(v,2),x=e=>{var t=Yf(),n=F(t),r=F(n);$(F(r),{name:`columns`,size:14,strokeWidth:1.75}),Ne(2),A(r),$i(Kl(L(r,2),{get onTaskClick(){return d.openTaskDrawer},onAddTask:()=>d.toggleAddTaskModal(!0),onBulkImport:()=>d.openBulkImport(`tasks`),$$legacy:!0}),e=>sn(l,e),()=>V(l)),A(n),A(t),K(e,t)};J(b,e=>{a()===`tasks`&&e(x)});var S=L(b,2),C=e=>{Hf(e,{get handler(){return d},get appState(){return f},get filteredTools(){return p},get filteredPrompts(){return m},get filteredResources(){return h}})};J(S,e=>{a()===`reference`&&e(C)}),K(e,t)};J(D,e=>{i()?e(te,-1):e(ee)}),A(E),A(x),A(y);var ne=L(y,2);pd(ne,{get memory(){return r().selectedMemory},get task(){return r().selectedTask},get open(){return r().drawerOpen},get onClose(){return d.closeDrawer},get onTaskUpdated(){return d.handleTaskUpdated},onTaskDeleted:()=>{i()&&V(l)?.loadTasks(i())}});var re=L(ne,2);Fd(re,{get item(){return r().selectedReference},get open(){return r().referenceDrawerOpen},onClose:()=>d.toggleReferenceDrawer(!1)});var ie=L(re,2);ef(ie,{get memory(){return r().memoryDrawerItem},get open(){return r().memoryDrawerOpen},onClose:()=>d.toggleMemoryDrawer(!1),get onSaved(){return d.handleMemorySaved},get onDeleted(){return d.handleMemoryDeleted}});var ae=L(ie,2);xf(ae,{get open(){return r().addTaskModalOpen},get newTask(){return r().newTask},onClose:()=>d.toggleAddTaskModal(!1),get onSave(){return d.createTask}});var oe=L(ae,2);{let e=qt(()=>i()||``);_f(oe,{get repo(){return V(e)},get importTarget(){return r().bulkImportTarget},get isOpen(){return r().bulkImportOpen},$$events:{close:()=>d.toggleBulkImport(!1),success:()=>{r().bulkImportTarget===`memories`&&V(u)?.refresh(),r().bulkImportTarget===`tasks`&&i()&&V(l)?.loadTasks(i())}}})}R(()=>S=Ai(x,1,`main-content`,null,S,{"sidebar-collapsed":n()})),K(e,v),Ge(),c()}Qr(Qf,{target:document.getElementById(`app`)});