@livenetworks/ashlar 2.1.2 → 2.1.4

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.
@@ -1 +1 @@
1
- (function(){"use strict";function nt(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function G(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const e=t.closest("[data-ln-debug]");return!(!e||typeof document<"u"&&e===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 t=console.warn;console.warn=function(...e){if(typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))){let o=null;for(let d=1;d<e.length;d++)if(e[d]&&e[d].nodeType===1){o=e[d];break}if(!G(o))return}t.apply(console,e)}}function D(t,e,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,o),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:o}))}function St(t,e,r){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const o={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};o[r]=t.name,D(t.dom,e,o)}function $(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){$(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function it(t){return t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.tagName==="DATA"&&t.hasAttribute("value")?t.getAttribute("value"):t.textContent.trim()}function At(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function Et(t,e){const r=!!(e&&e.typed),o=e&&e.exclude,d={},u=t.elements,c={};if(r)for(let h=0;h<u.length;h++){const s=u[h];s.name&&s.type==="checkbox"&&!s.disabled&&(c[s.name]=(c[s.name]||0)+1)}for(let h=0;h<u.length;h++){const s=u[h];if(!(!s.name||s.disabled||s.type==="file"||s.type==="submit"||s.type==="button")&&!(o&&s.matches&&s.matches(o)))if(s.type==="checkbox")r&&c[s.name]===1?d[s.name]=s.checked:(d[s.name]||(d[s.name]=[]),s.checked&&d[s.name].push(s.value));else if(s.type==="radio")s.checked&&(d[s.name]=s.value);else if(s.type==="select-multiple"){d[s.name]=[];for(let _=0;_<s.options.length;_++)s.options[_].selected&&d[s.name].push(s.options[_].value)}else if(r&&s.type==="hidden")d[s.name]=s.value;else if(r&&(s.type==="number"||s.type==="range")){const _=Number(s.value);d[s.name]=s.value===""||isNaN(_)?null:_}else d[s.name]=s.value}return d}function Dt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function kt(t,e){const r=t.elements,o=[],d={};for(let u=0;u<r.length;u++){const c=r[u];c.name&&c.type==="checkbox"&&(d[c.name]=(d[c.name]||0)+1)}for(let u=0;u<r.length;u++){const c=r[u];if(c.type==="file"||c.type==="submit"||c.type==="button")continue;const h=c.getAttribute("data-ln-fill-as")||c.name;if(!h||!(h in e))continue;const s=e[h];if(c.type==="checkbox"){if(Array.isArray(s))c.checked=s.indexOf(c.value)!==-1;else if(d[c.name]>1){const _=String(s).split(",").map(function(w){return w.trim()});c.checked=_.indexOf(c.value)!==-1}else c.checked=Dt(s);o.push(c)}else if(c.type==="radio")c.checked=c.value===String(s),o.push(c);else if(c.type==="select-multiple"){if(Array.isArray(s))for(let _=0;_<c.options.length;_++)c.options[_].selected=s.indexOf(c.options[_].value)!==-1;o.push(c)}else c.value=s,c.tagName==="SELECT"&&s!=null&&c.setAttribute("data-ln-value",s),o.push(c)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=kt,window.lnCore.serializeForm=Et,window.lnCore.resolveFormMethod=At);const lt={};function Lt(t,e){lt[t]=e}function xt(t){return lt[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Lt,window.lnCore.getDataMapper=xt);function rt(t){const e=t?t.closest("[lang]"):null,r=(e?e.getAttribute("lang")||e.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return r?r.trim():"en-US"}function It(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,$(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const st={};function Tt(t,e){if(!t||typeof e!="object")return;const r=t.toLowerCase().split("-")[0];st[r]=e}function Ft(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return st[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Tt,window.lnCore.getLocaleFallback=Ft,window.lnCore.ensureLocaleObserver=It);const P={};function ot(t,e){P[t]||(P[t]=document.querySelector('[data-ln-template="'+t+'"]'));const r=P[t];return r?r.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function at(t,e,r){if(t){const o=t.querySelector('[data-ln-template="'+e+'"]');if(o)return o.content.cloneNode(!0)}return ot(e,r)}function K(t,e){if(!t||!e)return t;const r=t.querySelectorAll("[data-ln-field]");for(let c=0;c<r.length;c++){const h=r[c],s=h.getAttribute("data-ln-field");e[s]!=null&&(h.textContent=e[s])}const o=t.querySelectorAll("[data-ln-attr]");for(let c=0;c<o.length;c++){const h=o[c],s=h.getAttribute("data-ln-attr").split(",");for(let _=0;_<s.length;_++){const w=s[_].trim().split(":");if(w.length!==2)continue;const b=w[0].trim(),k=w[1].trim();e[k]!=null&&h.setAttribute(b,e[k])}}const d=t.querySelectorAll("[data-ln-show]");for(let c=0;c<d.length;c++){const h=d[c],s=h.getAttribute("data-ln-show");s in e&&h.classList.toggle("hidden",!e[s])}const u=t.querySelectorAll("[data-ln-class]");for(let c=0;c<u.length;c++){const h=u[c],s=h.getAttribute("data-ln-class").split(",");for(let _=0;_<s.length;_++){const w=s[_].trim().split(":");if(w.length!==2)continue;const b=w[0].trim(),k=w[1].trim();k in e&&h.classList.toggle(b,!!e[k])}}return t}function qt(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,e??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0})));const r=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],e??null),r[o].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)K(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let r=0;r<e.length;r++)e[r].textContent=""}})));function Q(t,e){if(!t||!e)return t;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const u=r.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(c,h){return e[h]!==void 0?e[h]:""}))}const o=function(u,c){return e[c]!==void 0?e[c]:""},d=Array.from(t.querySelectorAll("*"));t.nodeType===1&&d.push(t);for(let u=0;u<d.length;u++){const c=d[u],h=c.attributes;for(let s=0;s<h.length;s++){const _=h[s];_.value.indexOf("{{")!==-1&&c.setAttribute(_.name,_.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return t}function Rt(t,e,r,o,d,u){const c={};for(let s=0;s<t.children.length;s++){const _=t.children[s],w=_.getAttribute("data-ln-render-key");w&&(c[w]=_)}const h=document.createDocumentFragment();for(let s=0;s<e.length;s++){const _=e[s],w=String(o(_));let b=c[w];if(b)d(b,_,s);else{const k=ot(r,u);if(!k||(Q(k,_),b=k.firstElementChild,!b))continue;b.setAttribute("data-ln-render-key",w),d(b,_,s)}h.appendChild(b)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=K,window.lnCore.lnFill=qt,window.lnCore.renderList=Rt);function U(t,e,r){const o=t.getAttribute(e);return o===null?r:o}function ct(t,e,r){const o=parseInt(t.getAttribute(e),10);return isNaN(o)?r:o}function Y(t,e,r=!1){const o=t.getAttribute(e);if(o===null)return!!r;const d=o.trim().toLowerCase();return!(d==="false"||d==="0")}function dt(t,e){return(t.getAttribute(e)||"").split(",").map(r=>r.trim()).filter(Boolean)}const J=new Map;function ut(t,e){const r=(t?t.join("|"):"")+"::"+e;if(J.has(r))return J.get(r);const o=new Set(t||[]),d=function(u,c){const h=u.getAttribute(c);return h!==null&&o.has(h)?h:e};return J.set(r,d),d}function ht(t,e,r){const o=parseFloat(t.getAttribute(e));return isNaN(o)?r:o}function ft(t,e,r){const o=t.getAttribute(e);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function _t(t,e,r,o,d){if(!t||e===null)return!0;const u=o||"ln-component",c=t.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||e===""&&t.fallback!==void 0)return!0;const h=s=>{d?console.warn(s,d):console.warn(s)};if(c==="boolean"){const s=e.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(h(`[${u}] Invalid value "${e}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const s=t.values||[];return s.includes(e)?!0:(h(`[${u}] Invalid value "${e}" for attribute "${r}". Allowed: ${s.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(e))return h(`[${u}] Invalid integer "${e}" for attribute "${r}". Fallback: ${t.fallback}.`),!1;const s=parseInt(e,10);return t.min!==void 0&&s<t.min?(h(`[${u}] Value ${s} for attribute "${r}" is less than min (${t.min}).`),!1):t.max!==void 0&&s>t.max?(h(`[${u}] Value ${s} for attribute "${r}" is greater than max (${t.max}).`),!1):!0}if(c==="float")return isNaN(Number(e))?(h(`[${u}] Invalid float "${e}" for attribute "${r}". Fallback: ${t.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(e),!0}catch(s){return h(`[${u}] Invalid JSON for attribute "${r}": ${s.message}. Fallback: ${t.fallback}.`),!1}return!0}function pt(t,e,r){for(const o in r){const[d,u,c]=r[o];Object.defineProperty(t,o,{get:function(){return d(e,u,c)},enumerable:!0,configurable:!0})}return t}function gt(t){const e={};for(const r in t){const o=t[r];if(!o||!o.prop)continue;let d=o.read;if(!d&&o.type)switch(o.type){case"enum":d=ut(o.values,o.fallback);break;case"integer":d=ct;break;case"float":d=ht;break;case"boolean":d=Y;break;case"list":d=dt;break;case"json":d=ft;break;case"string":default:d=U;break}d||(d=U),e[o.prop]=[d,r,o.fallback]}return e}function Ot(t){const e={};for(const r in t){const o=t[r];o&&o.effect&&(e[r]=o.effect)}return Object.keys(e).length?e:null}function Mt(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const r in t.effects)e.add(r);if(t.onAttrChange&&t.declared)for(const r of t.declared)e.add(r);return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=pt,window.lnCore.attrSpec=gt,window.lnCore.attrStr=U,window.lnCore.attrInt=ct,window.lnCore.attrBool=Y,window.lnCore.attrList=dt,window.lnCore.attrEnum=ut,window.lnCore.attrFloat=ht,window.lnCore.attrJson=ft);function V(t,e){if(!t[e.attribute]){window.lnCore._persistSink&&t.hasAttribute&&t.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(t,e.selector);try{t[e.attribute]=new e.ComponentFn(t)}catch(r){console.error("["+e.attribute+"] init failed",t,r)}}}function mt(t,e,r,o){if(t.nodeType!==1)return;const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",c={selector:e,attribute:r,ComponentFn:o};if(t.matches&&t.matches(u)&&V(t,c),t.querySelectorAll){const h=t.querySelectorAll(u);for(let s=0;s<h.length;s++)V(h[s],c)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ht(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Nt(t){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(t):setTimeout(t,0)):t()}function wt(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function Wt(t){const e=wt(),r=t.observed||[];for(let o=0;o<r.length;o++){const d=r[o];e.byAttr.has(d)||e.byAttr.set(d,[]),e.byAttr.get(d).push(t)}if(e.byDeclaredAttr=e.byDeclaredAttr||new Map,t.attributes)for(const o in t.attributes){e.byDeclaredAttr.has(o)||e.byDeclaredAttr.set(o,[]);const d=e.byDeclaredAttr.get(o);d.some(u=>u.componentTag===t.componentTag)||d.push({spec:t.attributes[o],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const o=Mt(t);if(o===null)e.reactiveWildcard.push(t);else for(const d of o)e.byReactive.has(d)||e.byReactive.set(d,[]),e.byReactive.get(d).push(t)}t.persist&&e.persist.push(t)}function bt(t,e,r,o){for(let d=0;d<t.length;d++){const u=t[d];if(!e[u.attribute])continue;const c=u.effects&&u.effects[r];c?c(e,r,o):u.onAttrChange&&(!u.declared||u.declared.has(r))&&u.onAttrChange(e,r,o)}}function zt(t){const e=t.attributeName,r=e.indexOf("data-ln-")===0,o=wt(),d=o.byAttr.get(e),u=nt()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(e);if(!r&&!d&&!u)return;const c=t.target;if(t.oldValue!==c.getAttribute(e)){if(u&&G(c)){const h=o.byDeclaredAttr.get(e),s=c.getAttribute(e);for(let _=0;_<h.length;_++)_t(h[_].spec,s,e,h[_].componentTag,c)}if(window.lnCore._debugSink&&(r||d)&&window.lnCore._debugSink("attr",e,c,{oldValue:t.oldValue,newValue:c.getAttribute(e)}),r){const h=o.byReactive.get(e);h&&bt(h,c,e,t.oldValue),o.reactiveWildcard.length&&bt(o.reactiveWildcard,c,e,t.oldValue)}if(d)for(let h=0;h<d.length;h++){const s=d[h];if(s.handler){s.handler(c,e,t.oldValue);continue}s.onAttributeChange&&c[s.attribute]?s.onAttributeChange(c,e):(mt(c,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(c))}}}function Bt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,$(function(){new MutationObserver(function(e){for(let r=0;r<e.length;r++)try{zt(e[r])}catch(o){console.error("[ln-core] mutation handler failed",e[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function X(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Z(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function tt(t,e){if(!document.contains(t))if(e.attribute){const r=t[e.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+e.attribute+"] destroy failed",t,o)}delete t[e.attribute]}else e.onDestroy&&e.onDestroy(t)}function Ut(t){const e=X();if(!e.length)return;const r=t.target;if(r){const d=r.nodeType===1?r:r.parentElement;if(d&&(d.isContentEditable||d.closest&&d.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=Z();if(t.target&&o.length)for(let d=0;d<o.length;d++){const u=o[d],c=u.query,h=t.target.nodeType===1?t.target.matches&&t.target.matches(c)?t.target:t.target.closest?t.target.closest(c):null:t.target.parentElement&&t.target.parentElement.closest?t.target.parentElement.closest(c):null;h&&u.onSubtreeChange(h,t)}for(let d=0;d<t.addedNodes.length;d++){const u=t.addedNodes[d];if(u.nodeType===1){const c=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const s=e[h];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)u.matches&&u.matches(s.query)&&V(u,s);else if(u.matches&&u.matches(s.query)&&V(u,s),u.querySelectorAll){const _=u.querySelectorAll(s.query);for(let w=0;w<_.length;w++)V(_[w],s)}}s.onInit&&s.onInit(u)}}}for(let d=0;d<t.removedNodes.length;d++){const u=t.removedNodes[d];if(u.nodeType===1){const c=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const s=e[h],_=s.query;if(_){if(!c)u.matches&&u.matches(_)&&tt(u,s);else if(u.matches&&u.matches(_)&&tt(u,s),u.querySelectorAll){const w=u.querySelectorAll(_);for(let b=0;b<w.length;b++)tt(w[b],s)}}}}}}function yt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,$(function(){new MutationObserver(function(e){for(let r=0;r<e.length;r++){const o=e[r];if(o.type==="childList")try{Ut(o)}catch(d){console.error("[ln-core] lifecycle handler failed",o.target,d)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Vt(t){X().push(t),t.onSubtreeChange&&t.query&&Z().push(t),yt()}function Ct(t,e,r,o,d={}){const u=d.extraAttributes||[],c=d.onAttributeChange||null,h=d.onSubtreeChange||null,s=d.onInit||null,_=d.onAttrChange||null,w=d.effects||null,b=d.attributes||null,k=b?Ot(b):w,F=b?new Set(Object.keys(b)):null,q=d.persist||null;function N(i){const l=i||document.body;if(mt(l,t,e,r),b&&nt())for(const a in b){const f=b[a],p=Array.from(l.querySelectorAll("["+a+"]"));l.matches&&l.matches("["+a+"]")&&p.push(l);for(let g=0;g<p.length;g++){const y=p[g];G(y)&&_t(f,y.getAttribute(a),a,o,y)}}s&&s(l)}const I=[];if(t.indexOf("[")!==-1){const i=/\[([\w-]+)/g;let l;for(;(l=i.exec(t))!==null;)I.push(l[1])}else I.push(t);Wt({selector:t,attribute:e,componentTag:o,attributes:b,ComponentFn:r,onInit:s,observed:I.concat(u),onAttributeChange:c,onAttrChange:_,effects:k,declared:F,persist:q}),Bt();const T=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,O=d.subtreeQuery||(T?t:"["+t+"]"),v={selector:t,attribute:e,ComponentFn:r,onInit:s,onSubtreeChange:h,query:O};X().push(v),h&&O&&Z().push(v),yt(),window[e]=N,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Ct,window.lnCore.observeLifecycle=Vt);function n(){Ht()>0?Nt(function(){N(document.body)}):N(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n):n(),N}function $t(t){let e=!1;for(let r=0;r<t.length;r++){const o=t[r];if(!(o===""||o==null)&&(e=!0,!Number.isFinite(Number(o))))return"string"}return e?"number":"string"}function jt(t,e,r,o){if(r==="number"){const c=parseFloat(t),h=parseFloat(e);return(isNaN(c)?0:c)-(isNaN(h)?0:h)}const d=t!=null?String(t):"",u=e!=null?String(e):"";return o?o.compare(d,u):d<u?-1:d>u?1:0}function Gt(t,e){let r=!1;return function(){r||(r=!0,queueMicrotask(function(){r=!1,t()}))}}function Pt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,r=t.pageSize>0?t.pageSize:200,o=t.threshold!=null?t.threshold:25,d=t.fetchDebounce!=null?t.fetchDebounce:120;const u=typeof t.requestPage=="function"?t.requestPage:function(){},c=typeof t.onChange=="function"?t.onChange:function(){},h=new Map,s=new Map,_=new Set;let w=0,b=0,k=0,F={sort:null,filters:{},search:""},q=null,N=0,I=0,T=!1;function O(l){s.set(l,++N)}function v(){return!!(F&&(F.search||F.filters&&Object.keys(F.filters).length))}function n(){if(h.size<=e)return;const l=Array.from(h.keys()).sort(function(f,p){return(s.get(f)||0)-(s.get(p)||0)});let a=0;for(;h.size>e&&a<l.length;)h.delete(l[a]),s.delete(l[a]),a++}function i(l,a){_.add(l),u(F,l,a)}return{get:function(l){return h.get(l)},has:function(l){return h.has(l)},peek:function(){return h.size?h.values().next().value:void 0},get logicalTotal(){return w},get grandTotal(){return b},get queryGen(){return k},get size(){return h.size},ensure:function(l,a){clearTimeout(q),I=l;for(let m=l;m<a;m++)h.has(m)&&O(m);if(w<=0)return;const f=Math.max(0,l-o),p=Math.min(w,a+o),g=Math.floor(f/r),y=Math.floor(Math.max(0,p-1)/r);let E=-1;for(let m=g;m<=y;m++){const C=m*r,L=Math.min(r,w-C);let W=!1;const z=Math.max(C,f),M=Math.min(C+L,p);for(let R=z;R<M;R++)if(!h.has(R)){W=!0;break}if(W&&!_.has(C)){E=C;break}}E!==-1&&(q=setTimeout(function(){i(E,r)},d))},ingest:function(l){if(l=l||{},l.queryGen!=null&&l.queryGen!==k)return!1;const a=l.offset||0,f=l.data||[];let p=0;for(let g=0;g<f.length;g++)f[g]!=null&&p++;if(p===0&&(l.provisional||l.filtered>0))return _.delete(a),!1;T&&(h.clear(),s.clear(),T=!1),l.provisional||(b=l.total!=null?l.total:b,w=l.filtered!=null?l.filtered:l.data?l.data.length:w);for(let g=0;g<f.length;g++)f[g]!=null&&(h.set(a+g,f[g]),O(a+g));return _.delete(a),n(),c(),!0},requestInitial:function(l){l&&(F=l),i(0,r)},invalidate:function(l){k++,_.clear(),clearTimeout(q),l&&(F=l),T=!0,i(0,r)},revalidate:function(){k++,_.clear(),clearTimeout(q),T=!0;const l=Math.max(0,Math.floor(I/r)*r);i(l,r)},release:function(l){_.delete(l)},destroy:function(){clearTimeout(q),h.clear(),s.clear(),_.clear()},configure:function(l){l=l||{};let a=!1;if(l.windowSize!=null&&l.windowSize>0&&l.windowSize!==e){const f=l.windowSize<e;e=l.windowSize,f&&n(),a=!0}l.pageSize!=null&&l.pageSize>0&&(r=l.pageSize),l.threshold!=null&&l.threshold>=0&&(o=l.threshold),l.fetchDebounce!=null&&l.fetchDebounce>=0&&(d=l.fetchDebounce),a&&c()},setGrandTotal:function(l){l==null||isNaN(l)||l<0||(b=l,v()||(w=l),c())}}}function vt(t){return(t||"").replace(/^#/,"")}function et(t){const e=t===void 0?location.hash:t,r={},o=vt(e);if(!o)return r;const d=o.split("&");for(let u=0;u<d.length;u++){const c=d[u];if(!c)continue;const h=c.indexOf(":"),s=h>-1?c.slice(0,h):c,_=h>-1?c.slice(h+1):"";if(s)try{r[s]=decodeURIComponent(_)}catch{r[s]=_}}return r}function Kt(t){if(!t)return null;const e=et();return t in e?e[t]:null}function Qt(t,e){if(!t)return;const r=et();e==null?delete r[t]:r[t]=String(e);const d=Object.keys(r).map(function(u){const c=r[u];return c===""?u:u+":"+encodeURIComponent(c)}).join("&");vt(location.hash)!==d&&(location.hash=d)}function Yt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Jt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const r=t.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return o?e?o+"-"+e:o:e||null}function Xt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Zt(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function te(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function ee(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const r=t.slice(0,e),o=t.slice(e+1),d=o?o.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:r,values:d}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=et,window.lnCore.hashGet=Kt,window.lnCore.hashSet=Qt,window.lnCore.hashLinkClick=Yt,window.lnCore.resolveHashNamespace=Jt,window.lnCore.hashSortEncode=Xt,window.lnCore.hashSortDecode=Zt,window.lnCore.hashFilterEncode=te,window.lnCore.hashFilterDecode=ee);function ne(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=ne),(function(){const t="data-ln-list",e="lnList",r="data-ln-list-empty";if(window[e]!==void 0)return;function s(n,i){if(!n||!n.isDataDriven)return;const l=n.dom.hasAttribute("data-ln-list-window");if(l&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!l&&n._windowed)n._exitWindowedMode();else if(l&&n._windowed){const a=parseInt(i,10);a>0&&n._cache.configure({windowSize:a})}}function _(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>0&&n._cache.configure({pageSize:l})}function w(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>=0&&n._cache.configure({threshold:l})}function b(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>=0&&n._cache.setGrandTotal(l)}const k={"data-ln-list":{prop:"name",type:"string",read:U,fallback:"",description:"List instance name or identifier"},"data-ln-list-source":{prop:"source",type:"string",read:U,fallback:"",description:"Source store or coordinator addressing"},"data-ln-list-selectable":{prop:"_selectable",type:"boolean",read:Y,description:"Enables item selection controls"},"data-ln-list-window":{type:"integer",fallback:1e3,min:10,effect:s,description:"Virtual scrolling window size in items"},"data-ln-list-window-page":{type:"integer",fallback:200,min:5,effect:_,description:"Virtual scrolling slice page size"},"data-ln-list-window-threshold":{type:"integer",fallback:50,min:0,effect:w,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-list-count":{type:"integer",min:0,effect:b,description:"Total item count override for virtual scrollbar calculation"},"data-ln-list-empty":{type:"marker",description:"Container for list empty state"},"data-ln-list-field":{type:"string",description:"Field name mapping for list item binding"}},F=gt(k);function q(n,i){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(rt(i)).format(n)}catch{return String(n)}}function N(n){let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const a=getComputedStyle(i).overflowY;if(a==="auto"||a==="scroll")return i;i=i.parentElement}return null}function I(n){const i=n._scrollContainer||N(n.dom);return{container:i,top:i?i.scrollTop:window.scrollY}}function T(n){n.container?n.container.scrollTop=n.top:window.scrollTo(window.scrollX,n.top)}function O(n){if(!n)return 0;const i=getComputedStyle(n),l=parseFloat(i.marginTop)||0,a=parseFloat(i.marginBottom)||0;return n.offsetHeight+l+a}function v(n){this.dom=n,pt(this,n,F),this.tbody=n.querySelector("[data-ln-list-body]")||n,this.isDataDriven=n.hasAttribute("data-ln-list-source"),this._totalSpan=n.querySelector("[data-ln-list-total]"),this._filteredSpan=n.querySelector("[data-ln-list-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-list-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this._data=[],this._filteredData=[],this.selectedIds=new Set,this._searchTerm="",this._filters={},this._sortField=null,this._sortDir=null,this._virtual=!1,this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._resizeHandler=null,this._scrollContainer=null,this.isUl=this.tbody.tagName==="UL"||this.tbody.tagName==="OL";const i=this;return this._onSetSearch=function(l){const a=(l.detail&&l.detail.query!=null?l.detail.query:l.detail&&l.detail.term!=null?l.detail.term:"").trim();i.isDataDriven?(i.currentSearch=a,D(n,"ln-list:search",{list:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=a.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-list:set-search",this._onSetSearch),this._onSearchChange=function(l){l.preventDefault(),i._onSetSearch(l)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",D(n,"ln-list:clear-filters",{list:i.name}),i._requestData()):(i._searchTerm="",i._filters={},i._sortField=null,i._sortDir=null,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._windowed=!1,this._cache=null,n.hasAttribute("data-ln-list-window")&&this._enterWindowedMode(),this._onSetData=function(l){const a=l.detail||{},f=a.data||[],p=a.total!=null?a.total:f.length;if(!(i._hasInitialSeed&&!i.isLoaded&&f.length===0&&p===0)){if(i._windowed){i._cache.ingest(a)&&!a.provisional&&n.classList.remove("ln-list--loading");return}i._data=f,i._lastTotal=p,i._lastFiltered=a.filtered!=null?a.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-list--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),D(n,"ln-list:rendered",{list:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-list:set-data",this._onSetData),this._onSetLoading=function(l){const a=l.detail&&l.detail.loading;n.classList.toggle("ln-list--loading",!!a),a&&(i.isLoaded=!1)},n.addEventListener("ln-list:set-loading",this._onSetLoading),this._onPageFailed=function(l){!i._windowed||!i._cache||i._cache.release(l.detail&&l.detail.offset)},n.addEventListener("ln-list:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this._onSort=function(l){!l.detail||l.detail.field==null||(l.preventDefault(),i.currentSort=l.detail.direction==="none"?null:{field:l.detail.field,direction:l.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._onItemClick=function(l){if(l.target.closest("[data-ln-item-select]")||l.target.closest("[data-ln-item-action]")||l.target.closest("a")||l.target.closest("button")||l.ctrlKey||l.metaKey||l.button===1)return;const a=l.target.closest("[data-ln-item]");if(!a)return;const f=a.getAttribute("data-ln-item-id"),p=a._lnRecord||{};D(n,"ln-list:item-click",{list:i.name,id:f,record:p})},this.tbody&&this.tbody.addEventListener("click",this._onItemClick),this._onItemAction=function(l){const a=l.target.closest("[data-ln-item-action]");if(!a)return;const f=a.closest("[data-ln-item]");if(!f)return;const p=a.getAttribute("data-ln-item-action"),g=f.getAttribute("data-ln-item-id"),y=f._lnRecord||{};D(n,"ln-list:item-action",{list:i.name,id:g,action:p,record:y})},this.tbody&&this.tbody.addEventListener("click",this._onItemAction),this.tbody&&this.tbody.children.length>0&&this._parseChildren(),this._windowed?this._kickWindowInitial():D(n,"ln-list:request-data",{list:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyObserver=null,this.tbody&&this.tbody.children.length>0?this._parseChildren():this.tbody&&(this._emptyObserver=new MutationObserver(function(){i.tbody.children.length>0&&(i._emptyObserver.disconnect(),i._emptyObserver=null,i._parseChildren())}),this._emptyObserver.observe(this.tbody,{childList:!0})),this._onFilterChange=function(l){if(l.preventDefault(),!l.detail)return;const a=l.detail.key,f=l.detail.values||[];if(a){if(f.length===0)delete i._filters[a];else{const p=[];for(let g=0;g<f.length;g++)p.push(f[g].toLowerCase());i._filters[a]=p}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange),this._onSort=function(l){if(!l.detail||l.detail.field==null)return;l.preventDefault();const a=l.detail.direction==="none"?null:l.detail.direction;i._sortField=a===null?null:l.detail.field,i._sortDir=a,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:sorted",{field:i._sortField,direction:l.detail&&l.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort)),this}v.prototype._parseChildren=function(){const n=Array.from(this.tbody.children).filter(i=>!i.classList.contains("ln-list__spacer"));this._data=[],n.length>0&&(this._itemHeight=O(n[0])||50);for(let i=0;i<n.length;i++){const l=n[i],a=l.getAttribute("data-ln-item-id")||l.getAttribute("id"),f=l.textContent.trim().toLowerCase();let p=null;if(this.isDataDriven){p={},a!=null&&(p.id=a);const E=l.querySelectorAll("[data-ln-list-field]");for(let m=0;m<E.length;m++){const C=E[m],L=C.getAttribute("data-ln-list-field");L&&(p[L]=it(C))}}const g={},y=l.querySelectorAll("[data-ln-list-field], [data-ln-field]");for(let E=0;E<y.length;E++){const m=y[E],C=m.getAttribute("data-ln-list-field")||m.getAttribute("data-ln-field");C&&(g[C]=it(m))}for(let E=0;E<l.attributes.length;E++){const m=l.attributes[E];if(m.name.startsWith("data-")&&!m.name.startsWith("data-ln-")){const C=m.name.slice(5);C&&(g[C]=m.value)}}this._data.push({html:l.outerHTML,id:a,searchText:f,fields:g,...p||{}})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),D(this.dom,"ln-list:ready",{total:this._data.length})},v.prototype._applyFilterAndSort=function(){if(this.isDataDriven)this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length;else{const n=this._searchTerm,i=n?n.split(/\s+/).filter(Boolean):[],l=this._filters||{},a=Object.keys(l).length>0;if(i.length===0&&!a?this._filteredData=this._data.slice():this._filteredData=this._data.filter(function(f){if(i.length>0&&!i.every(function(g){return f.searchText&&f.searchText.indexOf(g)!==-1}))return!1;if(a)for(const p in l){const g=l[p];if(g&&g.length>0){const y=f.fields&&f.fields[p]!==void 0?f.fields[p]:f[p]!==void 0?f[p]:null,E=y!=null?String(y).toLowerCase():"";if(g.indexOf(E)===-1)return!1}}return!0}),this._sortField&&this._sortDir){const f=this._sortField,p=this._sortDir==="desc"?-1:1,g=typeof Intl<"u"?new Intl.Collator(rt(this.dom),{sensitivity:"base"}):null,y=this._filteredData.map(function(m){return m.fields&&m.fields[f]!==void 0?m.fields[f]:m[f]}),E=$t(y);this._filteredData.sort(function(m,C){const L=m.fields&&m.fields[f]!==void 0?m.fields[f]:m[f],W=C.fields&&C.fields[f]!==void 0?C.fields[f]:C[f];return jt(L,W,E,g)*p})}}},v.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,i=this.visibleCount;if(n===0||this._filteredData.length===0||i===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const n=this._filteredData.length;n===0&&(this._searchTerm||Object.keys(this._filters||{}).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):n>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},v.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,i=document.createDocumentFragment();for(let a=0;a<n.length;a++){const f=this._buildItem(n[a]);f&&i.appendChild(f)}const l=I(this);this.tbody.replaceChildren(i),T(l),this._selectable&&this._updateSelectAll()}else{const n=[],i=this._filteredData;for(let a=0;a<i.length;a++)n.push(i[a].html);const l=I(this);this.tbody.innerHTML=n.join(""),T(l),this._selectable&&this._restoreSelection()}},v.prototype._readGridLayout=function(){const n=getComputedStyle(this.tbody),i=n.gridTemplateColumns;let l=1;if(i&&i!=="none"){const f=i.trim().split(/\s+/).filter(Boolean);f.length>0&&(l=f.length)}const a=parseFloat(n.rowGap);return{columns:l,rowGap:isNaN(a)?0:a}},v.prototype._measureItemHeight=function(){if(this._windowed){const n=this._cache.peek(),i=n?this._buildItem(n):this._buildPlaceholderItem();i&&(this.tbody.textContent="",this.tbody.appendChild(i),this._itemHeight=O(i)||50,this.tbody.textContent="")}else if(this.isDataDriven){if(this._data.length>0){const n=this._buildItem(this._data[0]);n&&(this.tbody.textContent="",this.tbody.appendChild(n),this._itemHeight=O(n)||50,this.tbody.textContent="")}}else{const n=this.tbody.children;n.length>0&&(this._itemHeight=O(n[0])||50)}},v.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;this._itemHeight||this._measureItemHeight(),this._scrollContainer=N(this.dom);const i=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},this._resizeRafId=null,this._resizeHandler=function(){n._resizeRafId||(n._resizeRafId=requestAnimationFrame(function(){n._resizeRafId=null,n._itemHeight=0,n._measureItemHeight(),n._vStart=-1,n._vEnd=-1,n._windowed?n._renderWindowed():n._renderVirtual()}))},i.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._resizeHandler,{passive:!0})},v.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._resizeRafId&&(cancelAnimationFrame(this._resizeRafId),this._resizeRafId=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},v.prototype._renderVirtual=function(){const n=this._filteredData,i=n.length,l=this._itemHeight;if(!l||!i)return;const a=this._scrollContainer;let f,p;if(a){const x=this.tbody.getBoundingClientRect(),A=a.getBoundingClientRect(),S=a===this.tbody?0:x.top-A.top+a.scrollTop;f=a.scrollTop-S,p=a.clientHeight}else{const A=this.tbody.getBoundingClientRect().top+window.scrollY;f=window.scrollY-A,p=window.innerHeight}const g=this._readGridLayout(),y=g.columns,E=g.rowGap,m=l+E,C=Math.ceil(i/y);let L=Math.max(0,Math.floor(f/m)-15);L=Math.min(L,C);const W=Math.ceil(p/m)+30,z=Math.min(L+W,C),M=Math.min(L*y,i),R=Math.min(z*y,i);if(M===this._vStart&&R===this._vEnd)return;this._vStart=M,this._vEnd=R;const B=L*m,H=(C-z)*m;if(this.isDataDriven){const x=document.createDocumentFragment();if(B>0){const S=document.createElement(this.isUl?"li":"div");S.className="ln-list__spacer",S.setAttribute("aria-hidden","true"),S.style.height=B+"px",x.appendChild(S)}for(let S=M;S<R;S++){const j=this._buildItem(n[S]);j&&x.appendChild(j)}if(H>0){const S=document.createElement(this.isUl?"li":"div");S.className="ln-list__spacer",S.setAttribute("aria-hidden","true"),S.style.height=H+"px",x.appendChild(S)}const A=I(this);this.tbody.replaceChildren(x),T(A),this._selectable&&this._updateSelectAll()}else{let x="";B>0&&(x+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${B}px"></${this.isUl?"li":"div"}>`);for(let S=M;S<R;S++)x+=n[S].html;H>0&&(x+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${H}px"></${this.isUl?"li":"div"}>`);const A=I(this);this.tbody.innerHTML=x,T(A),this._selectable&&this._restoreSelection()}},v.prototype._buildPlaceholderItem=function(){const n=document.createElement(this.isUl?"li":"div");return n.className="ln-list__placeholder",n.setAttribute("aria-hidden","true"),n.style.height=this._itemHeight+"px",n},v.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._itemHeight;if(!n)return;const i=this._scrollContainer;let l,a;if(i){const A=this.tbody.getBoundingClientRect(),S=i.getBoundingClientRect(),j=i===this.tbody?0:A.top-S.top+i.scrollTop;l=i.scrollTop-j,a=i.clientHeight}else{const S=this.tbody.getBoundingClientRect().top+window.scrollY;l=window.scrollY-S,a=window.innerHeight}const f=this._readGridLayout(),p=f.columns,g=f.rowGap,y=n+g,E=this._cache.logicalTotal,m=Math.ceil(E/p);let C=Math.max(0,Math.floor(l/y)-15);C=Math.min(C,m);const L=Math.ceil(a/y)+30,W=Math.min(C+L,m),z=Math.min(C*p,E),M=Math.min(W*p,E),R=C*y,B=(m-W)*y,H=document.createDocumentFragment();if(R>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=R+"px",H.appendChild(A)}for(let A=z;A<M;A++)if(this._cache.has(A)){const S=this._buildItem(this._cache.get(A));S&&H.appendChild(S)}else H.appendChild(this._buildPlaceholderItem());if(B>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=B+"px",H.appendChild(A)}const x=I(this);this.tbody.replaceChildren(H),T(x),this._vStart=z,this._vEnd=M,this._cache.ensure(z,M)},v.prototype._showEmptyState=function(){let n=null;if(this.isDataDriven){const i=this._lastTotal!=null?this._lastTotal:this._data.length,a=this.visibleCount===0&&i>0,f=a?this.name+"-empty-filtered":this.name+"-empty";if(n=at(this.dom,f,"ln-list"),!n){const p=this.dom.querySelector("template[data-ln-empty], template[data-ln-list-empty]");if(p){const g=a?"search":"initial",y=p.content.querySelector(`[data-ln-empty-when="${g}"]`)||p.content.firstElementChild;y&&(n=document.importNode(y,!0))}}}else{const i=this.dom.querySelector(`template[${r}]`);if(i){const l=i.content.firstElementChild;l&&(n=document.importNode(l,!0))}}if(n)if(n.tagName==="LI"||n.tagName==="TR")this.tbody.replaceChildren(n);else{const i=document.createElement(this.isUl?"li":"div");i.appendChild(n),this.tbody.replaceChildren(i)}else this.tbody.replaceChildren();D(this.dom,"ln-list:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},v.prototype._buildItem=function(n){let i=at(this.dom,this.name+"-row","ln-list");if(!i){const a=this.dom.querySelector("template[data-ln-item]");a&&(i=document.importNode(a.content,!0))}let l=i?i.querySelector("[data-ln-item]")||i.firstElementChild:null;if(l)Q(l,n),K(l,n);else if(n&&n.html){const a=document.createElement(this.isUl?"ul":"div");a.innerHTML=n.html,l=a.firstElementChild}else if(l=document.createElement(this.isUl?"li":"div"),l.setAttribute("data-ln-item",""),n&&typeof n=="object"){for(const a in n)if(a!=="html"&&n[a]!=null){const f=document.createElement("span");f.setAttribute("data-ln-field",a),f.textContent=String(n[a]),l.appendChild(f)}}if(l._lnRecord=n,n&&n.id!=null&&(l.setAttribute("data-ln-item-id",n.id),this._selectable&&this.selectedIds.has(String(n.id)))){l.classList.add("ln-item-selected");const a=l.querySelector("[data-ln-item-select]");a&&(a.checked=!0)}return l},v.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-item]");for(let i=0;i<n.length;i++){const l=n[i].getAttribute("data-ln-item-id"),a=l!=null&&this.selectedIds.has(String(l));n[i].classList.toggle("ln-item-selected",a);const f=n[i].querySelector("[data-ln-item-select]");f&&(f.checked=a)}this._updateSelectAll()},v.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;this._onSelectionChange=function(i){const l=i.target.closest("[data-ln-item-select]");if(!l)return;const a=l.closest("[data-ln-item]");if(!a)return;const f=a.getAttribute("data-ln-item-id");f!=null&&(l.checked?(n.selectedIds.add(String(f)),a.classList.add("ln-item-selected")):(n.selectedIds.delete(String(f)),a.classList.remove("ln-item-selected")),n._updateSelectAll(),n._updateFooter(),D(n.dom,"ln-list:select",{list:n.name,selectedIds:n.selectedIds,count:n.selectedIds.size}))},this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector("[data-ln-list-select-all]"),this._selectAllCheckbox&&(this._onSelectAll=function(){const i=n._selectAllCheckbox.checked,l=n.tbody.querySelectorAll("[data-ln-item]");for(let a=0;a<l.length;a++){const f=l[a],p=f.getAttribute("data-ln-item-id"),g=f.querySelector("[data-ln-item-select]");p!=null&&(i?(n.selectedIds.add(String(p)),f.classList.add("ln-item-selected")):(n.selectedIds.delete(String(p)),f.classList.remove("ln-item-selected")),g&&(g.checked=i))}D(n.dom,"ln-list:select-all",{list:n.name,selected:i}),D(n.dom,"ln-list:select",{list:n.name,selectedIds:n.selectedIds,count:n.selectedIds.size}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll))},v.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox)return;const n=this.tbody.querySelectorAll("[data-ln-item]");let i=n.length>0;for(let l=0;l<n.length;l++){const a=n[l].getAttribute("data-ln-item-id");if(a!=null&&!this.selectedIds.has(String(a))){i=!1;break}}this._selectAllCheckbox.checked=i},v.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-list--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}St(this,"ln-list:request-data","list")},v.prototype._enterWindowedMode=function(){const n=this,i=this.dom,l=parseInt(i.getAttribute("data-ln-list-window"),10),a=parseInt(i.getAttribute("data-ln-list-window-page"),10),f=parseInt(i.getAttribute("data-ln-list-window-threshold"),10);this._onCacheChange=function(){!n._windowed||!n._cache||(n.totalCount=n._cache.grandTotal,n.visibleCount=n._cache.logicalTotal,n._lastTotal=n._cache.grandTotal,n.isLoaded=!0,n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(i,"ln-list:rendered",{list:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=Gt(this._onCacheChange),this._cache=Pt({windowSize:l>0?l:1e3,pageSize:a>0?a:200,threshold:f>=0?f:25,fetchDebounce:120,requestPage:function(p,g,y){D(i,"ln-list:request-data",{list:n.name,sort:p.sort,filters:p.filters,search:p.search,offset:g,limit:y,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},v.prototype._kickWindowInitial=function(){if(this._data.length>0){const n=parseInt(this.dom.getAttribute("data-ln-list-count"),10),i=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:i,filtered:i})}else this.dom.classList.add("ln-list--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},v.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-list--loading"),this._requestData()},v.prototype._updateFooter=function(){let n=0,i=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,i=this.visibleCount):(n=this._data.length,i=this._filteredData.length);const l=i<n;if(this._totalSpan&&(this._totalSpan.textContent=q(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=l?q(i,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!l),this._selectedSpan){const a=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=a>0?q(a,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",a===0)}},v.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-list:set-search",this._onSetSearch),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this._cache&&this._cache.destroy(),this.dom.removeEventListener("ln-list:set-data",this._onSetData),this.dom.removeEventListener("ln-list:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-list:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onItemClick),this.tbody.removeEventListener("click",this._onItemAction))):(this._emptyObserver&&(this._emptyObserver.disconnect(),this._emptyObserver=null),this._onFilterChange&&this.dom.removeEventListener("ln-filter:change",this._onFilterChange),this._onSort&&this.dom.removeEventListener("ln-sort:change",this._onSort)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._data=[],this._filteredData=[],delete this.dom[e])},Ct(t,e,v,"ln-list",{attributes:k})})()})();
1
+ (function(){"use strict";function nt(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function G(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const e=t.closest("[data-ln-debug]");return!(!e||typeof document<"u"&&e===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 t=console.warn;console.warn=function(...e){if(typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))){let o=null;for(let d=1;d<e.length;d++)if(e[d]&&e[d].nodeType===1){o=e[d];break}if(!G(o))return}t.apply(console,e)}}function D(t,e,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,o),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:o}))}function St(t,e,r){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const o={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};o[r]=t.name,D(t.dom,e,o)}function $(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){$(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function it(t){return t.hasAttribute("value")?t.getAttribute("value"):t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.textContent.trim()}function At(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function Et(t,e){const r=!!(e&&e.typed),o=e&&e.exclude,d={},u=t.elements,c={};if(r)for(let h=0;h<u.length;h++){const s=u[h];s.name&&s.type==="checkbox"&&!s.disabled&&(c[s.name]=(c[s.name]||0)+1)}for(let h=0;h<u.length;h++){const s=u[h];if(!(!s.name||s.disabled||s.type==="file"||s.type==="submit"||s.type==="button")&&!(o&&s.matches&&s.matches(o)))if(s.type==="checkbox")r&&c[s.name]===1?d[s.name]=s.checked:(d[s.name]||(d[s.name]=[]),s.checked&&d[s.name].push(s.value));else if(s.type==="radio")s.checked&&(d[s.name]=s.value);else if(s.type==="select-multiple"){d[s.name]=[];for(let _=0;_<s.options.length;_++)s.options[_].selected&&d[s.name].push(s.options[_].value)}else if(r&&s.type==="hidden")d[s.name]=s.value;else if(r&&(s.type==="number"||s.type==="range")){const _=Number(s.value);d[s.name]=s.value===""||isNaN(_)?null:_}else d[s.name]=s.value}return d}function Dt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function kt(t,e){const r=t.elements,o=[],d={};for(let u=0;u<r.length;u++){const c=r[u];c.name&&c.type==="checkbox"&&(d[c.name]=(d[c.name]||0)+1)}for(let u=0;u<r.length;u++){const c=r[u];if(c.type==="file"||c.type==="submit"||c.type==="button")continue;const h=c.getAttribute("data-ln-fill-as")||c.name;if(!h||!(h in e))continue;const s=e[h];if(c.type==="checkbox"){if(Array.isArray(s))c.checked=s.indexOf(c.value)!==-1;else if(d[c.name]>1){const _=String(s).split(",").map(function(w){return w.trim()});c.checked=_.indexOf(c.value)!==-1}else c.checked=Dt(s);o.push(c)}else if(c.type==="radio")c.checked=c.value===String(s),o.push(c);else if(c.type==="select-multiple"){if(Array.isArray(s))for(let _=0;_<c.options.length;_++)c.options[_].selected=s.indexOf(c.options[_].value)!==-1;o.push(c)}else c.value=s,c.tagName==="SELECT"&&s!=null&&c.setAttribute("data-ln-value",s),o.push(c)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=kt,window.lnCore.serializeForm=Et,window.lnCore.resolveFormMethod=At);const lt={};function Lt(t,e){lt[t]=e}function xt(t){return lt[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Lt,window.lnCore.getDataMapper=xt);function rt(t){const e=t?t.closest("[lang]"):null,r=(e?e.getAttribute("lang")||e.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return r?r.trim():"en-US"}function It(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,$(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const st={};function Tt(t,e){if(!t||typeof e!="object")return;const r=t.toLowerCase().split("-")[0];st[r]=e}function Ft(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return st[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Tt,window.lnCore.getLocaleFallback=Ft,window.lnCore.ensureLocaleObserver=It);const P={};function ot(t,e){P[t]||(P[t]=document.querySelector('[data-ln-template="'+t+'"]'));const r=P[t];return r?r.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function at(t,e,r){if(t){const o=t.querySelector('[data-ln-template="'+e+'"]');if(o)return o.content.cloneNode(!0)}return ot(e,r)}function K(t,e){if(!t||!e)return t;const r=t.querySelectorAll("[data-ln-field]");for(let c=0;c<r.length;c++){const h=r[c],s=h.getAttribute("data-ln-field");e[s]!=null&&(h.textContent=e[s])}const o=t.querySelectorAll("[data-ln-attr]");for(let c=0;c<o.length;c++){const h=o[c],s=h.getAttribute("data-ln-attr").split(",");for(let _=0;_<s.length;_++){const w=s[_].trim().split(":");if(w.length!==2)continue;const b=w[0].trim(),k=w[1].trim();e[k]!=null&&h.setAttribute(b,e[k])}}const d=t.querySelectorAll("[data-ln-show]");for(let c=0;c<d.length;c++){const h=d[c],s=h.getAttribute("data-ln-show");s in e&&h.classList.toggle("hidden",!e[s])}const u=t.querySelectorAll("[data-ln-class]");for(let c=0;c<u.length;c++){const h=u[c],s=h.getAttribute("data-ln-class").split(",");for(let _=0;_<s.length;_++){const w=s[_].trim().split(":");if(w.length!==2)continue;const b=w[0].trim(),k=w[1].trim();k in e&&h.classList.toggle(b,!!e[k])}}return t}function qt(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,e??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0})));const r=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],e??null),r[o].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)K(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let r=0;r<e.length;r++)e[r].textContent=""}})));function Q(t,e){if(!t||!e)return t;const r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const u=r.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(c,h){return e[h]!==void 0?e[h]:""}))}const o=function(u,c){return e[c]!==void 0?e[c]:""},d=Array.from(t.querySelectorAll("*"));t.nodeType===1&&d.push(t);for(let u=0;u<d.length;u++){const c=d[u],h=c.attributes;for(let s=0;s<h.length;s++){const _=h[s];_.value.indexOf("{{")!==-1&&c.setAttribute(_.name,_.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return t}function Rt(t,e,r,o,d,u){const c={};for(let s=0;s<t.children.length;s++){const _=t.children[s],w=_.getAttribute("data-ln-render-key");w&&(c[w]=_)}const h=document.createDocumentFragment();for(let s=0;s<e.length;s++){const _=e[s],w=String(o(_));let b=c[w];if(b)d(b,_,s);else{const k=ot(r,u);if(!k||(Q(k,_),b=k.firstElementChild,!b))continue;b.setAttribute("data-ln-render-key",w),d(b,_,s)}h.appendChild(b)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=K,window.lnCore.lnFill=qt,window.lnCore.renderList=Rt);function U(t,e,r){const o=t.getAttribute(e);return o===null?r:o}function ct(t,e,r){const o=parseInt(t.getAttribute(e),10);return isNaN(o)?r:o}function Y(t,e,r=!1){const o=t.getAttribute(e);if(o===null)return!!r;const d=o.trim().toLowerCase();return!(d==="false"||d==="0")}function dt(t,e){return(t.getAttribute(e)||"").split(",").map(r=>r.trim()).filter(Boolean)}const J=new Map;function ut(t,e){const r=(t?t.join("|"):"")+"::"+e;if(J.has(r))return J.get(r);const o=new Set(t||[]),d=function(u,c){const h=u.getAttribute(c);return h!==null&&o.has(h)?h:e};return J.set(r,d),d}function ht(t,e,r){const o=parseFloat(t.getAttribute(e));return isNaN(o)?r:o}function ft(t,e,r){const o=t.getAttribute(e);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function _t(t,e,r,o,d){if(!t||e===null)return!0;const u=o||"ln-component",c=t.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||e===""&&t.fallback!==void 0)return!0;const h=s=>{d?console.warn(s,d):console.warn(s)};if(c==="boolean"){const s=e.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(h(`[${u}] Invalid value "${e}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const s=t.values||[];return s.includes(e)?!0:(h(`[${u}] Invalid value "${e}" for attribute "${r}". Allowed: ${s.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(e))return h(`[${u}] Invalid integer "${e}" for attribute "${r}". Fallback: ${t.fallback}.`),!1;const s=parseInt(e,10);return t.min!==void 0&&s<t.min?(h(`[${u}] Value ${s} for attribute "${r}" is less than min (${t.min}).`),!1):t.max!==void 0&&s>t.max?(h(`[${u}] Value ${s} for attribute "${r}" is greater than max (${t.max}).`),!1):!0}if(c==="float")return isNaN(Number(e))?(h(`[${u}] Invalid float "${e}" for attribute "${r}". Fallback: ${t.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(e),!0}catch(s){return h(`[${u}] Invalid JSON for attribute "${r}": ${s.message}. Fallback: ${t.fallback}.`),!1}return!0}function pt(t,e,r){for(const o in r){const[d,u,c]=r[o];Object.defineProperty(t,o,{get:function(){return d(e,u,c)},enumerable:!0,configurable:!0})}return t}function gt(t){const e={};for(const r in t){const o=t[r];if(!o||!o.prop)continue;let d=o.read;if(!d&&o.type)switch(o.type){case"enum":d=ut(o.values,o.fallback);break;case"integer":d=ct;break;case"float":d=ht;break;case"boolean":d=Y;break;case"list":d=dt;break;case"json":d=ft;break;case"string":default:d=U;break}d||(d=U),e[o.prop]=[d,r,o.fallback]}return e}function Ot(t){const e={};for(const r in t){const o=t[r];o&&o.effect&&(e[r]=o.effect)}return Object.keys(e).length?e:null}function Mt(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const r in t.effects)e.add(r);if(t.onAttrChange&&t.declared)for(const r of t.declared)e.add(r);return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=pt,window.lnCore.attrSpec=gt,window.lnCore.attrStr=U,window.lnCore.attrInt=ct,window.lnCore.attrBool=Y,window.lnCore.attrList=dt,window.lnCore.attrEnum=ut,window.lnCore.attrFloat=ht,window.lnCore.attrJson=ft);function V(t,e){if(!t[e.attribute]){window.lnCore._persistSink&&t.hasAttribute&&t.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(t,e.selector);try{t[e.attribute]=new e.ComponentFn(t)}catch(r){console.error("["+e.attribute+"] init failed",t,r)}}}function mt(t,e,r,o){if(t.nodeType!==1)return;const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",c={selector:e,attribute:r,ComponentFn:o};if(t.matches&&t.matches(u)&&V(t,c),t.querySelectorAll){const h=t.querySelectorAll(u);for(let s=0;s<h.length;s++)V(h[s],c)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ht(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Nt(t){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(t):setTimeout(t,0)):t()}function wt(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function Wt(t){const e=wt(),r=t.observed||[];for(let o=0;o<r.length;o++){const d=r[o];e.byAttr.has(d)||e.byAttr.set(d,[]),e.byAttr.get(d).push(t)}if(e.byDeclaredAttr=e.byDeclaredAttr||new Map,t.attributes)for(const o in t.attributes){e.byDeclaredAttr.has(o)||e.byDeclaredAttr.set(o,[]);const d=e.byDeclaredAttr.get(o);d.some(u=>u.componentTag===t.componentTag)||d.push({spec:t.attributes[o],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const o=Mt(t);if(o===null)e.reactiveWildcard.push(t);else for(const d of o)e.byReactive.has(d)||e.byReactive.set(d,[]),e.byReactive.get(d).push(t)}t.persist&&e.persist.push(t)}function bt(t,e,r,o){for(let d=0;d<t.length;d++){const u=t[d];if(!e[u.attribute])continue;const c=u.effects&&u.effects[r];c?c(e,r,o):u.onAttrChange&&(!u.declared||u.declared.has(r))&&u.onAttrChange(e,r,o)}}function zt(t){const e=t.attributeName,r=e.indexOf("data-ln-")===0,o=wt(),d=o.byAttr.get(e),u=nt()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(e);if(!r&&!d&&!u)return;const c=t.target;if(t.oldValue!==c.getAttribute(e)){if(u&&G(c)){const h=o.byDeclaredAttr.get(e),s=c.getAttribute(e);for(let _=0;_<h.length;_++)_t(h[_].spec,s,e,h[_].componentTag,c)}if(window.lnCore._debugSink&&(r||d)&&window.lnCore._debugSink("attr",e,c,{oldValue:t.oldValue,newValue:c.getAttribute(e)}),r){const h=o.byReactive.get(e);h&&bt(h,c,e,t.oldValue),o.reactiveWildcard.length&&bt(o.reactiveWildcard,c,e,t.oldValue)}if(d)for(let h=0;h<d.length;h++){const s=d[h];if(s.handler){s.handler(c,e,t.oldValue);continue}s.onAttributeChange&&c[s.attribute]?s.onAttributeChange(c,e):(mt(c,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(c))}}}function Bt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,$(function(){new MutationObserver(function(e){for(let r=0;r<e.length;r++)try{zt(e[r])}catch(o){console.error("[ln-core] mutation handler failed",e[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function X(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Z(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function tt(t,e){if(!document.contains(t))if(e.attribute){const r=t[e.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+e.attribute+"] destroy failed",t,o)}delete t[e.attribute]}else e.onDestroy&&e.onDestroy(t)}function Ut(t){const e=X();if(!e.length)return;const r=t.target;if(r){const d=r.nodeType===1?r:r.parentElement;if(d&&(d.isContentEditable||d.closest&&d.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=Z();if(t.target&&o.length)for(let d=0;d<o.length;d++){const u=o[d],c=u.query,h=t.target.nodeType===1?t.target.matches&&t.target.matches(c)?t.target:t.target.closest?t.target.closest(c):null:t.target.parentElement&&t.target.parentElement.closest?t.target.parentElement.closest(c):null;h&&u.onSubtreeChange(h,t)}for(let d=0;d<t.addedNodes.length;d++){const u=t.addedNodes[d];if(u.nodeType===1){const c=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const s=e[h];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)u.matches&&u.matches(s.query)&&V(u,s);else if(u.matches&&u.matches(s.query)&&V(u,s),u.querySelectorAll){const _=u.querySelectorAll(s.query);for(let w=0;w<_.length;w++)V(_[w],s)}}s.onInit&&s.onInit(u)}}}for(let d=0;d<t.removedNodes.length;d++){const u=t.removedNodes[d];if(u.nodeType===1){const c=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const s=e[h],_=s.query;if(_){if(!c)u.matches&&u.matches(_)&&tt(u,s);else if(u.matches&&u.matches(_)&&tt(u,s),u.querySelectorAll){const w=u.querySelectorAll(_);for(let b=0;b<w.length;b++)tt(w[b],s)}}}}}}function yt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,$(function(){new MutationObserver(function(e){for(let r=0;r<e.length;r++){const o=e[r];if(o.type==="childList")try{Ut(o)}catch(d){console.error("[ln-core] lifecycle handler failed",o.target,d)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Vt(t){X().push(t),t.onSubtreeChange&&t.query&&Z().push(t),yt()}function Ct(t,e,r,o,d={}){const u=d.extraAttributes||[],c=d.onAttributeChange||null,h=d.onSubtreeChange||null,s=d.onInit||null,_=d.onAttrChange||null,w=d.effects||null,b=d.attributes||null,k=b?Ot(b):w,F=b?new Set(Object.keys(b)):null,q=d.persist||null;function N(i){const l=i||document.body;if(mt(l,t,e,r),b&&nt())for(const a in b){const f=b[a],p=Array.from(l.querySelectorAll("["+a+"]"));l.matches&&l.matches("["+a+"]")&&p.push(l);for(let g=0;g<p.length;g++){const y=p[g];G(y)&&_t(f,y.getAttribute(a),a,o,y)}}s&&s(l)}const I=[];if(t.indexOf("[")!==-1){const i=/\[([\w-]+)/g;let l;for(;(l=i.exec(t))!==null;)I.push(l[1])}else I.push(t);Wt({selector:t,attribute:e,componentTag:o,attributes:b,ComponentFn:r,onInit:s,observed:I.concat(u),onAttributeChange:c,onAttrChange:_,effects:k,declared:F,persist:q}),Bt();const T=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,O=d.subtreeQuery||(T?t:"["+t+"]"),v={selector:t,attribute:e,ComponentFn:r,onInit:s,onSubtreeChange:h,query:O};X().push(v),h&&O&&Z().push(v),yt(),window[e]=N,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Ct,window.lnCore.observeLifecycle=Vt);function n(){Ht()>0?Nt(function(){N(document.body)}):N(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n):n(),N}function $t(t){let e=!1;for(let r=0;r<t.length;r++){const o=t[r];if(!(o===""||o==null)&&(e=!0,!Number.isFinite(Number(o))))return"string"}return e?"number":"string"}function jt(t,e,r,o){if(r==="number"){const c=parseFloat(t),h=parseFloat(e);return(isNaN(c)?0:c)-(isNaN(h)?0:h)}const d=t!=null?String(t):"",u=e!=null?String(e):"";return o?o.compare(d,u):d<u?-1:d>u?1:0}function Gt(t,e){let r=!1;return function(){r||(r=!0,queueMicrotask(function(){r=!1,t()}))}}function Pt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,r=t.pageSize>0?t.pageSize:200,o=t.threshold!=null?t.threshold:25,d=t.fetchDebounce!=null?t.fetchDebounce:120;const u=typeof t.requestPage=="function"?t.requestPage:function(){},c=typeof t.onChange=="function"?t.onChange:function(){},h=new Map,s=new Map,_=new Set;let w=0,b=0,k=0,F={sort:null,filters:{},search:""},q=null,N=0,I=0,T=!1;function O(l){s.set(l,++N)}function v(){return!!(F&&(F.search||F.filters&&Object.keys(F.filters).length))}function n(){if(h.size<=e)return;const l=Array.from(h.keys()).sort(function(f,p){return(s.get(f)||0)-(s.get(p)||0)});let a=0;for(;h.size>e&&a<l.length;)h.delete(l[a]),s.delete(l[a]),a++}function i(l,a){_.add(l),u(F,l,a)}return{get:function(l){return h.get(l)},has:function(l){return h.has(l)},peek:function(){return h.size?h.values().next().value:void 0},get logicalTotal(){return w},get grandTotal(){return b},get queryGen(){return k},get size(){return h.size},ensure:function(l,a){clearTimeout(q),I=l;for(let m=l;m<a;m++)h.has(m)&&O(m);if(w<=0)return;const f=Math.max(0,l-o),p=Math.min(w,a+o),g=Math.floor(f/r),y=Math.floor(Math.max(0,p-1)/r);let E=-1;for(let m=g;m<=y;m++){const C=m*r,L=Math.min(r,w-C);let W=!1;const z=Math.max(C,f),M=Math.min(C+L,p);for(let R=z;R<M;R++)if(!h.has(R)){W=!0;break}if(W&&!_.has(C)){E=C;break}}E!==-1&&(q=setTimeout(function(){i(E,r)},d))},ingest:function(l){if(l=l||{},l.queryGen!=null&&l.queryGen!==k)return!1;const a=l.offset||0,f=l.data||[];let p=0;for(let g=0;g<f.length;g++)f[g]!=null&&p++;if(p===0&&(l.provisional||l.filtered>0))return _.delete(a),!1;T&&(h.clear(),s.clear(),T=!1),l.provisional||(b=l.total!=null?l.total:b,w=l.filtered!=null?l.filtered:l.data?l.data.length:w);for(let g=0;g<f.length;g++)f[g]!=null&&(h.set(a+g,f[g]),O(a+g));return _.delete(a),n(),c(),!0},requestInitial:function(l){l&&(F=l),i(0,r)},invalidate:function(l){k++,_.clear(),clearTimeout(q),l&&(F=l),T=!0,i(0,r)},revalidate:function(){k++,_.clear(),clearTimeout(q),T=!0;const l=Math.max(0,Math.floor(I/r)*r);i(l,r)},release:function(l){_.delete(l)},destroy:function(){clearTimeout(q),h.clear(),s.clear(),_.clear()},configure:function(l){l=l||{};let a=!1;if(l.windowSize!=null&&l.windowSize>0&&l.windowSize!==e){const f=l.windowSize<e;e=l.windowSize,f&&n(),a=!0}l.pageSize!=null&&l.pageSize>0&&(r=l.pageSize),l.threshold!=null&&l.threshold>=0&&(o=l.threshold),l.fetchDebounce!=null&&l.fetchDebounce>=0&&(d=l.fetchDebounce),a&&c()},setGrandTotal:function(l){l==null||isNaN(l)||l<0||(b=l,v()||(w=l),c())}}}function vt(t){return(t||"").replace(/^#/,"")}function et(t){const e=t===void 0?location.hash:t,r={},o=vt(e);if(!o)return r;const d=o.split("&");for(let u=0;u<d.length;u++){const c=d[u];if(!c)continue;const h=c.indexOf(":"),s=h>-1?c.slice(0,h):c,_=h>-1?c.slice(h+1):"";if(s)try{r[s]=decodeURIComponent(_)}catch{r[s]=_}}return r}function Kt(t){if(!t)return null;const e=et();return t in e?e[t]:null}function Qt(t,e){if(!t)return;const r=et();e==null?delete r[t]:r[t]=String(e);const d=Object.keys(r).map(function(u){const c=r[u];return c===""?u:u+":"+encodeURIComponent(c)}).join("&");vt(location.hash)!==d&&(location.hash=d)}function Yt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Jt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const r=t.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return o?e?o+"-"+e:o:e||null}function Xt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Zt(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function te(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function ee(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const r=t.slice(0,e),o=t.slice(e+1),d=o?o.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:r,values:d}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=et,window.lnCore.hashGet=Kt,window.lnCore.hashSet=Qt,window.lnCore.hashLinkClick=Yt,window.lnCore.resolveHashNamespace=Jt,window.lnCore.hashSortEncode=Xt,window.lnCore.hashSortDecode=Zt,window.lnCore.hashFilterEncode=te,window.lnCore.hashFilterDecode=ee);function ne(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=ne),(function(){const t="data-ln-list",e="lnList",r="data-ln-list-empty";if(window[e]!==void 0)return;function s(n,i){if(!n||!n.isDataDriven)return;const l=n.dom.hasAttribute("data-ln-list-window");if(l&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!l&&n._windowed)n._exitWindowedMode();else if(l&&n._windowed){const a=parseInt(i,10);a>0&&n._cache.configure({windowSize:a})}}function _(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>0&&n._cache.configure({pageSize:l})}function w(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>=0&&n._cache.configure({threshold:l})}function b(n,i){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const l=parseInt(i,10);l>=0&&n._cache.setGrandTotal(l)}const k={"data-ln-list":{prop:"name",type:"string",read:U,fallback:"",description:"List instance name or identifier"},"data-ln-list-source":{prop:"source",type:"string",read:U,fallback:"",description:"Source store or coordinator addressing"},"data-ln-list-selectable":{prop:"_selectable",type:"boolean",read:Y,description:"Enables item selection controls"},"data-ln-list-window":{type:"integer",fallback:1e3,min:10,effect:s,description:"Virtual scrolling window size in items"},"data-ln-list-window-page":{type:"integer",fallback:200,min:5,effect:_,description:"Virtual scrolling slice page size"},"data-ln-list-window-threshold":{type:"integer",fallback:50,min:0,effect:w,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-list-count":{type:"integer",min:0,effect:b,description:"Total item count override for virtual scrollbar calculation"},"data-ln-list-empty":{type:"marker",description:"Container for list empty state"},"data-ln-list-field":{type:"string",description:"Field name mapping for list item binding"}},F=gt(k);function q(n,i){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(rt(i)).format(n)}catch{return String(n)}}function N(n){let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const a=getComputedStyle(i).overflowY;if(a==="auto"||a==="scroll")return i;i=i.parentElement}return null}function I(n){const i=n._scrollContainer||N(n.dom);return{container:i,top:i?i.scrollTop:window.scrollY}}function T(n){n.container?n.container.scrollTop=n.top:window.scrollTo(window.scrollX,n.top)}function O(n){if(!n)return 0;const i=getComputedStyle(n),l=parseFloat(i.marginTop)||0,a=parseFloat(i.marginBottom)||0;return n.offsetHeight+l+a}function v(n){this.dom=n,pt(this,n,F),this.tbody=n.querySelector("[data-ln-list-body]")||n,this.isDataDriven=n.hasAttribute("data-ln-list-source"),this._totalSpan=n.querySelector("[data-ln-list-total]"),this._filteredSpan=n.querySelector("[data-ln-list-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-list-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this._data=[],this._filteredData=[],this.selectedIds=new Set,this._searchTerm="",this._filters={},this._sortField=null,this._sortDir=null,this._virtual=!1,this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._resizeHandler=null,this._scrollContainer=null,this.isUl=this.tbody.tagName==="UL"||this.tbody.tagName==="OL";const i=this;return this._onSetSearch=function(l){const a=(l.detail&&l.detail.query!=null?l.detail.query:l.detail&&l.detail.term!=null?l.detail.term:"").trim();i.isDataDriven?(i.currentSearch=a,D(n,"ln-list:search",{list:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=a.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-list:set-search",this._onSetSearch),this._onSearchChange=function(l){l.preventDefault(),i._onSetSearch(l)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",D(n,"ln-list:clear-filters",{list:i.name}),i._requestData()):(i._searchTerm="",i._filters={},i._sortField=null,i._sortDir=null,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._windowed=!1,this._cache=null,n.hasAttribute("data-ln-list-window")&&this._enterWindowedMode(),this._onSetData=function(l){const a=l.detail||{},f=a.data||[],p=a.total!=null?a.total:f.length;if(!(i._hasInitialSeed&&!i.isLoaded&&f.length===0&&p===0)){if(i._windowed){i._cache.ingest(a)&&!a.provisional&&n.classList.remove("ln-list--loading");return}i._data=f,i._lastTotal=p,i._lastFiltered=a.filtered!=null?a.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-list--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),D(n,"ln-list:rendered",{list:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-list:set-data",this._onSetData),this._onSetLoading=function(l){const a=l.detail&&l.detail.loading;n.classList.toggle("ln-list--loading",!!a),a&&(i.isLoaded=!1)},n.addEventListener("ln-list:set-loading",this._onSetLoading),this._onPageFailed=function(l){!i._windowed||!i._cache||i._cache.release(l.detail&&l.detail.offset)},n.addEventListener("ln-list:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this._onSort=function(l){!l.detail||l.detail.field==null||(l.preventDefault(),i.currentSort=l.detail.direction==="none"?null:{field:l.detail.field,direction:l.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._onItemClick=function(l){if(l.target.closest("[data-ln-item-select]")||l.target.closest("[data-ln-item-action]")||l.target.closest("a")||l.target.closest("button")||l.ctrlKey||l.metaKey||l.button===1)return;const a=l.target.closest("[data-ln-item]");if(!a)return;const f=a.getAttribute("data-ln-item-id"),p=a._lnRecord||{};D(n,"ln-list:item-click",{list:i.name,id:f,record:p})},this.tbody&&this.tbody.addEventListener("click",this._onItemClick),this._onItemAction=function(l){const a=l.target.closest("[data-ln-item-action]");if(!a)return;const f=a.closest("[data-ln-item]");if(!f)return;const p=a.getAttribute("data-ln-item-action"),g=f.getAttribute("data-ln-item-id"),y=f._lnRecord||{};D(n,"ln-list:item-action",{list:i.name,id:g,action:p,record:y})},this.tbody&&this.tbody.addEventListener("click",this._onItemAction),this.tbody&&this.tbody.children.length>0&&this._parseChildren(),this._windowed?this._kickWindowInitial():D(n,"ln-list:request-data",{list:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyObserver=null,this.tbody&&this.tbody.children.length>0?this._parseChildren():this.tbody&&(this._emptyObserver=new MutationObserver(function(){i.tbody.children.length>0&&(i._emptyObserver.disconnect(),i._emptyObserver=null,i._parseChildren())}),this._emptyObserver.observe(this.tbody,{childList:!0})),this._onFilterChange=function(l){if(l.preventDefault(),!l.detail)return;const a=l.detail.key,f=l.detail.values||[];if(a){if(f.length===0)delete i._filters[a];else{const p=[];for(let g=0;g<f.length;g++)p.push(f[g].toLowerCase());i._filters[a]=p}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange),this._onSort=function(l){if(!l.detail||l.detail.field==null)return;l.preventDefault();const a=l.detail.direction==="none"?null:l.detail.direction;i._sortField=a===null?null:l.detail.field,i._sortDir=a,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-list:sorted",{field:i._sortField,direction:l.detail&&l.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort)),this}v.prototype._parseChildren=function(){const n=Array.from(this.tbody.children).filter(i=>!i.classList.contains("ln-list__spacer"));this._data=[],n.length>0&&(this._itemHeight=O(n[0])||50);for(let i=0;i<n.length;i++){const l=n[i],a=l.getAttribute("data-ln-item-id")||l.getAttribute("id"),f=l.textContent.trim().toLowerCase();let p=null;if(this.isDataDriven){p={},a!=null&&(p.id=a);const E=l.querySelectorAll("[data-ln-list-field]");for(let m=0;m<E.length;m++){const C=E[m],L=C.getAttribute("data-ln-list-field");L&&(p[L]=it(C))}}const g={},y=l.querySelectorAll("[data-ln-list-field], [data-ln-field]");for(let E=0;E<y.length;E++){const m=y[E],C=m.getAttribute("data-ln-list-field")||m.getAttribute("data-ln-field");C&&(g[C]=it(m))}for(let E=0;E<l.attributes.length;E++){const m=l.attributes[E];if(m.name.startsWith("data-")&&!m.name.startsWith("data-ln-")){const C=m.name.slice(5);C&&(g[C]=m.value)}}this._data.push({html:l.outerHTML,id:a,searchText:f,fields:g,...p||{}})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),D(this.dom,"ln-list:ready",{total:this._data.length})},v.prototype._applyFilterAndSort=function(){if(this.isDataDriven)this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length;else{const n=this._searchTerm,i=n?n.split(/\s+/).filter(Boolean):[],l=this._filters||{},a=Object.keys(l).length>0;if(i.length===0&&!a?this._filteredData=this._data.slice():this._filteredData=this._data.filter(function(f){if(i.length>0&&!i.every(function(g){return f.searchText&&f.searchText.indexOf(g)!==-1}))return!1;if(a)for(const p in l){const g=l[p];if(g&&g.length>0){const y=f.fields&&f.fields[p]!==void 0?f.fields[p]:f[p]!==void 0?f[p]:null,E=y!=null?String(y).toLowerCase():"";if(g.indexOf(E)===-1)return!1}}return!0}),this._sortField&&this._sortDir){const f=this._sortField,p=this._sortDir==="desc"?-1:1,g=typeof Intl<"u"?new Intl.Collator(rt(this.dom),{sensitivity:"base"}):null,y=this._filteredData.map(function(m){return m.fields&&m.fields[f]!==void 0?m.fields[f]:m[f]}),E=$t(y);this._filteredData.sort(function(m,C){const L=m.fields&&m.fields[f]!==void 0?m.fields[f]:m[f],W=C.fields&&C.fields[f]!==void 0?C.fields[f]:C[f];return jt(L,W,E,g)*p})}}},v.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,i=this.visibleCount;if(n===0||this._filteredData.length===0||i===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const n=this._filteredData.length;n===0&&(this._searchTerm||Object.keys(this._filters||{}).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):n>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},v.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,i=document.createDocumentFragment();for(let a=0;a<n.length;a++){const f=this._buildItem(n[a]);f&&i.appendChild(f)}const l=I(this);this.tbody.replaceChildren(i),T(l),this._selectable&&this._updateSelectAll()}else{const n=[],i=this._filteredData;for(let a=0;a<i.length;a++)n.push(i[a].html);const l=I(this);this.tbody.innerHTML=n.join(""),T(l),this._selectable&&this._restoreSelection()}},v.prototype._readGridLayout=function(){const n=getComputedStyle(this.tbody),i=n.gridTemplateColumns;let l=1;if(i&&i!=="none"){const f=i.trim().split(/\s+/).filter(Boolean);f.length>0&&(l=f.length)}const a=parseFloat(n.rowGap);return{columns:l,rowGap:isNaN(a)?0:a}},v.prototype._measureItemHeight=function(){if(this._windowed){const n=this._cache.peek(),i=n?this._buildItem(n):this._buildPlaceholderItem();i&&(this.tbody.textContent="",this.tbody.appendChild(i),this._itemHeight=O(i)||50,this.tbody.textContent="")}else if(this.isDataDriven){if(this._data.length>0){const n=this._buildItem(this._data[0]);n&&(this.tbody.textContent="",this.tbody.appendChild(n),this._itemHeight=O(n)||50,this.tbody.textContent="")}}else{const n=this.tbody.children;n.length>0&&(this._itemHeight=O(n[0])||50)}},v.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;this._itemHeight||this._measureItemHeight(),this._scrollContainer=N(this.dom);const i=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},this._resizeRafId=null,this._resizeHandler=function(){n._resizeRafId||(n._resizeRafId=requestAnimationFrame(function(){n._resizeRafId=null,n._itemHeight=0,n._measureItemHeight(),n._vStart=-1,n._vEnd=-1,n._windowed?n._renderWindowed():n._renderVirtual()}))},i.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._resizeHandler,{passive:!0})},v.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._resizeRafId&&(cancelAnimationFrame(this._resizeRafId),this._resizeRafId=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},v.prototype._renderVirtual=function(){const n=this._filteredData,i=n.length,l=this._itemHeight;if(!l||!i)return;const a=this._scrollContainer;let f,p;if(a){const x=this.tbody.getBoundingClientRect(),A=a.getBoundingClientRect(),S=a===this.tbody?0:x.top-A.top+a.scrollTop;f=a.scrollTop-S,p=a.clientHeight}else{const A=this.tbody.getBoundingClientRect().top+window.scrollY;f=window.scrollY-A,p=window.innerHeight}const g=this._readGridLayout(),y=g.columns,E=g.rowGap,m=l+E,C=Math.ceil(i/y);let L=Math.max(0,Math.floor(f/m)-15);L=Math.min(L,C);const W=Math.ceil(p/m)+30,z=Math.min(L+W,C),M=Math.min(L*y,i),R=Math.min(z*y,i);if(M===this._vStart&&R===this._vEnd)return;this._vStart=M,this._vEnd=R;const B=L*m,H=(C-z)*m;if(this.isDataDriven){const x=document.createDocumentFragment();if(B>0){const S=document.createElement(this.isUl?"li":"div");S.className="ln-list__spacer",S.setAttribute("aria-hidden","true"),S.style.height=B+"px",x.appendChild(S)}for(let S=M;S<R;S++){const j=this._buildItem(n[S]);j&&x.appendChild(j)}if(H>0){const S=document.createElement(this.isUl?"li":"div");S.className="ln-list__spacer",S.setAttribute("aria-hidden","true"),S.style.height=H+"px",x.appendChild(S)}const A=I(this);this.tbody.replaceChildren(x),T(A),this._selectable&&this._updateSelectAll()}else{let x="";B>0&&(x+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${B}px"></${this.isUl?"li":"div"}>`);for(let S=M;S<R;S++)x+=n[S].html;H>0&&(x+=`<${this.isUl?"li":"div"} class="ln-list__spacer" aria-hidden="true" style="height:${H}px"></${this.isUl?"li":"div"}>`);const A=I(this);this.tbody.innerHTML=x,T(A),this._selectable&&this._restoreSelection()}},v.prototype._buildPlaceholderItem=function(){const n=document.createElement(this.isUl?"li":"div");return n.className="ln-list__placeholder",n.setAttribute("aria-hidden","true"),n.style.height=this._itemHeight+"px",n},v.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._itemHeight;if(!n)return;const i=this._scrollContainer;let l,a;if(i){const A=this.tbody.getBoundingClientRect(),S=i.getBoundingClientRect(),j=i===this.tbody?0:A.top-S.top+i.scrollTop;l=i.scrollTop-j,a=i.clientHeight}else{const S=this.tbody.getBoundingClientRect().top+window.scrollY;l=window.scrollY-S,a=window.innerHeight}const f=this._readGridLayout(),p=f.columns,g=f.rowGap,y=n+g,E=this._cache.logicalTotal,m=Math.ceil(E/p);let C=Math.max(0,Math.floor(l/y)-15);C=Math.min(C,m);const L=Math.ceil(a/y)+30,W=Math.min(C+L,m),z=Math.min(C*p,E),M=Math.min(W*p,E),R=C*y,B=(m-W)*y,H=document.createDocumentFragment();if(R>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=R+"px",H.appendChild(A)}for(let A=z;A<M;A++)if(this._cache.has(A)){const S=this._buildItem(this._cache.get(A));S&&H.appendChild(S)}else H.appendChild(this._buildPlaceholderItem());if(B>0){const A=document.createElement(this.isUl?"li":"div");A.className="ln-list__spacer",A.setAttribute("aria-hidden","true"),A.style.height=B+"px",H.appendChild(A)}const x=I(this);this.tbody.replaceChildren(H),T(x),this._vStart=z,this._vEnd=M,this._cache.ensure(z,M)},v.prototype._showEmptyState=function(){let n=null;if(this.isDataDriven){const i=this._lastTotal!=null?this._lastTotal:this._data.length,a=this.visibleCount===0&&i>0,f=a?this.name+"-empty-filtered":this.name+"-empty";if(n=at(this.dom,f,"ln-list"),!n){const p=this.dom.querySelector("template[data-ln-empty], template[data-ln-list-empty]");if(p){const g=a?"search":"initial",y=p.content.querySelector(`[data-ln-empty-when="${g}"]`)||p.content.firstElementChild;y&&(n=document.importNode(y,!0))}}}else{const i=this.dom.querySelector(`template[${r}]`);if(i){const l=i.content.firstElementChild;l&&(n=document.importNode(l,!0))}}if(n)if(n.tagName==="LI"||n.tagName==="TR")this.tbody.replaceChildren(n);else{const i=document.createElement(this.isUl?"li":"div");i.appendChild(n),this.tbody.replaceChildren(i)}else this.tbody.replaceChildren();D(this.dom,"ln-list:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},v.prototype._buildItem=function(n){let i=at(this.dom,this.name+"-row","ln-list");if(!i){const a=this.dom.querySelector("template[data-ln-item]");a&&(i=document.importNode(a.content,!0))}let l=i?i.querySelector("[data-ln-item]")||i.firstElementChild:null;if(l)Q(l,n),K(l,n);else if(n&&n.html){const a=document.createElement(this.isUl?"ul":"div");a.innerHTML=n.html,l=a.firstElementChild}else if(l=document.createElement(this.isUl?"li":"div"),l.setAttribute("data-ln-item",""),n&&typeof n=="object"){for(const a in n)if(a!=="html"&&n[a]!=null){const f=document.createElement("span");f.setAttribute("data-ln-field",a),f.textContent=String(n[a]),l.appendChild(f)}}if(l._lnRecord=n,n&&n.id!=null&&(l.setAttribute("data-ln-item-id",n.id),this._selectable&&this.selectedIds.has(String(n.id)))){l.classList.add("ln-item-selected");const a=l.querySelector("[data-ln-item-select]");a&&(a.checked=!0)}return l},v.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-item]");for(let i=0;i<n.length;i++){const l=n[i].getAttribute("data-ln-item-id"),a=l!=null&&this.selectedIds.has(String(l));n[i].classList.toggle("ln-item-selected",a);const f=n[i].querySelector("[data-ln-item-select]");f&&(f.checked=a)}this._updateSelectAll()},v.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;this._onSelectionChange=function(i){const l=i.target.closest("[data-ln-item-select]");if(!l)return;const a=l.closest("[data-ln-item]");if(!a)return;const f=a.getAttribute("data-ln-item-id");f!=null&&(l.checked?(n.selectedIds.add(String(f)),a.classList.add("ln-item-selected")):(n.selectedIds.delete(String(f)),a.classList.remove("ln-item-selected")),n._updateSelectAll(),n._updateFooter(),D(n.dom,"ln-list:select",{list:n.name,selectedIds:n.selectedIds,count:n.selectedIds.size}))},this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector("[data-ln-list-select-all]"),this._selectAllCheckbox&&(this._onSelectAll=function(){const i=n._selectAllCheckbox.checked,l=n.tbody.querySelectorAll("[data-ln-item]");for(let a=0;a<l.length;a++){const f=l[a],p=f.getAttribute("data-ln-item-id"),g=f.querySelector("[data-ln-item-select]");p!=null&&(i?(n.selectedIds.add(String(p)),f.classList.add("ln-item-selected")):(n.selectedIds.delete(String(p)),f.classList.remove("ln-item-selected")),g&&(g.checked=i))}D(n.dom,"ln-list:select-all",{list:n.name,selected:i}),D(n.dom,"ln-list:select",{list:n.name,selectedIds:n.selectedIds,count:n.selectedIds.size}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll))},v.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox)return;const n=this.tbody.querySelectorAll("[data-ln-item]");let i=n.length>0;for(let l=0;l<n.length;l++){const a=n[l].getAttribute("data-ln-item-id");if(a!=null&&!this.selectedIds.has(String(a))){i=!1;break}}this._selectAllCheckbox.checked=i},v.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-list--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}St(this,"ln-list:request-data","list")},v.prototype._enterWindowedMode=function(){const n=this,i=this.dom,l=parseInt(i.getAttribute("data-ln-list-window"),10),a=parseInt(i.getAttribute("data-ln-list-window-page"),10),f=parseInt(i.getAttribute("data-ln-list-window-threshold"),10);this._onCacheChange=function(){!n._windowed||!n._cache||(n.totalCount=n._cache.grandTotal,n.visibleCount=n._cache.logicalTotal,n._lastTotal=n._cache.grandTotal,n.isLoaded=!0,n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(i,"ln-list:rendered",{list:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=Gt(this._onCacheChange),this._cache=Pt({windowSize:l>0?l:1e3,pageSize:a>0?a:200,threshold:f>=0?f:25,fetchDebounce:120,requestPage:function(p,g,y){D(i,"ln-list:request-data",{list:n.name,sort:p.sort,filters:p.filters,search:p.search,offset:g,limit:y,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},v.prototype._kickWindowInitial=function(){if(this._data.length>0){const n=parseInt(this.dom.getAttribute("data-ln-list-count"),10),i=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:i,filtered:i})}else this.dom.classList.add("ln-list--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},v.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._itemHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-list--loading"),this._requestData()},v.prototype._updateFooter=function(){let n=0,i=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,i=this.visibleCount):(n=this._data.length,i=this._filteredData.length);const l=i<n;if(this._totalSpan&&(this._totalSpan.textContent=q(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=l?q(i,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!l),this._selectedSpan){const a=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=a>0?q(a,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",a===0)}},v.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-list:set-search",this._onSetSearch),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-list:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this._cache&&this._cache.destroy(),this.dom.removeEventListener("ln-list:set-data",this._onSetData),this.dom.removeEventListener("ln-list:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-list:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-list:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-list:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onItemClick),this.tbody.removeEventListener("click",this._onItemAction))):(this._emptyObserver&&(this._emptyObserver.disconnect(),this._emptyObserver=null),this._onFilterChange&&this.dom.removeEventListener("ln-filter:change",this._onFilterChange),this._onSort&&this.dom.removeEventListener("ln-sort:change",this._onSort)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._data=[],this._filteredData=[],delete this.dom[e])},Ct(t,e,v,"ln-list",{attributes:k})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function W(){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 T(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!T(r))return}e.apply(console,t)}}function D(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function L(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){L(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ue(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ce(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},a=e.elements,s={};if(n)for(let u=0;u<a.length;u++){const i=a[u];i.name&&i.type==="checkbox"&&!i.disabled&&(s[i.name]=(s[i.name]||0)+1)}for(let u=0;u<a.length;u++){const i=a[u];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&s[i.name]===1?o[i.name]=i.checked:(o[i.name]||(o[i.name]=[]),i.checked&&o[i.name].push(i.value));else if(i.type==="radio")i.checked&&(o[i.name]=i.value);else if(i.type==="select-multiple"){o[i.name]=[];for(let l=0;l<i.options.length;l++)i.options[l].selected&&o[i.name].push(i.options[l].value)}else if(n&&i.type==="hidden")o[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const l=Number(i.value);o[i.name]=i.value===""||isNaN(l)?null:l}else o[i.name]=i.value}return o}function de(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function fe(e,t){const n=e.elements,r=[],o={};for(let a=0;a<n.length;a++){const s=n[a];s.name&&s.type==="checkbox"&&(o[s.name]=(o[s.name]||0)+1)}for(let a=0;a<n.length;a++){const s=n[a];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const u=s.getAttribute("data-ln-fill-as")||s.name;if(!u||!(u in t))continue;const i=t[u];if(s.type==="checkbox"){if(Array.isArray(i))s.checked=i.indexOf(s.value)!==-1;else if(o[s.name]>1){const l=String(i).split(",").map(function(c){return c.trim()});s.checked=l.indexOf(s.value)!==-1}else s.checked=de(i);r.push(s)}else if(s.type==="radio")s.checked=s.value===String(i),r.push(s);else if(s.type==="select-multiple"){if(Array.isArray(i))for(let l=0;l<s.options.length;l++)s.options[l].selected=i.indexOf(s.options[l].value)!==-1;r.push(s)}else s.value=i,s.tagName==="SELECT"&&i!=null&&s.setAttribute("data-ln-value",i),r.push(s)}return r}function he(e,t,{get:n,set:r}){Object.defineProperty(e,"value",{get:function(){return n?n.call(this):t.get.call(this)},set:function(o){r?r.call(this,o,a=>t.set.call(this,a)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=fe,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=ue);const P={};function we(e,t){P[e]=t}function pe(e){return P[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=we,window.lnCore.getDataMapper=pe);function _(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,L(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const K={};function me(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];K[n]=t}function be(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return K[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=me,window.lnCore.getLocaleFallback=be,window.lnCore.ensureLocaleObserver=U);const I={};function ge(e,t){I[e]||(I[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=I[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function Q(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const u=n[s],i=u.getAttribute("data-ln-field");t[i]!=null&&(u.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const u=r[s],i=u.getAttribute("data-ln-attr").split(",");for(let l=0;l<i.length;l++){const c=i[l].trim().split(":");if(c.length!==2)continue;const f=c[0].trim(),d=c[1].trim();t[d]!=null&&u.setAttribute(f,t[d])}}const o=e.querySelectorAll("[data-ln-show]");for(let s=0;s<o.length;s++){const u=o[s],i=u.getAttribute("data-ln-show");i in t&&u.classList.toggle("hidden",!t[i])}const a=e.querySelectorAll("[data-ln-class]");for(let s=0;s<a.length;s++){const u=a[s],i=u.getAttribute("data-ln-class").split(",");for(let l=0;l<i.length;l++){const c=i[l].trim().split(":");if(c.length!==2)continue;const f=c[0].trim(),d=c[1].trim();d in t&&u.classList.toggle(f,!!t[d])}}return e}function ye(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)Q(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function G(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,u){return t[u]!==void 0?t[u]:""}))}const r=function(a,s){return t[s]!==void 0?t[s]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let a=0;a<o.length;a++){const s=o[a],u=s.attributes;for(let i=0;i<u.length;i++){const l=u[i];l.value.indexOf("{{")!==-1&&s.setAttribute(l.name,l.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Ce(e,t,n,r,o,a){const s={};for(let i=0;i<e.children.length;i++){const l=e.children[i],c=l.getAttribute("data-ln-render-key");c&&(s[c]=l)}const u=document.createDocumentFragment();for(let i=0;i<t.length;i++){const l=t[i],c=String(r(l));let f=s[c];if(f)o(f,l,i);else{const d=ge(n,a);if(!d||(G(d,l),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",c),o(f,l,i)}u.appendChild(f)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=G,window.lnCore.fill=Q,window.lnCore.lnFill=ye,window.lnCore.renderList=Ce);function $(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function J(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function z(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function X(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const q=new Map;function Y(e,t){const n=(e?e.join("|"):"")+"::"+t;if(q.has(n))return q.get(n);const r=new Set(e||[]),o=function(a,s){const u=a.getAttribute(s);return u!==null&&r.has(u)?u:t};return q.set(n,o),o}function Z(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ee(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function te(e,t,n,r,o){if(!e||t===null)return!0;const a=r||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const u=i=>{o?console.warn(i,o):console.warn(i)};if(s==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(u(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const i=e.values||[];return i.includes(t)?!0:(u(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return u(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(u(`[${a}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(u(`[${a}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(u(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(i){return u(`[${a}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function _e(e,t,n){for(const r in n){const[o,a,s]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,a,s)},enumerable:!0,configurable:!0})}return e}function ve(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=Y(r.values,r.fallback);break;case"integer":o=J;break;case"float":o=Z;break;case"boolean":o=z;break;case"list":o=X;break;case"json":o=ee;break;case"string":default:o=$;break}o||(o=$),t[r.prop]=[o,n,r.fallback]}return t}function xe(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function Ae(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=_e,window.lnCore.attrSpec=ve,window.lnCore.attrStr=$,window.lnCore.attrInt=J,window.lnCore.attrBool=z,window.lnCore.attrList=X,window.lnCore.attrEnum=Y,window.lnCore.attrFloat=Z,window.lnCore.attrJson=ee);function F(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 ne(e,t,n,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(a)&&F(e,s),e.querySelectorAll){const u=e.querySelectorAll(a);for(let i=0;i<u.length;i++)F(u[i],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ee(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function De(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ie(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ne(e){const t=ie(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(a=>a.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Ae(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function re(e,t,n,r){for(let o=0;o<e.length;o++){const a=e[o];if(!t[a.attribute])continue;const s=a.effects&&a.effects[n];s?s(t,n,r):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,r)}}function Se(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=ie(),o=r.byAttr.get(t),a=W()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!o&&!a)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(a&&T(s)){const u=r.byDeclaredAttr.get(t),i=s.getAttribute(t);for(let l=0;l<u.length;l++)te(u[l].spec,i,t,u[l].componentTag,s)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),n){const u=r.byReactive.get(t);u&&re(u,s,t,e.oldValue),r.reactiveWildcard.length&&re(r.reactiveWildcard,s,t,e.oldValue)}if(o)for(let u=0;u<o.length;u++){const i=o[u];if(i.handler){i.handler(s,t,e.oldValue);continue}i.onAttributeChange&&s[i.attribute]?i.onAttributeChange(s,t):(ne(s,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(s))}}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,L(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Se(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function M(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Re(e){const t=H();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=j();if(e.target&&r.length)for(let o=0;o<r.length;o++){const a=r[o],s=a.query,u=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;u&&a.onSubtreeChange(u,e)}for(let o=0;o<e.addedNodes.length;o++){const a=e.addedNodes[o];if(a.nodeType===1){const s=!!(a.firstElementChild||a.children&&a.children.length);for(let u=0;u<t.length;u++){const i=t[u];if(i.selector&&i.attribute&&i.ComponentFn){if(!s)a.matches&&a.matches(i.query)&&F(a,i);else if(a.matches&&a.matches(i.query)&&F(a,i),a.querySelectorAll){const l=a.querySelectorAll(i.query);for(let c=0;c<l.length;c++)F(l[c],i)}}i.onInit&&i.onInit(a)}}}for(let o=0;o<e.removedNodes.length;o++){const a=e.removedNodes[o];if(a.nodeType===1){const s=!!(a.firstElementChild||a.children&&a.children.length);for(let u=0;u<t.length;u++){const i=t[u],l=i.query;if(l){if(!s)a.matches&&a.matches(l)&&M(a,i);else if(a.matches&&a.matches(l)&&M(a,i),a.querySelectorAll){const c=a.querySelectorAll(l);for(let f=0;f<c.length;f++)M(c[f],i)}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,L(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Re(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Fe(e){H().push(e),e.onSubtreeChange&&e.query&&j().push(e),oe()}function le(e,t,n,r,o={}){const a=o.extraAttributes||[],s=o.onAttributeChange||null,u=o.onSubtreeChange||null,i=o.onInit||null,l=o.onAttrChange||null,c=o.effects||null,f=o.attributes||null,d=f?xe(f):c,h=f?new Set(Object.keys(f)):null,p=o.persist||null;function m(N){const y=N||document.body;if(ne(y,e,t,n),f&&W())for(const S in f){const g=f[S],x=Array.from(y.querySelectorAll("["+S+"]"));y.matches&&y.matches("["+S+"]")&&x.push(y);for(let R=0;R<x.length;R++){const B=x[R];T(B)&&te(g,B.getAttribute(S),S,r,B)}}i&&i(y)}const w=[];if(e.indexOf("[")!==-1){const N=/\[([\w-]+)/g;let y;for(;(y=N.exec(e))!==null;)w.push(y[1])}else w.push(e);Ne({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:i,observed:w.concat(a),onAttributeChange:s,onAttrChange:l,effects:d,declared:h,persist:p}),ke();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=o.subtreeQuery||(b?e:"["+e+"]"),E={selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:u,query:C};H().push(E),u&&C&&j().push(E),oe(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le,window.lnCore.observeLifecycle=Fe);function k(){Ee()>0?De(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k(),m}function se(e){return(e||"").replace(/^#/,"")}function V(e){const t=e===void 0?location.hash:e,n={},r=se(t);if(!r)return n;const o=r.split("&");for(let a=0;a<o.length;a++){const s=o[a];if(!s)continue;const u=s.indexOf(":"),i=u>-1?s.slice(0,u):s,l=u>-1?s.slice(u+1):"";if(i)try{n[i]=decodeURIComponent(l)}catch{n[i]=l}}return n}function Le(e){if(!e)return null;const t=V();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const n=V();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(a){const s=n[a];return s===""?a:a+":"+encodeURIComponent(s)}).join("&");se(location.hash)!==o&&(location.hash=o)}function Te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ie(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function $e(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 He(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function je(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=V,window.lnCore.hashGet=Le,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=Ie,window.lnCore.hashSortEncode=$e,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=He,window.lnCore.hashFilterDecode=je);function Me(){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=Me);const A={};function O(e){const t=e||"default";if(!A[t]){const n=new Intl.NumberFormat(e,{useGrouping:!0}),r=n.formatToParts(1234.5);let o="",a=".";for(let s=0;s<r.length;s++)r[s].type==="group"&&(o=r[s].value),r[s].type==="decimal"&&(a=r[s].value);A[t]={groupSep:o,decimalSep:a,fmt:n}}return A[t]}function ae(e,t,n){if(e==null||typeof e!="string")return"";let r=e.trim();return r===""?"":(r=r.replace(/[$€£¥]/g,""),t&&(r=r.split(t).join("")),r=r.replace(/\s/g,""),n&&n!=="."&&(r=r.replace(n,".")),r=r.replace(/[^\d.-]/g,""),r)}function Ve(e,t){if(typeof e=="number")return isNaN(e)?NaN:e;if(e==null||typeof e!="string")return NaN;const n=e.trim();if(n===""||n==="-")return NaN;const r=O(t),o=ae(n,r.groupSep,r.decimalSep);if(o===""||o==="-")return NaN;const a=parseFloat(o);return isNaN(a)?NaN:a}function v(e,t,n={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",o=n.maxDecimals!=null?parseInt(n.maxDecimals,10):null,a=n.userDecimals!=null?n.userDecimals:null;if(o!==null){const s=r+"|max:"+o;return A[s]||(A[s]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:o})),A[s].format(e)}if(a!==null&&a>0){const s=r+"|exact:"+a;return A[s]||(A[s]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:a,maximumFractionDigits:a})),A[s].format(e)}return O(t).fmt.format(e)}function Be(e,t){if(!e)return 0;if(t<=0)return e.startsWith("-")?1:0;let n=t,r=0;for(let o=0;o<e.length&&n>0;o++)r=o+1,/[0-9]/.test(e[o])&&n--;return n>0&&(r=e.length),r}(function(){const e="data-ln-number",t="lnNumber";if(window[t]!==void 0)return;function n(l){const c=l[t];c&&(c.isTextElement?c._initTextElement():isNaN(c.value)||c._displayFormatted(c.value))}const r={"data-ln-number":{type:"marker",effect:n,description:"Activates localized number formatting on input or text element"},"data-ln-value":{type:"float",effect:n,description:"Raw unformatted numeric value"},"data-ln-number-decimals":{type:"integer",fallback:0,min:0,max:20,effect:n,description:"Number of decimal fraction digits"},"data-ln-number-min":{type:"float",effect:n,description:"Minimum allowed numeric value"},"data-ln-number-max":{type:"float",effect:n,description:"Maximum allowed numeric value"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),a=new Set;let s=!1;function u(){U(),!s&&(s=!0,document.addEventListener("ln-core:locale-change",function(){a.forEach(function(l){l.isTextElement?l._formatTextContent():isNaN(l.value)||l._displayFormatted(l.value)})}))}function i(l){if(l[t])return l[t];if(l[t]=this,this.dom=l,a.add(this),u(),l.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;const c=document.createElement("input");c.type="hidden",c.name=l.name,l.removeAttribute("name"),l.hasAttribute("data-ln-fill-as")&&c.setAttribute("data-ln-fill-as",l.getAttribute("data-ln-fill-as")),l.type="text",l.setAttribute("inputmode","decimal"),l.insertAdjacentElement("afterend",c),this._hidden=c,Object.defineProperty(c,"value",{get:function(){return o.get.call(c)},set:function(d){if(o.set.call(c,d),d!==""&&!isNaN(parseFloat(d))){const h=self.dom.getAttribute("data-ln-number-decimals");self._setDisplayRaw(v(parseFloat(d),_(self.dom),{maxDecimals:h}))}else self._setDisplayRaw("");self.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),he(l,o,{get:function(){return o.get.call(l)},set:function(d){if(d===""){self._setDisplayRaw(""),self._setHiddenRaw(""),l.dispatchEvent(new Event("input",{bubbles:!0}));return}const h=typeof d=="number"?d:parseFloat(String(d));if(isNaN(h))self._setDisplayRaw(String(d)),self._setHiddenRaw("");else{self._setHiddenRaw(h);const p=l.getAttribute("data-ln-number-decimals");self._setDisplayRaw(v(h,_(l),{maxDecimals:p}))}l.dispatchEvent(new Event("input",{bubbles:!0}))}}),this._onInput=function(){self._handleInput()},l.addEventListener("input",this._onInput),this._onKeyDown=function(d){if(d.key!=="Backspace")return;const h=l.selectionStart,p=l.selectionEnd;if(h!==p||h===0)return;const m=O(_(l)),w=o.get.call(l),b=w[h-1];if(b===m.groupSep||/\s/.test(b)){d.preventDefault();const C=h-2>=0?h-2:0,E=w.slice(0,C)+w.slice(h);o.set.call(l,E),l.setSelectionRange(C,C),l.dispatchEvent(new Event("input",{bubbles:!0}))}},l.addEventListener("keydown",this._onKeyDown),this._onPaste=function(d){d.preventDefault();const h=(d.clipboardData||window.clipboardData).getData("text"),p=Ve(h,_(l));self.value=isNaN(p)?NaN:p},l.addEventListener("paste",this._onPaste);const f=l.value;if(f!==""){const d=parseFloat(f);if(!isNaN(d)){const h=l.getAttribute("data-ln-number-decimals");this._setHiddenRaw(d),this._setDisplayRaw(v(d,_(l),{maxDecimals:h})),l.dispatchEvent(new Event("input",{bubbles:!0}))}}return l.form&&(this._onFormReset=function(){setTimeout(function(){const d=l.defaultValue;if(d!==""){const h=parseFloat(d);if(!isNaN(h)){const p=l.getAttribute("data-ln-number-decimals");self._setHiddenRaw(h),self._setDisplayRaw(v(h,_(l),{maxDecimals:p})),l.dispatchEvent(new Event("input",{bubbles:!0}));return}}self._setHiddenRaw(""),self._setDisplayRaw(""),l.dispatchEvent(new Event("input",{bubbles:!0}))},0)},l.form.addEventListener("reset",this._onFormReset)),this}i.prototype._initTextElement=function(){const l=this.dom;let c=l.getAttribute("data-ln-value"),f=l.getAttribute("data-ln-number"),d=null;c!==null&&c!==""?d=c:f!==null&&f!==""&&f!=="true"?d=f:d=l.textContent.trim();const h=parseFloat(d);isNaN(h)?this._rawValue=null:(this._rawValue=h,l.hasAttribute("data-ln-value")||l.setAttribute("data-ln-value",String(h)),this._formatTextContent())},i.prototype._formatTextContent=function(){if(this._rawValue!==null&&!isNaN(this._rawValue)){const l=this.dom.getAttribute("data-ln-number-decimals");this.dom.textContent=v(this._rawValue,_(this.dom),{maxDecimals:l})}},i.prototype._handleInput=function(){const l=this.dom,c=o.get.call(l);if(c===""){this._setHiddenRaw(""),D(l,"ln-number:input",{value:NaN,formatted:""});return}if(c==="-"){this._setHiddenRaw(""),D(l,"ln-number:input",{value:NaN,formatted:"-"});return}const f=l.selectionStart;let d=0;for(let g=0;g<f;g++)/[0-9]/.test(c[g])&&d++;const h=_(l),p=O(h);let m=c,w=ae(c,p.groupSep,p.decimalSep),b=parseFloat(w);if(isNaN(b)){this._setHiddenRaw(""),D(l,"ln-number:input",{value:NaN,formatted:c});return}const C=l.getAttribute("data-ln-number-decimals"),E=w.indexOf(".");if(C!==null&&E!==-1){const g=parseInt(C,10),x=w.slice(E+1);if(g===0)w=w.slice(0,E),m=m.split(p.decimalSep)[0],b=parseFloat(w),this._setDisplayRaw(m);else if(x.length>g){w=w.slice(0,E+1+g);const R=m.split(p.decimalSep);m=R[0]+p.decimalSep+R[1].slice(0,g),b=parseFloat(w),this._setDisplayRaw(m)}}const k=l.getAttribute("data-ln-number-max");if(k!==null&&b>parseFloat(k)){const g=parseFloat(k),x=v(g,h,{maxDecimals:C});this._setDisplayRaw(x),this._setHiddenRaw(g),l.setSelectionRange(x.length,x.length),D(l,"ln-number:input",{value:g,formatted:x});return}if(m.endsWith(p.decimalSep)||p.decimalSep!=="."&&m.endsWith(".")){this._setHiddenRaw(b),D(l,"ln-number:input",{value:b,formatted:m});return}const N=w.indexOf(".");if(N!==-1&&w.slice(N+1).endsWith("0")){this._setHiddenRaw(b),D(l,"ln-number:input",{value:b,formatted:m});return}let y;if(C!==null)y=v(b,h,{maxDecimals:C});else{const g=N!==-1?w.slice(N+1).length:0;y=v(b,h,{userDecimals:g})}this._setDisplayRaw(y);const S=Be(y,d);l.setSelectionRange(S,S),this._setHiddenRaw(b),D(l,"ln-number:input",{value:b,formatted:y})},i.prototype._setHiddenRaw=function(l){this._hidden&&o.set.call(this._hidden,String(l))},i.prototype._setDisplayRaw=function(l){this.isTextElement?this.dom.textContent=String(l):o.set.call(this.dom,String(l))},i.prototype._displayFormatted=function(l){if(this.isTextElement)this._formatTextContent();else{const c=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(v(l,_(this.dom),{maxDecimals:c}))}},Object.defineProperty(i.prototype,"value",{get:function(){if(this.isTextElement)return this._rawValue;const l=o.get.call(this._hidden);return l===""?NaN:parseFloat(l)},set:function(l){const c=typeof l=="number"?l:parseFloat(l);if(this.isTextElement){isNaN(c)?(this._rawValue=null,this.dom.textContent=""):(this._rawValue=c,this.dom.setAttribute("data-ln-value",String(c)),this._formatTextContent());return}if(isNaN(c)){this._setDisplayRaw(""),this._setHiddenRaw(""),this.dom.dispatchEvent(new Event("input",{bubbles:!0}));return}this._setHiddenRaw(c);const f=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(v(c,_(this.dom),{maxDecimals:f})),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(i.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:o.get.call(this.dom)}}),i.prototype.destroy=function(){this.dom[t]&&(a.delete(this),this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement||(this._onFormReset&&this.dom.form&&this.dom.form.removeEventListener("reset",this._onFormReset),this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("keydown",this._onKeyDown),this.dom.removeEventListener("paste",this._onPaste),this._hidden&&(this.dom.name=this._hidden.name,this._hidden.remove()),this.dom.type="number",this.dom.removeAttribute("inputmode")),delete this.dom[t])},le(e,t,i,"ln-number",{attributes:r,extraAttributes:["lang"],onAttributeChange:n})})()})();
1
+ (function(){"use strict";function W(){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 T(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!T(r))return}e.apply(console,t)}}function D(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function L(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){L(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ue(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ce(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},a=e.elements,s={};if(n)for(let u=0;u<a.length;u++){const i=a[u];i.name&&i.type==="checkbox"&&!i.disabled&&(s[i.name]=(s[i.name]||0)+1)}for(let u=0;u<a.length;u++){const i=a[u];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&s[i.name]===1?o[i.name]=i.checked:(o[i.name]||(o[i.name]=[]),i.checked&&o[i.name].push(i.value));else if(i.type==="radio")i.checked&&(o[i.name]=i.value);else if(i.type==="select-multiple"){o[i.name]=[];for(let l=0;l<i.options.length;l++)i.options[l].selected&&o[i.name].push(i.options[l].value)}else if(n&&i.type==="hidden")o[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const l=Number(i.value);o[i.name]=i.value===""||isNaN(l)?null:l}else o[i.name]=i.value}return o}function de(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function fe(e,t){const n=e.elements,r=[],o={};for(let a=0;a<n.length;a++){const s=n[a];s.name&&s.type==="checkbox"&&(o[s.name]=(o[s.name]||0)+1)}for(let a=0;a<n.length;a++){const s=n[a];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const u=s.getAttribute("data-ln-fill-as")||s.name;if(!u||!(u in t))continue;const i=t[u];if(s.type==="checkbox"){if(Array.isArray(i))s.checked=i.indexOf(s.value)!==-1;else if(o[s.name]>1){const l=String(i).split(",").map(function(c){return c.trim()});s.checked=l.indexOf(s.value)!==-1}else s.checked=de(i);r.push(s)}else if(s.type==="radio")s.checked=s.value===String(i),r.push(s);else if(s.type==="select-multiple"){if(Array.isArray(i))for(let l=0;l<s.options.length;l++)s.options[l].selected=i.indexOf(s.options[l].value)!==-1;r.push(s)}else s.value=i,s.tagName==="SELECT"&&i!=null&&s.setAttribute("data-ln-value",i),r.push(s)}return r}function he(e,t,{get:n,set:r}){Object.defineProperty(e,"value",{get:function(){return n?n.call(this):t.get.call(this)},set:function(o){r?r.call(this,o,a=>t.set.call(this,a)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=fe,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=ue);const P={};function we(e,t){P[e]=t}function pe(e){return P[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=we,window.lnCore.getDataMapper=pe);function v(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,L(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const K={};function me(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];K[n]=t}function be(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return K[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=me,window.lnCore.getLocaleFallback=be,window.lnCore.ensureLocaleObserver=U);const I={};function ge(e,t){I[e]||(I[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=I[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function Q(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const u=n[s],i=u.getAttribute("data-ln-field");t[i]!=null&&(u.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const u=r[s],i=u.getAttribute("data-ln-attr").split(",");for(let l=0;l<i.length;l++){const c=i[l].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),p=c[1].trim();t[p]!=null&&u.setAttribute(d,t[p])}}const o=e.querySelectorAll("[data-ln-show]");for(let s=0;s<o.length;s++){const u=o[s],i=u.getAttribute("data-ln-show");i in t&&u.classList.toggle("hidden",!t[i])}const a=e.querySelectorAll("[data-ln-class]");for(let s=0;s<a.length;s++){const u=a[s],i=u.getAttribute("data-ln-class").split(",");for(let l=0;l<i.length;l++){const c=i[l].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),p=c[1].trim();p in t&&u.classList.toggle(d,!!t[p])}}return e}function ye(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)Q(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function G(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,u){return t[u]!==void 0?t[u]:""}))}const r=function(a,s){return t[s]!==void 0?t[s]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let a=0;a<o.length;a++){const s=o[a],u=s.attributes;for(let i=0;i<u.length;i++){const l=u[i];l.value.indexOf("{{")!==-1&&s.setAttribute(l.name,l.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Ce(e,t,n,r,o,a){const s={};for(let i=0;i<e.children.length;i++){const l=e.children[i],c=l.getAttribute("data-ln-render-key");c&&(s[c]=l)}const u=document.createDocumentFragment();for(let i=0;i<t.length;i++){const l=t[i],c=String(r(l));let d=s[c];if(d)o(d,l,i);else{const p=ge(n,a);if(!p||(G(p,l),d=p.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",c),o(d,l,i)}u.appendChild(d)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=G,window.lnCore.fill=Q,window.lnCore.lnFill=ye,window.lnCore.renderList=Ce);function $(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function J(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function z(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function X(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const q=new Map;function Y(e,t){const n=(e?e.join("|"):"")+"::"+t;if(q.has(n))return q.get(n);const r=new Set(e||[]),o=function(a,s){const u=a.getAttribute(s);return u!==null&&r.has(u)?u:t};return q.set(n,o),o}function Z(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ee(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function te(e,t,n,r,o){if(!e||t===null)return!0;const a=r||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const u=i=>{o?console.warn(i,o):console.warn(i)};if(s==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(u(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const i=e.values||[];return i.includes(t)?!0:(u(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return u(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(u(`[${a}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(u(`[${a}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(u(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(i){return u(`[${a}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function _e(e,t,n){for(const r in n){const[o,a,s]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,a,s)},enumerable:!0,configurable:!0})}return e}function ve(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=Y(r.values,r.fallback);break;case"integer":o=J;break;case"float":o=Z;break;case"boolean":o=z;break;case"list":o=X;break;case"json":o=ee;break;case"string":default:o=$;break}o||(o=$),t[r.prop]=[o,n,r.fallback]}return t}function xe(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function Ae(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=_e,window.lnCore.attrSpec=ve,window.lnCore.attrStr=$,window.lnCore.attrInt=J,window.lnCore.attrBool=z,window.lnCore.attrList=X,window.lnCore.attrEnum=Y,window.lnCore.attrFloat=Z,window.lnCore.attrJson=ee);function F(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 ne(e,t,n,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(a)&&F(e,s),e.querySelectorAll){const u=e.querySelectorAll(a);for(let i=0;i<u.length;i++)F(u[i],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ee(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function De(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ie(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ne(e){const t=ie(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(a=>a.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Ae(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function re(e,t,n,r){for(let o=0;o<e.length;o++){const a=e[o];if(!t[a.attribute])continue;const s=a.effects&&a.effects[n];s?s(t,n,r):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,r)}}function Se(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=ie(),o=r.byAttr.get(t),a=W()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!o&&!a)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(a&&T(s)){const u=r.byDeclaredAttr.get(t),i=s.getAttribute(t);for(let l=0;l<u.length;l++)te(u[l].spec,i,t,u[l].componentTag,s)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),n){const u=r.byReactive.get(t);u&&re(u,s,t,e.oldValue),r.reactiveWildcard.length&&re(r.reactiveWildcard,s,t,e.oldValue)}if(o)for(let u=0;u<o.length;u++){const i=o[u];if(i.handler){i.handler(s,t,e.oldValue);continue}i.onAttributeChange&&s[i.attribute]?i.onAttributeChange(s,t):(ne(s,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(s))}}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,L(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Se(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function M(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Re(e){const t=H();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=j();if(e.target&&r.length)for(let o=0;o<r.length;o++){const a=r[o],s=a.query,u=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;u&&a.onSubtreeChange(u,e)}for(let o=0;o<e.addedNodes.length;o++){const a=e.addedNodes[o];if(a.nodeType===1){const s=!!(a.firstElementChild||a.children&&a.children.length);for(let u=0;u<t.length;u++){const i=t[u];if(i.selector&&i.attribute&&i.ComponentFn){if(!s)a.matches&&a.matches(i.query)&&F(a,i);else if(a.matches&&a.matches(i.query)&&F(a,i),a.querySelectorAll){const l=a.querySelectorAll(i.query);for(let c=0;c<l.length;c++)F(l[c],i)}}i.onInit&&i.onInit(a)}}}for(let o=0;o<e.removedNodes.length;o++){const a=e.removedNodes[o];if(a.nodeType===1){const s=!!(a.firstElementChild||a.children&&a.children.length);for(let u=0;u<t.length;u++){const i=t[u],l=i.query;if(l){if(!s)a.matches&&a.matches(l)&&M(a,i);else if(a.matches&&a.matches(l)&&M(a,i),a.querySelectorAll){const c=a.querySelectorAll(l);for(let d=0;d<c.length;d++)M(c[d],i)}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,L(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Re(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Fe(e){H().push(e),e.onSubtreeChange&&e.query&&j().push(e),oe()}function le(e,t,n,r,o={}){const a=o.extraAttributes||[],s=o.onAttributeChange||null,u=o.onSubtreeChange||null,i=o.onInit||null,l=o.onAttrChange||null,c=o.effects||null,d=o.attributes||null,p=d?xe(d):c,f=d?new Set(Object.keys(d)):null,h=o.persist||null;function w(S){const y=S||document.body;if(ne(y,e,t,n),d&&W())for(const k in d){const g=d[k],A=Array.from(y.querySelectorAll("["+k+"]"));y.matches&&y.matches("["+k+"]")&&A.push(y);for(let R=0;R<A.length;R++){const B=A[R];T(B)&&te(g,B.getAttribute(k),k,r,B)}}i&&i(y)}const m=[];if(e.indexOf("[")!==-1){const S=/\[([\w-]+)/g;let y;for(;(y=S.exec(e))!==null;)m.push(y[1])}else m.push(e);Ne({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:n,onInit:i,observed:m.concat(a),onAttributeChange:s,onAttrChange:l,effects:p,declared:f,persist:h}),ke();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=o.subtreeQuery||(b?e:"["+e+"]"),_={selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:u,query:C};H().push(_),u&&C&&j().push(_),oe(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le,window.lnCore.observeLifecycle=Fe);function N(){Ee()>0?De(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",N):N(),w}function se(e){return(e||"").replace(/^#/,"")}function V(e){const t=e===void 0?location.hash:e,n={},r=se(t);if(!r)return n;const o=r.split("&");for(let a=0;a<o.length;a++){const s=o[a];if(!s)continue;const u=s.indexOf(":"),i=u>-1?s.slice(0,u):s,l=u>-1?s.slice(u+1):"";if(i)try{n[i]=decodeURIComponent(l)}catch{n[i]=l}}return n}function Le(e){if(!e)return null;const t=V();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const n=V();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(a){const s=n[a];return s===""?a:a+":"+encodeURIComponent(s)}).join("&");se(location.hash)!==o&&(location.hash=o)}function Te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ie(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function $e(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 He(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function je(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=V,window.lnCore.hashGet=Le,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=Ie,window.lnCore.hashSortEncode=$e,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=He,window.lnCore.hashFilterDecode=je);function Me(){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=Me);const E={};function O(e){const t=e||"default";if(!E[t]){const n=new Intl.NumberFormat(e,{useGrouping:!0}),r=n.formatToParts(1234.5);let o="",a=".";for(let s=0;s<r.length;s++)r[s].type==="group"&&(o=r[s].value),r[s].type==="decimal"&&(a=r[s].value);E[t]={groupSep:o,decimalSep:a,fmt:n}}return E[t]}function ae(e,t,n){if(e==null||typeof e!="string")return"";let r=e.trim();return r===""?"":(r=r.replace(/[$€£¥]/g,""),t&&(r=r.split(t).join("")),r=r.replace(/\s/g,""),n&&n!=="."&&(r=r.replace(n,".")),r=r.replace(/[^\d.-]/g,""),r)}function Ve(e,t){if(typeof e=="number")return isNaN(e)?NaN:e;if(e==null||typeof e!="string")return NaN;const n=e.trim();if(n===""||n==="-")return NaN;const r=O(t),o=ae(n,r.groupSep,r.decimalSep);if(o===""||o==="-")return NaN;const a=parseFloat(o);return isNaN(a)?NaN:a}function x(e,t,n={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",o=n.maxDecimals!=null?parseInt(n.maxDecimals,10):null,a=n.userDecimals!=null?n.userDecimals:null;if(o!==null){const s=r+"|max:"+o;return E[s]||(E[s]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:o})),E[s].format(e)}if(a!==null&&a>0){const s=r+"|exact:"+a;return E[s]||(E[s]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:a,maximumFractionDigits:a})),E[s].format(e)}return O(t).fmt.format(e)}function Be(e,t){if(!e)return 0;if(t<=0)return e.startsWith("-")?1:0;let n=t,r=0;for(let o=0;o<e.length&&n>0;o++)r=o+1,/[0-9]/.test(e[o])&&n--;return n>0&&(r=e.length),r}(function(){const e="data-ln-number",t="lnNumber";if(window[t]!==void 0)return;function n(l){const c=l[t];c&&(c.isTextElement?c._initTextElement():isNaN(c.value)||c._displayFormatted(c.value))}const r={"data-ln-number":{type:"marker",effect:n,description:"Activates localized number formatting on input or text element"},"data-ln-value":{type:"float",effect:n,description:"Raw unformatted numeric value"},"data-ln-number-decimals":{type:"integer",fallback:0,min:0,max:20,effect:n,description:"Number of decimal fraction digits"},"data-ln-number-min":{type:"float",effect:n,description:"Minimum allowed numeric value"},"data-ln-number-max":{type:"float",effect:n,description:"Maximum allowed numeric value"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),a=new Set;let s=!1;function u(){U(),!s&&(s=!0,document.addEventListener("ln-core:locale-change",function(){a.forEach(function(l){l.isTextElement?l._formatTextContent():isNaN(l.value)||l._displayFormatted(l.value)})}))}function i(l){if(l[t])return l[t];l[t]=this,this.dom=l;const c=this;if(a.add(this),u(),l.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;const d=document.createElement("input");d.type="hidden",d.name=l.name,l.removeAttribute("name"),l.hasAttribute("data-ln-fill-as")&&d.setAttribute("data-ln-fill-as",l.getAttribute("data-ln-fill-as")),l.type="text",l.setAttribute("inputmode","decimal"),l.insertAdjacentElement("afterend",d),this._hidden=d,Object.defineProperty(d,"value",{get:function(){return o.get.call(d)},set:function(f){if(o.set.call(d,f),f!==""&&!isNaN(parseFloat(f))){const h=c.dom.getAttribute("data-ln-number-decimals");c._setDisplayRaw(x(parseFloat(f),v(c.dom),{maxDecimals:h}))}else c._setDisplayRaw("");c.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),he(l,o,{get:function(){return o.get.call(l)},set:function(f){if(f===""){c._setDisplayRaw(""),c._setHiddenRaw(""),l.dispatchEvent(new Event("input",{bubbles:!0}));return}const h=typeof f=="number"?f:parseFloat(String(f));if(isNaN(h))c._setDisplayRaw(String(f)),c._setHiddenRaw("");else{c._setHiddenRaw(h);const w=l.getAttribute("data-ln-number-decimals");c._setDisplayRaw(x(h,v(l),{maxDecimals:w}))}l.dispatchEvent(new Event("input",{bubbles:!0}))}}),this._onInput=function(){c._handleInput()},l.addEventListener("input",this._onInput),this._onKeyDown=function(f){if(f.key!=="Backspace")return;const h=l.selectionStart,w=l.selectionEnd;if(h!==w||h===0)return;const m=O(v(l)),b=o.get.call(l),C=b[h-1];if(C===m.groupSep||/\s/.test(C)){f.preventDefault();const _=h-2>=0?h-2:0,N=b.slice(0,_)+b.slice(h);o.set.call(l,N),l.setSelectionRange(_,_),l.dispatchEvent(new Event("input",{bubbles:!0}))}},l.addEventListener("keydown",this._onKeyDown),this._onPaste=function(f){f.preventDefault();const h=(f.clipboardData||window.clipboardData).getData("text"),w=Ve(h,v(l));c.value=isNaN(w)?NaN:w},l.addEventListener("paste",this._onPaste);const p=l.value;if(p!==""){const f=parseFloat(p);if(!isNaN(f)){const h=l.getAttribute("data-ln-number-decimals");this._setHiddenRaw(f),this._setDisplayRaw(x(f,v(l),{maxDecimals:h})),l.dispatchEvent(new Event("input",{bubbles:!0}))}}return l.form&&(this._onFormReset=function(){setTimeout(function(){const f=l.defaultValue;if(f!==""){const h=parseFloat(f);if(!isNaN(h)){const w=l.getAttribute("data-ln-number-decimals");c._setHiddenRaw(h),c._setDisplayRaw(x(h,v(l),{maxDecimals:w})),l.dispatchEvent(new Event("input",{bubbles:!0}));return}}c._setHiddenRaw(""),c._setDisplayRaw(""),l.dispatchEvent(new Event("input",{bubbles:!0}))},0)},l.form.addEventListener("reset",this._onFormReset)),this}i.prototype._initTextElement=function(){const l=this.dom;let c=l.getAttribute("data-ln-value"),d=l.getAttribute("data-ln-number"),p=null;c!==null&&c!==""?p=c:d!==null&&d!==""&&d!=="true"?p=d:p=l.textContent.trim();const f=parseFloat(p);isNaN(f)?this._rawValue=null:(this._rawValue=f,l.hasAttribute("data-ln-value")||l.setAttribute("data-ln-value",String(f)),this._formatTextContent())},i.prototype._formatTextContent=function(){if(this._rawValue!==null&&!isNaN(this._rawValue)){const l=this.dom.getAttribute("data-ln-number-decimals");this.dom.textContent=x(this._rawValue,v(this.dom),{maxDecimals:l})}},i.prototype._handleInput=function(){const l=this.dom,c=o.get.call(l);if(c===""){this._setHiddenRaw(""),D(l,"ln-number:input",{value:NaN,formatted:""});return}if(c==="-"){this._setHiddenRaw(""),D(l,"ln-number:input",{value:NaN,formatted:"-"});return}const d=l.selectionStart;let p=0;for(let g=0;g<d;g++)/[0-9]/.test(c[g])&&p++;const f=v(l),h=O(f);let w=c,m=ae(c,h.groupSep,h.decimalSep),b=parseFloat(m);if(isNaN(b)){this._setHiddenRaw(""),D(l,"ln-number:input",{value:NaN,formatted:c});return}const C=l.getAttribute("data-ln-number-decimals"),_=m.indexOf(".");if(C!==null&&_!==-1){const g=parseInt(C,10),A=m.slice(_+1);if(g===0)m=m.slice(0,_),w=w.split(h.decimalSep)[0],b=parseFloat(m),this._setDisplayRaw(w);else if(A.length>g){m=m.slice(0,_+1+g);const R=w.split(h.decimalSep);w=R[0]+h.decimalSep+R[1].slice(0,g),b=parseFloat(m),this._setDisplayRaw(w)}}const N=l.getAttribute("data-ln-number-max");if(N!==null&&b>parseFloat(N)){const g=parseFloat(N),A=x(g,f,{maxDecimals:C});this._setDisplayRaw(A),this._setHiddenRaw(g),l.setSelectionRange(A.length,A.length),D(l,"ln-number:input",{value:g,formatted:A});return}if(w.endsWith(h.decimalSep)||h.decimalSep!=="."&&w.endsWith(".")){this._setHiddenRaw(b),D(l,"ln-number:input",{value:b,formatted:w});return}const S=m.indexOf(".");if(S!==-1&&m.slice(S+1).endsWith("0")){this._setHiddenRaw(b),D(l,"ln-number:input",{value:b,formatted:w});return}let y;if(C!==null)y=x(b,f,{maxDecimals:C});else{const g=S!==-1?m.slice(S+1).length:0;y=x(b,f,{userDecimals:g})}this._setDisplayRaw(y);const k=Be(y,p);l.setSelectionRange(k,k),this._setHiddenRaw(b),D(l,"ln-number:input",{value:b,formatted:y})},i.prototype._setHiddenRaw=function(l){this._hidden&&o.set.call(this._hidden,String(l))},i.prototype._setDisplayRaw=function(l){this.isTextElement?this.dom.textContent=String(l):o.set.call(this.dom,String(l))},i.prototype._displayFormatted=function(l){if(this.isTextElement)this._formatTextContent();else{const c=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(x(l,v(this.dom),{maxDecimals:c}))}},Object.defineProperty(i.prototype,"value",{get:function(){if(this.isTextElement)return this._rawValue;const l=o.get.call(this._hidden);return l===""?NaN:parseFloat(l)},set:function(l){const c=typeof l=="number"?l:parseFloat(l);if(this.isTextElement){isNaN(c)?(this._rawValue=null,this.dom.textContent=""):(this._rawValue=c,this.dom.setAttribute("data-ln-value",String(c)),this._formatTextContent());return}if(isNaN(c)){this._setDisplayRaw(""),this._setHiddenRaw(""),this.dom.dispatchEvent(new Event("input",{bubbles:!0}));return}this._setHiddenRaw(c);const d=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(x(c,v(this.dom),{maxDecimals:d})),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(i.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:o.get.call(this.dom)}}),i.prototype.destroy=function(){this.dom[t]&&(a.delete(this),this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement||(this._onFormReset&&this.dom.form&&this.dom.form.removeEventListener("reset",this._onFormReset),this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("keydown",this._onKeyDown),this.dom.removeEventListener("paste",this._onPaste),this._hidden&&(this.dom.name=this._hidden.name,this._hidden.remove()),this.dom.type="number",this.dom.removeAttribute("inputmode")),delete this.dom[t])},le(e,t,i,"ln-number",{attributes:r,extraAttributes:["lang"],onAttributeChange:n})})()})();
@@ -52,6 +52,7 @@ import { calculateCursorPosition } from './number-model.js';
52
52
  if (dom[DOM_ATTRIBUTE]) return dom[DOM_ATTRIBUTE];
53
53
  dom[DOM_ATTRIBUTE] = this;
54
54
  this.dom = dom;
55
+ const self = this;
55
56
 
56
57
  _instances.add(this);
57
58
  _ensureLocaleListener();
@@ -30,6 +30,10 @@
30
30
  value set; if every non-empty value is a finite number, comparison is numeric, else
31
31
  `localeCompare` via `ln-core.getLocale`. Per-pair type inference breaks comparator
32
32
  transitivity and produces wrong ordering — never do it.
33
+ 6. **Schwartzian Transform (Pre-computed Keys).** In default DOM sorting, items are mapped once
34
+ upfront into `{ el, val: _readItemValue(...) }`. Comparison operates strictly on in-memory keys,
35
+ reducing DOM queries by up to 90% and eliminating querySelector calls inside the sort comparator.
36
+ Sorted elements are moved in a single batch via `DocumentFragment`.
33
37
 
34
38
  ---
35
39