@livenetworks/ashlar 2.1.10 → 2.1.12

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.
Files changed (71) hide show
  1. package/components/COMPONENTS.md +1 -1
  2. package/components/ln-accordion/ln-accordion.js +1 -1
  3. package/components/ln-ajax/ln-ajax.js +1 -1
  4. package/components/ln-api-connector/ln-api-connector.js +1 -1
  5. package/components/ln-api-queue/ln-api-queue.js +1 -1
  6. package/components/ln-autosave/ln-autosave.js +1 -1
  7. package/components/ln-chart/ln-chart.js +1 -1
  8. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  9. package/components/ln-confirm/ln-confirm.js +1 -1
  10. package/components/ln-core/events.js +5 -2
  11. package/components/ln-core/lifecycle.js +25 -44
  12. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  13. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  14. package/components/ln-data-store/README.md +19 -0
  15. package/components/ln-data-store/ln-data-store.js +1 -1
  16. package/components/ln-data-store/ln-data-store.schema.json +92 -84
  17. package/components/ln-data-store/src/data-store-model.js +17 -0
  18. package/components/ln-data-store/src/ln-data-store.js +77 -1
  19. package/components/ln-date/ln-date.js +1 -1
  20. package/components/ln-debug/ln-debug.js +1 -1
  21. package/components/ln-debug/ln-debug.schema.json +28 -28
  22. package/components/ln-debug/src/debug-verifier.js +24 -30
  23. package/components/ln-debug/src/generated-attributes.js +1 -3
  24. package/components/ln-debug/src/ln-debug.js +3 -11
  25. package/components/ln-dropdown/ln-dropdown.js +1 -1
  26. package/components/ln-editor/ln-editor.js +1 -1
  27. package/components/ln-external-links/ln-external-links.js +1 -1
  28. package/components/ln-filter/ln-filter.js +1 -1
  29. package/components/ln-form/ln-form.js +1 -1
  30. package/components/ln-icon/ln-icon.js +1 -1
  31. package/components/ln-include/ln-include.js +1 -1
  32. package/components/ln-key/ln-key.js +1 -1
  33. package/components/ln-link/ln-link.js +1 -1
  34. package/components/ln-list/ln-list.js +1 -1
  35. package/components/ln-modal/ln-modal.js +1 -1
  36. package/components/ln-nav/ln-nav.js +1 -1
  37. package/components/ln-number/ln-number.js +1 -1
  38. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  39. package/components/ln-options/ln-options.js +1 -1
  40. package/components/ln-persist/ln-persist.js +1 -1
  41. package/components/ln-picklist/ln-picklist.js +1 -1
  42. package/components/ln-popover/ln-popover.js +1 -1
  43. package/components/ln-progress/ln-progress.js +1 -1
  44. package/components/ln-router/ln-router.js +1 -1
  45. package/components/ln-scroll/ln-scroll.js +1 -1
  46. package/components/ln-search/ln-search.js +1 -1
  47. package/components/ln-slug/ln-slug.js +1 -1
  48. package/components/ln-sort/ln-sort.js +1 -1
  49. package/components/ln-sortable/ln-sortable.js +1 -1
  50. package/components/ln-stat/ln-stat.js +1 -1
  51. package/components/ln-table/README.md +69 -38
  52. package/components/ln-table/ln-table.js +1 -1
  53. package/components/ln-table/ln-table.schema.json +11 -35
  54. package/components/ln-table/src/ln-table.js +306 -414
  55. package/components/ln-table/src/table-model.js +31 -0
  56. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  57. package/components/ln-tabs/ln-tabs.js +1 -1
  58. package/components/ln-time/ln-time.js +1 -1
  59. package/components/ln-toast/ln-toast.js +1 -1
  60. package/components/ln-toggle/ln-toggle.js +1 -1
  61. package/components/ln-tooltip/ln-tooltip.js +1 -1
  62. package/components/ln-translations/ln-translations.js +1 -1
  63. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  64. package/components/ln-upload/ln-upload.js +1 -1
  65. package/components/ln-validate/ln-validate.js +1 -1
  66. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  67. package/ln-ashlar.html-data.json +7 -17
  68. package/package.json +1 -1
  69. package/theme/config/mixins/_ln-table.scss +18 -10
  70. package/theme/config/mixins/_table.scss +15 -2
  71. package/web-types.json +14 -28
@@ -1,84 +1,92 @@
1
- {
2
- "$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
3
- "component": "ln-data-store",
4
- "generator": "scripts/sync-ln-schemas.mjs",
5
- "attributes": {
6
- "data-ln-data-store": {
7
- "direction": "author",
8
- "sources": [
9
- "ln-data-store-dev.scss",
10
- "src/ln-data-store.js"
11
- ],
12
- "type": "marker",
13
- "description": "Identifies the element as a data-store definition container"
14
- },
15
- "data-ln-data-store-frozen": {
16
- "direction": "runtime",
17
- "sources": [
18
- "ln-data-store-dev.scss",
19
- "src/ln-data-store.js"
20
- ],
21
- "type": "marker",
22
- "description": "Applied at runtime to indicate store schema is locked in IndexedDB"
23
- },
24
- "data-ln-data-store-indexes": {
25
- "direction": "author",
26
- "sources": [
27
- "src/ln-data-store.js"
28
- ],
29
- "type": "list",
30
- "description": "Comma-separated index field names for the IndexedDB store"
31
- },
32
- "data-ln-data-store-no-local-query": {
33
- "direction": null,
34
- "sources": [
35
- "src/ln-data-store.js"
36
- ],
37
- "type": "boolean",
38
- "description": "Bypasses local IndexedDB query resolution, forcing remote fetching"
39
- },
40
- "data-ln-data-store-search-fields": {
41
- "direction": null,
42
- "sources": [
43
- "src/ln-data-store.js"
44
- ],
45
- "type": "list",
46
- "description": "Record fields to index for client-side search"
47
- },
48
- "data-ln-data-store-stale": {
49
- "direction": null,
50
- "sources": [
51
- "src/ln-data-store.js"
52
- ],
53
- "type": "integer",
54
- "fallback": 300,
55
- "description": "Cache staleness threshold in seconds, or -1/never"
56
- },
57
- "data-ln-data-store-window": {
58
- "direction": "author",
59
- "sources": [
60
- "src/ln-data-store.js"
61
- ],
62
- "type": "integer",
63
- "fallback": 1000,
64
- "min": 10,
65
- "description": "Virtual scrolling cache window size in records"
66
- },
67
- "data-ln-data-store-window-page": {
68
- "direction": null,
69
- "sources": [
70
- "src/ln-data-store.js"
71
- ],
72
- "type": "integer",
73
- "fallback": 200,
74
- "min": 5,
75
- "description": "Virtual scrolling slice page size"
76
- },
77
- "data-ln-debug": {
78
- "direction": null,
79
- "sources": [
80
- "ln-data-store-dev.scss"
81
- ]
82
- }
83
- }
84
- }
1
+ {
2
+ "$comment": "This file is partly generated. The $comment, component, generator, and each attribute's direction, sources, type, values, fallback, and description keys are owned by the generator and synchronized from JS source code. All other keys are preserved and safe to hand-author. Regenerate with `npm run sync:ln-schemas`.",
3
+ "component": "ln-data-store",
4
+ "generator": "scripts/sync-ln-schemas.mjs",
5
+ "attributes": {
6
+ "data-ln-data-store": {
7
+ "direction": "author",
8
+ "sources": [
9
+ "ln-data-store-dev.scss",
10
+ "src/ln-data-store.js"
11
+ ],
12
+ "type": "marker",
13
+ "description": "Identifies the element as a data-store definition container"
14
+ },
15
+ "data-ln-data-store-frozen": {
16
+ "direction": "runtime",
17
+ "sources": [
18
+ "ln-data-store-dev.scss",
19
+ "src/ln-data-store.js"
20
+ ],
21
+ "type": "marker",
22
+ "description": "Applied at runtime to indicate store schema is locked in IndexedDB"
23
+ },
24
+ "data-ln-data-store-indexes": {
25
+ "direction": "author",
26
+ "sources": [
27
+ "src/ln-data-store.js"
28
+ ],
29
+ "type": "list",
30
+ "description": "Comma-separated index field names for the IndexedDB store"
31
+ },
32
+ "data-ln-data-store-no-local-query": {
33
+ "direction": null,
34
+ "sources": [
35
+ "src/ln-data-store.js"
36
+ ],
37
+ "type": "boolean",
38
+ "description": "Bypasses local IndexedDB query resolution, forcing remote fetching"
39
+ },
40
+ "data-ln-data-store-search-fields": {
41
+ "direction": null,
42
+ "sources": [
43
+ "src/ln-data-store.js"
44
+ ],
45
+ "type": "list",
46
+ "description": "Record fields to index for client-side search"
47
+ },
48
+ "data-ln-data-store-seed": {
49
+ "direction": "author",
50
+ "sources": [
51
+ "src/ln-data-store.js"
52
+ ],
53
+ "type": "string",
54
+ "description": "Selector or element ID of an external seed script block"
55
+ },
56
+ "data-ln-data-store-stale": {
57
+ "direction": null,
58
+ "sources": [
59
+ "src/ln-data-store.js"
60
+ ],
61
+ "type": "integer",
62
+ "fallback": 300,
63
+ "description": "Cache staleness threshold in seconds, or -1/never"
64
+ },
65
+ "data-ln-data-store-window": {
66
+ "direction": "author",
67
+ "sources": [
68
+ "src/ln-data-store.js"
69
+ ],
70
+ "type": "integer",
71
+ "fallback": 1000,
72
+ "min": 10,
73
+ "description": "Virtual scrolling cache window size in records"
74
+ },
75
+ "data-ln-data-store-window-page": {
76
+ "direction": null,
77
+ "sources": [
78
+ "src/ln-data-store.js"
79
+ ],
80
+ "type": "integer",
81
+ "fallback": 200,
82
+ "min": 5,
83
+ "description": "Virtual scrolling slice page size"
84
+ },
85
+ "data-ln-debug": {
86
+ "direction": null,
87
+ "sources": [
88
+ "ln-data-store-dev.scss"
89
+ ]
90
+ }
91
+ }
92
+ }
@@ -182,3 +182,20 @@ export function normalizeSyncError(err) {
182
182
  const errorMsg = (err && err.message) ? err.message : String(err);
183
183
  return { ok: false, error: errorMsg };
184
184
  }
185
+
186
+ /**
187
+ * Parses raw JSON seed string into an array of record objects.
188
+ * @param {string} raw
189
+ * @returns {Array<Record<string, any>> | null}
190
+ */
191
+ export function parseSeedRecords(raw) {
192
+ if (!raw || typeof raw !== 'string') return null;
193
+ const trimmed = raw.trim();
194
+ if (!trimmed) return null;
195
+ try {
196
+ const parsed = JSON.parse(trimmed);
197
+ return Array.isArray(parsed) ? parsed : null;
198
+ } catch (_) {
199
+ return null;
200
+ }
201
+ }
@@ -1,6 +1,6 @@
1
1
  import { registerComponent, dispatch, setCryptoKey, getCryptoKey, encryptData, decryptData, defineAttrs, attrSpec, attrInt, attrBool, attrList } from '../../ln-core';
2
2
  import { createWindowIndex } from './window-index.js';
3
- import { aggregateRecords, decorateRecords, filterRecords, queryRecords, checkNeedsUpgrade, normalizeSyncError } from './data-store-model.js';
3
+ import { aggregateRecords, decorateRecords, filterRecords, queryRecords, checkNeedsUpgrade, normalizeSyncError, parseSeedRecords } from './data-store-model.js';
4
4
 
5
5
  (function () {
6
6
  const DOM_SELECTOR = 'data-ln-data-store';
@@ -21,6 +21,7 @@ import { aggregateRecords, decorateRecords, filterRecords, queryRecords, checkNe
21
21
  const ATTRIBUTES = {
22
22
  'data-ln-data-store': { type: 'marker', effect: _markFrozen, description: 'Identifies the element as a data-store definition container' },
23
23
  'data-ln-data-store-indexes': { type: 'list', effect: _markFrozen, description: 'Comma-separated index field names for the IndexedDB store' },
24
+ 'data-ln-data-store-seed': { type: 'string', description: 'Selector or element ID of an external seed script block' },
24
25
  'data-ln-data-store-stale': { prop: '_staleThreshold', type: 'integer', read: _readStale, fallback: 300, description: 'Cache staleness threshold in seconds, or -1/never' },
25
26
  'data-ln-data-store-search-fields': { prop: '_searchFields', type: 'list', read: attrList, description: 'Record fields to index for client-side search' },
26
27
  'data-ln-data-store-no-local-query': { prop: 'noLocalQuery', type: 'boolean', read: attrBool, description: 'Bypasses local IndexedDB query resolution, forcing remote fetching' },
@@ -515,11 +516,63 @@ import { aggregateRecords, decorateRecords, filterRecords, queryRecords, checkNe
515
516
 
516
517
  // ─── Initialization ────────────────────────────────────
517
518
 
519
+ function _readSeedRecords(self) {
520
+ let scriptEl = null;
521
+ const seedSelector = self.dom.getAttribute('data-ln-data-store-seed');
522
+ if (seedSelector) {
523
+ scriptEl = document.getElementById(seedSelector);
524
+ if (!scriptEl) {
525
+ try {
526
+ scriptEl = document.querySelector(seedSelector);
527
+ } catch (_) {}
528
+ }
529
+ }
530
+ if (!scriptEl) {
531
+ scriptEl = self.dom.querySelector('script[type="application/json"]') || self.dom.querySelector('script');
532
+ }
533
+ if (scriptEl && scriptEl.textContent) {
534
+ return parseSeedRecords(scriptEl.textContent);
535
+ }
536
+ return null;
537
+ }
538
+
518
539
  function _initStore(self) {
540
+ const seedRecords = _readSeedRecords(self);
541
+ self._seedRecords = seedRecords;
542
+
543
+ if (seedRecords) {
544
+ self.lastSyncedAt = Math.floor(Date.now() / 1000);
545
+ self.totalCount = seedRecords.length;
546
+ self.hasCache = true;
547
+ self.isLoaded = true;
548
+ self.canServe = true;
549
+ self.isInitialized = true;
550
+ setTimeout(() => {
551
+ dispatch(self.dom, 'ln-data-store:ready', { store: self._name, count: self.totalCount, source: 'seed' });
552
+ dispatch(self.dom, 'ln-data-store:initialized', { store: self._name, hasCache: true, lastSyncedAt: self.lastSyncedAt, count: self.totalCount, source: 'seed' });
553
+ }, 0);
554
+
555
+ // Persist seed asynchronously to IndexedDB in background without blocking immediate queries
556
+ _openDatabase().then(db => {
557
+ if (!db) return;
558
+ return _clearStore(self._name)
559
+ .then(() => _putBulk(self._name, seedRecords))
560
+ .then(() => _setMeta(self._name, {
561
+ schema_version: SCHEMA_VERSION,
562
+ last_synced_at: self.lastSyncedAt,
563
+ has_cache: true,
564
+ record_count: self.totalCount
565
+ }));
566
+ }).catch(() => {});
567
+
568
+ return Promise.resolve({ ok: true, source: 'seed' });
569
+ }
570
+
519
571
  return _openDatabase().then(db => {
520
572
  if (!db) throw new Error('IndexedDB is unavailable');
521
573
  return _getMeta(self._name);
522
574
  }).then(meta => {
575
+ if (seedRecords) return;
523
576
  self.initializationError = null;
524
577
  if (meta && meta.schema_version === SCHEMA_VERSION) {
525
578
  self.lastSyncedAt = meta.last_synced_at || null;
@@ -548,6 +601,17 @@ import { aggregateRecords, decorateRecords, filterRecords, queryRecords, checkNe
548
601
  dispatch(self.dom, 'ln-data-store:initialized', { store: self._name, hasCache: false, lastSyncedAt: null, count: 0 });
549
602
  }
550
603
  }).catch(error => {
604
+ if (seedRecords) {
605
+ self.lastSyncedAt = Math.floor(Date.now() / 1000);
606
+ self.totalCount = seedRecords.length;
607
+ self.hasCache = true;
608
+ self.isLoaded = true;
609
+ self.canServe = true;
610
+ self.isInitialized = true;
611
+ dispatch(self.dom, 'ln-data-store:ready', { store: self._name, count: self.totalCount, source: 'seed' });
612
+ dispatch(self.dom, 'ln-data-store:initialized', { store: self._name, hasCache: true, lastSyncedAt: self.lastSyncedAt, count: self.totalCount, source: 'seed' });
613
+ return { ok: true, source: 'seed' };
614
+ }
551
615
  self.isInitialized = true;
552
616
  self.isLoaded = false;
553
617
  self.canServe = false;
@@ -752,6 +816,14 @@ import { aggregateRecords, decorateRecords, filterRecords, queryRecords, checkNe
752
816
 
753
817
  _component.prototype.getAll = function (options = {}) {
754
818
  const self = this;
819
+ if (self._seedRecords) {
820
+ const r = _queryLocal(self, self._seedRecords, options);
821
+ return Promise.resolve({
822
+ data: _decorate(self, r.records),
823
+ total: r.total,
824
+ filtered: r.filtered
825
+ });
826
+ }
755
827
  if (self._windowIndex) {
756
828
  const offset = options.offset || 0;
757
829
  const limit = options.limit || 200;
@@ -807,6 +879,10 @@ import { aggregateRecords, decorateRecords, filterRecords, queryRecords, checkNe
807
879
  };
808
880
 
809
881
  _component.prototype.count = function (filters) {
882
+ if (this._seedRecords) {
883
+ const hasFilters = filters && Object.keys(filters).length > 0;
884
+ return Promise.resolve(hasFilters ? filterRecords(this._seedRecords, filters).length : this._seedRecords.length);
885
+ }
810
886
  const hasFilters = filters && Object.keys(filters).length > 0;
811
887
  if (!hasFilters) {
812
888
  if (this.windowed && this.totalCount != null) return Promise.resolve(this.totalCount);
@@ -1 +1 @@
1
- (function(){"use strict";function Q(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function q(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!q(r))return}e.apply(console,t)}}function K(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function I(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){I(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function we(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function pe(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const i=s[c];i.name&&i.type==="checkbox"&&!i.disabled&&(l[i.name]=(l[i.name]||0)+1)}for(let c=0;c<s.length;c++){const i=s[c];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&l[i.name]===1?o[i.name]=i.checked:(o[i.name]||(o[i.name]=[]),i.checked&&o[i.name].push(i.value));else if(i.type==="radio")i.checked&&(o[i.name]=i.value);else if(i.type==="select-multiple"){o[i.name]=[];for(let u=0;u<i.options.length;u++)i.options[u].selected&&o[i.name].push(i.options[u].value)}else if(n&&i.type==="hidden")o[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const u=Number(i.value);o[i.name]=i.value===""||isNaN(u)?null:u}else o[i.name]=i.value}return o}function ge(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function be(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const i=t[c];if(l.type==="checkbox"){if(Array.isArray(i))l.checked=i.indexOf(l.value)!==-1;else if(o[l.name]>1){const u=String(i).split(",").map(function(w){return w.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=ge(i);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(i),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(i))for(let u=0;u<l.options.length;u++)l.options[u].selected=i.indexOf(l.options[u].value)!==-1;r.push(l)}else l.value=i,l.tagName==="SELECT"&&i!=null&&l.setAttribute("data-ln-value",i),r.push(l)}return r}function ye(e,t,{get:n,set:r}){Object.defineProperty(e,"value",{get:function(){return n?n.call(this):t.get.call(this)},set:function(o){r?r.call(this,o,s=>t.set.call(this,s)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=be,window.lnCore.serializeForm=pe,window.lnCore.resolveFormMethod=we);const Y={};function Ce(e,t){Y[e]=t}function _e(e){return Y[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ce,window.lnCore.getDataMapper=_e);function M(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function J(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,I(function(){new MutationObserver(function(){K(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const G={};function z(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];G[n]=t}function O(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return G[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=z,window.lnCore.getLocaleFallback=O,window.lnCore.ensureLocaleObserver=J);const R={};function Ae(e,t){R[e]||(R[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=R[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function X(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const c=r[l],i=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const w=i[u].trim().split(":");if(w.length!==2)continue;const m=w[0].trim(),a=w[1].trim();t[a]!=null&&c.setAttribute(m,t[a])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],i=c.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const w=i[u].trim().split(":");if(w.length!==2)continue;const m=w[0].trim(),a=w[1].trim();a in t&&c.classList.toggle(m,!!t[a])}}return e}function ve(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)X(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function Z(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],c=l.attributes;for(let i=0;i<c.length;i++){const u=c[i];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Se(e,t,n,r,o,s){const l={};for(let i=0;i<e.children.length;i++){const u=e.children[i],w=u.getAttribute("data-ln-render-key");w&&(l[w]=u)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],w=String(r(u));let m=l[w];if(m)o(m,u,i);else{const a=Ae(n,s);if(!a||(Z(a,u),m=a.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",w),o(m,u,i)}c.appendChild(m)}e.textContent="",e.appendChild(c)}function xe(e,t){const n={},r=e.querySelectorAll("["+t+"]");for(let o=0;o<r.length;o++)n[r[o].getAttribute(t)]=r[o].textContent,r[o].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Z,window.lnCore.fill=X,window.lnCore.lnFill=ve,window.lnCore.renderList=Se);function B(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function ee(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function te(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function ne(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const $=new Map;function re(e,t){const n=(e?e.join("|"):"")+"::"+t;if($.has(n))return $.get(n);const r=new Set(e||[]),o=function(s,l){const c=s.getAttribute(l);return c!==null&&r.has(c)?c:t};return $.set(n,o),o}function oe(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ie(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function le(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=i=>{o?console.warn(i,o):console.warn(i)};if(l==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function ke(e,t,n){for(const r in n){const[o,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function Ee(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=re(r.values,r.fallback);break;case"integer":o=ee;break;case"float":o=oe;break;case"boolean":o=te;break;case"list":o=ne;break;case"json":o=ie;break;case"string":default:o=B;break}o||(o=B),t[r.prop]=[o,n,r.fallback]}return t}function De(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function Le(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ke,window.lnCore.attrSpec=Ee,window.lnCore.attrStr=B,window.lnCore.attrInt=ee,window.lnCore.attrBool=te,window.lnCore.attrList=ne,window.lnCore.attrEnum=re,window.lnCore.attrFloat=oe,window.lnCore.attrJson=ie);function T(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function se(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(s)&&T(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let i=0;i<c.length;i++)T(c[i],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Oe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Te(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ae(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Fe(e){const t=ae(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Le(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function ce(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Ie(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=ae(),o=r.byAttr.get(t),s=Q()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&q(l)){const c=r.byDeclaredAttr.get(t),i=l.getAttribute(t);for(let u=0;u<c.length;u++)le(c[u].spec,i,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&ce(c,l,t,e.oldValue),r.reactiveWildcard.length&&ce(r.reactiveWildcard,l,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const i=o[c];if(i.handler){i.handler(l,t,e.oldValue);continue}i.onAttributeChange&&l[i.attribute]?i.onAttributeChange(l,t):(se(l,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(l))}}}function Me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,I(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ie(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function j(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function V(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function P(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ue(e){const t=j();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=V();if(e.target&&r.length)for(let o=0;o<r.length;o++){const s=r[o],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const i=t[c];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)s.matches&&s.matches(i.query)&&T(s,i);else if(s.matches&&s.matches(i.query)&&T(s,i),s.querySelectorAll){const u=s.querySelectorAll(i.query);for(let w=0;w<u.length;w++)T(u[w],i)}}i.onInit&&i.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const i=t[c],u=i.query;if(u){if(!l)s.matches&&s.matches(u)&&P(s,i);else if(s.matches&&s.matches(u)&&P(s,i),s.querySelectorAll){const w=s.querySelectorAll(u);for(let m=0;m<w.length;m++)P(w[m],i)}}}}}}function de(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,I(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ue(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ne(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let r=0;r<n.length;r++){const o=n[r];if(o.type==="childList")try{ue(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function qe(e){j().push(e),e.onSubtreeChange&&e.query&&V().push(e),de()}function fe(e,t,n,r,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,i=o.onInit||null,u=o.onAttrChange||null,w=o.effects||null,m=o.attributes||null,a=m?De(m):w,d=m?new Set(Object.keys(m)):null,h=o.persist||null;function g(D){const f=D||document.body;if(se(f,e,t,n),m&&Q())for(const p in m){const b=m[p],_=Array.from(f.querySelectorAll("["+p+"]"));f.matches&&f.matches("["+p+"]")&&_.push(f);for(let x=0;x<_.length;x++){const E=_[x];q(E)&&le(b,E.getAttribute(p),p,r,E)}}i&&i(f)}const y=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let f;for(;(f=D.exec(e))!==null;)y.push(f[1])}else y.push(e);Fe({selector:e,attribute:t,componentTag:r,attributes:m,ComponentFn:n,onInit:i,observed:y.concat(s),onAttributeChange:l,onAttrChange:u,effects:a,declared:d,persist:h}),Me();const v=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=o.subtreeQuery||(v?e:"["+e+"]"),S={selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:c,query:C};j().push(S),c&&C&&V().push(S),de(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=fe,window.lnCore.observeLifecycle=qe,window.lnCore.withoutLifecycle=Ne);function k(){Oe()>0?Te(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k(),g}function he(e){return(e||"").replace(/^#/,"")}function H(e){const t=e===void 0?location.hash:e,n={},r=he(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const c=l.indexOf(":"),i=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(i)try{n[i]=decodeURIComponent(u)}catch{n[i]=u}}return n}function Re(e){if(!e)return null;const t=H();return e in t?t[e]:null}function Be(e,t){if(!e)return;const n=H();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");he(location.hash)!==o&&(location.hash=o)}function $e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function je(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Pe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function He(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ue(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=H,window.lnCore.hashGet=Re,window.lnCore.hashSet=Be,window.lnCore.hashLinkClick=$e,window.lnCore.resolveHashNamespace=je,window.lnCore.hashSortEncode=Ve,window.lnCore.hashSortDecode=Pe,window.lnCore.hashFilterEncode=He,window.lnCore.hashFilterDecode=Ue);function We(e){return(e||"").replace(/^\?/,"")}function Qe(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},r=We(t);if(!r)return n;const o=new URLSearchParams(r);for(const[s,l]of o.entries())n[s]=l;return n}function Ke(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Ye(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const r=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",r)}function Je(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"_"+t:r:t||null}function Ge(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ze(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:r}}}return null}function Xe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ze(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Qe,window.lnCore.queryGet=Ke,window.lnCore.querySet=Ye,window.lnCore.resolveQueryParam=Je,window.lnCore.querySortEncode=Ge,window.lnCore.querySortDecode=ze,window.lnCore.queryFilterEncode=Xe,window.lnCore.queryFilterDecode=Ze);function et(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=et);function A(e){if(e==null||e==="")return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;const t=Number(e);if(!isNaN(t)&&t>0){const n=t<1e11?t*1e3:t,r=new Date(n);return isNaN(r.getTime())?null:r}if(typeof e=="string"){const n=e.trim();if(!n)return null;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(r){const s=+r[1],l=+r[2],c=+r[3],i=new Date(s,l-1,c);return i.getFullYear()!==s||i.getMonth()!==l-1||i.getDate()!==c?null:i}const o=new Date(n);return isNaN(o.getTime())?null:o}return null}function L(e){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return t+"-"+n+"-"+r}const U=/^(short|medium|long)(\s+datetime)?$/,tt={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},"short datetime":{dateStyle:"short",timeStyle:"short"},"medium datetime":{dateStyle:"medium",timeStyle:"short"},"long datetime":{dateStyle:"long",timeStyle:"short"}};function nt(e){return!e||e===""?{dateStyle:"medium"}:String(e).trim().match(U)?tt[e.trim()]:null}function F(e){if(!e||typeof e!="string")return null;const t=e.trim();if(t.length<6)return null;let n,r;if(t.indexOf(".")!==-1)n=".",r=t.split(".");else if(t.indexOf("/")!==-1)n="/",r=t.split("/");else if(t.indexOf("-")!==-1)n="-",r=t.split("-");else return null;if(r.length!==3)return null;const o=[];for(let u=0;u<3;u++){const w=parseInt(r[u],10);if(isNaN(w))return null;o.push(w)}let s,l,c;n==="."?(s=o[0],l=o[1],c=o[2]):n==="/"?(l=o[0],s=o[1],c=o[2]):r[0].length===4?(c=o[0],l=o[1],s=o[2]):(s=o[0],l=o[1],c=o[2]),c<100&&(c+=c<50?2e3:1900);const i=new Date(c,l-1,s);return i.getFullYear()!==c||i.getMonth()!==l-1||i.getDate()!==s?null:i}function W(e,t,n,r){if(!e||!(e instanceof Date)||isNaN(e.getTime())||!t||typeof t!="string")return"";const o=e.getDate(),s=e.getMonth(),l=e.getFullYear(),c=e.getHours(),i=e.getMinutes();let u,w;const m=(n||"").toLowerCase().split("-")[0];let a=!1;try{const g=new Intl.DateTimeFormat(n,{month:"long"}).resolvedOptions().locale.toLowerCase().split("-")[0];a=!!(r&&g!==m)}catch{a=!!r}if(a&&r&&r.monthsLong)u=r.monthsLong[s];else try{u=new Intl.DateTimeFormat(n,{month:"long"}).format(e)}catch{u=String(s+1)}if(a&&r&&r.monthsShort)w=r.monthsShort[s];else try{w=new Intl.DateTimeFormat(n,{month:"short"}).format(e)}catch{w=String(s+1)}const d={yyyy:String(l),yy:String(l).slice(-2),MMMM:u,MMM:w,MM:String(s+1).padStart(2,"0"),M:String(s+1),dd:String(o).padStart(2,"0"),d:String(o),HH:String(c).padStart(2,"0"),mm:String(i).padStart(2,"0")};return t.replace(/yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|mm/g,function(h){return d[h]!==void 0?d[h]:h})}function N(e,t,n,r){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const o=nt(t);if(o)try{const s=new Intl.DateTimeFormat(n,o),l=(n||"").toLowerCase().split("-")[0],c=s.resolvedOptions().locale.toLowerCase().split("-")[0];return r&&c!==l?W(e,"dd.MM.yyyy",n,r):s.format(e)}catch{return W(e,"dd.MM.yyyy",n,r)}return W(e,t||"dd.MM.yyyy",n,r)}(function(){const e="data-ln-date",t="lnDate";if(window[t]!==void 0)return;function n(a){const d=a[t];if(d){if(d.isTextElement)d._initTextElement();else if(d.value){const h=A(d.value);h&&d._displayFormatted(h)}}}const r={"data-ln-date":{type:"enum",values:["short","medium","long","full","iso"],fallback:"medium",effect:n,description:"Date display style preset or activator"},"data-ln-date-format":{type:"string",effect:n,description:"Custom Intl.DateTimeFormat pattern or options"},"data-ln-date-locale":{type:"string",effect:n,description:"BCP 47 language tag override for date formatting"},"data-ln-value":{type:"string",effect:n,description:"Raw ISO date string or timestamp for non-time elements (td, span)"},"data-ln-date-dict":{type:"marker",description:"Container for date translation dictionary"},"data-ln-date-dict-key":{type:"string",description:"Dictionary key for relative time or custom date formatting"},"data-ln-date-field":{type:"string",description:"Field name mapping for date record binding"},"data-ln-date-label":{type:"string",description:"Accessible label text for the date input"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function s(a,d,h){K(a.dom,"ln-date:change",{value:d,formatted:a.dom.value,date:h}),a.dom.dispatchEvent(new Event("change",{bubbles:!0}))}function l(a,d,h,g){a._setHiddenRaw(d),o.set.call(a._picker,d),a._lastISO=d,g!==void 0?(a._isFormatting=!0,a.dom.value=g,a._isFormatting=!1):h&&a._displayFormatted(h),s(a,d,h)}function c(a){a._setHiddenRaw(""),o.set.call(a._picker,""),a._isFormatting=!0,a.dom.value="",a._isFormatting=!1,a._lastISO="",s(a,"",null)}const i=new Set;let u=!1;function w(){J(),!u&&(u=!0,document.addEventListener("ln-core:locale-change",function(){i.forEach(function(a){if(a.isTextElement)a._formatTextContent();else if(a.value){const d=A(a.value);d&&a._displayFormatted(d)}})}))}function m(a){if(a[t])return a[t];a[t]=this,this.dom=a;const d=this;if(i.add(this),w(),a.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;this.isTextElement=!1;const h=a.value,g=a.name,y=a.closest(".form-element, form")||a.parentNode;if(y){const f=y.querySelectorAll("[data-ln-date-dict]");for(let p=0;p<f.length;p++){const b=f[p].getAttribute("data-ln-date-dict");if(b){const _=xe(f[p],"data-ln-date-dict-key");_["months-long"]&&(_.monthsLong=_["months-long"].split(",").map(x=>x.trim())),_["months-short"]&&(_.monthsShort=_["months-short"].split(",").map(x=>x.trim())),z(b,_)}}}const v=document.createElement("span");v.setAttribute("data-ln-date-field",""),a.parentNode.insertBefore(v,a),v.appendChild(a),this._wrapper=v;const C=document.createElement("input");C.type="hidden",C.name=g,a.removeAttribute("name"),a.hasAttribute("data-ln-fill-as")&&C.setAttribute("data-ln-fill-as",a.getAttribute("data-ln-fill-as")),a.insertAdjacentElement("afterend",C),this._hidden=C;const S=document.createElement("input");S.type="date",S.tabIndex=-1,S.setAttribute("tabindex","-1"),S.setAttribute("aria-hidden","true"),S.setAttribute("aria-label",a.getAttribute("data-ln-date-label")||"Date picker"),S.style.cssText="position:absolute;opacity:0;width:0;height:0;overflow:hidden;pointer-events:none",C.insertAdjacentElement("afterend",S),this._picker=S,a.type="text";const k=document.createElement("button");k.type="button",k.setAttribute("aria-label",a.getAttribute("data-ln-date-label")||"Open date picker"),k.innerHTML='<svg class="ln-icon" aria-hidden="true"><use href="#ln-icon-calendar"></use></svg>',S.insertAdjacentElement("afterend",k),this._btn=k,this._lastISO="",Object.defineProperty(C,"value",{get:function(){return o.get.call(C)},set:function(f){if(o.set.call(C,f),f&&f!==""){const p=A(f);p&&l(d,f,p)}else f===""&&c(d)}}),ye(a,o,{get:function(){return o.get.call(a)},set:function(f,p){if(d._isFormatting){p(f);return}if(!f||f===""){p(""),c(d);return}const b=A(f)||F(f);if(b){const _=L(b),x=a.getAttribute(e)||"",E=M(a),rt=O(E),me=N(b,x,E,rt);p(me),l(d,_,b,me)}else p(String(f)),c(d)}}),this._onPickerChange=function(){const f=S.value;if(f){const p=A(f);p&&l(d,f,p)}else c(d)},S.addEventListener("change",this._onPickerChange),this._onBlur=function(){const f=d.dom.value.trim();if(f===""){d._lastISO!==""&&c(d);return}if(d._lastISO){const b=A(d._lastISO);if(b){const _=d.dom.getAttribute(e)||"",x=M(d.dom),E=O(x);if(f===N(b,_,x,E))return}}const p=F(f);if(p){const b=L(p);l(d,b,p)}else if(d._lastISO){const b=A(d._lastISO);b&&d._displayFormatted(b)}else d.dom.value=""},a.addEventListener("blur",this._onBlur),this._onBtnClick=function(){d._openPicker()},k.addEventListener("click",this._onBtnClick);const D=a.form;if(D&&(this._form=D,this._onFormReset=function(){setTimeout(function(){const f=d.dom.value;if(f){const p=A(f)||F(f);if(p){const b=L(p);l(d,b,p);return}}c(d)},0)},D.addEventListener("reset",this._onFormReset)),h&&h!==""){const f=A(h);f&&l(d,h,f)}return this}m.prototype._initTextElement=function(){const a=this.dom,d=a.getAttribute("data-ln-value"),h=a.getAttribute("data-ln-date"),g=a.getAttribute("datetime");let y=null;a.tagName==="TIME"&&g!==null&&g!==""?y=g:d!==null&&d!==""?y=d:g!==null&&g!==""?y=g:h!==null&&h!==""&&h!=="true"&&!U.test(h)?y=h:y=a.textContent.trim();const v=A(y)||F(y);if(v&&!isNaN(v.getTime())){const C=L(v);this._rawValue=C,a.tagName!=="TIME"&&!a.hasAttribute("data-ln-value")&&a.setAttribute("data-ln-value",C),this._formatTextContent()}else this._rawValue=null},m.prototype._formatTextContent=function(){if(this._rawValue){const a=A(this._rawValue);if(a){let h=this.dom.getAttribute("data-ln-date-format");if(!h){const v=this.dom.getAttribute("data-ln-date");v&&U.test(v)&&(h=v)}const g=M(this.dom),y=O(g);this.dom.textContent=N(a,h||"medium",g,y)}}},m.prototype._openPicker=function(){if(typeof this._picker.showPicker=="function")try{this._picker.showPicker()}catch{this._picker.click()}else this._picker.click()},m.prototype._setHiddenRaw=function(a){o.set.call(this._hidden,a)},m.prototype._displayFormatted=function(a){const d=this.dom.getAttribute(e)||"",h=M(this.dom),g=O(h);this._isFormatting=!0,this.dom.value=N(a,d,h,g),this._isFormatting=!1},Object.defineProperty(m.prototype,"value",{get:function(){return this.isTextElement?this._rawValue||"":o.get.call(this._hidden)},set:function(a){if(this.isTextElement){if(!a||a===""){this._rawValue=null,this.dom.removeAttribute("data-ln-value"),this.dom.tagName==="TIME"&&this.dom.removeAttribute("datetime"),this.dom.textContent="";return}const h=A(a)||F(a);if(!h)return;const g=L(h);this._rawValue=g,this.dom.tagName==="TIME"?this.dom.setAttribute("datetime",g):this.dom.setAttribute("data-ln-value",g),this._formatTextContent();return}if(!a||a===""){c(this);return}const d=A(a);d&&l(this,a,d)}}),Object.defineProperty(m.prototype,"date",{get:function(){const a=this.value;return a?A(a):null},set:function(a){if(!a||!(a instanceof Date)||isNaN(a.getTime())){this.value="";return}this.value=L(a)}}),Object.defineProperty(m.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:this.dom.value}}),m.prototype.destroy=function(){if(!this.dom[t])return;if(i.delete(this),this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement){delete this.dom[t];return}this._form&&this._onFormReset&&this._form.removeEventListener("reset",this._onFormReset),this._picker.removeEventListener("change",this._onPickerChange),this.dom.removeEventListener("blur",this._onBlur),this._btn.removeEventListener("click",this._onBtnClick);const a=this.value;this._hidden.remove(),this._picker.remove(),this._btn.remove(),this._wrapper&&this._wrapper.parentNode&&(this._wrapper.parentNode.insertBefore(this.dom,this._wrapper),this._wrapper.remove()),delete this.dom.value,this.dom.name=this._hidden.name,this.dom.type="date",a&&(this.dom.value=a),delete this.dom[t]},fe(e,t,m,"ln-date",{attributes:r,extraAttributes:["datetime","lang"],onAttributeChange:n})})()})();
1
+ (function(){"use strict";function W(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function q(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!q(r))return}e.apply(console,t)}}function Q(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function F(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){F(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function we(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function pe(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const i=s[c];i.name&&i.type==="checkbox"&&!i.disabled&&(l[i.name]=(l[i.name]||0)+1)}for(let c=0;c<s.length;c++){const i=s[c];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&l[i.name]===1?o[i.name]=i.checked:(o[i.name]||(o[i.name]=[]),i.checked&&o[i.name].push(i.value));else if(i.type==="radio")i.checked&&(o[i.name]=i.value);else if(i.type==="select-multiple"){o[i.name]=[];for(let u=0;u<i.options.length;u++)i.options[u].selected&&o[i.name].push(i.options[u].value)}else if(n&&i.type==="hidden")o[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const u=Number(i.value);o[i.name]=i.value===""||isNaN(u)?null:u}else o[i.name]=i.value}return o}function ge(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function be(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const i=t[c];if(l.type==="checkbox"){if(Array.isArray(i))l.checked=i.indexOf(l.value)!==-1;else if(o[l.name]>1){const u=String(i).split(",").map(function(w){return w.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=ge(i);r.push(l)}else if(l.type==="radio")l.checked=l.value===String(i),r.push(l);else if(l.type==="select-multiple"){if(Array.isArray(i))for(let u=0;u<l.options.length;u++)l.options[u].selected=i.indexOf(l.options[u].value)!==-1;r.push(l)}else l.value=i,l.tagName==="SELECT"&&i!=null&&l.setAttribute("data-ln-value",i),r.push(l)}return r}function ye(e,t,{get:n,set:r}){Object.defineProperty(e,"value",{get:function(){return n?n.call(this):t.get.call(this)},set:function(o){r?r.call(this,o,s=>t.set.call(this,s)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=be,window.lnCore.serializeForm=pe,window.lnCore.resolveFormMethod=we);const K={};function Ce(e,t){K[e]=t}function _e(e){return K[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ce,window.lnCore.getDataMapper=_e);function I(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function Y(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,F(function(){new MutationObserver(function(){Q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const J={};function G(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];J[n]=t}function L(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return J[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=G,window.lnCore.getLocaleFallback=L,window.lnCore.ensureLocaleObserver=Y);const R={};function Ae(e,t){R[e]||(R[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=R[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function z(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<r.length;l++){const c=r[l],i=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const w=i[u].trim().split(":");if(w.length!==2)continue;const f=w[0].trim(),a=w[1].trim();t[a]!=null&&c.setAttribute(f,t[a])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],i=c.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const w=i[u].trim().split(":");if(w.length!==2)continue;const f=w[0].trim(),a=w[1].trim();a in t&&c.classList.toggle(f,!!t[a])}}return e}function ve(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)z(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function X(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],c=l.attributes;for(let i=0;i<c.length;i++){const u=c[i];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Se(e,t,n,r,o,s){const l={};for(let i=0;i<e.children.length;i++){const u=e.children[i],w=u.getAttribute("data-ln-render-key");w&&(l[w]=u)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],w=String(r(u));let f=l[w];if(f)o(f,u,i);else{const a=Ae(n,s);if(!a||(X(a,u),f=a.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",w),o(f,u,i)}c.appendChild(f)}e.textContent="",e.appendChild(c)}function xe(e,t){const n={},r=e.querySelectorAll("["+t+"]");for(let o=0;o<r.length;o++)n[r[o].getAttribute(t)]=r[o].textContent,r[o].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=X,window.lnCore.fill=z,window.lnCore.lnFill=ve,window.lnCore.renderList=Se);function B(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function Z(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function ee(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function te(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const $=new Map;function ne(e,t){const n=(e?e.join("|"):"")+"::"+t;if($.has(n))return $.get(n);const r=new Set(e||[]),o=function(s,l){const c=s.getAttribute(l);return c!==null&&r.has(c)?c:t};return $.set(n,o),o}function re(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function oe(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function ie(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=i=>{o?console.warn(i,o):console.warn(i)};if(l==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function Ee(e,t,n){for(const r in n){const[o,s,l]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function ke(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=ne(r.values,r.fallback);break;case"integer":o=Z;break;case"float":o=re;break;case"boolean":o=ee;break;case"list":o=te;break;case"json":o=oe;break;case"string":default:o=B;break}o||(o=B),t[r.prop]=[o,n,r.fallback]}return t}function De(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function Oe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Ee,window.lnCore.attrSpec=ke,window.lnCore.attrStr=B,window.lnCore.attrInt=Z,window.lnCore.attrBool=ee,window.lnCore.attrList=te,window.lnCore.attrEnum=ne,window.lnCore.attrFloat=re,window.lnCore.attrJson=oe);function M(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function le(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(s)&&M(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let i=0;i<c.length;i++)M(c[i],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Le(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Te(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function se(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Fe(e){const t=se(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Oe(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function ae(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Ie(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=se(),o=r.byAttr.get(t),s=W()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&q(l)){const c=r.byDeclaredAttr.get(t),i=l.getAttribute(t);for(let u=0;u<c.length;u++)ie(c[u].spec,i,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&ae(c,l,t,e.oldValue),r.reactiveWildcard.length&&ae(r.reactiveWildcard,l,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const i=o[c];if(i.handler){i.handler(l,t,e.oldValue);continue}i.onAttributeChange&&l[i.attribute]?i.onAttributeChange(l,t):(le(l,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(l))}}}function Me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,F(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ie(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function j(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function V(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function ce(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ue(e){const t=j();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=V();if(e.target&&r.length)for(let o=0;o<r.length;o++){const s=r[o],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType!==1)continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const i=t[c],u=i.query;if(u&&(s.matches&&s.matches(u)&&(i.ComponentFn&&M(s,i),i.onInit&&i.onInit(s)),l&&s.querySelectorAll)){const w=s.querySelectorAll(u);for(let f=0;f<w.length;f++)i.ComponentFn&&M(w[f],i),i.onInit&&i.onInit(w[f])}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType!==1||document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const i=t[c],u=i.query;if(u&&(s.matches&&s.matches(u)&&ce(s,i),l&&s.querySelectorAll)){const w=s.querySelectorAll(u);for(let f=0;f<w.length;f++)ce(w[f],i)}}}}function de(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,F(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{ue(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ne(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let r=0;r<n.length;r++){const o=n[r];if(o.type==="childList")try{ue(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function qe(e){j().push(e),e.onSubtreeChange&&e.query&&V().push(e),de()}function fe(e,t,n,r,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,i=o.onInit||null,u=o.onAttrChange||null,w=o.effects||null,f=o.attributes||null,a=f?De(f):w,d=f?new Set(Object.keys(f)):null,m=o.persist||null;function g(D){const h=D||document.body;if(le(h,e,t,n),f&&W())for(const p in f){const b=f[p],_=Array.from(h.querySelectorAll("["+p+"]"));h.matches&&h.matches("["+p+"]")&&_.push(h);for(let x=0;x<_.length;x++){const k=_[x];q(k)&&ie(b,k.getAttribute(p),p,r,k)}}i&&i(h)}const y=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let h;for(;(h=D.exec(e))!==null;)y.push(h[1])}else y.push(e);Fe({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:i,observed:y.concat(s),onAttributeChange:l,onAttrChange:u,effects:a,declared:d,persist:m}),Me();const v=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=o.subtreeQuery||(v?e:"["+e+"]"),S={selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:c,query:C};j().push(S),c&&C&&V().push(S),de(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=fe,window.lnCore.observeLifecycle=qe,window.lnCore.withoutLifecycle=Ne);function E(){Le()>0?Te(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",E):E(),g}function he(e){return(e||"").replace(/^#/,"")}function P(e){const t=e===void 0?location.hash:e,n={},r=he(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const c=l.indexOf(":"),i=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(i)try{n[i]=decodeURIComponent(u)}catch{n[i]=u}}return n}function Re(e){if(!e)return null;const t=P();return e in t?t[e]:null}function Be(e,t){if(!e)return;const n=P();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");he(location.hash)!==o&&(location.hash=o)}function $e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function je(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Pe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function He(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ue(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=P,window.lnCore.hashGet=Re,window.lnCore.hashSet=Be,window.lnCore.hashLinkClick=$e,window.lnCore.resolveHashNamespace=je,window.lnCore.hashSortEncode=Ve,window.lnCore.hashSortDecode=Pe,window.lnCore.hashFilterEncode=He,window.lnCore.hashFilterDecode=Ue);function We(e){return(e||"").replace(/^\?/,"")}function Qe(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},r=We(t);if(!r)return n;const o=new URLSearchParams(r);for(const[s,l]of o.entries())n[s]=l;return n}function Ke(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Ye(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const r=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",r)}function Je(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"_"+t:r:t||null}function Ge(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ze(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const r=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:r}}}return null}function Xe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ze(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Qe,window.lnCore.queryGet=Ke,window.lnCore.querySet=Ye,window.lnCore.resolveQueryParam=Je,window.lnCore.querySortEncode=Ge,window.lnCore.querySortDecode=ze,window.lnCore.queryFilterEncode=Xe,window.lnCore.queryFilterDecode=Ze);function et(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=et);function A(e){if(e==null||e==="")return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;const t=Number(e);if(!isNaN(t)&&t>0){const n=t<1e11?t*1e3:t,r=new Date(n);return isNaN(r.getTime())?null:r}if(typeof e=="string"){const n=e.trim();if(!n)return null;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(r){const s=+r[1],l=+r[2],c=+r[3],i=new Date(s,l-1,c);return i.getFullYear()!==s||i.getMonth()!==l-1||i.getDate()!==c?null:i}const o=new Date(n);return isNaN(o.getTime())?null:o}return null}function O(e){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return t+"-"+n+"-"+r}const H=/^(short|medium|long)(\s+datetime)?$/,tt={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},"short datetime":{dateStyle:"short",timeStyle:"short"},"medium datetime":{dateStyle:"medium",timeStyle:"short"},"long datetime":{dateStyle:"long",timeStyle:"short"}};function nt(e){return!e||e===""?{dateStyle:"medium"}:String(e).trim().match(H)?tt[e.trim()]:null}function T(e){if(!e||typeof e!="string")return null;const t=e.trim();if(t.length<6)return null;let n,r;if(t.indexOf(".")!==-1)n=".",r=t.split(".");else if(t.indexOf("/")!==-1)n="/",r=t.split("/");else if(t.indexOf("-")!==-1)n="-",r=t.split("-");else return null;if(r.length!==3)return null;const o=[];for(let u=0;u<3;u++){const w=parseInt(r[u],10);if(isNaN(w))return null;o.push(w)}let s,l,c;n==="."?(s=o[0],l=o[1],c=o[2]):n==="/"?(l=o[0],s=o[1],c=o[2]):r[0].length===4?(c=o[0],l=o[1],s=o[2]):(s=o[0],l=o[1],c=o[2]),c<100&&(c+=c<50?2e3:1900);const i=new Date(c,l-1,s);return i.getFullYear()!==c||i.getMonth()!==l-1||i.getDate()!==s?null:i}function U(e,t,n,r){if(!e||!(e instanceof Date)||isNaN(e.getTime())||!t||typeof t!="string")return"";const o=e.getDate(),s=e.getMonth(),l=e.getFullYear(),c=e.getHours(),i=e.getMinutes();let u,w;const f=(n||"").toLowerCase().split("-")[0];let a=!1;try{const g=new Intl.DateTimeFormat(n,{month:"long"}).resolvedOptions().locale.toLowerCase().split("-")[0];a=!!(r&&g!==f)}catch{a=!!r}if(a&&r&&r.monthsLong)u=r.monthsLong[s];else try{u=new Intl.DateTimeFormat(n,{month:"long"}).format(e)}catch{u=String(s+1)}if(a&&r&&r.monthsShort)w=r.monthsShort[s];else try{w=new Intl.DateTimeFormat(n,{month:"short"}).format(e)}catch{w=String(s+1)}const d={yyyy:String(l),yy:String(l).slice(-2),MMMM:u,MMM:w,MM:String(s+1).padStart(2,"0"),M:String(s+1),dd:String(o).padStart(2,"0"),d:String(o),HH:String(c).padStart(2,"0"),mm:String(i).padStart(2,"0")};return t.replace(/yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|mm/g,function(m){return d[m]!==void 0?d[m]:m})}function N(e,t,n,r){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const o=nt(t);if(o)try{const s=new Intl.DateTimeFormat(n,o),l=(n||"").toLowerCase().split("-")[0],c=s.resolvedOptions().locale.toLowerCase().split("-")[0];return r&&c!==l?U(e,"dd.MM.yyyy",n,r):s.format(e)}catch{return U(e,"dd.MM.yyyy",n,r)}return U(e,t||"dd.MM.yyyy",n,r)}(function(){const e="data-ln-date",t="lnDate";if(window[t]!==void 0)return;function n(a){const d=a[t];if(d){if(d.isTextElement)d._initTextElement();else if(d.value){const m=A(d.value);m&&d._displayFormatted(m)}}}const r={"data-ln-date":{type:"enum",values:["short","medium","long","full","iso"],fallback:"medium",effect:n,description:"Date display style preset or activator"},"data-ln-date-format":{type:"string",effect:n,description:"Custom Intl.DateTimeFormat pattern or options"},"data-ln-date-locale":{type:"string",effect:n,description:"BCP 47 language tag override for date formatting"},"data-ln-value":{type:"string",effect:n,description:"Raw ISO date string or timestamp for non-time elements (td, span)"},"data-ln-date-dict":{type:"marker",description:"Container for date translation dictionary"},"data-ln-date-dict-key":{type:"string",description:"Dictionary key for relative time or custom date formatting"},"data-ln-date-field":{type:"string",description:"Field name mapping for date record binding"},"data-ln-date-label":{type:"string",description:"Accessible label text for the date input"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function s(a,d,m){Q(a.dom,"ln-date:change",{value:d,formatted:a.dom.value,date:m}),a.dom.dispatchEvent(new Event("change",{bubbles:!0}))}function l(a,d,m,g){a._setHiddenRaw(d),o.set.call(a._picker,d),a._lastISO=d,g!==void 0?(a._isFormatting=!0,a.dom.value=g,a._isFormatting=!1):m&&a._displayFormatted(m),s(a,d,m)}function c(a){a._setHiddenRaw(""),o.set.call(a._picker,""),a._isFormatting=!0,a.dom.value="",a._isFormatting=!1,a._lastISO="",s(a,"",null)}const i=new Set;let u=!1;function w(){Y(),!u&&(u=!0,document.addEventListener("ln-core:locale-change",function(){i.forEach(function(a){if(a.isTextElement)a._formatTextContent();else if(a.value){const d=A(a.value);d&&a._displayFormatted(d)}})}))}function f(a){if(a[t])return a[t];a[t]=this,this.dom=a;const d=this;if(i.add(this),w(),a.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;this.isTextElement=!1;const m=a.value,g=a.name,y=a.closest(".form-element, form")||a.parentNode;if(y){const h=y.querySelectorAll("[data-ln-date-dict]");for(let p=0;p<h.length;p++){const b=h[p].getAttribute("data-ln-date-dict");if(b){const _=xe(h[p],"data-ln-date-dict-key");_["months-long"]&&(_.monthsLong=_["months-long"].split(",").map(x=>x.trim())),_["months-short"]&&(_.monthsShort=_["months-short"].split(",").map(x=>x.trim())),G(b,_)}}}const v=document.createElement("span");v.setAttribute("data-ln-date-field",""),a.parentNode.insertBefore(v,a),v.appendChild(a),this._wrapper=v;const C=document.createElement("input");C.type="hidden",C.name=g,a.removeAttribute("name"),a.hasAttribute("data-ln-fill-as")&&C.setAttribute("data-ln-fill-as",a.getAttribute("data-ln-fill-as")),a.insertAdjacentElement("afterend",C),this._hidden=C;const S=document.createElement("input");S.type="date",S.tabIndex=-1,S.setAttribute("tabindex","-1"),S.setAttribute("aria-hidden","true"),S.setAttribute("aria-label",a.getAttribute("data-ln-date-label")||"Date picker"),S.style.cssText="position:absolute;opacity:0;width:0;height:0;overflow:hidden;pointer-events:none",C.insertAdjacentElement("afterend",S),this._picker=S,a.type="text";const E=document.createElement("button");E.type="button",E.setAttribute("aria-label",a.getAttribute("data-ln-date-label")||"Open date picker"),E.innerHTML='<svg class="ln-icon" aria-hidden="true"><use href="#ln-icon-calendar"></use></svg>',S.insertAdjacentElement("afterend",E),this._btn=E,this._lastISO="",Object.defineProperty(C,"value",{get:function(){return o.get.call(C)},set:function(h){if(o.set.call(C,h),h&&h!==""){const p=A(h);p&&l(d,h,p)}else h===""&&c(d)}}),ye(a,o,{get:function(){return o.get.call(a)},set:function(h,p){if(d._isFormatting){p(h);return}if(!h||h===""){p(""),c(d);return}const b=A(h)||T(h);if(b){const _=O(b),x=a.getAttribute(e)||"",k=I(a),rt=L(k),me=N(b,x,k,rt);p(me),l(d,_,b,me)}else p(String(h)),c(d)}}),this._onPickerChange=function(){const h=S.value;if(h){const p=A(h);p&&l(d,h,p)}else c(d)},S.addEventListener("change",this._onPickerChange),this._onBlur=function(){const h=d.dom.value.trim();if(h===""){d._lastISO!==""&&c(d);return}if(d._lastISO){const b=A(d._lastISO);if(b){const _=d.dom.getAttribute(e)||"",x=I(d.dom),k=L(x);if(h===N(b,_,x,k))return}}const p=T(h);if(p){const b=O(p);l(d,b,p)}else if(d._lastISO){const b=A(d._lastISO);b&&d._displayFormatted(b)}else d.dom.value=""},a.addEventListener("blur",this._onBlur),this._onBtnClick=function(){d._openPicker()},E.addEventListener("click",this._onBtnClick);const D=a.form;if(D&&(this._form=D,this._onFormReset=function(){setTimeout(function(){const h=d.dom.value;if(h){const p=A(h)||T(h);if(p){const b=O(p);l(d,b,p);return}}c(d)},0)},D.addEventListener("reset",this._onFormReset)),m&&m!==""){const h=A(m);h&&l(d,m,h)}return this}f.prototype._initTextElement=function(){const a=this.dom,d=a.getAttribute("data-ln-value"),m=a.getAttribute("data-ln-date"),g=a.getAttribute("datetime");let y=null;a.tagName==="TIME"&&g!==null&&g!==""?y=g:d!==null&&d!==""?y=d:g!==null&&g!==""?y=g:m!==null&&m!==""&&m!=="true"&&!H.test(m)?y=m:y=a.textContent.trim();const v=A(y)||T(y);if(v&&!isNaN(v.getTime())){const C=O(v);this._rawValue=C,a.tagName!=="TIME"&&!a.hasAttribute("data-ln-value")&&a.setAttribute("data-ln-value",C),this._formatTextContent()}else this._rawValue=null},f.prototype._formatTextContent=function(){if(this._rawValue){const a=A(this._rawValue);if(a){let m=this.dom.getAttribute("data-ln-date-format");if(!m){const v=this.dom.getAttribute("data-ln-date");v&&H.test(v)&&(m=v)}const g=I(this.dom),y=L(g);this.dom.textContent=N(a,m||"medium",g,y)}}},f.prototype._openPicker=function(){if(typeof this._picker.showPicker=="function")try{this._picker.showPicker()}catch{this._picker.click()}else this._picker.click()},f.prototype._setHiddenRaw=function(a){o.set.call(this._hidden,a)},f.prototype._displayFormatted=function(a){const d=this.dom.getAttribute(e)||"",m=I(this.dom),g=L(m);this._isFormatting=!0,this.dom.value=N(a,d,m,g),this._isFormatting=!1},Object.defineProperty(f.prototype,"value",{get:function(){return this.isTextElement?this._rawValue||"":o.get.call(this._hidden)},set:function(a){if(this.isTextElement){if(!a||a===""){this._rawValue=null,this.dom.removeAttribute("data-ln-value"),this.dom.tagName==="TIME"&&this.dom.removeAttribute("datetime"),this.dom.textContent="";return}const m=A(a)||T(a);if(!m)return;const g=O(m);this._rawValue=g,this.dom.tagName==="TIME"?this.dom.setAttribute("datetime",g):this.dom.setAttribute("data-ln-value",g),this._formatTextContent();return}if(!a||a===""){c(this);return}const d=A(a);d&&l(this,a,d)}}),Object.defineProperty(f.prototype,"date",{get:function(){const a=this.value;return a?A(a):null},set:function(a){if(!a||!(a instanceof Date)||isNaN(a.getTime())){this.value="";return}this.value=O(a)}}),Object.defineProperty(f.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:this.dom.value}}),f.prototype.destroy=function(){if(!this.dom[t])return;if(i.delete(this),this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement){delete this.dom[t];return}this._form&&this._onFormReset&&this._form.removeEventListener("reset",this._onFormReset),this._picker.removeEventListener("change",this._onPickerChange),this.dom.removeEventListener("blur",this._onBlur),this._btn.removeEventListener("click",this._onBtnClick);const a=this.value;this._hidden.remove(),this._picker.remove(),this._btn.remove(),this._wrapper&&this._wrapper.parentNode&&(this._wrapper.parentNode.insertBefore(this.dom,this._wrapper),this._wrapper.remove()),delete this.dom.value,this.dom.name=this._hidden.name,this.dom.type="date",a&&(this.dom.value=a),delete this.dom[t]},fe(e,t,f,"ln-date",{attributes:r,extraAttributes:["datetime","lang"],onAttributeChange:n})})()})();