@sken-ds/primitives 0.3.0 → 0.3.4

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.
@@ -0,0 +1,1563 @@
1
+ import { t as e } from "./decorate-D4FKzyDw.js";
2
+ import { a as t, n, r, t as i } from "./directive-BcLtPdVO.js";
3
+ import { LitElement as a, css as o, html as s, noChange as c, nothing as l } from "lit";
4
+ import { customElement as u, property as d } from "lit/decorators.js";
5
+ import { constructTable as f, createColumnHelper as ee } from "@tanstack/table-core";
6
+ import * as te from "@tanstack/table-core/static-functions";
7
+ import { table_publishExternalState as ne, table_setOptions as re } from "@tanstack/table-core/static-functions";
8
+ //#region \0rolldown/runtime.js
9
+ var p = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, ae = Object.getOwnPropertyNames, m = Object.prototype.hasOwnProperty, h = (e, t) => {
10
+ let n = {};
11
+ for (var r in e) p(n, r, {
12
+ get: e[r],
13
+ enumerable: !0
14
+ });
15
+ return t || p(n, Symbol.toStringTag, { value: "Module" }), n;
16
+ }, g = (e, t, n, r) => {
17
+ if (t && typeof t == "object" || typeof t == "function") for (var i = ae(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !m.call(e, s) && s !== n && p(e, s, {
18
+ get: ((e) => t[e]).bind(null, s),
19
+ enumerable: !(r = ie(t, s)) || r.enumerable
20
+ });
21
+ return e;
22
+ }, oe = (e, t, n) => (g(e, t, "default"), n && g(n, t, "default"));
23
+ //#endregion
24
+ //#region ../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/flexRender.js
25
+ function _(e, t) {
26
+ return e == null ? null : typeof e == "function" ? e(t) : e;
27
+ }
28
+ function v(e) {
29
+ if ("cell" in e && e.cell) {
30
+ let t = e.cell, n = t.column.columnDef, r = t, i = n;
31
+ return r.getIsAggregated?.() ? _(i.aggregatedCell ?? n.cell, t.getContext()) : r.getIsPlaceholder?.() ? null : _(n.cell, t.getContext());
32
+ }
33
+ return "header" in e && e.header ? _(e.header.column.columnDef.header, e.header.getContext()) : "footer" in e && e.footer ? _(e.footer.column.columnDef.footer, e.footer.getContext()) : null;
34
+ }
35
+ //#endregion
36
+ //#region ../../node_modules/.pnpm/@tanstack+lit-store@0.14.0_lit@3.3.3/node_modules/@tanstack/lit-store/dist/tan-stack-store-selector.js
37
+ function se(e, t) {
38
+ return e === t;
39
+ }
40
+ function ce(e) {
41
+ return e;
42
+ }
43
+ var le = class {
44
+ #e;
45
+ #t;
46
+ #n;
47
+ #r;
48
+ #i;
49
+ #a;
50
+ #o = !1;
51
+ #s;
52
+ constructor(e, t, n = ce, r) {
53
+ this.#e = e, this.#t = t, this.#n = n, this.#r = r?.compare ?? se, e.addController(this);
54
+ }
55
+ get value() {
56
+ return this.#s;
57
+ }
58
+ hostUpdate() {
59
+ let e = this.#t();
60
+ if (e !== this.#a) {
61
+ if (this.#i?.(), this.#a = e, !e) {
62
+ this.#i = void 0, this.#o = !1, this.#s = void 0;
63
+ return;
64
+ }
65
+ this.#s = this.#n(e.get()), this.#o = !0, this.#i = e.subscribe((e) => {
66
+ let t = this.#n(e);
67
+ this.#o && this.#r(this.#s, t) || (this.#s = t, this.#o = !0, this.#e.requestUpdate());
68
+ }).unsubscribe;
69
+ }
70
+ }
71
+ hostDisconnected() {
72
+ this.#i?.(), this.#i = void 0, this.#a = void 0, this.#o = !1, this.#s = void 0;
73
+ }
74
+ }, y = /* @__PURE__ */ function(e) {
75
+ return e[e.None = 0] = "None", e[e.Mutable = 1] = "Mutable", e[e.Watching = 2] = "Watching", e[e.RecursedCheck = 4] = "RecursedCheck", e[e.Recursed = 8] = "Recursed", e[e.Dirty = 16] = "Dirty", e[e.Pending = 32] = "Pending", e;
76
+ }({});
77
+ /* @__NO_SIDE_EFFECTS__ */
78
+ function ue({ update: e, notify: t, unwatched: n }) {
79
+ return {
80
+ link: r,
81
+ unlink: i,
82
+ propagate: a,
83
+ checkDirty: o,
84
+ shallowPropagate: s
85
+ };
86
+ function r(e, t, n) {
87
+ let r = t.depsTail;
88
+ if (r !== void 0 && r.dep === e) return;
89
+ let i = r === void 0 ? t.deps : r.nextDep;
90
+ if (i !== void 0 && i.dep === e) {
91
+ i.version = n, t.depsTail = i;
92
+ return;
93
+ }
94
+ let a = e.subsTail;
95
+ if (a !== void 0 && a.version === n && a.sub === t) return;
96
+ let o = t.depsTail = e.subsTail = {
97
+ version: n,
98
+ dep: e,
99
+ sub: t,
100
+ prevDep: r,
101
+ nextDep: i,
102
+ prevSub: a,
103
+ nextSub: void 0
104
+ };
105
+ i !== void 0 && (i.prevDep = o), r === void 0 ? t.deps = o : r.nextDep = o, a === void 0 ? e.subs = o : a.nextSub = o;
106
+ }
107
+ function i(e, t = e.sub) {
108
+ let r = e.dep, i = e.prevDep, a = e.nextDep, o = e.nextSub, s = e.prevSub;
109
+ return a === void 0 ? t.depsTail = i : a.prevDep = i, i === void 0 ? t.deps = a : i.nextDep = a, o === void 0 ? r.subsTail = s : o.prevSub = s, s === void 0 ? (r.subs = o) === void 0 && n(r) : s.nextSub = o, a;
110
+ }
111
+ function a(e) {
112
+ let n = e.nextSub, r;
113
+ top: do {
114
+ let i = e.sub, a = i.flags;
115
+ if (a & (y.RecursedCheck | y.Recursed | y.Dirty | y.Pending) ? a & (y.RecursedCheck | y.Recursed) ? a & y.RecursedCheck ? !(a & (y.Dirty | y.Pending)) && c(e, i) ? (i.flags = a | (y.Recursed | y.Pending), a &= y.Mutable) : a = y.None : i.flags = a & ~y.Recursed | y.Pending : a = y.None : i.flags = a | y.Pending, a & y.Watching && t(i), a & y.Mutable) {
116
+ let t = i.subs;
117
+ if (t !== void 0) {
118
+ let i = (e = t).nextSub;
119
+ i !== void 0 && (r = {
120
+ value: n,
121
+ prev: r
122
+ }, n = i);
123
+ continue;
124
+ }
125
+ }
126
+ if ((e = n) !== void 0) {
127
+ n = e.nextSub;
128
+ continue;
129
+ }
130
+ for (; r !== void 0;) if (e = r.value, r = r.prev, e !== void 0) {
131
+ n = e.nextSub;
132
+ continue top;
133
+ }
134
+ break;
135
+ } while (!0);
136
+ }
137
+ function o(t, n) {
138
+ let r, i = 0, a = !1;
139
+ top: do {
140
+ let o = t.dep, c = o.flags;
141
+ if (n.flags & y.Dirty) a = !0;
142
+ else if ((c & (y.Mutable | y.Dirty)) === (y.Mutable | y.Dirty)) {
143
+ if (e(o)) {
144
+ let e = o.subs;
145
+ e.nextSub !== void 0 && s(e), a = !0;
146
+ }
147
+ } else if ((c & (y.Mutable | y.Pending)) === (y.Mutable | y.Pending)) {
148
+ (t.nextSub !== void 0 || t.prevSub !== void 0) && (r = {
149
+ value: t,
150
+ prev: r
151
+ }), t = o.deps, n = o, ++i;
152
+ continue;
153
+ }
154
+ if (!a) {
155
+ let e = t.nextDep;
156
+ if (e !== void 0) {
157
+ t = e;
158
+ continue;
159
+ }
160
+ }
161
+ for (; i--;) {
162
+ let i = n.subs, o = i.nextSub !== void 0;
163
+ if (o ? (t = r.value, r = r.prev) : t = i, a) {
164
+ if (e(n)) {
165
+ o && s(i), n = t.sub;
166
+ continue;
167
+ }
168
+ a = !1;
169
+ } else n.flags &= ~y.Pending;
170
+ n = t.sub;
171
+ let c = t.nextDep;
172
+ if (c !== void 0) {
173
+ t = c;
174
+ continue top;
175
+ }
176
+ }
177
+ return a;
178
+ } while (!0);
179
+ }
180
+ function s(e) {
181
+ do {
182
+ let n = e.sub, r = n.flags;
183
+ (r & (y.Pending | y.Dirty)) === y.Pending && (n.flags = r | y.Dirty, (r & (y.Watching | y.RecursedCheck)) === y.Watching && t(n));
184
+ } while ((e = e.nextSub) !== void 0);
185
+ }
186
+ function c(e, t) {
187
+ let n = t.depsTail;
188
+ for (; n !== void 0;) {
189
+ if (n === e) return !0;
190
+ n = n.prevDep;
191
+ }
192
+ return !1;
193
+ }
194
+ }
195
+ //#endregion
196
+ //#region ../../node_modules/.pnpm/@tanstack+store@0.11.0/node_modules/@tanstack/store/dist/atom.js
197
+ function de(e, t, n) {
198
+ let r = typeof e == "object", i = r ? e : void 0;
199
+ return {
200
+ next: (r ? e.next : e)?.bind(i),
201
+ error: (r ? e.error : t)?.bind(i),
202
+ complete: (r ? e.complete : n)?.bind(i)
203
+ };
204
+ }
205
+ var b = [], x = 0, { link: S, unlink: C, propagate: w, checkDirty: T, shallowPropagate: E } = /* @__PURE__ */ ue({
206
+ update(e) {
207
+ return e._update();
208
+ },
209
+ notify(e) {
210
+ b[O++] = e, e.flags &= ~y.Watching;
211
+ },
212
+ unwatched(e) {
213
+ e.depsTail !== void 0 && (e.depsTail = void 0, e.flags = y.Mutable | y.Dirty, j(e));
214
+ }
215
+ }), D = 0, O = 0, k, A = 0;
216
+ function fe(e) {
217
+ try {
218
+ ++A, e();
219
+ } finally {
220
+ --A || M();
221
+ }
222
+ }
223
+ function j(e) {
224
+ let t = e.depsTail, n = t === void 0 ? e.deps : t.nextDep;
225
+ for (; n !== void 0;) n = C(n, e);
226
+ }
227
+ function M() {
228
+ if (!(A > 0)) {
229
+ for (; D < O;) {
230
+ let e = b[D];
231
+ b[D++] = void 0, e.notify();
232
+ }
233
+ D = 0, O = 0;
234
+ }
235
+ }
236
+ function pe(e, t) {
237
+ let n = typeof e == "function", r = e, i = {
238
+ _snapshot: n ? void 0 : e,
239
+ subs: void 0,
240
+ subsTail: void 0,
241
+ deps: void 0,
242
+ depsTail: void 0,
243
+ flags: n ? y.None : y.Mutable,
244
+ get() {
245
+ return k !== void 0 && S(i, k, x), i._snapshot;
246
+ },
247
+ subscribe(e) {
248
+ let t = de(e), n = { current: !1 }, r = me(() => {
249
+ i.get(), n.current ? t.next?.(i._snapshot) : n.current = !0;
250
+ });
251
+ return { unsubscribe: () => {
252
+ r.stop();
253
+ } };
254
+ },
255
+ _update(e) {
256
+ let a = k, o = t?.compare ?? Object.is;
257
+ if (n) k = i, ++x, i.depsTail = void 0;
258
+ else if (e === void 0) return !1;
259
+ n && (i.flags = y.Mutable | y.RecursedCheck);
260
+ try {
261
+ let t = i._snapshot, a = typeof e == "function" ? e(t) : e === void 0 && n ? r(t) : e;
262
+ return t === void 0 || !o(t, a) ? (i._snapshot = a, !0) : !1;
263
+ } finally {
264
+ k = a, n && (i.flags &= ~y.RecursedCheck), j(i);
265
+ }
266
+ }
267
+ };
268
+ return n ? (i.flags = y.Mutable | y.Dirty, i.get = function() {
269
+ let e = i.flags;
270
+ if (e & y.Dirty || e & y.Pending && T(i.deps, i)) {
271
+ if (i._update()) {
272
+ let e = i.subs;
273
+ e !== void 0 && E(e);
274
+ }
275
+ } else e & y.Pending && (i.flags = e & ~y.Pending);
276
+ return k !== void 0 && S(i, k, x), i._snapshot;
277
+ }) : i.set = function(e) {
278
+ if (i._update(e)) {
279
+ let e = i.subs;
280
+ e !== void 0 && (w(e), E(e), M());
281
+ }
282
+ }, i;
283
+ }
284
+ function me(e) {
285
+ let t = () => {
286
+ let t = k;
287
+ k = n, ++x, n.depsTail = void 0, n.flags = y.Watching | y.RecursedCheck;
288
+ try {
289
+ return e();
290
+ } finally {
291
+ k = t, n.flags &= ~y.RecursedCheck, j(n);
292
+ }
293
+ }, n = {
294
+ deps: void 0,
295
+ depsTail: void 0,
296
+ subs: void 0,
297
+ subsTail: void 0,
298
+ flags: y.Watching | y.RecursedCheck,
299
+ notify() {
300
+ let e = this.flags;
301
+ e & y.Dirty || e & y.Pending && T(this.deps, this) ? t() : this.flags = y.Watching;
302
+ },
303
+ stop() {
304
+ this.flags = y.None, this.depsTail = void 0, j(this);
305
+ }
306
+ };
307
+ return t(), n;
308
+ }
309
+ //#endregion
310
+ //#region ../../node_modules/.pnpm/@tanstack+store@0.11.0/node_modules/@tanstack/store/dist/shallow.js
311
+ function N(e, t) {
312
+ if (Object.is(e, t)) return !0;
313
+ if (typeof e != "object" || !e || typeof t != "object" || !t) return !1;
314
+ if (e instanceof Map && t instanceof Map) {
315
+ if (e.size !== t.size) return !1;
316
+ for (let [n, r] of e) if (!t.has(n) || !Object.is(r, t.get(n))) return !1;
317
+ return !0;
318
+ }
319
+ if (e instanceof Set && t instanceof Set) {
320
+ if (e.size !== t.size) return !1;
321
+ for (let n of e) if (!t.has(n)) return !1;
322
+ return !0;
323
+ }
324
+ if (e instanceof Date && t instanceof Date) return e.getTime() === t.getTime();
325
+ let n = P(e);
326
+ if (n.length !== P(t).length) return !1;
327
+ for (let r = 0; r < n.length; r++) if (!Object.prototype.hasOwnProperty.call(t, n[r]) || !Object.is(e[n[r]], t[n[r]])) return !1;
328
+ return !0;
329
+ }
330
+ function P(e) {
331
+ return Object.keys(e).concat(Object.getOwnPropertySymbols(e));
332
+ }
333
+ //#endregion
334
+ //#region ../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directive-helpers.js
335
+ var { I: he } = t, F = (e) => e.strings === void 0, I = (e, t) => {
336
+ let n = e._$AN;
337
+ if (n === void 0) return !1;
338
+ for (let e of n) e._$AO?.(t, !1), I(e, t);
339
+ return !0;
340
+ }, L = (e) => {
341
+ let t, n;
342
+ do {
343
+ if ((t = e._$AM) === void 0) break;
344
+ n = t._$AN, n.delete(e), e = t;
345
+ } while (n?.size === 0);
346
+ }, R = (e) => {
347
+ for (let t; t = e._$AM; e = t) {
348
+ let n = t._$AN;
349
+ if (n === void 0) t._$AN = n = /* @__PURE__ */ new Set();
350
+ else if (n.has(e)) break;
351
+ n.add(e), _e(t);
352
+ }
353
+ };
354
+ function z(e) {
355
+ this._$AN === void 0 ? this._$AM = e : (L(this), this._$AM = e, R(this));
356
+ }
357
+ function ge(e, t = !1, n = 0) {
358
+ let r = this._$AH, i = this._$AN;
359
+ if (i !== void 0 && i.size !== 0) if (t) if (Array.isArray(r)) for (let e = n; e < r.length; e++) I(r[e], !1), L(r[e]);
360
+ else r != null && (I(r, !1), L(r));
361
+ else I(this, e);
362
+ }
363
+ var _e = (e) => {
364
+ e.type == r.CHILD && (e._$AP ??= ge, e._$AQ ??= z);
365
+ }, ve = class extends n {
366
+ constructor() {
367
+ super(...arguments), this._$AN = void 0;
368
+ }
369
+ _$AT(e, t, n) {
370
+ super._$AT(e, t, n), R(this), this.isConnected = e._$AU;
371
+ }
372
+ _$AO(e, t = !0) {
373
+ e !== this.isConnected && (this.isConnected = e, e ? this.reconnected?.() : this.disconnected?.()), t && (I(this, e), L(this));
374
+ }
375
+ setValue(e) {
376
+ if (F(this._$Ct)) this._$Ct._$AI(e, this);
377
+ else {
378
+ let t = [...this._$Ct._$AH];
379
+ t[this._$Ci] = e, this._$Ct._$AI(t, this, 0);
380
+ }
381
+ }
382
+ disconnected() {}
383
+ reconnected() {}
384
+ }, ye = (e) => e, B = class extends ve {
385
+ controller;
386
+ latestSource;
387
+ latestSelector;
388
+ resolvedTemplate;
389
+ initialized = !1;
390
+ render(e, t, n) {
391
+ return c;
392
+ }
393
+ update(e, t) {
394
+ let [n, r, i] = t, a = i === void 0, o = a ? ye : r, s = a ? r : i, c = this.latestSource !== n, l = this.latestSelector !== o, u = !this.initialized || c || l;
395
+ return this.resolvedTemplate = s, u && (this.initialized && (this.controller?.hostDisconnected(), this.controller = void 0), this.latestSource = n, this.latestSelector = o, this.controller ||= new le(this.createFakeHost(), () => this.latestSource, (e) => this.latestSelector?.(e)), this.controller.hostUpdate(), this.initialized = !0), this.resolvedTemplate?.(this.latestSelector(this.latestSource.get()));
396
+ }
397
+ disconnected() {
398
+ this.controller?.hostDisconnected();
399
+ }
400
+ reconnected() {
401
+ this.controller?.hostUpdate(), this.resolvedTemplate && this.controller && this.setValue(this.resolvedTemplate(this.controller.value));
402
+ }
403
+ createFakeHost() {
404
+ return {
405
+ addController: () => {},
406
+ removeController: () => {},
407
+ requestUpdate: () => {
408
+ this.resolvedTemplate && this.controller && this.setValue(this.resolvedTemplate(this.controller.value));
409
+ },
410
+ get updateComplete() {
411
+ return Promise.resolve(!0);
412
+ }
413
+ };
414
+ }
415
+ }, V = i(B);
416
+ //#endregion
417
+ //#region ../../node_modules/.pnpm/@tanstack+table-core@9.0.0/node_modules/@tanstack/table-core/dist/core/reactivity/renderPhaseReactivity.js
418
+ function be(e) {
419
+ let { createAtom: t, batch: n } = e, r = t(0);
420
+ return {
421
+ createOptionsStore: !1,
422
+ wrapExternalAtoms: !1,
423
+ addSubscription: () => {
424
+ throw Error("Feature not supported in current reactivity implementation");
425
+ },
426
+ unmount: () => {
427
+ throw Error("Feature not supported in current reactivity implementation");
428
+ },
429
+ schedule: e.schedule ?? ((e) => queueMicrotask(e)),
430
+ batch: n,
431
+ untrack: (e) => e(),
432
+ createReadonlyAtom: (e, n) => {
433
+ let i = n?.compare ?? Object.is, a = !1, o, s = () => {
434
+ let t = e();
435
+ return (!a || !i(o, t)) && (o = t, a = !0), o;
436
+ }, c = t(() => (r.get(), s()), { compare: i });
437
+ return {
438
+ get: s,
439
+ subscribe: c.subscribe.bind(c)
440
+ };
441
+ },
442
+ createWritableAtom: (e, n) => t(e, { compare: n?.compare }),
443
+ commit: () => {
444
+ r.set((e) => e + 1);
445
+ }
446
+ };
447
+ }
448
+ function xe(e, t = Object.is) {
449
+ let n = !1, r;
450
+ return {
451
+ get: e.get,
452
+ markCommitted: (e) => {
453
+ r = e, n = !0;
454
+ },
455
+ subscribe: (i) => e.subscribe((e) => {
456
+ (!n || !t(r, e)) && i(e);
457
+ })
458
+ };
459
+ }
460
+ //#endregion
461
+ //#region ../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/reactivity.js
462
+ function H() {
463
+ return be({
464
+ createAtom: pe,
465
+ batch: fe
466
+ });
467
+ }
468
+ //#endregion
469
+ //#region ../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/TableController.js
470
+ var U = class {
471
+ host;
472
+ _table = null;
473
+ _rootSource;
474
+ _storeSubscription;
475
+ _capturedState;
476
+ _capturedSnapshot;
477
+ _hasSelector = !1;
478
+ _latestSelector;
479
+ _lastSelected;
480
+ constructor(e) {
481
+ (this.host = e).addController(this);
482
+ }
483
+ table(e, t) {
484
+ if (!this._table) {
485
+ let t = {
486
+ ...e,
487
+ features: {
488
+ coreReactivityFeature: H(),
489
+ ...e.features
490
+ },
491
+ mergeOptions: (e, t) => ({
492
+ ...e,
493
+ ...t
494
+ })
495
+ };
496
+ this._table = f(t), this._rootSource = xe(this._table.store, N), this._setupSubscriptions();
497
+ }
498
+ re(this._table, (t) => ({
499
+ ...t,
500
+ ...e
501
+ }), { syncExternalState: !1 }), this._capturedState = this._table.options.state;
502
+ let n = this._rootSource.get();
503
+ return this._capturedSnapshot = n, this._hasSelector = t !== void 0, this._latestSelector = t, this._lastSelected = t ? t(n) : n, {
504
+ ...this._table,
505
+ subscribe: V,
506
+ FlexRender: v,
507
+ get state() {
508
+ return t?.(n) ?? n;
509
+ }
510
+ };
511
+ }
512
+ _setupSubscriptions() {
513
+ this._table && !this._storeSubscription && (this._storeSubscription = this._rootSource.subscribe((e) => {
514
+ if (this._hasSelector) {
515
+ let t = this._latestSelector(e);
516
+ if (N(this._lastSelected, t)) return;
517
+ this._lastSelected = t;
518
+ }
519
+ this.host.requestUpdate();
520
+ }));
521
+ }
522
+ hostConnected() {
523
+ this._setupSubscriptions(), this._table && this.host.requestUpdate();
524
+ }
525
+ hostUpdated() {
526
+ this._table && (this._rootSource.markCommitted(this._capturedSnapshot), ne(this._table, this._capturedState ?? null, N));
527
+ }
528
+ hostDisconnected() {
529
+ this._storeSubscription?.unsubscribe(), this._storeSubscription = void 0;
530
+ }
531
+ }, W = class extends Event {
532
+ constructor(e, t, n, r) {
533
+ super("context-request", {
534
+ bubbles: !0,
535
+ composed: !0
536
+ }), this.context = e, this.contextTarget = t, this.callback = n, this.subscribe = r ?? !1;
537
+ }
538
+ };
539
+ //#endregion
540
+ //#region ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/create-context.js
541
+ function G(e) {
542
+ return e;
543
+ }
544
+ //#endregion
545
+ //#region ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js
546
+ var K = class {
547
+ constructor(e, t, n, r) {
548
+ if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (e, t) => {
549
+ this.unsubscribe && (this.unsubscribe !== t && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = e, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(e, t)), this.unsubscribe = t;
550
+ }, this.host = e, t.context !== void 0) {
551
+ let e = t;
552
+ this.context = e.context, this.callback = e.callback, this.subscribe = e.subscribe ?? !1;
553
+ } else this.context = t, this.callback = n, this.subscribe = r ?? !1;
554
+ this.host.addController(this);
555
+ }
556
+ hostConnected() {
557
+ this.dispatchRequest();
558
+ }
559
+ hostDisconnected() {
560
+ this.unsubscribe &&= (this.unsubscribe(), void 0);
561
+ }
562
+ dispatchRequest() {
563
+ this.host.dispatchEvent(new W(this.context, this.host, this.t, this.subscribe));
564
+ }
565
+ }, Se = class {
566
+ get value() {
567
+ return this.o;
568
+ }
569
+ set value(e) {
570
+ this.setValue(e);
571
+ }
572
+ setValue(e, t = !1) {
573
+ let n = t || !Object.is(e, this.o);
574
+ this.o = e, n && this.updateObservers();
575
+ }
576
+ constructor(e) {
577
+ this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
578
+ for (let [e, { disposer: t }] of this.subscriptions) e(this.o, t);
579
+ }, e !== void 0 && (this.value = e);
580
+ }
581
+ addCallback(e, t, n) {
582
+ if (!n) return void e(this.value);
583
+ this.subscriptions.has(e) || this.subscriptions.set(e, {
584
+ disposer: () => {
585
+ this.subscriptions.delete(e);
586
+ },
587
+ consumerHost: t
588
+ });
589
+ let { disposer: r } = this.subscriptions.get(e);
590
+ e(this.value, r);
591
+ }
592
+ clearCallbacks() {
593
+ this.subscriptions.clear();
594
+ }
595
+ }, Ce = class extends Event {
596
+ constructor(e, t) {
597
+ super("context-provider", {
598
+ bubbles: !0,
599
+ composed: !0
600
+ }), this.context = e, this.contextTarget = t;
601
+ }
602
+ }, we = class extends Se {
603
+ constructor(e, t, n) {
604
+ super(t.context === void 0 ? n : t.initialValue), this.onContextRequest = (e) => {
605
+ if (e.context !== this.context) return;
606
+ let t = e.contextTarget ?? e.composedPath()[0];
607
+ t !== this.host && (e.stopPropagation(), this.addCallback(e.callback, t, e.subscribe));
608
+ }, this.onProviderRequest = (e) => {
609
+ if (e.context !== this.context || (e.contextTarget ?? e.composedPath()[0]) === this.host) return;
610
+ let t = /* @__PURE__ */ new Set();
611
+ for (let [e, { consumerHost: n }] of this.subscriptions) t.has(e) || (t.add(e), n.dispatchEvent(new W(this.context, n, e, !0)));
612
+ e.stopPropagation();
613
+ }, this.host = e, this.context = t.context === void 0 ? t : t.context, this.attachListeners(), this.host.addController?.(this);
614
+ }
615
+ attachListeners() {
616
+ this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
617
+ }
618
+ hostConnected() {
619
+ this.host.dispatchEvent(new Ce(this.context, this.host));
620
+ }
621
+ };
622
+ //#endregion
623
+ //#region ../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/createTableHook.js
624
+ function Te({ tableComponents: e, cellComponents: t, headerComponents: n, ...r }) {
625
+ let i = G(Symbol("tanstack-table")), a = G(Symbol("tanstack-cell")), o = G(Symbol("tanstack-header"));
626
+ function s() {
627
+ return ee();
628
+ }
629
+ function c(e) {
630
+ return new K(e, {
631
+ context: i,
632
+ subscribe: !0
633
+ });
634
+ }
635
+ function l(e) {
636
+ return new K(e, {
637
+ context: a,
638
+ subscribe: !0
639
+ });
640
+ }
641
+ function u(e) {
642
+ return new K(e, {
643
+ context: o,
644
+ subscribe: !0
645
+ });
646
+ }
647
+ function d(a, o, s) {
648
+ let c = new U(a), l = new we(a, { context: i });
649
+ return { table() {
650
+ let i = {
651
+ ...r,
652
+ ...o
653
+ }, a = c.table(i, s);
654
+ l.setValue(a);
655
+ function u(e, n) {
656
+ let r = () => v({ cell: e }), i = {};
657
+ for (let [n, r] of Object.entries(t ?? {})) i[n] = () => r(e);
658
+ return n(Object.assign(e, {
659
+ FlexRender: r,
660
+ ...i
661
+ }));
662
+ }
663
+ function d(e, t) {
664
+ let r = () => _(e.column.columnDef.header, e.getContext()), i = {};
665
+ for (let [t, r] of Object.entries(n ?? {})) i[t] = () => r(e);
666
+ return t(Object.assign(e, {
667
+ FlexRender: r,
668
+ ...i
669
+ }));
670
+ }
671
+ function f(e, t) {
672
+ let r = () => _(e.column.columnDef.footer, e.getContext()), i = {};
673
+ for (let [t, r] of Object.entries(n ?? {})) i[t] = () => r(e);
674
+ return t(Object.assign(e, {
675
+ FlexRender: r,
676
+ ...i
677
+ }));
678
+ }
679
+ return Object.assign(a, {
680
+ AppCell: u,
681
+ AppHeader: d,
682
+ AppFooter: f,
683
+ FlexRender: v,
684
+ ...e ?? {}
685
+ });
686
+ } };
687
+ }
688
+ return {
689
+ appFeatures: r.features,
690
+ createAppColumnHelper: s,
691
+ useAppTable: d,
692
+ useTableContext: c,
693
+ useCellContext: l,
694
+ useHeaderContext: u
695
+ };
696
+ }
697
+ //#endregion
698
+ //#region ../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/index.js
699
+ var q = /* @__PURE__ */ h({
700
+ FlexRender: () => v,
701
+ SubscribeDirective: () => B,
702
+ TableController: () => U,
703
+ createTableHook: () => Te,
704
+ flexRender: () => _,
705
+ subscribe: () => V
706
+ });
707
+ import * as Ee from "@tanstack/table-core";
708
+ oe(q, Ee);
709
+ //#endregion
710
+ //#region ../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.0.0/node_modules/@tanstack/match-sorter-utils/dist/remove-accents.js
711
+ var J = {
712
+ À: "A",
713
+ Á: "A",
714
+ Â: "A",
715
+ Ã: "A",
716
+ Ä: "A",
717
+ Å: "A",
718
+ Ấ: "A",
719
+ Ắ: "A",
720
+ Ẳ: "A",
721
+ Ẵ: "A",
722
+ Ặ: "A",
723
+ Æ: "AE",
724
+ Ầ: "A",
725
+ Ằ: "A",
726
+ Ȃ: "A",
727
+ Ç: "C",
728
+ Ḉ: "C",
729
+ È: "E",
730
+ É: "E",
731
+ Ê: "E",
732
+ Ë: "E",
733
+ Ế: "E",
734
+ Ḗ: "E",
735
+ Ề: "E",
736
+ Ḕ: "E",
737
+ Ḝ: "E",
738
+ Ȇ: "E",
739
+ Ì: "I",
740
+ Í: "I",
741
+ Î: "I",
742
+ Ï: "I",
743
+ Ḯ: "I",
744
+ Ȋ: "I",
745
+ Ð: "D",
746
+ Ñ: "N",
747
+ Ò: "O",
748
+ Ó: "O",
749
+ Ô: "O",
750
+ Õ: "O",
751
+ Ö: "O",
752
+ Ø: "O",
753
+ Ố: "O",
754
+ Ṍ: "O",
755
+ Ṓ: "O",
756
+ Ȏ: "O",
757
+ Ù: "U",
758
+ Ú: "U",
759
+ Û: "U",
760
+ Ü: "U",
761
+ Ý: "Y",
762
+ à: "a",
763
+ á: "a",
764
+ â: "a",
765
+ ã: "a",
766
+ ä: "a",
767
+ å: "a",
768
+ ấ: "a",
769
+ ắ: "a",
770
+ ẳ: "a",
771
+ ẵ: "a",
772
+ ặ: "a",
773
+ æ: "ae",
774
+ ầ: "a",
775
+ ằ: "a",
776
+ ȃ: "a",
777
+ ç: "c",
778
+ ḉ: "c",
779
+ è: "e",
780
+ é: "e",
781
+ ê: "e",
782
+ ë: "e",
783
+ ế: "e",
784
+ ḗ: "e",
785
+ ề: "e",
786
+ ḕ: "e",
787
+ ḝ: "e",
788
+ ȇ: "e",
789
+ ì: "i",
790
+ í: "i",
791
+ î: "i",
792
+ ï: "i",
793
+ ḯ: "i",
794
+ ȋ: "i",
795
+ ð: "d",
796
+ ñ: "n",
797
+ ò: "o",
798
+ ó: "o",
799
+ ô: "o",
800
+ õ: "o",
801
+ ö: "o",
802
+ ø: "o",
803
+ ố: "o",
804
+ ṍ: "o",
805
+ ṓ: "o",
806
+ ȏ: "o",
807
+ ù: "u",
808
+ ú: "u",
809
+ û: "u",
810
+ ü: "u",
811
+ ý: "y",
812
+ ÿ: "y",
813
+ Ā: "A",
814
+ ā: "a",
815
+ Ă: "A",
816
+ ă: "a",
817
+ Ą: "A",
818
+ ą: "a",
819
+ Ć: "C",
820
+ ć: "c",
821
+ Ĉ: "C",
822
+ ĉ: "c",
823
+ Ċ: "C",
824
+ ċ: "c",
825
+ Č: "C",
826
+ č: "c",
827
+ C̆: "C",
828
+ c̆: "c",
829
+ Ď: "D",
830
+ ď: "d",
831
+ Đ: "D",
832
+ đ: "d",
833
+ Ē: "E",
834
+ ē: "e",
835
+ Ĕ: "E",
836
+ ĕ: "e",
837
+ Ė: "E",
838
+ ė: "e",
839
+ Ę: "E",
840
+ ę: "e",
841
+ Ě: "E",
842
+ ě: "e",
843
+ Ĝ: "G",
844
+ Ǵ: "G",
845
+ ĝ: "g",
846
+ ǵ: "g",
847
+ Ğ: "G",
848
+ ğ: "g",
849
+ Ġ: "G",
850
+ ġ: "g",
851
+ Ģ: "G",
852
+ ģ: "g",
853
+ Ĥ: "H",
854
+ ĥ: "h",
855
+ Ħ: "H",
856
+ ħ: "h",
857
+ Ḫ: "H",
858
+ ḫ: "h",
859
+ Ĩ: "I",
860
+ ĩ: "i",
861
+ Ī: "I",
862
+ ī: "i",
863
+ Ĭ: "I",
864
+ ĭ: "i",
865
+ Į: "I",
866
+ į: "i",
867
+ İ: "I",
868
+ ı: "i",
869
+ IJ: "IJ",
870
+ ij: "ij",
871
+ Ĵ: "J",
872
+ ĵ: "j",
873
+ Ķ: "K",
874
+ ķ: "k",
875
+ Ḱ: "K",
876
+ ḱ: "k",
877
+ K̆: "K",
878
+ k̆: "k",
879
+ Ĺ: "L",
880
+ ĺ: "l",
881
+ Ļ: "L",
882
+ ļ: "l",
883
+ Ľ: "L",
884
+ ľ: "l",
885
+ Ŀ: "L",
886
+ ŀ: "l",
887
+ Ł: "l",
888
+ ł: "l",
889
+ Ḿ: "M",
890
+ ḿ: "m",
891
+ M̆: "M",
892
+ m̆: "m",
893
+ Ń: "N",
894
+ ń: "n",
895
+ Ņ: "N",
896
+ ņ: "n",
897
+ Ň: "N",
898
+ ň: "n",
899
+ ʼn: "n",
900
+ N̆: "N",
901
+ n̆: "n",
902
+ Ō: "O",
903
+ ō: "o",
904
+ Ŏ: "O",
905
+ ŏ: "o",
906
+ Ő: "O",
907
+ ő: "o",
908
+ Œ: "OE",
909
+ œ: "oe",
910
+ P̆: "P",
911
+ p̆: "p",
912
+ Ŕ: "R",
913
+ ŕ: "r",
914
+ Ŗ: "R",
915
+ ŗ: "r",
916
+ Ř: "R",
917
+ ř: "r",
918
+ R̆: "R",
919
+ r̆: "r",
920
+ Ȓ: "R",
921
+ ȓ: "r",
922
+ Ś: "S",
923
+ ś: "s",
924
+ Ŝ: "S",
925
+ ŝ: "s",
926
+ Ş: "S",
927
+ Ș: "S",
928
+ ș: "s",
929
+ ş: "s",
930
+ Š: "S",
931
+ š: "s",
932
+ Ţ: "T",
933
+ ţ: "t",
934
+ ț: "t",
935
+ Ț: "T",
936
+ Ť: "T",
937
+ ť: "t",
938
+ Ŧ: "T",
939
+ ŧ: "t",
940
+ T̆: "T",
941
+ t̆: "t",
942
+ Ũ: "U",
943
+ ũ: "u",
944
+ Ū: "U",
945
+ ū: "u",
946
+ Ŭ: "U",
947
+ ŭ: "u",
948
+ Ů: "U",
949
+ ů: "u",
950
+ Ű: "U",
951
+ ű: "u",
952
+ Ų: "U",
953
+ ų: "u",
954
+ Ȗ: "U",
955
+ ȗ: "u",
956
+ V̆: "V",
957
+ v̆: "v",
958
+ Ŵ: "W",
959
+ ŵ: "w",
960
+ Ẃ: "W",
961
+ ẃ: "w",
962
+ X̆: "X",
963
+ x̆: "x",
964
+ Ŷ: "Y",
965
+ ŷ: "y",
966
+ Ÿ: "Y",
967
+ Y̆: "Y",
968
+ y̆: "y",
969
+ Ź: "Z",
970
+ ź: "z",
971
+ Ż: "Z",
972
+ ż: "z",
973
+ Ž: "Z",
974
+ ž: "z",
975
+ ſ: "s",
976
+ ƒ: "f",
977
+ Ơ: "O",
978
+ ơ: "o",
979
+ Ư: "U",
980
+ ư: "u",
981
+ Ǎ: "A",
982
+ ǎ: "a",
983
+ Ǐ: "I",
984
+ ǐ: "i",
985
+ Ǒ: "O",
986
+ ǒ: "o",
987
+ Ǔ: "U",
988
+ ǔ: "u",
989
+ Ǖ: "U",
990
+ ǖ: "u",
991
+ Ǘ: "U",
992
+ ǘ: "u",
993
+ Ǚ: "U",
994
+ ǚ: "u",
995
+ Ǜ: "U",
996
+ ǜ: "u",
997
+ Ứ: "U",
998
+ ứ: "u",
999
+ Ṹ: "U",
1000
+ ṹ: "u",
1001
+ Ǻ: "A",
1002
+ ǻ: "a",
1003
+ Ǽ: "AE",
1004
+ ǽ: "ae",
1005
+ Ǿ: "O",
1006
+ ǿ: "o",
1007
+ Þ: "TH",
1008
+ þ: "th",
1009
+ Ṕ: "P",
1010
+ ṕ: "p",
1011
+ Ṥ: "S",
1012
+ ṥ: "s",
1013
+ X́: "X",
1014
+ x́: "x",
1015
+ Ѓ: "Г",
1016
+ ѓ: "г",
1017
+ Ќ: "К",
1018
+ ќ: "к",
1019
+ A̋: "A",
1020
+ a̋: "a",
1021
+ E̋: "E",
1022
+ e̋: "e",
1023
+ I̋: "I",
1024
+ i̋: "i",
1025
+ Ǹ: "N",
1026
+ ǹ: "n",
1027
+ Ồ: "O",
1028
+ ồ: "o",
1029
+ Ṑ: "O",
1030
+ ṑ: "o",
1031
+ Ừ: "U",
1032
+ ừ: "u",
1033
+ Ẁ: "W",
1034
+ ẁ: "w",
1035
+ Ỳ: "Y",
1036
+ ỳ: "y",
1037
+ Ȁ: "A",
1038
+ ȁ: "a",
1039
+ Ȅ: "E",
1040
+ ȅ: "e",
1041
+ Ȉ: "I",
1042
+ ȉ: "i",
1043
+ Ȍ: "O",
1044
+ ȍ: "o",
1045
+ Ȑ: "R",
1046
+ ȑ: "r",
1047
+ Ȕ: "U",
1048
+ ȕ: "u",
1049
+ B̌: "B",
1050
+ b̌: "b",
1051
+ Č̣: "C",
1052
+ č̣: "c",
1053
+ Ê̌: "E",
1054
+ ê̌: "e",
1055
+ F̌: "F",
1056
+ f̌: "f",
1057
+ Ǧ: "G",
1058
+ ǧ: "g",
1059
+ Ȟ: "H",
1060
+ ȟ: "h",
1061
+ J̌: "J",
1062
+ ǰ: "j",
1063
+ Ǩ: "K",
1064
+ ǩ: "k",
1065
+ M̌: "M",
1066
+ m̌: "m",
1067
+ P̌: "P",
1068
+ p̌: "p",
1069
+ Q̌: "Q",
1070
+ q̌: "q",
1071
+ Ř̩: "R",
1072
+ ř̩: "r",
1073
+ Ṧ: "S",
1074
+ ṧ: "s",
1075
+ V̌: "V",
1076
+ v̌: "v",
1077
+ W̌: "W",
1078
+ w̌: "w",
1079
+ X̌: "X",
1080
+ x̌: "x",
1081
+ Y̌: "Y",
1082
+ y̌: "y",
1083
+ A̧: "A",
1084
+ a̧: "a",
1085
+ B̧: "B",
1086
+ b̧: "b",
1087
+ Ḑ: "D",
1088
+ ḑ: "d",
1089
+ Ȩ: "E",
1090
+ ȩ: "e",
1091
+ Ɛ̧: "E",
1092
+ ɛ̧: "e",
1093
+ Ḩ: "H",
1094
+ ḩ: "h",
1095
+ I̧: "I",
1096
+ i̧: "i",
1097
+ Ɨ̧: "I",
1098
+ ɨ̧: "i",
1099
+ M̧: "M",
1100
+ m̧: "m",
1101
+ O̧: "O",
1102
+ o̧: "o",
1103
+ Q̧: "Q",
1104
+ q̧: "q",
1105
+ U̧: "U",
1106
+ u̧: "u",
1107
+ X̧: "X",
1108
+ x̧: "x",
1109
+ Z̧: "Z",
1110
+ z̧: "z"
1111
+ }, De = Object.keys(J).join("|"), Oe = new RegExp(De, "g");
1112
+ function ke(e) {
1113
+ return e.replace(Oe, (e) => J[e]);
1114
+ }
1115
+ //#endregion
1116
+ //#region ../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.0.0/node_modules/@tanstack/match-sorter-utils/dist/index.js
1117
+ var Y = {
1118
+ CASE_SENSITIVE_EQUAL: 7,
1119
+ EQUAL: 6,
1120
+ STARTS_WITH: 5,
1121
+ WORD_STARTS_WITH: 4,
1122
+ CONTAINS: 3,
1123
+ ACRONYM: 2,
1124
+ MATCHES: 1,
1125
+ NO_MATCH: 0
1126
+ };
1127
+ function Ae(e, t, n) {
1128
+ if (n ||= {}, n.threshold = n.threshold ?? Y.MATCHES, !n.accessors) {
1129
+ let r = X(e, t, n);
1130
+ return {
1131
+ rankedValue: e,
1132
+ rank: r,
1133
+ accessorIndex: -1,
1134
+ accessorThreshold: n.threshold,
1135
+ passed: r >= n.threshold
1136
+ };
1137
+ }
1138
+ let r = Pe(e, n.accessors), i = {
1139
+ rankedValue: e,
1140
+ rank: Y.NO_MATCH,
1141
+ accessorIndex: -1,
1142
+ accessorThreshold: n.threshold,
1143
+ passed: !1
1144
+ };
1145
+ for (let e = 0; e < r.length; e++) {
1146
+ let a = r[e], o = X(a.itemValue, t, n), { minRanking: s, maxRanking: c, threshold: l = n.threshold } = a.attributes;
1147
+ o < s && o >= Y.MATCHES ? o = s : o > c && (o = c), o = Math.min(o, c), o >= l && o > i.rank && (i.rank = o, i.passed = !0, i.accessorIndex = e, i.accessorThreshold = l, i.rankedValue = a.itemValue);
1148
+ }
1149
+ return i;
1150
+ }
1151
+ function X(e, t, n) {
1152
+ return e = Z(e, n), t = Z(t, n), t.length > e.length ? Y.NO_MATCH : e === t ? Y.CASE_SENSITIVE_EQUAL : (e = e.toLowerCase(), t = t.toLowerCase(), e === t ? Y.EQUAL : e.startsWith(t) ? Y.STARTS_WITH : e.includes(` ${t}`) ? Y.WORD_STARTS_WITH : e.includes(t) ? Y.CONTAINS : t.length === 1 ? Y.NO_MATCH : je(e).includes(t) ? Y.ACRONYM : Me(e, t));
1153
+ }
1154
+ function je(e) {
1155
+ let t = "";
1156
+ return e.split(" ").forEach((e) => {
1157
+ e.split("-").forEach((e) => {
1158
+ t += e.substr(0, 1);
1159
+ });
1160
+ }), t;
1161
+ }
1162
+ function Me(e, t) {
1163
+ let n = 0, r = 0;
1164
+ function i(e, t, r) {
1165
+ for (let i = r, a = t.length; i < a; i++) if (t[i] === e) return n += 1, i + 1;
1166
+ return -1;
1167
+ }
1168
+ function a(e) {
1169
+ let r = 1 / e, i = n / t.length;
1170
+ return Y.MATCHES + i * r;
1171
+ }
1172
+ let o = i(t[0], e, 0);
1173
+ if (o < 0) return Y.NO_MATCH;
1174
+ r = o;
1175
+ for (let n = 1, a = t.length; n < a; n++) {
1176
+ let a = t[n];
1177
+ if (r = i(a, e, r), !(r > -1)) return Y.NO_MATCH;
1178
+ }
1179
+ return a(r - o);
1180
+ }
1181
+ function Z(e, { keepDiacritics: t }) {
1182
+ return e = `${e}`, t || (e = ke(e)), e;
1183
+ }
1184
+ function Ne(e, t) {
1185
+ let n = t;
1186
+ typeof t == "object" && (n = t.accessor);
1187
+ let r = n(e);
1188
+ return r == null ? [] : Array.isArray(r) ? r : [String(r)];
1189
+ }
1190
+ function Pe(e, t) {
1191
+ let n = [];
1192
+ for (let r = 0, i = t.length; r < i; r++) {
1193
+ let i = t[r], a = Fe(i), o = Ne(e, i);
1194
+ for (let e = 0, t = o.length; e < t; e++) n.push({
1195
+ itemValue: o[e],
1196
+ attributes: a
1197
+ });
1198
+ }
1199
+ return n;
1200
+ }
1201
+ var Q = {
1202
+ maxRanking: Infinity,
1203
+ minRanking: -Infinity
1204
+ };
1205
+ function Fe(e) {
1206
+ return typeof e == "function" ? Q : {
1207
+ ...Q,
1208
+ ...e
1209
+ };
1210
+ }
1211
+ //#endregion
1212
+ //#region src/components/sken-datatable.ts
1213
+ var $ = class extends a {
1214
+ constructor(...e) {
1215
+ super(...e), this.rows = [], this.columns = [], this.getRowId = void 0, this.loading = !1, this.empty = void 0, this.sorting = void 0, this.globalFilter = void 0, this.filterPlaceholder = "Filter…", this.pagination = void 0, this.defaultPageSize = 10, this.#e = [], this.#t = "", this.#n = {
1216
+ pageIndex: 0,
1217
+ pageSize: 10
1218
+ }, this.#r = (0, q.tableFeatures)({
1219
+ rowSortingFeature: q.rowSortingFeature,
1220
+ sortedRowModel: (0, q.createSortedRowModel)(),
1221
+ columnFilteringFeature: q.columnFilteringFeature,
1222
+ filteredRowModel: (0, q.createFilteredRowModel)(),
1223
+ globalFilteringFeature: q.globalFilteringFeature,
1224
+ rowPaginationFeature: q.rowPaginationFeature,
1225
+ paginatedRowModel: (0, q.createPaginatedRowModel)()
1226
+ }), this.#i = void 0, this.#o = (e, t, n) => Ae(Object.values(e.original ?? {}).map((e) => e == null ? "" : String(e)).join(" "), String(n ?? "")).passed;
1227
+ }
1228
+ #e;
1229
+ #t;
1230
+ #n;
1231
+ #r;
1232
+ #i;
1233
+ #a() {
1234
+ return this.#i === void 0 && (this.#i = new U(this)), this.#i;
1235
+ }
1236
+ #o;
1237
+ #s() {
1238
+ this.getRowId === void 0 && globalThis.console !== void 0 && globalThis.console.warn("[sken-datatable] Missing `getRowId`. This is required in M1.x once row selection, expansion, or server-side filtering are added. See ADR-0006 §4 and the research report §1.");
1239
+ }
1240
+ connectedCallback() {
1241
+ super.connectedCallback(), this.#s(), this.#n.pageSize === 10 && this.defaultPageSize !== 10 && (this.#n = {
1242
+ pageIndex: 0,
1243
+ pageSize: this.defaultPageSize
1244
+ });
1245
+ }
1246
+ render() {
1247
+ if (this.loading) return s`
1248
+ <div class="loading" role="status" aria-busy="true">
1249
+ <slot name="loading"></slot>
1250
+ </div>
1251
+ `;
1252
+ if (this.rows.length === 0) return this.#c();
1253
+ let e = {}, t = {};
1254
+ this.sorting !== void 0 && this.sorting.length > 0 && (e.sorting = this.sorting, t.sorting = this.sorting), this.globalFilter !== void 0 && this.globalFilter.length > 0 && (e.globalFilter = this.globalFilter, t.globalFilter = this.globalFilter), this.pagination === void 0 ? t.pagination = this.#n : (e.pagination = this.pagination, t.pagination = this.pagination);
1255
+ let n = this.#a().table({
1256
+ data: this.rows,
1257
+ columns: this.columns,
1258
+ getRowId: this.getRowId ?? ((e, t) => String(t)),
1259
+ features: this.#r,
1260
+ globalFilterFn: this.#o,
1261
+ state: e,
1262
+ initialState: t,
1263
+ onSortingChange: (e) => {
1264
+ let t = this.sorting ?? this.#e, n = typeof e == "function" ? e(t) : e;
1265
+ this.sorting === void 0 && (this.#e = n, this.requestUpdate()), this.dispatchEvent(new CustomEvent("sken-sort-change", {
1266
+ detail: n,
1267
+ bubbles: !0,
1268
+ composed: !0
1269
+ }));
1270
+ },
1271
+ onGlobalFilterChange: (e) => {
1272
+ let t = this.globalFilter ?? this.#t, n = typeof e == "function" ? e(t) : e;
1273
+ this.globalFilter === void 0 && (this.#t = n, this.requestUpdate()), this.dispatchEvent(new CustomEvent("sken-global-filter-change", {
1274
+ detail: n,
1275
+ bubbles: !0,
1276
+ composed: !0
1277
+ }));
1278
+ },
1279
+ onPaginationChange: (e) => {
1280
+ let t = this.pagination ?? this.#n, n = typeof e == "function" ? e(t) : e;
1281
+ this.pagination === void 0 && (this.#n = n, this.requestUpdate()), this.dispatchEvent(new CustomEvent("sken-pagination-change", {
1282
+ detail: n,
1283
+ bubbles: !0,
1284
+ composed: !0
1285
+ }));
1286
+ }
1287
+ });
1288
+ return te.table_publishExternalState(n, e, (e, t) => e === t), s`
1289
+ <div class="filter-bar">
1290
+ <slot name="filter">
1291
+ <input
1292
+ class="filter-input"
1293
+ type="search"
1294
+ placeholder=${this.filterPlaceholder}
1295
+ aria-label="Filter rows"
1296
+ .value=${this.globalFilter ?? this.#t}
1297
+ @input=${(e) => {
1298
+ let t = e.target;
1299
+ this.globalFilter === void 0 && (this.#t = t.value, this.requestUpdate()), this.dispatchEvent(new CustomEvent("sken-global-filter-change", {
1300
+ detail: t.value,
1301
+ bubbles: !0,
1302
+ composed: !0
1303
+ }));
1304
+ }}
1305
+ />
1306
+ </slot>
1307
+ </div>
1308
+ <table>
1309
+ <thead>
1310
+ ${n.getHeaderGroups().map((e) => s`
1311
+ <tr>
1312
+ ${e.headers.map((e) => {
1313
+ let t = e.column.columnDef.header, n = typeof t == "string" ? t : e.column.id, r = e.column.getCanSort(), i = e.column.getIsSorted(), a = i === "asc" ? "▲" : i === "desc" ? "▼" : "", o = e.column.getToggleSortingHandler();
1314
+ return s`
1315
+ <th
1316
+ scope="col"
1317
+ part="header-cell"
1318
+ data-column-id=${e.column.id}
1319
+ class=${r ? "sortable" : ""}
1320
+ aria-sort=${i === "asc" ? "ascending" : i === "desc" ? "descending" : "none"}
1321
+ @click=${r && o ? o : null}
1322
+ >
1323
+ <span class="header-text">${n}</span>
1324
+ ${r ? s`<span
1325
+ class="sort-indicator"
1326
+ data-state=${i || "none"}
1327
+ aria-hidden="true"
1328
+ >${a}</span
1329
+ >` : l}
1330
+ </th>
1331
+ `;
1332
+ })}
1333
+ </tr>
1334
+ `)}
1335
+ </thead>
1336
+ <tbody>
1337
+ ${n.getRowModel().rows.map((e) => {
1338
+ let t = e;
1339
+ return s`
1340
+ <tr part="row" data-row-id=${t.id}>
1341
+ ${t.getAllCells().map((e) => {
1342
+ let t = e.getValue();
1343
+ return s`
1344
+ <td part="cell" data-column-id=${e.column.id}>
1345
+ ${t == null ? l : String(t)}
1346
+ </td>
1347
+ `;
1348
+ })}
1349
+ </tr>
1350
+ `;
1351
+ })}
1352
+ </tbody>
1353
+ </table>
1354
+
1355
+ <div class="pagination-bar" part="pagination">
1356
+ <slot name="pagination">
1357
+ ${(() => {
1358
+ let e = n, { pageIndex: t, pageSize: r } = e.state.pagination, i = e.getPageCount();
1359
+ return s`
1360
+ <button
1361
+ type="button"
1362
+ class="page-btn"
1363
+ ?disabled=${!e.getCanPreviousPage()}
1364
+ @click=${() => e.previousPage()}
1365
+ aria-label="Previous page"
1366
+ >
1367
+ ← Prev
1368
+ </button>
1369
+ <span class="page-info">
1370
+ Page ${t + 1} of ${Math.max(i, 1)}
1371
+ </span>
1372
+ <button
1373
+ type="button"
1374
+ class="page-btn"
1375
+ ?disabled=${!e.getCanNextPage()}
1376
+ @click=${() => e.nextPage()}
1377
+ aria-label="Next page"
1378
+ >
1379
+ Next →
1380
+ </button>
1381
+ <span class="page-size-info">${r} per page</span>
1382
+ `;
1383
+ })()}
1384
+ </slot>
1385
+ </div>
1386
+ `;
1387
+ }
1388
+ #c() {
1389
+ return s`
1390
+ <div class="empty" role="status">
1391
+ <slot name="empty">${this.empty ?? "No rows"}</slot>
1392
+ </div>
1393
+ `;
1394
+ }
1395
+ static {
1396
+ this.styles = o`
1397
+ :host {
1398
+ display: block;
1399
+ inline-size: 100%;
1400
+ font-family: var(--sken-family-sans);
1401
+ color: var(--sken-foreground);
1402
+ }
1403
+
1404
+ table {
1405
+ inline-size: 100%;
1406
+ border-collapse: collapse;
1407
+ border: 1px solid var(--sken-border);
1408
+ border-radius: var(--sken-md);
1409
+ overflow: hidden;
1410
+ }
1411
+
1412
+ thead {
1413
+ background: var(--sken-muted);
1414
+ }
1415
+
1416
+ th,
1417
+ td {
1418
+ padding-block: var(--sken-2);
1419
+ padding-inline: var(--sken-3);
1420
+ text-align: start;
1421
+ border-block-end: 1px solid var(--sken-border);
1422
+ }
1423
+
1424
+ th {
1425
+ font-weight: var(--sken-weight-semibold);
1426
+ color: var(--sken-foreground);
1427
+ }
1428
+
1429
+ th.sortable {
1430
+ cursor: pointer;
1431
+ user-select: none;
1432
+ }
1433
+
1434
+ th.sortable:hover {
1435
+ background: var(--sken-muted);
1436
+ }
1437
+
1438
+ th .header-text {
1439
+ margin-inline-end: 0.25rem;
1440
+ }
1441
+
1442
+ th .sort-indicator {
1443
+ display: inline-block;
1444
+ min-inline-size: 0.75rem;
1445
+ color: var(--sken-muted-foreground);
1446
+ font-size: 0.75em;
1447
+ }
1448
+
1449
+ th .sort-indicator[data-state='asc'],
1450
+ th .sort-indicator[data-state='desc'] {
1451
+ color: var(--sken-primary);
1452
+ }
1453
+
1454
+ tbody tr:last-child td {
1455
+ border-block-end: none;
1456
+ }
1457
+
1458
+ tbody tr:hover {
1459
+ background: var(--sken-muted);
1460
+ }
1461
+
1462
+ .empty {
1463
+ padding-block: var(--sken-4);
1464
+ padding-inline: var(--sken-3);
1465
+ text-align: center;
1466
+ color: var(--sken-muted-foreground);
1467
+ border: 1px solid var(--sken-border);
1468
+ border-radius: var(--sken-md);
1469
+ }
1470
+
1471
+ .loading {
1472
+ display: flex;
1473
+ align-items: center;
1474
+ justify-content: center;
1475
+ padding-block: var(--sken-6);
1476
+ min-block-size: 12rem;
1477
+ border: 1px solid var(--sken-border);
1478
+ border-radius: var(--sken-md);
1479
+ color: var(--sken-muted-foreground);
1480
+ }
1481
+
1482
+ /* The loading region renders a loading slot. The consumer
1483
+ supplies the spinner (typically a sken-icon with name
1484
+ spinner, which animates itself per its name) and the
1485
+ datatable provides the layout + accessible status region.
1486
+ The keyframe is owned by the icon package, not here,
1487
+ because the rotation is part of what spinner means: a
1488
+ static spinner would be a different icon. */
1489
+
1490
+ .filter-bar {
1491
+ margin-block-end: 0.75rem;
1492
+ }
1493
+
1494
+ .filter-input {
1495
+ box-sizing: border-box;
1496
+ inline-size: 100%;
1497
+ max-inline-size: 20rem;
1498
+ padding-block: var(--sken-2);
1499
+ padding-inline: var(--sken-3);
1500
+ border: 1px solid var(--sken-border);
1501
+ border-radius: var(--sken-md);
1502
+ background: var(--sken-background);
1503
+ color: var(--sken-foreground);
1504
+ font-family: var(--sken-family-sans);
1505
+ font-size: var(--sken-size-md);
1506
+ }
1507
+
1508
+ .filter-input::placeholder {
1509
+ color: var(--sken-muted-foreground);
1510
+ }
1511
+
1512
+ .filter-input:focus-visible {
1513
+ outline: 2px solid var(--sken-primary);
1514
+ outline-offset: 1px;
1515
+ }
1516
+
1517
+ .pagination-bar {
1518
+ display: flex;
1519
+ align-items: center;
1520
+ gap: 0.75rem;
1521
+ margin-block-start: 0.75rem;
1522
+ font-size: 0.875rem;
1523
+ color: var(--sken-muted-foreground);
1524
+ }
1525
+
1526
+ .page-btn {
1527
+ padding-block: var(--sken-1);
1528
+ padding-inline: var(--sken-3);
1529
+ border: 1px solid var(--sken-border);
1530
+ border-radius: var(--sken-sm);
1531
+ background: var(--sken-background);
1532
+ color: var(--sken-foreground);
1533
+ font-family: inherit;
1534
+ font-size: inherit;
1535
+ cursor: pointer;
1536
+ }
1537
+
1538
+ .page-btn:hover:not(:disabled) {
1539
+ background: var(--sken-muted);
1540
+ }
1541
+
1542
+ .page-btn:disabled {
1543
+ opacity: 0.5;
1544
+ cursor: not-allowed;
1545
+ }
1546
+
1547
+ .page-info {
1548
+ color: var(--sken-foreground);
1549
+ }
1550
+ `;
1551
+ }
1552
+ };
1553
+ e([d({ attribute: !1 })], $.prototype, "rows", void 0), e([d({ attribute: !1 })], $.prototype, "columns", void 0), e([d({ attribute: !1 })], $.prototype, "getRowId", void 0), e([d({
1554
+ reflect: !0,
1555
+ type: Boolean
1556
+ })], $.prototype, "loading", void 0), e([d()], $.prototype, "empty", void 0), e([d({ attribute: !1 })], $.prototype, "sorting", void 0), e([d({ attribute: !1 })], $.prototype, "globalFilter", void 0), e([d()], $.prototype, "filterPlaceholder", void 0), e([d({ attribute: !1 })], $.prototype, "pagination", void 0), e([d({
1557
+ attribute: "default-page-size",
1558
+ type: Number
1559
+ })], $.prototype, "defaultPageSize", void 0), $ = e([u("sken-datatable")], $);
1560
+ //#endregion
1561
+ export { $ as t };
1562
+
1563
+ //# sourceMappingURL=sken-datatable-BtR-NwRN.js.map