@livenetworks/ashlar 2.1.11 → 2.1.13
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/README.md +25 -2
- package/components/COMPONENTS.md +82 -78
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/README.md +25 -69
- package/components/ln-core/events.js +5 -2
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +25 -44
- package/components/ln-core/reactive.js +0 -59
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/ln-debug.schema.json +28 -28
- package/components/ln-debug/src/debug-verifier.js +24 -30
- package/components/ln-debug/src/ln-debug.js +3 -11
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/src/ln-filter.js +3 -1
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/package.json +95 -85
- package/theme/README.md +73 -0
- package/theme/components/_table.scss +1 -2
- package/theme/config/_density.scss +104 -191
- package/theme/config/mixins/_avatar.scss +2 -2
- package/theme/config/mixins/_card.scss +2 -5
- package/theme/config/mixins/_form.scss +26 -39
- package/theme/config/mixins/_nav.scss +4 -4
- package/theme/config/mixins/_spacing.scss +4 -4
- package/theme/config/mixins/_table.scss +9 -33
- package/theme/tailwind/components.css +1661 -0
- package/theme/tailwind/entry.css +3 -0
- package/theme/tailwind/theme.css +23 -0
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var LnAshlarComponent=(function(C){"use strict";function j(){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 a=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){a=t[l];break}if(!S(a))return}e.apply(console,t)}}function pe(e,t){window.lnCore=window.lnCore||{},window.lnCore._debugSink=e,window.lnCore._debugIsContained=t||null}function he(e,t,n){const a=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,a),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:a}))}function h(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){h(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function be(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function me(e,t){const n=!!(t&&t.typed),a=t&&t.exclude,l={},i=e.elements,r={};if(n)for(let d=0;d<i.length;d++){const o=i[d];o.name&&o.type==="checkbox"&&!o.disabled&&(r[o.name]=(r[o.name]||0)+1)}for(let d=0;d<i.length;d++){const o=i[d];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(a&&o.matches&&o.matches(a)))if(o.type==="checkbox")n&&r[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let s=0;s<o.options.length;s++)o.options[s].selected&&l[o.name].push(o.options[s].value)}else if(n&&o.type==="hidden")l[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const s=Number(o.value);l[o.name]=o.value===""||isNaN(s)?null:s}else l[o.name]=o.value}return l}function ge(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ye(e,t){const n=e.elements,a=[],l={};for(let i=0;i<n.length;i++){const r=n[i];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let i=0;i<n.length;i++){const r=n[i];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const d=r.getAttribute("data-ln-fill-as")||r.name;if(!d||!(d in t))continue;const o=t[d];if(r.type==="checkbox"){if(Array.isArray(o))r.checked=o.indexOf(r.value)!==-1;else if(l[r.name]>1){const s=String(o).split(",").map(function(c){return c.trim()});r.checked=s.indexOf(r.value)!==-1}else r.checked=ge(o);a.push(r)}else if(r.type==="radio")r.checked=r.value===String(o),a.push(r);else if(r.type==="select-multiple"){if(Array.isArray(o))for(let s=0;s<r.options.length;s++)r.options[s].selected=o.indexOf(r.options[s].value)!==-1;a.push(r)}else r.value=o,r.tagName==="SELECT"&&o!=null&&r.setAttribute("data-ln-value",o),a.push(r)}return a}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ye,window.lnCore.serializeForm=me,window.lnCore.resolveFormMethod=be);const B={};function Ce(e,t){B[e]=t}function Ae(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ce,window.lnCore.getDataMapper=Ae);function ve(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,h(function(){new MutationObserver(function(){he(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const W={};function Se(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];W[n]=t}function xe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return W[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Se,window.lnCore.getLocaleFallback=xe,window.lnCore.ensureLocaleObserver=ve);const x={};function ke(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=x[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function U(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let r=0;r<n.length;r++){const d=n[r],o=d.getAttribute("data-ln-field");t[o]!=null&&(d.textContent=t[o])}const a=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<a.length;r++){const d=a[r],o=d.getAttribute("data-ln-attr").split(",");for(let s=0;s<o.length;s++){const c=o[s].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();t[f]!=null&&d.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const d=l[r],o=d.getAttribute("data-ln-show");o in t&&d.classList.toggle("hidden",!t[o])}const i=e.querySelectorAll("[data-ln-class]");for(let r=0;r<i.length;r++){const d=i[r],o=d.getAttribute("data-ln-class").split(",");for(let s=0;s<o.length;s++){const c=o[s].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();f in t&&d.classList.toggle(u,!!t[f])}}return e}function _e(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 a=0;a<n.length;a++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[a],t??null),n[a].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)U(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 V(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,d){return t[d]!==void 0?t[d]:""}))}const a=function(i,r){return t[r]!==void 0?t[r]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let i=0;i<l.length;i++){const r=l[i],d=r.attributes;for(let o=0;o<d.length;o++){const s=d[o];s.value.indexOf("{{")!==-1&&r.setAttribute(s.name,s.value.replace(/\{\{\s*(\w+)\s*\}\}/g,a))}}return e}function De(e,t,n,a,l,i){const r={};for(let o=0;o<e.children.length;o++){const s=e.children[o],c=s.getAttribute("data-ln-render-key");c&&(r[c]=s)}const d=document.createDocumentFragment();for(let o=0;o<t.length;o++){const s=t[o],c=String(a(s));let u=r[c];if(u)l(u,s,o);else{const f=ke(n,i);if(!f||(V(f,s),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",c),l(u,s,o)}d.appendChild(u)}e.textContent="",e.appendChild(d)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=V,window.lnCore.fill=U,window.lnCore.lnFill=_e,window.lnCore.renderList=De);function k(e,t,n){const a=e.getAttribute(t);return a===null?n:a}function H(e,t,n){const a=parseInt(e.getAttribute(t),10);return isNaN(a)?n:a}function z(e,t,n=!1){const a=e.getAttribute(t);if(a===null)return!!n;const l=a.trim().toLowerCase();return!(l==="false"||l==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const _=new Map;function Q(e,t){const n=(e?e.join("|"):"")+"::"+t;if(_.has(n))return _.get(n);const a=new Set(e||[]),l=function(i,r){const d=i.getAttribute(r);return d!==null&&a.has(d)?d:t};return _.set(n,l),l}function P(e,t,n){const a=parseFloat(e.getAttribute(t));return isNaN(a)?n:a}function J(e,t,n){const a=e.getAttribute(t);if(!a)return n;try{return JSON.parse(a)}catch{return n}}function K(e,t,n,a,l){if(!e||t===null)return!0;const i=a||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const d=o=>{l?console.warn(o,l):console.warn(o)};if(r==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(d(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const o=e.values||[];return o.includes(t)?!0:(d(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return d(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(d(`[${i}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(d(`[${i}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(d(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(o){return d(`[${i}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function Ee(e,t,n){for(const a in n){const[l,i,r]=n[a];Object.defineProperty(e,a,{get:function(){return l(t,i,r)},enumerable:!0,configurable:!0})}return e}function qe(e){const t={};for(const n in e){const a=e[n];if(!a||!a.prop)continue;let l=a.read;if(!l&&a.type)switch(a.type){case"enum":l=Q(a.values,a.fallback);break;case"integer":l=H;break;case"float":l=P;break;case"boolean":l=z;break;case"list":l=G;break;case"json":l=J;break;case"string":default:l=k;break}l||(l=k),t[a.prop]=[l,n,a.fallback]}return t}function Ie(e){const t={};for(const n in e){const a=e[n];a&&a.effect&&(t[n]=a.effect)}return Object.keys(t).length?t:null}function $e(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Ee,window.lnCore.attrSpec=qe,window.lnCore.attrStr=k,window.lnCore.attrInt=H,window.lnCore.attrBool=z,window.lnCore.attrList=G,window.lnCore.attrEnum=Q,window.lnCore.attrFloat=P,window.lnCore.attrJson=J);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function X(e,t,n,a){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:n,ComponentFn:a};if(e.matches&&e.matches(i)&&b(e,r),e.querySelectorAll){const d=e.querySelectorAll(i);for(let o=0;o<d.length;o++)b(d[o],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Y(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Z(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 ee(){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 te(e){const t=ee(),n=e.observed||[];for(let a=0;a<n.length;a++){const l=n[a];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const a in e.attributes){t.byDeclaredAttr.has(a)||t.byDeclaredAttr.set(a,[]);const l=t.byDeclaredAttr.get(a);l.some(i=>i.componentTag===e.componentTag)||l.push({spec:e.attributes[a],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const a=$e(e);if(a===null)t.reactiveWildcard.push(e);else for(const l of a)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function ne(e,t,n,a){for(let l=0;l<e.length;l++){const i=e[l];if(!t[i.attribute])continue;const r=i.effects&&i.effects[n];r?r(t,n,a):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,a)}}function Le(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,a=ee(),l=a.byAttr.get(t),i=j()&&a.byDeclaredAttr&&a.byDeclaredAttr.has(t);if(!n&&!l&&!i)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(i&&S(r)){const d=a.byDeclaredAttr.get(t),o=r.getAttribute(t);for(let s=0;s<d.length;s++)K(d[s].spec,o,t,d[s].componentTag,r)}if(window.lnCore._debugSink&&(n||l)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),n){const d=a.byReactive.get(t);d&&ne(d,r,t,e.oldValue),a.reactiveWildcard.length&&ne(a.reactiveWildcard,r,t,e.oldValue)}if(l)for(let d=0;d<l.length;d++){const o=l[d];if(o.handler){o.handler(r,t,e.oldValue);continue}o.onAttributeChange&&r[o.attribute]?o.onAttributeChange(r,t):(X(r,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(r))}}}function ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,h(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Le(t[n])}catch(a){console.error("[ln-core] mutation handler failed",t[n].target,a)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function D(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function q(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(a){console.error("["+t.attribute+"] destroy failed",e,a)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=D();if(!t.length)return;const n=e.target;if(n){const l=n.nodeType===1?n:n.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const a=E();if(e.target&&a.length)for(let l=0;l<a.length;l++){const i=a[l],r=i.query,d=e.target.nodeType===1?e.target.matches&&e.target.matches(r)?e.target:e.target.closest?e.target.closest(r):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(r):null;d&&i.onSubtreeChange(d,e)}for(let l=0;l<e.addedNodes.length;l++){const i=e.addedNodes[l];if(i.nodeType===1){const r=!!(i.firstElementChild||i.children&&i.children.length);for(let d=0;d<t.length;d++){const o=t[d];if(o.selector&&o.attribute&&o.ComponentFn){if(!r)i.matches&&i.matches(o.query)&&b(i,o);else if(i.matches&&i.matches(o.query)&&b(i,o),i.querySelectorAll){const s=i.querySelectorAll(o.query);for(let c=0;c<s.length;c++)b(s[c],o)}}o.onInit&&o.onInit(i)}}}for(let l=0;l<e.removedNodes.length;l++){const i=e.removedNodes[l];if(i.nodeType===1){if(document.contains(i))continue;const r=!!(i.firstElementChild||i.children&&i.children.length);for(let d=0;d<t.length;d++){const o=t[d],s=o.query;if(s){if(!r)i.matches&&i.matches(s)&&q(i,o);else if(i.matches&&i.matches(s)&&q(i,o),i.querySelectorAll){const c=i.querySelectorAll(s);for(let u=0;u<c.length;u++)q(c[u],o)}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,h(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const a=t[n];if(a.type==="childList")try{oe(a)}catch(l){console.error("[ln-core] lifecycle handler failed",a.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let a=0;a<n.length;a++){const l=n[a];if(l.type==="childList")try{oe(l)}catch(i){console.error("[ln-core] lifecycle handler failed",l.target,i)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Te(e,t){te({observed:e,handler:t}),ae()}function Re(e){D().push(e),e.onSubtreeChange&&e.query&&E().push(e),re()}function le(e,t,n,a,l={}){const i=l.extraAttributes||[],r=l.onAttributeChange||null,d=l.onSubtreeChange||null,o=l.onInit||null,s=l.onAttrChange||null,c=l.effects||null,u=l.attributes||null,f=u?Ie(u):c,O=u?new Set(Object.keys(u)):null,ct=l.persist||null;function v(R){const w=R||document.body;if(X(w,e,t,n),u&&j())for(const y in u){const ft=u[y],F=Array.from(w.querySelectorAll("["+y+"]"));w.matches&&w.matches("["+y+"]")&&F.push(w);for(let M=0;M<F.length;M++){const N=F[M];S(N)&&K(ft,N.getAttribute(y),y,a,N)}}o&&o(w)}const T=[];if(e.indexOf("[")!==-1){const R=/\[([\w-]+)/g;let w;for(;(w=R.exec(e))!==null;)T.push(w[1])}else T.push(e);te({selector:e,attribute:t,componentTag:a,attributes:u,ComponentFn:n,onInit:o,observed:T.concat(i),onAttributeChange:r,onAttrChange:s,effects:f,declared:O,persist:ct}),ae();const ut=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ue=l.subtreeQuery||(ut?e:"["+e+"]"),fe={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:d,query:ue};D().push(fe),d&&ue&&E().push(fe),re(),window[t]=v,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le,window.lnCore.observeLifecycle=Re,window.lnCore.withoutLifecycle=Oe);function we(){Y()>0?Z(function(){v(document.body)}):v(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",we):we(),v}function ie(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,n={},a=ie(t);if(!a)return n;const l=a.split("&");for(let i=0;i<l.length;i++){const r=l[i];if(!r)continue;const d=r.indexOf(":"),o=d>-1?r.slice(0,d):r,s=d>-1?r.slice(d+1):"";if(o)try{n[o]=decodeURIComponent(s)}catch{n[o]=s}}return n}function Fe(e){if(!e)return null;const t=I();return e in t?t[e]:null}function Me(e,t){if(!e)return;const n=I();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(i){const r=n[i];return r===""?i:i+":"+encodeURIComponent(r)}).join("&");ie(location.hash)!==l&&(location.hash=l)}function Ne(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function je(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const a=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return a?t?a+"-"+t:a:t||null}function Be(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 Ue(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ve(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),a=e.slice(t+1),l=a?a.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=Fe,window.lnCore.hashSet=Me,window.lnCore.hashLinkClick=Ne,window.lnCore.resolveHashNamespace=je,window.lnCore.hashSortEncode=Be,window.lnCore.hashSortDecode=We,window.lnCore.hashFilterEncode=Ue,window.lnCore.hashFilterDecode=Ve);function He(e){return(e||"").replace(/^\?/,"")}function ze(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},a=He(t);if(!a)return n;const l=new URLSearchParams(a);for(const[i,r]of l.entries())n[i]=r;return n}function Ge(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Qe(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const a=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",a)}function Pe(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const a=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return a?t?a+"_"+t:a:t||null}function Je(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ke(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const a=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:a}}}return null}function Xe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ye(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=ze,window.lnCore.queryGet=Ge,window.lnCore.querySet=Qe,window.lnCore.resolveQueryParam=Pe,window.lnCore.querySortEncode=Je,window.lnCore.querySortDecode=Ke,window.lnCore.queryFilterEncode=Xe,window.lnCore.queryFilterDecode=Ye);function Ze(){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=Ze);const $=new Set(["data-ln-accordion","data-ln-ajax","data-ln-api-base-url","data-ln-api-connector","data-ln-api-connector-query-debounce","data-ln-api-endpoint","data-ln-api-headers","data-ln-api-param-limit","data-ln-api-param-offset","data-ln-api-param-search","data-ln-api-param-sort-dir","data-ln-api-param-sort-field","data-ln-api-path","data-ln-api-queue","data-ln-api-queue-online","data-ln-attr","data-ln-autoresize","data-ln-autosave","data-ln-autosave-clear","data-ln-autosave-debounce-input","data-ln-autosave-exclude","data-ln-chart","data-ln-chart-area","data-ln-chart-count","data-ln-chart-empty","data-ln-chart-labels","data-ln-chart-line","data-ln-chart-max","data-ln-chart-min","data-ln-chart-padding","data-ln-chart-plot","data-ln-chart-sort","data-ln-chart-source","data-ln-chart-type","data-ln-chart-x","data-ln-chart-y","data-ln-chart-zero","data-ln-circular-progress","data-ln-circular-progress-label","data-ln-circular-progress-max","data-ln-class","data-ln-col","data-ln-confirm","data-ln-confirm-active","data-ln-confirm-announcer","data-ln-confirm-idle","data-ln-confirm-state","data-ln-confirm-timeout","data-ln-connector","data-ln-couchdb-auth","data-ln-couchdb-connector","data-ln-couchdb-db","data-ln-couchdb-headers","data-ln-couchdb-url","data-ln-data-coordinator","data-ln-data-coordinator-connector","data-ln-data-coordinator-filters","data-ln-data-coordinator-mapper","data-ln-data-coordinator-no-autosync","data-ln-data-coordinator-scope","data-ln-data-coordinator-search","data-ln-data-coordinator-sort-direction","data-ln-data-coordinator-sort-field","data-ln-data-coordinator-stale","data-ln-data-store","data-ln-data-store-frozen","data-ln-data-store-indexes","data-ln-data-store-no-autosync","data-ln-data-store-no-local-query","data-ln-data-store-search-fields","data-ln-data-store-seed","data-ln-data-store-stale","data-ln-data-store-window","data-ln-data-store-window-page","data-ln-date","data-ln-date-dict","data-ln-date-dict-key","data-ln-date-field","data-ln-date-format","data-ln-date-label","data-ln-date-locale","data-ln-debug","data-ln-dropdown","data-ln-dropdown-menu","data-ln-dropdown-placement","data-ln-dropdown-position","data-ln-editor","data-ln-editor-action","data-ln-editor-source","data-ln-empty","data-ln-empty-state","data-ln-empty-when","data-ln-error","data-ln-external-link","data-ln-field","data-ln-fill-as","data-ln-fill-form","data-ln-fill-id","data-ln-fillable","data-ln-filter","data-ln-filter-col","data-ln-filter-hide","data-ln-filter-key","data-ln-filter-options","data-ln-filter-reset","data-ln-filter-search","data-ln-filter-target","data-ln-filter-value","data-ln-filter-values","data-ln-form","data-ln-form-action-edit","data-ln-form-action-method","data-ln-hash","data-ln-include","data-ln-initial-value","data-ln-item","data-ln-item-action","data-ln-item-id","data-ln-item-select","data-ln-key","data-ln-key-allow-input","data-ln-key-for","data-ln-key-modifier","data-ln-key-target","data-ln-link","data-ln-list","data-ln-list-body","data-ln-list-count","data-ln-list-empty","data-ln-list-field","data-ln-list-filtered","data-ln-list-select-all","data-ln-list-selectable","data-ln-list-selected","data-ln-list-source","data-ln-list-total","data-ln-list-window","data-ln-list-window-page","data-ln-list-window-threshold","data-ln-modal","data-ln-modal-close","data-ln-modal-for","data-ln-modal-mode","data-ln-modal-when","data-ln-nav","data-ln-nav-exact","data-ln-number","data-ln-number-decimals","data-ln-number-max","data-ln-number-min","data-ln-obfuscator","data-ln-obfuscator-codec","data-ln-obfuscator-key","data-ln-options","data-ln-options-label","data-ln-options-value","data-ln-outlet","data-ln-panel","data-ln-persist","data-ln-persist-scope","data-ln-picklist","data-ln-picklist-list","data-ln-picklist-max","data-ln-popover","data-ln-popover-for","data-ln-popover-placement","data-ln-popover-position","data-ln-progress","data-ln-progress-max","data-ln-query","data-ln-render-key","data-ln-route","data-ln-route-keep","data-ln-route-target","data-ln-route-title","data-ln-router-base","data-ln-router-hydrate","data-ln-scroll","data-ln-scroll-behavior","data-ln-scroll-block","data-ln-scroll-delay","data-ln-scroll-focus","data-ln-scroll-set","data-ln-scroll-update-hash","data-ln-search","data-ln-search-clear","data-ln-search-clear-for","data-ln-search-exclude","data-ln-search-fields","data-ln-search-for","data-ln-search-hide","data-ln-search-items","data-ln-show","data-ln-slug-from","data-ln-sort","data-ln-sort-dir","data-ln-sort-exclude","data-ln-sort-field","data-ln-sort-icon","data-ln-sort-items","data-ln-sort-state","data-ln-sortable","data-ln-sortable-handle","data-ln-stat","data-ln-stat-card","data-ln-stat-filter","data-ln-stat-label","data-ln-stat-trend","data-ln-stat-value","data-ln-step","data-ln-step-label","data-ln-stepper","data-ln-store","data-ln-tab","data-ln-table","data-ln-table-body","data-ln-table-cell-attr","data-ln-table-clear","data-ln-table-clear-all","data-ln-table-col","data-ln-table-col-filter","data-ln-table-col-select","data-ln-table-col-sort","data-ln-table-coordinator","data-ln-table-dict","data-ln-table-empty","data-ln-table-empty-when","data-ln-table-filter-col","data-ln-table-filtered","data-ln-table-loading","data-ln-table-row","data-ln-table-row-action","data-ln-table-row-id","data-ln-table-row-select","data-ln-table-select-all-label","data-ln-table-selectable","data-ln-table-selected","data-ln-table-sort","data-ln-table-source","data-ln-table-total","data-ln-table-window","data-ln-tabs","data-ln-tabs-active","data-ln-tabs-default","data-ln-tabs-focus","data-ln-tabs-key","data-ln-template","data-ln-time","data-ln-time-locale","data-ln-toast","data-ln-toast-close","data-ln-toast-item","data-ln-toast-max","data-ln-toast-timeout","data-ln-toast-when","data-ln-toggle","data-ln-toggle-action","data-ln-toggle-for","data-ln-tooltip","data-ln-tooltip-enhance","data-ln-tooltip-enhanced","data-ln-tooltip-placement","data-ln-tooltip-position","data-ln-translatable","data-ln-translatable-lang","data-ln-translations","data-ln-translations-active","data-ln-translations-add","data-ln-translations-default","data-ln-translations-lang","data-ln-translations-locales","data-ln-translations-placeholder","data-ln-translations-prefix","data-ln-translations-remove-label","data-ln-ui-coordinator","data-ln-upload","data-ln-upload-accept","data-ln-upload-action","data-ln-upload-delete","data-ln-upload-dict","data-ln-upload-ext","data-ln-upload-file-field","data-ln-upload-id","data-ln-upload-ids-field","data-ln-upload-item","data-ln-upload-list","data-ln-upload-local-id","data-ln-upload-max-files","data-ln-upload-max-size","data-ln-upload-progress","data-ln-upload-size","data-ln-upload-state","data-ln-upload-zone","data-ln-validate","data-ln-validate-error","data-ln-validate-errors","data-ln-value","data-ln-websocket-connector","data-ln-websocket-connector-url"]);function et(e,t){if(e===t)return 0;if(!e.length)return t.length;if(!t.length)return e.length;const n=[];for(let a=0;a<=t.length;a++)n[a]=[a];for(let a=0;a<=e.length;a++)n[0][a]=a;for(let a=1;a<=t.length;a++)for(let l=1;l<=e.length;l++)t.charAt(a-1)===e.charAt(l-1)?n[a][l]=n[a-1][l-1]:n[a][l]=Math.min(n[a-1][l-1]+1,n[a][l-1]+1,n[a-1][l]+1);return n[t.length][e.length]}function tt(e,t=$){if(t.has(e))return null;let n=null,a=1/0;for(const i of t){const r=et(e,i);r<a&&(a=r,n=i)}const l=Math.max(3,Math.floor(e.length*.4));return a<=l?n:null}function de(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/([!"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function nt(e=document){const t=e.ownerDocument||e,n=e.nodeType===9?e.body||e.documentElement:e;if(!n)return[];const a=[],l=[n,...n.querySelectorAll("*")];for(let i=0;i<l.length;i++){const r=l[i];if(r.attributes)for(let d=0;d<r.attributes.length;d++){const o=r.attributes[d];if(o.name.startsWith("data-ln-")&&o.name.endsWith("-for")){const s=(o.value||"").trim();if(!s){a.push({type:"id-empty",element:r,attribute:o.name,targetId:"",message:`[ln-debug] Empty ID reference in <${r.tagName.toLowerCase()} ${o.name}="">.`});continue}t.getElementById(s)||t.querySelector("#"+de(s))||a.push({type:"id-unresolved",element:r,attribute:o.name,targetId:s,message:`[ln-debug] Unresolved ID reference: <${r.tagName.toLowerCase()} ${o.name}="${s}"> targets "#${s}", but no element with id="${s}" exists in the document.`})}}}return a}function at(e=document){const t=e.ownerDocument||e,n=e.nodeType===9?e.body||e.documentElement:e;if(!n)return[];const a=[],l=[n,...n.querySelectorAll("*")];for(let i=0;i<l.length;i++){const r=l[i];if(r.attributes)for(let d=0;d<r.attributes.length;d++){const o=r.attributes[d];if(o.name.startsWith("data-ln-")&&(o.name.endsWith("-source")||o.name.endsWith("-store"))&&o.name!=="data-ln-data-store"){const c=(o.value||"").trim();if(!c){a.push({type:"store-empty",element:r,attribute:o.name,storeName:"",message:`[ln-debug] Empty store reference in <${r.tagName.toLowerCase()} ${o.name}="">.`});continue}const u=de(c),f=t.querySelector(`[data-ln-data-store="${u}"], [data-ln-store="${u}"]`),O=typeof window<"u"&&window.lnDataStore&&typeof window.lnDataStore.getStore=="function"&&window.lnDataStore.getStore(c);!f&&!O&&a.push({type:"store-unresolved",element:r,attribute:o.name,storeName:c,message:`[ln-debug] Unresolved store reference: <${r.tagName.toLowerCase()} ${o.name}="${c}"> targets store "${c}", but no [data-ln-data-store="${c}"] exists in the document.`})}}}return a}function ot(e=document){e.ownerDocument;const t=e.nodeType===9?e.body||e.documentElement:e;if(!t)return[];const n=[],a=Array.from(t.querySelectorAll("[data-ln-data-store]"));t.hasAttribute&&t.hasAttribute("data-ln-data-store")&&a.unshift(t);const l=new Map;for(let i=0;i<a.length;i++){const r=a[i],d=(r.getAttribute("data-ln-data-store")||"").trim();d&&(l.has(d)||l.set(d,[]),l.get(d).push(r))}for(const[i,r]of l.entries())r.length>1&&n.push({type:"store-duplicate",storeName:i,elements:r,message:`[ln-debug] Duplicate store name: Multiple elements declare data-ln-data-store="${i}". Store names must be unique across the document.`});return n}function rt(e=document,t=$){const n=e.nodeType===9?e.body||e.documentElement:e;if(!n)return[];const a=[],l=[n,...n.querySelectorAll("*")];for(let i=0;i<l.length;i++){const r=l[i];if(r.attributes)for(let d=0;d<r.attributes.length;d++){const o=r.attributes[d];if(o.name.startsWith("data-ln-")&&!t.has(o.name)){const s=tt(o.name,t),c=s?` Did you mean "${s}"?`:"";a.push({type:"attribute-unknown",element:r,attribute:o.name,suggestion:s,message:`[ln-debug] Unknown attribute "${o.name}" on <${r.tagName.toLowerCase()}>.${c}`})}}}return a}function A(e=typeof document<"u"?document:null,t={}){if(!e)return{idIssues:[],storeIssues:[],uniquenessIssues:[],spellingIssues:[],total:0};const n=t.validAttributes||$,a=nt(e),l=at(e),i=ot(e),r=rt(e,n),d=[...a,...l,...i,...r];if(!t.silent)for(let o=0;o<d.length;o++)console.warn(d[o].message);return{idIssues:a,storeIssues:l,uniquenessIssues:i,spellingIssues:r,total:d.length}}let m=null;function g(e=typeof document<"u"?document:null,t=50,n=null){if(!e)return;m&&(clearTimeout(m),m=null);function a(){m=setTimeout(()=>{m=null;const l=A(e);n&&n(l)},t)}Y()>0?Z(a):a()}function lt(e,t,n,a){e==="event"?(console.groupCollapsed("[ln-debug] event",t),console.log("target",n),console.log("detail",a),console.groupEnd()):e==="attr"&&(console.groupCollapsed("[ln-debug] attr",t),console.log("target",n),console.log("old → new",a.oldValue,"→",a.newValue),console.groupEnd())}let p=[];function it(){p=Array.from(document.body.querySelectorAll("[data-ln-debug]")),document.body.hasAttribute("data-ln-debug")&&p.push(document.body)}function se(e){if(e===window||e===document)return p.indexOf(document.body)!==-1;for(let t=0;t<p.length;t++)if(p[t].contains(e))return!0;return!1}function dt(e,t,n,a){se(n)&<(e,t,n,a)}function L(){it(),pe(p.length>0?dt:null,p.length>0?se:null)}function ce(){L()}function st(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._debugGateBound&&(window.lnCore._debugGateBound=!0,h(function(){L(),Te(["data-ln-debug"],L)},"ln-debug")))}return(function(){const e="data-ln-debug",t="lnDebug";if(typeof window<"u"&&window[t]!==void 0)return;const n={"data-ln-debug":{type:"marker",description:"Enables developer diagnostics overlay, live validation badges, and inspection logging"}};st();function a(i){return this.dom=i,g(i.ownerDocument||document),ce(),this}a.prototype.verify=function(i,r){return A(i||(this.dom?this.dom.ownerDocument||this.dom:document),r)},a.prototype.destroy=function(){delete this.dom[t],ce()};const l=le(e,t,a,"ln-debug",{attributes:n,onInit:function(i){typeof document<"u"&&g(i&&i.ownerDocument?i.ownerDocument:document)},onSubtreeChange:function(i){typeof document<"u"&&g(i&&i.ownerDocument?i.ownerDocument:document)}});l.verify=function(i,r){return A(i||document,r)},l.schedule=function(i,r,d){return g(i||document,r,d)}})(),C.scheduleVerification=g,C.verifyDOM=A,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"}),C})({});
|
|
1
|
+
var LnAshlarComponent=(function(g){"use strict";function v(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function 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 a=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){a=t[l];break}if(!S(a))return}e.apply(console,t)}}function pe(e,t){window.lnCore=window.lnCore||{},window.lnCore._debugSink=e,window.lnCore._debugIsContained=t||null}function he(e,t,n){const a=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,a),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:a}))}function h(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){h(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function be(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function me(e,t){const n=!!(t&&t.typed),a=t&&t.exclude,l={},i=e.elements,r={};if(n)for(let d=0;d<i.length;d++){const o=i[d];o.name&&o.type==="checkbox"&&!o.disabled&&(r[o.name]=(r[o.name]||0)+1)}for(let d=0;d<i.length;d++){const o=i[d];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(a&&o.matches&&o.matches(a)))if(o.type==="checkbox")n&&r[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let s=0;s<o.options.length;s++)o.options[s].selected&&l[o.name].push(o.options[s].value)}else if(n&&o.type==="hidden")l[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const s=Number(o.value);l[o.name]=o.value===""||isNaN(s)?null:s}else l[o.name]=o.value}return l}function ge(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ye(e,t){const n=e.elements,a=[],l={};for(let i=0;i<n.length;i++){const r=n[i];r.name&&r.type==="checkbox"&&(l[r.name]=(l[r.name]||0)+1)}for(let i=0;i<n.length;i++){const r=n[i];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const d=r.getAttribute("data-ln-fill-as")||r.name;if(!d||!(d in t))continue;const o=t[d];if(r.type==="checkbox"){if(Array.isArray(o))r.checked=o.indexOf(r.value)!==-1;else if(l[r.name]>1){const s=String(o).split(",").map(function(c){return c.trim()});r.checked=s.indexOf(r.value)!==-1}else r.checked=ge(o);a.push(r)}else if(r.type==="radio")r.checked=r.value===String(o),a.push(r);else if(r.type==="select-multiple"){if(Array.isArray(o))for(let s=0;s<r.options.length;s++)r.options[s].selected=o.indexOf(r.options[s].value)!==-1;a.push(r)}else r.value=o,r.tagName==="SELECT"&&o!=null&&r.setAttribute("data-ln-value",o),a.push(r)}return a}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ye,window.lnCore.serializeForm=me,window.lnCore.resolveFormMethod=be);const j={};function Ce(e,t){j[e]=t}function Ae(e){return j[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ce,window.lnCore.getDataMapper=Ae);function ve(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,h(function(){new MutationObserver(function(){he(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const B={};function Se(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];B[n]=t}function xe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return B[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Se,window.lnCore.getLocaleFallback=xe,window.lnCore.ensureLocaleObserver=ve);const x={};function ke(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=x[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function W(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let r=0;r<n.length;r++){const d=n[r],o=d.getAttribute("data-ln-field");t[o]!=null&&(d.textContent=t[o])}const a=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<a.length;r++){const d=a[r],o=d.getAttribute("data-ln-attr").split(",");for(let s=0;s<o.length;s++){const c=o[s].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();t[f]!=null&&d.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let r=0;r<l.length;r++){const d=l[r],o=d.getAttribute("data-ln-show");o in t&&d.classList.toggle("hidden",!t[o])}const i=e.querySelectorAll("[data-ln-class]");for(let r=0;r<i.length;r++){const d=i[r],o=d.getAttribute("data-ln-class").split(",");for(let s=0;s<o.length;s++){const c=o[s].trim().split(":");if(c.length!==2)continue;const u=c[0].trim(),f=c[1].trim();f in t&&d.classList.toggle(u,!!t[f])}}return e}function _e(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 a=0;a<n.length;a++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[a],t??null),n[a].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)W(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 U(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const i=n.currentNode;i.textContent.indexOf("{{")!==-1&&(i.textContent=i.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,d){return t[d]!==void 0?t[d]:""}))}const a=function(i,r){return t[r]!==void 0?t[r]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let i=0;i<l.length;i++){const r=l[i],d=r.attributes;for(let o=0;o<d.length;o++){const s=d[o];s.value.indexOf("{{")!==-1&&r.setAttribute(s.name,s.value.replace(/\{\{\s*(\w+)\s*\}\}/g,a))}}return e}function Ee(e,t,n,a,l,i){const r={};for(let o=0;o<e.children.length;o++){const s=e.children[o],c=s.getAttribute("data-ln-render-key");c&&(r[c]=s)}const d=document.createDocumentFragment();for(let o=0;o<t.length;o++){const s=t[o],c=String(a(s));let u=r[c];if(u)l(u,s,o);else{const f=ke(n,i);if(!f||(U(f,s),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",c),l(u,s,o)}d.appendChild(u)}e.textContent="",e.appendChild(d)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=W,window.lnCore.lnFill=_e,window.lnCore.renderList=Ee);function k(e,t,n){const a=e.getAttribute(t);return a===null?n:a}function V(e,t,n){const a=parseInt(e.getAttribute(t),10);return isNaN(a)?n:a}function H(e,t,n=!1){const a=e.getAttribute(t);if(a===null)return!!n;const l=a.trim().toLowerCase();return!(l==="false"||l==="0")}function z(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const _=new Map;function G(e,t){const n=(e?e.join("|"):"")+"::"+t;if(_.has(n))return _.get(n);const a=new Set(e||[]),l=function(i,r){const d=i.getAttribute(r);return d!==null&&a.has(d)?d:t};return _.set(n,l),l}function Q(e,t,n){const a=parseFloat(e.getAttribute(t));return isNaN(a)?n:a}function P(e,t,n){const a=e.getAttribute(t);if(!a)return n;try{return JSON.parse(a)}catch{return n}}function J(e,t,n,a,l){if(!e||t===null)return!0;const i=a||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const d=o=>{l?console.warn(o,l):console.warn(o)};if(r==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(d(`[${i}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const o=e.values||[];return o.includes(t)?!0:(d(`[${i}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return d(`[${i}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(d(`[${i}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(d(`[${i}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(d(`[${i}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(o){return d(`[${i}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function De(e,t,n){for(const a in n){const[l,i,r]=n[a];Object.defineProperty(e,a,{get:function(){return l(t,i,r)},enumerable:!0,configurable:!0})}return e}function Ie(e){const t={};for(const n in e){const a=e[n];if(!a||!a.prop)continue;let l=a.read;if(!l&&a.type)switch(a.type){case"enum":l=G(a.values,a.fallback);break;case"integer":l=V;break;case"float":l=Q;break;case"boolean":l=H;break;case"list":l=z;break;case"json":l=P;break;case"string":default:l=k;break}l||(l=k),t[a.prop]=[l,n,a.fallback]}return t}function qe(e){const t={};for(const n in e){const a=e[n];a&&a.effect&&(t[n]=a.effect)}return Object.keys(t).length?t:null}function $e(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=De,window.lnCore.attrSpec=Ie,window.lnCore.attrStr=k,window.lnCore.attrInt=V,window.lnCore.attrBool=H,window.lnCore.attrList=z,window.lnCore.attrEnum=G,window.lnCore.attrFloat=Q,window.lnCore.attrJson=P);function y(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function K(e,t,n,a){if(e.nodeType!==1)return;const i=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:n,ComponentFn:a};if(e.matches&&e.matches(i)&&y(e,r),e.querySelectorAll){const d=e.querySelectorAll(i);for(let o=0;o<d.length;o++)y(d[o],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function X(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Y(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 Z(){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 ee(e){const t=Z(),n=e.observed||[];for(let a=0;a<n.length;a++){const l=n[a];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const a in e.attributes){t.byDeclaredAttr.has(a)||t.byDeclaredAttr.set(a,[]);const l=t.byDeclaredAttr.get(a);l.some(i=>i.componentTag===e.componentTag)||l.push({spec:e.attributes[a],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const a=$e(e);if(a===null)t.reactiveWildcard.push(e);else for(const l of a)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function te(e,t,n,a){for(let l=0;l<e.length;l++){const i=e[l];if(!t[i.attribute])continue;const r=i.effects&&i.effects[n];r?r(t,n,a):i.onAttrChange&&(!i.declared||i.declared.has(n))&&i.onAttrChange(t,n,a)}}function Le(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,a=Z(),l=a.byAttr.get(t),i=v()&&a.byDeclaredAttr&&a.byDeclaredAttr.has(t);if(!n&&!l&&!i)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(i&&S(r)){const d=a.byDeclaredAttr.get(t),o=r.getAttribute(t);for(let s=0;s<d.length;s++)J(d[s].spec,o,t,d[s].componentTag,r)}if(window.lnCore._debugSink&&(n||l)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),n){const d=a.byReactive.get(t);d&&te(d,r,t,e.oldValue),a.reactiveWildcard.length&&te(a.reactiveWildcard,r,t,e.oldValue)}if(l)for(let d=0;d<l.length;d++){const o=l[d];if(o.handler){o.handler(r,t,e.oldValue);continue}o.onAttributeChange&&r[o.attribute]?o.onAttributeChange(r,t):(K(r,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(r))}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,h(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Le(t[n])}catch(a){console.error("[ln-core] mutation handler failed",t[n].target,a)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function E(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function D(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function ae(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(a){console.error("["+t.attribute+"] destroy failed",e,a)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=E();if(!t.length)return;const n=e.target;if(n){const l=n.nodeType===1?n:n.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const a=D();if(e.target&&a.length)for(let l=0;l<a.length;l++){const i=a[l],r=i.query,d=e.target.nodeType===1?e.target.matches&&e.target.matches(r)?e.target:e.target.closest?e.target.closest(r):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(r):null;d&&i.onSubtreeChange(d,e)}for(let l=0;l<e.addedNodes.length;l++){const i=e.addedNodes[l];if(i.nodeType!==1)continue;const r=!!(i.firstElementChild||i.children&&i.children.length);for(let d=0;d<t.length;d++){const o=t[d],s=o.query;if(s&&(i.matches&&i.matches(s)&&(o.ComponentFn&&y(i,o),o.onInit&&o.onInit(i)),r&&i.querySelectorAll)){const c=i.querySelectorAll(s);for(let u=0;u<c.length;u++)o.ComponentFn&&y(c[u],o),o.onInit&&o.onInit(c[u])}}}for(let l=0;l<e.removedNodes.length;l++){const i=e.removedNodes[l];if(i.nodeType!==1||document.contains(i))continue;const r=!!(i.firstElementChild||i.children&&i.children.length);for(let d=0;d<t.length;d++){const o=t[d],s=o.query;if(s&&(i.matches&&i.matches(s)&&ae(i,o),r&&i.querySelectorAll)){const c=i.querySelectorAll(s);for(let u=0;u<c.length;u++)ae(c[u],o)}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,h(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const a=t[n];if(a.type==="childList")try{oe(a)}catch(l){console.error("[ln-core] lifecycle handler failed",a.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let a=0;a<n.length;a++){const l=n[a];if(l.type==="childList")try{oe(l)}catch(i){console.error("[ln-core] lifecycle handler failed",l.target,i)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Te(e,t){ee({observed:e,handler:t}),ne()}function Fe(e){E().push(e),e.onSubtreeChange&&e.query&&D().push(e),re()}function le(e,t,n,a,l={}){const i=l.extraAttributes||[],r=l.onAttributeChange||null,d=l.onSubtreeChange||null,o=l.onInit||null,s=l.onAttrChange||null,c=l.effects||null,u=l.attributes||null,f=u?qe(u):c,O=u?new Set(Object.keys(u)):null,ct=l.persist||null;function A(F){const w=F||document.body;if(K(w,e,t,n),u&&v())for(const m in u){const ft=u[m],M=Array.from(w.querySelectorAll("["+m+"]"));w.matches&&w.matches("["+m+"]")&&M.push(w);for(let R=0;R<M.length;R++){const N=M[R];S(N)&&J(ft,N.getAttribute(m),m,a,N)}}o&&o(w)}const T=[];if(e.indexOf("[")!==-1){const F=/\[([\w-]+)/g;let w;for(;(w=F.exec(e))!==null;)T.push(w[1])}else T.push(e);ee({selector:e,attribute:t,componentTag:a,attributes:u,ComponentFn:n,onInit:o,observed:T.concat(i),onAttributeChange:r,onAttrChange:s,effects:f,declared:O,persist:ct}),ne();const ut=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ue=l.subtreeQuery||(ut?e:"["+e+"]"),fe={selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:d,query:ue};E().push(fe),d&&ue&&D().push(fe),re(),window[t]=A,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le,window.lnCore.observeLifecycle=Fe,window.lnCore.withoutLifecycle=Oe);function we(){X()>0?Y(function(){A(document.body)}):A(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",we):we(),A}function ie(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,n={},a=ie(t);if(!a)return n;const l=a.split("&");for(let i=0;i<l.length;i++){const r=l[i];if(!r)continue;const d=r.indexOf(":"),o=d>-1?r.slice(0,d):r,s=d>-1?r.slice(d+1):"";if(o)try{n[o]=decodeURIComponent(s)}catch{n[o]=s}}return n}function Me(e){if(!e)return null;const t=I();return e in t?t[e]:null}function Re(e,t){if(!e)return;const n=I();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(i){const r=n[i];return r===""?i:i+":"+encodeURIComponent(r)}).join("&");ie(location.hash)!==l&&(location.hash=l)}function Ne(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function je(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const a=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return a?t?a+"-"+t:a:t||null}function Be(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 Ue(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ve(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),a=e.slice(t+1),l=a?a.split(",").map(function(i){try{return decodeURIComponent(i)}catch{return i}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=Me,window.lnCore.hashSet=Re,window.lnCore.hashLinkClick=Ne,window.lnCore.resolveHashNamespace=je,window.lnCore.hashSortEncode=Be,window.lnCore.hashSortDecode=We,window.lnCore.hashFilterEncode=Ue,window.lnCore.hashFilterDecode=Ve);function He(e){return(e||"").replace(/^\?/,"")}function ze(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},a=He(t);if(!a)return n;const l=new URLSearchParams(a);for(const[i,r]of l.entries())n[i]=r;return n}function Ge(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Qe(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const a=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",a)}function Pe(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const a=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return a?t?a+"_"+t:a:t||null}function Je(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ke(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const a=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:a}}}return null}function Xe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ye(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=ze,window.lnCore.queryGet=Ge,window.lnCore.querySet=Qe,window.lnCore.resolveQueryParam=Pe,window.lnCore.querySortEncode=Je,window.lnCore.querySortDecode=Ke,window.lnCore.queryFilterEncode=Xe,window.lnCore.queryFilterDecode=Ye);function Ze(){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=Ze);const q=new Set(["data-ln-accordion","data-ln-ajax","data-ln-api-base-url","data-ln-api-connector","data-ln-api-connector-query-debounce","data-ln-api-endpoint","data-ln-api-headers","data-ln-api-param-limit","data-ln-api-param-offset","data-ln-api-param-search","data-ln-api-param-sort-dir","data-ln-api-param-sort-field","data-ln-api-path","data-ln-api-queue","data-ln-api-queue-online","data-ln-attr","data-ln-autoresize","data-ln-autosave","data-ln-autosave-clear","data-ln-autosave-debounce-input","data-ln-autosave-exclude","data-ln-chart","data-ln-chart-area","data-ln-chart-count","data-ln-chart-empty","data-ln-chart-labels","data-ln-chart-line","data-ln-chart-max","data-ln-chart-min","data-ln-chart-padding","data-ln-chart-plot","data-ln-chart-sort","data-ln-chart-source","data-ln-chart-type","data-ln-chart-x","data-ln-chart-y","data-ln-chart-zero","data-ln-circular-progress","data-ln-circular-progress-label","data-ln-circular-progress-max","data-ln-class","data-ln-col","data-ln-confirm","data-ln-confirm-active","data-ln-confirm-announcer","data-ln-confirm-idle","data-ln-confirm-state","data-ln-confirm-timeout","data-ln-connector","data-ln-couchdb-auth","data-ln-couchdb-connector","data-ln-couchdb-db","data-ln-couchdb-headers","data-ln-couchdb-url","data-ln-data-coordinator","data-ln-data-coordinator-connector","data-ln-data-coordinator-filters","data-ln-data-coordinator-mapper","data-ln-data-coordinator-no-autosync","data-ln-data-coordinator-scope","data-ln-data-coordinator-search","data-ln-data-coordinator-sort-direction","data-ln-data-coordinator-sort-field","data-ln-data-coordinator-stale","data-ln-data-store","data-ln-data-store-frozen","data-ln-data-store-indexes","data-ln-data-store-no-autosync","data-ln-data-store-no-local-query","data-ln-data-store-search-fields","data-ln-data-store-seed","data-ln-data-store-stale","data-ln-data-store-window","data-ln-data-store-window-page","data-ln-date","data-ln-date-dict","data-ln-date-dict-key","data-ln-date-field","data-ln-date-format","data-ln-date-label","data-ln-date-locale","data-ln-debug","data-ln-dropdown","data-ln-dropdown-menu","data-ln-dropdown-placement","data-ln-dropdown-position","data-ln-editor","data-ln-editor-action","data-ln-editor-source","data-ln-empty","data-ln-empty-state","data-ln-empty-when","data-ln-error","data-ln-external-link","data-ln-field","data-ln-fill-as","data-ln-fill-form","data-ln-fill-id","data-ln-fillable","data-ln-filter","data-ln-filter-col","data-ln-filter-hide","data-ln-filter-key","data-ln-filter-options","data-ln-filter-reset","data-ln-filter-search","data-ln-filter-target","data-ln-filter-value","data-ln-filter-values","data-ln-form","data-ln-form-action-edit","data-ln-form-action-method","data-ln-hash","data-ln-include","data-ln-initial-value","data-ln-item","data-ln-item-action","data-ln-item-id","data-ln-item-select","data-ln-key","data-ln-key-allow-input","data-ln-key-for","data-ln-key-modifier","data-ln-key-target","data-ln-link","data-ln-list","data-ln-list-body","data-ln-list-count","data-ln-list-empty","data-ln-list-field","data-ln-list-filtered","data-ln-list-select-all","data-ln-list-selectable","data-ln-list-selected","data-ln-list-source","data-ln-list-total","data-ln-list-window","data-ln-list-window-page","data-ln-list-window-threshold","data-ln-modal","data-ln-modal-close","data-ln-modal-for","data-ln-modal-mode","data-ln-modal-when","data-ln-nav","data-ln-nav-exact","data-ln-number","data-ln-number-decimals","data-ln-number-max","data-ln-number-min","data-ln-obfuscator","data-ln-obfuscator-codec","data-ln-obfuscator-key","data-ln-options","data-ln-options-label","data-ln-options-value","data-ln-outlet","data-ln-panel","data-ln-persist","data-ln-persist-scope","data-ln-picklist","data-ln-picklist-list","data-ln-picklist-max","data-ln-popover","data-ln-popover-for","data-ln-popover-placement","data-ln-popover-position","data-ln-progress","data-ln-progress-max","data-ln-query","data-ln-render-key","data-ln-route","data-ln-route-keep","data-ln-route-target","data-ln-route-title","data-ln-router-base","data-ln-router-hydrate","data-ln-scroll","data-ln-scroll-behavior","data-ln-scroll-block","data-ln-scroll-delay","data-ln-scroll-focus","data-ln-scroll-set","data-ln-scroll-update-hash","data-ln-search","data-ln-search-clear","data-ln-search-clear-for","data-ln-search-exclude","data-ln-search-fields","data-ln-search-for","data-ln-search-hide","data-ln-search-items","data-ln-show","data-ln-slug-from","data-ln-sort","data-ln-sort-dir","data-ln-sort-exclude","data-ln-sort-field","data-ln-sort-icon","data-ln-sort-items","data-ln-sort-state","data-ln-sortable","data-ln-sortable-handle","data-ln-stat","data-ln-stat-card","data-ln-stat-filter","data-ln-stat-label","data-ln-stat-trend","data-ln-stat-value","data-ln-step","data-ln-step-label","data-ln-stepper","data-ln-store","data-ln-tab","data-ln-table","data-ln-table-body","data-ln-table-cell-attr","data-ln-table-clear","data-ln-table-clear-all","data-ln-table-col","data-ln-table-col-filter","data-ln-table-col-select","data-ln-table-col-sort","data-ln-table-coordinator","data-ln-table-dict","data-ln-table-empty","data-ln-table-empty-when","data-ln-table-filter-col","data-ln-table-filtered","data-ln-table-loading","data-ln-table-row","data-ln-table-row-action","data-ln-table-row-id","data-ln-table-row-select","data-ln-table-select-all-label","data-ln-table-selectable","data-ln-table-selected","data-ln-table-sort","data-ln-table-source","data-ln-table-total","data-ln-table-window","data-ln-tabs","data-ln-tabs-active","data-ln-tabs-default","data-ln-tabs-focus","data-ln-tabs-key","data-ln-template","data-ln-time","data-ln-time-locale","data-ln-toast","data-ln-toast-close","data-ln-toast-item","data-ln-toast-max","data-ln-toast-timeout","data-ln-toast-when","data-ln-toggle","data-ln-toggle-action","data-ln-toggle-for","data-ln-tooltip","data-ln-tooltip-enhance","data-ln-tooltip-enhanced","data-ln-tooltip-placement","data-ln-tooltip-position","data-ln-translatable","data-ln-translatable-lang","data-ln-translations","data-ln-translations-active","data-ln-translations-add","data-ln-translations-default","data-ln-translations-lang","data-ln-translations-locales","data-ln-translations-placeholder","data-ln-translations-prefix","data-ln-translations-remove-label","data-ln-ui-coordinator","data-ln-upload","data-ln-upload-accept","data-ln-upload-action","data-ln-upload-delete","data-ln-upload-dict","data-ln-upload-ext","data-ln-upload-file-field","data-ln-upload-id","data-ln-upload-ids-field","data-ln-upload-item","data-ln-upload-list","data-ln-upload-local-id","data-ln-upload-max-files","data-ln-upload-max-size","data-ln-upload-progress","data-ln-upload-size","data-ln-upload-state","data-ln-upload-zone","data-ln-validate","data-ln-validate-error","data-ln-validate-errors","data-ln-value","data-ln-websocket-connector","data-ln-websocket-connector-url"]);function et(e,t){if(e===t)return 0;if(!e.length)return t.length;if(!t.length)return e.length;const n=[];for(let a=0;a<=t.length;a++)n[a]=[a];for(let a=0;a<=e.length;a++)n[0][a]=a;for(let a=1;a<=t.length;a++)for(let l=1;l<=e.length;l++)t.charAt(a-1)===e.charAt(l-1)?n[a][l]=n[a-1][l-1]:n[a][l]=Math.min(n[a-1][l-1]+1,n[a][l-1]+1,n[a-1][l]+1);return n[t.length][e.length]}function tt(e,t=q){if(t.has(e))return null;let n=null,a=1/0;const l=Math.max(3,Math.floor(e.length*.4));for(const i of t){if(Math.abs(e.length-i.length)>3||Math.abs(e.length-i.length)>=a)continue;const r=et(e,i);r<a&&(a=r,n=i)}return a<=l?n:null}function de(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/([!"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function nt(e=document){const t=e.ownerDocument||e,n=e.nodeType===9?e.body||e.documentElement:e;if(!n)return[];const a=[],l=[n,...n.querySelectorAll("*")];for(let i=0;i<l.length;i++){const r=l[i];if(r.attributes)for(let d=0;d<r.attributes.length;d++){const o=r.attributes[d];if(o.name.startsWith("data-ln-")&&o.name.endsWith("-for")){const s=(o.value||"").trim();if(!s){a.push({type:"id-empty",element:r,attribute:o.name,targetId:"",message:`[ln-debug] Empty ID reference in <${r.tagName.toLowerCase()} ${o.name}="">.`});continue}t.getElementById(s)||t.querySelector("#"+de(s))||a.push({type:"id-unresolved",element:r,attribute:o.name,targetId:s,message:`[ln-debug] Unresolved ID reference: <${r.tagName.toLowerCase()} ${o.name}="${s}"> targets "#${s}", but no element with id="${s}" exists in the document.`})}}}return a}function at(e=document){const t=e.ownerDocument||e,n=e.nodeType===9?e.body||e.documentElement:e;if(!n)return[];const a=[],l=[n,...n.querySelectorAll("*")];for(let i=0;i<l.length;i++){const r=l[i];if(r.attributes)for(let d=0;d<r.attributes.length;d++){const o=r.attributes[d];if(o.name.startsWith("data-ln-")&&(o.name.endsWith("-source")||o.name.endsWith("-store"))&&o.name!=="data-ln-data-store"){const c=(o.value||"").trim();if(!c){a.push({type:"store-empty",element:r,attribute:o.name,storeName:"",message:`[ln-debug] Empty store reference in <${r.tagName.toLowerCase()} ${o.name}="">.`});continue}const u=de(c),f=t.querySelector(`[data-ln-data-store="${u}"], [data-ln-store="${u}"]`),O=typeof window<"u"&&window.lnDataStore&&typeof window.lnDataStore.getStore=="function"&&window.lnDataStore.getStore(c);!f&&!O&&a.push({type:"store-unresolved",element:r,attribute:o.name,storeName:c,message:`[ln-debug] Unresolved store reference: <${r.tagName.toLowerCase()} ${o.name}="${c}"> targets store "${c}", but no [data-ln-data-store="${c}"] exists in the document.`})}}}return a}function ot(e=document){e.ownerDocument;const t=e.nodeType===9?e.body||e.documentElement:e;if(!t)return[];const n=[],a=Array.from(t.querySelectorAll("[data-ln-data-store]"));t.hasAttribute&&t.hasAttribute("data-ln-data-store")&&a.unshift(t);const l=new Map;for(let i=0;i<a.length;i++){const r=a[i],d=(r.getAttribute("data-ln-data-store")||"").trim();d&&(l.has(d)||l.set(d,[]),l.get(d).push(r))}for(const[i,r]of l.entries())r.length>1&&n.push({type:"store-duplicate",storeName:i,elements:r,message:`[ln-debug] Duplicate store name: Multiple elements declare data-ln-data-store="${i}". Store names must be unique across the document.`});return n}function rt(e=typeof document<"u"?document:null,t=q){const n=e&&(e.nodeType===9?e.body||e.documentElement:e);if(!n)return[];const a=[],l=[n,...n.querySelectorAll("*")];for(let i=0;i<l.length;i++){const r=l[i];if(r.attributes)for(let d=0;d<r.attributes.length;d++){const o=r.attributes[d];if(!o.name.startsWith("data-ln-")||t.has(o.name))continue;const s=tt(o.name,t);a.push({type:"attribute-unknown",element:r,attribute:o.name,suggestion:s,message:`[ln-debug] Unknown attribute "${o.name}" on <${r.tagName.toLowerCase()}>.${s?` Did you mean "${s}"?`:""}`})}}return a}function C(e=typeof document<"u"?document:null,t={}){if(!e)return{idIssues:[],storeIssues:[],uniquenessIssues:[],spellingIssues:[],total:0};const n=t.validAttributes||q,a=nt(e),l=at(e),i=ot(e),r=rt(e,n),d=[...a,...l,...i,...r];if(!t.silent)for(let o=0;o<d.length;o++)console.warn(d[o].message);return{idIssues:a,storeIssues:l,uniquenessIssues:i,spellingIssues:r,total:d.length}}let $=null;function b(e=typeof document<"u"?document:null,t=50,n=null){if(!e||!v())return;clearTimeout($);const a=()=>{$=setTimeout(()=>{$=null;const l=C(e);n&&n(l)},t)};if(X()>0)return Y(a);a()}function lt(e,t,n,a){e==="event"?(console.groupCollapsed("[ln-debug] event",t),console.log("target",n),console.log("detail",a),console.groupEnd()):e==="attr"&&(console.groupCollapsed("[ln-debug] attr",t),console.log("target",n),console.log("old → new",a.oldValue,"→",a.newValue),console.groupEnd())}let p=[];function it(){p=Array.from(document.body.querySelectorAll("[data-ln-debug]")),document.body.hasAttribute("data-ln-debug")&&p.push(document.body)}function se(e){if(e===window||e===document)return p.indexOf(document.body)!==-1;for(let t=0;t<p.length;t++)if(p[t].contains(e))return!0;return!1}function dt(e,t,n,a){se(n)&<(e,t,n,a)}function L(){it(),pe(p.length>0?dt:null,p.length>0?se:null)}function ce(){L()}function st(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._debugGateBound&&(window.lnCore._debugGateBound=!0,h(function(){L(),Te(["data-ln-debug"],L)},"ln-debug")))}return(function(){const e="data-ln-debug",t="lnDebug";if(typeof window<"u"&&window[t]!==void 0)return;const n={"data-ln-debug":{type:"marker",description:"Enables developer diagnostics overlay, live validation badges, and inspection logging"}};st();function a(i){return this.dom=i,b(i),ce(),this}a.prototype.verify=function(i,r){return C(i||(this.dom?this.dom.ownerDocument||this.dom:document),r)},a.prototype.destroy=function(){delete this.dom[t],ce()};const l=le(e,t,a,"ln-debug",{attributes:n,onInit:i=>b(i),onSubtreeChange:i=>b(i)});l.verify=function(i,r){return C(i||document,r)},l.schedule=function(i,r,d){return b(i||document,r,d)}})(),g.scheduleVerification=b,g.verifyDOM=C,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),g})({});
|
|
@@ -1,28 +1,28 @@
|
|
|
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-debug",
|
|
4
|
-
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
-
"attributes": {
|
|
6
|
-
"data-ln-data-store": {
|
|
7
|
-
"direction": "author",
|
|
8
|
-
"sources": [
|
|
9
|
-
"src/debug-verifier.js"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"data-ln-debug": {
|
|
13
|
-
"direction": "author",
|
|
14
|
-
"sources": [
|
|
15
|
-
"src/gate.js",
|
|
16
|
-
"src/ln-debug.js"
|
|
17
|
-
],
|
|
18
|
-
"type": "marker",
|
|
19
|
-
"description": "Enables developer diagnostics overlay, live validation badges, and inspection logging"
|
|
20
|
-
},
|
|
21
|
-
"data-ln-store": {
|
|
22
|
-
"direction": "author",
|
|
23
|
-
"sources": [
|
|
24
|
-
"src/debug-verifier.js"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
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-debug",
|
|
4
|
+
"generator": "scripts/sync-ln-schemas.mjs",
|
|
5
|
+
"attributes": {
|
|
6
|
+
"data-ln-data-store": {
|
|
7
|
+
"direction": "author",
|
|
8
|
+
"sources": [
|
|
9
|
+
"src/debug-verifier.js"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"data-ln-debug": {
|
|
13
|
+
"direction": "author",
|
|
14
|
+
"sources": [
|
|
15
|
+
"src/gate.js",
|
|
16
|
+
"src/ln-debug.js"
|
|
17
|
+
],
|
|
18
|
+
"type": "marker",
|
|
19
|
+
"description": "Enables developer diagnostics overlay, live validation badges, and inspection logging"
|
|
20
|
+
},
|
|
21
|
+
"data-ln-store": {
|
|
22
|
+
"direction": "author",
|
|
23
|
+
"sources": [
|
|
24
|
+
"src/debug-verifier.js"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VALID_ATTRIBUTES } from './generated-attributes.js';
|
|
2
|
-
import { pendingCount, queueBoot } from '../../ln-core/index.js';
|
|
2
|
+
import { pendingCount, queueBoot, hasActiveDebug } from '../../ln-core/index.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Calculates Levenshtein distance between two strings.
|
|
@@ -43,8 +43,11 @@ export function findClosestAttribute(attrName, validSet = VALID_ATTRIBUTES) {
|
|
|
43
43
|
|
|
44
44
|
let bestMatch = null;
|
|
45
45
|
let minDistance = Infinity;
|
|
46
|
+
const maxAllowedDist = Math.max(3, Math.floor(attrName.length * 0.4));
|
|
46
47
|
|
|
47
48
|
for (const valid of validSet) {
|
|
49
|
+
if (Math.abs(attrName.length - valid.length) > 3) continue;
|
|
50
|
+
if (Math.abs(attrName.length - valid.length) >= minDistance) continue;
|
|
48
51
|
const dist = levenshtein(attrName, valid);
|
|
49
52
|
if (dist < minDistance) {
|
|
50
53
|
minDistance = dist;
|
|
@@ -52,7 +55,6 @@ export function findClosestAttribute(attrName, validSet = VALID_ATTRIBUTES) {
|
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
const maxAllowedDist = Math.max(3, Math.floor(attrName.length * 0.4));
|
|
56
58
|
if (minDistance <= maxAllowedDist) {
|
|
57
59
|
return bestMatch;
|
|
58
60
|
}
|
|
@@ -226,8 +228,8 @@ export function verifyStoreUniqueness(root = document) {
|
|
|
226
228
|
* @param {Set<string>} validSet
|
|
227
229
|
* @returns {Array<{ type: string, element: Element, attribute: string, suggestion: string|null, message: string }>}
|
|
228
230
|
*/
|
|
229
|
-
export function verifyAttributeSpelling(root = document, validSet = VALID_ATTRIBUTES) {
|
|
230
|
-
const scope = root.nodeType === 9 ? root.body || root.documentElement : root;
|
|
231
|
+
export function verifyAttributeSpelling(root = (typeof document !== 'undefined' ? document : null), validSet = VALID_ATTRIBUTES) {
|
|
232
|
+
const scope = root && (root.nodeType === 9 ? root.body || root.documentElement : root);
|
|
231
233
|
if (!scope) return [];
|
|
232
234
|
|
|
233
235
|
const issues = [];
|
|
@@ -239,25 +241,24 @@ export function verifyAttributeSpelling(root = document, validSet = VALID_ATTRIB
|
|
|
239
241
|
|
|
240
242
|
for (let j = 0; j < el.attributes.length; j++) {
|
|
241
243
|
const attr = el.attributes[j];
|
|
242
|
-
if (attr.name.startsWith('data-ln-'))
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}
|
|
244
|
+
if (!attr.name.startsWith('data-ln-') || validSet.has(attr.name)) continue;
|
|
245
|
+
|
|
246
|
+
const suggestion = findClosestAttribute(attr.name, validSet);
|
|
247
|
+
issues.push({
|
|
248
|
+
type: 'attribute-unknown',
|
|
249
|
+
element: el,
|
|
250
|
+
attribute: attr.name,
|
|
251
|
+
suggestion: suggestion,
|
|
252
|
+
message: `[ln-debug] Unknown attribute "${attr.name}" on <${el.tagName.toLowerCase()}>.${suggestion ? ` Did you mean "${suggestion}"?` : ''}`
|
|
253
|
+
});
|
|
255
254
|
}
|
|
256
255
|
}
|
|
257
256
|
|
|
258
257
|
return issues;
|
|
259
258
|
}
|
|
260
259
|
|
|
260
|
+
export { verifyAttributeSpelling as checkAttributeSpelling };
|
|
261
|
+
|
|
261
262
|
/**
|
|
262
263
|
* Performs a complete contract verification scan of the DOM.
|
|
263
264
|
* @param {HTMLElement|Document} root
|
|
@@ -308,24 +309,17 @@ let _debounceTimer = null;
|
|
|
308
309
|
* @param {function} [callback]
|
|
309
310
|
*/
|
|
310
311
|
export function scheduleVerification(root = (typeof document !== 'undefined' ? document : null), delay = 50, callback = null) {
|
|
311
|
-
if (!root) return;
|
|
312
|
+
if (!root || !hasActiveDebug()) return;
|
|
312
313
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
_debounceTimer = null;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
function run() {
|
|
314
|
+
clearTimeout(_debounceTimer);
|
|
315
|
+
const run = () => {
|
|
319
316
|
_debounceTimer = setTimeout(() => {
|
|
320
317
|
_debounceTimer = null;
|
|
321
318
|
const report = verifyDOM(root);
|
|
322
319
|
if (callback) callback(report);
|
|
323
320
|
}, delay);
|
|
324
|
-
}
|
|
321
|
+
};
|
|
325
322
|
|
|
326
|
-
if (pendingCount() > 0)
|
|
327
|
-
|
|
328
|
-
} else {
|
|
329
|
-
run();
|
|
330
|
-
}
|
|
323
|
+
if (pendingCount() > 0) return queueBoot(run);
|
|
324
|
+
run();
|
|
331
325
|
}
|
|
@@ -17,7 +17,7 @@ import { ensureDebugGate, refreshDebugHosts } from './gate.js';
|
|
|
17
17
|
|
|
18
18
|
function _component(dom) {
|
|
19
19
|
this.dom = dom;
|
|
20
|
-
scheduleVerification(dom
|
|
20
|
+
scheduleVerification(dom);
|
|
21
21
|
refreshDebugHosts();
|
|
22
22
|
return this;
|
|
23
23
|
}
|
|
@@ -33,16 +33,8 @@ import { ensureDebugGate, refreshDebugHosts } from './gate.js';
|
|
|
33
33
|
|
|
34
34
|
const _ctor = registerComponent(DOM_SELECTOR, DOM_ATTRIBUTE, _component, 'ln-debug', {
|
|
35
35
|
attributes: ATTRIBUTES,
|
|
36
|
-
onInit:
|
|
37
|
-
|
|
38
|
-
scheduleVerification(node && node.ownerDocument ? node.ownerDocument : document);
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
onSubtreeChange: function (host) {
|
|
42
|
-
if (typeof document !== 'undefined') {
|
|
43
|
-
scheduleVerification(host && host.ownerDocument ? host.ownerDocument : document);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
36
|
+
onInit: (node) => scheduleVerification(node),
|
|
37
|
+
onSubtreeChange: (host) => scheduleVerification(host)
|
|
46
38
|
});
|
|
47
39
|
|
|
48
40
|
// registerComponent assigns window[DOM_ATTRIBUTE] = constructor, so the
|
|
@@ -1 +1 @@
|
|
|
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 l=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){l=t[s];break}if(!S(l))return}e.apply(console,t)}}function x(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}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()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const r=!!(t&&t.typed),l=t&&t.exclude,s={},c=e.elements,o={};if(r)for(let i=0;i<c.length;i++){const n=c[i];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let i=0;i<c.length;i++){const n=c[i];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")r&&o[n.name]===1?s[n.name]=n.checked:(s[n.name]||(s[n.name]=[]),n.checked&&s[n.name].push(n.value));else if(n.type==="radio")n.checked&&(s[n.name]=n.value);else if(n.type==="select-multiple"){s[n.name]=[];for(let u=0;u<n.options.length;u++)n.options[u].selected&&s[n.name].push(n.options[u].value)}else if(r&&n.type==="hidden")s[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const u=Number(n.value);s[n.name]=n.value===""||isNaN(u)?null:u}else s[n.name]=n.value}return s}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const r=e.elements,l=[],s={};for(let c=0;c<r.length;c++){const o=r[c];o.name&&o.type==="checkbox"&&(s[o.name]=(s[o.name]||0)+1)}for(let c=0;c<r.length;c++){const o=r[c];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const i=o.getAttribute("data-ln-fill-as")||o.name;if(!i||!(i in t))continue;const n=t[i];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(s[o.name]>1){const u=String(n).split(",").map(function(d){return d.trim()});o.checked=u.indexOf(o.value)!==-1}else o.checked=se(n);l.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),l.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<o.options.length;u++)o.options[u].selected=n.indexOf(o.options[u].value)!==-1;l.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),l.push(o)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);const N={};function ue(e,t){N[e]=t}function de(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=de);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,k(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const j={};function fe(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];j[r]=t}function ge(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return j[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=ge,window.lnCore.ensureLocaleObserver=ae);const L={};function pe(e,t){L[e]||(L[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=L[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function U(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const i=r[o],n=i.getAttribute("data-ln-field");t[n]!=null&&(i.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<l.length;o++){const i=l[o],n=i.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const d=n[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&i.setAttribute(a,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let o=0;o<s.length;o++){const i=s[o],n=i.getAttribute("data-ln-show");n in t&&i.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let o=0;o<c.length;o++){const i=c[o],n=i.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const d=n[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&i.classList.toggle(a,!!t[f])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<r.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[l],t??null),r[l].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)U(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function P(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,i){return t[i]!==void 0?t[i]:""}))}const l=function(c,o){return t[o]!==void 0?t[o]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let c=0;c<s.length;c++){const o=s[c],i=o.attributes;for(let n=0;n<i.length;n++){const u=i[n];u.value.indexOf("{{")!==-1&&o.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function he(e,t,r,l,s,c){const o={};for(let n=0;n<e.children.length;n++){const u=e.children[n],d=u.getAttribute("data-ln-render-key");d&&(o[d]=u)}const i=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],d=String(l(u));let a=o[d];if(a)s(a,u,n);else{const f=pe(r,c);if(!f||(P(f,u),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),s(a,u,n)}i.appendChild(a)}e.textContent="",e.appendChild(i)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=P,window.lnCore.fill=U,window.lnCore.lnFill=we,window.lnCore.renderList=he);function R(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function W(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function z(e,t,r=!1){const l=e.getAttribute(t);if(l===null)return!!r;const s=l.trim().toLowerCase();return!(s==="false"||s==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const O=new Map;function V(e,t){const r=(e?e.join("|"):"")+"::"+t;if(O.has(r))return O.get(r);const l=new Set(e||[]),s=function(c,o){const i=c.getAttribute(o);return i!==null&&l.has(i)?i:t};return O.set(r,s),s}function K(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function Q(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function J(e,t,r,l,s){if(!e||t===null)return!0;const c=l||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const i=n=>{s?console.warn(n,s):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(i(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(i(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return i(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(i(`[${c}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(i(`[${c}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(i(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return i(`[${c}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function G(e,t,r){for(const l in r){const[s,c,o]=r[l];Object.defineProperty(e,l,{get:function(){return s(t,c,o)},enumerable:!0,configurable:!0})}return e}function X(e){const t={};for(const r in e){const l=e[r];if(!l||!l.prop)continue;let s=l.read;if(!s&&l.type)switch(l.type){case"enum":s=V(l.values,l.fallback);break;case"integer":s=W;break;case"float":s=K;break;case"boolean":s=z;break;case"list":s=H;break;case"json":s=Q;break;case"string":default:s=R;break}s||(s=R),t[l.prop]=[s,r,l.fallback]}return t}function be(e){const t={};for(const r in e){const l=e[r];l&&l.effect&&(t[r]=l.effect)}return Object.keys(t).length?t:null}function me(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=G,window.lnCore.attrSpec=X,window.lnCore.attrStr=R,window.lnCore.attrInt=W,window.lnCore.attrBool=z,window.lnCore.attrList=H,window.lnCore.attrEnum=V,window.lnCore.attrFloat=K,window.lnCore.attrJson=Q);function A(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function Y(e,t,r,l){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:l};if(e.matches&&e.matches(c)&&A(e,o),e.querySelectorAll){const i=e.querySelectorAll(c);for(let n=0;n<i.length;n++)A(i[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ye(){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 Z(){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 _e(e){const t=Z(),r=e.observed||[];for(let l=0;l<r.length;l++){const s=r[l];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const s=t.byDeclaredAttr.get(l);s.some(c=>c.componentTag===e.componentTag)||s.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=me(e);if(l===null)t.reactiveWildcard.push(e);else for(const s of l)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function ee(e,t,r,l){for(let s=0;s<e.length;s++){const c=e[s];if(!t[c.attribute])continue;const o=c.effects&&c.effects[r];o?o(t,r,l):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,l)}}function Ae(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=Z(),s=l.byAttr.get(t),c=$()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!s&&!c)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(c&&S(o)){const i=l.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let u=0;u<i.length;u++)J(i[u].spec,n,t,i[u].componentTag,o)}if(window.lnCore._debugSink&&(r||s)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const i=l.byReactive.get(t);i&&ee(i,o,t,e.oldValue),l.reactiveWildcard.length&&ee(l.reactiveWildcard,o,t,e.oldValue)}if(s)for(let i=0;i<s.length;i++){const n=s[i];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(Y(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,k(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ae(t[r])}catch(l){console.error("[ln-core] mutation handler failed",t[r].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function q(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function D(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function I(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function te(e){const t=q();if(!t.length)return;const r=e.target;if(r){const s=r.nodeType===1?r:r.parentElement;if(s&&(s.isContentEditable||s.closest&&s.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=D();if(e.target&&l.length)for(let s=0;s<l.length;s++){const c=l[s],o=c.query,i=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;i&&c.onSubtreeChange(i,e)}for(let s=0;s<e.addedNodes.length;s++){const c=e.addedNodes[s];if(c.nodeType===1){const o=!!(c.firstElementChild||c.children&&c.children.length);for(let i=0;i<t.length;i++){const n=t[i];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)c.matches&&c.matches(n.query)&&A(c,n);else if(c.matches&&c.matches(n.query)&&A(c,n),c.querySelectorAll){const u=c.querySelectorAll(n.query);for(let d=0;d<u.length;d++)A(u[d],n)}}n.onInit&&n.onInit(c)}}}for(let s=0;s<e.removedNodes.length;s++){const c=e.removedNodes[s];if(c.nodeType===1){if(document.contains(c))continue;const o=!!(c.firstElementChild||c.children&&c.children.length);for(let i=0;i<t.length;i++){const n=t[i],u=n.query;if(u){if(!o)c.matches&&c.matches(u)&&I(c,n);else if(c.matches&&c.matches(u)&&I(c,n),c.querySelectorAll){const d=c.querySelectorAll(u);for(let a=0;a<d.length;a++)I(d[a],n)}}}}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,k(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{te(l)}catch(s){console.error("[ln-core] lifecycle handler failed",l.target,s)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ee(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let l=0;l<r.length;l++){const s=r[l];if(s.type==="childList")try{te(s)}catch(c){console.error("[ln-core] lifecycle handler failed",s.target,c)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function ke(e){q().push(e),e.onSubtreeChange&&e.query&&D().push(e),ne()}function oe(e,t,r,l,s={}){const c=s.extraAttributes||[],o=s.onAttributeChange||null,i=s.onSubtreeChange||null,n=s.onInit||null,u=s.onAttrChange||null,d=s.effects||null,a=s.attributes||null,f=a?be(a):d,v=a?new Set(Object.keys(a)):null,_=s.persist||null;function C(h){const p=h||document.body;if(Y(p,e,t,r),a&&$())for(const E in a){const Ve=a[E],F=Array.from(p.querySelectorAll("["+E+"]"));p.matches&&p.matches("["+E+"]")&&F.push(p);for(let B=0;B<F.length;B++){const M=F[B];S(M)&&J(Ve,M.getAttribute(E),E,l,M)}}n&&n(p)}const b=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let p;for(;(p=h.exec(e))!==null;)b.push(p[1])}else b.push(e);_e({selector:e,attribute:t,componentTag:l,attributes:a,ComponentFn:r,onInit:n,observed:b.concat(c),onAttributeChange:o,onAttrChange:u,effects:f,declared:v,persist:_}),ve();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,m=s.subtreeQuery||(y?e:"["+e+"]"),g={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:i,query:m};q().push(g),i&&m&&D().push(g),ne(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=oe,window.lnCore.observeLifecycle=ke,window.lnCore.withoutLifecycle=Ee);function w(){ye()>0?Ce(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",w):w(),C}function re(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,r={},l=re(t);if(!l)return r;const s=l.split("&");for(let c=0;c<s.length;c++){const o=s[c];if(!o)continue;const i=o.indexOf(":"),n=i>-1?o.slice(0,i):o,u=i>-1?o.slice(i+1):"";if(n)try{r[n]=decodeURIComponent(u)}catch{r[n]=u}}return r}function Se(e){if(!e)return null;const t=T();return e in t?t[e]:null}function xe(e,t){if(!e)return;const r=T();t==null?delete r[e]:r[e]=String(t);const s=Object.keys(r).map(function(c){const o=r[c];return o===""?c:c+":"+encodeURIComponent(o)}).join("&");re(location.hash)!==s&&(location.hash=s)}function Le(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function qe(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 De(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),l=e.slice(t+1),s=l?l.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Se,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=Le,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=Ie);function Te(e){return(e||"").replace(/^\?/,"")}function Fe(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},l=Te(t);if(!l)return r;const s=new URLSearchParams(l);for(const[c,o]of s.entries())r[c]=o;return r}function Be(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Me(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const l=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",l)}function $e(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"_"+t:l:t||null}function Ne(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const l=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:l}}}return null}function Ue(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Pe(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Fe,window.lnCore.queryGet=Be,window.lnCore.querySet=Me,window.lnCore.resolveQueryParam=$e,window.lnCore.querySortEncode=Ne,window.lnCore.querySortDecode=je,window.lnCore.queryFilterEncode=Ue,window.lnCore.queryFilterDecode=Pe);function We(e,t,r,l){const s=typeof l=="number"?l:4,c=window.innerWidth,o=window.innerHeight,i=t.width,n=t.height,u=r.split("-"),d=u[0],a=u[1]==="start"||u[1]==="end"?u[1]:"center",f={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},v=f[d]||f.bottom;function _(g){return g==="top"||g==="bottom"?a==="start"?e.left:a==="end"?e.right-i:e.left+(e.width-i)/2:a==="start"?e.top:a==="end"?e.bottom-n:e.top+(e.height-n)/2}function C(g){let w,h,p=!0;return g==="top"?(w=e.top-s-n,h=_(g),w<0&&(p=!1)):g==="bottom"?(w=e.bottom+s,h=_(g),w+n>o&&(p=!1)):g==="left"?(w=_(g),h=e.left-s-i,h<0&&(p=!1)):(w=_(g),h=e.right+s,h+i>c&&(p=!1)),{top:w,left:h,side:g,fits:p}}let b=null;for(let g=0;g<v.length;g++){const w=C(v[g]);if(w.fits){b=w;break}}b||(b=C(v[0]));let y=b.top,m=b.left;return i>=c?m=0:(m<0&&(m=0),m+i>c&&(m=c-i)),n>=o?y=0:(y<0&&(y=0),y+n>o&&(y=o-n)),{top:y,left:m,placement:b.side}}function ze(e){if(!e)return{width:0,height:0};const t=e.style,r=t.visibility,l=t.display,s=t.position;t.visibility="hidden",t.display="block",t.position="fixed";const c=e.offsetWidth,o=e.offsetHeight;return t.visibility=r,t.display=l,t.position=s,{width:c,height:o}}function He(){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=He),(function(){const e="data-ln-dropdown",t="lnDropdown",r="bottom-end";if(window[t]!==void 0)return;const l={"data-ln-dropdown":{type:"marker",description:"Initializes the dropdown container"},"data-ln-dropdown-position":{prop:"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:r,description:"Preferred positioning anchor"},"data-ln-dropdown-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"},"data-ln-dropdown-menu":{type:"marker",description:"Dropdown menu element containing items"}},s=X(l);function c(o){this.dom=o,G(this,o,s),this.toggleEl=o.querySelector("[data-ln-toggle]"),this._boundDocClick=null,this._docClickTimeout=null,this._boundScrollReposition=null,this._boundResizeClose=null,this.toggleEl&&(this.toggleEl.setAttribute("data-ln-dropdown-menu",""),this.toggleEl.setAttribute("role","menu"),this.toggleEl.setAttribute("popover","manual"),this._initMenuAria()),this.triggerBtn=o.querySelector("[data-ln-toggle-for]"),this.triggerBtn&&(this.triggerBtn.setAttribute("aria-haspopup","menu"),this.triggerBtn.setAttribute("aria-expanded","false"));const i=this;return this._onRequestOpen=function(){i.toggleEl&&i.toggleEl.setAttribute("data-ln-toggle","open")},this._onRequestClose=function(){i.toggleEl&&i.toggleEl.setAttribute("data-ln-toggle","close")},this._onRequestToggle=function(){if(i.toggleEl){const n=i.toggleEl.getAttribute("data-ln-toggle");i.toggleEl.setAttribute("data-ln-toggle",n==="open"?"close":"open")}},this._onKeydown=function(n){const u=i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open";if(n.key==="Escape"){u&&(n.preventDefault(),n.stopPropagation(),i.toggleEl.setAttribute("data-ln-toggle","close"),i.triggerBtn&&i.triggerBtn.focus());return}if(n.key==="Tab"){u&&(i.triggerBtn&&i.triggerBtn.focus(),i.toggleEl.setAttribute("data-ln-toggle","close"));return}const d=i._getMenuItems();if(d.length===0)return;if(!u&&(n.key==="ArrowDown"||n.key==="ArrowUp")){n.preventDefault(),i.toggleEl.setAttribute("data-ln-toggle","open"),setTimeout(function(){const f=i._getMenuItems();f.length>0&&i._focusItem(f,n.key==="ArrowDown"?0:f.length-1)},0);return}if(!u)return;const a=d.indexOf(document.activeElement);if(n.key==="ArrowDown"){n.preventDefault();const f=a<d.length-1?a+1:0;i._focusItem(d,f)}else if(n.key==="ArrowUp"){n.preventDefault();const f=a>0?a-1:d.length-1;i._focusItem(d,f)}else n.key==="Home"?(n.preventDefault(),i._focusItem(d,0)):n.key==="End"&&(n.preventDefault(),i._focusItem(d,d.length-1))},this.dom.addEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.addEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.addEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.addEventListener("keydown",this._onKeydown),this._onToggleOpen=function(n){!n.detail||n.detail.target!==i.toggleEl||(i.triggerBtn&&i.triggerBtn.setAttribute("aria-expanded","true"),typeof i.toggleEl.showPopover=="function"&&i.toggleEl.showPopover(),i._initMenuAria(),i._reposition(),i._addOutsideClickListener(),i._addScrollRepositionListener(),i._addResizeCloseListener(),x(o,"ln-dropdown:open",{target:n.detail.target}))},this._onToggleClose=function(n){!n.detail||n.detail.target!==i.toggleEl||(i.triggerBtn&&i.triggerBtn.setAttribute("aria-expanded","false"),i._removeOutsideClickListener(),i._removeScrollRepositionListener(),i._removeResizeCloseListener(),i.toggleEl.style.top="",i.toggleEl.style.left="",i.toggleEl.removeAttribute("data-ln-dropdown-placement"),typeof i.toggleEl.hidePopover=="function"&&i.toggleEl.matches(":popover-open")&&i.toggleEl.hidePopover(),x(o,"ln-dropdown:close",{target:n.detail.target}))},this.toggleEl&&(this.toggleEl.addEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.addEventListener("ln-toggle:close",this._onToggleClose)),this}c.prototype._initMenuAria=function(){if(!this.toggleEl)return;const o=this.toggleEl.querySelectorAll("li");for(const n of o)n.setAttribute("role","none");const i=this._getMenuItems();for(let n=0;n<i.length;n++)i[n].setAttribute("role","menuitem"),i[n].setAttribute("tabindex",n===0?"0":"-1")},c.prototype._getMenuItems=function(){return this.toggleEl?Array.from(this.toggleEl.querySelectorAll('a[href], button:not([disabled]), [role="menuitem"]:not([disabled])')):[]},c.prototype._focusItem=function(o,i){for(let n=0;n<o.length;n++)o[n].setAttribute("tabindex",n===i?"0":"-1");o[i]&&o[i].focus()},c.prototype._reposition=function(){if(!this.triggerBtn||!this.toggleEl||!document.contains(this.toggleEl))return;const o=this.triggerBtn.getBoundingClientRect(),i=ze(this.toggleEl),n=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--size-xs"))*16||4,u=this.position||r,d=We(o,i,u,n),a=d.top+"px",f=d.left+"px";this.toggleEl.style.top!==a&&(this.toggleEl.style.top=a),this.toggleEl.style.left!==f&&(this.toggleEl.style.left=f),this.toggleEl.getAttribute("data-ln-dropdown-placement")!==d.placement&&this.toggleEl.setAttribute("data-ln-dropdown-placement",d.placement)},c.prototype._addOutsideClickListener=function(){if(this._boundDocClick)return;const o=this;this._boundDocClick=function(i){o.dom.contains(i.target)||o.toggleEl&&o.toggleEl.contains(i.target)||o.toggleEl&&o.toggleEl.getAttribute("data-ln-toggle")==="open"&&o.toggleEl.setAttribute("data-ln-toggle","close")},o._docClickTimeout=setTimeout(function(){o._docClickTimeout=null,document.addEventListener("click",o._boundDocClick)},0)},c.prototype._removeOutsideClickListener=function(){this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null)},c.prototype._addScrollRepositionListener=function(){const o=this;this._scrollRepositionRaf=null,this._boundScrollReposition=function(){o._scrollRepositionRaf||(o._scrollRepositionRaf=requestAnimationFrame(function(){o._scrollRepositionRaf=null,o._reposition()}))},window.addEventListener("scroll",this._boundScrollReposition,{passive:!0,capture:!0})},c.prototype._removeScrollRepositionListener=function(){this._scrollRepositionRaf&&(cancelAnimationFrame(this._scrollRepositionRaf),this._scrollRepositionRaf=null),this._boundScrollReposition&&(window.removeEventListener("scroll",this._boundScrollReposition,{capture:!0}),this._boundScrollReposition=null)},c.prototype._addResizeCloseListener=function(){const o=this;this._boundResizeClose=function(){o.toggleEl&&o.toggleEl.getAttribute("data-ln-toggle")==="open"&&o.toggleEl.setAttribute("data-ln-toggle","close")},window.addEventListener("resize",this._boundResizeClose)},c.prototype._removeResizeCloseListener=function(){this._boundResizeClose&&(window.removeEventListener("resize",this._boundResizeClose),this._boundResizeClose=null)},c.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.removeEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.removeEventListener("keydown",this._onKeydown),this._removeOutsideClickListener(),this._removeScrollRepositionListener(),this._removeResizeCloseListener(),this.toggleEl&&typeof this.toggleEl.hidePopover=="function"&&this.toggleEl.matches(":popover-open")&&this.toggleEl.hidePopover(),this.toggleEl&&(this.toggleEl.removeAttribute("data-ln-dropdown-placement"),this.toggleEl.removeEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.removeEventListener("ln-toggle:close",this._onToggleClose)),delete this.dom[t])},oe(e,t,c,"ln-dropdown",{attributes:l})})()})();
|
|
1
|
+
(function(){"use strict";function M(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function 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 l=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){l=t[s];break}if(!S(l))return}e.apply(console,t)}}function x(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const r=!!(t&&t.typed),l=t&&t.exclude,s={},c=e.elements,o={};if(r)for(let i=0;i<c.length;i++){const n=c[i];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let i=0;i<c.length;i++){const n=c[i];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")r&&o[n.name]===1?s[n.name]=n.checked:(s[n.name]||(s[n.name]=[]),n.checked&&s[n.name].push(n.value));else if(n.type==="radio")n.checked&&(s[n.name]=n.value);else if(n.type==="select-multiple"){s[n.name]=[];for(let u=0;u<n.options.length;u++)n.options[u].selected&&s[n.name].push(n.options[u].value)}else if(r&&n.type==="hidden")s[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const u=Number(n.value);s[n.name]=n.value===""||isNaN(u)?null:u}else s[n.name]=n.value}return s}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const r=e.elements,l=[],s={};for(let c=0;c<r.length;c++){const o=r[c];o.name&&o.type==="checkbox"&&(s[o.name]=(s[o.name]||0)+1)}for(let c=0;c<r.length;c++){const o=r[c];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const i=o.getAttribute("data-ln-fill-as")||o.name;if(!i||!(i in t))continue;const n=t[i];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(s[o.name]>1){const u=String(n).split(",").map(function(d){return d.trim()});o.checked=u.indexOf(o.value)!==-1}else o.checked=se(n);l.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),l.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let u=0;u<o.options.length;u++)o.options[u].selected=n.indexOf(o.options[u].value)!==-1;l.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),l.push(o)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);const $={};function ue(e,t){$[e]=t}function de(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=de);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function fe(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];N[r]=t}function ge(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=fe,window.lnCore.getLocaleFallback=ge,window.lnCore.ensureLocaleObserver=ae);const L={};function pe(e,t){L[e]||(L[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=L[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function j(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const i=r[o],n=i.getAttribute("data-ln-field");t[n]!=null&&(i.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<l.length;o++){const i=l[o],n=i.getAttribute("data-ln-attr").split(",");for(let u=0;u<n.length;u++){const d=n[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&i.setAttribute(a,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let o=0;o<s.length;o++){const i=s[o],n=i.getAttribute("data-ln-show");n in t&&i.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let o=0;o<c.length;o++){const i=c[o],n=i.getAttribute("data-ln-class").split(",");for(let u=0;u<n.length;u++){const d=n[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&i.classList.toggle(a,!!t[f])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<r.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[l],t??null),r[l].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)j(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function U(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,i){return t[i]!==void 0?t[i]:""}))}const l=function(c,o){return t[o]!==void 0?t[o]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let c=0;c<s.length;c++){const o=s[c],i=o.attributes;for(let n=0;n<i.length;n++){const u=i[n];u.value.indexOf("{{")!==-1&&o.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function he(e,t,r,l,s,c){const o={};for(let n=0;n<e.children.length;n++){const u=e.children[n],d=u.getAttribute("data-ln-render-key");d&&(o[d]=u)}const i=document.createDocumentFragment();for(let n=0;n<t.length;n++){const u=t[n],d=String(l(u));let a=o[d];if(a)s(a,u,n);else{const f=pe(r,c);if(!f||(U(f,u),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),s(a,u,n)}i.appendChild(a)}e.textContent="",e.appendChild(i)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=j,window.lnCore.lnFill=we,window.lnCore.renderList=he);function R(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function P(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function W(e,t,r=!1){const l=e.getAttribute(t);if(l===null)return!!r;const s=l.trim().toLowerCase();return!(s==="false"||s==="0")}function z(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const O=new Map;function H(e,t){const r=(e?e.join("|"):"")+"::"+t;if(O.has(r))return O.get(r);const l=new Set(e||[]),s=function(c,o){const i=c.getAttribute(o);return i!==null&&l.has(i)?i:t};return O.set(r,s),s}function V(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function K(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function Q(e,t,r,l,s){if(!e||t===null)return!0;const c=l||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const i=n=>{s?console.warn(n,s):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(i(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(i(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return i(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(i(`[${c}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(i(`[${c}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(i(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return i(`[${c}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function J(e,t,r){for(const l in r){const[s,c,o]=r[l];Object.defineProperty(e,l,{get:function(){return s(t,c,o)},enumerable:!0,configurable:!0})}return e}function G(e){const t={};for(const r in e){const l=e[r];if(!l||!l.prop)continue;let s=l.read;if(!s&&l.type)switch(l.type){case"enum":s=H(l.values,l.fallback);break;case"integer":s=P;break;case"float":s=V;break;case"boolean":s=W;break;case"list":s=z;break;case"json":s=K;break;case"string":default:s=R;break}s||(s=R),t[l.prop]=[s,r,l.fallback]}return t}function be(e){const t={};for(const r in e){const l=e[r];l&&l.effect&&(t[r]=l.effect)}return Object.keys(t).length?t:null}function me(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=J,window.lnCore.attrSpec=G,window.lnCore.attrStr=R,window.lnCore.attrInt=P,window.lnCore.attrBool=W,window.lnCore.attrList=z,window.lnCore.attrEnum=H,window.lnCore.attrFloat=V,window.lnCore.attrJson=K);function k(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function X(e,t,r,l){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:l};if(e.matches&&e.matches(c)&&k(e,o),e.querySelectorAll){const i=e.querySelectorAll(c);for(let n=0;n<i.length;n++)k(i[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ye(){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 Y(){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 _e(e){const t=Y(),r=e.observed||[];for(let l=0;l<r.length;l++){const s=r[l];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const s=t.byDeclaredAttr.get(l);s.some(c=>c.componentTag===e.componentTag)||s.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=me(e);if(l===null)t.reactiveWildcard.push(e);else for(const s of l)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function Z(e,t,r,l){for(let s=0;s<e.length;s++){const c=e[s];if(!t[c.attribute])continue;const o=c.effects&&c.effects[r];o?o(t,r,l):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,l)}}function Ae(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=Y(),s=l.byAttr.get(t),c=M()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!s&&!c)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(c&&S(o)){const i=l.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let u=0;u<i.length;u++)Q(i[u].spec,n,t,i[u].componentTag,o)}if(window.lnCore._debugSink&&(r||s)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const i=l.byReactive.get(t);i&&Z(i,o,t,e.oldValue),l.reactiveWildcard.length&&Z(l.reactiveWildcard,o,t,e.oldValue)}if(s)for(let i=0;i<s.length;i++){const n=s[i];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(X(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ae(t[r])}catch(l){console.error("[ln-core] mutation handler failed",t[r].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function q(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function D(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function ee(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function te(e){const t=q();if(!t.length)return;const r=e.target;if(r){const s=r.nodeType===1?r:r.parentElement;if(s&&(s.isContentEditable||s.closest&&s.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=D();if(e.target&&l.length)for(let s=0;s<l.length;s++){const c=l[s],o=c.query,i=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;i&&c.onSubtreeChange(i,e)}for(let s=0;s<e.addedNodes.length;s++){const c=e.addedNodes[s];if(c.nodeType!==1)continue;const o=!!(c.firstElementChild||c.children&&c.children.length);for(let i=0;i<t.length;i++){const n=t[i],u=n.query;if(u&&(c.matches&&c.matches(u)&&(n.ComponentFn&&k(c,n),n.onInit&&n.onInit(c)),o&&c.querySelectorAll)){const d=c.querySelectorAll(u);for(let a=0;a<d.length;a++)n.ComponentFn&&k(d[a],n),n.onInit&&n.onInit(d[a])}}}for(let s=0;s<e.removedNodes.length;s++){const c=e.removedNodes[s];if(c.nodeType!==1||document.contains(c))continue;const o=!!(c.firstElementChild||c.children&&c.children.length);for(let i=0;i<t.length;i++){const n=t[i],u=n.query;if(u&&(c.matches&&c.matches(u)&&ee(c,n),o&&c.querySelectorAll)){const d=c.querySelectorAll(u);for(let a=0;a<d.length;a++)ee(d[a],n)}}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{te(l)}catch(s){console.error("[ln-core] lifecycle handler failed",l.target,s)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ee(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let l=0;l<r.length;l++){const s=r[l];if(s.type==="childList")try{te(s)}catch(c){console.error("[ln-core] lifecycle handler failed",s.target,c)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function ke(e){q().push(e),e.onSubtreeChange&&e.query&&D().push(e),ne()}function oe(e,t,r,l,s={}){const c=s.extraAttributes||[],o=s.onAttributeChange||null,i=s.onSubtreeChange||null,n=s.onInit||null,u=s.onAttrChange||null,d=s.effects||null,a=s.attributes||null,f=a?be(a):d,A=a?new Set(Object.keys(a)):null,_=s.persist||null;function C(h){const p=h||document.body;if(X(p,e,t,r),a&&M())for(const v in a){const Ve=a[v],T=Array.from(p.querySelectorAll("["+v+"]"));p.matches&&p.matches("["+v+"]")&&T.push(p);for(let F=0;F<T.length;F++){const B=T[F];S(B)&&Q(Ve,B.getAttribute(v),v,l,B)}}n&&n(p)}const b=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let p;for(;(p=h.exec(e))!==null;)b.push(p[1])}else b.push(e);_e({selector:e,attribute:t,componentTag:l,attributes:a,ComponentFn:r,onInit:n,observed:b.concat(c),onAttributeChange:o,onAttrChange:u,effects:f,declared:A,persist:_}),ve();const y=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,m=s.subtreeQuery||(y?e:"["+e+"]"),g={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:i,query:m};q().push(g),i&&m&&D().push(g),ne(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=oe,window.lnCore.observeLifecycle=ke,window.lnCore.withoutLifecycle=Ee);function w(){ye()>0?Ce(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",w):w(),C}function re(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,r={},l=re(t);if(!l)return r;const s=l.split("&");for(let c=0;c<s.length;c++){const o=s[c];if(!o)continue;const i=o.indexOf(":"),n=i>-1?o.slice(0,i):o,u=i>-1?o.slice(i+1):"";if(n)try{r[n]=decodeURIComponent(u)}catch{r[n]=u}}return r}function Se(e){if(!e)return null;const t=I();return e in t?t[e]:null}function xe(e,t){if(!e)return;const r=I();t==null?delete r[e]:r[e]=String(t);const s=Object.keys(r).map(function(c){const o=r[c];return o===""?c:c+":"+encodeURIComponent(o)}).join("&");re(location.hash)!==s&&(location.hash=s)}function Le(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function qe(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 De(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),l=e.slice(t+1),s=l?l.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=Se,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=Le,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=Ie);function Te(e){return(e||"").replace(/^\?/,"")}function Fe(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},l=Te(t);if(!l)return r;const s=new URLSearchParams(l);for(const[c,o]of s.entries())r[c]=o;return r}function Be(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Me(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const l=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",l)}function $e(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"_"+t:l:t||null}function Ne(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const l=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:l}}}return null}function Ue(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Pe(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Fe,window.lnCore.queryGet=Be,window.lnCore.querySet=Me,window.lnCore.resolveQueryParam=$e,window.lnCore.querySortEncode=Ne,window.lnCore.querySortDecode=je,window.lnCore.queryFilterEncode=Ue,window.lnCore.queryFilterDecode=Pe);function We(e,t,r,l){const s=typeof l=="number"?l:4,c=window.innerWidth,o=window.innerHeight,i=t.width,n=t.height,u=r.split("-"),d=u[0],a=u[1]==="start"||u[1]==="end"?u[1]:"center",f={top:["top","bottom","right","left"],bottom:["bottom","top","right","left"],left:["left","right","top","bottom"],right:["right","left","top","bottom"]},A=f[d]||f.bottom;function _(g){return g==="top"||g==="bottom"?a==="start"?e.left:a==="end"?e.right-i:e.left+(e.width-i)/2:a==="start"?e.top:a==="end"?e.bottom-n:e.top+(e.height-n)/2}function C(g){let w,h,p=!0;return g==="top"?(w=e.top-s-n,h=_(g),w<0&&(p=!1)):g==="bottom"?(w=e.bottom+s,h=_(g),w+n>o&&(p=!1)):g==="left"?(w=_(g),h=e.left-s-i,h<0&&(p=!1)):(w=_(g),h=e.right+s,h+i>c&&(p=!1)),{top:w,left:h,side:g,fits:p}}let b=null;for(let g=0;g<A.length;g++){const w=C(A[g]);if(w.fits){b=w;break}}b||(b=C(A[0]));let y=b.top,m=b.left;return i>=c?m=0:(m<0&&(m=0),m+i>c&&(m=c-i)),n>=o?y=0:(y<0&&(y=0),y+n>o&&(y=o-n)),{top:y,left:m,placement:b.side}}function ze(e){if(!e)return{width:0,height:0};const t=e.style,r=t.visibility,l=t.display,s=t.position;t.visibility="hidden",t.display="block",t.position="fixed";const c=e.offsetWidth,o=e.offsetHeight;return t.visibility=r,t.display=l,t.position=s,{width:c,height:o}}function He(){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=He),(function(){const e="data-ln-dropdown",t="lnDropdown",r="bottom-end";if(window[t]!==void 0)return;const l={"data-ln-dropdown":{type:"marker",description:"Initializes the dropdown container"},"data-ln-dropdown-position":{prop:"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:r,description:"Preferred positioning anchor"},"data-ln-dropdown-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"},"data-ln-dropdown-menu":{type:"marker",description:"Dropdown menu element containing items"}},s=G(l);function c(o){this.dom=o,J(this,o,s),this.toggleEl=o.querySelector("[data-ln-toggle]"),this._boundDocClick=null,this._docClickTimeout=null,this._boundScrollReposition=null,this._boundResizeClose=null,this.toggleEl&&(this.toggleEl.setAttribute("data-ln-dropdown-menu",""),this.toggleEl.setAttribute("role","menu"),this.toggleEl.setAttribute("popover","manual"),this._initMenuAria()),this.triggerBtn=o.querySelector("[data-ln-toggle-for]"),this.triggerBtn&&(this.triggerBtn.setAttribute("aria-haspopup","menu"),this.triggerBtn.setAttribute("aria-expanded","false"));const i=this;return this._onRequestOpen=function(){i.toggleEl&&i.toggleEl.setAttribute("data-ln-toggle","open")},this._onRequestClose=function(){i.toggleEl&&i.toggleEl.setAttribute("data-ln-toggle","close")},this._onRequestToggle=function(){if(i.toggleEl){const n=i.toggleEl.getAttribute("data-ln-toggle");i.toggleEl.setAttribute("data-ln-toggle",n==="open"?"close":"open")}},this._onKeydown=function(n){const u=i.toggleEl&&i.toggleEl.getAttribute("data-ln-toggle")==="open";if(n.key==="Escape"){u&&(n.preventDefault(),n.stopPropagation(),i.toggleEl.setAttribute("data-ln-toggle","close"),i.triggerBtn&&i.triggerBtn.focus());return}if(n.key==="Tab"){u&&(i.triggerBtn&&i.triggerBtn.focus(),i.toggleEl.setAttribute("data-ln-toggle","close"));return}const d=i._getMenuItems();if(d.length===0)return;if(!u&&(n.key==="ArrowDown"||n.key==="ArrowUp")){n.preventDefault(),i.toggleEl.setAttribute("data-ln-toggle","open"),setTimeout(function(){const f=i._getMenuItems();f.length>0&&i._focusItem(f,n.key==="ArrowDown"?0:f.length-1)},0);return}if(!u)return;const a=d.indexOf(document.activeElement);if(n.key==="ArrowDown"){n.preventDefault();const f=a<d.length-1?a+1:0;i._focusItem(d,f)}else if(n.key==="ArrowUp"){n.preventDefault();const f=a>0?a-1:d.length-1;i._focusItem(d,f)}else n.key==="Home"?(n.preventDefault(),i._focusItem(d,0)):n.key==="End"&&(n.preventDefault(),i._focusItem(d,d.length-1))},this.dom.addEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.addEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.addEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.addEventListener("keydown",this._onKeydown),this._onToggleOpen=function(n){!n.detail||n.detail.target!==i.toggleEl||(i.triggerBtn&&i.triggerBtn.setAttribute("aria-expanded","true"),typeof i.toggleEl.showPopover=="function"&&i.toggleEl.showPopover(),i._initMenuAria(),i._reposition(),i._addOutsideClickListener(),i._addScrollRepositionListener(),i._addResizeCloseListener(),x(o,"ln-dropdown:open",{target:n.detail.target}))},this._onToggleClose=function(n){!n.detail||n.detail.target!==i.toggleEl||(i.triggerBtn&&i.triggerBtn.setAttribute("aria-expanded","false"),i._removeOutsideClickListener(),i._removeScrollRepositionListener(),i._removeResizeCloseListener(),i.toggleEl.style.top="",i.toggleEl.style.left="",i.toggleEl.removeAttribute("data-ln-dropdown-placement"),typeof i.toggleEl.hidePopover=="function"&&i.toggleEl.matches(":popover-open")&&i.toggleEl.hidePopover(),x(o,"ln-dropdown:close",{target:n.detail.target}))},this.toggleEl&&(this.toggleEl.addEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.addEventListener("ln-toggle:close",this._onToggleClose)),this}c.prototype._initMenuAria=function(){if(!this.toggleEl)return;const o=this.toggleEl.querySelectorAll("li");for(const n of o)n.setAttribute("role","none");const i=this._getMenuItems();for(let n=0;n<i.length;n++)i[n].setAttribute("role","menuitem"),i[n].setAttribute("tabindex",n===0?"0":"-1")},c.prototype._getMenuItems=function(){return this.toggleEl?Array.from(this.toggleEl.querySelectorAll('a[href], button:not([disabled]), [role="menuitem"]:not([disabled])')):[]},c.prototype._focusItem=function(o,i){for(let n=0;n<o.length;n++)o[n].setAttribute("tabindex",n===i?"0":"-1");o[i]&&o[i].focus()},c.prototype._reposition=function(){if(!this.triggerBtn||!this.toggleEl||!document.contains(this.toggleEl))return;const o=this.triggerBtn.getBoundingClientRect(),i=ze(this.toggleEl),n=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--size-xs"))*16||4,u=this.position||r,d=We(o,i,u,n),a=d.top+"px",f=d.left+"px";this.toggleEl.style.top!==a&&(this.toggleEl.style.top=a),this.toggleEl.style.left!==f&&(this.toggleEl.style.left=f),this.toggleEl.getAttribute("data-ln-dropdown-placement")!==d.placement&&this.toggleEl.setAttribute("data-ln-dropdown-placement",d.placement)},c.prototype._addOutsideClickListener=function(){if(this._boundDocClick)return;const o=this;this._boundDocClick=function(i){o.dom.contains(i.target)||o.toggleEl&&o.toggleEl.contains(i.target)||o.toggleEl&&o.toggleEl.getAttribute("data-ln-toggle")==="open"&&o.toggleEl.setAttribute("data-ln-toggle","close")},o._docClickTimeout=setTimeout(function(){o._docClickTimeout=null,document.addEventListener("click",o._boundDocClick)},0)},c.prototype._removeOutsideClickListener=function(){this._docClickTimeout&&(clearTimeout(this._docClickTimeout),this._docClickTimeout=null),this._boundDocClick&&(document.removeEventListener("click",this._boundDocClick),this._boundDocClick=null)},c.prototype._addScrollRepositionListener=function(){const o=this;this._scrollRepositionRaf=null,this._boundScrollReposition=function(){o._scrollRepositionRaf||(o._scrollRepositionRaf=requestAnimationFrame(function(){o._scrollRepositionRaf=null,o._reposition()}))},window.addEventListener("scroll",this._boundScrollReposition,{passive:!0,capture:!0})},c.prototype._removeScrollRepositionListener=function(){this._scrollRepositionRaf&&(cancelAnimationFrame(this._scrollRepositionRaf),this._scrollRepositionRaf=null),this._boundScrollReposition&&(window.removeEventListener("scroll",this._boundScrollReposition,{capture:!0}),this._boundScrollReposition=null)},c.prototype._addResizeCloseListener=function(){const o=this;this._boundResizeClose=function(){o.toggleEl&&o.toggleEl.getAttribute("data-ln-toggle")==="open"&&o.toggleEl.setAttribute("data-ln-toggle","close")},window.addEventListener("resize",this._boundResizeClose)},c.prototype._removeResizeCloseListener=function(){this._boundResizeClose&&(window.removeEventListener("resize",this._boundResizeClose),this._boundResizeClose=null)},c.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-dropdown:request-open",this._onRequestOpen),this.dom.removeEventListener("ln-dropdown:request-close",this._onRequestClose),this.dom.removeEventListener("ln-dropdown:request-toggle",this._onRequestToggle),this.dom.removeEventListener("keydown",this._onKeydown),this._removeOutsideClickListener(),this._removeScrollRepositionListener(),this._removeResizeCloseListener(),this.toggleEl&&typeof this.toggleEl.hidePopover=="function"&&this.toggleEl.matches(":popover-open")&&this.toggleEl.hidePopover(),this.toggleEl&&(this.toggleEl.removeAttribute("data-ln-dropdown-placement"),this.toggleEl.removeEventListener("ln-toggle:open",this._onToggleOpen),this.toggleEl.removeEventListener("ln-toggle:close",this._onToggleClose)),delete this.dom[t])},oe(e,t,c,"ln-dropdown",{attributes:l})})()})();
|