@scaleflex/asset-picker 0.2.1 → 0.2.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,6 +1,6 @@
1
- import { css as $, LitElement as w, html as n, nothing as f, svg as ce } from "lit";
2
- import { property as h, query as Se, customElement as k, state as _ } from "lit/decorators.js";
3
- class As {
1
+ import { css as $, LitElement as k, html as n, nothing as f, svg as ce } from "lit";
2
+ import { property as h, query as Se, customElement as S, state as _ } from "lit/decorators.js";
3
+ class Ts {
4
4
  constructor(e) {
5
5
  this.listeners = /* @__PURE__ */ new Set(), this._notifying = !1, this._pendingState = null, this.state = e;
6
6
  }
@@ -31,8 +31,8 @@ class As {
31
31
  this.listeners.clear();
32
32
  }
33
33
  }
34
- function Ts() {
35
- return new As({
34
+ function Ms() {
35
+ return new Ts({
36
36
  config: null,
37
37
  projectToken: "",
38
38
  sassKey: "",
@@ -92,7 +92,7 @@ class Os {
92
92
  (e = this.unsubscribe) == null || e.call(this);
93
93
  }
94
94
  }
95
- class Ms {
95
+ class Ps {
96
96
  constructor(e, s) {
97
97
  this.lastClickedIndex = -1, this.host = e, this.store = s, e.addController(this);
98
98
  }
@@ -135,7 +135,7 @@ class Ms {
135
135
  return Array.from(this.store.getState().selectedAssets.values());
136
136
  }
137
137
  }
138
- class Ps {
138
+ class Ls {
139
139
  constructor(e, s) {
140
140
  this.host = e, this.onLoadMore = s, e.addController(this);
141
141
  }
@@ -157,8 +157,8 @@ class Ps {
157
157
  this.observer && this.sentinel && (this.observer.unobserve(this.sentinel), this.observer.disconnect()), this.observer = void 0, this.sentinel = void 0;
158
158
  }
159
159
  }
160
- const Kt = 5, Te = 40, Gt = 15;
161
- class Ls {
160
+ const Gt = 5, Te = 40, Yt = 15;
161
+ class Is {
162
162
  constructor(e, s) {
163
163
  this.startX = 0, this.startY = 0, this.startClientX = 0, this.startClientY = 0, this.preMarqueeSelection = /* @__PURE__ */ new Map(), this._dragging = !1, this._scrollRAF = null, this._lastMouseEvent = null, this.isActive = !1, this.rect = { x: 0, y: 0, width: 0, height: 0 }, this.handleMouseDown = (i) => this.onMouseDown(i), this.handleMouseMove = (i) => this.onMouseMove(i), this.handleMouseUp = () => this.onMouseUp(), this.host = e, this.store = s, e.addController(this);
164
164
  }
@@ -190,7 +190,7 @@ class Ls {
190
190
  if (this.container) {
191
191
  if (!this._dragging) {
192
192
  const s = Math.abs(e.clientX - this.startClientX), i = Math.abs(e.clientY - this.startClientY);
193
- if (s < Kt && i < Kt) return;
193
+ if (s < Gt && i < Gt) return;
194
194
  this._dragging = !0, this.isActive = !0, this.preMarqueeSelection = new Map(this.store.getState().selectedAssets);
195
195
  }
196
196
  this._lastMouseEvent = e, this.updateMarqueeRect(e), this.startAutoScroll(e);
@@ -215,7 +215,7 @@ class Ls {
215
215
  if (this._scrollRAF = null, !this.container || !this._dragging || !this._lastMouseEvent) return;
216
216
  const e = this.container.getBoundingClientRect(), s = this._lastMouseEvent, i = s.clientY - e.top, a = e.bottom - s.clientY;
217
217
  let r = 0;
218
- i < Te ? r = -Gt * (1 - i / Te) : a < Te && (r = Gt * (1 - a / Te)), r !== 0 && (this.container.scrollTop += r, this.updateMarqueeRect(s), this._scrollRAF = requestAnimationFrame(() => this.autoScrollTick()));
218
+ i < Te ? r = -Yt * (1 - i / Te) : a < Te && (r = Yt * (1 - a / Te)), r !== 0 && (this.container.scrollTop += r, this.updateMarqueeRect(s), this._scrollRAF = requestAnimationFrame(() => this.autoScrollTick()));
219
219
  }
220
220
  stopAutoScroll() {
221
221
  this._scrollRAF && (cancelAnimationFrame(this._scrollRAF), this._scrollRAF = null);
@@ -255,11 +255,11 @@ class Ls {
255
255
  this.store.setState({ selectedAssets: s });
256
256
  }
257
257
  }
258
- class Is {
258
+ class Ds {
259
259
  constructor(e, s) {
260
260
  this.auth = e;
261
261
  const i = e.projectToken;
262
- this.baseUrl = s || `https://api.filerobot.com/${i}/v5`, e.mode === "sassKey" && (this.sassKey = e.sassKey);
262
+ this.baseUrl = s || `https://api.filerobot.com/${i}/v5`;
263
263
  }
264
264
  setSassKey(e) {
265
265
  this.sassKey = e;
@@ -268,16 +268,19 @@ class Is {
268
268
  if (this.auth.mode === "securityTemplate")
269
269
  return this.auth.securityTemplateKey;
270
270
  }
271
- _applyAuthHeaders(e) {
272
- this.sassKey ? e["X-Filerobot-Key"] = this.sassKey : this.auth.mode === "securityTemplate" && (e["X-Filerobot-Key"] = this.auth.securityTemplateKey);
273
- }
274
271
  async request(e, s) {
275
272
  const i = new URL(`${this.baseUrl}${e}`);
276
273
  s && Object.entries(s).forEach(([l, c]) => {
277
274
  c != null && (Array.isArray(c) ? i.searchParams.set(l, c.join(",")) : i.searchParams.set(l, String(c)));
278
275
  });
279
276
  const a = {};
280
- this._applyAuthHeaders(a);
277
+ if (this.auth.mode === "session") {
278
+ const l = this.auth;
279
+ a["X-Session-Token"] = l.sessionToken, a["X-Company-Token"] = l.companyToken, a["X-Project-Token"] = l.projectToken;
280
+ } else {
281
+ const l = this.auth;
282
+ this.sassKey ? a["X-Filerobot-Key"] = this.sassKey : a["X-Filerobot-Key"] = l.securityTemplateKey;
283
+ }
281
284
  const r = new AbortController(), o = setTimeout(() => r.abort(), 3e4);
282
285
  try {
283
286
  const l = await fetch(i.toString(), { headers: a, signal: r.signal });
@@ -302,7 +305,13 @@ class Is {
302
305
  const i = new URL(`${this.baseUrl}${e}`), a = {
303
306
  "Content-Type": "application/json"
304
307
  };
305
- this._applyAuthHeaders(a);
308
+ if (this.auth.mode === "session") {
309
+ const l = this.auth;
310
+ a["X-Session-Token"] = l.sessionToken, a["X-Company-Token"] = l.companyToken, a["X-Project-Token"] = l.projectToken;
311
+ } else {
312
+ const l = this.auth;
313
+ this.sassKey ? a["X-Filerobot-Key"] = this.sassKey : a["X-Filerobot-Key"] = l.securityTemplateKey;
314
+ }
306
315
  const r = new AbortController(), o = setTimeout(() => r.abort(), 3e4);
307
316
  try {
308
317
  const l = await fetch(i.toString(), {
@@ -329,7 +338,7 @@ class Is {
329
338
  }
330
339
  }
331
340
  }
332
- function Ds(t) {
341
+ function zs(t) {
333
342
  const e = {
334
343
  offset: t.offset ?? 0,
335
344
  limit: t.limit ?? 100,
@@ -348,17 +357,17 @@ function Ds(t) {
348
357
  return t.search && r.push(t.search), t.q && r.push(t.q), r.length > 0 && (e.q = r.join(" ")), e;
349
358
  }
350
359
  async function tt(t, e) {
351
- const s = Ds(e);
360
+ const s = zs(e);
352
361
  return t.request("/files", s);
353
362
  }
354
- async function Yt(t, e) {
363
+ async function Xt(t, e) {
355
364
  const s = {
356
365
  folder: e.folder,
357
366
  recursive: e.recursive ?? 1
358
367
  }, i = [];
359
368
  return e.search && i.push(e.search), e.q && i.push(e.q), i.length > 0 && (s.q = i.join(" ")), t.request("/files/stats", s);
360
369
  }
361
- async function zs(t, e) {
370
+ async function Rs(t, e) {
362
371
  const s = {
363
372
  recursive: (e == null ? void 0 : e.recursive) ?? 0,
364
373
  folder: (e == null ? void 0 : e.folderPath) ?? "/",
@@ -373,16 +382,16 @@ async function zs(t, e) {
373
382
  };
374
383
  return s.sort = `${r[i] || i}:${a}`, await t.request("/folders", s);
375
384
  }
376
- async function Rs(t, e) {
385
+ async function Ns(t, e) {
377
386
  return e.length === 0 ? {} : (await t.post(
378
387
  "/folders/previews",
379
388
  { folders: e }
380
389
  )).folders || {};
381
390
  }
382
- async function Ns(t) {
391
+ async function js(t) {
383
392
  return await t.request("/labels");
384
393
  }
385
- async function js(t) {
394
+ async function Us(t) {
386
395
  return ((await t.request("/tags")).tags || []).map((i) => ({
387
396
  ...i,
388
397
  label: i.names.en || Object.values(i.names)[0] || ""
@@ -407,12 +416,12 @@ const m = {
407
416
  PRODUCT_REF: "product_ref",
408
417
  FACES: "faces",
409
418
  COLOR: "color"
410
- }, V = {
419
+ }, B = {
411
420
  STATUS: "approval_status",
412
421
  APPROVER: "task_approver",
413
422
  REQUESTOR: "task_requester",
414
423
  DUE_DATE: "task_duedate"
415
- }, x = {
424
+ }, w = {
416
425
  IS: ":",
417
426
  RANGE: "..",
418
427
  IS_NOT: ":-",
@@ -421,9 +430,9 @@ const m = {
421
430
  CONTAINS_IN_TEXT: "~~~",
422
431
  GREATER_THAN_OR_EQUAL: ">=",
423
432
  LESS_THAN_OR_EQUAL: "<="
424
- }, Us = {
433
+ }, Vs = {
425
434
  AND: "AND"
426
- }, C = {
435
+ }, x = {
427
436
  NUMERIC: "numeric",
428
437
  SELECT_ONE: "select-one",
429
438
  MULTI_SELECT: "multi-select",
@@ -438,36 +447,36 @@ const m = {
438
447
  DECIMAL2: "decimal2",
439
448
  INTEGER_LIST: "integer-list"
440
449
  }, vt = {
441
- [C.DATE]: "date_",
442
- [C.BOOLEAN]: "bool_",
443
- [C.NUMERIC]: "num_",
444
- [C.DECIMAL2]: "dec_",
445
- [C.ATTACHMENTS_ASSETS]: "attach_",
446
- [C.ATTACHMENT_URI]: "uri_",
447
- [C.SELECT_ONE]: "one_",
448
- [C.MULTI_SELECT]: "multi_",
449
- [C.SUPERTAGS]: "tags_",
450
- [C.TEXT]: "text_",
451
- [C.TEXT_AREA]: "area_",
452
- [C.GEO_POINT]: "geo_",
453
- [C.INTEGER_LIST]: "intlist_"
450
+ [x.DATE]: "date_",
451
+ [x.BOOLEAN]: "bool_",
452
+ [x.NUMERIC]: "num_",
453
+ [x.DECIMAL2]: "dec_",
454
+ [x.ATTACHMENTS_ASSETS]: "attach_",
455
+ [x.ATTACHMENT_URI]: "uri_",
456
+ [x.SELECT_ONE]: "one_",
457
+ [x.MULTI_SELECT]: "multi_",
458
+ [x.SUPERTAGS]: "tags_",
459
+ [x.TEXT]: "text_",
460
+ [x.TEXT_AREA]: "area_",
461
+ [x.GEO_POINT]: "geo_",
462
+ [x.INTEGER_LIST]: "intlist_"
454
463
  };
455
464
  Object.fromEntries(
456
465
  Object.entries(vt).map(([t, e]) => [e, t])
457
466
  );
458
- const is = Object.values(vt), Be = {
467
+ const rs = Object.values(vt), Ue = {
459
468
  PRESET: "preset",
460
469
  AFTER: "after",
461
470
  BEFORE: "before",
462
471
  BETWEEN: "between",
463
472
  SPECIFIC: "specific"
464
- }, Xt = {
473
+ }, Wt = {
465
474
  EMPTY: "empty",
466
475
  NOT_EMPTY: "non-empty"
467
- }, K = "empty", G = "non-empty", be = "specific", xt = 10, $t = 10, st = 10, rs = "filters:pinned:", os = "metadata:pinned:", Wt = [
476
+ }, K = "empty", G = "non-empty", be = "specific", xt = 10, wt = 10, st = 10, os = "filters:pinned:", ns = "metadata:pinned:", Qt = [
468
477
  m.DATE,
469
478
  m.TYPE
470
- ], ns = x.IS, it = "20", rt = "1", Vs = 0, qs = [
479
+ ], ls = w.IS, it = "20", rt = "1", qs = 0, Hs = [
471
480
  { key: m.DATE, label: "Date", icon: "calendar", type: "date" },
472
481
  { key: m.TYPE, label: "Format", icon: "file-type", type: "string" },
473
482
  { key: m.SIZE, label: "Size", icon: "scaling", type: "string" },
@@ -477,21 +486,21 @@ const is = Object.values(vt), Be = {
477
486
  { key: m.PRODUCT_REF, label: "Products", icon: "box", type: "string" },
478
487
  { key: m.IMAGE, label: "Image", icon: "image", type: "string" },
479
488
  { key: m.COLOR, label: "Color", icon: "swatch-book", type: "string" }
480
- ], Hs = {
489
+ ], Ks = {
481
490
  key: m.METADATA,
482
491
  label: "Metadata",
483
492
  icon: "file-text",
484
493
  type: "string"
485
- }, Ks = {
494
+ }, Gs = {
486
495
  key: m.APPROVAL,
487
496
  label: "Approval",
488
497
  icon: "badge-check",
489
498
  type: "string"
490
- }, Mt = [
491
- Hs,
492
- ...qs,
493
- Ks
494
- ], Oe = {
499
+ }, Pt = [
500
+ Ks,
501
+ ...Hs,
502
+ Gs
503
+ ], Me = {
495
504
  [m.TYPE]: "Format",
496
505
  [m.DATE]: "Date",
497
506
  [m.SIZE]: "Size",
@@ -512,7 +521,7 @@ const is = Object.values(vt), Be = {
512
521
  DESIGN_TEMPLATE: "template_fdt",
513
522
  OTHER: "other",
514
523
  FONTS: "font"
515
- }, ls = [
524
+ }, cs = [
516
525
  { value: le.IMAGE, label: "Image", icon: "image" },
517
526
  { value: le.VIDEO, label: "Video", icon: "clapperboard" },
518
527
  { value: le.AUDIO, label: "Audio", icon: "music" },
@@ -521,28 +530,28 @@ const is = Object.values(vt), Be = {
521
530
  { value: le.DESIGN_TEMPLATE, label: "Design template", icon: "layout-template" },
522
531
  { value: le.FONTS, label: "Fonts", icon: "text" },
523
532
  { value: le.OTHER, label: "Other", icon: "layout-grid" }
524
- ], wt = {
533
+ ], $t = {
525
534
  RESOLUTION: 0,
526
535
  ORIENTATION: 1,
527
536
  FACES: 2
528
- }, Gs = [
537
+ }, Ys = [
529
538
  { value: "small", label: "Small" },
530
539
  { value: "medium", label: "Medium" },
531
540
  { value: "large", label: "Large" }
532
- ], Ys = [
541
+ ], Xs = [
533
542
  { value: "portrait", label: "Portrait" },
534
543
  { value: "landscape", label: "Landscape" },
535
544
  { value: "square", label: "Square" },
536
545
  { value: "panorama", label: "Panorama" }
537
- ], Xs = [
546
+ ], Ws = [
538
547
  { value: "none", label: "None" },
539
548
  { value: "1", label: "1" },
540
549
  { value: "2", label: "2" },
541
550
  { value: "3..", label: "3+" }
542
- ], cs = [
551
+ ], ds = [
543
552
  { value: "created", label: "Created at" },
544
553
  { value: "updated", label: "Updated at" }
545
- ], Lt = [
554
+ ], It = [
546
555
  { value: "today", label: "Today" },
547
556
  { value: "before", label: "Before date" },
548
557
  { value: "last_week", label: "Last week" },
@@ -550,7 +559,7 @@ const is = Object.values(vt), Be = {
550
559
  { value: "last_month", label: "Last month" },
551
560
  { value: "between", label: "Between dates" },
552
561
  { value: "last_year", label: "Last year" }
553
- ], ds = [
562
+ ], ps = [
554
563
  { value: "today", label: "Today" },
555
564
  { value: "before", label: "Before date" },
556
565
  { value: "within_week", label: "Within week" },
@@ -559,7 +568,7 @@ const is = Object.values(vt), Be = {
559
568
  { value: "between", label: "Between dates" },
560
569
  { value: "within_year", label: "Within year" },
561
570
  { value: "specific", label: "Specific date" }
562
- ], Ws = [
571
+ ], Qs = [
563
572
  { value: "today", label: "Today" },
564
573
  { value: "before", label: "Before date" },
565
574
  { value: "within_week", label: "Within week" },
@@ -568,7 +577,7 @@ const is = Object.values(vt), Be = {
568
577
  { value: "between", label: "Between dates" },
569
578
  { value: "within_year", label: "Within year" },
570
579
  { value: "specific", label: "Specific date" }
571
- ], Qs = [
580
+ ], Zs = [
572
581
  "#ffffff",
573
582
  "#99a1af",
574
583
  "#000000",
@@ -582,34 +591,34 @@ const is = Object.values(vt), Be = {
582
591
  "#1447e6",
583
592
  "#7f22fe",
584
593
  "#e60076"
585
- ], Zs = [
594
+ ], Js = [
586
595
  { label: "None (Exact)", value: "0" },
587
596
  { label: "Small", value: "1" },
588
597
  { label: "Medium", value: "2" },
589
598
  { label: "Large", value: "4" }
590
599
  ], kt = [
591
- { label: "Is", value: x.IS },
592
- { label: "Contains", value: x.CONTAINS_IN_TEXT }
600
+ { label: "Is", value: w.IS },
601
+ { label: "Contains", value: w.CONTAINS_IN_TEXT }
593
602
  ], ee = [
594
- { label: "Is", value: x.IS },
595
- { label: "Is not", value: x.IS_NOT }
603
+ { label: "Is", value: w.IS },
604
+ { label: "Is not", value: w.IS_NOT }
596
605
  ], St = [
597
- { label: "Is", value: x.IS_EXACT },
598
- { label: "Contains", value: x.IS },
599
- { label: "Does not contain", value: x.IS_NOT }
606
+ { label: "Is", value: w.IS_EXACT },
607
+ { label: "Contains", value: w.IS },
608
+ { label: "Does not contain", value: w.IS_NOT }
600
609
  ], Ct = [
601
- { label: "Is", value: x.IS },
602
- { label: "Greater than", value: x.GREATER_THAN_OR_EQUAL },
603
- { label: "Is not", value: x.IS_NOT },
604
- { label: "Less than", value: x.LESS_THAN_OR_EQUAL },
605
- { label: "Between", value: x.RANGE }
606
- ], Js = [
607
- { label: "Is", value: x.IS_EXACT },
608
- { label: "Is not", value: x.IS_NOT }
609
- ], Qt = [
610
- { label: "Contains", value: x.CONTAINS },
611
- { label: "Does not contain", value: x.IS_NOT }
610
+ { label: "Is", value: w.IS },
611
+ { label: "Greater than", value: w.GREATER_THAN_OR_EQUAL },
612
+ { label: "Is not", value: w.IS_NOT },
613
+ { label: "Less than", value: w.LESS_THAN_OR_EQUAL },
614
+ { label: "Between", value: w.RANGE }
612
615
  ], ea = [
616
+ { label: "Is", value: w.IS_EXACT },
617
+ { label: "Is not", value: w.IS_NOT }
618
+ ], Zt = [
619
+ { label: "Contains", value: w.CONTAINS },
620
+ { label: "Does not contain", value: w.IS_NOT }
621
+ ], ta = [
613
622
  { value: "APPROVED", label: "Approved", icon: "circle-check-big", iconColor: "var(--ap-success, oklch(0.637 0.17 151.295))" },
614
623
  { value: "PENDING", label: "Pending", icon: "clock", iconColor: "var(--ap-warning, oklch(0.734 0.157 69.419))" },
615
624
  { value: "REJECTED", label: "Rejected", icon: "x-circle", iconColor: "var(--ap-destructive, oklch(0.577 0.215 27.325))" },
@@ -620,60 +629,74 @@ const is = Object.values(vt), Be = {
620
629
  ], Ft = [
621
630
  ...ye,
622
631
  { label: "Specific", value: be }
623
- ], ta = [
632
+ ], sa = [
624
633
  { label: "Empty", value: K },
625
634
  { label: "Not empty", value: G },
626
635
  { label: "True", value: "true" },
627
636
  { label: "False", value: "false" }
628
- ], sa = {
629
- [C.TEXT]: "text",
630
- [C.TEXT_AREA]: "text",
631
- [C.NUMERIC]: "number",
632
- [C.DECIMAL2]: "number",
633
- [C.BOOLEAN]: "boolean",
634
- [C.SELECT_ONE]: "select-one",
635
- [C.MULTI_SELECT]: "multi-select",
636
- [C.SUPERTAGS]: "tags",
637
- [C.DATE]: "date",
638
- [C.GEO_POINT]: "geo",
639
- [C.ATTACHMENTS_ASSETS]: "attachment",
640
- [C.ATTACHMENT_URI]: "attachment",
641
- [C.INTEGER_LIST]: "attachment"
637
+ ], Et = {
638
+ [x.DATE]: "calendar",
639
+ [x.BOOLEAN]: "toggle-left",
640
+ [x.NUMERIC]: "file-digit",
641
+ [x.DECIMAL2]: "decimals-arrow-right",
642
+ [x.ATTACHMENTS_ASSETS]: "paperclip",
643
+ [x.ATTACHMENT_URI]: "link-2",
644
+ [x.SELECT_ONE]: "circle-dot",
645
+ [x.MULTI_SELECT]: "square-check",
646
+ [x.SUPERTAGS]: "hash",
647
+ [x.TEXT]: "text-initial",
648
+ [x.TEXT_AREA]: "text-align-justify",
649
+ [x.GEO_POINT]: "locate",
650
+ [x.INTEGER_LIST]: "list-ordered"
651
+ }, aa = {
652
+ [x.TEXT]: "text",
653
+ [x.TEXT_AREA]: "text",
654
+ [x.NUMERIC]: "number",
655
+ [x.DECIMAL2]: "number",
656
+ [x.BOOLEAN]: "boolean",
657
+ [x.SELECT_ONE]: "select-one",
658
+ [x.MULTI_SELECT]: "multi-select",
659
+ [x.SUPERTAGS]: "tags",
660
+ [x.DATE]: "date",
661
+ [x.GEO_POINT]: "geo",
662
+ [x.ATTACHMENTS_ASSETS]: "attachment",
663
+ [x.ATTACHMENT_URI]: "attachment",
664
+ [x.INTEGER_LIST]: "attachment"
642
665
  };
643
- async function aa(t) {
644
- var b, E, y, D;
645
- const e = await t.request("/settings"), s = e.settings ?? e, i = (s == null ? void 0 : s.metadata) ?? e.metadata, r = ((i == null ? void 0 : i.model) ?? [])[Vs], o = i == null ? void 0 : i.store, c = ((o == null ? void 0 : o.regional_variants_groups) ?? []).map((F) => ({
646
- uuid: F.uuid,
647
- label: F.label ?? F.name ?? "",
648
- variants: (F.variants ?? []).map((A) => ({
666
+ async function ia(t) {
667
+ var b, E;
668
+ const e = await t.request("/settings"), s = e.settings ?? e, i = (s == null ? void 0 : s.metadata) ?? e.metadata, r = ((i == null ? void 0 : i.model) ?? [])[qs], o = i == null ? void 0 : i.store, c = ((o == null ? void 0 : o.regional_variants_groups) ?? []).map((y) => ({
669
+ uuid: y.uuid,
670
+ label: y.label ?? y.name ?? "",
671
+ variants: (y.variants ?? []).map((A) => ({
649
672
  api_value: A.api_value ?? A.value ?? "",
650
673
  internal_unique_value: A.internal_unique_value ?? A.api_value ?? "",
651
674
  label: A.label ?? A.name ?? ""
652
675
  }))
653
- })).filter((F) => F.variants.length > 1), p = {};
654
- for (const F of c)
655
- p[F.uuid] = ((b = F.variants[0]) == null ? void 0 : b.api_value) ?? "";
676
+ })).filter((y) => y.variants.length > 1), p = {};
677
+ for (const y of c)
678
+ p[y.uuid] = ((b = y.variants[0]) == null ? void 0 : b.api_value) ?? "";
656
679
  const u = (s == null ? void 0 : s.project_branding) ?? ((E = e.settings) == null ? void 0 : E.project_branding), v = u == null ? void 0 : u.brandColor;
657
680
  if (!r) return { fields: [], regionalVariantGroups: c, regionalFilters: p, brandColor: v };
658
681
  const d = r.groups ?? [], g = [];
659
- for (const F of d) {
660
- const A = ((y = F.name) == null ? void 0 : y.toLowerCase()) === "products" || ((D = F.name) == null ? void 0 : D.toLowerCase()) === "product fields";
661
- for (const L of F.fields ?? []) {
662
- const I = L.possible_values, N = I == null ? void 0 : I.map((O) => ({
663
- api_value: O.api_value ?? O.value ?? "",
664
- internal_unique_value: O.internal_unique_value ?? O.api_value ?? "",
665
- label: O.label ?? O.name ?? O.api_value ?? ""
682
+ for (const y of d) {
683
+ const A = y.name || "Root fields";
684
+ for (const F of y.fields ?? []) {
685
+ const I = F.possible_values, H = I == null ? void 0 : I.map((T) => ({
686
+ api_value: T.api_value ?? T.value ?? "",
687
+ internal_unique_value: T.internal_unique_value ?? T.api_value ?? "",
688
+ label: T.label ?? T.name ?? T.api_value ?? ""
666
689
  }));
667
690
  g.push({
668
691
  // Use field.key (not ckey) — this is what a.meta uses as keys
669
- key: L.key ?? L.ckey,
670
- label: L.title ?? L.label ?? L.key ?? "",
671
- type: L.type ?? "text",
672
- slug: L.slug,
673
- ckey: L.ckey,
674
- possible_values: N,
675
- group: A ? "product" : "root",
676
- regionalVariantsGroupUuid: L.regional_variants_group_uuid
692
+ key: F.key ?? F.ckey,
693
+ label: F.title ?? F.label ?? F.key ?? "",
694
+ type: F.type ?? "text",
695
+ slug: F.slug,
696
+ ckey: F.ckey,
697
+ possible_values: H,
698
+ group: A,
699
+ regionalVariantsGroupUuid: F.regional_variants_group_uuid
677
700
  });
678
701
  }
679
702
  }
@@ -685,7 +708,7 @@ function _e(t) {
685
708
  function at() {
686
709
  return _e(/* @__PURE__ */ new Date());
687
710
  }
688
- function ps(t) {
711
+ function hs(t) {
689
712
  const e = /* @__PURE__ */ new Date();
690
713
  switch (t) {
691
714
  case "today":
@@ -721,30 +744,30 @@ function ps(t) {
721
744
  return null;
722
745
  }
723
746
  }
724
- function Zt(t, e) {
725
- return e ? e.type === "date" ? ia(e) : e.type === "string" ? ra(e) : !0 : !1;
747
+ function Jt(t, e) {
748
+ return e ? e.type === "date" ? ra(e) : e.type === "string" ? oa(e) : !0 : !1;
726
749
  }
727
- function ia(t) {
750
+ function ra(t) {
728
751
  return !(!t.kind && !t.preset || t.kind === "preset" && !t.preset || t.kind === "between" && !t.from && !t.to || t.kind === "after" && !t.from || t.kind === "before" && !t.to || t.kind === "specific" && !t.from || t.from && t.to && new Date(t.from) > new Date(t.to));
729
752
  }
730
- function ra(t) {
753
+ function oa(t) {
731
754
  return !t.values || !Array.isArray(t.values) ? !1 : t.values.filter(Boolean).length > 0;
732
755
  }
733
- function oa(t, e = {}) {
756
+ function na(t, e = {}) {
734
757
  const s = [];
735
758
  for (const [i, a] of Object.entries(t)) {
736
- if (!a || !Zt(i, a)) continue;
737
- const r = la(i, a);
759
+ if (!a || !Jt(i, a)) continue;
760
+ const r = ca(i, a);
738
761
  s.push(...r);
739
762
  }
740
763
  for (const [i, a] of Object.entries(e)) {
741
- if (!a || !Zt(i, a)) continue;
742
- const r = ua(i, a);
764
+ if (!a || !Jt(i, a)) continue;
765
+ const r = ga(i, a);
743
766
  s.push(...r);
744
767
  }
745
- return na(s);
768
+ return la(s);
746
769
  }
747
- function na(t) {
770
+ function la(t) {
748
771
  const e = [], s = [], i = [];
749
772
  for (const a of t)
750
773
  a.startsWith("type:") || a.startsWith("type=") ? e.push(a) : a.startsWith("mimetype:") || a.startsWith("mimetype=") ? s.push(a) : i.push(a);
@@ -755,49 +778,49 @@ function na(t) {
755
778
  i.push(...e, ...s);
756
779
  return i;
757
780
  }
758
- function la(t, e) {
781
+ function ca(t, e) {
759
782
  if (e.type === "date")
760
- return hs(t, e);
783
+ return us(t, e);
761
784
  if (t === m.IMAGE)
762
- return ha(e);
763
- const s = e, { operator: i = ns, values: a = [], logic: r } = s;
785
+ return ua(e);
786
+ const s = e, { operator: i = ls, values: a = [], logic: r } = s;
764
787
  if (a.length === 0) return [];
765
788
  switch (t) {
766
789
  case m.SIZE:
767
- return ca(t, a, "..");
790
+ return da(t, a, "..");
768
791
  case m.FACES:
769
- return da(t, i, a);
792
+ return pa(t, i, a);
770
793
  case m.TAGS:
771
- return xe(t, i, es(a), ",", r);
794
+ return xe(t, i, ts(a), ",", r);
772
795
  case m.LABELS:
773
- return xe(t, i, es(a), ",", r);
796
+ return xe(t, i, ts(a), ",", r);
774
797
  case m.COLOR:
775
- return pa(i, a, r);
798
+ return ha(i, a, r);
776
799
  case m.TYPE:
777
- return Jt(t, a, i);
800
+ return es(t, a, i);
778
801
  case m.MIME_TYPE:
779
- return Jt(t, a, i);
802
+ return es(t, a, i);
780
803
  case m.PRODUCT_REF:
781
804
  return xe(t, "=%", a, ",", r);
782
805
  default:
783
806
  return xe(t, i, a, ",", r);
784
807
  }
785
808
  }
786
- function hs(t, e) {
809
+ function us(t, e) {
787
810
  const s = e.field || "created";
788
- if (e.kind === Be.PRESET && e.preset) {
789
- if (e.preset === Xt.EMPTY)
811
+ if (e.kind === Ue.PRESET && e.preset) {
812
+ if (e.preset === Wt.EMPTY)
790
813
  return [`${s}:"empty"`];
791
- if (e.preset === Xt.NOT_EMPTY)
814
+ if (e.preset === Wt.NOT_EMPTY)
792
815
  return [`${s}:"non-empty"`];
793
- const i = ps(e.preset);
816
+ const i = hs(e.preset);
794
817
  return i ? i.to === null ? [`${s}>"${i.from}"`] : [`${s}:"${i.from}..${i.to}"`] : [];
795
818
  }
796
- if (e.kind === Be.AFTER && e.from)
819
+ if (e.kind === Ue.AFTER && e.from)
797
820
  return [`${s}:>"${e.from}"`];
798
- if (e.kind === Be.BEFORE && e.to)
821
+ if (e.kind === Ue.BEFORE && e.to)
799
822
  return [`${s}:<"${e.to}"`];
800
- if (e.kind === Be.BETWEEN) {
823
+ if (e.kind === Ue.BETWEEN) {
801
824
  if (e.from && e.to)
802
825
  return [`${s}:"${e.from}..${e.to}"`];
803
826
  if (e.from && !e.to)
@@ -805,52 +828,52 @@ function hs(t, e) {
805
828
  if (!e.from && e.to)
806
829
  return [`${s}:<"${e.to}"`];
807
830
  }
808
- return e.kind === Be.SPECIFIC && e.from ? [`${s}:"${e.from}"`] : [];
831
+ return e.kind === Ue.SPECIFIC && e.from ? [`${s}:"${e.from}"`] : [];
809
832
  }
810
- function ca(t, e, s) {
833
+ function da(t, e, s) {
811
834
  return e.length === 0 ? [] : [`${t}:"${e.join(s)}"`];
812
835
  }
813
- function da(t, e, s) {
836
+ function pa(t, e, s) {
814
837
  return s.length === 0 ? [] : [`${t}${e}"${s.join(",")}"`];
815
838
  }
816
839
  function xe(t, e, s, i, a) {
817
840
  if (s.length === 0) return [];
818
- if (a === Us.AND)
841
+ if (a === Vs.AND)
819
842
  return s.map((o) => `${t}${e}"${o}"`);
820
843
  const r = s.map((o) => `"${o}"`).join(i);
821
844
  return [`${t}${e}${r}`];
822
845
  }
823
- function pa(t, e, s) {
846
+ function ha(t, e, s) {
824
847
  const i = [], a = xe("color_search", t, e, ",", s);
825
848
  return i.push(...a), i.push('color_operator:"AND"'), i;
826
849
  }
827
- function Jt(t, e, s, i) {
850
+ function es(t, e, s, i) {
828
851
  if (e.length === 0) return [];
829
852
  const a = e.map((r) => `"${r}"`).join(",");
830
853
  return [`${t}${s}${a}`];
831
854
  }
832
- function ha(t) {
855
+ function ua(t) {
833
856
  const e = [];
834
857
  if (typeof t == "object" && t !== null && !Array.isArray(t)) {
835
858
  const o = t, l = o.resolution, c = o.orientation, p = o.faces;
836
859
  return l != null && l.length && e.push(`resolution:"${l.join(",")}"`), c != null && c.length && e.push(`orientation:"${c.join(",")}"`), p != null && p.length && e.push(`faces:"${p.join(",")}"`), e;
837
860
  }
838
- const s = t, i = s[wt.RESOLUTION], a = s[wt.ORIENTATION], r = s[wt.FACES];
861
+ const s = t, i = s[$t.RESOLUTION], a = s[$t.ORIENTATION], r = s[$t.FACES];
839
862
  return i && e.push(`resolution:"${i}"`), a && e.push(`orientation:"${a}"`), r && e.push(`faces:"${r}"`), e;
840
863
  }
841
- function ua(t, e) {
842
- const s = va(t), i = fa(t);
864
+ function ga(t, e) {
865
+ const s = ma(t), i = va(t);
843
866
  if (e.type === "date")
844
- return ga(s, e, i);
845
- const a = e, { operator: r = ns, values: o = [], logic: l, metadataType: c } = a;
867
+ return fa(s, e, i);
868
+ const a = e, { operator: r = ls, values: o = [], logic: l, metadataType: c } = a;
846
869
  if (o.length === 0) return [];
847
870
  if (o.length === 1 && (o[0] === K || o[0] === G)) {
848
- const p = c === C.GEO_POINT ? x.IS + "~" : x.IS;
871
+ const p = c === x.GEO_POINT ? w.IS + "~" : w.IS;
849
872
  return [`${s}${p}"${o[0]}"`];
850
873
  }
851
- if ((c === C.NUMERIC || c === C.DECIMAL2) && r === x.RANGE)
852
- return [`${s}${x.IS}"${o.join('","')}"`];
853
- if (c === C.GEO_POINT) {
874
+ if ((c === x.NUMERIC || c === x.DECIMAL2) && r === w.RANGE)
875
+ return [`${s}${w.IS}"${o.join('","')}"`];
876
+ if (c === x.GEO_POINT) {
854
877
  const p = o.map((u) => {
855
878
  const v = u.indexOf("..");
856
879
  if (v === -1) return `(${u})`;
@@ -861,8 +884,8 @@ function ua(t, e) {
861
884
  }
862
885
  return xe(s, r, o, ",", l);
863
886
  }
864
- function ga(t, e, s) {
865
- const i = hs(t, e);
887
+ function fa(t, e, s) {
888
+ const i = us(t, e);
866
889
  return !s || i.length === 0 ? i : i.map((a) => {
867
890
  const r = a.search(/[^a-zA-Z0-9_]/);
868
891
  if (r === -1) return `"${a}"`;
@@ -870,32 +893,32 @@ function ga(t, e, s) {
870
893
  return `"${o}${c}"`;
871
894
  });
872
895
  }
873
- function fa(t) {
896
+ function va(t) {
874
897
  return t.startsWith("date_");
875
898
  }
876
- function va(t) {
877
- for (const e of is)
899
+ function ma(t) {
900
+ for (const e of rs)
878
901
  if (t.startsWith(e))
879
902
  return t.slice(e.length);
880
903
  return t;
881
904
  }
882
- function es(t) {
905
+ function ts(t) {
883
906
  return t.map((e) => e.replace(/#/g, ""));
884
907
  }
885
- const ma = /* @__PURE__ */ new Set([
908
+ const ba = /* @__PURE__ */ new Set([
886
909
  m.DATE,
887
910
  m.LICENSE_EXPIRY,
888
- V.DUE_DATE
911
+ B.DUE_DATE
889
912
  ]);
890
- function Ue(t) {
913
+ function Be(t) {
891
914
  if (!t) return {};
892
915
  const e = {};
893
916
  for (const [s, i] of Object.entries(t))
894
- i && (e[s] = ba(s, i));
917
+ i && (e[s] = _a(s, i));
895
918
  return e;
896
919
  }
897
- function ba(t, e) {
898
- return e.type === "string" || e.type === "date" ? e : ma.has(t) ? {
920
+ function _a(t, e) {
921
+ return e.type === "string" || e.type === "date" ? e : ba.has(t) ? {
899
922
  type: "date",
900
923
  field: e.field ?? "created",
901
924
  kind: e.kind ?? null,
@@ -909,13 +932,13 @@ function ba(t, e) {
909
932
  ...e.logic !== void 0 && { logic: e.logic }
910
933
  };
911
934
  }
912
- function _a(t) {
913
- const e = localStorage.getItem(rs + t), s = localStorage.getItem(os + t);
935
+ function ya(t) {
936
+ const e = localStorage.getItem(os + t), s = localStorage.getItem(ns + t);
914
937
  let i;
915
938
  try {
916
- i = e ? JSON.parse(e) : [...Wt];
939
+ i = e ? JSON.parse(e) : [...Qt];
917
940
  } catch {
918
- i = [...Wt];
941
+ i = [...Qt];
919
942
  }
920
943
  let a;
921
944
  try {
@@ -925,70 +948,70 @@ function _a(t) {
925
948
  }
926
949
  return { pinnedFilters: i, pinnedMetadata: a };
927
950
  }
928
- function ya(t, e) {
929
- localStorage.setItem(rs + t, JSON.stringify(e));
930
- }
931
951
  function xa(t, e) {
932
952
  localStorage.setItem(os + t, JSON.stringify(e));
933
953
  }
934
- const us = "sort-by", gs = "sort-order";
935
- function ts(t, e) {
954
+ function wa(t, e) {
955
+ localStorage.setItem(ns + t, JSON.stringify(e));
956
+ }
957
+ const gs = "sort-by", fs = "sort-order";
958
+ function ss(t, e) {
936
959
  try {
937
- localStorage.setItem(us, t), localStorage.setItem(gs, e);
960
+ localStorage.setItem(gs, t), localStorage.setItem(fs, e);
938
961
  } catch {
939
962
  }
940
963
  }
941
964
  function $a() {
942
965
  try {
943
- const t = localStorage.getItem(us), e = localStorage.getItem(gs);
966
+ const t = localStorage.getItem(gs), e = localStorage.getItem(fs);
944
967
  return { sortBy: t, sortDirection: e };
945
968
  } catch {
946
969
  return { sortBy: null, sortDirection: null };
947
970
  }
948
971
  }
949
- const fs = "ap-last-folder", vs = "ap-last-view";
950
- function ss(t) {
972
+ const vs = "ap-last-folder", ms = "ap-last-view";
973
+ function as(t) {
951
974
  try {
952
- localStorage.setItem(fs, t);
975
+ localStorage.setItem(vs, t);
953
976
  } catch {
954
977
  }
955
978
  }
956
- function wa() {
979
+ function ka() {
957
980
  try {
958
- return localStorage.getItem(fs);
981
+ return localStorage.getItem(vs);
959
982
  } catch {
960
983
  return null;
961
984
  }
962
985
  }
963
- function ka(t) {
986
+ function Sa(t) {
964
987
  try {
965
- localStorage.setItem(vs, t);
988
+ localStorage.setItem(ms, t);
966
989
  } catch {
967
990
  }
968
991
  }
969
- function Sa() {
992
+ function Ca() {
970
993
  try {
971
- return localStorage.getItem(vs);
994
+ return localStorage.getItem(ms);
972
995
  } catch {
973
996
  return null;
974
997
  }
975
998
  }
976
- function Ca(t) {
999
+ function Fa(t) {
977
1000
  const e = t.replace("#", ""), s = e.length === 3 ? e[0] + e[0] + e[1] + e[1] + e[2] + e[2] : e, i = parseInt(s.slice(0, 2), 16) / 255, a = parseInt(s.slice(2, 4), 16) / 255, r = parseInt(s.slice(4, 6), 16) / 255;
978
1001
  return [i, a, r];
979
1002
  }
980
- function Et(t) {
1003
+ function At(t) {
981
1004
  return t <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
982
1005
  }
983
- function Fa(t, e, s) {
984
- const i = Et(t), a = Et(e), r = Et(s), o = 0.4122214708 * i + 0.5363325363 * a + 0.0514459929 * r, l = 0.2119034982 * i + 0.6806995451 * a + 0.1073969566 * r, c = 0.0883024619 * i + 0.2817188376 * a + 0.6299787005 * r, p = Math.cbrt(o), u = Math.cbrt(l), v = Math.cbrt(c), d = 0.2104542553 * p + 0.793617785 * u - 0.0040720468 * v, g = 1.9779984951 * p - 2.428592205 * u + 0.4505937099 * v, b = 0.0259040371 * p + 0.7827717662 * u - 0.808675766 * v, E = Math.sqrt(g * g + b * b);
1006
+ function Ea(t, e, s) {
1007
+ const i = At(t), a = At(e), r = At(s), o = 0.4122214708 * i + 0.5363325363 * a + 0.0514459929 * r, l = 0.2119034982 * i + 0.6806995451 * a + 0.1073969566 * r, c = 0.0883024619 * i + 0.2817188376 * a + 0.6299787005 * r, p = Math.cbrt(o), u = Math.cbrt(l), v = Math.cbrt(c), d = 0.2104542553 * p + 0.793617785 * u - 0.0040720468 * v, g = 1.9779984951 * p - 2.428592205 * u + 0.4505937099 * v, b = 0.0259040371 * p + 0.7827717662 * u - 0.808675766 * v, E = Math.sqrt(g * g + b * b);
985
1008
  let y = Math.atan2(b, g) * (180 / Math.PI);
986
1009
  return y < 0 && (y += 360), [d, E, y];
987
1010
  }
988
- function Ea(t) {
1011
+ function Aa(t) {
989
1012
  return t > 0.7;
990
1013
  }
991
- function Aa(t, e) {
1014
+ function Ta(t, e) {
992
1015
  const s = [
993
1016
  "--ap-primary",
994
1017
  "--ap-primary-foreground",
@@ -1004,18 +1027,18 @@ function Aa(t, e) {
1004
1027
  t.style.removeProperty(v);
1005
1028
  return;
1006
1029
  }
1007
- const [i, a, r] = Ca(e), [o, l, c] = Fa(i, a, r), p = `oklch(${o.toFixed(3)} ${l.toFixed(3)} ${c.toFixed(1)})`, u = Ea(o) ? "#000" : "#fff";
1030
+ const [i, a, r] = Fa(e), [o, l, c] = Ea(i, a, r), p = `oklch(${o.toFixed(3)} ${l.toFixed(3)} ${c.toFixed(1)})`, u = Aa(o) ? "#000" : "#fff";
1008
1031
  t.style.setProperty("--ap-primary", p), t.style.setProperty("--ap-primary-foreground", u), t.style.setProperty("--ap-primary-10", `oklch(${o.toFixed(3)} ${l.toFixed(3)} ${c.toFixed(1)} / 0.1)`), t.style.setProperty("--ap-primary-20", `oklch(${o.toFixed(3)} ${l.toFixed(3)} ${c.toFixed(1)} / 0.2)`), t.style.setProperty("--ap-accent", `oklch(${o.toFixed(3)} ${l.toFixed(3)} ${c.toFixed(1)} / 0.07)`), t.style.setProperty("--ap-accent-foreground", p), t.style.setProperty("--ap-ring", `oklch(${o.toFixed(3)} ${l.toFixed(3)} ${c.toFixed(1)} / 0.7)`), t.style.setProperty("--ap-selection-bg", `oklch(${o.toFixed(3)} ${l.toFixed(3)} ${c.toFixed(1)} / 0.08)`);
1009
1032
  }
1010
- const It = [
1033
+ const Dt = [
1011
1034
  { value: "name", label: "Name" },
1012
1035
  { value: "created_at", label: "Uploaded" },
1013
1036
  { value: "modified_at", label: "Modified" },
1014
1037
  { value: "size", label: "Size" },
1015
1038
  { value: "type", label: "Format" }
1016
- ], Ta = [
1039
+ ], Ma = [
1017
1040
  { value: "relevance", label: "Relevance" },
1018
- ...It
1041
+ ...Dt
1019
1042
  ], Oa = [
1020
1043
  { value: "name", label: "Name" },
1021
1044
  { value: "created_at", label: "Uploaded" },
@@ -1023,12 +1046,12 @@ const It = [
1023
1046
  { value: "files_count_recursive", label: "Assets count" },
1024
1047
  { value: "files_size_recursive", label: "Assets size" }
1025
1048
  ];
1026
- var Ma = Object.defineProperty, Pa = Object.getOwnPropertyDescriptor, Dt = (t, e, s, i) => {
1027
- for (var a = i > 1 ? void 0 : i ? Pa(e, s) : e, r = t.length - 1, o; r >= 0; r--)
1049
+ var Pa = Object.defineProperty, La = Object.getOwnPropertyDescriptor, zt = (t, e, s, i) => {
1050
+ for (var a = i > 1 ? void 0 : i ? La(e, s) : e, r = t.length - 1, o; r >= 0; r--)
1028
1051
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
1029
- return i && a && Ma(e, s, a), a;
1052
+ return i && a && Pa(e, s, a), a;
1030
1053
  };
1031
- let qe = class extends w {
1054
+ let qe = class extends k {
1032
1055
  constructor() {
1033
1056
  super(...arguments), this.open = !1;
1034
1057
  }
@@ -1149,16 +1172,16 @@ qe.styles = $`
1149
1172
  }
1150
1173
  }
1151
1174
  `;
1152
- Dt([
1175
+ zt([
1153
1176
  h({ type: Boolean })
1154
1177
  ], qe.prototype, "open", 2);
1155
- Dt([
1178
+ zt([
1156
1179
  Se("dialog")
1157
1180
  ], qe.prototype, "dialog", 2);
1158
- qe = Dt([
1159
- k("ap-modal")
1181
+ qe = zt([
1182
+ S("ap-modal")
1160
1183
  ], qe);
1161
- function La(t, e) {
1184
+ function Ia(t, e) {
1162
1185
  let s;
1163
1186
  const i = ((...a) => {
1164
1187
  clearTimeout(s), s = setTimeout(() => t(...a), e);
@@ -1170,12 +1193,12 @@ const ie = $`
1170
1193
  box-sizing: border-box;
1171
1194
  }
1172
1195
  `;
1173
- var Ia = Object.defineProperty, Da = Object.getOwnPropertyDescriptor, mt = (t, e, s, i) => {
1174
- for (var a = i > 1 ? void 0 : i ? Da(e, s) : e, r = t.length - 1, o; r >= 0; r--)
1196
+ var Da = Object.defineProperty, za = Object.getOwnPropertyDescriptor, mt = (t, e, s, i) => {
1197
+ for (var a = i > 1 ? void 0 : i ? za(e, s) : e, r = t.length - 1, o; r >= 0; r--)
1175
1198
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
1176
- return i && a && Ia(e, s, a), a;
1199
+ return i && a && Da(e, s, a), a;
1177
1200
  };
1178
- let Pe = class extends w {
1201
+ let Pe = class extends k {
1179
1202
  constructor() {
1180
1203
  super(...arguments), this.groups = [], this.selectedFilters = {}, this._open = !1, this._handleOutsideClick = (t) => {
1181
1204
  this._open && !t.composedPath().includes(this) && (this._open = !1);
@@ -1329,20 +1352,20 @@ mt([
1329
1352
  _()
1330
1353
  ], Pe.prototype, "_open", 2);
1331
1354
  Pe = mt([
1332
- k("ap-regional-settings")
1355
+ S("ap-regional-settings")
1333
1356
  ], Pe);
1334
- var za = Object.defineProperty, Ra = Object.getOwnPropertyDescriptor, re = (t, e, s, i) => {
1335
- for (var a = i > 1 ? void 0 : i ? Ra(e, s) : e, r = t.length - 1, o; r >= 0; r--)
1357
+ var Ra = Object.defineProperty, Na = Object.getOwnPropertyDescriptor, re = (t, e, s, i) => {
1358
+ for (var a = i > 1 ? void 0 : i ? Na(e, s) : e, r = t.length - 1, o; r >= 0; r--)
1336
1359
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
1337
- return i && a && za(e, s, a), a;
1360
+ return i && a && Ra(e, s, a), a;
1338
1361
  };
1339
- const Na = [
1362
+ const ja = [
1340
1363
  { value: "assets", label: "Assets", icon: "gallery-vertical-end" },
1341
1364
  { value: "folders", label: "Folders", icon: "folder-open" }
1342
1365
  ];
1343
- let W = class extends w {
1366
+ let W = class extends k {
1344
1367
  constructor() {
1345
- super(...arguments), this.activeTab = "assets", this.tabs = ["assets", "folders"], this.viewMode = "grid", this.searchQuery = "", this.regionalGroups = [], this.regionalFilters = {}, this.hideClose = !1, this._localSearch = "", this._debouncedSearch = La((t) => {
1368
+ super(...arguments), this.activeTab = "assets", this.tabs = ["assets", "folders"], this.viewMode = "grid", this.searchQuery = "", this.regionalGroups = [], this.regionalFilters = {}, this.hideClose = !1, this._localSearch = "", this._debouncedSearch = Ia((t) => {
1346
1369
  (t.length === 0 || t.length >= 3) && this.dispatchEvent(new CustomEvent("search-change", { detail: { value: t }, bubbles: !0, composed: !0 }));
1347
1370
  }, 300);
1348
1371
  }
@@ -1378,7 +1401,7 @@ let W = class extends w {
1378
1401
  }
1379
1402
  render() {
1380
1403
  var e, s;
1381
- const t = Na.filter((i) => this.tabs.includes(i.value));
1404
+ const t = ja.filter((i) => this.tabs.includes(i.value));
1382
1405
  return ((e = t.find((i) => i.value === this.activeTab)) == null ? void 0 : e.label) ?? ((s = t[0]) == null || s.label), n`
1383
1406
  <div class="header-row">
1384
1407
  ${t.length > 1 ? n`<ap-dropdown
@@ -1557,14 +1580,14 @@ re([
1557
1580
  _()
1558
1581
  ], W.prototype, "_localSearch", 2);
1559
1582
  W = re([
1560
- k("ap-header")
1583
+ S("ap-header")
1561
1584
  ], W);
1562
- var ja = Object.defineProperty, Ba = Object.getOwnPropertyDescriptor, ms = (t, e, s, i) => {
1585
+ var Ua = Object.defineProperty, Ba = Object.getOwnPropertyDescriptor, bs = (t, e, s, i) => {
1563
1586
  for (var a = i > 1 ? void 0 : i ? Ba(e, s) : e, r = t.length - 1, o; r >= 0; r--)
1564
1587
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
1565
- return i && a && ja(e, s, a), a;
1588
+ return i && a && Ua(e, s, a), a;
1566
1589
  };
1567
- let ot = class extends w {
1590
+ let ot = class extends k {
1568
1591
  constructor() {
1569
1592
  super(...arguments), this.items = [];
1570
1593
  }
@@ -1619,18 +1642,18 @@ ot.styles = $`
1619
1642
  color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
1620
1643
  }
1621
1644
  `;
1622
- ms([
1645
+ bs([
1623
1646
  h({ type: Array })
1624
1647
  ], ot.prototype, "items", 2);
1625
- ot = ms([
1626
- k("ap-breadcrumb")
1648
+ ot = bs([
1649
+ S("ap-breadcrumb")
1627
1650
  ], ot);
1628
- var Ua = Object.defineProperty, Va = Object.getOwnPropertyDescriptor, zt = (t, e, s, i) => {
1629
- for (var a = i > 1 ? void 0 : i ? Va(e, s) : e, r = t.length - 1, o; r >= 0; r--)
1651
+ var Va = Object.defineProperty, qa = Object.getOwnPropertyDescriptor, Rt = (t, e, s, i) => {
1652
+ for (var a = i > 1 ? void 0 : i ? qa(e, s) : e, r = t.length - 1, o; r >= 0; r--)
1630
1653
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
1631
- return i && a && Ua(e, s, a), a;
1654
+ return i && a && Va(e, s, a), a;
1632
1655
  };
1633
- let He = class extends w {
1656
+ let He = class extends k {
1634
1657
  constructor() {
1635
1658
  super(...arguments), this.title = "", this.open = !1;
1636
1659
  }
@@ -1649,7 +1672,7 @@ He.styles = $`
1649
1672
  }
1650
1673
  .popover {
1651
1674
  position: absolute;
1652
- top: calc(100% + 8px);
1675
+ top: calc(100% + 4px);
1653
1676
  left: 20px;
1654
1677
  z-index: 50;
1655
1678
  width: 320px;
@@ -1669,21 +1692,21 @@ He.styles = $`
1669
1692
  margin-bottom: 12px;
1670
1693
  }
1671
1694
  `;
1672
- zt([
1695
+ Rt([
1673
1696
  h()
1674
1697
  ], He.prototype, "title", 2);
1675
- zt([
1698
+ Rt([
1676
1699
  h({ type: Boolean })
1677
1700
  ], He.prototype, "open", 2);
1678
- He = zt([
1679
- k("ap-filter-popover")
1701
+ He = Rt([
1702
+ S("ap-filter-popover")
1680
1703
  ], He);
1681
- var qa = Object.defineProperty, Ha = Object.getOwnPropertyDescriptor, bs = (t, e, s, i) => {
1682
- for (var a = i > 1 ? void 0 : i ? Ha(e, s) : e, r = t.length - 1, o; r >= 0; r--)
1704
+ var Ha = Object.defineProperty, Ka = Object.getOwnPropertyDescriptor, _s = (t, e, s, i) => {
1705
+ for (var a = i > 1 ? void 0 : i ? Ka(e, s) : e, r = t.length - 1, o; r >= 0; r--)
1683
1706
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
1684
- return i && a && qa(e, s, a), a;
1707
+ return i && a && Ha(e, s, a), a;
1685
1708
  };
1686
- let nt = class extends w {
1709
+ let nt = class extends k {
1687
1710
  constructor() {
1688
1711
  super(...arguments), this.selected = [];
1689
1712
  }
@@ -1694,7 +1717,7 @@ let nt = class extends w {
1694
1717
  detail: {
1695
1718
  key: m.TYPE,
1696
1719
  values: e,
1697
- operator: x.IS
1720
+ operator: w.IS
1698
1721
  },
1699
1722
  bubbles: !0,
1700
1723
  composed: !0
@@ -1705,7 +1728,7 @@ let nt = class extends w {
1705
1728
  return n`
1706
1729
  <div class="options">
1707
1730
  <span class="section-label">Formats</span>
1708
- ${ls.map(
1731
+ ${cs.map(
1709
1732
  (t) => n`
1710
1733
  <div
1711
1734
  class="option ${this.selected.includes(t.value) ? "selected" : ""}"
@@ -1771,11 +1794,11 @@ nt.styles = $`
1771
1794
  color: var(--ap-primary, oklch(0.578 0.198 268.129));
1772
1795
  }
1773
1796
  `;
1774
- bs([
1797
+ _s([
1775
1798
  h({ type: Array })
1776
1799
  ], nt.prototype, "selected", 2);
1777
- nt = bs([
1778
- k("ap-filter-type")
1800
+ nt = _s([
1801
+ S("ap-filter-type")
1779
1802
  ], nt);
1780
1803
  const oe = $`
1781
1804
  :host {
@@ -1894,6 +1917,28 @@ const oe = $`
1894
1917
  color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
1895
1918
  }
1896
1919
 
1920
+ /* ── Date input: Lucide calendar icon ── */
1921
+ .filter-input[type="date"]::-webkit-calendar-picker-indicator {
1922
+ opacity: 0;
1923
+ position: absolute;
1924
+ right: 0;
1925
+ top: 0;
1926
+ width: 100%;
1927
+ height: 100%;
1928
+ cursor: pointer;
1929
+ }
1930
+ .filter-input[type="date"] {
1931
+ position: relative;
1932
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
1933
+ background-repeat: no-repeat;
1934
+ background-position: right 10px center;
1935
+ background-size: 16px 16px;
1936
+ padding-right: 32px;
1937
+ }
1938
+ .input-label:has(+ .filter-input[type="date"]) {
1939
+ font-weight: 400;
1940
+ }
1941
+
1897
1942
  textarea.filter-input {
1898
1943
  min-height: 60px;
1899
1944
  resize: vertical;
@@ -2030,15 +2075,15 @@ const oe = $`
2030
2075
  color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
2031
2076
  }
2032
2077
  `;
2033
- var Ka = Object.defineProperty, Ga = Object.getOwnPropertyDescriptor, Ce = (t, e, s, i) => {
2034
- for (var a = i > 1 ? void 0 : i ? Ga(e, s) : e, r = t.length - 1, o; r >= 0; r--)
2078
+ var Ga = Object.defineProperty, Ya = Object.getOwnPropertyDescriptor, Ce = (t, e, s, i) => {
2079
+ for (var a = i > 1 ? void 0 : i ? Ya(e, s) : e, r = t.length - 1, o; r >= 0; r--)
2035
2080
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
2036
- return i && a && Ka(e, s, a), a;
2081
+ return i && a && Ga(e, s, a), a;
2037
2082
  };
2038
- function At(t) {
2083
+ function Tt(t) {
2039
2084
  return t.toISOString().split("T")[0];
2040
2085
  }
2041
- let te = class extends w {
2086
+ let te = class extends k {
2042
2087
  constructor() {
2043
2088
  super(...arguments), this.filterKey = m.DATE, this.field = "created", this.kind = null, this.preset = "", this.from = "", this.to = "";
2044
2089
  }
@@ -2046,10 +2091,10 @@ let te = class extends w {
2046
2091
  return this.filterKey === m.LICENSE_EXPIRY;
2047
2092
  }
2048
2093
  get _rangeOptions() {
2049
- return this._isLicenseExpiry ? ds : Lt;
2094
+ return this._isLicenseExpiry ? ps : It;
2050
2095
  }
2051
2096
  get _todayStr() {
2052
- return At(/* @__PURE__ */ new Date());
2097
+ return Tt(/* @__PURE__ */ new Date());
2053
2098
  }
2054
2099
  get _hasFilter() {
2055
2100
  return !!(this.kind || this.preset || this.from || this.to);
@@ -2067,7 +2112,7 @@ let te = class extends w {
2067
2112
  this.from = "", this.to = "", this.requestUpdate();
2068
2113
  return;
2069
2114
  }
2070
- const s = ps(t);
2115
+ const s = hs(t);
2071
2116
  s && (this.from = s.from, this.to = s.to ?? ""), this._dispatchChange();
2072
2117
  }
2073
2118
  _clearAll() {
@@ -2104,7 +2149,7 @@ let te = class extends w {
2104
2149
  <div class="filter-section">
2105
2150
  <span class="section-label">Date type</span>
2106
2151
  <ap-radio-group
2107
- .options=${cs}
2152
+ .options=${ds}
2108
2153
  .value=${this.field}
2109
2154
  @ap-change=${(t) => this._selectField(t.detail.value)}
2110
2155
  ></ap-radio-group>
@@ -2127,7 +2172,7 @@ let te = class extends w {
2127
2172
  _renderDateInputs() {
2128
2173
  const t = this.preset;
2129
2174
  if (!["before", "after", "between", "specific"].includes(t)) return f;
2130
- const e = this.from ? At(new Date(this.from)) : "", s = this.to ? At(new Date(this.to)) : "", i = this._todayStr;
2175
+ const e = this.from ? Tt(new Date(this.from)) : "", s = this.to ? Tt(new Date(this.to)) : "", i = this._todayStr;
2131
2176
  return t === "specific" ? n`
2132
2177
  <div class="filter-section date-inputs">
2133
2178
  <div>
@@ -2234,14 +2279,14 @@ Ce([
2234
2279
  h()
2235
2280
  ], te.prototype, "to", 2);
2236
2281
  te = Ce([
2237
- k("ap-filter-date")
2282
+ S("ap-filter-date")
2238
2283
  ], te);
2239
- var Ya = Object.defineProperty, Xa = Object.getOwnPropertyDescriptor, ze = (t, e, s, i) => {
2240
- for (var a = i > 1 ? void 0 : i ? Xa(e, s) : e, r = t.length - 1, o; r >= 0; r--)
2284
+ var Xa = Object.defineProperty, Wa = Object.getOwnPropertyDescriptor, ze = (t, e, s, i) => {
2285
+ for (var a = i > 1 ? void 0 : i ? Wa(e, s) : e, r = t.length - 1, o; r >= 0; r--)
2241
2286
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
2242
- return i && a && Ya(e, s, a), a;
2287
+ return i && a && Xa(e, s, a), a;
2243
2288
  };
2244
- let de = class extends w {
2289
+ let de = class extends k {
2245
2290
  constructor() {
2246
2291
  super(...arguments), this.tags = [], this.selected = [], this.filterKey = m.TAGS, this._search = "";
2247
2292
  }
@@ -2272,7 +2317,7 @@ let de = class extends w {
2272
2317
  detail: {
2273
2318
  key: this.filterKey,
2274
2319
  values: s,
2275
- operator: x.IS
2320
+ operator: w.IS
2276
2321
  },
2277
2322
  bubbles: !0,
2278
2323
  composed: !0
@@ -2286,7 +2331,7 @@ let de = class extends w {
2286
2331
  detail: {
2287
2332
  key: this.filterKey,
2288
2333
  values: e,
2289
- operator: x.IS
2334
+ operator: w.IS
2290
2335
  },
2291
2336
  bubbles: !0,
2292
2337
  composed: !0
@@ -2299,7 +2344,7 @@ let de = class extends w {
2299
2344
  detail: {
2300
2345
  key: this.filterKey,
2301
2346
  values: [],
2302
- operator: x.IS
2347
+ operator: w.IS
2303
2348
  },
2304
2349
  bubbles: !0,
2305
2350
  composed: !0
@@ -2534,14 +2579,14 @@ ze([
2534
2579
  _()
2535
2580
  ], de.prototype, "_search", 2);
2536
2581
  de = ze([
2537
- k("ap-filter-tags")
2582
+ S("ap-filter-tags")
2538
2583
  ], de);
2539
- var Wa = Object.defineProperty, Qa = Object.getOwnPropertyDescriptor, Qe = (t, e, s, i) => {
2540
- for (var a = i > 1 ? void 0 : i ? Qa(e, s) : e, r = t.length - 1, o; r >= 0; r--)
2584
+ var Qa = Object.defineProperty, Za = Object.getOwnPropertyDescriptor, Qe = (t, e, s, i) => {
2585
+ for (var a = i > 1 ? void 0 : i ? Za(e, s) : e, r = t.length - 1, o; r >= 0; r--)
2541
2586
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
2542
- return i && a && Wa(e, s, a), a;
2587
+ return i && a && Qa(e, s, a), a;
2543
2588
  };
2544
- let $e = class extends w {
2589
+ let we = class extends k {
2545
2590
  constructor() {
2546
2591
  super(...arguments), this.labels = [], this.selected = [], this._search = "";
2547
2592
  }
@@ -2552,7 +2597,7 @@ let $e = class extends w {
2552
2597
  });
2553
2598
  }
2554
2599
  get _atLimit() {
2555
- return this.selected.length >= $t;
2600
+ return this.selected.length >= wt;
2556
2601
  }
2557
2602
  get _isSearching() {
2558
2603
  return this._search.trim().length > 0;
@@ -2566,7 +2611,7 @@ let $e = class extends w {
2566
2611
  detail: {
2567
2612
  key: m.LABELS,
2568
2613
  values: s,
2569
- operator: x.IS
2614
+ operator: w.IS
2570
2615
  },
2571
2616
  bubbles: !0,
2572
2617
  composed: !0
@@ -2580,7 +2625,7 @@ let $e = class extends w {
2580
2625
  detail: {
2581
2626
  key: m.LABELS,
2582
2627
  values: e,
2583
- operator: x.IS
2628
+ operator: w.IS
2584
2629
  },
2585
2630
  bubbles: !0,
2586
2631
  composed: !0
@@ -2593,7 +2638,7 @@ let $e = class extends w {
2593
2638
  detail: {
2594
2639
  key: m.LABELS,
2595
2640
  values: [],
2596
- operator: x.IS
2641
+ operator: w.IS
2597
2642
  },
2598
2643
  bubbles: !0,
2599
2644
  composed: !0
@@ -2614,7 +2659,7 @@ let $e = class extends w {
2614
2659
  return n`
2615
2660
  <div
2616
2661
  class="label-item ${s ? "disabled" : ""}"
2617
- title=${s ? `You can select up to ${$t} labels` : f}
2662
+ title=${s ? `You can select up to ${wt} labels` : f}
2618
2663
  @click=${() => !s && this._toggle(t.sid)}
2619
2664
  >
2620
2665
  <ap-checkbox ?checked=${e}></ap-checkbox>
@@ -2689,14 +2734,14 @@ let $e = class extends w {
2689
2734
  ${this._atLimit ? n`
2690
2735
  <div class="info-alert">
2691
2736
  <ap-icon name="info" .size=${14}></ap-icon>
2692
- <span>You can select up to ${$t} labels.</span>
2737
+ <span>You can select up to ${wt} labels.</span>
2693
2738
  </div>
2694
2739
  ` : f}
2695
2740
  </div>
2696
2741
  `;
2697
2742
  }
2698
2743
  };
2699
- $e.styles = [oe, $`
2744
+ we.styles = [oe, $`
2700
2745
  .label-item {
2701
2746
  display: flex;
2702
2747
  align-items: center;
@@ -2748,34 +2793,34 @@ $e.styles = [oe, $`
2748
2793
  `];
2749
2794
  Qe([
2750
2795
  h({ type: Array })
2751
- ], $e.prototype, "labels", 2);
2796
+ ], we.prototype, "labels", 2);
2752
2797
  Qe([
2753
2798
  h({ type: Array })
2754
- ], $e.prototype, "selected", 2);
2799
+ ], we.prototype, "selected", 2);
2755
2800
  Qe([
2756
2801
  Se(".search-input")
2757
- ], $e.prototype, "_searchInput", 2);
2802
+ ], we.prototype, "_searchInput", 2);
2758
2803
  Qe([
2759
2804
  _()
2760
- ], $e.prototype, "_search", 2);
2761
- $e = Qe([
2762
- k("ap-filter-labels")
2763
- ], $e);
2764
- var Za = Object.defineProperty, Ja = Object.getOwnPropertyDescriptor, Re = (t, e, s, i) => {
2765
- for (var a = i > 1 ? void 0 : i ? Ja(e, s) : e, r = t.length - 1, o; r >= 0; r--)
2805
+ ], we.prototype, "_search", 2);
2806
+ we = Qe([
2807
+ S("ap-filter-labels")
2808
+ ], we);
2809
+ var Ja = Object.defineProperty, ei = Object.getOwnPropertyDescriptor, Re = (t, e, s, i) => {
2810
+ for (var a = i > 1 ? void 0 : i ? ei(e, s) : e, r = t.length - 1, o; r >= 0; r--)
2766
2811
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
2767
- return i && a && Za(e, s, a), a;
2812
+ return i && a && Ja(e, s, a), a;
2768
2813
  };
2769
- const Tt = 3, Pt = /^#[0-9A-Fa-f]{6}$/;
2770
- function ei(t) {
2814
+ const Mt = 3, Lt = /^#[0-9A-Fa-f]{6}$/;
2815
+ function ti(t) {
2771
2816
  const e = t.trim().split(/\s+/);
2772
- return e.length < 1 || !Pt.test(e[0]) ? null : {
2817
+ return e.length < 1 || !Lt.test(e[0]) ? null : {
2773
2818
  hex: e[0],
2774
2819
  tolerance: e[1] || rt,
2775
2820
  coverage: e[3] || it
2776
2821
  };
2777
2822
  }
2778
- let pe = class extends w {
2823
+ let pe = class extends k {
2779
2824
  constructor() {
2780
2825
  super(...arguments), this.values = [], this._colors = [], this._advanced = !1, this._showPalette = !1, this._initialized = !1;
2781
2826
  }
@@ -2789,7 +2834,7 @@ let pe = class extends w {
2789
2834
  if (t.has("values")) {
2790
2835
  const e = [];
2791
2836
  for (const s of this.values) {
2792
- const i = ei(s);
2837
+ const i = ti(s);
2793
2838
  i && e.push(i);
2794
2839
  }
2795
2840
  (!this._initialized || this.values.length === 0 && this._colors.length > 0) && (this._colors = e, e.length > 0 && (this._advanced = e.some(
@@ -2798,13 +2843,13 @@ let pe = class extends w {
2798
2843
  }
2799
2844
  }
2800
2845
  _selectColor(t) {
2801
- if (!Pt.test(t)) return;
2846
+ if (!Lt.test(t)) return;
2802
2847
  const e = this._colors.findIndex((s) => s.hex.toLowerCase() === t.toLowerCase());
2803
2848
  if (e >= 0) {
2804
2849
  this._removeColor(e);
2805
2850
  return;
2806
2851
  }
2807
- this._colors.length >= Tt || (this._colors = [
2852
+ this._colors.length >= Mt || (this._colors = [
2808
2853
  ...this._colors,
2809
2854
  {
2810
2855
  hex: t,
@@ -2824,7 +2869,7 @@ let pe = class extends w {
2824
2869
  }
2825
2870
  _handleHexInput(t, e) {
2826
2871
  let i = e.target.value.trim();
2827
- if (i.startsWith("#") || (i = "#" + i), !Pt.test(i) || this._colors.some(
2872
+ if (i.startsWith("#") || (i = "#" + i), !Lt.test(i) || this._colors.some(
2828
2873
  (o, l) => l !== t && o.hex.toLowerCase() === i.toLowerCase()
2829
2874
  )) return;
2830
2875
  const r = [...this._colors];
@@ -2868,10 +2913,10 @@ let pe = class extends w {
2868
2913
  );
2869
2914
  }
2870
2915
  _renderPalette() {
2871
- const t = this._selectedHexes, e = this._colors.length >= Tt;
2916
+ const t = this._selectedHexes, e = this._colors.length >= Mt;
2872
2917
  return n`
2873
2918
  <div class="palette">
2874
- ${Qs.map(
2919
+ ${Zs.map(
2875
2920
  (s) => {
2876
2921
  const i = t.has(s), a = e && !i;
2877
2922
  return n`
@@ -2908,7 +2953,7 @@ let pe = class extends w {
2908
2953
  <span class="adv-field-label">Difference</span>
2909
2954
  <ap-dropdown
2910
2955
  .value=${t.tolerance}
2911
- .options=${Zs}
2956
+ .options=${Js}
2912
2957
  @ap-change=${(s) => this._handleToleranceChange(e, s)}
2913
2958
  ></ap-dropdown>
2914
2959
  </div>
@@ -2947,7 +2992,7 @@ let pe = class extends w {
2947
2992
  `;
2948
2993
  }
2949
2994
  render() {
2950
- const t = this._colors.length === 0 || this._showPalette, e = this._colors.length < Tt && !this._showPalette;
2995
+ const t = this._colors.length === 0 || this._showPalette, e = this._colors.length < Mt && !this._showPalette;
2951
2996
  return n`
2952
2997
  <div class="filter-content">
2953
2998
  <button
@@ -3247,23 +3292,23 @@ Re([
3247
3292
  _()
3248
3293
  ], pe.prototype, "_initialized", 2);
3249
3294
  pe = Re([
3250
- k("ap-filter-color")
3295
+ S("ap-filter-color")
3251
3296
  ], pe);
3252
- var ti = Object.defineProperty, si = Object.getOwnPropertyDescriptor, Fe = (t, e, s, i) => {
3253
- for (var a = i > 1 ? void 0 : i ? si(e, s) : e, r = t.length - 1, o; r >= 0; r--)
3297
+ var si = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, Fe = (t, e, s, i) => {
3298
+ for (var a = i > 1 ? void 0 : i ? ai(e, s) : e, r = t.length - 1, o; r >= 0; r--)
3254
3299
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
3255
- return i && a && ti(e, s, a), a;
3300
+ return i && a && si(e, s, a), a;
3256
3301
  };
3257
- const ai = {
3302
+ const ii = {
3258
3303
  KB: 1 / 1e3,
3259
3304
  MB: 1,
3260
3305
  GB: 1e3
3261
- }, ii = [
3306
+ }, ri = [
3262
3307
  // KB disabled until backend supports sub-MB precision
3263
3308
  { value: "MB", label: "MB" },
3264
3309
  { value: "GB", label: "GB" }
3265
3310
  ];
3266
- let se = class extends w {
3311
+ let se = class extends k {
3267
3312
  constructor() {
3268
3313
  super(...arguments), this.min = 0, this.max = 0, this._minVal = "", this._maxVal = "", this._unit = "MB", this._initialized = !1;
3269
3314
  }
@@ -3280,7 +3325,7 @@ let se = class extends w {
3280
3325
  this._unit = t.detail.value, this._emitChange();
3281
3326
  }
3282
3327
  _emitChange() {
3283
- const t = ai[this._unit], e = this._minVal !== "" ? parseFloat((parseFloat(this._minVal) * t).toFixed(2)).toString() : null, s = this._maxVal !== "" ? parseFloat((parseFloat(this._maxVal) * t).toFixed(2)).toString() : null;
3328
+ const t = ii[this._unit], e = this._minVal !== "" ? parseFloat((parseFloat(this._minVal) * t).toFixed(2)).toString() : null, s = this._maxVal !== "" ? parseFloat((parseFloat(this._maxVal) * t).toFixed(2)).toString() : null;
3284
3329
  let i;
3285
3330
  if (e !== null && s !== null)
3286
3331
  i = `${e}..${s}`;
@@ -3294,7 +3339,7 @@ let se = class extends w {
3294
3339
  detail: {
3295
3340
  key: m.SIZE,
3296
3341
  values: [],
3297
- operator: x.RANGE
3342
+ operator: w.RANGE
3298
3343
  },
3299
3344
  bubbles: !0,
3300
3345
  composed: !0
@@ -3307,7 +3352,7 @@ let se = class extends w {
3307
3352
  detail: {
3308
3353
  key: m.SIZE,
3309
3354
  values: [i],
3310
- operator: x.RANGE
3355
+ operator: w.RANGE
3311
3356
  },
3312
3357
  bubbles: !0,
3313
3358
  composed: !0
@@ -3358,7 +3403,7 @@ let se = class extends w {
3358
3403
  <div>
3359
3404
  <span class="input-label">Unit</span>
3360
3405
  <ap-dropdown
3361
- .options=${ii}
3406
+ .options=${ri}
3362
3407
  .value=${this._unit}
3363
3408
  @ap-change=${this._setUnit}
3364
3409
  ></ap-dropdown>
@@ -3410,26 +3455,26 @@ Fe([
3410
3455
  _()
3411
3456
  ], se.prototype, "_initialized", 2);
3412
3457
  se = Fe([
3413
- k("ap-filter-size")
3458
+ S("ap-filter-size")
3414
3459
  ], se);
3415
- var ri = Object.defineProperty, oi = Object.getOwnPropertyDescriptor, bt = (t, e, s, i) => {
3416
- for (var a = i > 1 ? void 0 : i ? oi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
3460
+ var oi = Object.defineProperty, ni = Object.getOwnPropertyDescriptor, bt = (t, e, s, i) => {
3461
+ for (var a = i > 1 ? void 0 : i ? ni(e, s) : e, r = t.length - 1, o; r >= 0; r--)
3417
3462
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
3418
- return i && a && ri(e, s, a), a;
3463
+ return i && a && oi(e, s, a), a;
3419
3464
  };
3420
- const ni = ce`
3465
+ const li = ce`
3421
3466
  <svg width="20" height="20" viewBox="0 0 12 16" fill="none" xmlns="http://www.w3.org/2000/svg">
3422
3467
  <path d="M2.66666 1.9987C2.29847 1.9987 1.99999 2.29717 1.99999 2.66536L1.99999 13.332C1.99999 13.7002 2.29847 13.9987 2.66666 13.9987L9.33332 13.9987C9.70151 13.9987 9.99999 13.7002 9.99999 13.332L9.99999 2.66536C9.99999 2.29717 9.70151 1.9987 9.33332 1.9987L2.66666 1.9987ZM9.33332 0.665364C10.4379 0.665364 11.3333 1.56079 11.3333 2.66536L11.3333 13.332C11.3333 14.4366 10.4379 15.332 9.33332 15.332L2.66666 15.332C1.56209 15.332 0.666656 14.4366 0.666656 13.332L0.666656 2.66536C0.666656 1.56079 1.56209 0.665364 2.66666 0.665364L9.33332 0.665364Z" fill="#9747FF"/>
3423
3468
  <path d="M5.33332 4.65885C5.33332 4.29066 5.6318 3.99219 5.99999 3.99219C6.36818 3.99219 6.66666 4.29066 6.66666 4.65885L6.66666 4.66536C6.66666 5.03355 6.36818 5.33203 5.99999 5.33203C5.6318 5.33203 5.33332 5.03355 5.33332 4.66536L5.33332 4.65885Z" fill="#9747FF"/>
3424
3469
  <path d="M5.33332 11.3255C5.33332 10.9573 5.6318 10.6589 5.99999 10.6589C6.36818 10.6589 6.66666 10.9573 6.66666 11.3255L6.66666 11.332C6.66666 11.7002 6.36818 11.9987 5.99999 11.9987C5.6318 11.9987 5.33332 11.7002 5.33332 11.332L5.33332 11.3255Z" fill="#9747FF"/>
3425
3470
  </svg>
3426
- `, li = ce`
3471
+ `, ci = ce`
3427
3472
  <svg width="20" height="20" viewBox="0 0 16 12" fill="none" xmlns="http://www.w3.org/2000/svg">
3428
3473
  <path d="M14 2.66797C14 2.29978 13.7015 2.0013 13.3333 2.0013H2.66666C2.29847 2.0013 1.99999 2.29978 1.99999 2.66797V9.33463C1.99999 9.70282 2.29847 10.0013 2.66666 10.0013H13.3333C13.7015 10.0013 14 9.70282 14 9.33463V2.66797ZM15.3333 9.33463C15.3333 10.4392 14.4379 11.3346 13.3333 11.3346H2.66666C1.56209 11.3346 0.666656 10.4392 0.666656 9.33463V2.66797C0.666656 1.5634 1.56209 0.667969 2.66666 0.667969H13.3333C14.4379 0.667969 15.3333 1.5634 15.3333 2.66797V9.33463Z" fill="#65A30D"/>
3429
3474
  <path d="M11.3398 5.33464C11.708 5.33464 12.0065 5.63311 12.0065 6.0013C12.0065 6.36949 11.708 6.66797 11.3398 6.66797H11.3333C10.9651 6.66797 10.6667 6.36949 10.6667 6.0013C10.6667 5.63311 10.9651 5.33464 11.3333 5.33464H11.3398Z" fill="#65A30D"/>
3430
3475
  <path d="M4.67317 5.33464C5.04136 5.33464 5.33983 5.63311 5.33983 6.0013C5.33983 6.36949 5.04136 6.66797 4.67317 6.66797H4.66666C4.29847 6.66797 3.99999 6.36949 3.99999 6.0013C3.99999 5.63311 4.29847 5.33464 4.66666 5.33464H4.67317Z" fill="#65A30D"/>
3431
3476
  </svg>
3432
- `, ci = ce`
3477
+ `, di = ce`
3433
3478
  <svg width="20" height="20" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
3434
3479
  <path d="M12.3333 2.33203C12.3333 1.96384 12.0349 1.66536 11.6667 1.66536H2.33334C1.96515 1.66536 1.66668 1.96384 1.66668 2.33203V11.6654C1.66668 12.0336 1.96515 12.332 2.33334 12.332H11.6667C12.0349 12.332 12.3333 12.0336 12.3333 11.6654V2.33203ZM13.6667 11.6654C13.6667 12.7699 12.7712 13.6654 11.6667 13.6654H2.33334C1.22877 13.6654 0.333344 12.7699 0.333344 11.6654V2.33203C0.333344 1.22746 1.22877 0.332031 2.33334 0.332031H11.6667C12.7712 0.332031 13.6667 1.22746 13.6667 2.33203V11.6654Z" fill="#6366F1"/>
3435
3480
  <path d="M9.67319 3.66536C10.0414 3.66536 10.3399 3.96384 10.3399 4.33203C10.3399 4.70022 10.0414 4.9987 9.67319 4.9987H9.66668C9.29849 4.9987 9.00001 4.70022 9.00001 4.33203C9.00001 3.96384 9.29849 3.66536 9.66668 3.66536H9.67319Z" fill="#6366F1"/>
@@ -3437,19 +3482,19 @@ const ni = ce`
3437
3482
  <path d="M4.33985 8.9987C4.70804 8.9987 5.00652 9.29718 5.00652 9.66537C5.00652 10.0336 4.70804 10.332 4.33985 10.332H4.33334C3.96515 10.332 3.66668 10.0336 3.66668 9.66537C3.66668 9.29718 3.96515 8.9987 4.33334 8.9987H4.33985Z" fill="#6366F1"/>
3438
3483
  <path d="M9.67319 8.9987C10.0414 8.9987 10.3399 9.29718 10.3399 9.66537C10.3399 10.0336 10.0414 10.332 9.67319 10.332H9.66668C9.29849 10.332 9.00001 10.0336 9.00001 9.66537C9.00001 9.29718 9.29849 8.9987 9.66668 8.9987H9.67319Z" fill="#6366F1"/>
3439
3484
  </svg>
3440
- `, di = ce`
3485
+ `, pi = ce`
3441
3486
  <svg width="20" height="20" viewBox="0 0 16 8" fill="none" xmlns="http://www.w3.org/2000/svg">
3442
3487
  <path d="M14 2.33203C14 1.96384 13.7015 1.66536 13.3333 1.66536H2.66666C2.29847 1.66536 1.99999 1.96384 1.99999 2.33203V5.66536C1.99999 6.03355 2.29847 6.33203 2.66666 6.33203H13.3333C13.7015 6.33203 14 6.03355 14 5.66536V2.33203ZM15.3333 5.66536C15.3333 6.76993 14.4379 7.66536 13.3333 7.66536H2.66666C1.56209 7.66536 0.666656 6.76993 0.666656 5.66536V2.33203C0.666656 1.22746 1.56209 0.332031 2.66666 0.332031H13.3333C14.4379 0.332031 15.3333 1.22746 15.3333 2.33203V5.66536Z" fill="#4BA3AD"/>
3443
3488
  <path d="M11.3398 3.33203C11.708 3.33203 12.0065 3.63051 12.0065 3.9987C12.0065 4.36689 11.708 4.66536 11.3398 4.66536H11.3333C10.9651 4.66536 10.6667 4.36689 10.6667 3.9987C10.6667 3.63051 10.9651 3.33203 11.3333 3.33203H11.3398Z" fill="#4BA3AD"/>
3444
3489
  <path d="M4.67317 3.33203C5.04136 3.33203 5.33983 3.63051 5.33983 3.9987C5.33983 4.36689 5.04136 4.66536 4.67317 4.66536H4.66666C4.29847 4.66536 3.99999 4.36689 3.99999 3.9987C3.99999 3.63051 4.29847 3.33203 4.66666 3.33203H4.67317Z" fill="#4BA3AD"/>
3445
3490
  </svg>
3446
- `, pi = {
3447
- portrait: ni,
3448
- landscape: li,
3449
- square: ci,
3450
- panorama: di
3491
+ `, hi = {
3492
+ portrait: li,
3493
+ landscape: ci,
3494
+ square: di,
3495
+ panorama: pi
3451
3496
  };
3452
- let Le = class extends w {
3497
+ let Le = class extends k {
3453
3498
  constructor() {
3454
3499
  super(...arguments), this.selectedResolution = [], this.selectedOrientation = [], this.selectedFaces = [];
3455
3500
  }
@@ -3499,7 +3544,7 @@ let Le = class extends w {
3499
3544
  <div class="filter-section">
3500
3545
  <span class="section-label">Resolution</span>
3501
3546
  <div class="options-horizontal">
3502
- ${Gs.map(
3547
+ ${Ys.map(
3503
3548
  (t) => n`
3504
3549
  <ap-checkbox
3505
3550
  ?checked=${this.selectedResolution.includes(t.value)}
@@ -3515,14 +3560,14 @@ let Le = class extends w {
3515
3560
  <div class="filter-section">
3516
3561
  <span class="section-label">Orientation</span>
3517
3562
  <div class="options-vertical">
3518
- ${Ys.map(
3563
+ ${Xs.map(
3519
3564
  (t) => n`
3520
3565
  <ap-checkbox
3521
3566
  ?checked=${this.selectedOrientation.includes(t.value)}
3522
3567
  @ap-toggle=${() => {
3523
3568
  this._toggleOrientation(t.value);
3524
3569
  }}
3525
- ><span class="orientation-label">${pi[t.value]}${t.label}</span></ap-checkbox>
3570
+ ><span class="orientation-label">${hi[t.value]}${t.label}</span></ap-checkbox>
3526
3571
  `
3527
3572
  )}
3528
3573
  </div>
@@ -3531,7 +3576,7 @@ let Le = class extends w {
3531
3576
  <div class="filter-section">
3532
3577
  <span class="section-label">Faces</span>
3533
3578
  <div class="options-horizontal">
3534
- ${Xs.map(
3579
+ ${Ws.map(
3535
3580
  (t) => n`
3536
3581
  <ap-checkbox
3537
3582
  ?checked=${this.selectedFaces.includes(t.value)}
@@ -3581,17 +3626,17 @@ bt([
3581
3626
  h({ type: Array })
3582
3627
  ], Le.prototype, "selectedFaces", 2);
3583
3628
  Le = bt([
3584
- k("ap-filter-image")
3629
+ S("ap-filter-image")
3585
3630
  ], Le);
3586
- var hi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, z = (t, e, s, i) => {
3587
- for (var a = i > 1 ? void 0 : i ? ui(e, s) : e, r = t.length - 1, o; r >= 0; r--)
3631
+ var ui = Object.defineProperty, gi = Object.getOwnPropertyDescriptor, L = (t, e, s, i) => {
3632
+ for (var a = i > 1 ? void 0 : i ? gi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
3588
3633
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
3589
- return i && a && hi(e, s, a), a;
3634
+ return i && a && ui(e, s, a), a;
3590
3635
  };
3591
- function S(t) {
3636
+ function C(t) {
3592
3637
  return `${vt[t.type] || ""}${t.key}`;
3593
3638
  }
3594
- let M = class extends w {
3639
+ let P = class extends k {
3595
3640
  constructor() {
3596
3641
  super(...arguments), this.fields = [], this.appliedFilters = {}, this.visibleFields = [], this.mode = "full", this.activeFieldKey = "", this.pinnedFields = [], this.appliedMetadata = {}, this._showFieldSelection = !1, this._fieldSearch = "", this._collapsedFields = /* @__PURE__ */ new Set(), this._tagInputs = {}, this._tagSuggestions = {}, this._tagLoading = {}, this._datePresets = {}, this._dateFroms = {}, this._dateTos = {}, this._specificModeFields = /* @__PURE__ */ new Set(), this._selectSearches = {}, this._tagDebounceTimers = {};
3597
3642
  }
@@ -3612,10 +3657,10 @@ let M = class extends w {
3612
3657
  return this.visibleFields.length >= st;
3613
3658
  }
3614
3659
  _getField(t) {
3615
- return this.fields.find((e) => S(e) === t);
3660
+ return this.fields.find((e) => C(e) === t);
3616
3661
  }
3617
3662
  _getUIType(t) {
3618
- return sa[t.type];
3663
+ return aa[t.type];
3619
3664
  }
3620
3665
  _getApplied(t) {
3621
3666
  return this.appliedMetadata[t] || this.appliedFilters[t] || {};
@@ -3631,7 +3676,7 @@ let M = class extends w {
3631
3676
  }
3632
3677
  // ── Event dispatchers ────────────────────────────────────────────
3633
3678
  _emitFilterChange(t, e, s) {
3634
- const i = S(t);
3679
+ const i = C(t);
3635
3680
  this.dispatchEvent(
3636
3681
  new CustomEvent("metadata-filter-change", {
3637
3682
  detail: {
@@ -3646,7 +3691,7 @@ let M = class extends w {
3646
3691
  );
3647
3692
  }
3648
3693
  _emitFieldToggle(t, e) {
3649
- const s = S(t);
3694
+ const s = C(t);
3650
3695
  this.dispatchEvent(
3651
3696
  new CustomEvent("metadata-field-toggle", {
3652
3697
  detail: { fieldKey: s, visible: e },
@@ -3656,7 +3701,7 @@ let M = class extends w {
3656
3701
  );
3657
3702
  }
3658
3703
  _emitFieldSelect(t) {
3659
- const e = S(t);
3704
+ const e = C(t);
3660
3705
  !this.visibleFields.includes(e) && this._atFieldLimit || (this.visibleFields.includes(e) || this._emitFieldToggle(t, !0), this.dispatchEvent(
3661
3706
  new CustomEvent("metadata-field-select", {
3662
3707
  detail: { fieldKey: e },
@@ -3683,7 +3728,7 @@ let M = class extends w {
3683
3728
  }
3684
3729
  _addField(t) {
3685
3730
  if (this._atFieldLimit) return;
3686
- const e = S(t);
3731
+ const e = C(t);
3687
3732
  this.visibleFields.includes(e) || this._emitFieldToggle(t, !0);
3688
3733
  }
3689
3734
  _removeField(t) {
@@ -3695,12 +3740,12 @@ let M = class extends w {
3695
3740
  }
3696
3741
  // ── Operator change (via radio group) ─────────────────────────────
3697
3742
  _onOperatorChange(t, e) {
3698
- const i = this._getApplied(S(t)).values || [];
3743
+ const i = this._getApplied(C(t)).values || [];
3699
3744
  this._emitFilterChange(t, e, i);
3700
3745
  }
3701
3746
  // ── Content mode change ─────────────────────────────────────────
3702
3747
  _onContentModeChange(t, e) {
3703
- const s = S(t);
3748
+ const s = C(t);
3704
3749
  if (e === be) {
3705
3750
  const i = new Set(this._specificModeFields);
3706
3751
  i.add(s), this._specificModeFields = i;
@@ -3716,7 +3761,7 @@ let M = class extends w {
3716
3761
  }
3717
3762
  // ── Clear field filter ──────────────────────────────────────────
3718
3763
  _clearFieldFilter(t) {
3719
- const e = S(t);
3764
+ const e = C(t);
3720
3765
  if (this._specificModeFields.has(e)) {
3721
3766
  const d = new Set(this._specificModeFields);
3722
3767
  d.delete(e), this._specificModeFields = d;
@@ -3734,16 +3779,16 @@ let M = class extends w {
3734
3779
  }
3735
3780
  // ── Text filter ──────────────────────────────────────────────────
3736
3781
  _onTextInput(t, e) {
3737
- const s = e.target.value, a = this._getApplied(S(t)).operator || kt[0].value;
3782
+ const s = e.target.value, a = this._getApplied(C(t)).operator || kt[0].value;
3738
3783
  this._emitFilterChange(t, a, s ? [s] : []);
3739
3784
  }
3740
3785
  // ── Number filter ────────────────────────────────────────────────
3741
3786
  _onNumberInput(t, e, s) {
3742
- const i = e.target.value, a = S(t), r = this._getApplied(a), o = r.operator || Ct[0].value, l = [...r.values || []];
3787
+ const i = e.target.value, a = C(t), r = this._getApplied(a), o = r.operator || Ct[0].value, l = [...r.values || []];
3743
3788
  s === 0 ? l[0] = i : l[1] = i;
3744
3789
  const c = l.filter((p) => p !== "" && p !== void 0);
3745
3790
  if (c.length > 0) {
3746
- const p = t.type === C.DECIMAL2;
3791
+ const p = t.type === x.DECIMAL2;
3747
3792
  if (!c.every(
3748
3793
  (v) => p ? !isNaN(parseFloat(v)) : /^-?\d+$/.test(v)
3749
3794
  )) return;
@@ -3753,22 +3798,22 @@ let M = class extends w {
3753
3798
  // ── Boolean filter ───────────────────────────────────────────────
3754
3799
  _onBooleanSelect(t, e) {
3755
3800
  var a;
3756
- const s = this._getApplied(S(t));
3801
+ const s = this._getApplied(C(t));
3757
3802
  ((a = s.values) == null ? void 0 : a[0]) === e ? this._emitFilterChange(t, void 0, []) : this._emitFilterChange(t, s.operator, [e]);
3758
3803
  }
3759
3804
  // ── Select-one filter ────────────────────────────────────────────
3760
3805
  _onSelectOneToggle(t, e) {
3761
- const s = S(t), i = this._getApplied(s), a = i.operator || ee[0].value, r = i.values || [];
3806
+ const s = C(t), i = this._getApplied(s), a = i.operator || ee[0].value, r = i.values || [];
3762
3807
  r.length === 1 && r[0] === e ? this._emitFilterChange(t, a, []) : this._emitFilterChange(t, a, [e]);
3763
3808
  }
3764
3809
  // ── Multi-select filter ──────────────────────────────────────────
3765
3810
  _onMultiSelectToggle(t, e) {
3766
- const s = S(t), i = this._getApplied(s), a = i.operator || St[0].value, r = i.values || [], o = r.includes(e) ? r.filter((l) => l !== e) : [...r, e];
3811
+ const s = C(t), i = this._getApplied(s), a = i.operator || St[0].value, r = i.values || [], o = r.includes(e) ? r.filter((l) => l !== e) : [...r, e];
3767
3812
  this._emitFilterChange(t, a, o);
3768
3813
  }
3769
3814
  // ── Tags filter ──────────────────────────────────────────────────
3770
3815
  _onTagKeydown(t, e) {
3771
- const s = S(t);
3816
+ const s = C(t);
3772
3817
  (e.key === "Enter" || e.key === ",") && (e.preventDefault(), this._commitTagInput(t, s));
3773
3818
  }
3774
3819
  _onTagInput(t, e, s) {
@@ -3781,7 +3826,7 @@ let M = class extends w {
3781
3826
  this._tagInputs = { ...this._tagInputs, [e]: i }, this._fetchTagSuggestions(t, e, i.trim());
3782
3827
  }
3783
3828
  _selectTagSuggestion(t, e) {
3784
- const s = S(t), i = this._getApplied(s), a = i.operator || ee[0].value, r = i.values || [];
3829
+ const s = C(t), i = this._getApplied(s), a = i.operator || ee[0].value, r = i.values || [];
3785
3830
  r.includes(e) || this._emitFilterChange(t, a, [...r, e]), this._tagInputs = { ...this._tagInputs, [s]: "" }, this._tagSuggestions = { ...this._tagSuggestions, [s]: [] };
3786
3831
  }
3787
3832
  _fetchTagSuggestions(t, e, s) {
@@ -3814,7 +3859,7 @@ let M = class extends w {
3814
3859
  r.includes(s) || this._emitFilterChange(t, a, [...r, s]), this._tagInputs = { ...this._tagInputs, [e]: "" }, this._tagSuggestions = { ...this._tagSuggestions, [e]: [] };
3815
3860
  }
3816
3861
  _removeTag(t, e) {
3817
- const s = S(t), i = this._getApplied(s), a = i.operator || ee[0].value, r = i.values || [];
3862
+ const s = C(t), i = this._getApplied(s), a = i.operator || ee[0].value, r = i.values || [];
3818
3863
  this._emitFilterChange(
3819
3864
  t,
3820
3865
  a,
@@ -3822,12 +3867,12 @@ let M = class extends w {
3822
3867
  );
3823
3868
  }
3824
3869
  _onTagOperatorChange(t, e) {
3825
- const s = S(t), a = this._getApplied(s).values || [];
3870
+ const s = C(t), a = this._getApplied(s).values || [];
3826
3871
  this._emitFilterChange(t, e, a);
3827
3872
  }
3828
3873
  // ── Date filter ──────────────────────────────────────────────────
3829
3874
  _onDatePreset(t, e) {
3830
- const s = S(t);
3875
+ const s = C(t);
3831
3876
  if (this._datePresets = { ...this._datePresets, [s]: e }, ["before", "after", "between"].includes(e)) {
3832
3877
  this._dateFroms = { ...this._dateFroms, [s]: "" }, this._dateTos = { ...this._dateTos, [s]: "" };
3833
3878
  return;
@@ -3865,7 +3910,7 @@ let M = class extends w {
3865
3910
  a && r && (this._dateFroms = { ...this._dateFroms, [s]: a }, this._dateTos = { ...this._dateTos, [s]: r }, this._emitFilterChange(t, "..", [a, r]));
3866
3911
  }
3867
3912
  _onDateInput(t, e, s) {
3868
- const i = s.target.value, a = S(t), r = this._datePresets[a] || "", o = i ? (/* @__PURE__ */ new Date(i + "T00:00:00")).toISOString() : "";
3913
+ const i = s.target.value, a = C(t), r = this._datePresets[a] || "", o = i ? (/* @__PURE__ */ new Date(i + "T00:00:00")).toISOString() : "";
3869
3914
  e === "from" ? this._dateFroms = { ...this._dateFroms, [a]: o } : this._dateTos = { ...this._dateTos, [a]: o };
3870
3915
  let l = this._dateFroms[a] || "", c = this._dateTos[a] || "";
3871
3916
  r === "after" && l && (c = (/* @__PURE__ */ new Date()).toISOString(), this._dateTos = { ...this._dateTos, [a]: c }), r === "before" && c && (l = (/* @__PURE__ */ new Date(0)).toISOString(), this._dateFroms = { ...this._dateFroms, [a]: l }), l && c && this._emitFilterChange(t, "..", [l, c]);
@@ -3873,7 +3918,7 @@ let M = class extends w {
3873
3918
  // ── Geo filter ───────────────────────────────────────────────────
3874
3919
  _onGeoLocationInput(t, e) {
3875
3920
  var v;
3876
- const s = e.target.value.trim(), i = S(t), a = (v = this.shadowRoot) == null ? void 0 : v.querySelector(
3921
+ const s = e.target.value.trim(), i = C(t), a = (v = this.shadowRoot) == null ? void 0 : v.querySelector(
3877
3922
  `[data-geo-radius="${i}"]`
3878
3923
  ), r = (a == null ? void 0 : a.value) || "";
3879
3924
  if (!s) {
@@ -3885,39 +3930,45 @@ let M = class extends w {
3885
3930
  return;
3886
3931
  const [l, c] = o;
3887
3932
  let u = `${l},${c}..${r || "0"}`;
3888
- this._emitFilterChange(t, x.IS, [u]);
3933
+ this._emitFilterChange(t, w.IS, [u]);
3889
3934
  }
3890
3935
  _onGeoRadiusInput(t, e) {
3891
3936
  var c;
3892
- const s = e.target.value, i = S(t), a = this._getApplied(i);
3937
+ const s = e.target.value, i = C(t), a = this._getApplied(i);
3893
3938
  if (!((c = a.values) != null && c[0])) return;
3894
3939
  const r = a.values[0], [o] = r.split("..");
3895
3940
  let l = o;
3896
- s && (l += `..${s}`), this._emitFilterChange(t, x.IS, [l]);
3941
+ s && (l += `..${s}`), this._emitFilterChange(t, w.IS, [l]);
3897
3942
  }
3898
3943
  // ── Empty/non-empty option click ─────────────────────────────────
3899
3944
  _onEmptyOption(t, e) {
3900
3945
  var a;
3901
- const s = this._getApplied(S(t));
3946
+ const s = this._getApplied(C(t));
3902
3947
  ((a = s.values) == null ? void 0 : a[0]) === e ? this._emitFilterChange(t, s.operator, []) : this._emitFilterChange(t, s.operator, [e]);
3903
3948
  }
3904
3949
  // ── Render: Field selection panel ────────────────────────────────
3950
+ _getGroupedFields(t) {
3951
+ const e = /* @__PURE__ */ new Map();
3952
+ for (const s of t) {
3953
+ const i = s.group || "Root fields";
3954
+ e.has(i) || e.set(i, []), e.get(i).push(s);
3955
+ }
3956
+ return e;
3957
+ }
3905
3958
  _renderFieldSelection() {
3906
3959
  const t = this._fieldSearch.toLowerCase(), e = this.fields.filter(
3907
- (r) => r.label.toLowerCase().includes(t)
3908
- ), s = e.filter(
3909
- (r) => !r.group || r.group === "root"
3910
- ), i = e.filter((r) => r.group === "product"), a = (r, o) => o.length === 0 ? f : n`
3911
- <div class="field-group-label">${r}</div>
3912
- ${o.map((l) => {
3913
- const c = S(l), p = this.visibleFields.includes(c), u = !p && this._atFieldLimit;
3960
+ (a) => a.label.toLowerCase().includes(t)
3961
+ ), s = this._getGroupedFields(e), i = (a, r) => r.length === 0 ? f : n`
3962
+ <div class="field-group-label">${a}</div>
3963
+ ${r.map((o) => {
3964
+ const l = C(o), c = this.visibleFields.includes(l), p = !c && this._atFieldLimit;
3914
3965
  return n`
3915
3966
  <div
3916
- class="field-item ${p ? "selected" : ""} ${u ? "disabled" : ""}"
3917
- @click=${() => !u && !p && this._addField(l)}
3967
+ class="field-item ${c ? "selected" : ""} ${p ? "disabled" : ""}"
3968
+ @click=${() => !p && !c && this._addField(o)}
3918
3969
  >
3919
- ${p ? n`<ap-icon name="check" .size=${14}></ap-icon>` : f}
3920
- <span>${l.label}</span>
3970
+ ${c ? n`<ap-icon name="check" .size=${14}></ap-icon>` : n`<ap-icon name=${Et[o.type] || "file-text"} .size=${14} style="color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82))"></ap-icon>`}
3971
+ <span>${o.label}</span>
3921
3972
  </div>
3922
3973
  `;
3923
3974
  })}
@@ -3938,15 +3989,14 @@ let M = class extends w {
3938
3989
  type="text"
3939
3990
  placeholder="Search fields..."
3940
3991
  .value=${this._fieldSearch}
3941
- @input=${(r) => {
3942
- this._fieldSearch = r.target.value;
3992
+ @input=${(a) => {
3993
+ this._fieldSearch = a.target.value;
3943
3994
  }}
3944
3995
  />
3945
3996
  <div class="field-list">
3946
- ${e.length === 0 ? n`<div class="empty-msg">No fields found</div>` : n`
3947
- ${a("Root fields", s)}
3948
- ${a("Product fields", i)}
3949
- `}
3997
+ ${e.length === 0 ? n`<div class="empty-msg">No fields found</div>` : n`${[...s.entries()].map(
3998
+ ([a, r]) => i(a, r)
3999
+ )}`}
3950
4000
  </div>
3951
4001
  </div>
3952
4002
  `;
@@ -3954,7 +4004,7 @@ let M = class extends w {
3954
4004
  // ── Render: Text filter ──────────────────────────────────────────
3955
4005
  _renderTextFilter(t) {
3956
4006
  var p, u;
3957
- const e = S(t), s = this._getApplied(e), a = this._isSpecialValue(s.values) ? "" : ((p = s.values) == null ? void 0 : p[0]) || "", r = this._getContentMode(e), o = r === K || r === G, l = s.operator || kt[0].value, c = t.type === C.TEXT_AREA;
4007
+ const e = C(t), s = this._getApplied(e), a = this._isSpecialValue(s.values) ? "" : ((p = s.values) == null ? void 0 : p[0]) || "", r = this._getContentMode(e), o = r === K || r === G, l = s.operator || kt[0].value, c = t.type === x.TEXT_AREA;
3958
4008
  return n`
3959
4009
  <div class="filter-content" style="position: relative;">
3960
4010
  <button
@@ -4012,13 +4062,13 @@ let M = class extends w {
4012
4062
  }
4013
4063
  // ── Render: Number filter ────────────────────────────────────────
4014
4064
  _renderNumberFilter(t) {
4015
- var F, A, L;
4016
- const e = S(t), s = this._getApplied(e), i = s.operator || Ct[0].value, a = this._isSpecialValue(s.values), r = this._getContentMode(e), o = r === K || r === G, l = i === x.RANGE, c = i === x.GREATER_THAN_OR_EQUAL, p = i === x.LESS_THAN_OR_EQUAL, u = t.type === C.DECIMAL2, v = u ? "0.01" : "1", d = u ? "0.00" : "0", g = a ? "" : ((F = s.values) == null ? void 0 : F[0]) || "", b = a ? "" : ((A = s.values) == null ? void 0 : A[1]) || "", E = l || c || p, y = l || c || p ? "Min" : "Value";
4065
+ var F, I, H;
4066
+ const e = C(t), s = this._getApplied(e), i = s.operator || Ct[0].value, a = this._isSpecialValue(s.values), r = this._getContentMode(e), o = r === K || r === G, l = i === w.RANGE, c = i === w.GREATER_THAN_OR_EQUAL, p = i === w.LESS_THAN_OR_EQUAL, u = t.type === x.DECIMAL2, v = u ? "0.01" : "1", d = u ? "0.00" : "0", g = a ? "" : ((F = s.values) == null ? void 0 : F[0]) || "", b = a ? "" : ((I = s.values) == null ? void 0 : I[1]) || "", E = l || c || p, y = l || c || p ? "Min" : "Value";
4017
4067
  return n`
4018
4068
  <div class="filter-content" style="position: relative;">
4019
4069
  <button
4020
4070
  class="clear-btn"
4021
- ?disabled=${!((L = s.values) != null && L.length) && !s.operator}
4071
+ ?disabled=${!((H = s.values) != null && H.length) && !s.operator}
4022
4072
  @click=${() => this._clearFieldFilter(t)}
4023
4073
  >Clear all</button>
4024
4074
 
@@ -4029,7 +4079,7 @@ let M = class extends w {
4029
4079
  .options=${Ct}
4030
4080
  .value=${i}
4031
4081
  ?disabled=${o}
4032
- @ap-change=${(I) => this._onOperatorChange(t, I.detail.value)}
4082
+ @ap-change=${(T) => this._onOperatorChange(t, T.detail.value)}
4033
4083
  ></ap-radio-group>
4034
4084
  </div>
4035
4085
 
@@ -4038,7 +4088,7 @@ let M = class extends w {
4038
4088
  <ap-radio-group
4039
4089
  .options=${Ft}
4040
4090
  .value=${r}
4041
- @ap-change=${(I) => this._onContentModeChange(t, I.detail.value)}
4091
+ @ap-change=${(T) => this._onContentModeChange(t, T.detail.value)}
4042
4092
  ></ap-radio-group>
4043
4093
  </div>
4044
4094
 
@@ -4054,7 +4104,7 @@ let M = class extends w {
4054
4104
  placeholder=${d}
4055
4105
  .value=${g}
4056
4106
  ?disabled=${p}
4057
- @change=${(I) => this._onNumberInput(t, I, 0)}
4107
+ @change=${(T) => this._onNumberInput(t, T, 0)}
4058
4108
  />
4059
4109
  </div>
4060
4110
  ${E ? n`
@@ -4067,7 +4117,7 @@ let M = class extends w {
4067
4117
  placeholder=${d}
4068
4118
  .value=${b}
4069
4119
  ?disabled=${c}
4070
- @change=${(I) => this._onNumberInput(t, I, 1)}
4120
+ @change=${(T) => this._onNumberInput(t, T, 1)}
4071
4121
  />
4072
4122
  </div>
4073
4123
  ` : f}
@@ -4080,7 +4130,7 @@ let M = class extends w {
4080
4130
  // ── Render: Boolean filter ───────────────────────────────────────
4081
4131
  _renderBooleanFilter(t) {
4082
4132
  var i, a;
4083
- const e = this._getApplied(S(t)), s = ((i = e.values) == null ? void 0 : i[0]) || "";
4133
+ const e = this._getApplied(C(t)), s = ((i = e.values) == null ? void 0 : i[0]) || "";
4084
4134
  return n`
4085
4135
  <div class="filter-content" style="position: relative;">
4086
4136
  <button
@@ -4092,7 +4142,7 @@ let M = class extends w {
4092
4142
  <div class="filter-section">
4093
4143
  <span class="section-label">Value</span>
4094
4144
  <ap-radio-group
4095
- .options=${ta}
4145
+ .options=${sa}
4096
4146
  .value=${s}
4097
4147
  @ap-change=${(r) => this._onBooleanSelect(t, r.detail.value)}
4098
4148
  ></ap-radio-group>
@@ -4102,7 +4152,7 @@ let M = class extends w {
4102
4152
  }
4103
4153
  // ── Render: Select-one filter ────────────────────────────────────
4104
4154
  _renderSelectOneFilter(t) {
4105
- const e = S(t), s = this._getApplied(e), i = this._isSpecialValue(s.values), a = i ? [] : s.values || [], r = t.possible_values || [], o = s.operator || ee[0].value, l = (this._selectSearches[e] || "").toLowerCase(), c = l.length > 0, p = a.length > 0 || i, u = l ? r.filter((d) => d.label.toLowerCase().includes(l)) : r, v = a.length >= st;
4155
+ const e = C(t), s = this._getApplied(e), i = this._isSpecialValue(s.values), a = i ? [] : s.values || [], r = t.possible_values || [], o = s.operator || ee[0].value, l = (this._selectSearches[e] || "").toLowerCase(), c = l.length > 0, p = a.length > 0 || i, u = l ? r.filter((d) => d.label.toLowerCase().includes(l)) : r, v = a.length >= st;
4106
4156
  return n`
4107
4157
  <div class="filter-content">
4108
4158
  <!-- Search input -->
@@ -4221,7 +4271,7 @@ let M = class extends w {
4221
4271
  }
4222
4272
  // ── Render: Multi-select filter ──────────────────────────────────
4223
4273
  _renderMultiSelectFilter(t) {
4224
- const e = S(t), s = this._getApplied(e), i = this._isSpecialValue(s.values), a = i ? [] : s.values || [], r = t.possible_values || [], o = s.operator || St[0].value, l = (this._selectSearches[e] || "").toLowerCase(), c = l.length > 0, p = a.length > 0 || i, u = l ? r.filter((d) => d.label.toLowerCase().includes(l)) : r, v = a.length >= st;
4274
+ const e = C(t), s = this._getApplied(e), i = this._isSpecialValue(s.values), a = i ? [] : s.values || [], r = t.possible_values || [], o = s.operator || St[0].value, l = (this._selectSearches[e] || "").toLowerCase(), c = l.length > 0, p = a.length > 0 || i, u = l ? r.filter((d) => d.label.toLowerCase().includes(l)) : r, v = a.length >= st;
4225
4275
  return n`
4226
4276
  <div class="filter-content">
4227
4277
  <!-- Search input -->
@@ -4340,7 +4390,7 @@ let M = class extends w {
4340
4390
  }
4341
4391
  // ── Render: Tags filter ──────────────────────────────────────────
4342
4392
  _renderTagsFilter(t) {
4343
- const e = S(t), s = this._getApplied(e), i = this._isSpecialValue(s.values), a = i ? [] : s.values || [], r = this._tagInputs[e] || "", o = s.operator || ee[0].value, l = a.length > 0 || i, c = this._tagSuggestions[e] || [], p = this._tagLoading[e] || !1, u = r.trim().length > 0, v = a.length >= st;
4393
+ const e = C(t), s = this._getApplied(e), i = this._isSpecialValue(s.values), a = i ? [] : s.values || [], r = this._tagInputs[e] || "", o = s.operator || ee[0].value, l = a.length > 0 || i, c = this._tagSuggestions[e] || [], p = this._tagLoading[e] || !1, u = r.trim().length > 0, v = a.length >= st;
4344
4394
  return n`
4345
4395
  <div class="filter-content">
4346
4396
  <!-- Search input -->
@@ -4458,7 +4508,7 @@ let M = class extends w {
4458
4508
  // ── Render: Date filter ──────────────────────────────────────────
4459
4509
  _renderDateFilter(t) {
4460
4510
  var u, v;
4461
- const e = S(t), s = this._datePresets[e] || "", i = this._getApplied(e), r = this._isSpecialValue(i.values) ? ((u = i.values) == null ? void 0 : u[0]) || "" : s, o = [
4511
+ const e = C(t), s = this._datePresets[e] || "", i = this._getApplied(e), r = this._isSpecialValue(i.values) ? ((u = i.values) == null ? void 0 : u[0]) || "" : s, o = [
4462
4512
  { value: "empty", label: "Empty" },
4463
4513
  { value: "non-empty", label: "Not empty" }
4464
4514
  ], l = this._dateFroms[e] ? new Date(this._dateFroms[e]).toISOString().split("T")[0] : "", c = this._dateTos[e] ? new Date(this._dateTos[e]).toISOString().split("T")[0] : "", p = ["before", "after", "between"].includes(r);
@@ -4481,7 +4531,7 @@ let M = class extends w {
4481
4531
 
4482
4532
  <ap-radio-group
4483
4533
  columns="2"
4484
- .options=${Lt}
4534
+ .options=${It}
4485
4535
  .value=${r !== "empty" && r !== "non-empty" ? r : ""}
4486
4536
  @ap-change=${(d) => this._onDatePreset(t, d.detail.value)}
4487
4537
  ></ap-radio-group>
@@ -4539,7 +4589,7 @@ let M = class extends w {
4539
4589
  // ── Render: Geo filter ───────────────────────────────────────────
4540
4590
  _renderGeoFilter(t) {
4541
4591
  var u, v;
4542
- const e = S(t), s = this._getApplied(e), i = this._isSpecialValue(s.values), a = this._getContentMode(e);
4592
+ const e = C(t), s = this._getApplied(e), i = this._isSpecialValue(s.values), a = this._getContentMode(e);
4543
4593
  let r = "", o = "";
4544
4594
  if (!i && ((u = s.values) != null && u[0])) {
4545
4595
  const d = s.values[0], [g, b] = d.split("..");
@@ -4597,7 +4647,7 @@ let M = class extends w {
4597
4647
  // ── Render: Attachment filter ────────────────────────────────────
4598
4648
  _renderAttachmentFilter(t) {
4599
4649
  var i, a;
4600
- const e = this._getApplied(S(t)), s = ((i = e.values) == null ? void 0 : i[0]) || "";
4650
+ const e = this._getApplied(C(t)), s = ((i = e.values) == null ? void 0 : i[0]) || "";
4601
4651
  return n`
4602
4652
  <div class="filter-content" style="position: relative;">
4603
4653
  <button
@@ -4618,7 +4668,7 @@ let M = class extends w {
4618
4668
  }
4619
4669
  // ── Render: Face matcher (integer-list with slug face_matcher) ──
4620
4670
  _renderFaceMatcherFilter(t) {
4621
- const e = S(t), s = this._getApplied(e), i = s.values || [], a = s.operator || x.IS;
4671
+ const e = C(t), s = this._getApplied(e), i = s.values || [], a = s.operator || w.IS;
4622
4672
  return n`
4623
4673
  <div class="filter-content" style="position: relative;">
4624
4674
  <button
@@ -4669,7 +4719,7 @@ let M = class extends w {
4669
4719
  case "geo":
4670
4720
  return this._renderGeoFilter(t);
4671
4721
  case "attachment":
4672
- return t.type === C.INTEGER_LIST && t.slug === "face_matcher" ? this._renderFaceMatcherFilter(t) : this._renderAttachmentFilter(t);
4722
+ return t.type === x.INTEGER_LIST && t.slug === "face_matcher" ? this._renderFaceMatcherFilter(t) : this._renderAttachmentFilter(t);
4673
4723
  default:
4674
4724
  return f;
4675
4725
  }
@@ -4691,6 +4741,7 @@ let M = class extends w {
4691
4741
  name="chevron-right"
4692
4742
  .size=${14}
4693
4743
  ></ap-icon>
4744
+ <ap-icon name=${Et[e.type] || "file-text"} .size=${14} style="color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82))"></ap-icon>
4694
4745
  <span>${e.label}</span>
4695
4746
  </div>
4696
4747
  <div class="field-header-actions">
@@ -4714,29 +4765,28 @@ let M = class extends w {
4714
4765
  // ── Selector mode render ─────────────────────────────────────────
4715
4766
  _renderSelectorMode() {
4716
4767
  const t = this._fieldSearch.toLowerCase(), e = this.fields.filter(
4717
- (r) => r.label.toLowerCase().includes(t)
4718
- ), s = e.filter(
4719
- (r) => !r.group || r.group === "root"
4720
- ), i = e.filter((r) => r.group === "product"), a = (r, o) => o.length === 0 ? f : n`
4721
- <div class="field-group-label">${r}</div>
4722
- ${o.map((l) => {
4723
- const c = S(l), p = this.visibleFields.includes(c), u = !!this.appliedMetadata[c] || !!this.appliedFilters[c], v = this.pinnedFields.includes(c), d = !p && this._atFieldLimit;
4768
+ (a) => a.label.toLowerCase().includes(t)
4769
+ ), s = this._getGroupedFields(e), i = (a, r) => r.length === 0 ? f : n`
4770
+ <div class="field-group-label">${a}</div>
4771
+ ${r.map((o) => {
4772
+ const l = C(o), c = this.visibleFields.includes(l), p = !!this.appliedMetadata[l] || !!this.appliedFilters[l], u = this.pinnedFields.includes(l), v = !c && this._atFieldLimit;
4724
4773
  return n`
4725
4774
  <div
4726
- class="field-item ${u ? "has-filter" : ""} ${d ? "disabled" : ""}"
4727
- @click=${() => !d && this._emitFieldSelect(l)}
4775
+ class="field-item ${p ? "has-filter" : ""} ${v ? "disabled" : ""}"
4776
+ @click=${() => !v && this._emitFieldSelect(o)}
4728
4777
  >
4729
- <span class="field-item-label">${l.label}</span>
4778
+ <ap-icon name=${Et[o.type] || "file-text"} .size=${14} style="color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82))"></ap-icon>
4779
+ <span class="field-item-label">${o.label}</span>
4730
4780
  <button
4731
- class="field-item-pin ${v ? "pinned" : ""}"
4732
- @click=${(g) => {
4733
- g.stopPropagation(), this._emitPin(c, !v);
4781
+ class="field-item-pin ${u ? "pinned" : ""}"
4782
+ @click=${(d) => {
4783
+ d.stopPropagation(), this._emitPin(l, !u);
4734
4784
  }}
4735
- title=${v ? "Unpin field" : "Pin field"}
4785
+ title=${u ? "Unpin field" : "Pin field"}
4736
4786
  >
4737
4787
  <ap-icon name="pin" .size=${12}></ap-icon>
4738
4788
  </button>
4739
- ${u ? n`<ap-icon name="check" .size=${14}></ap-icon>` : f}
4789
+ ${p ? n`<ap-icon name="check" .size=${14}></ap-icon>` : f}
4740
4790
  </div>
4741
4791
  `;
4742
4792
  })}
@@ -4748,15 +4798,14 @@ let M = class extends w {
4748
4798
  type="text"
4749
4799
  placeholder="Search fields..."
4750
4800
  .value=${this._fieldSearch}
4751
- @input=${(r) => {
4752
- this._fieldSearch = r.target.value;
4801
+ @input=${(a) => {
4802
+ this._fieldSearch = a.target.value;
4753
4803
  }}
4754
4804
  />
4755
4805
  <div class="field-list">
4756
- ${e.length === 0 ? n`<div class="empty-msg">No fields found</div>` : n`
4757
- ${a("Root fields", s)}
4758
- ${a("Product fields", i)}
4759
- `}
4806
+ ${e.length === 0 ? n`<div class="empty-msg">No fields found</div>` : n`${[...s.entries()].map(
4807
+ ([a, r]) => i(a, r)
4808
+ )}`}
4760
4809
  </div>
4761
4810
  </div>
4762
4811
  `;
@@ -4795,7 +4844,7 @@ let M = class extends w {
4795
4844
  `;
4796
4845
  }
4797
4846
  };
4798
- M.styles = [ie, oe, $`
4847
+ P.styles = [ie, oe, $`
4799
4848
  /* ── Field selection panel ─────────────────────────────── */
4800
4849
 
4801
4850
  .add-field-btn {
@@ -5160,72 +5209,72 @@ M.styles = [ie, oe, $`
5160
5209
  background: var(--ap-primary-10, oklch(0.578 0.198 268.129 / 0.1));
5161
5210
  }
5162
5211
  `];
5163
- z([
5212
+ L([
5164
5213
  h({ type: Array })
5165
- ], M.prototype, "fields", 2);
5166
- z([
5214
+ ], P.prototype, "fields", 2);
5215
+ L([
5167
5216
  h({ type: Object })
5168
- ], M.prototype, "appliedFilters", 2);
5169
- z([
5217
+ ], P.prototype, "appliedFilters", 2);
5218
+ L([
5170
5219
  h({ type: Array })
5171
- ], M.prototype, "visibleFields", 2);
5172
- z([
5220
+ ], P.prototype, "visibleFields", 2);
5221
+ L([
5173
5222
  h()
5174
- ], M.prototype, "mode", 2);
5175
- z([
5223
+ ], P.prototype, "mode", 2);
5224
+ L([
5176
5225
  h()
5177
- ], M.prototype, "activeFieldKey", 2);
5178
- z([
5226
+ ], P.prototype, "activeFieldKey", 2);
5227
+ L([
5179
5228
  h({ type: Array })
5180
- ], M.prototype, "pinnedFields", 2);
5181
- z([
5229
+ ], P.prototype, "pinnedFields", 2);
5230
+ L([
5182
5231
  h({ type: Object })
5183
- ], M.prototype, "appliedMetadata", 2);
5184
- z([
5232
+ ], P.prototype, "appliedMetadata", 2);
5233
+ L([
5185
5234
  h({ attribute: !1 })
5186
- ], M.prototype, "apiClient", 2);
5187
- z([
5235
+ ], P.prototype, "apiClient", 2);
5236
+ L([
5188
5237
  _()
5189
- ], M.prototype, "_showFieldSelection", 2);
5190
- z([
5238
+ ], P.prototype, "_showFieldSelection", 2);
5239
+ L([
5191
5240
  _()
5192
- ], M.prototype, "_fieldSearch", 2);
5193
- z([
5241
+ ], P.prototype, "_fieldSearch", 2);
5242
+ L([
5194
5243
  _()
5195
- ], M.prototype, "_collapsedFields", 2);
5196
- z([
5244
+ ], P.prototype, "_collapsedFields", 2);
5245
+ L([
5197
5246
  _()
5198
- ], M.prototype, "_tagInputs", 2);
5199
- z([
5247
+ ], P.prototype, "_tagInputs", 2);
5248
+ L([
5200
5249
  _()
5201
- ], M.prototype, "_tagSuggestions", 2);
5202
- z([
5250
+ ], P.prototype, "_tagSuggestions", 2);
5251
+ L([
5203
5252
  _()
5204
- ], M.prototype, "_tagLoading", 2);
5205
- z([
5253
+ ], P.prototype, "_tagLoading", 2);
5254
+ L([
5206
5255
  _()
5207
- ], M.prototype, "_datePresets", 2);
5208
- z([
5256
+ ], P.prototype, "_datePresets", 2);
5257
+ L([
5209
5258
  _()
5210
- ], M.prototype, "_dateFroms", 2);
5211
- z([
5259
+ ], P.prototype, "_dateFroms", 2);
5260
+ L([
5212
5261
  _()
5213
- ], M.prototype, "_dateTos", 2);
5214
- z([
5262
+ ], P.prototype, "_dateTos", 2);
5263
+ L([
5215
5264
  _()
5216
- ], M.prototype, "_specificModeFields", 2);
5217
- z([
5265
+ ], P.prototype, "_specificModeFields", 2);
5266
+ L([
5218
5267
  _()
5219
- ], M.prototype, "_selectSearches", 2);
5220
- M = z([
5221
- k("ap-filter-metadata")
5222
- ], M);
5223
- var gi = Object.defineProperty, fi = Object.getOwnPropertyDescriptor, Z = (t, e, s, i) => {
5224
- for (var a = i > 1 ? void 0 : i ? fi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
5268
+ ], P.prototype, "_selectSearches", 2);
5269
+ P = L([
5270
+ S("ap-filter-metadata")
5271
+ ], P);
5272
+ var fi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, Z = (t, e, s, i) => {
5273
+ for (var a = i > 1 ? void 0 : i ? vi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
5225
5274
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
5226
- return i && a && gi(e, s, a), a;
5275
+ return i && a && fi(e, s, a), a;
5227
5276
  };
5228
- let Y = class extends w {
5277
+ let Y = class extends k {
5229
5278
  constructor() {
5230
5279
  super(...arguments), this.selectedStatus = [], this.statusOperator = ":=", this.approverValue = "", this.approverOperator = "~", this.requesterValue = "", this.requesterOperator = "~", this.dueDatePreset = "", this.dueDateFrom = "", this.dueDateTo = "";
5231
5280
  }
@@ -5247,43 +5296,43 @@ let Y = class extends w {
5247
5296
  // ── Status handlers ────────────────────────────────────────────────
5248
5297
  _toggleStatus(t) {
5249
5298
  const e = this.selectedStatus.includes(t) ? this.selectedStatus.filter((s) => s !== t) : [...this.selectedStatus, t];
5250
- this._emitChange(V.STATUS, e, this.statusOperator);
5299
+ this._emitChange(B.STATUS, e, this.statusOperator);
5251
5300
  }
5252
5301
  _handleStatusOperator(t) {
5253
5302
  const e = t.detail.value;
5254
- this._emitChange(V.STATUS, this.selectedStatus, e);
5303
+ this._emitChange(B.STATUS, this.selectedStatus, e);
5255
5304
  }
5256
5305
  _clearStatus() {
5257
- this._emitChange(V.STATUS, [], this.statusOperator);
5306
+ this._emitChange(B.STATUS, [], this.statusOperator);
5258
5307
  }
5259
5308
  // ── Approver handlers ──────────────────────────────────────────────
5260
5309
  _handleApproverInput(t) {
5261
5310
  const e = t.target.value;
5262
- this._emitChange(V.APPROVER, e ? [e] : [], this.approverOperator);
5311
+ this._emitChange(B.APPROVER, e ? [e] : [], this.approverOperator);
5263
5312
  }
5264
5313
  _handleApproverOperator(t) {
5265
5314
  const e = t.detail.value;
5266
- this._emitChange(V.APPROVER, this.approverValue ? [this.approverValue] : [], e);
5315
+ this._emitChange(B.APPROVER, this.approverValue ? [this.approverValue] : [], e);
5267
5316
  }
5268
5317
  _clearApprover() {
5269
- this._emitChange(V.APPROVER, [], this.approverOperator);
5318
+ this._emitChange(B.APPROVER, [], this.approverOperator);
5270
5319
  }
5271
5320
  // ── Requester handlers ─────────────────────────────────────────────
5272
5321
  _handleRequesterInput(t) {
5273
5322
  const e = t.target.value;
5274
- this._emitChange(V.REQUESTOR, e ? [e] : [], this.requesterOperator);
5323
+ this._emitChange(B.REQUESTOR, e ? [e] : [], this.requesterOperator);
5275
5324
  }
5276
5325
  _handleRequesterOperator(t) {
5277
5326
  const e = t.detail.value;
5278
- this._emitChange(V.REQUESTOR, this.requesterValue ? [this.requesterValue] : [], e);
5327
+ this._emitChange(B.REQUESTOR, this.requesterValue ? [this.requesterValue] : [], e);
5279
5328
  }
5280
5329
  _clearRequester() {
5281
- this._emitChange(V.REQUESTOR, [], this.requesterOperator);
5330
+ this._emitChange(B.REQUESTOR, [], this.requesterOperator);
5282
5331
  }
5283
5332
  // ── Due Date handlers ──────────────────────────────────────────────
5284
5333
  _handleDueDatePreset(t) {
5285
5334
  const e = t.detail.value, s = this.dueDatePreset === e ? "" : e;
5286
- this._emitChange(V.DUE_DATE, s ? [s] : [], ":");
5335
+ this._emitChange(B.DUE_DATE, s ? [s] : [], ":");
5287
5336
  }
5288
5337
  _handleDueDateFrom(t) {
5289
5338
  const e = t.target.value;
@@ -5296,7 +5345,7 @@ let Y = class extends w {
5296
5345
  _clearDueDate() {
5297
5346
  this.dispatchEvent(new CustomEvent("filter-change", {
5298
5347
  detail: {
5299
- key: V.DUE_DATE,
5348
+ key: B.DUE_DATE,
5300
5349
  values: [],
5301
5350
  operator: ":"
5302
5351
  },
@@ -5308,7 +5357,7 @@ let Y = class extends w {
5308
5357
  const s = [];
5309
5358
  t && s.push(t), e && s.push(e), this.dispatchEvent(new CustomEvent("filter-change", {
5310
5359
  detail: {
5311
- key: V.DUE_DATE,
5360
+ key: B.DUE_DATE,
5312
5361
  values: s,
5313
5362
  operator: t && e ? ".." : t ? ">=" : "<="
5314
5363
  },
@@ -5341,7 +5390,7 @@ let Y = class extends w {
5341
5390
  <span class="section-label condition-label">Condition</span>
5342
5391
  <ap-radio-group
5343
5392
  direction="horizontal"
5344
- .options=${Js}
5393
+ .options=${ea}
5345
5394
  .value=${this.statusOperator}
5346
5395
  ?disabled=${this._statusHasOnlyEmptyValues}
5347
5396
  @ap-change=${this._handleStatusOperator}
@@ -5363,7 +5412,7 @@ let Y = class extends w {
5363
5412
 
5364
5413
  <!-- Status options -->
5365
5414
  <div class="options-list short">
5366
- ${ea.map(
5415
+ ${ta.map(
5367
5416
  (e) => n`
5368
5417
  <ap-checkbox
5369
5418
  ?checked=${this.selectedStatus.includes(e.value)}
@@ -5396,7 +5445,7 @@ let Y = class extends w {
5396
5445
  <span class="section-label condition-label">Condition</span>
5397
5446
  <ap-radio-group
5398
5447
  direction="horizontal"
5399
- .options=${Qt}
5448
+ .options=${Zt}
5400
5449
  .value=${this.approverOperator}
5401
5450
  @ap-change=${this._handleApproverOperator}
5402
5451
  ></ap-radio-group>
@@ -5427,7 +5476,7 @@ let Y = class extends w {
5427
5476
  <span class="section-label condition-label">Condition</span>
5428
5477
  <ap-radio-group
5429
5478
  direction="horizontal"
5430
- .options=${Qt}
5479
+ .options=${Zt}
5431
5480
  .value=${this.requesterOperator}
5432
5481
  @ap-change=${this._handleRequesterOperator}
5433
5482
  ></ap-radio-group>
@@ -5466,7 +5515,7 @@ let Y = class extends w {
5466
5515
  <!-- Date range options -->
5467
5516
  <ap-radio-group
5468
5517
  columns="2"
5469
- .options=${Ws}
5518
+ .options=${Qs}
5470
5519
  .value=${this.dueDatePreset !== K && this.dueDatePreset !== G ? this.dueDatePreset : ""}
5471
5520
  @ap-change=${this._handleDueDatePreset}
5472
5521
  ></ap-radio-group>
@@ -5563,22 +5612,22 @@ Z([
5563
5612
  h()
5564
5613
  ], Y.prototype, "dueDateTo", 2);
5565
5614
  Y = Z([
5566
- k("ap-filter-approval")
5615
+ S("ap-filter-approval")
5567
5616
  ], Y);
5568
- var vi = Object.defineProperty, mi = Object.getOwnPropertyDescriptor, J = (t, e, s, i) => {
5569
- for (var a = i > 1 ? void 0 : i ? mi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
5617
+ var mi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, J = (t, e, s, i) => {
5618
+ for (var a = i > 1 ? void 0 : i ? bi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
5570
5619
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
5571
- return i && a && vi(e, s, a), a;
5620
+ return i && a && mi(e, s, a), a;
5572
5621
  };
5573
- const bi = 300;
5574
- function _i(t) {
5622
+ const _i = 300;
5623
+ function yi(t) {
5575
5624
  return t.filter(
5576
5625
  (e) => e.toLowerCase().includes("*") || !t.some(
5577
5626
  (s) => s.toLowerCase().includes("*") && e.toLowerCase().startsWith(s.slice(0, -1).toLowerCase())
5578
5627
  )
5579
5628
  );
5580
5629
  }
5581
- let X = class extends w {
5630
+ let X = class extends k {
5582
5631
  constructor() {
5583
5632
  super(...arguments), this.selected = [], this._search = "", this._debouncedSearch = "", this._products = [], this._isLoading = !1, this._showAddList = !1, this._addListText = "";
5584
5633
  }
@@ -5595,13 +5644,13 @@ let X = class extends w {
5595
5644
  return this._debouncedSearch.length > 0;
5596
5645
  }
5597
5646
  _emit(t) {
5598
- const e = _i(t);
5647
+ const e = yi(t);
5599
5648
  this.dispatchEvent(
5600
5649
  new CustomEvent("filter-change", {
5601
5650
  detail: {
5602
5651
  key: m.PRODUCT_REF,
5603
5652
  values: e,
5604
- operator: x.IS
5653
+ operator: w.IS
5605
5654
  },
5606
5655
  bubbles: !0,
5607
5656
  composed: !0
@@ -5623,7 +5672,7 @@ let X = class extends w {
5623
5672
  this._search = e, this._debounceTimer && clearTimeout(this._debounceTimer), this._debounceTimer = setTimeout(() => {
5624
5673
  const s = e.trim().toLowerCase();
5625
5674
  this._debouncedSearch = s, s ? this._fetchProducts(s) : (this._products = [], this._isLoading = !1);
5626
- }, bi);
5675
+ }, _i);
5627
5676
  }
5628
5677
  _clearSearch() {
5629
5678
  this._search = "", this._debouncedSearch = "", this._products = [], this._isLoading = !1, this._debounceTimer && clearTimeout(this._debounceTimer);
@@ -6049,21 +6098,21 @@ J([
6049
6098
  _()
6050
6099
  ], X.prototype, "_addListText", 2);
6051
6100
  X = J([
6052
- k("ap-filter-product-ref")
6101
+ S("ap-filter-product-ref")
6053
6102
  ], X);
6054
- var yi = Object.defineProperty, xi = Object.getOwnPropertyDescriptor, P = (t, e, s, i) => {
6055
- for (var a = i > 1 ? void 0 : i ? xi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
6103
+ var xi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, O = (t, e, s, i) => {
6104
+ for (var a = i > 1 ? void 0 : i ? wi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
6056
6105
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
6057
- return i && a && yi(e, s, a), a;
6106
+ return i && a && xi(e, s, a), a;
6058
6107
  };
6059
- let T = class extends w {
6108
+ let M = class extends k {
6060
6109
  constructor() {
6061
- super(...arguments), this.totalCount = 0, this.totalFolderCount = 0, this.isLoading = !1, this.showUpload = !1, this.sortBy = "created_at", this.sortDirection = "desc", this.sortOptions = It, this.filters = {
6110
+ super(...arguments), this.totalCount = 0, this.totalFolderCount = 0, this.isLoading = !1, this.showUpload = !1, this.sortBy = "created_at", this.sortDirection = "desc", this.sortOptions = Dt, this.filters = {
6062
6111
  metadata: { pinned: [], visible: [], applied: {} },
6063
6112
  pinned: [],
6064
6113
  visible: [],
6065
6114
  applied: {}
6066
- }, this.labels = [], this.tags = [], this.metadataFields = [], this.pinnedFilters = [], this.forcedFilterKeys = [], this._showDropdown = !1, this._showMetadataSelector = !1, this._openFilter = null, this._openMetadataField = null, this._externalTrigger = !1, this._externalLeft = null, this._outsideClickHandler = (t) => {
6115
+ }, this.labels = [], this.tags = [], this.metadataFields = [], this.pinnedFilters = [], this.forcedFilterKeys = [], this._showDropdown = !1, this._showMetadataSelector = !1, this._openFilter = null, this._openMetadataField = null, this._externalTrigger = !1, this._externalLeft = null, this._externalTop = null, this._outsideClickHandler = (t) => {
6067
6116
  const e = t.composedPath();
6068
6117
  if (this._externalTrigger && e.some(
6069
6118
  (r) => {
@@ -6073,9 +6122,9 @@ let T = class extends w {
6073
6122
  ))
6074
6123
  return;
6075
6124
  const s = this._openFilter && e.some((a) => a instanceof HTMLElement ? a.classList.contains("popover-anchor") || a.classList.contains("popover-panel") : !1), i = (this._showDropdown || this._showMetadataSelector) && e.some(
6076
- (a) => a instanceof HTMLElement && (a.classList.contains("dropdown-menu") || a.classList.contains("filter-dropdown"))
6125
+ (a) => a instanceof HTMLElement && (a.classList.contains("dropdown-menu") || a.classList.contains("filter-dropdown") || a.classList.contains("metadata-selector-overlay"))
6077
6126
  );
6078
- s || i || (this._openFilter && (this._openFilter = null, this._openMetadataField = null, this._externalTrigger = !1, this._externalLeft = null), (this._showDropdown || this._showMetadataSelector) && (this._showDropdown = !1, this._showMetadataSelector = !1));
6127
+ s || i || (this._openFilter && (this._openFilter = null, this._openMetadataField = null, this._externalTrigger = !1, this._externalLeft = null, this._externalTop = null), (this._showDropdown || this._showMetadataSelector) && (this._showDropdown = !1, this._showMetadataSelector = !1));
6079
6128
  };
6080
6129
  }
6081
6130
  connectedCallback() {
@@ -6102,7 +6151,7 @@ let T = class extends w {
6102
6151
  }
6103
6152
  _closeAllDropdowns() {
6104
6153
  var t;
6105
- this._showDropdown = !1, this._showMetadataSelector = !1, this._openFilter = null, this._openMetadataField = null, this._externalTrigger = !1, this._externalLeft = null, (t = this._sortDropdown) == null || t.close();
6154
+ this._showDropdown = !1, this._showMetadataSelector = !1, this._openFilter = null, this._openMetadataField = null, this._externalTrigger = !1, this._externalLeft = null, this._externalTop = null, (t = this._sortDropdown) == null || t.close();
6106
6155
  }
6107
6156
  _handleUploadClick() {
6108
6157
  this.dispatchEvent(new CustomEvent("upload-click", { bubbles: !0, composed: !0 }));
@@ -6112,27 +6161,27 @@ let T = class extends w {
6112
6161
  this._closeAllDropdowns(), this._showDropdown = !t;
6113
6162
  }
6114
6163
  _toggleMetadataSelector() {
6115
- this._showMetadataSelector = !this._showMetadataSelector, this._showDropdown = !1;
6164
+ this._showMetadataSelector = !this._showMetadataSelector;
6116
6165
  }
6117
6166
  /** Close any open filter panel */
6118
6167
  closeFilterPanel() {
6119
- this._openFilter = null, this._openMetadataField = null, this._externalTrigger = !1, this._externalLeft = null;
6168
+ this._openFilter = null, this._openMetadataField = null, this._externalTrigger = !1, this._externalLeft = null, this._externalTop = null;
6120
6169
  }
6121
6170
  /** Open a specific filter panel (also used programmatically by parent) */
6122
- openFilterPanel(t, e = !1, s) {
6171
+ openFilterPanel(t, e = !1, s, i) {
6123
6172
  if (e && this._externalTrigger && this._openFilter === t && !this._openMetadataField) {
6124
6173
  this.closeFilterPanel();
6125
6174
  return;
6126
6175
  }
6127
6176
  if (!e && !this._isFilterActive(t)) {
6128
- this._showDropdown = !1, this.dispatchEvent(new CustomEvent("filter-pending", {
6177
+ this._showDropdown = !1, this._showMetadataSelector = !1, this.dispatchEvent(new CustomEvent("filter-pending", {
6129
6178
  detail: { key: t },
6130
6179
  bubbles: !0,
6131
6180
  composed: !0
6132
6181
  }));
6133
6182
  return;
6134
6183
  }
6135
- this._showDropdown = !1, this._openFilter = t, this._openMetadataField = null, this._externalTrigger = e, this._externalLeft = s ?? null;
6184
+ this._showDropdown = !1, this._showMetadataSelector = !1, this._openFilter = t, this._openMetadataField = null, this._externalTrigger = e, this._externalLeft = s ?? null, this._externalTop = i ?? null;
6136
6185
  }
6137
6186
  _handleSortOpen() {
6138
6187
  this._showDropdown = !1, this._openFilter = null, this._openMetadataField = null;
@@ -6177,7 +6226,7 @@ let T = class extends w {
6177
6226
  var s;
6178
6227
  t.stopPropagation();
6179
6228
  const e = t.detail.fieldKey;
6180
- if (this._showMetadataSelector = !1, !(e in (((s = this.filters.metadata) == null ? void 0 : s.applied) || {}))) {
6229
+ if (this._showMetadataSelector = !1, this._showDropdown = !1, !(e in (((s = this.filters.metadata) == null ? void 0 : s.applied) || {}))) {
6181
6230
  this.dispatchEvent(new CustomEvent("filter-pending", {
6182
6231
  detail: { metadataFieldKey: e },
6183
6232
  bubbles: !0,
@@ -6194,12 +6243,12 @@ let T = class extends w {
6194
6243
  composed: !0
6195
6244
  }));
6196
6245
  }
6197
- openMetadataFieldPanel(t, e = !1, s) {
6246
+ openMetadataFieldPanel(t, e = !1, s, i) {
6198
6247
  if (e && this._externalTrigger && this._openMetadataField === t) {
6199
6248
  this.closeFilterPanel();
6200
6249
  return;
6201
6250
  }
6202
- this._showDropdown = !1, this._openFilter = "metadata", this._openMetadataField = t, this._externalTrigger = e, this._externalLeft = s ?? null;
6251
+ this._showDropdown = !1, this._openFilter = "metadata", this._openMetadataField = t, this._externalTrigger = e, this._externalLeft = s ?? null, this._externalTop = i ?? null;
6203
6252
  }
6204
6253
  _getMetadataFieldLabel(t) {
6205
6254
  for (const e of this.metadataFields)
@@ -6216,7 +6265,7 @@ let T = class extends w {
6216
6265
  }));
6217
6266
  }
6218
6267
  _getFilterIcon(t) {
6219
- const e = Mt.find((s) => s.key === t);
6268
+ const e = Pt.find((s) => s.key === t);
6220
6269
  return (e == null ? void 0 : e.icon) || "filter";
6221
6270
  }
6222
6271
  _renderFilterContent(t) {
@@ -6345,8 +6394,7 @@ let T = class extends w {
6345
6394
  }
6346
6395
  }
6347
6396
  _renderFilterButton(t) {
6348
- const e = t.key === "metadata", s = e ? Object.keys(this.filters.metadata.applied).length > 0 : this._isFilterActive(t.key), i = this.pinnedFilters.includes(t.key);
6349
- return n`
6397
+ const e = t.key === "metadata", s = e ? Object.keys(this.filters.metadata.applied).length > 0 : this._isFilterActive(t.key), i = this.pinnedFilters.includes(t.key), a = n`
6350
6398
  <button
6351
6399
  class="filter-btn ${s ? "active" : ""} ${i ? "pinned" : ""}"
6352
6400
  @click=${() => e ? this._toggleMetadataSelector() : this.openFilterPanel(t.key)}
@@ -6361,13 +6409,32 @@ let T = class extends w {
6361
6409
  <span
6362
6410
  class="pin-btn ${i ? "pinned" : ""}"
6363
6411
  title=${i ? "Unpin filter" : "Pin filter"}
6364
- @click=${(a) => this._togglePin(t.key, a)}
6412
+ @click=${(r) => this._togglePin(t.key, r)}
6365
6413
  >
6366
6414
  <ap-icon name="pin" .size=${14}></ap-icon>
6367
6415
  </span>
6368
6416
  `}
6369
6417
  </button>
6370
6418
  `;
6419
+ return e ? n`
6420
+ <div class="filter-btn-wrapper">
6421
+ ${a}
6422
+ ${this._showMetadataSelector ? n`
6423
+ <div class="metadata-selector-overlay">
6424
+ <ap-filter-metadata
6425
+ mode="selector"
6426
+ .fields=${this.metadataFields}
6427
+ .appliedMetadata=${this.filters.metadata.applied}
6428
+ .visibleFields=${this.filters.metadata.visible}
6429
+ .pinnedFields=${this.filters.metadata.pinned}
6430
+ @metadata-field-select=${this._handleMetadataSelectorFieldSelect}
6431
+ @metadata-field-toggle=${this._handleMetadataFieldToggle}
6432
+ @metadata-pin=${this._handleMetadataPin}
6433
+ ></ap-filter-metadata>
6434
+ </div>
6435
+ ` : f}
6436
+ </div>
6437
+ ` : a;
6371
6438
  }
6372
6439
  render() {
6373
6440
  const t = Object.keys(this.filters.applied).length + Object.keys(this.filters.metadata.applied).length;
@@ -6387,21 +6454,7 @@ let T = class extends w {
6387
6454
  </button>
6388
6455
  ${this._showDropdown ? n`
6389
6456
  <div class="dropdown-menu">
6390
- ${Mt.filter((e) => !this.forcedFilterKeys.includes(e.key)).map((e) => this._renderFilterButton(e))}
6391
- </div>
6392
- ` : f}
6393
- ${this._showMetadataSelector ? n`
6394
- <div class="dropdown-menu metadata-selector-menu">
6395
- <ap-filter-metadata
6396
- mode="selector"
6397
- .fields=${this.metadataFields}
6398
- .appliedMetadata=${this.filters.metadata.applied}
6399
- .visibleFields=${this.filters.metadata.visible}
6400
- .pinnedFields=${this.filters.metadata.pinned}
6401
- @metadata-field-select=${this._handleMetadataSelectorFieldSelect}
6402
- @metadata-field-toggle=${this._handleMetadataFieldToggle}
6403
- @metadata-pin=${this._handleMetadataPin}
6404
- ></ap-filter-metadata>
6457
+ ${Pt.filter((e) => !this.forcedFilterKeys.includes(e.key)).map((e) => this._renderFilterButton(e))}
6405
6458
  </div>
6406
6459
  ` : f}
6407
6460
  </div>
@@ -6430,7 +6483,7 @@ let T = class extends w {
6430
6483
  </div>
6431
6484
  </div>
6432
6485
  ${this._openFilter ? n`
6433
- <div class="popover-anchor ${this._externalTrigger ? "external" : ""}">
6486
+ <div class="popover-anchor ${this._externalTrigger ? "external" : ""}" style=${this._externalTrigger && this._externalTop != null ? `top: ${this._externalTop + 4}px` : ""}>
6434
6487
  ${this._externalTrigger ? f : n`
6435
6488
  <div class="anchor-tab">
6436
6489
  ${this._openFilter === "metadata" && this._openMetadataField ? n`
@@ -6442,10 +6495,10 @@ let T = class extends w {
6442
6495
  ${this._getMetadataFieldLabel(this._openMetadataField)}
6443
6496
  ` : n`
6444
6497
  <ap-icon name=${this._getFilterIcon(this._openFilter)} .size=${16}></ap-icon>
6445
- ${Oe[this._openFilter] || this._openFilter}
6498
+ ${Me[this._openFilter] || this._openFilter}
6446
6499
  `}
6447
6500
  <button class="anchor-close" @click=${() => {
6448
- this._openFilter = null, this._openMetadataField = null, this._externalTrigger = !1, this._externalLeft = null;
6501
+ this._openFilter = null, this._openMetadataField = null, this._externalTrigger = !1, this._externalLeft = null, this._externalTop = null;
6449
6502
  }} title="Close">
6450
6503
  <ap-icon name="close" .size=${14}></ap-icon>
6451
6504
  </button>
@@ -6459,7 +6512,7 @@ let T = class extends w {
6459
6512
  `;
6460
6513
  }
6461
6514
  };
6462
- T.styles = $`
6515
+ M.styles = $`
6463
6516
  :host {
6464
6517
  display: block;
6465
6518
  padding: 8px 20px 6px;
@@ -6559,13 +6612,25 @@ T.styles = $`
6559
6612
  gap: 12px;
6560
6613
  overscroll-behavior: contain;
6561
6614
  }
6562
- .dropdown-menu.metadata-selector-menu {
6563
- display: block;
6564
- min-width: 0;
6615
+ .filter-btn-wrapper {
6616
+ position: relative;
6617
+ display: flex;
6618
+ }
6619
+ .filter-btn-wrapper .filter-btn {
6620
+ flex: 1;
6621
+ }
6622
+ .metadata-selector-overlay {
6623
+ position: absolute;
6624
+ top: calc(100% + 4px);
6625
+ left: 0;
6626
+ z-index: 60;
6565
6627
  width: 280px;
6566
- padding: 0;
6567
6628
  max-height: 400px;
6568
6629
  overflow-y: auto;
6630
+ background: var(--ap-card, oklch(1 0 0));
6631
+ border: 1px solid var(--ap-border, oklch(92.86% 0.009 247.92));
6632
+ border-radius: var(--ap-radius, 8px);
6633
+ box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
6569
6634
  }
6570
6635
 
6571
6636
  /* Filter button in dropdown */
@@ -6777,90 +6842,94 @@ T.styles = $`
6777
6842
  }
6778
6843
  .popover-anchor.external {
6779
6844
  padding: 0;
6845
+ top: 0;
6780
6846
  }
6781
6847
  .popover-anchor.external .popover-panel {
6782
6848
  border-radius: 8px;
6783
6849
  top: 0;
6784
6850
  }
6785
6851
  `;
6786
- P([
6852
+ O([
6787
6853
  h({ type: Number })
6788
- ], T.prototype, "totalCount", 2);
6789
- P([
6854
+ ], M.prototype, "totalCount", 2);
6855
+ O([
6790
6856
  h({ type: Number })
6791
- ], T.prototype, "totalFolderCount", 2);
6792
- P([
6857
+ ], M.prototype, "totalFolderCount", 2);
6858
+ O([
6793
6859
  h({ type: Boolean })
6794
- ], T.prototype, "isLoading", 2);
6795
- P([
6860
+ ], M.prototype, "isLoading", 2);
6861
+ O([
6796
6862
  h({ type: Boolean })
6797
- ], T.prototype, "showUpload", 2);
6798
- P([
6863
+ ], M.prototype, "showUpload", 2);
6864
+ O([
6799
6865
  h()
6800
- ], T.prototype, "sortBy", 2);
6801
- P([
6866
+ ], M.prototype, "sortBy", 2);
6867
+ O([
6802
6868
  h()
6803
- ], T.prototype, "sortDirection", 2);
6804
- P([
6869
+ ], M.prototype, "sortDirection", 2);
6870
+ O([
6805
6871
  h({ type: Array })
6806
- ], T.prototype, "sortOptions", 2);
6807
- P([
6872
+ ], M.prototype, "sortOptions", 2);
6873
+ O([
6808
6874
  h({ type: Object })
6809
- ], T.prototype, "filters", 2);
6810
- P([
6875
+ ], M.prototype, "filters", 2);
6876
+ O([
6811
6877
  h({ type: Array })
6812
- ], T.prototype, "labels", 2);
6813
- P([
6878
+ ], M.prototype, "labels", 2);
6879
+ O([
6814
6880
  h({ type: Array })
6815
- ], T.prototype, "tags", 2);
6816
- P([
6881
+ ], M.prototype, "tags", 2);
6882
+ O([
6817
6883
  h({ type: Array })
6818
- ], T.prototype, "metadataFields", 2);
6819
- P([
6884
+ ], M.prototype, "metadataFields", 2);
6885
+ O([
6820
6886
  h({ type: Array })
6821
- ], T.prototype, "pinnedFilters", 2);
6822
- P([
6887
+ ], M.prototype, "pinnedFilters", 2);
6888
+ O([
6823
6889
  h({ type: Array })
6824
- ], T.prototype, "forcedFilterKeys", 2);
6825
- P([
6890
+ ], M.prototype, "forcedFilterKeys", 2);
6891
+ O([
6826
6892
  h({ attribute: !1 })
6827
- ], T.prototype, "apiClient", 2);
6828
- P([
6893
+ ], M.prototype, "apiClient", 2);
6894
+ O([
6829
6895
  Se("ap-dropdown")
6830
- ], T.prototype, "_sortDropdown", 2);
6831
- P([
6896
+ ], M.prototype, "_sortDropdown", 2);
6897
+ O([
6832
6898
  _()
6833
- ], T.prototype, "_showDropdown", 2);
6834
- P([
6899
+ ], M.prototype, "_showDropdown", 2);
6900
+ O([
6835
6901
  _()
6836
- ], T.prototype, "_showMetadataSelector", 2);
6837
- P([
6902
+ ], M.prototype, "_showMetadataSelector", 2);
6903
+ O([
6838
6904
  _()
6839
- ], T.prototype, "_openFilter", 2);
6840
- P([
6905
+ ], M.prototype, "_openFilter", 2);
6906
+ O([
6841
6907
  _()
6842
- ], T.prototype, "_openMetadataField", 2);
6843
- P([
6908
+ ], M.prototype, "_openMetadataField", 2);
6909
+ O([
6844
6910
  _()
6845
- ], T.prototype, "_externalTrigger", 2);
6846
- P([
6911
+ ], M.prototype, "_externalTrigger", 2);
6912
+ O([
6847
6913
  _()
6848
- ], T.prototype, "_externalLeft", 2);
6849
- T = P([
6850
- k("ap-content-toolbar")
6851
- ], T);
6852
- var $i = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, q = (t, e, s, i) => {
6853
- for (var a = i > 1 ? void 0 : i ? wi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
6914
+ ], M.prototype, "_externalLeft", 2);
6915
+ O([
6916
+ _()
6917
+ ], M.prototype, "_externalTop", 2);
6918
+ M = O([
6919
+ S("ap-content-toolbar")
6920
+ ], M);
6921
+ var $i = Object.defineProperty, ki = Object.getOwnPropertyDescriptor, V = (t, e, s, i) => {
6922
+ for (var a = i > 1 ? void 0 : i ? ki(e, s) : e, r = t.length - 1, o; r >= 0; r--)
6854
6923
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
6855
6924
  return i && a && $i(e, s, a), a;
6856
6925
  };
6857
- let B = class extends w {
6926
+ let N = class extends k {
6858
6927
  constructor() {
6859
6928
  super(...arguments), this.appliedFilters = {}, this.appliedMetadata = {}, this.forcedFilters = {}, this.metadataFields = [], this.pinnedFilters = [], this.pinnedMetadataFields = [], this.tags = [], this.labels = [], this.activeFilter = null, this.activeMetadataField = null, this.pendingFilter = null, this.pendingMetadataField = null;
6860
6929
  }
6861
6930
  _mapTypeLabel(t) {
6862
6931
  var e;
6863
- return ((e = ls.find((s) => s.value === t)) == null ? void 0 : e.label) || t;
6932
+ return ((e = cs.find((s) => s.value === t)) == null ? void 0 : e.label) || t;
6864
6933
  }
6865
6934
  _getSizeSummary(t) {
6866
6935
  if (t.values.length === 0) return "";
@@ -6899,7 +6968,7 @@ let B = class extends w {
6899
6968
  }
6900
6969
  _getDateSummary(t) {
6901
6970
  var o, l;
6902
- const e = ((o = cs.find((c) => c.value === t.field)) == null ? void 0 : o.label) || t.field, s = [...Lt, ...ds], i = t.preset ? ((l = s.find((c) => c.value === t.preset)) == null ? void 0 : l.label) || t.preset : "", a = (c) => {
6971
+ const e = ((o = ds.find((c) => c.value === t.field)) == null ? void 0 : o.label) || t.field, s = [...It, ...ps], i = t.preset ? ((l = s.find((c) => c.value === t.preset)) == null ? void 0 : l.label) || t.preset : "", a = (c) => {
6903
6972
  try {
6904
6973
  return c.split("T")[0];
6905
6974
  } catch {
@@ -6930,14 +6999,14 @@ let B = class extends w {
6930
6999
  }
6931
7000
  _getFilterIcon(t) {
6932
7001
  var e;
6933
- return ((e = Mt.find((s) => s.key === t)) == null ? void 0 : e.icon) || "filter";
7002
+ return ((e = Pt.find((s) => s.key === t)) == null ? void 0 : e.icon) || "filter";
6934
7003
  }
6935
7004
  _getMetadataLabel(t) {
6936
7005
  const e = this._stripMetadataPrefix(t), s = this.metadataFields.find((i) => i.key === e);
6937
7006
  return (s == null ? void 0 : s.label) || e;
6938
7007
  }
6939
7008
  _stripMetadataPrefix(t) {
6940
- for (const e of is)
7009
+ for (const e of rs)
6941
7010
  if (t.startsWith(e)) return t.slice(e.length);
6942
7011
  return t;
6943
7012
  }
@@ -6982,7 +7051,7 @@ let B = class extends w {
6982
7051
  return n`
6983
7052
  <span class="chip forced">
6984
7053
  ${(i || t === m.TYPE || t === m.SIZE) && s ? n`<span class="chip-label">${s}</span>` : n`
6985
- <span class="chip-label">${Oe[t] || t}</span>
7054
+ <span class="chip-label">${Me[t] || t}</span>
6986
7055
  ${s ? n`<span class="chip-summary">${s}</span>` : f}
6987
7056
  `}
6988
7057
  <span class="chip-lock">
@@ -6996,7 +7065,7 @@ let B = class extends w {
6996
7065
  return n`
6997
7066
  <span class="chip pinned-empty ${t === this.activeFilter ? "active" : ""}" @click=${(a) => this._openFilter(t, a)}>
6998
7067
  <span class="chip-icon"><ap-icon name=${this._getFilterIcon(t)} .size=${16}></ap-icon></span>
6999
- <span class="chip-label">${Oe[t] || t}</span>
7068
+ <span class="chip-label">${Me[t] || t}</span>
7000
7069
  <span class="chip-chevron"><ap-icon name="chevron-down" .size=${14}></ap-icon></span>
7001
7070
  </span>
7002
7071
  `;
@@ -7006,7 +7075,7 @@ let B = class extends w {
7006
7075
  ${(i || t === m.TYPE || t === m.SIZE) && s ? n`
7007
7076
  <span class="chip-icon"><ap-icon name=${this._getFilterIcon(t)} .size=${16}></ap-icon></span>
7008
7077
  <span class="chip-label">${s}</span>` : n`
7009
- <span class="chip-label">${Oe[t] || t}</span>
7078
+ <span class="chip-label">${Me[t] || t}</span>
7010
7079
  ${s ? n`<span class="chip-summary">${s}</span>` : f}
7011
7080
  `}
7012
7081
  <button class="chip-remove" @click=${(a) => {
@@ -7042,7 +7111,7 @@ let B = class extends w {
7042
7111
  `;
7043
7112
  }
7044
7113
  render() {
7045
- const t = Ue(this.forcedFilters), e = new Set(Object.keys(t)), s = Object.keys(this.appliedFilters).filter((g) => !e.has(g)), i = Object.keys(this.appliedMetadata), a = new Set(this.pinnedFilters), r = new Set(this.pinnedMetadataFields), o = this.pinnedFilters.filter((g) => !e.has(g)), l = s.filter((g) => !a.has(g)), c = i.filter((g) => !r.has(g)), p = this.pendingFilter && !a.has(this.pendingFilter) && !(this.pendingFilter in this.appliedFilters), u = this.pendingMetadataField && !r.has(this.pendingMetadataField) && !(this.pendingMetadataField in this.appliedMetadata), v = s.length + i.length > 0;
7114
+ const t = Be(this.forcedFilters), e = new Set(Object.keys(t)), s = Object.keys(this.appliedFilters).filter((g) => !e.has(g)), i = Object.keys(this.appliedMetadata), a = new Set(this.pinnedFilters), r = new Set(this.pinnedMetadataFields), o = this.pinnedFilters.filter((g) => !e.has(g)), l = s.filter((g) => !a.has(g)), c = i.filter((g) => !r.has(g)), p = this.pendingFilter && !a.has(this.pendingFilter) && !(this.pendingFilter in this.appliedFilters), u = this.pendingMetadataField && !r.has(this.pendingMetadataField) && !(this.pendingMetadataField in this.appliedMetadata), v = s.length + i.length > 0;
7046
7115
  return e.size + o.length + this.pinnedMetadataFields.length + l.length + c.length + (p ? 1 : 0) + (u ? 1 : 0) === 0 ? f : n`
7047
7116
  <div class="chips-row">
7048
7117
  <div class="chips">
@@ -7061,7 +7130,7 @@ let B = class extends w {
7061
7130
  ${p ? n`
7062
7131
  <span class="chip pinned-empty active pending" @click=${(g) => this._openFilter(this.pendingFilter, g)}>
7063
7132
  <span class="chip-icon"><ap-icon name=${this._getFilterIcon(this.pendingFilter)} .size=${16}></ap-icon></span>
7064
- <span class="chip-label">${Oe[this.pendingFilter] || this.pendingFilter}</span>
7133
+ <span class="chip-label">${Me[this.pendingFilter] || this.pendingFilter}</span>
7065
7134
  <span class="chip-chevron"><ap-icon name="chevron-down" .size=${14}></ap-icon></span>
7066
7135
  </span>
7067
7136
  ` : f}
@@ -7081,7 +7150,7 @@ let B = class extends w {
7081
7150
  `;
7082
7151
  }
7083
7152
  };
7084
- B.styles = $`
7153
+ N.styles = $`
7085
7154
  :host {
7086
7155
  display: block;
7087
7156
  }
@@ -7229,52 +7298,52 @@ B.styles = $`
7229
7298
  opacity: 0.6;
7230
7299
  }
7231
7300
  `;
7232
- q([
7301
+ V([
7233
7302
  h({ type: Object })
7234
- ], B.prototype, "appliedFilters", 2);
7235
- q([
7303
+ ], N.prototype, "appliedFilters", 2);
7304
+ V([
7236
7305
  h({ type: Object })
7237
- ], B.prototype, "appliedMetadata", 2);
7238
- q([
7306
+ ], N.prototype, "appliedMetadata", 2);
7307
+ V([
7239
7308
  h({ type: Object })
7240
- ], B.prototype, "forcedFilters", 2);
7241
- q([
7309
+ ], N.prototype, "forcedFilters", 2);
7310
+ V([
7242
7311
  h({ type: Array })
7243
- ], B.prototype, "metadataFields", 2);
7244
- q([
7312
+ ], N.prototype, "metadataFields", 2);
7313
+ V([
7245
7314
  h({ type: Array })
7246
- ], B.prototype, "pinnedFilters", 2);
7247
- q([
7315
+ ], N.prototype, "pinnedFilters", 2);
7316
+ V([
7248
7317
  h({ type: Array })
7249
- ], B.prototype, "pinnedMetadataFields", 2);
7250
- q([
7318
+ ], N.prototype, "pinnedMetadataFields", 2);
7319
+ V([
7251
7320
  h({ type: Array })
7252
- ], B.prototype, "tags", 2);
7253
- q([
7321
+ ], N.prototype, "tags", 2);
7322
+ V([
7254
7323
  h({ type: Array })
7255
- ], B.prototype, "labels", 2);
7256
- q([
7324
+ ], N.prototype, "labels", 2);
7325
+ V([
7257
7326
  h()
7258
- ], B.prototype, "activeFilter", 2);
7259
- q([
7327
+ ], N.prototype, "activeFilter", 2);
7328
+ V([
7260
7329
  h()
7261
- ], B.prototype, "activeMetadataField", 2);
7262
- q([
7330
+ ], N.prototype, "activeMetadataField", 2);
7331
+ V([
7263
7332
  h()
7264
- ], B.prototype, "pendingFilter", 2);
7265
- q([
7333
+ ], N.prototype, "pendingFilter", 2);
7334
+ V([
7266
7335
  h()
7267
- ], B.prototype, "pendingMetadataField", 2);
7268
- B = q([
7269
- k("ap-filters-bar")
7270
- ], B);
7271
- var ki = Object.defineProperty, Si = Object.getOwnPropertyDescriptor, Ee = (t, e, s, i) => {
7272
- for (var a = i > 1 ? void 0 : i ? Si(e, s) : e, r = t.length - 1, o; r >= 0; r--)
7336
+ ], N.prototype, "pendingMetadataField", 2);
7337
+ N = V([
7338
+ S("ap-filters-bar")
7339
+ ], N);
7340
+ var Si = Object.defineProperty, Ci = Object.getOwnPropertyDescriptor, Ee = (t, e, s, i) => {
7341
+ for (var a = i > 1 ? void 0 : i ? Ci(e, s) : e, r = t.length - 1, o; r >= 0; r--)
7273
7342
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
7274
- return i && a && ki(e, s, a), a;
7343
+ return i && a && Si(e, s, a), a;
7275
7344
  };
7276
- const Ci = 6;
7277
- let ae = class extends w {
7345
+ const Fi = 6;
7346
+ let ae = class extends k {
7278
7347
  constructor() {
7279
7348
  super(...arguments), this.assets = [], this.folders = [], this.folderPreviews = {}, this.selectedIds = [], this.isLoading = !1, this.multiSelect = !0, this._prevCount = 0;
7280
7349
  }
@@ -7316,7 +7385,7 @@ let ae = class extends w {
7316
7385
  `;
7317
7386
  }
7318
7387
  )}
7319
- ${this.isLoading ? Array.from({ length: Ci }, () => n`<div class="ghost-card"></div>`) : f}
7388
+ ${this.isLoading ? Array.from({ length: Fi }, () => n`<div class="ghost-card"></div>`) : f}
7320
7389
  </div>
7321
7390
  `;
7322
7391
  }
@@ -7370,15 +7439,15 @@ Ee([
7370
7439
  h({ type: Boolean })
7371
7440
  ], ae.prototype, "multiSelect", 2);
7372
7441
  ae = Ee([
7373
- k("ap-grid-view")
7442
+ S("ap-grid-view")
7374
7443
  ], ae);
7375
- var Fi = Object.defineProperty, Ei = Object.getOwnPropertyDescriptor, ge = (t, e, s, i) => {
7376
- for (var a = i > 1 ? void 0 : i ? Ei(e, s) : e, r = t.length - 1, o; r >= 0; r--)
7444
+ var Ei = Object.defineProperty, Ai = Object.getOwnPropertyDescriptor, ge = (t, e, s, i) => {
7445
+ for (var a = i > 1 ? void 0 : i ? Ai(e, s) : e, r = t.length - 1, o; r >= 0; r--)
7377
7446
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
7378
- return i && a && Fi(e, s, a), a;
7447
+ return i && a && Ei(e, s, a), a;
7379
7448
  };
7380
- const Ai = 5;
7381
- let Q = class extends w {
7449
+ const Ti = 5;
7450
+ let Q = class extends k {
7382
7451
  constructor() {
7383
7452
  super(...arguments), this.assets = [], this.folders = [], this.selectedIds = [], this.isLoading = !1, this.multiSelect = !0, this.totalCount = 0, this.isSelectingAll = !1;
7384
7453
  }
@@ -7435,7 +7504,7 @@ let Q = class extends w {
7435
7504
  ></ap-asset-row>
7436
7505
  `
7437
7506
  )}
7438
- ${this.isLoading ? Array.from({ length: Ai }, () => n`<div class="ghost-row"></div>`) : f}
7507
+ ${this.isLoading ? Array.from({ length: Ti }, () => n`<div class="ghost-row"></div>`) : f}
7439
7508
  </div>
7440
7509
  `;
7441
7510
  }
@@ -7538,18 +7607,18 @@ ge([
7538
7607
  h({ type: Boolean })
7539
7608
  ], Q.prototype, "isSelectingAll", 2);
7540
7609
  Q = ge([
7541
- k("ap-list-view")
7610
+ S("ap-list-view")
7542
7611
  ], Q);
7543
7612
  function lt(t) {
7544
7613
  var i;
7545
7614
  const e = t.info, s = (e == null ? void 0 : e.video_thumbnail) || (e == null ? void 0 : e.image_thumbnail) || (e == null ? void 0 : e.thumbnail) || (e == null ? void 0 : e.preview) || ((i = t.url) == null ? void 0 : i.cdn) || "";
7546
7615
  return Ie(s);
7547
7616
  }
7548
- function _s(t) {
7617
+ function ys(t) {
7549
7618
  const e = t.info, s = (e == null ? void 0 : e.video_thumbnail) || (e == null ? void 0 : e.image_thumbnail) || (e == null ? void 0 : e.thumbnail) || "";
7550
7619
  return s ? Ie(s) : "";
7551
7620
  }
7552
- function Rt(t) {
7621
+ function Nt(t) {
7553
7622
  var s, i;
7554
7623
  let e = Ie(((s = t.url) == null ? void 0 : s.cdn) || ((i = t.url) == null ? void 0 : i.public) || "");
7555
7624
  return e ? (e = e.replace(/([?&])func=proxy&?/, "$1").replace(/[?&]$/, ""), Ve(e, {
@@ -7569,14 +7638,14 @@ function Ve(t, e) {
7569
7638
  return t;
7570
7639
  }
7571
7640
  }
7572
- const as = /^(https:\/\/)([a-z0-9_-]+)\.filerobot\.com\//i;
7641
+ const is = /^(https:\/\/)([a-z0-9_-]+)\.filerobot\.com\//i;
7573
7642
  function Ie(t, e) {
7574
7643
  if (!t) return "";
7575
7644
  if (t.includes("assets.filerobot.com")) return t;
7576
- const s = t.match(as);
7645
+ const s = t.match(is);
7577
7646
  if (s) {
7578
7647
  const i = s[2];
7579
- return t.replace(as, `$1assets.filerobot.com/${i}/`);
7648
+ return t.replace(is, `$1assets.filerobot.com/${i}/`);
7580
7649
  }
7581
7650
  if (e)
7582
7651
  try {
@@ -7586,7 +7655,7 @@ function Ie(t, e) {
7586
7655
  }
7587
7656
  return t;
7588
7657
  }
7589
- function Nt(t) {
7658
+ function jt(t) {
7590
7659
  if (t === 0) return "0 B";
7591
7660
  const e = ["B", "KB", "MB", "GB", "TB"], s = 1024, i = Math.floor(Math.log(t) / Math.log(s));
7592
7661
  return `${(t / Math.pow(s, i)).toFixed(i === 0 ? 0 : 1)} ${e[i]}`;
@@ -7600,11 +7669,11 @@ function ct(t) {
7600
7669
  day: "numeric"
7601
7670
  });
7602
7671
  }
7603
- function ys(t, e) {
7672
+ function xs(t, e) {
7604
7673
  return !t || !e ? "" : `${t} x ${e}`;
7605
7674
  }
7606
- const Ti = /* @__PURE__ */ new Set(["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp", "ico", "tiff", "tif", "avif", "heic", "heif"]), Oi = /* @__PURE__ */ new Set([
7607
- ...Ti,
7675
+ const Mi = /* @__PURE__ */ new Set(["jpg", "jpeg", "png", "gif", "webp", "svg", "bmp", "ico", "tiff", "tif", "avif", "heic", "heif"]), Oi = /* @__PURE__ */ new Set([
7676
+ ...Mi,
7608
7677
  "pdf",
7609
7678
  "psd",
7610
7679
  "eps",
@@ -7615,7 +7684,7 @@ const Ti = /* @__PURE__ */ new Set(["jpg", "jpeg", "png", "gif", "webp", "svg",
7615
7684
  "woff2",
7616
7685
  "eot"
7617
7686
  ]);
7618
- function Me(t) {
7687
+ function Oe(t) {
7619
7688
  if (!t) return "other";
7620
7689
  const e = {
7621
7690
  image: "image",
@@ -7627,11 +7696,11 @@ function Me(t) {
7627
7696
  };
7628
7697
  return e[t] ? e[t] : t.startsWith("image/") ? "image" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("application/pdf") || t.startsWith("text/") || t.startsWith("application/msword") || t.startsWith("application/vnd.") ? "document" : t.startsWith("application/zip") || t.startsWith("application/x-rar") || t.startsWith("application/x-7z") || t.startsWith("application/gzip") ? "archive" : t.startsWith("font/") ? "font" : "other";
7629
7698
  }
7630
- function xs(t) {
7699
+ function ws(t) {
7631
7700
  const e = (t == null ? void 0 : t.toLowerCase().replace(".", "")) || "";
7632
7701
  return Oi.has(e);
7633
7702
  }
7634
- const $s = "https://assets.filerobot.com/scaleflex/assets/file-types/v2/", Mi = {
7703
+ const $s = "https://assets.filerobot.com/scaleflex/assets/file-types/v2/", Pi = {
7635
7704
  png: "PNG",
7636
7705
  jpg: "JPG",
7637
7706
  jpeg: "JPG",
@@ -7695,7 +7764,7 @@ const $s = "https://assets.filerobot.com/scaleflex/assets/file-types/v2/", Mi =
7695
7764
  bin: "BIN"
7696
7765
  };
7697
7766
  function _t(t) {
7698
- const e = (t == null ? void 0 : t.toLowerCase().replace(".", "")) || "", s = Mi[e];
7767
+ const e = (t == null ? void 0 : t.toLowerCase().replace(".", "")) || "", s = Pi[e];
7699
7768
  return `${$s}${s || "DEFAULT"}.png`;
7700
7769
  }
7701
7770
  function Ke() {
@@ -7706,17 +7775,17 @@ function Ot(t) {
7706
7775
  const e = t.split("/");
7707
7776
  return e.length > 1 ? e[1] : e[0];
7708
7777
  }
7709
- const Pi = /* @__PURE__ */ new Set(["png", "svg", "webp", "gif", "avif"]);
7710
- function jt(t) {
7778
+ const Li = /* @__PURE__ */ new Set(["png", "svg", "webp", "gif", "avif"]);
7779
+ function Ut(t) {
7711
7780
  const e = (t == null ? void 0 : t.toLowerCase().replace(".", "")) || "";
7712
- return Pi.has(e);
7781
+ return Li.has(e);
7713
7782
  }
7714
- var Li = Object.defineProperty, Ii = Object.getOwnPropertyDescriptor, Ze = (t, e, s, i) => {
7715
- for (var a = i > 1 ? void 0 : i ? Ii(e, s) : e, r = t.length - 1, o; r >= 0; r--)
7783
+ var Ii = Object.defineProperty, Di = Object.getOwnPropertyDescriptor, Ze = (t, e, s, i) => {
7784
+ for (var a = i > 1 ? void 0 : i ? Di(e, s) : e, r = t.length - 1, o; r >= 0; r--)
7716
7785
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
7717
- return i && a && Li(e, s, a), a;
7786
+ return i && a && Ii(e, s, a), a;
7718
7787
  };
7719
- let we = class extends w {
7788
+ let $e = class extends k {
7720
7789
  constructor() {
7721
7790
  super(...arguments), this.index = 0, this.selected = !1, this.multiSelect = !0;
7722
7791
  }
@@ -7755,10 +7824,10 @@ let we = class extends w {
7755
7824
  var c, p, u, v;
7756
7825
  const t = this.asset;
7757
7826
  if (!t) return n``;
7758
- const s = Me(t.type) === "video", i = ((c = t.extension) == null ? void 0 : c.toLowerCase()) === "pdf", a = xs(t.extension || "");
7827
+ const s = Oe(t.type) === "video", i = ((c = t.extension) == null ? void 0 : c.toLowerCase()) === "pdf", a = ws(t.extension || "");
7759
7828
  let r = "";
7760
- s ? r = _s(t) : i ? r = Rt(t) : a && (r = lt(t));
7761
- const o = _t(t.extension || ""), l = jt(t.extension || "");
7829
+ s ? r = ys(t) : i ? r = Nt(t) : a && (r = lt(t));
7830
+ const o = _t(t.extension || ""), l = Ut(t.extension || "");
7762
7831
  return n`
7763
7832
  <div class="card" @click=${this._handleSelect}>
7764
7833
  <div class="thumbnail ${l && r ? "chess" : ""}">
@@ -7804,16 +7873,16 @@ let we = class extends w {
7804
7873
  <div class="info">
7805
7874
  <div class="name" title=${t.name}>${t.name}</div>
7806
7875
  <div class="meta">${(u = t.extension) == null ? void 0 : u.toUpperCase()}${(() => {
7807
- var E, y, D, F;
7808
- const d = ((E = t.info) == null ? void 0 : E.img_w) || ((y = t.info) == null ? void 0 : y.video_w), g = ((D = t.info) == null ? void 0 : D.img_h) || ((F = t.info) == null ? void 0 : F.video_h), b = ys(d, g);
7876
+ var E, y, A, F;
7877
+ const d = ((E = t.info) == null ? void 0 : E.img_w) || ((y = t.info) == null ? void 0 : y.video_w), g = ((A = t.info) == null ? void 0 : A.img_h) || ((F = t.info) == null ? void 0 : F.video_h), b = xs(d, g);
7809
7878
  return b ? ` · ${b}` : "";
7810
- })()} · ${Nt(((v = t.size) == null ? void 0 : v.bytes) || 0)}</div>
7879
+ })()} · ${jt(((v = t.size) == null ? void 0 : v.bytes) || 0)}</div>
7811
7880
  </div>
7812
7881
  </div>
7813
7882
  `;
7814
7883
  }
7815
7884
  };
7816
- we.styles = $`
7885
+ $e.styles = $`
7817
7886
  :host {
7818
7887
  display: block;
7819
7888
  animation: ap-card-in 300ms ease-out both;
@@ -7992,25 +8061,25 @@ we.styles = $`
7992
8061
  `;
7993
8062
  Ze([
7994
8063
  h({ type: Object })
7995
- ], we.prototype, "asset", 2);
8064
+ ], $e.prototype, "asset", 2);
7996
8065
  Ze([
7997
8066
  h({ type: Number })
7998
- ], we.prototype, "index", 2);
8067
+ ], $e.prototype, "index", 2);
7999
8068
  Ze([
8000
8069
  h({ type: Boolean, reflect: !0 })
8001
- ], we.prototype, "selected", 2);
8070
+ ], $e.prototype, "selected", 2);
8002
8071
  Ze([
8003
8072
  h({ type: Boolean })
8004
- ], we.prototype, "multiSelect", 2);
8005
- we = Ze([
8006
- k("ap-asset-card")
8007
- ], we);
8008
- var Di = Object.defineProperty, zi = Object.getOwnPropertyDescriptor, Je = (t, e, s, i) => {
8009
- for (var a = i > 1 ? void 0 : i ? zi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
8073
+ ], $e.prototype, "multiSelect", 2);
8074
+ $e = Ze([
8075
+ S("ap-asset-card")
8076
+ ], $e);
8077
+ var zi = Object.defineProperty, Ri = Object.getOwnPropertyDescriptor, Je = (t, e, s, i) => {
8078
+ for (var a = i > 1 ? void 0 : i ? Ri(e, s) : e, r = t.length - 1, o; r >= 0; r--)
8010
8079
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
8011
- return i && a && Di(e, s, a), a;
8080
+ return i && a && zi(e, s, a), a;
8012
8081
  };
8013
- let ke = class extends w {
8082
+ let ke = class extends k {
8014
8083
  constructor() {
8015
8084
  super(...arguments), this.index = 0, this.selected = !1, this.multiSelect = !0;
8016
8085
  }
@@ -8039,10 +8108,10 @@ let ke = class extends w {
8039
8108
  var c, p, u;
8040
8109
  const t = this.asset;
8041
8110
  if (!t) return n``;
8042
- const s = Me(t.type) === "video", i = ((c = t.extension) == null ? void 0 : c.toLowerCase()) === "pdf", a = xs(t.extension || "");
8111
+ const s = Oe(t.type) === "video", i = ((c = t.extension) == null ? void 0 : c.toLowerCase()) === "pdf", a = ws(t.extension || "");
8043
8112
  let r = "";
8044
- s ? r = _s(t) : i ? r = Rt(t) : a && (r = lt(t));
8045
- const o = _t(t.extension || ""), l = jt(t.extension || "");
8113
+ s ? r = ys(t) : i ? r = Nt(t) : a && (r = lt(t));
8114
+ const o = _t(t.extension || ""), l = Ut(t.extension || "");
8046
8115
  return n`
8047
8116
  <div class="row" @click=${this._handleSelect}>
8048
8117
  ${this.multiSelect ? n`
@@ -8076,7 +8145,7 @@ let ke = class extends w {
8076
8145
  </div>
8077
8146
  <div class="name" title=${t.name}>${t.name}</div>
8078
8147
  <div class="type">${(p = t.extension) == null ? void 0 : p.toUpperCase()}</div>
8079
- <div class="desc">${Nt(((u = t.size) == null ? void 0 : u.bytes) || 0)}</div>
8148
+ <div class="desc">${jt(((u = t.size) == null ? void 0 : u.bytes) || 0)}</div>
8080
8149
  <div class="date">${ct(t.created_at || "")}</div>
8081
8150
  <div class="actions">
8082
8151
  <button class="icon-btn" @click=${this._handlePreview} aria-label="Preview">
@@ -8226,14 +8295,14 @@ Je([
8226
8295
  h({ type: Boolean })
8227
8296
  ], ke.prototype, "multiSelect", 2);
8228
8297
  ke = Je([
8229
- k("ap-asset-row")
8298
+ S("ap-asset-row")
8230
8299
  ], ke);
8231
- var Ri = Object.defineProperty, Ni = Object.getOwnPropertyDescriptor, Bt = (t, e, s, i) => {
8232
- for (var a = i > 1 ? void 0 : i ? Ni(e, s) : e, r = t.length - 1, o; r >= 0; r--)
8300
+ var Ni = Object.defineProperty, ji = Object.getOwnPropertyDescriptor, Bt = (t, e, s, i) => {
8301
+ for (var a = i > 1 ? void 0 : i ? ji(e, s) : e, r = t.length - 1, o; r >= 0; r--)
8233
8302
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
8234
- return i && a && Ri(e, s, a), a;
8303
+ return i && a && Ni(e, s, a), a;
8235
8304
  };
8236
- let Ge = class extends w {
8305
+ let Ge = class extends k {
8237
8306
  constructor() {
8238
8307
  super(...arguments), this.previews = [];
8239
8308
  }
@@ -8256,7 +8325,7 @@ let Ge = class extends w {
8256
8325
  const e = t.file_uri_cdn;
8257
8326
  if (!e) return "";
8258
8327
  let s = Ie(e);
8259
- const i = Me(t.file_type), a = String(window.devicePixelRatio || 1);
8328
+ const i = Oe(t.file_type), a = String(window.devicePixelRatio || 1);
8260
8329
  return i === "video" ? Ve(s, { w: "200", dpr: a, force_format: "webp,jpeg" }) : t.file_type === "application/pdf" || Ot(t.file_type).toLowerCase() === "pdf" ? (s = s.replace(/([?&])func=proxy&?/, "$1").replace(/[?&]$/, ""), Ve(s, { w: "200", dpr: a, force_format: "webp,jpeg", doc_page: "1", bypass_process_proxy: "1" })) : Ve(s, { w: "200", dpr: a });
8261
8330
  }
8262
8331
  _renderPreviewImg(t) {
@@ -8461,14 +8530,14 @@ Bt([
8461
8530
  h({ type: Array })
8462
8531
  ], Ge.prototype, "previews", 2);
8463
8532
  Ge = Bt([
8464
- k("ap-folder-card")
8533
+ S("ap-folder-card")
8465
8534
  ], Ge);
8466
- var ji = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, ws = (t, e, s, i) => {
8535
+ var Ui = Object.defineProperty, Bi = Object.getOwnPropertyDescriptor, ks = (t, e, s, i) => {
8467
8536
  for (var a = i > 1 ? void 0 : i ? Bi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
8468
8537
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
8469
- return i && a && ji(e, s, a), a;
8538
+ return i && a && Ui(e, s, a), a;
8470
8539
  };
8471
- let dt = class extends w {
8540
+ let dt = class extends k {
8472
8541
  _handleOpen() {
8473
8542
  this.dispatchEvent(new CustomEvent("folder-open", {
8474
8543
  detail: { folder: this.folder },
@@ -8524,18 +8593,18 @@ dt.styles = $`
8524
8593
  color: var(--ap-muted-foreground, oklch(0.685 0.033 249.82));
8525
8594
  }
8526
8595
  `;
8527
- ws([
8596
+ ks([
8528
8597
  h({ type: Object })
8529
8598
  ], dt.prototype, "folder", 2);
8530
- dt = ws([
8531
- k("ap-folder-row")
8599
+ dt = ks([
8600
+ S("ap-folder-row")
8532
8601
  ], dt);
8533
- var Ui = Object.defineProperty, Vi = Object.getOwnPropertyDescriptor, ks = (t, e, s, i) => {
8534
- for (var a = i > 1 ? void 0 : i ? Vi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
8602
+ var Vi = Object.defineProperty, qi = Object.getOwnPropertyDescriptor, Ss = (t, e, s, i) => {
8603
+ for (var a = i > 1 ? void 0 : i ? qi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
8535
8604
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
8536
- return i && a && Ui(e, s, a), a;
8605
+ return i && a && Vi(e, s, a), a;
8537
8606
  };
8538
- let pt = class extends w {
8607
+ let pt = class extends k {
8539
8608
  constructor() {
8540
8609
  super(...arguments), this.variant = "grid";
8541
8610
  }
@@ -8582,25 +8651,25 @@ pt.styles = $`
8582
8651
  .skeleton { animation: none; }
8583
8652
  }
8584
8653
  `;
8585
- ks([
8654
+ Ss([
8586
8655
  h()
8587
8656
  ], pt.prototype, "variant", 2);
8588
- pt = ks([
8589
- k("ap-skeleton")
8657
+ pt = Ss([
8658
+ S("ap-skeleton")
8590
8659
  ], pt);
8591
- function qi(t) {
8660
+ function Hi(t) {
8592
8661
  var a, r;
8593
8662
  const e = (a = t.info) == null ? void 0 : a.playlists;
8594
8663
  if (!(e != null && e.length)) return null;
8595
8664
  const s = (r = e[0]) == null ? void 0 : r.playlists;
8596
8665
  return s != null && s.length && s[0] || null;
8597
8666
  }
8598
- var Hi = Object.defineProperty, Ki = Object.getOwnPropertyDescriptor, j = (t, e, s, i) => {
8599
- for (var a = i > 1 ? void 0 : i ? Ki(e, s) : e, r = t.length - 1, o; r >= 0; r--)
8667
+ var Ki = Object.defineProperty, Gi = Object.getOwnPropertyDescriptor, z = (t, e, s, i) => {
8668
+ for (var a = i > 1 ? void 0 : i ? Gi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
8600
8669
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
8601
- return i && a && Hi(e, s, a), a;
8670
+ return i && a && Ki(e, s, a), a;
8602
8671
  };
8603
- let R = class extends w {
8672
+ let D = class extends k {
8604
8673
  constructor() {
8605
8674
  super(...arguments), this.asset = null, this.assets = [], this.selectedIds = [], this.containerToken = "", this.showMetadata = !0, this.metadataFields = [], this.labels = [], this.regionalFilters = {}, this.multiSelect = !0, this._isFullscreen = !1, this._fsImageLoaded = !1, this._previewLoading = !1, this._openSections = /* @__PURE__ */ new Set(["file-info", "metadata"]), this._hls = null;
8606
8675
  }
@@ -8622,13 +8691,13 @@ let R = class extends w {
8622
8691
  }
8623
8692
  updated(t) {
8624
8693
  if (super.updated(t), t.has("asset") && (this._destroyHls(), this._previewLoading = !0, this.asset)) {
8625
- const e = Me(this.asset.type);
8694
+ const e = Oe(this.asset.type);
8626
8695
  e === "video" && this._setupHls(this.asset), e !== "image" && e !== "video" && (this._previewLoading = !1);
8627
8696
  }
8628
8697
  }
8629
8698
  async _setupHls(t) {
8630
8699
  var i, a;
8631
- const e = qi(t);
8700
+ const e = Hi(t);
8632
8701
  if (!e || (await this.updateComplete, ((i = this.asset) == null ? void 0 : i.uuid) !== t.uuid)) return;
8633
8702
  const s = this._videoEl;
8634
8703
  if (s) {
@@ -8695,7 +8764,7 @@ let R = class extends w {
8695
8764
  }
8696
8765
  /** Check if an asset supports inline fullscreen preview (not PDF/other). */
8697
8766
  _supportsFullscreen(t) {
8698
- const e = Me(t.type);
8767
+ const e = Oe(t.type);
8699
8768
  return e === "image" || e === "video" || e === "audio";
8700
8769
  }
8701
8770
  /**
@@ -8764,14 +8833,14 @@ let R = class extends w {
8764
8833
  }
8765
8834
  _applyTagFilter(t) {
8766
8835
  this.dispatchEvent(new CustomEvent("filter-update", {
8767
- detail: { key: m.TAGS, values: [t], operator: x.IS },
8836
+ detail: { key: m.TAGS, values: [t], operator: w.IS },
8768
8837
  bubbles: !0,
8769
8838
  composed: !0
8770
8839
  }));
8771
8840
  }
8772
8841
  _applyLabelFilter(t) {
8773
8842
  this.dispatchEvent(new CustomEvent("filter-update", {
8774
- detail: { key: m.LABELS, values: [t], operator: x.IS },
8843
+ detail: { key: m.LABELS, values: [t], operator: w.IS },
8775
8844
  bubbles: !0,
8776
8845
  composed: !0
8777
8846
  }));
@@ -8838,7 +8907,7 @@ let R = class extends w {
8838
8907
  _getFileInfoRows(t) {
8839
8908
  var s, i, a, r, o;
8840
8909
  const e = [];
8841
- return e.push({ label: "File name", value: t.name }), t.extension && e.push({ label: "Type", value: t.extension.toUpperCase() }), (s = t.size) != null && s.bytes && e.push({ label: "Size", value: Nt(t.size.bytes) }), (i = t.info) != null && i.img_w && e.push({ label: "Dimensions", value: ys(t.info.img_w, t.info.img_h) }), (a = t.info) != null && a.video_w && e.push({ label: "Video resolution", value: `${t.info.video_w} x ${t.info.video_h}` }), (r = t.info) != null && r.duration && e.push({ label: "Duration", value: `${Math.round(t.info.duration)}s` }), (o = t.info) != null && o.color_space && e.push({ label: "Color space", value: t.info.color_space }), t.created_at && e.push({ label: "Created", value: ct(t.created_at) }), t.modified_at && e.push({ label: "Modified", value: ct(t.modified_at) }), e;
8910
+ return e.push({ label: "File name", value: t.name }), t.extension && e.push({ label: "Type", value: t.extension.toUpperCase() }), (s = t.size) != null && s.bytes && e.push({ label: "Size", value: jt(t.size.bytes) }), (i = t.info) != null && i.img_w && e.push({ label: "Dimensions", value: xs(t.info.img_w, t.info.img_h) }), (a = t.info) != null && a.video_w && e.push({ label: "Video resolution", value: `${t.info.video_w} x ${t.info.video_h}` }), (r = t.info) != null && r.duration && e.push({ label: "Duration", value: `${Math.round(t.info.duration)}s` }), (o = t.info) != null && o.color_space && e.push({ label: "Color space", value: t.info.color_space }), t.created_at && e.push({ label: "Created", value: ct(t.created_at) }), t.modified_at && e.push({ label: "Modified", value: ct(t.modified_at) }), e;
8842
8911
  }
8843
8912
  /**
8844
8913
  * Build a lookup map from metadata field key → field definition.
@@ -8972,10 +9041,10 @@ let R = class extends w {
8972
9041
  `;
8973
9042
  }
8974
9043
  render() {
8975
- var L, I, N, O, ne, fe, Ae, et;
9044
+ var H, T, R, U, ne, fe, Ae, et;
8976
9045
  const t = this.asset;
8977
9046
  if (!t) return f;
8978
- const e = Me(t.type), s = e === "image", i = e === "video", a = e === "audio", r = ((L = t.extension) == null ? void 0 : L.toLowerCase()) === "pdf", o = _t(t.extension || ""), l = jt(t.extension || ""), c = ((I = t.extension) == null ? void 0 : I.toLowerCase()) === "svg", p = lt(t), u = s ? c ? ((N = t.url) == null ? void 0 : N.cdn) || "" : p || Ie(((O = t.url) == null ? void 0 : O.cdn) || "", this.containerToken) : "", v = s ? this._getFullscreenImageUrl(t) : "", d = s && !c ? this._getBlurDimensions(t) : null, g = i && ((ne = t.url) == null ? void 0 : ne.cdn) || "", b = i && (((fe = t.info) == null ? void 0 : fe.video_thumbnail) || ((Ae = t.info) == null ? void 0 : Ae.preview)) || "", E = r && !s ? Rt(t) : "", y = this._getCurrentIndex(), D = y > 0 && this._findNavTarget(y, -1) >= 0, F = y >= 0 && this._findNavTarget(y, 1) >= 0, A = this.assets.length > 1;
9047
+ const e = Oe(t.type), s = e === "image", i = e === "video", a = e === "audio", r = ((H = t.extension) == null ? void 0 : H.toLowerCase()) === "pdf", o = _t(t.extension || ""), l = Ut(t.extension || ""), c = ((T = t.extension) == null ? void 0 : T.toLowerCase()) === "svg", p = lt(t), u = s ? c ? ((R = t.url) == null ? void 0 : R.cdn) || "" : p || Ie(((U = t.url) == null ? void 0 : U.cdn) || "", this.containerToken) : "", v = s ? this._getFullscreenImageUrl(t) : "", d = s && !c ? this._getBlurDimensions(t) : null, g = i && ((ne = t.url) == null ? void 0 : ne.cdn) || "", b = i && (((fe = t.info) == null ? void 0 : fe.video_thumbnail) || ((Ae = t.info) == null ? void 0 : Ae.preview)) || "", E = r && !s ? Nt(t) : "", y = this._getCurrentIndex(), A = y > 0 && this._findNavTarget(y, -1) >= 0, F = y >= 0 && this._findNavTarget(y, 1) >= 0, I = this.assets.length > 1;
8979
9048
  return n`
8980
9049
  <div class="panel">
8981
9050
  <div class="panel-header">
@@ -8994,8 +9063,8 @@ let R = class extends w {
8994
9063
  </div>
8995
9064
 
8996
9065
  <div class="preview-area ${s && l ? "chess" : ""}">
8997
- ${A ? n`
8998
- <button class="nav-btn prev" @click=${this._prev} ?disabled=${!D} aria-label="Previous">
9066
+ ${I ? n`
9067
+ <button class="nav-btn prev" @click=${this._prev} ?disabled=${!A} aria-label="Previous">
8999
9068
  <ap-icon name="chevron-left" .size=${16}></ap-icon>
9000
9069
  </button>
9001
9070
  <button class="nav-btn next" @click=${this._next} ?disabled=${!F} aria-label="Next">
@@ -9066,7 +9135,7 @@ let R = class extends w {
9066
9135
  `;
9067
9136
  }
9068
9137
  };
9069
- R.styles = $`
9138
+ D.styles = $`
9070
9139
  :host {
9071
9140
  display: block;
9072
9141
  }
@@ -9376,60 +9445,60 @@ R.styles = $`
9376
9445
  .accordion-chevron { transition: none; }
9377
9446
  }
9378
9447
  `;
9379
- j([
9448
+ z([
9380
9449
  h({ type: Object })
9381
- ], R.prototype, "asset", 2);
9382
- j([
9450
+ ], D.prototype, "asset", 2);
9451
+ z([
9383
9452
  h({ type: Array })
9384
- ], R.prototype, "assets", 2);
9385
- j([
9453
+ ], D.prototype, "assets", 2);
9454
+ z([
9386
9455
  h({ type: Array })
9387
- ], R.prototype, "selectedIds", 2);
9388
- j([
9456
+ ], D.prototype, "selectedIds", 2);
9457
+ z([
9389
9458
  h()
9390
- ], R.prototype, "containerToken", 2);
9391
- j([
9459
+ ], D.prototype, "containerToken", 2);
9460
+ z([
9392
9461
  h({ type: Boolean })
9393
- ], R.prototype, "showMetadata", 2);
9394
- j([
9462
+ ], D.prototype, "showMetadata", 2);
9463
+ z([
9395
9464
  h({ type: Array })
9396
- ], R.prototype, "metadataFields", 2);
9397
- j([
9465
+ ], D.prototype, "metadataFields", 2);
9466
+ z([
9398
9467
  h({ type: Array })
9399
- ], R.prototype, "labels", 2);
9400
- j([
9468
+ ], D.prototype, "labels", 2);
9469
+ z([
9401
9470
  h({ type: Object })
9402
- ], R.prototype, "regionalFilters", 2);
9403
- j([
9471
+ ], D.prototype, "regionalFilters", 2);
9472
+ z([
9404
9473
  h({ type: Boolean })
9405
- ], R.prototype, "multiSelect", 2);
9406
- j([
9474
+ ], D.prototype, "multiSelect", 2);
9475
+ z([
9407
9476
  Se(".preview-area")
9408
- ], R.prototype, "previewArea", 2);
9409
- j([
9477
+ ], D.prototype, "previewArea", 2);
9478
+ z([
9410
9479
  Se("video")
9411
- ], R.prototype, "_videoEl", 2);
9412
- j([
9480
+ ], D.prototype, "_videoEl", 2);
9481
+ z([
9413
9482
  _()
9414
- ], R.prototype, "_isFullscreen", 2);
9415
- j([
9483
+ ], D.prototype, "_isFullscreen", 2);
9484
+ z([
9416
9485
  _()
9417
- ], R.prototype, "_fsImageLoaded", 2);
9418
- j([
9486
+ ], D.prototype, "_fsImageLoaded", 2);
9487
+ z([
9419
9488
  _()
9420
- ], R.prototype, "_previewLoading", 2);
9421
- j([
9489
+ ], D.prototype, "_previewLoading", 2);
9490
+ z([
9422
9491
  _()
9423
- ], R.prototype, "_openSections", 2);
9424
- R = j([
9425
- k("ap-preview-panel")
9426
- ], R);
9427
- var Gi = Object.defineProperty, Yi = Object.getOwnPropertyDescriptor, Ne = (t, e, s, i) => {
9428
- for (var a = i > 1 ? void 0 : i ? Yi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
9492
+ ], D.prototype, "_openSections", 2);
9493
+ D = z([
9494
+ S("ap-preview-panel")
9495
+ ], D);
9496
+ var Yi = Object.defineProperty, Xi = Object.getOwnPropertyDescriptor, Ne = (t, e, s, i) => {
9497
+ for (var a = i > 1 ? void 0 : i ? Xi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
9429
9498
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
9430
- return i && a && Gi(e, s, a), a;
9499
+ return i && a && Yi(e, s, a), a;
9431
9500
  };
9432
- let he = class extends w {
9501
+ let he = class extends k {
9433
9502
  constructor() {
9434
9503
  super(...arguments), this.selectedAssets = [], this.totalCount = 0, this.isSelectingAll = !1, this.multiSelect = !0;
9435
9504
  }
@@ -9564,14 +9633,14 @@ Ne([
9564
9633
  h({ type: Number })
9565
9634
  ], he.prototype, "maxSelections", 2);
9566
9635
  he = Ne([
9567
- k("ap-selection-bar")
9636
+ S("ap-selection-bar")
9568
9637
  ], he);
9569
- var Xi = Object.defineProperty, Wi = Object.getOwnPropertyDescriptor, Ut = (t, e, s, i) => {
9570
- for (var a = i > 1 ? void 0 : i ? Wi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
9638
+ var Wi = Object.defineProperty, Qi = Object.getOwnPropertyDescriptor, Vt = (t, e, s, i) => {
9639
+ for (var a = i > 1 ? void 0 : i ? Qi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
9571
9640
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
9572
- return i && a && Xi(e, s, a), a;
9641
+ return i && a && Wi(e, s, a), a;
9573
9642
  };
9574
- let Ye = class extends w {
9643
+ let Ye = class extends k {
9575
9644
  constructor() {
9576
9645
  super(...arguments), this.active = !1, this.rect = { x: 0, y: 0, width: 0, height: 0 };
9577
9646
  }
@@ -9602,21 +9671,21 @@ Ye.styles = $`
9602
9671
  border-radius: 2px;
9603
9672
  }
9604
9673
  `;
9605
- Ut([
9674
+ Vt([
9606
9675
  h({ type: Boolean })
9607
9676
  ], Ye.prototype, "active", 2);
9608
- Ut([
9677
+ Vt([
9609
9678
  h({ type: Object })
9610
9679
  ], Ye.prototype, "rect", 2);
9611
- Ye = Ut([
9612
- k("ap-marquee-overlay")
9680
+ Ye = Vt([
9681
+ S("ap-marquee-overlay")
9613
9682
  ], Ye);
9614
- var Qi = Object.defineProperty, Zi = Object.getOwnPropertyDescriptor, Vt = (t, e, s, i) => {
9615
- for (var a = i > 1 ? void 0 : i ? Zi(e, s) : e, r = t.length - 1, o; r >= 0; r--)
9683
+ var Zi = Object.defineProperty, Ji = Object.getOwnPropertyDescriptor, qt = (t, e, s, i) => {
9684
+ for (var a = i > 1 ? void 0 : i ? Ji(e, s) : e, r = t.length - 1, o; r >= 0; r--)
9616
9685
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
9617
- return i && a && Qi(e, s, a), a;
9686
+ return i && a && Zi(e, s, a), a;
9618
9687
  };
9619
- const Ji = {
9688
+ const er = {
9620
9689
  // ── Navigation & Actions ────────────────────────────────────────────
9621
9690
  search: [
9622
9691
  { tag: "circle", attrs: { cx: "11", cy: "11", r: "8" } },
@@ -9879,6 +9948,66 @@ const Ji = {
9879
9948
  { tag: "circle", attrs: { cx: "12", cy: "12", r: "10" } },
9880
9949
  { tag: "path", attrs: { d: "M12 6v6l4 2" } }
9881
9950
  ],
9951
+ // ── Metadata Field Types (exact Lucide icon paths) ─────────────────
9952
+ "toggle-left": [
9953
+ { tag: "rect", attrs: { width: "20", height: "14", x: "2", y: "5", rx: "7" } },
9954
+ { tag: "circle", attrs: { cx: "9", cy: "12", r: "3" } }
9955
+ ],
9956
+ "file-digit": [
9957
+ { tag: "path", attrs: { d: "M4 12V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2" } },
9958
+ { tag: "path", attrs: { d: "M14 2v5a1 1 0 0 0 1 1h5" } },
9959
+ { tag: "path", attrs: { d: "M10 16h2v6" } },
9960
+ { tag: "path", attrs: { d: "M10 22h4" } },
9961
+ { tag: "rect", attrs: { width: "4", height: "6", x: "2", y: "16", rx: "2" } }
9962
+ ],
9963
+ "decimals-arrow-right": [
9964
+ { tag: "path", attrs: { d: "M10 18h10" } },
9965
+ { tag: "path", attrs: { d: "m17 21 3-3-3-3" } },
9966
+ { tag: "path", attrs: { d: "M3 11h.01" } },
9967
+ { tag: "rect", attrs: { width: "5", height: "8", x: "15", y: "3", rx: "2.5" } },
9968
+ { tag: "rect", attrs: { width: "5", height: "8", x: "6", y: "3", rx: "2.5" } }
9969
+ ],
9970
+ "text-initial": [
9971
+ { tag: "path", attrs: { d: "M15 5h6" } },
9972
+ { tag: "path", attrs: { d: "M15 12h6" } },
9973
+ { tag: "path", attrs: { d: "M3 19h18" } },
9974
+ { tag: "path", attrs: { d: "m3 12 3.553-7.724a.5.5 0 0 1 .894 0L11 12" } },
9975
+ { tag: "path", attrs: { d: "M3.92 10h6.16" } }
9976
+ ],
9977
+ "text-align-justify": [
9978
+ { tag: "path", attrs: { d: "M3 5h18" } },
9979
+ { tag: "path", attrs: { d: "M3 12h18" } },
9980
+ { tag: "path", attrs: { d: "M3 19h18" } }
9981
+ ],
9982
+ paperclip: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
9983
+ "link-2": [
9984
+ { tag: "path", attrs: { d: "M9 17H7A5 5 0 0 1 7 7h2" } },
9985
+ { tag: "path", attrs: { d: "M15 7h2a5 5 0 1 1 0 10h-2" } },
9986
+ { tag: "path", attrs: { d: "M8 12h8" } }
9987
+ ],
9988
+ "circle-dot": [
9989
+ { tag: "circle", attrs: { cx: "12", cy: "12", r: "10" } },
9990
+ { tag: "circle", attrs: { cx: "12", cy: "12", r: "1" } }
9991
+ ],
9992
+ "square-check": [
9993
+ { tag: "rect", attrs: { width: "18", height: "18", x: "3", y: "3", rx: "2" } },
9994
+ { tag: "path", attrs: { d: "m9 12 2 2 4-4" } }
9995
+ ],
9996
+ locate: [
9997
+ { tag: "path", attrs: { d: "M2 12h3" } },
9998
+ { tag: "path", attrs: { d: "M19 12h3" } },
9999
+ { tag: "path", attrs: { d: "M12 2v3" } },
10000
+ { tag: "path", attrs: { d: "M12 19v3" } },
10001
+ { tag: "circle", attrs: { cx: "12", cy: "12", r: "7" } }
10002
+ ],
10003
+ "list-ordered": [
10004
+ { tag: "path", attrs: { d: "M11 5h10" } },
10005
+ { tag: "path", attrs: { d: "M11 12h10" } },
10006
+ { tag: "path", attrs: { d: "M11 19h10" } },
10007
+ { tag: "path", attrs: { d: "M4 4h1v5" } },
10008
+ { tag: "path", attrs: { d: "M4 9h2" } },
10009
+ { tag: "path", attrs: { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02" } }
10010
+ ],
9882
10011
  // ── Misc ────────────────────────────────────────────────────────────
9883
10012
  component: [
9884
10013
  { tag: "path", attrs: { d: "M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z" } },
@@ -9887,12 +10016,12 @@ const Ji = {
9887
10016
  { tag: "path", attrs: { d: "M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z" } }
9888
10017
  ]
9889
10018
  };
9890
- let Xe = class extends w {
10019
+ let Xe = class extends k {
9891
10020
  constructor() {
9892
10021
  super(...arguments), this.name = "", this.size = 20;
9893
10022
  }
9894
10023
  render() {
9895
- const t = Ji[this.name];
10024
+ const t = er[this.name];
9896
10025
  if (!t) return f;
9897
10026
  const e = typeof t == "string" ? ce`<path d=${t}></path>` : t.map((s) => {
9898
10027
  const { tag: i, attrs: a } = s;
@@ -9926,21 +10055,21 @@ Xe.styles = [
9926
10055
  }
9927
10056
  `
9928
10057
  ];
9929
- Vt([
10058
+ qt([
9930
10059
  h()
9931
10060
  ], Xe.prototype, "name", 2);
9932
- Vt([
10061
+ qt([
9933
10062
  h({ type: Number })
9934
10063
  ], Xe.prototype, "size", 2);
9935
- Xe = Vt([
9936
- k("ap-icon")
10064
+ Xe = qt([
10065
+ S("ap-icon")
9937
10066
  ], Xe);
9938
- var er = Object.defineProperty, tr = Object.getOwnPropertyDescriptor, Ss = (t, e, s, i) => {
9939
- for (var a = i > 1 ? void 0 : i ? tr(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10067
+ var tr = Object.defineProperty, sr = Object.getOwnPropertyDescriptor, Cs = (t, e, s, i) => {
10068
+ for (var a = i > 1 ? void 0 : i ? sr(e, s) : e, r = t.length - 1, o; r >= 0; r--)
9940
10069
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
9941
- return i && a && er(e, s, a), a;
10070
+ return i && a && tr(e, s, a), a;
9942
10071
  };
9943
- let ht = class extends w {
10072
+ let ht = class extends k {
9944
10073
  constructor() {
9945
10074
  super(...arguments), this.size = 24;
9946
10075
  }
@@ -9964,18 +10093,18 @@ ht.styles = [
9964
10093
  }
9965
10094
  `
9966
10095
  ];
9967
- Ss([
10096
+ Cs([
9968
10097
  h({ type: Number })
9969
10098
  ], ht.prototype, "size", 2);
9970
- ht = Ss([
9971
- k("ap-spinner")
10099
+ ht = Cs([
10100
+ S("ap-spinner")
9972
10101
  ], ht);
9973
- var sr = Object.defineProperty, ar = Object.getOwnPropertyDescriptor, yt = (t, e, s, i) => {
9974
- for (var a = i > 1 ? void 0 : i ? ar(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10102
+ var ar = Object.defineProperty, ir = Object.getOwnPropertyDescriptor, yt = (t, e, s, i) => {
10103
+ for (var a = i > 1 ? void 0 : i ? ir(e, s) : e, r = t.length - 1, o; r >= 0; r--)
9975
10104
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
9976
- return i && a && sr(e, s, a), a;
10105
+ return i && a && ar(e, s, a), a;
9977
10106
  };
9978
- let De = class extends w {
10107
+ let De = class extends k {
9979
10108
  constructor() {
9980
10109
  super(...arguments), this.checked = !1, this.indeterminate = !1, this.disabled = !1, this._hasLabel = !1, this._handleHostClick = () => {
9981
10110
  this.dispatchEvent(new CustomEvent("ap-toggle", {
@@ -10073,14 +10202,14 @@ yt([
10073
10202
  h({ type: Boolean, reflect: !0 })
10074
10203
  ], De.prototype, "disabled", 2);
10075
10204
  De = yt([
10076
- k("ap-checkbox")
10205
+ S("ap-checkbox")
10077
10206
  ], De);
10078
- var ir = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, Cs = (t, e, s, i) => {
10079
- for (var a = i > 1 ? void 0 : i ? rr(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10207
+ var rr = Object.defineProperty, or = Object.getOwnPropertyDescriptor, Fs = (t, e, s, i) => {
10208
+ for (var a = i > 1 ? void 0 : i ? or(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10080
10209
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
10081
- return i && a && ir(e, s, a), a;
10210
+ return i && a && rr(e, s, a), a;
10082
10211
  };
10083
- let ut = class extends w {
10212
+ let ut = class extends k {
10084
10213
  constructor() {
10085
10214
  super(...arguments), this.open = !1, this._handleOutsideClick = (t) => {
10086
10215
  this.open && !t.composedPath().includes(this) && (this.open = !1);
@@ -10125,18 +10254,18 @@ ut.styles = [
10125
10254
  }
10126
10255
  `
10127
10256
  ];
10128
- Cs([
10257
+ Fs([
10129
10258
  _()
10130
10259
  ], ut.prototype, "open", 2);
10131
- ut = Cs([
10132
- k("ap-popover")
10260
+ ut = Fs([
10261
+ S("ap-popover")
10133
10262
  ], ut);
10134
- var or = Object.defineProperty, nr = Object.getOwnPropertyDescriptor, H = (t, e, s, i) => {
10135
- for (var a = i > 1 ? void 0 : i ? nr(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10263
+ var nr = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, q = (t, e, s, i) => {
10264
+ for (var a = i > 1 ? void 0 : i ? lr(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10136
10265
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
10137
- return i && a && or(e, s, a), a;
10266
+ return i && a && nr(e, s, a), a;
10138
10267
  };
10139
- let U = class extends w {
10268
+ let j = class extends k {
10140
10269
  constructor() {
10141
10270
  super(...arguments), this.value = "", this.label = "", this.variant = "default", this.options = [], this._open = !1, this._focusedIndex = -1, this._menuPosition = "below", this._menuAlign = "align-left", this._menuTop = 0, this._menuBottom = 0, this._menuLeft = 0, this._menuRight = 0, this._handleOutsideClick = (t) => {
10142
10271
  t.composedPath().includes(this) || (this._open = !1, document.removeEventListener("click", this._handleOutsideClick));
@@ -10243,7 +10372,7 @@ let U = class extends w {
10243
10372
  super.disconnectedCallback(), document.removeEventListener("click", this._handleOutsideClick);
10244
10373
  }
10245
10374
  };
10246
- U.styles = [
10375
+ j.styles = [
10247
10376
  ie,
10248
10377
  $`
10249
10378
  :host {
@@ -10325,51 +10454,51 @@ U.styles = [
10325
10454
  }
10326
10455
  `
10327
10456
  ];
10328
- H([
10457
+ q([
10329
10458
  h()
10330
- ], U.prototype, "value", 2);
10331
- H([
10459
+ ], j.prototype, "value", 2);
10460
+ q([
10332
10461
  h()
10333
- ], U.prototype, "label", 2);
10334
- H([
10462
+ ], j.prototype, "label", 2);
10463
+ q([
10335
10464
  h({ reflect: !0 })
10336
- ], U.prototype, "variant", 2);
10337
- H([
10465
+ ], j.prototype, "variant", 2);
10466
+ q([
10338
10467
  h({ type: Array })
10339
- ], U.prototype, "options", 2);
10340
- H([
10468
+ ], j.prototype, "options", 2);
10469
+ q([
10341
10470
  _()
10342
- ], U.prototype, "_open", 2);
10343
- H([
10471
+ ], j.prototype, "_open", 2);
10472
+ q([
10344
10473
  _()
10345
- ], U.prototype, "_focusedIndex", 2);
10346
- H([
10474
+ ], j.prototype, "_focusedIndex", 2);
10475
+ q([
10347
10476
  _()
10348
- ], U.prototype, "_menuPosition", 2);
10349
- H([
10477
+ ], j.prototype, "_menuPosition", 2);
10478
+ q([
10350
10479
  _()
10351
- ], U.prototype, "_menuAlign", 2);
10352
- H([
10480
+ ], j.prototype, "_menuAlign", 2);
10481
+ q([
10353
10482
  _()
10354
- ], U.prototype, "_menuTop", 2);
10355
- H([
10483
+ ], j.prototype, "_menuTop", 2);
10484
+ q([
10356
10485
  _()
10357
- ], U.prototype, "_menuBottom", 2);
10358
- H([
10486
+ ], j.prototype, "_menuBottom", 2);
10487
+ q([
10359
10488
  _()
10360
- ], U.prototype, "_menuLeft", 2);
10361
- H([
10489
+ ], j.prototype, "_menuLeft", 2);
10490
+ q([
10362
10491
  _()
10363
- ], U.prototype, "_menuRight", 2);
10364
- U = H([
10365
- k("ap-dropdown")
10366
- ], U);
10367
- var lr = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, Fs = (t, e, s, i) => {
10368
- for (var a = i > 1 ? void 0 : i ? cr(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10492
+ ], j.prototype, "_menuRight", 2);
10493
+ j = q([
10494
+ S("ap-dropdown")
10495
+ ], j);
10496
+ var cr = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, Es = (t, e, s, i) => {
10497
+ for (var a = i > 1 ? void 0 : i ? dr(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10369
10498
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
10370
- return i && a && lr(e, s, a), a;
10499
+ return i && a && cr(e, s, a), a;
10371
10500
  };
10372
- let gt = class extends w {
10501
+ let gt = class extends k {
10373
10502
  constructor() {
10374
10503
  super(...arguments), this.variant = "default";
10375
10504
  }
@@ -10398,18 +10527,18 @@ gt.styles = [
10398
10527
  }
10399
10528
  `
10400
10529
  ];
10401
- Fs([
10530
+ Es([
10402
10531
  h({ reflect: !0 })
10403
10532
  ], gt.prototype, "variant", 2);
10404
- gt = Fs([
10405
- k("ap-badge")
10533
+ gt = Es([
10534
+ S("ap-badge")
10406
10535
  ], gt);
10407
- var dr = Object.defineProperty, pr = Object.getOwnPropertyDescriptor, Es = (t, e, s, i) => {
10408
- for (var a = i > 1 ? void 0 : i ? pr(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10536
+ var pr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, As = (t, e, s, i) => {
10537
+ for (var a = i > 1 ? void 0 : i ? hr(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10409
10538
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
10410
- return i && a && dr(e, s, a), a;
10539
+ return i && a && pr(e, s, a), a;
10411
10540
  };
10412
- let ft = class extends w {
10541
+ let ft = class extends k {
10413
10542
  constructor() {
10414
10543
  super(...arguments), this.text = "";
10415
10544
  }
@@ -10446,18 +10575,18 @@ ft.styles = [
10446
10575
  }
10447
10576
  `
10448
10577
  ];
10449
- Es([
10578
+ As([
10450
10579
  h()
10451
10580
  ], ft.prototype, "text", 2);
10452
- ft = Es([
10453
- k("ap-tooltip")
10581
+ ft = As([
10582
+ S("ap-tooltip")
10454
10583
  ], ft);
10455
- var hr = Object.defineProperty, ur = Object.getOwnPropertyDescriptor, je = (t, e, s, i) => {
10456
- for (var a = i > 1 ? void 0 : i ? ur(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10584
+ var ur = Object.defineProperty, gr = Object.getOwnPropertyDescriptor, je = (t, e, s, i) => {
10585
+ for (var a = i > 1 ? void 0 : i ? gr(e, s) : e, r = t.length - 1, o; r >= 0; r--)
10457
10586
  (o = t[r]) && (a = (i ? o(e, s, a) : o(a)) || a);
10458
- return i && a && hr(e, s, a), a;
10587
+ return i && a && ur(e, s, a), a;
10459
10588
  };
10460
- let ue = class extends w {
10589
+ let ue = class extends k {
10461
10590
  constructor() {
10462
10591
  super(...arguments), this.value = "", this.options = [], this.disabled = !1, this.direction = "vertical", this._onKeydown = (t) => {
10463
10592
  const e = this.options.filter(
@@ -10598,14 +10727,14 @@ je([
10598
10727
  h({ reflect: !0 })
10599
10728
  ], ue.prototype, "columns", 2);
10600
10729
  ue = je([
10601
- k("ap-radio-group")
10730
+ S("ap-radio-group")
10602
10731
  ], ue);
10603
- var gr = Object.defineProperty, qt = (t, e, s, i) => {
10732
+ var fr = Object.defineProperty, Ht = (t, e, s, i) => {
10604
10733
  for (var a = void 0, r = t.length - 1, o; r >= 0; r--)
10605
10734
  (o = t[r]) && (a = o(e, s, a) || a);
10606
- return a && gr(e, s, a), a;
10735
+ return a && fr(e, s, a), a;
10607
10736
  };
10608
- const Ht = class Ht extends w {
10737
+ const Kt = class Kt extends k {
10609
10738
  constructor() {
10610
10739
  super(), this._initFailed = !1, this._loadId = 0, this._loadMoreId = 0, this._loadDataTimer = null, this._pendingFilter = null, this._pendingMetadataField = null, this._uploaderEl = null, this._uploaderImportPromise = null, this._dragCounter = 0, this._isDragOver = !1, this._isUploaderOpen = !1, this._onDragEnter = (e) => {
10611
10740
  var s;
@@ -10622,7 +10751,7 @@ const Ht = class Ht extends w {
10622
10751
  e.preventDefault(), this._dragCounter = 0, this._isDragOver = !1;
10623
10752
  const s = Array.from(((a = e.dataTransfer) == null ? void 0 : a.files) ?? []);
10624
10753
  s.length > 0 && this._openUploader(s);
10625
- }, this.store = Ts(), this.storeCtrl = new Os(this, this.store), this.selectionCtrl = new Ms(this, this.store), this.infiniteScrollCtrl = new Ps(this, () => this._loadMore()), this.marqueeCtrl = new Ls(this, this.store);
10754
+ }, this.store = Ms(), this.storeCtrl = new Os(this, this.store), this.selectionCtrl = new Ps(this, this.store), this.infiniteScrollCtrl = new Ls(this, () => this._loadMore()), this.marqueeCtrl = new Is(this, this.store);
10626
10755
  }
10627
10756
  get _isInline() {
10628
10757
  var e;
@@ -10655,21 +10784,21 @@ const Ht = class Ht extends w {
10655
10784
  this.store.setState({
10656
10785
  config: e,
10657
10786
  projectToken: e.auth.projectToken,
10658
- viewMode: e.rememberLastView && Sa() || e.defaultViewMode || "grid",
10787
+ viewMode: e.rememberLastView && Ca() || e.defaultViewMode || "grid",
10659
10788
  sortBy: i,
10660
10789
  sortDirection: a,
10661
10790
  currentFolder: null,
10662
10791
  currentFolderPath: e.rootFolderPath ?? "/"
10663
- }), this.apiClient = new Is(e.auth, e.apiBase);
10792
+ }), this.apiClient = new Ds(e.auth, e.apiBase);
10664
10793
  try {
10665
10794
  if (e.auth.mode === "securityTemplate") {
10666
10795
  const d = await Bs(this.apiClient);
10667
10796
  this.apiClient.setSassKey(d), this.store.setState({ sassKey: d });
10668
10797
  }
10669
10798
  const [r, o, l] = await Promise.allSettled([
10670
- aa(this.apiClient),
10671
- Ns(this.apiClient),
10672
- js(this.apiClient)
10799
+ ia(this.apiClient),
10800
+ js(this.apiClient),
10801
+ Us(this.apiClient)
10673
10802
  ]);
10674
10803
  if (r.status === "fulfilled") {
10675
10804
  const { fields: d, regionalVariantGroups: g, regionalFilters: b, brandColor: E } = r.value;
@@ -10681,7 +10810,7 @@ const Ht = class Ht extends w {
10681
10810
  });
10682
10811
  }
10683
10812
  o.status === "fulfilled" && this.store.setState({ labels: o.value.labels || [] }), l.status === "fulfilled" && this.store.setState({ tags: l.value });
10684
- const { pinnedFilters: c, pinnedMetadata: p } = _a(e.auth.projectToken ?? null), u = this.store.getState().filters;
10813
+ const { pinnedFilters: c, pinnedMetadata: p } = ya(e.auth.projectToken ?? null), u = this.store.getState().filters;
10685
10814
  this.store.setState({
10686
10815
  filters: {
10687
10816
  ...u,
@@ -10695,7 +10824,7 @@ const Ht = class Ht extends w {
10695
10824
  }
10696
10825
  });
10697
10826
  const v = e.brandColor || this.store.getState().brandColor;
10698
- v && (this.store.setState({ brandColor: v }), Aa(this, v));
10827
+ v && (this.store.setState({ brandColor: v }), Ta(this, v));
10699
10828
  } catch (r) {
10700
10829
  throw this.dispatchEvent(new CustomEvent("ap-error", {
10701
10830
  detail: { error: r, context: "init" },
@@ -10725,9 +10854,10 @@ const Ht = class Ht extends w {
10725
10854
  container: e.auth.projectToken,
10726
10855
  securityTemplateId: e.auth.securityTemplateKey
10727
10856
  } : a = {
10728
- mode: "sass-key",
10857
+ mode: "session",
10729
10858
  container: e.auth.projectToken,
10730
- sassKey: e.auth.sassKey
10859
+ sessionToken: e.auth.sessionToken,
10860
+ companyToken: e.auth.companyToken
10731
10861
  }, {
10732
10862
  auth: a,
10733
10863
  targetFolder: i.currentFolderPath || "/",
@@ -10786,7 +10916,7 @@ const Ht = class Ht extends w {
10786
10916
  }
10787
10917
  async open() {
10788
10918
  var l, c, p, u, v, d;
10789
- const e = this.store.getState(), s = Ue((l = this.config) == null ? void 0 : l.forcedFilters), i = new Set(Object.keys(s)), a = {}, r = Ue((c = this.config) == null ? void 0 : c.defaultFilters);
10919
+ const e = this.store.getState(), s = Be((l = this.config) == null ? void 0 : l.forcedFilters), i = new Set(Object.keys(s)), a = {}, r = Be((c = this.config) == null ? void 0 : c.defaultFilters);
10790
10920
  for (const [g, b] of Object.entries(r))
10791
10921
  i.has(g) || (a[g] = b);
10792
10922
  const o = Object.keys(a);
@@ -10808,7 +10938,7 @@ const Ht = class Ht extends w {
10808
10938
  assets: [],
10809
10939
  folders: [],
10810
10940
  currentFolder: null,
10811
- currentFolderPath: ((v = this.config) == null ? void 0 : v.rememberLastFolder) && wa() || ((d = this.config) == null ? void 0 : d.rootFolderPath) || "/",
10941
+ currentFolderPath: ((v = this.config) == null ? void 0 : v.rememberLastFolder) && ka() || ((d = this.config) == null ? void 0 : d.rootFolderPath) || "/",
10812
10942
  breadcrumb: [],
10813
10943
  selectedAssets: /* @__PURE__ */ new Map(),
10814
10944
  folderPreviews: {},
@@ -10835,10 +10965,10 @@ const Ht = class Ht extends w {
10835
10965
  const e = ++this._loadId, s = this.store.getState();
10836
10966
  this._scrollToTop(), this.store.setState({ isLoading: !0 });
10837
10967
  try {
10838
- const D = s.activeTab;
10839
- if (D === "assets") {
10840
- const F = this._buildSearchNotation(), A = s.currentFolderPath || "/", L = tt(this.apiClient, {
10841
- folder: A,
10968
+ const A = s.activeTab;
10969
+ if (A === "assets") {
10970
+ const F = this._buildSearchNotation(), I = s.currentFolderPath || "/", H = tt(this.apiClient, {
10971
+ folder: I,
10842
10972
  offset: 0,
10843
10973
  limit: s.limit,
10844
10974
  sort_by: s.sortBy,
@@ -10846,16 +10976,16 @@ const Ht = class Ht extends w {
10846
10976
  search: s.searchQuery || void 0,
10847
10977
  q: F || void 0,
10848
10978
  recursive: 1
10849
- }), I = Yt(this.apiClient, {
10850
- folder: A,
10979
+ }), T = Xt(this.apiClient, {
10980
+ folder: I,
10851
10981
  q: F || void 0,
10852
10982
  search: s.searchQuery || void 0,
10853
10983
  recursive: 1
10854
- }).catch(() => null), [N, O] = await Promise.all([L, I]);
10984
+ }).catch(() => null), [R, U] = await Promise.all([H, T]);
10855
10985
  if (e !== this._loadId) return;
10856
- const ne = ((i = N.files) == null ? void 0 : i.length) ?? 0, fe = ne >= s.limit, Ae = ((a = O == null ? void 0 : O.stats) == null ? void 0 : a.approx_files_count) ?? ((r = O == null ? void 0 : O.info) == null ? void 0 : r.total_files_count) ?? ((o = N.info) == null ? void 0 : o.total_files_count) ?? ((c = (l = N.base) == null ? void 0 : l.count) == null ? void 0 : c.files_recursive) ?? ((u = (p = N.base) == null ? void 0 : p.count) == null ? void 0 : u.files_direct) ?? ne;
10986
+ const ne = ((i = R.files) == null ? void 0 : i.length) ?? 0, fe = ne >= s.limit, Ae = ((a = U == null ? void 0 : U.stats) == null ? void 0 : a.approx_files_count) ?? ((r = U == null ? void 0 : U.info) == null ? void 0 : r.total_files_count) ?? ((o = R.info) == null ? void 0 : o.total_files_count) ?? ((c = (l = R.base) == null ? void 0 : l.count) == null ? void 0 : c.files_recursive) ?? ((u = (p = R.base) == null ? void 0 : p.count) == null ? void 0 : u.files_direct) ?? ne;
10857
10987
  this.store.setState({
10858
- assets: N.files || [],
10988
+ assets: R.files || [],
10859
10989
  folders: [],
10860
10990
  totalCount: Ae,
10861
10991
  totalFolderCount: 0,
@@ -10863,9 +10993,9 @@ const Ht = class Ht extends w {
10863
10993
  hasMore: fe,
10864
10994
  isLoading: !1
10865
10995
  });
10866
- } else if (D === "folders") {
10867
- const F = this._buildSearchNotation(), A = s.currentFolderPath || "/", [L, I, N] = await Promise.all([
10868
- zs(this.apiClient, {
10996
+ } else if (A === "folders") {
10997
+ const F = this._buildSearchNotation(), I = s.currentFolderPath || "/", [H, T, R] = await Promise.all([
10998
+ Rs(this.apiClient, {
10869
10999
  folderPath: s.currentFolderPath,
10870
11000
  q: s.searchQuery || void 0,
10871
11001
  recursive: s.searchQuery ? 1 : 0,
@@ -10873,7 +11003,7 @@ const Ht = class Ht extends w {
10873
11003
  sort_direction: s.sortDirection
10874
11004
  }),
10875
11005
  tt(this.apiClient, {
10876
- folder: A,
11006
+ folder: I,
10877
11007
  offset: 0,
10878
11008
  limit: s.limit,
10879
11009
  sort_by: s.sortBy,
@@ -10882,38 +11012,38 @@ const Ht = class Ht extends w {
10882
11012
  q: F || void 0,
10883
11013
  recursive: 0
10884
11014
  }),
10885
- Yt(this.apiClient, {
10886
- folder: A,
11015
+ Xt(this.apiClient, {
11016
+ folder: I,
10887
11017
  q: F || void 0,
10888
11018
  search: s.searchQuery || void 0,
10889
11019
  recursive: 0
10890
11020
  }).catch(() => null)
10891
11021
  ]);
10892
11022
  if (e !== this._loadId) return;
10893
- const O = L.folders || [];
11023
+ const U = H.folders || [];
10894
11024
  let ne = {};
10895
- if (O.length > 0)
11025
+ if (U.length > 0)
10896
11026
  try {
10897
- ne = await Rs(this.apiClient, O.map((ve) => ve.uuid));
11027
+ ne = await Ns(this.apiClient, U.map((ve) => ve.uuid));
10898
11028
  } catch {
10899
11029
  }
10900
11030
  if (e !== this._loadId) return;
10901
- const fe = ((v = I.files) == null ? void 0 : v.length) ?? 0, Ae = fe >= s.limit, et = ((d = N == null ? void 0 : N.stats) == null ? void 0 : d.approx_files_count) ?? ((g = N == null ? void 0 : N.info) == null ? void 0 : g.total_files_count) ?? ((b = I.info) == null ? void 0 : b.total_files_count) ?? ((y = (E = I.base) == null ? void 0 : E.count) == null ? void 0 : y.files_direct) ?? fe;
11031
+ const fe = ((v = T.files) == null ? void 0 : v.length) ?? 0, Ae = fe >= s.limit, et = ((d = R == null ? void 0 : R.stats) == null ? void 0 : d.approx_files_count) ?? ((g = R == null ? void 0 : R.info) == null ? void 0 : g.total_files_count) ?? ((b = T.info) == null ? void 0 : b.total_files_count) ?? ((y = (E = T.base) == null ? void 0 : E.count) == null ? void 0 : y.files_direct) ?? fe;
10902
11032
  this.store.setState({
10903
- assets: I.files || [],
10904
- folders: O,
11033
+ assets: T.files || [],
11034
+ folders: U,
10905
11035
  folderPreviews: ne,
10906
11036
  totalCount: et,
10907
- totalFolderCount: L.total ?? O.length,
11037
+ totalFolderCount: H.total ?? U.length,
10908
11038
  offset: 0,
10909
11039
  hasMore: Ae,
10910
11040
  isLoading: !1
10911
11041
  });
10912
11042
  }
10913
- } catch (D) {
11043
+ } catch (A) {
10914
11044
  if (e !== this._loadId) return;
10915
11045
  this.store.setState({ isLoading: !1 }), this.dispatchEvent(new CustomEvent("ap-error", {
10916
- detail: { error: D, context: "loadData" },
11046
+ detail: { error: A, context: "loadData" },
10917
11047
  bubbles: !0,
10918
11048
  composed: !0
10919
11049
  }));
@@ -10967,7 +11097,7 @@ const Ht = class Ht extends w {
10967
11097
  _handleViewChange(e) {
10968
11098
  var i;
10969
11099
  const s = e.detail.mode;
10970
- this.store.setState({ viewMode: s }), (i = this.config) != null && i.rememberLastView && ka(s), this._scrollToTop();
11100
+ this.store.setState({ viewMode: s }), (i = this.config) != null && i.rememberLastView && Sa(s), this._scrollToTop();
10971
11101
  }
10972
11102
  _handleRegionalChange(e) {
10973
11103
  const { groupUuid: s, value: i } = e.detail, a = this.store.getState().regionalFilters;
@@ -10982,7 +11112,7 @@ const Ht = class Ht extends w {
10982
11112
  offset: 0,
10983
11113
  assets: [],
10984
11114
  folders: []
10985
- }), ts(s, i.sortDirection), this.selectionCtrl.resetRange(), this._loadData();
11115
+ }), ss(s, i.sortDirection), this.selectionCtrl.resetRange(), this._loadData();
10986
11116
  }
10987
11117
  _handleSortDirectionChange(e) {
10988
11118
  const s = e.detail.value, i = this.store.getState();
@@ -10991,7 +11121,7 @@ const Ht = class Ht extends w {
10991
11121
  offset: 0,
10992
11122
  assets: [],
10993
11123
  folders: []
10994
- }), ts(i.sortBy, s), this.selectionCtrl.resetRange(), this._loadData();
11124
+ }), ss(i.sortBy, s), this.selectionCtrl.resetRange(), this._loadData();
10995
11125
  }
10996
11126
  _handleTabChange(e) {
10997
11127
  var s;
@@ -11026,7 +11156,7 @@ const Ht = class Ht extends w {
11026
11156
  _handleFolderOpen(e) {
11027
11157
  var r;
11028
11158
  const s = e.detail.folder, i = this.store.getState(), a = s.path || `${i.currentFolderPath}${s.name}/`;
11029
- (r = this.config) != null && r.rememberLastFolder && ss(a), this.store.setState({
11159
+ (r = this.config) != null && r.rememberLastFolder && as(a), this.store.setState({
11030
11160
  currentFolder: s.uuid,
11031
11161
  currentFolderPath: a,
11032
11162
  breadcrumb: [...i.breadcrumb, { uuid: s.uuid, name: s.name, path: a }],
@@ -11039,7 +11169,7 @@ const Ht = class Ht extends w {
11039
11169
  _handleBreadcrumbNavigate(e) {
11040
11170
  var l, c;
11041
11171
  const s = e.detail.uuid, i = this.store.getState(), a = s ? i.breadcrumb.findIndex((p) => p.uuid === s) : -1, r = s ? i.breadcrumb.slice(0, a + 1) : [], o = r.length > 0 ? r[r.length - 1].path : ((l = this.config) == null ? void 0 : l.rootFolderPath) || "/";
11042
- (c = this.config) != null && c.rememberLastFolder && ss(o), this.store.setState({
11172
+ (c = this.config) != null && c.rememberLastFolder && as(o), this.store.setState({
11043
11173
  currentFolder: s || null,
11044
11174
  currentFolderPath: o,
11045
11175
  breadcrumb: r,
@@ -11078,11 +11208,11 @@ const Ht = class Ht extends w {
11078
11208
  u.push(y);
11079
11209
  const v = 4, d = [];
11080
11210
  for (let y = 0; y < u.length; y += v) {
11081
- const D = u.slice(y, y + v), F = await Promise.all(
11082
- D.map(
11083
- (A) => tt(this.apiClient, {
11211
+ const A = u.slice(y, y + v), F = await Promise.all(
11212
+ A.map(
11213
+ (I) => tt(this.apiClient, {
11084
11214
  folder: r,
11085
- offset: A,
11215
+ offset: I,
11086
11216
  limit: o,
11087
11217
  sort_by: e.sortBy,
11088
11218
  sort_direction: e.sortDirection,
@@ -11092,8 +11222,8 @@ const Ht = class Ht extends w {
11092
11222
  })
11093
11223
  )
11094
11224
  );
11095
- for (const A of F)
11096
- A.files && d.push(...A.files);
11225
+ for (const I of F)
11226
+ I.files && d.push(...I.files);
11097
11227
  }
11098
11228
  const g = new Set(l.map((y) => y.uuid)), b = d.filter((y) => g.has(y.uuid) ? !1 : (g.add(y.uuid), !0)), E = [...l, ...b];
11099
11229
  this.store.setState({
@@ -11120,7 +11250,7 @@ const Ht = class Ht extends w {
11120
11250
  }
11121
11251
  // ── Filter Handlers ──────────────────────────────────────────────────
11122
11252
  _isDateFilterKey(e) {
11123
- return e === m.DATE || e === m.LICENSE_EXPIRY || e === V.DUE_DATE;
11253
+ return e === m.DATE || e === m.LICENSE_EXPIRY || e === B.DUE_DATE;
11124
11254
  }
11125
11255
  _handleFilterUpdate(e) {
11126
11256
  const { key: s, values: i, operator: a } = e.detail, o = { ...this.store.getState().filters };
@@ -11157,55 +11287,55 @@ const Ht = class Ht extends w {
11157
11287
  }
11158
11288
  _handleFilterOpen(e) {
11159
11289
  const s = e.detail.key, i = e.detail.chipRect, a = this.renderRoot.querySelector("ap-content-toolbar");
11160
- let r;
11290
+ let r, o;
11161
11291
  if (i) {
11162
- const o = this.renderRoot.querySelector(".toolbar-filters-wrapper");
11163
- if (o) {
11164
- const l = o.getBoundingClientRect();
11165
- r = i.left - l.left;
11292
+ const l = this.renderRoot.querySelector(".toolbar-filters-wrapper");
11293
+ if (l) {
11294
+ const c = l.getBoundingClientRect();
11295
+ r = i.left - c.left, o = i.bottom - c.top;
11166
11296
  }
11167
11297
  }
11168
- a == null || a.openFilterPanel(s, !0, r);
11298
+ a == null || a.openFilterPanel(s, !0, r, o);
11169
11299
  }
11170
11300
  _handleMetadataFilterOpen(e) {
11171
11301
  const { fieldKey: s, chipRect: i } = e.detail, a = this.renderRoot.querySelector("ap-content-toolbar");
11172
- let r;
11302
+ let r, o;
11173
11303
  if (i) {
11174
- const o = this.renderRoot.querySelector(".toolbar-filters-wrapper");
11175
- if (o) {
11176
- const l = o.getBoundingClientRect();
11177
- r = i.left - l.left;
11304
+ const l = this.renderRoot.querySelector(".toolbar-filters-wrapper");
11305
+ if (l) {
11306
+ const c = l.getBoundingClientRect();
11307
+ r = i.left - c.left, o = i.bottom - c.top;
11178
11308
  }
11179
11309
  }
11180
- a == null || a.openMetadataFieldPanel(s, !0, r);
11310
+ a == null || a.openMetadataFieldPanel(s, !0, r, o);
11181
11311
  }
11182
11312
  _handleFilterPanelChange(e) {
11183
11313
  const s = this.renderRoot.querySelector("ap-filters-bar");
11184
11314
  s && (s.activeFilter = e.detail.key, s.activeMetadataField = e.detail.metadataFieldKey || null), !e.detail.key && !e.detail.metadataFieldKey && (this._pendingFilter || this._pendingMetadataField) && (this._pendingFilter = null, this._pendingMetadataField = null, s && (s.pendingFilter = null, s.pendingMetadataField = null));
11185
11315
  }
11186
11316
  async _handleFilterPending(e) {
11187
- var v, d, g;
11317
+ var d, g, b;
11188
11318
  const { key: s, metadataFieldKey: i } = e.detail, a = this.renderRoot.querySelector("ap-filters-bar"), r = this.renderRoot.querySelector("ap-content-toolbar");
11189
11319
  if (!a || !r) return;
11190
11320
  i ? (this._pendingMetadataField = i, a.pendingMetadataField = i) : s && (this._pendingFilter = s, a.pendingFilter = s), await a.updateComplete;
11191
11321
  let o = a.renderRoot.querySelector(".chip.pending");
11192
11322
  if (!o) {
11193
- const b = a.renderRoot.querySelectorAll(".chip.pinned-empty"), E = i ? (v = a._getMetadataLabel) == null ? void 0 : v.call(a, i) : void 0;
11194
- for (const y of b) {
11195
- const D = (g = (d = y.querySelector(".chip-label")) == null ? void 0 : d.textContent) == null ? void 0 : g.trim();
11196
- if (i && D === E) {
11197
- o = y;
11323
+ const E = a.renderRoot.querySelectorAll(".chip.pinned-empty"), y = i ? (d = a._getMetadataLabel) == null ? void 0 : d.call(a, i) : void 0;
11324
+ for (const A of E) {
11325
+ const F = (b = (g = A.querySelector(".chip-label")) == null ? void 0 : g.textContent) == null ? void 0 : b.trim();
11326
+ if (i && F === y) {
11327
+ o = A;
11198
11328
  break;
11199
11329
  }
11200
- if (s && D === (Oe[s] || s)) {
11201
- o = y;
11330
+ if (s && F === (Me[s] || s)) {
11331
+ o = A;
11202
11332
  break;
11203
11333
  }
11204
11334
  }
11205
11335
  }
11206
11336
  if (!o) return;
11207
- const l = o.getBoundingClientRect(), c = this.renderRoot.querySelector(".toolbar-filters-wrapper"), p = c == null ? void 0 : c.getBoundingClientRect(), u = p ? l.left - p.left : l.left;
11208
- i ? r.openMetadataFieldPanel(i, !0, u) : s && r.openFilterPanel(s, !0, u);
11337
+ const l = o.getBoundingClientRect(), c = this.renderRoot.querySelector(".toolbar-filters-wrapper"), p = c == null ? void 0 : c.getBoundingClientRect(), u = p ? l.left - p.left : l.left, v = p ? l.bottom - p.top : void 0;
11338
+ i ? r.openMetadataFieldPanel(i, !0, u, v) : s && r.openFilterPanel(s, !0, u, v);
11209
11339
  }
11210
11340
  _handleFilterRemove(e) {
11211
11341
  var o;
@@ -11240,14 +11370,14 @@ const Ht = class Ht extends w {
11240
11370
  const { key: s, pinned: i } = e.detail, r = { ...this.store.getState().filters };
11241
11371
  i ? r.pinned.includes(s) || (r.pinned = [...r.pinned, s]) : (r.pinned = r.pinned.filter((p) => p !== s), s in r.applied || (r.visible = r.visible.filter((p) => p !== s))), this.store.setState({ filters: r });
11242
11372
  const o = ((c = (l = this.store.getState().config) == null ? void 0 : l.auth) == null ? void 0 : c.projectToken) ?? null;
11243
- ya(o, r.pinned);
11373
+ xa(o, r.pinned);
11244
11374
  }
11245
11375
  _handleMetadataPin(e) {
11246
11376
  var c, p;
11247
11377
  const { fieldKey: s, pinned: i } = e.detail, r = { ...this.store.getState().filters }, o = { ...r.metadata };
11248
11378
  i ? o.pinned.includes(s) || (o.pinned = [...o.pinned, s]) : (o.pinned = o.pinned.filter((u) => u !== s), s in o.applied || (o.visible = o.visible.filter((u) => u !== s))), r.metadata = o, this.store.setState({ filters: r });
11249
11379
  const l = ((p = (c = this.store.getState().config) == null ? void 0 : c.auth) == null ? void 0 : p.projectToken) ?? null;
11250
- xa(l, o.pinned);
11380
+ wa(l, o.pinned);
11251
11381
  }
11252
11382
  _handleFiltersClearAll() {
11253
11383
  const e = this.store.getState();
@@ -11295,13 +11425,13 @@ const Ht = class Ht extends w {
11295
11425
  // ── Sort Options ────────────────────────────────────────────────────
11296
11426
  _getSortOptions() {
11297
11427
  const e = this.storeCtrl.state;
11298
- return e.searchQuery ? Ta : e.activeTab === "folders" ? Oa : It;
11428
+ return e.searchQuery ? Ma : e.activeTab === "folders" ? Oa : Dt;
11299
11429
  }
11300
11430
  // ── Search Notation Builder ──────────────────────────────────────────
11301
11431
  _buildSearchNotation() {
11302
11432
  var a;
11303
- const e = this.store.getState(), s = { ...Ue((a = this.config) == null ? void 0 : a.forcedFilters), ...e.filters.applied };
11304
- return oa(s, e.filters.metadata.applied).join(" ");
11433
+ const e = this.store.getState(), s = { ...Be((a = this.config) == null ? void 0 : a.forcedFilters), ...e.filters.applied };
11434
+ return na(s, e.filters.metadata.applied).join(" ");
11305
11435
  }
11306
11436
  render() {
11307
11437
  var p, u, v, d, g, b, E, y;
@@ -11356,7 +11486,7 @@ const Ht = class Ht extends w {
11356
11486
  .metadataFields=${e.metadataFields}
11357
11487
  .pinnedFilters=${e.filters.pinned}
11358
11488
  .apiClient=${this.apiClient}
11359
- .forcedFilterKeys=${Object.keys(Ue((v = this.config) == null ? void 0 : v.forcedFilters))}
11489
+ .forcedFilterKeys=${Object.keys(Be((v = this.config) == null ? void 0 : v.forcedFilters))}
11360
11490
  @sort-change=${this._handleSortChange}
11361
11491
  @sort-direction-change=${this._handleSortDirectionChange}
11362
11492
  @filter-update=${this._handleFilterUpdate}
@@ -11445,7 +11575,7 @@ const Ht = class Ht extends w {
11445
11575
  ` : f : n`
11446
11576
  <ap-modal
11447
11577
  ?open=${e.isOpen}
11448
- @ap-cancel=${(D) => this._handleCancel(D.detail.reason)}
11578
+ @ap-cancel=${(A) => this._handleCancel(A.detail.reason)}
11449
11579
  >
11450
11580
  ${this._isUploaderOpen ? c : n`
11451
11581
  <div slot="header">${a}</div>
@@ -11530,7 +11660,7 @@ const Ht = class Ht extends w {
11530
11660
  ` : f;
11531
11661
  }
11532
11662
  };
11533
- Ht.styles = [
11663
+ Kt.styles = [
11534
11664
  $`
11535
11665
  :host {
11536
11666
  display: contents;
@@ -11693,14 +11823,14 @@ Ht.styles = [
11693
11823
  }
11694
11824
  `
11695
11825
  ];
11696
- let We = Ht;
11697
- qt([
11826
+ let We = Kt;
11827
+ Ht([
11698
11828
  _()
11699
11829
  ], We.prototype, "_isDragOver");
11700
- qt([
11830
+ Ht([
11701
11831
  _()
11702
11832
  ], We.prototype, "_isUploaderOpen");
11703
- qt([
11833
+ Ht([
11704
11834
  h({ type: Object })
11705
11835
  ], We.prototype, "config");
11706
11836
  export {