@livenetworks/ashlar 2.1.11 → 2.1.12
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-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/events.js +5 -2
- package/components/ln-core/lifecycle.js +25 -44
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/ln-debug.schema.json +28 -28
- package/components/ln-debug/src/debug-verifier.js +24 -30
- package/components/ln-debug/src/ln-debug.js +3 -11
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function W(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function R(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 a=1;a<e.length;a++)if(e[a]&&e[a].nodeType===1){r=e[a];break}if(!R(r))return}t.apply(console,e)}}function y(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 ut(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,y(t.dom,e,r)}function q(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){q(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function $(t){return t.hasAttribute("value")?t.getAttribute("value"):t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.textContent.trim()}function ht(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function ft(t,e){const l=!!(e&&e.typed),r=e&&e.exclude,a={},u=t.elements,d={};if(l)for(let h=0;h<u.length;h++){const o=u[h];o.name&&o.type==="checkbox"&&!o.disabled&&(d[o.name]=(d[o.name]||0)+1)}for(let h=0;h<u.length;h++){const o=u[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&&d[o.name]===1?a[o.name]=o.checked:(a[o.name]||(a[o.name]=[]),o.checked&&a[o.name].push(o.value));else if(o.type==="radio")o.checked&&(a[o.name]=o.value);else if(o.type==="select-multiple"){a[o.name]=[];for(let i=0;i<o.options.length;i++)o.options[i].selected&&a[o.name].push(o.options[i].value)}else if(l&&o.type==="hidden")a[o.name]=o.value;else if(l&&(o.type==="number"||o.type==="range")){const i=Number(o.value);a[o.name]=o.value===""||isNaN(i)?null:i}else a[o.name]=o.value}return a}function bt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function pt(t,e){const l=t.elements,r=[],a={};for(let u=0;u<l.length;u++){const d=l[u];d.name&&d.type==="checkbox"&&(a[d.name]=(a[d.name]||0)+1)}for(let u=0;u<l.length;u++){const d=l[u];if(d.type==="file"||d.type==="submit"||d.type==="button")continue;const h=d.getAttribute("data-ln-fill-as")||d.name;if(!h||!(h in e))continue;const o=e[h];if(d.type==="checkbox"){if(Array.isArray(o))d.checked=o.indexOf(d.value)!==-1;else if(a[d.name]>1){const i=String(o).split(",").map(function(s){return s.trim()});d.checked=i.indexOf(d.value)!==-1}else d.checked=bt(o);r.push(d)}else if(d.type==="radio")d.checked=d.value===String(o),r.push(d);else if(d.type==="select-multiple"){if(Array.isArray(o))for(let i=0;i<d.options.length;i++)d.options[i].selected=o.indexOf(d.options[i].value)!==-1;r.push(d)}else d.value=o,d.tagName==="SELECT"&&o!=null&&d.setAttribute("data-ln-value",o),r.push(d)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=pt,window.lnCore.serializeForm=ft,window.lnCore.resolveFormMethod=ht);const j={};function wt(t,e){j[t]=e}function _t(t){return j[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=wt,window.lnCore.getDataMapper=_t);function gt(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,q(function(){new MutationObserver(function(){y(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function mt(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];U[l]=e}function yt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return U[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=mt,window.lnCore.getLocaleFallback=yt,window.lnCore.ensureLocaleObserver=gt);const F={};function z(t,e){F[t]||(F[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=F[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function x(t,e,l){if(t){const r=t.querySelector('[data-ln-template="'+e+'"]');if(r)return r.content.cloneNode(!0)}return z(e,l)}function Q(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let d=0;d<l.length;d++){const h=l[d],o=h.getAttribute("data-ln-field");e[o]!=null&&(h.textContent=e[o])}const r=t.querySelectorAll("[data-ln-attr]");for(let d=0;d<r.length;d++){const h=r[d],o=h.getAttribute("data-ln-attr").split(",");for(let i=0;i<o.length;i++){const s=o[i].trim().split(":");if(s.length!==2)continue;const n=s[0].trim(),c=s[1].trim();e[c]!=null&&h.setAttribute(n,e[c])}}const a=t.querySelectorAll("[data-ln-show]");for(let d=0;d<a.length;d++){const h=a[d],o=h.getAttribute("data-ln-show");o in e&&h.classList.toggle("hidden",!e[o])}const u=t.querySelectorAll("[data-ln-class]");for(let d=0;d<u.length;d++){const h=u[d],o=h.getAttribute("data-ln-class").split(",");for(let i=0;i<o.length;i++){const s=o[i].trim().split(":");if(s.length!==2)continue;const n=s[0].trim(),c=s[1].trim();c in e&&h.classList.toggle(n,!!e[c])}}return t}function Ct(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)Q(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 I(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const u=l.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(d,h){return e[h]!==void 0?e[h]:""}))}const r=function(u,d){return e[d]!==void 0?e[d]:""},a=Array.from(t.querySelectorAll("*"));t.nodeType===1&&a.push(t);for(let u=0;u<a.length;u++){const d=a[u],h=d.attributes;for(let o=0;o<h.length;o++){const i=h[o];i.value.indexOf("{{")!==-1&&d.setAttribute(i.name,i.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function St(t,e,l,r,a,u){const d={};for(let o=0;o<t.children.length;o++){const i=t.children[o],s=i.getAttribute("data-ln-render-key");s&&(d[s]=i)}const h=document.createDocumentFragment();for(let o=0;o<e.length;o++){const i=e[o],s=String(r(i));let n=d[s];if(n)a(n,i,o);else{const c=z(l,u);if(!c||(I(c,i),n=c.firstElementChild,!n))continue;n.setAttribute("data-ln-render-key",s),a(n,i,o)}h.appendChild(n)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=I,window.lnCore.fill=Q,window.lnCore.lnFill=Ct,window.lnCore.renderList=St);function k(t,e,l){const r=t.getAttribute(e);return r===null?l:r}function K(t,e,l){const r=parseInt(t.getAttribute(e),10);return isNaN(r)?l:r}function O(t,e,l=!1){const r=t.getAttribute(e);if(r===null)return!!l;const a=r.trim().toLowerCase();return!(a==="false"||a==="0")}function J(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const N=new Map;function G(t,e){const l=(t?t.join("|"):"")+"::"+e;if(N.has(l))return N.get(l);const r=new Set(t||[]),a=function(u,d){const h=u.getAttribute(d);return h!==null&&r.has(h)?h:e};return N.set(l,a),a}function Y(t,e,l){const r=parseFloat(t.getAttribute(e));return isNaN(r)?l:r}function X(t,e,l){const r=t.getAttribute(e);if(!r)return l;try{return JSON.parse(r)}catch{return l}}function Z(t,e,l,r,a){if(!t||e===null)return!0;const u=r||"ln-component",d=t.type;if(d==="trigger"||d==="marker"||d==="string"||d==="list"||!d||e===""&&t.fallback!==void 0)return!0;const h=o=>{a?console.warn(o,a):console.warn(o)};if(d==="boolean"){const o=e.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(h(`[${u}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(d==="enum"){const o=t.values||[];return o.includes(e)?!0:(h(`[${u}] Invalid value "${e}" for attribute "${l}". Allowed: ${o.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(d==="integer"){if(!/^-?\d+$/.test(e))return h(`[${u}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const o=parseInt(e,10);return t.min!==void 0&&o<t.min?(h(`[${u}] Value ${o} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&o>t.max?(h(`[${u}] Value ${o} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(d==="float")return isNaN(Number(e))?(h(`[${u}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(d==="json")try{return JSON.parse(e),!0}catch(o){return h(`[${u}] Invalid JSON for attribute "${l}": ${o.message}. Fallback: ${t.fallback}.`),!1}return!0}function tt(t,e,l){for(const r in l){const[a,u,d]=l[r];Object.defineProperty(t,r,{get:function(){return a(e,u,d)},enumerable:!0,configurable:!0})}return t}function et(t){const e={};for(const l in t){const r=t[l];if(!r||!r.prop)continue;let a=r.read;if(!a&&r.type)switch(r.type){case"enum":a=G(r.values,r.fallback);break;case"integer":a=K;break;case"float":a=Y;break;case"boolean":a=O;break;case"list":a=J;break;case"json":a=X;break;case"string":default:a=k;break}a||(a=k),e[r.prop]=[a,l,r.fallback]}return e}function At(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 vt(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=tt,window.lnCore.attrSpec=et,window.lnCore.attrStr=k,window.lnCore.attrInt=K,window.lnCore.attrBool=O,window.lnCore.attrList=J,window.lnCore.attrEnum=G,window.lnCore.attrFloat=Y,window.lnCore.attrJson=X);function D(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 nt(t,e,l,r){if(t.nodeType!==1)return;const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",d={selector:e,attribute:l,ComponentFn:r};if(t.matches&&t.matches(u)&&D(t,d),t.querySelectorAll){const h=t.querySelectorAll(u);for(let o=0;o<h.length;o++)D(h[o],d)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function xt(){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 it(){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 Et(t){const e=it(),l=t.observed||[];for(let r=0;r<l.length;r++){const a=l[r];e.byAttr.has(a)||e.byAttr.set(a,[]),e.byAttr.get(a).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 a=e.byDeclaredAttr.get(r);a.some(u=>u.componentTag===t.componentTag)||a.push({spec:t.attributes[r],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const r=vt(t);if(r===null)e.reactiveWildcard.push(t);else for(const a of r)e.byReactive.has(a)||e.byReactive.set(a,[]),e.byReactive.get(a).push(t)}t.persist&&e.persist.push(t)}function lt(t,e,l,r){for(let a=0;a<t.length;a++){const u=t[a];if(!e[u.attribute])continue;const d=u.effects&&u.effects[l];d?d(e,l,r):u.onAttrChange&&(!u.declared||u.declared.has(l))&&u.onAttrChange(e,l,r)}}function Lt(t){const e=t.attributeName,l=e.indexOf("data-ln-")===0,r=it(),a=r.byAttr.get(e),u=W()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(e);if(!l&&!a&&!u)return;const d=t.target;if(t.oldValue!==d.getAttribute(e)){if(u&&R(d)){const h=r.byDeclaredAttr.get(e),o=d.getAttribute(e);for(let i=0;i<h.length;i++)Z(h[i].spec,o,e,h[i].componentTag,d)}if(window.lnCore._debugSink&&(l||a)&&window.lnCore._debugSink("attr",e,d,{oldValue:t.oldValue,newValue:d.getAttribute(e)}),l){const h=r.byReactive.get(e);h&<(h,d,e,t.oldValue),r.reactiveWildcard.length&<(r.reactiveWildcard,d,e,t.oldValue)}if(a)for(let h=0;h<a.length;h++){const o=a[h];if(o.handler){o.handler(d,e,t.oldValue);continue}o.onAttributeChange&&d[o.attribute]?o.onAttributeChange(d,e):(nt(d,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(d))}}}function kt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,q(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Lt(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 H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function M(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function B(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 ot(t){const e=H();if(!e.length)return;const l=t.target;if(l){const a=l.nodeType===1?l:l.parentElement;if(a&&(a.isContentEditable||a.closest&&a.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=M();if(t.target&&r.length)for(let a=0;a<r.length;a++){const u=r[a],d=u.query,h=t.target.nodeType===1?t.target.matches&&t.target.matches(d)?t.target:t.target.closest?t.target.closest(d):null:t.target.parentElement&&t.target.parentElement.closest?t.target.parentElement.closest(d):null;h&&u.onSubtreeChange(h,t)}for(let a=0;a<t.addedNodes.length;a++){const u=t.addedNodes[a];if(u.nodeType===1){const d=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const o=e[h];if(o.selector&&o.attribute&&o.ComponentFn){if(!d)u.matches&&u.matches(o.query)&&D(u,o);else if(u.matches&&u.matches(o.query)&&D(u,o),u.querySelectorAll){const i=u.querySelectorAll(o.query);for(let s=0;s<i.length;s++)D(i[s],o)}}o.onInit&&o.onInit(u)}}}for(let a=0;a<t.removedNodes.length;a++){const u=t.removedNodes[a];if(u.nodeType===1){if(document.contains(u))continue;const d=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const o=e[h],i=o.query;if(i){if(!d)u.matches&&u.matches(i)&&B(u,o);else if(u.matches&&u.matches(i)&&B(u,o),u.querySelectorAll){const s=u.querySelectorAll(i);for(let n=0;n<s.length;n++)B(s[n],o)}}}}}}function rt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,q(function(){const t=new MutationObserver(function(e){for(let l=0;l<e.length;l++){const r=e[l];if(r.type==="childList")try{ot(r)}catch(a){console.error("[ln-core] lifecycle handler failed",r.target,a)}}});window.lnCore._lifecycleObserver=t,t.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Dt(t){if(typeof window>"u")return t();window.lnCore=window.lnCore||{};const e=window.lnCore._lifecycleObserver;if(!e)return t();const l=e.takeRecords();for(let r=0;r<l.length;r++){const a=l[r];if(a.type==="childList")try{ot(a)}catch(u){console.error("[ln-core] lifecycle handler failed",a.target,u)}}e.disconnect();try{return t()}finally{e.observe(document.body,{childList:!0,subtree:!0})}}function qt(t){H().push(t),t.onSubtreeChange&&t.query&&M().push(t),rt()}function st(t,e,l,r,a={}){const u=a.extraAttributes||[],d=a.onAttributeChange||null,h=a.onSubtreeChange||null,o=a.onInit||null,i=a.onAttrChange||null,s=a.effects||null,n=a.attributes||null,c=n?At(n):s,f=n?new Set(Object.keys(n)):null,w=a.persist||null;function p(S){const m=S||document.body;if(nt(m,t,e,l),n&&W())for(const A in n){const v=n[A],L=Array.from(m.querySelectorAll("["+A+"]"));m.matches&&m.matches("["+A+"]")&&L.push(m);for(let E=0;E<L.length;E++){const P=L[E];R(P)&&Z(v,P.getAttribute(A),A,r,P)}}o&&o(m)}const b=[];if(t.indexOf("[")!==-1){const S=/\[([\w-]+)/g;let m;for(;(m=S.exec(t))!==null;)b.push(m[1])}else b.push(t);Et({selector:t,attribute:e,componentTag:r,attributes:n,ComponentFn:l,onInit:o,observed:b.concat(u),onAttributeChange:d,onAttrChange:i,effects:c,declared:f,persist:w}),kt();const _=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,g=a.subtreeQuery||(_?t:"["+t+"]"),C={selector:t,attribute:e,ComponentFn:l,onInit:o,onSubtreeChange:h,query:g};H().push(C),h&&g&&M().push(C),rt(),window[e]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=st,window.lnCore.observeLifecycle=qt,window.lnCore.withoutLifecycle=Dt);function T(){xt()>0?Tt(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",T):T(),p}function at(t){return(t||"").replace(/^#/,"")}function V(t){const e=t===void 0?location.hash:t,l={},r=at(e);if(!r)return l;const a=r.split("&");for(let u=0;u<a.length;u++){const d=a[u];if(!d)continue;const h=d.indexOf(":"),o=h>-1?d.slice(0,h):d,i=h>-1?d.slice(h+1):"";if(o)try{l[o]=decodeURIComponent(i)}catch{l[o]=i}}return l}function Rt(t){if(!t)return null;const e=V();return t in e?e[t]:null}function Ft(t,e){if(!t)return;const l=V();e==null?delete l[t]:l[t]=String(e);const a=Object.keys(l).map(function(u){const d=l[u];return d===""?u:u+":"+encodeURIComponent(d)}).join("&");at(location.hash)!==a&&(location.hash=a)}function It(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Ot(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 Nt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Ht(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 Mt(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function Bt(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),a=r?r.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:l,values:a}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=V,window.lnCore.hashGet=Rt,window.lnCore.hashSet=Ft,window.lnCore.hashLinkClick=It,window.lnCore.resolveHashNamespace=Ot,window.lnCore.hashSortEncode=Nt,window.lnCore.hashSortDecode=Ht,window.lnCore.hashFilterEncode=Mt,window.lnCore.hashFilterDecode=Bt);function Vt(t){return(t||"").replace(/^\?/,"")}function Pt(t){const e=t===void 0?typeof window<"u"?window.location.search:"":t,l={},r=Vt(e);if(!r)return l;const a=new URLSearchParams(r);for(const[u,d]of a.entries())l[u]=d;return l}function Wt(t){if(!t||typeof window>"u")return null;const e=new URLSearchParams(window.location.search);return e.has(t)?e.get(t):null}function $t(t,e){if(!t||typeof window>"u")return;const l=new URL(window.location.href);if(e==null||e===""?l.searchParams.delete(t):l.searchParams.set(t,String(e)),l.search===window.location.search)return;const r=l.pathname+l.search+l.hash;window.history.replaceState(window.history.state,"",r)}function jt(t,e){if(!t||!t.hasAttribute("data-ln-query"))return null;const l=t.getAttribute("data-ln-query");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 Ut(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function zt(t,e){if(t&&typeof t=="string"){if(t.endsWith(".asc"))return{fieldOrColumn:t.slice(0,-4),direction:"asc"};if(t.endsWith(".desc"))return{fieldOrColumn:t.slice(0,-5),direction:"desc"}}if(e&&typeof e=="object"){const l=e.sort_field||e.sort_by;if(l){const r=e.sort_dir&&String(e.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:l,direction:r}}}return null}function Qt(t){return!Array.isArray(t)||t.length===0?null:t.map(encodeURIComponent).join(",")}function Kt(t){return!t||typeof t!="string"?[]:t.split(",").map(function(e){try{return decodeURIComponent(e.trim())}catch{return e.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Pt,window.lnCore.queryGet=Wt,window.lnCore.querySet=$t,window.lnCore.resolveQueryParam=jt,window.lnCore.querySortEncode=Ut,window.lnCore.querySortDecode=zt,window.lnCore.queryFilterEncode=Qt,window.lnCore.queryFilterDecode=Kt);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 Gt(t,e,l,r,a=15){if(r<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const u=Math.max(0,t||0),d=Math.max(0,e||0),h=Math.floor(u/l),o=Math.ceil(d/l),i=Math.max(0,h-a),s=Math.min(r,h+o+a),n=i*l,c=Math.max(0,(r-s)*l);return{start:i,end:s,topPadding:n,bottomPadding:c}}function Yt(t,e){const l=Array.isArray(t)?t.length:0,r=e instanceof Set?e:new Set(e||[]);let a=0;if(Array.isArray(t))for(let h=0;h<t.length;h++)r.has(t[h])&&a++;else a=r.size;const u=l>0&&a===l,d=a>0&&a<l;return{totalCount:l,selectedCount:a,isAllSelected:u,isIndeterminate:d}}function ct(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 dt(t,e,l){const r=new Set(t);if(!Array.isArray(e))return r;if(l)for(let a=0;a<e.length;a++)e[a]!=null&&r.add(e[a]);else for(let a=0;a<e.length;a++)r.delete(e[a]);return r}(function(){const t="data-ln-table",e="lnTable";if(window[e]!==void 0)return;const a={"data-ln-table":{prop:"name",type:"string",read:k,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:k,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:O,description:"Enables row selection check controls"},"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-select-all-label":{type:"string",description:"Accessibility label for select-all header trigger"}},u=et(a);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function d(i,s){if(!i)return;if(s==null||isNaN(s)){i.removeAttribute("data-ln-value"),"value"in i&&i.tagName==="DATA"&&(i.value=""),i.lnNumber?i.lnNumber.value=NaN:i.textContent="";return}const n=String(s);i.setAttribute("data-ln-value",n),"value"in i&&i.tagName==="DATA"&&(i.value=n),i.lnNumber?i.lnNumber.value=s:i.textContent=n}function h(i,s){let n=s?s.parentElement:i;for(;n&&n!==document.body&&n!==document.documentElement;){const f=getComputedStyle(n).overflowY;if(f==="auto"||f==="scroll")return n;n=n.parentElement}return null}function o(i){this.dom=i,tt(this,i,u),this.table=i.querySelector("table"),this.tbody=i.querySelector("[data-ln-table-body]")||i.querySelector("tbody"),this.thead=i.querySelector("thead");const s=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=s?Array.from(s.querySelectorAll("th")):[],this._totalSpan=i.querySelector("[data-ln-table-total]"),this._filteredSpan=i.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==i?this._filteredSpan.parentElement:null),this._selectedSpan=i.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==i?this._selectedSpan.parentElement:null),this._loadingIndicator=i.querySelector("[data-ln-table-loading]"),this._loadingIndicator&&this._loadingIndicator.classList.add("hidden"),this.isDataDriven=i.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,this._rowPool=null,this._topSpacer=null,this._topTd=null,this._bottomSpacer=null,this._bottomTd=null;const n=this;return this._onSetSearch=function(c){const f=(c.detail&&c.detail.query!=null?c.detail.query:c.detail&&c.detail.term!=null?c.detail.term:"").trim();n.isDataDriven?(n.currentSearch=f,y(i,"ln-table:search",{table:n.name,query:n.currentSearch}),n._requestData()):(n._searchTerm=f.toLowerCase(),n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),y(i,"ln-table:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length}))},i.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(c){c.preventDefault(),n._onSetSearch(c)},i.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){n.isDataDriven?(n.currentFilters={},n.currentSearch="",y(i,"ln-table:clear-filters",{table:n.name}),n._requestData()):(n._searchTerm="",n._columnFilters={},n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),y(i,"ln-table:filter",{term:"",matched:n._filteredData.length,total:n._data.length}))},i.addEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this._initialLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._onSetData=function(c){const f=c.detail||{},w=f.data||[],p=f.total!=null?f.total:w.length;n._hasInitialSeed&&!n.isLoaded&&w.length===0&&p===0||(n._data=w,n._lastTotal=p,n._lastFiltered=f.filtered!=null?f.filtered:n._data.length,n.totalCount=n._lastTotal,n.visibleCount=n._lastFiltered,n.isLoaded=!0,n._initialLoaded=!0,n._hasInitialSeed=!1,i.classList.remove("ln-table--loading"),i.setAttribute("aria-busy","false"),n._loadingIndicator&&n._loadingIndicator.classList.add("hidden"),n._vStart=-1,n._vEnd=-1,n._applyFilterAndSort(),n._render(),n._updateFooter(),y(i,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},i.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(c){const f=!!(c.detail&&c.detail.loading);i.classList.toggle("ln-table--loading",f),i.setAttribute("aria-busy",f?"true":"false"),f&&!n._initialLoaded&&(n.isLoaded=!1,n._showLoadingState()),n._loadingIndicator&&n._loadingIndicator.classList.toggle("hidden",!(f&&n._initialLoaded))},i.addEventListener("ln-table:set-loading",this._onSetLoading),this._onSort=function(c){!c.detail||c.detail.field==null||(c.preventDefault(),n.currentSort=c.detail.direction==="none"?null:{field:c.detail.field,direction:c.detail.direction},n._requestData())},i.addEventListener("ln-sort:change",this._onSort),this._onRowClick=function(c){if(c.target.closest("[data-ln-table-row-select]")||c.target.closest("[data-ln-table-row-action]")||c.target.closest("a")||c.target.closest("button")||c.ctrlKey||c.metaKey||c.button===1)return;const f=c.target.closest("[data-ln-table-row]");if(!f)return;const w=f.getAttribute("data-ln-table-row-id"),p=f._lnRecord||{};y(i,"ln-table:row-click",{table:n.name,id:w,record:p})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(c){const f=c.target.closest("[data-ln-table-row-action]");if(!f)return;const w=f.closest("[data-ln-table-row]");if(!w)return;const p=f.getAttribute("data-ln-table-row-action"),b=w.getAttribute("data-ln-table-row-id"),_=w._lnRecord||{};y(i,"ln-table:row-action",{table:n.name,id:b,action:p,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0?this._parseRows():(this._showLoadingState(),i.setAttribute("aria-busy","true")),setTimeout(function(){!n.dom||!document.contains(n.dom)||y(i,"ln-table:request-data",{table:n.name,sort:n.currentSort,filters:n.currentFilters,search:n.currentSearch})},0)):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){n.tbody.rows.length>0&&(n._emptyTbodyObserver.disconnect(),n._emptyTbodyObserver=null,n._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(c){if(!c.detail||c.detail.column==null)return;c.preventDefault();const f=c.detail.direction==="none"?null:c.detail.direction;n._sortCol=f===null?-1:c.detail.column,n._sortDir=f,n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),y(i,"ln-table:sorted",{column:c.detail.column,direction:c.detail.direction,matched:n._filteredData.length,total:n._data.length})},i.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(c){if(c.preventDefault(),!c.detail)return;const f=c.detail.key,w=c.detail.values||[];if(f){if(w.length===0)delete n._columnFilters[f];else{const p=[];for(let b=0;b<w.length;b++)p.push(w[b].toLowerCase());n._columnFilters[f]=p}n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),y(i,"ln-table:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length})}},i.addEventListener("ln-filter:change",this._onFilterChange)),this}o.prototype._parseRows=function(){const i=this.tbody.rows,s=this.ths;this._data=[],i.length>0&&(this._rowHeight=i[0].offsetHeight||40),this._lockColumnWidths();for(let n=0;n<i.length;n++){const c=i[n],f=[],w=[],p=[];for(let _=0;_<c.cells.length;_++){const g=c.cells[_],C=g.textContent.trim();f[_]=$(g),w[_]=C.toLowerCase(),g.querySelector("[data-ln-table-row-action]")||p.push(C.toLowerCase())}let b=null;if(this.isDataDriven){b={};const _=c.getAttribute("data-ln-table-row-id");_!=null&&(b.id=_);for(let g=0;g<s.length;g++){const C=s[g].getAttribute("data-ln-table-col");if(C){const T=g;if(T<c.cells.length){const S=c.cells[T];b[C]=$(S)}}}}this._data.push({values:f,rawTexts:w,html:c.outerHTML,searchText:p.join(" "),id:this.isDataDriven&&b?b.id:void 0,...b})}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(),y(this.dom,"ln-table:ready",{total:this._data.length})},o.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},o.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const i=document.createElement("colgroup");this.ths.forEach(function(s){const n=document.createElement("col");n.style.width=s.offsetWidth+"px",i.appendChild(n)}),this.table.insertBefore(i,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=i},o.prototype._render=function(){if(this.tbody)if(this.isDataDriven){const i=this._lastTotal,s=this.visibleCount;if(i===0){if(this._disableVirtualScroll(),!this.isLoaded){this._showLoadingState();return}this._showEmptyState();return}if(this._filteredData.length===0||s===0){if(this._disableVirtualScroll(),!this.isLoaded){this._showLoadingState();return}this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const i=this._filteredData.length;i===0&&(this._searchTerm||Object.keys(this._columnFilters).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):i>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},o.prototype._renderAll=function(){this._rowPool=null,this._topSpacer=null,this._topTd=null,this._bottomSpacer=null,this._bottomTd=null;const i=this._filteredData;if(this.isDataDriven||i.length>0&&!i[0].html){const s=document.createDocumentFragment();for(let n=0;n<i.length;n++){const c=this._buildRow(i[n]);if(!c)break;s.appendChild(c)}this.tbody.replaceChildren(s),this._selectable&&this._updateSelectAll()}else{const s=[];for(let n=0;n<i.length;n++)s.push(i[n].html);this.tbody.innerHTML=s.join(""),this._selectable&&this._restoreSelection()}},o.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const i=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let n=null;this.isDataDriven&&this._data.length>0&&(n=this._buildRow(this._data[0])),n&&this.tbody&&(this.tbody.appendChild(n),this._rowHeight=n.offsetHeight||40,n.remove())}this._scrollContainer=h(this.dom,this.table);const s=this._scrollContainer||window;this.dom&&(this.dom.style.overflowAnchor="none"),this.table&&(this.table.style.overflowAnchor="none"),this.tbody&&(this.tbody.style.overflowAnchor="none"),this._scrollContainer&&(this._scrollContainer.style.overflowAnchor="none"),this._scrollHandler=function(){i._rafId||(i._rafId=requestAnimationFrame(function(){i._rafId=null,i._renderVirtual()}))},s.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},o.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,this._rowPool=null,this._topSpacer=null,this._topTd=null,this._bottomSpacer=null,this._bottomTd=null)},o.prototype._compileRowBindings=function(i){const s={textNodes:[],attrs:[],cellAttrs:[]},n=document.createTreeWalker(i,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const f=n.currentNode;if(f.textContent.indexOf("{{")!==-1){const w=f.parentElement;s.textNodes.push({node:f,raw:f.textContent,el:w,isLeaf:!!(w&&w.children.length===0)})}}const c=Array.from(i.querySelectorAll("*"));i.nodeType===1&&c.push(i);for(let f=0;f<c.length;f++){const w=c[f];if(w.hasAttribute("data-ln-table-cell-attr")){const b=w.getAttribute("data-ln-table-cell-attr").split(",");for(let _=0;_<b.length;_++){const g=b[_].trim().split(":");g.length===2&&s.cellAttrs.push({el:w,field:g[0].trim(),attr:g[1].trim()})}}const p=w.attributes;for(let b=0;b<p.length;b++){const _=p[b];_.value.indexOf("{{")!==-1&&s.attrs.push({el:w,name:_.name,raw:_.value})}}return i._lnBindings=s,s},o.prototype._createTemplateRow=function(){let i=x(this.dom,this.name+"-row","ln-table");if(!i){const n=this.dom.querySelector("template[data-ln-table-row]");n&&(i=document.importNode(n.content,!0))}let s=i?i.querySelector("[data-ln-table-row]")||i.firstElementChild:null;return s?(this._compileRowBindings(s),s):((window.lnDebug||typeof document<"u"&&document.body&&document.body.hasAttribute("data-ln-debug"))&&console.warn(`[ln-table] Missing row template: <template data-ln-template="${this.name}-row">`),null)},o.prototype._updateRow=function(i,s){if(!s)return;i._lnRecord=s,s.id!=null&&i.setAttribute("data-ln-table-row-id",s.id);const n=i._lnBindings||this._compileRowBindings(i),c=n.textNodes;for(let p=0;p<c.length;p++){const b=c[p],_=b.raw.replace(/\{\{\s*(\w+)\s*\}\}/g,function(g,C){return s[C]!==void 0&&s[C]!==null?s[C]:""});b.isLeaf&&b.el?b.el.textContent=_:b.node&&b.node.parentNode?b.node.textContent=_:b.el&&(b.el.textContent=_)}const f=n.attrs;for(let p=0;p<f.length;p++){const b=f[p];b.el.setAttribute(b.name,b.raw.replace(/\{\{\s*(\w+)\s*\}\}/g,function(_,g){return s[g]!==void 0&&s[g]!==null?s[g]:""}))}const w=n.cellAttrs;for(let p=0;p<w.length;p++){const b=w[p],_=s[b.field];_!=null&&b.el.setAttribute(b.attr,_)}if(n.textNodes.length===0&&n.attrs.length===0&&this.ths.length>0)for(let p=0;p<this.ths.length;p++){const b=this.ths[p].getAttribute("data-ln-table-col");b&&p<i.cells.length&&s[b]!=null&&(i.cells[p].textContent=String(s[b]))}if(this._selectable){const p=s.id!=null?String(s.id):null,b=p!=null&&this.selectedIds.has(p);i.classList.toggle("ln-row-selected",b);const _=i.querySelector("[data-ln-table-row-select]");_&&(_.checked=b)}},o.prototype._ensureRowPool=function(i,s){for(this._rowPool?this._topTd&&this._topTd.getAttribute("colspan")!==String(s)&&(this._topTd.setAttribute("colspan",s),this._bottomTd.setAttribute("colspan",s)):(this._rowPool=[],this._topSpacer=document.createElement("tr"),this._topSpacer.className="ln-table__spacer",this._topSpacer.setAttribute("aria-hidden","true"),this._topSpacer.style.overflowAnchor="none",this._topTd=document.createElement("td"),this._topTd.setAttribute("colspan",s),this._topTd.style.padding="0",this._topTd.style.border="none",this._topTd.style.overflowAnchor="none",this._topSpacer.appendChild(this._topTd),this._bottomSpacer=document.createElement("tr"),this._bottomSpacer.className="ln-table__spacer",this._bottomSpacer.setAttribute("aria-hidden","true"),this._bottomSpacer.style.overflowAnchor="none",this._bottomTd=document.createElement("td"),this._bottomTd.setAttribute("colspan",s),this._bottomTd.style.padding="0",this._bottomTd.style.border="none",this._bottomTd.style.overflowAnchor="none",this._bottomSpacer.appendChild(this._bottomTd),this.tbody.replaceChildren(this._topSpacer,this._bottomSpacer));this._rowPool.length<i;){const n=this._createTemplateRow();if(!n)break;this._rowPool.push(n),this.tbody.insertBefore(n,this._bottomSpacer)}},o.prototype._renderVirtual=function(){const i=this._filteredData,s=i.length,n=this._rowHeight;if(!n||!s)return;const c=this.thead?this.thead.offsetHeight:0,f=this._scrollContainer;let w,p;if(f){const S=this.table.getBoundingClientRect(),m=f.getBoundingClientRect(),A=S.top-m.top+f.scrollTop+c;w=f.scrollTop-A,p=f.clientHeight}else{const A=this.table.getBoundingClientRect().top+window.scrollY+c;w=window.scrollY-A,p=window.innerHeight}const b=Gt(w,p,n,s,15),_=b.start,g=b.end;if(_===this._vStart&&g===this._vEnd)return;this._vStart=_,this._vEnd=g;const C=this.ths.length||1,T=g-_;this._ensureRowPool(T,C),b.topPadding>0?(this._topTd.style.height=b.topPadding+"px",this._topSpacer.style.display=""):(this._topTd.style.height="0px",this._topSpacer.style.display="none"),b.bottomPadding>0?(this._bottomTd.style.height=b.bottomPadding+"px",this._bottomSpacer.style.display=""):(this._bottomTd.style.height="0px",this._bottomSpacer.style.display="none");for(let S=0;S<this._rowPool.length;S++){const m=this._rowPool[S],A=_+S;if(S<T&&A<s){m.style.display="";const v=i[A];if(v&&v.html){const L=document.createElement("tbody");L.innerHTML=v.html;const E=L.firstElementChild;E&&(m.innerHTML=E.innerHTML,m.className=E.className,m._lnRecord=v,v.id!=null&&m.setAttribute("data-ln-table-row-id",v.id))}else this._updateRow(m,v)}else m.style.display="none"}this._selectable&&this._updateSelectAll()},o.prototype._showLoadingState=function(){this._rowPool=null,this._topSpacer=null,this._topTd=null,this._bottomSpacer=null,this._bottomTd=null;const i=this.ths.length||1;let s=null,n=x(this.dom,this.name+"-loading","ln-table")||x(this.dom,"table-loading","ln-table");if(!n){const c=this.dom.querySelector("template[data-ln-table-loading]");c&&(n=document.importNode(c.content,!0))}if(n)if(n.tagName==="TR")s=n;else{const c=document.createElement("td");c.setAttribute("colspan",String(i)),c.appendChild(n);const f=document.createElement("tr");f.className="table-empty ln-table__empty",f.appendChild(c),s=f}s?this.tbody.replaceChildren(s):this.tbody.replaceChildren()},o.prototype._showEmptyState=function(){this._rowPool=null,this._topSpacer=null,this._topTd=null,this._bottomSpacer=null,this._bottomTd=null;const i=this.ths.length||1;let s=null,n=null;if(this.isDataDriven){const c=this._lastTotal!=null?this._lastTotal:this._data.length,w=this.visibleCount===0&&c>0,p=w?this.name+"-empty-filtered":this.name+"-empty";if(n=x(this.dom,p,"ln-table")||x(this.dom,w?"table-empty-filtered":"table-empty","ln-table"),!n){const b=this.dom.querySelector("template[data-ln-table-empty]");if(b){const _=w?"search":"initial",g=b.content.querySelector('[data-ln-table-empty-when="'+_+'"]')||b.content.firstElementChild;g&&(n=document.importNode(g,!0))}}}else if(n=x(this.dom,this.name+"-empty","ln-table")||x(this.dom,"table-empty","ln-table"),!n){const c=this.dom.querySelector("template[data-ln-table-empty]");c&&(n=document.importNode(c.content,!0))}if(n)if(n.tagName==="TR")s=n;else{const c=document.createElement("td");c.setAttribute("colspan",String(i)),c.appendChild(n);const f=document.createElement("tr");f.className="ln-table__empty",f.appendChild(c),s=f}s?this.tbody.replaceChildren(s):this.tbody.replaceChildren(),y(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})},o.prototype._fillRow=function(i,s){I(i,s);const n=i.querySelectorAll("[data-ln-table-cell-attr]");for(let c=0;c<n.length;c++){const f=n[c],w=f.getAttribute("data-ln-table-cell-attr").split(",");for(let p=0;p<w.length;p++){const b=w[p].trim().split(":");if(b.length!==2)continue;const _=b[0].trim(),g=b[1].trim();s[_]!=null&&f.setAttribute(g,s[_])}}},o.prototype._buildRow=function(i){let s=x(this.dom,this.name+"-row","ln-table");if(!s){const c=this.dom.querySelector("template[data-ln-table-row]");c&&(s=document.importNode(c.content,!0))}let n=s?s.querySelector("[data-ln-table-row]")||s.firstElementChild:null;if(n)this._fillRow(n,i);else if(i&&i.html){const c=document.createElement("tbody");c.innerHTML=i.html,n=c.firstElementChild}else return(window.lnDebug||typeof document<"u"&&document.body&&document.body.hasAttribute("data-ln-debug"))&&console.warn(`[ln-table] Missing row template: <template data-ln-template="${this.name}-row">`),null;if(n._lnRecord=i,i.id!=null&&n.setAttribute("data-ln-table-row-id",i.id),this._selectable&&i.id!=null&&this.selectedIds.has(String(i.id))){n.classList.add("ln-row-selected");const c=n.querySelector("[data-ln-table-row-select]");c&&(c.checked=!0)}return n},o.prototype._requestData=function(){ut(this,"ln-table:request-data","table")},o.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const i=this.tbody.querySelectorAll("[data-ln-table-row]"),s=[];for(let c=0;c<i.length;c++){const f=i[c].getAttribute("data-ln-table-row-id");f!=null&&s.push(f)}const n=Yt(s,this.selectedIds);this._selectAllCheckbox.checked=n.isAllSelected,this._selectAllCheckbox.indeterminate=n.isIndeterminate},o.prototype._restoreSelection=function(){if(!this.tbody)return;const i=this.tbody.querySelectorAll("[data-ln-table-row]");for(let s=0;s<i.length;s++){const n=i[s].getAttribute("data-ln-table-row-id"),c=n!=null&&this.selectedIds.has(n);i[s].classList.toggle("ln-row-selected",c);const f=i[s].querySelector("[data-ln-table-row-select]");f&&(f.checked=c)}this._updateSelectAll()},Object.defineProperty(o.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),o.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const i=this;if(this._onSelectionChange=function(s){const n=s.target.closest("[data-ln-table-row-select]");if(!n)return;const c=n.closest("[data-ln-table-row]");if(!c)return;const f=c.getAttribute("data-ln-table-row-id");f!=null&&(i.selectedIds=ct(i.selectedIds,f,n.checked),c.classList.toggle("ln-row-selected",n.checked),i.selectedCount=i.selectedIds.size,i._updateSelectAll(),i._updateFooter(),y(i.dom,"ln-table:select",{table:i.name,selectedIds:i.selectedIds,count:i.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 s=document.createElement("input");s.type="checkbox";const n=i.dom.querySelector('[data-ln-table-dict="select-all"]'),c=i.dom.getAttribute("data-ln-table-select-all-label")||(n?n.textContent.trim():null)||"Select all";s.setAttribute("aria-label",c),this._selectAllCheckbox.appendChild(s),this._selectAllCheckbox=s}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const s=i._selectAllCheckbox.checked,n=i.tbody?i.tbody.querySelectorAll("[data-ln-table-row]"):[],c=[];for(let f=0;f<n.length;f++){const w=n[f].getAttribute("data-ln-table-row-id"),p=n[f].querySelector("[data-ln-table-row-select]");w!=null&&(c.push(w),n[f].classList.toggle("ln-row-selected",s),p&&(p.checked=s))}i.selectedIds=dt(i.selectedIds,c,s),i.selectedCount=i.selectedIds.size,y(i.dom,"ln-table:select-all",{table:i.name,selected:s}),y(i.dom,"ln-table:select",{table:i.name,selectedIds:i.selectedIds,count:i.selectedCount}),i._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const s=this.tbody.querySelectorAll("[data-ln-table-row]");for(let n=0;n<s.length;n++){const c=s[n].querySelector("[data-ln-table-row-select]"),f=s[n].getAttribute("data-ln-table-row-id");c&&c.checked&&f!=null&&(i.selectedIds=ct(i.selectedIds,f,!0),s[n].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},o.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 i=this.dom.querySelector("[data-ln-table-col-select]");if(i){const s=i.querySelector('input[type="checkbox"]');s&&s.remove()}if(this._selectAllCheckbox=null,this.selectedIds=dt(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const s=this.tbody.querySelectorAll("[data-ln-table-row]");for(let n=0;n<s.length;n++){s[n].classList.remove("ln-row-selected");const c=s[n].querySelector("[data-ln-table-row-select]");c&&(c.checked=!1)}}this._updateFooter()},o.prototype._updateFooter=function(){let i=0,s=0;this.isDataDriven?(i=this._lastTotal!=null?this._lastTotal:this._data.length,s=this.visibleCount):(i=this._data.length,s=this._filteredData.length);const n=s<i;if(this._totalSpan&&d(this._totalSpan,i),this._filteredSpan&&d(this._filteredSpan,n?s:null),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!n),this._selectedSpan){const c=this.selectedIds?this.selectedIds.size:0;d(this._selectedSpan,c>0?c:null),this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",c===0)}},o.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-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onRowClick),this.tbody.removeEventListener("click",this._onRowAction))):(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._loadingIndicator=null,this._data=[],this._filteredData=[],delete this.dom[e])},st(t,e,o,"ln-table",{attributes:a})})()})();
|
|
1
|
+
(function(){"use strict";function P(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function R(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 a=1;a<e.length;a++)if(e[a]&&e[a].nodeType===1){r=e[a];break}if(!R(r))return}t.apply(console,e)}}function y(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 ut(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,y(t.dom,e,r)}function D(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){D(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function W(t){return t.hasAttribute("value")?t.getAttribute("value"):t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.textContent.trim()}function ht(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function ft(t,e){const l=!!(e&&e.typed),r=e&&e.exclude,a={},u=t.elements,d={};if(l)for(let h=0;h<u.length;h++){const o=u[h];o.name&&o.type==="checkbox"&&!o.disabled&&(d[o.name]=(d[o.name]||0)+1)}for(let h=0;h<u.length;h++){const o=u[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&&d[o.name]===1?a[o.name]=o.checked:(a[o.name]||(a[o.name]=[]),o.checked&&a[o.name].push(o.value));else if(o.type==="radio")o.checked&&(a[o.name]=o.value);else if(o.type==="select-multiple"){a[o.name]=[];for(let i=0;i<o.options.length;i++)o.options[i].selected&&a[o.name].push(o.options[i].value)}else if(l&&o.type==="hidden")a[o.name]=o.value;else if(l&&(o.type==="number"||o.type==="range")){const i=Number(o.value);a[o.name]=o.value===""||isNaN(i)?null:i}else a[o.name]=o.value}return a}function bt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function pt(t,e){const l=t.elements,r=[],a={};for(let u=0;u<l.length;u++){const d=l[u];d.name&&d.type==="checkbox"&&(a[d.name]=(a[d.name]||0)+1)}for(let u=0;u<l.length;u++){const d=l[u];if(d.type==="file"||d.type==="submit"||d.type==="button")continue;const h=d.getAttribute("data-ln-fill-as")||d.name;if(!h||!(h in e))continue;const o=e[h];if(d.type==="checkbox"){if(Array.isArray(o))d.checked=o.indexOf(d.value)!==-1;else if(a[d.name]>1){const i=String(o).split(",").map(function(s){return s.trim()});d.checked=i.indexOf(d.value)!==-1}else d.checked=bt(o);r.push(d)}else if(d.type==="radio")d.checked=d.value===String(o),r.push(d);else if(d.type==="select-multiple"){if(Array.isArray(o))for(let i=0;i<d.options.length;i++)d.options[i].selected=o.indexOf(d.options[i].value)!==-1;r.push(d)}else d.value=o,d.tagName==="SELECT"&&o!=null&&d.setAttribute("data-ln-value",o),r.push(d)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=pt,window.lnCore.serializeForm=ft,window.lnCore.resolveFormMethod=ht);const $={};function wt(t,e){$[t]=e}function _t(t){return $[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=wt,window.lnCore.getDataMapper=_t);function gt(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,D(function(){new MutationObserver(function(){y(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const j={};function mt(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];j[l]=e}function yt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return j[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=mt,window.lnCore.getLocaleFallback=yt,window.lnCore.ensureLocaleObserver=gt);const F={};function U(t,e){F[t]||(F[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=F[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function x(t,e,l){if(t){const r=t.querySelector('[data-ln-template="'+e+'"]');if(r)return r.content.cloneNode(!0)}return U(e,l)}function z(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let d=0;d<l.length;d++){const h=l[d],o=h.getAttribute("data-ln-field");e[o]!=null&&(h.textContent=e[o])}const r=t.querySelectorAll("[data-ln-attr]");for(let d=0;d<r.length;d++){const h=r[d],o=h.getAttribute("data-ln-attr").split(",");for(let i=0;i<o.length;i++){const s=o[i].trim().split(":");if(s.length!==2)continue;const n=s[0].trim(),c=s[1].trim();e[c]!=null&&h.setAttribute(n,e[c])}}const a=t.querySelectorAll("[data-ln-show]");for(let d=0;d<a.length;d++){const h=a[d],o=h.getAttribute("data-ln-show");o in e&&h.classList.toggle("hidden",!e[o])}const u=t.querySelectorAll("[data-ln-class]");for(let d=0;d<u.length;d++){const h=u[d],o=h.getAttribute("data-ln-class").split(",");for(let i=0;i<o.length;i++){const s=o[i].trim().split(":");if(s.length!==2)continue;const n=s[0].trim(),c=s[1].trim();c in e&&h.classList.toggle(n,!!e[c])}}return t}function Ct(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)z(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 I(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const u=l.currentNode;u.textContent.indexOf("{{")!==-1&&(u.textContent=u.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(d,h){return e[h]!==void 0?e[h]:""}))}const r=function(u,d){return e[d]!==void 0?e[d]:""},a=Array.from(t.querySelectorAll("*"));t.nodeType===1&&a.push(t);for(let u=0;u<a.length;u++){const d=a[u],h=d.attributes;for(let o=0;o<h.length;o++){const i=h[o];i.value.indexOf("{{")!==-1&&d.setAttribute(i.name,i.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function St(t,e,l,r,a,u){const d={};for(let o=0;o<t.children.length;o++){const i=t.children[o],s=i.getAttribute("data-ln-render-key");s&&(d[s]=i)}const h=document.createDocumentFragment();for(let o=0;o<e.length;o++){const i=e[o],s=String(r(i));let n=d[s];if(n)a(n,i,o);else{const c=U(l,u);if(!c||(I(c,i),n=c.firstElementChild,!n))continue;n.setAttribute("data-ln-render-key",s),a(n,i,o)}h.appendChild(n)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=I,window.lnCore.fill=z,window.lnCore.lnFill=Ct,window.lnCore.renderList=St);function k(t,e,l){const r=t.getAttribute(e);return r===null?l:r}function Q(t,e,l){const r=parseInt(t.getAttribute(e),10);return isNaN(r)?l:r}function O(t,e,l=!1){const r=t.getAttribute(e);if(r===null)return!!l;const a=r.trim().toLowerCase();return!(a==="false"||a==="0")}function K(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const N=new Map;function J(t,e){const l=(t?t.join("|"):"")+"::"+e;if(N.has(l))return N.get(l);const r=new Set(t||[]),a=function(u,d){const h=u.getAttribute(d);return h!==null&&r.has(h)?h:e};return N.set(l,a),a}function G(t,e,l){const r=parseFloat(t.getAttribute(e));return isNaN(r)?l:r}function Y(t,e,l){const r=t.getAttribute(e);if(!r)return l;try{return JSON.parse(r)}catch{return l}}function X(t,e,l,r,a){if(!t||e===null)return!0;const u=r||"ln-component",d=t.type;if(d==="trigger"||d==="marker"||d==="string"||d==="list"||!d||e===""&&t.fallback!==void 0)return!0;const h=o=>{a?console.warn(o,a):console.warn(o)};if(d==="boolean"){const o=e.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(h(`[${u}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(d==="enum"){const o=t.values||[];return o.includes(e)?!0:(h(`[${u}] Invalid value "${e}" for attribute "${l}". Allowed: ${o.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(d==="integer"){if(!/^-?\d+$/.test(e))return h(`[${u}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const o=parseInt(e,10);return t.min!==void 0&&o<t.min?(h(`[${u}] Value ${o} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&o>t.max?(h(`[${u}] Value ${o} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(d==="float")return isNaN(Number(e))?(h(`[${u}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(d==="json")try{return JSON.parse(e),!0}catch(o){return h(`[${u}] Invalid JSON for attribute "${l}": ${o.message}. Fallback: ${t.fallback}.`),!1}return!0}function Z(t,e,l){for(const r in l){const[a,u,d]=l[r];Object.defineProperty(t,r,{get:function(){return a(e,u,d)},enumerable:!0,configurable:!0})}return t}function tt(t){const e={};for(const l in t){const r=t[l];if(!r||!r.prop)continue;let a=r.read;if(!a&&r.type)switch(r.type){case"enum":a=J(r.values,r.fallback);break;case"integer":a=Q;break;case"float":a=G;break;case"boolean":a=O;break;case"list":a=K;break;case"json":a=Y;break;case"string":default:a=k;break}a||(a=k),e[r.prop]=[a,l,r.fallback]}return e}function At(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 vt(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=Z,window.lnCore.attrSpec=tt,window.lnCore.attrStr=k,window.lnCore.attrInt=Q,window.lnCore.attrBool=O,window.lnCore.attrList=K,window.lnCore.attrEnum=J,window.lnCore.attrFloat=G,window.lnCore.attrJson=Y);function q(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 et(t,e,l,r){if(t.nodeType!==1)return;const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",d={selector:e,attribute:l,ComponentFn:r};if(t.matches&&t.matches(u)&&q(t,d),t.querySelectorAll){const h=t.querySelectorAll(u);for(let o=0;o<h.length;o++)q(h[o],d)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function xt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Et(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 nt(){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 Tt(t){const e=nt(),l=t.observed||[];for(let r=0;r<l.length;r++){const a=l[r];e.byAttr.has(a)||e.byAttr.set(a,[]),e.byAttr.get(a).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 a=e.byDeclaredAttr.get(r);a.some(u=>u.componentTag===t.componentTag)||a.push({spec:t.attributes[r],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const r=vt(t);if(r===null)e.reactiveWildcard.push(t);else for(const a of r)e.byReactive.has(a)||e.byReactive.set(a,[]),e.byReactive.get(a).push(t)}t.persist&&e.persist.push(t)}function it(t,e,l,r){for(let a=0;a<t.length;a++){const u=t[a];if(!e[u.attribute])continue;const d=u.effects&&u.effects[l];d?d(e,l,r):u.onAttrChange&&(!u.declared||u.declared.has(l))&&u.onAttrChange(e,l,r)}}function Lt(t){const e=t.attributeName,l=e.indexOf("data-ln-")===0,r=nt(),a=r.byAttr.get(e),u=P()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(e);if(!l&&!a&&!u)return;const d=t.target;if(t.oldValue!==d.getAttribute(e)){if(u&&R(d)){const h=r.byDeclaredAttr.get(e),o=d.getAttribute(e);for(let i=0;i<h.length;i++)X(h[i].spec,o,e,h[i].componentTag,d)}if(window.lnCore._debugSink&&(l||a)&&window.lnCore._debugSink("attr",e,d,{oldValue:t.oldValue,newValue:d.getAttribute(e)}),l){const h=r.byReactive.get(e);h&&it(h,d,e,t.oldValue),r.reactiveWildcard.length&&it(r.reactiveWildcard,d,e,t.oldValue)}if(a)for(let h=0;h<a.length;h++){const o=a[h];if(o.handler){o.handler(d,e,t.oldValue);continue}o.onAttributeChange&&d[o.attribute]?o.onAttributeChange(d,e):(et(d,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(d))}}}function kt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,D(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Lt(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 H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function M(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function lt(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 ot(t){const e=H();if(!e.length)return;const l=t.target;if(l){const a=l.nodeType===1?l:l.parentElement;if(a&&(a.isContentEditable||a.closest&&a.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=M();if(t.target&&r.length)for(let a=0;a<r.length;a++){const u=r[a],d=u.query,h=t.target.nodeType===1?t.target.matches&&t.target.matches(d)?t.target:t.target.closest?t.target.closest(d):null:t.target.parentElement&&t.target.parentElement.closest?t.target.parentElement.closest(d):null;h&&u.onSubtreeChange(h,t)}for(let a=0;a<t.addedNodes.length;a++){const u=t.addedNodes[a];if(u.nodeType!==1)continue;const d=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const o=e[h],i=o.query;if(i&&(u.matches&&u.matches(i)&&(o.ComponentFn&&q(u,o),o.onInit&&o.onInit(u)),d&&u.querySelectorAll)){const s=u.querySelectorAll(i);for(let n=0;n<s.length;n++)o.ComponentFn&&q(s[n],o),o.onInit&&o.onInit(s[n])}}}for(let a=0;a<t.removedNodes.length;a++){const u=t.removedNodes[a];if(u.nodeType!==1||document.contains(u))continue;const d=!!(u.firstElementChild||u.children&&u.children.length);for(let h=0;h<e.length;h++){const o=e[h],i=o.query;if(i&&(u.matches&&u.matches(i)&<(u,o),d&&u.querySelectorAll)){const s=u.querySelectorAll(i);for(let n=0;n<s.length;n++)lt(s[n],o)}}}}function rt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,D(function(){const t=new MutationObserver(function(e){for(let l=0;l<e.length;l++){const r=e[l];if(r.type==="childList")try{ot(r)}catch(a){console.error("[ln-core] lifecycle handler failed",r.target,a)}}});window.lnCore._lifecycleObserver=t,t.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Dt(t){if(typeof window>"u")return t();window.lnCore=window.lnCore||{};const e=window.lnCore._lifecycleObserver;if(!e)return t();const l=e.takeRecords();for(let r=0;r<l.length;r++){const a=l[r];if(a.type==="childList")try{ot(a)}catch(u){console.error("[ln-core] lifecycle handler failed",a.target,u)}}e.disconnect();try{return t()}finally{e.observe(document.body,{childList:!0,subtree:!0})}}function qt(t){H().push(t),t.onSubtreeChange&&t.query&&M().push(t),rt()}function st(t,e,l,r,a={}){const u=a.extraAttributes||[],d=a.onAttributeChange||null,h=a.onSubtreeChange||null,o=a.onInit||null,i=a.onAttrChange||null,s=a.effects||null,n=a.attributes||null,c=n?At(n):s,f=n?new Set(Object.keys(n)):null,w=a.persist||null;function p(S){const m=S||document.body;if(et(m,t,e,l),n&&P())for(const A in n){const v=n[A],L=Array.from(m.querySelectorAll("["+A+"]"));m.matches&&m.matches("["+A+"]")&&L.push(m);for(let T=0;T<L.length;T++){const V=L[T];R(V)&&X(v,V.getAttribute(A),A,r,V)}}o&&o(m)}const b=[];if(t.indexOf("[")!==-1){const S=/\[([\w-]+)/g;let m;for(;(m=S.exec(t))!==null;)b.push(m[1])}else b.push(t);Tt({selector:t,attribute:e,componentTag:r,attributes:n,ComponentFn:l,onInit:o,observed:b.concat(u),onAttributeChange:d,onAttrChange:i,effects:c,declared:f,persist:w}),kt();const _=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,g=a.subtreeQuery||(_?t:"["+t+"]"),C={selector:t,attribute:e,ComponentFn:l,onInit:o,onSubtreeChange:h,query:g};H().push(C),h&&g&&M().push(C),rt(),window[e]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=st,window.lnCore.observeLifecycle=qt,window.lnCore.withoutLifecycle=Dt);function E(){xt()>0?Et(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",E):E(),p}function at(t){return(t||"").replace(/^#/,"")}function B(t){const e=t===void 0?location.hash:t,l={},r=at(e);if(!r)return l;const a=r.split("&");for(let u=0;u<a.length;u++){const d=a[u];if(!d)continue;const h=d.indexOf(":"),o=h>-1?d.slice(0,h):d,i=h>-1?d.slice(h+1):"";if(o)try{l[o]=decodeURIComponent(i)}catch{l[o]=i}}return l}function Rt(t){if(!t)return null;const e=B();return t in e?e[t]:null}function Ft(t,e){if(!t)return;const l=B();e==null?delete l[t]:l[t]=String(e);const a=Object.keys(l).map(function(u){const d=l[u];return d===""?u:u+":"+encodeURIComponent(d)}).join("&");at(location.hash)!==a&&(location.hash=a)}function It(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function Ot(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 Nt(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function Ht(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 Mt(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function Bt(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),a=r?r.split(",").map(function(u){try{return decodeURIComponent(u)}catch{return u}}).filter(Boolean):[];return{key:l,values:a}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=B,window.lnCore.hashGet=Rt,window.lnCore.hashSet=Ft,window.lnCore.hashLinkClick=It,window.lnCore.resolveHashNamespace=Ot,window.lnCore.hashSortEncode=Nt,window.lnCore.hashSortDecode=Ht,window.lnCore.hashFilterEncode=Mt,window.lnCore.hashFilterDecode=Bt);function Vt(t){return(t||"").replace(/^\?/,"")}function Pt(t){const e=t===void 0?typeof window<"u"?window.location.search:"":t,l={},r=Vt(e);if(!r)return l;const a=new URLSearchParams(r);for(const[u,d]of a.entries())l[u]=d;return l}function Wt(t){if(!t||typeof window>"u")return null;const e=new URLSearchParams(window.location.search);return e.has(t)?e.get(t):null}function $t(t,e){if(!t||typeof window>"u")return;const l=new URL(window.location.href);if(e==null||e===""?l.searchParams.delete(t):l.searchParams.set(t,String(e)),l.search===window.location.search)return;const r=l.pathname+l.search+l.hash;window.history.replaceState(window.history.state,"",r)}function jt(t,e){if(!t||!t.hasAttribute("data-ln-query"))return null;const l=t.getAttribute("data-ln-query");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 Ut(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function zt(t,e){if(t&&typeof t=="string"){if(t.endsWith(".asc"))return{fieldOrColumn:t.slice(0,-4),direction:"asc"};if(t.endsWith(".desc"))return{fieldOrColumn:t.slice(0,-5),direction:"desc"}}if(e&&typeof e=="object"){const l=e.sort_field||e.sort_by;if(l){const r=e.sort_dir&&String(e.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:l,direction:r}}}return null}function Qt(t){return!Array.isArray(t)||t.length===0?null:t.map(encodeURIComponent).join(",")}function Kt(t){return!t||typeof t!="string"?[]:t.split(",").map(function(e){try{return decodeURIComponent(e.trim())}catch{return e.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Pt,window.lnCore.queryGet=Wt,window.lnCore.querySet=$t,window.lnCore.resolveQueryParam=jt,window.lnCore.querySortEncode=Ut,window.lnCore.querySortDecode=zt,window.lnCore.queryFilterEncode=Qt,window.lnCore.queryFilterDecode=Kt);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 Gt(t,e,l,r,a=15){if(r<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const u=Math.max(0,t||0),d=Math.max(0,e||0),h=Math.floor(u/l),o=Math.ceil(d/l),i=Math.max(0,h-a),s=Math.min(r,h+o+a),n=i*l,c=Math.max(0,(r-s)*l);return{start:i,end:s,topPadding:n,bottomPadding:c}}function Yt(t,e){const l=Array.isArray(t)?t.length:0,r=e instanceof Set?e:new Set(e||[]);let a=0;if(Array.isArray(t))for(let h=0;h<t.length;h++)r.has(t[h])&&a++;else a=r.size;const u=l>0&&a===l,d=a>0&&a<l;return{totalCount:l,selectedCount:a,isAllSelected:u,isIndeterminate:d}}function ct(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 dt(t,e,l){const r=new Set(t);if(!Array.isArray(e))return r;if(l)for(let a=0;a<e.length;a++)e[a]!=null&&r.add(e[a]);else for(let a=0;a<e.length;a++)r.delete(e[a]);return r}(function(){const t="data-ln-table",e="lnTable";if(window[e]!==void 0)return;const a={"data-ln-table":{prop:"name",type:"string",read:k,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:k,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:O,description:"Enables row selection check controls"},"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-select-all-label":{type:"string",description:"Accessibility label for select-all header trigger"}},u=tt(a);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function d(i,s){if(!i)return;if(s==null||isNaN(s)){i.removeAttribute("data-ln-value"),"value"in i&&i.tagName==="DATA"&&(i.value=""),i.lnNumber?i.lnNumber.value=NaN:i.textContent="";return}const n=String(s);i.setAttribute("data-ln-value",n),"value"in i&&i.tagName==="DATA"&&(i.value=n),i.lnNumber?i.lnNumber.value=s:i.textContent=n}function h(i,s){let n=s?s.parentElement:i;for(;n&&n!==document.body&&n!==document.documentElement;){const f=getComputedStyle(n).overflowY;if(f==="auto"||f==="scroll")return n;n=n.parentElement}return null}function o(i){this.dom=i,Z(this,i,u),this.table=i.querySelector("table"),this.tbody=i.querySelector("[data-ln-table-body]")||i.querySelector("tbody"),this.thead=i.querySelector("thead");const s=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=s?Array.from(s.querySelectorAll("th")):[],this._totalSpan=i.querySelector("[data-ln-table-total]"),this._filteredSpan=i.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==i?this._filteredSpan.parentElement:null),this._selectedSpan=i.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==i?this._selectedSpan.parentElement:null),this._loadingIndicator=i.querySelector("[data-ln-table-loading]"),this._loadingIndicator&&this._loadingIndicator.classList.add("hidden"),this.isDataDriven=i.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,this._rowPool=null,this._topSpacer=null,this._topTd=null,this._bottomSpacer=null,this._bottomTd=null;const n=this;return this._onSetSearch=function(c){const f=(c.detail&&c.detail.query!=null?c.detail.query:c.detail&&c.detail.term!=null?c.detail.term:"").trim();n.isDataDriven?(n.currentSearch=f,y(i,"ln-table:search",{table:n.name,query:n.currentSearch}),n._requestData()):(n._searchTerm=f.toLowerCase(),n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),y(i,"ln-table:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length}))},i.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(c){c.preventDefault(),n._onSetSearch(c)},i.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){n.isDataDriven?(n.currentFilters={},n.currentSearch="",y(i,"ln-table:clear-filters",{table:n.name}),n._requestData()):(n._searchTerm="",n._columnFilters={},n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),y(i,"ln-table:filter",{term:"",matched:n._filteredData.length,total:n._data.length}))},i.addEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this._initialLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._onSetData=function(c){const f=c.detail||{},w=f.data||[],p=f.total!=null?f.total:w.length;n._hasInitialSeed&&!n.isLoaded&&w.length===0&&p===0||(n._data=w,n._lastTotal=p,n._lastFiltered=f.filtered!=null?f.filtered:n._data.length,n.totalCount=n._lastTotal,n.visibleCount=n._lastFiltered,n.isLoaded=!0,n._initialLoaded=!0,n._hasInitialSeed=!1,i.classList.remove("ln-table--loading"),i.setAttribute("aria-busy","false"),n._loadingIndicator&&n._loadingIndicator.classList.add("hidden"),n._vStart=-1,n._vEnd=-1,n._applyFilterAndSort(),n._render(),n._updateFooter(),y(i,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},i.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(c){const f=!!(c.detail&&c.detail.loading);i.classList.toggle("ln-table--loading",f),i.setAttribute("aria-busy",f?"true":"false"),f&&!n._initialLoaded&&(n.isLoaded=!1,n._showLoadingState()),n._loadingIndicator&&n._loadingIndicator.classList.toggle("hidden",!(f&&n._initialLoaded))},i.addEventListener("ln-table:set-loading",this._onSetLoading),this._onSort=function(c){!c.detail||c.detail.field==null||(c.preventDefault(),n.currentSort=c.detail.direction==="none"?null:{field:c.detail.field,direction:c.detail.direction},n._requestData())},i.addEventListener("ln-sort:change",this._onSort),this._onRowClick=function(c){if(c.target.closest("[data-ln-table-row-select]")||c.target.closest("[data-ln-table-row-action]")||c.target.closest("a")||c.target.closest("button")||c.ctrlKey||c.metaKey||c.button===1)return;const f=c.target.closest("[data-ln-table-row]");if(!f)return;const w=f.getAttribute("data-ln-table-row-id"),p=f._lnRecord||{};y(i,"ln-table:row-click",{table:n.name,id:w,record:p})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(c){const f=c.target.closest("[data-ln-table-row-action]");if(!f)return;const w=f.closest("[data-ln-table-row]");if(!w)return;const p=f.getAttribute("data-ln-table-row-action"),b=w.getAttribute("data-ln-table-row-id"),_=w._lnRecord||{};y(i,"ln-table:row-action",{table:n.name,id:b,action:p,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0?this._parseRows():(this._showLoadingState(),i.setAttribute("aria-busy","true")),setTimeout(function(){!n.dom||!document.contains(n.dom)||y(i,"ln-table:request-data",{table:n.name,sort:n.currentSort,filters:n.currentFilters,search:n.currentSearch})},0)):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){n.tbody.rows.length>0&&(n._emptyTbodyObserver.disconnect(),n._emptyTbodyObserver=null,n._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(c){if(!c.detail||c.detail.column==null)return;c.preventDefault();const f=c.detail.direction==="none"?null:c.detail.direction;n._sortCol=f===null?-1:c.detail.column,n._sortDir=f,n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),y(i,"ln-table:sorted",{column:c.detail.column,direction:c.detail.direction,matched:n._filteredData.length,total:n._data.length})},i.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(c){if(c.preventDefault(),!c.detail)return;const f=c.detail.key,w=c.detail.values||[];if(f){if(w.length===0)delete n._columnFilters[f];else{const p=[];for(let b=0;b<w.length;b++)p.push(w[b].toLowerCase());n._columnFilters[f]=p}n._applyFilterAndSort(),n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),y(i,"ln-table:filter",{term:n._searchTerm,matched:n._filteredData.length,total:n._data.length})}},i.addEventListener("ln-filter:change",this._onFilterChange)),this}o.prototype._parseRows=function(){const i=this.tbody.rows,s=this.ths;this._data=[],i.length>0&&(this._rowHeight=i[0].offsetHeight||40),this._lockColumnWidths();for(let n=0;n<i.length;n++){const c=i[n],f=[],w=[],p=[];for(let _=0;_<c.cells.length;_++){const g=c.cells[_],C=g.textContent.trim();f[_]=W(g),w[_]=C.toLowerCase(),g.querySelector("[data-ln-table-row-action]")||p.push(C.toLowerCase())}let b=null;if(this.isDataDriven){b={};const _=c.getAttribute("data-ln-table-row-id");_!=null&&(b.id=_);for(let g=0;g<s.length;g++){const C=s[g].getAttribute("data-ln-table-col");if(C){const E=g;if(E<c.cells.length){const S=c.cells[E];b[C]=W(S)}}}}this._data.push({values:f,rawTexts:w,html:c.outerHTML,searchText:p.join(" "),id:this.isDataDriven&&b?b.id:void 0,...b})}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(),y(this.dom,"ln-table:ready",{total:this._data.length})},o.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},o.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const i=document.createElement("colgroup");this.ths.forEach(function(s){const n=document.createElement("col");n.style.width=s.offsetWidth+"px",i.appendChild(n)}),this.table.insertBefore(i,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=i},o.prototype._render=function(){if(this.tbody)if(this.isDataDriven){const i=this._lastTotal,s=this.visibleCount;if(i===0){if(this._disableVirtualScroll(),!this.isLoaded){this._showLoadingState();return}this._showEmptyState();return}if(this._filteredData.length===0||s===0){if(this._disableVirtualScroll(),!this.isLoaded){this._showLoadingState();return}this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const i=this._filteredData.length;i===0&&(this._searchTerm||Object.keys(this._columnFilters).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):i>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},o.prototype._renderAll=function(){this._rowPool=null,this._topSpacer=null,this._topTd=null,this._bottomSpacer=null,this._bottomTd=null;const i=this._filteredData;if(this.isDataDriven||i.length>0&&!i[0].html){const s=document.createDocumentFragment();for(let n=0;n<i.length;n++){const c=this._buildRow(i[n]);if(!c)break;s.appendChild(c)}this.tbody.replaceChildren(s),this._selectable&&this._updateSelectAll()}else{const s=[];for(let n=0;n<i.length;n++)s.push(i[n].html);this.tbody.innerHTML=s.join(""),this._selectable&&this._restoreSelection()}},o.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const i=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let n=null;this.isDataDriven&&this._data.length>0&&(n=this._buildRow(this._data[0])),n&&this.tbody&&(this.tbody.appendChild(n),this._rowHeight=n.offsetHeight||40,n.remove())}this._scrollContainer=h(this.dom,this.table);const s=this._scrollContainer||window;this.dom&&(this.dom.style.overflowAnchor="none"),this.table&&(this.table.style.overflowAnchor="none"),this.tbody&&(this.tbody.style.overflowAnchor="none"),this._scrollContainer&&(this._scrollContainer.style.overflowAnchor="none"),this._scrollHandler=function(){i._rafId||(i._rafId=requestAnimationFrame(function(){i._rafId=null,i._renderVirtual()}))},s.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},o.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,this._rowPool=null,this._topSpacer=null,this._topTd=null,this._bottomSpacer=null,this._bottomTd=null)},o.prototype._compileRowBindings=function(i){const s={textNodes:[],attrs:[],cellAttrs:[]},n=document.createTreeWalker(i,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const f=n.currentNode;if(f.textContent.indexOf("{{")!==-1){const w=f.parentElement;s.textNodes.push({node:f,raw:f.textContent,el:w,isLeaf:!!(w&&w.children.length===0)})}}const c=Array.from(i.querySelectorAll("*"));i.nodeType===1&&c.push(i);for(let f=0;f<c.length;f++){const w=c[f];if(w.hasAttribute("data-ln-table-cell-attr")){const b=w.getAttribute("data-ln-table-cell-attr").split(",");for(let _=0;_<b.length;_++){const g=b[_].trim().split(":");g.length===2&&s.cellAttrs.push({el:w,field:g[0].trim(),attr:g[1].trim()})}}const p=w.attributes;for(let b=0;b<p.length;b++){const _=p[b];_.value.indexOf("{{")!==-1&&s.attrs.push({el:w,name:_.name,raw:_.value})}}return i._lnBindings=s,s},o.prototype._createTemplateRow=function(){let i=x(this.dom,this.name+"-row","ln-table");if(!i){const n=this.dom.querySelector("template[data-ln-table-row]");n&&(i=document.importNode(n.content,!0))}let s=i?i.querySelector("[data-ln-table-row]")||i.firstElementChild:null;return s?(this._compileRowBindings(s),s):((window.lnDebug||typeof document<"u"&&document.body&&document.body.hasAttribute("data-ln-debug"))&&console.warn(`[ln-table] Missing row template: <template data-ln-template="${this.name}-row">`),null)},o.prototype._updateRow=function(i,s){if(!s)return;i._lnRecord=s,s.id!=null&&i.setAttribute("data-ln-table-row-id",s.id);const n=i._lnBindings||this._compileRowBindings(i),c=n.textNodes;for(let p=0;p<c.length;p++){const b=c[p],_=b.raw.replace(/\{\{\s*(\w+)\s*\}\}/g,function(g,C){return s[C]!==void 0&&s[C]!==null?s[C]:""});b.isLeaf&&b.el?b.el.textContent=_:b.node&&b.node.parentNode?b.node.textContent=_:b.el&&(b.el.textContent=_)}const f=n.attrs;for(let p=0;p<f.length;p++){const b=f[p];b.el.setAttribute(b.name,b.raw.replace(/\{\{\s*(\w+)\s*\}\}/g,function(_,g){return s[g]!==void 0&&s[g]!==null?s[g]:""}))}const w=n.cellAttrs;for(let p=0;p<w.length;p++){const b=w[p],_=s[b.field];_!=null&&b.el.setAttribute(b.attr,_)}if(n.textNodes.length===0&&n.attrs.length===0&&this.ths.length>0)for(let p=0;p<this.ths.length;p++){const b=this.ths[p].getAttribute("data-ln-table-col");b&&p<i.cells.length&&s[b]!=null&&(i.cells[p].textContent=String(s[b]))}if(this._selectable){const p=s.id!=null?String(s.id):null,b=p!=null&&this.selectedIds.has(p);i.classList.toggle("ln-row-selected",b);const _=i.querySelector("[data-ln-table-row-select]");_&&(_.checked=b)}},o.prototype._ensureRowPool=function(i,s){for(this._rowPool?this._topTd&&this._topTd.getAttribute("colspan")!==String(s)&&(this._topTd.setAttribute("colspan",s),this._bottomTd.setAttribute("colspan",s)):(this._rowPool=[],this._topSpacer=document.createElement("tr"),this._topSpacer.className="ln-table__spacer",this._topSpacer.setAttribute("aria-hidden","true"),this._topSpacer.style.overflowAnchor="none",this._topTd=document.createElement("td"),this._topTd.setAttribute("colspan",s),this._topTd.style.padding="0",this._topTd.style.border="none",this._topTd.style.overflowAnchor="none",this._topSpacer.appendChild(this._topTd),this._bottomSpacer=document.createElement("tr"),this._bottomSpacer.className="ln-table__spacer",this._bottomSpacer.setAttribute("aria-hidden","true"),this._bottomSpacer.style.overflowAnchor="none",this._bottomTd=document.createElement("td"),this._bottomTd.setAttribute("colspan",s),this._bottomTd.style.padding="0",this._bottomTd.style.border="none",this._bottomTd.style.overflowAnchor="none",this._bottomSpacer.appendChild(this._bottomTd),this.tbody.replaceChildren(this._topSpacer,this._bottomSpacer));this._rowPool.length<i;){const n=this._createTemplateRow();if(!n)break;this._rowPool.push(n),this.tbody.insertBefore(n,this._bottomSpacer)}},o.prototype._renderVirtual=function(){const i=this._filteredData,s=i.length,n=this._rowHeight;if(!n||!s)return;const c=this.thead?this.thead.offsetHeight:0,f=this._scrollContainer;let w,p;if(f){const S=this.table.getBoundingClientRect(),m=f.getBoundingClientRect(),A=S.top-m.top+f.scrollTop+c;w=f.scrollTop-A,p=f.clientHeight}else{const A=this.table.getBoundingClientRect().top+window.scrollY+c;w=window.scrollY-A,p=window.innerHeight}const b=Gt(w,p,n,s,15),_=b.start,g=b.end;if(_===this._vStart&&g===this._vEnd)return;this._vStart=_,this._vEnd=g;const C=this.ths.length||1,E=g-_;this._ensureRowPool(E,C),b.topPadding>0?(this._topTd.style.height=b.topPadding+"px",this._topSpacer.style.display=""):(this._topTd.style.height="0px",this._topSpacer.style.display="none"),b.bottomPadding>0?(this._bottomTd.style.height=b.bottomPadding+"px",this._bottomSpacer.style.display=""):(this._bottomTd.style.height="0px",this._bottomSpacer.style.display="none");for(let S=0;S<this._rowPool.length;S++){const m=this._rowPool[S],A=_+S;if(S<E&&A<s){m.style.display="";const v=i[A];if(v&&v.html){const L=document.createElement("tbody");L.innerHTML=v.html;const T=L.firstElementChild;T&&(m.innerHTML=T.innerHTML,m.className=T.className,m._lnRecord=v,v.id!=null&&m.setAttribute("data-ln-table-row-id",v.id))}else this._updateRow(m,v)}else m.style.display="none"}this._selectable&&this._updateSelectAll()},o.prototype._showLoadingState=function(){this._rowPool=null,this._topSpacer=null,this._topTd=null,this._bottomSpacer=null,this._bottomTd=null;const i=this.ths.length||1;let s=null,n=x(this.dom,this.name+"-loading","ln-table")||x(this.dom,"table-loading","ln-table");if(!n){const c=this.dom.querySelector("template[data-ln-table-loading]");c&&(n=document.importNode(c.content,!0))}if(n)if(n.tagName==="TR")s=n;else{const c=document.createElement("td");c.setAttribute("colspan",String(i)),c.appendChild(n);const f=document.createElement("tr");f.className="table-empty ln-table__empty",f.appendChild(c),s=f}s?this.tbody.replaceChildren(s):this.tbody.replaceChildren()},o.prototype._showEmptyState=function(){this._rowPool=null,this._topSpacer=null,this._topTd=null,this._bottomSpacer=null,this._bottomTd=null;const i=this.ths.length||1;let s=null,n=null;if(this.isDataDriven){const c=this._lastTotal!=null?this._lastTotal:this._data.length,w=this.visibleCount===0&&c>0,p=w?this.name+"-empty-filtered":this.name+"-empty";if(n=x(this.dom,p,"ln-table")||x(this.dom,w?"table-empty-filtered":"table-empty","ln-table"),!n){const b=this.dom.querySelector("template[data-ln-table-empty]");if(b){const _=w?"search":"initial",g=b.content.querySelector('[data-ln-table-empty-when="'+_+'"]')||b.content.firstElementChild;g&&(n=document.importNode(g,!0))}}}else if(n=x(this.dom,this.name+"-empty","ln-table")||x(this.dom,"table-empty","ln-table"),!n){const c=this.dom.querySelector("template[data-ln-table-empty]");c&&(n=document.importNode(c.content,!0))}if(n)if(n.tagName==="TR")s=n;else{const c=document.createElement("td");c.setAttribute("colspan",String(i)),c.appendChild(n);const f=document.createElement("tr");f.className="ln-table__empty",f.appendChild(c),s=f}s?this.tbody.replaceChildren(s):this.tbody.replaceChildren(),y(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})},o.prototype._fillRow=function(i,s){I(i,s);const n=i.querySelectorAll("[data-ln-table-cell-attr]");for(let c=0;c<n.length;c++){const f=n[c],w=f.getAttribute("data-ln-table-cell-attr").split(",");for(let p=0;p<w.length;p++){const b=w[p].trim().split(":");if(b.length!==2)continue;const _=b[0].trim(),g=b[1].trim();s[_]!=null&&f.setAttribute(g,s[_])}}},o.prototype._buildRow=function(i){let s=x(this.dom,this.name+"-row","ln-table");if(!s){const c=this.dom.querySelector("template[data-ln-table-row]");c&&(s=document.importNode(c.content,!0))}let n=s?s.querySelector("[data-ln-table-row]")||s.firstElementChild:null;if(n)this._fillRow(n,i);else if(i&&i.html){const c=document.createElement("tbody");c.innerHTML=i.html,n=c.firstElementChild}else return(window.lnDebug||typeof document<"u"&&document.body&&document.body.hasAttribute("data-ln-debug"))&&console.warn(`[ln-table] Missing row template: <template data-ln-template="${this.name}-row">`),null;if(n._lnRecord=i,i.id!=null&&n.setAttribute("data-ln-table-row-id",i.id),this._selectable&&i.id!=null&&this.selectedIds.has(String(i.id))){n.classList.add("ln-row-selected");const c=n.querySelector("[data-ln-table-row-select]");c&&(c.checked=!0)}return n},o.prototype._requestData=function(){ut(this,"ln-table:request-data","table")},o.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const i=this.tbody.querySelectorAll("[data-ln-table-row]"),s=[];for(let c=0;c<i.length;c++){const f=i[c].getAttribute("data-ln-table-row-id");f!=null&&s.push(f)}const n=Yt(s,this.selectedIds);this._selectAllCheckbox.checked=n.isAllSelected,this._selectAllCheckbox.indeterminate=n.isIndeterminate},o.prototype._restoreSelection=function(){if(!this.tbody)return;const i=this.tbody.querySelectorAll("[data-ln-table-row]");for(let s=0;s<i.length;s++){const n=i[s].getAttribute("data-ln-table-row-id"),c=n!=null&&this.selectedIds.has(n);i[s].classList.toggle("ln-row-selected",c);const f=i[s].querySelector("[data-ln-table-row-select]");f&&(f.checked=c)}this._updateSelectAll()},Object.defineProperty(o.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),o.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const i=this;if(this._onSelectionChange=function(s){const n=s.target.closest("[data-ln-table-row-select]");if(!n)return;const c=n.closest("[data-ln-table-row]");if(!c)return;const f=c.getAttribute("data-ln-table-row-id");f!=null&&(i.selectedIds=ct(i.selectedIds,f,n.checked),c.classList.toggle("ln-row-selected",n.checked),i.selectedCount=i.selectedIds.size,i._updateSelectAll(),i._updateFooter(),y(i.dom,"ln-table:select",{table:i.name,selectedIds:i.selectedIds,count:i.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 s=document.createElement("input");s.type="checkbox";const n=i.dom.querySelector('[data-ln-table-dict="select-all"]'),c=i.dom.getAttribute("data-ln-table-select-all-label")||(n?n.textContent.trim():null)||"Select all";s.setAttribute("aria-label",c),this._selectAllCheckbox.appendChild(s),this._selectAllCheckbox=s}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const s=i._selectAllCheckbox.checked,n=i.tbody?i.tbody.querySelectorAll("[data-ln-table-row]"):[],c=[];for(let f=0;f<n.length;f++){const w=n[f].getAttribute("data-ln-table-row-id"),p=n[f].querySelector("[data-ln-table-row-select]");w!=null&&(c.push(w),n[f].classList.toggle("ln-row-selected",s),p&&(p.checked=s))}i.selectedIds=dt(i.selectedIds,c,s),i.selectedCount=i.selectedIds.size,y(i.dom,"ln-table:select-all",{table:i.name,selected:s}),y(i.dom,"ln-table:select",{table:i.name,selectedIds:i.selectedIds,count:i.selectedCount}),i._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const s=this.tbody.querySelectorAll("[data-ln-table-row]");for(let n=0;n<s.length;n++){const c=s[n].querySelector("[data-ln-table-row-select]"),f=s[n].getAttribute("data-ln-table-row-id");c&&c.checked&&f!=null&&(i.selectedIds=ct(i.selectedIds,f,!0),s[n].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},o.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 i=this.dom.querySelector("[data-ln-table-col-select]");if(i){const s=i.querySelector('input[type="checkbox"]');s&&s.remove()}if(this._selectAllCheckbox=null,this.selectedIds=dt(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const s=this.tbody.querySelectorAll("[data-ln-table-row]");for(let n=0;n<s.length;n++){s[n].classList.remove("ln-row-selected");const c=s[n].querySelector("[data-ln-table-row-select]");c&&(c.checked=!1)}}this._updateFooter()},o.prototype._updateFooter=function(){let i=0,s=0;this.isDataDriven?(i=this._lastTotal!=null?this._lastTotal:this._data.length,s=this.visibleCount):(i=this._data.length,s=this._filteredData.length);const n=s<i;if(this._totalSpan&&d(this._totalSpan,i),this._filteredSpan&&d(this._filteredSpan,n?s:null),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!n),this._selectedSpan){const c=this.selectedIds?this.selectedIds.size:0;d(this._selectedSpan,c>0?c:null),this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",c===0)}},o.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-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onRowClick),this.tbody.removeEventListener("click",this._onRowAction))):(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._loadingIndicator=null,this._data=[],this._filteredData=[],delete this.dom[e])},st(t,e,o,"ln-table",{attributes:a})})()})();
|
|
@@ -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 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 i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!x(o))return}e.apply(console,t)}}function B(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function v(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){v(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,i={},c=e.elements,l={};if(r)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let s=0;s<c.length;s++){const n=c[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&l[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&i[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);i[n.name]=n.value===""||isNaN(a)?null:a}else i[n.name]=n.value}return i}function ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function le(e,t){const r=e.elements,o=[],i={};for(let c=0;c<r.length;c++){const l=r[c];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<r.length;c++){const l=r[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const n=t[s];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(i[l.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=ie(n);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<l.options.length;a++)l.options[a].selected=n.indexOf(l.options[a].value)!==-1;o.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=re);const M={};function ce(e,t){M[e]=t}function se(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=se);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,v(function(){new MutationObserver(function(){B(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const j={};function ue(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];j[r]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return j[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=ae);const k={};function fe(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=k[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function U(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const s=r[l],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const s=o[l],n=s.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[a].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 i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const s=i[l],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],n=s.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[a].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 we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[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)U(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function W(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const o=function(c,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let c=0;c<i.length;c++){const l=i[c],s=l.attributes;for(let n=0;n<s.length;n++){const a=s[n];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function he(e,t,r,o,i,c){const l={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(l[u]=a)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(o(a));let d=l[u];if(d)i(d,a,n);else{const f=fe(r,c);if(!f||(W(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,a,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=U,window.lnCore.lnFill=we,window.lnCore.renderList=he);function E(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function V(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function H(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function P(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const q=new Map;function Q(e,t){const r=(e?e.join("|"):"")+"::"+t;if(q.has(r))return q.get(r);const o=new Set(e||[]),i=function(c,l){const s=c.getAttribute(l);return s!==null&&o.has(s)?s:t};return q.set(r,i),i}function K(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function J(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function G(e,t,r,o,i){if(!e||t===null)return!0;const c=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=n=>{i?console.warn(n,i):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${c}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${c}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${c}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function be(e,t,r){for(const o in r){const[i,c,l]=r[o];Object.defineProperty(e,o,{get:function(){return i(t,c,l)},enumerable:!0,configurable:!0})}return e}function pe(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=Q(o.values,o.fallback);break;case"integer":i=V;break;case"float":i=K;break;case"boolean":i=H;break;case"list":i=P;break;case"json":i=J;break;case"string":default:i=E;break}i||(i=E),t[o.prop]=[i,r,o.fallback]}return t}function ge(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function ye(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=be,window.lnCore.attrSpec=pe,window.lnCore.attrStr=E,window.lnCore.attrInt=V,window.lnCore.attrBool=H,window.lnCore.attrList=P,window.lnCore.attrEnum=Q,window.lnCore.attrFloat=K,window.lnCore.attrJson=J);function A(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function X(e,t,r,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(c)&&A(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)A(s[n],l)}}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 Ce(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function z(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ae(e){const t=z(),r=e.observed||[];for(let o=0;o<r.length;o++){const i=r[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(c=>c.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ye(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 Y(e,t,r,o){for(let i=0;i<e.length;i++){const c=e[i];if(!t[c.attribute])continue;const l=c.effects&&c.effects[r];l?l(t,r,o):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,o)}}function Se(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=z(),i=o.byAttr.get(t),c=$()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!i&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&x(l)){const s=o.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let a=0;a<s.length;a++)G(s[a].spec,n,t,s[a].componentTag,l)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const s=o.byReactive.get(t);s&&Y(s,l,t,e.oldValue),o.reactiveWildcard.length&&Y(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const n=i[s];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(X(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,v(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Se(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).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(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function T(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Z(e){const t=L();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=O();if(e.target&&o.length)for(let i=0;i<o.length;i++){const c=o[i],l=c.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&&c.onSubtreeChange(s,e)}for(let i=0;i<e.addedNodes.length;i++){const c=e.addedNodes[i];if(c.nodeType===1){const l=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s];if(n.selector&&n.attribute&&n.ComponentFn){if(!l)c.matches&&c.matches(n.query)&&A(c,n);else if(c.matches&&c.matches(n.query)&&A(c,n),c.querySelectorAll){const a=c.querySelectorAll(n.query);for(let u=0;u<a.length;u++)A(a[u],n)}}n.onInit&&n.onInit(c)}}}for(let i=0;i<e.removedNodes.length;i++){const c=e.removedNodes[i];if(c.nodeType===1){if(document.contains(c))continue;const l=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s],a=n.query;if(a){if(!l)c.matches&&c.matches(a)&&T(c,n);else if(c.matches&&c.matches(a)&&T(c,n),c.querySelectorAll){const u=c.querySelectorAll(a);for(let d=0;d<u.length;d++)T(u[d],n)}}}}}}function ee(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,v(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{Z(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let o=0;o<r.length;o++){const i=r[o];if(i.type==="childList")try{Z(i)}catch(c){console.error("[ln-core] lifecycle handler failed",i.target,c)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function xe(e){L().push(e),e.onSubtreeChange&&e.query&&O().push(e),ee()}function te(e,t,r,o,i={}){const c=i.extraAttributes||[],l=i.onAttributeChange||null,s=i.onSubtreeChange||null,n=i.onInit||null,a=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?ge(d):u,y=d?new Set(Object.keys(d)):null,b=i.persist||null;function w(D){const g=D||document.body;if(X(g,e,t,r),d&&$())for(const S in d){const He=d[S],F=Array.from(g.querySelectorAll("["+S+"]"));g.matches&&g.matches("["+S+"]")&&F.push(g);for(let N=0;N<F.length;N++){const R=F[N];x(R)&&G(He,R.getAttribute(S),S,o,R)}}n&&n(g)}const m=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let g;for(;(g=D.exec(e))!==null;)m.push(g[1])}else m.push(e);Ae({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:r,onInit:n,observed:m.concat(c),onAttributeChange:l,onAttrChange:a,effects:f,declared:y,persist:b}),ve();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,h=i.subtreeQuery||(C?e:"["+e+"]"),p={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:s,query:h};L().push(p),s&&h&&O().push(p),ee(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=te,window.lnCore.observeLifecycle=xe,window.lnCore.withoutLifecycle=_e);function _(){me()>0?Ce(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_):_(),w}function ne(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,r={},o=ne(t);if(!o)return r;const i=o.split("&");for(let c=0;c<i.length;c++){const l=i[c];if(!l)continue;const s=l.indexOf(":"),n=s>-1?l.slice(0,s):l,a=s>-1?l.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function ke(e){if(!e)return null;const t=I();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const r=I();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(c){const l=r[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");ne(location.hash)!==i&&(location.hash=i)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.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 Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Te(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 Ie(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 r=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=ke,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Te,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=De);function Fe(e){return(e||"").replace(/^\?/,"")}function Ne(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},o=Fe(t);if(!o)return r;const i=new URLSearchParams(o);for(const[c,l]of i.entries())r[c]=l;return r}function Re(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function $e(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const o=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",o)}function Be(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const 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 Me(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:o}}}return null}function Ue(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function We(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Ne,window.lnCore.queryGet=Re,window.lnCore.querySet=$e,window.lnCore.resolveQueryParam=Be,window.lnCore.querySortEncode=Me,window.lnCore.querySortDecode=je,window.lnCore.queryFilterEncode=Ue,window.lnCore.queryFilterDecode=We);function Ve(){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=Ve),(function(){const e="data-ln-table-coordinator",t="lnTableCoordinator";if(window[t]!==void 0)return;const r={"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 n=document.querySelector("["+e+"] [data-ln-search-for]")||document.querySelector("[data-ln-search-for]");if(!n)return;const a=n.tagName==="INPUT"||n.tagName==="TEXTAREA"?n:n.querySelector('input[type="search"], input[type="text"], input');a&&(s.preventDefault(),a.focus())});function o(s){return this.dom=s,l(this),this}function i(s,n){const a=n?'[data-ln-search-for="'+n+'"]':"[data-ln-search-for]",u=s.querySelector(a)||document.querySelector(a);return u?u.tagName==="INPUT"||u.tagName==="TEXTAREA"?u:u.querySelector("input, textarea"):null}function c(s,n){if(n){const u=s.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 a=s.querySelectorAll("[data-ln-filter]");return a.length>0?a:document.querySelectorAll("[data-ln-filter]")}function l(s){const n=s.dom;function a(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 y=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(f):f.replace(/(["\\])/g,"\\$1");return n.querySelector('[data-ln-table-source="'+y+'"]')||n.querySelector('[data-ln-table="'+y+'"]')||(n.id===f?n:null)||document.getElementById(f)}s._handlers={filter:function(u){if(!u.detail)return;const d=a(u);if(!d)return;const f=u.detail.key,y=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",y.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 y=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,m=w?document.getElementById(w):null;if(m&&m.hasAttribute("data-ln-search"))m.setAttribute("data-ln-search","");else{const h=i(n,w);h&&h.value!==""&&(h.value="",h.dispatchEvent(new Event("input",{bubbles:!0})))}const C=c(n,w);for(let h=0;h<C.length;h++){const p=C[h].querySelector("[data-ln-filter-reset]");if(!p)continue;const _=C[h].querySelectorAll("input:not([data-ln-filter-reset]):checked").length>0;(!p.checked||_)&&(p.checked=!0,p.dispatchEvent(new Event("change",{bubbles:!0})))}f.lnTable&&!f.hasAttribute("data-ln-table-source")&&B(f,"ln-table:request-clear-filters",{table:y})}},n.addEventListener("ln-filter:change",s._handlers.filter),n.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])},te(e,t,o,"ln-table-coordinator",{attributes:r})})()})();
|
|
1
|
+
(function(){"use strict";function R(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function 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 i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!x(o))return}e.apply(console,t)}}function $(e,t,r){const o=r||{};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 re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,i={},c=e.elements,l={};if(r)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let s=0;s<c.length;s++){const n=c[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&l[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&i[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);i[n.name]=n.value===""||isNaN(a)?null:a}else i[n.name]=n.value}return i}function ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function le(e,t){const r=e.elements,o=[],i={};for(let c=0;c<r.length;c++){const l=r[c];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<r.length;c++){const l=r[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const n=t[s];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(i[l.name]>1){const a=String(n).split(",").map(function(d){return d.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=ie(n);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<l.options.length;a++)l.options[a].selected=n.indexOf(l.options[a].value)!==-1;o.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=re);const B={};function ce(e,t){B[e]=t}function se(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=se);function ae(){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 M={};function ue(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];M[r]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return M[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=ae);const k={};function fe(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=k[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function j(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const s=r[l],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const s=o[l],n=s.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const d=n[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&s.setAttribute(u,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const s=i[l],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],n=s.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const d=n[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[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)j(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function U(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const o=function(c,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let c=0;c<i.length;c++){const l=i[c],s=l.attributes;for(let n=0;n<s.length;n++){const a=s[n];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function he(e,t,r,o,i,c){const l={};for(let n=0;n<e.children.length;n++){const a=e.children[n],d=a.getAttribute("data-ln-render-key");d&&(l[d]=a)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],d=String(o(a));let u=l[d];if(u)i(u,a,n);else{const f=fe(r,c);if(!f||(U(f,a),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),i(u,a,n)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=j,window.lnCore.lnFill=we,window.lnCore.renderList=he);function E(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function W(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function V(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function H(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const q=new Map;function P(e,t){const r=(e?e.join("|"):"")+"::"+t;if(q.has(r))return q.get(r);const o=new Set(e||[]),i=function(c,l){const s=c.getAttribute(l);return s!==null&&o.has(s)?s:t};return q.set(r,i),i}function Q(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function K(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function J(e,t,r,o,i){if(!e||t===null)return!0;const c=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=n=>{i?console.warn(n,i):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${c}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${c}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${c}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function be(e,t,r){for(const o in r){const[i,c,l]=r[o];Object.defineProperty(e,o,{get:function(){return i(t,c,l)},enumerable:!0,configurable:!0})}return e}function pe(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=P(o.values,o.fallback);break;case"integer":i=W;break;case"float":i=Q;break;case"boolean":i=V;break;case"list":i=H;break;case"json":i=K;break;case"string":default:i=E;break}i||(i=E),t[o.prop]=[i,r,o.fallback]}return t}function ge(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function ye(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=be,window.lnCore.attrSpec=pe,window.lnCore.attrStr=E,window.lnCore.attrInt=W,window.lnCore.attrBool=V,window.lnCore.attrList=H,window.lnCore.attrEnum=P,window.lnCore.attrFloat=Q,window.lnCore.attrJson=K);function v(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function G(e,t,r,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(c)&&v(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)v(s[n],l)}}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 Ce(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 Ae(e){const t=X(),r=e.observed||[];for(let o=0;o<r.length;o++){const i=r[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(c=>c.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ye(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 z(e,t,r,o){for(let i=0;i<e.length;i++){const c=e[i];if(!t[c.attribute])continue;const l=c.effects&&c.effects[r];l?l(t,r,o):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,o)}}function Se(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=X(),i=o.byAttr.get(t),c=R()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!i&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&x(l)){const s=o.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let a=0;a<s.length;a++)J(s[a].spec,n,t,s[a].componentTag,l)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const s=o.byReactive.get(t);s&&z(s,l,t,e.oldValue),o.reactiveWildcard.length&&z(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const n=i[s];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(G(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Se(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).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(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function Y(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Z(e){const t=L();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=O();if(e.target&&o.length)for(let i=0;i<o.length;i++){const c=o[i],l=c.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&&c.onSubtreeChange(s,e)}for(let i=0;i<e.addedNodes.length;i++){const c=e.addedNodes[i];if(c.nodeType!==1)continue;const l=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s],a=n.query;if(a&&(c.matches&&c.matches(a)&&(n.ComponentFn&&v(c,n),n.onInit&&n.onInit(c)),l&&c.querySelectorAll)){const d=c.querySelectorAll(a);for(let u=0;u<d.length;u++)n.ComponentFn&&v(d[u],n),n.onInit&&n.onInit(d[u])}}}for(let i=0;i<e.removedNodes.length;i++){const c=e.removedNodes[i];if(c.nodeType!==1||document.contains(c))continue;const l=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s],a=n.query;if(a&&(c.matches&&c.matches(a)&&Y(c,n),l&&c.querySelectorAll)){const d=c.querySelectorAll(a);for(let u=0;u<d.length;u++)Y(d[u],n)}}}}function ee(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{Z(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let o=0;o<r.length;o++){const i=r[o];if(i.type==="childList")try{Z(i)}catch(c){console.error("[ln-core] lifecycle handler failed",i.target,c)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function xe(e){L().push(e),e.onSubtreeChange&&e.query&&O().push(e),ee()}function te(e,t,r,o,i={}){const c=i.extraAttributes||[],l=i.onAttributeChange||null,s=i.onSubtreeChange||null,n=i.onInit||null,a=i.onAttrChange||null,d=i.effects||null,u=i.attributes||null,f=u?ge(u):d,y=u?new Set(Object.keys(u)):null,b=i.persist||null;function w(T){const g=T||document.body;if(G(g,e,t,r),u&&R())for(const A in u){const He=u[A],D=Array.from(g.querySelectorAll("["+A+"]"));g.matches&&g.matches("["+A+"]")&&D.push(g);for(let F=0;F<D.length;F++){const N=D[F];x(N)&&J(He,N.getAttribute(A),A,o,N)}}n&&n(g)}const m=[];if(e.indexOf("[")!==-1){const T=/\[([\w-]+)/g;let g;for(;(g=T.exec(e))!==null;)m.push(g[1])}else m.push(e);Ae({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:r,onInit:n,observed:m.concat(c),onAttributeChange:l,onAttrChange:a,effects:f,declared:y,persist:b}),ve();const C=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,h=i.subtreeQuery||(C?e:"["+e+"]"),p={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:s,query:h};L().push(p),s&&h&&O().push(p),ee(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=te,window.lnCore.observeLifecycle=xe,window.lnCore.withoutLifecycle=_e);function _(){me()>0?Ce(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",_):_(),w}function ne(e){return(e||"").replace(/^#/,"")}function I(e){const t=e===void 0?location.hash:e,r={},o=ne(t);if(!o)return r;const i=o.split("&");for(let c=0;c<i.length;c++){const l=i[c];if(!l)continue;const s=l.indexOf(":"),n=s>-1?l.slice(0,s):l,a=s>-1?l.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function ke(e){if(!e)return null;const t=I();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const r=I();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(c){const l=r[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");ne(location.hash)!==i&&(location.hash=i)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.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 Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(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 Te(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 r=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=I,window.lnCore.hashGet=ke,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=Te,window.lnCore.hashFilterDecode=De);function Fe(e){return(e||"").replace(/^\?/,"")}function Ne(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},o=Fe(t);if(!o)return r;const i=new URLSearchParams(o);for(const[c,l]of i.entries())r[c]=l;return r}function Re(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function $e(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const o=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",o)}function Be(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const 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 Me(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:o}}}return null}function Ue(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function We(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Ne,window.lnCore.queryGet=Re,window.lnCore.querySet=$e,window.lnCore.resolveQueryParam=Be,window.lnCore.querySortEncode=Me,window.lnCore.querySortDecode=je,window.lnCore.queryFilterEncode=Ue,window.lnCore.queryFilterDecode=We);function Ve(){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=Ve),(function(){const e="data-ln-table-coordinator",t="lnTableCoordinator";if(window[t]!==void 0)return;const r={"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 n=document.querySelector("["+e+"] [data-ln-search-for]")||document.querySelector("[data-ln-search-for]");if(!n)return;const a=n.tagName==="INPUT"||n.tagName==="TEXTAREA"?n:n.querySelector('input[type="search"], input[type="text"], input');a&&(s.preventDefault(),a.focus())});function o(s){return this.dom=s,l(this),this}function i(s,n){const a=n?'[data-ln-search-for="'+n+'"]':"[data-ln-search-for]",d=s.querySelector(a)||document.querySelector(a);return d?d.tagName==="INPUT"||d.tagName==="TEXTAREA"?d:d.querySelector("input, textarea"):null}function c(s,n){if(n){const d=s.querySelectorAll('[data-ln-filter="'+n+'"]');if(d.length>0)return d;const u=document.querySelectorAll('[data-ln-filter="'+n+'"]');if(u.length>0)return u}const a=s.querySelectorAll("[data-ln-filter]");return a.length>0?a:document.querySelectorAll("[data-ln-filter]")}function l(s){const n=s.dom;function a(d){const u=d.target;if(u&&u.hasAttribute&&(u.hasAttribute("data-ln-table")||u.tagName==="TABLE"))return u;const f=d.detail&&d.detail.targetId||u&&u.id;if(!f)return null;const y=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(f):f.replace(/(["\\])/g,"\\$1");return n.querySelector('[data-ln-table-source="'+y+'"]')||n.querySelector('[data-ln-table="'+y+'"]')||(n.id===f?n:null)||document.getElementById(f)}s._handlers={filter:function(d){if(!d.detail)return;const u=a(d);if(!u)return;const f=d.detail.key,y=d.detail.values||[],b=u.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",y.length>0);break}},clear:function(d){const u=d.target.closest("[data-ln-table-clear], [data-ln-table-clear-all]");if(!u)return;const f=u.closest("[data-ln-table], table")||n.querySelector("[data-ln-table], table");if(!f)return;const y=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,m=w?document.getElementById(w):null;if(m&&m.hasAttribute("data-ln-search"))m.setAttribute("data-ln-search","");else{const h=i(n,w);h&&h.value!==""&&(h.value="",h.dispatchEvent(new Event("input",{bubbles:!0})))}const C=c(n,w);for(let h=0;h<C.length;h++){const p=C[h].querySelector("[data-ln-filter-reset]");if(!p)continue;const _=C[h].querySelectorAll("input:not([data-ln-filter-reset]):checked").length>0;(!p.checked||_)&&(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:y})}},n.addEventListener("ln-filter:change",s._handlers.filter),n.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])},te(e,t,o,"ln-table-coordinator",{attributes:r})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function K(){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 o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!v(o))return}e.apply(console,t)}}function N(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function de(e,t,r){const o=r||{};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 C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ue(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function fe(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,i={},l=e.elements,s={};if(r)for(let a=0;a<l.length;a++){const n=l[a];n.name&&n.type==="checkbox"&&!n.disabled&&(s[n.name]=(s[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")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&s[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&i[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);i[n.name]=n.value===""||isNaN(c)?null:c}else i[n.name]=n.value}return i}function he(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function we(e,t){const r=e.elements,o=[],i={};for(let l=0;l<r.length;l++){const s=r[l];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let l=0;l<r.length;l++){const s=r[l];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const a=s.getAttribute("data-ln-fill-as")||s.name;if(!a||!(a in t))continue;const n=t[a];if(s.type==="checkbox"){if(Array.isArray(n))s.checked=n.indexOf(s.value)!==-1;else if(i[s.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});s.checked=c.indexOf(s.value)!==-1}else s.checked=he(n);o.push(s)}else if(s.type==="radio")s.checked=s.value===String(n),o.push(s);else if(s.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<s.options.length;c++)s.options[c].selected=n.indexOf(s.options[c].value)!==-1;o.push(s)}else s.value=n,s.tagName==="SELECT"&&n!=null&&s.setAttribute("data-ln-value",n),o.push(s)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=we,window.lnCore.serializeForm=fe,window.lnCore.resolveFormMethod=ue);const $={};function be(e,t){$[e]=t}function pe(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=be,window.lnCore.getDataMapper=pe);function ge(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,C(function(){new MutationObserver(function(){N(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const M={};function me(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];M[r]=t}function ye(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return M[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=me,window.lnCore.getLocaleFallback=ye,window.lnCore.ensureLocaleObserver=ge);const _={};function Ce(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=_[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function j(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let s=0;s<r.length;s++){const a=r[s],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<o.length;s++){const a=o[s],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 i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const a=i[s],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const l=e.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const a=l[s],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 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 r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[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)j(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function B(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const l=r.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,a){return t[a]!==void 0?t[a]:""}))}const o=function(l,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const s=i[l],a=s.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&s.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ve(e,t,r,o,i,l){const s={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(s[u]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(o(c));let d=s[u];if(d)i(d,c,n);else{const f=Ce(r,l);if(!f||(B(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,c,n)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=j,window.lnCore.lnFill=Ae,window.lnCore.renderList=ve);function k(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function U(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function x(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const S=new Map;function H(e,t){const r=(e?e.join("|"):"")+"::"+t;if(S.has(r))return S.get(r);const o=new Set(e||[]),i=function(l,s){const a=l.getAttribute(s);return a!==null&&o.has(a)?a:t};return S.set(r,i),i}function P(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function V(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function Q(e,t,r,o,i){if(!e||t===null)return!0;const l=o||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const a=n=>{i?console.warn(n,i):console.warn(n)};if(s==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${l}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${l}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return a(`[${l}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${l}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${l}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(a(`[${l}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${l}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function z(e,t,r){for(const o in r){const[i,l,s]=r[o];Object.defineProperty(e,o,{get:function(){return i(t,l,s)},enumerable:!0,configurable:!0})}return e}function J(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=H(o.values,o.fallback);break;case"integer":i=U;break;case"float":i=P;break;case"boolean":i=x;break;case"list":i=W;break;case"json":i=V;break;case"string":default:i=k;break}i||(i=k),t[o.prop]=[i,r,o.fallback]}return t}function _e(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function ke(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=z,window.lnCore.attrSpec=J,window.lnCore.attrStr=k,window.lnCore.attrInt=U,window.lnCore.attrBool=x,window.lnCore.attrList=W,window.lnCore.attrEnum=H,window.lnCore.attrFloat=P,window.lnCore.attrJson=V);function g(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function G(e,t,r,o){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(l)&&g(e,s),e.querySelectorAll){const a=e.querySelectorAll(l);for(let n=0;n<a.length;n++)g(a[n],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function xe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Se(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 Le(e){const t=X(),r=e.observed||[];for(let o=0;o<r.length;o++){const i=r[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(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ke(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 Y(e,t,r,o){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const s=l.effects&&l.effects[r];s?s(t,r,o):l.onAttrChange&&(!l.declared||l.declared.has(r))&&l.onAttrChange(t,r,o)}}function Ee(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=X(),i=o.byAttr.get(t),l=K()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!i&&!l)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(l&&v(s)){const a=o.byDeclaredAttr.get(t),n=s.getAttribute(t);for(let c=0;c<a.length;c++)Q(a[c].spec,n,t,a[c].componentTag,s)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),r){const a=o.byReactive.get(t);a&&Y(a,s,t,e.oldValue),o.reactiveWildcard.length&&Y(o.reactiveWildcard,s,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const n=i[a];if(n.handler){n.handler(s,t,e.oldValue);continue}n.onAttributeChange&&s[n.attribute]?n.onAttributeChange(s,t):(G(s,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(s))}}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ee(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).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(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function T(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Z(e){const t=L();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=E();if(e.target&&o.length)for(let i=0;i<o.length;i++){const l=o[i],s=l.query,a=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;a&&l.onSubtreeChange(a,e)}for(let i=0;i<e.addedNodes.length;i++){const l=e.addedNodes[i];if(l.nodeType===1){const s=!!(l.firstElementChild||l.children&&l.children.length);for(let a=0;a<t.length;a++){const n=t[a];if(n.selector&&n.attribute&&n.ComponentFn){if(!s)l.matches&&l.matches(n.query)&&g(l,n);else if(l.matches&&l.matches(n.query)&&g(l,n),l.querySelectorAll){const c=l.querySelectorAll(n.query);for(let u=0;u<c.length;u++)g(c[u],n)}}n.onInit&&n.onInit(l)}}}for(let i=0;i<e.removedNodes.length;i++){const l=e.removedNodes[i];if(l.nodeType===1){if(document.contains(l))continue;const s=!!(l.firstElementChild||l.children&&l.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c){if(!s)l.matches&&l.matches(c)&&T(l,n);else if(l.matches&&l.matches(c)&&T(l,n),l.querySelectorAll){const u=l.querySelectorAll(c);for(let d=0;d<u.length;d++)T(u[d],n)}}}}}}function ee(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{Z(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let o=0;o<r.length;o++){const i=r[o];if(i.type==="childList")try{Z(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function qe(e){L().push(e),e.onSubtreeChange&&e.query&&E().push(e),ee()}function te(e,t,r,o,i={}){const l=i.extraAttributes||[],s=i.onAttributeChange||null,a=i.onSubtreeChange||null,n=i.onInit||null,c=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?_e(d):u,h=d?new Set(Object.keys(d)):null,p=i.persist||null;function w(D){const b=D||document.body;if(G(b,e,t,r),d&&K())for(const y in d){const ze=d[y],F=Array.from(b.querySelectorAll("["+y+"]"));b.matches&&b.matches("["+y+"]")&&F.push(b);for(let R=0;R<F.length;R++){const I=F[R];v(I)&&Q(ze,I.getAttribute(y),y,o,I)}}n&&n(b)}const q=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let b;for(;(b=D.exec(e))!==null;)q.push(b[1])}else q.push(e);Le({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:r,onInit:n,observed:q.concat(l),onAttributeChange:s,onAttrChange:c,effects:f,declared:h,persist:p}),Te();const Qe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,le=i.subtreeQuery||(Qe?e:"["+e+"]"),ae={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:a,query:le};L().push(ae),a&&le&&E().push(ae),ee(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=te,window.lnCore.observeLifecycle=qe,window.lnCore.withoutLifecycle=Oe);function ce(){xe()>0?Se(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ce):ce(),w}function ne(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,r={},o=ne(t);if(!o)return r;const i=o.split("&");for(let l=0;l<i.length;l++){const s=i[l];if(!s)continue;const a=s.indexOf(":"),n=a>-1?s.slice(0,a):s,c=a>-1?s.slice(a+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function m(e){if(!e)return null;const t=O();return e in t?t[e]:null}function A(e,t){if(!e)return;const r=O();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(l){const s=r[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");ne(location.hash)!==i&&(location.hash=i)}function re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function De(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Re(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 Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ke(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=m,window.lnCore.hashSet=A,window.lnCore.hashLinkClick=re,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Fe,window.lnCore.hashSortDecode=Re,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=Ke);function Ne(e){return(e||"").replace(/^\?/,"")}function $e(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},o=Ne(t);if(!o)return r;const i=new URLSearchParams(o);for(const[l,s]of i.entries())r[l]=s;return r}function Me(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function je(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const o=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",o)}function Be(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const 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 Ue(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function We(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:o}}}return null}function He(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Pe(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=$e,window.lnCore.queryGet=Me,window.lnCore.querySet=je,window.lnCore.resolveQueryParam=Be,window.lnCore.querySortEncode=Ue,window.lnCore.querySortDecode=We,window.lnCore.queryFilterEncode=He,window.lnCore.queryFilterDecode=Pe);function Ve(){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=Ve);function oe(e,t,r,o){const i=(e||"").toLowerCase().trim();if(i)return i;if((t||"").toUpperCase()!=="A")return"";const l=r||"";if(!l.startsWith("#"))return"";const s=l.slice(1);if(!s)return"";const a=s.split("&"),n=(o||"").toLowerCase().trim();if(n)for(const d of a){const f=d.indexOf(":");if(f>0&&d.slice(0,f).toLowerCase().trim()===n)return d.slice(f+1).toLowerCase().trim()}const c=a[a.length-1]||"",u=c.indexOf(":");return(u>0?c.slice(u+1):c).toLowerCase().trim()}function ie(e,t){if(!Array.isArray(e)||e.length===0)return{hashEnabled:!1,warning:null};const r=e.filter(l=>(l.tagName||"").toUpperCase()==="A"&&(l.href||"").startsWith("#")),o=r.length>0&&r.length===e.length,i=(t||"").toLowerCase().trim();return r.length>0&&r.length!==e.length?{hashEnabled:!1,warning:"mixed"}:o&&!i?{hashEnabled:!1,warning:"missing-namespace"}:{hashEnabled:o&&!!i,warning:null}}function se(e,t,r){const o=(e||"").toLowerCase().trim();return o&&Array.isArray(t)&&t.includes(o)?o:(r||"").toLowerCase().trim()}(function(){const e="data-ln-tabs",t="lnTabs";if(window[t]!==void 0&&window[t]!==null)return;function r(n){const c=n.getAttribute("data-ln-tabs-active");n[t]&&n[t]._applyActive(c)}function o(n,c){return(n.getAttribute(c)||n.id||"").toLowerCase().trim()}const i={"data-ln-tabs":{type:"marker",description:"Mounts lnTabs component instance on tabs container"},"data-ln-tabs-active":{effect:r,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"}},l=J(i);function s(n){return this.dom=n,z(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(d=>({tagName:d.tagName,href:d.getAttribute("href")})),c=ie(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 d of this.tabs){const f=oe(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 p=d.tagName==="A";if(!p&&(h.ctrlKey||h.metaKey||h.button===1))return;const w=oe(d.getAttribute("data-ln-tab"),d.tagName,d.getAttribute("href"),u.nsKey);w&&(p&&!re(h)||(u.hashEnabled?m(u.nsKey)===w?u.dom.setAttribute("data-ln-tabs-active",w):A(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=m(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=se(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(n){const c=(n+"").toLowerCase().trim();c&&(this.hashEnabled?m(this.nsKey)===c?this.dom.setAttribute("data-ln-tabs-active",c):A(this.nsKey,c):this.dom.setAttribute("data-ln-tabs-active",c))},s.prototype._applyActive=function(n){var u;if(n=se(n,Object.keys(this.mapPanels),this.defaultKey),n===this.activeKey)return;const c=this.activeKey;if(c!==null&&de(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&&m(this.nsKey)!==c&&A(this.nsKey,c));return}this.activeKey=n;for(const d in this.mapTabs){const f=this.mapTabs[d];d===n?(f.hasAttribute("data-active")||f.setAttribute("data-active",""),f.getAttribute("aria-selected")!=="true"&&f.setAttribute("aria-selected","true")):(f.hasAttribute("data-active")&&f.removeAttribute("data-active"),f.getAttribute("aria-selected")!=="false"&&f.setAttribute("aria-selected","false"))}for(const d in this.mapPanels){const f=this.mapPanels[d],h=d===n;f.hidden!==!h&&(f.hidden=!h),f.classList.contains("hidden")!==!h&&f.classList.toggle("hidden",!h);const p=h?"false":"true";f.getAttribute("aria-hidden")!==p&&f.setAttribute("aria-hidden",p)}if(this.autoFocus){const d=(u=this.mapPanels[n])==null?void 0:u.querySelector('input,button,select,textarea,[tabindex]:not([tabindex="-1"])');d&&setTimeout(()=>d.focus({preventScroll:!0}),0)}N(this.dom,"ln-tabs:change",{key:n,previousKey:c,tab:this.mapTabs[n],panel:this.mapPanels[n],target:this.dom})},s.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]}},te(e,t,s,"ln-tabs",{attributes:i,persist:{attr:"data-ln-tabs-active",hashActive:function(n){const c=Array.from(n.querySelectorAll("[data-ln-tab]")).map(function(d){return{tagName:d.tagName,href:d.getAttribute("href")}}),u=(n.getAttribute("data-ln-tabs-key")||n.id||"").toLowerCase().trim();return ie(c,u).hashEnabled}}})})()})();
|
|
1
|
+
(function(){"use strict";function R(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function 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 o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!v(o))return}e.apply(console,t)}}function K(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function de(e,t,r){const o=r||{};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 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 ue(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function fe(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,i={},l=e.elements,s={};if(r)for(let a=0;a<l.length;a++){const n=l[a];n.name&&n.type==="checkbox"&&!n.disabled&&(s[n.name]=(s[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")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&s[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&i[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);i[n.name]=n.value===""||isNaN(c)?null:c}else i[n.name]=n.value}return i}function he(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function we(e,t){const r=e.elements,o=[],i={};for(let l=0;l<r.length;l++){const s=r[l];s.name&&s.type==="checkbox"&&(i[s.name]=(i[s.name]||0)+1)}for(let l=0;l<r.length;l++){const s=r[l];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const a=s.getAttribute("data-ln-fill-as")||s.name;if(!a||!(a in t))continue;const n=t[a];if(s.type==="checkbox"){if(Array.isArray(n))s.checked=n.indexOf(s.value)!==-1;else if(i[s.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});s.checked=c.indexOf(s.value)!==-1}else s.checked=he(n);o.push(s)}else if(s.type==="radio")s.checked=s.value===String(n),o.push(s);else if(s.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<s.options.length;c++)s.options[c].selected=n.indexOf(s.options[c].value)!==-1;o.push(s)}else s.value=n,s.tagName==="SELECT"&&n!=null&&s.setAttribute("data-ln-value",n),o.push(s)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=we,window.lnCore.serializeForm=fe,window.lnCore.resolveFormMethod=ue);const N={};function be(e,t){N[e]=t}function pe(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=be,window.lnCore.getDataMapper=pe);function ge(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){K(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function me(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];$[r]=t}function ye(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=me,window.lnCore.getLocaleFallback=ye,window.lnCore.ensureLocaleObserver=ge);const _={};function Ce(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=_[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let s=0;s<r.length;s++){const a=r[s],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<o.length;s++){const a=o[s],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 i=e.querySelectorAll("[data-ln-show]");for(let s=0;s<i.length;s++){const a=i[s],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const l=e.querySelectorAll("[data-ln-class]");for(let s=0;s<l.length;s++){const a=l[s],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 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 r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[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)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function j(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const l=r.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,a){return t[a]!==void 0?t[a]:""}))}const o=function(l,s){return t[s]!==void 0?t[s]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const s=i[l],a=s.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&s.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ve(e,t,r,o,i,l){const s={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(s[u]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(o(c));let d=s[u];if(d)i(d,c,n);else{const f=Ce(r,l);if(!f||(j(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(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=Ae,window.lnCore.renderList=ve);function k(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function B(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function x(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function U(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const S=new Map;function W(e,t){const r=(e?e.join("|"):"")+"::"+t;if(S.has(r))return S.get(r);const o=new Set(e||[]),i=function(l,s){const a=l.getAttribute(s);return a!==null&&o.has(a)?a:t};return S.set(r,i),i}function H(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function P(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function V(e,t,r,o,i){if(!e||t===null)return!0;const l=o||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const a=n=>{i?console.warn(n,i):console.warn(n)};if(s==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${l}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${l}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return a(`[${l}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${l}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${l}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(a(`[${l}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${l}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,r){for(const o in r){const[i,l,s]=r[o];Object.defineProperty(e,o,{get:function(){return i(t,l,s)},enumerable:!0,configurable:!0})}return e}function z(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=W(o.values,o.fallback);break;case"integer":i=B;break;case"float":i=H;break;case"boolean":i=x;break;case"list":i=U;break;case"json":i=P;break;case"string":default:i=k;break}i||(i=k),t[o.prop]=[i,r,o.fallback]}return t}function _e(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function ke(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=z,window.lnCore.attrStr=k,window.lnCore.attrInt=B,window.lnCore.attrBool=x,window.lnCore.attrList=U,window.lnCore.attrEnum=W,window.lnCore.attrFloat=H,window.lnCore.attrJson=P);function C(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,o){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(l)&&C(e,s),e.querySelectorAll){const a=e.querySelectorAll(l);for(let n=0;n<a.length;n++)C(a[n],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function xe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Se(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 Ee(e){const t=G(),r=e.observed||[];for(let o=0;o<r.length;o++){const i=r[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(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ke(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 X(e,t,r,o){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const s=l.effects&&l.effects[r];s?s(t,r,o):l.onAttrChange&&(!l.declared||l.declared.has(r))&&l.onAttrChange(t,r,o)}}function Le(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=G(),i=o.byAttr.get(t),l=R()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!i&&!l)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(l&&v(s)){const a=o.byDeclaredAttr.get(t),n=s.getAttribute(t);for(let c=0;c<a.length;c++)V(a[c].spec,n,t,a[c].componentTag,s)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),r){const a=o.byReactive.get(t);a&&X(a,s,t,e.oldValue),o.reactiveWildcard.length&&X(o.reactiveWildcard,s,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const n=i[a];if(n.handler){n.handler(s,t,e.oldValue);continue}n.onAttributeChange&&s[n.attribute]?n.onAttributeChange(s,t):(J(s,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(s))}}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Le(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function E(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function L(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function Y(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Z(e){const t=E();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=L();if(e.target&&o.length)for(let i=0;i<o.length;i++){const l=o[i],s=l.query,a=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;a&&l.onSubtreeChange(a,e)}for(let i=0;i<e.addedNodes.length;i++){const l=e.addedNodes[i];if(l.nodeType!==1)continue;const s=!!(l.firstElementChild||l.children&&l.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c&&(l.matches&&l.matches(c)&&(n.ComponentFn&&C(l,n),n.onInit&&n.onInit(l)),s&&l.querySelectorAll)){const u=l.querySelectorAll(c);for(let d=0;d<u.length;d++)n.ComponentFn&&C(u[d],n),n.onInit&&n.onInit(u[d])}}}for(let i=0;i<e.removedNodes.length;i++){const l=e.removedNodes[i];if(l.nodeType!==1||document.contains(l))continue;const s=!!(l.firstElementChild||l.children&&l.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c&&(l.matches&&l.matches(c)&&Y(l,n),s&&l.querySelectorAll)){const u=l.querySelectorAll(c);for(let d=0;d<u.length;d++)Y(u[d],n)}}}}function ee(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{Z(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const r=t.takeRecords();for(let o=0;o<r.length;o++){const i=r[o];if(i.type==="childList")try{Z(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function qe(e){E().push(e),e.onSubtreeChange&&e.query&&L().push(e),ee()}function te(e,t,r,o,i={}){const l=i.extraAttributes||[],s=i.onAttributeChange||null,a=i.onSubtreeChange||null,n=i.onInit||null,c=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?_e(d):u,h=d?new Set(Object.keys(d)):null,p=i.persist||null;function w(q){const b=q||document.body;if(J(b,e,t,r),d&&R())for(const m in d){const ze=d[m],D=Array.from(b.querySelectorAll("["+m+"]"));b.matches&&b.matches("["+m+"]")&&D.push(b);for(let F=0;F<D.length;F++){const I=D[F];v(I)&&V(ze,I.getAttribute(m),m,o,I)}}n&&n(b)}const O=[];if(e.indexOf("[")!==-1){const q=/\[([\w-]+)/g;let b;for(;(b=q.exec(e))!==null;)O.push(b[1])}else O.push(e);Ee({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:r,onInit:n,observed:O.concat(l),onAttributeChange:s,onAttrChange:c,effects:f,declared:h,persist:p}),Te();const Qe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,le=i.subtreeQuery||(Qe?e:"["+e+"]"),ae={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:a,query:le};E().push(ae),a&&le&&L().push(ae),ee(),window[t]=w,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=te,window.lnCore.observeLifecycle=qe,window.lnCore.withoutLifecycle=Oe);function ce(){xe()>0?Se(function(){w(document.body)}):w(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ce):ce(),w}function ne(e){return(e||"").replace(/^#/,"")}function T(e){const t=e===void 0?location.hash:e,r={},o=ne(t);if(!o)return r;const i=o.split("&");for(let l=0;l<i.length;l++){const s=i[l];if(!s)continue;const a=s.indexOf(":"),n=a>-1?s.slice(0,a):s,c=a>-1?s.slice(a+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function g(e){if(!e)return null;const t=T();return e in t?t[e]:null}function A(e,t){if(!e)return;const r=T();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(l){const s=r[l];return s===""?l:l+":"+encodeURIComponent(s)}).join("&");ne(location.hash)!==i&&(location.hash=i)}function re(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function De(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(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 Re(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ke(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=T,window.lnCore.hashGet=g,window.lnCore.hashSet=A,window.lnCore.hashLinkClick=re,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Fe,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=Re,window.lnCore.hashFilterDecode=Ke);function Ne(e){return(e||"").replace(/^\?/,"")}function $e(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},o=Ne(t);if(!o)return r;const i=new URLSearchParams(o);for(const[l,s]of i.entries())r[l]=s;return r}function Me(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function je(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const o=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",o)}function Be(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const 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 Ue(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function We(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:o}}}return null}function He(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Pe(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=$e,window.lnCore.queryGet=Me,window.lnCore.querySet=je,window.lnCore.resolveQueryParam=Be,window.lnCore.querySortEncode=Ue,window.lnCore.querySortDecode=We,window.lnCore.queryFilterEncode=He,window.lnCore.queryFilterDecode=Pe);function Ve(){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=Ve);function oe(e,t,r,o){const i=(e||"").toLowerCase().trim();if(i)return i;if((t||"").toUpperCase()!=="A")return"";const l=r||"";if(!l.startsWith("#"))return"";const s=l.slice(1);if(!s)return"";const a=s.split("&"),n=(o||"").toLowerCase().trim();if(n)for(const d of a){const f=d.indexOf(":");if(f>0&&d.slice(0,f).toLowerCase().trim()===n)return d.slice(f+1).toLowerCase().trim()}const c=a[a.length-1]||"",u=c.indexOf(":");return(u>0?c.slice(u+1):c).toLowerCase().trim()}function ie(e,t){if(!Array.isArray(e)||e.length===0)return{hashEnabled:!1,warning:null};const r=e.filter(l=>(l.tagName||"").toUpperCase()==="A"&&(l.href||"").startsWith("#")),o=r.length>0&&r.length===e.length,i=(t||"").toLowerCase().trim();return r.length>0&&r.length!==e.length?{hashEnabled:!1,warning:"mixed"}:o&&!i?{hashEnabled:!1,warning:"missing-namespace"}:{hashEnabled:o&&!!i,warning:null}}function se(e,t,r){const o=(e||"").toLowerCase().trim();return o&&Array.isArray(t)&&t.includes(o)?o:(r||"").toLowerCase().trim()}(function(){const e="data-ln-tabs",t="lnTabs";if(window[t]!==void 0&&window[t]!==null)return;function r(n){const c=n.getAttribute("data-ln-tabs-active");n[t]&&n[t]._applyActive(c)}function o(n,c){return(n.getAttribute(c)||n.id||"").toLowerCase().trim()}const i={"data-ln-tabs":{type:"marker",description:"Mounts lnTabs component instance on tabs container"},"data-ln-tabs-active":{effect:r,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"}},l=z(i);function s(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(d=>({tagName:d.tagName,href:d.getAttribute("href")})),c=ie(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 d of this.tabs){const f=oe(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 p=d.tagName==="A";if(!p&&(h.ctrlKey||h.metaKey||h.button===1))return;const w=oe(d.getAttribute("data-ln-tab"),d.tagName,d.getAttribute("href"),u.nsKey);w&&(p&&!re(h)||(u.hashEnabled?g(u.nsKey)===w?u.dom.setAttribute("data-ln-tabs-active",w):A(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=g(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=se(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(n){const c=(n+"").toLowerCase().trim();c&&(this.hashEnabled?g(this.nsKey)===c?this.dom.setAttribute("data-ln-tabs-active",c):A(this.nsKey,c):this.dom.setAttribute("data-ln-tabs-active",c))},s.prototype._applyActive=function(n){var u;if(n=se(n,Object.keys(this.mapPanels),this.defaultKey),n===this.activeKey)return;const c=this.activeKey;if(c!==null&&de(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&&A(this.nsKey,c));return}this.activeKey=n;for(const d in this.mapTabs){const f=this.mapTabs[d];d===n?(f.hasAttribute("data-active")||f.setAttribute("data-active",""),f.getAttribute("aria-selected")!=="true"&&f.setAttribute("aria-selected","true")):(f.hasAttribute("data-active")&&f.removeAttribute("data-active"),f.getAttribute("aria-selected")!=="false"&&f.setAttribute("aria-selected","false"))}for(const d in this.mapPanels){const f=this.mapPanels[d],h=d===n;f.hidden!==!h&&(f.hidden=!h),f.classList.contains("hidden")!==!h&&f.classList.toggle("hidden",!h);const p=h?"false":"true";f.getAttribute("aria-hidden")!==p&&f.setAttribute("aria-hidden",p)}if(this.autoFocus){const d=(u=this.mapPanels[n])==null?void 0:u.querySelector('input,button,select,textarea,[tabindex]:not([tabindex="-1"])');d&&setTimeout(()=>d.focus({preventScroll:!0}),0)}K(this.dom,"ln-tabs:change",{key:n,previousKey:c,tab:this.mapTabs[n],panel:this.mapPanels[n],target:this.dom})},s.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]}},te(e,t,s,"ln-tabs",{attributes:i,persist:{attr:"data-ln-tabs-active",hashActive:function(n){const c=Array.from(n.querySelectorAll("[data-ln-tab]")).map(function(d){return{tagName:d.tagName,href:d.getAttribute("href")}}),u=(n.getAttribute("data-ln-tabs-key")||n.id||"").toLowerCase().trim();return ie(c,u).hashEnabled}}})})()})();
|