@shahmilsaari/memory-core 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,264 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- Config
4
- } from "./chunk-KSLFLWB4.js";
5
-
6
- // src/db.ts
7
- import pg from "pg";
8
- import { createHash } from "crypto";
9
- var { Pool } = pg;
10
- var pool = null;
11
- var migrationsRun = false;
12
- function hashMemoryContent(content) {
13
- return createHash("md5").update(content.trim()).digest("hex");
14
- }
15
- function getPool() {
16
- if (!pool) {
17
- if (!Config.databaseUrl) {
18
- throw new Error("DATABASE_URL is not set. Add it to your .env or .memory-core.env file.");
19
- }
20
- pool = new Pool({ connectionString: Config.databaseUrl });
21
- }
22
- return pool;
23
- }
24
- async function runMigrations() {
25
- if (migrationsRun) return;
26
- const client = await getPool().connect();
27
- try {
28
- await client.query("BEGIN");
29
- await client.query(`ALTER TABLE memories ADD COLUMN IF NOT EXISTS reason TEXT`);
30
- await client.query(`ALTER TABLE memories ADD COLUMN IF NOT EXISTS content_hash TEXT`);
31
- await client.query(`ALTER TABLE memories ADD COLUMN IF NOT EXISTS context JSONB NOT NULL DEFAULT '{}'::jsonb`);
32
- await client.query(
33
- `UPDATE memories
34
- SET content_hash = md5(trim(content))
35
- WHERE content_hash IS NULL`
36
- );
37
- await client.query(`CREATE INDEX IF NOT EXISTS memories_content_hash_idx ON memories (content_hash)`);
38
- await client.query("COMMIT");
39
- migrationsRun = true;
40
- } catch (err) {
41
- await client.query("ROLLBACK");
42
- throw err;
43
- } finally {
44
- client.release();
45
- }
46
- }
47
- async function saveMemory(memory) {
48
- await runMigrations();
49
- const { type, scope, architecture, projectName, title, content, reason, context, tags, embedding } = memory;
50
- const contentHash = hashMemoryContent(content);
51
- await getPool().query(
52
- `INSERT INTO memories (type, scope, architecture, project_name, title, content, reason, context, tags, embedding, content_hash)
53
- VALUES ($1, $2, $3, $4, $5, $6, $7, $8::jsonb, $9, $10, $11)`,
54
- [
55
- type,
56
- scope,
57
- architecture ?? null,
58
- projectName ?? null,
59
- title ?? null,
60
- content,
61
- reason ?? null,
62
- JSON.stringify(context ?? {}),
63
- tags ?? [],
64
- `[${embedding.join(",")}]`,
65
- contentHash
66
- ]
67
- );
68
- }
69
- async function upsertMemory(memory) {
70
- await runMigrations();
71
- const contentHash = hashMemoryContent(memory.content);
72
- const existing = await getPool().query(
73
- `SELECT id FROM memories
74
- WHERE content_hash = $1
75
- AND COALESCE(architecture, '') = COALESCE($2, '')
76
- AND scope = $3
77
- AND type = $4
78
- LIMIT 1`,
79
- [contentHash, memory.architecture ?? null, memory.scope, memory.type]
80
- );
81
- if (existing.rowCount) return "skipped";
82
- await saveMemory(memory);
83
- return "inserted";
84
- }
85
- async function listMemories(filters = {}) {
86
- await runMigrations();
87
- const where = [];
88
- const params = [];
89
- if (filters.type) {
90
- params.push(filters.type);
91
- where.push(`type = $${params.length}`);
92
- }
93
- if (filters.scope) {
94
- params.push(filters.scope);
95
- where.push(`scope = $${params.length}`);
96
- }
97
- if (filters.architecture) {
98
- if (Array.isArray(filters.architecture)) {
99
- params.push(filters.architecture);
100
- where.push(filters.includeGlobal ? `(architecture IS NULL OR architecture = ANY($${params.length}))` : `architecture = ANY($${params.length})`);
101
- } else {
102
- params.push(filters.architecture);
103
- where.push(filters.includeGlobal ? `(architecture IS NULL OR architecture = $${params.length})` : `architecture = $${params.length}`);
104
- }
105
- }
106
- if (filters.projectName) {
107
- params.push(filters.projectName);
108
- where.push(filters.includeGlobal ? `(project_name IS NULL OR project_name = $${params.length})` : `project_name = $${params.length}`);
109
- }
110
- if (filters.tags?.length) {
111
- params.push(filters.tags);
112
- where.push(`tags && $${params.length}::text[]`);
113
- }
114
- const limit = filters.limit ?? 200;
115
- params.push(limit);
116
- const result = await getPool().query(
117
- `SELECT id, type, scope, architecture, project_name, title, content, reason, context, tags, content_hash
118
- FROM memories
119
- ${where.length ? `WHERE ${where.join(" AND ")}` : ""}
120
- ORDER BY id ASC
121
- LIMIT $${params.length}`,
122
- params
123
- );
124
- return result.rows;
125
- }
126
- async function getMemory(id) {
127
- await runMigrations();
128
- const result = await getPool().query(
129
- `SELECT id, type, scope, architecture, project_name, title, content, reason, context, tags, content_hash
130
- FROM memories
131
- WHERE id = $1`,
132
- [id]
133
- );
134
- return result.rows[0] ?? null;
135
- }
136
- async function deleteMemory(id) {
137
- await runMigrations();
138
- const result = await getPool().query(`DELETE FROM memories WHERE id = $1`, [id]);
139
- return (result.rowCount ?? 0) > 0;
140
- }
141
- async function deleteMemories(filters) {
142
- await runMigrations();
143
- const where = [];
144
- const params = [];
145
- if (filters.type) {
146
- params.push(filters.type);
147
- where.push(`type = $${params.length}`);
148
- }
149
- if (filters.scope) {
150
- params.push(filters.scope);
151
- where.push(`scope = $${params.length}`);
152
- }
153
- if (filters.architecture) {
154
- if (Array.isArray(filters.architecture)) {
155
- params.push(filters.architecture);
156
- where.push(`architecture = ANY($${params.length})`);
157
- } else {
158
- params.push(filters.architecture);
159
- where.push(`architecture = $${params.length}`);
160
- }
161
- }
162
- if (filters.tag) {
163
- params.push(filters.tag);
164
- where.push(`$${params.length} = ANY(tags)`);
165
- }
166
- if (where.length === 0) {
167
- throw new Error("Refusing to bulk-delete without filters");
168
- }
169
- const result = await getPool().query(
170
- `DELETE FROM memories WHERE ${where.join(" AND ")}`,
171
- params
172
- );
173
- return result.rowCount ?? 0;
174
- }
175
- async function updateMemory(id, patch) {
176
- await runMigrations();
177
- const current = await getMemory(id);
178
- if (!current) return null;
179
- const content = patch.content ?? current.content;
180
- const contentHash = hashMemoryContent(content);
181
- const embedding = patch.embedding ? `[${patch.embedding.join(",")}]` : null;
182
- const result = await getPool().query(
183
- `UPDATE memories
184
- SET type = $2,
185
- scope = $3,
186
- title = $4,
187
- content = $5,
188
- reason = $6,
189
- context = $7::jsonb,
190
- tags = $8,
191
- content_hash = $9,
192
- embedding = COALESCE($10::vector, embedding)
193
- WHERE id = $1
194
- RETURNING id, type, scope, architecture, project_name, title, content, reason, context, tags, content_hash`,
195
- [
196
- id,
197
- patch.type ?? current.type,
198
- patch.scope ?? current.scope,
199
- patch.title ?? current.title ?? null,
200
- content,
201
- patch.reason ?? current.reason ?? null,
202
- JSON.stringify(patch.context ?? current.context ?? {}),
203
- patch.tags ?? current.tags ?? [],
204
- contentHash,
205
- embedding
206
- ]
207
- );
208
- return result.rows[0] ?? null;
209
- }
210
- async function searchMemories(embedding, architectures, limit = 10) {
211
- await runMigrations();
212
- const vector = `[${embedding.join(",")}]`;
213
- const params = [vector];
214
- let whereClause = "";
215
- const selectedArchitectures = architectures ? (Array.isArray(architectures) ? architectures : [architectures]).filter(Boolean) : [];
216
- if (selectedArchitectures.length > 0) {
217
- whereClause = `WHERE (
218
- architecture = ANY($2)
219
- OR architecture IS NULL
220
- OR architecture = 'global'
221
- )`;
222
- params.push(selectedArchitectures);
223
- }
224
- const client = await getPool().connect();
225
- try {
226
- await client.query("BEGIN");
227
- await client.query("SET LOCAL ivfflat.probes = 10");
228
- const result = await client.query(
229
- `SELECT id, type, scope, architecture, project_name, title, content, reason, context, tags,
230
- 1 - (embedding <=> $1) AS similarity
231
- FROM memories
232
- ${whereClause}
233
- ORDER BY embedding <=> $1
234
- LIMIT $${params.length + 1}`,
235
- [...params, limit]
236
- );
237
- await client.query("COMMIT");
238
- return result.rows;
239
- } finally {
240
- client.release();
241
- }
242
- }
243
- async function closePool() {
244
- if (pool) {
245
- await pool.end();
246
- pool = null;
247
- migrationsRun = false;
248
- }
249
- }
250
-
251
- export {
252
- hashMemoryContent,
253
- getPool,
254
- runMigrations,
255
- saveMemory,
256
- upsertMemory,
257
- listMemories,
258
- getMemory,
259
- deleteMemory,
260
- deleteMemories,
261
- updateMemory,
262
- searchMemories,
263
- closePool
264
- };
@@ -1,2 +0,0 @@
1
- var Il=Object.defineProperty;var qn=e=>{throw TypeError(e)};var Ll=(e,t,r)=>t in e?Il(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Le=(e,t,r)=>Ll(e,typeof t!="symbol"?t+"":t,r),ts=(e,t,r)=>t.has(e)||qn("Cannot "+r);var l=(e,t,r)=>(ts(e,t,"read from private field"),r?r.call(e):t.get(e)),R=(e,t,r)=>t.has(e)?qn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),M=(e,t,r,s)=>(ts(e,t,"write to private field"),s?s.call(e,r):t.set(e,r),r),U=(e,t,r)=>(ts(e,t,"access private method"),r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const f of i.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();const Pl=!1;var ws=Array.isArray,$l=Array.prototype.indexOf,zt=Array.prototype.includes,jr=Array.from,jl=Object.defineProperty,lr=Object.getOwnPropertyDescriptor,ca=Object.getOwnPropertyDescriptors,Wl=Object.prototype,ql=Array.prototype,ys=Object.getPrototypeOf,Un=Object.isExtensible;const Ul=()=>{};function Vl(e){return e()}function ls(e){for(var t=0;t<e.length;t++)e[t]()}function fa(){var e,t,r=new Promise((s,a)=>{e=s,t=a});return{promise:r,resolve:e,reject:t}}const ae=2,Ht=4,mr=8,ua=1<<24,Ke=16,We=32,ut=64,os=128,Re=512,G=1024,ne=2048,qe=4096,ce=8192,Ce=16384,Dt=32768,Vn=1<<25,Bt=65536,cs=1<<17,zl=1<<18,Gt=1<<19,va=1<<20,Be=1<<25,Rt=65536,Fr=1<<21,ur=1<<22,ct=1<<23,kt=Symbol("$state"),Xe=new class extends Error{constructor(){super(...arguments);Le(this,"name","StaleReactionError");Le(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Hl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Bl(e,t,r){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Kl(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Yl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Gl(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Jl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Ql(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Xl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Zl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function eo(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const to=1,ro=2,da=4,so=8,no=16,ao=2,Z=Symbol(),pa="http://www.w3.org/1999/xhtml";function io(){console.warn("https://svelte.dev/e/derived_inert")}function lo(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function oo(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function _a(e){return e===this.v}function co(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function ha(e){return!co(e,this.v)}let Wr=!1,fo=!1;function uo(){Wr=!0}let J=null;function Kt(e){J=e}function ga(e,t=!1,r){J={p:J,i:!1,c:null,e:null,s:e,x:null,r:D,l:Wr&&!t?{s:null,u:null,$:[]}:null}}function ba(e){var t=J,r=t.e;if(r!==null){t.e=null;for(var s of r)ja(s)}return t.i=!0,J=t.p,{}}function wr(){return!Wr||J!==null&&J.l===null}let gt=[];function ma(){var e=gt;gt=[],ls(e)}function ft(e){if(gt.length===0&&!or){var t=gt;queueMicrotask(()=>{t===gt&&ma()})}gt.push(e)}function vo(){for(;gt.length>0;)ma()}function wa(e){var t=D;if(t===null)return O.f|=ct,e;if(!(t.f&Dt)&&!(t.f&Ht))throw e;ot(e,t)}function ot(e,t){for(;t!==null;){if(t.f&os){if(!(t.f&Dt))throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw e}const po=-7169;function K(e,t){e.f=e.f&po|t}function Es(e){e.f&Re||e.deps===null?K(e,G):K(e,qe)}function ya(e){if(e!==null)for(const t of e)!(t.f&ae)||!(t.f&Rt)||(t.f^=Rt,ya(t.deps))}function Ea(e,t,r){e.f&ne?t.add(e):e.f&qe&&r.add(e),ya(e.deps),K(e,G)}const ht=new Set;let T=null,se=null,fs=null,or=!1,rs=!1,$t=null,Ar=null;var zn=0;let _o=1;var jt,Wt,mt,Ze,Ve,dr,me,pr,it,et,ze,qt,Ut,wt,Q,Rr,xa,Cr,us,Nr,ho;const Lr=class Lr{constructor(){R(this,Q);Le(this,"id",_o++);Le(this,"current",new Map);Le(this,"previous",new Map);R(this,jt,new Set);R(this,Wt,new Set);R(this,mt,new Set);R(this,Ze,new Map);R(this,Ve,new Map);R(this,dr,null);R(this,me,[]);R(this,pr,[]);R(this,it,new Set);R(this,et,new Set);R(this,ze,new Map);R(this,qt,new Set);Le(this,"is_fork",!1);R(this,Ut,!1);R(this,wt,new Set)}skip_effect(t){l(this,ze).has(t)||l(this,ze).set(t,{d:[],m:[]}),l(this,qt).delete(t)}unskip_effect(t,r=s=>this.schedule(s)){var s=l(this,ze).get(t);if(s){l(this,ze).delete(t);for(var a of s.d)K(a,ne),r(a);for(a of s.m)K(a,qe),r(a)}l(this,qt).add(t)}capture(t,r,s=!1){t.v!==Z&&!this.previous.has(t)&&this.previous.set(t,t.v),t.f&ct||(this.current.set(t,[r,s]),se==null||se.set(t,r)),this.is_fork||(t.v=r)}activate(){T=this}deactivate(){T=null,se=null}flush(){try{rs=!0,T=this,U(this,Q,Cr).call(this)}finally{zn=0,fs=null,$t=null,Ar=null,rs=!1,T=null,se=null,St.clear()}}discard(){for(const t of l(this,Wt))t(this);l(this,Wt).clear(),l(this,mt).clear(),ht.delete(this)}register_created_effect(t){l(this,pr).push(t)}increment(t,r){let s=l(this,Ze).get(r)??0;if(l(this,Ze).set(r,s+1),t){let a=l(this,Ve).get(r)??0;l(this,Ve).set(r,a+1)}}decrement(t,r,s){let a=l(this,Ze).get(r)??0;if(a===1?l(this,Ze).delete(r):l(this,Ze).set(r,a-1),t){let i=l(this,Ve).get(r)??0;i===1?l(this,Ve).delete(r):l(this,Ve).set(r,i-1)}l(this,Ut)||s||(M(this,Ut,!0),ft(()=>{M(this,Ut,!1),this.flush()}))}transfer_effects(t,r){for(const s of t)l(this,it).add(s);for(const s of r)l(this,et).add(s);t.clear(),r.clear()}oncommit(t){l(this,jt).add(t)}ondiscard(t){l(this,Wt).add(t)}on_fork_commit(t){l(this,mt).add(t)}run_fork_commit_callbacks(){for(const t of l(this,mt))t(this);l(this,mt).clear()}settled(){return(l(this,dr)??M(this,dr,fa())).promise}static ensure(){if(T===null){const t=T=new Lr;rs||(ht.add(T),or||ft(()=>{T===t&&t.flush()}))}return T}apply(){{se=null;return}}schedule(t){var a;if(fs=t,(a=t.b)!=null&&a.is_pending&&t.f&(Ht|mr|ua)&&!(t.f&Dt)){t.b.defer_effect(t);return}for(var r=t;r.parent!==null;){r=r.parent;var s=r.f;if($t!==null&&r===D&&(O===null||!(O.f&ae)))return;if(s&(ut|We)){if(!(s&G))return;r.f^=G}}l(this,me).push(r)}};jt=new WeakMap,Wt=new WeakMap,mt=new WeakMap,Ze=new WeakMap,Ve=new WeakMap,dr=new WeakMap,me=new WeakMap,pr=new WeakMap,it=new WeakMap,et=new WeakMap,ze=new WeakMap,qt=new WeakMap,Ut=new WeakMap,wt=new WeakMap,Q=new WeakSet,Rr=function(){return this.is_fork||l(this,Ve).size>0},xa=function(){for(const s of l(this,wt))for(const a of l(s,Ve).keys()){for(var t=!1,r=a;r.parent!==null;){if(l(this,ze).has(r)){t=!0;break}r=r.parent}if(!t)return!0}return!1},Cr=function(){var d,c;if(zn++>1e3&&(ht.delete(this),bo()),!U(this,Q,Rr).call(this)){for(const p of l(this,it))l(this,et).delete(p),K(p,ne),this.schedule(p);for(const p of l(this,et))K(p,qe),this.schedule(p)}const t=l(this,me);M(this,me,[]),this.apply();var r=$t=[],s=[],a=Ar=[];for(const p of t)try{U(this,Q,us).call(this,p,r,s)}catch(g){throw Ta(p),g}if(T=null,a.length>0){var i=Lr.ensure();for(const p of a)i.schedule(p)}if($t=null,Ar=null,U(this,Q,Rr).call(this)||U(this,Q,xa).call(this)){U(this,Q,Nr).call(this,s),U(this,Q,Nr).call(this,r);for(const[p,g]of l(this,ze))Sa(p,g)}else{l(this,Ze).size===0&&ht.delete(this),l(this,it).clear(),l(this,et).clear();for(const p of l(this,jt))p(this);l(this,jt).clear(),Hn(s),Hn(r),(d=l(this,dr))==null||d.resolve()}var f=T;if(l(this,me).length>0){const p=f??(f=this);l(p,me).push(...l(this,me).filter(g=>!l(p,me).includes(g)))}f!==null&&(ht.add(f),U(c=f,Q,Cr).call(c))},us=function(t,r,s){t.f^=G;for(var a=t.first;a!==null;){var i=a.f,f=(i&(We|ut))!==0,d=f&&(i&G)!==0,c=d||(i&ce)!==0||l(this,ze).has(a);if(!c&&a.fn!==null){f?a.f^=G:i&Ht?r.push(a):Jt(a)&&(i&Ke&&l(this,et).add(a),Mt(a));var p=a.first;if(p!==null){a=p;continue}}for(;a!==null;){var g=a.next;if(g!==null){a=g;break}a=a.parent}}},Nr=function(t){for(var r=0;r<t.length;r+=1)Ea(t[r],l(this,it),l(this,et))},ho=function(){var g,x,y;for(const E of ht){var t=E.id<this.id,r=[];for(const[b,[v,m]]of this.current){if(E.current.has(b)){var s=E.current.get(b)[0];if(t&&v!==s)E.current.set(b,[v,m]);else continue}r.push(b)}var a=[...E.current.keys()].filter(b=>!this.current.has(b));if(a.length===0)t&&E.discard();else if(r.length>0){if(t)for(const b of l(this,qt))E.unskip_effect(b,v=>{var m;v.f&(Ke|ur)?E.schedule(v):U(m=E,Q,Nr).call(m,[v])});E.activate();var i=new Set,f=new Map;for(var d of r)ka(d,a,i,f);f=new Map;var c=[...E.current.keys()].filter(b=>this.current.has(b)?this.current.get(b)[0]!==b:!0);for(const b of l(this,pr))!(b.f&(Ce|ce|cs))&&xs(b,c,f)&&(b.f&(ur|Ke)?(K(b,ne),E.schedule(b)):l(E,it).add(b));if(l(E,me).length>0){E.apply();for(var p of l(E,me))U(g=E,Q,us).call(g,p,[],[]);M(E,me,[])}E.deactivate()}}for(const E of ht)l(E,wt).has(this)&&(l(E,wt).delete(this),l(E,wt).size===0&&!U(x=E,Q,Rr).call(x)&&(E.activate(),U(y=E,Q,Cr).call(y)))};let Ct=Lr;function go(e){var t=or;or=!0;try{for(var r;;){if(vo(),T===null)return r;T.flush()}}finally{or=t}}function bo(){try{Jl()}catch(e){ot(e,fs)}}let Pe=null;function Hn(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var s=e[r++];if(!(s.f&(Ce|ce))&&Jt(s)&&(Pe=new Set,Mt(s),s.deps===null&&s.first===null&&s.nodes===null&&s.teardown===null&&s.ac===null&&qa(s),(Pe==null?void 0:Pe.size)>0)){St.clear();for(const a of Pe){if(a.f&(Ce|ce))continue;const i=[a];let f=a.parent;for(;f!==null;)Pe.has(f)&&(Pe.delete(f),i.push(f)),f=f.parent;for(let d=i.length-1;d>=0;d--){const c=i[d];c.f&(Ce|ce)||Mt(c)}}Pe.clear()}}Pe=null}}function ka(e,t,r,s){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const a of e.reactions){const i=a.f;i&ae?ka(a,t,r,s):i&(ur|Ke)&&!(i&ne)&&xs(a,t,s)&&(K(a,ne),ks(a))}}function xs(e,t,r){const s=r.get(e);if(s!==void 0)return s;if(e.deps!==null)for(const a of e.deps){if(zt.call(t,a))return!0;if(a.f&ae&&xs(a,t,r))return r.set(a,!0),!0}return r.set(e,!1),!1}function ks(e){T.schedule(e)}function Sa(e,t){if(!(e.f&We&&e.f&G)){e.f&ne?t.d.push(e):e.f&qe&&t.m.push(e),K(e,G);for(var r=e.first;r!==null;)Sa(r,t),r=r.next}}function Ta(e){K(e,G);for(var t=e.first;t!==null;)Ta(t),t=t.next}function mo(e){let t=0,r=Nt(0),s;return()=>{Rs()&&(n(r),Ur(()=>(t===0&&(s=w(()=>e(()=>cr(r)))),t+=1,()=>{ft(()=>{t-=1,t===0&&(s==null||s(),s=void 0,cr(r))})})))}}var wo=Bt|Gt;function yo(e,t,r,s){new Eo(e,t,r,s)}var ke,ms,Se,yt,ve,Te,oe,we,tt,Et,lt,Vt,_r,hr,rt,Pr,Y,xo,ko,So,vs,Mr,Dr,ds,ps;class Eo{constructor(t,r,s,a){R(this,Y);Le(this,"parent");Le(this,"is_pending",!1);Le(this,"transform_error");R(this,ke);R(this,ms,null);R(this,Se);R(this,yt);R(this,ve);R(this,Te,null);R(this,oe,null);R(this,we,null);R(this,tt,null);R(this,Et,0);R(this,lt,0);R(this,Vt,!1);R(this,_r,new Set);R(this,hr,new Set);R(this,rt,null);R(this,Pr,mo(()=>(M(this,rt,Nt(l(this,Et))),()=>{M(this,rt,null)})));var i;M(this,ke,t),M(this,Se,r),M(this,yt,f=>{var d=D;d.b=this,d.f|=os,s(f)}),this.parent=D.b,this.transform_error=a??((i=this.parent)==null?void 0:i.transform_error)??(f=>f),M(this,ve,Ns(()=>{U(this,Y,vs).call(this)},wo))}defer_effect(t){Ea(t,l(this,_r),l(this,hr))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!l(this,Se).pending}update_pending_count(t,r){U(this,Y,ds).call(this,t,r),M(this,Et,l(this,Et)+t),!(!l(this,rt)||l(this,Vt))&&(M(this,Vt,!0),ft(()=>{M(this,Vt,!1),l(this,rt)&&Yt(l(this,rt),l(this,Et))}))}get_effect_pending(){return l(this,Pr).call(this),n(l(this,rt))}error(t){if(!l(this,Se).onerror&&!l(this,Se).failed)throw t;T!=null&&T.is_fork?(l(this,Te)&&T.skip_effect(l(this,Te)),l(this,oe)&&T.skip_effect(l(this,oe)),l(this,we)&&T.skip_effect(l(this,we)),T.on_fork_commit(()=>{U(this,Y,ps).call(this,t)})):U(this,Y,ps).call(this,t)}}ke=new WeakMap,ms=new WeakMap,Se=new WeakMap,yt=new WeakMap,ve=new WeakMap,Te=new WeakMap,oe=new WeakMap,we=new WeakMap,tt=new WeakMap,Et=new WeakMap,lt=new WeakMap,Vt=new WeakMap,_r=new WeakMap,hr=new WeakMap,rt=new WeakMap,Pr=new WeakMap,Y=new WeakSet,xo=function(){try{M(this,Te,Ae(()=>l(this,yt).call(this,l(this,ke))))}catch(t){this.error(t)}},ko=function(t){const r=l(this,Se).failed;r&&M(this,we,Ae(()=>{r(l(this,ke),()=>t,()=>()=>{})}))},So=function(){const t=l(this,Se).pending;t&&(this.is_pending=!0,M(this,oe,Ae(()=>t(l(this,ke)))),ft(()=>{var r=M(this,tt,document.createDocumentFragment()),s=st();r.append(s),M(this,Te,U(this,Y,Dr).call(this,()=>Ae(()=>l(this,yt).call(this,s)))),l(this,lt)===0&&(l(this,ke).before(r),M(this,tt,null),Tt(l(this,oe),()=>{M(this,oe,null)}),U(this,Y,Mr).call(this,T))}))},vs=function(){try{if(this.is_pending=this.has_pending_snippet(),M(this,lt,0),M(this,Et,0),M(this,Te,Ae(()=>{l(this,yt).call(this,l(this,ke))})),l(this,lt)>0){var t=M(this,tt,document.createDocumentFragment());Os(l(this,Te),t);const r=l(this,Se).pending;M(this,oe,Ae(()=>r(l(this,ke))))}else U(this,Y,Mr).call(this,T)}catch(r){this.error(r)}},Mr=function(t){this.is_pending=!1,t.transfer_effects(l(this,_r),l(this,hr))},Dr=function(t){var r=D,s=O,a=J;De(l(this,ve)),Me(l(this,ve)),Kt(l(this,ve).ctx);try{return Ct.ensure(),t()}catch(i){return wa(i),null}finally{De(r),Me(s),Kt(a)}},ds=function(t,r){var s;if(!this.has_pending_snippet()){this.parent&&U(s=this.parent,Y,ds).call(s,t,r);return}M(this,lt,l(this,lt)+t),l(this,lt)===0&&(U(this,Y,Mr).call(this,r),l(this,oe)&&Tt(l(this,oe),()=>{M(this,oe,null)}),l(this,tt)&&(l(this,ke).before(l(this,tt)),M(this,tt,null)))},ps=function(t){l(this,Te)&&(pe(l(this,Te)),M(this,Te,null)),l(this,oe)&&(pe(l(this,oe)),M(this,oe,null)),l(this,we)&&(pe(l(this,we)),M(this,we,null));var r=l(this,Se).onerror;let s=l(this,Se).failed;var a=!1,i=!1;const f=()=>{if(a){oo();return}a=!0,i&&eo(),l(this,we)!==null&&Tt(l(this,we),()=>{M(this,we,null)}),U(this,Y,Dr).call(this,()=>{U(this,Y,vs).call(this)})},d=c=>{try{i=!0,r==null||r(c,f),i=!1}catch(p){ot(p,l(this,ve)&&l(this,ve).parent)}s&&M(this,we,U(this,Y,Dr).call(this,()=>{try{return Ae(()=>{var p=D;p.b=this,p.f|=os,s(l(this,ke),()=>c,()=>f)})}catch(p){return ot(p,l(this,ve).parent),null}}))};ft(()=>{var c;try{c=this.transform_error(t)}catch(p){ot(p,l(this,ve)&&l(this,ve).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(d,p=>ot(p,l(this,ve)&&l(this,ve).parent)):d(c)})};function To(e,t,r,s){const a=wr()?Ss:Ra;var i=e.filter(y=>!y.settled);if(r.length===0&&i.length===0){s(t.map(a));return}var f=D,d=Ao(),c=i.length===1?i[0].promise:i.length>1?Promise.all(i.map(y=>y.promise)):null;function p(y){d();try{s(y)}catch(E){f.f&Ce||ot(E,f)}Ir()}if(r.length===0){c.then(()=>p(t.map(a)));return}var g=Aa();function x(){Promise.all(r.map(y=>Ro(y))).then(y=>p([...t.map(a),...y])).catch(y=>ot(y,f)).finally(()=>g())}c?c.then(()=>{d(),x(),Ir()}):x()}function Ao(){var e=D,t=O,r=J,s=T;return function(i=!0){De(e),Me(t),Kt(r),i&&!(e.f&Ce)&&(s==null||s.activate(),s==null||s.apply())}}function Ir(e=!0){De(null),Me(null),Kt(null),e&&(T==null||T.deactivate())}function Aa(){var e=D,t=e.b,r=T,s=t.is_rendered();return t.update_pending_count(1,r),r.increment(s,e),(a=!1)=>{t.update_pending_count(-1,r),r.decrement(s,e,a)}}function Ss(e){var t=ae|ne;return D!==null&&(D.f|=Gt),{ctx:J,deps:null,effects:null,equals:_a,f:t,fn:e,reactions:null,rv:0,v:Z,wv:0,parent:D,ac:null}}function Ro(e,t,r){let s=D;s===null&&Hl();var a=void 0,i=Nt(Z),f=!O,d=new Map;return Vo(()=>{var E;var c=D,p=fa();a=p.promise;try{Promise.resolve(e()).then(p.resolve,p.reject).finally(Ir)}catch(b){p.reject(b),Ir()}var g=T;if(f){if(c.f&Dt)var x=Aa();if(s.b.is_rendered())(E=d.get(g))==null||E.reject(Xe),d.delete(g);else{for(const b of d.values())b.reject(Xe);d.clear()}d.set(g,p)}const y=(b,v=void 0)=>{if(x){var m=v===Xe;x(m)}if(!(v===Xe||c.f&Ce)){if(g.activate(),v)i.f|=ct,Yt(i,v);else{i.f&ct&&(i.f^=ct),Yt(i,b);for(const[A,P]of d){if(d.delete(A),A===g)break;P.reject(Xe)}}g.deactivate()}};p.promise.then(y,b=>y(null,b||"unknown"))}),Cs(()=>{for(const c of d.values())c.reject(Xe)}),new Promise(c=>{function p(g){function x(){g===a?c(i):p(a)}g.then(x,x)}p(a)})}function Ra(e){const t=Ss(e);return t.equals=ha,t}function Co(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)pe(t[r])}}function Ts(e){var t,r=D,s=e.parent;if(!vt&&s!==null&&s.f&(Ce|ce))return io(),e.v;De(s);try{e.f&=~Rt,Co(e),t=Ka(e)}finally{De(r)}return t}function Ca(e){var t=Ts(e);if(!e.equals(t)&&(e.wv=Ha(),(!(T!=null&&T.is_fork)||e.deps===null)&&(T!==null?T.capture(e,t,!0):e.v=t,e.deps===null))){K(e,G);return}vt||(se!==null?(Rs()||T!=null&&T.is_fork)&&se.set(e,t):Es(e))}function No(e){var t,r;if(e.effects!==null)for(const s of e.effects)(s.teardown||s.ac)&&((t=s.teardown)==null||t.call(s),(r=s.ac)==null||r.abort(Xe),s.teardown=Ul,s.ac=null,vr(s,0),Ms(s))}function Na(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&Mt(t)}let _s=new Set;const St=new Map;let Ma=!1;function Nt(e,t){var r={f:0,v:e,reactions:null,equals:_a,rv:0,wv:0};return r}function nt(e,t){const r=Nt(e);return Bo(r),r}function B(e,t=!1,r=!0){var a;const s=Nt(e);return t||(s.equals=ha),Wr&&r&&J!==null&&J.l!==null&&((a=J.l).s??(a.s=[])).push(s),s}function rr(e,t){return N(e,w(()=>n(e))),t}function N(e,t,r=!1){O!==null&&(!je||O.f&cs)&&wr()&&O.f&(ae|Ke|ur|cs)&&(Ne===null||!zt.call(Ne,e))&&Zl();let s=r?ar(t):t;return Yt(e,s,Ar)}function Yt(e,t,r=null){if(!e.equals(t)){St.set(e,vt?t:e.v);var s=Ct.ensure();if(s.capture(e,t),e.f&ae){const a=e;e.f&ne&&Ts(a),se===null&&Es(a)}e.wv=Ha(),Da(e,ne,r),wr()&&D!==null&&D.f&G&&!(D.f&(We|ut))&&(xe===null?Ko([e]):xe.push(e)),!s.is_fork&&_s.size>0&&!Ma&&Mo()}return t}function Mo(){Ma=!1;for(const e of _s)e.f&G&&K(e,qe),Jt(e)&&Mt(e);_s.clear()}function cr(e){N(e,e.v+1)}function Da(e,t,r){var s=e.reactions;if(s!==null)for(var a=wr(),i=s.length,f=0;f<i;f++){var d=s[f],c=d.f;if(!(!a&&d===D)){var p=(c&ne)===0;if(p&&K(d,t),c&ae){var g=d;se==null||se.delete(g),c&Rt||(c&Re&&(D===null||!(D.f&Fr))&&(d.f|=Rt),Da(g,qe,r))}else if(p){var x=d;c&Ke&&Pe!==null&&Pe.add(x),r!==null?r.push(x):ks(x)}}}}function ar(e){if(typeof e!="object"||e===null||kt in e)return e;const t=ys(e);if(t!==Wl&&t!==ql)return e;var r=new Map,s=ws(e),a=nt(0),i=At,f=d=>{if(At===i)return d();var c=O,p=At;Me(null),Qn(i);var g=d();return Me(c),Qn(p),g};return s&&r.set("length",nt(e.length)),new Proxy(e,{defineProperty(d,c,p){(!("value"in p)||p.configurable===!1||p.enumerable===!1||p.writable===!1)&&Ql();var g=r.get(c);return g===void 0?f(()=>{var x=nt(p.value);return r.set(c,x),x}):N(g,p.value,!0),!0},deleteProperty(d,c){var p=r.get(c);if(p===void 0){if(c in d){const g=f(()=>nt(Z));r.set(c,g),cr(a)}}else N(p,Z),cr(a);return!0},get(d,c,p){var E;if(c===kt)return e;var g=r.get(c),x=c in d;if(g===void 0&&(!x||(E=lr(d,c))!=null&&E.writable)&&(g=f(()=>{var b=ar(x?d[c]:Z),v=nt(b);return v}),r.set(c,g)),g!==void 0){var y=n(g);return y===Z?void 0:y}return Reflect.get(d,c,p)},getOwnPropertyDescriptor(d,c){var p=Reflect.getOwnPropertyDescriptor(d,c);if(p&&"value"in p){var g=r.get(c);g&&(p.value=n(g))}else if(p===void 0){var x=r.get(c),y=x==null?void 0:x.v;if(x!==void 0&&y!==Z)return{enumerable:!0,configurable:!0,value:y,writable:!0}}return p},has(d,c){var y;if(c===kt)return!0;var p=r.get(c),g=p!==void 0&&p.v!==Z||Reflect.has(d,c);if(p!==void 0||D!==null&&(!g||(y=lr(d,c))!=null&&y.writable)){p===void 0&&(p=f(()=>{var E=g?ar(d[c]):Z,b=nt(E);return b}),r.set(c,p));var x=n(p);if(x===Z)return!1}return g},set(d,c,p,g){var I;var x=r.get(c),y=c in d;if(s&&c==="length")for(var E=p;E<x.v;E+=1){var b=r.get(E+"");b!==void 0?N(b,Z):E in d&&(b=f(()=>nt(Z)),r.set(E+"",b))}if(x===void 0)(!y||(I=lr(d,c))!=null&&I.writable)&&(x=f(()=>nt(void 0)),N(x,ar(p)),r.set(c,x));else{y=x.v!==Z;var v=f(()=>ar(p));N(x,v)}var m=Reflect.getOwnPropertyDescriptor(d,c);if(m!=null&&m.set&&m.set.call(g,p),!y){if(s&&typeof c=="string"){var A=r.get("length"),P=Number(c);Number.isInteger(P)&&P>=A.v&&N(A,P+1)}cr(a)}return!0},ownKeys(d){n(a);var c=Reflect.ownKeys(d).filter(x=>{var y=r.get(x);return y===void 0||y.v!==Z});for(var[p,g]of r)g.v!==Z&&!(p in d)&&c.push(p);return c},setPrototypeOf(){Xl()}})}function Bn(e){try{if(e!==null&&typeof e=="object"&&kt in e)return e[kt]}catch{}return e}function Do(e,t){return Object.is(Bn(e),Bn(t))}var Kn,Oa,Fa,Ia;function Oo(){if(Kn===void 0){Kn=window,Oa=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;Fa=lr(t,"firstChild").get,Ia=lr(t,"nextSibling").get,Un(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Un(r)&&(r.__t=void 0)}}function st(e=""){return document.createTextNode(e)}function As(e){return Fa.call(e)}function yr(e){return Ia.call(e)}function _(e,t){return As(e)}function Fo(e,t=!1){{var r=As(e);return r instanceof Comment&&r.data===""?yr(r):r}}function h(e,t=1,r=!1){let s=e;for(;t--;)s=yr(s);return s}function Io(e){e.textContent=""}function La(){return!1}function Lo(e,t,r){return document.createElementNS(pa,e,void 0)}let Yn=!1;function Po(){Yn||(Yn=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const r of e.target.elements)(t=r.__on_r)==null||t.call(r)})},{capture:!0}))}function qr(e){var t=O,r=D;Me(null),De(null);try{return e()}finally{Me(t),De(r)}}function Pa(e,t,r,s=r){e.addEventListener(t,()=>qr(r));const a=e.__on_r;a?e.__on_r=()=>{a(),s(!0)}:e.__on_r=()=>s(!0),Po()}function $a(e){D===null&&(O===null&&Gl(),Yl()),vt&&Kl()}function $o(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function Ye(e,t){var r=D;r!==null&&r.f&ce&&(e|=ce);var s={ctx:J,deps:null,nodes:null,f:e|ne|Re,first:null,fn:t,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};T==null||T.register_created_effect(s);var a=s;if(e&Ht)$t!==null?$t.push(s):Ct.ensure().schedule(s);else if(t!==null){try{Mt(s)}catch(f){throw pe(s),f}a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&!(a.f&Gt)&&(a=a.first,e&Ke&&e&Bt&&a!==null&&(a.f|=Bt))}if(a!==null&&(a.parent=r,r!==null&&$o(a,r),O!==null&&O.f&ae&&!(e&ut))){var i=O;(i.effects??(i.effects=[])).push(a)}return s}function Rs(){return O!==null&&!je}function Cs(e){const t=Ye(mr,null);return K(t,G),t.teardown=e,t}function Gn(e){$a();var t=D.f,r=!O&&(t&We)!==0&&(t&Dt)===0;if(r){var s=J;(s.e??(s.e=[])).push(e)}else return ja(e)}function ja(e){return Ye(Ht|va,e)}function jo(e){return $a(),Ye(mr|va,e)}function Wo(e){Ct.ensure();const t=Ye(ut|Gt,e);return(r={})=>new Promise(s=>{r.outro?Tt(t,()=>{pe(t),s(void 0)}):(pe(t),s(void 0))})}function qo(e){return Ye(Ht,e)}function ge(e,t){var r=J,s={effect:null,ran:!1,deps:e};r.l.$.push(s),s.effect=Ur(()=>{if(e(),!s.ran){s.ran=!0;var a=D;try{De(a.parent),w(t)}finally{De(a)}}})}function Uo(){var e=J;Ur(()=>{for(var t of e.l.$){t.deps();var r=t.effect;r.f&G&&r.deps!==null&&K(r,qe),Jt(r)&&Mt(r),t.ran=!1}})}function Vo(e){return Ye(ur|Gt,e)}function Ur(e,t=0){return Ye(mr|t,e)}function V(e,t=[],r=[],s=[]){To(s,t,r,a=>{Ye(mr,()=>e(...a.map(n)))})}function Ns(e,t=0){var r=Ye(Ke|t,e);return r}function Ae(e){return Ye(We|Gt,e)}function Wa(e){var t=e.teardown;if(t!==null){const r=vt,s=O;Jn(!0),Me(null);try{t.call(null)}finally{Jn(r),Me(s)}}}function Ms(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const a=r.ac;a!==null&&qr(()=>{a.abort(Xe)});var s=r.next;r.f&ut?r.parent=null:pe(r,t),r=s}}function zo(e){for(var t=e.first;t!==null;){var r=t.next;t.f&We||pe(t),t=r}}function pe(e,t=!0){var r=!1;(t||e.f&zl)&&e.nodes!==null&&e.nodes.end!==null&&(Ho(e.nodes.start,e.nodes.end),r=!0),K(e,Vn),Ms(e,t&&!r),vr(e,0);var s=e.nodes&&e.nodes.t;if(s!==null)for(const i of s)i.stop();Wa(e),e.f^=Vn,e.f|=Ce;var a=e.parent;a!==null&&a.first!==null&&qa(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Ho(e,t){for(;e!==null;){var r=e===t?null:yr(e);e.remove(),e=r}}function qa(e){var t=e.parent,r=e.prev,s=e.next;r!==null&&(r.next=s),s!==null&&(s.prev=r),t!==null&&(t.first===e&&(t.first=s),t.last===e&&(t.last=r))}function Tt(e,t,r=!0){var s=[];Ua(e,s,!0);var a=()=>{r&&pe(e),t&&t()},i=s.length;if(i>0){var f=()=>--i||a();for(var d of s)d.out(f)}else a()}function Ua(e,t,r){if(!(e.f&ce)){e.f^=ce;var s=e.nodes&&e.nodes.t;if(s!==null)for(const d of s)(d.is_global||r)&&t.push(d);for(var a=e.first;a!==null;){var i=a.next;if(!(a.f&ut)){var f=(a.f&Bt)!==0||(a.f&We)!==0&&(e.f&Ke)!==0;Ua(a,t,f?r:!1)}a=i}}}function Ds(e){Va(e,!0)}function Va(e,t){if(e.f&ce){e.f^=ce,e.f&G||(K(e,ne),Ct.ensure().schedule(e));for(var r=e.first;r!==null;){var s=r.next,a=(r.f&Bt)!==0||(r.f&We)!==0;Va(r,a?t:!1),r=s}var i=e.nodes&&e.nodes.t;if(i!==null)for(const f of i)(f.is_global||t)&&f.in()}}function Os(e,t){if(e.nodes)for(var r=e.nodes.start,s=e.nodes.end;r!==null;){var a=r===s?null:yr(r);t.append(r),r=a}}let Or=!1,vt=!1;function Jn(e){vt=e}let O=null,je=!1;function Me(e){O=e}let D=null;function De(e){D=e}let Ne=null;function Bo(e){O!==null&&(Ne===null?Ne=[e]:Ne.push(e))}let de=null,be=0,xe=null;function Ko(e){xe=e}let za=1,bt=0,At=bt;function Qn(e){At=e}function Ha(){return++za}function Jt(e){var t=e.f;if(t&ne)return!0;if(t&ae&&(e.f&=~Rt),t&qe){for(var r=e.deps,s=r.length,a=0;a<s;a++){var i=r[a];if(Jt(i)&&Ca(i),i.wv>e.wv)return!0}t&Re&&se===null&&K(e,G)}return!1}function Ba(e,t,r=!0){var s=e.reactions;if(s!==null&&!(Ne!==null&&zt.call(Ne,e)))for(var a=0;a<s.length;a++){var i=s[a];i.f&ae?Ba(i,t,!1):t===i&&(r?K(i,ne):i.f&G&&K(i,qe),ks(i))}}function Ka(e){var v;var t=de,r=be,s=xe,a=O,i=Ne,f=J,d=je,c=At,p=e.f;de=null,be=0,xe=null,O=p&(We|ut)?null:e,Ne=null,Kt(e.ctx),je=!1,At=++bt,e.ac!==null&&(qr(()=>{e.ac.abort(Xe)}),e.ac=null);try{e.f|=Fr;var g=e.fn,x=g();e.f|=Dt;var y=e.deps,E=T==null?void 0:T.is_fork;if(de!==null){var b;if(E||vr(e,be),y!==null&&be>0)for(y.length=be+de.length,b=0;b<de.length;b++)y[be+b]=de[b];else e.deps=y=de;if(Rs()&&e.f&Re)for(b=be;b<y.length;b++)((v=y[b]).reactions??(v.reactions=[])).push(e)}else!E&&y!==null&&be<y.length&&(vr(e,be),y.length=be);if(wr()&&xe!==null&&!je&&y!==null&&!(e.f&(ae|qe|ne)))for(b=0;b<xe.length;b++)Ba(xe[b],e);if(a!==null&&a!==e){if(bt++,a.deps!==null)for(let m=0;m<r;m+=1)a.deps[m].rv=bt;if(t!==null)for(const m of t)m.rv=bt;xe!==null&&(s===null?s=xe:s.push(...xe))}return e.f&ct&&(e.f^=ct),x}catch(m){return wa(m)}finally{e.f^=Fr,de=t,be=r,xe=s,O=a,Ne=i,Kt(f),je=d,At=c}}function Yo(e,t){let r=t.reactions;if(r!==null){var s=$l.call(r,e);if(s!==-1){var a=r.length-1;a===0?r=t.reactions=null:(r[s]=r[a],r.pop())}}if(r===null&&t.f&ae&&(de===null||!zt.call(de,t))){var i=t;i.f&Re&&(i.f^=Re,i.f&=~Rt),i.v!==Z&&Es(i),No(i),vr(i,0)}}function vr(e,t){var r=e.deps;if(r!==null)for(var s=t;s<r.length;s++)Yo(e,r[s])}function Mt(e){var t=e.f;if(!(t&Ce)){K(e,G);var r=D,s=Or;D=e,Or=!0;try{t&(Ke|ua)?zo(e):Ms(e),Wa(e);var a=Ka(e);e.teardown=typeof a=="function"?a:null,e.wv=za;var i;Pl&&fo&&e.f&ne&&e.deps}finally{Or=s,D=r}}}async function Go(){await Promise.resolve(),go()}function n(e){var t=e.f,r=(t&ae)!==0;if(O!==null&&!je){var s=D!==null&&(D.f&Ce)!==0;if(!s&&(Ne===null||!zt.call(Ne,e))){var a=O.deps;if(O.f&Fr)e.rv<bt&&(e.rv=bt,de===null&&a!==null&&a[be]===e?be++:de===null?de=[e]:de.push(e));else{(O.deps??(O.deps=[])).push(e);var i=e.reactions;i===null?e.reactions=[O]:zt.call(i,O)||i.push(O)}}}if(vt&&St.has(e))return St.get(e);if(r){var f=e;if(vt){var d=f.v;return(!(f.f&G)&&f.reactions!==null||Ga(f))&&(d=Ts(f)),St.set(f,d),d}var c=(f.f&Re)===0&&!je&&O!==null&&(Or||(O.f&Re)!==0),p=(f.f&Dt)===0;Jt(f)&&(c&&(f.f|=Re),Ca(f)),c&&!p&&(Na(f),Ya(f))}if(se!=null&&se.has(e))return se.get(e);if(e.f&ct)throw e.v;return e.v}function Ya(e){if(e.f|=Re,e.deps!==null)for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),t.f&ae&&!(t.f&Re)&&(Na(t),Ya(t))}function Ga(e){if(e.v===Z)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(St.has(t)||t.f&ae&&Ga(t))return!0;return!1}function w(e){var t=je;try{return je=!0,e()}finally{je=t}}function Jo(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(kt in e)hs(e);else if(!Array.isArray(e))for(let t in e){const r=e[t];typeof r=="object"&&r&&kt in r&&hs(r)}}}function hs(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let s in e)try{hs(e[s],t)}catch{}const r=ys(e);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){const s=ca(r);for(let a in s){const i=s[a].get;if(i)try{i.call(e)}catch{}}}}}const Qo=["touchstart","touchmove"];function Xo(e){return Qo.includes(e)}const kr=Symbol("events"),Zo=new Set,Xn=new Set;function ec(e,t,r,s={}){function a(i){if(s.capture||gs.call(t,i),!i.cancelBubble)return qr(()=>r==null?void 0:r.call(this,i))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?ft(()=>{t.addEventListener(e,a,s)}):t.addEventListener(e,a,s),a}function Zn(e,t,r,s,a){var i={capture:s,passive:a},f=ec(e,t,r,i);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Cs(()=>{t.removeEventListener(e,f,i)})}let ea=null;function gs(e){var m,A;var t=this,r=t.ownerDocument,s=e.type,a=((m=e.composedPath)==null?void 0:m.call(e))||[],i=a[0]||e.target;ea=e;var f=0,d=ea===e&&e[kr];if(d){var c=a.indexOf(d);if(c!==-1&&(t===document||t===window)){e[kr]=t;return}var p=a.indexOf(t);if(p===-1)return;c<=p&&(f=c)}if(i=a[f]||e.target,i!==t){jl(e,"currentTarget",{configurable:!0,get(){return i||r}});var g=O,x=D;Me(null),De(null);try{for(var y,E=[];i!==null;){var b=i.assignedSlot||i.parentNode||i.host||null;try{var v=(A=i[kr])==null?void 0:A[s];v!=null&&(!i.disabled||e.target===i)&&v.call(i,e)}catch(P){y?E.push(P):y=P}if(e.cancelBubble||b===t||b===null)break;i=b}if(y){for(let P of E)queueMicrotask(()=>{throw P});throw y}}finally{e[kr]=t,delete e.currentTarget,Me(g),De(x)}}}var la;const ss=((la=globalThis==null?void 0:globalThis.window)==null?void 0:la.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function tc(e){return(ss==null?void 0:ss.createHTML(e))??e}function rc(e){var t=Lo("template");return t.innerHTML=tc(e.replaceAll("<!>","<!---->")),t.content}function Fs(e,t){var r=D;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function W(e,t){var r=(t&ao)!==0,s,a=!e.startsWith("<!>");return()=>{s===void 0&&(s=rc(a?e:"<!>"+e),s=As(s));var i=r||Oa?document.importNode(s,!0):s.cloneNode(!0);return Fs(i,i),i}}function ta(e=""){{var t=st(e+"");return Fs(t,t),t}}function sc(){var e=document.createDocumentFragment(),t=document.createComment(""),r=st();return e.append(t,r),Fs(t,r),e}function F(e,t){e!==null&&e.before(t)}function k(e,t){var r=t==null?"":typeof t=="object"?`${t}`:t;r!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=r,e.nodeValue=`${r}`)}function nc(e,t){return ac(e,t)}const Sr=new Map;function ac(e,{target:t,anchor:r,props:s={},events:a,context:i,intro:f=!0,transformError:d}){Oo();var c=void 0,p=Wo(()=>{var g=r??t.appendChild(st());yo(g,{pending:()=>{}},E=>{ga({});var b=J;i&&(b.c=i),a&&(s.$$events=a),c=e(E,s)||{},ba()},d);var x=new Set,y=E=>{for(var b=0;b<E.length;b++){var v=E[b];if(!x.has(v)){x.add(v);var m=Xo(v);for(const I of[t,document]){var A=Sr.get(I);A===void 0&&(A=new Map,Sr.set(I,A));var P=A.get(v);P===void 0?(I.addEventListener(v,gs,{passive:m}),A.set(v,1)):A.set(v,P+1)}}}};return y(jr(Zo)),Xn.add(y),()=>{var m;for(var E of x)for(const A of[t,document]){var b=Sr.get(A),v=b.get(E);--v==0?(A.removeEventListener(E,gs),b.delete(E),b.size===0&&Sr.delete(A)):b.set(E,v)}Xn.delete(y),g!==r&&((m=g.parentNode)==null||m.removeChild(g))}});return ic.set(c,p),c}let ic=new WeakMap;var $e,He,ye,xt,gr,br,$r;class lc{constructor(t,r=!0){Le(this,"anchor");R(this,$e,new Map);R(this,He,new Map);R(this,ye,new Map);R(this,xt,new Set);R(this,gr,!0);R(this,br,t=>{if(l(this,$e).has(t)){var r=l(this,$e).get(t),s=l(this,He).get(r);if(s)Ds(s),l(this,xt).delete(r);else{var a=l(this,ye).get(r);a&&(l(this,He).set(r,a.effect),l(this,ye).delete(r),a.fragment.lastChild.remove(),this.anchor.before(a.fragment),s=a.effect)}for(const[i,f]of l(this,$e)){if(l(this,$e).delete(i),i===t)break;const d=l(this,ye).get(f);d&&(pe(d.effect),l(this,ye).delete(f))}for(const[i,f]of l(this,He)){if(i===r||l(this,xt).has(i))continue;const d=()=>{if(Array.from(l(this,$e).values()).includes(i)){var p=document.createDocumentFragment();Os(f,p),p.append(st()),l(this,ye).set(i,{effect:f,fragment:p})}else pe(f);l(this,xt).delete(i),l(this,He).delete(i)};l(this,gr)||!s?(l(this,xt).add(i),Tt(f,d,!1)):d()}}});R(this,$r,t=>{l(this,$e).delete(t);const r=Array.from(l(this,$e).values());for(const[s,a]of l(this,ye))r.includes(s)||(pe(a.effect),l(this,ye).delete(s))});this.anchor=t,M(this,gr,r)}ensure(t,r){var s=T,a=La();if(r&&!l(this,He).has(t)&&!l(this,ye).has(t))if(a){var i=document.createDocumentFragment(),f=st();i.append(f),l(this,ye).set(t,{effect:Ae(()=>r(f)),fragment:i})}else l(this,He).set(t,Ae(()=>r(this.anchor)));if(l(this,$e).set(s,t),a){for(const[d,c]of l(this,He))d===t?s.unskip_effect(c):s.skip_effect(c);for(const[d,c]of l(this,ye))d===t?s.unskip_effect(c.effect):s.skip_effect(c.effect);s.oncommit(l(this,br)),s.ondiscard(l(this,$r))}else l(this,br).call(this,s)}}$e=new WeakMap,He=new WeakMap,ye=new WeakMap,xt=new WeakMap,gr=new WeakMap,br=new WeakMap,$r=new WeakMap;function ue(e,t,r=!1){var s=new lc(e),a=r?Bt:0;function i(f,d){s.ensure(f,d)}Ns(()=>{var f=!1;t((d,c=0)=>{f=!0,i(c,d)}),f||i(-1,null)},a)}function oc(e,t,r){for(var s=[],a=t.length,i,f=t.length,d=0;d<a;d++){let x=t[d];Tt(x,()=>{if(i){if(i.pending.delete(x),i.done.add(x),i.pending.size===0){var y=e.outrogroups;bs(e,jr(i.done)),y.delete(i),y.size===0&&(e.outrogroups=null)}}else f-=1},!1)}if(f===0){var c=s.length===0&&r!==null;if(c){var p=r,g=p.parentNode;Io(g),g.append(p),e.items.clear()}bs(e,t,!c)}else i={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(i)}function bs(e,t,r=!0){var s;if(e.pending.size>0){s=new Set;for(const f of e.pending.values())for(const d of f)s.add(e.items.get(d).e)}for(var a=0;a<t.length;a++){var i=t[a];if(s!=null&&s.has(i)){i.f|=Be;const f=document.createDocumentFragment();Os(i,f)}else pe(t[a],r)}}var ra;function Pt(e,t,r,s,a,i=null){var f=e,d=new Map,c=(t&da)!==0;if(c){var p=e;f=p.appendChild(st())}var g=null,x=Ra(()=>{var I=r();return ws(I)?I:I==null?[]:jr(I)}),y,E=new Map,b=!0;function v(I){P.effect.f&Ce||(P.pending.delete(I),P.fallback=g,cc(P,y,f,t,s),g!==null&&(y.length===0?g.f&Be?(g.f^=Be,ir(g,null,f)):Ds(g):Tt(g,()=>{g=null})))}function m(I){P.pending.delete(I)}var A=Ns(()=>{y=n(x);for(var I=y.length,X=new Set,ee=T,$=La(),ie=0;ie<I;ie+=1){var Ge=y[ie],Ue=s(Ge,ie),le=b?null:d.get(Ue);le?(le.v&&Yt(le.v,Ge),le.i&&Yt(le.i,ie),$&&ee.unskip_effect(le.e)):(le=fc(d,b?f:ra??(ra=st()),Ge,Ue,ie,a,t,r),b||(le.e.f|=Be),d.set(Ue,le)),X.add(Ue)}if(I===0&&i&&!g&&(b?g=Ae(()=>i(f)):(g=Ae(()=>i(ra??(ra=st()))),g.f|=Be)),I>X.size&&Bl(),!b)if(E.set(ee,X),$){for(const[dt,pt]of d)X.has(dt)||ee.skip_effect(pt.e);ee.oncommit(v),ee.ondiscard(m)}else v(ee);n(x)}),P={effect:A,items:d,pending:E,outrogroups:null,fallback:g};b=!1}function sr(e){for(;e!==null&&!(e.f&We);)e=e.next;return e}function cc(e,t,r,s,a){var le,dt,pt,Qt,Xt,Er,Ot,Zt,xr;var i=(s&so)!==0,f=t.length,d=e.items,c=sr(e.effect.first),p,g=null,x,y=[],E=[],b,v,m,A;if(i)for(A=0;A<f;A+=1)b=t[A],v=a(b,A),m=d.get(v).e,m.f&Be||((dt=(le=m.nodes)==null?void 0:le.a)==null||dt.measure(),(x??(x=new Set)).add(m));for(A=0;A<f;A+=1){if(b=t[A],v=a(b,A),m=d.get(v).e,e.outrogroups!==null)for(const Oe of e.outrogroups)Oe.pending.delete(m),Oe.done.delete(m);if(m.f&ce&&(Ds(m),i&&((Qt=(pt=m.nodes)==null?void 0:pt.a)==null||Qt.unfix(),(x??(x=new Set)).delete(m))),m.f&Be)if(m.f^=Be,m===c)ir(m,null,r);else{var P=g?g.next:c;m===e.effect.last&&(e.effect.last=m.prev),m.prev&&(m.prev.next=m.next),m.next&&(m.next.prev=m.prev),at(e,g,m),at(e,m,P),ir(m,P,r),g=m,y=[],E=[],c=sr(g.next);continue}if(m!==c){if(p!==void 0&&p.has(m)){if(y.length<E.length){var I=E[0],X;g=I.prev;var ee=y[0],$=y[y.length-1];for(X=0;X<y.length;X+=1)ir(y[X],I,r);for(X=0;X<E.length;X+=1)p.delete(E[X]);at(e,ee.prev,$.next),at(e,g,ee),at(e,$,I),c=I,g=$,A-=1,y=[],E=[]}else p.delete(m),ir(m,c,r),at(e,m.prev,m.next),at(e,m,g===null?e.effect.first:g.next),at(e,g,m),g=m;continue}for(y=[],E=[];c!==null&&c!==m;)(p??(p=new Set)).add(c),E.push(c),c=sr(c.next);if(c===null)continue}m.f&Be||y.push(m),g=m,c=sr(m.next)}if(e.outrogroups!==null){for(const Oe of e.outrogroups)Oe.pending.size===0&&(bs(e,jr(Oe.done)),(Xt=e.outrogroups)==null||Xt.delete(Oe));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||p!==void 0){var ie=[];if(p!==void 0)for(m of p)m.f&ce||ie.push(m);for(;c!==null;)!(c.f&ce)&&c!==e.fallback&&ie.push(c),c=sr(c.next);var Ge=ie.length;if(Ge>0){var Ue=s&da&&f===0?r:null;if(i){for(A=0;A<Ge;A+=1)(Ot=(Er=ie[A].nodes)==null?void 0:Er.a)==null||Ot.measure();for(A=0;A<Ge;A+=1)(xr=(Zt=ie[A].nodes)==null?void 0:Zt.a)==null||xr.fix()}oc(e,ie,Ue)}}i&&ft(()=>{var Oe,er;if(x!==void 0)for(m of x)(er=(Oe=m.nodes)==null?void 0:Oe.a)==null||er.apply()})}function fc(e,t,r,s,a,i,f,d){var c=f&to?f&no?Nt(r):B(r,!1,!1):null,p=f&ro?Nt(a):null;return{v:c,i:p,e:Ae(()=>(i(t,c??r,p??a,d),()=>{e.delete(s)}))}}function ir(e,t,r){if(e.nodes)for(var s=e.nodes.start,a=e.nodes.end,i=t&&!(t.f&Be)?t.nodes.start:r;s!==null;){var f=yr(s);if(i.before(s),s===a)return;s=f}}function at(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}const sa=[...`
2
- \r\f \v\uFEFF`];function uc(e,t,r){var s=e==null?"":""+e;if(r){for(var a of Object.keys(r))if(r[a])s=s?s+" "+a:a;else if(s.length)for(var i=a.length,f=0;(f=s.indexOf(a,f))>=0;){var d=f+i;(f===0||sa.includes(s[f-1]))&&(d===s.length||sa.includes(s[d]))?s=(f===0?"":s.substring(0,f))+s.substring(d+1):f=d}}return s===""?null:s}function vc(e,t){return e==null?null:String(e)}function nr(e,t,r,s,a,i){var f=e.__className;if(f!==r||f===void 0){var d=uc(r,s,i);d==null?e.removeAttribute("class"):e.className=d,e.__className=r}else if(i&&a!==i)for(var c in i){var p=!!i[c];(a==null||p!==!!a[c])&&e.classList.toggle(c,p)}return i}function na(e,t,r,s){var a=e.__style;if(a!==t){var i=vc(t);i==null?e.removeAttribute("style"):e.style.cssText=i,e.__style=t}return s}function Ja(e,t,r=!1){if(e.multiple){if(t==null)return;if(!ws(t))return lo();for(var s of e.options)s.selected=t.includes(fr(s));return}for(s of e.options){var a=fr(s);if(Do(a,t)){s.selected=!0;return}}(!r||t!==void 0)&&(e.selectedIndex=-1)}function dc(e){var t=new MutationObserver(()=>{Ja(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Cs(()=>{t.disconnect()})}function ns(e,t,r=t){var s=new WeakSet,a=!0;Pa(e,"change",i=>{var f=i?"[selected]":":checked",d;if(e.multiple)d=[].map.call(e.querySelectorAll(f),fr);else{var c=e.querySelector(f)??e.querySelector("option:not([disabled])");d=c&&fr(c)}r(d),e.__value=d,T!==null&&s.add(T)}),qo(()=>{var i=t();if(e===document.activeElement){var f=T;if(s.has(f))return}if(Ja(e,i,a),a&&i===void 0){var d=e.querySelector(":checked");d!==null&&(i=fr(d),r(i))}e.__value=i,a=!1}),dc(e)}function fr(e){return"__value"in e?e.__value:e.value}const pc=Symbol("is custom element"),_c=Symbol("is html");function hc(e,t,r,s){var a=gc(e);a[t]!==(a[t]=r)&&(r==null?e.removeAttribute(t):typeof r!="string"&&bc(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function gc(e){return e.__attributes??(e.__attributes={[pc]:e.nodeName.includes("-"),[_c]:e.namespaceURI===pa})}var aa=new Map;function bc(e){var t=e.getAttribute("is")||e.nodeName,r=aa.get(t);if(r)return r;aa.set(t,r=[]);for(var s,a=e,i=Element.prototype;i!==a;){s=ca(a);for(var f in s)s[f].set&&r.push(f);a=ys(a)}return r}function Tr(e,t,r=t){var s=new WeakSet;Pa(e,"input",async a=>{var i=a?e.defaultValue:e.value;if(i=as(e)?is(i):i,r(i),T!==null&&s.add(T),await Go(),i!==(i=t())){var f=e.selectionStart,d=e.selectionEnd,c=e.value.length;if(e.value=i??"",d!==null){var p=e.value.length;f===d&&d===c&&p>c?(e.selectionStart=p,e.selectionEnd=p):(e.selectionStart=f,e.selectionEnd=Math.min(d,p))}}}),w(t)==null&&e.value&&(r(as(e)?is(e.value):e.value),T!==null&&s.add(T)),Ur(()=>{var a=t();if(e===document.activeElement){var i=T;if(s.has(i))return}as(e)&&a===is(e.value)||e.type==="date"&&!a&&!e.value||a!==e.value&&(e.value=a??"")})}function as(e){var t=e.type;return t==="number"||t==="range"}function is(e){return e===""?null:+e}function mc(e){return function(...t){var r=t[0];return r.preventDefault(),e==null?void 0:e.apply(this,t)}}function wc(e=!1){const t=J,r=t.l.u;if(!r)return;let s=()=>Jo(t.s);if(e){let a=0,i={};const f=Ss(()=>{let d=!1;const c=t.s;for(const p in c)c[p]!==i[p]&&(i[p]=c[p],d=!0);return d&&a++,a});s=()=>n(f)}r.b.length&&jo(()=>{ia(t,s),ls(r.b)}),Gn(()=>{const a=w(()=>r.m.map(Vl));return()=>{for(const i of a)typeof i=="function"&&i()}}),r.a.length&&Gn(()=>{ia(t,s),ls(r.a)})}function ia(e,t){if(e.l.s)for(const r of e.l.s)n(r);t()}const yc="5";var oa;typeof window<"u"&&((oa=window.__svelte??(window.__svelte={})).v??(oa.v=new Set)).add(yc);uo();var Ec=W('<div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Watch issue</span><strong class="status-warn svelte-d3ct2b"> </strong></div>'),xc=W('<section class="notice svelte-d3ct2b"> </section>'),kc=W('<section class="notice danger svelte-d3ct2b"> </section>'),Sc=W('<p class="terminal-line svelte-d3ct2b"><time class="svelte-d3ct2b">--:--:--</time><span class="sys svelte-d3ct2b">SYS</span><strong class="svelte-d3ct2b">Waiting for memory-core watch output...</strong></p>'),Tc=W('<strong class="svelte-d3ct2b"> </strong>'),Ac=W('<strong class="svelte-d3ct2b"> </strong>'),Rc=W('<strong class="svelte-d3ct2b"> </strong>'),Cc=W('<strong class="svelte-d3ct2b"> </strong>'),Nc=W('<strong class="svelte-d3ct2b"> </strong>'),Mc=W('<p class="svelte-d3ct2b"><b class="svelte-d3ct2b">Why:</b> </p>'),Dc=W('<p class="svelte-d3ct2b"><b class="svelte-d3ct2b">Issue:</b> </p>'),Oc=W('<p class="svelte-d3ct2b"><b class="svelte-d3ct2b">Fix:</b> </p>'),Fc=W('<pre class="svelte-d3ct2b"> </pre>'),Ic=W('<div class="terminal-detail svelte-d3ct2b"><p class="svelte-d3ct2b"> </p> <p class="svelte-d3ct2b"><b class="svelte-d3ct2b">Rule:</b> </p> <!> <!> <!> <!></div>'),Lc=W('<section><p class="terminal-line svelte-d3ct2b"><time class="svelte-d3ct2b"> </time> <span class="svelte-d3ct2b"> </span> <!></p> <!></section>'),Pc=W('<div class="metric-row svelte-d3ct2b"><div class="svelte-d3ct2b"><span class="svelte-d3ct2b"> </span> <strong class="svelte-d3ct2b"> </strong></div> <i class="svelte-d3ct2b"></i></div>'),$c=W('<p class="empty svelte-d3ct2b">No rule counters yet.</p>'),jc=W('<div class="metric-row warning svelte-d3ct2b"><div class="svelte-d3ct2b"><span class="svelte-d3ct2b"> </span> <strong class="svelte-d3ct2b"> </strong></div> <i class="svelte-d3ct2b"></i></div>'),Wc=W('<p class="empty svelte-d3ct2b">No file counters yet.</p>'),qc=W('<small class="svelte-d3ct2b"> </small>'),Uc=W('<small class="svelte-d3ct2b"> </small>'),Vc=W('<section class="commit-item svelte-d3ct2b"><div class="commit-meta svelte-d3ct2b"><span> </span> <time> </time></div> <strong class="svelte-d3ct2b"> </strong> <p class="svelte-d3ct2b"> </p> <!> <!></section>'),zc=W('<p class="empty svelte-d3ct2b">No commit hook violations recorded yet.</p>'),Hc=W('<small class="svelte-d3ct2b"> </small>'),Bc=W('<div class="rule-item svelte-d3ct2b"><div><div class="rule-meta svelte-d3ct2b"><span class="svelte-d3ct2b"> </span> <code class="svelte-d3ct2b"> </code></div> <p class="svelte-d3ct2b"> </p> <!></div> <button class="svelte-d3ct2b">Delete</button></div>'),Kc=W('<p class="empty svelte-d3ct2b">No rules match the current filters.</p>'),Yc=W('<div class="command-center svelte-d3ct2b"><aside class="sidebar svelte-d3ct2b"><div class="brand svelte-d3ct2b"><h1 class="svelte-d3ct2b">memory-core</h1> <span class="svelte-d3ct2b">command center</span></div> <nav aria-label="Dashboard navigation" class="svelte-d3ct2b"><a class="nav-item active svelte-d3ct2b" href="/"><span class="nav-icon svelte-d3ct2b">[]</span> <span>Command Center</span></a></nav> <div class="sidebar-footer svelte-d3ct2b"><div><i class="svelte-d3ct2b"></i> </div> <small class="svelte-d3ct2b"> </small></div></aside> <div class="workspace svelte-d3ct2b"><header class="topbar svelte-d3ct2b"><div class="topbar-left svelte-d3ct2b"><button class="icon-button mobile-menu svelte-d3ct2b" aria-label="Menu">=</button> <div><i class="svelte-d3ct2b"></i> <span> </span></div></div> <div class="header-metrics svelte-d3ct2b" aria-label="Global metrics"><div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Violations</span> <strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Files</span> <strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Rules</span> <strong class="svelte-d3ct2b"> </strong></div></div> <div class="top-actions svelte-d3ct2b" aria-label="Status shortcuts"><button class="icon-button svelte-d3ct2b" title="Warnings" aria-label="Warnings">!</button> <button class="icon-button svelte-d3ct2b" title="Rules" aria-label="Rules">R</button> <button class="icon-button svelte-d3ct2b" title="Database" aria-label="Database">DB</button> <button class="icon-button svelte-d3ct2b" title="Network" aria-label="Network">LAN</button></div></header> <main class="canvas svelte-d3ct2b"><section class="status-grid svelte-d3ct2b"><article class="glass-panel status-card svelte-d3ct2b"><div class="card-head svelte-d3ct2b"><h2 class="svelte-d3ct2b">Project</h2> <span class="svelte-d3ct2b"> </span></div> <div class="data-list svelte-d3ct2b"><div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Name</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Type</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Language</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Architecture</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Watcher</span><strong class="svelte-d3ct2b"> </strong></div> <!></div></article> <article class="glass-panel status-card svelte-d3ct2b"><div class="card-head svelte-d3ct2b"><h2 class="svelte-d3ct2b">Runtime</h2> <span class="svelte-d3ct2b"> </span></div> <div class="data-list svelte-d3ct2b"><div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Provider</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Check model</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Check status</span> <strong><!></strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Embedding</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Ollama URL</span><strong class="svelte-d3ct2b"> </strong></div></div></article> <article class="glass-panel status-card svelte-d3ct2b"><div class="card-head svelte-d3ct2b"><h2 class="svelte-d3ct2b">PostgreSQL</h2> <span> </span></div> <div class="data-list svelte-d3ct2b"><div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Database</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">User</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Host</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">URL</span><strong class="svelte-d3ct2b"> </strong></div></div></article></section> <!> <!> <section class="terminal-panel glass-panel svelte-d3ct2b"><div class="terminal-head svelte-d3ct2b"><div class="svelte-d3ct2b"><span class="terminal-icon svelte-d3ct2b">&gt;_</span> <h2 class="svelte-d3ct2b">Live Feed</h2></div> <div class="window-dots svelte-d3ct2b" aria-hidden="true"><i class="svelte-d3ct2b"></i><i class="svelte-d3ct2b"></i><i class="svelte-d3ct2b"></i></div></div> <div class="terminal-body svelte-d3ct2b"><!> <!></div></section> <section class="content-grid svelte-d3ct2b"><article class="glass-panel stats-panel svelte-d3ct2b"><div class="card-head svelte-d3ct2b"><h2 class="svelte-d3ct2b">Stats</h2> <span class="svelte-d3ct2b">Recorded</span></div> <div class="stat-block svelte-d3ct2b"><h3 class="svelte-d3ct2b">Most Violated Rules</h3> <!></div> <div class="stat-block svelte-d3ct2b"><h3 class="svelte-d3ct2b">Problem Files</h3> <!></div> <div class="summary-strip svelte-d3ct2b"><div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Clean</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Issues</span><strong class="svelte-d3ct2b"> </strong></div> <div class="svelte-d3ct2b"><span class="svelte-d3ct2b">Events</span><strong class="svelte-d3ct2b"> </strong></div></div></article> <article class="glass-panel commit-watch svelte-d3ct2b"><div class="card-head svelte-d3ct2b"><h2 class="svelte-d3ct2b">Commit Watch</h2> <span class="svelte-d3ct2b"> </span></div> <div class="commit-list svelte-d3ct2b"></div></article> <article class="glass-panel rule-engine svelte-d3ct2b"><div class="card-head svelte-d3ct2b"><h2 class="svelte-d3ct2b">Rule Engine</h2> <span class="svelte-d3ct2b"> </span></div> <form class="rule-form svelte-d3ct2b"><div class="control-grid svelte-d3ct2b"><select class="svelte-d3ct2b"><option>Rule</option><option>Decision</option><option>Pattern</option><option>Ignore</option></select> <select class="svelte-d3ct2b"><option>Project</option><option>Global</option></select></div> <textarea rows="3" placeholder="Rule or decision" class="svelte-d3ct2b"></textarea> <div class="control-grid svelte-d3ct2b"><input placeholder="Reason" class="svelte-d3ct2b"/> <input placeholder="Tags" class="svelte-d3ct2b"/></div> <button class="svelte-d3ct2b"> </button></form> <div class="control-grid filters svelte-d3ct2b"><select class="svelte-d3ct2b"><option>All types</option><option>Rules</option><option>Decisions</option><option>Patterns</option><option>Ignores</option></select> <input placeholder="Search rules..." class="svelte-d3ct2b"/></div> <div class="rule-list svelte-d3ct2b"></div></article></section></main></div></div>');function Gc(e,t){ga(t,!1);const r=B(),s=B(),a=B(),i=B(),f=B(),d=B(),c=B(),p=B(),g=B(),x=B(),y=B(),E=B(),b=B();let v=B({config:null,stats:{rules:{},files:{},topRules:[],topFiles:[]},files:[],memories:[]}),m=B([]),A=B(!1),P=B("all"),I=B(""),X=B(!1),ee=B(""),$=B({type:"rule",scope:"project",content:"",reason:"",tags:"dashboard"});const ie=()=>{var o;return((o=n(v).runtime)==null?void 0:o.project.name)??"memory-core"},Ge=()=>{var C,j;const o=((C=n(v).runtime)==null?void 0:C.project.declaredArchitectures)??[],u=((j=n(v).runtime)==null?void 0:j.project.activeArchitectures)??[];return o.length>0?o.join(", "):u.length>0?u.join(", "):"none"};function Ue(o){N(m,[{...o,id:crypto.randomUUID()},...n(m)].slice(0,80))}function le(o){return o.type==="saved"?{type:"saved",timestamp:o.timestamp,file:o.file}:o.type==="clean"?{type:"clean",timestamp:o.timestamp,file:o.file}:o.type==="skipped"?{type:"skipped",timestamp:o.timestamp,file:o.file,reason:o.reason}:o.type==="violations"?{type:"violations",timestamp:o.timestamp,file:o.file,violations:o.violations}:o.type==="error"?{type:"error",timestamp:o.timestamp,message:o.message}:o.type==="ready"?{type:"system",timestamp:o.timestamp,message:`Watching ${o.path} | ${o.rules} rules | ${o.model}`}:{type:"system",timestamp:o.timestamp,message:"Watch stopped"}}function dt(o=[]){N(m,o.map(le).map(u=>({...u,id:crypto.randomUUID()})).reverse().slice(0,80))}function pt(o){return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(o))}function Qt(o){return Math.max(1,...o.map(u=>u.count))}function Xt(o,u){const C=o.file||u;return o.line?`${C}:${o.line}`:C}function Er(o){return o.type==="saved"?"SAVE":o.type==="clean"?"OK":o.type==="skipped"?"SKIP":o.type==="violations"?"FAIL":o.type==="error"?"WARN":"SYS"}async function Ot(){const o=await fetch("/api/snapshot");N(v,await o.json()),dt(n(v).events)}function Zt(){const o=location.protocol==="https:"?"wss:":"ws:",u=new WebSocket(`${o}//${location.host}/ws`);u.addEventListener("open",()=>{N(A,!0),Ue({type:"system",timestamp:new Date().toISOString(),message:"Dashboard connected"})}),u.addEventListener("close",()=>{N(A,!1),Ue({type:"error",timestamp:new Date().toISOString(),message:"Dashboard disconnected"}),setTimeout(Zt,1500)}),u.addEventListener("message",C=>{const j=JSON.parse(C.data);if(j.type==="snapshot"){N(v,j.snapshot),n(m).length===0&&dt(n(v).events);return}j.type==="watch"&&Ue(le(j.event))})}async function xr(){if(n($).content.trim()){N(X,!0),N(ee,"");try{const o=await fetch("/api/memories",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(n($))});if(!o.ok)throw new Error((await o.json()).error??"Save failed");N($,{type:"rule",scope:"project",content:"",reason:"",tags:"dashboard"}),await Ot()}catch(o){N(ee,o.message)}finally{N(X,!1)}}}async function Oe(o){N(ee,"");const u=await fetch(`/api/memories/${o}`,{method:"DELETE"});if(!u.ok){N(ee,(await u.json()).error??"Delete failed");return}await Ot()}Ot().catch(o=>{N(ee,o.message)}),Zt(),ge(()=>(n(v),n(P),n(I)),()=>{N(r,n(v).memories.filter(o=>{const u=n(P)==="all"||o.type===n(P),C=`${o.type} ${o.scope} ${o.content} ${o.reason??""} ${o.tags.join(" ")}`.toLowerCase();return u&&C.includes(n(I).toLowerCase())}))}),ge(()=>n(v),()=>{N(s,n(v).files.reduce((o,u)=>o+u.violations.length,0))}),ge(()=>n(v),()=>{N(a,n(v).files.filter(o=>o.status==="clean").length)}),ge(()=>n(v),()=>{N(i,n(v).files.filter(o=>o.status==="violations").length)}),ge(()=>n(v),()=>{N(f,Object.values(n(v).stats.rules).reduce((o,u)=>o+u,0))}),ge(()=>n(v),()=>{N(d,n(v).stats.recentViolations??[])}),ge(()=>n(d),()=>{N(c,n(d).filter(o=>o.source==="hook"||o.source==="ci"))}),ge(()=>(n(s),n(c)),()=>{N(p,n(s)+n(c).length)}),ge(()=>(n(v),n(c)),()=>{N(g,new Set([...n(v).files.map(o=>o.file),...n(c).map(o=>o.file).filter(Boolean)]).size)}),ge(()=>n(v),()=>{N(x,n(v).memories.filter(o=>["rule","pattern","decision"].includes(o.type)).length)}),ge(()=>n(v),()=>{var o;N(y,((o=n(v).memoryCount)==null?void 0:o.total)??n(v).memories.length)}),ge(()=>n(v),()=>{var o;N(E,((o=n(v).memoryCount)==null?void 0:o.relevant)??n(v).memories.length)}),ge(()=>(n(A),n(v)),()=>{var o,u;N(b,n(A)?((o=n(v).watcher)==null?void 0:o.enabled)===!1?{live:!1,label:"Watch off"}:(u=n(v).watcher)!=null&&u.running?{live:!0,label:"Watcher live"}:{live:!1,label:"Watcher idle"}:{live:!1,label:"Disconnected"})}),Uo(),wc();var er=Yc(),Is=_(er),Qa=h(_(Is),4),Vr=_(Qa);let Ls;var Xa=h(_(Vr)),Za=h(Vr,2),ei=_(Za),ti=h(Is,2),Ps=_(ti),$s=_(Ps),js=h(_($s),2);let Ws;var ri=h(_(js),2),si=_(ri),ni=h($s,2),qs=_(ni),ai=h(_(qs),2),ii=_(ai),Us=h(qs,2),li=h(_(Us),2),oi=_(li),ci=h(Us,2),fi=h(_(ci),2),ui=_(fi),vi=h(Ps,2),Vs=_(vi),zs=_(Vs),Hs=_(zs),di=h(_(Hs),2),pi=_(di),_i=h(Hs,2),Bs=_(_i),hi=h(_(Bs)),gi=_(hi),Ks=h(Bs,2),bi=h(_(Ks)),mi=_(bi),Ys=h(Ks,2),wi=h(_(Ys)),yi=_(wi),Gs=h(Ys,2),Ei=h(_(Gs)),xi=_(Ei),Js=h(Gs,2),ki=h(_(Js)),Si=_(ki),Ti=h(Js,2);{var Ai=o=>{var u=Ec(),C=h(_(u)),j=_(C);V(()=>k(j,(n(v),w(()=>n(v).watcher.error)))),F(o,u)};ue(Ti,o=>{n(v),w(()=>{var u;return(u=n(v).watcher)==null?void 0:u.error})&&o(Ai)})}var Qs=h(zs,2),Xs=_(Qs),Ri=h(_(Xs),2),Ci=_(Ri),Ni=h(Xs,2),Zs=_(Ni),Mi=h(_(Zs)),Di=_(Mi),en=h(Zs,2),Oi=h(_(en)),Fi=_(Oi),tn=h(en,2),rn=h(_(tn),2);let sn;var Ii=_(rn);{var Li=o=>{var u=ta();V(()=>k(u,(n(v),w(()=>{var C;return(C=n(v).runtime)!=null&&C.model.checkModelInstalled?"installed":"missing"})))),F(o,u)},Pi=o=>{var u=ta();V(()=>k(u,(n(v),w(()=>{var C;return(C=n(v).runtime)!=null&&C.model.apiKeyConfigured?"api key set":"api key missing"})))),F(o,u)};ue(Ii,o=>{n(v),w(()=>{var u;return((u=n(v).runtime)==null?void 0:u.model.provider)==="ollama"})?o(Li):o(Pi,-1)})}var nn=h(tn,2),$i=h(_(nn)),ji=_($i),Wi=h(nn,2),qi=h(_(Wi)),Ui=_(qi),Vi=h(Qs,2),an=_(Vi),ln=h(_(an),2);let on;var zi=_(ln),Hi=h(an,2),cn=_(Hi),Bi=h(_(cn)),Ki=_(Bi),fn=h(cn,2),Yi=h(_(fn)),Gi=_(Yi),un=h(fn,2),Ji=h(_(un)),Qi=_(Ji),Xi=h(un,2),Zi=h(_(Xi)),el=_(Zi),vn=h(Vs,2);{var tl=o=>{var u=xc(),C=_(u);V(()=>k(C,(n(v),w(()=>n(v).dbError)))),F(o,u)};ue(vn,o=>{n(v),w(()=>n(v).dbError)&&o(tl)})}var dn=h(vn,2);{var rl=o=>{var u=kc(),C=_(u);V(()=>k(C,n(ee))),F(o,u)};ue(dn,o=>{n(ee)&&o(rl)})}var pn=h(dn,2),sl=h(_(pn),2),_n=_(sl);{var nl=o=>{var u=Sc();F(o,u)};ue(_n,o=>{n(m),w(()=>n(m).length===0)&&o(nl)})}var al=h(_n,2);Pt(al,1,()=>(n(m),w(()=>[...n(m)].reverse())),o=>o.id,(o,u)=>{var C=Lc();let j;var te=_(C),fe=_(te),Ee=_(fe),_e=h(fe,2),S=_(_e),q=h(_e,2);{var Je=L=>{var z=Tc(),Fe=_(z);V(()=>k(Fe,(n(u),w(()=>n(u).message)))),F(L,z)},tr=L=>{var z=Ac(),Fe=_(z);V(()=>k(Fe,`saved: ${n(u),w(()=>n(u).file)??""}`)),F(L,z)},Ft=L=>{var z=Rc(),Fe=_(z);V(()=>k(Fe,`${n(u),w(()=>n(u).file)??""} - no violations`)),F(L,z)},It=L=>{var z=Cc(),Fe=_(z);V(()=>k(Fe,`${n(u),w(()=>n(u).file)??""} - skipped: ${n(u),w(()=>n(u).reason)??""}`)),F(L,z)},Qe=L=>{var z=Nc(),Fe=_(z);V(()=>k(Fe,`${n(u),w(()=>n(u).violations.length)??""} violation${n(u),w(()=>n(u).violations.length===1?"":"s")??""} in ${n(u),w(()=>n(u).file)??""}`)),F(L,z)};ue(q,L=>{n(u),w(()=>n(u).type==="system"||n(u).type==="error")?L(Je):(n(u),w(()=>n(u).type==="saved")?L(tr,1):(n(u),w(()=>n(u).type==="clean")?L(Ft,2):(n(u),w(()=>n(u).type==="skipped")?L(It,3):L(Qe,-1))))})}var Lt=h(te,2);{var he=L=>{var z=sc(),Fe=Fo(z);Pt(Fe,3,()=>(n(u),w(()=>n(u).violations)),(Fn,H)=>`${n(u).id}-${H}`,(Fn,H,Al)=>{var In=Ic(),Ln=_(In),Rl=_(Ln),Pn=h(Ln,2),Cl=h(_(Pn)),$n=h(Pn,2);{var Nl=re=>{var Ie=Mc(),_t=h(_(Ie));V(()=>k(_t,` ${n(H),w(()=>n(H).reason)??""}`)),F(re,Ie)};ue($n,re=>{n(H),w(()=>n(H).reason)&&re(Nl)})}var jn=h($n,2);{var Ml=re=>{var Ie=Dc(),_t=h(_(Ie));V(()=>k(_t,` ${n(H),w(()=>n(H).issue)??""}`)),F(re,Ie)};ue(jn,re=>{n(H),w(()=>n(H).issue)&&re(Ml)})}var Wn=h(jn,2);{var Dl=re=>{var Ie=Oc(),_t=h(_(Ie));V(()=>k(_t,` ${n(H),w(()=>n(H).suggestion)??""}`)),F(re,Ie)};ue(Wn,re=>{n(H),w(()=>n(H).suggestion)&&re(Dl)})}var Ol=h(Wn,2);{var Fl=re=>{var Ie=Fc(),_t=_(Ie);V(()=>k(_t,(n(H),w(()=>n(H).code)))),F(re,Ie)};ue(Ol,re=>{n(H),w(()=>n(H).code)&&re(Fl)})}V(re=>{k(Rl,`[${n(Al)+1}] ${re??""}`),k(Cl,` ${n(H),w(()=>n(H).rule)??""}`)},[()=>(n(H),n(u),w(()=>Xt(n(H),n(u).file)))]),F(Fn,In)}),F(L,z)};ue(Lt,L=>{n(u),w(()=>n(u).type==="violations")&&L(he)})}V((L,z)=>{j=nr(C,1,"svelte-d3ct2b",null,j,{"error-line":n(u).type==="error","ok-line":n(u).type==="clean","violation-line":n(u).type==="violations"}),k(Ee,L),k(S,z)},[()=>(n(u),w(()=>pt(n(u).timestamp))),()=>(n(u),w(()=>Er(n(u))))]),F(o,C)});var il=h(pn,2),hn=_(il),gn=h(_(hn),2),ll=h(_(gn),2);Pt(ll,1,()=>(n(v),w(()=>n(v).stats.topRules.slice(0,5))),o=>o.name,(o,u)=>{var C=Pc(),j=_(C),te=_(j),fe=_(te),Ee=h(te,2),_e=_(Ee),S=h(j,2);V(q=>{k(fe,(n(u),w(()=>n(u).name))),k(_e,(n(u),w(()=>n(u).count))),na(S,q)},[()=>(n(u),n(v),w(()=>`width: ${n(u).count/Qt(n(v).stats.topRules)*100}%`))]),F(o,C)},o=>{var u=$c();F(o,u)});var bn=h(gn,2),ol=h(_(bn),2);Pt(ol,1,()=>(n(v),w(()=>n(v).stats.topFiles.slice(0,5))),o=>o.name,(o,u)=>{var C=jc(),j=_(C),te=_(j),fe=_(te),Ee=h(te,2),_e=_(Ee),S=h(j,2);V(q=>{k(fe,(n(u),w(()=>n(u).name))),k(_e,(n(u),w(()=>n(u).count))),na(S,q)},[()=>(n(u),n(v),w(()=>`width: ${n(u).count/Qt(n(v).stats.topFiles)*100}%`))]),F(o,C)},o=>{var u=Wc();F(o,u)});var cl=h(bn,2),mn=_(cl),fl=h(_(mn)),ul=_(fl),wn=h(mn,2),vl=h(_(wn)),dl=_(vl),pl=h(wn,2),_l=h(_(pl)),hl=_(_l),yn=h(hn,2),En=_(yn),gl=h(_(En),2),bl=_(gl),ml=h(En,2);Pt(ml,7,()=>(n(c),w(()=>n(c).slice(0,8))),(o,u)=>`${o.timestamp}-${u}`,(o,u)=>{var C=Vc(),j=_(C),te=_(j),fe=_(te),Ee=h(te,2),_e=_(Ee),S=h(j,2),q=_(S),Je=h(S,2),tr=_(Je),Ft=h(Je,2);{var It=he=>{var L=qc(),z=_(L);V(()=>k(z,(n(u),w(()=>n(u).issue)))),F(he,L)};ue(Ft,he=>{n(u),w(()=>n(u).issue)&&he(It)})}var Qe=h(Ft,2);{var Lt=he=>{var L=Uc(),z=_(L);V(()=>k(z,(n(u),w(()=>n(u).suggestion)))),F(he,L)};ue(Qe,he=>{n(u),w(()=>n(u).suggestion)&&he(Lt)})}V((he,L)=>{k(fe,(n(u),w(()=>n(u).source==="ci"?"CI":"Hook"))),k(_e,he),k(q,(n(u),w(()=>n(u).rule))),k(tr,L)},[()=>(n(u),w(()=>pt(n(u).timestamp))),()=>(n(u),w(()=>Xt(n(u),n(u).file||"staged diff")))]),F(o,C)},o=>{var u=zc();F(o,u)});var wl=h(yn,2),xn=_(wl),yl=h(_(xn),2),El=_(yl),zr=h(xn,2),kn=_(zr),Hr=_(kn),Br=_(Hr);Br.value=Br.__value="rule";var Kr=h(Br);Kr.value=Kr.__value="decision";var Yr=h(Kr);Yr.value=Yr.__value="pattern";var Sn=h(Yr);Sn.value=Sn.__value="ignore";var Tn=h(Hr,2),Gr=_(Tn);Gr.value=Gr.__value="project";var An=h(Gr);An.value=An.__value="global";var Rn=h(kn,2),Cn=h(Rn,2),Nn=_(Cn),xl=h(Nn,2),Mn=h(Cn,2),kl=_(Mn),Dn=h(zr,2),Jr=_(Dn),Qr=_(Jr);Qr.value=Qr.__value="all";var Xr=h(Qr);Xr.value=Xr.__value="rule";var Zr=h(Xr);Zr.value=Zr.__value="decision";var es=h(Zr);es.value=es.__value="pattern";var On=h(es);On.value=On.__value="ignore";var Sl=h(Jr,2),Tl=h(Dn,2);Pt(Tl,5,()=>n(r),o=>o.id,(o,u)=>{var C=Bc(),j=_(C),te=_(j),fe=_(te),Ee=_(fe),_e=h(fe,2),S=_(_e),q=h(te,2),Je=_(q),tr=h(q,2);{var Ft=Qe=>{var Lt=Hc(),he=_(Lt);V(()=>k(he,(n(u),w(()=>n(u).reason)))),F(Qe,Lt)};ue(tr,Qe=>{n(u),w(()=>n(u).reason)&&Qe(Ft)})}var It=h(j,2);V(Qe=>{k(Ee,(n(u),w(()=>n(u).scope))),k(S,`Rule-${Qe??""}`),k(Je,(n(u),w(()=>n(u).content))),hc(It,"aria-label",(n(u),w(()=>`Delete ${n(u).id}`)))},[()=>(n(u),w(()=>String(n(u).id).padStart(3,"0")))]),Zn("click",It,()=>Oe(n(u).id)),F(o,C)},o=>{var u=Kc();F(o,u)}),V((o,u,C)=>{var j,te,fe,Ee,_e;Ls=nr(Vr,1,"status-chip svelte-d3ct2b",null,Ls,{live:n(b).live}),k(Xa,` ${n(b),w(()=>n(b).label)??""}`),k(ei,(n(v),w(()=>{var S;return((S=n(v).runtime)==null?void 0:S.model.label)??"runtime pending"}))),Ws=nr(js,1,"live-label svelte-d3ct2b",null,Ws,{live:n(b).live}),k(si,(n(b),w(()=>n(b).label))),k(ii,n(p)),k(oi,n(g)),k(ui,n(x)),k(pi,(n(v),w(()=>{var S;return(S=n(v).runtime)!=null&&S.project.initialized?"Initialized":"Not initialized"}))),k(gi,o),k(mi,(n(v),w(()=>{var S;return((S=n(v).runtime)==null?void 0:S.project.type)??"unknown"}))),k(yi,(n(v),w(()=>{var S;return((S=n(v).runtime)==null?void 0:S.project.language)??"unknown"}))),k(xi,u),k(Si,(n(v),w(()=>{var S,q;return((S=n(v).watcher)==null?void 0:S.enabled)===!1?"disabled":(q=n(v).watcher)!=null&&q.running?"running":"idle"}))),k(Ci,(n(v),w(()=>{var S;return((S=n(v).runtime)==null?void 0:S.model.label)??"pending"}))),k(Di,(n(v),w(()=>{var S;return((S=n(v).runtime)==null?void 0:S.model.provider)??"unknown"}))),k(Fi,(n(v),w(()=>{var S,q,Je;return((S=n(v).runtime)==null?void 0:S.model.checkModelResolved)??((q=n(v).runtime)==null?void 0:q.model.checkModel)??((Je=n(v).runtime)==null?void 0:Je.model.chatModel)??"unknown"}))),sn=nr(rn,1,"svelte-d3ct2b",null,sn,{"status-ok":((j=n(v).runtime)==null?void 0:j.model.checkModelInstalled)||((te=n(v).runtime)==null?void 0:te.model.apiKeyConfigured),"status-warn":((fe=n(v).runtime)==null?void 0:fe.model.checkModelInstalled)===!1||((Ee=n(v).runtime)==null?void 0:Ee.model.error)}),k(ji,(n(v),w(()=>{var S,q;return((S=n(v).runtime)==null?void 0:S.model.embeddingModelResolved)??((q=n(v).runtime)==null?void 0:q.model.embeddingModel)??"unknown"}))),k(Ui,(n(v),w(()=>{var S;return((S=n(v).runtime)==null?void 0:S.model.ollamaUrl)??"unknown"}))),on=nr(ln,1,"svelte-d3ct2b",null,on,{success:(_e=n(v).runtime)==null?void 0:_e.postgres.connected}),k(zi,(n(v),w(()=>{var S;return(S=n(v).runtime)!=null&&S.postgres.connected?"Connected":"Not connected"}))),k(Ki,(n(v),w(()=>{var S,q;return((S=n(v).runtime)==null?void 0:S.postgres.serverDatabase)??((q=n(v).runtime)==null?void 0:q.postgres.database)??"unknown"}))),k(Gi,(n(v),w(()=>{var S,q;return((S=n(v).runtime)==null?void 0:S.postgres.serverUser)??((q=n(v).runtime)==null?void 0:q.postgres.user)??"unknown"}))),k(Qi,`${n(v),w(()=>{var S;return((S=n(v).runtime)==null?void 0:S.postgres.host)??"unknown"})??""}${n(v),w(()=>{var S;return(S=n(v).runtime)!=null&&S.postgres.port?`:${n(v).runtime.postgres.port}`:""})??""}`),k(el,(n(v),w(()=>{var S;return((S=n(v).runtime)==null?void 0:S.postgres.url)??"(not set)"}))),k(ul,n(a)),k(dl,n(p)),k(hl,n(f)),k(bl,`${n(c),w(()=>n(c).length)??""} recent`),k(El,`${n(x)??""} rules active`),Mn.disabled=C,k(kl,n(X)?"Saving...":"Add New Architecture Rule")},[()=>w(ie),()=>w(Ge),()=>(n(X),n($),w(()=>n(X)||!n($).content.trim()))]),ns(Hr,()=>n($).type,o=>rr($,n($).type=o)),ns(Tn,()=>n($).scope,o=>rr($,n($).scope=o)),Tr(Rn,()=>n($).content,o=>rr($,n($).content=o)),Tr(Nn,()=>n($).reason,o=>rr($,n($).reason=o)),Tr(xl,()=>n($).tags,o=>rr($,n($).tags=o)),Zn("submit",zr,mc(xr)),ns(Jr,()=>n(P),o=>N(P,o)),Tr(Sl,()=>n(I),o=>N(I,o)),F(e,er),ba()}nc(Gc,{target:document.getElementById("app")});
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- closePool,
4
- deleteMemories,
5
- deleteMemory,
6
- getMemory,
7
- getPool,
8
- hashMemoryContent,
9
- listMemories,
10
- runMigrations,
11
- saveMemory,
12
- searchMemories,
13
- updateMemory,
14
- upsertMemory
15
- } from "./chunk-WUL7HLAA.js";
16
- import "./chunk-KSLFLWB4.js";
17
- export {
18
- closePool,
19
- deleteMemories,
20
- deleteMemory,
21
- getMemory,
22
- getPool,
23
- hashMemoryContent,
24
- listMemories,
25
- runMigrations,
26
- saveMemory,
27
- searchMemories,
28
- updateMemory,
29
- upsertMemory
30
- };
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- embed
4
- } from "./chunk-HAGRPKR3.js";
5
- import "./chunk-KSLFLWB4.js";
6
- export {
7
- embed
8
- };