@livenetworks/ashlar 2.0.7 → 2.0.9
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/LICENSE +641 -641
- package/components/COMPONENTS.md +1116 -1116
- package/components/index.js +81 -81
- package/components/ln-accordion/ln-accordion-dev.scss +8 -8
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-accordion/ln-accordion.schema.json +30 -30
- package/components/ln-ajax/ln-ajax-dev.scss +8 -8
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-ajax/ln-ajax.schema.json +30 -30
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-connector/ln-api-connector.schema.json +9 -0
- package/components/ln-api-connector/src/ln-api-connector.js +2 -0
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-api-queue/ln-api-queue.schema.json +34 -34
- package/components/ln-api-queue/src/ln-api-queue.js +3 -13
- package/components/ln-autoresize/ln-autoresize-dev.scss +8 -8
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autoresize/ln-autoresize.schema.json +22 -22
- package/components/ln-autosave/ln-autosave-dev.scss +13 -13
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-autosave/ln-autosave.schema.json +48 -48
- package/components/ln-autosave/src/autosave-model.js +34 -34
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-chart/ln-chart.schema.json +146 -146
- package/components/ln-chart/src/chart-model.js +154 -154
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.schema.json +42 -42
- package/components/ln-confirm/ln-confirm-dev.scss +24 -24
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-confirm/ln-confirm.schema.json +66 -66
- package/components/ln-confirm/src/ln-confirm.js +178 -178
- package/components/ln-core/attrs.js +13 -0
- package/components/ln-core/crypto.js +286 -265
- package/components/ln-core/dom.js +115 -115
- package/components/ln-core/form.js +146 -136
- package/components/ln-core/helpers.js +33 -33
- package/components/ln-core/http.js +48 -48
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +5 -0
- package/components/ln-core/ln-core.schema.json +3 -2
- package/components/ln-core/locale.js +55 -55
- package/components/ln-core/matching.js +78 -78
- package/components/ln-core/number.js +125 -125
- package/components/ln-core/template.js +206 -206
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-couchdb-connector/ln-couchdb-connector.schema.json +50 -50
- package/components/ln-couchdb-connector/src/ln-couchdb-connector.js +1 -0
- package/components/ln-data-coordinator/README.md +9 -38
- package/components/ln-data-coordinator/ln-data-coordinator-dev.scss +8 -8
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.schema.json +16 -16
- package/components/ln-data-coordinator/src/data-read-policy.js +0 -7
- package/components/ln-data-coordinator/src/ln-data-coordinator.js +432 -1308
- package/components/ln-data-store/ln-data-store-dev.scss +13 -13
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-data-store/ln-data-store.schema.json +84 -84
- package/components/ln-data-store/src/data-store-model.js +184 -184
- package/components/ln-data-store/src/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-date/ln-date.schema.json +92 -92
- package/components/ln-date/src/date-model.js +186 -186
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/ln-debug.schema.json +28 -28
- package/components/ln-debug/src/console-sink.js +19 -19
- package/components/ln-debug/src/gate.js +95 -95
- package/components/ln-debug/src/generated-attributes.js +4 -2
- package/components/ln-dropdown/ln-dropdown-dev.scss +13 -13
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-editor/ln-editor.schema.json +58 -58
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/ln-external-links.schema.json +18 -18
- package/components/ln-fill/ln-fill.js +1 -1
- package/components/ln-fill/ln-fill.schema.json +23 -23
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +153 -153
- package/components/ln-filter/src/filter-model.js +185 -185
- package/components/ln-form/ln-form-dev.scss +8 -8
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-form/ln-form.schema.json +6 -0
- package/components/ln-form/src/ln-form.js +21 -0
- package/components/ln-http/ln-http.js +1 -1
- package/components/ln-http/ln-http.schema.json +6 -6
- package/components/ln-icon/ln-icon.schema.json +6 -6
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-include/ln-include.schema.json +23 -23
- package/components/ln-key/ln-key-dev.scss +18 -18
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-key/ln-key.schema.json +56 -56
- package/components/ln-key/src/ln-key.js +10 -10
- package/components/ln-link/ln-link-dev.scss +8 -8
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-link/ln-link.schema.json +22 -22
- package/components/ln-list/README.md +152 -152
- package/components/ln-list/ln-list-dev.scss +8 -8
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-list/ln-list.schema.json +166 -166
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-modal/ln-modal.schema.json +65 -65
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-nav/ln-nav.schema.json +25 -25
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-number/ln-number.schema.json +63 -63
- package/components/ln-number/src/ln-number.js +26 -0
- package/components/ln-number/src/number-model.js +31 -31
- package/components/ln-obfuscator/README.md +60 -60
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.schema.json +49 -49
- package/components/ln-obfuscator/src/ln-obfuscator.js +159 -159
- package/components/ln-obfuscator/src/obfuscator-model.js +250 -250
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-options/ln-options.schema.json +6 -0
- package/components/ln-options/src/ln-options.js +4 -4
- package/components/ln-persist/README.md +151 -151
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-persist/ln-persist.schema.json +28 -28
- package/components/ln-persist/src/ln-persist.js +83 -83
- package/components/ln-picklist/README.md +230 -230
- package/components/ln-picklist/ln-picklist-dev.scss +22 -22
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-picklist/ln-picklist.schema.json +49 -49
- package/components/ln-picklist/src/ln-picklist.js +228 -228
- package/components/ln-popover/ln-popover-dev.scss +13 -13
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-popover/ln-popover.schema.json +82 -82
- package/components/ln-progress/ln-progress-dev.scss +8 -8
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-progress/ln-progress.schema.json +40 -40
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-router/ln-router.schema.json +76 -76
- package/components/ln-scroll/README.md +45 -45
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-scroll/ln-scroll.schema.json +85 -85
- package/components/ln-scroll/src/ln-scroll.js +150 -150
- package/components/ln-search/README.md +188 -188
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-search/ln-search.schema.json +103 -103
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-slug/ln-slug.schema.json +23 -23
- package/components/ln-slug/src/ln-slug.js +25 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sort/ln-sort.schema.json +104 -104
- package/components/ln-sort/src/ln-sort.js +321 -321
- package/components/ln-sort/src/sort-model.js +117 -117
- package/components/ln-sortable/ln-sortable-dev.scss +13 -13
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-sortable/ln-sortable.schema.json +36 -36
- package/components/ln-stat/ln-stat-dev.scss +8 -8
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-stat/ln-stat.schema.json +32 -32
- package/components/ln-stat/src/stat-model.js +28 -28
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table/ln-table.schema.json +211 -211
- package/components/ln-table/src/table-model.js +98 -98
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.schema.json +93 -93
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-tabs/ln-tabs.schema.json +75 -75
- package/components/ln-tabs/src/ln-tabs.js +208 -208
- package/components/ln-tabs/src/tabs-model.js +82 -82
- package/components/ln-time/ln-time-dev.scss +13 -13
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-time/ln-time.schema.json +38 -38
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toast/ln-toast.schema.json +65 -65
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-toggle/ln-toggle.schema.json +52 -52
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-tooltip/ln-tooltip.schema.json +86 -86
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-translations/ln-translations.schema.json +120 -120
- package/components/ln-ui-coordinator/README.md +62 -62
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.schema.json +28 -28
- package/components/ln-ui-coordinator/src/ln-ui-coordinator.js +140 -140
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-upload/ln-upload.schema.json +193 -193
- package/components/ln-upload/src/upload-model.js +78 -78
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-validate/ln-validate.schema.json +50 -50
- package/components/ln-validate/src/validate-model.js +64 -64
- package/components/ln-websocket-connector/README.md +166 -166
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.schema.json +29 -29
- package/components/ln-websocket-connector/src/ln-websocket-connector.js +283 -279
- package/ln-ashlar.html-data.json +15 -8
- package/package.json +85 -84
- package/theme/brand.css +73 -73
- package/theme/components/_confirm.scss +6 -6
- package/theme/components/_picklist.scss +3 -3
- package/theme/config/_palette.scss +274 -274
- package/theme/config/_theme.scss +292 -292
- package/theme/config/_tokens.scss +285 -285
- package/theme/config/mixins/_index.scss +62 -62
- package/theme/config/mixins/_picklist.scss +66 -66
- package/theme/ln-ashlar-dev.scss +66 -66
- package/theme/ln-ashlar-landing.scss +56 -56
- package/theme/ln-ashlar-theme.scss +63 -63
- package/theme/presentation/_bento.scss +151 -151
- package/theme/presentation/_cta.scss +111 -111
- package/theme/presentation/_effects.scss +216 -216
- package/theme/presentation/_features.scss +108 -108
- package/theme/presentation/_footer.scss +129 -129
- package/theme/presentation/_hero.scss +158 -158
- package/theme/presentation/_layout.scss +170 -170
- package/theme/presentation/_navbar.scss +140 -140
- package/theme/presentation/_pricing.scss +262 -262
- package/theme/presentation/_stats.scss +87 -87
- package/theme/presentation/_testimonials.scss +124 -124
- package/theme/presentation/_tokens.scss +39 -39
- package/theme/presentation/_typography.scss +163 -163
- package/web-types.json +26 -12
|
@@ -1,63 +1,63 @@
|
|
|
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-number",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-debug": {
|
|
7
|
-
"direction": null,
|
|
8
|
-
"sources": [
|
|
9
|
-
"ln-number-dev.scss"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"data-ln-fill-as": {
|
|
13
|
-
"direction": "both",
|
|
14
|
-
"sources": [
|
|
15
|
-
"src/ln-number.js"
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
|
-
"data-ln-number": {
|
|
19
|
-
"direction": "author",
|
|
20
|
-
"sources": [
|
|
21
|
-
"ln-number-dev.scss",
|
|
22
|
-
"src/ln-number.js"
|
|
23
|
-
],
|
|
24
|
-
"type": "marker",
|
|
25
|
-
"description": "Activates localized number formatting on input or text element"
|
|
26
|
-
},
|
|
27
|
-
"data-ln-number-decimals": {
|
|
28
|
-
"direction": "author",
|
|
29
|
-
"sources": [
|
|
30
|
-
"src/ln-number.js"
|
|
31
|
-
],
|
|
32
|
-
"type": "integer",
|
|
33
|
-
"fallback": 0,
|
|
34
|
-
"min": 0,
|
|
35
|
-
"max": 20,
|
|
36
|
-
"description": "Number of decimal fraction digits"
|
|
37
|
-
},
|
|
38
|
-
"data-ln-number-max": {
|
|
39
|
-
"direction": "author",
|
|
40
|
-
"sources": [
|
|
41
|
-
"src/ln-number.js"
|
|
42
|
-
],
|
|
43
|
-
"type": "float",
|
|
44
|
-
"description": "Maximum allowed numeric value"
|
|
45
|
-
},
|
|
46
|
-
"data-ln-number-min": {
|
|
47
|
-
"direction": null,
|
|
48
|
-
"sources": [
|
|
49
|
-
"src/ln-number.js"
|
|
50
|
-
],
|
|
51
|
-
"type": "float",
|
|
52
|
-
"description": "Minimum allowed numeric value"
|
|
53
|
-
},
|
|
54
|
-
"data-ln-value": {
|
|
55
|
-
"direction": "both",
|
|
56
|
-
"sources": [
|
|
57
|
-
"src/ln-number.js"
|
|
58
|
-
],
|
|
59
|
-
"type": "float",
|
|
60
|
-
"description": "Raw unformatted numeric value"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
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-number",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-debug": {
|
|
7
|
+
"direction": null,
|
|
8
|
+
"sources": [
|
|
9
|
+
"ln-number-dev.scss"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-fill-as": {
|
|
13
|
+
"direction": "both",
|
|
14
|
+
"sources": [
|
|
15
|
+
"src/ln-number.js"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"data-ln-number": {
|
|
19
|
+
"direction": "author",
|
|
20
|
+
"sources": [
|
|
21
|
+
"ln-number-dev.scss",
|
|
22
|
+
"src/ln-number.js"
|
|
23
|
+
],
|
|
24
|
+
"type": "marker",
|
|
25
|
+
"description": "Activates localized number formatting on input or text element"
|
|
26
|
+
},
|
|
27
|
+
"data-ln-number-decimals": {
|
|
28
|
+
"direction": "author",
|
|
29
|
+
"sources": [
|
|
30
|
+
"src/ln-number.js"
|
|
31
|
+
],
|
|
32
|
+
"type": "integer",
|
|
33
|
+
"fallback": 0,
|
|
34
|
+
"min": 0,
|
|
35
|
+
"max": 20,
|
|
36
|
+
"description": "Number of decimal fraction digits"
|
|
37
|
+
},
|
|
38
|
+
"data-ln-number-max": {
|
|
39
|
+
"direction": "author",
|
|
40
|
+
"sources": [
|
|
41
|
+
"src/ln-number.js"
|
|
42
|
+
],
|
|
43
|
+
"type": "float",
|
|
44
|
+
"description": "Maximum allowed numeric value"
|
|
45
|
+
},
|
|
46
|
+
"data-ln-number-min": {
|
|
47
|
+
"direction": null,
|
|
48
|
+
"sources": [
|
|
49
|
+
"src/ln-number.js"
|
|
50
|
+
],
|
|
51
|
+
"type": "float",
|
|
52
|
+
"description": "Minimum allowed numeric value"
|
|
53
|
+
},
|
|
54
|
+
"data-ln-value": {
|
|
55
|
+
"direction": "both",
|
|
56
|
+
"sources": [
|
|
57
|
+
"src/ln-number.js"
|
|
58
|
+
],
|
|
59
|
+
"type": "float",
|
|
60
|
+
"description": "Raw unformatted numeric value"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -158,6 +158,29 @@ import { calculateCursorPosition } from './number-model.js';
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
// ── Form reset listener ───────────────────────────
|
|
162
|
+
if (dom.form) {
|
|
163
|
+
this._onFormReset = function () {
|
|
164
|
+
setTimeout(function () {
|
|
165
|
+
const def = dom.defaultValue;
|
|
166
|
+
if (def !== '') {
|
|
167
|
+
const num = parseFloat(def);
|
|
168
|
+
if (!isNaN(num)) {
|
|
169
|
+
const maxDecimals = dom.getAttribute('data-ln-number-decimals');
|
|
170
|
+
self._setHiddenRaw(num);
|
|
171
|
+
self._setDisplayRaw(formatNumber(num, getLocale(dom), { maxDecimals }));
|
|
172
|
+
dom.dispatchEvent(new Event('input', { bubbles: true }));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
self._setHiddenRaw('');
|
|
177
|
+
self._setDisplayRaw('');
|
|
178
|
+
dom.dispatchEvent(new Event('input', { bubbles: true }));
|
|
179
|
+
}, 0);
|
|
180
|
+
};
|
|
181
|
+
dom.form.addEventListener('reset', this._onFormReset);
|
|
182
|
+
}
|
|
183
|
+
|
|
161
184
|
return this;
|
|
162
185
|
}
|
|
163
186
|
|
|
@@ -377,6 +400,9 @@ import { calculateCursorPosition } from './number-model.js';
|
|
|
377
400
|
document.removeEventListener('ln-core:locale-change', this._onLocaleChange);
|
|
378
401
|
}
|
|
379
402
|
if (!this.isTextElement) {
|
|
403
|
+
if (this._onFormReset && this.dom.form) {
|
|
404
|
+
this.dom.form.removeEventListener('reset', this._onFormReset);
|
|
405
|
+
}
|
|
380
406
|
this.dom.removeEventListener('input', this._onInput);
|
|
381
407
|
this.dom.removeEventListener('keydown', this._onKeyDown);
|
|
382
408
|
this.dom.removeEventListener('paste', this._onPaste);
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Re-map the cursor position in the formatted string based on digits
|
|
3
|
-
* that were present before the cursor prior to formatting.
|
|
4
|
-
*
|
|
5
|
-
* @param {string} formattedStr Formatted string to place cursor into
|
|
6
|
-
* @param {number} digitsBeforeCursor Count of digits preceding the cursor in the unformatted input
|
|
7
|
-
* @returns {number} Index in formattedStr where cursor should be positioned
|
|
8
|
-
*/
|
|
9
|
-
export function calculateCursorPosition(formattedStr, digitsBeforeCursor) {
|
|
10
|
-
if (!formattedStr) return 0;
|
|
11
|
-
if (digitsBeforeCursor <= 0) {
|
|
12
|
-
// If input starts with a negative sign or empty, position at first position
|
|
13
|
-
return formattedStr.startsWith('-') ? 1 : 0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let targetDigits = digitsBeforeCursor;
|
|
17
|
-
let newPos = 0;
|
|
18
|
-
|
|
19
|
-
for (let i = 0; i < formattedStr.length && targetDigits > 0; i++) {
|
|
20
|
-
newPos = i + 1;
|
|
21
|
-
if (/[0-9]/.test(formattedStr[i])) {
|
|
22
|
-
targetDigits--;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (targetDigits > 0) {
|
|
27
|
-
newPos = formattedStr.length;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return newPos;
|
|
31
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Re-map the cursor position in the formatted string based on digits
|
|
3
|
+
* that were present before the cursor prior to formatting.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} formattedStr Formatted string to place cursor into
|
|
6
|
+
* @param {number} digitsBeforeCursor Count of digits preceding the cursor in the unformatted input
|
|
7
|
+
* @returns {number} Index in formattedStr where cursor should be positioned
|
|
8
|
+
*/
|
|
9
|
+
export function calculateCursorPosition(formattedStr, digitsBeforeCursor) {
|
|
10
|
+
if (!formattedStr) return 0;
|
|
11
|
+
if (digitsBeforeCursor <= 0) {
|
|
12
|
+
// If input starts with a negative sign or empty, position at first position
|
|
13
|
+
return formattedStr.startsWith('-') ? 1 : 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let targetDigits = digitsBeforeCursor;
|
|
17
|
+
let newPos = 0;
|
|
18
|
+
|
|
19
|
+
for (let i = 0; i < formattedStr.length && targetDigits > 0; i++) {
|
|
20
|
+
newPos = i + 1;
|
|
21
|
+
if (/[0-9]/.test(formattedStr[i])) {
|
|
22
|
+
targetDigits--;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (targetDigits > 0) {
|
|
27
|
+
newPos = formattedStr.length;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return newPos;
|
|
31
|
+
}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
# ln-obfuscator
|
|
2
|
-
|
|
3
|
-
> Binds to any DOM element carrying `data-ln-obfuscator` (`<span>`, `<p>`, `<a>`, headings, table cells) and automatically deobfuscates its text nodes and `href` attributes at runtime.
|
|
4
|
-
> Operates with zero configuration using ROT13 as default, and supports universal Base64 and XOR ciphers via optional attributes for international scripts (Cyrillic, CJK, etc.) while maintaining an internal idempotency guard without DOM pollution.
|
|
5
|
-
|
|
6
|
-
## Markup anatomy
|
|
7
|
-
|
|
8
|
-
### 1. Default ROT Caesar (Letters & Digits)
|
|
9
|
-
|
|
10
|
-
```html
|
|
11
|
-
<!-- Authored HTML (Obfuscated) -->
|
|
12
|
-
<span data-ln-obfuscator>Uryyb Jbeyq!</span>
|
|
13
|
-
<a data-ln-obfuscator href="znvygb:pbagnpg@rknzcyr.pbz">pbagnpg@rknzcyr.pbz</a>
|
|
14
|
-
<a data-ln-obfuscator="5" href="yjc:+834-25-678-901">+834-25-678-901</a>
|
|
15
|
-
|
|
16
|
-
<!-- Runtime result (Deobfuscated) -->
|
|
17
|
-
<span data-ln-obfuscator>Hello World!</span>
|
|
18
|
-
<a data-ln-obfuscator href="mailto:contact@example.com">contact@example.com</a>
|
|
19
|
-
<a data-ln-obfuscator="5" href="tel:+389-70-123-456">+389-70-123-456</a>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### 2. Universal Base64 & XOR (Unicode & International Scripts)
|
|
23
|
-
|
|
24
|
-
```html
|
|
25
|
-
<!-- Base64 Codec (Unicode / UTF-8 safe) -->
|
|
26
|
-
<span data-ln-obfuscator data-ln-obfuscator-codec="base64">VW5pY29kZSBOb3RlOiBjb250YWN0QGV4YW1wbGUuY29tIChUZWw6ICsxLTgwMC01NTUtMDE5OSk=</span>
|
|
27
|
-
<!-- Runtime: "Unicode Note: contact@example.com (Tel: +1-800-555-0199)" -->
|
|
28
|
-
|
|
29
|
-
<!-- XOR Codec with Custom Key -->
|
|
30
|
-
<span data-ln-obfuscator data-ln-obfuscator-codec="xor" data-ln-obfuscator-key="secret-key">MAoNFAwQSAUREBIJWVIGG0MfBBoHJQYKBBldBwBXEAoOUk0gSAdfWVhUTkpVRABeUExeVVJLXF0=</span>
|
|
31
|
-
<!-- Runtime: "Confidential: contact@example.com (Tel: +1-800-555-0199)" -->
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Attribute contract
|
|
35
|
-
|
|
36
|
-
| Attribute | Role | Default | Description |
|
|
37
|
-
|---|---|---|---|
|
|
38
|
-
| `data-ln-obfuscator` | Selector & Shift | `13` | Triggers deobfuscation. Optional integer sets ROT shift offset. Default is ROT13. |
|
|
39
|
-
| `data-ln-obfuscator-codec` | Codec mode | `rot` | Encryption/encoding mode: `'rot'` (default), `'base64'`, or `'xor'`. |
|
|
40
|
-
| `data-ln-obfuscator-key` | XOR key | `'ln-ashlar'` | Secret key for `'xor'` codec. Automatically activates XOR codec when provided. |
|
|
41
|
-
|
|
42
|
-
## Events API
|
|
43
|
-
|
|
44
|
-
- `ln-obfuscator:deobfuscated`: Dispatched on the target element with `{ target, codec, shift, key }` upon deobfuscation.
|
|
45
|
-
|
|
46
|
-
## JavaScript API
|
|
47
|
-
|
|
48
|
-
```javascript
|
|
49
|
-
// Scan DOM for uninitialized obfuscated elements
|
|
50
|
-
window.lnObfuscator(document.body);
|
|
51
|
-
|
|
52
|
-
// Pure cipher utilities
|
|
53
|
-
const rot = window.lnObfuscator.obfuscate('contact@example.com', 13);
|
|
54
|
-
const b64 = window.lnObfuscator.obfuscate('Contact: info@example.com', { codec: 'base64' });
|
|
55
|
-
const xor = window.lnObfuscator.obfuscate('Confidential: info@example.com', { codec: 'xor', key: 'secret-key' });
|
|
56
|
-
|
|
57
|
-
window.lnObfuscator.deobfuscate(rot, 13);
|
|
58
|
-
window.lnObfuscator.deobfuscate(b64, { codec: 'base64' });
|
|
59
|
-
window.lnObfuscator.deobfuscate(xor, { codec: 'xor', key: 'secret-key' });
|
|
60
|
-
```
|
|
1
|
+
# ln-obfuscator
|
|
2
|
+
|
|
3
|
+
> Binds to any DOM element carrying `data-ln-obfuscator` (`<span>`, `<p>`, `<a>`, headings, table cells) and automatically deobfuscates its text nodes and `href` attributes at runtime.
|
|
4
|
+
> Operates with zero configuration using ROT13 as default, and supports universal Base64 and XOR ciphers via optional attributes for international scripts (Cyrillic, CJK, etc.) while maintaining an internal idempotency guard without DOM pollution.
|
|
5
|
+
|
|
6
|
+
## Markup anatomy
|
|
7
|
+
|
|
8
|
+
### 1. Default ROT Caesar (Letters & Digits)
|
|
9
|
+
|
|
10
|
+
```html
|
|
11
|
+
<!-- Authored HTML (Obfuscated) -->
|
|
12
|
+
<span data-ln-obfuscator>Uryyb Jbeyq!</span>
|
|
13
|
+
<a data-ln-obfuscator href="znvygb:pbagnpg@rknzcyr.pbz">pbagnpg@rknzcyr.pbz</a>
|
|
14
|
+
<a data-ln-obfuscator="5" href="yjc:+834-25-678-901">+834-25-678-901</a>
|
|
15
|
+
|
|
16
|
+
<!-- Runtime result (Deobfuscated) -->
|
|
17
|
+
<span data-ln-obfuscator>Hello World!</span>
|
|
18
|
+
<a data-ln-obfuscator href="mailto:contact@example.com">contact@example.com</a>
|
|
19
|
+
<a data-ln-obfuscator="5" href="tel:+389-70-123-456">+389-70-123-456</a>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 2. Universal Base64 & XOR (Unicode & International Scripts)
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
<!-- Base64 Codec (Unicode / UTF-8 safe) -->
|
|
26
|
+
<span data-ln-obfuscator data-ln-obfuscator-codec="base64">VW5pY29kZSBOb3RlOiBjb250YWN0QGV4YW1wbGUuY29tIChUZWw6ICsxLTgwMC01NTUtMDE5OSk=</span>
|
|
27
|
+
<!-- Runtime: "Unicode Note: contact@example.com (Tel: +1-800-555-0199)" -->
|
|
28
|
+
|
|
29
|
+
<!-- XOR Codec with Custom Key -->
|
|
30
|
+
<span data-ln-obfuscator data-ln-obfuscator-codec="xor" data-ln-obfuscator-key="secret-key">MAoNFAwQSAUREBIJWVIGG0MfBBoHJQYKBBldBwBXEAoOUk0gSAdfWVhUTkpVRABeUExeVVJLXF0=</span>
|
|
31
|
+
<!-- Runtime: "Confidential: contact@example.com (Tel: +1-800-555-0199)" -->
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Attribute contract
|
|
35
|
+
|
|
36
|
+
| Attribute | Role | Default | Description |
|
|
37
|
+
|---|---|---|---|
|
|
38
|
+
| `data-ln-obfuscator` | Selector & Shift | `13` | Triggers deobfuscation. Optional integer sets ROT shift offset. Default is ROT13. |
|
|
39
|
+
| `data-ln-obfuscator-codec` | Codec mode | `rot` | Encryption/encoding mode: `'rot'` (default), `'base64'`, or `'xor'`. |
|
|
40
|
+
| `data-ln-obfuscator-key` | XOR key | `'ln-ashlar'` | Secret key for `'xor'` codec. Automatically activates XOR codec when provided. |
|
|
41
|
+
|
|
42
|
+
## Events API
|
|
43
|
+
|
|
44
|
+
- `ln-obfuscator:deobfuscated`: Dispatched on the target element with `{ target, codec, shift, key }` upon deobfuscation.
|
|
45
|
+
|
|
46
|
+
## JavaScript API
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
// Scan DOM for uninitialized obfuscated elements
|
|
50
|
+
window.lnObfuscator(document.body);
|
|
51
|
+
|
|
52
|
+
// Pure cipher utilities
|
|
53
|
+
const rot = window.lnObfuscator.obfuscate('contact@example.com', 13);
|
|
54
|
+
const b64 = window.lnObfuscator.obfuscate('Contact: info@example.com', { codec: 'base64' });
|
|
55
|
+
const xor = window.lnObfuscator.obfuscate('Confidential: info@example.com', { codec: 'xor', key: 'secret-key' });
|
|
56
|
+
|
|
57
|
+
window.lnObfuscator.deobfuscate(rot, 13);
|
|
58
|
+
window.lnObfuscator.deobfuscate(b64, { codec: 'base64' });
|
|
59
|
+
window.lnObfuscator.deobfuscate(xor, { codec: 'xor', key: 'secret-key' });
|
|
60
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function B(){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){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 i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!_(r))return}e.apply(console,t)}}function L(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 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()}const D={};function z(e,t){D[e]=t}function G(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=z,window.lnCore.getDataMapper=G);function Z(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function Y(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function ee(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Y,window.lnCore.getLocaleFallback=ee,window.lnCore.ensureLocaleObserver=Z);const k={};function te(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=k[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function I(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const f=n[o],s=f.getAttribute("data-ln-field");t[s]!=null&&(f.textContent=t[s])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const f=r[o],s=f.getAttribute("data-ln-attr").split(",");for(let c=0;c<s.length;c++){const d=s[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),h=d[1].trim();t[h]!=null&&f.setAttribute(u,t[h])}}const i=e.querySelectorAll("[data-ln-show]");for(let o=0;o<i.length;o++){const f=i[o],s=f.getAttribute("data-ln-show");s in t&&f.classList.toggle("hidden",!t[s])}const l=e.querySelectorAll("[data-ln-class]");for(let o=0;o<l.length;o++){const f=l[o],s=f.getAttribute("data-ln-class").split(",");for(let c=0;c<s.length;c++){const d=s[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),h=d[1].trim();h in t&&f.classList.toggle(u,!!t[h])}}return e}function ne(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)I(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 R(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const l=n.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,f){return t[f]!==void 0?t[f]:""}))}const r=function(l,o){return t[o]!==void 0?t[o]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const o=i[l],f=o.attributes;for(let s=0;s<f.length;s++){const c=f[s];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function re(e,t,n,r,i,l){const o={};for(let s=0;s<e.children.length;s++){const c=e.children[s],d=c.getAttribute("data-ln-render-key");d&&(o[d]=c)}const f=document.createDocumentFragment();for(let s=0;s<t.length;s++){const c=t[s],d=String(r(c));let u=o[d];if(u)i(u,c,s);else{const h=te(n,l);if(!h||(R(h,c),u=h.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),i(u,c,s)}f.appendChild(u)}e.textContent="",e.appendChild(f)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=I,window.lnCore.lnFill=ne,window.lnCore.renderList=re);function F(e,t,n,r,i){if(!e||t===null)return!0;const l=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const f=s=>{i?console.warn(s,i):console.warn(s)};if(o==="boolean"){const s=t.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(f(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const s=e.values||[];return s.includes(t)?!0:(f(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${s.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return f(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const s=parseInt(t,10);return e.min!==void 0&&s<e.min?(f(`[${l}] Value ${s} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&s>e.max?(f(`[${l}] Value ${s} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(f(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(s){return f(`[${l}] Invalid JSON for attribute "${n}": ${s.message}. Fallback: ${e.fallback}.`),!1}return!0}function oe(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 ie(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}function S(e,t,n,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(l));e.matches&&e.matches(l)&&o.push(e);for(const f of o)if(!f[n]){window.lnCore._persistSink&&f.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(f,t);try{f[n]=new r(f)}catch(s){console.error("["+n+"] init failed",f,s)}}}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 se(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 fe(e){const t=q(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).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 i=t.byDeclaredAttr.get(r);i.some(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ie(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function H(e,t,n,r){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const o=l.effects&&l.effects[n];o?o(t,n,r):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(t,n,r)}}function ce(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=q(),i=r.byAttr.get(n);if(B()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&_(t)){const l=r.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let f=0;f<l.length;f++)F(l[f].spec,o,n,l[f].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const l=r.byReactive.get(n);l&&H(l,t,n,e.oldValue),r.reactiveWildcard.length&&H(r.reactiveWildcard,t,n,e.oldValue)}if(i)for(let l=0;l<i.length;l++){const o=i[l];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(S(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function ue(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ce(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 M(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function de(e){const t=M();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.query,l=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;l&&r.onSubtreeChange(l,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const l=t[i];S(r,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const l=t[i],o=l.query,f=Array.from(r.querySelectorAll(o));r.matches&&r.matches(o)&&f.push(r);for(let s=0;s<f.length;s++){const c=f[s];if(!document.contains(c)){const d=c[l.attribute];if(d&&typeof d.destroy=="function")try{d.destroy()}catch(u){console.error("["+l.attribute+"] destroy failed",c,u)}delete c[l.attribute]}}}}}}function ae(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{de(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function he(e,t,n,r,i={}){const l=i.extraAttributes||[],o=i.onAttributeChange||null,f=i.onSubtreeChange||null,s=i.onInit||null,c=i.onAttrChange||null,d=i.effects||null,u=i.attributes||null,h=u?oe(u):d,p=u?new Set(Object.keys(u)):null,A=i.persist||null;function y(v){const g=v||document.body;if(S(g,e,t,n),u&&B())for(const C in u){const ke=u[C],E=Array.from(g.querySelectorAll("["+C+"]"));g.matches&&g.matches("["+C+"]")&&E.push(g);for(let O=0;O<E.length;O++){const N=E[O];_(N)&&F(ke,N.getAttribute(C),C,r,N)}}s&&s(g)}const a=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let g;for(;(g=v.exec(e))!==null;)a.push(g[1])}else a.push(e);fe({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:n,onInit:s,observed:a.concat(l),onAttributeChange:o,onAttrChange:c,effects:h,declared:p,persist:A}),ue();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";M().push({selector:e,attribute:t,ComponentFn:n,onInit:s,onSubtreeChange:f,query:b}),ae(),window[t]=y;function X(){le()>0?se(function(){y(document.body)}):y(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",X):X(),y}function W(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},r=W(t);if(!r)return n;const i=r.split("&");for(let l=0;l<i.length;l++){const o=i[l];if(!o)continue;const f=o.indexOf(":"),s=f>-1?o.slice(0,f):o,c=f>-1?o.slice(f+1):"";if(s)try{n[s]=decodeURIComponent(c)}catch{n[s]=c}}return n}function we(e){if(!e)return null;const t=x();return e in t?t[e]:null}function be(e,t){if(!e)return;const n=x();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(l){const o=n[l];return o===""?l:l+":"+encodeURIComponent(o)}).join("&");W(location.hash)!==i&&(location.hash=i)}function ge(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function pe(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 ye(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ce(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 me(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ae(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),i=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=we,window.lnCore.hashSet=be,window.lnCore.hashLinkClick=ge,window.lnCore.resolveHashNamespace=pe,window.lnCore.hashSortEncode=ye,window.lnCore.hashSortDecode=Ce,window.lnCore.hashFilterEncode=me,window.lnCore.hashFilterDecode=Ae);function j(e,t){if(e.length!==1)return e;const n=e.charCodeAt(0);if(n>=65&&n<=90){const r=((n-65+t)%26+26)%26;return String.fromCharCode(65+r)}if(n>=97&&n<=122){const r=((n-97+t)%26+26)%26;return String.fromCharCode(97+r)}if(n>=48&&n<=57){const r=((n-48+t)%10+10)%10;return String.fromCharCode(48+r)}return e}function V(e){if(e==null||e==="")return"";const t=String(e);if(typeof TextEncoder<"u"&&typeof btoa<"u"){const n=new TextEncoder().encode(t);let r="";const i=n.length;for(let l=0;l<i;l++)r+=String.fromCharCode(n[l]);return btoa(r)}return typeof Buffer<"u"?Buffer.from(t,"utf-8").toString("base64"):""}function U(e){if(e==null||e==="")return"";try{const t=String(e).trim();if(typeof atob<"u"&&typeof TextDecoder<"u"){const n=atob(t),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return new TextDecoder().decode(r)}if(typeof Buffer<"u")return Buffer.from(t,"base64").toString("utf-8")}catch{return e}return e}function K(e,t){const n=String(t||"ln-ashlar");let r;typeof TextEncoder<"u"?r=new TextEncoder().encode(n):typeof Buffer<"u"?r=Buffer.from(n,"utf-8"):r=[108,110];const i=r.length||1,l=new Uint8Array(e.length);for(let o=0;o<e.length;o++)l[o]=e[o]^r[o%i];return l}function Q(e,t="ln-ashlar"){if(e==null||e==="")return"";const n=String(e);let r;if(typeof TextEncoder<"u")r=new TextEncoder().encode(n);else if(typeof Buffer<"u")r=Buffer.from(n,"utf-8");else return"";const i=K(r,t);let l="";for(let o=0;o<i.length;o++)l+=String.fromCharCode(i[o]);return typeof btoa<"u"?btoa(l):typeof Buffer<"u"?Buffer.from(i).toString("base64"):""}function J(e,t="ln-ashlar"){if(e==null||e==="")return"";try{const n=String(e).trim();let r="";if(typeof atob<"u")r=atob(n);else if(typeof Buffer<"u")r=Buffer.from(n,"base64").toString("binary");else return e;const i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);const l=K(i,t);if(typeof TextDecoder<"u")return new TextDecoder().decode(l);if(typeof Buffer<"u")return Buffer.from(l).toString("utf-8")}catch{return e}return e}function P(e){if(typeof e=="number"||typeof e=="string"&&/^-?\d+$/.test(String(e).trim()))return{codec:"rot",shift:Number(e)||13,key:"ln-ashlar"};if(e&&typeof e=="object"){const t=(e.codec||(e.key?"xor":"rot")).toLowerCase().trim(),n=t==="xor"||t==="base64"?t:"rot",r=Number(e.shift)||13,i=e.key||"ln-ashlar";return{codec:n,shift:r,key:i}}return{codec:"rot",shift:13,key:"ln-ashlar"}}function _e(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=P(t);return n.codec==="base64"?V(e):n.codec==="xor"?Q(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>j(r,n.shift))}function T(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=P(t);return n.codec==="base64"?U(e):n.codec==="xor"?J(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>j(r,-n.shift))}(function(){const e="data-ln-obfuscator",t="lnObfuscator";if(window[t]!==void 0)return;function n(o){const f=o[t];f&&f.deobfuscate()}const r={"data-ln-obfuscator":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Codec used to deobfuscate text or links"},"data-ln-obfuscator-codec":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Explicit codec override attribute"},"data-ln-obfuscator-key":{type:"string",effect:n,description:"Encryption or masking key for XOR codec"}};function i(o){return o[t]?o[t]:(o[t]=this,this.dom=o,this._originalTextNodes=null,this._originalHref=null,this.deobfuscate(),this)}i.prototype.deobfuscate=function(){const o=!!(this.dom.matches&&(this.dom.matches("a")||this.dom.matches("area")));if(this._originalHref===null&&o&&this.dom.hasAttribute("href")&&(this._originalHref=this.dom.getAttribute("href")),(!this._originalTextNodes||this._originalTextNodes.length===0||this._originalTextNodes.some(a=>!this.dom.contains(a.node)))&&(this._originalTextNodes=[],typeof document<"u"&&document.createTreeWalker)){const a=document.createTreeWalker(this.dom,NodeFilter.SHOW_TEXT,{acceptNode:function(w){return w.parentElement&&w.parentElement.classList&&w.parentElement.classList.contains("sr-only")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;a.nextNode();)this._originalTextNodes.push({node:a.currentNode,raw:a.currentNode.nodeValue})}const s=this.dom.getAttribute(e),c=parseInt(s,10),d=isNaN(c)?13:c,u=(this.dom.getAttribute("data-ln-obfuscator-codec")||"").toLowerCase().trim(),h=this.dom.getAttribute("data-ln-obfuscator-key");let p="rot";u==="xor"||u==="base64"?p=u:h&&(p="xor");const A=h||"ln-ashlar",y={codec:p,shift:d,key:A};if(o&&this.dom.getAttribute("data-ln-external-link")==="processed"){const a=this.dom.querySelectorAll(".sr-only");for(let b=0;b<a.length;b++)a[b].remove();this.dom.removeAttribute("data-ln-external-link"),this.dom.removeAttribute("target");const w=(this.dom.rel||"").split(/\s+/).filter(function(b){return b&&b!=="noopener"&&b!=="noreferrer"});w.length>0?this.dom.rel=w.join(" "):this.dom.removeAttribute("rel")}if(this._originalTextNodes)for(let a=0;a<this._originalTextNodes.length;a++){const w=this._originalTextNodes[a];w.node&&w.raw&&w.raw.length>0&&(w.node.nodeValue=T(w.raw,y))}if(o&&this._originalHref){const a=T(this._originalHref,y);this.dom.setAttribute("href",a)}L(this.dom,"ln-obfuscator:deobfuscated",{target:this.dom,codec:p,shift:d,key:p==="xor"?A:null})},i.prototype.destroy=function(){if(this.dom[t]){if(this._originalTextNodes)for(let o=0;o<this._originalTextNodes.length;o++){const f=this._originalTextNodes[o];f.node&&f.raw&&(f.node.nodeValue=f.raw)}this._originalHref!==null&&this.dom.setAttribute("href",this._originalHref),delete this.dom[t]}};const l=he(e,t,i,"ln-obfuscator",{attributes:r});l.obfuscate=_e,l.deobfuscate=T,l.utf8ToBase64=V,l.base64ToUtf8=U,l.xorObfuscate=Q,l.xorDeobfuscate=J})()})();
|
|
1
|
+
(function(){"use strict";function D(){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 x(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 i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){r=t[i];break}if(!x(r))return}e.apply(console,t)}}function F(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 C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,i={},s=e.elements,o={};if(n)for(let c=0;c<s.length;c++){const l=s[c];l.name&&l.type==="checkbox"&&!l.disabled&&(o[l.name]=(o[l.name]||0)+1)}for(let c=0;c<s.length;c++){const l=s[c];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&o[l.name]===1?i[l.name]=l.checked:(i[l.name]||(i[l.name]=[]),l.checked&&i[l.name].push(l.value));else if(l.type==="radio")l.checked&&(i[l.name]=l.value);else if(l.type==="select-multiple"){i[l.name]=[];for(let u=0;u<l.options.length;u++)l.options[u].selected&&i[l.name].push(l.options[u].value)}else if(n&&l.type==="hidden")i[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const u=Number(l.value);i[l.name]=l.value===""||isNaN(u)?null:u}else i[l.name]=l.value}return i}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const n=e.elements,r=[],i={};for(let s=0;s<n.length;s++){const o=n[s];o.name&&o.type==="checkbox"&&(i[o.name]=(i[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 c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const l=t[c];if(o.type==="checkbox"){if(Array.isArray(l))o.checked=l.indexOf(o.value)!==-1;else if(i[o.name]>1){const u=String(l).split(",").map(function(a){return a.trim()});o.checked=u.indexOf(o.value)!==-1}else o.checked=se(l);r.push(o)}else if(o.type==="radio")o.checked=o.value===String(l),r.push(o);else if(o.type==="select-multiple"){if(Array.isArray(l))for(let u=0;u<o.options.length;u++)o.options[u].selected=l.indexOf(o.options[u].value)!==-1;r.push(o)}else o.value=l,o.tagName==="SELECT"&&l!=null&&o.setAttribute("data-ln-value",l),r.push(o)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);const I={};function ue(e,t){I[e]=t}function fe(e){return I[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=fe);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function de(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=de,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=ae);const k={};function he(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=k[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const c=n[o],l=c.getAttribute("data-ln-field");t[l]!=null&&(c.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const c=r[o],l=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),w=a[1].trim();t[w]!=null&&c.setAttribute(f,t[w])}}const i=e.querySelectorAll("[data-ln-show]");for(let o=0;o<i.length;o++){const c=i[o],l=c.getAttribute("data-ln-show");l in t&&c.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const c=s[o],l=c.getAttribute("data-ln-class").split(",");for(let u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),w=a[1].trim();w in t&&c.classList.toggle(f,!!t[w])}}return e}function be(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)R(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 q(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,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,o){return t[o]!==void 0?t[o]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const o=i[s],c=o.attributes;for(let l=0;l<c.length;l++){const u=c[l];u.value.indexOf("{{")!==-1&&o.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function pe(e,t,n,r,i,s){const o={};for(let l=0;l<e.children.length;l++){const u=e.children[l],a=u.getAttribute("data-ln-render-key");a&&(o[a]=u)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],a=String(r(u));let f=o[a];if(f)i(f,u,l);else{const w=he(n,s);if(!w||(q(w,u),f=w.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",a),i(f,u,l)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=q,window.lnCore.fill=R,window.lnCore.lnFill=be,window.lnCore.renderList=pe);function _(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function M(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function j(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const i=r.trim().toLowerCase();return!(i==="false"||i==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const v=new Map;function W(e,t){const n=(e?e.join("|"):"")+"::"+t;if(v.has(n))return v.get(n);const r=new Set(e||[]),i=function(s,o){const c=s.getAttribute(o);return c!==null&&r.has(c)?c:t};return v.set(n,i),i}function U(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function V(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function J(e,t,n,r,i){if(!e||t===null)return!0;const s=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=l=>{i?console.warn(l,i):console.warn(l)};if(o==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const l=e.values||[];return l.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(c(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(c(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(l){return c(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function ge(e,t,n){for(const r in n){const[i,s,o]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,s,o)},enumerable:!0,configurable:!0})}return e}function me(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let i=r.read;if(!i&&r.type)switch(r.type){case"enum":i=W(r.values,r.fallback);break;case"integer":i=M;break;case"float":i=U;break;case"boolean":i=j;break;case"list":i=H;break;case"json":i=V;break;case"string":default:i=_;break}i||(i=_),t[r.prop]=[i,n,r.fallback]}return t}function ye(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 Ce(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=ge,window.lnCore.attrSpec=me,window.lnCore.attrStr=_,window.lnCore.attrInt=M,window.lnCore.attrBool=j,window.lnCore.attrList=H,window.lnCore.attrEnum=W,window.lnCore.attrFloat=U,window.lnCore.attrJson=V);function S(e,t,n,r){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 c of o)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(l){console.error("["+n+"] init failed",c,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function xe(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 K(){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 ke(e){const t=K(),n=e.observed||[];for(let r=0;r<n.length;r++){const i=n[r];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).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 i=t.byDeclaredAttr.get(r);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Ce(e);if(r===null)t.reactiveWildcard.push(e);else for(const i of r)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function Q(e,t,n,r){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const o=s.effects&&s.effects[n];o?o(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function _e(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=K(),i=r.byAttr.get(n);if(D()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&x(t)){const s=r.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let c=0;c<s.length;c++)J(s[c].spec,o,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&Q(s,t,n,e.oldValue),r.reactiveWildcard.length&&Q(r.reactiveWildcard,t,n,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const o=i[s];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(S(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{_e(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 z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Se(e){const t=z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const i=r.query,s=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i];S(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let i=0;i<t.length;i++){const s=t[i],o=s.query,c=Array.from(r.querySelectorAll(o));r.matches&&r.matches(o)&&c.push(r);for(let l=0;l<c.length;l++){const u=c[l];if(!document.contains(u)){const a=u[s.attribute];if(a&&typeof a.destroy=="function")try{a.destroy()}catch(f){console.error("["+s.attribute+"] destroy failed",u,f)}delete u[s.attribute]}}}}}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Se(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function P(e,t,n,r,i={}){const s=i.extraAttributes||[],o=i.onAttributeChange||null,c=i.onSubtreeChange||null,l=i.onInit||null,u=i.onAttrChange||null,a=i.effects||null,f=i.attributes||null,w=f?ye(f):a,g=f?new Set(Object.keys(f)):null,A=i.persist||null;function m(E){const p=E||document.body;if(S(p,e,t,n),f&&D())for(const y in f){const qe=f[y],N=Array.from(p.querySelectorAll("["+y+"]"));p.matches&&p.matches("["+y+"]")&&N.push(p);for(let L=0;L<N.length;L++){const B=N[L];x(B)&&J(qe,B.getAttribute(y),y,r,B)}}l&&l(p)}const d=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let p;for(;(p=E.exec(e))!==null;)d.push(p[1])}else d.push(e);ke({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:l,observed:d.concat(s),onAttributeChange:o,onAttrChange:u,effects:w,declared:g,persist:A}),ve();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";z().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:b}),Te(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=P);function oe(){Ae()>0?xe(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",oe):oe(),m}function X(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},r=X(t);if(!r)return n;const i=r.split("&");for(let s=0;s<i.length;s++){const o=i[s];if(!o)continue;const c=o.indexOf(":"),l=c>-1?o.slice(0,c):o,u=c>-1?o.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(u)}catch{n[l]=u}}return n}function Oe(e){if(!e)return null;const t=T();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const o=n[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");X(location.hash)!==i&&(location.hash=i)}function Ne(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(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 Be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(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 Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(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),i=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Oe,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=Ne,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Be,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Ie);function $e(){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=$e);function G(e,t){if(e.length!==1)return e;const n=e.charCodeAt(0);if(n>=65&&n<=90){const r=((n-65+t)%26+26)%26;return String.fromCharCode(65+r)}if(n>=97&&n<=122){const r=((n-97+t)%26+26)%26;return String.fromCharCode(97+r)}if(n>=48&&n<=57){const r=((n-48+t)%10+10)%10;return String.fromCharCode(48+r)}return e}function Z(e){if(e==null||e==="")return"";const t=String(e);if(typeof TextEncoder<"u"&&typeof btoa<"u"){const n=new TextEncoder().encode(t);let r="";const i=n.length;for(let s=0;s<i;s++)r+=String.fromCharCode(n[s]);return btoa(r)}return typeof Buffer<"u"?Buffer.from(t,"utf-8").toString("base64"):""}function Y(e){if(e==null||e==="")return"";try{const t=String(e).trim();if(typeof atob<"u"&&typeof TextDecoder<"u"){const n=atob(t),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return new TextDecoder().decode(r)}if(typeof Buffer<"u")return Buffer.from(t,"base64").toString("utf-8")}catch{return e}return e}function ee(e,t){const n=String(t||"ln-ashlar");let r;typeof TextEncoder<"u"?r=new TextEncoder().encode(n):typeof Buffer<"u"?r=Buffer.from(n,"utf-8"):r=[108,110];const i=r.length||1,s=new Uint8Array(e.length);for(let o=0;o<e.length;o++)s[o]=e[o]^r[o%i];return s}function te(e,t="ln-ashlar"){if(e==null||e==="")return"";const n=String(e);let r;if(typeof TextEncoder<"u")r=new TextEncoder().encode(n);else if(typeof Buffer<"u")r=Buffer.from(n,"utf-8");else return"";const i=ee(r,t);let s="";for(let o=0;o<i.length;o++)s+=String.fromCharCode(i[o]);return typeof btoa<"u"?btoa(s):typeof Buffer<"u"?Buffer.from(i).toString("base64"):""}function ne(e,t="ln-ashlar"){if(e==null||e==="")return"";try{const n=String(e).trim();let r="";if(typeof atob<"u")r=atob(n);else if(typeof Buffer<"u")r=Buffer.from(n,"base64").toString("binary");else return e;const i=new Uint8Array(r.length);for(let o=0;o<r.length;o++)i[o]=r.charCodeAt(o);const s=ee(i,t);if(typeof TextDecoder<"u")return new TextDecoder().decode(s);if(typeof Buffer<"u")return Buffer.from(s).toString("utf-8")}catch{return e}return e}function re(e){if(typeof e=="number"||typeof e=="string"&&/^-?\d+$/.test(String(e).trim()))return{codec:"rot",shift:Number(e)||13,key:"ln-ashlar"};if(e&&typeof e=="object"){const t=(e.codec||(e.key?"xor":"rot")).toLowerCase().trim(),n=t==="xor"||t==="base64"?t:"rot",r=Number(e.shift)||13,i=e.key||"ln-ashlar";return{codec:n,shift:r,key:i}}return{codec:"rot",shift:13,key:"ln-ashlar"}}function Re(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=re(t);return n.codec==="base64"?Z(e):n.codec==="xor"?te(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>G(r,n.shift))}function O(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=re(t);return n.codec==="base64"?Y(e):n.codec==="xor"?ne(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>G(r,-n.shift))}(function(){const e="data-ln-obfuscator",t="lnObfuscator";if(window[t]!==void 0)return;function n(o){const c=o[t];c&&c.deobfuscate()}const r={"data-ln-obfuscator":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Codec used to deobfuscate text or links"},"data-ln-obfuscator-codec":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Explicit codec override attribute"},"data-ln-obfuscator-key":{type:"string",effect:n,description:"Encryption or masking key for XOR codec"}};function i(o){return o[t]?o[t]:(o[t]=this,this.dom=o,this._originalTextNodes=null,this._originalHref=null,this.deobfuscate(),this)}i.prototype.deobfuscate=function(){const o=!!(this.dom.matches&&(this.dom.matches("a")||this.dom.matches("area")));if(this._originalHref===null&&o&&this.dom.hasAttribute("href")&&(this._originalHref=this.dom.getAttribute("href")),(!this._originalTextNodes||this._originalTextNodes.length===0||this._originalTextNodes.some(d=>!this.dom.contains(d.node)))&&(this._originalTextNodes=[],typeof document<"u"&&document.createTreeWalker)){const d=document.createTreeWalker(this.dom,NodeFilter.SHOW_TEXT,{acceptNode:function(h){return h.parentElement&&h.parentElement.classList&&h.parentElement.classList.contains("sr-only")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;d.nextNode();)this._originalTextNodes.push({node:d.currentNode,raw:d.currentNode.nodeValue})}const l=this.dom.getAttribute(e),u=parseInt(l,10),a=isNaN(u)?13:u,f=(this.dom.getAttribute("data-ln-obfuscator-codec")||"").toLowerCase().trim(),w=this.dom.getAttribute("data-ln-obfuscator-key");let g="rot";f==="xor"||f==="base64"?g=f:w&&(g="xor");const A=w||"ln-ashlar",m={codec:g,shift:a,key:A};if(o&&this.dom.getAttribute("data-ln-external-link")==="processed"){const d=this.dom.querySelectorAll(".sr-only");for(let b=0;b<d.length;b++)d[b].remove();this.dom.removeAttribute("data-ln-external-link"),this.dom.removeAttribute("target");const h=(this.dom.rel||"").split(/\s+/).filter(function(b){return b&&b!=="noopener"&&b!=="noreferrer"});h.length>0?this.dom.rel=h.join(" "):this.dom.removeAttribute("rel")}if(this._originalTextNodes)for(let d=0;d<this._originalTextNodes.length;d++){const h=this._originalTextNodes[d];h.node&&h.raw&&h.raw.length>0&&(h.node.nodeValue=O(h.raw,m))}if(o&&this._originalHref){const d=O(this._originalHref,m);this.dom.setAttribute("href",d)}F(this.dom,"ln-obfuscator:deobfuscated",{target:this.dom,codec:g,shift:a,key:g==="xor"?A:null})},i.prototype.destroy=function(){if(this.dom[t]){if(this._originalTextNodes)for(let o=0;o<this._originalTextNodes.length;o++){const c=this._originalTextNodes[o];c.node&&c.raw&&(c.node.nodeValue=c.raw)}this._originalHref!==null&&this.dom.setAttribute("href",this._originalHref),delete this.dom[t]}};const s=P(e,t,i,"ln-obfuscator",{attributes:r});s.obfuscate=Re,s.deobfuscate=O,s.utf8ToBase64=Z,s.base64ToUtf8=Y,s.xorObfuscate=te,s.xorDeobfuscate=ne})()})();
|
|
@@ -1,49 +1,49 @@
|
|
|
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-obfuscator",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-external-link": {
|
|
7
|
-
"direction": "both",
|
|
8
|
-
"sources": [
|
|
9
|
-
"src/ln-obfuscator.js"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"data-ln-obfuscator": {
|
|
13
|
-
"direction": "author",
|
|
14
|
-
"sources": [
|
|
15
|
-
"src/ln-obfuscator.js"
|
|
16
|
-
],
|
|
17
|
-
"type": "enum",
|
|
18
|
-
"values": [
|
|
19
|
-
"rot13",
|
|
20
|
-
"base64",
|
|
21
|
-
"xor"
|
|
22
|
-
],
|
|
23
|
-
"fallback": "rot13",
|
|
24
|
-
"description": "Codec used to deobfuscate text or links"
|
|
25
|
-
},
|
|
26
|
-
"data-ln-obfuscator-codec": {
|
|
27
|
-
"direction": "author",
|
|
28
|
-
"sources": [
|
|
29
|
-
"src/ln-obfuscator.js"
|
|
30
|
-
],
|
|
31
|
-
"type": "enum",
|
|
32
|
-
"values": [
|
|
33
|
-
"rot13",
|
|
34
|
-
"base64",
|
|
35
|
-
"xor"
|
|
36
|
-
],
|
|
37
|
-
"fallback": "rot13",
|
|
38
|
-
"description": "Explicit codec override attribute"
|
|
39
|
-
},
|
|
40
|
-
"data-ln-obfuscator-key": {
|
|
41
|
-
"direction": "author",
|
|
42
|
-
"sources": [
|
|
43
|
-
"src/ln-obfuscator.js"
|
|
44
|
-
],
|
|
45
|
-
"type": "string",
|
|
46
|
-
"description": "Encryption or masking key for XOR codec"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
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-obfuscator",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-external-link": {
|
|
7
|
+
"direction": "both",
|
|
8
|
+
"sources": [
|
|
9
|
+
"src/ln-obfuscator.js"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-obfuscator": {
|
|
13
|
+
"direction": "author",
|
|
14
|
+
"sources": [
|
|
15
|
+
"src/ln-obfuscator.js"
|
|
16
|
+
],
|
|
17
|
+
"type": "enum",
|
|
18
|
+
"values": [
|
|
19
|
+
"rot13",
|
|
20
|
+
"base64",
|
|
21
|
+
"xor"
|
|
22
|
+
],
|
|
23
|
+
"fallback": "rot13",
|
|
24
|
+
"description": "Codec used to deobfuscate text or links"
|
|
25
|
+
},
|
|
26
|
+
"data-ln-obfuscator-codec": {
|
|
27
|
+
"direction": "author",
|
|
28
|
+
"sources": [
|
|
29
|
+
"src/ln-obfuscator.js"
|
|
30
|
+
],
|
|
31
|
+
"type": "enum",
|
|
32
|
+
"values": [
|
|
33
|
+
"rot13",
|
|
34
|
+
"base64",
|
|
35
|
+
"xor"
|
|
36
|
+
],
|
|
37
|
+
"fallback": "rot13",
|
|
38
|
+
"description": "Explicit codec override attribute"
|
|
39
|
+
},
|
|
40
|
+
"data-ln-obfuscator-key": {
|
|
41
|
+
"direction": "author",
|
|
42
|
+
"sources": [
|
|
43
|
+
"src/ln-obfuscator.js"
|
|
44
|
+
],
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "Encryption or masking key for XOR codec"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|