@livenetworks/ashlar 2.0.9 → 2.1.0
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.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-ajax/src/ln-ajax.js +15 -26
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/helpers.js +1 -1
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +98 -41
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/src/generated-attributes.js +1 -0
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/src/ln-external-links.js +9 -21
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +161 -153
- package/components/ln-filter/src/ln-filter.js +77 -5
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-icon/src/ln-icon.js +14 -16
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-link/src/ln-link.js +16 -26
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-nav/src/ln-nav.js +5 -4
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-progress/src/ln-progress.js +9 -21
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-search/src/ln-search.js +17 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/ln-ashlar.html-data.json +5 -0
- package/package.json +1 -1
- package/web-types.json +8 -1
|
@@ -1,153 +1,161 @@
|
|
|
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-filter",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-col": {
|
|
7
|
-
"direction": "author",
|
|
8
|
-
"sources": [
|
|
9
|
-
"src/filter-model.js"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"data-ln-debug": {
|
|
13
|
-
"direction": null,
|
|
14
|
-
"sources": [
|
|
15
|
-
"ln-filter-dev.scss"
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
|
-
"data-ln-empty": {
|
|
19
|
-
"direction": "author",
|
|
20
|
-
"sources": [
|
|
21
|
-
"src/ln-filter.js"
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
"data-ln-empty-state": {
|
|
25
|
-
"direction": "author",
|
|
26
|
-
"sources": [
|
|
27
|
-
"src/ln-filter.js"
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
"data-ln-field": {
|
|
31
|
-
"direction": "author",
|
|
32
|
-
"sources": [
|
|
33
|
-
"src/filter-model.js"
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
"data-ln-filter": {
|
|
37
|
-
"direction":
|
|
38
|
-
"sources": [
|
|
39
|
-
"ln-filter-dev.scss",
|
|
40
|
-
"src/ln-filter.js"
|
|
41
|
-
],
|
|
42
|
-
"type": "string",
|
|
43
|
-
"description": "Target table or list element ID to filter"
|
|
44
|
-
},
|
|
45
|
-
"data-ln-filter-col": {
|
|
46
|
-
"direction": "author",
|
|
47
|
-
"sources": [
|
|
48
|
-
"src/filter-model.js",
|
|
49
|
-
"src/ln-filter.js"
|
|
50
|
-
],
|
|
51
|
-
"type": "string",
|
|
52
|
-
"description": "Column name or index filter specifier"
|
|
53
|
-
},
|
|
54
|
-
"data-ln-filter-hide": {
|
|
55
|
-
"direction": "runtime",
|
|
56
|
-
"sources": [
|
|
57
|
-
"ln-filter.scss",
|
|
58
|
-
"src/ln-filter.js"
|
|
59
|
-
],
|
|
60
|
-
"type": "enum",
|
|
61
|
-
"values": [
|
|
62
|
-
"collapse",
|
|
63
|
-
"none"
|
|
64
|
-
],
|
|
65
|
-
"fallback": "collapse",
|
|
66
|
-
"description": "CSS hiding strategy for non-matching rows"
|
|
67
|
-
},
|
|
68
|
-
"data-ln-filter-key": {
|
|
69
|
-
"direction": "author",
|
|
70
|
-
"sources": [
|
|
71
|
-
"ln-filter-dev.scss",
|
|
72
|
-
"src/filter-model.js",
|
|
73
|
-
"src/ln-filter.js"
|
|
74
|
-
],
|
|
75
|
-
"type": "string",
|
|
76
|
-
"description": "Field key for filter matching"
|
|
77
|
-
},
|
|
78
|
-
"data-ln-filter-reset": {
|
|
79
|
-
"direction": "author",
|
|
80
|
-
"sources": [
|
|
81
|
-
"src/ln-filter.js"
|
|
82
|
-
],
|
|
83
|
-
"type": "trigger",
|
|
84
|
-
"description": "Filter reset button or option trigger"
|
|
85
|
-
},
|
|
86
|
-
"data-ln-filter-
|
|
87
|
-
"direction": "
|
|
88
|
-
"sources": [
|
|
89
|
-
"src/ln-filter.js"
|
|
90
|
-
],
|
|
91
|
-
"type": "
|
|
92
|
-
"description": "
|
|
93
|
-
},
|
|
94
|
-
"data-ln-filter-
|
|
95
|
-
"direction": "
|
|
96
|
-
"sources": [
|
|
97
|
-
"src/ln-filter.js"
|
|
98
|
-
],
|
|
99
|
-
"type": "string",
|
|
100
|
-
"description": "
|
|
101
|
-
},
|
|
102
|
-
"data-ln-
|
|
103
|
-
"direction":
|
|
104
|
-
"sources": [
|
|
105
|
-
"src/ln-filter.js"
|
|
106
|
-
],
|
|
107
|
-
"type": "string",
|
|
108
|
-
"description": "
|
|
109
|
-
},
|
|
110
|
-
"data-ln-
|
|
111
|
-
"direction":
|
|
112
|
-
"sources": [
|
|
113
|
-
"src/filter
|
|
114
|
-
]
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
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-filter",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-col": {
|
|
7
|
+
"direction": "author",
|
|
8
|
+
"sources": [
|
|
9
|
+
"src/filter-model.js"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-debug": {
|
|
13
|
+
"direction": null,
|
|
14
|
+
"sources": [
|
|
15
|
+
"ln-filter-dev.scss"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"data-ln-empty": {
|
|
19
|
+
"direction": "author",
|
|
20
|
+
"sources": [
|
|
21
|
+
"src/ln-filter.js"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"data-ln-empty-state": {
|
|
25
|
+
"direction": "author",
|
|
26
|
+
"sources": [
|
|
27
|
+
"src/ln-filter.js"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"data-ln-field": {
|
|
31
|
+
"direction": "author",
|
|
32
|
+
"sources": [
|
|
33
|
+
"src/filter-model.js"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"data-ln-filter": {
|
|
37
|
+
"direction": "author",
|
|
38
|
+
"sources": [
|
|
39
|
+
"ln-filter-dev.scss",
|
|
40
|
+
"src/ln-filter.js"
|
|
41
|
+
],
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "Target table or list element ID to filter"
|
|
44
|
+
},
|
|
45
|
+
"data-ln-filter-col": {
|
|
46
|
+
"direction": "author",
|
|
47
|
+
"sources": [
|
|
48
|
+
"src/filter-model.js",
|
|
49
|
+
"src/ln-filter.js"
|
|
50
|
+
],
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "Column name or index filter specifier"
|
|
53
|
+
},
|
|
54
|
+
"data-ln-filter-hide": {
|
|
55
|
+
"direction": "runtime",
|
|
56
|
+
"sources": [
|
|
57
|
+
"ln-filter.scss",
|
|
58
|
+
"src/ln-filter.js"
|
|
59
|
+
],
|
|
60
|
+
"type": "enum",
|
|
61
|
+
"values": [
|
|
62
|
+
"collapse",
|
|
63
|
+
"none"
|
|
64
|
+
],
|
|
65
|
+
"fallback": "collapse",
|
|
66
|
+
"description": "CSS hiding strategy for non-matching rows"
|
|
67
|
+
},
|
|
68
|
+
"data-ln-filter-key": {
|
|
69
|
+
"direction": "author",
|
|
70
|
+
"sources": [
|
|
71
|
+
"ln-filter-dev.scss",
|
|
72
|
+
"src/filter-model.js",
|
|
73
|
+
"src/ln-filter.js"
|
|
74
|
+
],
|
|
75
|
+
"type": "string",
|
|
76
|
+
"description": "Field key for filter matching"
|
|
77
|
+
},
|
|
78
|
+
"data-ln-filter-reset": {
|
|
79
|
+
"direction": "author",
|
|
80
|
+
"sources": [
|
|
81
|
+
"src/ln-filter.js"
|
|
82
|
+
],
|
|
83
|
+
"type": "trigger",
|
|
84
|
+
"description": "Filter reset button or option trigger"
|
|
85
|
+
},
|
|
86
|
+
"data-ln-filter-target": {
|
|
87
|
+
"direction": "both",
|
|
88
|
+
"sources": [
|
|
89
|
+
"src/ln-filter.js"
|
|
90
|
+
],
|
|
91
|
+
"type": "marker",
|
|
92
|
+
"description": "Marker on target container or table observed by ln-filter"
|
|
93
|
+
},
|
|
94
|
+
"data-ln-filter-value": {
|
|
95
|
+
"direction": "author",
|
|
96
|
+
"sources": [
|
|
97
|
+
"src/ln-filter.js"
|
|
98
|
+
],
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "Value to match for this filter input"
|
|
101
|
+
},
|
|
102
|
+
"data-ln-filter-values": {
|
|
103
|
+
"direction": "both",
|
|
104
|
+
"sources": [
|
|
105
|
+
"src/ln-filter.js"
|
|
106
|
+
],
|
|
107
|
+
"type": "string",
|
|
108
|
+
"description": "Encoded active filter values"
|
|
109
|
+
},
|
|
110
|
+
"data-ln-hash": {
|
|
111
|
+
"direction": null,
|
|
112
|
+
"sources": [
|
|
113
|
+
"src/ln-filter.js"
|
|
114
|
+
],
|
|
115
|
+
"type": "string",
|
|
116
|
+
"description": "URL hash routing key for filter state persistence"
|
|
117
|
+
},
|
|
118
|
+
"data-ln-popover": {
|
|
119
|
+
"direction": "author",
|
|
120
|
+
"sources": [
|
|
121
|
+
"src/filter-model.js"
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"data-ln-popover-for": {
|
|
125
|
+
"direction": "author",
|
|
126
|
+
"sources": [
|
|
127
|
+
"src/filter-model.js"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"data-ln-sort-exclude": {
|
|
131
|
+
"direction": "author",
|
|
132
|
+
"sources": [
|
|
133
|
+
"src/ln-filter.js"
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"data-ln-table-col": {
|
|
137
|
+
"direction": "author",
|
|
138
|
+
"sources": [
|
|
139
|
+
"src/filter-model.js"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"data-ln-table-empty": {
|
|
143
|
+
"direction": "author",
|
|
144
|
+
"sources": [
|
|
145
|
+
"src/ln-filter.js"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"data-ln-table-filter-col": {
|
|
149
|
+
"direction": "author",
|
|
150
|
+
"sources": [
|
|
151
|
+
"src/filter-model.js"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
"data-ln-value": {
|
|
155
|
+
"direction": "author",
|
|
156
|
+
"sources": [
|
|
157
|
+
"src/ln-filter.js"
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -11,6 +11,7 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
|
|
|
11
11
|
const COL_ATTR = 'data-ln-filter-col';
|
|
12
12
|
const HASH_ATTR = 'data-ln-hash';
|
|
13
13
|
const VALUES_ATTR = 'data-ln-filter-values';
|
|
14
|
+
const TARGET_ATTR = 'data-ln-filter-target';
|
|
14
15
|
|
|
15
16
|
// Shared column filter state per plain table (AND across columns, OR within column)
|
|
16
17
|
const _tableFilters = new WeakMap();
|
|
@@ -19,14 +20,15 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
|
|
|
19
20
|
|
|
20
21
|
// ─── Attribute Contract (SSOT) ──────────────────────────
|
|
21
22
|
const ATTRIBUTES = {
|
|
22
|
-
'data-ln-filter': { prop: 'targetId', type: 'string', read: attrStr, fallback: null, description: 'Target table or list element ID to filter' },
|
|
23
|
+
'data-ln-filter': { prop: 'targetId', type: 'string', read: attrStr, fallback: null, effect: _syncAttribute, description: 'Target table or list element ID to filter' },
|
|
23
24
|
'data-ln-hash': { type: 'string', effect: _syncAttribute, description: 'URL hash routing key for filter state persistence' },
|
|
24
25
|
'data-ln-filter-values': { type: 'string', effect: _syncAttribute, description: 'Encoded active filter values' },
|
|
25
26
|
'data-ln-filter-col': { type: 'string', description: 'Column name or index filter specifier' },
|
|
26
27
|
'data-ln-filter-key': { type: 'string', description: 'Field key for filter matching' },
|
|
27
28
|
'data-ln-filter-reset': { type: 'trigger', description: 'Filter reset button or option trigger' },
|
|
28
29
|
'data-ln-filter-value': { type: 'string', description: 'Value to match for this filter input' },
|
|
29
|
-
'data-ln-filter-hide': { type: 'enum', values: ['collapse', 'none'], fallback: 'collapse', description: 'CSS hiding strategy for non-matching rows' }
|
|
30
|
+
'data-ln-filter-hide': { type: 'enum', values: ['collapse', 'none'], fallback: 'collapse', description: 'CSS hiding strategy for non-matching rows' },
|
|
31
|
+
'data-ln-filter-target': { type: 'marker', description: 'Marker on target container or table observed by ln-filter' }
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
const ATTR_SPEC = attrSpec(ATTRIBUTES);
|
|
@@ -90,6 +92,31 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
|
|
|
90
92
|
});
|
|
91
93
|
|
|
92
94
|
this._queueRender = queueRender;
|
|
95
|
+
|
|
96
|
+
const queueDomFilter = createBatcher(function () {
|
|
97
|
+
if (!self._destroyed) {
|
|
98
|
+
self._applyDomFilter();
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
this._queueDomFilter = queueDomFilter;
|
|
103
|
+
|
|
104
|
+
function _ensureTargetMarked() {
|
|
105
|
+
if (!self.targetId) return;
|
|
106
|
+
const target = document.getElementById(self.targetId);
|
|
107
|
+
if (target && !target.hasAttribute(TARGET_ATTR)) {
|
|
108
|
+
target.setAttribute(TARGET_ATTR, self.targetId);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
this._ensureTargetMarked = _ensureTargetMarked;
|
|
113
|
+
_ensureTargetMarked();
|
|
114
|
+
queueBoot(function () {
|
|
115
|
+
if (!self._destroyed) {
|
|
116
|
+
_ensureTargetMarked();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
93
120
|
this._attachHandlers();
|
|
94
121
|
|
|
95
122
|
// Hash change listener
|
|
@@ -274,13 +301,19 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
|
|
|
274
301
|
}
|
|
275
302
|
|
|
276
303
|
if (defaultPrevented) return;
|
|
304
|
+
self._applyDomFilter(target);
|
|
305
|
+
};
|
|
277
306
|
|
|
278
|
-
|
|
307
|
+
_component.prototype._applyDomFilter = function (targetOverride) {
|
|
308
|
+
const target = targetOverride || document.getElementById(this.targetId);
|
|
309
|
+
if (!target) return;
|
|
310
|
+
const active = _deriveActive(this);
|
|
311
|
+
const isReset = active.key === null || active.values.length === 0;
|
|
312
|
+
const table = target.tagName === 'TABLE' ? target : (target.querySelector ? target.querySelector('table') : null);
|
|
279
313
|
|
|
280
314
|
if (table) {
|
|
281
|
-
|
|
315
|
+
this._filterTableRows(active, table);
|
|
282
316
|
} else {
|
|
283
|
-
if (!target) return;
|
|
284
317
|
const children = target.children;
|
|
285
318
|
for (let i = 0; i < children.length; i++) {
|
|
286
319
|
const el = children[i];
|
|
@@ -383,6 +416,13 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
|
|
|
383
416
|
}
|
|
384
417
|
if (Object.keys(filters).length === 0) _tableFilters.delete(table);
|
|
385
418
|
}
|
|
419
|
+
|
|
420
|
+
if (this.targetId) {
|
|
421
|
+
const remaining = document.querySelectorAll('[' + DOM_SELECTOR + '="' + this.targetId + '"]');
|
|
422
|
+
if (remaining.length <= 1) {
|
|
423
|
+
target.removeAttribute(TARGET_ATTR);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
386
426
|
}
|
|
387
427
|
|
|
388
428
|
if (this._onDomChange) {
|
|
@@ -420,6 +460,10 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
|
|
|
420
460
|
_applyInputValues(el, key, values);
|
|
421
461
|
instance._render();
|
|
422
462
|
}
|
|
463
|
+
} else if (attrName === DOM_SELECTOR) {
|
|
464
|
+
instance.targetId = el.getAttribute(DOM_SELECTOR) || null;
|
|
465
|
+
instance._ensureTargetMarked();
|
|
466
|
+
instance._render();
|
|
423
467
|
}
|
|
424
468
|
}
|
|
425
469
|
|
|
@@ -427,6 +471,34 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
|
|
|
427
471
|
|
|
428
472
|
registerComponent(DOM_SELECTOR, DOM_ATTRIBUTE, _component, 'ln-filter', {
|
|
429
473
|
attributes: ATTRIBUTES,
|
|
474
|
+
subtreeQuery: '[' + DOM_SELECTOR + '], [' + TARGET_ATTR + ']',
|
|
475
|
+
onSubtreeChange: function (host, mut) {
|
|
476
|
+
if (mut.addedNodes.length === 0 && mut.removedNodes.length === 0) return;
|
|
477
|
+
|
|
478
|
+
let targetId = null;
|
|
479
|
+
let targetEl = null;
|
|
480
|
+
|
|
481
|
+
if (host.hasAttribute(TARGET_ATTR)) {
|
|
482
|
+
targetEl = host;
|
|
483
|
+
targetId = host.getAttribute(TARGET_ATTR) || host.id;
|
|
484
|
+
} else if (host.hasAttribute(DOM_SELECTOR)) {
|
|
485
|
+
targetId = host.getAttribute(DOM_SELECTOR);
|
|
486
|
+
targetEl = targetId ? document.getElementById(targetId) : null;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
if (!targetId || !targetEl) return;
|
|
490
|
+
|
|
491
|
+
const controls = document.querySelectorAll('[' + DOM_SELECTOR + '="' + targetId + '"]');
|
|
492
|
+
for (let i = 0; i < controls.length; i++) {
|
|
493
|
+
const inst = controls[i][DOM_ATTRIBUTE];
|
|
494
|
+
if (inst && !inst._destroyed) {
|
|
495
|
+
const active = _deriveActive(inst);
|
|
496
|
+
if (active.values.length > 0) {
|
|
497
|
+
inst._queueDomFilter();
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
},
|
|
430
502
|
persist: {
|
|
431
503
|
attr: VALUES_ATTR,
|
|
432
504
|
hashActive: function (el) { return !!resolveHashNamespace(el, 'filter'); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function E(){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 g(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 i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!g(i))return}e.apply(console,t)}}function z(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function p(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function G(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function X(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,l={},s=e.elements,o={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(o[r.name]=(o[r.name]||0)+1)}for(let a=0;a<s.length;a++){const r=s[a];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(i&&r.matches&&r.matches(i)))if(r.type==="checkbox")n&&o[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let c=0;c<r.options.length;c++)r.options[c].selected&&l[r.name].push(r.options[c].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const c=Number(r.value);l[r.name]=r.value===""||isNaN(c)?null:c}else l[r.name]=r.value}return l}function Y(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function L(e,t){const n=e.elements,i=[],l={};for(let s=0;s<n.length;s++){const o=n[s];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<n.length;s++){const o=n[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const a=o.getAttribute("data-ln-fill-as")||o.name;if(!a||!(a in t))continue;const r=t[a];if(o.type==="checkbox"){if(Array.isArray(r))o.checked=r.indexOf(o.value)!==-1;else if(l[o.name]>1){const c=String(r).split(",").map(function(u){return u.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=Y(r);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(r),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(r))for(let c=0;c<o.options.length;c++)o.options[c].selected=r.indexOf(o.options[c].value)!==-1;i.push(o)}else o.value=r,o.tagName==="SELECT"&&r!=null&&o.setAttribute("data-ln-value",r),i.push(o)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=L,window.lnCore.serializeForm=X,window.lnCore.resolveFormMethod=G);const T={};function Z(e,t){T[e]=t}function ee(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Z,window.lnCore.getDataMapper=ee);function te(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){z(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const I={};function ne(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];I[n]=t}function oe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return I[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ne,window.lnCore.getLocaleFallback=oe,window.lnCore.ensureLocaleObserver=te);const C={};function re(e,t){C[e]||(C[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=C[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function F(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const a=n[o],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const a=i[o],r=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<r.length;c++){const u=r[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&a.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const a=l[o],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const a=s[o],r=a.getAttribute("data-ln-class").split(",");for(let c=0;c<r.length;c++){const u=r[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&a.classList.toggle(d,!!t[f])}}return e}function ie(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 i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].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)F(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 $(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(o,a){return t[a]!==void 0?t[a]:""}))}const i=function(s,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const o=l[s],a=o.attributes;for(let r=0;r<a.length;r++){const c=a[r];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function le(e,t,n,i,l,s){const o={};for(let r=0;r<e.children.length;r++){const c=e.children[r],u=c.getAttribute("data-ln-render-key");u&&(o[u]=c)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const c=t[r],u=String(i(c));let d=o[u];if(d)l(d,c,r);else{const f=re(n,s);if(!f||($(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,c,r)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=F,window.lnCore.lnFill=ie,window.lnCore.renderList=le);function b(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function M(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function D(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function R(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const y=new Map;function N(e,t){const n=(e?e.join("|"):"")+"::"+t;if(y.has(n))return y.get(n);const i=new Set(e||[]),l=function(s,o){const a=s.getAttribute(o);return a!==null&&i.has(a)?a:t};return y.set(n,l),l}function q(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function B(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function j(e,t,n,i,l){if(!e||t===null)return!0;const s=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const a=r=>{l?console.warn(r,l):console.warn(r)};if(o==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const r=e.values||[];return r.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(a(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(a(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(r){return a(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function U(e,t,n){for(const i in n){const[l,s,o]=n[i];Object.defineProperty(e,i,{get:function(){return l(t,s,o)},enumerable:!0,configurable:!0})}return e}function W(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=N(i.values,i.fallback);break;case"integer":l=M;break;case"float":l=q;break;case"boolean":l=D;break;case"list":l=R;break;case"json":l=B;break;case"string":default:l=b;break}l||(l=b),t[i.prop]=[l,n,i.fallback]}return t}function se(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function ae(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=U,window.lnCore.attrSpec=W,window.lnCore.attrStr=b,window.lnCore.attrInt=M,window.lnCore.attrBool=D,window.lnCore.attrList=R,window.lnCore.attrEnum=N,window.lnCore.attrFloat=q,window.lnCore.attrJson=B);function A(e,t,n,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&o.push(e);for(const a of o)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new i(a)}catch(r){console.error("["+n+"] init failed",a,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ue(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 H(){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 de(e){const t=H(),n=e.observed||[];for(let i=0;i<n.length;i++){const l=n[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=ae(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function V(e,t,n,i){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const o=s.effects&&s.effects[n];o?o(t,n,i):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,i)}}function fe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const i=H(),l=i.byAttr.get(n);if(E()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(n)&&g(t)){const s=i.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let a=0;a<s.length;a++)j(s[a].spec,o,n,s[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=i.byReactive.get(n);s&&V(s,t,n,e.oldValue),i.reactiveWildcard.length&&V(i.reactiveWildcard,t,n,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const o=l[s];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(A(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function we(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{fe(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function P(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function he(e){const t=P();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const i=t[n];if(i.onSubtreeChange){const l=i.query,s=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;s&&i.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const i=e.addedNodes[n];if(i.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l];A(i,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(i)}}for(let n=0;n<e.removedNodes.length;n++){const i=e.removedNodes[n];if(i.nodeType===1)for(let l=0;l<t.length;l++){const s=t[l],o=s.query,a=Array.from(i.querySelectorAll(o));i.matches&&i.matches(o)&&a.push(i);for(let r=0;r<a.length;r++){const c=a[r];if(!document.contains(c)){const u=c[s.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+s.attribute+"] destroy failed",c,d)}delete c[s.attribute]}}}}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{he(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function J(e,t,n,i,l={}){const s=l.extraAttributes||[],o=l.onAttributeChange||null,a=l.onSubtreeChange||null,r=l.onInit||null,c=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?se(d):u,ke=d?new Set(Object.keys(d)):null,Se=l.persist||null;function m(x){const w=x||document.body;if(A(w,e,t,n),d&&E())for(const h in d){const Ee=d[h],k=Array.from(w.querySelectorAll("["+h+"]"));w.matches&&w.matches("["+h+"]")&&k.push(w);for(let S=0;S<k.length;S++){const O=k[S];g(O)&&j(Ee,O.getAttribute(h),h,i,O)}}r&&r(w)}const _=[];if(e.indexOf("[")!==-1){const x=/\[([\w-]+)/g;let w;for(;(w=x.exec(e))!==null;)_.push(w[1])}else _.push(e);de({selector:e,attribute:t,componentTag:i,attributes:d,ComponentFn:n,onInit:r,observed:_.concat(s),onAttributeChange:o,onAttrChange:c,effects:f,declared:ke,persist:Se}),we();const Oe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";P().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:a,query:Oe}),pe(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=J);function Q(){ce()>0?ue(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Q):Q(),m}function K(e){return(e||"").replace(/^#/,"")}function v(e){const t=e===void 0?location.hash:e,n={},i=K(t);if(!i)return n;const l=i.split("&");for(let s=0;s<l.length;s++){const o=l[s];if(!o)continue;const a=o.indexOf(":"),r=a>-1?o.slice(0,a):o,c=a>-1?o.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(c)}catch{n[r]=c}}return n}function be(e){if(!e)return null;const t=v();return e in t?t[e]:null}function me(e,t){if(!e)return;const n=v();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const o=n[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");K(location.hash)!==l&&(location.hash=l)}function ge(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ce(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 i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function ye(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ae(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 ve(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function _e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=v,window.lnCore.hashGet=be,window.lnCore.hashSet=me,window.lnCore.hashLinkClick=ge,window.lnCore.resolveHashNamespace=Ce,window.lnCore.hashSortEncode=ye,window.lnCore.hashSortDecode=Ae,window.lnCore.hashFilterEncode=ve,window.lnCore.hashFilterDecode=_e);function xe(){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=xe),(function(){const e="data-ln-form",t="lnForm";if(window[t]!==void 0)return;const n={"data-ln-form":{type:"marker",description:"Identifies the form element as an enhanced ln-form"},"data-ln-form-action-edit":{prop:"_actionEdit",type:"string",read:b,fallback:"",description:"URL template or endpoint used when editing an existing record"},"data-ln-form-action-method":{prop:"_actionMethod",type:"enum",values:["PUT","POST","PATCH"],fallback:"PUT",description:"HTTP method used when submitting edit action"}},i=W(n);function l(s){this.dom=s,U(this,s,i),this._baseAction=s.getAttribute("action")||"";const o=this;function a(){const c=o.dom.querySelectorAll('input[type="hidden"]:not([name="_method"])');for(let u=0;u<c.length;u++)c[u].hasAttribute("data-ln-initial-value")||c[u].setAttribute("data-ln-initial-value",c[u].getAttribute("value")||"")}function r(){const c=o.dom.querySelectorAll('input[type="hidden"]:not([name="_method"])');for(let u=0;u<c.length;u++)c[u].value=c[u].getAttribute("data-ln-initial-value")||""}return a(),this._onLnFill=function(c){c.target===o.dom&&(c.detail?(a(),o.fill(c.detail),o._applyActionMode(c.detail)):(o.dom.reset(),r()))},this._onReset=function(){o._applyActionMode(null),r()},s.addEventListener("ln-fill",this._onLnFill),s.addEventListener("reset",this._onReset),this}l.prototype.fill=function(s){const o=L(this.dom,s);for(let a=0;a<o.length;a++){const r=o[a],c=r.tagName==="SELECT"||r.type==="checkbox"||r.type==="radio";r.dispatchEvent(new Event(c?"change":"input",{bubbles:!0}))}},l.prototype._ensureMethodInput=function(){let s=this.dom.querySelector('input[name="_method"]');return s||(s=document.createElement("input"),s.type="hidden",s.name="_method",s.value="",this.dom.appendChild(s)),s},l.prototype._applyActionMode=function(s){if(!this.dom.hasAttribute("data-ln-form-action-edit"))return;const o=s&&s.id!=null&&s.id!==""?s.id:null,a=this._ensureMethodInput();if(o!==null){const r=this._actionEdit;r?this.dom.setAttribute("action",r.replace(":id",encodeURIComponent(o))):this.dom.setAttribute("action",this._baseAction.replace(/\/$/,"")+"/"+encodeURIComponent(o)),a.value=this._actionMethod||"PUT"}else this.dom.setAttribute("action",this._baseAction),a.value=""},l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-fill",this._onLnFill),this.dom.removeEventListener("reset",this._onReset),delete this.dom[t])},J(e,t,l,"ln-form",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function T(){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 C(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 n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!C(n))return}e.apply(console,t)}}function Y(e,t,i){const n=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function b(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){b(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ee(e,t){const i=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,r={};if(i)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(r[o.name]=(r[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(n&&o.matches&&o.matches(n)))if(o.type==="checkbox")i&&r[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let a=0;a<o.options.length;a++)o.options[a].selected&&l[o.name].push(o.options[a].value)}else if(i&&o.type==="hidden")l[o.name]=o.value;else if(i&&(o.type==="number"||o.type==="range")){const a=Number(o.value);l[o.name]=o.value===""||isNaN(a)?null:a}else l[o.name]=o.value}return l}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function I(e,t){const i=e.elements,n=[],l={};for(let s=0;s<i.length;s++){const r=i[s];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<i.length;s++){const r=i[s];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const c=r.getAttribute("data-ln-fill-as")||r.name;if(!c||!(c in t))continue;const o=t[c];if(r.type==="checkbox"){if(Array.isArray(o))r.checked=o.indexOf(r.value)!==-1;else if(l[r.name]>1){const a=String(o).split(",").map(function(u){return u.trim()});r.checked=a.indexOf(r.value)!==-1}else r.checked=te(o);n.push(r)}else if(r.type==="radio")r.checked=r.value===String(o),n.push(r);else if(r.type==="select-multiple"){if(Array.isArray(o))for(let a=0;a<r.options.length;a++)r.options[a].selected=o.indexOf(r.options[a].value)!==-1;n.push(r)}else r.value=o,r.tagName==="SELECT"&&o!=null&&r.setAttribute("data-ln-value",o),n.push(r)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=I,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Z);const D={};function ne(e,t){D[e]=t}function oe(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=oe);function re(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,b(function(){new MutationObserver(function(){Y(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function ie(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];F[i]=t}function le(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return F[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ie,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=re);const y={};function se(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=y[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function q(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let r=0;r<i.length;r++){const c=i[r],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const n=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<n.length;r++){const c=n[r],o=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<o.length;a++){const u=o[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const c=l[r],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const c=s[r],o=c.getAttribute("data-ln-class").split(",");for(let a=0;a<o.length;a++){const u=o[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function ce(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 i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<i.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[n],t??null),i[n].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)q(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function $(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const s=i.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,c){return t[c]!==void 0?t[c]:""}))}const n=function(s,r){return t[r]!==void 0?t[r]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const r=l[s],c=r.attributes;for(let o=0;o<c.length;o++){const a=c[o];a.value.indexOf("{{")!==-1&&r.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ae(e,t,i,n,l,s){const r={};for(let o=0;o<e.children.length;o++){const a=e.children[o],u=a.getAttribute("data-ln-render-key");u&&(r[u]=a)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const a=t[o],u=String(n(a));let d=r[u];if(d)l(d,a,o);else{const f=se(i,s);if(!f||($(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,a,o)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=q,window.lnCore.lnFill=ce,window.lnCore.renderList=ae);function m(e,t,i){const n=e.getAttribute(t);return n===null?i:n}function M(e,t,i){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?i:n}function R(e,t,i=!1){const n=e.getAttribute(t);if(n===null)return!!i;const l=n.trim().toLowerCase();return!(l==="false"||l==="0")}function N(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const A=new Map;function B(e,t){const i=(e?e.join("|"):"")+"::"+t;if(A.has(i))return A.get(i);const n=new Set(e||[]),l=function(s,r){const c=s.getAttribute(r);return c!==null&&n.has(c)?c:t};return A.set(i,l),l}function j(e,t,i){const n=parseFloat(e.getAttribute(t));return isNaN(n)?i:n}function U(e,t,i){const n=e.getAttribute(t);if(!n)return i;try{return JSON.parse(n)}catch{return i}}function W(e,t,i,n,l){if(!e||t===null)return!0;const s=n||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const c=o=>{l?console.warn(o,l):console.warn(o)};if(r==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${i}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${i}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function H(e,t,i){for(const n in i){const[l,s,r]=i[n];Object.defineProperty(e,n,{get:function(){return l(t,s,r)},enumerable:!0,configurable:!0})}return e}function V(e){const t={};for(const i in e){const n=e[i];if(!n||!n.prop)continue;let l=n.read;if(!l&&n.type)switch(n.type){case"enum":l=B(n.values,n.fallback);break;case"integer":l=M;break;case"float":l=j;break;case"boolean":l=R;break;case"list":l=N;break;case"json":l=U;break;case"string":default:l=m;break}l||(l=m),t[n.prop]=[l,i,n.fallback]}return t}function ue(e){const t={};for(const i in e){const n=e[i];n&&n.effect&&(t[i]=n.effect)}return Object.keys(t).length?t:null}function de(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=H,window.lnCore.attrSpec=V,window.lnCore.attrStr=m,window.lnCore.attrInt=M,window.lnCore.attrBool=R,window.lnCore.attrList=N,window.lnCore.attrEnum=B,window.lnCore.attrFloat=j,window.lnCore.attrJson=U);function h(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(i){console.error("["+t.attribute+"] init failed",e,i)}}}function P(e,t,i,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:i,ComponentFn:n};if(e.matches&&e.matches(s)&&h(e,r),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)h(c[o],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(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 Q(){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 he(e){const t=Q(),i=e.observed||[];for(let n=0;n<i.length;n++){const l=i[n];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const l=t.byDeclaredAttr.get(n);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=de(e);if(n===null)t.reactiveWildcard.push(e);else for(const l of n)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,i,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const r=s.effects&&s.effects[i];r?r(t,i,n):s.onAttrChange&&(!s.declared||s.declared.has(i))&&s.onAttrChange(t,i,n)}}function pe(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,n=Q(),l=n.byAttr.get(t),s=T()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!i&&!l&&!s)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(s&&C(r)){const c=n.byDeclaredAttr.get(t),o=r.getAttribute(t);for(let a=0;a<c.length;a++)W(c[a].spec,o,t,c[a].componentTag,r)}if(window.lnCore._debugSink&&(i||l)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),i){const c=n.byReactive.get(t);c&&J(c,r,t,e.oldValue),n.reactiveWildcard.length&&J(n.reactiveWildcard,r,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const o=l[c];if(o.handler){o.handler(r,t,e.oldValue);continue}o.onAttributeChange&&r[o.attribute]?o.onAttributeChange(r,t):(P(r,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(r))}}}function be(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,b(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{pe(t[i])}catch(n){console.error("[ln-core] mutation handler failed",t[i].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function v(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function _(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function me(e){const t=v();if(t.length){if(e.target)for(let i=0;i<t.length;i++){const n=t[i];if(n.onSubtreeChange&&n.query){const l=n.query,s=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;s&&n.onSubtreeChange(s,e)}}for(let i=0;i<e.addedNodes.length;i++){const n=e.addedNodes[i];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const r=t[s];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)n.matches&&n.matches(r.query)&&h(n,r);else if(n.matches&&n.matches(r.query)&&h(n,r),n.querySelectorAll){const c=n.querySelectorAll(r.query);for(let o=0;o<c.length;o++)h(c[o],r)}}r.onInit&&r.onInit(n)}}}for(let i=0;i<e.removedNodes.length;i++){const n=e.removedNodes[i];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const r=t[s],c=r.query;if(c){if(!l)n.matches&&n.matches(c)&&_(n,r);else if(n.matches&&n.matches(c)&&_(n,r),n.querySelectorAll){const o=n.querySelectorAll(c);for(let a=0;a<o.length;a++)_(o[a],r)}}}}}}}function K(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,b(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const n=t[i];if(n.type==="childList")try{me(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ge(e){v().push(e),K()}function z(e,t,i,n,l={}){const s=l.extraAttributes||[],r=l.onAttributeChange||null,c=l.onSubtreeChange||null,o=l.onInit||null,a=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?ue(d):u,Le=d?new Set(Object.keys(d)):null,Oe=l.persist||null;function g(S){const w=S||document.body;if(P(w,e,t,i),d&&T())for(const p in d){const De=d[p],E=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&E.push(w);for(let L=0;L<E.length;L++){const O=E[L];C(O)&&W(De,O.getAttribute(p),p,n,O)}}o&&o(w)}const k=[];if(e.indexOf("[")!==-1){const S=/\[([\w-]+)/g;let w;for(;(w=S.exec(e))!==null;)k.push(w[1])}else k.push(e);he({selector:e,attribute:t,componentTag:n,attributes:d,ComponentFn:i,onInit:o,observed:k.concat(s),onAttributeChange:r,onAttrChange:a,effects:f,declared:Le,persist:Oe}),be();const Te=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ie=l.subtreeQuery||(Te?e:"["+e+"]");v().push({selector:e,attribute:t,ComponentFn:i,onInit:o,onSubtreeChange:c,query:Ie}),K(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=z,window.lnCore.observeLifecycle=ge);function X(){fe()>0?we(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",X):X(),g}function G(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,i={},n=G(t);if(!n)return i;const l=n.split("&");for(let s=0;s<l.length;s++){const r=l[s];if(!r)continue;const c=r.indexOf(":"),o=c>-1?r.slice(0,c):r,a=c>-1?r.slice(c+1):"";if(o)try{i[o]=decodeURIComponent(a)}catch{i[o]=a}}return i}function Ce(e){if(!e)return null;const t=x();return e in t?t[e]:null}function ye(e,t){if(!e)return;const i=x();t==null?delete i[e]:i[e]=String(t);const l=Object.keys(i).map(function(s){const r=i[s];return r===""?s:s+":"+encodeURIComponent(r)}).join("&");G(location.hash)!==l&&(location.hash=l)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ve(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function _e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function xe(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 ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Se(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),n=e.slice(t+1),l=n?n.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:i,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=Ce,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=ve,window.lnCore.hashSortEncode=_e,window.lnCore.hashSortDecode=xe,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Se);function Ee(){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=Ee),(function(){const e="data-ln-form",t="lnForm";if(window[t]!==void 0)return;const i={"data-ln-form":{type:"marker",description:"Identifies the form element as an enhanced ln-form"},"data-ln-form-action-edit":{prop:"_actionEdit",type:"string",read:m,fallback:"",description:"URL template or endpoint used when editing an existing record"},"data-ln-form-action-method":{prop:"_actionMethod",type:"enum",values:["PUT","POST","PATCH"],fallback:"PUT",description:"HTTP method used when submitting edit action"}},n=V(i);function l(s){this.dom=s,H(this,s,n),this._baseAction=s.getAttribute("action")||"";const r=this;function c(){const a=r.dom.querySelectorAll('input[type="hidden"]:not([name="_method"])');for(let u=0;u<a.length;u++)a[u].hasAttribute("data-ln-initial-value")||a[u].setAttribute("data-ln-initial-value",a[u].getAttribute("value")||"")}function o(){const a=r.dom.querySelectorAll('input[type="hidden"]:not([name="_method"])');for(let u=0;u<a.length;u++)a[u].value=a[u].getAttribute("data-ln-initial-value")||""}return c(),this._onLnFill=function(a){a.target===r.dom&&(a.detail?(c(),r.fill(a.detail),r._applyActionMode(a.detail)):(r.dom.reset(),o()))},this._onReset=function(){r._applyActionMode(null),o()},s.addEventListener("ln-fill",this._onLnFill),s.addEventListener("reset",this._onReset),this}l.prototype.fill=function(s){const r=I(this.dom,s);for(let c=0;c<r.length;c++){const o=r[c],a=o.tagName==="SELECT"||o.type==="checkbox"||o.type==="radio";o.dispatchEvent(new Event(a?"change":"input",{bubbles:!0}))}},l.prototype._ensureMethodInput=function(){let s=this.dom.querySelector('input[name="_method"]');return s||(s=document.createElement("input"),s.type="hidden",s.name="_method",s.value="",this.dom.appendChild(s)),s},l.prototype._applyActionMode=function(s){if(!this.dom.hasAttribute("data-ln-form-action-edit"))return;const r=s&&s.id!=null&&s.id!==""?s.id:null,c=this._ensureMethodInput();if(r!==null){const o=this._actionEdit;o?this.dom.setAttribute("action",o.replace(":id",encodeURIComponent(r))):this.dom.setAttribute("action",this._baseAction.replace(/\/$/,"")+"/"+encodeURIComponent(r)),c.value=this._actionMethod||"PUT"}else this.dom.setAttribute("action",this._baseAction),c.value=""},l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-fill",this._onLnFill),this.dom.removeEventListener("reset",this._onReset),delete this.dom[t])},z(e,t,l,"ln-form",{attributes:i})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";(function(){const h="ln-icon-sprite",a="#ln-icon-",s="#ln-icon-custom-",d=new Set,l=new Set;let c=null;const y=(window.LN_ICON_CDN||"https://cdn.jsdelivr.net/npm/@tabler/icons@3.31.0/icons/outline").replace(/\/$/,""),g=(window.LN_ICON_CUSTOM_CDN||"").replace(/\/$/,""),u="lni:",m="lni:v",w="1";function v(){try{if(localStorage.getItem(m)!==w){for(let t=localStorage.length-1;t>=0;t--){const e=localStorage.key(t);e&&e.indexOf(u)===0&&localStorage.removeItem(e)}localStorage.setItem(m,w)}}catch{}}v();function N(){return c||(c=document.getElementById(h),c||(c=document.createElementNS("http://www.w3.org/2000/svg","svg"),c.id=h,c.setAttribute("hidden",""),c.setAttribute("aria-hidden","true"),c.appendChild(document.createElementNS("http://www.w3.org/2000/svg","defs")),document.body.insertBefore(c,document.body.firstChild))),c}function A(t){return t.indexOf(s)===0?g+"/"+t.slice(s.length)+".svg":y+"/"+t.slice(a.length)+".svg"}function S(t,e){const o=e.match(/viewBox="([^"]+)"/),n=o?o[1]:"0 0 24 24",i=e.match(/<svg[^>]*>([\s\S]*?)<\/svg>/i),I=i?i[1].trim():"",p=e.match(/<svg([^>]*)>/i),O=p?p[1]:"",r=document.createElementNS("http://www.w3.org/2000/svg","symbol");r.id=t,r.setAttribute("viewBox",n),["fill","stroke","stroke-width","stroke-linecap","stroke-linejoin"].forEach(function(_){const b=O.match(new RegExp(_+'="([^"]*)"'));b&&r.setAttribute(_,b[1])}),r.innerHTML=I,N().querySelector("defs").appendChild(r)}function f(t){if(d.has(t)||l.has(t))return;if(t.indexOf(s)===0&&!g){console.warn("[ln-icon] Custom icon requested but no CUSTOM_CDN configured:",t);return}const e=t.slice(1);try{const n=localStorage.getItem(u+e);if(n){S(e,n),d.add(t);return}}catch{}l.add(t);const o=A(t);fetch(o).then(function(n){if(!n.ok)throw new Error(n.status);return n.text()}).then(function(n){S(e,n),d.add(t),l.delete(t);try{localStorage.setItem(u+e,n)}catch{}}).catch(function(n){console.error("[ln-icon] Fetch failed for:",e,n),l.delete(t)})}function C(t){const e='use[href^="'+a+'"], use[href^="'+s+'"]',o=t.querySelectorAll?t.querySelectorAll(e):[];if(t.matches&&t.matches(e)){const n=t.getAttribute("href");n&&f(n)}Array.prototype.forEach.call(o,function(n){const i=n.getAttribute("href");i&&f(i)})}function E(){C(document),new MutationObserver(function(t){t.forEach(function(e){if(e.type==="childList")e.addedNodes.forEach(function(o){o.nodeType===1&&C(o)});else if(e.type==="attributes"&&e.attributeName==="href"){const o=e.target.getAttribute("href");o&&(o.indexOf(a)===0||o.indexOf(s)===0)&&f(o)}})}).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["href"]})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",E):E()})()})();
|
|
1
|
+
(function(){"use strict";function X(){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 E(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 n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!E(n))return}e.apply(console,t)}}function z(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function G(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Q(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(n&&o.matches&&o.matches(n)))if(o.type==="checkbox")r&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let a=0;a<o.options.length;a++)o.options[a].selected&&l[o.name].push(o.options[a].value)}else if(r&&o.type==="hidden")l[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const a=Number(o.value);l[o.name]=o.value===""||isNaN(a)?null:a}else l[o.name]=o.value}return l}function Y(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Z(e,t){const r=e.elements,n=[],l={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const o=t[c];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const a=String(o).split(",").map(function(d){return d.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=Y(o);n.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),n.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let a=0;a<i.options.length;a++)i.options[a].selected=o.indexOf(i.options[a].value)!==-1;n.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),n.push(i)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Z,window.lnCore.serializeForm=Q,window.lnCore.resolveFormMethod=G);const O={};function ee(e,t){O[e]=t}function te(e){return O[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ee,window.lnCore.getDataMapper=te);function ne(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){z(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const L={};function re(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];L[r]=t}function oe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return L[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=re,window.lnCore.getLocaleFallback=oe,window.lnCore.ensureLocaleObserver=ne);const A={};function ie(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=A[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const n=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<n.length;i++){const c=n[i],o=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<o.length;a++){const d=o[a].trim().split(":");if(d.length!==2)continue;const h=d[0].trim(),p=d[1].trim();t[p]!=null&&c.setAttribute(h,t[p])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],o=c.getAttribute("data-ln-class").split(",");for(let a=0;a<o.length;a++){const d=o[a].trim().split(":");if(d.length!==2)continue;const h=d[0].trim(),p=d[1].trim();p in t&&c.classList.toggle(h,!!t[p])}}return e}function le(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 r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<r.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[n],t??null),r[n].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)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function I(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const n=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let o=0;o<c.length;o++){const a=c[o];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function se(e,t,r,n,l,s){const i={};for(let o=0;o<e.children.length;o++){const a=e.children[o],d=a.getAttribute("data-ln-render-key");d&&(i[d]=a)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const a=t[o],d=String(n(a));let h=i[d];if(h)l(h,a,o);else{const p=ie(r,s);if(!p||(I(p,a),h=p.firstElementChild,!h))continue;h.setAttribute("data-ln-render-key",d),l(h,a,o)}c.appendChild(h)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=I,window.lnCore.fill=N,window.lnCore.lnFill=le,window.lnCore.renderList=se);function v(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function D(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function F(e,t,r=!1){const n=e.getAttribute(t);if(n===null)return!!r;const l=n.trim().toLowerCase();return!(l==="false"||l==="0")}function $(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const x=new Map;function q(e,t){const r=(e?e.join("|"):"")+"::"+t;if(x.has(r))return x.get(r);const n=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&n.has(c)?c:t};return x.set(r,l),l}function M(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function R(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function ce(e,t,r,n,l){if(!e||t===null)return!0;const s=n||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ae(e,t,r){for(const n in r){const[l,s,i]=r[n];Object.defineProperty(e,n,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function ue(e){const t={};for(const r in e){const n=e[r];if(!n||!n.prop)continue;let l=n.read;if(!l&&n.type)switch(n.type){case"enum":l=q(n.values,n.fallback);break;case"integer":l=D;break;case"float":l=M;break;case"boolean":l=F;break;case"list":l=$;break;case"json":l=R;break;case"string":default:l=v;break}l||(l=v),t[n.prop]=[l,r,n.fallback]}return t}function de(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ae,window.lnCore.attrSpec=ue,window.lnCore.attrStr=v,window.lnCore.attrInt=D,window.lnCore.attrBool=F,window.lnCore.attrList=$,window.lnCore.attrEnum=q,window.lnCore.attrFloat=M,window.lnCore.attrJson=R);function C(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(r){console.error("["+t.attribute+"] init failed",e,r)}}}function fe(e,t,r,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(s)&&C(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)C(c[o],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function B(){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 we(e){const t=B(),r=e.observed||[];for(let n=0;n<r.length;n++){const l=r[n];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const l=t.byDeclaredAttr.get(n);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=de(e);if(n===null)t.reactiveWildcard.push(e);else for(const l of n)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function T(e,t,r,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,n):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,n)}}function he(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=B(),l=n.byAttr.get(t),s=X()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&E(i)){const c=n.byDeclaredAttr.get(t),o=i.getAttribute(t);for(let a=0;a<c.length;a++)ce(c[a].spec,o,t,c[a].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=n.byReactive.get(t);c&&T(c,i,t,e.oldValue),n.reactiveWildcard.length&&T(n.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const o=l[c];if(o.handler){o.handler(i,t,e.oldValue);continue}o.onAttributeChange&&i[o.attribute]?o.onAttributeChange(i,t):(fe(i,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(i))}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{he(t[r])}catch(n){console.error("[ln-core] mutation handler failed",t[r].target,n)}}).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 S(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function be(e){const t=j();if(t.length){if(e.target)for(let r=0;r<t.length;r++){const n=t[r];if(n.onSubtreeChange&&n.query){const l=n.query,s=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;s&&n.onSubtreeChange(s,e)}}for(let r=0;r<e.addedNodes.length;r++){const n=e.addedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)n.matches&&n.matches(i.query)&&C(n,i);else if(n.matches&&n.matches(i.query)&&C(n,i),n.querySelectorAll){const c=n.querySelectorAll(i.query);for(let o=0;o<c.length;o++)C(c[o],i)}}i.onInit&&i.onInit(n)}}}for(let r=0;r<e.removedNodes.length;r++){const n=e.removedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s],c=i.query;if(c){if(!l)n.matches&&n.matches(c)&&S(n,i);else if(n.matches&&n.matches(c)&&S(n,i),n.querySelectorAll){const o=n.querySelectorAll(c);for(let a=0;a<o.length;a++)S(o[a],i)}}}}}}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{be(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function me(e,t){we({observed:e,handler:t}),pe()}function Ce(e){j().push(e),ge()}function W(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,r={},n=W(t);if(!n)return r;const l=n.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),o=c>-1?i.slice(0,c):i,a=c>-1?i.slice(c+1):"";if(o)try{r[o]=decodeURIComponent(a)}catch{r[o]=a}}return r}function ye(e){if(!e)return null;const t=_();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const r=_();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");W(location.hash)!==l&&(location.hash=l)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function xe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(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 ke(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ee(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),n=e.slice(t+1),l=n?n.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=ye,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=xe,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=ke,window.lnCore.hashFilterDecode=Ee);function Oe(){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=Oe),(function(){const e="ln-icon-sprite",t="#ln-icon-",r="#ln-icon-custom-",n=new Set,l=new Set;let s=null;const i=(window.LN_ICON_CDN||"https://cdn.jsdelivr.net/npm/@tabler/icons@3.31.0/icons/outline").replace(/\/$/,""),c=(window.LN_ICON_CUSTOM_CDN||"").replace(/\/$/,""),o="lni:",a="lni:v",d="1";function h(){try{if(localStorage.getItem(a)!==d){for(let u=localStorage.length-1;u>=0;u--){const w=localStorage.key(u);w&&w.indexOf(o)===0&&localStorage.removeItem(w)}localStorage.setItem(a,d)}}catch{}}h();function p(){return s||(s=document.getElementById(e),s||(s=document.createElementNS("http://www.w3.org/2000/svg","svg"),s.id=e,s.setAttribute("hidden",""),s.setAttribute("aria-hidden","true"),s.appendChild(document.createElementNS("http://www.w3.org/2000/svg","defs")),document.body.insertBefore(s,document.body.firstChild))),s}function Le(u){return u.indexOf(r)===0?c+"/"+u.slice(r.length)+".svg":i+"/"+u.slice(t.length)+".svg"}function V(u,w){const b=w.match(/viewBox="([^"]+)"/),f=b?b[1]:"0 0 24 24",g=w.match(/<svg[^>]*>([\s\S]*?)<\/svg>/i),Ne=g?g[1].trim():"",K=w.match(/<svg([^>]*)>/i),Ie=K?K[1]:"",y=document.createElementNS("http://www.w3.org/2000/svg","symbol");y.id=u,y.setAttribute("viewBox",f),["fill","stroke","stroke-width","stroke-linecap","stroke-linejoin"].forEach(function(P){const J=Ie.match(new RegExp(P+'="([^"]*)"'));J&&y.setAttribute(P,J[1])}),y.innerHTML=Ne,p().querySelector("defs").appendChild(y)}function k(u){if(n.has(u)||l.has(u))return;if(u.indexOf(r)===0&&!c){console.warn("[ln-icon] Custom icon requested but no CUSTOM_CDN configured:",u);return}const w=u.slice(1);try{const f=localStorage.getItem(o+w);if(f){V(w,f),n.add(u);return}}catch{}l.add(u);const b=Le(u);fetch(b).then(function(f){if(!f.ok)throw new Error(f.status);return f.text()}).then(function(f){V(w,f),n.add(u),l.delete(u);try{localStorage.setItem(o+w,f)}catch{}}).catch(function(f){console.error("[ln-icon] Fetch failed for:",w,f),l.delete(u)})}function U(u){const w='use[href^="'+t+'"], use[href^="'+r+'"]',b=u.querySelectorAll?u.querySelectorAll(w):[];if(u.matches&&u.matches(w)){const f=u.getAttribute("href");f&&k(f)}Array.prototype.forEach.call(b,function(f){const g=f.getAttribute("href");g&&k(g)})}function H(){U(document),m(function(){Ce({onInit:function(u){U(u)}}),me(["href"],function(u){if((u.tagName?u.tagName.toLowerCase():"")==="use"){const b=u.getAttribute("href");b&&(b.indexOf(t)===0||b.indexOf(r)===0)&&k(b)}})},"ln-icon")}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",H):H()})()})();
|