@livenetworks/ashlar 2.0.9 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-ajax/src/ln-ajax.js +15 -26
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/helpers.js +1 -1
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +98 -41
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/src/generated-attributes.js +1 -0
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/src/ln-external-links.js +9 -21
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +161 -153
- package/components/ln-filter/src/ln-filter.js +77 -5
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-icon/src/ln-icon.js +14 -16
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-link/src/ln-link.js +16 -26
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-nav/src/ln-nav.js +5 -4
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-progress/src/ln-progress.js +9 -21
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-search/src/ln-search.js +17 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/ln-ashlar.html-data.json +5 -0
- package/package.json +1 -1
- package/web-types.json +8 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function H(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 s=1;s<e.length;s++)if(e[s]&&e[s].nodeType===1){o=e[s];break}if(!H(o))return}t.apply(console,e)}}function D(t,e,l){const o=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,o),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:o}))}function ft(t,e,l){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const o={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};o[l]=t.name,D(t.dom,e,o)}function O(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){O(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function j(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 bt(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function pt(t,e){const l=!!(e&&e.typed),o=e&&e.exclude,s={},h=t.elements,c={};if(l)for(let f=0;f<h.length;f++){const a=h[f];a.name&&a.type==="checkbox"&&!a.disabled&&(c[a.name]=(c[a.name]||0)+1)}for(let f=0;f<h.length;f++){const a=h[f];if(!(!a.name||a.disabled||a.type==="file"||a.type==="submit"||a.type==="button")&&!(o&&a.matches&&a.matches(o)))if(a.type==="checkbox")l&&c[a.name]===1?s[a.name]=a.checked:(s[a.name]||(s[a.name]=[]),a.checked&&s[a.name].push(a.value));else if(a.type==="radio")a.checked&&(s[a.name]=a.value);else if(a.type==="select-multiple"){s[a.name]=[];for(let w=0;w<a.options.length;w++)a.options[w].selected&&s[a.name].push(a.options[w].value)}else if(l&&a.type==="hidden")s[a.name]=a.value;else if(l&&(a.type==="number"||a.type==="range")){const w=Number(a.value);s[a.name]=a.value===""||isNaN(w)?null:w}else s[a.name]=a.value}return s}function wt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function _t(t,e){const l=t.elements,o=[],s={};for(let h=0;h<l.length;h++){const c=l[h];c.name&&c.type==="checkbox"&&(s[c.name]=(s[c.name]||0)+1)}for(let h=0;h<l.length;h++){const c=l[h];if(c.type==="file"||c.type==="submit"||c.type==="button")continue;const f=c.getAttribute("data-ln-fill-as")||c.name;if(!f||!(f in e))continue;const a=e[f];if(c.type==="checkbox"){if(Array.isArray(a))c.checked=a.indexOf(c.value)!==-1;else if(s[c.name]>1){const w=String(a).split(",").map(function(S){return S.trim()});c.checked=w.indexOf(c.value)!==-1}else c.checked=wt(a);o.push(c)}else if(c.type==="radio")c.checked=c.value===String(a),o.push(c);else if(c.type==="select-multiple"){if(Array.isArray(a))for(let w=0;w<c.options.length;w++)c.options[w].selected=a.indexOf(c.options[w].value)!==-1;o.push(c)}else c.value=a,c.tagName==="SELECT"&&a!=null&&c.setAttribute("data-ln-value",a),o.push(c)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=_t,window.lnCore.serializeForm=pt,window.lnCore.resolveFormMethod=bt);const U={};function gt(t,e){U[t]=e}function mt(t){return U[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=gt,window.lnCore.getDataMapper=mt);function yt(t){const e=t?t.closest("[lang]"):null,l=(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 l?l.trim():"en-US"}function Ct(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,O(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const G={};function St(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];G[l]=e}function vt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return G[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=St,window.lnCore.getLocaleFallback=vt,window.lnCore.ensureLocaleObserver=Ct);const N={};function K(t,e){N[t]||(N[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=N[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function Q(t,e,l){if(t){const o=t.querySelector('[data-ln-template="'+e+'"]');if(o)return o.content.cloneNode(!0)}return K(e,l)}function Y(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let c=0;c<l.length;c++){const f=l[c],a=f.getAttribute("data-ln-field");e[a]!=null&&(f.textContent=e[a])}const o=t.querySelectorAll("[data-ln-attr]");for(let c=0;c<o.length;c++){const f=o[c],a=f.getAttribute("data-ln-attr").split(",");for(let w=0;w<a.length;w++){const S=a[w].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();e[E]!=null&&f.setAttribute(A,e[E])}}const s=t.querySelectorAll("[data-ln-show]");for(let c=0;c<s.length;c++){const f=s[c],a=f.getAttribute("data-ln-show");a in e&&f.classList.toggle("hidden",!e[a])}const h=t.querySelectorAll("[data-ln-class]");for(let c=0;c<h.length;c++){const f=h[c],a=f.getAttribute("data-ln-class").split(",");for(let w=0;w<a.length;w++){const S=a[w].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();E in e&&f.classList.toggle(A,!!e[E])}}return t}function At(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 l=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<l.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[o],e??null),l[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)Y(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let l=0;l<e.length;l++)e[l].textContent=""}})));function M(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const h=l.currentNode;h.textContent.indexOf("{{")!==-1&&(h.textContent=h.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(c,f){return e[f]!==void 0?e[f]:""}))}const o=function(h,c){return e[c]!==void 0?e[c]:""},s=Array.from(t.querySelectorAll("*"));t.nodeType===1&&s.push(t);for(let h=0;h<s.length;h++){const c=s[h],f=c.attributes;for(let a=0;a<f.length;a++){const w=f[a];w.value.indexOf("{{")!==-1&&c.setAttribute(w.name,w.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return t}function Et(t,e,l,o,s,h){const c={};for(let a=0;a<t.children.length;a++){const w=t.children[a],S=w.getAttribute("data-ln-render-key");S&&(c[S]=w)}const f=document.createDocumentFragment();for(let a=0;a<e.length;a++){const w=e[a],S=String(o(w));let A=c[S];if(A)s(A,w,a);else{const E=K(l,h);if(!E||(M(E,w),A=E.firstElementChild,!A))continue;A.setAttribute("data-ln-render-key",S),s(A,w,a)}f.appendChild(A)}t.textContent="",t.appendChild(f)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=Y,window.lnCore.lnFill=At,window.lnCore.renderList=Et);function F(t,e,l){const o=t.getAttribute(e);return o===null?l:o}function J(t,e,l){const o=parseInt(t.getAttribute(e),10);return isNaN(o)?l:o}function W(t,e,l=!1){const o=t.getAttribute(e);if(o===null)return!!l;const s=o.trim().toLowerCase();return!(s==="false"||s==="0")}function X(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const P=new Map;function Z(t,e){const l=(t?t.join("|"):"")+"::"+e;if(P.has(l))return P.get(l);const o=new Set(t||[]),s=function(h,c){const f=h.getAttribute(c);return f!==null&&o.has(f)?f:e};return P.set(l,s),s}function tt(t,e,l){const o=parseFloat(t.getAttribute(e));return isNaN(o)?l:o}function et(t,e,l){const o=t.getAttribute(e);if(!o)return l;try{return JSON.parse(o)}catch{return l}}function nt(t,e,l,o,s){if(!t||e===null)return!0;const h=o||"ln-component",c=t.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||e===""&&t.fallback!==void 0)return!0;const f=a=>{s?console.warn(a,s):console.warn(a)};if(c==="boolean"){const a=e.trim().toLowerCase();return a!==""&&a!=="true"&&a!=="false"&&a!=="1"&&a!=="0"?(f(`[${h}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const a=t.values||[];return a.includes(e)?!0:(f(`[${h}] Invalid value "${e}" for attribute "${l}". Allowed: ${a.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(e))return f(`[${h}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const a=parseInt(e,10);return t.min!==void 0&&a<t.min?(f(`[${h}] Value ${a} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&a>t.max?(f(`[${h}] Value ${a} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(c==="float")return isNaN(Number(e))?(f(`[${h}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(e),!0}catch(a){return f(`[${h}] Invalid JSON for attribute "${l}": ${a.message}. Fallback: ${t.fallback}.`),!1}return!0}function it(t,e,l){for(const o in l){const[s,h,c]=l[o];Object.defineProperty(t,o,{get:function(){return s(e,h,c)},enumerable:!0,configurable:!0})}return t}function lt(t){const e={};for(const l in t){const o=t[l];if(!o||!o.prop)continue;let s=o.read;if(!s&&o.type)switch(o.type){case"enum":s=Z(o.values,o.fallback);break;case"integer":s=J;break;case"float":s=tt;break;case"boolean":s=W;break;case"list":s=X;break;case"json":s=et;break;case"string":default:s=F;break}s||(s=F),e[o.prop]=[s,l,o.fallback]}return e}function xt(t){const e={};for(const l in t){const o=t[l];o&&o.effect&&(e[l]=o.effect)}return Object.keys(e).length?e:null}function kt(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const l in t.effects)e.add(l);if(t.onAttrChange&&t.declared)for(const l of t.declared)e.add(l);return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=it,window.lnCore.attrSpec=lt,window.lnCore.attrStr=F,window.lnCore.attrInt=J,window.lnCore.attrBool=W,window.lnCore.attrList=X,window.lnCore.attrEnum=Z,window.lnCore.attrFloat=tt,window.lnCore.attrJson=et);function V(t,e,l,o){if(t.nodeType!==1)return;const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",c=Array.from(t.querySelectorAll(h));t.matches&&t.matches(h)&&c.push(t);for(const f of c)if(!f[l]){window.lnCore._persistSink&&f.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(f,e);try{f[l]=new o(f)}catch(a){console.error("["+l+"] init failed",f,a)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Dt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Tt(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 ot(){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 Lt(t){const e=ot(),l=t.observed||[];for(let o=0;o<l.length;o++){const s=l[o];e.byAttr.has(s)||e.byAttr.set(s,[]),e.byAttr.get(s).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 s=e.byDeclaredAttr.get(o);s.some(h=>h.componentTag===t.componentTag)||s.push({spec:t.attributes[o],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const o=kt(t);if(o===null)e.reactiveWildcard.push(t);else for(const s of o)e.byReactive.has(s)||e.byReactive.set(s,[]),e.byReactive.get(s).push(t)}t.persist&&e.persist.push(t)}function rt(t,e,l,o){for(let s=0;s<t.length;s++){const h=t[s];if(!e[h.attribute])continue;const c=h.effects&&h.effects[l];c?c(e,l,o):h.onAttrChange&&(!h.declared||h.declared.has(l))&&h.onAttrChange(e,l,o)}}function It(t){const e=t.target,l=t.attributeName;if(t.oldValue===e.getAttribute(l))return;const o=ot(),s=o.byAttr.get(l);if($()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(l)&&H(e)){const h=o.byDeclaredAttr.get(l),c=e.getAttribute(l);for(let f=0;f<h.length;f++)nt(h[f].spec,c,l,h[f].componentTag,e)}if(window.lnCore._debugSink&&(l.indexOf("data-ln-")===0||s)&&window.lnCore._debugSink("attr",l,e,{oldValue:t.oldValue,newValue:e.getAttribute(l)}),l.indexOf("data-ln-")===0){const h=o.byReactive.get(l);h&&rt(h,e,l,t.oldValue),o.reactiveWildcard.length&&rt(o.reactiveWildcard,e,l,t.oldValue)}if(s)for(let h=0;h<s.length;h++){const c=s[h];if(c.handler){c.handler(e,l,t.oldValue);continue}c.onAttributeChange&&e[c.attribute]?c.onAttributeChange(e,l):(V(e,c.selector,c.attribute,c.ComponentFn),c.onInit&&c.onInit(e))}}function qt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,O(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{It(e[l])}catch(o){console.error("[ln-core] mutation handler failed",e[l].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function st(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Rt(t){const e=st();if(e.length){if(t.target)for(let l=0;l<e.length;l++){const o=e[l];if(o.onSubtreeChange){const s=o.query,h=t.target.nodeType===1?t.target.matches(s)?t.target:t.target.closest(s):t.target.parentElement?t.target.parentElement.closest(s):null;h&&o.onSubtreeChange(h,t)}}for(let l=0;l<t.addedNodes.length;l++){const o=t.addedNodes[l];if(o.nodeType===1)for(let s=0;s<e.length;s++){const h=e[s];V(o,h.selector,h.attribute,h.ComponentFn),h.onInit&&h.onInit(o)}}for(let l=0;l<t.removedNodes.length;l++){const o=t.removedNodes[l];if(o.nodeType===1)for(let s=0;s<e.length;s++){const h=e[s],c=h.query,f=Array.from(o.querySelectorAll(c));o.matches&&o.matches(c)&&f.push(o);for(let a=0;a<f.length;a++){const w=f[a];if(!document.contains(w)){const S=w[h.attribute];if(S&&typeof S.destroy=="function")try{S.destroy()}catch(A){console.error("["+h.attribute+"] destroy failed",w,A)}delete w[h.attribute]}}}}}}function Ft(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,O(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++){const o=e[l];if(o.type==="childList")try{Rt(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function at(t,e,l,o,s={}){const h=s.extraAttributes||[],c=s.onAttributeChange||null,f=s.onSubtreeChange||null,a=s.onInit||null,w=s.onAttrChange||null,S=s.effects||null,A=s.attributes||null,E=A?xt(A):S,I=A?new Set(Object.keys(A)):null,q=s.persist||null;function R(r){const b=r||document.body;if(V(b,t,e,l),A&&$())for(const d in A){const _=A[d],p=Array.from(b.querySelectorAll("["+d+"]"));b.matches&&b.matches("["+d+"]")&&p.push(b);for(let g=0;g<p.length;g++){const m=p[g];H(m)&&nt(_,m.getAttribute(d),d,o,m)}}a&&a(b)}const v=[];if(t.indexOf("[")!==-1){const r=/\[([\w-]+)/g;let b;for(;(b=r.exec(t))!==null;)v.push(b[1])}else v.push(t);Lt({selector:t,attribute:e,componentTag:o,attributes:A,ComponentFn:l,onInit:a,observed:v.concat(h),onAttributeChange:c,onAttrChange:w,effects:E,declared:I,persist:q}),qt();const u=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]";st().push({selector:t,attribute:e,ComponentFn:l,onInit:a,onSubtreeChange:f,query:u}),Ft(),window[e]=R,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=at);function i(){Dt()>0?Tt(function(){R(document.body)}):R(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i(),R}function Ot(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function Ht(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,l=t.pageSize>0?t.pageSize:200,o=t.threshold!=null?t.threshold:25,s=t.fetchDebounce!=null?t.fetchDebounce:120;const h=typeof t.requestPage=="function"?t.requestPage:function(){},c=typeof t.onChange=="function"?t.onChange:function(){},f=new Map,a=new Map,w=new Set;let S=0,A=0,E=0,I={sort:null,filters:{},search:""},q=null,R=0,v=0,n=!1;function u(d){a.set(d,++R)}function i(){return!!(I&&(I.search||I.filters&&Object.keys(I.filters).length))}function r(){if(f.size<=e)return;const d=Array.from(f.keys()).sort(function(p,g){return(a.get(p)||0)-(a.get(g)||0)});let _=0;for(;f.size>e&&_<d.length;)f.delete(d[_]),a.delete(d[_]),_++}function b(d,_){w.add(d),h(I,d,_)}return{get:function(d){return f.get(d)},has:function(d){return f.has(d)},peek:function(){return f.size?f.values().next().value:void 0},get logicalTotal(){return S},get grandTotal(){return A},get queryGen(){return E},get size(){return f.size},ensure:function(d,_){clearTimeout(q),v=d;for(let x=d;x<_;x++)f.has(x)&&u(x);if(S<=0)return;const p=Math.max(0,d-o),g=Math.min(S,_+o),m=Math.floor(p/l),T=Math.floor(Math.max(0,g-1)/l);let L=-1;for(let x=m;x<=T;x++){const y=x*l,C=Math.min(l,S-y);let k=!1;const Gt=Math.max(y,p),Kt=Math.min(y+C,g);for(let z=Gt;z<Kt;z++)if(!f.has(z)){k=!0;break}if(k&&!w.has(y)){L=y;break}}L!==-1&&(q=setTimeout(function(){b(L,l)},s))},ingest:function(d){if(d=d||{},d.queryGen!=null&&d.queryGen!==E)return!1;const _=d.offset||0,p=d.data||[];let g=0;for(let m=0;m<p.length;m++)p[m]!=null&&g++;if(g===0&&(d.provisional||d.filtered>0))return w.delete(_),!1;n&&(f.clear(),a.clear(),n=!1),d.provisional||(A=d.total!=null?d.total:A,S=d.filtered!=null?d.filtered:d.data?d.data.length:S);for(let m=0;m<p.length;m++)p[m]!=null&&(f.set(_+m,p[m]),u(_+m));return w.delete(_),r(),c(),!0},requestInitial:function(d){d&&(I=d),b(0,l)},invalidate:function(d){E++,w.clear(),clearTimeout(q),d&&(I=d),n=!0,b(0,l)},revalidate:function(){E++,w.clear(),clearTimeout(q),n=!0;const d=Math.max(0,Math.floor(v/l)*l);b(d,l)},release:function(d){w.delete(d)},destroy:function(){clearTimeout(q),f.clear(),a.clear(),w.clear()},configure:function(d){d=d||{};let _=!1;if(d.windowSize!=null&&d.windowSize>0&&d.windowSize!==e){const p=d.windowSize<e;e=d.windowSize,p&&r(),_=!0}d.pageSize!=null&&d.pageSize>0&&(l=d.pageSize),d.threshold!=null&&d.threshold>=0&&(o=d.threshold),d.fetchDebounce!=null&&d.fetchDebounce>=0&&(s=d.fetchDebounce),_&&c()},setGrandTotal:function(d){d==null||isNaN(d)||d<0||(A=d,i()||(S=d),c())}}}function ct(t){return(t||"").replace(/^#/,"")}function B(t){const e=t===void 0?location.hash:t,l={},o=ct(e);if(!o)return l;const s=o.split("&");for(let h=0;h<s.length;h++){const c=s[h];if(!c)continue;const f=c.indexOf(":"),a=f>-1?c.slice(0,f):c,w=f>-1?c.slice(f+1):"";if(a)try{l[a]=decodeURIComponent(w)}catch{l[a]=w}}return l}function Nt(t){if(!t)return null;const e=B();return t in e?e[t]:null}function Mt(t,e){if(!t)return;const l=B();e==null?delete l[t]:l[t]=String(e);const s=Object.keys(l).map(function(h){const c=l[h];return c===""?h:h+":"+encodeURIComponent(c)}).join("&");ct(location.hash)!==s&&(location.hash=s)}function Wt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Pt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const l=t.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.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 Vt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Bt(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 zt(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function $t(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const l=t.slice(0,e),o=t.slice(e+1),s=o?o.split(",").map(function(h){try{return decodeURIComponent(h)}catch{return h}}).filter(Boolean):[];return{key:l,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=B,window.lnCore.hashGet=Nt,window.lnCore.hashSet=Mt,window.lnCore.hashLinkClick=Wt,window.lnCore.resolveHashNamespace=Pt,window.lnCore.hashSortEncode=Vt,window.lnCore.hashSortDecode=Bt,window.lnCore.hashFilterEncode=zt,window.lnCore.hashFilterDecode=$t);function jt(){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=jt);function dt(t,e,l,o,s=15){if(o<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const h=Math.max(0,t||0),c=Math.max(0,e||0),f=Math.floor(h/l),a=Math.ceil(c/l),w=Math.max(0,f-s),S=Math.min(o,f+a+s),A=w*l,E=Math.max(0,(o-S)*l);return{start:w,end:S,topPadding:A,bottomPadding:E}}function Ut(t,e){const l=Array.isArray(t)?t.length:0,o=e instanceof Set?e:new Set(e||[]);let s=0;if(Array.isArray(t))for(let f=0;f<t.length;f++)o.has(t[f])&&s++;else s=o.size;const h=l>0&&s===l,c=s>0&&s<l;return{totalCount:l,selectedCount:s,isAllSelected:h,isIndeterminate:c}}function ut(t,e,l){const o=new Set(t);return e==null||((l!==void 0?l:!o.has(e))?o.add(e):o.delete(e)),o}function ht(t,e,l){const o=new Set(t);if(!Array.isArray(e))return o;if(l)for(let s=0;s<e.length;s++)e[s]!=null&&o.add(e[s]);else for(let s=0;s<e.length;s++)o.delete(e[s]);return o}(function(){const t="data-ln-table",e="lnTable",l="data-ln-table-empty";if(window[e]!==void 0)return;function a(n,u){if(!n||!n.isDataDriven)return;const i=n.dom.hasAttribute("data-ln-table-window");if(i&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!i&&n._windowed)n._exitWindowedMode();else if(i&&n._windowed){const r=parseInt(u,10);r>0&&n._cache.configure({windowSize:r})}}function w(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>0&&n._cache.configure({pageSize:i})}function S(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.configure({threshold:i})}function A(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.setGrandTotal(i)}const E={"data-ln-table":{prop:"name",type:"string",read:F,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:F,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:W,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:a,description:"Virtual scrolling window size in rows"},"data-ln-table-window-page":{type:"integer",fallback:200,min:5,effect:w,description:"Virtual scrolling slice page size"},"data-ln-table-window-threshold":{type:"integer",fallback:50,min:0,effect:S,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-table-count":{type:"integer",min:0,effect:A,description:"Total record count override for virtual scrollbar calculation"},"data-ln-table-row":{type:"marker",description:"Table row template element"},"data-ln-table-row-id":{type:"string",description:"Record identifier on row element"},"data-ln-table-row-action":{type:"trigger",description:"Action trigger inside a table row"},"data-ln-table-row-select":{type:"trigger",description:"Row selection checkbox trigger"},"data-ln-table-col":{type:"string",description:"Column header identifier or field mapping"},"data-ln-table-col-select":{type:"trigger",description:"Header select-all checkbox trigger"},"data-ln-table-cell-attr":{type:"string",description:"Cell attribute template mapping"},"data-ln-table-empty":{type:"marker",description:"Container for table empty state"},"data-ln-table-select-all-label":{type:"string",description:"Accessibility label for select-all header trigger"}},I=lt(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function q(n,u){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(yt(u)).format(n)}catch{return String(n)}}function R(n){let u=n.parentElement;for(;u&&u!==document.body&&u!==document.documentElement;){const r=getComputedStyle(u).overflowY;if(r==="auto"||r==="scroll")return u;u=u.parentElement}return null}function v(n){this.dom=n,it(this,n,I),this.table=n.querySelector("table"),this.tbody=n.querySelector("[data-ln-table-body]")||n.querySelector("tbody"),this.thead=n.querySelector("thead");const u=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=u?Array.from(u.querySelectorAll("th")):[],this._totalSpan=n.querySelector("[data-ln-table-total]"),this._filteredSpan=n.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this.isDataDriven=n.hasAttribute("data-ln-table-source"),this._data=[],this._filteredData=[],this._searchTerm="",this._sortCol=-1,this._sortDir=null,this._columnFilters={},this.selectedIds=new Set,this._virtual=!1,this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._scrollContainer=null,this._colgroup=null;const i=this;return this._onSetSearch=function(r){const b=(r.detail&&r.detail.query!=null?r.detail.query:r.detail&&r.detail.term!=null?r.detail.term:"").trim();i.isDataDriven?(i.currentSearch=b,D(n,"ln-table:search",{table:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=b.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(r){r.preventDefault(),i._onSetSearch(r)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",D(n,"ln-table:clear-filters",{table:i.name}),i._requestData()):(i._searchTerm="",i._columnFilters={},i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table: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,this.isDataDriven&&n.hasAttribute("data-ln-table-window")&&this._enterWindowedMode(),this._onSetData=function(r){const b=r.detail||{},d=b.data||[],_=b.total!=null?b.total:d.length;if(!(i._hasInitialSeed&&!i.isLoaded&&d.length===0&&_===0)){if(i._windowed){i._cache.ingest(b)&&!b.provisional&&n.classList.remove("ln-table--loading");return}i._data=d,i._lastTotal=_,i._lastFiltered=b.filtered!=null?b.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-table--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),D(n,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(r){const b=r.detail&&r.detail.loading;n.classList.toggle("ln-table--loading",!!b),b&&(i.isLoaded=!1)},n.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(r){!i._windowed||!i._cache||i._cache.release(r.detail&&r.detail.offset)},n.addEventListener("ln-table:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this._onSort=function(r){!r.detail||r.detail.field==null||(r.preventDefault(),i.currentSort=r.detail.direction==="none"?null:{field:r.detail.field,direction:r.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._windowed&&this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden"),this._onRowClick=function(r){if(r.target.closest("[data-ln-table-row-select]")||r.target.closest("[data-ln-table-row-action]")||r.target.closest("a")||r.target.closest("button")||r.ctrlKey||r.metaKey||r.button===1)return;const b=r.target.closest("[data-ln-table-row]");if(!b)return;const d=b.getAttribute("data-ln-table-row-id"),_=b._lnRecord||{};D(n,"ln-table:row-click",{table:i.name,id:d,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(r){const b=r.target.closest("[data-ln-table-row-action]");if(!b)return;const d=b.closest("[data-ln-table-row]");if(!d)return;const _=b.getAttribute("data-ln-table-row-action"),p=d.getAttribute("data-ln-table-row-id"),g=d._lnRecord||{};D(n,"ln-table:row-action",{table:i.name,id:p,action:_,record:g})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),this._windowed?this._kickWindowInitial():D(n,"ln-table:request-data",{table:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){i.tbody.rows.length>0&&(i._emptyTbodyObserver.disconnect(),i._emptyTbodyObserver=null,i._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(r){if(!r.detail||r.detail.column==null)return;r.preventDefault();const b=r.detail.direction==="none"?null:r.detail.direction;i._sortCol=b===null?-1:r.detail.column,i._sortDir=b,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),D(n,"ln-table:sorted",{column:r.detail.column,direction:r.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(r){if(r.preventDefault(),!r.detail)return;const b=r.detail.key,d=r.detail.values||[];if(b){if(d.length===0)delete i._columnFilters[b];else{const _=[];for(let p=0;p<d.length;p++)_.push(d[p].toLowerCase());i._columnFilters[b]=_}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange)),this}v.prototype._parseRows=function(){const n=this.tbody.rows,u=this.ths;this._data=[],n.length>0&&(this._rowHeight=n[0].offsetHeight||40),this._lockColumnWidths();for(let i=0;i<n.length;i++){const r=n[i],b=[],d=[],_=[];for(let g=0;g<r.cells.length;g++){const m=r.cells[g],T=m.textContent.trim();b[g]=j(m),d[g]=T.toLowerCase(),m.querySelector("[data-ln-table-row-action]")||_.push(T.toLowerCase())}let p=null;if(this.isDataDriven){p={};const g=r.getAttribute("data-ln-table-row-id");g!=null&&(p.id=g);for(let m=0;m<u.length;m++){const T=u[m].getAttribute("data-ln-table-col");if(T){const L=m;if(L<r.cells.length){const x=r.cells[L];p[T]=j(x)}}}}this._data.push({values:b,rawTexts:d,html:r.outerHTML,searchText:_.join(" "),id:this.isDataDriven&&p?p.id:void 0,...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-table:ready",{total:this._data.length})},v.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},v.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const n=document.createElement("colgroup");this.ths.forEach(function(u){const i=document.createElement("col");i.style.width=u.offsetWidth+"px",n.appendChild(i)}),this.table.insertBefore(n,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=n},v.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,u=this.visibleCount;if(n===0){this._disableVirtualScroll(),this._showEmptyState();return}if(this._filteredData.length===0||u===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._columnFilters).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,u=document.createDocumentFragment();for(let i=0;i<n.length;i++){const r=this._buildRow(n[i]);if(!r)break;u.appendChild(r)}this.tbody.replaceChildren(u),this._selectable&&this._updateSelectAll()}else{const n=[],u=this._filteredData;for(let i=0;i<u.length;i++)n.push(u[i].html);this.tbody.innerHTML=n.join(""),this._selectable&&this._restoreSelection()}},v.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let i=null;if(this._windowed){const r=this._cache?this._cache.peek():null;i=r?this._buildRow(r):this._buildPlaceholderRow()}else this.isDataDriven&&this._data.length>0&&(i=this._buildRow(this._data[0]));i&&this.tbody&&(this.tbody.appendChild(i),this._rowHeight=i.offsetHeight||40,i.remove())}this.isDataDriven?this._scrollContainer=R(this.dom):this._scrollContainer=null;const u=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},u.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},v.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),window.removeEventListener("resize",this._scrollHandler),this._scrollHandler=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,u=n.length,i=this._rowHeight;if(!i||!u)return;const r=this.thead?this.thead.offsetHeight:0,b=this._scrollContainer;let d,_;if(b){const y=this.table.getBoundingClientRect(),C=b.getBoundingClientRect(),k=y.top-C.top+b.scrollTop+r;d=b.scrollTop-k,_=b.clientHeight}else{const k=this.table.getBoundingClientRect().top+window.scrollY+r;d=window.scrollY-k,_=window.innerHeight}const p=dt(d,_,i,u,15),g=p.start,m=p.end;if(g===this._vStart&&m===this._vEnd)return;this._vStart=g,this._vEnd=m;const T=this.ths.length||1,L=p.topPadding,x=p.bottomPadding;if(this.isDataDriven){const y=document.createDocumentFragment();if(L>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const k=document.createElement("td");k.setAttribute("colspan",T),k.style.height=L+"px",C.appendChild(k),y.appendChild(C)}for(let C=g;C<m;C++){const k=this._buildRow(n[C]);k&&y.appendChild(k)}if(x>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const k=document.createElement("td");k.setAttribute("colspan",T),k.style.height=x+"px",C.appendChild(k),y.appendChild(C)}this.tbody.replaceChildren(y),this._selectable&&this._updateSelectAll()}else{let y="";L>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+L+'px;padding:0;border:none"></td></tr>');for(let C=g;C<m;C++)y+=n[C].html;x>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+x+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=y,this._selectable&&this._restoreSelection()}},v.prototype._buildPlaceholderRow=function(){const n=document.createElement("tr");n.className="ln-table__placeholder",n.setAttribute("aria-hidden","true");const u=document.createElement("td");return u.setAttribute("colspan",this.ths.length||1),u.style.height=this._rowHeight+"px",n.appendChild(u),n},v.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._rowHeight;if(!n)return;const u=this._cache.logicalTotal,i=this.thead?this.thead.offsetHeight:0,r=this._scrollContainer;let b,d;if(r){const y=this.table.getBoundingClientRect(),C=r.getBoundingClientRect(),k=y.top-C.top+r.scrollTop+i;b=r.scrollTop-k,d=r.clientHeight}else{const k=this.table.getBoundingClientRect().top+window.scrollY+i;b=window.scrollY-k,d=window.innerHeight}const _=dt(b,d,n,u,15),p=_.start,g=_.end,m=this.ths.length||1,T=_.topPadding,L=_.bottomPadding,x=document.createDocumentFragment();if(T>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=T+"px",y.appendChild(C),x.appendChild(y)}for(let y=p;y<g;y++)if(this._cache.has(y)){const C=this._buildRow(this._cache.get(y));C&&x.appendChild(C)}else x.appendChild(this._buildPlaceholderRow());if(L>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=L+"px",y.appendChild(C),x.appendChild(y)}this.tbody.replaceChildren(x),this._vStart=p,this._vEnd=g,this._cache.ensure(p,g)},v.prototype._showEmptyState=function(){const n=this.ths.length||1;let u=null,i=null;if(this.isDataDriven){const r=this._lastTotal!=null?this._lastTotal:this._data.length,d=this.visibleCount===0&&r>0,_=d?this.name+"-empty-filtered":this.name+"-empty";if(i=Q(this.dom,_,"ln-table"),!i){const p=this.dom.querySelector("template[data-ln-table-empty]");if(p){const g=d?"search":"initial",m=p.content.querySelector('[data-ln-table-empty-when="'+g+'"]')||p.content.firstElementChild;m&&(i=document.importNode(m,!0))}}if(i)if(i.tagName==="TR")u=i;else{const p=document.createElement("td");p.setAttribute("colspan",String(n)),p.appendChild(i);const g=document.createElement("tr");g.className="ln-table__empty",g.appendChild(p),u=g}}else{const r=this.dom.querySelector("template["+l+"]"),b=document.createElement("td");b.setAttribute("colspan",String(n)),r&&b.appendChild(document.importNode(r.content,!0));const d=document.createElement("tr");d.className="ln-table__empty",d.appendChild(b),u=d}u?this.tbody.replaceChildren(u):this.tbody.replaceChildren(),D(this.dom,"ln-table:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},v.prototype._fillRow=function(n,u){M(n,u);const i=n.querySelectorAll("[data-ln-table-cell-attr]");for(let r=0;r<i.length;r++){const b=i[r],d=b.getAttribute("data-ln-table-cell-attr").split(",");for(let _=0;_<d.length;_++){const p=d[_].trim().split(":");if(p.length!==2)continue;const g=p[0].trim(),m=p[1].trim();u[g]!=null&&b.setAttribute(m,u[g])}}},v.prototype._buildRow=function(n){let u=Q(this.dom,this.name+"-row","ln-table");if(!u){const r=this.dom.querySelector("template[data-ln-table-row]");r&&(u=document.importNode(r.content,!0))}let i=u?u.querySelector("[data-ln-table-row]")||u.firstElementChild:null;if(i)this._fillRow(i,n);else if(n&&n.html){const r=document.createElement("tbody");r.innerHTML=n.html,i=r.firstElementChild}else{i=document.createElement("tr"),i.setAttribute("data-ln-table-row","");const r=this.ths;for(let b=0;b<r.length;b++){const d=r[b].hasAttribute("data-ln-table-col-select"),_=document.createElement("td");if(d){const p=document.createElement("input");p.type="checkbox",p.setAttribute("data-ln-table-row-select",""),p.setAttribute("aria-label","Select row"),_.appendChild(p)}else{const p=r[b].getAttribute("data-ln-table-col");p&&n[p]!=null&&(_.textContent=String(n[p]))}i.appendChild(_)}}if(i._lnRecord=n,n.id!=null&&i.setAttribute("data-ln-table-row-id",n.id),this._selectable&&n.id!=null&&this.selectedIds.has(String(n.id))){i.classList.add("ln-row-selected");const r=i.querySelector("[data-ln-table-row-select]");r&&(r.checked=!0)}return i},v.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-table--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}ft(this,"ln-table:request-data","table")},v.prototype._enterWindowedMode=function(){const n=this,u=this.dom,i=parseInt(u.getAttribute("data-ln-table-window"),10),r=parseInt(u.getAttribute("data-ln-table-window-page"),10),b=parseInt(u.getAttribute("data-ln-table-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(u,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=Ot(this._onCacheChange),this._cache=Ht({windowSize:i>0?i:1e3,pageSize:r>0?r:200,threshold:b>=0?b:25,fetchDebounce:120,requestPage:function(d,_,p){D(u,"ln-table:request-data",{table:n.name,sort:d.sort,filters:d.filters,search:d.search,offset:_,limit:p,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){let n=parseInt(this.dom.getAttribute("data-ln-table-count"),10);if(isNaN(n)&&this._totalSpan){const i=this._totalSpan.textContent.replace(/[^\d]/g,"");i&&(n=parseInt(i,10))}const u=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:u,filtered:u})}else this.dom.classList.add("ln-table--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._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-table--loading"),this._requestData()},v.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]"),u=[];for(let r=0;r<n.length;r++){const b=n[r].getAttribute("data-ln-table-row-id");b!=null&&u.push(b)}const i=Ut(u,this.selectedIds);this._selectAllCheckbox.checked=i.isAllSelected,this._selectAllCheckbox.indeterminate=i.isIndeterminate},v.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]");for(let u=0;u<n.length;u++){const i=n[u].getAttribute("data-ln-table-row-id"),r=i!=null&&this.selectedIds.has(i);n[u].classList.toggle("ln-row-selected",r);const b=n[u].querySelector("[data-ln-table-row-select]");b&&(b.checked=r)}this._updateSelectAll()},Object.defineProperty(v.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),v.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;if(this._onSelectionChange=function(u){const i=u.target.closest("[data-ln-table-row-select]");if(!i)return;const r=i.closest("[data-ln-table-row]");if(!r)return;const b=r.getAttribute("data-ln-table-row-id");b!=null&&(n.selectedIds=ut(n.selectedIds,b,i.checked),r.classList.toggle("ln-row-selected",i.checked),n.selectedCount=n.selectedIds.size,n._updateSelectAll(),n._updateFooter(),D(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}))},this.tbody&&this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector('[data-ln-table-col-select] input[type="checkbox"]')||this.dom.querySelector("[data-ln-table-col-select]"),this._selectAllCheckbox&&this._selectAllCheckbox.tagName==="TH"){const u=document.createElement("input");u.type="checkbox";const i=n.dom.querySelector('[data-ln-table-dict="select-all"]'),r=n.dom.getAttribute("data-ln-table-select-all-label")||(i?i.textContent.trim():null)||"Select all";u.setAttribute("aria-label",r),this._selectAllCheckbox.appendChild(u),this._selectAllCheckbox=u}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const u=n._selectAllCheckbox.checked,i=n.tbody?n.tbody.querySelectorAll("[data-ln-table-row]"):[],r=[];for(let b=0;b<i.length;b++){const d=i[b].getAttribute("data-ln-table-row-id"),_=i[b].querySelector("[data-ln-table-row-select]");d!=null&&(r.push(d),i[b].classList.toggle("ln-row-selected",u),_&&(_.checked=u))}n.selectedIds=ht(n.selectedIds,r,u),n.selectedCount=n.selectedIds.size,D(n.dom,"ln-table:select-all",{table:n.name,selected:u}),D(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){const r=u[i].querySelector("[data-ln-table-row-select]"),b=u[i].getAttribute("data-ln-table-row-id");r&&r.checked&&b!=null&&(n.selectedIds=ut(n.selectedIds,b,!0),u[i].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},v.prototype._disableSelection=function(){if(!this._selectableActive)return;this._selectableActive=!1,this.tbody&&this._onSelectionChange&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll);const n=this.dom.querySelector("[data-ln-table-col-select]");if(n){const u=n.querySelector('input[type="checkbox"]');u&&u.remove()}if(this._selectAllCheckbox=null,this.selectedIds=ht(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){u[i].classList.remove("ln-row-selected");const r=u[i].querySelector("[data-ln-table-row-select]");r&&(r.checked=!1)}}this._updateFooter()},v.prototype._updateFooter=function(){let n=0,u=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,u=this.visibleCount):(n=this._data.length,u=this._filteredData.length);const i=u<n;if(this._totalSpan&&(this._totalSpan.textContent=q(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=i?q(u,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!i),this._selectedSpan){const r=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=r>0?q(r,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",r===0)}},v.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-table:set-search",this._onSetSearch),this.dom.removeEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this.dom.removeEventListener("ln-table:set-data",this._onSetData),this.dom.removeEventListener("ln-table:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-table:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onRowClick),this.tbody.removeEventListener("click",this._onRowAction)),this._cache&&this._cache.destroy()):(this._emptyTbodyObserver&&(this._emptyTbodyObserver.disconnect(),this._emptyTbodyObserver=null),this.dom.removeEventListener("ln-sort:change",this._onSort),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-filter:change",this._onFilterChange)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._colgroup&&(this._colgroup.remove(),this._colgroup=null),this.table&&(this.table.style.tableLayout=""),this._data=[],this._filteredData=[],delete this.dom[e])},at(t,e,v,"ln-table",{attributes:E})})()})();
|
|
1
|
+
(function(){"use strict";function U(){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 N(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 r=null;for(let c=1;c<e.length;c++)if(e[c]&&e[c].nodeType===1){r=e[c];break}if(!N(r))return}t.apply(console,e)}}function D(t,e,l){const r=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,r),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function wt(t,e,l){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const r={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};r[l]=t.name,D(t.dom,e,r)}function H(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){H(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function G(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 _t(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function gt(t,e){const l=!!(e&&e.typed),r=e&&e.exclude,c={},b=t.elements,a={};if(l)for(let h=0;h<b.length;h++){const o=b[h];o.name&&o.type==="checkbox"&&!o.disabled&&(a[o.name]=(a[o.name]||0)+1)}for(let h=0;h<b.length;h++){const o=b[h];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")l&&a[o.name]===1?c[o.name]=o.checked:(c[o.name]||(c[o.name]=[]),o.checked&&c[o.name].push(o.value));else if(o.type==="radio")o.checked&&(c[o.name]=o.value);else if(o.type==="select-multiple"){c[o.name]=[];for(let p=0;p<o.options.length;p++)o.options[p].selected&&c[o.name].push(o.options[p].value)}else if(l&&o.type==="hidden")c[o.name]=o.value;else if(l&&(o.type==="number"||o.type==="range")){const p=Number(o.value);c[o.name]=o.value===""||isNaN(p)?null:p}else c[o.name]=o.value}return c}function mt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function yt(t,e){const l=t.elements,r=[],c={};for(let b=0;b<l.length;b++){const a=l[b];a.name&&a.type==="checkbox"&&(c[a.name]=(c[a.name]||0)+1)}for(let b=0;b<l.length;b++){const a=l[b];if(a.type==="file"||a.type==="submit"||a.type==="button")continue;const h=a.getAttribute("data-ln-fill-as")||a.name;if(!h||!(h in e))continue;const o=e[h];if(a.type==="checkbox"){if(Array.isArray(o))a.checked=o.indexOf(a.value)!==-1;else if(c[a.name]>1){const p=String(o).split(",").map(function(v){return v.trim()});a.checked=p.indexOf(a.value)!==-1}else a.checked=mt(o);r.push(a)}else if(a.type==="radio")a.checked=a.value===String(o),r.push(a);else if(a.type==="select-multiple"){if(Array.isArray(o))for(let p=0;p<a.options.length;p++)a.options[p].selected=o.indexOf(a.options[p].value)!==-1;r.push(a)}else a.value=o,a.tagName==="SELECT"&&o!=null&&a.setAttribute("data-ln-value",o),r.push(a)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=yt,window.lnCore.serializeForm=gt,window.lnCore.resolveFormMethod=_t);const K={};function Ct(t,e){K[t]=e}function St(t){return K[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ct,window.lnCore.getDataMapper=St);function vt(t){const e=t?t.closest("[lang]"):null,l=(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 l?l.trim():"en-US"}function At(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,H(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Q={};function Et(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];Q[l]=e}function kt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return Q[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Et,window.lnCore.getLocaleFallback=kt,window.lnCore.ensureLocaleObserver=At);const M={};function Y(t,e){M[t]||(M[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=M[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function J(t,e,l){if(t){const r=t.querySelector('[data-ln-template="'+e+'"]');if(r)return r.content.cloneNode(!0)}return Y(e,l)}function X(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let a=0;a<l.length;a++){const h=l[a],o=h.getAttribute("data-ln-field");e[o]!=null&&(h.textContent=e[o])}const r=t.querySelectorAll("[data-ln-attr]");for(let a=0;a<r.length;a++){const h=r[a],o=h.getAttribute("data-ln-attr").split(",");for(let p=0;p<o.length;p++){const v=o[p].trim().split(":");if(v.length!==2)continue;const A=v[0].trim(),E=v[1].trim();e[E]!=null&&h.setAttribute(A,e[E])}}const c=t.querySelectorAll("[data-ln-show]");for(let a=0;a<c.length;a++){const h=c[a],o=h.getAttribute("data-ln-show");o in e&&h.classList.toggle("hidden",!e[o])}const b=t.querySelectorAll("[data-ln-class]");for(let a=0;a<b.length;a++){const h=b[a],o=h.getAttribute("data-ln-class").split(",");for(let p=0;p<o.length;p++){const v=o[p].trim().split(":");if(v.length!==2)continue;const A=v[0].trim(),E=v[1].trim();E in e&&h.classList.toggle(A,!!e[E])}}return t}function xt(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 l=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<l.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[r],e??null),l[r].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)X(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let l=0;l<e.length;l++)e[l].textContent=""}})));function W(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const b=l.currentNode;b.textContent.indexOf("{{")!==-1&&(b.textContent=b.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(a,h){return e[h]!==void 0?e[h]:""}))}const r=function(b,a){return e[a]!==void 0?e[a]:""},c=Array.from(t.querySelectorAll("*"));t.nodeType===1&&c.push(t);for(let b=0;b<c.length;b++){const a=c[b],h=a.attributes;for(let o=0;o<h.length;o++){const p=h[o];p.value.indexOf("{{")!==-1&&a.setAttribute(p.name,p.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function Dt(t,e,l,r,c,b){const a={};for(let o=0;o<t.children.length;o++){const p=t.children[o],v=p.getAttribute("data-ln-render-key");v&&(a[v]=p)}const h=document.createDocumentFragment();for(let o=0;o<e.length;o++){const p=e[o],v=String(r(p));let A=a[v];if(A)c(A,p,o);else{const E=Y(l,b);if(!E||(W(E,p),A=E.firstElementChild,!A))continue;A.setAttribute("data-ln-render-key",v),c(A,p,o)}h.appendChild(A)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=X,window.lnCore.lnFill=xt,window.lnCore.renderList=Dt);function R(t,e,l){const r=t.getAttribute(e);return r===null?l:r}function Z(t,e,l){const r=parseInt(t.getAttribute(e),10);return isNaN(r)?l:r}function P(t,e,l=!1){const r=t.getAttribute(e);if(r===null)return!!l;const c=r.trim().toLowerCase();return!(c==="false"||c==="0")}function tt(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const V=new Map;function et(t,e){const l=(t?t.join("|"):"")+"::"+e;if(V.has(l))return V.get(l);const r=new Set(t||[]),c=function(b,a){const h=b.getAttribute(a);return h!==null&&r.has(h)?h:e};return V.set(l,c),c}function nt(t,e,l){const r=parseFloat(t.getAttribute(e));return isNaN(r)?l:r}function it(t,e,l){const r=t.getAttribute(e);if(!r)return l;try{return JSON.parse(r)}catch{return l}}function lt(t,e,l,r,c){if(!t||e===null)return!0;const b=r||"ln-component",a=t.type;if(a==="trigger"||a==="marker"||a==="string"||a==="list"||!a||e===""&&t.fallback!==void 0)return!0;const h=o=>{c?console.warn(o,c):console.warn(o)};if(a==="boolean"){const o=e.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(h(`[${b}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(a==="enum"){const o=t.values||[];return o.includes(e)?!0:(h(`[${b}] Invalid value "${e}" for attribute "${l}". Allowed: ${o.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(a==="integer"){if(!/^-?\d+$/.test(e))return h(`[${b}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const o=parseInt(e,10);return t.min!==void 0&&o<t.min?(h(`[${b}] Value ${o} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&o>t.max?(h(`[${b}] Value ${o} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(a==="float")return isNaN(Number(e))?(h(`[${b}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(a==="json")try{return JSON.parse(e),!0}catch(o){return h(`[${b}] Invalid JSON for attribute "${l}": ${o.message}. Fallback: ${t.fallback}.`),!1}return!0}function rt(t,e,l){for(const r in l){const[c,b,a]=l[r];Object.defineProperty(t,r,{get:function(){return c(e,b,a)},enumerable:!0,configurable:!0})}return t}function ot(t){const e={};for(const l in t){const r=t[l];if(!r||!r.prop)continue;let c=r.read;if(!c&&r.type)switch(r.type){case"enum":c=et(r.values,r.fallback);break;case"integer":c=Z;break;case"float":c=nt;break;case"boolean":c=P;break;case"list":c=tt;break;case"json":c=it;break;case"string":default:c=R;break}c||(c=R),e[r.prop]=[c,l,r.fallback]}return e}function Tt(t){const e={};for(const l in t){const r=t[l];r&&r.effect&&(e[l]=r.effect)}return Object.keys(e).length?e:null}function Lt(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const l in t.effects)e.add(l);if(t.onAttrChange&&t.declared)for(const l of t.declared)e.add(l);return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=rt,window.lnCore.attrSpec=ot,window.lnCore.attrStr=R,window.lnCore.attrInt=Z,window.lnCore.attrBool=P,window.lnCore.attrList=tt,window.lnCore.attrEnum=et,window.lnCore.attrFloat=nt,window.lnCore.attrJson=it);function O(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(l){console.error("["+e.attribute+"] init failed",t,l)}}}function st(t,e,l,r){if(t.nodeType!==1)return;const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",a={selector:e,attribute:l,ComponentFn:r};if(t.matches&&t.matches(b)&&O(t,a),t.querySelectorAll){const h=t.querySelectorAll(b);for(let o=0;o<h.length;o++)O(h[o],a)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function qt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function It(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 at(){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 Ft(t){const e=at(),l=t.observed||[];for(let r=0;r<l.length;r++){const c=l[r];e.byAttr.has(c)||e.byAttr.set(c,[]),e.byAttr.get(c).push(t)}if(e.byDeclaredAttr=e.byDeclaredAttr||new Map,t.attributes)for(const r in t.attributes){e.byDeclaredAttr.has(r)||e.byDeclaredAttr.set(r,[]);const c=e.byDeclaredAttr.get(r);c.some(b=>b.componentTag===t.componentTag)||c.push({spec:t.attributes[r],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const r=Lt(t);if(r===null)e.reactiveWildcard.push(t);else for(const c of r)e.byReactive.has(c)||e.byReactive.set(c,[]),e.byReactive.get(c).push(t)}t.persist&&e.persist.push(t)}function ct(t,e,l,r){for(let c=0;c<t.length;c++){const b=t[c];if(!e[b.attribute])continue;const a=b.effects&&b.effects[l];a?a(e,l,r):b.onAttrChange&&(!b.declared||b.declared.has(l))&&b.onAttrChange(e,l,r)}}function Rt(t){const e=t.attributeName,l=e.indexOf("data-ln-")===0,r=at(),c=r.byAttr.get(e),b=U()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(e);if(!l&&!c&&!b)return;const a=t.target;if(t.oldValue!==a.getAttribute(e)){if(b&&N(a)){const h=r.byDeclaredAttr.get(e),o=a.getAttribute(e);for(let p=0;p<h.length;p++)lt(h[p].spec,o,e,h[p].componentTag,a)}if(window.lnCore._debugSink&&(l||c)&&window.lnCore._debugSink("attr",e,a,{oldValue:t.oldValue,newValue:a.getAttribute(e)}),l){const h=r.byReactive.get(e);h&&ct(h,a,e,t.oldValue),r.reactiveWildcard.length&&ct(r.reactiveWildcard,a,e,t.oldValue)}if(c)for(let h=0;h<c.length;h++){const o=c[h];if(o.handler){o.handler(a,e,t.oldValue);continue}o.onAttributeChange&&a[o.attribute]?o.onAttributeChange(a,e):(st(a,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(a))}}}function Ot(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,H(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Rt(e[l])}catch(r){console.error("[ln-core] mutation handler failed",e[l].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function B(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function z(t,e){if(!document.contains(t))if(e.attribute){const l=t[e.attribute];if(l&&typeof l.destroy=="function")try{l.destroy()}catch(r){console.error("["+e.attribute+"] destroy failed",t,r)}delete t[e.attribute]}else e.onDestroy&&e.onDestroy(t)}function Ht(t){const e=B();if(e.length){if(t.target)for(let l=0;l<e.length;l++){const r=e[l];if(r.onSubtreeChange&&r.query){const c=r.query,b=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;b&&r.onSubtreeChange(b,t)}}for(let l=0;l<t.addedNodes.length;l++){const r=t.addedNodes[l];if(r.nodeType===1){const c=!!(r.firstElementChild||r.children&&r.children.length);for(let b=0;b<e.length;b++){const a=e[b];if(a.selector&&a.attribute&&a.ComponentFn){if(!c)r.matches&&r.matches(a.query)&&O(r,a);else if(r.matches&&r.matches(a.query)&&O(r,a),r.querySelectorAll){const h=r.querySelectorAll(a.query);for(let o=0;o<h.length;o++)O(h[o],a)}}a.onInit&&a.onInit(r)}}}for(let l=0;l<t.removedNodes.length;l++){const r=t.removedNodes[l];if(r.nodeType===1){const c=!!(r.firstElementChild||r.children&&r.children.length);for(let b=0;b<e.length;b++){const a=e[b],h=a.query;if(h){if(!c)r.matches&&r.matches(h)&&z(r,a);else if(r.matches&&r.matches(h)&&z(r,a),r.querySelectorAll){const o=r.querySelectorAll(h);for(let p=0;p<o.length;p++)z(o[p],a)}}}}}}}function dt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,H(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++){const r=e[l];if(r.type==="childList")try{Ht(r)}catch(c){console.error("[ln-core] lifecycle handler failed",r.target,c)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Nt(t){B().push(t),dt()}function ut(t,e,l,r,c={}){const b=c.extraAttributes||[],a=c.onAttributeChange||null,h=c.onSubtreeChange||null,o=c.onInit||null,p=c.onAttrChange||null,v=c.effects||null,A=c.attributes||null,E=A?Tt(A):v,q=A?new Set(Object.keys(A)):null,I=c.persist||null;function F(s){const f=s||document.body;if(st(f,t,e,l),A&&U())for(const d in A){const _=A[d],w=Array.from(f.querySelectorAll("["+d+"]"));f.matches&&f.matches("["+d+"]")&&w.push(f);for(let g=0;g<w.length;g++){const m=w[g];N(m)&<(_,m.getAttribute(d),d,r,m)}}o&&o(f)}const S=[];if(t.indexOf("[")!==-1){const s=/\[([\w-]+)/g;let f;for(;(f=s.exec(t))!==null;)S.push(f[1])}else S.push(t);Ft({selector:t,attribute:e,componentTag:r,attributes:A,ComponentFn:l,onInit:o,observed:S.concat(b),onAttributeChange:a,onAttrChange:p,effects:E,declared:q,persist:I}),Ot();const n=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,u=c.subtreeQuery||(n?t:"["+t+"]");B().push({selector:t,attribute:e,ComponentFn:l,onInit:o,onSubtreeChange:h,query:u}),dt(),window[e]=F,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ut,window.lnCore.observeLifecycle=Nt);function i(){qt()>0?It(function(){F(document.body)}):F(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i(),F}function Mt(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function Wt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,l=t.pageSize>0?t.pageSize:200,r=t.threshold!=null?t.threshold:25,c=t.fetchDebounce!=null?t.fetchDebounce:120;const b=typeof t.requestPage=="function"?t.requestPage:function(){},a=typeof t.onChange=="function"?t.onChange:function(){},h=new Map,o=new Map,p=new Set;let v=0,A=0,E=0,q={sort:null,filters:{},search:""},I=null,F=0,S=0,n=!1;function u(d){o.set(d,++F)}function i(){return!!(q&&(q.search||q.filters&&Object.keys(q.filters).length))}function s(){if(h.size<=e)return;const d=Array.from(h.keys()).sort(function(w,g){return(o.get(w)||0)-(o.get(g)||0)});let _=0;for(;h.size>e&&_<d.length;)h.delete(d[_]),o.delete(d[_]),_++}function f(d,_){p.add(d),b(q,d,_)}return{get:function(d){return h.get(d)},has:function(d){return h.has(d)},peek:function(){return h.size?h.values().next().value:void 0},get logicalTotal(){return v},get grandTotal(){return A},get queryGen(){return E},get size(){return h.size},ensure:function(d,_){clearTimeout(I),S=d;for(let k=d;k<_;k++)h.has(k)&&u(k);if(v<=0)return;const w=Math.max(0,d-r),g=Math.min(v,_+r),m=Math.floor(w/l),T=Math.floor(Math.max(0,g-1)/l);let L=-1;for(let k=m;k<=T;k++){const y=k*l,C=Math.min(l,v-y);let x=!1;const Yt=Math.max(y,w),Jt=Math.min(y+C,g);for(let j=Yt;j<Jt;j++)if(!h.has(j)){x=!0;break}if(x&&!p.has(y)){L=y;break}}L!==-1&&(I=setTimeout(function(){f(L,l)},c))},ingest:function(d){if(d=d||{},d.queryGen!=null&&d.queryGen!==E)return!1;const _=d.offset||0,w=d.data||[];let g=0;for(let m=0;m<w.length;m++)w[m]!=null&&g++;if(g===0&&(d.provisional||d.filtered>0))return p.delete(_),!1;n&&(h.clear(),o.clear(),n=!1),d.provisional||(A=d.total!=null?d.total:A,v=d.filtered!=null?d.filtered:d.data?d.data.length:v);for(let m=0;m<w.length;m++)w[m]!=null&&(h.set(_+m,w[m]),u(_+m));return p.delete(_),s(),a(),!0},requestInitial:function(d){d&&(q=d),f(0,l)},invalidate:function(d){E++,p.clear(),clearTimeout(I),d&&(q=d),n=!0,f(0,l)},revalidate:function(){E++,p.clear(),clearTimeout(I),n=!0;const d=Math.max(0,Math.floor(S/l)*l);f(d,l)},release:function(d){p.delete(d)},destroy:function(){clearTimeout(I),h.clear(),o.clear(),p.clear()},configure:function(d){d=d||{};let _=!1;if(d.windowSize!=null&&d.windowSize>0&&d.windowSize!==e){const w=d.windowSize<e;e=d.windowSize,w&&s(),_=!0}d.pageSize!=null&&d.pageSize>0&&(l=d.pageSize),d.threshold!=null&&d.threshold>=0&&(r=d.threshold),d.fetchDebounce!=null&&d.fetchDebounce>=0&&(c=d.fetchDebounce),_&&a()},setGrandTotal:function(d){d==null||isNaN(d)||d<0||(A=d,i()||(v=d),a())}}}function ht(t){return(t||"").replace(/^#/,"")}function $(t){const e=t===void 0?location.hash:t,l={},r=ht(e);if(!r)return l;const c=r.split("&");for(let b=0;b<c.length;b++){const a=c[b];if(!a)continue;const h=a.indexOf(":"),o=h>-1?a.slice(0,h):a,p=h>-1?a.slice(h+1):"";if(o)try{l[o]=decodeURIComponent(p)}catch{l[o]=p}}return l}function Pt(t){if(!t)return null;const e=$();return t in e?e[t]:null}function Vt(t,e){if(!t)return;const l=$();e==null?delete l[t]:l[t]=String(e);const c=Object.keys(l).map(function(b){const a=l[b];return a===""?b:b+":"+encodeURIComponent(a)}).join("&");ht(location.hash)!==c&&(location.hash=c)}function Bt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function zt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const l=t.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.trim();const r=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return r?e?r+"-"+e:r:e||null}function $t(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function jt(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 Ut(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function Gt(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const l=t.slice(0,e),r=t.slice(e+1),c=r?r.split(",").map(function(b){try{return decodeURIComponent(b)}catch{return b}}).filter(Boolean):[];return{key:l,values:c}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Pt,window.lnCore.hashSet=Vt,window.lnCore.hashLinkClick=Bt,window.lnCore.resolveHashNamespace=zt,window.lnCore.hashSortEncode=$t,window.lnCore.hashSortDecode=jt,window.lnCore.hashFilterEncode=Ut,window.lnCore.hashFilterDecode=Gt);function Kt(){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=Kt);function ft(t,e,l,r,c=15){if(r<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const b=Math.max(0,t||0),a=Math.max(0,e||0),h=Math.floor(b/l),o=Math.ceil(a/l),p=Math.max(0,h-c),v=Math.min(r,h+o+c),A=p*l,E=Math.max(0,(r-v)*l);return{start:p,end:v,topPadding:A,bottomPadding:E}}function Qt(t,e){const l=Array.isArray(t)?t.length:0,r=e instanceof Set?e:new Set(e||[]);let c=0;if(Array.isArray(t))for(let h=0;h<t.length;h++)r.has(t[h])&&c++;else c=r.size;const b=l>0&&c===l,a=c>0&&c<l;return{totalCount:l,selectedCount:c,isAllSelected:b,isIndeterminate:a}}function bt(t,e,l){const r=new Set(t);return e==null||((l!==void 0?l:!r.has(e))?r.add(e):r.delete(e)),r}function pt(t,e,l){const r=new Set(t);if(!Array.isArray(e))return r;if(l)for(let c=0;c<e.length;c++)e[c]!=null&&r.add(e[c]);else for(let c=0;c<e.length;c++)r.delete(e[c]);return r}(function(){const t="data-ln-table",e="lnTable",l="data-ln-table-empty";if(window[e]!==void 0)return;function o(n,u){if(!n||!n.isDataDriven)return;const i=n.dom.hasAttribute("data-ln-table-window");if(i&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!i&&n._windowed)n._exitWindowedMode();else if(i&&n._windowed){const s=parseInt(u,10);s>0&&n._cache.configure({windowSize:s})}}function p(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>0&&n._cache.configure({pageSize:i})}function v(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.configure({threshold:i})}function A(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.setGrandTotal(i)}const E={"data-ln-table":{prop:"name",type:"string",read:R,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:R,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:P,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:o,description:"Virtual scrolling window size in rows"},"data-ln-table-window-page":{type:"integer",fallback:200,min:5,effect:p,description:"Virtual scrolling slice page size"},"data-ln-table-window-threshold":{type:"integer",fallback:50,min:0,effect:v,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-table-count":{type:"integer",min:0,effect:A,description:"Total record count override for virtual scrollbar calculation"},"data-ln-table-row":{type:"marker",description:"Table row template element"},"data-ln-table-row-id":{type:"string",description:"Record identifier on row element"},"data-ln-table-row-action":{type:"trigger",description:"Action trigger inside a table row"},"data-ln-table-row-select":{type:"trigger",description:"Row selection checkbox trigger"},"data-ln-table-col":{type:"string",description:"Column header identifier or field mapping"},"data-ln-table-col-select":{type:"trigger",description:"Header select-all checkbox trigger"},"data-ln-table-cell-attr":{type:"string",description:"Cell attribute template mapping"},"data-ln-table-empty":{type:"marker",description:"Container for table empty state"},"data-ln-table-select-all-label":{type:"string",description:"Accessibility label for select-all header trigger"}},q=ot(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function I(n,u){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(vt(u)).format(n)}catch{return String(n)}}function F(n){let u=n.parentElement;for(;u&&u!==document.body&&u!==document.documentElement;){const s=getComputedStyle(u).overflowY;if(s==="auto"||s==="scroll")return u;u=u.parentElement}return null}function S(n){this.dom=n,rt(this,n,q),this.table=n.querySelector("table"),this.tbody=n.querySelector("[data-ln-table-body]")||n.querySelector("tbody"),this.thead=n.querySelector("thead");const u=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=u?Array.from(u.querySelectorAll("th")):[],this._totalSpan=n.querySelector("[data-ln-table-total]"),this._filteredSpan=n.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this.isDataDriven=n.hasAttribute("data-ln-table-source"),this._data=[],this._filteredData=[],this._searchTerm="",this._sortCol=-1,this._sortDir=null,this._columnFilters={},this.selectedIds=new Set,this._virtual=!1,this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._scrollContainer=null,this._colgroup=null;const i=this;return this._onSetSearch=function(s){const f=(s.detail&&s.detail.query!=null?s.detail.query:s.detail&&s.detail.term!=null?s.detail.term:"").trim();i.isDataDriven?(i.currentSearch=f,D(n,"ln-table:search",{table:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=f.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(s){s.preventDefault(),i._onSetSearch(s)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",D(n,"ln-table:clear-filters",{table:i.name}),i._requestData()):(i._searchTerm="",i._columnFilters={},i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table: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,this.isDataDriven&&n.hasAttribute("data-ln-table-window")&&this._enterWindowedMode(),this._onSetData=function(s){const f=s.detail||{},d=f.data||[],_=f.total!=null?f.total:d.length;if(!(i._hasInitialSeed&&!i.isLoaded&&d.length===0&&_===0)){if(i._windowed){i._cache.ingest(f)&&!f.provisional&&n.classList.remove("ln-table--loading");return}i._data=d,i._lastTotal=_,i._lastFiltered=f.filtered!=null?f.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-table--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),D(n,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(s){const f=s.detail&&s.detail.loading;n.classList.toggle("ln-table--loading",!!f),f&&(i.isLoaded=!1)},n.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(s){!i._windowed||!i._cache||i._cache.release(s.detail&&s.detail.offset)},n.addEventListener("ln-table:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this._onSort=function(s){!s.detail||s.detail.field==null||(s.preventDefault(),i.currentSort=s.detail.direction==="none"?null:{field:s.detail.field,direction:s.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._windowed&&this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden"),this._onRowClick=function(s){if(s.target.closest("[data-ln-table-row-select]")||s.target.closest("[data-ln-table-row-action]")||s.target.closest("a")||s.target.closest("button")||s.ctrlKey||s.metaKey||s.button===1)return;const f=s.target.closest("[data-ln-table-row]");if(!f)return;const d=f.getAttribute("data-ln-table-row-id"),_=f._lnRecord||{};D(n,"ln-table:row-click",{table:i.name,id:d,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(s){const f=s.target.closest("[data-ln-table-row-action]");if(!f)return;const d=f.closest("[data-ln-table-row]");if(!d)return;const _=f.getAttribute("data-ln-table-row-action"),w=d.getAttribute("data-ln-table-row-id"),g=d._lnRecord||{};D(n,"ln-table:row-action",{table:i.name,id:w,action:_,record:g})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),this._windowed?this._kickWindowInitial():D(n,"ln-table:request-data",{table:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){i.tbody.rows.length>0&&(i._emptyTbodyObserver.disconnect(),i._emptyTbodyObserver=null,i._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(s){if(!s.detail||s.detail.column==null)return;s.preventDefault();const f=s.detail.direction==="none"?null:s.detail.direction;i._sortCol=f===null?-1:s.detail.column,i._sortDir=f,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),D(n,"ln-table:sorted",{column:s.detail.column,direction:s.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(s){if(s.preventDefault(),!s.detail)return;const f=s.detail.key,d=s.detail.values||[];if(f){if(d.length===0)delete i._columnFilters[f];else{const _=[];for(let w=0;w<d.length;w++)_.push(d[w].toLowerCase());i._columnFilters[f]=_}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange)),this}S.prototype._parseRows=function(){const n=this.tbody.rows,u=this.ths;this._data=[],n.length>0&&(this._rowHeight=n[0].offsetHeight||40),this._lockColumnWidths();for(let i=0;i<n.length;i++){const s=n[i],f=[],d=[],_=[];for(let g=0;g<s.cells.length;g++){const m=s.cells[g],T=m.textContent.trim();f[g]=G(m),d[g]=T.toLowerCase(),m.querySelector("[data-ln-table-row-action]")||_.push(T.toLowerCase())}let w=null;if(this.isDataDriven){w={};const g=s.getAttribute("data-ln-table-row-id");g!=null&&(w.id=g);for(let m=0;m<u.length;m++){const T=u[m].getAttribute("data-ln-table-col");if(T){const L=m;if(L<s.cells.length){const k=s.cells[L];w[T]=G(k)}}}}this._data.push({values:f,rawTexts:d,html:s.outerHTML,searchText:_.join(" "),id:this.isDataDriven&&w?w.id:void 0,...w})}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-table:ready",{total:this._data.length})},S.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},S.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const n=document.createElement("colgroup");this.ths.forEach(function(u){const i=document.createElement("col");i.style.width=u.offsetWidth+"px",n.appendChild(i)}),this.table.insertBefore(n,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=n},S.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,u=this.visibleCount;if(n===0){this._disableVirtualScroll(),this._showEmptyState();return}if(this._filteredData.length===0||u===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._columnFilters).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):n>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},S.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,u=document.createDocumentFragment();for(let i=0;i<n.length;i++){const s=this._buildRow(n[i]);if(!s)break;u.appendChild(s)}this.tbody.replaceChildren(u),this._selectable&&this._updateSelectAll()}else{const n=[],u=this._filteredData;for(let i=0;i<u.length;i++)n.push(u[i].html);this.tbody.innerHTML=n.join(""),this._selectable&&this._restoreSelection()}},S.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let i=null;if(this._windowed){const s=this._cache?this._cache.peek():null;i=s?this._buildRow(s):this._buildPlaceholderRow()}else this.isDataDriven&&this._data.length>0&&(i=this._buildRow(this._data[0]));i&&this.tbody&&(this.tbody.appendChild(i),this._rowHeight=i.offsetHeight||40,i.remove())}this.isDataDriven?this._scrollContainer=F(this.dom):this._scrollContainer=null;const u=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},u.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},S.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),window.removeEventListener("resize",this._scrollHandler),this._scrollHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},S.prototype._renderVirtual=function(){const n=this._filteredData,u=n.length,i=this._rowHeight;if(!i||!u)return;const s=this.thead?this.thead.offsetHeight:0,f=this._scrollContainer;let d,_;if(f){const y=this.table.getBoundingClientRect(),C=f.getBoundingClientRect(),x=y.top-C.top+f.scrollTop+s;d=f.scrollTop-x,_=f.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+s;d=window.scrollY-x,_=window.innerHeight}const w=ft(d,_,i,u,15),g=w.start,m=w.end;if(g===this._vStart&&m===this._vEnd)return;this._vStart=g,this._vEnd=m;const T=this.ths.length||1,L=w.topPadding,k=w.bottomPadding;if(this.isDataDriven){const y=document.createDocumentFragment();if(L>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=L+"px",C.appendChild(x),y.appendChild(C)}for(let C=g;C<m;C++){const x=this._buildRow(n[C]);x&&y.appendChild(x)}if(k>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=k+"px",C.appendChild(x),y.appendChild(C)}this.tbody.replaceChildren(y),this._selectable&&this._updateSelectAll()}else{let y="";L>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+L+'px;padding:0;border:none"></td></tr>');for(let C=g;C<m;C++)y+=n[C].html;k>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+k+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=y,this._selectable&&this._restoreSelection()}},S.prototype._buildPlaceholderRow=function(){const n=document.createElement("tr");n.className="ln-table__placeholder",n.setAttribute("aria-hidden","true");const u=document.createElement("td");return u.setAttribute("colspan",this.ths.length||1),u.style.height=this._rowHeight+"px",n.appendChild(u),n},S.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._rowHeight;if(!n)return;const u=this._cache.logicalTotal,i=this.thead?this.thead.offsetHeight:0,s=this._scrollContainer;let f,d;if(s){const y=this.table.getBoundingClientRect(),C=s.getBoundingClientRect(),x=y.top-C.top+s.scrollTop+i;f=s.scrollTop-x,d=s.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+i;f=window.scrollY-x,d=window.innerHeight}const _=ft(f,d,n,u,15),w=_.start,g=_.end,m=this.ths.length||1,T=_.topPadding,L=_.bottomPadding,k=document.createDocumentFragment();if(T>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=T+"px",y.appendChild(C),k.appendChild(y)}for(let y=w;y<g;y++)if(this._cache.has(y)){const C=this._buildRow(this._cache.get(y));C&&k.appendChild(C)}else k.appendChild(this._buildPlaceholderRow());if(L>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=L+"px",y.appendChild(C),k.appendChild(y)}this.tbody.replaceChildren(k),this._vStart=w,this._vEnd=g,this._cache.ensure(w,g)},S.prototype._showEmptyState=function(){const n=this.ths.length||1;let u=null,i=null;if(this.isDataDriven){const s=this._lastTotal!=null?this._lastTotal:this._data.length,d=this.visibleCount===0&&s>0,_=d?this.name+"-empty-filtered":this.name+"-empty";if(i=J(this.dom,_,"ln-table"),!i){const w=this.dom.querySelector("template[data-ln-table-empty]");if(w){const g=d?"search":"initial",m=w.content.querySelector('[data-ln-table-empty-when="'+g+'"]')||w.content.firstElementChild;m&&(i=document.importNode(m,!0))}}if(i)if(i.tagName==="TR")u=i;else{const w=document.createElement("td");w.setAttribute("colspan",String(n)),w.appendChild(i);const g=document.createElement("tr");g.className="ln-table__empty",g.appendChild(w),u=g}}else{const s=this.dom.querySelector("template["+l+"]"),f=document.createElement("td");f.setAttribute("colspan",String(n)),s&&f.appendChild(document.importNode(s.content,!0));const d=document.createElement("tr");d.className="ln-table__empty",d.appendChild(f),u=d}u?this.tbody.replaceChildren(u):this.tbody.replaceChildren(),D(this.dom,"ln-table:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},S.prototype._fillRow=function(n,u){W(n,u);const i=n.querySelectorAll("[data-ln-table-cell-attr]");for(let s=0;s<i.length;s++){const f=i[s],d=f.getAttribute("data-ln-table-cell-attr").split(",");for(let _=0;_<d.length;_++){const w=d[_].trim().split(":");if(w.length!==2)continue;const g=w[0].trim(),m=w[1].trim();u[g]!=null&&f.setAttribute(m,u[g])}}},S.prototype._buildRow=function(n){let u=J(this.dom,this.name+"-row","ln-table");if(!u){const s=this.dom.querySelector("template[data-ln-table-row]");s&&(u=document.importNode(s.content,!0))}let i=u?u.querySelector("[data-ln-table-row]")||u.firstElementChild:null;if(i)this._fillRow(i,n);else if(n&&n.html){const s=document.createElement("tbody");s.innerHTML=n.html,i=s.firstElementChild}else{i=document.createElement("tr"),i.setAttribute("data-ln-table-row","");const s=this.ths;for(let f=0;f<s.length;f++){const d=s[f].hasAttribute("data-ln-table-col-select"),_=document.createElement("td");if(d){const w=document.createElement("input");w.type="checkbox",w.setAttribute("data-ln-table-row-select",""),w.setAttribute("aria-label","Select row"),_.appendChild(w)}else{const w=s[f].getAttribute("data-ln-table-col");w&&n[w]!=null&&(_.textContent=String(n[w]))}i.appendChild(_)}}if(i._lnRecord=n,n.id!=null&&i.setAttribute("data-ln-table-row-id",n.id),this._selectable&&n.id!=null&&this.selectedIds.has(String(n.id))){i.classList.add("ln-row-selected");const s=i.querySelector("[data-ln-table-row-select]");s&&(s.checked=!0)}return i},S.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-table--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}wt(this,"ln-table:request-data","table")},S.prototype._enterWindowedMode=function(){const n=this,u=this.dom,i=parseInt(u.getAttribute("data-ln-table-window"),10),s=parseInt(u.getAttribute("data-ln-table-window-page"),10),f=parseInt(u.getAttribute("data-ln-table-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(u,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=Mt(this._onCacheChange),this._cache=Wt({windowSize:i>0?i:1e3,pageSize:s>0?s:200,threshold:f>=0?f:25,fetchDebounce:120,requestPage:function(d,_,w){D(u,"ln-table:request-data",{table:n.name,sort:d.sort,filters:d.filters,search:d.search,offset:_,limit:w,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},S.prototype._kickWindowInitial=function(){if(this._data.length>0){let n=parseInt(this.dom.getAttribute("data-ln-table-count"),10);if(isNaN(n)&&this._totalSpan){const i=this._totalSpan.textContent.replace(/[^\d]/g,"");i&&(n=parseInt(i,10))}const u=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:u,filtered:u})}else this.dom.classList.add("ln-table--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},S.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._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-table--loading"),this._requestData()},S.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]"),u=[];for(let s=0;s<n.length;s++){const f=n[s].getAttribute("data-ln-table-row-id");f!=null&&u.push(f)}const i=Qt(u,this.selectedIds);this._selectAllCheckbox.checked=i.isAllSelected,this._selectAllCheckbox.indeterminate=i.isIndeterminate},S.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]");for(let u=0;u<n.length;u++){const i=n[u].getAttribute("data-ln-table-row-id"),s=i!=null&&this.selectedIds.has(i);n[u].classList.toggle("ln-row-selected",s);const f=n[u].querySelector("[data-ln-table-row-select]");f&&(f.checked=s)}this._updateSelectAll()},Object.defineProperty(S.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),S.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;if(this._onSelectionChange=function(u){const i=u.target.closest("[data-ln-table-row-select]");if(!i)return;const s=i.closest("[data-ln-table-row]");if(!s)return;const f=s.getAttribute("data-ln-table-row-id");f!=null&&(n.selectedIds=bt(n.selectedIds,f,i.checked),s.classList.toggle("ln-row-selected",i.checked),n.selectedCount=n.selectedIds.size,n._updateSelectAll(),n._updateFooter(),D(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}))},this.tbody&&this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector('[data-ln-table-col-select] input[type="checkbox"]')||this.dom.querySelector("[data-ln-table-col-select]"),this._selectAllCheckbox&&this._selectAllCheckbox.tagName==="TH"){const u=document.createElement("input");u.type="checkbox";const i=n.dom.querySelector('[data-ln-table-dict="select-all"]'),s=n.dom.getAttribute("data-ln-table-select-all-label")||(i?i.textContent.trim():null)||"Select all";u.setAttribute("aria-label",s),this._selectAllCheckbox.appendChild(u),this._selectAllCheckbox=u}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const u=n._selectAllCheckbox.checked,i=n.tbody?n.tbody.querySelectorAll("[data-ln-table-row]"):[],s=[];for(let f=0;f<i.length;f++){const d=i[f].getAttribute("data-ln-table-row-id"),_=i[f].querySelector("[data-ln-table-row-select]");d!=null&&(s.push(d),i[f].classList.toggle("ln-row-selected",u),_&&(_.checked=u))}n.selectedIds=pt(n.selectedIds,s,u),n.selectedCount=n.selectedIds.size,D(n.dom,"ln-table:select-all",{table:n.name,selected:u}),D(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){const s=u[i].querySelector("[data-ln-table-row-select]"),f=u[i].getAttribute("data-ln-table-row-id");s&&s.checked&&f!=null&&(n.selectedIds=bt(n.selectedIds,f,!0),u[i].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},S.prototype._disableSelection=function(){if(!this._selectableActive)return;this._selectableActive=!1,this.tbody&&this._onSelectionChange&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll);const n=this.dom.querySelector("[data-ln-table-col-select]");if(n){const u=n.querySelector('input[type="checkbox"]');u&&u.remove()}if(this._selectAllCheckbox=null,this.selectedIds=pt(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){u[i].classList.remove("ln-row-selected");const s=u[i].querySelector("[data-ln-table-row-select]");s&&(s.checked=!1)}}this._updateFooter()},S.prototype._updateFooter=function(){let n=0,u=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,u=this.visibleCount):(n=this._data.length,u=this._filteredData.length);const i=u<n;if(this._totalSpan&&(this._totalSpan.textContent=I(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=i?I(u,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!i),this._selectedSpan){const s=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=s>0?I(s,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",s===0)}},S.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-table:set-search",this._onSetSearch),this.dom.removeEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this.dom.removeEventListener("ln-table:set-data",this._onSetData),this.dom.removeEventListener("ln-table:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-table:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onRowClick),this.tbody.removeEventListener("click",this._onRowAction)),this._cache&&this._cache.destroy()):(this._emptyTbodyObserver&&(this._emptyTbodyObserver.disconnect(),this._emptyTbodyObserver=null),this.dom.removeEventListener("ln-sort:change",this._onSort),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-filter:change",this._onFilterChange)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._colgroup&&(this._colgroup.remove(),this._colgroup=null),this.table&&(this.table.style.tableLayout=""),this._data=[],this._filteredData=[],delete this.dom[e])},ut(t,e,S,"ln-table",{attributes:E})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function N(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function x(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!x(o))return}e.apply(console,t)}}function $(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function G(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Y(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,l={},a=e.elements,i={};if(n)for(let s=0;s<a.length;s++){const r=a[s];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let s=0;s<a.length;s++){const r=a[s];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&i[r.name]===1?l[r.name]=r.checked:(l[r.name]||(l[r.name]=[]),r.checked&&l[r.name].push(r.value));else if(r.type==="radio")r.checked&&(l[r.name]=r.value);else if(r.type==="select-multiple"){l[r.name]=[];for(let c=0;c<r.options.length;c++)r.options[c].selected&&l[r.name].push(r.options[c].value)}else if(n&&r.type==="hidden")l[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const c=Number(r.value);l[r.name]=r.value===""||isNaN(c)?null:c}else l[r.name]=r.value}return l}function Z(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ee(e,t){const n=e.elements,o=[],l={};for(let a=0;a<n.length;a++){const i=n[a];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let a=0;a<n.length;a++){const i=n[a];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const s=i.getAttribute("data-ln-fill-as")||i.name;if(!s||!(s in t))continue;const r=t[s];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(l[i.name]>1){const c=String(r).split(",").map(function(u){return u.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=Z(r);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let c=0;c<i.options.length;c++)i.options[c].selected=r.indexOf(i.options[c].value)!==-1;o.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ee,window.lnCore.serializeForm=Y,window.lnCore.resolveFormMethod=G);const D={};function te(e,t){D[e]=t}function ne(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=te,window.lnCore.getDataMapper=ne);function re(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){$(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function oe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];F[n]=t}function ie(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return F[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=oe,window.lnCore.getLocaleFallback=ie,window.lnCore.ensureLocaleObserver=re);const k={};function le(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=k[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function B(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const s=n[i],r=s.getAttribute("data-ln-field");t[r]!=null&&(s.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const s=o[i],r=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<r.length;c++){const u=r[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const s=l[i],r=s.getAttribute("data-ln-show");r in t&&s.classList.toggle("hidden",!t[r])}const a=e.querySelectorAll("[data-ln-class]");for(let i=0;i<a.length;i++){const s=a[i],r=s.getAttribute("data-ln-class").split(",");for(let c=0;c<r.length;c++){const u=r[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)B(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(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(i,s){return t[s]!==void 0?t[s]:""}))}const o=function(a,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const i=l[a],s=i.attributes;for(let r=0;r<s.length;r++){const c=s[r];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function se(e,t,n,o,l,a){const i={};for(let r=0;r<e.children.length;r++){const c=e.children[r],u=c.getAttribute("data-ln-render-key");u&&(i[u]=c)}const s=document.createDocumentFragment();for(let r=0;r<t.length;r++){const c=t[r],u=String(o(c));let d=i[u];if(d)l(d,c,r);else{const f=le(n,a);if(!f||(R(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,c,r)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=B,window.lnCore.lnFill=ae,window.lnCore.renderList=se);function _(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function M(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function j(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const l=o.trim().toLowerCase();return!(l==="false"||l==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const E=new Map;function U(e,t){const n=(e?e.join("|"):"")+"::"+t;if(E.has(n))return E.get(n);const o=new Set(e||[]),l=function(a,i){const s=a.getAttribute(i);return s!==null&&o.has(s)?s:t};return E.set(n,l),l}function V(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function H(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function K(e,t,n,o,l){if(!e||t===null)return!0;const a=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const s=r=>{l?console.warn(r,l):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(s(`[${a}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(s(`[${a}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return s(`[${a}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function ce(e,t,n){for(const o in n){const[l,a,i]=n[o];Object.defineProperty(e,o,{get:function(){return l(t,a,i)},enumerable:!0,configurable:!0})}return e}function ue(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=U(o.values,o.fallback);break;case"integer":l=M;break;case"float":l=V;break;case"boolean":l=j;break;case"list":l=W;break;case"json":l=H;break;case"string":default:l=_;break}l||(l=_),t[o.prop]=[l,n,o.fallback]}return t}function de(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function fe(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=ce,window.lnCore.attrSpec=ue,window.lnCore.attrStr=_,window.lnCore.attrInt=M,window.lnCore.attrBool=j,window.lnCore.attrList=W,window.lnCore.attrEnum=U,window.lnCore.attrFloat=V,window.lnCore.attrJson=H);function O(e,t,n,o){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&i.push(e);for(const s of i)if(!s[n]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[n]=new o(s)}catch(r){console.error("["+n+"] init failed",s,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function we(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(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 P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function he(e){const t=P(),n=e.observed||[];for(let o=0;o<n.length;o++){const l=n[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=fe(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,n,o){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const i=a.effects&&a.effects[n];i?i(t,n,o):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,o)}}function pe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=P(),l=o.byAttr.get(n);if(N()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&x(t)){const a=o.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let s=0;s<a.length;s++)K(a[s].spec,i,n,a[s].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const a=o.byReactive.get(n);a&&J(a,t,n,e.oldValue),o.reactiveWildcard.length&&J(o.reactiveWildcard,t,n,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const i=l[a];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(O(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function ge(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{pe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function Q(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function me(e){const t=Q();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const l=o.query,a=e.target.nodeType===1?e.target.matches(l)?e.target:e.target.closest(l):e.target.parentElement?e.target.parentElement.closest(l):null;a&&o.onSubtreeChange(a,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l];O(o,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let l=0;l<t.length;l++){const a=t[l],i=a.query,s=Array.from(o.querySelectorAll(i));o.matches&&o.matches(i)&&s.push(o);for(let r=0;r<s.length;r++){const c=s[r];if(!document.contains(c)){const u=c[a.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+a.attribute+"] destroy failed",c,d)}delete c[a.attribute]}}}}}}function ye(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{me(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function X(e,t,n,o,l={}){const a=l.extraAttributes||[],i=l.onAttributeChange||null,s=l.onSubtreeChange||null,r=l.onInit||null,c=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?de(d):u,m=d?new Set(Object.keys(d)):null,h=l.persist||null;function w(A){const g=A||document.body;if(O(g,e,t,n),d&&N())for(const v in d){const Te=d[v],q=Array.from(g.querySelectorAll("["+v+"]"));g.matches&&g.matches("["+v+"]")&&q.push(g);for(let L=0;L<q.length;L++){const I=q[L];x(I)&&K(Te,I.getAttribute(v),v,o,I)}}r&&r(g)}const y=[];if(e.indexOf("[")!==-1){const A=/\[([\w-]+)/g;let g;for(;(g=A.exec(e))!==null;)y.push(g[1])}else y.push(e);he({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:r,observed:y.concat(a),onAttributeChange:i,onAttrChange:c,effects:f,declared:m,persist:h}),ge();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";Q().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:s,query:b}),ye(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X);function p(){we()>0?be(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p):p(),w}function z(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,n={},o=z(t);if(!o)return n;const l=o.split("&");for(let a=0;a<l.length;a++){const i=l[a];if(!i)continue;const s=i.indexOf(":"),r=s>-1?i.slice(0,s):i,c=s>-1?i.slice(s+1):"";if(r)try{n[r]=decodeURIComponent(c)}catch{n[r]=c}}return n}function Ce(e){if(!e)return null;const t=T();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const n=T();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(a){const i=n[a];return i===""?a:a+":"+encodeURIComponent(i)}).join("&");z(location.hash)!==l&&(location.hash=l)}function ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Se(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function xe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ke(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 _e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ee(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Ce,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=ve,window.lnCore.resolveHashNamespace=Se,window.lnCore.hashSortEncode=xe,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=Ee);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe),(function(){const e="data-ln-table-coordinator",t="lnTableCoordinator";if(window[t]!==void 0)return;const n={"data-ln-table-coordinator":{type:"marker",description:"Mounts table coordinator mediating between table, search, filter, and pagination"}};document.addEventListener("keydown",function(s){if(s.key!=="/"||s.defaultPrevented||document.activeElement&&(document.activeElement.tagName==="INPUT"||document.activeElement.tagName==="TEXTAREA"||document.activeElement.isContentEditable))return;const r=document.querySelector("["+e+"] [data-ln-search-for]")||document.querySelector("[data-ln-search-for]");if(!r)return;const c=r.tagName==="INPUT"||r.tagName==="TEXTAREA"?r:r.querySelector('input[type="search"], input[type="text"], input');c&&(s.preventDefault(),c.focus())});function o(s){return this.dom=s,i(this),this}function l(s,r){const c=r?'[data-ln-search-for="'+r+'"]':"[data-ln-search-for]",u=s.querySelector(c)||document.querySelector(c);return u?u.tagName==="INPUT"||u.tagName==="TEXTAREA"?u:u.querySelector("input, textarea"):null}function a(s,r){if(r){const u=s.querySelectorAll('[data-ln-filter="'+r+'"]');if(u.length>0)return u;const d=document.querySelectorAll('[data-ln-filter="'+r+'"]');if(d.length>0)return d}const c=s.querySelectorAll("[data-ln-filter]");return c.length>0?c:document.querySelectorAll("[data-ln-filter]")}function i(s){const r=s.dom;function c(u){const d=u.target;if(d&&d.hasAttribute&&(d.hasAttribute("data-ln-table")||d.tagName==="TABLE"))return d;const f=u.detail&&u.detail.targetId||d&&d.id;if(!f)return null;const m=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(f):f.replace(/(["\\])/g,"\\$1");return r.querySelector('[data-ln-table-source="'+m+'"]')||r.querySelector('[data-ln-table="'+m+'"]')||(r.id===f?r:null)||document.getElementById(f)}s._handlers={filter:function(u){if(!u.detail)return;const d=c(u);if(!d)return;const f=u.detail.key,m=u.detail.values||[],h=d.querySelectorAll("th");for(let w=0;w<h.length;w++)if((h[w].getAttribute("data-ln-table-filter-col")||h[w].getAttribute("data-ln-filter-col")||h[w].getAttribute("data-ln-filter-key")||h[w].getAttribute("data-ln-field"))===f){const C=h[w].querySelector("[data-ln-table-col-filter], .table-filter");C&&C.classList.toggle("ln-filter-active",m.length>0);break}},clear:function(u){const d=u.target.closest("[data-ln-table-clear], [data-ln-table-clear-all]");if(!d)return;const f=d.closest("[data-ln-table], table")||r.querySelector("[data-ln-table], table");if(!f)return;const m=f.lnTable&&f.lnTable.name||f.id,h=f.querySelectorAll("th");for(let b=0;b<h.length;b++){const p=h[b].querySelector("[data-ln-table-col-filter], .table-filter");p&&p.classList.remove("ln-filter-active")}const w=f.getAttribute("data-ln-table-source")||f.id,y=w?document.getElementById(w):null;if(y&&y.hasAttribute("data-ln-search"))y.setAttribute("data-ln-search","");else{const b=l(r,w);b&&b.value!==""&&(b.value="",b.dispatchEvent(new Event("input",{bubbles:!0})))}const C=a(r,w);for(let b=0;b<C.length;b++){const p=C[b].querySelector("[data-ln-filter-reset]");if(!p)continue;const A=C[b].querySelectorAll("input:not([data-ln-filter-reset]):checked").length>0;(!p.checked||A)&&(p.checked=!0,p.dispatchEvent(new Event("change",{bubbles:!0})))}f.lnTable&&!f.hasAttribute("data-ln-table-source")&&$(f,"ln-table:request-clear-filters",{table:m})}},r.addEventListener("ln-filter:change",s._handlers.filter),r.addEventListener("click",s._handlers.clear)}o.prototype.destroy=function(){this.dom[t]&&(this._handlers&&(this.dom.removeEventListener("ln-filter:change",this._handlers.filter),this.dom.removeEventListener("click",this._handlers.clear),this._handlers=null),delete this.dom[t])},X(e,t,o,"ln-table-coordinator",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function F(){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 k(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 l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!k(r))return}e.apply(console,t)}}function $(e,t,o){const r=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function x(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){x(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ee(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function te(e,t){const o=!!(t&&t.typed),r=t&&t.exclude,l={},s=e.elements,i={};if(o)for(let a=0;a<s.length;a++){const n=s[a];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let a=0;a<s.length;a++){const n=s[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")o&&i[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&l[n.name].push(n.options[c].value)}else if(o&&n.type==="hidden")l[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const c=Number(n.value);l[n.name]=n.value===""||isNaN(c)?null:c}else l[n.name]=n.value}return l}function ne(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function re(e,t){const o=e.elements,r=[],l={};for(let s=0;s<o.length;s++){const i=o[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<o.length;s++){const i=o[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const n=t[a];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(l[i.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=ne(n);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<i.options.length;c++)i.options[c].selected=n.indexOf(i.options[c].value)!==-1;r.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=re,window.lnCore.serializeForm=te,window.lnCore.resolveFormMethod=ee);const B={};function oe(e,t){B[e]=t}function ie(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=ie);function le(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,x(function(){new MutationObserver(function(){$(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function ae(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];R[o]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=le);const _={};function ce(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=_[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let i=0;i<o.length;i++){const a=o[i],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],n=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const u=n[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&a.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const a=l[i],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],n=a.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const u=n[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&a.classList.toggle(d,!!t[f])}}return e}function ue(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 o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<o.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[r],t??null),o[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)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function j(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const s=o.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,a){return t[a]!==void 0?t[a]:""}))}const r=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],a=i.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function de(e,t,o,r,l,s){const i={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(i[u]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(r(c));let d=i[u];if(d)l(d,c,n);else{const f=ce(o,s);if(!f||(j(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,c,n)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=M,window.lnCore.lnFill=ue,window.lnCore.renderList=de);function E(e,t,o){const r=e.getAttribute(t);return r===null?o:r}function W(e,t,o){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?o:r}function U(e,t,o=!1){const r=e.getAttribute(t);if(r===null)return!!o;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const q=new Map;function H(e,t){const o=(e?e.join("|"):"")+"::"+t;if(q.has(o))return q.get(o);const r=new Set(e||[]),l=function(s,i){const a=s.getAttribute(i);return a!==null&&r.has(a)?a:t};return q.set(o,l),l}function K(e,t,o){const r=parseFloat(e.getAttribute(t));return isNaN(r)?o:r}function P(e,t,o){const r=e.getAttribute(t);if(!r)return o;try{return JSON.parse(r)}catch{return o}}function Q(e,t,o,r,l){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=n=>{l?console.warn(n,l):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function fe(e,t,o){for(const r in o){const[l,s,i]=o[r];Object.defineProperty(e,r,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function we(e){const t={};for(const o in e){const r=e[o];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=H(r.values,r.fallback);break;case"integer":l=W;break;case"float":l=K;break;case"boolean":l=U;break;case"list":l=V;break;case"json":l=P;break;case"string":default:l=E;break}l||(l=E),t[r.prop]=[l,o,r.fallback]}return t}function he(e){const t={};for(const o in e){const r=e[o];r&&r.effect&&(t[o]=r.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=fe,window.lnCore.attrSpec=we,window.lnCore.attrStr=E,window.lnCore.attrInt=W,window.lnCore.attrBool=U,window.lnCore.attrList=V,window.lnCore.attrEnum=H,window.lnCore.attrFloat=K,window.lnCore.attrJson=P);function A(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function J(e,t,o,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:o,ComponentFn:r};if(e.matches&&e.matches(s)&&A(e,i),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)A(a[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ge(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 X(){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 me(e){const t=X(),o=e.observed||[];for(let r=0;r<o.length;r++){const l=o[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=be(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function z(e,t,o,r){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[o];i?i(t,o,r):s.onAttrChange&&(!s.declared||s.declared.has(o))&&s.onAttrChange(t,o,r)}}function ye(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,r=X(),l=r.byAttr.get(t),s=F()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!o&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&k(i)){const a=r.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let c=0;c<a.length;c++)Q(a[c].spec,n,t,a[c].componentTag,i)}if(window.lnCore._debugSink&&(o||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),o){const a=r.byReactive.get(t);a&&z(a,i,t,e.oldValue),r.reactiveWildcard.length&&z(r.reactiveWildcard,i,t,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const n=l[a];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(J(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,x(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{ye(t[o])}catch(r){console.error("[ln-core] mutation handler failed",t[o].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function L(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function O(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ae(e){const t=L();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const r=t[o];if(r.onSubtreeChange&&r.query){const l=r.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;s&&r.onSubtreeChange(s,e)}}for(let o=0;o<e.addedNodes.length;o++){const r=e.addedNodes[o];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let s=0;s<t.length;s++){const i=t[s];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)r.matches&&r.matches(i.query)&&A(r,i);else if(r.matches&&r.matches(i.query)&&A(r,i),r.querySelectorAll){const a=r.querySelectorAll(i.query);for(let n=0;n<a.length;n++)A(a[n],i)}}i.onInit&&i.onInit(r)}}}for(let o=0;o<e.removedNodes.length;o++){const r=e.removedNodes[o];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let s=0;s<t.length;s++){const i=t[s],a=i.query;if(a){if(!l)r.matches&&r.matches(a)&&O(r,i);else if(r.matches&&r.matches(a)&&O(r,i),r.querySelectorAll){const n=r.querySelectorAll(a);for(let c=0;c<n.length;c++)O(n[c],i)}}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,x(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const r=t[o];if(r.type==="childList")try{Ae(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ve(e){L().push(e),G()}function Y(e,t,o,r,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,a=l.onSubtreeChange||null,n=l.onInit||null,c=l.onAttrChange||null,u=l.effects||null,d=l.attributes||null,f=d?he(d):u,m=d?new Set(Object.keys(d)):null,b=l.persist||null;function w(v){const g=v||document.body;if(J(g,e,t,o),d&&F())for(const S in d){const Ie=d[S],I=Array.from(g.querySelectorAll("["+S+"]"));g.matches&&g.matches("["+S+"]")&&I.push(g);for(let D=0;D<I.length;D++){const N=I[D];k(N)&&Q(Ie,N.getAttribute(S),S,r,N)}}n&&n(g)}const y=[];if(e.indexOf("[")!==-1){const v=/\[([\w-]+)/g;let g;for(;(g=v.exec(e))!==null;)y.push(g[1])}else y.push(e);me({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:o,onInit:n,observed:y.concat(s),onAttributeChange:i,onAttrChange:c,effects:f,declared:m,persist:b}),Ce();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,h=l.subtreeQuery||(C?e:"["+e+"]");L().push({selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:a,query:h}),G(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=ve);function p(){pe()>0?ge(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p):p(),w}function Z(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,o={},r=Z(t);if(!r)return o;const l=r.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const a=i.indexOf(":"),n=a>-1?i.slice(0,a):i,c=a>-1?i.slice(a+1):"";if(n)try{o[n]=decodeURIComponent(c)}catch{o[n]=c}}return o}function Se(e){if(!e)return null;const t=T();return e in t?t[e]:null}function xe(e,t){if(!e)return;const o=T();t==null?delete o[e]:o[e]=String(t);const l=Object.keys(o).map(function(s){const i=o[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Z(location.hash)!==l&&(location.hash=l)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function _e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.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 Ee(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 Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:o,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=Se,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=Oe);function Te(){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=Te),(function(){const e="data-ln-table-coordinator",t="lnTableCoordinator";if(window[t]!==void 0)return;const o={"data-ln-table-coordinator":{type:"marker",description:"Mounts table coordinator mediating between table, search, filter, and pagination"}};document.addEventListener("keydown",function(a){if(a.key!=="/"||a.defaultPrevented||document.activeElement&&(document.activeElement.tagName==="INPUT"||document.activeElement.tagName==="TEXTAREA"||document.activeElement.isContentEditable))return;const n=document.querySelector("["+e+"] [data-ln-search-for]")||document.querySelector("[data-ln-search-for]");if(!n)return;const c=n.tagName==="INPUT"||n.tagName==="TEXTAREA"?n:n.querySelector('input[type="search"], input[type="text"], input');c&&(a.preventDefault(),c.focus())});function r(a){return this.dom=a,i(this),this}function l(a,n){const c=n?'[data-ln-search-for="'+n+'"]':"[data-ln-search-for]",u=a.querySelector(c)||document.querySelector(c);return u?u.tagName==="INPUT"||u.tagName==="TEXTAREA"?u:u.querySelector("input, textarea"):null}function s(a,n){if(n){const u=a.querySelectorAll('[data-ln-filter="'+n+'"]');if(u.length>0)return u;const d=document.querySelectorAll('[data-ln-filter="'+n+'"]');if(d.length>0)return d}const c=a.querySelectorAll("[data-ln-filter]");return c.length>0?c:document.querySelectorAll("[data-ln-filter]")}function i(a){const n=a.dom;function c(u){const d=u.target;if(d&&d.hasAttribute&&(d.hasAttribute("data-ln-table")||d.tagName==="TABLE"))return d;const f=u.detail&&u.detail.targetId||d&&d.id;if(!f)return null;const m=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(f):f.replace(/(["\\])/g,"\\$1");return n.querySelector('[data-ln-table-source="'+m+'"]')||n.querySelector('[data-ln-table="'+m+'"]')||(n.id===f?n:null)||document.getElementById(f)}a._handlers={filter:function(u){if(!u.detail)return;const d=c(u);if(!d)return;const f=u.detail.key,m=u.detail.values||[],b=d.querySelectorAll("th");for(let w=0;w<b.length;w++)if((b[w].getAttribute("data-ln-table-filter-col")||b[w].getAttribute("data-ln-filter-col")||b[w].getAttribute("data-ln-filter-key")||b[w].getAttribute("data-ln-field"))===f){const C=b[w].querySelector("[data-ln-table-col-filter], .table-filter");C&&C.classList.toggle("ln-filter-active",m.length>0);break}},clear:function(u){const d=u.target.closest("[data-ln-table-clear], [data-ln-table-clear-all]");if(!d)return;const f=d.closest("[data-ln-table], table")||n.querySelector("[data-ln-table], table");if(!f)return;const m=f.lnTable&&f.lnTable.name||f.id,b=f.querySelectorAll("th");for(let h=0;h<b.length;h++){const p=b[h].querySelector("[data-ln-table-col-filter], .table-filter");p&&p.classList.remove("ln-filter-active")}const w=f.getAttribute("data-ln-table-source")||f.id,y=w?document.getElementById(w):null;if(y&&y.hasAttribute("data-ln-search"))y.setAttribute("data-ln-search","");else{const h=l(n,w);h&&h.value!==""&&(h.value="",h.dispatchEvent(new Event("input",{bubbles:!0})))}const C=s(n,w);for(let h=0;h<C.length;h++){const p=C[h].querySelector("[data-ln-filter-reset]");if(!p)continue;const v=C[h].querySelectorAll("input:not([data-ln-filter-reset]):checked").length>0;(!p.checked||v)&&(p.checked=!0,p.dispatchEvent(new Event("change",{bubbles:!0})))}f.lnTable&&!f.hasAttribute("data-ln-table-source")&&$(f,"ln-table:request-clear-filters",{table:m})}},n.addEventListener("ln-filter:change",a._handlers.filter),n.addEventListener("click",a._handlers.clear)}r.prototype.destroy=function(){this.dom[t]&&(this._handlers&&(this.dom.removeEventListener("ln-filter:change",this._handlers.filter),this.dom.removeEventListener("click",this._handlers.clear),this._handlers=null),delete this.dom[t])},Y(e,t,r,"ln-table-coordinator",{attributes:o})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function F(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!A(o))return}e.apply(console,t)}}function q(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function re(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ie(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},a=e.elements,s={};if(n)for(let c=0;c<a.length;c++){const r=a[c];r.name&&r.type==="checkbox"&&!r.disabled&&(s[r.name]=(s[r.name]||0)+1)}for(let c=0;c<a.length;c++){const r=a[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&s[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let l=0;l<r.options.length;l++)r.options[l].selected&&i[r.name].push(r.options[l].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const l=Number(r.value);i[r.name]=r.value===""||isNaN(l)?null:l}else i[r.name]=r.value}return i}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ae(e,t){const n=e.elements,o=[],i={};for(let a=0;a<n.length;a++){const s=n[a];s.name&&s.type==="checkbox"&&(i[s.name]=(i[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 c=s.getAttribute("data-ln-fill-as")||s.name;if(!c||!(c in t))continue;const r=t[c];if(s.type==="checkbox"){if(Array.isArray(r))s.checked=r.indexOf(s.value)!==-1;else if(i[s.name]>1){const l=String(r).split(",").map(function(u){return u.trim()});s.checked=l.indexOf(s.value)!==-1}else s.checked=se(r);o.push(s)}else if(s.type==="radio")s.checked=s.value===String(r),o.push(s);else if(s.type==="select-multiple"){if(Array.isArray(r))for(let l=0;l<s.options.length;l++)s.options[l].selected=r.indexOf(s.options[l].value)!==-1;o.push(s)}else s.value=r,s.tagName==="SELECT"&&r!=null&&s.setAttribute("data-ln-value",r),o.push(s)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ae,window.lnCore.serializeForm=ie,window.lnCore.resolveFormMethod=oe);const D={};function le(e,t){D[e]=t}function ce(e){return D[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=ce);function de(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const I={};function ue(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];I[n]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return I[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=de);const v={};function he(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const c=n[s],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<o.length;s++){const c=o[s],r=c.getAttribute("data-ln-attr").split(",");for(let l=0;l<r.length;l++){const u=r[l].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const c=i[s],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const a=e.querySelectorAll("[data-ln-class]");for(let s=0;s<a.length;s++){const c=a[s],r=c.getAttribute("data-ln-class").split(",");for(let l=0;l<r.length;l++){const u=r[l].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function R(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,c){return t[c]!==void 0?t[c]:""}))}const o=function(a,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let a=0;a<i.length;a++){const s=i[a],c=s.attributes;for(let r=0;r<c.length;r++){const l=c[r];l.value.indexOf("{{")!==-1&&s.setAttribute(l.name,l.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function be(e,t,n,o,i,a){const s={};for(let r=0;r<e.children.length;r++){const l=e.children[r],u=l.getAttribute("data-ln-render-key");u&&(s[u]=l)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const l=t[r],u=String(o(l));let d=s[u];if(d)i(d,l,r);else{const f=he(n,a);if(!f||(R(f,l),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,l,r)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=$,window.lnCore.lnFill=we,window.lnCore.renderList=be);function k(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function M(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function x(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const _=new Map;function B(e,t){const n=(e?e.join("|"):"")+"::"+t;if(_.has(n))return _.get(n);const o=new Set(e||[]),i=function(a,s){const c=a.getAttribute(s);return c!==null&&o.has(c)?c:t};return _.set(n,i),i}function H(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function W(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function U(e,t,n,o,i){if(!e||t===null)return!0;const a=o||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const c=r=>{i?console.warn(r,i):console.warn(r)};if(s==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return c(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${a}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${a}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(c(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${a}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function P(e,t,n){for(const o in n){const[i,a,s]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,a,s)},enumerable:!0,configurable:!0})}return e}function V(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=B(o.values,o.fallback);break;case"integer":i=M;break;case"float":i=H;break;case"boolean":i=x;break;case"list":i=j;break;case"json":i=W;break;case"string":default:i=k;break}i||(i=k),t[o.prop]=[i,n,o.fallback]}return t}function pe(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function ge(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=P,window.lnCore.attrSpec=V,window.lnCore.attrStr=k,window.lnCore.attrInt=M,window.lnCore.attrBool=x,window.lnCore.attrList=j,window.lnCore.attrEnum=B,window.lnCore.attrFloat=H,window.lnCore.attrJson=W);function S(e,t,n,o){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&s.push(e);for(const c of s)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new o(c)}catch(r){console.error("["+n+"] init failed",c,r)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ye(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function z(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ce(e){const t=z(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(a=>a.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ge(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function J(e,t,n,o){for(let i=0;i<e.length;i++){const a=e[i];if(!t[a.attribute])continue;const s=a.effects&&a.effects[n];s?s(t,n,o):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,o)}}function Ae(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const o=z(),i=o.byAttr.get(n);if(F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(n)&&A(t)){const a=o.byDeclaredAttr.get(n),s=t.getAttribute(n);for(let c=0;c<a.length;c++)U(a[c].spec,s,n,a[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||i)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const a=o.byReactive.get(n);a&&J(a,t,n,e.oldValue),o.reactiveWildcard.length&&J(o.reactiveWildcard,t,n,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const s=i[a];if(s.handler){s.handler(t,n,e.oldValue);continue}s.onAttributeChange&&t[s.attribute]?s.onAttributeChange(t,n):(S(t,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(t))}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ae(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function Q(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function ke(e){const t=Q();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const o=t[n];if(o.onSubtreeChange){const i=o.query,a=e.target.nodeType===1?e.target.matches(i)?e.target:e.target.closest(i):e.target.parentElement?e.target.parentElement.closest(i):null;a&&o.onSubtreeChange(a,e)}}for(let n=0;n<e.addedNodes.length;n++){const o=e.addedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const a=t[i];S(o,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(o)}}for(let n=0;n<e.removedNodes.length;n++){const o=e.removedNodes[n];if(o.nodeType===1)for(let i=0;i<t.length;i++){const a=t[i],s=a.query,c=Array.from(o.querySelectorAll(s));o.matches&&o.matches(s)&&c.push(o);for(let r=0;r<c.length;r++){const l=c[r];if(!document.contains(l)){const u=l[a.attribute];if(u&&typeof u.destroy=="function")try{u.destroy()}catch(d){console.error("["+a.attribute+"] destroy failed",l,d)}delete l[a.attribute]}}}}}}function xe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ke(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function G(e,t,n,o,i={}){const a=i.extraAttributes||[],s=i.onAttributeChange||null,c=i.onSubtreeChange||null,r=i.onInit||null,l=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?pe(d):u,h=d?new Set(Object.keys(d)):null,C=i.persist||null;function w(T){const b=T||document.body;if(S(b,e,t,n),d&&F())for(const g in d){const Ne=d[g],O=Array.from(b.querySelectorAll("["+g+"]"));b.matches&&b.matches("["+g+"]")&&O.push(b);for(let K=0;K<O.length;K++){const N=O[K];A(N)&&U(Ne,N.getAttribute(g),g,o,N)}}r&&r(b)}const E=[];if(e.indexOf("[")!==-1){const T=/\[([\w-]+)/g;let b;for(;(b=T.exec(e))!==null;)E.push(b[1])}else E.push(e);Ce({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:r,observed:E.concat(a),onAttributeChange:s,onAttrChange:l,effects:f,declared:h,persist:C}),ve();const Ke=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]";Q().push({selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:Ke}),xe(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=G);function ne(){me()>0?ye(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),w}function X(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,n={},o=X(t);if(!o)return n;const i=o.split("&");for(let a=0;a<i.length;a++){const s=i[a];if(!s)continue;const c=s.indexOf(":"),r=c>-1?s.slice(0,c):s,l=c>-1?s.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(l)}catch{n[r]=l}}return n}function p(e){if(!e)return null;const t=L();return e in t?t[e]:null}function y(e,t){if(!e)return;const n=L();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(a){const s=n[a];return s===""?a:a+":"+encodeURIComponent(s)}).join("&");X(location.hash)!==i&&(location.hash=i)}function Y(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function _e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Le(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 Ee(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Te(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=p,window.lnCore.hashSet=y,window.lnCore.hashLinkClick=Y,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Te);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe);function Z(e,t,n,o){const i=(e||"").toLowerCase().trim();if(i)return i;if((t||"").toUpperCase()!=="A")return"";const a=n||"";if(!a.startsWith("#"))return"";const s=a.slice(1);if(!s)return"";const c=s.split("&"),r=(o||"").toLowerCase().trim();if(r)for(const d of c){const f=d.indexOf(":");if(f>0&&d.slice(0,f).toLowerCase().trim()===r)return d.slice(f+1).toLowerCase().trim()}const l=c[c.length-1]||"",u=l.indexOf(":");return(u>0?l.slice(u+1):l).toLowerCase().trim()}function ee(e,t){if(!Array.isArray(e)||e.length===0)return{hashEnabled:!1,warning:null};const n=e.filter(a=>(a.tagName||"").toUpperCase()==="A"&&(a.href||"").startsWith("#")),o=n.length>0&&n.length===e.length,i=(t||"").toLowerCase().trim();return n.length>0&&n.length!==e.length?{hashEnabled:!1,warning:"mixed"}:o&&!i?{hashEnabled:!1,warning:"missing-namespace"}:{hashEnabled:o&&!!i,warning:null}}function te(e,t,n){const o=(e||"").toLowerCase().trim();return o&&Array.isArray(t)&&t.includes(o)?o:(n||"").toLowerCase().trim()}(function(){const e="data-ln-tabs",t="lnTabs";if(window[t]!==void 0&&window[t]!==null)return;function n(r){const l=r.getAttribute("data-ln-tabs-active");r[t]&&r[t]._applyActive(l)}function o(r,l){return(r.getAttribute(l)||r.id||"").toLowerCase().trim()}const i={"data-ln-tabs":{type:"marker",description:"Mounts lnTabs component instance on tabs container"},"data-ln-tabs-active":{effect:n,type:"string",description:"Active tab key identifier"},"data-ln-tabs-default":{type:"string",description:"Default fallback tab key when none selected"},"data-ln-tabs-focus":{prop:"autoFocus",read:x,type:"boolean",fallback:!0,description:"Whether to shift focus to newly activated tab panel"},"data-ln-tabs-key":{prop:"nsKey",read:o,type:"string",description:"Hash namespace key for URL hash synchronization"},"data-ln-tab":{type:"string",description:"Tab trigger key identifier"},"data-ln-panel":{type:"string",description:"Tab content panel key identifier matching corresponding tab"}},a=V(i);function s(r){return this.dom=r,P(this,r,a),this.activeKey=null,c.call(this),this}function c(){this.tabs=Array.from(this.dom.querySelectorAll("[data-ln-tab]")),this.panels=Array.from(this.dom.querySelectorAll("[data-ln-panel]"));const r=this.tabs.map(d=>({tagName:d.tagName,href:d.getAttribute("href")})),l=ee(r,this.nsKey);this.hashEnabled=l.hashEnabled,l.warning==="mixed"?console.warn('[ln-tabs] Mixed <a href="#…"> and <button> triggers in one group — using persist mode. Pick one: anchors for URL hash, buttons for localStorage persist.',this.dom):l.warning==="missing-namespace"&&console.warn("[ln-tabs] Anchor triggers need a hash namespace — add id or data-ln-tabs-key to the wrapper. Falling back to non-hash mode.",this.dom),this.mapTabs={},this.mapPanels={};for(const d of this.tabs){const f=Z(d.getAttribute("data-ln-tab"),d.tagName,d.getAttribute("href"),this.nsKey);f?this.mapTabs[f]=d:console.warn('[ln-tabs] Trigger has no resolvable key — needs `data-ln-tab="key"` or `<a href="#…">`.',d)}for(const d of this.panels){const f=(d.getAttribute("data-ln-panel")||"").toLowerCase().trim();f&&(this.mapPanels[f]=d)}this.defaultKey=(this.dom.getAttribute("data-ln-tabs-default")||"").toLowerCase().trim()||Object.keys(this.mapTabs)[0]||"";const u=this;this._clickHandlers=[];for(const d of this.tabs){if(d[t+"Trigger"])continue;const f=function(h){const C=d.tagName==="A";if(!C&&(h.ctrlKey||h.metaKey||h.button===1))return;const w=Z(d.getAttribute("data-ln-tab"),d.tagName,d.getAttribute("href"),u.nsKey);w&&(C&&!Y(h)||(u.hashEnabled?p(u.nsKey)===w?u.dom.setAttribute("data-ln-tabs-active",w):y(u.nsKey,w):u.dom.setAttribute("data-ln-tabs-active",w)))};d.addEventListener("click",f),d[t+"Trigger"]=f,u._clickHandlers.push({el:d,handler:f})}if(this._onRequestSelect=function(d){const f=d.detail&&(d.detail.key||d.detail.tab);f&&u.select(f)},this.dom.addEventListener("ln-tabs:request-select",this._onRequestSelect),this._hashHandler=function(){if(!u.hashEnabled)return;const d=p(u.nsKey);u.dom.setAttribute("data-ln-tabs-active",d!==null?d:u.defaultKey)},this.hashEnabled)window.addEventListener("hashchange",this._hashHandler),this._hashHandler();else{const d=te(this.dom.getAttribute("data-ln-tabs-active"),Object.keys(this.mapPanels),this.defaultKey);this.dom.setAttribute("data-ln-tabs-active",d)}}s.prototype.select=function(r){const l=(r+"").toLowerCase().trim();l&&(this.hashEnabled?p(this.nsKey)===l?this.dom.setAttribute("data-ln-tabs-active",l):y(this.nsKey,l):this.dom.setAttribute("data-ln-tabs-active",l))},s.prototype._applyActive=function(r){var u;if(r=te(r,Object.keys(this.mapPanels),this.defaultKey),r===this.activeKey)return;const l=this.activeKey;if(l!==null&&re(this.dom,"ln-tabs:before-change",{key:r,previousKey:l,tab:this.mapTabs[r],panel:this.mapPanels[r],target:this.dom}).defaultPrevented){l in this.mapPanels&&(this.dom.setAttribute("data-ln-tabs-active",l),this.hashEnabled&&p(this.nsKey)!==l&&y(this.nsKey,l));return}this.activeKey=r;for(const d in this.mapTabs){const f=this.mapTabs[d];d===r?(f.setAttribute("data-active",""),f.setAttribute("aria-selected","true")):(f.removeAttribute("data-active"),f.setAttribute("aria-selected","false"))}for(const d in this.mapPanels){const f=this.mapPanels[d],h=d===r;f.hidden=!h,f.classList.toggle("hidden",!h),f.setAttribute("aria-hidden",h?"false":"true")}if(this.autoFocus){const d=(u=this.mapPanels[r])==null?void 0:u.querySelector('input,button,select,textarea,[tabindex]:not([tabindex="-1"])');d&&setTimeout(()=>d.focus({preventScroll:!0}),0)}q(this.dom,"ln-tabs:change",{key:r,previousKey:l,tab:this.mapTabs[r],panel:this.mapPanels[r],target:this.dom})},s.prototype.destroy=function(){if(this.dom[t]){this.dom.removeEventListener("ln-tabs:request-select",this._onRequestSelect);for(const{el:r,handler:l}of this._clickHandlers)r.removeEventListener("click",l),delete r[t+"Trigger"];this.hashEnabled&&window.removeEventListener("hashchange",this._hashHandler),delete this.dom[t]}},G(e,t,s,"ln-tabs",{attributes:i,persist:{attr:"data-ln-tabs-active",hashActive:function(r){const l=Array.from(r.querySelectorAll("[data-ln-tab]")).map(function(d){return{tagName:d.tagName,href:d.getAttribute("href")}}),u=(r.getAttribute("data-ln-tabs-key")||r.id||"").toLowerCase().trim();return ee(l,u).hashEnabled}}})})()})();
|
|
1
|
+
(function(){"use strict";function N(){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 v(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 s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){r=t[s];break}if(!v(r))return}e.apply(console,t)}}function I(e,t,o){const r=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function se(e,t,o){const r=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(s),s}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function le(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ae(e,t){const o=!!(t&&t.typed),r=t&&t.exclude,s={},l=e.elements,i={};if(o)for(let a=0;a<l.length;a++){const n=l[a];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let a=0;a<l.length;a++){const n=l[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")o&&i[n.name]===1?s[n.name]=n.checked:(s[n.name]||(s[n.name]=[]),n.checked&&s[n.name].push(n.value));else if(n.type==="radio")n.checked&&(s[n.name]=n.value);else if(n.type==="select-multiple"){s[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&s[n.name].push(n.options[c].value)}else if(o&&n.type==="hidden")s[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const c=Number(n.value);s[n.name]=n.value===""||isNaN(c)?null:c}else s[n.name]=n.value}return s}function ce(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ue(e,t){const o=e.elements,r=[],s={};for(let l=0;l<o.length;l++){const i=o[l];i.name&&i.type==="checkbox"&&(s[i.name]=(s[i.name]||0)+1)}for(let l=0;l<o.length;l++){const i=o[l];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const n=t[a];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(s[i.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=ce(n);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<i.options.length;c++)i.options[c].selected=n.indexOf(i.options[c].value)!==-1;r.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ue,window.lnCore.serializeForm=ae,window.lnCore.resolveFormMethod=le);const $={};function de(e,t){$[e]=t}function fe(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=fe);function he(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function be(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];R[o]=t}function we(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=be,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=he);const k={};function pe(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=k[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let i=0;i<o.length;i++){const a=o[i],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],n=a.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&a.setAttribute(u,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let i=0;i<s.length;i++){const a=s[i],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const l=e.querySelectorAll("[data-ln-class]");for(let i=0;i<l.length;i++){const a=l[i],n=a.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&a.classList.toggle(u,!!t[f])}}return e}function ge(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 o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<o.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[r],t??null),o[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)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function j(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const l=o.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,a){return t[a]!==void 0?t[a]:""}))}const r=function(l,i){return t[i]!==void 0?t[i]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let l=0;l<s.length;l++){const i=s[l],a=i.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function me(e,t,o,r,s,l){const i={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(i[d]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(r(c));let u=i[d];if(u)s(u,c,n);else{const f=pe(o,l);if(!f||(j(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),s(u,c,n)}a.appendChild(u)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=M,window.lnCore.lnFill=ge,window.lnCore.renderList=me);function x(e,t,o){const r=e.getAttribute(t);return r===null?o:r}function B(e,t,o){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?o:r}function _(e,t,o=!1){const r=e.getAttribute(t);if(r===null)return!!o;const s=r.trim().toLowerCase();return!(s==="false"||s==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const S=new Map;function W(e,t){const o=(e?e.join("|"):"")+"::"+t;if(S.has(o))return S.get(o);const r=new Set(e||[]),s=function(l,i){const a=l.getAttribute(i);return a!==null&&r.has(a)?a:t};return S.set(o,s),s}function U(e,t,o){const r=parseFloat(e.getAttribute(t));return isNaN(r)?o:r}function P(e,t,o){const r=e.getAttribute(t);if(!r)return o;try{return JSON.parse(r)}catch{return o}}function V(e,t,o,r,s){if(!e||t===null)return!0;const l=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=n=>{s?console.warn(n,s):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${l}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${l}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${l}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${l}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${l}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${l}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${l}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,o){for(const r in o){const[s,l,i]=o[r];Object.defineProperty(e,r,{get:function(){return s(t,l,i)},enumerable:!0,configurable:!0})}return e}function z(e){const t={};for(const o in e){const r=e[o];if(!r||!r.prop)continue;let s=r.read;if(!s&&r.type)switch(r.type){case"enum":s=W(r.values,r.fallback);break;case"integer":s=B;break;case"float":s=U;break;case"boolean":s=_;break;case"list":s=H;break;case"json":s=P;break;case"string":default:s=x;break}s||(s=x),t[r.prop]=[s,o,r.fallback]}return t}function ye(e){const t={};for(const o in e){const r=e[o];r&&r.effect&&(t[o]=r.effect)}return Object.keys(t).length?t:null}function Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=z,window.lnCore.attrStr=x,window.lnCore.attrInt=B,window.lnCore.attrBool=_,window.lnCore.attrList=H,window.lnCore.attrEnum=W,window.lnCore.attrFloat=U,window.lnCore.attrJson=P);function p(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(o){console.error("["+t.attribute+"] init failed",e,o)}}}function J(e,t,o,r){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:o,ComponentFn:r};if(e.matches&&e.matches(l)&&p(e,i),e.querySelectorAll){const a=e.querySelectorAll(l);for(let n=0;n<a.length;n++)p(a[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ve(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 G(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ke(e){const t=G(),o=e.observed||[];for(let r=0;r<o.length;r++){const s=o[r];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const s=t.byDeclaredAttr.get(r);s.some(l=>l.componentTag===e.componentTag)||s.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Ce(e);if(r===null)t.reactiveWildcard.push(e);else for(const s of r)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function X(e,t,o,r){for(let s=0;s<e.length;s++){const l=e[s];if(!t[l.attribute])continue;const i=l.effects&&l.effects[o];i?i(t,o,r):l.onAttrChange&&(!l.declared||l.declared.has(o))&&l.onAttrChange(t,o,r)}}function xe(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,r=G(),s=r.byAttr.get(t),l=N()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!o&&!s&&!l)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(l&&v(i)){const a=r.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let c=0;c<a.length;c++)V(a[c].spec,n,t,a[c].componentTag,i)}if(window.lnCore._debugSink&&(o||s)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),o){const a=r.byReactive.get(t);a&&X(a,i,t,e.oldValue),r.reactiveWildcard.length&&X(r.reactiveWildcard,i,t,e.oldValue)}if(s)for(let a=0;a<s.length;a++){const n=s[a];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(J(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{xe(t[o])}catch(r){console.error("[ln-core] mutation handler failed",t[o].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function L(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Se(e){const t=L();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const r=t[o];if(r.onSubtreeChange&&r.query){const s=r.query,l=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;l&&r.onSubtreeChange(l,e)}}for(let o=0;o<e.addedNodes.length;o++){const r=e.addedNodes[o];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const i=t[l];if(i.selector&&i.attribute&&i.ComponentFn){if(!s)r.matches&&r.matches(i.query)&&p(r,i);else if(r.matches&&r.matches(i.query)&&p(r,i),r.querySelectorAll){const a=r.querySelectorAll(i.query);for(let n=0;n<a.length;n++)p(a[n],i)}}i.onInit&&i.onInit(r)}}}for(let o=0;o<e.removedNodes.length;o++){const r=e.removedNodes[o];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const i=t[l],a=i.query;if(a){if(!s)r.matches&&r.matches(a)&&E(r,i);else if(r.matches&&r.matches(a)&&E(r,i),r.querySelectorAll){const n=r.querySelectorAll(a);for(let c=0;c<n.length;c++)E(n[c],i)}}}}}}}function Y(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const r=t[o];if(r.type==="childList")try{Se(r)}catch(s){console.error("[ln-core] lifecycle handler failed",r.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Le(e){L().push(e),Y()}function Z(e,t,o,r,s={}){const l=s.extraAttributes||[],i=s.onAttributeChange||null,a=s.onSubtreeChange||null,n=s.onInit||null,c=s.onAttrChange||null,d=s.effects||null,u=s.attributes||null,f=u?ye(u):d,h=u?new Set(Object.keys(u)):null,A=s.persist||null;function b(q){const w=q||document.body;if(J(w,e,t,o),u&&N())for(const m in u){const Ie=u[m],D=Array.from(w.querySelectorAll("["+m+"]"));w.matches&&w.matches("["+m+"]")&&D.push(w);for(let F=0;F<D.length;F++){const K=D[F];v(K)&&V(Ie,K.getAttribute(m),m,r,K)}}n&&n(w)}const O=[];if(e.indexOf("[")!==-1){const q=/\[([\w-]+)/g;let w;for(;(w=q.exec(e))!==null;)O.push(w[1])}else O.push(e);ke({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:o,onInit:n,observed:O.concat(l),onAttributeChange:i,onAttrChange:c,effects:f,declared:h,persist:A}),_e();const Ke=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Ne=s.subtreeQuery||(Ke?e:"["+e+"]");L().push({selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:a,query:Ne}),Y(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=Le);function ie(){Ae()>0?ve(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ie):ie(),b}function ee(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,o={},r=ee(t);if(!r)return o;const s=r.split("&");for(let l=0;l<s.length;l++){const i=s[l];if(!i)continue;const a=i.indexOf(":"),n=a>-1?i.slice(0,a):i,c=a>-1?i.slice(a+1):"";if(n)try{o[n]=decodeURIComponent(c)}catch{o[n]=c}}return o}function g(e){if(!e)return null;const t=T();return e in t?t[e]:null}function C(e,t){if(!e)return;const o=T();t==null?delete o[e]:o[e]=String(t);const s=Object.keys(o).map(function(l){const i=o[l];return i===""?l:l+":"+encodeURIComponent(i)}).join("&");ee(location.hash)!==s&&(location.hash=s)}function te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ee(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.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 Te(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Oe(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 qe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),r=e.slice(t+1),s=r?r.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:o,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=g,window.lnCore.hashSet=C,window.lnCore.hashLinkClick=te,window.lnCore.resolveHashNamespace=Ee,window.lnCore.hashSortEncode=Te,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=De);function Fe(){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=Fe);function ne(e,t,o,r){const s=(e||"").toLowerCase().trim();if(s)return s;if((t||"").toUpperCase()!=="A")return"";const l=o||"";if(!l.startsWith("#"))return"";const i=l.slice(1);if(!i)return"";const a=i.split("&"),n=(r||"").toLowerCase().trim();if(n)for(const u of a){const f=u.indexOf(":");if(f>0&&u.slice(0,f).toLowerCase().trim()===n)return u.slice(f+1).toLowerCase().trim()}const c=a[a.length-1]||"",d=c.indexOf(":");return(d>0?c.slice(d+1):c).toLowerCase().trim()}function re(e,t){if(!Array.isArray(e)||e.length===0)return{hashEnabled:!1,warning:null};const o=e.filter(l=>(l.tagName||"").toUpperCase()==="A"&&(l.href||"").startsWith("#")),r=o.length>0&&o.length===e.length,s=(t||"").toLowerCase().trim();return o.length>0&&o.length!==e.length?{hashEnabled:!1,warning:"mixed"}:r&&!s?{hashEnabled:!1,warning:"missing-namespace"}:{hashEnabled:r&&!!s,warning:null}}function oe(e,t,o){const r=(e||"").toLowerCase().trim();return r&&Array.isArray(t)&&t.includes(r)?r:(o||"").toLowerCase().trim()}(function(){const e="data-ln-tabs",t="lnTabs";if(window[t]!==void 0&&window[t]!==null)return;function o(n){const c=n.getAttribute("data-ln-tabs-active");n[t]&&n[t]._applyActive(c)}function r(n,c){return(n.getAttribute(c)||n.id||"").toLowerCase().trim()}const s={"data-ln-tabs":{type:"marker",description:"Mounts lnTabs component instance on tabs container"},"data-ln-tabs-active":{effect:o,type:"string",description:"Active tab key identifier"},"data-ln-tabs-default":{type:"string",description:"Default fallback tab key when none selected"},"data-ln-tabs-focus":{prop:"autoFocus",read:_,type:"boolean",fallback:!0,description:"Whether to shift focus to newly activated tab panel"},"data-ln-tabs-key":{prop:"nsKey",read:r,type:"string",description:"Hash namespace key for URL hash synchronization"},"data-ln-tab":{type:"string",description:"Tab trigger key identifier"},"data-ln-panel":{type:"string",description:"Tab content panel key identifier matching corresponding tab"}},l=z(s);function i(n){return this.dom=n,Q(this,n,l),this.activeKey=null,a.call(this),this}function a(){this.tabs=Array.from(this.dom.querySelectorAll("[data-ln-tab]")),this.panels=Array.from(this.dom.querySelectorAll("[data-ln-panel]"));const n=this.tabs.map(u=>({tagName:u.tagName,href:u.getAttribute("href")})),c=re(n,this.nsKey);this.hashEnabled=c.hashEnabled,c.warning==="mixed"?console.warn('[ln-tabs] Mixed <a href="#…"> and <button> triggers in one group — using persist mode. Pick one: anchors for URL hash, buttons for localStorage persist.',this.dom):c.warning==="missing-namespace"&&console.warn("[ln-tabs] Anchor triggers need a hash namespace — add id or data-ln-tabs-key to the wrapper. Falling back to non-hash mode.",this.dom),this.mapTabs={},this.mapPanels={};for(const u of this.tabs){const f=ne(u.getAttribute("data-ln-tab"),u.tagName,u.getAttribute("href"),this.nsKey);f?this.mapTabs[f]=u:console.warn('[ln-tabs] Trigger has no resolvable key — needs `data-ln-tab="key"` or `<a href="#…">`.',u)}for(const u of this.panels){const f=(u.getAttribute("data-ln-panel")||"").toLowerCase().trim();f&&(this.mapPanels[f]=u)}this.defaultKey=(this.dom.getAttribute("data-ln-tabs-default")||"").toLowerCase().trim()||Object.keys(this.mapTabs)[0]||"";const d=this;this._clickHandlers=[];for(const u of this.tabs){if(u[t+"Trigger"])continue;const f=function(h){const A=u.tagName==="A";if(!A&&(h.ctrlKey||h.metaKey||h.button===1))return;const b=ne(u.getAttribute("data-ln-tab"),u.tagName,u.getAttribute("href"),d.nsKey);b&&(A&&!te(h)||(d.hashEnabled?g(d.nsKey)===b?d.dom.setAttribute("data-ln-tabs-active",b):C(d.nsKey,b):d.dom.setAttribute("data-ln-tabs-active",b)))};u.addEventListener("click",f),u[t+"Trigger"]=f,d._clickHandlers.push({el:u,handler:f})}if(this._onRequestSelect=function(u){const f=u.detail&&(u.detail.key||u.detail.tab);f&&d.select(f)},this.dom.addEventListener("ln-tabs:request-select",this._onRequestSelect),this._hashHandler=function(){if(!d.hashEnabled)return;const u=g(d.nsKey);d.dom.setAttribute("data-ln-tabs-active",u!==null?u:d.defaultKey)},this.hashEnabled)window.addEventListener("hashchange",this._hashHandler),this._hashHandler();else{const u=oe(this.dom.getAttribute("data-ln-tabs-active"),Object.keys(this.mapPanels),this.defaultKey);this.dom.setAttribute("data-ln-tabs-active",u)}}i.prototype.select=function(n){const c=(n+"").toLowerCase().trim();c&&(this.hashEnabled?g(this.nsKey)===c?this.dom.setAttribute("data-ln-tabs-active",c):C(this.nsKey,c):this.dom.setAttribute("data-ln-tabs-active",c))},i.prototype._applyActive=function(n){var d;if(n=oe(n,Object.keys(this.mapPanels),this.defaultKey),n===this.activeKey)return;const c=this.activeKey;if(c!==null&&se(this.dom,"ln-tabs:before-change",{key:n,previousKey:c,tab:this.mapTabs[n],panel:this.mapPanels[n],target:this.dom}).defaultPrevented){c in this.mapPanels&&(this.dom.setAttribute("data-ln-tabs-active",c),this.hashEnabled&&g(this.nsKey)!==c&&C(this.nsKey,c));return}this.activeKey=n;for(const u in this.mapTabs){const f=this.mapTabs[u];u===n?(f.setAttribute("data-active",""),f.setAttribute("aria-selected","true")):(f.removeAttribute("data-active"),f.setAttribute("aria-selected","false"))}for(const u in this.mapPanels){const f=this.mapPanels[u],h=u===n;f.hidden=!h,f.classList.toggle("hidden",!h),f.setAttribute("aria-hidden",h?"false":"true")}if(this.autoFocus){const u=(d=this.mapPanels[n])==null?void 0:d.querySelector('input,button,select,textarea,[tabindex]:not([tabindex="-1"])');u&&setTimeout(()=>u.focus({preventScroll:!0}),0)}I(this.dom,"ln-tabs:change",{key:n,previousKey:c,tab:this.mapTabs[n],panel:this.mapPanels[n],target:this.dom})},i.prototype.destroy=function(){if(this.dom[t]){this.dom.removeEventListener("ln-tabs:request-select",this._onRequestSelect);for(const{el:n,handler:c}of this._clickHandlers)n.removeEventListener("click",c),delete n[t+"Trigger"];this.hashEnabled&&window.removeEventListener("hashchange",this._hashHandler),delete this.dom[t]}},Z(e,t,i,"ln-tabs",{attributes:s,persist:{attr:"data-ln-tabs-active",hashActive:function(n){const c=Array.from(n.querySelectorAll("[data-ln-tab]")).map(function(u){return{tagName:u.tagName,href:u.getAttribute("href")}}),d=(n.getAttribute("data-ln-tabs-key")||n.id||"").toLowerCase().trim();return re(c,d).hashEnabled}}})})()})();
|