@livenetworks/ashlar 2.1.0 → 2.1.1

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.
Files changed (55) hide show
  1. package/components/ln-accordion/ln-accordion.js +1 -1
  2. package/components/ln-ajax/ln-ajax.js +1 -1
  3. package/components/ln-api-connector/ln-api-connector.js +1 -1
  4. package/components/ln-api-queue/ln-api-queue.js +1 -1
  5. package/components/ln-autoresize/ln-autoresize.js +1 -1
  6. package/components/ln-autosave/ln-autosave.js +1 -1
  7. package/components/ln-chart/ln-chart.js +1 -1
  8. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  9. package/components/ln-confirm/ln-confirm.js +1 -1
  10. package/components/ln-core/lifecycle.js +9 -0
  11. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  12. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  13. package/components/ln-data-store/ln-data-store.js +1 -1
  14. package/components/ln-date/ln-date.js +1 -1
  15. package/components/ln-debug/ln-debug.js +1 -1
  16. package/components/ln-dropdown/ln-dropdown.js +1 -1
  17. package/components/ln-editor/ln-editor.js +1 -1
  18. package/components/ln-editor/src/ln-editor.js +45 -12
  19. package/components/ln-external-links/ln-external-links.js +1 -1
  20. package/components/ln-filter/ln-filter.js +1 -1
  21. package/components/ln-form/ln-form.js +1 -1
  22. package/components/ln-icon/ln-icon.js +1 -1
  23. package/components/ln-include/ln-include.js +1 -1
  24. package/components/ln-key/ln-key.js +1 -1
  25. package/components/ln-link/ln-link.js +1 -1
  26. package/components/ln-list/ln-list.js +1 -1
  27. package/components/ln-modal/ln-modal.js +1 -1
  28. package/components/ln-nav/ln-nav.js +1 -1
  29. package/components/ln-number/ln-number.js +1 -1
  30. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  31. package/components/ln-options/ln-options.js +1 -1
  32. package/components/ln-picklist/ln-picklist.js +1 -1
  33. package/components/ln-popover/ln-popover.js +1 -1
  34. package/components/ln-progress/ln-progress.js +1 -1
  35. package/components/ln-router/ln-router.js +1 -1
  36. package/components/ln-scroll/ln-scroll.js +1 -1
  37. package/components/ln-search/ln-search.js +1 -1
  38. package/components/ln-slug/ln-slug.js +1 -1
  39. package/components/ln-sort/ln-sort.js +1 -1
  40. package/components/ln-sortable/ln-sortable.js +1 -1
  41. package/components/ln-stat/ln-stat.js +1 -1
  42. package/components/ln-table/ln-table.js +1 -1
  43. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  44. package/components/ln-tabs/ln-tabs.js +1 -1
  45. package/components/ln-time/ln-time.js +1 -1
  46. package/components/ln-toast/ln-toast.js +1 -1
  47. package/components/ln-toggle/ln-toggle.js +1 -1
  48. package/components/ln-tooltip/ln-tooltip.js +1 -1
  49. package/components/ln-translations/ln-translations.js +1 -1
  50. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  51. package/components/ln-upload/ln-upload.js +1 -1
  52. package/components/ln-validate/ln-validate.js +1 -1
  53. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  54. package/package.json +1 -1
  55. package/web-types.json +1 -1
@@ -1 +1 @@
1
- (function(){"use strict";function T(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!A(r))return}e.apply(console,t)}}function C(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function X(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(l),l}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 Z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ee(e,t){const i=!!(t&&t.typed),r=t&&t.exclude,l={},a=e.elements,o={};if(i)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let s=0;s<a.length;s++){const n=a[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")i&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&l[n.name].push(n.options[c].value)}else if(i&&n.type==="hidden")l[n.name]=n.value;else if(i&&(n.type==="number"||n.type==="range")){const c=Number(n.value);l[n.name]=n.value===""||isNaN(c)?null:c}else l[n.name]=n.value}return l}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ne(e,t){const i=e.elements,r=[],l={};for(let a=0;a<i.length;a++){const o=i[a];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<i.length;a++){const o=i[a];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const n=t[s];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=te(n);r.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),r.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<o.options.length;c++)o.options[c].selected=n.indexOf(o.options[c].value)!==-1;r.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),r.push(o)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ne,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Z);const F={};function re(e,t){F[e]=t}function oe(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=oe);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){C(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function le(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];$[i]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=ie);const v={};function ae(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=v[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let o=0;o<i.length;o++){const s=i[o],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const s=r[o],n=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&s.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const s=l[o],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let o=0;o<a.length;o++){const s=a[o],n=s.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function ce(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 i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<i.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[r],t??null),i[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function B(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const a=i.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return t[s]!==void 0?t[s]:""}))}const r=function(a,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const o=l[a],s=o.attributes;for(let n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function de(e,t,i,r,l,a){const o={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(o[d]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(r(c));let u=o[d];if(u)l(u,c,n);else{const f=ae(i,a);if(!f||(B(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,c,n)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=M,window.lnCore.lnFill=ce,window.lnCore.renderList=de);function x(e,t,i){const r=e.getAttribute(t);return r===null?i:r}function N(e,t,i){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?i:r}function R(e,t,i=!1){const r=e.getAttribute(t);if(r===null)return!!i;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const _=new Map;function W(e,t){const i=(e?e.join("|"):"")+"::"+t;if(_.has(i))return _.get(i);const r=new Set(e||[]),l=function(a,o){const s=a.getAttribute(o);return s!==null&&r.has(s)?s:t};return _.set(i,l),l}function P(e,t,i){const r=parseFloat(e.getAttribute(t));return isNaN(r)?i:r}function U(e,t,i){const r=e.getAttribute(t);if(!r)return i;try{return JSON.parse(r)}catch{return i}}function V(e,t,i,r,l){if(!e||t===null)return!0;const a=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${i}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${i}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function ue(e,t,i){for(const r in i){const[l,a,o]=i[r];Object.defineProperty(e,r,{get:function(){return l(t,a,o)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const i in e){const r=e[i];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=W(r.values,r.fallback);break;case"integer":l=N;break;case"float":l=P;break;case"boolean":l=R;break;case"list":l=j;break;case"json":l=U;break;case"string":default:l=x;break}l||(l=x),t[r.prop]=[l,i,r.fallback]}return t}function we(e){const t={};for(const i in e){const r=e[i];r&&r.effect&&(t[i]=r.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ue,window.lnCore.attrSpec=fe,window.lnCore.attrStr=x,window.lnCore.attrInt=N,window.lnCore.attrBool=R,window.lnCore.attrList=j,window.lnCore.attrEnum=W,window.lnCore.attrFloat=P,window.lnCore.attrJson=U);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(i){console.error("["+t.attribute+"] init failed",e,i)}}}function H(e,t,i,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:i,ComponentFn:r};if(e.matches&&e.matches(a)&&g(e,o),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)g(s[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function he(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(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 Q(){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 ge(e){const t=Q(),i=e.observed||[];for(let r=0;r<i.length;r++){const l=i[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=be(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function J(e,t,i,r){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const o=a.effects&&a.effects[i];o?o(t,i,r):a.onAttrChange&&(!a.declared||a.declared.has(i))&&a.onAttrChange(t,i,r)}}function me(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,r=Q(),l=r.byAttr.get(t),a=T()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!i&&!l&&!a)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(a&&A(o)){const s=r.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let c=0;c<s.length;c++)V(s[c].spec,n,t,s[c].componentTag,o)}if(window.lnCore._debugSink&&(i||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),i){const s=r.byReactive.get(t);s&&J(s,o,t,e.oldValue),r.reactiveWildcard.length&&J(r.reactiveWildcard,o,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const n=l[s];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(H(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{me(t[i])}catch(r){console.error("[ln-core] mutation handler failed",t[i].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function k(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function S(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=k();if(t.length){if(e.target)for(let i=0;i<t.length;i++){const r=t[i];if(r.onSubtreeChange&&r.query){const l=r.query,a=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;a&&r.onSubtreeChange(a,e)}}for(let i=0;i<e.addedNodes.length;i++){const r=e.addedNodes[i];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let a=0;a<t.length;a++){const o=t[a];if(o.selector&&o.attribute&&o.ComponentFn){if(!l)r.matches&&r.matches(o.query)&&g(r,o);else if(r.matches&&r.matches(o.query)&&g(r,o),r.querySelectorAll){const s=r.querySelectorAll(o.query);for(let n=0;n<s.length;n++)g(s[n],o)}}o.onInit&&o.onInit(r)}}}for(let i=0;i<e.removedNodes.length;i++){const r=e.removedNodes[i];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let a=0;a<t.length;a++){const o=t[a],s=o.query;if(s){if(!l)r.matches&&r.matches(s)&&S(r,o);else if(r.matches&&r.matches(s)&&S(r,o),r.querySelectorAll){const n=r.querySelectorAll(s);for(let c=0;c<n.length;c++)S(n[c],o)}}}}}}}function K(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.type==="childList")try{ye(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){k().push(e),K()}function Y(e,t,i,r,l={}){const a=l.extraAttributes||[],o=l.onAttributeChange||null,s=l.onSubtreeChange||null,n=l.onInit||null,c=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,f=u?we(u):d,h=u?new Set(Object.keys(u)):null,p=l.persist||null;function b(O){const w=O||document.body;if(H(w,e,t,i),u&&T())for(const m in u){const Te=u[m],D=Array.from(w.querySelectorAll("["+m+"]"));w.matches&&w.matches("["+m+"]")&&D.push(w);for(let I=0;I<D.length;I++){const q=D[I];A(q)&&V(Te,q.getAttribute(m),m,r,q)}}n&&n(w)}const L=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let w;for(;(w=O.exec(e))!==null;)L.push(w[1])}else L.push(e);ge({selector:e,attribute:t,componentTag:r,attributes:u,ComponentFn:i,onInit:n,observed:L.concat(a),onAttributeChange:o,onAttrChange:c,effects:f,declared:h,persist:p}),Ce();const Ie=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,qe=l.subtreeQuery||(Ie?e:"["+e+"]");k().push({selector:e,attribute:t,ComponentFn:i,onInit:n,onSubtreeChange:s,query:qe}),K(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=Ae);function G(){he()>0?pe(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),b}function z(e){return(e||"").replace(/^#/,"")}function E(e){const t=e===void 0?location.hash:e,i={},r=z(t);if(!r)return i;const l=r.split("&");for(let a=0;a<l.length;a++){const o=l[a];if(!o)continue;const s=o.indexOf(":"),n=s>-1?o.slice(0,s):o,c=s>-1?o.slice(s+1):"";if(n)try{i[n]=decodeURIComponent(c)}catch{i[n]=c}}return i}function ve(e){if(!e)return null;const t=E();return e in t?t[e]:null}function xe(e,t){if(!e)return;const i=E();t==null?delete i[e]:i[e]=String(t);const l=Object.keys(i).map(function(a){const o=i[a];return o===""?a:a+":"+encodeURIComponent(o)}).join("&");z(location.hash)!==l&&(location.hash=l)}function _e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ee(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:i,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=E,window.lnCore.hashGet=ve,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=_e,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Ee,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=Oe);function De(){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=De),(function(){const e="data-ln-sortable",t="lnSortable",i="data-ln-sortable-handle";if(window[t]!==void 0)return;const r={"data-ln-sortable":{effect:a,type:"enum",values:["enabled","disabled"],fallback:"enabled",description:"Enables drag-and-drop item reordering or disables when set to disabled"},"data-ln-sortable-handle":{type:"marker",description:"Designates an element as the drag handle for its parent sortable item"}};function l(o){this.dom=o,this.isEnabled=o.getAttribute(e)!=="disabled",this._dragging=null,o.setAttribute("aria-roledescription","sortable list");const s=this;return this._onPointerDown=function(n){s.isEnabled&&s._handlePointerDown(n)},o.addEventListener("pointerdown",this._onPointerDown),this}l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),delete this.dom[t])},l.prototype._handlePointerDown=function(o){let s=o.target.closest("["+i+"]"),n;if(s){for(n=s;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+i+"]"))return;for(n=o.target;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return;s=n}const d=Array.from(this.dom.children).indexOf(n);if(X(this.dom,"ln-sortable:before-drag",{item:n,index:d}).defaultPrevented)return;o.preventDefault(),s.setPointerCapture(o.pointerId),this._dragging=n,n.classList.add("ln-sortable--dragging"),n.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),C(this.dom,"ln-sortable:drag-start",{item:n,index:d});const f=this,h=function(b){f._handlePointerMove(b)},p=function(b){f._handlePointerEnd(b),s.removeEventListener("pointermove",h),s.removeEventListener("pointerup",p),s.removeEventListener("pointercancel",p)};s.addEventListener("pointermove",h),s.addEventListener("pointerup",p),s.addEventListener("pointercancel",p)},l.prototype._handlePointerMove=function(o){if(!this._dragging)return;const s=Array.from(this.dom.children),n=this._dragging;for(const c of s)c.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");for(const c of s){if(c===n)continue;const d=c.getBoundingClientRect(),u=d.top+d.height/2;if(o.clientY>=d.top&&o.clientY<u){c.classList.add("ln-sortable--drop-before");break}else if(o.clientY>=u&&o.clientY<=d.bottom){c.classList.add("ln-sortable--drop-after");break}}},l.prototype._handlePointerEnd=function(o){if(!this._dragging)return;const s=this._dragging,n=Array.from(this.dom.children),c=n.indexOf(s);let d=null,u=null;for(const f of n){if(f.classList.contains("ln-sortable--drop-before")){d=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){d=f,u="after";break}}for(const f of n)f.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(s.classList.remove("ln-sortable--dragging"),s.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),d&&d!==s){u==="before"?this.dom.insertBefore(s,d):this.dom.insertBefore(s,d.nextElementSibling);const h=Array.from(this.dom.children).indexOf(s);C(this.dom,"ln-sortable:reordered",{item:s,oldIndex:c,newIndex:h})}this._dragging=null};function a(o){const s=o[t];if(!s)return;const n=o.getAttribute(e)!=="disabled";n!==s.isEnabled&&(s.isEnabled=n,C(o,n?"ln-sortable:enabled":"ln-sortable:disabled",{target:o}))}Y(e,t,l,"ln-sortable",{attributes:r})})()})();
1
+ (function(){"use strict";function q(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!A(l))return}e.apply(console,t)}}function C(e,t,i){const l=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function X(e,t,i){const l=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(o),o}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 Z(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ee(e,t){const i=!!(t&&t.typed),l=t&&t.exclude,o={},a=e.elements,r={};if(i)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(r[n.name]=(r[n.name]||0)+1)}for(let s=0;s<a.length;s++){const n=a[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")i&&r[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&o[n.name].push(n.options[c].value)}else if(i&&n.type==="hidden")o[n.name]=n.value;else if(i&&(n.type==="number"||n.type==="range")){const c=Number(n.value);o[n.name]=n.value===""||isNaN(c)?null:c}else o[n.name]=n.value}return o}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ne(e,t){const i=e.elements,l=[],o={};for(let a=0;a<i.length;a++){const r=i[a];r.name&&r.type==="checkbox"&&(o[r.name]=(o[r.name]||0)+1)}for(let a=0;a<i.length;a++){const r=i[a];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const s=r.getAttribute("data-ln-fill-as")||r.name;if(!s||!(s in t))continue;const n=t[s];if(r.type==="checkbox"){if(Array.isArray(n))r.checked=n.indexOf(r.value)!==-1;else if(o[r.name]>1){const c=String(n).split(",").map(function(d){return d.trim()});r.checked=c.indexOf(r.value)!==-1}else r.checked=te(n);l.push(r)}else if(r.type==="radio")r.checked=r.value===String(n),l.push(r);else if(r.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<r.options.length;c++)r.options[c].selected=n.indexOf(r.options[c].value)!==-1;l.push(r)}else r.value=n,r.tagName==="SELECT"&&n!=null&&r.setAttribute("data-ln-value",n),l.push(r)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ne,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Z);const F={};function re(e,t){F[e]=t}function oe(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=oe);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){C(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function le(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];$[i]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=ie);const v={};function ae(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=v[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let r=0;r<i.length;r++){const s=i[r],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<l.length;r++){const s=l[r],n=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&s.setAttribute(u,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let r=0;r<o.length;r++){const s=o[r],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let r=0;r<a.length;r++){const s=a[r],n=s.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const d=n[c].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&s.classList.toggle(u,!!t[f])}}return e}function ce(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 i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<i.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[l],t??null),i[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function B(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const a=i.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,s){return t[s]!==void 0?t[s]:""}))}const l=function(a,r){return t[r]!==void 0?t[r]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let a=0;a<o.length;a++){const r=o[a],s=r.attributes;for(let n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&r.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function de(e,t,i,l,o,a){const r={};for(let n=0;n<e.children.length;n++){const c=e.children[n],d=c.getAttribute("data-ln-render-key");d&&(r[d]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],d=String(l(c));let u=r[d];if(u)o(u,c,n);else{const f=ae(i,a);if(!f||(B(f,c),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),o(u,c,n)}s.appendChild(u)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=M,window.lnCore.lnFill=ce,window.lnCore.renderList=de);function x(e,t,i){const l=e.getAttribute(t);return l===null?i:l}function N(e,t,i){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?i:l}function R(e,t,i=!1){const l=e.getAttribute(t);if(l===null)return!!i;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const _=new Map;function W(e,t){const i=(e?e.join("|"):"")+"::"+t;if(_.has(i))return _.get(i);const l=new Set(e||[]),o=function(a,r){const s=a.getAttribute(r);return s!==null&&l.has(s)?s:t};return _.set(i,o),o}function P(e,t,i){const l=parseFloat(e.getAttribute(t));return isNaN(l)?i:l}function U(e,t,i){const l=e.getAttribute(t);if(!l)return i;try{return JSON.parse(l)}catch{return i}}function V(e,t,i,l,o){if(!e||t===null)return!0;const a=l||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const s=n=>{o?console.warn(n,o):console.warn(n)};if(r==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${i}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${i}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function ue(e,t,i){for(const l in i){const[o,a,r]=i[l];Object.defineProperty(e,l,{get:function(){return o(t,a,r)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const i in e){const l=e[i];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=W(l.values,l.fallback);break;case"integer":o=N;break;case"float":o=P;break;case"boolean":o=R;break;case"list":o=j;break;case"json":o=U;break;case"string":default:o=x;break}o||(o=x),t[l.prop]=[o,i,l.fallback]}return t}function we(e){const t={};for(const i in e){const l=e[i];l&&l.effect&&(t[i]=l.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ue,window.lnCore.attrSpec=fe,window.lnCore.attrStr=x,window.lnCore.attrInt=N,window.lnCore.attrBool=R,window.lnCore.attrList=j,window.lnCore.attrEnum=W,window.lnCore.attrFloat=P,window.lnCore.attrJson=U);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(i){console.error("["+t.attribute+"] init failed",e,i)}}}function H(e,t,i,l){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:i,ComponentFn:l};if(e.matches&&e.matches(a)&&g(e,r),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)g(s[n],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function he(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(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 Q(){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 ge(e){const t=Q(),i=e.observed||[];for(let l=0;l<i.length;l++){const o=i[l];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(a=>a.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=be(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function J(e,t,i,l){for(let o=0;o<e.length;o++){const a=e[o];if(!t[a.attribute])continue;const r=a.effects&&a.effects[i];r?r(t,i,l):a.onAttrChange&&(!a.declared||a.declared.has(i))&&a.onAttrChange(t,i,l)}}function me(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,l=Q(),o=l.byAttr.get(t),a=q()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!i&&!o&&!a)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(a&&A(r)){const s=l.byDeclaredAttr.get(t),n=r.getAttribute(t);for(let c=0;c<s.length;c++)V(s[c].spec,n,t,s[c].componentTag,r)}if(window.lnCore._debugSink&&(i||o)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),i){const s=l.byReactive.get(t);s&&J(s,r,t,e.oldValue),l.reactiveWildcard.length&&J(l.reactiveWildcard,r,t,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const n=o[s];if(n.handler){n.handler(r,t,e.oldValue);continue}n.onAttributeChange&&r[n.attribute]?n.onAttributeChange(r,t):(H(r,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(r))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{me(t[i])}catch(l){console.error("[ln-core] mutation handler failed",t[i].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function k(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=k();if(!t.length)return;const i=e.target;if(i){const l=i.nodeType===1?i:i.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let l=0;l<t.length;l++){const o=t[l];if(o.onSubtreeChange&&o.query){const a=o.query,r=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;r&&o.onSubtreeChange(r,e)}}for(let l=0;l<e.addedNodes.length;l++){const o=e.addedNodes[l];if(o.nodeType===1){const a=!!(o.firstElementChild||o.children&&o.children.length);for(let r=0;r<t.length;r++){const s=t[r];if(s.selector&&s.attribute&&s.ComponentFn){if(!a)o.matches&&o.matches(s.query)&&g(o,s);else if(o.matches&&o.matches(s.query)&&g(o,s),o.querySelectorAll){const n=o.querySelectorAll(s.query);for(let c=0;c<n.length;c++)g(n[c],s)}}s.onInit&&s.onInit(o)}}}for(let l=0;l<e.removedNodes.length;l++){const o=e.removedNodes[l];if(o.nodeType===1){const a=!!(o.firstElementChild||o.children&&o.children.length);for(let r=0;r<t.length;r++){const s=t[r],n=s.query;if(n){if(!a)o.matches&&o.matches(n)&&E(o,s);else if(o.matches&&o.matches(n)&&E(o,s),o.querySelectorAll){const c=o.querySelectorAll(n);for(let d=0;d<c.length;d++)E(c[d],s)}}}}}}function K(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const l=t[i];if(l.type==="childList")try{ye(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){k().push(e),K()}function Y(e,t,i,l,o={}){const a=o.extraAttributes||[],r=o.onAttributeChange||null,s=o.onSubtreeChange||null,n=o.onInit||null,c=o.onAttrChange||null,d=o.effects||null,u=o.attributes||null,f=u?we(u):d,h=u?new Set(Object.keys(u)):null,p=o.persist||null;function b(O){const w=O||document.body;if(H(w,e,t,i),u&&q())for(const m in u){const qe=u[m],D=Array.from(w.querySelectorAll("["+m+"]"));w.matches&&w.matches("["+m+"]")&&D.push(w);for(let I=0;I<D.length;I++){const T=D[I];A(T)&&V(qe,T.getAttribute(m),m,l,T)}}n&&n(w)}const L=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let w;for(;(w=O.exec(e))!==null;)L.push(w[1])}else L.push(e);ge({selector:e,attribute:t,componentTag:l,attributes:u,ComponentFn:i,onInit:n,observed:L.concat(a),onAttributeChange:r,onAttrChange:c,effects:f,declared:h,persist:p}),Ce();const Ie=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Te=o.subtreeQuery||(Ie?e:"["+e+"]");k().push({selector:e,attribute:t,ComponentFn:i,onInit:n,onSubtreeChange:s,query:Te}),K(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=Ae);function G(){he()>0?pe(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",G):G(),b}function z(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,i={},l=z(t);if(!l)return i;const o=l.split("&");for(let a=0;a<o.length;a++){const r=o[a];if(!r)continue;const s=r.indexOf(":"),n=s>-1?r.slice(0,s):r,c=s>-1?r.slice(s+1):"";if(n)try{i[n]=decodeURIComponent(c)}catch{i[n]=c}}return i}function ve(e){if(!e)return null;const t=S();return e in t?t[e]:null}function xe(e,t){if(!e)return;const i=S();t==null?delete i[e]:i[e]=String(t);const o=Object.keys(i).map(function(a){const r=i[a];return r===""?a:a+":"+encodeURIComponent(r)}).join("&");z(location.hash)!==o&&(location.hash=o)}function _e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Ee(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Se(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Le(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Oe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),l=e.slice(t+1),o=l?l.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:i,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=ve,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=_e,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Ee,window.lnCore.hashSortDecode=Se,window.lnCore.hashFilterEncode=Le,window.lnCore.hashFilterDecode=Oe);function De(){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=De),(function(){const e="data-ln-sortable",t="lnSortable",i="data-ln-sortable-handle";if(window[t]!==void 0)return;const l={"data-ln-sortable":{effect:a,type:"enum",values:["enabled","disabled"],fallback:"enabled",description:"Enables drag-and-drop item reordering or disables when set to disabled"},"data-ln-sortable-handle":{type:"marker",description:"Designates an element as the drag handle for its parent sortable item"}};function o(r){this.dom=r,this.isEnabled=r.getAttribute(e)!=="disabled",this._dragging=null,r.setAttribute("aria-roledescription","sortable list");const s=this;return this._onPointerDown=function(n){s.isEnabled&&s._handlePointerDown(n)},r.addEventListener("pointerdown",this._onPointerDown),this}o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("pointerdown",this._onPointerDown),delete this.dom[t])},o.prototype._handlePointerDown=function(r){let s=r.target.closest("["+i+"]"),n;if(s){for(n=s;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return}else{if(this.dom.querySelector("["+i+"]"))return;for(n=r.target;n&&n.parentElement!==this.dom;)n=n.parentElement;if(!n||n.parentElement!==this.dom)return;s=n}const d=Array.from(this.dom.children).indexOf(n);if(X(this.dom,"ln-sortable:before-drag",{item:n,index:d}).defaultPrevented)return;r.preventDefault(),s.setPointerCapture(r.pointerId),this._dragging=n,n.classList.add("ln-sortable--dragging"),n.setAttribute("aria-grabbed","true"),this.dom.classList.add("ln-sortable--active"),C(this.dom,"ln-sortable:drag-start",{item:n,index:d});const f=this,h=function(b){f._handlePointerMove(b)},p=function(b){f._handlePointerEnd(b),s.removeEventListener("pointermove",h),s.removeEventListener("pointerup",p),s.removeEventListener("pointercancel",p)};s.addEventListener("pointermove",h),s.addEventListener("pointerup",p),s.addEventListener("pointercancel",p)},o.prototype._handlePointerMove=function(r){if(!this._dragging)return;const s=Array.from(this.dom.children),n=this._dragging;for(const c of s)c.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");for(const c of s){if(c===n)continue;const d=c.getBoundingClientRect(),u=d.top+d.height/2;if(r.clientY>=d.top&&r.clientY<u){c.classList.add("ln-sortable--drop-before");break}else if(r.clientY>=u&&r.clientY<=d.bottom){c.classList.add("ln-sortable--drop-after");break}}},o.prototype._handlePointerEnd=function(r){if(!this._dragging)return;const s=this._dragging,n=Array.from(this.dom.children),c=n.indexOf(s);let d=null,u=null;for(const f of n){if(f.classList.contains("ln-sortable--drop-before")){d=f,u="before";break}if(f.classList.contains("ln-sortable--drop-after")){d=f,u="after";break}}for(const f of n)f.classList.remove("ln-sortable--drop-before","ln-sortable--drop-after");if(s.classList.remove("ln-sortable--dragging"),s.removeAttribute("aria-grabbed"),this.dom.classList.remove("ln-sortable--active"),d&&d!==s){u==="before"?this.dom.insertBefore(s,d):this.dom.insertBefore(s,d.nextElementSibling);const h=Array.from(this.dom.children).indexOf(s);C(this.dom,"ln-sortable:reordered",{item:s,oldIndex:c,newIndex:h})}this._dragging=null};function a(r){const s=r[t];if(!s)return;const n=r.getAttribute(e)!=="disabled";n!==s.isEnabled&&(s.isEnabled=n,C(r,n?"ln-sortable:enabled":"ln-sortable:disabled",{target:r}))}Y(e,t,o,"ln-sortable",{attributes:l})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function D(){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 m(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 n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!m(n))return}e.apply(console,t)}}function I(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(n&&o.matches&&o.matches(n)))if(o.type==="checkbox")r&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&l[o.name].push(o.options[u].value)}else if(r&&o.type==="hidden")l[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const u=Number(o.value);l[o.name]=o.value===""||isNaN(u)?null:u}else l[o.name]=o.value}return l}function ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const r=e.elements,n=[],l={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const o=t[c];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const u=String(o).split(",").map(function(d){return d.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=ee(o);n.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),n.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<i.options.length;u++)i.options[u].selected=o.indexOf(i.options[u].value)!==-1;n.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),n.push(i)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const q={};function ne(e,t){q[e]=t}function re(e){return q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=re);function oe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function ie(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];F[r]=t}function le(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return F[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ie,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=oe);const y={};function se(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=y[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function T(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const n=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<n.length;i++){const c=n[i],o=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const d=o[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(a,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],o=c.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const d=o[u].trim().split(":");if(d.length!==2)continue;const a=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(a,!!t[f])}}return e}function ce(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 n=0;n<r.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[n],t??null),r[n].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)T(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 $(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const n=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let o=0;o<c.length;o++){const u=c[o];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ue(e,t,r,n,l,s){const i={};for(let o=0;o<e.children.length;o++){const u=e.children[o],d=u.getAttribute("data-ln-render-key");d&&(i[d]=u)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],d=String(n(u));let a=i[d];if(a)l(a,u,o);else{const f=se(r,s);if(!f||($(f,u),a=f.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",d),l(a,u,o)}c.appendChild(a)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=T,window.lnCore.lnFill=ce,window.lnCore.renderList=ue);function h(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function N(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function R(e,t,r=!1){const n=e.getAttribute(t);if(n===null)return!!r;const l=n.trim().toLowerCase();return!(l==="false"||l==="0")}function M(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function B(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const n=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&n.has(c)?c:t};return A.set(r,l),l}function j(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function W(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function V(e,t,r,n,l){if(!e||t===null)return!0;const s=n||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function U(e,t,r){for(const n in r){const[l,s,i]=r[n];Object.defineProperty(e,n,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function H(e){const t={};for(const r in e){const n=e[r];if(!n||!n.prop)continue;let l=n.read;if(!l&&n.type)switch(n.type){case"enum":l=B(n.values,n.fallback);break;case"integer":l=N;break;case"float":l=j;break;case"boolean":l=R;break;case"list":l=M;break;case"json":l=W;break;case"string":default:l=h;break}l||(l=h),t[n.prop]=[l,r,n.fallback]}return t}function ae(e){const t={};for(const r in e){const n=e[r];n&&n.effect&&(t[r]=n.effect)}return Object.keys(t).length?t:null}function de(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=U,window.lnCore.attrSpec=H,window.lnCore.attrStr=h,window.lnCore.attrInt=N,window.lnCore.attrBool=R,window.lnCore.attrList=M,window.lnCore.attrEnum=B,window.lnCore.attrFloat=j,window.lnCore.attrJson=W);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(s)&&b(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)b(c[o],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(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 Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function he(e){const t=Q(),r=e.observed||[];for(let n=0;n<r.length;n++){const l=r[n];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const l=t.byDeclaredAttr.get(n);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=de(e);if(n===null)t.reactiveWildcard.push(e);else for(const l of n)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function K(e,t,r,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,n):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,n)}}function be(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=Q(),l=n.byAttr.get(t),s=D()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&m(i)){const c=n.byDeclaredAttr.get(t),o=i.getAttribute(t);for(let u=0;u<c.length;u++)V(c[u].spec,o,t,c[u].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=n.byReactive.get(t);c&&K(c,i,t,e.oldValue),n.reactiveWildcard.length&&K(n.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const o=l[c];if(o.handler){o.handler(i,t,e.oldValue);continue}o.onAttributeChange&&i[o.attribute]?o.onAttributeChange(i,t):(J(i,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(i))}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{be(t[r])}catch(n){console.error("[ln-core] mutation handler failed",t[r].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function x(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function v(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ge(e){const t=x();if(t.length){if(e.target)for(let r=0;r<t.length;r++){const n=t[r];if(n.onSubtreeChange&&n.query){const l=n.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&&n.onSubtreeChange(s,e)}}for(let r=0;r<e.addedNodes.length;r++){const n=e.addedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)n.matches&&n.matches(i.query)&&b(n,i);else if(n.matches&&n.matches(i.query)&&b(n,i),n.querySelectorAll){const c=n.querySelectorAll(i.query);for(let o=0;o<c.length;o++)b(c[o],i)}}i.onInit&&i.onInit(n)}}}for(let r=0;r<e.removedNodes.length;r++){const n=e.removedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s],c=i.query;if(c){if(!l)n.matches&&n.matches(c)&&v(n,i);else if(n.matches&&n.matches(c)&&v(n,i),n.querySelectorAll){const o=n.querySelectorAll(c);for(let u=0;u<o.length;u++)v(o[u],i)}}}}}}}function P(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{ge(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ce(e){x().push(e),P()}function z(e,t,r,n,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,o=l.onInit||null,u=l.onAttrChange||null,d=l.effects||null,a=l.attributes||null,f=a?ae(a):d,De=a?new Set(Object.keys(a)):null,Ie=l.persist||null;function C(k){const w=k||document.body;if(J(w,e,t,r),a&&D())for(const p in a){const Te=a[p],O=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&O.push(w);for(let L=0;L<O.length;L++){const E=O[L];m(E)&&V(Te,E.getAttribute(p),p,n,E)}}o&&o(w)}const S=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let w;for(;(w=k.exec(e))!==null;)S.push(w[1])}else S.push(e);he({selector:e,attribute:t,componentTag:n,attributes:a,ComponentFn:r,onInit:o,observed:S.concat(s),onAttributeChange:i,onAttrChange:u,effects:f,declared:De,persist:Ie}),pe();const qe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Fe=l.subtreeQuery||(qe?e:"["+e+"]");x().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:c,query:Fe}),P(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=z,window.lnCore.observeLifecycle=Ce);function X(){fe()>0?we(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",X):X(),C}function G(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,r={},n=G(t);if(!n)return r;const l=n.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),o=c>-1?i.slice(0,c):i,u=c>-1?i.slice(c+1):"";if(o)try{r[o]=decodeURIComponent(u)}catch{r[o]=u}}return r}function me(e){if(!e)return null;const t=_();return e in t?t[e]:null}function ye(e,t){if(!e)return;const r=_();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");G(location.hash)!==l&&(location.hash=l)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function xe(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 n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(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 Se(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),n=e.slice(t+1),l=n?n.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=me,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=xe,window.lnCore.hashSortEncode=ve,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=Se,window.lnCore.hashFilterDecode=ke);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe);function Le(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t).trim(),n=e.slice(t+1).trim();if(!r)return null;const l={};return l[r]=[n],l}function Ee(e){return e==null?"":String(e)}(function(){const e="data-ln-stat",t="lnStat";if(window[t]!==void 0)return;const r={"data-ln-stat":{prop:"_storeName",type:"string",read:h,fallback:"",description:"Store or entity name to count"},"data-ln-stat-filter":{prop:"_filterRaw",type:"string",read:h,fallback:"",description:"JSON or key:value filter criteria for record counting"}},n=H(r);function l(s){return this.dom=s,U(this,s,n),this._onSetCount=function(i){s.textContent=Ee(i.detail&&i.detail.count),s.classList.remove("is-loading")},s.addEventListener("ln-stat:set-count",this._onSetCount),I(s,"ln-stat:request-count",{stat:this._storeName,filters:Le(this._filterRaw)}),this}l.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},z(e,t,l,"ln-stat",{attributes:r})})()})();
1
+ (function(){"use strict";function D(){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 m(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 i=null;for(let n=1;n<t.length;n++)if(t[n]&&t[n].nodeType===1){i=t[n];break}if(!m(i))return}e.apply(console,t)}}function I(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Z(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,n={},s=e.elements,l={};if(r)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(i&&o.matches&&o.matches(i)))if(o.type==="checkbox")r&&l[o.name]===1?n[o.name]=o.checked:(n[o.name]||(n[o.name]=[]),o.checked&&n[o.name].push(o.value));else if(o.type==="radio")o.checked&&(n[o.name]=o.value);else if(o.type==="select-multiple"){n[o.name]=[];for(let u=0;u<o.options.length;u++)o.options[u].selected&&n[o.name].push(o.options[u].value)}else if(r&&o.type==="hidden")n[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const u=Number(o.value);n[o.name]=o.value===""||isNaN(u)?null:u}else n[o.name]=o.value}return n}function ee(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function te(e,t){const r=e.elements,i=[],n={};for(let s=0;s<r.length;s++){const l=r[s];l.name&&l.type==="checkbox"&&(n[l.name]=(n[l.name]||0)+1)}for(let s=0;s<r.length;s++){const l=r[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const o=t[c];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(n[l.name]>1){const u=String(o).split(",").map(function(a){return a.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=ee(o);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let u=0;u<l.options.length;u++)l.options[u].selected=o.indexOf(l.options[u].value)!==-1;i.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=te,window.lnCore.serializeForm=Z,window.lnCore.resolveFormMethod=Y);const q={};function ne(e,t){q[e]=t}function re(e){return q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ne,window.lnCore.getDataMapper=re);function oe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function ie(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];F[r]=t}function le(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return F[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ie,window.lnCore.getLocaleFallback=le,window.lnCore.ensureLocaleObserver=oe);const y={};function se(e,t){y[e]||(y[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=y[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function T(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const c=r[l],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const c=i[l],o=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<o.length;u++){const a=o[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const n=e.querySelectorAll("[data-ln-show]");for(let l=0;l<n.length;l++){const c=n[l],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],o=c.getAttribute("data-ln-class").split(",");for(let u=0;u<o.length;u++){const a=o[u].trim().split(":");if(a.length!==2)continue;const d=a[0].trim(),f=a[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function ce(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 i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].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)T(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 $(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const i=function(s,l){return t[l]!==void 0?t[l]:""},n=Array.from(e.querySelectorAll("*"));e.nodeType===1&&n.push(e);for(let s=0;s<n.length;s++){const l=n[s],c=l.attributes;for(let o=0;o<c.length;o++){const u=c[o];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function ue(e,t,r,i,n,s){const l={};for(let o=0;o<e.children.length;o++){const u=e.children[o],a=u.getAttribute("data-ln-render-key");a&&(l[a]=u)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const u=t[o],a=String(i(u));let d=l[a];if(d)n(d,u,o);else{const f=se(r,s);if(!f||($(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",a),n(d,u,o)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=T,window.lnCore.lnFill=ce,window.lnCore.renderList=ue);function h(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function N(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function R(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const n=i.trim().toLowerCase();return!(n==="false"||n==="0")}function M(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const A=new Map;function B(e,t){const r=(e?e.join("|"):"")+"::"+t;if(A.has(r))return A.get(r);const i=new Set(e||[]),n=function(s,l){const c=s.getAttribute(l);return c!==null&&i.has(c)?c:t};return A.set(r,n),n}function j(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function W(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function V(e,t,r,i,n){if(!e||t===null)return!0;const s=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=o=>{n?console.warn(o,n):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function U(e,t,r){for(const i in r){const[n,s,l]=r[i];Object.defineProperty(e,i,{get:function(){return n(t,s,l)},enumerable:!0,configurable:!0})}return e}function H(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let n=i.read;if(!n&&i.type)switch(i.type){case"enum":n=B(i.values,i.fallback);break;case"integer":n=N;break;case"float":n=j;break;case"boolean":n=R;break;case"list":n=M;break;case"json":n=W;break;case"string":default:n=h;break}n||(n=h),t[i.prop]=[n,r,i.fallback]}return t}function ae(e){const t={};for(const r in e){const i=e[r];i&&i.effect&&(t[r]=i.effect)}return Object.keys(t).length?t:null}function de(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=U,window.lnCore.attrSpec=H,window.lnCore.attrStr=h,window.lnCore.attrInt=N,window.lnCore.attrBool=R,window.lnCore.attrList=M,window.lnCore.attrEnum=B,window.lnCore.attrFloat=j,window.lnCore.attrJson=W);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(s)&&b(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)b(c[o],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function we(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 Q(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function he(e){const t=Q(),r=e.observed||[];for(let i=0;i<r.length;i++){const n=r[i];t.byAttr.has(n)||t.byAttr.set(n,[]),t.byAttr.get(n).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const n=t.byDeclaredAttr.get(i);n.some(s=>s.componentTag===e.componentTag)||n.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=de(e);if(i===null)t.reactiveWildcard.push(e);else for(const n of i)t.byReactive.has(n)||t.byReactive.set(n,[]),t.byReactive.get(n).push(e)}e.persist&&t.persist.push(e)}function K(e,t,r,i){for(let n=0;n<e.length;n++){const s=e[n];if(!t[s.attribute])continue;const l=s.effects&&s.effects[r];l?l(t,r,i):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,i)}}function be(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=Q(),n=i.byAttr.get(t),s=D()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!n&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&m(l)){const c=i.byDeclaredAttr.get(t),o=l.getAttribute(t);for(let u=0;u<c.length;u++)V(c[u].spec,o,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(r||n)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const c=i.byReactive.get(t);c&&K(c,l,t,e.oldValue),i.reactiveWildcard.length&&K(i.reactiveWildcard,l,t,e.oldValue)}if(n)for(let c=0;c<n.length;c++){const o=n[c];if(o.handler){o.handler(l,t,e.oldValue);continue}o.onAttributeChange&&l[o.attribute]?o.onAttributeChange(l,t):(J(l,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(l))}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{be(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function x(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function v(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ge(e){const t=x();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}if(e.target)for(let i=0;i<t.length;i++){const n=t[i];if(n.onSubtreeChange&&n.query){const s=n.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;l&&n.onSubtreeChange(l,e)}}for(let i=0;i<e.addedNodes.length;i++){const n=e.addedNodes[i];if(n.nodeType===1){const s=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const c=t[l];if(c.selector&&c.attribute&&c.ComponentFn){if(!s)n.matches&&n.matches(c.query)&&b(n,c);else if(n.matches&&n.matches(c.query)&&b(n,c),n.querySelectorAll){const o=n.querySelectorAll(c.query);for(let u=0;u<o.length;u++)b(o[u],c)}}c.onInit&&c.onInit(n)}}}for(let i=0;i<e.removedNodes.length;i++){const n=e.removedNodes[i];if(n.nodeType===1){const s=!!(n.firstElementChild||n.children&&n.children.length);for(let l=0;l<t.length;l++){const c=t[l],o=c.query;if(o){if(!s)n.matches&&n.matches(o)&&v(n,c);else if(n.matches&&n.matches(o)&&v(n,c),n.querySelectorAll){const u=n.querySelectorAll(o);for(let a=0;a<u.length;a++)v(u[a],c)}}}}}}function P(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{ge(i)}catch(n){console.error("[ln-core] lifecycle handler failed",i.target,n)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ce(e){x().push(e),P()}function z(e,t,r,i,n={}){const s=n.extraAttributes||[],l=n.onAttributeChange||null,c=n.onSubtreeChange||null,o=n.onInit||null,u=n.onAttrChange||null,a=n.effects||null,d=n.attributes||null,f=d?ae(d):a,De=d?new Set(Object.keys(d)):null,Ie=n.persist||null;function C(k){const w=k||document.body;if(J(w,e,t,r),d&&D())for(const p in d){const Te=d[p],O=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&O.push(w);for(let E=0;E<O.length;E++){const L=O[E];m(L)&&V(Te,L.getAttribute(p),p,i,L)}}o&&o(w)}const S=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let w;for(;(w=k.exec(e))!==null;)S.push(w[1])}else S.push(e);he({selector:e,attribute:t,componentTag:i,attributes:d,ComponentFn:r,onInit:o,observed:S.concat(s),onAttributeChange:l,onAttrChange:u,effects:f,declared:De,persist:Ie}),pe();const qe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Fe=n.subtreeQuery||(qe?e:"["+e+"]");x().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:c,query:Fe}),P(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=z,window.lnCore.observeLifecycle=Ce);function X(){fe()>0?we(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",X):X(),C}function G(e){return(e||"").replace(/^#/,"")}function _(e){const t=e===void 0?location.hash:e,r={},i=G(t);if(!i)return r;const n=i.split("&");for(let s=0;s<n.length;s++){const l=n[s];if(!l)continue;const c=l.indexOf(":"),o=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(o)try{r[o]=decodeURIComponent(u)}catch{r[o]=u}}return r}function me(e){if(!e)return null;const t=_();return e in t?t[e]:null}function ye(e,t){if(!e)return;const r=_();t==null?delete r[e]:r[e]=String(t);const n=Object.keys(r).map(function(s){const l=r[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");G(location.hash)!==n&&(location.hash=n)}function Ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function xe(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 i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function ve(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function _e(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 Se(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),i=e.slice(t+1),n=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=_,window.lnCore.hashGet=me,window.lnCore.hashSet=ye,window.lnCore.hashLinkClick=Ae,window.lnCore.resolveHashNamespace=xe,window.lnCore.hashSortEncode=ve,window.lnCore.hashSortDecode=_e,window.lnCore.hashFilterEncode=Se,window.lnCore.hashFilterDecode=ke);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe);function Ee(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t).trim(),i=e.slice(t+1).trim();if(!r)return null;const n={};return n[r]=[i],n}function Le(e){return e==null?"":String(e)}(function(){const e="data-ln-stat",t="lnStat";if(window[t]!==void 0)return;const r={"data-ln-stat":{prop:"_storeName",type:"string",read:h,fallback:"",description:"Store or entity name to count"},"data-ln-stat-filter":{prop:"_filterRaw",type:"string",read:h,fallback:"",description:"JSON or key:value filter criteria for record counting"}},i=H(r);function n(s){return this.dom=s,U(this,s,i),this._onSetCount=function(l){s.textContent=Le(l.detail&&l.detail.count),s.classList.remove("is-loading")},s.addEventListener("ln-stat:set-count",this._onSetCount),I(s,"ln-stat:request-count",{stat:this._storeName,filters:Ee(this._filterRaw)}),this}n.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-stat:set-count",this._onSetCount),delete this.dom[t])},z(e,t,n,"ln-stat",{attributes:r})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function U(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function N(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const e=t.closest("[data-ln-debug]");return!(!e||typeof document<"u"&&e===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const t=console.warn;console.warn=function(...e){if(typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))){let r=null;for(let c=1;c<e.length;c++)if(e[c]&&e[c].nodeType===1){r=e[c];break}if(!N(r))return}t.apply(console,e)}}function D(t,e,l){const r=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,r),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function wt(t,e,l){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const r={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};r[l]=t.name,D(t.dom,e,r)}function H(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){H(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function G(t){return t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.tagName==="DATA"&&t.hasAttribute("value")?t.getAttribute("value"):t.textContent.trim()}function _t(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function gt(t,e){const l=!!(e&&e.typed),r=e&&e.exclude,c={},b=t.elements,a={};if(l)for(let h=0;h<b.length;h++){const o=b[h];o.name&&o.type==="checkbox"&&!o.disabled&&(a[o.name]=(a[o.name]||0)+1)}for(let h=0;h<b.length;h++){const o=b[h];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")l&&a[o.name]===1?c[o.name]=o.checked:(c[o.name]||(c[o.name]=[]),o.checked&&c[o.name].push(o.value));else if(o.type==="radio")o.checked&&(c[o.name]=o.value);else if(o.type==="select-multiple"){c[o.name]=[];for(let p=0;p<o.options.length;p++)o.options[p].selected&&c[o.name].push(o.options[p].value)}else if(l&&o.type==="hidden")c[o.name]=o.value;else if(l&&(o.type==="number"||o.type==="range")){const p=Number(o.value);c[o.name]=o.value===""||isNaN(p)?null:p}else c[o.name]=o.value}return c}function mt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function yt(t,e){const l=t.elements,r=[],c={};for(let b=0;b<l.length;b++){const a=l[b];a.name&&a.type==="checkbox"&&(c[a.name]=(c[a.name]||0)+1)}for(let b=0;b<l.length;b++){const a=l[b];if(a.type==="file"||a.type==="submit"||a.type==="button")continue;const h=a.getAttribute("data-ln-fill-as")||a.name;if(!h||!(h in e))continue;const o=e[h];if(a.type==="checkbox"){if(Array.isArray(o))a.checked=o.indexOf(a.value)!==-1;else if(c[a.name]>1){const p=String(o).split(",").map(function(v){return v.trim()});a.checked=p.indexOf(a.value)!==-1}else a.checked=mt(o);r.push(a)}else if(a.type==="radio")a.checked=a.value===String(o),r.push(a);else if(a.type==="select-multiple"){if(Array.isArray(o))for(let p=0;p<a.options.length;p++)a.options[p].selected=o.indexOf(a.options[p].value)!==-1;r.push(a)}else a.value=o,a.tagName==="SELECT"&&o!=null&&a.setAttribute("data-ln-value",o),r.push(a)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=yt,window.lnCore.serializeForm=gt,window.lnCore.resolveFormMethod=_t);const K={};function Ct(t,e){K[t]=e}function St(t){return K[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ct,window.lnCore.getDataMapper=St);function vt(t){const e=t?t.closest("[lang]"):null,l=(e?e.getAttribute("lang")||e.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return l?l.trim():"en-US"}function At(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,H(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Q={};function Et(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];Q[l]=e}function kt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return Q[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Et,window.lnCore.getLocaleFallback=kt,window.lnCore.ensureLocaleObserver=At);const M={};function Y(t,e){M[t]||(M[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=M[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function J(t,e,l){if(t){const r=t.querySelector('[data-ln-template="'+e+'"]');if(r)return r.content.cloneNode(!0)}return Y(e,l)}function X(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let a=0;a<l.length;a++){const h=l[a],o=h.getAttribute("data-ln-field");e[o]!=null&&(h.textContent=e[o])}const r=t.querySelectorAll("[data-ln-attr]");for(let a=0;a<r.length;a++){const h=r[a],o=h.getAttribute("data-ln-attr").split(",");for(let p=0;p<o.length;p++){const v=o[p].trim().split(":");if(v.length!==2)continue;const A=v[0].trim(),E=v[1].trim();e[E]!=null&&h.setAttribute(A,e[E])}}const c=t.querySelectorAll("[data-ln-show]");for(let a=0;a<c.length;a++){const h=c[a],o=h.getAttribute("data-ln-show");o in e&&h.classList.toggle("hidden",!e[o])}const b=t.querySelectorAll("[data-ln-class]");for(let a=0;a<b.length;a++){const h=b[a],o=h.getAttribute("data-ln-class").split(",");for(let p=0;p<o.length;p++){const v=o[p].trim().split(":");if(v.length!==2)continue;const A=v[0].trim(),E=v[1].trim();E in e&&h.classList.toggle(A,!!e[E])}}return t}function xt(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,e??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0})));const l=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<l.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[r],e??null),l[r].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)X(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let l=0;l<e.length;l++)e[l].textContent=""}})));function W(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const b=l.currentNode;b.textContent.indexOf("{{")!==-1&&(b.textContent=b.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(a,h){return e[h]!==void 0?e[h]:""}))}const r=function(b,a){return e[a]!==void 0?e[a]:""},c=Array.from(t.querySelectorAll("*"));t.nodeType===1&&c.push(t);for(let b=0;b<c.length;b++){const a=c[b],h=a.attributes;for(let o=0;o<h.length;o++){const p=h[o];p.value.indexOf("{{")!==-1&&a.setAttribute(p.name,p.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function Dt(t,e,l,r,c,b){const a={};for(let o=0;o<t.children.length;o++){const p=t.children[o],v=p.getAttribute("data-ln-render-key");v&&(a[v]=p)}const h=document.createDocumentFragment();for(let o=0;o<e.length;o++){const p=e[o],v=String(r(p));let A=a[v];if(A)c(A,p,o);else{const E=Y(l,b);if(!E||(W(E,p),A=E.firstElementChild,!A))continue;A.setAttribute("data-ln-render-key",v),c(A,p,o)}h.appendChild(A)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=X,window.lnCore.lnFill=xt,window.lnCore.renderList=Dt);function R(t,e,l){const r=t.getAttribute(e);return r===null?l:r}function Z(t,e,l){const r=parseInt(t.getAttribute(e),10);return isNaN(r)?l:r}function P(t,e,l=!1){const r=t.getAttribute(e);if(r===null)return!!l;const c=r.trim().toLowerCase();return!(c==="false"||c==="0")}function tt(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const V=new Map;function et(t,e){const l=(t?t.join("|"):"")+"::"+e;if(V.has(l))return V.get(l);const r=new Set(t||[]),c=function(b,a){const h=b.getAttribute(a);return h!==null&&r.has(h)?h:e};return V.set(l,c),c}function nt(t,e,l){const r=parseFloat(t.getAttribute(e));return isNaN(r)?l:r}function it(t,e,l){const r=t.getAttribute(e);if(!r)return l;try{return JSON.parse(r)}catch{return l}}function lt(t,e,l,r,c){if(!t||e===null)return!0;const b=r||"ln-component",a=t.type;if(a==="trigger"||a==="marker"||a==="string"||a==="list"||!a||e===""&&t.fallback!==void 0)return!0;const h=o=>{c?console.warn(o,c):console.warn(o)};if(a==="boolean"){const o=e.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(h(`[${b}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(a==="enum"){const o=t.values||[];return o.includes(e)?!0:(h(`[${b}] Invalid value "${e}" for attribute "${l}". Allowed: ${o.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(a==="integer"){if(!/^-?\d+$/.test(e))return h(`[${b}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const o=parseInt(e,10);return t.min!==void 0&&o<t.min?(h(`[${b}] Value ${o} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&o>t.max?(h(`[${b}] Value ${o} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(a==="float")return isNaN(Number(e))?(h(`[${b}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(a==="json")try{return JSON.parse(e),!0}catch(o){return h(`[${b}] Invalid JSON for attribute "${l}": ${o.message}. Fallback: ${t.fallback}.`),!1}return!0}function rt(t,e,l){for(const r in l){const[c,b,a]=l[r];Object.defineProperty(t,r,{get:function(){return c(e,b,a)},enumerable:!0,configurable:!0})}return t}function ot(t){const e={};for(const l in t){const r=t[l];if(!r||!r.prop)continue;let c=r.read;if(!c&&r.type)switch(r.type){case"enum":c=et(r.values,r.fallback);break;case"integer":c=Z;break;case"float":c=nt;break;case"boolean":c=P;break;case"list":c=tt;break;case"json":c=it;break;case"string":default:c=R;break}c||(c=R),e[r.prop]=[c,l,r.fallback]}return e}function Tt(t){const e={};for(const l in t){const r=t[l];r&&r.effect&&(e[l]=r.effect)}return Object.keys(e).length?e:null}function Lt(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const l in t.effects)e.add(l);if(t.onAttrChange&&t.declared)for(const l of t.declared)e.add(l);return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=rt,window.lnCore.attrSpec=ot,window.lnCore.attrStr=R,window.lnCore.attrInt=Z,window.lnCore.attrBool=P,window.lnCore.attrList=tt,window.lnCore.attrEnum=et,window.lnCore.attrFloat=nt,window.lnCore.attrJson=it);function O(t,e){if(!t[e.attribute]){window.lnCore._persistSink&&t.hasAttribute&&t.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(t,e.selector);try{t[e.attribute]=new e.ComponentFn(t)}catch(l){console.error("["+e.attribute+"] init failed",t,l)}}}function st(t,e,l,r){if(t.nodeType!==1)return;const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",a={selector:e,attribute:l,ComponentFn:r};if(t.matches&&t.matches(b)&&O(t,a),t.querySelectorAll){const h=t.querySelectorAll(b);for(let o=0;o<h.length;o++)O(h[o],a)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function qt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function It(t){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(t):setTimeout(t,0)):t()}function at(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function Ft(t){const e=at(),l=t.observed||[];for(let r=0;r<l.length;r++){const c=l[r];e.byAttr.has(c)||e.byAttr.set(c,[]),e.byAttr.get(c).push(t)}if(e.byDeclaredAttr=e.byDeclaredAttr||new Map,t.attributes)for(const r in t.attributes){e.byDeclaredAttr.has(r)||e.byDeclaredAttr.set(r,[]);const c=e.byDeclaredAttr.get(r);c.some(b=>b.componentTag===t.componentTag)||c.push({spec:t.attributes[r],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const r=Lt(t);if(r===null)e.reactiveWildcard.push(t);else for(const c of r)e.byReactive.has(c)||e.byReactive.set(c,[]),e.byReactive.get(c).push(t)}t.persist&&e.persist.push(t)}function ct(t,e,l,r){for(let c=0;c<t.length;c++){const b=t[c];if(!e[b.attribute])continue;const a=b.effects&&b.effects[l];a?a(e,l,r):b.onAttrChange&&(!b.declared||b.declared.has(l))&&b.onAttrChange(e,l,r)}}function Rt(t){const e=t.attributeName,l=e.indexOf("data-ln-")===0,r=at(),c=r.byAttr.get(e),b=U()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(e);if(!l&&!c&&!b)return;const a=t.target;if(t.oldValue!==a.getAttribute(e)){if(b&&N(a)){const h=r.byDeclaredAttr.get(e),o=a.getAttribute(e);for(let p=0;p<h.length;p++)lt(h[p].spec,o,e,h[p].componentTag,a)}if(window.lnCore._debugSink&&(l||c)&&window.lnCore._debugSink("attr",e,a,{oldValue:t.oldValue,newValue:a.getAttribute(e)}),l){const h=r.byReactive.get(e);h&&ct(h,a,e,t.oldValue),r.reactiveWildcard.length&&ct(r.reactiveWildcard,a,e,t.oldValue)}if(c)for(let h=0;h<c.length;h++){const o=c[h];if(o.handler){o.handler(a,e,t.oldValue);continue}o.onAttributeChange&&a[o.attribute]?o.onAttributeChange(a,e):(st(a,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(a))}}}function Ot(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,H(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Rt(e[l])}catch(r){console.error("[ln-core] mutation handler failed",e[l].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function B(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function z(t,e){if(!document.contains(t))if(e.attribute){const l=t[e.attribute];if(l&&typeof l.destroy=="function")try{l.destroy()}catch(r){console.error("["+e.attribute+"] destroy failed",t,r)}delete t[e.attribute]}else e.onDestroy&&e.onDestroy(t)}function Ht(t){const e=B();if(e.length){if(t.target)for(let l=0;l<e.length;l++){const r=e[l];if(r.onSubtreeChange&&r.query){const c=r.query,b=t.target.nodeType===1?t.target.matches&&t.target.matches(c)?t.target:t.target.closest?t.target.closest(c):null:t.target.parentElement&&t.target.parentElement.closest?t.target.parentElement.closest(c):null;b&&r.onSubtreeChange(b,t)}}for(let l=0;l<t.addedNodes.length;l++){const r=t.addedNodes[l];if(r.nodeType===1){const c=!!(r.firstElementChild||r.children&&r.children.length);for(let b=0;b<e.length;b++){const a=e[b];if(a.selector&&a.attribute&&a.ComponentFn){if(!c)r.matches&&r.matches(a.query)&&O(r,a);else if(r.matches&&r.matches(a.query)&&O(r,a),r.querySelectorAll){const h=r.querySelectorAll(a.query);for(let o=0;o<h.length;o++)O(h[o],a)}}a.onInit&&a.onInit(r)}}}for(let l=0;l<t.removedNodes.length;l++){const r=t.removedNodes[l];if(r.nodeType===1){const c=!!(r.firstElementChild||r.children&&r.children.length);for(let b=0;b<e.length;b++){const a=e[b],h=a.query;if(h){if(!c)r.matches&&r.matches(h)&&z(r,a);else if(r.matches&&r.matches(h)&&z(r,a),r.querySelectorAll){const o=r.querySelectorAll(h);for(let p=0;p<o.length;p++)z(o[p],a)}}}}}}}function dt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,H(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++){const r=e[l];if(r.type==="childList")try{Ht(r)}catch(c){console.error("[ln-core] lifecycle handler failed",r.target,c)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Nt(t){B().push(t),dt()}function ut(t,e,l,r,c={}){const b=c.extraAttributes||[],a=c.onAttributeChange||null,h=c.onSubtreeChange||null,o=c.onInit||null,p=c.onAttrChange||null,v=c.effects||null,A=c.attributes||null,E=A?Tt(A):v,q=A?new Set(Object.keys(A)):null,I=c.persist||null;function F(s){const f=s||document.body;if(st(f,t,e,l),A&&U())for(const d in A){const _=A[d],w=Array.from(f.querySelectorAll("["+d+"]"));f.matches&&f.matches("["+d+"]")&&w.push(f);for(let g=0;g<w.length;g++){const m=w[g];N(m)&&lt(_,m.getAttribute(d),d,r,m)}}o&&o(f)}const S=[];if(t.indexOf("[")!==-1){const s=/\[([\w-]+)/g;let f;for(;(f=s.exec(t))!==null;)S.push(f[1])}else S.push(t);Ft({selector:t,attribute:e,componentTag:r,attributes:A,ComponentFn:l,onInit:o,observed:S.concat(b),onAttributeChange:a,onAttrChange:p,effects:E,declared:q,persist:I}),Ot();const n=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,u=c.subtreeQuery||(n?t:"["+t+"]");B().push({selector:t,attribute:e,ComponentFn:l,onInit:o,onSubtreeChange:h,query:u}),dt(),window[e]=F,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ut,window.lnCore.observeLifecycle=Nt);function i(){qt()>0?It(function(){F(document.body)}):F(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i(),F}function Mt(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function Wt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,l=t.pageSize>0?t.pageSize:200,r=t.threshold!=null?t.threshold:25,c=t.fetchDebounce!=null?t.fetchDebounce:120;const b=typeof t.requestPage=="function"?t.requestPage:function(){},a=typeof t.onChange=="function"?t.onChange:function(){},h=new Map,o=new Map,p=new Set;let v=0,A=0,E=0,q={sort:null,filters:{},search:""},I=null,F=0,S=0,n=!1;function u(d){o.set(d,++F)}function i(){return!!(q&&(q.search||q.filters&&Object.keys(q.filters).length))}function s(){if(h.size<=e)return;const d=Array.from(h.keys()).sort(function(w,g){return(o.get(w)||0)-(o.get(g)||0)});let _=0;for(;h.size>e&&_<d.length;)h.delete(d[_]),o.delete(d[_]),_++}function f(d,_){p.add(d),b(q,d,_)}return{get:function(d){return h.get(d)},has:function(d){return h.has(d)},peek:function(){return h.size?h.values().next().value:void 0},get logicalTotal(){return v},get grandTotal(){return A},get queryGen(){return E},get size(){return h.size},ensure:function(d,_){clearTimeout(I),S=d;for(let k=d;k<_;k++)h.has(k)&&u(k);if(v<=0)return;const w=Math.max(0,d-r),g=Math.min(v,_+r),m=Math.floor(w/l),T=Math.floor(Math.max(0,g-1)/l);let L=-1;for(let k=m;k<=T;k++){const y=k*l,C=Math.min(l,v-y);let x=!1;const Yt=Math.max(y,w),Jt=Math.min(y+C,g);for(let j=Yt;j<Jt;j++)if(!h.has(j)){x=!0;break}if(x&&!p.has(y)){L=y;break}}L!==-1&&(I=setTimeout(function(){f(L,l)},c))},ingest:function(d){if(d=d||{},d.queryGen!=null&&d.queryGen!==E)return!1;const _=d.offset||0,w=d.data||[];let g=0;for(let m=0;m<w.length;m++)w[m]!=null&&g++;if(g===0&&(d.provisional||d.filtered>0))return p.delete(_),!1;n&&(h.clear(),o.clear(),n=!1),d.provisional||(A=d.total!=null?d.total:A,v=d.filtered!=null?d.filtered:d.data?d.data.length:v);for(let m=0;m<w.length;m++)w[m]!=null&&(h.set(_+m,w[m]),u(_+m));return p.delete(_),s(),a(),!0},requestInitial:function(d){d&&(q=d),f(0,l)},invalidate:function(d){E++,p.clear(),clearTimeout(I),d&&(q=d),n=!0,f(0,l)},revalidate:function(){E++,p.clear(),clearTimeout(I),n=!0;const d=Math.max(0,Math.floor(S/l)*l);f(d,l)},release:function(d){p.delete(d)},destroy:function(){clearTimeout(I),h.clear(),o.clear(),p.clear()},configure:function(d){d=d||{};let _=!1;if(d.windowSize!=null&&d.windowSize>0&&d.windowSize!==e){const w=d.windowSize<e;e=d.windowSize,w&&s(),_=!0}d.pageSize!=null&&d.pageSize>0&&(l=d.pageSize),d.threshold!=null&&d.threshold>=0&&(r=d.threshold),d.fetchDebounce!=null&&d.fetchDebounce>=0&&(c=d.fetchDebounce),_&&a()},setGrandTotal:function(d){d==null||isNaN(d)||d<0||(A=d,i()||(v=d),a())}}}function ht(t){return(t||"").replace(/^#/,"")}function $(t){const e=t===void 0?location.hash:t,l={},r=ht(e);if(!r)return l;const c=r.split("&");for(let b=0;b<c.length;b++){const a=c[b];if(!a)continue;const h=a.indexOf(":"),o=h>-1?a.slice(0,h):a,p=h>-1?a.slice(h+1):"";if(o)try{l[o]=decodeURIComponent(p)}catch{l[o]=p}}return l}function Pt(t){if(!t)return null;const e=$();return t in e?e[t]:null}function Vt(t,e){if(!t)return;const l=$();e==null?delete l[t]:l[t]=String(e);const c=Object.keys(l).map(function(b){const a=l[b];return a===""?b:b+":"+encodeURIComponent(a)}).join("&");ht(location.hash)!==c&&(location.hash=c)}function Bt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function zt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const l=t.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.trim();const r=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return r?e?r+"-"+e:r:e||null}function $t(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function jt(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function Ut(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function Gt(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const l=t.slice(0,e),r=t.slice(e+1),c=r?r.split(",").map(function(b){try{return decodeURIComponent(b)}catch{return b}}).filter(Boolean):[];return{key:l,values:c}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Pt,window.lnCore.hashSet=Vt,window.lnCore.hashLinkClick=Bt,window.lnCore.resolveHashNamespace=zt,window.lnCore.hashSortEncode=$t,window.lnCore.hashSortDecode=jt,window.lnCore.hashFilterEncode=Ut,window.lnCore.hashFilterDecode=Gt);function Kt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Kt);function ft(t,e,l,r,c=15){if(r<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const b=Math.max(0,t||0),a=Math.max(0,e||0),h=Math.floor(b/l),o=Math.ceil(a/l),p=Math.max(0,h-c),v=Math.min(r,h+o+c),A=p*l,E=Math.max(0,(r-v)*l);return{start:p,end:v,topPadding:A,bottomPadding:E}}function Qt(t,e){const l=Array.isArray(t)?t.length:0,r=e instanceof Set?e:new Set(e||[]);let c=0;if(Array.isArray(t))for(let h=0;h<t.length;h++)r.has(t[h])&&c++;else c=r.size;const b=l>0&&c===l,a=c>0&&c<l;return{totalCount:l,selectedCount:c,isAllSelected:b,isIndeterminate:a}}function bt(t,e,l){const r=new Set(t);return e==null||((l!==void 0?l:!r.has(e))?r.add(e):r.delete(e)),r}function pt(t,e,l){const r=new Set(t);if(!Array.isArray(e))return r;if(l)for(let c=0;c<e.length;c++)e[c]!=null&&r.add(e[c]);else for(let c=0;c<e.length;c++)r.delete(e[c]);return r}(function(){const t="data-ln-table",e="lnTable",l="data-ln-table-empty";if(window[e]!==void 0)return;function o(n,u){if(!n||!n.isDataDriven)return;const i=n.dom.hasAttribute("data-ln-table-window");if(i&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!i&&n._windowed)n._exitWindowedMode();else if(i&&n._windowed){const s=parseInt(u,10);s>0&&n._cache.configure({windowSize:s})}}function p(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>0&&n._cache.configure({pageSize:i})}function v(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.configure({threshold:i})}function A(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.setGrandTotal(i)}const E={"data-ln-table":{prop:"name",type:"string",read:R,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:R,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:P,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:o,description:"Virtual scrolling window size in rows"},"data-ln-table-window-page":{type:"integer",fallback:200,min:5,effect:p,description:"Virtual scrolling slice page size"},"data-ln-table-window-threshold":{type:"integer",fallback:50,min:0,effect:v,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-table-count":{type:"integer",min:0,effect:A,description:"Total record count override for virtual scrollbar calculation"},"data-ln-table-row":{type:"marker",description:"Table row template element"},"data-ln-table-row-id":{type:"string",description:"Record identifier on row element"},"data-ln-table-row-action":{type:"trigger",description:"Action trigger inside a table row"},"data-ln-table-row-select":{type:"trigger",description:"Row selection checkbox trigger"},"data-ln-table-col":{type:"string",description:"Column header identifier or field mapping"},"data-ln-table-col-select":{type:"trigger",description:"Header select-all checkbox trigger"},"data-ln-table-cell-attr":{type:"string",description:"Cell attribute template mapping"},"data-ln-table-empty":{type:"marker",description:"Container for table empty state"},"data-ln-table-select-all-label":{type:"string",description:"Accessibility label for select-all header trigger"}},q=ot(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function I(n,u){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(vt(u)).format(n)}catch{return String(n)}}function F(n){let u=n.parentElement;for(;u&&u!==document.body&&u!==document.documentElement;){const s=getComputedStyle(u).overflowY;if(s==="auto"||s==="scroll")return u;u=u.parentElement}return null}function S(n){this.dom=n,rt(this,n,q),this.table=n.querySelector("table"),this.tbody=n.querySelector("[data-ln-table-body]")||n.querySelector("tbody"),this.thead=n.querySelector("thead");const u=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=u?Array.from(u.querySelectorAll("th")):[],this._totalSpan=n.querySelector("[data-ln-table-total]"),this._filteredSpan=n.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this.isDataDriven=n.hasAttribute("data-ln-table-source"),this._data=[],this._filteredData=[],this._searchTerm="",this._sortCol=-1,this._sortDir=null,this._columnFilters={},this.selectedIds=new Set,this._virtual=!1,this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._scrollContainer=null,this._colgroup=null;const i=this;return this._onSetSearch=function(s){const f=(s.detail&&s.detail.query!=null?s.detail.query:s.detail&&s.detail.term!=null?s.detail.term:"").trim();i.isDataDriven?(i.currentSearch=f,D(n,"ln-table:search",{table:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=f.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(s){s.preventDefault(),i._onSetSearch(s)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",D(n,"ln-table:clear-filters",{table:i.name}),i._requestData()):(i._searchTerm="",i._columnFilters={},i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._windowed=!1,this._cache=null,this.isDataDriven&&n.hasAttribute("data-ln-table-window")&&this._enterWindowedMode(),this._onSetData=function(s){const f=s.detail||{},d=f.data||[],_=f.total!=null?f.total:d.length;if(!(i._hasInitialSeed&&!i.isLoaded&&d.length===0&&_===0)){if(i._windowed){i._cache.ingest(f)&&!f.provisional&&n.classList.remove("ln-table--loading");return}i._data=d,i._lastTotal=_,i._lastFiltered=f.filtered!=null?f.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-table--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),D(n,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(s){const f=s.detail&&s.detail.loading;n.classList.toggle("ln-table--loading",!!f),f&&(i.isLoaded=!1)},n.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(s){!i._windowed||!i._cache||i._cache.release(s.detail&&s.detail.offset)},n.addEventListener("ln-table:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this._onSort=function(s){!s.detail||s.detail.field==null||(s.preventDefault(),i.currentSort=s.detail.direction==="none"?null:{field:s.detail.field,direction:s.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._windowed&&this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden"),this._onRowClick=function(s){if(s.target.closest("[data-ln-table-row-select]")||s.target.closest("[data-ln-table-row-action]")||s.target.closest("a")||s.target.closest("button")||s.ctrlKey||s.metaKey||s.button===1)return;const f=s.target.closest("[data-ln-table-row]");if(!f)return;const d=f.getAttribute("data-ln-table-row-id"),_=f._lnRecord||{};D(n,"ln-table:row-click",{table:i.name,id:d,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(s){const f=s.target.closest("[data-ln-table-row-action]");if(!f)return;const d=f.closest("[data-ln-table-row]");if(!d)return;const _=f.getAttribute("data-ln-table-row-action"),w=d.getAttribute("data-ln-table-row-id"),g=d._lnRecord||{};D(n,"ln-table:row-action",{table:i.name,id:w,action:_,record:g})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),this._windowed?this._kickWindowInitial():D(n,"ln-table:request-data",{table:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){i.tbody.rows.length>0&&(i._emptyTbodyObserver.disconnect(),i._emptyTbodyObserver=null,i._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(s){if(!s.detail||s.detail.column==null)return;s.preventDefault();const f=s.detail.direction==="none"?null:s.detail.direction;i._sortCol=f===null?-1:s.detail.column,i._sortDir=f,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),D(n,"ln-table:sorted",{column:s.detail.column,direction:s.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(s){if(s.preventDefault(),!s.detail)return;const f=s.detail.key,d=s.detail.values||[];if(f){if(d.length===0)delete i._columnFilters[f];else{const _=[];for(let w=0;w<d.length;w++)_.push(d[w].toLowerCase());i._columnFilters[f]=_}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange)),this}S.prototype._parseRows=function(){const n=this.tbody.rows,u=this.ths;this._data=[],n.length>0&&(this._rowHeight=n[0].offsetHeight||40),this._lockColumnWidths();for(let i=0;i<n.length;i++){const s=n[i],f=[],d=[],_=[];for(let g=0;g<s.cells.length;g++){const m=s.cells[g],T=m.textContent.trim();f[g]=G(m),d[g]=T.toLowerCase(),m.querySelector("[data-ln-table-row-action]")||_.push(T.toLowerCase())}let w=null;if(this.isDataDriven){w={};const g=s.getAttribute("data-ln-table-row-id");g!=null&&(w.id=g);for(let m=0;m<u.length;m++){const T=u[m].getAttribute("data-ln-table-col");if(T){const L=m;if(L<s.cells.length){const k=s.cells[L];w[T]=G(k)}}}}this._data.push({values:f,rawTexts:d,html:s.outerHTML,searchText:_.join(" "),id:this.isDataDriven&&w?w.id:void 0,...w})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),D(this.dom,"ln-table:ready",{total:this._data.length})},S.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},S.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const n=document.createElement("colgroup");this.ths.forEach(function(u){const i=document.createElement("col");i.style.width=u.offsetWidth+"px",n.appendChild(i)}),this.table.insertBefore(n,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=n},S.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,u=this.visibleCount;if(n===0){this._disableVirtualScroll(),this._showEmptyState();return}if(this._filteredData.length===0||u===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const n=this._filteredData.length;n===0&&(this._searchTerm||Object.keys(this._columnFilters).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):n>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},S.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,u=document.createDocumentFragment();for(let i=0;i<n.length;i++){const s=this._buildRow(n[i]);if(!s)break;u.appendChild(s)}this.tbody.replaceChildren(u),this._selectable&&this._updateSelectAll()}else{const n=[],u=this._filteredData;for(let i=0;i<u.length;i++)n.push(u[i].html);this.tbody.innerHTML=n.join(""),this._selectable&&this._restoreSelection()}},S.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let i=null;if(this._windowed){const s=this._cache?this._cache.peek():null;i=s?this._buildRow(s):this._buildPlaceholderRow()}else this.isDataDriven&&this._data.length>0&&(i=this._buildRow(this._data[0]));i&&this.tbody&&(this.tbody.appendChild(i),this._rowHeight=i.offsetHeight||40,i.remove())}this.isDataDriven?this._scrollContainer=F(this.dom):this._scrollContainer=null;const u=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},u.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},S.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),window.removeEventListener("resize",this._scrollHandler),this._scrollHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},S.prototype._renderVirtual=function(){const n=this._filteredData,u=n.length,i=this._rowHeight;if(!i||!u)return;const s=this.thead?this.thead.offsetHeight:0,f=this._scrollContainer;let d,_;if(f){const y=this.table.getBoundingClientRect(),C=f.getBoundingClientRect(),x=y.top-C.top+f.scrollTop+s;d=f.scrollTop-x,_=f.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+s;d=window.scrollY-x,_=window.innerHeight}const w=ft(d,_,i,u,15),g=w.start,m=w.end;if(g===this._vStart&&m===this._vEnd)return;this._vStart=g,this._vEnd=m;const T=this.ths.length||1,L=w.topPadding,k=w.bottomPadding;if(this.isDataDriven){const y=document.createDocumentFragment();if(L>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=L+"px",C.appendChild(x),y.appendChild(C)}for(let C=g;C<m;C++){const x=this._buildRow(n[C]);x&&y.appendChild(x)}if(k>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=k+"px",C.appendChild(x),y.appendChild(C)}this.tbody.replaceChildren(y),this._selectable&&this._updateSelectAll()}else{let y="";L>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+L+'px;padding:0;border:none"></td></tr>');for(let C=g;C<m;C++)y+=n[C].html;k>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+k+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=y,this._selectable&&this._restoreSelection()}},S.prototype._buildPlaceholderRow=function(){const n=document.createElement("tr");n.className="ln-table__placeholder",n.setAttribute("aria-hidden","true");const u=document.createElement("td");return u.setAttribute("colspan",this.ths.length||1),u.style.height=this._rowHeight+"px",n.appendChild(u),n},S.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._rowHeight;if(!n)return;const u=this._cache.logicalTotal,i=this.thead?this.thead.offsetHeight:0,s=this._scrollContainer;let f,d;if(s){const y=this.table.getBoundingClientRect(),C=s.getBoundingClientRect(),x=y.top-C.top+s.scrollTop+i;f=s.scrollTop-x,d=s.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+i;f=window.scrollY-x,d=window.innerHeight}const _=ft(f,d,n,u,15),w=_.start,g=_.end,m=this.ths.length||1,T=_.topPadding,L=_.bottomPadding,k=document.createDocumentFragment();if(T>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=T+"px",y.appendChild(C),k.appendChild(y)}for(let y=w;y<g;y++)if(this._cache.has(y)){const C=this._buildRow(this._cache.get(y));C&&k.appendChild(C)}else k.appendChild(this._buildPlaceholderRow());if(L>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=L+"px",y.appendChild(C),k.appendChild(y)}this.tbody.replaceChildren(k),this._vStart=w,this._vEnd=g,this._cache.ensure(w,g)},S.prototype._showEmptyState=function(){const n=this.ths.length||1;let u=null,i=null;if(this.isDataDriven){const s=this._lastTotal!=null?this._lastTotal:this._data.length,d=this.visibleCount===0&&s>0,_=d?this.name+"-empty-filtered":this.name+"-empty";if(i=J(this.dom,_,"ln-table"),!i){const w=this.dom.querySelector("template[data-ln-table-empty]");if(w){const g=d?"search":"initial",m=w.content.querySelector('[data-ln-table-empty-when="'+g+'"]')||w.content.firstElementChild;m&&(i=document.importNode(m,!0))}}if(i)if(i.tagName==="TR")u=i;else{const w=document.createElement("td");w.setAttribute("colspan",String(n)),w.appendChild(i);const g=document.createElement("tr");g.className="ln-table__empty",g.appendChild(w),u=g}}else{const s=this.dom.querySelector("template["+l+"]"),f=document.createElement("td");f.setAttribute("colspan",String(n)),s&&f.appendChild(document.importNode(s.content,!0));const d=document.createElement("tr");d.className="ln-table__empty",d.appendChild(f),u=d}u?this.tbody.replaceChildren(u):this.tbody.replaceChildren(),D(this.dom,"ln-table:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},S.prototype._fillRow=function(n,u){W(n,u);const i=n.querySelectorAll("[data-ln-table-cell-attr]");for(let s=0;s<i.length;s++){const f=i[s],d=f.getAttribute("data-ln-table-cell-attr").split(",");for(let _=0;_<d.length;_++){const w=d[_].trim().split(":");if(w.length!==2)continue;const g=w[0].trim(),m=w[1].trim();u[g]!=null&&f.setAttribute(m,u[g])}}},S.prototype._buildRow=function(n){let u=J(this.dom,this.name+"-row","ln-table");if(!u){const s=this.dom.querySelector("template[data-ln-table-row]");s&&(u=document.importNode(s.content,!0))}let i=u?u.querySelector("[data-ln-table-row]")||u.firstElementChild:null;if(i)this._fillRow(i,n);else if(n&&n.html){const s=document.createElement("tbody");s.innerHTML=n.html,i=s.firstElementChild}else{i=document.createElement("tr"),i.setAttribute("data-ln-table-row","");const s=this.ths;for(let f=0;f<s.length;f++){const d=s[f].hasAttribute("data-ln-table-col-select"),_=document.createElement("td");if(d){const w=document.createElement("input");w.type="checkbox",w.setAttribute("data-ln-table-row-select",""),w.setAttribute("aria-label","Select row"),_.appendChild(w)}else{const w=s[f].getAttribute("data-ln-table-col");w&&n[w]!=null&&(_.textContent=String(n[w]))}i.appendChild(_)}}if(i._lnRecord=n,n.id!=null&&i.setAttribute("data-ln-table-row-id",n.id),this._selectable&&n.id!=null&&this.selectedIds.has(String(n.id))){i.classList.add("ln-row-selected");const s=i.querySelector("[data-ln-table-row-select]");s&&(s.checked=!0)}return i},S.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-table--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}wt(this,"ln-table:request-data","table")},S.prototype._enterWindowedMode=function(){const n=this,u=this.dom,i=parseInt(u.getAttribute("data-ln-table-window"),10),s=parseInt(u.getAttribute("data-ln-table-window-page"),10),f=parseInt(u.getAttribute("data-ln-table-window-threshold"),10);this._onCacheChange=function(){!n._windowed||!n._cache||(n.totalCount=n._cache.grandTotal,n.visibleCount=n._cache.logicalTotal,n._lastTotal=n._cache.grandTotal,n.isLoaded=!0,n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(u,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=Mt(this._onCacheChange),this._cache=Wt({windowSize:i>0?i:1e3,pageSize:s>0?s:200,threshold:f>=0?f:25,fetchDebounce:120,requestPage:function(d,_,w){D(u,"ln-table:request-data",{table:n.name,sort:d.sort,filters:d.filters,search:d.search,offset:_,limit:w,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},S.prototype._kickWindowInitial=function(){if(this._data.length>0){let n=parseInt(this.dom.getAttribute("data-ln-table-count"),10);if(isNaN(n)&&this._totalSpan){const i=this._totalSpan.textContent.replace(/[^\d]/g,"");i&&(n=parseInt(i,10))}const u=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:u,filtered:u})}else this.dom.classList.add("ln-table--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},S.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-table--loading"),this._requestData()},S.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]"),u=[];for(let s=0;s<n.length;s++){const f=n[s].getAttribute("data-ln-table-row-id");f!=null&&u.push(f)}const i=Qt(u,this.selectedIds);this._selectAllCheckbox.checked=i.isAllSelected,this._selectAllCheckbox.indeterminate=i.isIndeterminate},S.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]");for(let u=0;u<n.length;u++){const i=n[u].getAttribute("data-ln-table-row-id"),s=i!=null&&this.selectedIds.has(i);n[u].classList.toggle("ln-row-selected",s);const f=n[u].querySelector("[data-ln-table-row-select]");f&&(f.checked=s)}this._updateSelectAll()},Object.defineProperty(S.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),S.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;if(this._onSelectionChange=function(u){const i=u.target.closest("[data-ln-table-row-select]");if(!i)return;const s=i.closest("[data-ln-table-row]");if(!s)return;const f=s.getAttribute("data-ln-table-row-id");f!=null&&(n.selectedIds=bt(n.selectedIds,f,i.checked),s.classList.toggle("ln-row-selected",i.checked),n.selectedCount=n.selectedIds.size,n._updateSelectAll(),n._updateFooter(),D(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}))},this.tbody&&this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector('[data-ln-table-col-select] input[type="checkbox"]')||this.dom.querySelector("[data-ln-table-col-select]"),this._selectAllCheckbox&&this._selectAllCheckbox.tagName==="TH"){const u=document.createElement("input");u.type="checkbox";const i=n.dom.querySelector('[data-ln-table-dict="select-all"]'),s=n.dom.getAttribute("data-ln-table-select-all-label")||(i?i.textContent.trim():null)||"Select all";u.setAttribute("aria-label",s),this._selectAllCheckbox.appendChild(u),this._selectAllCheckbox=u}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const u=n._selectAllCheckbox.checked,i=n.tbody?n.tbody.querySelectorAll("[data-ln-table-row]"):[],s=[];for(let f=0;f<i.length;f++){const d=i[f].getAttribute("data-ln-table-row-id"),_=i[f].querySelector("[data-ln-table-row-select]");d!=null&&(s.push(d),i[f].classList.toggle("ln-row-selected",u),_&&(_.checked=u))}n.selectedIds=pt(n.selectedIds,s,u),n.selectedCount=n.selectedIds.size,D(n.dom,"ln-table:select-all",{table:n.name,selected:u}),D(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){const s=u[i].querySelector("[data-ln-table-row-select]"),f=u[i].getAttribute("data-ln-table-row-id");s&&s.checked&&f!=null&&(n.selectedIds=bt(n.selectedIds,f,!0),u[i].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},S.prototype._disableSelection=function(){if(!this._selectableActive)return;this._selectableActive=!1,this.tbody&&this._onSelectionChange&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll);const n=this.dom.querySelector("[data-ln-table-col-select]");if(n){const u=n.querySelector('input[type="checkbox"]');u&&u.remove()}if(this._selectAllCheckbox=null,this.selectedIds=pt(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){u[i].classList.remove("ln-row-selected");const s=u[i].querySelector("[data-ln-table-row-select]");s&&(s.checked=!1)}}this._updateFooter()},S.prototype._updateFooter=function(){let n=0,u=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,u=this.visibleCount):(n=this._data.length,u=this._filteredData.length);const i=u<n;if(this._totalSpan&&(this._totalSpan.textContent=I(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=i?I(u,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!i),this._selectedSpan){const s=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=s>0?I(s,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",s===0)}},S.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-table:set-search",this._onSetSearch),this.dom.removeEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this.dom.removeEventListener("ln-table:set-data",this._onSetData),this.dom.removeEventListener("ln-table:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-table:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onRowClick),this.tbody.removeEventListener("click",this._onRowAction)),this._cache&&this._cache.destroy()):(this._emptyTbodyObserver&&(this._emptyTbodyObserver.disconnect(),this._emptyTbodyObserver=null),this.dom.removeEventListener("ln-sort:change",this._onSort),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-filter:change",this._onFilterChange)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._colgroup&&(this._colgroup.remove(),this._colgroup=null),this.table&&(this.table.style.tableLayout=""),this._data=[],this._filteredData=[],delete this.dom[e])},ut(t,e,S,"ln-table",{attributes:E})})()})();
1
+ (function(){"use strict";function U(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function N(t){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return t?window.lnCore._debugIsContained(t):window.lnCore._debugSink!==null;if(t&&t.closest){const e=t.closest("[data-ln-debug]");return!(!e||typeof document<"u"&&e===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const t=console.warn;console.warn=function(...e){if(typeof e[0]=="string"&&(e[0].startsWith("[ln-")||e[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<e.length;o++)if(e[o]&&e[o].nodeType===1){r=e[o];break}if(!N(r))return}t.apply(console,e)}}function D(t,e,l){const r=l||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",e,t,r),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function wt(t,e,l){t._applyFilterAndSort(),t._vStart=-1,t._vEnd=-1,t._render(),t._updateFooter();const r={sort:t.currentSort,filters:t.currentFilters,search:t.currentSearch};r[l]=t.name,D(t.dom,e,r)}function H(t,e){if(!document.body){document.addEventListener("DOMContentLoaded",function(){H(t,e)}),console.warn("["+e+'] Script loaded before <body> — add "defer" to your <script> tag');return}t()}function G(t){return t.hasAttribute("data-ln-value")?t.getAttribute("data-ln-value"):t.tagName==="TIME"&&t.hasAttribute("datetime")?t.getAttribute("datetime"):t.tagName==="DATA"&&t.hasAttribute("value")?t.getAttribute("value"):t.textContent.trim()}function _t(t){const e=t.querySelector('input[name="_method"]');return((e&&e.value!==""?e.value:t.method)||"").toUpperCase()}function gt(t,e){const l=!!(e&&e.typed),r=e&&e.exclude,o={},b=t.elements,c={};if(l)for(let h=0;h<b.length;h++){const s=b[h];s.name&&s.type==="checkbox"&&!s.disabled&&(c[s.name]=(c[s.name]||0)+1)}for(let h=0;h<b.length;h++){const s=b[h];if(!(!s.name||s.disabled||s.type==="file"||s.type==="submit"||s.type==="button")&&!(r&&s.matches&&s.matches(r)))if(s.type==="checkbox")l&&c[s.name]===1?o[s.name]=s.checked:(o[s.name]||(o[s.name]=[]),s.checked&&o[s.name].push(s.value));else if(s.type==="radio")s.checked&&(o[s.name]=s.value);else if(s.type==="select-multiple"){o[s.name]=[];for(let p=0;p<s.options.length;p++)s.options[p].selected&&o[s.name].push(s.options[p].value)}else if(l&&s.type==="hidden")o[s.name]=s.value;else if(l&&(s.type==="number"||s.type==="range")){const p=Number(s.value);o[s.name]=s.value===""||isNaN(p)?null:p}else o[s.name]=s.value}return o}function mt(t){if(typeof t!="string")return!!t;const e=t.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!==""&&e!=="off"&&e!=="no"}function yt(t,e){const l=t.elements,r=[],o={};for(let b=0;b<l.length;b++){const c=l[b];c.name&&c.type==="checkbox"&&(o[c.name]=(o[c.name]||0)+1)}for(let b=0;b<l.length;b++){const c=l[b];if(c.type==="file"||c.type==="submit"||c.type==="button")continue;const h=c.getAttribute("data-ln-fill-as")||c.name;if(!h||!(h in e))continue;const s=e[h];if(c.type==="checkbox"){if(Array.isArray(s))c.checked=s.indexOf(c.value)!==-1;else if(o[c.name]>1){const p=String(s).split(",").map(function(S){return S.trim()});c.checked=p.indexOf(c.value)!==-1}else c.checked=mt(s);r.push(c)}else if(c.type==="radio")c.checked=c.value===String(s),r.push(c);else if(c.type==="select-multiple"){if(Array.isArray(s))for(let p=0;p<c.options.length;p++)c.options[p].selected=s.indexOf(c.options[p].value)!==-1;r.push(c)}else c.value=s,c.tagName==="SELECT"&&s!=null&&c.setAttribute("data-ln-value",s),r.push(c)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=yt,window.lnCore.serializeForm=gt,window.lnCore.resolveFormMethod=_t);const K={};function Ct(t,e){K[t]=e}function St(t){return K[t]||{ingress:e=>e,egress:e=>e}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ct,window.lnCore.getDataMapper=St);function vt(t){const e=t?t.closest("[lang]"):null,l=(e?e.getAttribute("lang")||e.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return l?l.trim():"en-US"}function At(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,H(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Q={};function Et(t,e){if(!t||typeof e!="object")return;const l=t.toLowerCase().split("-")[0];Q[l]=e}function kt(t){if(!t)return null;const e=t.toLowerCase().split("-")[0];return Q[e]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Et,window.lnCore.getLocaleFallback=kt,window.lnCore.ensureLocaleObserver=At);const M={};function Y(t,e){M[t]||(M[t]=document.querySelector('[data-ln-template="'+t+'"]'));const l=M[t];return l?l.content.cloneNode(!0):(console.warn("["+(e||"ln-core")+'] Template "'+t+'" not found'),null)}function J(t,e,l){if(t){const r=t.querySelector('[data-ln-template="'+e+'"]');if(r)return r.content.cloneNode(!0)}return Y(e,l)}function X(t,e){if(!t||!e)return t;const l=t.querySelectorAll("[data-ln-field]");for(let c=0;c<l.length;c++){const h=l[c],s=h.getAttribute("data-ln-field");e[s]!=null&&(h.textContent=e[s])}const r=t.querySelectorAll("[data-ln-attr]");for(let c=0;c<r.length;c++){const h=r[c],s=h.getAttribute("data-ln-attr").split(",");for(let p=0;p<s.length;p++){const S=s[p].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();e[E]!=null&&h.setAttribute(A,e[E])}}const o=t.querySelectorAll("[data-ln-show]");for(let c=0;c<o.length;c++){const h=o[c],s=h.getAttribute("data-ln-show");s in e&&h.classList.toggle("hidden",!e[s])}const b=t.querySelectorAll("[data-ln-class]");for(let c=0;c<b.length;c++){const h=b[c],s=h.getAttribute("data-ln-class").split(",");for(let p=0;p<s.length;p++){const S=s[p].trim().split(":");if(S.length!==2)continue;const A=S[0].trim(),E=S[1].trim();E in e&&h.classList.toggle(A,!!e[E])}}return t}function xt(t,e){t.matches&&t.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",t,e??null),t.dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0})));const l=t.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<l.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",l[r],e??null),l[r].dispatchEvent(new CustomEvent("ln-fill",{detail:e??null,bubbles:!0}));return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(t){if(!(!t.target.matches||!t.target.matches("[data-ln-fillable]")))if(t.detail)X(t.target,t.detail);else{const e=t.target.querySelectorAll("[data-ln-field]");for(let l=0;l<e.length;l++)e[l].textContent=""}})));function W(t,e){if(!t||!e)return t;const l=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(;l.nextNode();){const b=l.currentNode;b.textContent.indexOf("{{")!==-1&&(b.textContent=b.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(c,h){return e[h]!==void 0?e[h]:""}))}const r=function(b,c){return e[c]!==void 0?e[c]:""},o=Array.from(t.querySelectorAll("*"));t.nodeType===1&&o.push(t);for(let b=0;b<o.length;b++){const c=o[b],h=c.attributes;for(let s=0;s<h.length;s++){const p=h[s];p.value.indexOf("{{")!==-1&&c.setAttribute(p.name,p.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return t}function Dt(t,e,l,r,o,b){const c={};for(let s=0;s<t.children.length;s++){const p=t.children[s],S=p.getAttribute("data-ln-render-key");S&&(c[S]=p)}const h=document.createDocumentFragment();for(let s=0;s<e.length;s++){const p=e[s],S=String(r(p));let A=c[S];if(A)o(A,p,s);else{const E=Y(l,b);if(!E||(W(E,p),A=E.firstElementChild,!A))continue;A.setAttribute("data-ln-render-key",S),o(A,p,s)}h.appendChild(A)}t.textContent="",t.appendChild(h)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=X,window.lnCore.lnFill=xt,window.lnCore.renderList=Dt);function R(t,e,l){const r=t.getAttribute(e);return r===null?l:r}function Z(t,e,l){const r=parseInt(t.getAttribute(e),10);return isNaN(r)?l:r}function P(t,e,l=!1){const r=t.getAttribute(e);if(r===null)return!!l;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function tt(t,e){return(t.getAttribute(e)||"").split(",").map(l=>l.trim()).filter(Boolean)}const V=new Map;function et(t,e){const l=(t?t.join("|"):"")+"::"+e;if(V.has(l))return V.get(l);const r=new Set(t||[]),o=function(b,c){const h=b.getAttribute(c);return h!==null&&r.has(h)?h:e};return V.set(l,o),o}function nt(t,e,l){const r=parseFloat(t.getAttribute(e));return isNaN(r)?l:r}function it(t,e,l){const r=t.getAttribute(e);if(!r)return l;try{return JSON.parse(r)}catch{return l}}function lt(t,e,l,r,o){if(!t||e===null)return!0;const b=r||"ln-component",c=t.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||e===""&&t.fallback!==void 0)return!0;const h=s=>{o?console.warn(s,o):console.warn(s)};if(c==="boolean"){const s=e.trim().toLowerCase();return s!==""&&s!=="true"&&s!=="false"&&s!=="1"&&s!=="0"?(h(`[${b}] Invalid value "${e}" for boolean attribute "${l}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const s=t.values||[];return s.includes(e)?!0:(h(`[${b}] Invalid value "${e}" for attribute "${l}". Allowed: ${s.join(", ")}. Fallback: "${t.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(e))return h(`[${b}] Invalid integer "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1;const s=parseInt(e,10);return t.min!==void 0&&s<t.min?(h(`[${b}] Value ${s} for attribute "${l}" is less than min (${t.min}).`),!1):t.max!==void 0&&s>t.max?(h(`[${b}] Value ${s} for attribute "${l}" is greater than max (${t.max}).`),!1):!0}if(c==="float")return isNaN(Number(e))?(h(`[${b}] Invalid float "${e}" for attribute "${l}". Fallback: ${t.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(e),!0}catch(s){return h(`[${b}] Invalid JSON for attribute "${l}": ${s.message}. Fallback: ${t.fallback}.`),!1}return!0}function rt(t,e,l){for(const r in l){const[o,b,c]=l[r];Object.defineProperty(t,r,{get:function(){return o(e,b,c)},enumerable:!0,configurable:!0})}return t}function ot(t){const e={};for(const l in t){const r=t[l];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=et(r.values,r.fallback);break;case"integer":o=Z;break;case"float":o=nt;break;case"boolean":o=P;break;case"list":o=tt;break;case"json":o=it;break;case"string":default:o=R;break}o||(o=R),e[r.prop]=[o,l,r.fallback]}return e}function Tt(t){const e={};for(const l in t){const r=t[l];r&&r.effect&&(e[l]=r.effect)}return Object.keys(e).length?e:null}function Lt(t){if(t.onAttrChange&&!t.declared)return null;const e=new Set;if(t.effects)for(const l in t.effects)e.add(l);if(t.onAttrChange&&t.declared)for(const l of t.declared)e.add(l);return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=rt,window.lnCore.attrSpec=ot,window.lnCore.attrStr=R,window.lnCore.attrInt=Z,window.lnCore.attrBool=P,window.lnCore.attrList=tt,window.lnCore.attrEnum=et,window.lnCore.attrFloat=nt,window.lnCore.attrJson=it);function O(t,e){if(!t[e.attribute]){window.lnCore._persistSink&&t.hasAttribute&&t.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(t,e.selector);try{t[e.attribute]=new e.ComponentFn(t)}catch(l){console.error("["+e.attribute+"] init failed",t,l)}}}function st(t,e,l,r){if(t.nodeType!==1)return;const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1?e:"["+e+"]",c={selector:e,attribute:l,ComponentFn:r};if(t.matches&&t.matches(b)&&O(t,c),t.querySelectorAll){const h=t.querySelectorAll(b);for(let s=0;s<h.length;s++)O(h[s],c)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function qt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function It(t){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(t):setTimeout(t,0)):t()}function at(){window.lnCore=window.lnCore||{};const t=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return t.byReactive=t.byReactive||new Map,t.reactiveWildcard=t.reactiveWildcard||[],t}function Ft(t){const e=at(),l=t.observed||[];for(let r=0;r<l.length;r++){const o=l[r];e.byAttr.has(o)||e.byAttr.set(o,[]),e.byAttr.get(o).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 o=e.byDeclaredAttr.get(r);o.some(b=>b.componentTag===t.componentTag)||o.push({spec:t.attributes[r],componentTag:t.componentTag})}if(t.onAttrChange||t.effects){e.reactive.push(t);const r=Lt(t);if(r===null)e.reactiveWildcard.push(t);else for(const o of r)e.byReactive.has(o)||e.byReactive.set(o,[]),e.byReactive.get(o).push(t)}t.persist&&e.persist.push(t)}function ct(t,e,l,r){for(let o=0;o<t.length;o++){const b=t[o];if(!e[b.attribute])continue;const c=b.effects&&b.effects[l];c?c(e,l,r):b.onAttrChange&&(!b.declared||b.declared.has(l))&&b.onAttrChange(e,l,r)}}function Rt(t){const e=t.attributeName,l=e.indexOf("data-ln-")===0,r=at(),o=r.byAttr.get(e),b=U()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(e);if(!l&&!o&&!b)return;const c=t.target;if(t.oldValue!==c.getAttribute(e)){if(b&&N(c)){const h=r.byDeclaredAttr.get(e),s=c.getAttribute(e);for(let p=0;p<h.length;p++)lt(h[p].spec,s,e,h[p].componentTag,c)}if(window.lnCore._debugSink&&(l||o)&&window.lnCore._debugSink("attr",e,c,{oldValue:t.oldValue,newValue:c.getAttribute(e)}),l){const h=r.byReactive.get(e);h&&ct(h,c,e,t.oldValue),r.reactiveWildcard.length&&ct(r.reactiveWildcard,c,e,t.oldValue)}if(o)for(let h=0;h<o.length;h++){const s=o[h];if(s.handler){s.handler(c,e,t.oldValue);continue}s.onAttributeChange&&c[s.attribute]?s.onAttributeChange(c,e):(st(c,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(c))}}}function Ot(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,H(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++)try{Rt(e[l])}catch(r){console.error("[ln-core] mutation handler failed",e[l].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function B(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function z(t,e){if(!document.contains(t))if(e.attribute){const l=t[e.attribute];if(l&&typeof l.destroy=="function")try{l.destroy()}catch(r){console.error("["+e.attribute+"] destroy failed",t,r)}delete t[e.attribute]}else e.onDestroy&&e.onDestroy(t)}function Ht(t){const e=B();if(!e.length)return;const l=t.target;if(l){const r=l.nodeType===1?l:l.parentElement;if(r&&(r.isContentEditable||r.closest&&r.closest('[contenteditable]:not([contenteditable="false"])')))return}if(t.target)for(let r=0;r<e.length;r++){const o=e[r];if(o.onSubtreeChange&&o.query){const b=o.query,c=t.target.nodeType===1?t.target.matches&&t.target.matches(b)?t.target:t.target.closest?t.target.closest(b):null:t.target.parentElement&&t.target.parentElement.closest?t.target.parentElement.closest(b):null;c&&o.onSubtreeChange(c,t)}}for(let r=0;r<t.addedNodes.length;r++){const o=t.addedNodes[r];if(o.nodeType===1){const b=!!(o.firstElementChild||o.children&&o.children.length);for(let c=0;c<e.length;c++){const h=e[c];if(h.selector&&h.attribute&&h.ComponentFn){if(!b)o.matches&&o.matches(h.query)&&O(o,h);else if(o.matches&&o.matches(h.query)&&O(o,h),o.querySelectorAll){const s=o.querySelectorAll(h.query);for(let p=0;p<s.length;p++)O(s[p],h)}}h.onInit&&h.onInit(o)}}}for(let r=0;r<t.removedNodes.length;r++){const o=t.removedNodes[r];if(o.nodeType===1){const b=!!(o.firstElementChild||o.children&&o.children.length);for(let c=0;c<e.length;c++){const h=e[c],s=h.query;if(s){if(!b)o.matches&&o.matches(s)&&z(o,h);else if(o.matches&&o.matches(s)&&z(o,h),o.querySelectorAll){const p=o.querySelectorAll(s);for(let S=0;S<p.length;S++)z(p[S],h)}}}}}}function dt(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,H(function(){new MutationObserver(function(e){for(let l=0;l<e.length;l++){const r=e[l];if(r.type==="childList")try{Ht(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Nt(t){B().push(t),dt()}function ut(t,e,l,r,o={}){const b=o.extraAttributes||[],c=o.onAttributeChange||null,h=o.onSubtreeChange||null,s=o.onInit||null,p=o.onAttrChange||null,S=o.effects||null,A=o.attributes||null,E=A?Tt(A):S,q=A?new Set(Object.keys(A)):null,I=o.persist||null;function F(a){const f=a||document.body;if(st(f,t,e,l),A&&U())for(const d in A){const _=A[d],w=Array.from(f.querySelectorAll("["+d+"]"));f.matches&&f.matches("["+d+"]")&&w.push(f);for(let g=0;g<w.length;g++){const m=w[g];N(m)&&lt(_,m.getAttribute(d),d,r,m)}}s&&s(f)}const v=[];if(t.indexOf("[")!==-1){const a=/\[([\w-]+)/g;let f;for(;(f=a.exec(t))!==null;)v.push(f[1])}else v.push(t);Ft({selector:t,attribute:e,componentTag:r,attributes:A,ComponentFn:l,onInit:s,observed:v.concat(b),onAttributeChange:c,onAttrChange:p,effects:E,declared:q,persist:I}),Ot();const n=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1,u=o.subtreeQuery||(n?t:"["+t+"]");B().push({selector:t,attribute:e,ComponentFn:l,onInit:s,onSubtreeChange:h,query:u}),dt(),window[e]=F,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ut,window.lnCore.observeLifecycle=Nt);function i(){qt()>0?It(function(){F(document.body)}):F(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i(),F}function Mt(t,e){let l=!1;return function(){l||(l=!0,queueMicrotask(function(){l=!1,t()}))}}function Wt(t){t=t||{};let e=t.windowSize>0?t.windowSize:1e3,l=t.pageSize>0?t.pageSize:200,r=t.threshold!=null?t.threshold:25,o=t.fetchDebounce!=null?t.fetchDebounce:120;const b=typeof t.requestPage=="function"?t.requestPage:function(){},c=typeof t.onChange=="function"?t.onChange:function(){},h=new Map,s=new Map,p=new Set;let S=0,A=0,E=0,q={sort:null,filters:{},search:""},I=null,F=0,v=0,n=!1;function u(d){s.set(d,++F)}function i(){return!!(q&&(q.search||q.filters&&Object.keys(q.filters).length))}function a(){if(h.size<=e)return;const d=Array.from(h.keys()).sort(function(w,g){return(s.get(w)||0)-(s.get(g)||0)});let _=0;for(;h.size>e&&_<d.length;)h.delete(d[_]),s.delete(d[_]),_++}function f(d,_){p.add(d),b(q,d,_)}return{get:function(d){return h.get(d)},has:function(d){return h.has(d)},peek:function(){return h.size?h.values().next().value:void 0},get logicalTotal(){return S},get grandTotal(){return A},get queryGen(){return E},get size(){return h.size},ensure:function(d,_){clearTimeout(I),v=d;for(let k=d;k<_;k++)h.has(k)&&u(k);if(S<=0)return;const w=Math.max(0,d-r),g=Math.min(S,_+r),m=Math.floor(w/l),T=Math.floor(Math.max(0,g-1)/l);let L=-1;for(let k=m;k<=T;k++){const y=k*l,C=Math.min(l,S-y);let x=!1;const Yt=Math.max(y,w),Jt=Math.min(y+C,g);for(let j=Yt;j<Jt;j++)if(!h.has(j)){x=!0;break}if(x&&!p.has(y)){L=y;break}}L!==-1&&(I=setTimeout(function(){f(L,l)},o))},ingest:function(d){if(d=d||{},d.queryGen!=null&&d.queryGen!==E)return!1;const _=d.offset||0,w=d.data||[];let g=0;for(let m=0;m<w.length;m++)w[m]!=null&&g++;if(g===0&&(d.provisional||d.filtered>0))return p.delete(_),!1;n&&(h.clear(),s.clear(),n=!1),d.provisional||(A=d.total!=null?d.total:A,S=d.filtered!=null?d.filtered:d.data?d.data.length:S);for(let m=0;m<w.length;m++)w[m]!=null&&(h.set(_+m,w[m]),u(_+m));return p.delete(_),a(),c(),!0},requestInitial:function(d){d&&(q=d),f(0,l)},invalidate:function(d){E++,p.clear(),clearTimeout(I),d&&(q=d),n=!0,f(0,l)},revalidate:function(){E++,p.clear(),clearTimeout(I),n=!0;const d=Math.max(0,Math.floor(v/l)*l);f(d,l)},release:function(d){p.delete(d)},destroy:function(){clearTimeout(I),h.clear(),s.clear(),p.clear()},configure:function(d){d=d||{};let _=!1;if(d.windowSize!=null&&d.windowSize>0&&d.windowSize!==e){const w=d.windowSize<e;e=d.windowSize,w&&a(),_=!0}d.pageSize!=null&&d.pageSize>0&&(l=d.pageSize),d.threshold!=null&&d.threshold>=0&&(r=d.threshold),d.fetchDebounce!=null&&d.fetchDebounce>=0&&(o=d.fetchDebounce),_&&c()},setGrandTotal:function(d){d==null||isNaN(d)||d<0||(A=d,i()||(S=d),c())}}}function ht(t){return(t||"").replace(/^#/,"")}function $(t){const e=t===void 0?location.hash:t,l={},r=ht(e);if(!r)return l;const o=r.split("&");for(let b=0;b<o.length;b++){const c=o[b];if(!c)continue;const h=c.indexOf(":"),s=h>-1?c.slice(0,h):c,p=h>-1?c.slice(h+1):"";if(s)try{l[s]=decodeURIComponent(p)}catch{l[s]=p}}return l}function Pt(t){if(!t)return null;const e=$();return t in e?e[t]:null}function Vt(t,e){if(!t)return;const l=$();e==null?delete l[t]:l[t]=String(e);const o=Object.keys(l).map(function(b){const c=l[b];return c===""?b:b+":"+encodeURIComponent(c)}).join("&");ht(location.hash)!==o&&(location.hash=o)}function Bt(t){return t.button===1||t.ctrlKey||t.metaKey||t.shiftKey?!1:(t.preventDefault(),!0)}function zt(t,e){if(!t||!t.hasAttribute("data-ln-hash"))return null;const l=t.getAttribute("data-ln-hash");if(l&&l.trim()!=="")return l.trim();const r=t.getAttribute("data-ln-sort")||t.getAttribute("data-ln-search-for")||t.getAttribute("data-ln-search")||t.getAttribute("data-ln-filter")||t.id;return r?e?r+"-"+e:r:e||null}function $t(t,e){return!e||e==="none"||t===null||t===void 0?null:String(t)+"."+e}function jt(t){return!t||typeof t!="string"?null:t.endsWith(".asc")?{fieldOrColumn:t.slice(0,-4),direction:"asc"}:t.endsWith(".desc")?{fieldOrColumn:t.slice(0,-5),direction:"desc"}:null}function Ut(t,e){return!t||!Array.isArray(e)||e.length===0?null:t+":"+e.map(encodeURIComponent).join(",")}function Gt(t){if(!t||typeof t!="string")return null;const e=t.indexOf(":");if(e===-1)return null;const l=t.slice(0,e),r=t.slice(e+1),o=r?r.split(",").map(function(b){try{return decodeURIComponent(b)}catch{return b}}).filter(Boolean):[];return{key:l,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Pt,window.lnCore.hashSet=Vt,window.lnCore.hashLinkClick=Bt,window.lnCore.resolveHashNamespace=zt,window.lnCore.hashSortEncode=$t,window.lnCore.hashSortDecode=jt,window.lnCore.hashFilterEncode=Ut,window.lnCore.hashFilterDecode=Gt);function Kt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Kt);function ft(t,e,l,r,o=15){if(r<=0||l<=0)return{start:0,end:0,topPadding:0,bottomPadding:0};const b=Math.max(0,t||0),c=Math.max(0,e||0),h=Math.floor(b/l),s=Math.ceil(c/l),p=Math.max(0,h-o),S=Math.min(r,h+s+o),A=p*l,E=Math.max(0,(r-S)*l);return{start:p,end:S,topPadding:A,bottomPadding:E}}function Qt(t,e){const l=Array.isArray(t)?t.length:0,r=e instanceof Set?e:new Set(e||[]);let o=0;if(Array.isArray(t))for(let h=0;h<t.length;h++)r.has(t[h])&&o++;else o=r.size;const b=l>0&&o===l,c=o>0&&o<l;return{totalCount:l,selectedCount:o,isAllSelected:b,isIndeterminate:c}}function bt(t,e,l){const r=new Set(t);return e==null||((l!==void 0?l:!r.has(e))?r.add(e):r.delete(e)),r}function pt(t,e,l){const r=new Set(t);if(!Array.isArray(e))return r;if(l)for(let o=0;o<e.length;o++)e[o]!=null&&r.add(e[o]);else for(let o=0;o<e.length;o++)r.delete(e[o]);return r}(function(){const t="data-ln-table",e="lnTable",l="data-ln-table-empty";if(window[e]!==void 0)return;function s(n,u){if(!n||!n.isDataDriven)return;const i=n.dom.hasAttribute("data-ln-table-window");if(i&&!n._windowed)n._enterWindowedMode(),n._kickWindowInitial();else if(!i&&n._windowed)n._exitWindowedMode();else if(i&&n._windowed){const a=parseInt(u,10);a>0&&n._cache.configure({windowSize:a})}}function p(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>0&&n._cache.configure({pageSize:i})}function S(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.configure({threshold:i})}function A(n,u){if(!n||!n.isDataDriven||!n._windowed||!n._cache)return;const i=parseInt(u,10);i>=0&&n._cache.setGrandTotal(i)}const E={"data-ln-table":{prop:"name",type:"string",read:R,fallback:"",description:"Table instance name or identifier"},"data-ln-table-source":{prop:"source",type:"string",read:R,fallback:"",description:"Source store or coordinator addressing"},"data-ln-table-selectable":{prop:"_selectable",type:"boolean",read:P,description:"Enables row selection check controls"},"data-ln-table-window":{type:"integer",fallback:1e3,min:10,effect:s,description:"Virtual scrolling window size in rows"},"data-ln-table-window-page":{type:"integer",fallback:200,min:5,effect:p,description:"Virtual scrolling slice page size"},"data-ln-table-window-threshold":{type:"integer",fallback:50,min:0,effect:S,description:"Scroll threshold margin in pixels to trigger page fetch"},"data-ln-table-count":{type:"integer",min:0,effect:A,description:"Total record count override for virtual scrollbar calculation"},"data-ln-table-row":{type:"marker",description:"Table row template element"},"data-ln-table-row-id":{type:"string",description:"Record identifier on row element"},"data-ln-table-row-action":{type:"trigger",description:"Action trigger inside a table row"},"data-ln-table-row-select":{type:"trigger",description:"Row selection checkbox trigger"},"data-ln-table-col":{type:"string",description:"Column header identifier or field mapping"},"data-ln-table-col-select":{type:"trigger",description:"Header select-all checkbox trigger"},"data-ln-table-cell-attr":{type:"string",description:"Cell attribute template mapping"},"data-ln-table-empty":{type:"marker",description:"Container for table empty state"},"data-ln-table-select-all-label":{type:"string",description:"Accessibility label for select-all header trigger"}},q=ot(E);typeof Intl<"u"&&new Intl.Collator(document.documentElement.lang||void 0,{sensitivity:"base"});function I(n,u){if(n==null||isNaN(n))return"";try{return new Intl.NumberFormat(vt(u)).format(n)}catch{return String(n)}}function F(n){let u=n.parentElement;for(;u&&u!==document.body&&u!==document.documentElement;){const a=getComputedStyle(u).overflowY;if(a==="auto"||a==="scroll")return u;u=u.parentElement}return null}function v(n){this.dom=n,rt(this,n,q),this.table=n.querySelector("table"),this.tbody=n.querySelector("[data-ln-table-body]")||n.querySelector("tbody"),this.thead=n.querySelector("thead");const u=this.thead?this.thead.querySelector("tr:last-child"):null;this.ths=u?Array.from(u.querySelectorAll("th")):[],this._totalSpan=n.querySelector("[data-ln-table-total]"),this._filteredSpan=n.querySelector("[data-ln-table-filtered]"),this._filteredSpan&&(this._filteredWrap=this._filteredSpan.parentElement!==n?this._filteredSpan.parentElement:null),this._selectedSpan=n.querySelector("[data-ln-table-selected]"),this._selectedSpan&&(this._selectedWrap=this._selectedSpan.parentElement!==n?this._selectedSpan.parentElement:null),this.isDataDriven=n.hasAttribute("data-ln-table-source"),this._data=[],this._filteredData=[],this._searchTerm="",this._sortCol=-1,this._sortDir=null,this._columnFilters={},this.selectedIds=new Set,this._virtual=!1,this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._rafId=null,this._scrollHandler=null,this._scrollContainer=null,this._colgroup=null;const i=this;return this._onSetSearch=function(a){const f=(a.detail&&a.detail.query!=null?a.detail.query:a.detail&&a.detail.term!=null?a.detail.term:"").trim();i.isDataDriven?(i.currentSearch=f,D(n,"ln-table:search",{table:i.name,query:i.currentSearch}),i._requestData()):(i._searchTerm=f.toLowerCase(),i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:set-search",this._onSetSearch),this._onSearchChange=function(a){a.preventDefault(),i._onSetSearch(a)},n.addEventListener("ln-search:change",this._onSearchChange),this._onRequestClearFilters=function(){i.isDataDriven?(i.currentFilters={},i.currentSearch="",D(n,"ln-table:clear-filters",{table:i.name}),i._requestData()):(i._searchTerm="",i._columnFilters={},i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:"",matched:i._filteredData.length,total:i._data.length}))},n.addEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this._selectableActive=!1,this._selectable&&this._enableSelection(),this.isDataDriven?(this.isLoaded=!1,this.totalCount=0,this.visibleCount=0,this.currentSort=null,this.currentFilters={},this.currentSearch="",this._lastTotal=0,this._lastFiltered=0,this._hasInitialSeed=!1,this._windowed=!1,this._cache=null,this.isDataDriven&&n.hasAttribute("data-ln-table-window")&&this._enterWindowedMode(),this._onSetData=function(a){const f=a.detail||{},d=f.data||[],_=f.total!=null?f.total:d.length;if(!(i._hasInitialSeed&&!i.isLoaded&&d.length===0&&_===0)){if(i._windowed){i._cache.ingest(f)&&!f.provisional&&n.classList.remove("ln-table--loading");return}i._data=d,i._lastTotal=_,i._lastFiltered=f.filtered!=null?f.filtered:i._data.length,i.totalCount=i._lastTotal,i.visibleCount=i._lastFiltered,i.isLoaded=!0,i._hasInitialSeed=!1,n.classList.remove("ln-table--loading"),i._vStart=-1,i._vEnd=-1,i._applyFilterAndSort(),i._render(),i._updateFooter(),D(n,"ln-table:rendered",{table:i.name,total:i.totalCount,visible:i.visibleCount})}},n.addEventListener("ln-table:set-data",this._onSetData),this._onSetLoading=function(a){const f=a.detail&&a.detail.loading;n.classList.toggle("ln-table--loading",!!f),f&&(i.isLoaded=!1)},n.addEventListener("ln-table:set-loading",this._onSetLoading),this._onPageFailed=function(a){!i._windowed||!i._cache||i._cache.release(a.detail&&a.detail.offset)},n.addEventListener("ln-table:page-failed",this._onPageFailed),this._onRequestRevalidate=function(){!i._windowed||!i._cache||i._cache.revalidate()},n.addEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this._onRequestInvalidate=function(){!i._windowed||!i._cache||i._requestData()},n.addEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this._onSort=function(a){!a.detail||a.detail.field==null||(a.preventDefault(),i.currentSort=a.detail.direction==="none"?null:{field:a.detail.field,direction:a.detail.direction},i._requestData())},n.addEventListener("ln-sort:change",this._onSort),this._windowed&&this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden"),this._onRowClick=function(a){if(a.target.closest("[data-ln-table-row-select]")||a.target.closest("[data-ln-table-row-action]")||a.target.closest("a")||a.target.closest("button")||a.ctrlKey||a.metaKey||a.button===1)return;const f=a.target.closest("[data-ln-table-row]");if(!f)return;const d=f.getAttribute("data-ln-table-row-id"),_=f._lnRecord||{};D(n,"ln-table:row-click",{table:i.name,id:d,record:_})},this.tbody&&this.tbody.addEventListener("click",this._onRowClick),this._onRowAction=function(a){const f=a.target.closest("[data-ln-table-row-action]");if(!f)return;const d=f.closest("[data-ln-table-row]");if(!d)return;const _=f.getAttribute("data-ln-table-row-action"),w=d.getAttribute("data-ln-table-row-id"),g=d._lnRecord||{};D(n,"ln-table:row-action",{table:i.name,id:w,action:_,record:g})},this.tbody&&this.tbody.addEventListener("click",this._onRowAction),this.tbody&&this.tbody.rows.length>0&&this._parseRows(),this._windowed?this._kickWindowInitial():D(n,"ln-table:request-data",{table:this.name,sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})):(this._emptyTbodyObserver=null,this.tbody&&this.tbody.rows.length>0?this._parseRows():this.tbody&&(this._emptyTbodyObserver=new MutationObserver(function(){i.tbody.rows.length>0&&(i._emptyTbodyObserver.disconnect(),i._emptyTbodyObserver=null,i._parseRows())}),this._emptyTbodyObserver.observe(this.tbody,{childList:!0})),this._onSort=function(a){if(!a.detail||a.detail.column==null)return;a.preventDefault();const f=a.detail.direction==="none"?null:a.detail.direction;i._sortCol=f===null?-1:a.detail.column,i._sortDir=f,i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),D(n,"ln-table:sorted",{column:a.detail.column,direction:a.detail.direction,matched:i._filteredData.length,total:i._data.length})},n.addEventListener("ln-sort:change",this._onSort),this._onFilterChange=function(a){if(a.preventDefault(),!a.detail)return;const f=a.detail.key,d=a.detail.values||[];if(f){if(d.length===0)delete i._columnFilters[f];else{const _=[];for(let w=0;w<d.length;w++)_.push(d[w].toLowerCase());i._columnFilters[f]=_}i._applyFilterAndSort(),i._vStart=-1,i._vEnd=-1,i._render(),i._updateFooter(),D(n,"ln-table:filter",{term:i._searchTerm,matched:i._filteredData.length,total:i._data.length})}},n.addEventListener("ln-filter:change",this._onFilterChange)),this}v.prototype._parseRows=function(){const n=this.tbody.rows,u=this.ths;this._data=[],n.length>0&&(this._rowHeight=n[0].offsetHeight||40),this._lockColumnWidths();for(let i=0;i<n.length;i++){const a=n[i],f=[],d=[],_=[];for(let g=0;g<a.cells.length;g++){const m=a.cells[g],T=m.textContent.trim();f[g]=G(m),d[g]=T.toLowerCase(),m.querySelector("[data-ln-table-row-action]")||_.push(T.toLowerCase())}let w=null;if(this.isDataDriven){w={};const g=a.getAttribute("data-ln-table-row-id");g!=null&&(w.id=g);for(let m=0;m<u.length;m++){const T=u[m].getAttribute("data-ln-table-col");if(T){const L=m;if(L<a.cells.length){const k=a.cells[L];w[T]=G(k)}}}}this._data.push({values:f,rawTexts:d,html:a.outerHTML,searchText:_.join(" "),id:this.isDataDriven&&w?w.id:void 0,...w})}this._filteredData=this._data.slice(),this._data.length>0&&(this._hasInitialSeed=!0),this.isDataDriven&&(this._lastTotal=this._data.length,this._lastFiltered=this._data.length,this.totalCount=this._data.length,this.visibleCount=this._data.length,this._updateFooter()),this._render(),D(this.dom,"ln-table:ready",{total:this._data.length})},v.prototype._applyFilterAndSort=function(){this._filteredData=this._data?this._data.slice():[],this.visibleCount=this.isDataDriven&&this._lastFiltered!=null?this._lastFiltered:this._filteredData.length},v.prototype._lockColumnWidths=function(){if(!this.table||!this.thead||this._colgroup)return;const n=document.createElement("colgroup");this.ths.forEach(function(u){const i=document.createElement("col");i.style.width=u.offsetWidth+"px",n.appendChild(i)}),this.table.insertBefore(n,this.table.firstChild),this.table.style.tableLayout="fixed",this._colgroup=n},v.prototype._render=function(){if(this.tbody)if(this.isDataDriven){if(this._windowed){this._renderWindowed();return}const n=this._lastTotal,u=this.visibleCount;if(n===0){this._disableVirtualScroll(),this._showEmptyState();return}if(this._filteredData.length===0||u===0){this._disableVirtualScroll(),this._showEmptyState();return}this._filteredData.length>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}else{const n=this._filteredData.length;n===0&&(this._searchTerm||Object.keys(this._columnFilters).length>0)?(this._disableVirtualScroll(),this._showEmptyState()):n>200?(this._enableVirtualScroll(),this._renderVirtual()):(this._disableVirtualScroll(),this._renderAll())}},v.prototype._renderAll=function(){if(this.isDataDriven){const n=this._filteredData,u=document.createDocumentFragment();for(let i=0;i<n.length;i++){const a=this._buildRow(n[i]);if(!a)break;u.appendChild(a)}this.tbody.replaceChildren(u),this._selectable&&this._updateSelectAll()}else{const n=[],u=this._filteredData;for(let i=0;i<u.length;i++)n.push(u[i].html);this.tbody.innerHTML=n.join(""),this._selectable&&this._restoreSelection()}},v.prototype._enableVirtualScroll=function(){if(this._virtual)return;this._virtual=!0,this._vStart=-1,this._vEnd=-1;const n=this;if(!this._rowHeight)if(this.tbody&&this.tbody.rows.length>0)this._rowHeight=this.tbody.rows[0].offsetHeight||40;else{let i=null;if(this._windowed){const a=this._cache?this._cache.peek():null;i=a?this._buildRow(a):this._buildPlaceholderRow()}else this.isDataDriven&&this._data.length>0&&(i=this._buildRow(this._data[0]));i&&this.tbody&&(this.tbody.appendChild(i),this._rowHeight=i.offsetHeight||40,i.remove())}this.isDataDriven?this._scrollContainer=F(this.dom):this._scrollContainer=null;const u=this._scrollContainer||window;this._scrollHandler=function(){n._rafId||(n._rafId=requestAnimationFrame(function(){n._rafId=null,n._windowed?n._renderWindowed():n._renderVirtual()}))},u.addEventListener("scroll",this._scrollHandler,{passive:!0}),window.addEventListener("resize",this._scrollHandler,{passive:!0})},v.prototype._disableVirtualScroll=function(){this._virtual&&(this._virtual=!1,this._scrollHandler&&((this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler),window.removeEventListener("resize",this._scrollHandler),this._scrollHandler=null),this._scrollContainer=null,this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._vStart=-1,this._vEnd=-1)},v.prototype._renderVirtual=function(){const n=this._filteredData,u=n.length,i=this._rowHeight;if(!i||!u)return;const a=this.thead?this.thead.offsetHeight:0,f=this._scrollContainer;let d,_;if(f){const y=this.table.getBoundingClientRect(),C=f.getBoundingClientRect(),x=y.top-C.top+f.scrollTop+a;d=f.scrollTop-x,_=f.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+a;d=window.scrollY-x,_=window.innerHeight}const w=ft(d,_,i,u,15),g=w.start,m=w.end;if(g===this._vStart&&m===this._vEnd)return;this._vStart=g,this._vEnd=m;const T=this.ths.length||1,L=w.topPadding,k=w.bottomPadding;if(this.isDataDriven){const y=document.createDocumentFragment();if(L>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=L+"px",C.appendChild(x),y.appendChild(C)}for(let C=g;C<m;C++){const x=this._buildRow(n[C]);x&&y.appendChild(x)}if(k>0){const C=document.createElement("tr");C.className="ln-table__spacer",C.setAttribute("aria-hidden","true");const x=document.createElement("td");x.setAttribute("colspan",T),x.style.height=k+"px",C.appendChild(x),y.appendChild(C)}this.tbody.replaceChildren(y),this._selectable&&this._updateSelectAll()}else{let y="";L>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+L+'px;padding:0;border:none"></td></tr>');for(let C=g;C<m;C++)y+=n[C].html;k>0&&(y+='<tr class="ln-table__spacer" aria-hidden="true"><td colspan="'+T+'" style="height:'+k+'px;padding:0;border:none"></td></tr>'),this.tbody.innerHTML=y,this._selectable&&this._restoreSelection()}},v.prototype._buildPlaceholderRow=function(){const n=document.createElement("tr");n.className="ln-table__placeholder",n.setAttribute("aria-hidden","true");const u=document.createElement("td");return u.setAttribute("colspan",this.ths.length||1),u.style.height=this._rowHeight+"px",n.appendChild(u),n},v.prototype._renderWindowed=function(){if(this.isLoaded&&this._cache.logicalTotal===0){this._disableVirtualScroll(),this._showEmptyState();return}this._virtual||this._enableVirtualScroll();const n=this._rowHeight;if(!n)return;const u=this._cache.logicalTotal,i=this.thead?this.thead.offsetHeight:0,a=this._scrollContainer;let f,d;if(a){const y=this.table.getBoundingClientRect(),C=a.getBoundingClientRect(),x=y.top-C.top+a.scrollTop+i;f=a.scrollTop-x,d=a.clientHeight}else{const x=this.table.getBoundingClientRect().top+window.scrollY+i;f=window.scrollY-x,d=window.innerHeight}const _=ft(f,d,n,u,15),w=_.start,g=_.end,m=this.ths.length||1,T=_.topPadding,L=_.bottomPadding,k=document.createDocumentFragment();if(T>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=T+"px",y.appendChild(C),k.appendChild(y)}for(let y=w;y<g;y++)if(this._cache.has(y)){const C=this._buildRow(this._cache.get(y));C&&k.appendChild(C)}else k.appendChild(this._buildPlaceholderRow());if(L>0){const y=document.createElement("tr");y.className="ln-table__spacer",y.setAttribute("aria-hidden","true");const C=document.createElement("td");C.setAttribute("colspan",m),C.style.height=L+"px",y.appendChild(C),k.appendChild(y)}this.tbody.replaceChildren(k),this._vStart=w,this._vEnd=g,this._cache.ensure(w,g)},v.prototype._showEmptyState=function(){const n=this.ths.length||1;let u=null,i=null;if(this.isDataDriven){const a=this._lastTotal!=null?this._lastTotal:this._data.length,d=this.visibleCount===0&&a>0,_=d?this.name+"-empty-filtered":this.name+"-empty";if(i=J(this.dom,_,"ln-table"),!i){const w=this.dom.querySelector("template[data-ln-table-empty]");if(w){const g=d?"search":"initial",m=w.content.querySelector('[data-ln-table-empty-when="'+g+'"]')||w.content.firstElementChild;m&&(i=document.importNode(m,!0))}}if(i)if(i.tagName==="TR")u=i;else{const w=document.createElement("td");w.setAttribute("colspan",String(n)),w.appendChild(i);const g=document.createElement("tr");g.className="ln-table__empty",g.appendChild(w),u=g}}else{const a=this.dom.querySelector("template["+l+"]"),f=document.createElement("td");f.setAttribute("colspan",String(n)),a&&f.appendChild(document.importNode(a.content,!0));const d=document.createElement("tr");d.className="ln-table__empty",d.appendChild(f),u=d}u?this.tbody.replaceChildren(u):this.tbody.replaceChildren(),D(this.dom,"ln-table:empty",{term:this.isDataDriven?this.currentSearch||"":this._searchTerm,total:this.isDataDriven?this._lastTotal!=null?this._lastTotal:this._data.length:this._data.length})},v.prototype._fillRow=function(n,u){W(n,u);const i=n.querySelectorAll("[data-ln-table-cell-attr]");for(let a=0;a<i.length;a++){const f=i[a],d=f.getAttribute("data-ln-table-cell-attr").split(",");for(let _=0;_<d.length;_++){const w=d[_].trim().split(":");if(w.length!==2)continue;const g=w[0].trim(),m=w[1].trim();u[g]!=null&&f.setAttribute(m,u[g])}}},v.prototype._buildRow=function(n){let u=J(this.dom,this.name+"-row","ln-table");if(!u){const a=this.dom.querySelector("template[data-ln-table-row]");a&&(u=document.importNode(a.content,!0))}let i=u?u.querySelector("[data-ln-table-row]")||u.firstElementChild:null;if(i)this._fillRow(i,n);else if(n&&n.html){const a=document.createElement("tbody");a.innerHTML=n.html,i=a.firstElementChild}else{i=document.createElement("tr"),i.setAttribute("data-ln-table-row","");const a=this.ths;for(let f=0;f<a.length;f++){const d=a[f].hasAttribute("data-ln-table-col-select"),_=document.createElement("td");if(d){const w=document.createElement("input");w.type="checkbox",w.setAttribute("data-ln-table-row-select",""),w.setAttribute("aria-label","Select row"),_.appendChild(w)}else{const w=a[f].getAttribute("data-ln-table-col");w&&n[w]!=null&&(_.textContent=String(n[w]))}i.appendChild(_)}}if(i._lnRecord=n,n.id!=null&&i.setAttribute("data-ln-table-row-id",n.id),this._selectable&&n.id!=null&&this.selectedIds.has(String(n.id))){i.classList.add("ln-row-selected");const a=i.querySelector("[data-ln-table-row-select]");a&&(a.checked=!0)}return i},v.prototype._requestData=function(){if(this._windowed){this.dom.classList.add("ln-table--loading"),this._cache.invalidate({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch});return}wt(this,"ln-table:request-data","table")},v.prototype._enterWindowedMode=function(){const n=this,u=this.dom,i=parseInt(u.getAttribute("data-ln-table-window"),10),a=parseInt(u.getAttribute("data-ln-table-window-page"),10),f=parseInt(u.getAttribute("data-ln-table-window-threshold"),10);this._onCacheChange=function(){!n._windowed||!n._cache||(n.totalCount=n._cache.grandTotal,n.visibleCount=n._cache.logicalTotal,n._lastTotal=n._cache.grandTotal,n.isLoaded=!0,n._vStart=-1,n._vEnd=-1,n._render(),n._updateFooter(),D(u,"ln-table:rendered",{table:n.name,total:n.totalCount,visible:n.visibleCount}))},this._renderBatch=Mt(this._onCacheChange),this._cache=Wt({windowSize:i>0?i:1e3,pageSize:a>0?a:200,threshold:f>=0?f:25,fetchDebounce:120,requestPage:function(d,_,w){D(u,"ln-table:request-data",{table:n.name,sort:d.sort,filters:d.filters,search:d.search,offset:_,limit:w,queryGen:n._cache.queryGen})},onChange:this._renderBatch}),this._windowed=!0,this._selectable&&this._selectAllCheckbox&&this._selectAllCheckbox.classList.add("hidden")},v.prototype._kickWindowInitial=function(){if(this._data.length>0){let n=parseInt(this.dom.getAttribute("data-ln-table-count"),10);if(isNaN(n)&&this._totalSpan){const i=this._totalSpan.textContent.replace(/[^\d]/g,"");i&&(n=parseInt(i,10))}const u=n>0?n:this._data.length;this._cache.ingest({data:this._data,offset:0,total:u,filtered:u})}else this.dom.classList.add("ln-table--loading"),this._cache.requestInitial({sort:this.currentSort,filters:this.currentFilters,search:this.currentSearch})},v.prototype._exitWindowedMode=function(){this._disableVirtualScroll(),this._cache&&this._cache.destroy(),this._cache=null,this._windowed=!1,this._renderBatch=null,this._onCacheChange=null,this._selectAllCheckbox&&this._selectAllCheckbox.classList.remove("hidden"),this._rowHeight=0,this._vStart=-1,this._vEnd=-1,this._data=[],this._filteredData=[],this.dom.classList.add("ln-table--loading"),this._requestData()},v.prototype._updateSelectAll=function(){if(!this._selectAllCheckbox||!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]"),u=[];for(let a=0;a<n.length;a++){const f=n[a].getAttribute("data-ln-table-row-id");f!=null&&u.push(f)}const i=Qt(u,this.selectedIds);this._selectAllCheckbox.checked=i.isAllSelected,this._selectAllCheckbox.indeterminate=i.isIndeterminate},v.prototype._restoreSelection=function(){if(!this.tbody)return;const n=this.tbody.querySelectorAll("[data-ln-table-row]");for(let u=0;u<n.length;u++){const i=n[u].getAttribute("data-ln-table-row-id"),a=i!=null&&this.selectedIds.has(i);n[u].classList.toggle("ln-row-selected",a);const f=n[u].querySelector("[data-ln-table-row-select]");f&&(f.checked=a)}this._updateSelectAll()},Object.defineProperty(v.prototype,"selectedCount",{get:function(){return this.selectedIds.size},set:function(){}}),v.prototype._enableSelection=function(){if(this._selectableActive)return;this._selectableActive=!0;const n=this;if(this._onSelectionChange=function(u){const i=u.target.closest("[data-ln-table-row-select]");if(!i)return;const a=i.closest("[data-ln-table-row]");if(!a)return;const f=a.getAttribute("data-ln-table-row-id");f!=null&&(n.selectedIds=bt(n.selectedIds,f,i.checked),a.classList.toggle("ln-row-selected",i.checked),n.selectedCount=n.selectedIds.size,n._updateSelectAll(),n._updateFooter(),D(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}))},this.tbody&&this.tbody.addEventListener("change",this._onSelectionChange),this._selectAllCheckbox=this.dom.querySelector('[data-ln-table-col-select] input[type="checkbox"]')||this.dom.querySelector("[data-ln-table-col-select]"),this._selectAllCheckbox&&this._selectAllCheckbox.tagName==="TH"){const u=document.createElement("input");u.type="checkbox";const i=n.dom.querySelector('[data-ln-table-dict="select-all"]'),a=n.dom.getAttribute("data-ln-table-select-all-label")||(i?i.textContent.trim():null)||"Select all";u.setAttribute("aria-label",a),this._selectAllCheckbox.appendChild(u),this._selectAllCheckbox=u}if(this._selectAllCheckbox&&(this._onSelectAll=function(){const u=n._selectAllCheckbox.checked,i=n.tbody?n.tbody.querySelectorAll("[data-ln-table-row]"):[],a=[];for(let f=0;f<i.length;f++){const d=i[f].getAttribute("data-ln-table-row-id"),_=i[f].querySelector("[data-ln-table-row-select]");d!=null&&(a.push(d),i[f].classList.toggle("ln-row-selected",u),_&&(_.checked=u))}n.selectedIds=pt(n.selectedIds,a,u),n.selectedCount=n.selectedIds.size,D(n.dom,"ln-table:select-all",{table:n.name,selected:u}),D(n.dom,"ln-table:select",{table:n.name,selectedIds:n.selectedIds,count:n.selectedCount}),n._updateFooter()},this._selectAllCheckbox.addEventListener("change",this._onSelectAll)),this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){const a=u[i].querySelector("[data-ln-table-row-select]"),f=u[i].getAttribute("data-ln-table-row-id");a&&a.checked&&f!=null&&(n.selectedIds=bt(n.selectedIds,f,!0),u[i].classList.add("ln-row-selected"))}this.selectedCount=this.selectedIds.size,this.selectedCount>0&&this._updateSelectAll()}},v.prototype._disableSelection=function(){if(!this._selectableActive)return;this._selectableActive=!1,this.tbody&&this._onSelectionChange&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll);const n=this.dom.querySelector("[data-ln-table-col-select]");if(n){const u=n.querySelector('input[type="checkbox"]');u&&u.remove()}if(this._selectAllCheckbox=null,this.selectedIds=pt(this.selectedIds,Array.from(this.selectedIds),!1),this.selectedCount=0,this.tbody){const u=this.tbody.querySelectorAll("[data-ln-table-row]");for(let i=0;i<u.length;i++){u[i].classList.remove("ln-row-selected");const a=u[i].querySelector("[data-ln-table-row-select]");a&&(a.checked=!1)}}this._updateFooter()},v.prototype._updateFooter=function(){let n=0,u=0;this.isDataDriven?(n=this._lastTotal!=null?this._lastTotal:this._data.length,u=this.visibleCount):(n=this._data.length,u=this._filteredData.length);const i=u<n;if(this._totalSpan&&(this._totalSpan.textContent=I(n,this.dom)),this._filteredSpan&&(this._filteredSpan.textContent=i?I(u,this.dom):""),this._filteredWrap&&this._filteredWrap.classList.toggle("hidden",!i),this._selectedSpan){const a=this.selectedIds?this.selectedIds.size:0;this._selectedSpan.textContent=a>0?I(a,this.dom):"",this._selectedWrap&&this._selectedWrap.classList.toggle("hidden",a===0)}},v.prototype.destroy=function(){this.dom[e]&&(this._disableVirtualScroll(),this.dom.removeEventListener("ln-table:set-search",this._onSetSearch),this.dom.removeEventListener("ln-table:request-clear-filters",this._onRequestClearFilters),this.isDataDriven?(this.dom.removeEventListener("ln-table:set-data",this._onSetData),this.dom.removeEventListener("ln-table:set-loading",this._onSetLoading),this.dom.removeEventListener("ln-table:page-failed",this._onPageFailed),this.dom.removeEventListener("ln-table:request-revalidate",this._onRequestRevalidate),this.dom.removeEventListener("ln-table:request-invalidate",this._onRequestInvalidate),this.dom.removeEventListener("ln-sort:change",this._onSort),this.tbody&&(this.tbody.removeEventListener("click",this._onRowClick),this.tbody.removeEventListener("click",this._onRowAction)),this._cache&&this._cache.destroy()):(this._emptyTbodyObserver&&(this._emptyTbodyObserver.disconnect(),this._emptyTbodyObserver=null),this.dom.removeEventListener("ln-sort:change",this._onSort),this.dom.removeEventListener("ln-search:change",this._onSearchChange),this.dom.removeEventListener("ln-filter:change",this._onFilterChange)),this._onSelectionChange&&this.tbody&&this.tbody.removeEventListener("change",this._onSelectionChange),this._selectAllCheckbox&&this._onSelectAll&&this._selectAllCheckbox.removeEventListener("change",this._onSelectAll),this._colgroup&&(this._colgroup.remove(),this._colgroup=null),this.table&&(this.table.style.tableLayout=""),this._data=[],this._filteredData=[],delete this.dom[e])},ut(t,e,v,"ln-table",{attributes:E})})()})();