@livenetworks/ashlar 2.0.7 → 2.0.8
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 +96 -96
- package/components/ln-api-connector/src/ln-api-connector.js +1 -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/crypto.js +286 -265
- package/components/ln-core/dom.js +115 -115
- package/components/ln-core/form.js +136 -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/ln-core.schema.json +109 -109
- 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 +428 -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 +2 -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 +45 -45
- 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/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 +41 -41
- 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-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 +7 -8
- package/package.json +84 -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 +12 -12
|
@@ -1,52 +1,52 @@
|
|
|
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-toggle",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-debug": {
|
|
7
|
-
"direction": null,
|
|
8
|
-
"sources": [
|
|
9
|
-
"ln-toggle-dev.scss"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"data-ln-toggle": {
|
|
13
|
-
"direction": "both",
|
|
14
|
-
"sources": [
|
|
15
|
-
"ln-toggle-dev.scss",
|
|
16
|
-
"ln-toggle.scss",
|
|
17
|
-
"src/ln-toggle.js"
|
|
18
|
-
],
|
|
19
|
-
"type": "enum",
|
|
20
|
-
"values": [
|
|
21
|
-
"open",
|
|
22
|
-
"close"
|
|
23
|
-
],
|
|
24
|
-
"fallback": "close",
|
|
25
|
-
"description": "Visibility state of toggleable element"
|
|
26
|
-
},
|
|
27
|
-
"data-ln-toggle-action": {
|
|
28
|
-
"direction": "author",
|
|
29
|
-
"sources": [
|
|
30
|
-
"src/ln-toggle.js"
|
|
31
|
-
],
|
|
32
|
-
"type": "enum",
|
|
33
|
-
"values": [
|
|
34
|
-
"open",
|
|
35
|
-
"close",
|
|
36
|
-
"toggle"
|
|
37
|
-
],
|
|
38
|
-
"fallback": "toggle",
|
|
39
|
-
"description": "Action performed on target element when trigger is clicked"
|
|
40
|
-
},
|
|
41
|
-
"data-ln-toggle-for": {
|
|
42
|
-
"direction": "author",
|
|
43
|
-
"sources": [
|
|
44
|
-
"ln-toggle-dev.scss",
|
|
45
|
-
"ln-toggle.scss",
|
|
46
|
-
"src/ln-toggle.js"
|
|
47
|
-
],
|
|
48
|
-
"type": "string",
|
|
49
|
-
"description": "Target element ID to toggle on trigger click"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
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-toggle",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-debug": {
|
|
7
|
+
"direction": null,
|
|
8
|
+
"sources": [
|
|
9
|
+
"ln-toggle-dev.scss"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-toggle": {
|
|
13
|
+
"direction": "both",
|
|
14
|
+
"sources": [
|
|
15
|
+
"ln-toggle-dev.scss",
|
|
16
|
+
"ln-toggle.scss",
|
|
17
|
+
"src/ln-toggle.js"
|
|
18
|
+
],
|
|
19
|
+
"type": "enum",
|
|
20
|
+
"values": [
|
|
21
|
+
"open",
|
|
22
|
+
"close"
|
|
23
|
+
],
|
|
24
|
+
"fallback": "close",
|
|
25
|
+
"description": "Visibility state of toggleable element"
|
|
26
|
+
},
|
|
27
|
+
"data-ln-toggle-action": {
|
|
28
|
+
"direction": "author",
|
|
29
|
+
"sources": [
|
|
30
|
+
"src/ln-toggle.js"
|
|
31
|
+
],
|
|
32
|
+
"type": "enum",
|
|
33
|
+
"values": [
|
|
34
|
+
"open",
|
|
35
|
+
"close",
|
|
36
|
+
"toggle"
|
|
37
|
+
],
|
|
38
|
+
"fallback": "toggle",
|
|
39
|
+
"description": "Action performed on target element when trigger is clicked"
|
|
40
|
+
},
|
|
41
|
+
"data-ln-toggle-for": {
|
|
42
|
+
"direction": "author",
|
|
43
|
+
"sources": [
|
|
44
|
+
"ln-toggle-dev.scss",
|
|
45
|
+
"ln-toggle.scss",
|
|
46
|
+
"src/ln-toggle.js"
|
|
47
|
+
],
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "Target element ID to toggle on trigger click"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function I(){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 L(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 o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!L(o))return}e.apply(console,t)}}function P(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const B={};function V(e,t){B[e]=t}function U(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=V,window.lnCore.getDataMapper=U);function Q(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){P(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function G(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];F[n]=t}function K(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=G,window.lnCore.getLocaleFallback=K,window.lnCore.ensureLocaleObserver=Q);const O={};function J(e,t){O[e]||(O[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=O[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function q(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const s=n[l],d=s.getAttribute("data-ln-field");t[d]!=null&&(s.textContent=t[d])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const s=o[l],d=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<d.length;c++){const f=d[c].trim().split(":");if(f.length!==2)continue;const a=f[0].trim(),h=f[1].trim();t[h]!=null&&s.setAttribute(a,t[h])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const s=i[l],d=s.getAttribute("data-ln-show");d in t&&s.classList.toggle("hidden",!t[d])}const r=e.querySelectorAll("[data-ln-class]");for(let l=0;l<r.length;l++){const s=r[l],d=s.getAttribute("data-ln-class").split(",");for(let c=0;c<d.length;c++){const f=d[c].trim().split(":");if(f.length!==2)continue;const a=f[0].trim(),h=f[1].trim();h in t&&s.classList.toggle(a,!!t[h])}}return e}function X(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 o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].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 n=0;n<t.length;n++)t[n].textContent=""}})));function N(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const r=n.currentNode;r.textContent.indexOf("{{")!==-1&&(r.textContent=r.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const o=function(r,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let r=0;r<i.length;r++){const l=i[r],s=l.attributes;for(let d=0;d<s.length;d++){const c=s[d];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Y(e,t,n,o,i,r){const l={};for(let d=0;d<e.children.length;d++){const c=e.children[d],f=c.getAttribute("data-ln-render-key");f&&(l[f]=c)}const s=document.createDocumentFragment();for(let d=0;d<t.length;d++){const c=t[d],f=String(o(c));let a=l[f];if(a)i(a,c,d);else{const h=J(n,r);if(!h||(N(h,c),a=h.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",f),i(a,c,d)}s.appendChild(a)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=q,window.lnCore.lnFill=X,window.lnCore.renderList=Y);function M(e,t,n,o,i){if(!e||t===null)return!0;const r=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=d=>{i?console.warn(d,i):console.warn(d)};if(l==="boolean"){const d=t.trim().toLowerCase();return d!==""&&d!=="true"&&d!=="false"&&d!=="1"&&d!=="0"?(s(`[${r}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const d=e.values||[];return d.includes(t)?!0:(s(`[${r}] Invalid value "${t}" for attribute "${n}". Allowed: ${d.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${r}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const d=parseInt(t,10);return e.min!==void 0&&d<e.min?(s(`[${r}] Value ${d} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&d>e.max?(s(`[${r}] Value ${d} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${r}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(d){return s(`[${r}] Invalid JSON for attribute "${n}": ${d.message}. Fallback: ${e.fallback}.`),!1}return!0}function Z(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function z(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 T(e,t,n,o){if(e.nodeType!==1)return;const r=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(r));e.matches&&e.matches(r)&&l.push(e);for(const s of l)if(!s[n]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[n]=new o(s)}catch(d){console.error("["+n+"] init failed",s,d)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ee(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function te(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function W(){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 ne(e){const t=W(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];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 o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(r=>r.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=z(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function R(e,t,n,o){for(let i=0;i<e.length;i++){const r=e[i];if(!t[r.attribute])continue;const l=r.effects&&r.effects[n];l?l(t,n,o):r.onAttrChange&&(!r.declared||r.declared.has(n))&&r.onAttrChange(t,n,o)}}function oe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=W(),i=o.byAttr.get(n);if(I()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&L(t)){const r=o.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let s=0;s<r.length;s++)M(r[s].spec,l,n,r[s].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 r=o.byReactive.get(n);r&&R(r,t,n,e.oldValue),o.reactiveWildcard.length&&R(o.reactiveWildcard,t,n,e.oldValue)}if(i)for(let r=0;r<i.length;r++){const l=i[r];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(T(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{oe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).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 ie(e){const t=j();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const i=o.query,r=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;r&&o.onSubtreeChange(r,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const r=t[i];T(o,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const r=t[i],l=r.query,s=Array.from(o.querySelectorAll(l));o.matches&&o.matches(l)&&s.push(o);for(let d=0;d<s.length;d++){const c=s[d];if(!document.contains(c)){const f=c[r.attribute];if(f&&typeof f.destroy=="function")try{f.destroy()}catch(a){console.error("["+r.attribute+"] destroy failed",c,a)}delete c[r.attribute]}}}}}}function le(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ie(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function se(e,t,n,o,i={}){const r=i.extraAttributes||[],l=i.onAttributeChange||null,s=i.onSubtreeChange||null,d=i.onInit||null,c=i.onAttrChange||null,f=i.effects||null,a=i.attributes||null,h=a?Z(a):f,v=a?new Set(Object.keys(a)):null,A=i.persist||null;function y(b){const p=b||document.body;if(T(p,e,t,n),a&&I())for(const w in a){const $=a[w],_=Array.from(p.querySelectorAll("["+w+"]"));p.matches&&p.matches("["+w+"]")&&_.push(p);for(let E=0;E<_.length;E++){const k=_[E];L(k)&&M($,k.getAttribute(w),w,o,k)}}d&&d(p)}const g=[];if(e.indexOf("[")!==-1){const b=/\[([\w-]+)/g;let p;for(;(p=b.exec(e))!==null;)g.push(p[1])}else g.push(e);ne({selector:e,attribute:t,componentTag:o,attributes:a,ComponentFn:n,onInit:d,observed:g.concat(r),onAttributeChange:l,onAttrChange:c,effects:h,declared:v,persist:A}),re();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";j().push({selector:e,attribute:t,ComponentFn:n,onInit:d,onSubtreeChange:s,query:C}),le(),window[t]=y;function u(){ee()>0?te(function(){y(document.body)}):y(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u(),y}function H(e){return(e||"").replace(/^#/,"")}function x(e){const t=e===void 0?location.hash:e,n={},o=H(t);if(!o)return n;const i=o.split("&");for(let r=0;r<i.length;r++){const l=i[r];if(!l)continue;const s=l.indexOf(":"),d=s>-1?l.slice(0,s):l,c=s>-1?l.slice(s+1):"";if(d)try{n[d]=decodeURIComponent(c)}catch{n[d]=c}}return n}function de(e){if(!e)return null;const t=x();return e in t?t[e]:null}function ue(e,t){if(!e)return;const n=x();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(r){const l=n[r];return l===""?r:r+":"+encodeURIComponent(l)}).join("&");H(location.hash)!==i&&(location.hash=i)}function ce(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ae(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 o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function we(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function he(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function pe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(r){try{return decodeURIComponent(r)}catch{return r}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=x,window.lnCore.hashGet=de,window.lnCore.hashSet=ue,window.lnCore.hashLinkClick=ce,window.lnCore.resolveHashNamespace=ae,window.lnCore.hashSortEncode=fe,window.lnCore.hashSortDecode=we,window.lnCore.hashFilterEncode=he,window.lnCore.hashFilterDecode=pe);function be(e,t,n,o){const i=o,r=window.innerWidth,l=window.innerHeight,s=t.width,d=t.height,c=n.split("-"),f=c[0],a=c[1]==="start"||c[1]==="end"?c[1]:"center",h={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},v=h[f]||h.bottom;function A(u){return u==="top"||u==="bottom"?a==="start"?e.left:a==="end"?e.right-s:e.left+(e.width-s)/2:a==="start"?e.top:a==="end"?e.bottom-d:e.top+(e.height-d)/2}function y(u){let b,p,w=!0;return u==="top"?(b=e.top-i-d,p=A(u),b<0&&(w=!1)):u==="bottom"?(b=e.bottom+i,p=A(u),b+d>l&&(w=!1)):u==="left"?(b=A(u),p=e.left-i-s,p<0&&(w=!1)):(b=A(u),p=e.right+i,p+s>r&&(w=!1)),{top:b,left:p,side:u,fits:w}}let g=null;for(let u=0;u<v.length;u++){const b=y(v[u]);if(b.fits){g=b;break}}g||(g=y(v[0]));let m=g.top,C=g.left;return s>=r?C=0:(C<0&&(C=0),C+s>r&&(C=r-s)),d>=l?m=0:(m<0&&(m=0),m+d>l&&(m=l-d)),{top:m,left:C,placement:g.side}}(function(){const e="data-ln-tooltip-enhance",t="data-ln-tooltip",n="data-ln-tooltip-position",o="lnTooltipEnhance",i="ln-tooltip-portal";if(window[o]!==void 0)return;const r={"data-ln-tooltip-enhance":{type:"marker",description:"Activates enhanced tooltip behavior on element or container"},"data-ln-tooltip-enhanced":{type:"marker",description:"Runtime marker applied to enhanced tooltip trigger"},"data-ln-tooltip":{type:"string",description:"Tooltip text content to display"},"data-ln-tooltip-position":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],fallback:"top",description:"Preferred positioning anchor"},"data-ln-tooltip-placement":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],description:"Active calculated placement applied at runtime"}};let l=0,s=null,d=null,c=null,f=null,a=null,h=null;function v(){return s&&s.parentNode||(s=document.getElementById(i),s||(s=document.createElement("div"),s.id=i,document.body.appendChild(s)),s.hasAttribute("popover")||s.setAttribute("popover","manual")),s}function A(){h||(h=function(u){u.key==="Escape"&&m()},document.addEventListener("keydown",h))}function y(){h&&(document.removeEventListener("keydown",h),h=null)}function g(u){if(c===u)return;m();const b=u.getAttribute(t)||u.getAttribute("title");if(!b)return;v(),typeof s.showPopover=="function"&&s.showPopover(),u.hasAttribute("title")&&(f=u.getAttribute("title"),u.removeAttribute("title"));const p=u.getAttribute("aria-describedby");p?a=p:a=null;const w=document.createElement("div");w.className="ln-tooltip",w.textContent=b,u[o+"Uid"]||(l+=1,u[o+"Uid"]="ln-tooltip-"+l),w.id=u[o+"Uid"],s.appendChild(w);const $=w.offsetWidth,_=w.offsetHeight,E=u.getBoundingClientRect(),k=u.getAttribute(n)||"top",D=be(E,{width:$,height:_},k,6);w.style.top=D.top+"px",w.style.left=D.left+"px",w.setAttribute("data-ln-tooltip-placement",D.placement),a?u.setAttribute("aria-describedby",a+" "+w.id):u.setAttribute("aria-describedby",w.id),d=w,c=u,A()}function m(){if(!d){y();return}c&&(a!==null?c.setAttribute("aria-describedby",a):c.removeAttribute("aria-describedby"),a=null,f!==null&&c.setAttribute("title",f)),f=null,d.parentNode&&d.parentNode.removeChild(d),d=null,c=null,s&&typeof s.hidePopover=="function"&&s.matches(":popover-open")&&s.hidePopover(),y()}function C(u){return this.dom=u,u.hasAttribute("data-ln-tooltip-enhanced")||(u.setAttribute("data-ln-tooltip-enhanced",""),this._addedEnhancedAttr=!0),this._onEnter=function(){g(u)},this._onLeave=function(){c===u&&!u.contains(document.activeElement)&&m()},this._onFocus=function(){g(u)},this._onBlur=function(){c===u&&!u.matches(":hover")&&m()},u.addEventListener("mouseenter",this._onEnter),u.addEventListener("mouseleave",this._onLeave),u.addEventListener("focus",this._onFocus,!0),u.addEventListener("blur",this._onBlur,!0),this}C.prototype.destroy=function(){const u=this.dom;u.removeEventListener("mouseenter",this._onEnter),u.removeEventListener("mouseleave",this._onLeave),u.removeEventListener("focus",this._onFocus,!0),u.removeEventListener("blur",this._onBlur,!0),c===u&&m(),this._addedEnhancedAttr&&u.removeAttribute("data-ln-tooltip-enhanced"),delete u[o],delete u[o+"Uid"]},se("["+e+"], [data-ln-tooltip-enhanced], ["+t+"][title]",o,C,"ln-tooltip",{attributes:r})})()})();
|
|
1
|
+
(function(){"use strict";function $(){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 S(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 o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!S(o))return}e.apply(console,t)}}function H(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function k(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){k(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}const B={};function P(e,t){B[e]=t}function V(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=P,window.lnCore.getDataMapper=V);function Q(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,k(function(){new MutationObserver(function(){H(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function G(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];F[n]=t}function K(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=G,window.lnCore.getLocaleFallback=K,window.lnCore.ensureLocaleObserver=Q);const L={};function J(e,t){L[e]||(L[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=L[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function q(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const s=n[l],d=s.getAttribute("data-ln-field");t[d]!=null&&(s.textContent=t[d])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const s=o[l],d=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<d.length;c++){const f=d[c].trim().split(":");if(f.length!==2)continue;const a=f[0].trim(),p=f[1].trim();t[p]!=null&&s.setAttribute(a,t[p])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const s=i[l],d=s.getAttribute("data-ln-show");d in t&&s.classList.toggle("hidden",!t[d])}const r=e.querySelectorAll("[data-ln-class]");for(let l=0;l<r.length;l++){const s=r[l],d=s.getAttribute("data-ln-class").split(",");for(let c=0;c<d.length;c++){const f=d[c].trim().split(":");if(f.length!==2)continue;const a=f[0].trim(),p=f[1].trim();p in t&&s.classList.toggle(a,!!t[p])}}return e}function X(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 o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].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 n=0;n<t.length;n++)t[n].textContent=""}})));function N(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const r=n.currentNode;r.textContent.indexOf("{{")!==-1&&(r.textContent=r.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const o=function(r,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let r=0;r<i.length;r++){const l=i[r],s=l.attributes;for(let d=0;d<s.length;d++){const c=s[d];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Y(e,t,n,o,i,r){const l={};for(let d=0;d<e.children.length;d++){const c=e.children[d],f=c.getAttribute("data-ln-render-key");f&&(l[f]=c)}const s=document.createDocumentFragment();for(let d=0;d<t.length;d++){const c=t[d],f=String(o(c));let a=l[f];if(a)i(a,c,d);else{const p=J(n,r);if(!p||(N(p,c),a=p.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",f),i(a,c,d)}s.appendChild(a)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=q,window.lnCore.lnFill=X,window.lnCore.renderList=Y);function M(e,t,n,o,i){if(!e||t===null)return!0;const r=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=d=>{i?console.warn(d,i):console.warn(d)};if(l==="boolean"){const d=t.trim().toLowerCase();return d!==""&&d!=="true"&&d!=="false"&&d!=="1"&&d!=="0"?(s(`[${r}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const d=e.values||[];return d.includes(t)?!0:(s(`[${r}] Invalid value "${t}" for attribute "${n}". Allowed: ${d.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${r}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const d=parseInt(t,10);return e.min!==void 0&&d<e.min?(s(`[${r}] Value ${d} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&d>e.max?(s(`[${r}] Value ${d} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${r}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(d){return s(`[${r}] Invalid JSON for attribute "${n}": ${d.message}. Fallback: ${e.fallback}.`),!1}return!0}function Z(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function z(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 O(e,t,n,o){if(e.nodeType!==1)return;const r=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l=Array.from(e.querySelectorAll(r));e.matches&&e.matches(r)&&l.push(e);for(const s of l)if(!s[n]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[n]=new o(s)}catch(d){console.error("["+n+"] init failed",s,d)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ee(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function te(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function W(){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 ne(e){const t=W(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];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 o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(r=>r.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=z(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function R(e,t,n,o){for(let i=0;i<e.length;i++){const r=e[i];if(!t[r.attribute])continue;const l=r.effects&&r.effects[n];l?l(t,n,o):r.onAttrChange&&(!r.declared||r.declared.has(n))&&r.onAttrChange(t,n,o)}}function oe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=W(),i=o.byAttr.get(n);if($()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&S(t)){const r=o.byDeclaredAttr.get(n),l=t.getAttribute(n);for(let s=0;s<r.length;s++)M(r[s].spec,l,n,r[s].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 r=o.byReactive.get(n);r&&R(r,t,n,e.oldValue),o.reactiveWildcard.length&&R(o.reactiveWildcard,t,n,e.oldValue)}if(i)for(let r=0;r<i.length;r++){const l=i[r];if(l.handler){l.handler(t,n,e.oldValue);continue}l.onAttributeChange&&t[l.attribute]?l.onAttributeChange(t,n):(O(t,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(t))}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{oe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function U(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ie(e){const t=U();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const i=o.query,r=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;r&&o.onSubtreeChange(r,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const r=t[i];O(o,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const r=t[i],l=r.query,s=Array.from(o.querySelectorAll(l));o.matches&&o.matches(l)&&s.push(o);for(let d=0;d<s.length;d++){const c=s[d];if(!document.contains(c)){const f=c[r.attribute];if(f&&typeof f.destroy=="function")try{f.destroy()}catch(a){console.error("["+r.attribute+"] destroy failed",c,a)}delete c[r.attribute]}}}}}}function le(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,k(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ie(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function se(e,t,n,o,i={}){const r=i.extraAttributes||[],l=i.onAttributeChange||null,s=i.onSubtreeChange||null,d=i.onInit||null,c=i.onAttrChange||null,f=i.effects||null,a=i.attributes||null,p=a?Z(a):f,A=a?new Set(Object.keys(a)):null,v=i.persist||null;function y(b){const h=b||document.body;if(O(h,e,t,n),a&&$())for(const w in a){const D=a[w],_=Array.from(h.querySelectorAll("["+w+"]"));h.matches&&h.matches("["+w+"]")&&_.push(h);for(let x=0;x<_.length;x++){const E=_[x];S(E)&&M(D,E.getAttribute(w),w,o,E)}}d&&d(h)}const g=[];if(e.indexOf("[")!==-1){const b=/\[([\w-]+)/g;let h;for(;(h=b.exec(e))!==null;)g.push(h[1])}else g.push(e);ne({selector:e,attribute:t,componentTag:o,attributes:a,ComponentFn:n,onInit:d,observed:g.concat(r),onAttributeChange:l,onAttrChange:c,effects:p,declared:A,persist:v}),re();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";U().push({selector:e,attribute:t,ComponentFn:n,onInit:d,onSubtreeChange:s,query:C}),le(),window[t]=y;function u(){ee()>0?te(function(){y(document.body)}):y(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u(),y}function j(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},o=j(t);if(!o)return n;const i=o.split("&");for(let r=0;r<i.length;r++){const l=i[r];if(!l)continue;const s=l.indexOf(":"),d=s>-1?l.slice(0,s):l,c=s>-1?l.slice(s+1):"";if(d)try{n[d]=decodeURIComponent(c)}catch{n[d]=c}}return n}function de(e){if(!e)return null;const t=T();return e in t?t[e]:null}function ue(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(r){const l=n[r];return l===""?r:r+":"+encodeURIComponent(l)}).join("&");j(location.hash)!==i&&(location.hash=i)}function ce(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ae(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 o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function we(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 pe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function he(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(r){try{return decodeURIComponent(r)}catch{return r}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=de,window.lnCore.hashSet=ue,window.lnCore.hashLinkClick=ce,window.lnCore.resolveHashNamespace=ae,window.lnCore.hashSortEncode=fe,window.lnCore.hashSortDecode=we,window.lnCore.hashFilterEncode=pe,window.lnCore.hashFilterDecode=he);function be(e,t,n,o){const i=o,r=window.innerWidth,l=window.innerHeight,s=t.width,d=t.height,c=n.split("-"),f=c[0],a=c[1]==="start"||c[1]==="end"?c[1]:"center",p={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},A=p[f]||p.bottom;function v(u){return u==="top"||u==="bottom"?a==="start"?e.left:a==="end"?e.right-s:e.left+(e.width-s)/2:a==="start"?e.top:a==="end"?e.bottom-d:e.top+(e.height-d)/2}function y(u){let b,h,w=!0;return u==="top"?(b=e.top-i-d,h=v(u),b<0&&(w=!1)):u==="bottom"?(b=e.bottom+i,h=v(u),b+d>l&&(w=!1)):u==="left"?(b=v(u),h=e.left-i-s,h<0&&(w=!1)):(b=v(u),h=e.right+i,h+s>r&&(w=!1)),{top:b,left:h,side:u,fits:w}}let g=null;for(let u=0;u<A.length;u++){const b=y(A[u]);if(b.fits){g=b;break}}g||(g=y(A[0]));let m=g.top,C=g.left;return s>=r?C=0:(C<0&&(C=0),C+s>r&&(C=r-s)),d>=l?m=0:(m<0&&(m=0),m+d>l&&(m=l-d)),{top:m,left:C,placement:g.side}}function ge(){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=ge),(function(){const e="data-ln-tooltip-enhance",t="data-ln-tooltip",n="data-ln-tooltip-position",o="lnTooltipEnhance",i="ln-tooltip-portal";if(window[o]!==void 0)return;const r={"data-ln-tooltip-enhance":{type:"marker",description:"Activates enhanced tooltip behavior on element or container"},"data-ln-tooltip-enhanced":{type:"marker",description:"Runtime marker applied to enhanced tooltip trigger"},"data-ln-tooltip":{type:"string",description:"Tooltip text content to display"},"data-ln-tooltip-position":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],fallback:"top",description:"Preferred positioning anchor"},"data-ln-tooltip-placement":{type:"enum",values:["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"],description:"Active calculated placement applied at runtime"}};let l=0,s=null,d=null,c=null,f=null,a=null,p=null;function A(){return s&&s.parentNode||(s=document.getElementById(i),s||(s=document.createElement("div"),s.id=i,document.body.appendChild(s)),s.hasAttribute("popover")||s.setAttribute("popover","manual")),s}function v(){p||(p=function(u){u.key==="Escape"&&m()},document.addEventListener("keydown",p))}function y(){p&&(document.removeEventListener("keydown",p),p=null)}function g(u){if(c===u)return;m();const b=u.getAttribute(t)||u.getAttribute("title");if(!b)return;A(),typeof s.showPopover=="function"&&s.showPopover(),u.hasAttribute("title")&&(f=u.getAttribute("title"),u.removeAttribute("title"));const h=u.getAttribute("aria-describedby");h?a=h:a=null;const w=document.createElement("div");w.className="ln-tooltip",w.textContent=b,u[o+"Uid"]||(l+=1,u[o+"Uid"]="ln-tooltip-"+l),w.id=u[o+"Uid"],s.appendChild(w);const D=w.offsetWidth,_=w.offsetHeight,x=u.getBoundingClientRect(),E=u.getAttribute(n)||"top",I=be(x,{width:D,height:_},E,6);w.style.top=I.top+"px",w.style.left=I.left+"px",w.setAttribute("data-ln-tooltip-placement",I.placement),a?u.setAttribute("aria-describedby",a+" "+w.id):u.setAttribute("aria-describedby",w.id),d=w,c=u,v()}function m(){if(!d){y();return}c&&(a!==null?c.setAttribute("aria-describedby",a):c.removeAttribute("aria-describedby"),a=null,f!==null&&c.setAttribute("title",f)),f=null,d.parentNode&&d.parentNode.removeChild(d),d=null,c=null,s&&typeof s.hidePopover=="function"&&s.matches(":popover-open")&&s.hidePopover(),y()}function C(u){return this.dom=u,u.hasAttribute("data-ln-tooltip-enhanced")||(u.setAttribute("data-ln-tooltip-enhanced",""),this._addedEnhancedAttr=!0),this._onEnter=function(){g(u)},this._onLeave=function(){c===u&&!u.contains(document.activeElement)&&m()},this._onFocus=function(){g(u)},this._onBlur=function(){c===u&&!u.matches(":hover")&&m()},u.addEventListener("mouseenter",this._onEnter),u.addEventListener("mouseleave",this._onLeave),u.addEventListener("focus",this._onFocus,!0),u.addEventListener("blur",this._onBlur,!0),this}C.prototype.destroy=function(){const u=this.dom;u.removeEventListener("mouseenter",this._onEnter),u.removeEventListener("mouseleave",this._onLeave),u.removeEventListener("focus",this._onFocus,!0),u.removeEventListener("blur",this._onBlur,!0),c===u&&m(),this._addedEnhancedAttr&&u.removeAttribute("data-ln-tooltip-enhanced"),delete u[o],delete u[o+"Uid"]},se("["+e+"], [data-ln-tooltip-enhanced], ["+t+"][title]",o,C,"ln-tooltip",{attributes:r})})()})();
|
|
@@ -1,86 +1,86 @@
|
|
|
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-tooltip",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-debug": {
|
|
7
|
-
"direction": null,
|
|
8
|
-
"sources": [
|
|
9
|
-
"ln-tooltip-dev.scss"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"data-ln-tooltip": {
|
|
13
|
-
"direction": "author",
|
|
14
|
-
"sources": [
|
|
15
|
-
"ln-tooltip-dev.scss",
|
|
16
|
-
"ln-tooltip.scss",
|
|
17
|
-
"src/ln-tooltip.js"
|
|
18
|
-
],
|
|
19
|
-
"type": "string",
|
|
20
|
-
"description": "Tooltip text content to display"
|
|
21
|
-
},
|
|
22
|
-
"data-ln-tooltip-enhance": {
|
|
23
|
-
"direction": null,
|
|
24
|
-
"sources": [
|
|
25
|
-
"ln-tooltip.scss",
|
|
26
|
-
"src/ln-tooltip.js"
|
|
27
|
-
],
|
|
28
|
-
"type": "marker",
|
|
29
|
-
"description": "Activates enhanced tooltip behavior on element or container"
|
|
30
|
-
},
|
|
31
|
-
"data-ln-tooltip-enhanced": {
|
|
32
|
-
"direction": "both",
|
|
33
|
-
"sources": [
|
|
34
|
-
"ln-tooltip.scss",
|
|
35
|
-
"src/ln-tooltip.js"
|
|
36
|
-
],
|
|
37
|
-
"type": "marker",
|
|
38
|
-
"description": "Runtime marker applied to enhanced tooltip trigger"
|
|
39
|
-
},
|
|
40
|
-
"data-ln-tooltip-placement": {
|
|
41
|
-
"direction": "runtime",
|
|
42
|
-
"sources": [
|
|
43
|
-
"src/ln-tooltip.js"
|
|
44
|
-
],
|
|
45
|
-
"type": "enum",
|
|
46
|
-
"values": [
|
|
47
|
-
"top",
|
|
48
|
-
"top-start",
|
|
49
|
-
"top-end",
|
|
50
|
-
"bottom",
|
|
51
|
-
"bottom-start",
|
|
52
|
-
"bottom-end",
|
|
53
|
-
"left",
|
|
54
|
-
"left-start",
|
|
55
|
-
"left-end",
|
|
56
|
-
"right",
|
|
57
|
-
"right-start",
|
|
58
|
-
"right-end"
|
|
59
|
-
],
|
|
60
|
-
"description": "Active calculated placement applied at runtime"
|
|
61
|
-
},
|
|
62
|
-
"data-ln-tooltip-position": {
|
|
63
|
-
"direction": "author",
|
|
64
|
-
"sources": [
|
|
65
|
-
"src/ln-tooltip.js"
|
|
66
|
-
],
|
|
67
|
-
"type": "enum",
|
|
68
|
-
"values": [
|
|
69
|
-
"top",
|
|
70
|
-
"top-start",
|
|
71
|
-
"top-end",
|
|
72
|
-
"bottom",
|
|
73
|
-
"bottom-start",
|
|
74
|
-
"bottom-end",
|
|
75
|
-
"left",
|
|
76
|
-
"left-start",
|
|
77
|
-
"left-end",
|
|
78
|
-
"right",
|
|
79
|
-
"right-start",
|
|
80
|
-
"right-end"
|
|
81
|
-
],
|
|
82
|
-
"fallback": "top",
|
|
83
|
-
"description": "Preferred positioning anchor"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
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-tooltip",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-debug": {
|
|
7
|
+
"direction": null,
|
|
8
|
+
"sources": [
|
|
9
|
+
"ln-tooltip-dev.scss"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-tooltip": {
|
|
13
|
+
"direction": "author",
|
|
14
|
+
"sources": [
|
|
15
|
+
"ln-tooltip-dev.scss",
|
|
16
|
+
"ln-tooltip.scss",
|
|
17
|
+
"src/ln-tooltip.js"
|
|
18
|
+
],
|
|
19
|
+
"type": "string",
|
|
20
|
+
"description": "Tooltip text content to display"
|
|
21
|
+
},
|
|
22
|
+
"data-ln-tooltip-enhance": {
|
|
23
|
+
"direction": null,
|
|
24
|
+
"sources": [
|
|
25
|
+
"ln-tooltip.scss",
|
|
26
|
+
"src/ln-tooltip.js"
|
|
27
|
+
],
|
|
28
|
+
"type": "marker",
|
|
29
|
+
"description": "Activates enhanced tooltip behavior on element or container"
|
|
30
|
+
},
|
|
31
|
+
"data-ln-tooltip-enhanced": {
|
|
32
|
+
"direction": "both",
|
|
33
|
+
"sources": [
|
|
34
|
+
"ln-tooltip.scss",
|
|
35
|
+
"src/ln-tooltip.js"
|
|
36
|
+
],
|
|
37
|
+
"type": "marker",
|
|
38
|
+
"description": "Runtime marker applied to enhanced tooltip trigger"
|
|
39
|
+
},
|
|
40
|
+
"data-ln-tooltip-placement": {
|
|
41
|
+
"direction": "runtime",
|
|
42
|
+
"sources": [
|
|
43
|
+
"src/ln-tooltip.js"
|
|
44
|
+
],
|
|
45
|
+
"type": "enum",
|
|
46
|
+
"values": [
|
|
47
|
+
"top",
|
|
48
|
+
"top-start",
|
|
49
|
+
"top-end",
|
|
50
|
+
"bottom",
|
|
51
|
+
"bottom-start",
|
|
52
|
+
"bottom-end",
|
|
53
|
+
"left",
|
|
54
|
+
"left-start",
|
|
55
|
+
"left-end",
|
|
56
|
+
"right",
|
|
57
|
+
"right-start",
|
|
58
|
+
"right-end"
|
|
59
|
+
],
|
|
60
|
+
"description": "Active calculated placement applied at runtime"
|
|
61
|
+
},
|
|
62
|
+
"data-ln-tooltip-position": {
|
|
63
|
+
"direction": "author",
|
|
64
|
+
"sources": [
|
|
65
|
+
"src/ln-tooltip.js"
|
|
66
|
+
],
|
|
67
|
+
"type": "enum",
|
|
68
|
+
"values": [
|
|
69
|
+
"top",
|
|
70
|
+
"top-start",
|
|
71
|
+
"top-end",
|
|
72
|
+
"bottom",
|
|
73
|
+
"bottom-start",
|
|
74
|
+
"bottom-end",
|
|
75
|
+
"left",
|
|
76
|
+
"left-start",
|
|
77
|
+
"left-end",
|
|
78
|
+
"right",
|
|
79
|
+
"right-start",
|
|
80
|
+
"right-end"
|
|
81
|
+
],
|
|
82
|
+
"fallback": "top",
|
|
83
|
+
"description": "Preferred positioning anchor"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -1 +1 @@
|
|
|
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 A(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 a=1;a<t.length;a++)if(t[a]&&t[a].nodeType===1){r=t[a];break}if(!A(r))return}e.apply(console,t)}}function v(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 N(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const a=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(a),a}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()}const $={};function U(e,t){$[e]=t}function K(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=U,window.lnCore.getDataMapper=K);function J(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const I={};function Q(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];I[n]=t}function G(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=Q,window.lnCore.getLocaleFallback=G,window.lnCore.ensureLocaleObserver=J);const _={};function S(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=_[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const s=n[o],i=s.getAttribute("data-ln-field");t[i]!=null&&(s.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const s=r[o],i=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<i.length;c++){const u=i[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const a=e.querySelectorAll("[data-ln-show]");for(let o=0;o<a.length;o++){const s=a[o],i=s.getAttribute("data-ln-show");i in t&&s.classList.toggle("hidden",!t[i])}const l=e.querySelectorAll("[data-ln-class]");for(let o=0;o<l.length;o++){const s=l[o],i=s.getAttribute("data-ln-class").split(",");for(let c=0;c<i.length;c++){const u=i[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function z(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)B(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 F(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,s){return t[s]!==void 0?t[s]:""}))}const r=function(l,o){return t[o]!==void 0?t[o]:""},a=Array.from(e.querySelectorAll("*"));e.nodeType===1&&a.push(e);for(let l=0;l<a.length;l++){const o=a[l],s=o.attributes;for(let i=0;i<s.length;i++){const c=s[i];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function X(e,t,n,r,a,l){const o={};for(let i=0;i<e.children.length;i++){const c=e.children[i],u=c.getAttribute("data-ln-render-key");u&&(o[u]=c)}const s=document.createDocumentFragment();for(let i=0;i<t.length;i++){const c=t[i],u=String(r(c));let d=o[u];if(d)a(d,c,i);else{const f=S(n,l);if(!f||(F(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),a(d,c,i)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=F,window.lnCore.fill=B,window.lnCore.lnFill=z,window.lnCore.renderList=X);function w(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function Y(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function Z(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const a=r.trim().toLowerCase();return!(a==="false"||a==="0")}function ee(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const L=new Map;function te(e,t){const n=(e?e.join("|"):"")+"::"+t;if(L.has(n))return L.get(n);const r=new Set(e||[]),a=function(l,o){const s=l.getAttribute(o);return s!==null&&r.has(s)?s:t};return L.set(n,a),a}function ne(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function re(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function M(e,t,n,r,a){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 s=i=>{a?console.warn(i,a):console.warn(i)};if(o==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(s(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const i=e.values||[];return i.includes(t)?!0:(s(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(s(`[${l}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(s(`[${l}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(i){return s(`[${l}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function oe(e,t,n){for(const r in n){const[a,l,o]=n[r];Object.defineProperty(e,r,{get:function(){return a(t,l,o)},enumerable:!0,configurable:!0})}return e}function ae(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let a=r.read;if(!a&&r.type)switch(r.type){case"enum":a=te(r.values,r.fallback);break;case"integer":a=Y;break;case"float":a=ne;break;case"boolean":a=Z;break;case"list":a=ee;break;case"json":a=re;break;case"string":default:a=w;break}a||(a=w),t[r.prop]=[a,n,r.fallback]}return t}function ie(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function le(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function k(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 s of o)if(!s[n]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[n]=new r(s)}catch(i){console.error("["+n+"] init failed",s,i)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function se(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ce(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 j(){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=j(),n=e.observed||[];for(let r=0;r<n.length;r++){const a=n[r];t.byAttr.has(a)||t.byAttr.set(a,[]),t.byAttr.get(a).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 a=t.byDeclaredAttr.get(r);a.some(l=>l.componentTag===e.componentTag)||a.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=le(e);if(r===null)t.reactiveWildcard.push(e);else for(const a of r)t.byReactive.has(a)||t.byReactive.set(a,[]),t.byReactive.get(a).push(e)}e.persist&&t.persist.push(e)}function W(e,t,n,r){for(let a=0;a<e.length;a++){const l=e[a];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 ue(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=j(),a=r.byAttr.get(n);if(T()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&A(t)){const l=r.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let s=0;s<l.length;s++)M(l[s].spec,o,n,l[s].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||a)&&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&&W(l,t,n,e.oldValue),r.reactiveWildcard.length&&W(r.reactiveWildcard,t,n,e.oldValue)}if(a)for(let l=0;l<a.length;l++){const o=a[l];if(o.handler){o.handler(t,n,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,n):(k(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function fe(){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{ue(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 V(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=V();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const a=r.query,l=e.target.nodeType===1?e.target.matches(a)?e.target:e.target.closest(a):e.target.parentElement?e.target.parentElement.closest(a):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 a=0;a<t.length;a++){const l=t[a];k(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 a=0;a<t.length;a++){const l=t[a],o=l.query,s=Array.from(r.querySelectorAll(o));r.matches&&r.matches(o)&&s.push(r);for(let i=0;i<s.length;i++){const c=s[i];if(!document.contains(c)){const u=c[l.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+l.attribute+"] destroy failed",c,d)}delete c[l.attribute]}}}}}}function be(){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{ge(r)}catch(a){console.error("[ln-core] lifecycle handler failed",r.target,a)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function pe(e,t,n,r,a={}){const l=a.extraAttributes||[],o=a.onAttributeChange||null,s=a.onSubtreeChange||null,i=a.onInit||null,c=a.onAttrChange||null,u=a.effects||null,d=a.attributes||null,f=d?ie(d):u,b=d?new Set(Object.keys(d)):null,m=a.persist||null;function g(q){const p=q||document.body;if(k(p,e,t,n),d&&T())for(const y in d){const Le=d[y],O=Array.from(p.querySelectorAll("["+y+"]"));p.matches&&p.matches("["+y+"]")&&O.push(p);for(let D=0;D<O.length;D++){const R=O[D];A(R)&&M(Le,R.getAttribute(y),y,r,R)}}i&&i(p)}const h=[];if(e.indexOf("[")!==-1){const q=/\[([\w-]+)/g;let p;for(;(p=q.exec(e))!==null;)h.push(p[1])}else h.push(e);de({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:i,observed:h.concat(l),onAttributeChange:o,onAttrChange:c,effects:f,declared:b,persist:m}),fe();const Se=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";V().push({selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:s,query:Se}),be(),window[t]=g;function H(){se()>0?ce(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",H):H(),g}function P(e){return(e||"").replace(/^#/,"")}function E(e){const t=e===void 0?location.hash:e,n={},r=P(t);if(!r)return n;const a=r.split("&");for(let l=0;l<a.length;l++){const o=a[l];if(!o)continue;const s=o.indexOf(":"),i=s>-1?o.slice(0,s):o,c=s>-1?o.slice(s+1):"";if(i)try{n[i]=decodeURIComponent(c)}catch{n[i]=c}}return n}function he(e){if(!e)return null;const t=E();return e in t?t[e]:null}function we(e,t){if(!e)return;const n=E();t==null?delete n[e]:n[e]=String(t);const a=Object.keys(n).map(function(l){const o=n[l];return o===""?l:l+":"+encodeURIComponent(o)}).join("&");P(location.hash)!==a&&(location.hash=a)}function me(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ye(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 Ce(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),r=e.slice(t+1),a=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:a}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=E,window.lnCore.hashGet=he,window.lnCore.hashSet=we,window.lnCore.hashLinkClick=me,window.lnCore.resolveHashNamespace=ye,window.lnCore.hashSortEncode=Ce,window.lnCore.hashSortDecode=Ae,window.lnCore.hashFilterEncode=ve,window.lnCore.hashFilterDecode=_e),(function(){const e="data-ln-translations",t="lnTranslations";if(window[t]!==void 0)return;const n={"data-ln-translations":{type:"marker",description:"Mounts multi-language translation manager on form container"},"data-ln-translations-default":{prop:"defaultLang",read:w,type:"string",fallback:"",description:"Default primary language code (e.g. en)"},"data-ln-translations-placeholder":{prop:"placeholderLabel",read:w,type:"string",fallback:"{lang} translation",description:"Placeholder label pattern for cloned translation inputs"},"data-ln-translations-remove-label":{prop:"removeLabel",read:w,type:"string",fallback:"Remove {lang}",description:"Accessible label template for translation removal buttons"},"data-ln-translations-locales":{prop:"_localesRaw",read:w,type:"json",fallback:"",description:"JSON dictionary of supported locale codes and display labels"},"data-ln-translations-active":{type:"marker",description:"Container holding active language badge tags"},"data-ln-translations-add":{type:"string",description:"Trigger button action to add specified language translation fields"},"data-ln-translations-lang":{type:"string",description:"Language code associated with active language badge"},"data-ln-translations-prefix":{type:"string",description:"Prefix format pattern for cloned translated field names"},"data-ln-translatable":{type:"marker",description:"Marks form control as translatable into multiple languages"},"data-ln-translatable-lang":{type:"string",description:"Language code assigned to specific translatable input instance"}},r=ae(n),a={en:"English",sq:"Shqip",sr:"Srpski"};function l(o){if(this.dom=o,oe(this,o,r),this.activeLanguages=new Set,this.badgesEl=o.querySelector("[data-ln-translations-active]"),this.menuEl=o.querySelector("[data-ln-dropdown] > [data-ln-toggle]"),this.locales=a,this._localesRaw)try{this.locales=JSON.parse(this._localesRaw)}catch{console.warn("[ln-translations] Invalid JSON in data-ln-translations-locales")}this._applyDefaultLang(),this._updateDropdown();const s=this;return this._onRequestAdd=function(i){i.detail&&i.detail.lang&&s.addLanguage(i.detail.lang)},this._onRequestRemove=function(i){i.detail&&i.detail.lang&&s.removeLanguage(i.detail.lang)},o.addEventListener("ln-translations:request-add",this._onRequestAdd),o.addEventListener("ln-translations:request-remove",this._onRequestRemove),this._detectExisting(),this}l.prototype._applyDefaultLang=function(){if(!this.defaultLang)return;const o=this.dom.querySelectorAll("[data-ln-translatable]");for(const s of o){const i=s.querySelectorAll("input:not([data-ln-translatable-lang]), textarea:not([data-ln-translatable-lang]), select:not([data-ln-translatable-lang])");for(const c of i)c.setAttribute("data-ln-translatable-lang",this.defaultLang)}},l.prototype._detectExisting=function(){const o=this.dom.querySelectorAll("[data-ln-translatable-lang]");for(const s of o){const i=s.getAttribute("data-ln-translatable-lang");i&&i!==this.defaultLang&&this.activeLanguages.add(i)}this.activeLanguages.size>0&&(this._updateBadges(),this._updateDropdown())},l.prototype._updateDropdown=function(){if(!this.menuEl)return;this.menuEl.textContent="";const o=this;let s=0;for(const c in this.locales){if(!this.locales.hasOwnProperty(c)||this.activeLanguages.has(c))continue;s++;const u=S("ln-translations-menu-item","ln-translations");if(!u)return;const d=u.querySelector("[data-ln-translations-lang]");d.setAttribute("data-ln-translations-lang",c),d.textContent=this.locales[c],d.addEventListener("click",function(f){f.ctrlKey||f.metaKey||f.button===1||(f.preventDefault(),f.stopPropagation(),o.menuEl.getAttribute("data-ln-toggle")==="open"&&o.menuEl.setAttribute("data-ln-toggle","close"),o.addLanguage(c))}),this.menuEl.appendChild(u)}const i=this.dom.querySelector("[data-ln-translations-add]");i&&(i.hidden=s===0)},l.prototype._updateBadges=function(){if(!this.badgesEl)return;this.badgesEl.textContent="";const o=this;this.activeLanguages.forEach(function(s){const i=S("ln-translations-badge","ln-translations");if(!i)return;const c=i.querySelector("[data-ln-translations-lang]");c.setAttribute("data-ln-translations-lang",s);const u=c.querySelector("span");u.textContent=o.locales[s]||s.toUpperCase();const d=c.querySelector("button"),f=o.locales[s]||s.toUpperCase();d.setAttribute("aria-label",o.removeLabel.replace("{lang}",f)),d.addEventListener("click",function(b){b.ctrlKey||b.metaKey||b.button===1||(b.preventDefault(),b.stopPropagation(),o.removeLanguage(s))}),o.badgesEl.appendChild(i)})},l.prototype.addLanguage=function(o,s){if(this.activeLanguages.has(o))return;const i=this.locales[o]||o;if(N(this.dom,"ln-translations:before-add",{target:this.dom,lang:o,langName:i}).defaultPrevented)return;this.activeLanguages.add(o),s=s||{};const u=this.dom.querySelectorAll("[data-ln-translatable]");for(const d of u){const f=d.getAttribute("data-ln-translatable"),b=d.getAttribute("data-ln-translations-prefix")||"",m=d.querySelector(this.defaultLang?'[data-ln-translatable-lang="'+this.defaultLang+'"]':"input:not([data-ln-translatable-lang]), textarea:not([data-ln-translatable-lang]), select:not([data-ln-translatable-lang])");if(!m)continue;const g=m.cloneNode(m.tagName==="SELECT");b?g.name=b+"[trans]["+o+"]["+f+"]":g.name="trans["+o+"]["+f+"]",g.value=s[f]!==void 0?s[f]:"",g.removeAttribute("id"),"placeholder"in g&&(g.placeholder=this.placeholderLabel.replace("{lang}",i)),g.setAttribute("data-ln-translatable-lang",o);const h=d.querySelectorAll('[data-ln-translatable-lang]:not([data-ln-translatable-lang="'+this.defaultLang+'"])'),x=h.length>0?h[h.length-1]:m;x.parentNode.insertBefore(g,x.nextSibling)}this._updateDropdown(),this._updateBadges(),v(this.dom,"ln-translations:added",{target:this.dom,lang:o,langName:i})},l.prototype.removeLanguage=function(o){if(!this.activeLanguages.has(o)||N(this.dom,"ln-translations:before-remove",{target:this.dom,lang:o}).defaultPrevented)return;const i=this.dom.querySelectorAll('[data-ln-translatable-lang="'+o+'"]');for(const c of i)c.parentNode.removeChild(c);this.activeLanguages.delete(o),this._updateDropdown(),this._updateBadges(),v(this.dom,"ln-translations:removed",{target:this.dom,lang:o})},l.prototype.getActiveLanguages=function(){return new Set(this.activeLanguages)},l.prototype.hasLanguage=function(o){return this.activeLanguages.has(o)},l.prototype.destroy=function(){if(!this.dom[t])return;const o=this.defaultLang,s=this.dom.querySelectorAll("[data-ln-translatable-lang]");for(const i of s)i.getAttribute("data-ln-translatable-lang")!==o&&i.parentNode.removeChild(i);this.dom.removeEventListener("ln-translations:request-add",this._onRequestAdd),this.dom.removeEventListener("ln-translations:request-remove",this._onRequestRemove),delete this.dom[t]},pe(e,t,l,"ln-translations",{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 A(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(!A(r))return}e.apply(console,t)}}function v(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 N(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(i),i}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()}const $={};function H(e,t){$[e]=t}function K(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=H,window.lnCore.getDataMapper=K);function J(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const I={};function Q(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];I[n]=t}function G(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=Q,window.lnCore.getLocaleFallback=G,window.lnCore.ensureLocaleObserver=J);const _={};function x(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=_[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let o=0;o<n.length;o++){const s=n[o],a=s.getAttribute("data-ln-field");t[a]!=null&&(s.textContent=t[a])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const s=r[o],a=s.getAttribute("data-ln-attr").split(",");for(let d=0;d<a.length;d++){const u=a[d].trim().split(":");if(u.length!==2)continue;const c=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(c,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let o=0;o<i.length;o++){const s=i[o],a=s.getAttribute("data-ln-show");a in t&&s.classList.toggle("hidden",!t[a])}const l=e.querySelectorAll("[data-ln-class]");for(let o=0;o<l.length;o++){const s=l[o],a=s.getAttribute("data-ln-class").split(",");for(let d=0;d<a.length;d++){const u=a[d].trim().split(":");if(u.length!==2)continue;const c=u[0].trim(),f=u[1].trim();f in t&&s.classList.toggle(c,!!t[f])}}return e}function z(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)B(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 M(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,s){return t[s]!==void 0?t[s]:""}))}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],s=o.attributes;for(let a=0;a<s.length;a++){const d=s[a];d.value.indexOf("{{")!==-1&&o.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function X(e,t,n,r,i,l){const o={};for(let a=0;a<e.children.length;a++){const d=e.children[a],u=d.getAttribute("data-ln-render-key");u&&(o[u]=d)}const s=document.createDocumentFragment();for(let a=0;a<t.length;a++){const d=t[a],u=String(r(d));let c=o[u];if(c)i(c,d,a);else{const f=x(n,l);if(!f||(M(f,d),c=f.firstElementChild,!c))continue;c.setAttribute("data-ln-render-key",u),i(c,d,a)}s.appendChild(c)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=B,window.lnCore.lnFill=z,window.lnCore.renderList=X);function w(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function Y(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function Z(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 ee(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const S=new Map;function te(e,t){const n=(e?e.join("|"):"")+"::"+t;if(S.has(n))return S.get(n);const r=new Set(e||[]),i=function(l,o){const s=l.getAttribute(o);return s!==null&&r.has(s)?s:t};return S.set(n,i),i}function ne(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function re(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}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 s=a=>{i?console.warn(a,i):console.warn(a)};if(o==="boolean"){const a=t.trim().toLowerCase();return a!==""&&a!=="true"&&a!=="false"&&a!=="1"&&a!=="0"?(s(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const a=e.values||[];return a.includes(t)?!0:(s(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${a.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const a=parseInt(t,10);return e.min!==void 0&&a<e.min?(s(`[${l}] Value ${a} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&a>e.max?(s(`[${l}] Value ${a} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(a){return s(`[${l}] Invalid JSON for attribute "${n}": ${a.message}. Fallback: ${e.fallback}.`),!1}return!0}function oe(e,t,n){for(const r in n){const[i,l,o]=n[r];Object.defineProperty(e,r,{get:function(){return i(t,l,o)},enumerable:!0,configurable:!0})}return e}function ie(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=te(r.values,r.fallback);break;case"integer":i=Y;break;case"float":i=ne;break;case"boolean":i=Z;break;case"list":i=ee;break;case"json":i=re;break;case"string":default:i=w;break}i||(i=w),t[r.prop]=[i,n,r.fallback]}return t}function ae(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function le(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}function L(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 s of o)if(!s[n]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[n]=new r(s)}catch(a){console.error("["+n+"] init failed",s,a)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function se(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function de(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 j(){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 ce(e){const t=j(),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=le(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 W(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 ue(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=j(),i=r.byAttr.get(n);if(T()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&A(t)){const l=r.byDeclaredAttr.get(n),o=t.getAttribute(n);for(let s=0;s<l.length;s++)F(l[s].spec,o,n,l[s].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&&W(l,t,n,e.oldValue),r.reactiveWildcard.length&&W(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):(L(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function fe(){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{ue(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 U(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ge(e){const t=U();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];L(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,s=Array.from(r.querySelectorAll(o));r.matches&&r.matches(o)&&s.push(r);for(let a=0;a<s.length;a++){const d=s[a];if(!document.contains(d)){const u=d[l.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(c){console.error("["+l.attribute+"] destroy failed",d,c)}delete d[l.attribute]}}}}}}function pe(){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{ge(r)}catch(i){console.error("[ln-core] lifecycle handler failed",r.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function be(e,t,n,r,i={}){const l=i.extraAttributes||[],o=i.onAttributeChange||null,s=i.onSubtreeChange||null,a=i.onInit||null,d=i.onAttrChange||null,u=i.effects||null,c=i.attributes||null,f=c?ae(c):u,p=c?new Set(Object.keys(c)):null,m=i.persist||null;function g(q){const b=q||document.body;if(L(b,e,t,n),c&&T())for(const y in c){const Le=c[y],O=Array.from(b.querySelectorAll("["+y+"]"));b.matches&&b.matches("["+y+"]")&&O.push(b);for(let D=0;D<O.length;D++){const R=O[D];A(R)&&F(Le,R.getAttribute(y),y,r,R)}}a&&a(b)}const h=[];if(e.indexOf("[")!==-1){const q=/\[([\w-]+)/g;let b;for(;(b=q.exec(e))!==null;)h.push(b[1])}else h.push(e);ce({selector:e,attribute:t,componentTag:r,attributes:c,ComponentFn:n,onInit:a,observed:h.concat(l),onAttributeChange:o,onAttrChange:d,effects:f,declared:p,persist:m}),fe();const Se=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";U().push({selector:e,attribute:t,ComponentFn:n,onInit:a,onSubtreeChange:s,query:Se}),pe(),window[t]=g;function P(){se()>0?de(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",P):P(),g}function V(e){return(e||"").replace(/^#/,"")}function k(e){const t=e===void 0?location.hash:e,n={},r=V(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 s=o.indexOf(":"),a=s>-1?o.slice(0,s):o,d=s>-1?o.slice(s+1):"";if(a)try{n[a]=decodeURIComponent(d)}catch{n[a]=d}}return n}function he(e){if(!e)return null;const t=k();return e in t?t[e]:null}function we(e,t){if(!e)return;const n=k();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("&");V(location.hash)!==i&&(location.hash=i)}function me(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ye(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 Ce(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),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=k,window.lnCore.hashGet=he,window.lnCore.hashSet=we,window.lnCore.hashLinkClick=me,window.lnCore.resolveHashNamespace=ye,window.lnCore.hashSortEncode=Ce,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-translations",t="lnTranslations";if(window[t]!==void 0)return;const n={"data-ln-translations":{type:"marker",description:"Mounts multi-language translation manager on form container"},"data-ln-translations-default":{prop:"defaultLang",read:w,type:"string",fallback:"",description:"Default primary language code (e.g. en)"},"data-ln-translations-placeholder":{prop:"placeholderLabel",read:w,type:"string",fallback:"{lang} translation",description:"Placeholder label pattern for cloned translation inputs"},"data-ln-translations-remove-label":{prop:"removeLabel",read:w,type:"string",fallback:"Remove {lang}",description:"Accessible label template for translation removal buttons"},"data-ln-translations-locales":{prop:"_localesRaw",read:w,type:"json",fallback:"",description:"JSON dictionary of supported locale codes and display labels"},"data-ln-translations-active":{type:"marker",description:"Container holding active language badge tags"},"data-ln-translations-add":{type:"string",description:"Trigger button action to add specified language translation fields"},"data-ln-translations-lang":{type:"string",description:"Language code associated with active language badge"},"data-ln-translations-prefix":{type:"string",description:"Prefix format pattern for cloned translated field names"},"data-ln-translatable":{type:"marker",description:"Marks form control as translatable into multiple languages"},"data-ln-translatable-lang":{type:"string",description:"Language code assigned to specific translatable input instance"}},r=ie(n),i={en:"English",sq:"Shqip",sr:"Srpski"};function l(o){if(this.dom=o,oe(this,o,r),this.activeLanguages=new Set,this.badgesEl=o.querySelector("[data-ln-translations-active]"),this.menuEl=o.querySelector("[data-ln-dropdown] > [data-ln-toggle]"),this.locales=i,this._localesRaw)try{this.locales=JSON.parse(this._localesRaw)}catch{console.warn("[ln-translations] Invalid JSON in data-ln-translations-locales")}this._applyDefaultLang(),this._updateDropdown();const s=this;return this._onRequestAdd=function(a){a.detail&&a.detail.lang&&s.addLanguage(a.detail.lang)},this._onRequestRemove=function(a){a.detail&&a.detail.lang&&s.removeLanguage(a.detail.lang)},o.addEventListener("ln-translations:request-add",this._onRequestAdd),o.addEventListener("ln-translations:request-remove",this._onRequestRemove),this._detectExisting(),this}l.prototype._applyDefaultLang=function(){if(!this.defaultLang)return;const o=this.dom.querySelectorAll("[data-ln-translatable]");for(const s of o){const a=s.querySelectorAll("input:not([data-ln-translatable-lang]), textarea:not([data-ln-translatable-lang]), select:not([data-ln-translatable-lang])");for(const d of a)d.setAttribute("data-ln-translatable-lang",this.defaultLang)}},l.prototype._detectExisting=function(){const o=this.dom.querySelectorAll("[data-ln-translatable-lang]");for(const s of o){const a=s.getAttribute("data-ln-translatable-lang");a&&a!==this.defaultLang&&this.activeLanguages.add(a)}this.activeLanguages.size>0&&(this._updateBadges(),this._updateDropdown())},l.prototype._updateDropdown=function(){if(!this.menuEl)return;this.menuEl.textContent="";const o=this;let s=0;for(const d in this.locales){if(!this.locales.hasOwnProperty(d)||this.activeLanguages.has(d))continue;s++;const u=x("ln-translations-menu-item","ln-translations");if(!u)return;const c=u.querySelector("[data-ln-translations-lang]");c.setAttribute("data-ln-translations-lang",d),c.textContent=this.locales[d],c.addEventListener("click",function(f){f.ctrlKey||f.metaKey||f.button===1||(f.preventDefault(),f.stopPropagation(),o.menuEl.getAttribute("data-ln-toggle")==="open"&&o.menuEl.setAttribute("data-ln-toggle","close"),o.addLanguage(d))}),this.menuEl.appendChild(u)}const a=this.dom.querySelector("[data-ln-translations-add]");a&&(a.hidden=s===0)},l.prototype._updateBadges=function(){if(!this.badgesEl)return;this.badgesEl.textContent="";const o=this;this.activeLanguages.forEach(function(s){const a=x("ln-translations-badge","ln-translations");if(!a)return;const d=a.querySelector("[data-ln-translations-lang]");d.setAttribute("data-ln-translations-lang",s);const u=d.querySelector("span");u.textContent=o.locales[s]||s.toUpperCase();const c=d.querySelector("button"),f=o.locales[s]||s.toUpperCase();c.setAttribute("aria-label",o.removeLabel.replace("{lang}",f)),c.addEventListener("click",function(p){p.ctrlKey||p.metaKey||p.button===1||(p.preventDefault(),p.stopPropagation(),o.removeLanguage(s))}),o.badgesEl.appendChild(a)})},l.prototype.addLanguage=function(o,s){if(this.activeLanguages.has(o))return;const a=this.locales[o]||o;if(N(this.dom,"ln-translations:before-add",{target:this.dom,lang:o,langName:a}).defaultPrevented)return;this.activeLanguages.add(o),s=s||{};const u=this.dom.querySelectorAll("[data-ln-translatable]");for(const c of u){const f=c.getAttribute("data-ln-translatable"),p=c.getAttribute("data-ln-translations-prefix")||"",m=c.querySelector(this.defaultLang?'[data-ln-translatable-lang="'+this.defaultLang+'"]':"input:not([data-ln-translatable-lang]), textarea:not([data-ln-translatable-lang]), select:not([data-ln-translatable-lang])");if(!m)continue;const g=m.cloneNode(m.tagName==="SELECT");p?g.name=p+"[trans]["+o+"]["+f+"]":g.name="trans["+o+"]["+f+"]",g.value=s[f]!==void 0?s[f]:"",g.removeAttribute("id"),"placeholder"in g&&(g.placeholder=this.placeholderLabel.replace("{lang}",a)),g.setAttribute("data-ln-translatable-lang",o);const h=c.querySelectorAll('[data-ln-translatable-lang]:not([data-ln-translatable-lang="'+this.defaultLang+'"])'),E=h.length>0?h[h.length-1]:m;E.parentNode.insertBefore(g,E.nextSibling)}this._updateDropdown(),this._updateBadges(),v(this.dom,"ln-translations:added",{target:this.dom,lang:o,langName:a})},l.prototype.removeLanguage=function(o){if(!this.activeLanguages.has(o)||N(this.dom,"ln-translations:before-remove",{target:this.dom,lang:o}).defaultPrevented)return;const a=this.dom.querySelectorAll('[data-ln-translatable-lang="'+o+'"]');for(const d of a)d.parentNode.removeChild(d);this.activeLanguages.delete(o),this._updateDropdown(),this._updateBadges(),v(this.dom,"ln-translations:removed",{target:this.dom,lang:o})},l.prototype.getActiveLanguages=function(){return new Set(this.activeLanguages)},l.prototype.hasLanguage=function(o){return this.activeLanguages.has(o)},l.prototype.destroy=function(){if(!this.dom[t])return;const o=this.defaultLang,s=this.dom.querySelectorAll("[data-ln-translatable-lang]");for(const a of s)a.getAttribute("data-ln-translatable-lang")!==o&&a.parentNode.removeChild(a);this.dom.removeEventListener("ln-translations:request-add",this._onRequestAdd),this.dom.removeEventListener("ln-translations:request-remove",this._onRequestRemove),delete this.dom[t]},be(e,t,l,"ln-translations",{attributes:n})})()})();
|