@livenetworks/ashlar 2.1.1 → 2.1.3

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 (71) 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-autoresize/src/ln-autoresize.js +3 -1
  7. package/components/ln-autosave/ln-autosave.js +1 -1
  8. package/components/ln-chart/ln-chart.js +1 -1
  9. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  10. package/components/ln-confirm/ln-confirm.js +1 -1
  11. package/components/ln-core/lifecycle.js +24 -12
  12. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  13. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  14. package/components/ln-data-store/ln-data-store.js +1 -1
  15. package/components/ln-date/ln-date.js +1 -1
  16. package/components/ln-date/src/ln-date.js +22 -12
  17. package/components/ln-debug/ln-debug.js +1 -1
  18. package/components/ln-dropdown/ln-dropdown.js +1 -1
  19. package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
  20. package/components/ln-dropdown/src/ln-dropdown.js +18 -5
  21. package/components/ln-editor/ln-editor.js +1 -1
  22. package/components/ln-external-links/ln-external-links.js +1 -1
  23. package/components/ln-filter/ln-filter.js +1 -1
  24. package/components/ln-filter/ln-filter.schema.json +1 -1
  25. package/components/ln-filter/src/ln-filter.js +11 -10
  26. package/components/ln-form/ln-form.js +1 -1
  27. package/components/ln-form/src/ln-form.js +11 -0
  28. package/components/ln-icon/ln-icon.js +1 -1
  29. package/components/ln-include/ln-include.js +1 -1
  30. package/components/ln-key/ln-key.js +1 -1
  31. package/components/ln-link/ln-link.js +1 -1
  32. package/components/ln-list/ln-list.js +1 -1
  33. package/components/ln-list/src/ln-list.js +14 -5
  34. package/components/ln-modal/ln-modal.js +1 -1
  35. package/components/ln-nav/ln-nav.js +1 -1
  36. package/components/ln-number/ln-number.js +1 -1
  37. package/components/ln-number/src/ln-number.js +21 -10
  38. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  39. package/components/ln-options/ln-options.js +1 -1
  40. package/components/ln-picklist/ln-picklist.js +1 -1
  41. package/components/ln-popover/ln-popover.js +1 -1
  42. package/components/ln-popover/ln-popover.schema.json +82 -82
  43. package/components/ln-popover/src/ln-popover.js +22 -5
  44. package/components/ln-progress/ln-progress.js +1 -1
  45. package/components/ln-router/ln-router.js +1 -1
  46. package/components/ln-scroll/ln-scroll.js +1 -1
  47. package/components/ln-search/ln-search.js +1 -1
  48. package/components/ln-search/ln-search.schema.json +103 -103
  49. package/components/ln-search/src/ln-search.js +9 -5
  50. package/components/ln-slug/ln-slug.js +1 -1
  51. package/components/ln-sort/ln-sort.js +1 -1
  52. package/components/ln-sortable/ln-sortable.js +1 -1
  53. package/components/ln-sortable/src/ln-sortable.js +52 -7
  54. package/components/ln-stat/ln-stat.js +1 -1
  55. package/components/ln-table/ln-table.js +1 -1
  56. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  57. package/components/ln-tabs/ln-tabs.js +1 -1
  58. package/components/ln-tabs/src/ln-tabs.js +12 -8
  59. package/components/ln-time/ln-time.js +1 -1
  60. package/components/ln-time/src/ln-time.js +17 -7
  61. package/components/ln-toast/ln-toast.js +1 -1
  62. package/components/ln-toggle/ln-toggle.js +1 -1
  63. package/components/ln-tooltip/ln-tooltip.js +1 -1
  64. package/components/ln-translations/ln-translations.js +1 -1
  65. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  66. package/components/ln-upload/ln-upload.js +1 -1
  67. package/components/ln-validate/ln-validate.js +1 -1
  68. package/components/ln-validate/src/ln-validate.js +21 -7
  69. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  70. package/package.json +1 -1
  71. package/web-types.json +1 -1
@@ -1 +1 @@
1
- (function(){"use strict";function we(){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 oe(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let a=1;a<t.length;a++)if(t[a]&&t[a].nodeType===1){o=t[a];break}if(!oe(o))return}e.apply(console,t)}}function v(e,t,i){const o=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function J(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){J(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function $e(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Ke(e,t){const i=!!(t&&t.typed),o=t&&t.exclude,a={},c=e.elements,s={};if(i)for(let d=0;d<c.length;d++){const l=c[d];l.name&&l.type==="checkbox"&&!l.disabled&&(s[l.name]=(s[l.name]||0)+1)}for(let d=0;d<c.length;d++){const l=c[d];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(o&&l.matches&&l.matches(o)))if(l.type==="checkbox")i&&s[l.name]===1?a[l.name]=l.checked:(a[l.name]||(a[l.name]=[]),l.checked&&a[l.name].push(l.value));else if(l.type==="radio")l.checked&&(a[l.name]=l.value);else if(l.type==="select-multiple"){a[l.name]=[];for(let w=0;w<l.options.length;w++)l.options[w].selected&&a[l.name].push(l.options[w].value)}else if(i&&l.type==="hidden")a[l.name]=l.value;else if(i&&(l.type==="number"||l.type==="range")){const w=Number(l.value);a[l.name]=l.value===""||isNaN(w)?null:w}else a[l.name]=l.value}return a}function Ue(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Ve(e,t){const i=e.elements,o=[],a={};for(let c=0;c<i.length;c++){const s=i[c];s.name&&s.type==="checkbox"&&(a[s.name]=(a[s.name]||0)+1)}for(let c=0;c<i.length;c++){const s=i[c];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const d=s.getAttribute("data-ln-fill-as")||s.name;if(!d||!(d in t))continue;const l=t[d];if(s.type==="checkbox"){if(Array.isArray(l))s.checked=l.indexOf(s.value)!==-1;else if(a[s.name]>1){const w=String(l).split(",").map(function(b){return b.trim()});s.checked=w.indexOf(s.value)!==-1}else s.checked=Ue(l);o.push(s)}else if(s.type==="radio")s.checked=s.value===String(l),o.push(s);else if(s.type==="select-multiple"){if(Array.isArray(l))for(let w=0;w<s.options.length;w++)s.options[w].selected=l.indexOf(s.options[w].value)!==-1;o.push(s)}else s.value=l,s.tagName==="SELECT"&&l!=null&&s.setAttribute("data-ln-value",l),o.push(s)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Ve,window.lnCore.serializeForm=Ke,window.lnCore.resolveFormMethod=$e);const ye={};function Ge(e,t){ye[e]=t}function He(e){return ye[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ge,window.lnCore.getDataMapper=He);function We(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,J(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const pe={};function Qe(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];pe[i]=t}function Je(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return pe[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Qe,window.lnCore.getLocaleFallback=Je,window.lnCore.ensureLocaleObserver=We);const ie={};function Ze(e,t){ie[e]||(ie[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=ie[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function me(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let s=0;s<i.length;s++){const d=i[s],l=d.getAttribute("data-ln-field");t[l]!=null&&(d.textContent=t[l])}const o=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<o.length;s++){const d=o[s],l=d.getAttribute("data-ln-attr").split(",");for(let w=0;w<l.length;w++){const b=l[w].trim().split(":");if(b.length!==2)continue;const _=b[0].trim(),x=b[1].trim();t[x]!=null&&d.setAttribute(_,t[x])}}const a=e.querySelectorAll("[data-ln-show]");for(let s=0;s<a.length;s++){const d=a[s],l=d.getAttribute("data-ln-show");l in t&&d.classList.toggle("hidden",!t[l])}const c=e.querySelectorAll("[data-ln-class]");for(let s=0;s<c.length;s++){const d=c[s],l=d.getAttribute("data-ln-class").split(",");for(let w=0;w<l.length;w++){const b=l[w].trim().split(":");if(b.length!==2)continue;const _=b[0].trim(),x=b[1].trim();x in t&&d.classList.toggle(_,!!t[x])}}return e}function Xe(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 o=0;o<i.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[o],t??null),i[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)me(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 ge(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const c=i.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,d){return t[d]!==void 0?t[d]:""}))}const o=function(c,s){return t[s]!==void 0?t[s]:""},a=Array.from(e.querySelectorAll("*"));e.nodeType===1&&a.push(e);for(let c=0;c<a.length;c++){const s=a[c],d=s.attributes;for(let l=0;l<d.length;l++){const w=d[l];w.value.indexOf("{{")!==-1&&s.setAttribute(w.name,w.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Ye(e,t,i,o,a,c){const s={};for(let l=0;l<e.children.length;l++){const w=e.children[l],b=w.getAttribute("data-ln-render-key");b&&(s[b]=w)}const d=document.createDocumentFragment();for(let l=0;l<t.length;l++){const w=t[l],b=String(o(w));let _=s[b];if(_)a(_,w,l);else{const x=Ze(i,c);if(!x||(ge(x,w),_=x.firstElementChild,!_))continue;_.setAttribute("data-ln-render-key",b),a(_,w,l)}d.appendChild(_)}e.textContent="",e.appendChild(d)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=ge,window.lnCore.fill=me,window.lnCore.lnFill=Xe,window.lnCore.renderList=Ye);function ae(e,t,i){const o=e.getAttribute(t);return o===null?i:o}function Z(e,t,i){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?i:o}function se(e,t,i=!1){const o=e.getAttribute(t);if(o===null)return!!i;const a=o.trim().toLowerCase();return!(a==="false"||a==="0")}function le(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const ce=new Map;function be(e,t){const i=(e?e.join("|"):"")+"::"+t;if(ce.has(i))return ce.get(i);const o=new Set(e||[]),a=function(c,s){const d=c.getAttribute(s);return d!==null&&o.has(d)?d:t};return ce.set(i,a),a}function _e(e,t,i){const o=parseFloat(e.getAttribute(t));return isNaN(o)?i:o}function Ce(e,t,i){const o=e.getAttribute(t);if(!o)return i;try{return JSON.parse(o)}catch{return i}}function Se(e,t,i,o,a){if(!e||t===null)return!0;const c=o||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const d=l=>{a?console.warn(l,a):console.warn(l)};if(s==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(d(`[${c}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const l=e.values||[];return l.includes(t)?!0:(d(`[${c}] Invalid value "${t}" for attribute "${i}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return d(`[${c}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(d(`[${c}] Value ${l} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(d(`[${c}] Value ${l} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(d(`[${c}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(l){return d(`[${c}] Invalid JSON for attribute "${i}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function ve(e,t,i){for(const o in i){const[a,c,s]=i[o];Object.defineProperty(e,o,{get:function(){return a(t,c,s)},enumerable:!0,configurable:!0})}return e}function Ae(e){const t={};for(const i in e){const o=e[i];if(!o||!o.prop)continue;let a=o.read;if(!a&&o.type)switch(o.type){case"enum":a=be(o.values,o.fallback);break;case"integer":a=Z;break;case"float":a=_e;break;case"boolean":a=se;break;case"list":a=le;break;case"json":a=Ce;break;case"string":default:a=ae;break}a||(a=ae),t[o.prop]=[a,i,o.fallback]}return t}function et(e){const t={};for(const i in e){const o=e[i];o&&o.effect&&(t[i]=o.effect)}return Object.keys(t).length?t:null}function tt(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=ve,window.lnCore.attrSpec=Ae,window.lnCore.attrStr=ae,window.lnCore.attrInt=Z,window.lnCore.attrBool=se,window.lnCore.attrList=le,window.lnCore.attrEnum=be,window.lnCore.attrFloat=_e,window.lnCore.attrJson=Ce);function V(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(i){console.error("["+t.attribute+"] init failed",e,i)}}}function xe(e,t,i,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:i,ComponentFn:o};if(e.matches&&e.matches(c)&&V(e,s),e.querySelectorAll){const d=e.querySelectorAll(c);for(let l=0;l<d.length;l++)V(d[l],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function nt(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function rt(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 ke(){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 ot(e){const t=ke(),i=e.observed||[];for(let o=0;o<i.length;o++){const a=i[o];t.byAttr.has(a)||t.byAttr.set(a,[]),t.byAttr.get(a).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const a=t.byDeclaredAttr.get(o);a.some(c=>c.componentTag===e.componentTag)||a.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=tt(e);if(o===null)t.reactiveWildcard.push(e);else for(const a of o)t.byReactive.has(a)||t.byReactive.set(a,[]),t.byReactive.get(a).push(e)}e.persist&&t.persist.push(e)}function Ee(e,t,i,o){for(let a=0;a<e.length;a++){const c=e[a];if(!t[c.attribute])continue;const s=c.effects&&c.effects[i];s?s(t,i,o):c.onAttrChange&&(!c.declared||c.declared.has(i))&&c.onAttrChange(t,i,o)}}function it(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,o=ke(),a=o.byAttr.get(t),c=we()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!i&&!a&&!c)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(c&&oe(s)){const d=o.byDeclaredAttr.get(t),l=s.getAttribute(t);for(let w=0;w<d.length;w++)Se(d[w].spec,l,t,d[w].componentTag,s)}if(window.lnCore._debugSink&&(i||a)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),i){const d=o.byReactive.get(t);d&&Ee(d,s,t,e.oldValue),o.reactiveWildcard.length&&Ee(o.reactiveWildcard,s,t,e.oldValue)}if(a)for(let d=0;d<a.length;d++){const l=a[d];if(l.handler){l.handler(s,t,e.oldValue);continue}l.onAttributeChange&&s[l.attribute]?l.onAttributeChange(s,t):(xe(s,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(s))}}}function at(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,J(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{it(t[i])}catch(o){console.error("[ln-core] mutation handler failed",t[i].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ue(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function de(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function st(e){const t=ue();if(!t.length)return;const i=e.target;if(i){const o=i.nodeType===1?i:i.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let o=0;o<t.length;o++){const a=t[o];if(a.onSubtreeChange&&a.query){const c=a.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;s&&a.onSubtreeChange(s,e)}}for(let o=0;o<e.addedNodes.length;o++){const a=e.addedNodes[o];if(a.nodeType===1){const c=!!(a.firstElementChild||a.children&&a.children.length);for(let s=0;s<t.length;s++){const d=t[s];if(d.selector&&d.attribute&&d.ComponentFn){if(!c)a.matches&&a.matches(d.query)&&V(a,d);else if(a.matches&&a.matches(d.query)&&V(a,d),a.querySelectorAll){const l=a.querySelectorAll(d.query);for(let w=0;w<l.length;w++)V(l[w],d)}}d.onInit&&d.onInit(a)}}}for(let o=0;o<e.removedNodes.length;o++){const a=e.removedNodes[o];if(a.nodeType===1){const c=!!(a.firstElementChild||a.children&&a.children.length);for(let s=0;s<t.length;s++){const d=t[s],l=d.query;if(l){if(!c)a.matches&&a.matches(l)&&de(a,d);else if(a.matches&&a.matches(l)&&de(a,d),a.querySelectorAll){const w=a.querySelectorAll(l);for(let b=0;b<w.length;b++)de(w[b],d)}}}}}}function Ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,J(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const o=t[i];if(o.type==="childList")try{st(o)}catch(a){console.error("[ln-core] lifecycle handler failed",o.target,a)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function lt(e){ue().push(e),Ie()}function qe(e,t,i,o,a={}){const c=a.extraAttributes||[],s=a.onAttributeChange||null,d=a.onSubtreeChange||null,l=a.onInit||null,w=a.onAttrChange||null,b=a.effects||null,_=a.attributes||null,x=_?et(_):b,F=_?new Set(Object.keys(_)):null,P=a.persist||null;function m(k){const E=k||document.body;if(xe(E,e,t,i),_&&we())for(const j in _){const X=_[j],H=Array.from(E.querySelectorAll("["+j+"]"));E.matches&&E.matches("["+j+"]")&&H.push(E);for(let K=0;K<H.length;K++){const B=H[K];oe(B)&&Se(X,B.getAttribute(j),j,o,B)}}l&&l(E)}const S=[];if(e.indexOf("[")!==-1){const k=/\[([\w-]+)/g;let E;for(;(E=k.exec(e))!==null;)S.push(E[1])}else S.push(e);ot({selector:e,attribute:t,componentTag:o,attributes:_,ComponentFn:i,onInit:l,observed:S.concat(c),onAttributeChange:s,onAttrChange:w,effects:x,declared:F,persist:P}),at();const q=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,D=a.subtreeQuery||(q?e:"["+e+"]");ue().push({selector:e,attribute:t,ComponentFn:i,onInit:l,onSubtreeChange:d,query:D}),Ie(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=qe,window.lnCore.observeLifecycle=lt);function A(){nt()>0?rt(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",A):A(),m}function ct(e){let t=!1;for(let i=0;i<e.length;i++){const o=e[i];if(!(o===""||o==null)&&(t=!0,!Number.isFinite(Number(o))))return"string"}return t?"number":"string"}function ut(e,t,i,o){if(i==="number"){const s=parseFloat(e),d=parseFloat(t);return(isNaN(s)?0:s)-(isNaN(d)?0:d)}const a=e!=null?String(e):"",c=t!=null?String(t):"";return o?o.compare(a,c):a<c?-1:a>c?1:0}function De(e){return(e||"").replace(/^#/,"")}function fe(e){const t=e===void 0?location.hash:e,i={},o=De(t);if(!o)return i;const a=o.split("&");for(let c=0;c<a.length;c++){const s=a[c];if(!s)continue;const d=s.indexOf(":"),l=d>-1?s.slice(0,d):s,w=d>-1?s.slice(d+1):"";if(l)try{i[l]=decodeURIComponent(w)}catch{i[l]=w}}return i}function dt(e){if(!e)return null;const t=fe();return e in t?t[e]:null}function ft(e,t){if(!e)return;const i=fe();t==null?delete i[e]:i[e]=String(t);const a=Object.keys(i).map(function(c){const s=i[c];return s===""?c:c+":"+encodeURIComponent(s)}).join("&");De(location.hash)!==a&&(location.hash=a)}function ht(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function wt(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 o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function yt(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function pt(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 mt(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function gt(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),o=e.slice(t+1),a=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:i,values:a}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=fe,window.lnCore.hashGet=dt,window.lnCore.hashSet=ft,window.lnCore.hashLinkClick=ht,window.lnCore.resolveHashNamespace=wt,window.lnCore.hashSortEncode=yt,window.lnCore.hashSortDecode=pt,window.lnCore.hashFilterEncode=mt,window.lnCore.hashFilterDecode=gt);let G=null;const bt="ln-ashlar:storage-salt:v1",Le=32768;function Ne(e){let t="";const i=e.byteLength;for(let o=0;o<i;o+=Le)t+=String.fromCharCode.apply(null,e.subarray(o,Math.min(o+Le,i)));return btoa(t)}function Te(e){const t=atob(e),i=t.length,o=new Uint8Array(i);for(let a=0;a<i;a++)o[a]=t.charCodeAt(a);return o}function ze(e,t){let i=G,o={};return typeof CryptoKey<"u"&&e instanceof CryptoKey?i=e:e&&typeof e=="object"&&(o=e,typeof CryptoKey<"u"&&o.key instanceof CryptoKey&&(i=o.key)),{key:i,options:o}}async function _t(e,t={}){if(!e)throw new Error("[ln-crypto] Key derivation failed: Secret string is required");const i=t.method||"pbkdf2",o=new TextEncoder;if(i==="sha256"){const l=await crypto.subtle.digest("SHA-256",o.encode(e));return crypto.subtle.importKey("raw",l,{name:"AES-GCM"},!1,["encrypt","decrypt"])}const a=t.salt||bt,c=typeof a=="string"?o.encode(a):a,s=t.iterations||1e5,d=await crypto.subtle.importKey("raw",o.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:c,iterations:s,hash:"SHA-256"},d,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Oe(e,t={}){if(!e){G=null;return}try{const i=t.method||"sha256";G=await _t(e,{...t,method:i})}catch(i){throw console.error("[ln-core/crypto] Key derivation failed:",i),G=null,i}}function M(){return G}async function Ct(e,t,i){const{key:o}=ze(t);if(e==null)return e;if(!o)throw new Error("[ln-crypto] Encryption failed: No active cryptographic key provided");try{const a=new TextEncoder,c=crypto.getRandomValues(new Uint8Array(12)),s=typeof e=="string"?e:JSON.stringify(e),d=await crypto.subtle.encrypt({name:"AES-GCM",iv:c},o,a.encode(s));return{v:1,alg:"AES-GCM",encrypted:!0,iv:Ne(c),data:Ne(new Uint8Array(d))}}catch(a){throw console.error("[ln-core/crypto] Encryption failed:",a),new Error("[ln-crypto] Encryption failed: "+(a&&a.message?a.message:String(a)))}}async function St(e,t,i){const{key:o,options:a}=ze(t),c=a.silent===!0;if(!e||!e.encrypted)return e;if(!o){if(c)return{...e,decryptionError:!0};throw new Error("[ln-crypto] Decryption failed: No active cryptographic key provided")}if(!e.iv||!e.data){if(c)return{...e,decryptionError:!0};throw new Error("[ln-crypto] Decryption failed: Malformed envelope (missing iv or data)")}try{const s=new TextDecoder,d=Te(e.iv),l=Te(e.data),w=await crypto.subtle.decrypt({name:"AES-GCM",iv:d},o,l),b=s.decode(w);try{return JSON.parse(b)}catch{return b}}catch(s){if(c)return{...e,decryptionError:!0};throw console.error("[ln-core/crypto] Decryption failed. Key may be incorrect or payload tampered:",s),new Error("[ln-crypto] Decryption failed. Key may be incorrect or payload tampered: "+(s&&s.message?s.message:String(s)))}}function vt(){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=vt);function At(e){return String(e||"").trim().toLowerCase()}function xt(e){const t=At(e);return t?t.split(/\s+/).filter(Boolean):[]}function kt(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const i=String(e).toLowerCase();for(let o=0;o<t.length;o++)if(i.indexOf(t[o])===-1)return!1;return!0}function Et(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const i=String(e).trim().toLowerCase();for(let o=0;o<t.length;o++)if(String(t[o]).trim().toLowerCase()===i)return!0;return!1}function It(e={}){let t=e.windowSize>0?e.windowSize:1e3,i=e.pageSize>0?e.pageSize:200,o=e.fetchDebounce!=null?e.fetchDebounce:120;const a=typeof e.requestPage=="function"?e.requestPage:()=>{},c=new Map,s=new Set;let d=0,l=0,w=0,b=!1,_=null;function x(m,S){c.delete(m),c.set(m,S)}function F(){if(c.size<=t)return[];const m=[];for(;c.size>t;){const q=c.keys().next().value;m.push(c.get(q)),c.delete(q)}const S=new Set(c.values());return m.filter(q=>!S.has(q))}function P(m,S){s.add(m),clearTimeout(_),_=setTimeout(()=>a(m,i,S),o)}return{get logicalTotal(){return d},set logicalTotal(m){d=m},get grandTotal(){return l},set grandTotal(m){l=m},get queryGen(){return w},set queryGen(m){w=m},get size(){return c.size},get hasLoaded(){return b},getId:m=>{if(!c.has(m))return;const S=c.get(m);return x(m,S),S},ensure:(m,S,q)=>{if(!b&&!s.has(0))return P(0,q);if(d<=0)return;const D=Math.max(0,m),A=Math.min(d,S);for(let k=D;k<A;k++)if(!c.has(k)){const E=Math.floor(k/i)*i;if(!s.has(E))return P(E,q)}},ingest:(m,S,q,D,A)=>{if(A!=null&&A!==w)return[];b=!0,q!=null&&(l=q),D!=null&&(d=D);for(let k=0;k<S.length;k++)x(m+k,S[k]);return s.delete(m),F()},reset:function(){w++,this.clear()},clear:()=>{b=!1,c.clear(),s.clear(),clearTimeout(_)},configure:(m={})=>{let S=[];return m.windowSize>0&&m.windowSize!==t&&(t=m.windowSize,S=F()),m.pageSize>0&&(i=m.pageSize),m.fetchDebounce>=0&&(o=m.fetchDebounce),S}}}function qt(e,t,i){if(!Array.isArray(e)||!t||!t.field)return e;const{field:o,direction:a}=t,c=a==="desc",s=e.map(l=>l?l[o]:void 0),d=ct(s);return[...e].sort((l,w)=>{const b=l?l[o]:void 0,_=w?w[o]:void 0,x=ut(b,_,d,i);return c?-x:x})}function Re(e,t){if(!Array.isArray(e)||!t||typeof t!="object")return e;const i=Object.keys(t).filter(o=>Array.isArray(t[o])&&t[o].length>0);return i.length?e.filter(o=>o?i.every(a=>Et(o[a],t[a])):!1):e}function Dt(e,t,i){if(!Array.isArray(e)||!t||!i||!i.length)return e;const o=xt(t);return o.length?e.filter(a=>a?o.every(c=>i.some(s=>{const d=a[s];return d!=null&&kt(String(d),[c])})):!1):e}function Lt(e,t,i){if(!Array.isArray(e)||!e.length)return 0;if(i==="count")return e.length;const o=e.map(c=>c&&c[t]!=null?parseFloat(c[t]):NaN).filter(c=>Number.isFinite(c)),a=o.reduce((c,s)=>c+s,0);return i==="sum"?a:i==="avg"&&o.length?a/o.length:0}function Nt(e,t={},i=[],o){if(!Array.isArray(e))return{records:[],total:0,filtered:0};const a=e.length;let c=e;t.filters&&(c=Re(c,t.filters)),t.search&&(c=Dt(c,t.search,i));const s=c.length;if(t.sort&&(c=qt(c,t.sort,o)),t.offset||t.limit){const d=t.offset||0,l=t.limit||c.length;c=c.slice(d,d+l)}return{records:c,total:a,filtered:s}}function Tt(e,t){return!Array.isArray(e)||!t||typeof t!="object"?e:e.map(i=>{if(!i)return null;const o={...i};for(const[a,c]of Object.entries(t))if(typeof c=="function")try{o[a]=c(i)}catch{o[a]=void 0}return o})}function zt(e,t,i,o="_meta"){if(!Array.isArray(e)||!e.includes(o))return!0;for(const a of Object.keys(t||{})){if(!e.includes(a))return!0;const c=t[a]&&t[a].indexes||[],s=i&&i[a]||[];if(c.some(d=>!s.includes(d)))return!0}return!1}function Ot(e){return{ok:!1,error:e&&e.message?e.message:String(e)}}(function(){const e="data-ln-data-store",t="lnDataStore";if(window[t]!==void 0)return;function i(n,r,u){const f=n.getAttribute(r);if(f==="never"||f==="-1")return-1;const h=parseInt(f,10);return isNaN(h)?u:h}const o={"data-ln-data-store":{type:"marker",effect:je,description:"Identifies the element as a data-store definition container"},"data-ln-data-store-indexes":{type:"list",effect:je,description:"Comma-separated index field names for the IndexedDB store"},"data-ln-data-store-stale":{prop:"_staleThreshold",type:"integer",read:i,fallback:300,description:"Cache staleness threshold in seconds, or -1/never"},"data-ln-data-store-search-fields":{prop:"_searchFields",type:"list",read:le,description:"Record fields to index for client-side search"},"data-ln-data-store-no-local-query":{prop:"noLocalQuery",type:"boolean",read:se,description:"Bypasses local IndexedDB query resolution, forcing remote fetching"},"data-ln-data-store-window":{prop:"_windowSize",type:"integer",read:Z,fallback:1e3,min:10,effect:tn,description:"Virtual scrolling cache window size in records"},"data-ln-data-store-window-page":{prop:"_windowPageSize",type:"integer",read:Z,fallback:200,min:5,effect:nn,description:"Virtual scrolling slice page size"},"data-ln-data-store-frozen":{type:"marker",description:"Applied at runtime to indicate store schema is locked in IndexedDB"}},a=Ae(o),c="ln_app_cache",s="_meta",d="1.0";let l=null,w=null;const b={};function _(n){n&&n.name==="QuotaExceededError"&&v(document,"ln-data-store:quota-exceeded",{error:n})}function x(){const n={};for(const r of document.querySelectorAll(`[${e}]`)){const u=r.id;if(u){const f=r.getAttribute("data-ln-data-store-indexes")||"";n[u]={indexes:f.split(",").map(h=>h.trim()).filter(Boolean)}}}return n}function F(){return w||(w=new Promise(n=>{if(typeof indexedDB>"u")return console.warn("[ln-data-store] IndexedDB is not available in this environment"),n(null);const r=x(),u=Object.keys(r),f=indexedDB.open(c);f.onerror=()=>{console.warn("[ln-data-store] IndexedDB open failed"),n(null)},f.onsuccess=h=>{const y=h.target.result,p=Array.from(y.objectStoreNames),g=u.filter(N=>p.includes(N));let C={};if(g.length>0){const N=y.transaction(g,"readonly");for(const T of g)C[T]=Array.from(N.objectStore(T).indexNames)}if(!zt(p,r,C,s))return P(y),l=y,n(y);const $=y.version;y.close();const R=indexedDB.open(c,$+1);let z=!1,O=null;R.onblocked=()=>{console.warn("[ln-data-store] Database upgrade blocked — waiting for other tabs to close connection"),v(document,"ln-data-store:blocked",{db:c}),O||(O=setTimeout(()=>{z||(console.warn("[ln-data-store] Database upgrade timed out while blocked"),z=!0,w=null,n(null))},5e3))},R.onerror=()=>{z||(O&&clearTimeout(O),z=!0,w=null,console.warn("[ln-data-store] Database upgrade failed"),n(null))},R.onupgradeneeded=N=>{const T=N.target.result,rn=N.target.transaction;T.objectStoreNames.contains(s)||T.createObjectStore(s,{keyPath:"key"});for(const Q of u)if(T.objectStoreNames.contains(Q)){const re=rn.objectStore(Q);for(const U of r[Q].indexes)re.indexNames.contains(U)||re.createIndex(U,U,{unique:!1})}else{const re=T.createObjectStore(Q,{keyPath:"id"});for(const U of r[Q].indexes)re.createIndex(U,U,{unique:!1})}},R.onsuccess=N=>{if(z){N.target.result&&N.target.result.close();return}O&&clearTimeout(O),z=!0;const T=N.target.result;P(T),l=T,n(T)}}}),w)}function P(n){n.onversionchange=()=>{n.close(),l=null,w=null}}function m(){return l?Promise.resolve(l):(w=null,F())}async function S(n){if(!M()||!n)return n;const r={...n},u=r.id,f=await Ct(r);return!f||!f.encrypted?n:{...f,id:u}}async function q(n){return!n||!n.encrypted||!M()?n:St(n,{silent:!0})}const D=(n,r)=>m().then(u=>u?u.transaction(n,r).objectStore(n):null);function A(n){return new Promise((r,u)=>{n.onsuccess=()=>r(n.result),n.onerror=()=>{_(n.error),u(n.error)}})}const k=n=>D(n,"readonly").then(r=>r?A(r.getAll()):[]).then(r=>M()?Promise.all(r.map(u=>q(u))):r),E=(n,r)=>D(n,"readonly").then(u=>u?A(u.get(r)).then(f=>f!==void 0?f:typeof r=="string"&&r.trim()!==""&&!isNaN(Number(r))?A(u.get(Number(r))):typeof r=="number"?A(u.get(String(r))):null):null).then(u=>u?q(u):null),j=(n,r)=>m().then(u=>{if(!u)return[];const h=u.transaction(n,"readonly").objectStore(n),y=r.map(p=>A(h.get(p)).then(g=>g!==void 0?g:typeof p=="string"&&p.trim()!==""&&!isNaN(Number(p))?A(h.get(Number(p))):typeof p=="number"?A(h.get(String(p))):null));return Promise.all(y).then(p=>M()?Promise.all(p.map(g=>g?q(g):null)):p)}),X=(n,r)=>(M()?S(r):Promise.resolve(r)).then(f=>D(n,"readwrite").then(h=>h?A(h.put(f)):null)),H=(n,r)=>D(n,"readwrite").then(u=>u?A(u.delete(r)).then(()=>{if(typeof r=="string"&&r.trim()!==""&&!isNaN(Number(r)))return A(u.delete(Number(r)));if(typeof r=="number")return A(u.delete(String(r)))}):null),K=n=>D(n,"readwrite").then(r=>r?A(r.clear()):null),B=n=>D(n,"readonly").then(r=>r?A(r.count()):0),Rt=n=>D(s,"readonly").then(r=>r?A(r.get(n)):null),Y=(n,r)=>D(s,"readwrite").then(u=>{if(u)return r.key=n,A(u.put(r))});function L(n){return this.dom=n,this._name=n.id,this._name||console.warn("[ln-data-store] missing id — the store cannot be addressed",n),ve(this,n,a),this._handlers=null,this.isLoaded=!1,this.canServe=!1,this.isInitialized=!1,this.initializationError=null,this.hasCache=!1,this.isSyncing=!1,this.lastSyncedAt=null,this.query={filters:{},search:"",sort:null},n.hasAttribute("data-ln-data-store-window")?this._windowIndex=It({windowSize:this._windowSize,pageSize:this._windowPageSize,requestPage:(r,u,f)=>{v(this.dom,"ln-data-store:request-page",{store:this._name,offset:r,limit:u,query:f,queryGen:this._windowIndex.queryGen})}}):this._windowIndex=null,this.windowed=this._windowIndex!==null,this.totalCount=0,this.presenters=null,this._mutationChain=Promise.resolve(),b[this._name]=this,Mt(this),this.ready=Kt(this),this}function Mt(n){n._handlers={create:r=>ee(n,"create",r.detail,()=>Bt(n,r.detail)),update:r=>ee(n,"update",r.detail,()=>Ft(n,r.detail)),delete:r=>ee(n,"delete",r.detail,()=>Pt(n,r.detail)),"bulk-delete":r=>ee(n,"bulk-delete",r.detail,()=>jt(n,r.detail)),"sync-failed":r=>{n.isSyncing=!1,v(n.dom,"ln-data-store:sync-error",{store:n._name,error:r.detail&&r.detail.error,status:r.detail&&r.detail.status})}};for(const[r,u]of Object.entries(n._handlers))n.dom.addEventListener(`ln-data-store:request-${r}`,u);n._queryHandlers={"ln-search:change":r=>{r.preventDefault();const u=r.detail&&r.detail.term!=null?r.detail.term:"";u!==n.query.search&&(n.query.search=u,he(n))},"ln-filter:change":r=>{r.preventDefault();const u=r.detail&&r.detail.key;if(!u)return;const f=(r.detail.values||[]).slice(),h=n.query.filters[u];(h?h.length===f.length&&h.every((p,g)=>p===f[g]):!f.length)||(f.length?n.query.filters[u]=f:delete n.query.filters[u],he(n))},"ln-sort:change":r=>{r.preventDefault();const u=r.detail&&r.detail.field,f=r.detail&&r.detail.direction,h=f&&f!=="none"?{field:u,direction:f}:null,y=n.query.sort;!y&&!h||y&&h&&y.field===h.field&&y.direction===h.direction||(n.query.sort=h,he(n))}};for(const[r,u]of Object.entries(n._queryHandlers))n.dom.addEventListener(r,u)}function ee(n,r,u,f){const h=u&&u.requestId;return n._mutationChain=n._mutationChain.then(()=>n.ready).then(()=>{if(n.initializationError)throw n.initializationError;return f()}).catch(y=>$t(n,r,h,y)),n._mutationChain}function te(n,r=0){return B(n._name).then(u=>{if(n._windowIndex||n.windowed){const f=n.totalCount!=null?n.totalCount:u;n.totalCount=Math.max(0,f+r)}else n.totalCount=u;return n.hasCache=!0,n.isLoaded=!0,n.canServe=!0,Y(n._name,{schema_version:d,last_synced_at:n.lastSyncedAt,has_cache:!0,record_count:n.totalCount})})}function Bt(n,{tempId:r,data:u={},requestId:f}={}){const h={...u,id:r};return X(n._name,h).then(()=>te(n,1)).then(()=>{v(n.dom,"ln-data-store:created",{store:n._name,record:h,tempId:r,requestId:f})})}function Ft(n,{id:r,data:u={},requestId:f}={}){return E(n._name,r).then(h=>{if(!h)throw new Error(`Record not found: ${r}`);const y=h.id,p={...h,...u,id:y},g=u.id,C=g!==void 0&&g!==y;return(C?Ut(n._name,y,{...p,id:g}):X(n._name,p)).then(()=>te(n,0)).then(()=>{v(n.dom,"ln-data-store:updated",{store:n._name,record:C?{...p,id:g}:p,previous:h,requestId:f})})})}function Pt(n,{id:r,requestId:u}={}){return E(n._name,r).then(f=>{if(!f){v(n.dom,"ln-data-store:deleted",{store:n._name,id:r,requestId:u,missing:!0});return}const h=f.id;return H(n._name,h).then(()=>te(n,-1)).then(()=>{v(n.dom,"ln-data-store:deleted",{store:n._name,id:h,requestId:u})})})}function jt(n,{ids:r=[],requestId:u}={}){return r.length?Promise.all(r.map(f=>E(n._name,f))).then(f=>{const h=f.filter(Boolean).map(y=>y.id);return ne(n._name,h).then(()=>te(n,-h.length)).then(()=>{v(n.dom,"ln-data-store:deleted",{store:n._name,ids:h,requestId:u})})}):(v(n.dom,"ln-data-store:deleted",{store:n._name,ids:[],requestId:u}),Promise.resolve())}function $t(n,r,u,f){console.error("[ln-data-store] "+r+" failed:",f),v(n.dom,"ln-data-store:mutation-error",{store:n._name,action:r,requestId:u,error:f})}function Kt(n){return F().then(r=>{if(!r)throw new Error("IndexedDB is unavailable");return Rt(n._name)}).then(r=>{if(n.initializationError=null,r&&r.schema_version===d)n.lastSyncedAt=r.last_synced_at||null,n.totalCount=r.record_count||0,n.hasCache=r.has_cache===!0||n.totalCount>0,n.hasCache&&(n.isLoaded=!0,n.canServe=!0,v(n.dom,"ln-data-store:ready",{store:n._name,count:n.totalCount,source:"cache"})),n.isInitialized=!0,v(n.dom,"ln-data-store:initialized",{store:n._name,hasCache:n.hasCache,lastSyncedAt:n.lastSyncedAt,count:n.totalCount});else{if(r&&r.schema_version!==d)return K(n._name).then(()=>Y(n._name,{schema_version:d,last_synced_at:null,has_cache:!1,record_count:0})).then(()=>{n.isInitialized=!0,n.hasCache=!1,v(n.dom,"ln-data-store:initialized",{store:n._name,hasCache:!1,lastSyncedAt:null,count:0})});n.isInitialized=!0,n.hasCache=!1,v(n.dom,"ln-data-store:initialized",{store:n._name,hasCache:!1,lastSyncedAt:null,count:0})}}).catch(r=>(n.isInitialized=!0,n.isLoaded=!1,n.canServe=!1,n.hasCache=!1,n.isSyncing=!1,n.initializationError=r,v(n.dom,"ln-data-store:initialization-error",{store:n._name,error:r}),{ok:!1,error:r}))}function Me(n){n.isSyncing=!0,v(n.dom,"ln-data-store:request-remote-sync",{since:n.lastSyncedAt})}function Be(n,r){return m().then(u=>u?(M()?Promise.all(r.map(h=>S(h))):Promise.resolve(r)).then(h=>new Promise((y,p)=>{const g=u.transaction(n,"readwrite"),C=g.objectStore(n);h.forEach(I=>C.put(I)),g.oncomplete=()=>y(),g.onerror=()=>{_(g.error),p(g.error)}})):void 0)}function ne(n,r){return m().then(u=>{if(u)return new Promise((f,h)=>{const y=u.transaction(n,"readwrite"),p=y.objectStore(n);r.forEach(g=>{p.delete(g),typeof g=="string"&&g.trim()!==""&&!isNaN(Number(g))?p.delete(Number(g)):typeof g=="number"&&p.delete(String(g))}),y.oncomplete=()=>f(),y.onerror=()=>h(y.error)})})}function Ut(n,r,u){return(M()?S(u):Promise.resolve(u)).then(h=>m().then(y=>{if(y)return new Promise((p,g)=>{const C=y.transaction(n,"readwrite"),I=C.objectStore(n);I.put(h),I.delete(r),C.oncomplete=()=>p(),C.onerror=()=>{_(C.error),g(C.error)}})}))}const Vt=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function Gt(n){return n?Object.keys(n).filter(r=>Array.isArray(n[r])&&n[r].length>0):[]}function Ht(n,r,u){return r.every(f=>u[f].map(String).includes(String(n[f])))}function Wt(n){return String(n||"").toLowerCase().split(/\s+/).filter(Boolean)}function Qt(n,r,u){return r.every(f=>u.some(h=>{const y=n[h];return y!=null&&String(y).toLowerCase().includes(f)}))}function Jt(n,r,u){return Lt(n,r,u)}function W(n,r){return Tt(r,n.presenters&&n.presenters.computed)}function Zt(n){return!n.sort&&!M()}function Xt(n,r,u){const f=Gt(r.filters),h=r.search?Wt(r.search):[],y=n._searchFields,p=h.length>0&&y&&y.length>0;return D(n._name,"readonly").then(g=>g?new Promise((C,I)=>{const $=[],R=g.openCursor();R.onsuccess=()=>{const z=R.result;if(!z||$.length>=u){C($);return}const O=z.value;(!f.length||Ht(O,f,r.filters))&&(!p||Qt(O,h,y))&&$.push(O),z.continue()},R.onerror=()=>I(R.error)}):[])}function Fe(n,r,u){return Nt(r,u,n._searchFields,Vt)}function Pe(n,r,u){const f=[];for(let y=r;y<r+u;y++){const p=n._windowIndex.getId(y);f.push(p)}const h=Array.from(new Set(f.filter(y=>y!==void 0)));return j(n._name,h).then(y=>{const p=new Map;for(let C=0;C<y.length;C++){const I=y[C];I&&p.set(String(I.id),I)}const g=[];for(let C=0;C<f.length;C++){const I=f[C];if(I===void 0)g.push(null);else{const $=p.get(String(I));g.push($||null)}}return{data:W(n,g),total:n._windowIndex.grandTotal,filtered:n._windowIndex.logicalTotal,offset:r,queryGen:n._windowIndex.queryGen}})}L.prototype.getAll=function(n={}){const r=this;if(r._windowIndex){const u=n.offset||0,f=n.limit||200;if(r._windowIndex.ensure(u,u+f,n),!r._windowIndex.hasLoaded&&!r.noLocalQuery){const h=u+f,y=p=>p.length?{data:W(r,p),offset:u,queryGen:r._windowIndex.queryGen,provisional:!0}:Pe(r,u,f);return Zt(n)?Xt(r,n,h).then(p=>y(p.slice(u,h))):k(r._name).then(p=>y(Fe(r,p,n).records))}return Pe(r,u,f)}return k(r._name).then(u=>{const f=Fe(r,u,n);return{data:W(r,f.records),total:f.total,filtered:f.filtered}})},L.prototype.getById=function(n){return E(this._name,n).then(r=>r?W(this,[r])[0]:null)},L.prototype.count=function(n){return n&&Object.keys(n).length>0?k(this._name).then(u=>Re(u,n).length):this.windowed&&this.totalCount!=null?Promise.resolve(this.totalCount):B(this._name)},L.prototype.aggregate=function(n,r){return k(this._name).then(u=>Jt(u,n,r))},L.prototype.setPresenters=function(n){this.presenters=n},L.prototype.applySync=function(n,r,u,f){f=f||{};const h=this;if(h._windowIndex&&f.queryGen!=null&&f.queryGen!==h._windowIndex.queryGen)return Promise.resolve({ok:!0,stale:!0});let y=m().then(p=>{if(!p)throw new Error("IndexedDB unavailable")});return n.length>0&&(y=y.then(()=>Be(h._name,n))),r.length>0&&(y=y.then(()=>ne(h._name,r))),y.then(()=>{if(h._windowIndex&&(f.offset!=null||f.total!=null)){const p=f.offset!=null?f.offset:0,g=n.map(I=>I.id),C=h._windowIndex.ingest(p,g,f.total,f.filtered,f.queryGen);if(C&&C.length)return ne(h._name,C)}}).then(()=>B(h._name)).then(p=>(h.totalCount=f.total!==void 0?f.total:p,h.hasCache=!0,Y(h._name,{schema_version:d,last_synced_at:u,has_cache:!0,record_count:h.totalCount}))).then(()=>{const p=!h.isLoaded;return h.isLoaded=!0,h.canServe=!0,h.isSyncing=!1,h.lastSyncedAt=u,p?(v(h.dom,"ln-data-store:loaded",{store:h._name,count:h.totalCount,meta:f}),v(h.dom,"ln-data-store:ready",{store:h._name,count:h.totalCount,source:"server",meta:f})):v(h.dom,"ln-data-store:synced",{store:h._name,added:n.length,deleted:r.length,changed:!0,meta:f}),{ok:!0}}).catch(p=>{h.isSyncing=!1;const g=p&&p.message?p.message:String(p);return console.error("[ln-data-store] applySync failed:",p),v(h.dom,"ln-data-store:sync-error",{store:h._name,error:g}),Ot(p)})},L.prototype.applyQuery=function(n,r){r=r||{};const u=this;let f=Promise.resolve();return n.length>0&&(f=f.then(()=>Be(u._name,n))),f.then(()=>B(u._name)).then(h=>(u.totalCount=r.total!==void 0?r.total:h,n.length>0&&(u.canServe=!0),W(u,n))).catch(h=>(console.error("[ln-data-store] applyQuery failed:",h),[]))},L.prototype.forceSync=function(){this.isSyncing||Me(this)},L.prototype.fullReload=function(){const n=this;return K(n._name).then(()=>Y(n._name,{schema_version:d,last_synced_at:null,has_cache:!1,record_count:0})).then(()=>{n.isLoaded=!1,n.hasCache=!1,n.lastSyncedAt=null,n.totalCount=0,Me(n)})},L.prototype.destroy=function(){if(this._windowIndex&&(this._windowIndex.clear(),this._windowIndex=null,this.windowed=!1),this._handlers){for(const[n,r]of Object.entries(this._handlers))this.dom.removeEventListener(`ln-data-store:request-${n}`,r);this._handlers=null}if(this._queryHandlers){for(const[n,r]of Object.entries(this._queryHandlers))this.dom.removeEventListener(n,r);this._queryHandlers=null}delete b[this._name],delete this.dom[t]};function Yt(){return m().then(n=>{if(!n)return;const r=Array.from(n.objectStoreNames);return new Promise((u,f)=>{const h=n.transaction(r,"readwrite");r.forEach(y=>h.objectStore(y).clear()),h.oncomplete=()=>u(),h.onerror=()=>f(h.error)})}).then(()=>{Object.values(b).forEach(n=>{n.isLoaded=!1,n.canServe=!1,n.isInitialized=!1,n.initializationError=null,n.hasCache=!1,n.isSyncing=!1,n.lastSyncedAt=null,n.totalCount=0})})}function he(n){n._windowIndex&&n._windowIndex.reset(),v(n.dom,"ln-data-store:query-changed",{store:n._name,query:{filters:Object.assign({},n.query.filters),search:n.query.search,sort:n.query.sort?Object.assign({},n.query.sort):null}})}const en="data-ln-data-store-frozen";function je(n,r){n.setAttribute(en,r)}function tn(n){const r=n[t];if(!r._windowIndex)return;const u=r._windowIndex.configure({windowSize:r._windowSize});u.length&&ne(r._name,u).catch(f=>{console.error("[ln-data-store] window shrink eviction failed:",f)})}function nn(n){const r=n[t];r._windowIndex&&r._windowIndex.configure({pageSize:r._windowPageSize})}qe(e,t,L,"ln-data-store",{attributes:o}),window[t].clearAll=Yt,window[t].init=window[t],window[t].setStorageKey=Oe,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.setStorageKey=Oe)})()})();
1
+ (function(){"use strict";function pe(){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 oe(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 s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){i=t[s];break}if(!oe(i))return}e.apply(console,t)}}function v(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function Z(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){Z(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Ue(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Ve(e,t){const o=!!(t&&t.typed),i=t&&t.exclude,s={},l=e.elements,c={};if(o)for(let d=0;d<l.length;d++){const a=l[d];a.name&&a.type==="checkbox"&&!a.disabled&&(c[a.name]=(c[a.name]||0)+1)}for(let d=0;d<l.length;d++){const a=l[d];if(!(!a.name||a.disabled||a.type==="file"||a.type==="submit"||a.type==="button")&&!(i&&a.matches&&a.matches(i)))if(a.type==="checkbox")o&&c[a.name]===1?s[a.name]=a.checked:(s[a.name]||(s[a.name]=[]),a.checked&&s[a.name].push(a.value));else if(a.type==="radio")a.checked&&(s[a.name]=a.value);else if(a.type==="select-multiple"){s[a.name]=[];for(let w=0;w<a.options.length;w++)a.options[w].selected&&s[a.name].push(a.options[w].value)}else if(o&&a.type==="hidden")s[a.name]=a.value;else if(o&&(a.type==="number"||a.type==="range")){const w=Number(a.value);s[a.name]=a.value===""||isNaN(w)?null:w}else s[a.name]=a.value}return s}function Ge(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function He(e,t){const o=e.elements,i=[],s={};for(let l=0;l<o.length;l++){const c=o[l];c.name&&c.type==="checkbox"&&(s[c.name]=(s[c.name]||0)+1)}for(let l=0;l<o.length;l++){const c=o[l];if(c.type==="file"||c.type==="submit"||c.type==="button")continue;const d=c.getAttribute("data-ln-fill-as")||c.name;if(!d||!(d in t))continue;const a=t[d];if(c.type==="checkbox"){if(Array.isArray(a))c.checked=a.indexOf(c.value)!==-1;else if(s[c.name]>1){const w=String(a).split(",").map(function(b){return b.trim()});c.checked=w.indexOf(c.value)!==-1}else c.checked=Ge(a);i.push(c)}else if(c.type==="radio")c.checked=c.value===String(a),i.push(c);else if(c.type==="select-multiple"){if(Array.isArray(a))for(let w=0;w<c.options.length;w++)c.options[w].selected=a.indexOf(c.options[w].value)!==-1;i.push(c)}else c.value=a,c.tagName==="SELECT"&&a!=null&&c.setAttribute("data-ln-value",a),i.push(c)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=He,window.lnCore.serializeForm=Ve,window.lnCore.resolveFormMethod=Ue);const ge={};function We(e,t){ge[e]=t}function Qe(e){return ge[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=We,window.lnCore.getDataMapper=Qe);function Je(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,Z(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const me={};function Ze(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];me[o]=t}function Xe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return me[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Ze,window.lnCore.getLocaleFallback=Xe,window.lnCore.ensureLocaleObserver=Je);const ie={};function Ye(e,t){ie[e]||(ie[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=ie[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function be(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let c=0;c<o.length;c++){const d=o[c],a=d.getAttribute("data-ln-field");t[a]!=null&&(d.textContent=t[a])}const i=e.querySelectorAll("[data-ln-attr]");for(let c=0;c<i.length;c++){const d=i[c],a=d.getAttribute("data-ln-attr").split(",");for(let w=0;w<a.length;w++){const b=a[w].trim().split(":");if(b.length!==2)continue;const _=b[0].trim(),x=b[1].trim();t[x]!=null&&d.setAttribute(_,t[x])}}const s=e.querySelectorAll("[data-ln-show]");for(let c=0;c<s.length;c++){const d=s[c],a=d.getAttribute("data-ln-show");a in t&&d.classList.toggle("hidden",!t[a])}const l=e.querySelectorAll("[data-ln-class]");for(let c=0;c<l.length;c++){const d=l[c],a=d.getAttribute("data-ln-class").split(",");for(let w=0;w<a.length;w++){const b=a[w].trim().split(":");if(b.length!==2)continue;const _=b[0].trim(),x=b[1].trim();x in t&&d.classList.toggle(_,!!t[x])}}return e}function et(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<o.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[i],t??null),o[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)be(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function _e(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const l=o.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(c,d){return t[d]!==void 0?t[d]:""}))}const i=function(l,c){return t[c]!==void 0?t[c]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let l=0;l<s.length;l++){const c=s[l],d=c.attributes;for(let a=0;a<d.length;a++){const w=d[a];w.value.indexOf("{{")!==-1&&c.setAttribute(w.name,w.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function tt(e,t,o,i,s,l){const c={};for(let a=0;a<e.children.length;a++){const w=e.children[a],b=w.getAttribute("data-ln-render-key");b&&(c[b]=w)}const d=document.createDocumentFragment();for(let a=0;a<t.length;a++){const w=t[a],b=String(i(w));let _=c[b];if(_)s(_,w,a);else{const x=Ye(o,l);if(!x||(_e(x,w),_=x.firstElementChild,!_))continue;_.setAttribute("data-ln-render-key",b),s(_,w,a)}d.appendChild(_)}e.textContent="",e.appendChild(d)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=_e,window.lnCore.fill=be,window.lnCore.lnFill=et,window.lnCore.renderList=tt);function ae(e,t,o){const i=e.getAttribute(t);return i===null?o:i}function X(e,t,o){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?o:i}function se(e,t,o=!1){const i=e.getAttribute(t);if(i===null)return!!o;const s=i.trim().toLowerCase();return!(s==="false"||s==="0")}function le(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const ce=new Map;function Ce(e,t){const o=(e?e.join("|"):"")+"::"+t;if(ce.has(o))return ce.get(o);const i=new Set(e||[]),s=function(l,c){const d=l.getAttribute(c);return d!==null&&i.has(d)?d:t};return ce.set(o,s),s}function Se(e,t,o){const i=parseFloat(e.getAttribute(t));return isNaN(i)?o:i}function ve(e,t,o){const i=e.getAttribute(t);if(!i)return o;try{return JSON.parse(i)}catch{return o}}function Ae(e,t,o,i,s){if(!e||t===null)return!0;const l=i||"ln-component",c=e.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||t===""&&e.fallback!==void 0)return!0;const d=a=>{s?console.warn(a,s):console.warn(a)};if(c==="boolean"){const a=t.trim().toLowerCase();return a!==""&&a!=="true"&&a!=="false"&&a!=="1"&&a!=="0"?(d(`[${l}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const a=e.values||[];return a.includes(t)?!0:(d(`[${l}] Invalid value "${t}" for attribute "${o}". Allowed: ${a.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(t))return d(`[${l}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const a=parseInt(t,10);return e.min!==void 0&&a<e.min?(d(`[${l}] Value ${a} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&a>e.max?(d(`[${l}] Value ${a} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(c==="float")return isNaN(Number(t))?(d(`[${l}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(t),!0}catch(a){return d(`[${l}] Invalid JSON for attribute "${o}": ${a.message}. Fallback: ${e.fallback}.`),!1}return!0}function xe(e,t,o){for(const i in o){const[s,l,c]=o[i];Object.defineProperty(e,i,{get:function(){return s(t,l,c)},enumerable:!0,configurable:!0})}return e}function ke(e){const t={};for(const o in e){const i=e[o];if(!i||!i.prop)continue;let s=i.read;if(!s&&i.type)switch(i.type){case"enum":s=Ce(i.values,i.fallback);break;case"integer":s=X;break;case"float":s=Se;break;case"boolean":s=se;break;case"list":s=le;break;case"json":s=ve;break;case"string":default:s=ae;break}s||(s=ae),t[i.prop]=[s,o,i.fallback]}return t}function nt(e){const t={};for(const o in e){const i=e[o];i&&i.effect&&(t[o]=i.effect)}return Object.keys(t).length?t:null}function rt(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=xe,window.lnCore.attrSpec=ke,window.lnCore.attrStr=ae,window.lnCore.attrInt=X,window.lnCore.attrBool=se,window.lnCore.attrList=le,window.lnCore.attrEnum=Ce,window.lnCore.attrFloat=Se,window.lnCore.attrJson=ve);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(o){console.error("["+t.attribute+"] init failed",e,o)}}}function Ee(e,t,o,i){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",c={selector:t,attribute:o,ComponentFn:i};if(e.matches&&e.matches(l)&&G(e,c),e.querySelectorAll){const d=e.querySelectorAll(l);for(let a=0;a<d.length;a++)G(d[a],c)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ot(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function it(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function Ie(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function at(e){const t=Ie(),o=e.observed||[];for(let i=0;i<o.length;i++){const s=o[i];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const s=t.byDeclaredAttr.get(i);s.some(l=>l.componentTag===e.componentTag)||s.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=rt(e);if(i===null)t.reactiveWildcard.push(e);else for(const s of i)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function qe(e,t,o,i){for(let s=0;s<e.length;s++){const l=e[s];if(!t[l.attribute])continue;const c=l.effects&&l.effects[o];c?c(t,o,i):l.onAttrChange&&(!l.declared||l.declared.has(o))&&l.onAttrChange(t,o,i)}}function st(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,i=Ie(),s=i.byAttr.get(t),l=pe()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!o&&!s&&!l)return;const c=e.target;if(e.oldValue!==c.getAttribute(t)){if(l&&oe(c)){const d=i.byDeclaredAttr.get(t),a=c.getAttribute(t);for(let w=0;w<d.length;w++)Ae(d[w].spec,a,t,d[w].componentTag,c)}if(window.lnCore._debugSink&&(o||s)&&window.lnCore._debugSink("attr",t,c,{oldValue:e.oldValue,newValue:c.getAttribute(t)}),o){const d=i.byReactive.get(t);d&&qe(d,c,t,e.oldValue),i.reactiveWildcard.length&&qe(i.reactiveWildcard,c,t,e.oldValue)}if(s)for(let d=0;d<s.length;d++){const a=s[d];if(a.handler){a.handler(c,t,e.oldValue);continue}a.onAttributeChange&&c[a.attribute]?a.onAttributeChange(c,t):(Ee(c,a.selector,a.attribute,a.ComponentFn),a.onInit&&a.onInit(c))}}}function lt(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,Z(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{st(t[o])}catch(i){console.error("[ln-core] mutation handler failed",t[o].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ue(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function de(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function fe(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ct(e){const t=ue();if(!t.length)return;const o=e.target;if(o){const s=o.nodeType===1?o:o.parentElement;if(s&&(s.isContentEditable||s.closest&&s.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=de();if(e.target&&i.length)for(let s=0;s<i.length;s++){const l=i[s],c=l.query,d=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;d&&l.onSubtreeChange(d,e)}for(let s=0;s<e.addedNodes.length;s++){const l=e.addedNodes[s];if(l.nodeType===1){const c=!!(l.firstElementChild||l.children&&l.children.length);for(let d=0;d<t.length;d++){const a=t[d];if(a.selector&&a.attribute&&a.ComponentFn){if(!c)l.matches&&l.matches(a.query)&&G(l,a);else if(l.matches&&l.matches(a.query)&&G(l,a),l.querySelectorAll){const w=l.querySelectorAll(a.query);for(let b=0;b<w.length;b++)G(w[b],a)}}a.onInit&&a.onInit(l)}}}for(let s=0;s<e.removedNodes.length;s++){const l=e.removedNodes[s];if(l.nodeType===1){const c=!!(l.firstElementChild||l.children&&l.children.length);for(let d=0;d<t.length;d++){const a=t[d],w=a.query;if(w){if(!c)l.matches&&l.matches(w)&&fe(l,a);else if(l.matches&&l.matches(w)&&fe(l,a),l.querySelectorAll){const b=l.querySelectorAll(w);for(let _=0;_<b.length;_++)fe(b[_],a)}}}}}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,Z(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const i=t[o];if(i.type==="childList")try{ct(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ut(e){ue().push(e),e.onSubtreeChange&&e.query&&de().push(e),De()}function Le(e,t,o,i,s={}){const l=s.extraAttributes||[],c=s.onAttributeChange||null,d=s.onSubtreeChange||null,a=s.onInit||null,w=s.onAttrChange||null,b=s.effects||null,_=s.attributes||null,x=_?nt(_):b,j=_?new Set(Object.keys(_)):null,$=s.persist||null;function g(D){const L=D||document.body;if(Ee(L,e,t,o),_&&pe())for(const F in _){const we=_[F],U=Array.from(L.querySelectorAll("["+F+"]"));L.matches&&L.matches("["+F+"]")&&U.push(L);for(let P=0;P<U.length;P++){const W=U[P];oe(W)&&Ae(we,W.getAttribute(F),F,i,W)}}a&&a(L)}const S=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let L;for(;(L=D.exec(e))!==null;)S.push(L[1])}else S.push(e);at({selector:e,attribute:t,componentTag:i,attributes:_,ComponentFn:o,onInit:a,observed:S.concat(l),onAttributeChange:c,onAttrChange:w,effects:x,declared:j,persist:$}),lt();const q=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,k=s.subtreeQuery||(q?e:"["+e+"]"),A={selector:e,attribute:t,ComponentFn:o,onInit:a,onSubtreeChange:d,query:k};ue().push(A),d&&k&&de().push(A),De(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Le,window.lnCore.observeLifecycle=ut);function E(){ot()>0?it(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",E):E(),g}function dt(e){let t=!1;for(let o=0;o<e.length;o++){const i=e[o];if(!(i===""||i==null)&&(t=!0,!Number.isFinite(Number(i))))return"string"}return t?"number":"string"}function ft(e,t,o,i){if(o==="number"){const c=parseFloat(e),d=parseFloat(t);return(isNaN(c)?0:c)-(isNaN(d)?0:d)}const s=e!=null?String(e):"",l=t!=null?String(t):"";return i?i.compare(s,l):s<l?-1:s>l?1:0}function Ne(e){return(e||"").replace(/^#/,"")}function he(e){const t=e===void 0?location.hash:e,o={},i=Ne(t);if(!i)return o;const s=i.split("&");for(let l=0;l<s.length;l++){const c=s[l];if(!c)continue;const d=c.indexOf(":"),a=d>-1?c.slice(0,d):c,w=d>-1?c.slice(d+1):"";if(a)try{o[a]=decodeURIComponent(w)}catch{o[a]=w}}return o}function ht(e){if(!e)return null;const t=he();return e in t?t[e]:null}function wt(e,t){if(!e)return;const o=he();t==null?delete o[e]:o[e]=String(t);const s=Object.keys(o).map(function(l){const c=o[l];return c===""?l:l+":"+encodeURIComponent(c)}).join("&");Ne(location.hash)!==s&&(location.hash=s)}function yt(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function pt(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const 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 gt(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function mt(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 bt(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function _t(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),i=e.slice(t+1),s=i?i.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:o,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=he,window.lnCore.hashGet=ht,window.lnCore.hashSet=wt,window.lnCore.hashLinkClick=yt,window.lnCore.resolveHashNamespace=pt,window.lnCore.hashSortEncode=gt,window.lnCore.hashSortDecode=mt,window.lnCore.hashFilterEncode=bt,window.lnCore.hashFilterDecode=_t);let H=null;const Ct="ln-ashlar:storage-salt:v1",Te=32768;function ze(e){let t="";const o=e.byteLength;for(let i=0;i<o;i+=Te)t+=String.fromCharCode.apply(null,e.subarray(i,Math.min(i+Te,o)));return btoa(t)}function Re(e){const t=atob(e),o=t.length,i=new Uint8Array(o);for(let s=0;s<o;s++)i[s]=t.charCodeAt(s);return i}function Oe(e,t){let o=H,i={};return typeof CryptoKey<"u"&&e instanceof CryptoKey?o=e:e&&typeof e=="object"&&(i=e,typeof CryptoKey<"u"&&i.key instanceof CryptoKey&&(o=i.key)),{key:o,options:i}}async function St(e,t={}){if(!e)throw new Error("[ln-crypto] Key derivation failed: Secret string is required");const o=t.method||"pbkdf2",i=new TextEncoder;if(o==="sha256"){const a=await crypto.subtle.digest("SHA-256",i.encode(e));return crypto.subtle.importKey("raw",a,{name:"AES-GCM"},!1,["encrypt","decrypt"])}const s=t.salt||Ct,l=typeof s=="string"?i.encode(s):s,c=t.iterations||1e5,d=await crypto.subtle.importKey("raw",i.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:l,iterations:c,hash:"SHA-256"},d,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Me(e,t={}){if(!e){H=null;return}try{const o=t.method||"sha256";H=await St(e,{...t,method:o})}catch(o){throw console.error("[ln-core/crypto] Key derivation failed:",o),H=null,o}}function B(){return H}async function vt(e,t,o){const{key:i}=Oe(t);if(e==null)return e;if(!i)throw new Error("[ln-crypto] Encryption failed: No active cryptographic key provided");try{const s=new TextEncoder,l=crypto.getRandomValues(new Uint8Array(12)),c=typeof e=="string"?e:JSON.stringify(e),d=await crypto.subtle.encrypt({name:"AES-GCM",iv:l},i,s.encode(c));return{v:1,alg:"AES-GCM",encrypted:!0,iv:ze(l),data:ze(new Uint8Array(d))}}catch(s){throw console.error("[ln-core/crypto] Encryption failed:",s),new Error("[ln-crypto] Encryption failed: "+(s&&s.message?s.message:String(s)))}}async function At(e,t,o){const{key:i,options:s}=Oe(t),l=s.silent===!0;if(!e||!e.encrypted)return e;if(!i){if(l)return{...e,decryptionError:!0};throw new Error("[ln-crypto] Decryption failed: No active cryptographic key provided")}if(!e.iv||!e.data){if(l)return{...e,decryptionError:!0};throw new Error("[ln-crypto] Decryption failed: Malformed envelope (missing iv or data)")}try{const c=new TextDecoder,d=Re(e.iv),a=Re(e.data),w=await crypto.subtle.decrypt({name:"AES-GCM",iv:d},i,a),b=c.decode(w);try{return JSON.parse(b)}catch{return b}}catch(c){if(l)return{...e,decryptionError:!0};throw console.error("[ln-core/crypto] Decryption failed. Key may be incorrect or payload tampered:",c),new Error("[ln-crypto] Decryption failed. Key may be incorrect or payload tampered: "+(c&&c.message?c.message:String(c)))}}function xt(){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=xt);function kt(e){return String(e||"").trim().toLowerCase()}function Et(e){const t=kt(e);return t?t.split(/\s+/).filter(Boolean):[]}function It(e,t){if(!t||t.length===0)return!0;if(!e)return!1;const o=String(e).toLowerCase();for(let i=0;i<t.length;i++)if(o.indexOf(t[i])===-1)return!1;return!0}function qt(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const o=String(e).trim().toLowerCase();for(let i=0;i<t.length;i++)if(String(t[i]).trim().toLowerCase()===o)return!0;return!1}function Dt(e={}){let t=e.windowSize>0?e.windowSize:1e3,o=e.pageSize>0?e.pageSize:200,i=e.fetchDebounce!=null?e.fetchDebounce:120;const s=typeof e.requestPage=="function"?e.requestPage:()=>{},l=new Map,c=new Set;let d=0,a=0,w=0,b=!1,_=null;function x(g,S){l.delete(g),l.set(g,S)}function j(){if(l.size<=t)return[];const g=[];for(;l.size>t;){const q=l.keys().next().value;g.push(l.get(q)),l.delete(q)}const S=new Set(l.values());return g.filter(q=>!S.has(q))}function $(g,S){c.add(g),clearTimeout(_),_=setTimeout(()=>s(g,o,S),i)}return{get logicalTotal(){return d},set logicalTotal(g){d=g},get grandTotal(){return a},set grandTotal(g){a=g},get queryGen(){return w},set queryGen(g){w=g},get size(){return l.size},get hasLoaded(){return b},getId:g=>{if(!l.has(g))return;const S=l.get(g);return x(g,S),S},ensure:(g,S,q)=>{if(!b&&!c.has(0))return $(0,q);if(d<=0)return;const k=Math.max(0,g),A=Math.min(d,S);for(let E=k;E<A;E++)if(!l.has(E)){const D=Math.floor(E/o)*o;if(!c.has(D))return $(D,q)}},ingest:(g,S,q,k,A)=>{if(A!=null&&A!==w)return[];b=!0,q!=null&&(a=q),k!=null&&(d=k);for(let E=0;E<S.length;E++)x(g+E,S[E]);return c.delete(g),j()},reset:function(){w++,this.clear()},clear:()=>{b=!1,l.clear(),c.clear(),clearTimeout(_)},configure:(g={})=>{let S=[];return g.windowSize>0&&g.windowSize!==t&&(t=g.windowSize,S=j()),g.pageSize>0&&(o=g.pageSize),g.fetchDebounce>=0&&(i=g.fetchDebounce),S}}}function Lt(e,t,o){if(!Array.isArray(e)||!t||!t.field)return e;const{field:i,direction:s}=t,l=s==="desc",c=e.map(a=>a?a[i]:void 0),d=dt(c);return[...e].sort((a,w)=>{const b=a?a[i]:void 0,_=w?w[i]:void 0,x=ft(b,_,d,o);return l?-x:x})}function Be(e,t){if(!Array.isArray(e)||!t||typeof t!="object")return e;const o=Object.keys(t).filter(i=>Array.isArray(t[i])&&t[i].length>0);return o.length?e.filter(i=>i?o.every(s=>qt(i[s],t[s])):!1):e}function Nt(e,t,o){if(!Array.isArray(e)||!t||!o||!o.length)return e;const i=Et(t);return i.length?e.filter(s=>s?i.every(l=>o.some(c=>{const d=s[c];return d!=null&&It(String(d),[l])})):!1):e}function Tt(e,t,o){if(!Array.isArray(e)||!e.length)return 0;if(o==="count")return e.length;const i=e.map(l=>l&&l[t]!=null?parseFloat(l[t]):NaN).filter(l=>Number.isFinite(l)),s=i.reduce((l,c)=>l+c,0);return o==="sum"?s:o==="avg"&&i.length?s/i.length:0}function zt(e,t={},o=[],i){if(!Array.isArray(e))return{records:[],total:0,filtered:0};const s=e.length;let l=e;t.filters&&(l=Be(l,t.filters)),t.search&&(l=Nt(l,t.search,o));const c=l.length;if(t.sort&&(l=Lt(l,t.sort,i)),t.offset||t.limit){const d=t.offset||0,a=t.limit||l.length;l=l.slice(d,d+a)}return{records:l,total:s,filtered:c}}function Rt(e,t){return!Array.isArray(e)||!t||typeof t!="object"?e:e.map(o=>{if(!o)return null;const i={...o};for(const[s,l]of Object.entries(t))if(typeof l=="function")try{i[s]=l(o)}catch{i[s]=void 0}return i})}function Ot(e,t,o,i="_meta"){if(!Array.isArray(e)||!e.includes(i))return!0;for(const s of Object.keys(t||{})){if(!e.includes(s))return!0;const l=t[s]&&t[s].indexes||[],c=o&&o[s]||[];if(l.some(d=>!c.includes(d)))return!0}return!1}function Mt(e){return{ok:!1,error:e&&e.message?e.message:String(e)}}(function(){const e="data-ln-data-store",t="lnDataStore";if(window[t]!==void 0)return;function o(n,r,u){const f=n.getAttribute(r);if(f==="never"||f==="-1")return-1;const h=parseInt(f,10);return isNaN(h)?u:h}const i={"data-ln-data-store":{type:"marker",effect:Ke,description:"Identifies the element as a data-store definition container"},"data-ln-data-store-indexes":{type:"list",effect:Ke,description:"Comma-separated index field names for the IndexedDB store"},"data-ln-data-store-stale":{prop:"_staleThreshold",type:"integer",read:o,fallback:300,description:"Cache staleness threshold in seconds, or -1/never"},"data-ln-data-store-search-fields":{prop:"_searchFields",type:"list",read:le,description:"Record fields to index for client-side search"},"data-ln-data-store-no-local-query":{prop:"noLocalQuery",type:"boolean",read:se,description:"Bypasses local IndexedDB query resolution, forcing remote fetching"},"data-ln-data-store-window":{prop:"_windowSize",type:"integer",read:X,fallback:1e3,min:10,effect:nn,description:"Virtual scrolling cache window size in records"},"data-ln-data-store-window-page":{prop:"_windowPageSize",type:"integer",read:X,fallback:200,min:5,effect:rn,description:"Virtual scrolling slice page size"},"data-ln-data-store-frozen":{type:"marker",description:"Applied at runtime to indicate store schema is locked in IndexedDB"}},s=ke(i),l="ln_app_cache",c="_meta",d="1.0";let a=null,w=null;const b={};function _(n){n&&n.name==="QuotaExceededError"&&v(document,"ln-data-store:quota-exceeded",{error:n})}function x(){const n={};for(const r of document.querySelectorAll(`[${e}]`)){const u=r.id;if(u){const f=r.getAttribute("data-ln-data-store-indexes")||"";n[u]={indexes:f.split(",").map(h=>h.trim()).filter(Boolean)}}}return n}function j(){return w||(w=new Promise(n=>{if(typeof indexedDB>"u")return console.warn("[ln-data-store] IndexedDB is not available in this environment"),n(null);const r=x(),u=Object.keys(r),f=indexedDB.open(l);f.onerror=()=>{console.warn("[ln-data-store] IndexedDB open failed"),n(null)},f.onsuccess=h=>{const y=h.target.result,p=Array.from(y.objectStoreNames),m=u.filter(T=>p.includes(T));let C={};if(m.length>0){const T=y.transaction(m,"readonly");for(const z of m)C[z]=Array.from(T.objectStore(z).indexNames)}if(!Ot(p,r,C,c))return $(y),a=y,n(y);const K=y.version;y.close();const M=indexedDB.open(l,K+1);let R=!1,O=null;M.onblocked=()=>{console.warn("[ln-data-store] Database upgrade blocked — waiting for other tabs to close connection"),v(document,"ln-data-store:blocked",{db:l}),O||(O=setTimeout(()=>{R||(console.warn("[ln-data-store] Database upgrade timed out while blocked"),R=!0,w=null,n(null))},5e3))},M.onerror=()=>{R||(O&&clearTimeout(O),R=!0,w=null,console.warn("[ln-data-store] Database upgrade failed"),n(null))},M.onupgradeneeded=T=>{const z=T.target.result,on=T.target.transaction;z.objectStoreNames.contains(c)||z.createObjectStore(c,{keyPath:"key"});for(const J of u)if(z.objectStoreNames.contains(J)){const re=on.objectStore(J);for(const V of r[J].indexes)re.indexNames.contains(V)||re.createIndex(V,V,{unique:!1})}else{const re=z.createObjectStore(J,{keyPath:"id"});for(const V of r[J].indexes)re.createIndex(V,V,{unique:!1})}},M.onsuccess=T=>{if(R){T.target.result&&T.target.result.close();return}O&&clearTimeout(O),R=!0;const z=T.target.result;$(z),a=z,n(z)}}}),w)}function $(n){n.onversionchange=()=>{n.close(),a=null,w=null}}function g(){return a?Promise.resolve(a):(w=null,j())}async function S(n){if(!B()||!n)return n;const r={...n},u=r.id,f=await vt(r);return!f||!f.encrypted?n:{...f,id:u}}async function q(n){return!n||!n.encrypted||!B()?n:At(n,{silent:!0})}const k=(n,r)=>g().then(u=>u?u.transaction(n,r).objectStore(n):null);function A(n){return new Promise((r,u)=>{n.onsuccess=()=>r(n.result),n.onerror=()=>{_(n.error),u(n.error)}})}const E=n=>k(n,"readonly").then(r=>r?A(r.getAll()):[]).then(r=>B()?Promise.all(r.map(u=>q(u))):r),D=(n,r)=>k(n,"readonly").then(u=>u?A(u.get(r)).then(f=>f!==void 0?f:typeof r=="string"&&r.trim()!==""&&!isNaN(Number(r))?A(u.get(Number(r))):typeof r=="number"?A(u.get(String(r))):null):null).then(u=>u?q(u):null),L=(n,r)=>g().then(u=>{if(!u)return[];const h=u.transaction(n,"readonly").objectStore(n),y=r.map(p=>A(h.get(p)).then(m=>m!==void 0?m:typeof p=="string"&&p.trim()!==""&&!isNaN(Number(p))?A(h.get(Number(p))):typeof p=="number"?A(h.get(String(p))):null));return Promise.all(y).then(p=>B()?Promise.all(p.map(m=>m?q(m):null)):p)}),F=(n,r)=>(B()?S(r):Promise.resolve(r)).then(f=>k(n,"readwrite").then(h=>h?A(h.put(f)):null)),we=(n,r)=>k(n,"readwrite").then(u=>u?A(u.delete(r)).then(()=>{if(typeof r=="string"&&r.trim()!==""&&!isNaN(Number(r)))return A(u.delete(Number(r)));if(typeof r=="number")return A(u.delete(String(r)))}):null),U=n=>k(n,"readwrite").then(r=>r?A(r.clear()):null),P=n=>k(n,"readonly").then(r=>r?A(r.count()):0),W=n=>k(c,"readonly").then(r=>r?A(r.get(n)):null),Y=(n,r)=>k(c,"readwrite").then(u=>{if(u)return r.key=n,A(u.put(r))});function N(n){return this.dom=n,this._name=n.id,this._name||console.warn("[ln-data-store] missing id — the store cannot be addressed",n),xe(this,n,s),this._handlers=null,this.isLoaded=!1,this.canServe=!1,this.isInitialized=!1,this.initializationError=null,this.hasCache=!1,this.isSyncing=!1,this.lastSyncedAt=null,this.query={filters:{},search:"",sort:null},n.hasAttribute("data-ln-data-store-window")?this._windowIndex=Dt({windowSize:this._windowSize,pageSize:this._windowPageSize,requestPage:(r,u,f)=>{v(this.dom,"ln-data-store:request-page",{store:this._name,offset:r,limit:u,query:f,queryGen:this._windowIndex.queryGen})}}):this._windowIndex=null,this.windowed=this._windowIndex!==null,this.totalCount=0,this.presenters=null,this._mutationChain=Promise.resolve(),b[this._name]=this,Bt(this),this.ready=Ut(this),this}function Bt(n){n._handlers={create:r=>ee(n,"create",r.detail,()=>Ft(n,r.detail)),update:r=>ee(n,"update",r.detail,()=>Pt(n,r.detail)),delete:r=>ee(n,"delete",r.detail,()=>jt(n,r.detail)),"bulk-delete":r=>ee(n,"bulk-delete",r.detail,()=>$t(n,r.detail)),"sync-failed":r=>{n.isSyncing=!1,v(n.dom,"ln-data-store:sync-error",{store:n._name,error:r.detail&&r.detail.error,status:r.detail&&r.detail.status})}};for(const[r,u]of Object.entries(n._handlers))n.dom.addEventListener(`ln-data-store:request-${r}`,u);n._queryHandlers={"ln-search:change":r=>{r.preventDefault();const u=r.detail&&r.detail.term!=null?r.detail.term:"";u!==n.query.search&&(n.query.search=u,ye(n))},"ln-filter:change":r=>{r.preventDefault();const u=r.detail&&r.detail.key;if(!u)return;const f=(r.detail.values||[]).slice(),h=n.query.filters[u];(h?h.length===f.length&&h.every((p,m)=>p===f[m]):!f.length)||(f.length?n.query.filters[u]=f:delete n.query.filters[u],ye(n))},"ln-sort:change":r=>{r.preventDefault();const u=r.detail&&r.detail.field,f=r.detail&&r.detail.direction,h=f&&f!=="none"?{field:u,direction:f}:null,y=n.query.sort;!y&&!h||y&&h&&y.field===h.field&&y.direction===h.direction||(n.query.sort=h,ye(n))}};for(const[r,u]of Object.entries(n._queryHandlers))n.dom.addEventListener(r,u)}function ee(n,r,u,f){const h=u&&u.requestId;return n._mutationChain=n._mutationChain.then(()=>n.ready).then(()=>{if(n.initializationError)throw n.initializationError;return f()}).catch(y=>Kt(n,r,h,y)),n._mutationChain}function te(n,r=0){return P(n._name).then(u=>{if(n._windowIndex||n.windowed){const f=n.totalCount!=null?n.totalCount:u;n.totalCount=Math.max(0,f+r)}else n.totalCount=u;return n.hasCache=!0,n.isLoaded=!0,n.canServe=!0,Y(n._name,{schema_version:d,last_synced_at:n.lastSyncedAt,has_cache:!0,record_count:n.totalCount})})}function Ft(n,{tempId:r,data:u={},requestId:f}={}){const h={...u,id:r};return F(n._name,h).then(()=>te(n,1)).then(()=>{v(n.dom,"ln-data-store:created",{store:n._name,record:h,tempId:r,requestId:f})})}function Pt(n,{id:r,data:u={},requestId:f}={}){return D(n._name,r).then(h=>{if(!h)throw new Error(`Record not found: ${r}`);const y=h.id,p={...h,...u,id:y},m=u.id,C=m!==void 0&&m!==y;return(C?Vt(n._name,y,{...p,id:m}):F(n._name,p)).then(()=>te(n,0)).then(()=>{v(n.dom,"ln-data-store:updated",{store:n._name,record:C?{...p,id:m}:p,previous:h,requestId:f})})})}function jt(n,{id:r,requestId:u}={}){return D(n._name,r).then(f=>{if(!f){v(n.dom,"ln-data-store:deleted",{store:n._name,id:r,requestId:u,missing:!0});return}const h=f.id;return we(n._name,h).then(()=>te(n,-1)).then(()=>{v(n.dom,"ln-data-store:deleted",{store:n._name,id:h,requestId:u})})})}function $t(n,{ids:r=[],requestId:u}={}){return r.length?Promise.all(r.map(f=>D(n._name,f))).then(f=>{const h=f.filter(Boolean).map(y=>y.id);return ne(n._name,h).then(()=>te(n,-h.length)).then(()=>{v(n.dom,"ln-data-store:deleted",{store:n._name,ids:h,requestId:u})})}):(v(n.dom,"ln-data-store:deleted",{store:n._name,ids:[],requestId:u}),Promise.resolve())}function Kt(n,r,u,f){console.error("[ln-data-store] "+r+" failed:",f),v(n.dom,"ln-data-store:mutation-error",{store:n._name,action:r,requestId:u,error:f})}function Ut(n){return j().then(r=>{if(!r)throw new Error("IndexedDB is unavailable");return W(n._name)}).then(r=>{if(n.initializationError=null,r&&r.schema_version===d)n.lastSyncedAt=r.last_synced_at||null,n.totalCount=r.record_count||0,n.hasCache=r.has_cache===!0||n.totalCount>0,n.hasCache&&(n.isLoaded=!0,n.canServe=!0,v(n.dom,"ln-data-store:ready",{store:n._name,count:n.totalCount,source:"cache"})),n.isInitialized=!0,v(n.dom,"ln-data-store:initialized",{store:n._name,hasCache:n.hasCache,lastSyncedAt:n.lastSyncedAt,count:n.totalCount});else{if(r&&r.schema_version!==d)return U(n._name).then(()=>Y(n._name,{schema_version:d,last_synced_at:null,has_cache:!1,record_count:0})).then(()=>{n.isInitialized=!0,n.hasCache=!1,v(n.dom,"ln-data-store:initialized",{store:n._name,hasCache:!1,lastSyncedAt:null,count:0})});n.isInitialized=!0,n.hasCache=!1,v(n.dom,"ln-data-store:initialized",{store:n._name,hasCache:!1,lastSyncedAt:null,count:0})}}).catch(r=>(n.isInitialized=!0,n.isLoaded=!1,n.canServe=!1,n.hasCache=!1,n.isSyncing=!1,n.initializationError=r,v(n.dom,"ln-data-store:initialization-error",{store:n._name,error:r}),{ok:!1,error:r}))}function Fe(n){n.isSyncing=!0,v(n.dom,"ln-data-store:request-remote-sync",{since:n.lastSyncedAt})}function Pe(n,r){return g().then(u=>u?(B()?Promise.all(r.map(h=>S(h))):Promise.resolve(r)).then(h=>new Promise((y,p)=>{const m=u.transaction(n,"readwrite"),C=m.objectStore(n);h.forEach(I=>C.put(I)),m.oncomplete=()=>y(),m.onerror=()=>{_(m.error),p(m.error)}})):void 0)}function ne(n,r){return g().then(u=>{if(u)return new Promise((f,h)=>{const y=u.transaction(n,"readwrite"),p=y.objectStore(n);r.forEach(m=>{p.delete(m),typeof m=="string"&&m.trim()!==""&&!isNaN(Number(m))?p.delete(Number(m)):typeof m=="number"&&p.delete(String(m))}),y.oncomplete=()=>f(),y.onerror=()=>h(y.error)})})}function Vt(n,r,u){return(B()?S(u):Promise.resolve(u)).then(h=>g().then(y=>{if(y)return new Promise((p,m)=>{const C=y.transaction(n,"readwrite"),I=C.objectStore(n);I.put(h),I.delete(r),C.oncomplete=()=>p(),C.onerror=()=>{_(C.error),m(C.error)}})}))}const Gt=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function Ht(n){return n?Object.keys(n).filter(r=>Array.isArray(n[r])&&n[r].length>0):[]}function Wt(n,r,u){return r.every(f=>u[f].map(String).includes(String(n[f])))}function Qt(n){return String(n||"").toLowerCase().split(/\s+/).filter(Boolean)}function Jt(n,r,u){return r.every(f=>u.some(h=>{const y=n[h];return y!=null&&String(y).toLowerCase().includes(f)}))}function Zt(n,r,u){return Tt(n,r,u)}function Q(n,r){return Rt(r,n.presenters&&n.presenters.computed)}function Xt(n){return!n.sort&&!B()}function Yt(n,r,u){const f=Ht(r.filters),h=r.search?Qt(r.search):[],y=n._searchFields,p=h.length>0&&y&&y.length>0;return k(n._name,"readonly").then(m=>m?new Promise((C,I)=>{const K=[],M=m.openCursor();M.onsuccess=()=>{const R=M.result;if(!R||K.length>=u){C(K);return}const O=R.value;(!f.length||Wt(O,f,r.filters))&&(!p||Jt(O,h,y))&&K.push(O),R.continue()},M.onerror=()=>I(M.error)}):[])}function je(n,r,u){return zt(r,u,n._searchFields,Gt)}function $e(n,r,u){const f=[];for(let y=r;y<r+u;y++){const p=n._windowIndex.getId(y);f.push(p)}const h=Array.from(new Set(f.filter(y=>y!==void 0)));return L(n._name,h).then(y=>{const p=new Map;for(let C=0;C<y.length;C++){const I=y[C];I&&p.set(String(I.id),I)}const m=[];for(let C=0;C<f.length;C++){const I=f[C];if(I===void 0)m.push(null);else{const K=p.get(String(I));m.push(K||null)}}return{data:Q(n,m),total:n._windowIndex.grandTotal,filtered:n._windowIndex.logicalTotal,offset:r,queryGen:n._windowIndex.queryGen}})}N.prototype.getAll=function(n={}){const r=this;if(r._windowIndex){const u=n.offset||0,f=n.limit||200;if(r._windowIndex.ensure(u,u+f,n),!r._windowIndex.hasLoaded&&!r.noLocalQuery){const h=u+f,y=p=>p.length?{data:Q(r,p),offset:u,queryGen:r._windowIndex.queryGen,provisional:!0}:$e(r,u,f);return Xt(n)?Yt(r,n,h).then(p=>y(p.slice(u,h))):E(r._name).then(p=>y(je(r,p,n).records))}return $e(r,u,f)}return E(r._name).then(u=>{const f=je(r,u,n);return{data:Q(r,f.records),total:f.total,filtered:f.filtered}})},N.prototype.getById=function(n){return D(this._name,n).then(r=>r?Q(this,[r])[0]:null)},N.prototype.count=function(n){return n&&Object.keys(n).length>0?E(this._name).then(u=>Be(u,n).length):this.windowed&&this.totalCount!=null?Promise.resolve(this.totalCount):P(this._name)},N.prototype.aggregate=function(n,r){return E(this._name).then(u=>Zt(u,n,r))},N.prototype.setPresenters=function(n){this.presenters=n},N.prototype.applySync=function(n,r,u,f){f=f||{};const h=this;if(h._windowIndex&&f.queryGen!=null&&f.queryGen!==h._windowIndex.queryGen)return Promise.resolve({ok:!0,stale:!0});let y=g().then(p=>{if(!p)throw new Error("IndexedDB unavailable")});return n.length>0&&(y=y.then(()=>Pe(h._name,n))),r.length>0&&(y=y.then(()=>ne(h._name,r))),y.then(()=>{if(h._windowIndex&&(f.offset!=null||f.total!=null)){const p=f.offset!=null?f.offset:0,m=n.map(I=>I.id),C=h._windowIndex.ingest(p,m,f.total,f.filtered,f.queryGen);if(C&&C.length)return ne(h._name,C)}}).then(()=>P(h._name)).then(p=>(h.totalCount=f.total!==void 0?f.total:p,h.hasCache=!0,Y(h._name,{schema_version:d,last_synced_at:u,has_cache:!0,record_count:h.totalCount}))).then(()=>{const p=!h.isLoaded;return h.isLoaded=!0,h.canServe=!0,h.isSyncing=!1,h.lastSyncedAt=u,p?(v(h.dom,"ln-data-store:loaded",{store:h._name,count:h.totalCount,meta:f}),v(h.dom,"ln-data-store:ready",{store:h._name,count:h.totalCount,source:"server",meta:f})):v(h.dom,"ln-data-store:synced",{store:h._name,added:n.length,deleted:r.length,changed:!0,meta:f}),{ok:!0}}).catch(p=>{h.isSyncing=!1;const m=p&&p.message?p.message:String(p);return console.error("[ln-data-store] applySync failed:",p),v(h.dom,"ln-data-store:sync-error",{store:h._name,error:m}),Mt(p)})},N.prototype.applyQuery=function(n,r){r=r||{};const u=this;let f=Promise.resolve();return n.length>0&&(f=f.then(()=>Pe(u._name,n))),f.then(()=>P(u._name)).then(h=>(u.totalCount=r.total!==void 0?r.total:h,n.length>0&&(u.canServe=!0),Q(u,n))).catch(h=>(console.error("[ln-data-store] applyQuery failed:",h),[]))},N.prototype.forceSync=function(){this.isSyncing||Fe(this)},N.prototype.fullReload=function(){const n=this;return U(n._name).then(()=>Y(n._name,{schema_version:d,last_synced_at:null,has_cache:!1,record_count:0})).then(()=>{n.isLoaded=!1,n.hasCache=!1,n.lastSyncedAt=null,n.totalCount=0,Fe(n)})},N.prototype.destroy=function(){if(this._windowIndex&&(this._windowIndex.clear(),this._windowIndex=null,this.windowed=!1),this._handlers){for(const[n,r]of Object.entries(this._handlers))this.dom.removeEventListener(`ln-data-store:request-${n}`,r);this._handlers=null}if(this._queryHandlers){for(const[n,r]of Object.entries(this._queryHandlers))this.dom.removeEventListener(n,r);this._queryHandlers=null}delete b[this._name],delete this.dom[t]};function en(){return g().then(n=>{if(!n)return;const r=Array.from(n.objectStoreNames);return new Promise((u,f)=>{const h=n.transaction(r,"readwrite");r.forEach(y=>h.objectStore(y).clear()),h.oncomplete=()=>u(),h.onerror=()=>f(h.error)})}).then(()=>{Object.values(b).forEach(n=>{n.isLoaded=!1,n.canServe=!1,n.isInitialized=!1,n.initializationError=null,n.hasCache=!1,n.isSyncing=!1,n.lastSyncedAt=null,n.totalCount=0})})}function ye(n){n._windowIndex&&n._windowIndex.reset(),v(n.dom,"ln-data-store:query-changed",{store:n._name,query:{filters:Object.assign({},n.query.filters),search:n.query.search,sort:n.query.sort?Object.assign({},n.query.sort):null}})}const tn="data-ln-data-store-frozen";function Ke(n,r){n.setAttribute(tn,r)}function nn(n){const r=n[t];if(!r._windowIndex)return;const u=r._windowIndex.configure({windowSize:r._windowSize});u.length&&ne(r._name,u).catch(f=>{console.error("[ln-data-store] window shrink eviction failed:",f)})}function rn(n){const r=n[t];r._windowIndex&&r._windowIndex.configure({pageSize:r._windowPageSize})}Le(e,t,N,"ln-data-store",{attributes:i}),window[t].clearAll=en,window[t].init=window[t],window[t].setStorageKey=Me,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.setStorageKey=Me)})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function W(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function I(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let n=1;n<t.length;n++)if(t[n]&&t[n].nodeType===1){o=t[n];break}if(!I(o))return}e.apply(console,t)}}function U(e,t,r){const o=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function M(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){M(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function de(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function fe(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,n={},c=e.elements,s={};if(r)for(let a=0;a<c.length;a++){const i=c[a];i.name&&i.type==="checkbox"&&!i.disabled&&(s[i.name]=(s[i.name]||0)+1)}for(let a=0;a<c.length;a++){const i=c[a];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(o&&i.matches&&i.matches(o)))if(i.type==="checkbox")r&&s[i.name]===1?n[i.name]=i.checked:(n[i.name]||(n[i.name]=[]),i.checked&&n[i.name].push(i.value));else if(i.type==="radio")i.checked&&(n[i.name]=i.value);else if(i.type==="select-multiple"){n[i.name]=[];for(let l=0;l<i.options.length;l++)i.options[l].selected&&n[i.name].push(i.options[l].value)}else if(r&&i.type==="hidden")n[i.name]=i.value;else if(r&&(i.type==="number"||i.type==="range")){const l=Number(i.value);n[i.name]=i.value===""||isNaN(l)?null:l}else n[i.name]=i.value}return n}function he(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function me(e,t){const r=e.elements,o=[],n={};for(let c=0;c<r.length;c++){const s=r[c];s.name&&s.type==="checkbox"&&(n[s.name]=(n[s.name]||0)+1)}for(let c=0;c<r.length;c++){const s=r[c];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const a=s.getAttribute("data-ln-fill-as")||s.name;if(!a||!(a in t))continue;const i=t[a];if(s.type==="checkbox"){if(Array.isArray(i))s.checked=i.indexOf(s.value)!==-1;else if(n[s.name]>1){const l=String(i).split(",").map(function(u){return u.trim()});s.checked=l.indexOf(s.value)!==-1}else s.checked=he(i);o.push(s)}else if(s.type==="radio")s.checked=s.value===String(i),o.push(s);else if(s.type==="select-multiple"){if(Array.isArray(i))for(let l=0;l<s.options.length;l++)s.options[l].selected=i.indexOf(s.options[l].value)!==-1;o.push(s)}else s.value=i,s.tagName==="SELECT"&&i!=null&&s.setAttribute("data-ln-value",i),o.push(s)}return o}function pe(e,t,{get:r,set:o}){Object.defineProperty(e,"value",{get:function(){return r?r.call(this):t.get.call(this)},set:function(n){o?o.call(this,n,c=>t.set.call(this,c)):t.set.call(this,n)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=me,window.lnCore.serializeForm=fe,window.lnCore.resolveFormMethod=de);const K={};function we(e,t){K[e]=t}function ge(e){return K[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=we,window.lnCore.getDataMapper=ge);function N(e){const t=e?e.closest("[lang]"):null,r=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return r?r.trim():"en-US"}function Q(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,M(function(){new MutationObserver(function(){U(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const Y={};function J(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];Y[r]=t}function E(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return Y[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=J,window.lnCore.getLocaleFallback=E,window.lnCore.ensureLocaleObserver=Q);const R={};function be(e,t){R[e]||(R[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=R[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function z(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let s=0;s<r.length;s++){const a=r[s],i=a.getAttribute("data-ln-field");t[i]!=null&&(a.textContent=t[i])}const o=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<o.length;s++){const a=o[s],i=a.getAttribute("data-ln-attr").split(",");for(let l=0;l<i.length;l++){const u=i[l].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),h=u[1].trim();t[h]!=null&&a.setAttribute(d,t[h])}}const n=e.querySelectorAll("[data-ln-show]");for(let s=0;s<n.length;s++){const a=n[s],i=a.getAttribute("data-ln-show");i in t&&a.classList.toggle("hidden",!t[i])}const c=e.querySelectorAll("[data-ln-class]");for(let s=0;s<c.length;s++){const a=c[s],i=a.getAttribute("data-ln-class").split(",");for(let l=0;l<i.length;l++){const u=i[l].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),h=u[1].trim();h in t&&a.classList.toggle(d,!!t[h])}}return e}function ye(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)z(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 G(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,a){return t[a]!==void 0?t[a]:""}))}const o=function(c,s){return t[s]!==void 0?t[s]:""},n=Array.from(e.querySelectorAll("*"));e.nodeType===1&&n.push(e);for(let c=0;c<n.length;c++){const s=n[c],a=s.attributes;for(let i=0;i<a.length;i++){const l=a[i];l.value.indexOf("{{")!==-1&&s.setAttribute(l.name,l.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Ce(e,t,r,o,n,c){const s={};for(let i=0;i<e.children.length;i++){const l=e.children[i],u=l.getAttribute("data-ln-render-key");u&&(s[u]=l)}const a=document.createDocumentFragment();for(let i=0;i<t.length;i++){const l=t[i],u=String(o(l));let d=s[u];if(d)n(d,l,i);else{const h=be(r,c);if(!h||(G(h,l),d=h.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),n(d,l,i)}a.appendChild(d)}e.textContent="",e.appendChild(a)}function _e(e,t){const r={},o=e.querySelectorAll("["+t+"]");for(let n=0;n<o.length;n++)r[o[n].getAttribute(t)]=o[n].textContent,o[n].remove();return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=G,window.lnCore.fill=z,window.lnCore.lnFill=ye,window.lnCore.renderList=Ce);function q(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function X(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function Z(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const n=o.trim().toLowerCase();return!(n==="false"||n==="0")}function ee(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const B=new Map;function te(e,t){const r=(e?e.join("|"):"")+"::"+t;if(B.has(r))return B.get(r);const o=new Set(e||[]),n=function(c,s){const a=c.getAttribute(s);return a!==null&&o.has(a)?a:t};return B.set(r,n),n}function ne(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function re(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function oe(e,t,r,o,n){if(!e||t===null)return!0;const c=o||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const a=i=>{n?console.warn(i,n):console.warn(i)};if(s==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(a(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const i=e.values||[];return i.includes(t)?!0:(a(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return a(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(a(`[${c}] Value ${i} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(a(`[${c}] Value ${i} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(a(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(i){return a(`[${c}] Invalid JSON for attribute "${r}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function ve(e,t,r){for(const o in r){const[n,c,s]=r[o];Object.defineProperty(e,o,{get:function(){return n(t,c,s)},enumerable:!0,configurable:!0})}return e}function Ae(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let n=o.read;if(!n&&o.type)switch(o.type){case"enum":n=te(o.values,o.fallback);break;case"integer":n=X;break;case"float":n=ne;break;case"boolean":n=Z;break;case"list":n=ee;break;case"json":n=re;break;case"string":default:n=q;break}n||(n=q),t[o.prop]=[n,r,o.fallback]}return t}function xe(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function Se(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=ve,window.lnCore.attrSpec=Ae,window.lnCore.attrStr=q,window.lnCore.attrInt=X,window.lnCore.attrBool=Z,window.lnCore.attrList=ee,window.lnCore.attrEnum=te,window.lnCore.attrFloat=ne,window.lnCore.attrJson=re);function D(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 ie(e,t,r,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(c)&&D(e,s),e.querySelectorAll){const a=e.querySelectorAll(c);for(let i=0;i<a.length;i++)D(a[i],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ke(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ee(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 le(){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 De(e){const t=le(),r=e.observed||[];for(let o=0;o<r.length;o++){const n=r[o];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 o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const n=t.byDeclaredAttr.get(o);n.some(c=>c.componentTag===e.componentTag)||n.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Se(e);if(o===null)t.reactiveWildcard.push(e);else for(const n of o)t.byReactive.has(n)||t.byReactive.set(n,[]),t.byReactive.get(n).push(e)}e.persist&&t.persist.push(e)}function se(e,t,r,o){for(let n=0;n<e.length;n++){const c=e[n];if(!t[c.attribute])continue;const s=c.effects&&c.effects[r];s?s(t,r,o):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,o)}}function Oe(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=le(),n=o.byAttr.get(t),c=W()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!n&&!c)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(c&&I(s)){const a=o.byDeclaredAttr.get(t),i=s.getAttribute(t);for(let l=0;l<a.length;l++)oe(a[l].spec,i,t,a[l].componentTag,s)}if(window.lnCore._debugSink&&(r||n)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),r){const a=o.byReactive.get(t);a&&se(a,s,t,e.oldValue),o.reactiveWildcard.length&&se(o.reactiveWildcard,s,t,e.oldValue)}if(n)for(let a=0;a<n.length;a++){const i=n[a];if(i.handler){i.handler(s,t,e.oldValue);continue}i.onAttributeChange&&s[i.attribute]?i.onAttributeChange(s,t):(ie(s,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(s))}}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,M(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Oe(t[r])}catch(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function $(){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(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Le(e){const t=$();if(!t.length)return;const r=e.target;if(r){const o=r.nodeType===1?r:r.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let o=0;o<t.length;o++){const n=t[o];if(n.onSubtreeChange&&n.query){const c=n.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;s&&n.onSubtreeChange(s,e)}}for(let o=0;o<e.addedNodes.length;o++){const n=e.addedNodes[o];if(n.nodeType===1){const c=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const a=t[s];if(a.selector&&a.attribute&&a.ComponentFn){if(!c)n.matches&&n.matches(a.query)&&D(n,a);else if(n.matches&&n.matches(a.query)&&D(n,a),n.querySelectorAll){const i=n.querySelectorAll(a.query);for(let l=0;l<i.length;l++)D(i[l],a)}}a.onInit&&a.onInit(n)}}}for(let o=0;o<e.removedNodes.length;o++){const n=e.removedNodes[o];if(n.nodeType===1){const c=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const a=t[s],i=a.query;if(i){if(!c)n.matches&&n.matches(i)&&V(n,a);else if(n.matches&&n.matches(i)&&V(n,a),n.querySelectorAll){const l=n.querySelectorAll(i);for(let u=0;u<l.length;u++)V(l[u],a)}}}}}}function ae(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,M(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{Le(o)}catch(n){console.error("[ln-core] lifecycle handler failed",o.target,n)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Me(e){$().push(e),ae()}function ce(e,t,r,o,n={}){const c=n.extraAttributes||[],s=n.onAttributeChange||null,a=n.onSubtreeChange||null,i=n.onInit||null,l=n.onAttrChange||null,u=n.effects||null,d=n.attributes||null,h=d?xe(d):u,b=d?new Set(Object.keys(d)):null,w=n.persist||null;function g(m){const p=m||document.body;if(ie(p,e,t,r),d&&W())for(const y in d){const v=d[y],x=Array.from(p.querySelectorAll("["+y+"]"));p.matches&&p.matches("["+y+"]")&&x.push(p);for(let L=0;L<x.length;L++){const k=x[L];I(k)&&oe(v,k.getAttribute(y),y,o,k)}}i&&i(p)}const C=[];if(e.indexOf("[")!==-1){const m=/\[([\w-]+)/g;let p;for(;(p=m.exec(e))!==null;)C.push(p[1])}else C.push(e);De({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:r,onInit:i,observed:C.concat(c),onAttributeChange:s,onAttrChange:l,effects:h,declared:b,persist:w}),Te();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,T=n.subtreeQuery||(A?e:"["+e+"]");$().push({selector:e,attribute:t,ComponentFn:r,onInit:i,onSubtreeChange:a,query:T}),ae(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ce,window.lnCore.observeLifecycle=Me);function f(){ke()>0?Ee(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f(),g}function ue(e){return(e||"").replace(/^#/,"")}function j(e){const t=e===void 0?location.hash:e,r={},o=ue(t);if(!o)return r;const n=o.split("&");for(let c=0;c<n.length;c++){const s=n[c];if(!s)continue;const a=s.indexOf(":"),i=a>-1?s.slice(0,a):s,l=a>-1?s.slice(a+1):"";if(i)try{r[i]=decodeURIComponent(l)}catch{r[i]=l}}return r}function Ne(e){if(!e)return null;const t=j();return e in t?t[e]:null}function Fe(e,t){if(!e)return;const r=j();t==null?delete r[e]:r[e]=String(t);const n=Object.keys(r).map(function(c){const s=r[c];return s===""?c:c+":"+encodeURIComponent(s)}).join("&");ue(location.hash)!==n&&(location.hash=n)}function Ie(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Re(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function qe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Be(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function $e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ve(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),n=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=j,window.lnCore.hashGet=Ne,window.lnCore.hashSet=Fe,window.lnCore.hashLinkClick=Ie,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=qe,window.lnCore.hashSortDecode=Be,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=Ve);function je(){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=je);function _(e){if(e==null||e==="")return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;const t=Number(e);if(!isNaN(t)&&t>0){const r=t<1e11?t*1e3:t,o=new Date(r);return isNaN(o.getTime())?null:o}if(typeof e=="string"){const r=e.trim();if(!r)return null;const o=/^(\d{4})-(\d{2})-(\d{2})$/.exec(r);if(o){const c=+o[1],s=+o[2],a=+o[3],i=new Date(c,s-1,a);return i.getFullYear()!==c||i.getMonth()!==s-1||i.getDate()!==a?null:i}const n=new Date(r);return isNaN(n.getTime())?null:n}return null}function S(e){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0");return t+"-"+r+"-"+o}const P=/^(short|medium|long)(\s+datetime)?$/,Pe={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},"short datetime":{dateStyle:"short",timeStyle:"short"},"medium datetime":{dateStyle:"medium",timeStyle:"short"},"long datetime":{dateStyle:"long",timeStyle:"short"}};function He(e){return!e||e===""?{dateStyle:"medium"}:String(e).trim().match(P)?Pe[e.trim()]:null}function O(e){if(!e||typeof e!="string")return null;const t=e.trim();if(t.length<6)return null;let r,o;if(t.indexOf(".")!==-1)r=".",o=t.split(".");else if(t.indexOf("/")!==-1)r="/",o=t.split("/");else if(t.indexOf("-")!==-1)r="-",o=t.split("-");else return null;if(o.length!==3)return null;const n=[];for(let l=0;l<3;l++){const u=parseInt(o[l],10);if(isNaN(u))return null;n.push(u)}let c,s,a;r==="."?(c=n[0],s=n[1],a=n[2]):r==="/"?(s=n[0],c=n[1],a=n[2]):o[0].length===4?(a=n[0],s=n[1],c=n[2]):(c=n[0],s=n[1],a=n[2]),a<100&&(a+=a<50?2e3:1900);const i=new Date(a,s-1,c);return i.getFullYear()!==a||i.getMonth()!==s-1||i.getDate()!==c?null:i}function H(e,t,r,o){if(!e||!(e instanceof Date)||isNaN(e.getTime())||!t||typeof t!="string")return"";const n=e.getDate(),c=e.getMonth(),s=e.getFullYear(),a=e.getHours(),i=e.getMinutes();let l,u;const d=(r||"").toLowerCase().split("-")[0];let h=!1;try{const g=new Intl.DateTimeFormat(r,{month:"long"}).resolvedOptions().locale.toLowerCase().split("-")[0];h=!!(o&&g!==d)}catch{h=!!o}if(h&&o&&o.monthsLong)l=o.monthsLong[c];else try{l=new Intl.DateTimeFormat(r,{month:"long"}).format(e)}catch{l=String(c+1)}if(h&&o&&o.monthsShort)u=o.monthsShort[c];else try{u=new Intl.DateTimeFormat(r,{month:"short"}).format(e)}catch{u=String(c+1)}const b={yyyy:String(s),yy:String(s).slice(-2),MMMM:l,MMM:u,MM:String(c+1).padStart(2,"0"),M:String(c+1),dd:String(n).padStart(2,"0"),d:String(n),HH:String(a).padStart(2,"0"),mm:String(i).padStart(2,"0")};return t.replace(/yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|mm/g,function(w){return b[w]!==void 0?b[w]:w})}function F(e,t,r,o){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const n=He(t);if(n)try{const c=new Intl.DateTimeFormat(r,n),s=(r||"").toLowerCase().split("-")[0],a=c.resolvedOptions().locale.toLowerCase().split("-")[0];return o&&a!==s?H(e,"dd.MM.yyyy",r,o):c.format(e)}catch{return H(e,"dd.MM.yyyy",r,o)}return H(e,t||"dd.MM.yyyy",r,o)}(function(){const e="data-ln-date",t="lnDate";if(window[t]!==void 0)return;function r(l){const u=l[t];if(u){if(u.isTextElement)u._initTextElement();else if(u.value){const d=_(u.value);d&&u._displayFormatted(d)}}}const o={"data-ln-date":{type:"enum",values:["short","medium","long","full","iso"],fallback:"medium",effect:r,description:"Date display style preset or activator"},"data-ln-date-format":{type:"string",effect:r,description:"Custom Intl.DateTimeFormat pattern or options"},"data-ln-date-locale":{type:"string",effect:r,description:"BCP 47 language tag override for date formatting"},"data-ln-value":{type:"string",effect:r,description:"Raw ISO date string or timestamp for non-time elements (td, span)"},"data-ln-date-dict":{type:"marker",description:"Container for date translation dictionary"},"data-ln-date-dict-key":{type:"string",description:"Dictionary key for relative time or custom date formatting"},"data-ln-date-field":{type:"string",description:"Field name mapping for date record binding"},"data-ln-date-label":{type:"string",description:"Accessible label text for the date input"}},n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function c(l,u,d){U(l.dom,"ln-date:change",{value:u,formatted:l.dom.value,date:d}),l.dom.dispatchEvent(new Event("change",{bubbles:!0}))}function s(l,u,d,h){l._setHiddenRaw(u),n.set.call(l._picker,u),l._lastISO=u,h!==void 0?(l._isFormatting=!0,l.dom.value=h,l._isFormatting=!1):d&&l._displayFormatted(d),c(l,u,d)}function a(l){l._setHiddenRaw(""),n.set.call(l._picker,""),l._isFormatting=!0,l.dom.value="",l._isFormatting=!1,l._lastISO="",c(l,"",null)}function i(l){if(l[t])return l[t];l[t]=this,this.dom=l;const u=this;if(this._onLocaleChange=function(){if(u.isTextElement)u._formatTextContent();else if(u.value){const f=_(u.value);f&&u._displayFormatted(f)}},Q(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),l.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;this.isTextElement=!1;const d=l.value,h=l.name,b=l.closest(".form-element, form")||l.parentNode;if(b){const f=b.querySelectorAll("[data-ln-date-dict]");for(let m=0;m<f.length;m++){const p=f[m].getAttribute("data-ln-date-dict");if(p){const y=_e(f[m],"data-ln-date-dict-key");y["months-long"]&&(y.monthsLong=y["months-long"].split(",").map(v=>v.trim())),y["months-short"]&&(y.monthsShort=y["months-short"].split(",").map(v=>v.trim())),J(p,y)}}}const w=document.createElement("span");w.setAttribute("data-ln-date-field",""),l.parentNode.insertBefore(w,l),w.appendChild(l),this._wrapper=w;const g=document.createElement("input");g.type="hidden",g.name=h,l.removeAttribute("name"),l.hasAttribute("data-ln-fill-as")&&g.setAttribute("data-ln-fill-as",l.getAttribute("data-ln-fill-as")),l.insertAdjacentElement("afterend",g),this._hidden=g;const C=document.createElement("input");C.type="date",C.tabIndex=-1,C.setAttribute("tabindex","-1"),C.setAttribute("aria-hidden","true"),C.setAttribute("aria-label",l.getAttribute("data-ln-date-label")||"Date picker"),C.style.cssText="position:absolute;opacity:0;width:0;height:0;overflow:hidden;pointer-events:none",g.insertAdjacentElement("afterend",C),this._picker=C,l.type="text";const A=document.createElement("button");A.type="button",A.setAttribute("aria-label",l.getAttribute("data-ln-date-label")||"Open date picker"),A.innerHTML='<svg class="ln-icon" aria-hidden="true"><use href="#ln-icon-calendar"></use></svg>',C.insertAdjacentElement("afterend",A),this._btn=A,this._lastISO="",Object.defineProperty(g,"value",{get:function(){return n.get.call(g)},set:function(f){if(n.set.call(g,f),f&&f!==""){const m=_(f);m&&s(u,f,m)}else f===""&&a(u)}}),pe(l,n,{get:function(){return n.get.call(l)},set:function(f,m){if(u._isFormatting){m(f);return}if(!f||f===""){m(""),a(u);return}const p=_(f)||O(f);if(p){const y=S(p),v=l.getAttribute(e)||"",x=N(l),L=E(x),k=F(p,v,x,L);m(k),s(u,y,p,k)}else m(String(f)),a(u)}}),this._onPickerChange=function(){const f=C.value;if(f){const m=_(f);m&&s(u,f,m)}else a(u)},C.addEventListener("change",this._onPickerChange),this._onBlur=function(){const f=u.dom.value.trim();if(f===""){u._lastISO!==""&&a(u);return}if(u._lastISO){const p=_(u._lastISO);if(p){const y=u.dom.getAttribute(e)||"",v=N(u.dom),x=E(v);if(f===F(p,y,v,x))return}}const m=O(f);if(m){const p=S(m);s(u,p,m)}else if(u._lastISO){const p=_(u._lastISO);p&&u._displayFormatted(p)}else u.dom.value=""},l.addEventListener("blur",this._onBlur),this._onBtnClick=function(){u._openPicker()},A.addEventListener("click",this._onBtnClick);const T=l.form;if(T&&(this._form=T,this._onFormReset=function(){setTimeout(function(){const f=u.dom.value;if(f){const m=_(f)||O(f);if(m){const p=S(m);s(u,p,m);return}}a(u)},0)},T.addEventListener("reset",this._onFormReset)),d&&d!==""){const f=_(d);f&&s(u,d,f)}return this}i.prototype._initTextElement=function(){const l=this.dom,u=l.getAttribute("data-ln-value"),d=l.getAttribute("data-ln-date"),h=l.getAttribute("datetime");let b=null;l.tagName==="TIME"&&h!==null&&h!==""?b=h:u!==null&&u!==""?b=u:h!==null&&h!==""?b=h:d!==null&&d!==""&&d!=="true"&&!P.test(d)?b=d:b=l.textContent.trim();const w=_(b)||O(b);if(w&&!isNaN(w.getTime())){const g=S(w);this._rawValue=g,l.tagName!=="TIME"&&!l.hasAttribute("data-ln-value")&&l.setAttribute("data-ln-value",g),this._formatTextContent()}else this._rawValue=null},i.prototype._formatTextContent=function(){if(this._rawValue){const l=_(this._rawValue);if(l){let d=this.dom.getAttribute("data-ln-date-format");if(!d){const w=this.dom.getAttribute("data-ln-date");w&&P.test(w)&&(d=w)}const h=N(this.dom),b=E(h);this.dom.textContent=F(l,d||"medium",h,b)}}},i.prototype._openPicker=function(){if(typeof this._picker.showPicker=="function")try{this._picker.showPicker()}catch{this._picker.click()}else this._picker.click()},i.prototype._setHiddenRaw=function(l){n.set.call(this._hidden,l)},i.prototype._displayFormatted=function(l){const u=this.dom.getAttribute(e)||"",d=N(this.dom),h=E(d);this._isFormatting=!0,this.dom.value=F(l,u,d,h),this._isFormatting=!1},Object.defineProperty(i.prototype,"value",{get:function(){return this.isTextElement?this._rawValue||"":n.get.call(this._hidden)},set:function(l){if(this.isTextElement){if(!l||l===""){this._rawValue=null,this.dom.removeAttribute("data-ln-value"),this.dom.tagName==="TIME"&&this.dom.removeAttribute("datetime"),this.dom.textContent="";return}const d=_(l)||O(l);if(!d)return;const h=S(d);this._rawValue=h,this.dom.tagName==="TIME"?this.dom.setAttribute("datetime",h):this.dom.setAttribute("data-ln-value",h),this._formatTextContent();return}if(!l||l===""){a(this);return}const u=_(l);u&&s(this,l,u)}}),Object.defineProperty(i.prototype,"date",{get:function(){const l=this.value;return l?_(l):null},set:function(l){if(!l||!(l instanceof Date)||isNaN(l.getTime())){this.value="";return}this.value=S(l)}}),Object.defineProperty(i.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:this.dom.value}}),i.prototype.destroy=function(){if(!this.dom[t])return;if(this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement){delete this.dom[t];return}this._form&&this._onFormReset&&this._form.removeEventListener("reset",this._onFormReset),this._picker.removeEventListener("change",this._onPickerChange),this.dom.removeEventListener("blur",this._onBlur),this._btn.removeEventListener("click",this._onBtnClick);const l=this.value;this._hidden.remove(),this._picker.remove(),this._btn.remove(),this._wrapper&&this._wrapper.parentNode&&(this._wrapper.parentNode.insertBefore(this.dom,this._wrapper),this._wrapper.remove()),delete this.dom.value,this.dom.name=this._hidden.name,this.dom.type="date",l&&(this.dom.value=l),delete this.dom[t]},ce(e,t,i,"ln-date",{attributes:o,extraAttributes:["datetime","lang"],onAttributeChange:r})})()})();
1
+ (function(){"use strict";function K(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function R(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 o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){i=t[o];break}if(!R(i))return}e.apply(console,t)}}function Q(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function N(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){N(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function me(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function pe(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,o={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(i&&r.matches&&r.matches(i)))if(r.type==="checkbox")n&&l[r.name]===1?o[r.name]=r.checked:(o[r.name]||(o[r.name]=[]),r.checked&&o[r.name].push(r.value));else if(r.type==="radio")r.checked&&(o[r.name]=r.value);else if(r.type==="select-multiple"){o[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&o[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")o[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);o[r.name]=r.value===""||isNaN(u)?null:u}else o[r.name]=r.value}return o}function we(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ge(e,t){const n=e.elements,i=[],o={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[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 r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(o[l.name]>1){const u=String(r).split(",").map(function(p){return p.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=we(r);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let u=0;u<l.options.length;u++)l.options[u].selected=r.indexOf(l.options[u].value)!==-1;i.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),i.push(l)}return i}function be(e,t,{get:n,set:i}){Object.defineProperty(e,"value",{get:function(){return n?n.call(this):t.get.call(this)},set:function(o){i?i.call(this,o,s=>t.set.call(this,s)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ge,window.lnCore.serializeForm=pe,window.lnCore.resolveFormMethod=me);const Y={};function ye(e,t){Y[e]=t}function Ce(e){return Y[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ye,window.lnCore.getDataMapper=Ce);function F(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function J(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,N(function(){new MutationObserver(function(){Q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const z={};function G(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];z[n]=t}function T(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return z[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=G,window.lnCore.getLocaleFallback=T,window.lnCore.ensureLocaleObserver=J);const B={};function _e(e,t){B[e]||(B[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=B[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function X(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const p=r[u].trim().split(":");if(p.length!==2)continue;const m=p[0].trim(),a=p[1].trim();t[a]!=null&&c.setAttribute(m,t[a])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const p=r[u].trim().split(":");if(p.length!==2)continue;const m=p[0].trim(),a=p[1].trim();a in t&&c.classList.toggle(m,!!t[a])}}return e}function ve(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[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)X(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function Z(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.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]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],c=l.attributes;for(let r=0;r<c.length;r++){const u=c[r];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Ae(e,t,n,i,o,s){const l={};for(let r=0;r<e.children.length;r++){const u=e.children[r],p=u.getAttribute("data-ln-render-key");p&&(l[p]=u)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],p=String(i(u));let m=l[p];if(m)o(m,u,r);else{const a=_e(n,s);if(!a||(Z(a,u),m=a.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",p),o(m,u,r)}c.appendChild(m)}e.textContent="",e.appendChild(c)}function xe(e,t){const n={},i=e.querySelectorAll("["+t+"]");for(let o=0;o<i.length;o++)n[i[o].getAttribute(t)]=i[o].textContent,i[o].remove();return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Z,window.lnCore.fill=X,window.lnCore.lnFill=ve,window.lnCore.renderList=Ae);function q(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function ee(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function te(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const o=i.trim().toLowerCase();return!(o==="false"||o==="0")}function ne(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const $=new Map;function re(e,t){const n=(e?e.join("|"):"")+"::"+t;if($.has(n))return $.get(n);const i=new Set(e||[]),o=function(s,l){const c=s.getAttribute(l);return c!==null&&i.has(c)?c:t};return $.set(n,o),o}function oe(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function ie(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function le(e,t,n,i,o){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=r=>{o?console.warn(r,o):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function Se(e,t,n){for(const i in n){const[o,s,l]=n[i];Object.defineProperty(e,i,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function ke(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let o=i.read;if(!o&&i.type)switch(i.type){case"enum":o=re(i.values,i.fallback);break;case"integer":o=ee;break;case"float":o=oe;break;case"boolean":o=te;break;case"list":o=ne;break;case"json":o=ie;break;case"string":default:o=q;break}o||(o=q),t[i.prop]=[o,n,i.fallback]}return t}function Ee(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=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 n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Se,window.lnCore.attrSpec=ke,window.lnCore.attrStr=q,window.lnCore.attrInt=ee,window.lnCore.attrBool=te,window.lnCore.attrList=ne,window.lnCore.attrEnum=re,window.lnCore.attrFloat=oe,window.lnCore.attrJson=ie);function L(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function se(e,t,n,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:i};if(e.matches&&e.matches(s)&&L(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)L(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Oe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Te(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 ae(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Le(e){const t=ae(),n=e.observed||[];for(let i=0;i<n.length;i++){const o=n[i];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 i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const o=t.byDeclaredAttr.get(i);o.some(s=>s.componentTag===e.componentTag)||o.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 o of i)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function ce(e,t,n,i){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,i):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,i)}}function Me(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,i=ae(),o=i.byAttr.get(t),s=K()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&R(l)){const c=i.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let u=0;u<c.length;u++)le(c[u].spec,r,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=i.byReactive.get(t);c&&ce(c,l,t,e.oldValue),i.reactiveWildcard.length&&ce(i.reactiveWildcard,l,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const r=o[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(se(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,N(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Me(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function V(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function P(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Fe(e){const t=V();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=j();if(e.target&&i.length)for(let o=0;o<i.length;o++){const s=i[o],l=s.query,c=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;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)s.matches&&s.matches(r.query)&&L(s,r);else if(s.matches&&s.matches(r.query)&&L(s,r),s.querySelectorAll){const u=s.querySelectorAll(r.query);for(let p=0;p<u.length;p++)L(u[p],r)}}r.onInit&&r.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],u=r.query;if(u){if(!l)s.matches&&s.matches(u)&&P(s,r);else if(s.matches&&s.matches(u)&&P(s,r),s.querySelectorAll){const p=s.querySelectorAll(u);for(let m=0;m<p.length;m++)P(p[m],r)}}}}}}function ue(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,N(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{Fe(i)}catch(o){console.error("[ln-core] lifecycle handler failed",i.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ie(e){V().push(e),e.onSubtreeChange&&e.query&&j().push(e),ue()}function de(e,t,n,i,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,r=o.onInit||null,u=o.onAttrChange||null,p=o.effects||null,m=o.attributes||null,a=m?Ee(m):p,d=m?new Set(Object.keys(m)):null,h=o.persist||null;function g(D){const f=D||document.body;if(se(f,e,t,n),m&&K())for(const w in m){const b=m[w],_=Array.from(f.querySelectorAll("["+w+"]"));f.matches&&f.matches("["+w+"]")&&_.push(f);for(let S=0;S<_.length;S++){const E=_[S];R(E)&&le(b,E.getAttribute(w),w,i,E)}}r&&r(f)}const y=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let f;for(;(f=D.exec(e))!==null;)y.push(f[1])}else y.push(e);Le({selector:e,attribute:t,componentTag:i,attributes:m,ComponentFn:n,onInit:r,observed:y.concat(s),onAttributeChange:l,onAttrChange:u,effects:a,declared:d,persist:h}),Ne();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=o.subtreeQuery||(A?e:"["+e+"]"),x={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:C};V().push(x),c&&C&&j().push(x),ue(),window[t]=g,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=de,window.lnCore.observeLifecycle=Ie);function k(){Oe()>0?Te(function(){g(document.body)}):g(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k(),g}function fe(e){return(e||"").replace(/^#/,"")}function H(e){const t=e===void 0?location.hash:e,n={},i=fe(t);if(!i)return n;const o=i.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function Re(e){if(!e)return null;const t=H();return e in t?t[e]:null}function Be(e,t){if(!e)return;const n=H();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");fe(location.hash)!==o&&(location.hash=o)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function $e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const 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 je(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 Pe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function He(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),o=i?i.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=H,window.lnCore.hashGet=Re,window.lnCore.hashSet=Be,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=$e,window.lnCore.hashSortEncode=Ve,window.lnCore.hashSortDecode=je,window.lnCore.hashFilterEncode=Pe,window.lnCore.hashFilterDecode=He);function We(){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=We);function v(e){if(e==null||e==="")return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;const t=Number(e);if(!isNaN(t)&&t>0){const n=t<1e11?t*1e3:t,i=new Date(n);return isNaN(i.getTime())?null:i}if(typeof e=="string"){const n=e.trim();if(!n)return null;const i=/^(\d{4})-(\d{2})-(\d{2})$/.exec(n);if(i){const s=+i[1],l=+i[2],c=+i[3],r=new Date(s,l-1,c);return r.getFullYear()!==s||r.getMonth()!==l-1||r.getDate()!==c?null:r}const o=new Date(n);return isNaN(o.getTime())?null:o}return null}function O(e){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return t+"-"+n+"-"+i}const W=/^(short|medium|long)(\s+datetime)?$/,Ue={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},"short datetime":{dateStyle:"short",timeStyle:"short"},"medium datetime":{dateStyle:"medium",timeStyle:"short"},"long datetime":{dateStyle:"long",timeStyle:"short"}};function Ke(e){return!e||e===""?{dateStyle:"medium"}:String(e).trim().match(W)?Ue[e.trim()]:null}function M(e){if(!e||typeof e!="string")return null;const t=e.trim();if(t.length<6)return null;let n,i;if(t.indexOf(".")!==-1)n=".",i=t.split(".");else if(t.indexOf("/")!==-1)n="/",i=t.split("/");else if(t.indexOf("-")!==-1)n="-",i=t.split("-");else return null;if(i.length!==3)return null;const o=[];for(let u=0;u<3;u++){const p=parseInt(i[u],10);if(isNaN(p))return null;o.push(p)}let s,l,c;n==="."?(s=o[0],l=o[1],c=o[2]):n==="/"?(l=o[0],s=o[1],c=o[2]):i[0].length===4?(c=o[0],l=o[1],s=o[2]):(s=o[0],l=o[1],c=o[2]),c<100&&(c+=c<50?2e3:1900);const r=new Date(c,l-1,s);return r.getFullYear()!==c||r.getMonth()!==l-1||r.getDate()!==s?null:r}function U(e,t,n,i){if(!e||!(e instanceof Date)||isNaN(e.getTime())||!t||typeof t!="string")return"";const o=e.getDate(),s=e.getMonth(),l=e.getFullYear(),c=e.getHours(),r=e.getMinutes();let u,p;const m=(n||"").toLowerCase().split("-")[0];let a=!1;try{const g=new Intl.DateTimeFormat(n,{month:"long"}).resolvedOptions().locale.toLowerCase().split("-")[0];a=!!(i&&g!==m)}catch{a=!!i}if(a&&i&&i.monthsLong)u=i.monthsLong[s];else try{u=new Intl.DateTimeFormat(n,{month:"long"}).format(e)}catch{u=String(s+1)}if(a&&i&&i.monthsShort)p=i.monthsShort[s];else try{p=new Intl.DateTimeFormat(n,{month:"short"}).format(e)}catch{p=String(s+1)}const d={yyyy:String(l),yy:String(l).slice(-2),MMMM:u,MMM:p,MM:String(s+1).padStart(2,"0"),M:String(s+1),dd:String(o).padStart(2,"0"),d:String(o),HH:String(c).padStart(2,"0"),mm:String(r).padStart(2,"0")};return t.replace(/yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|mm/g,function(h){return d[h]!==void 0?d[h]:h})}function I(e,t,n,i){if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";const o=Ke(t);if(o)try{const s=new Intl.DateTimeFormat(n,o),l=(n||"").toLowerCase().split("-")[0],c=s.resolvedOptions().locale.toLowerCase().split("-")[0];return i&&c!==l?U(e,"dd.MM.yyyy",n,i):s.format(e)}catch{return U(e,"dd.MM.yyyy",n,i)}return U(e,t||"dd.MM.yyyy",n,i)}(function(){const e="data-ln-date",t="lnDate";if(window[t]!==void 0)return;function n(a){const d=a[t];if(d){if(d.isTextElement)d._initTextElement();else if(d.value){const h=v(d.value);h&&d._displayFormatted(h)}}}const i={"data-ln-date":{type:"enum",values:["short","medium","long","full","iso"],fallback:"medium",effect:n,description:"Date display style preset or activator"},"data-ln-date-format":{type:"string",effect:n,description:"Custom Intl.DateTimeFormat pattern or options"},"data-ln-date-locale":{type:"string",effect:n,description:"BCP 47 language tag override for date formatting"},"data-ln-value":{type:"string",effect:n,description:"Raw ISO date string or timestamp for non-time elements (td, span)"},"data-ln-date-dict":{type:"marker",description:"Container for date translation dictionary"},"data-ln-date-dict-key":{type:"string",description:"Dictionary key for relative time or custom date formatting"},"data-ln-date-field":{type:"string",description:"Field name mapping for date record binding"},"data-ln-date-label":{type:"string",description:"Accessible label text for the date input"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function s(a,d,h){Q(a.dom,"ln-date:change",{value:d,formatted:a.dom.value,date:h}),a.dom.dispatchEvent(new Event("change",{bubbles:!0}))}function l(a,d,h,g){a._setHiddenRaw(d),o.set.call(a._picker,d),a._lastISO=d,g!==void 0?(a._isFormatting=!0,a.dom.value=g,a._isFormatting=!1):h&&a._displayFormatted(h),s(a,d,h)}function c(a){a._setHiddenRaw(""),o.set.call(a._picker,""),a._isFormatting=!0,a.dom.value="",a._isFormatting=!1,a._lastISO="",s(a,"",null)}const r=new Set;let u=!1;function p(){J(),!u&&(u=!0,document.addEventListener("ln-core:locale-change",function(){r.forEach(function(a){if(a.isTextElement)a._formatTextContent();else if(a.value){const d=v(a.value);d&&a._displayFormatted(d)}})}))}function m(a){if(a[t])return a[t];a[t]=this,this.dom=a;const d=this;if(r.add(this),p(),a.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;this.isTextElement=!1;const h=a.value,g=a.name,y=a.closest(".form-element, form")||a.parentNode;if(y){const f=y.querySelectorAll("[data-ln-date-dict]");for(let w=0;w<f.length;w++){const b=f[w].getAttribute("data-ln-date-dict");if(b){const _=xe(f[w],"data-ln-date-dict-key");_["months-long"]&&(_.monthsLong=_["months-long"].split(",").map(S=>S.trim())),_["months-short"]&&(_.monthsShort=_["months-short"].split(",").map(S=>S.trim())),G(b,_)}}}const A=document.createElement("span");A.setAttribute("data-ln-date-field",""),a.parentNode.insertBefore(A,a),A.appendChild(a),this._wrapper=A;const C=document.createElement("input");C.type="hidden",C.name=g,a.removeAttribute("name"),a.hasAttribute("data-ln-fill-as")&&C.setAttribute("data-ln-fill-as",a.getAttribute("data-ln-fill-as")),a.insertAdjacentElement("afterend",C),this._hidden=C;const x=document.createElement("input");x.type="date",x.tabIndex=-1,x.setAttribute("tabindex","-1"),x.setAttribute("aria-hidden","true"),x.setAttribute("aria-label",a.getAttribute("data-ln-date-label")||"Date picker"),x.style.cssText="position:absolute;opacity:0;width:0;height:0;overflow:hidden;pointer-events:none",C.insertAdjacentElement("afterend",x),this._picker=x,a.type="text";const k=document.createElement("button");k.type="button",k.setAttribute("aria-label",a.getAttribute("data-ln-date-label")||"Open date picker"),k.innerHTML='<svg class="ln-icon" aria-hidden="true"><use href="#ln-icon-calendar"></use></svg>',x.insertAdjacentElement("afterend",k),this._btn=k,this._lastISO="",Object.defineProperty(C,"value",{get:function(){return o.get.call(C)},set:function(f){if(o.set.call(C,f),f&&f!==""){const w=v(f);w&&l(d,f,w)}else f===""&&c(d)}}),be(a,o,{get:function(){return o.get.call(a)},set:function(f,w){if(d._isFormatting){w(f);return}if(!f||f===""){w(""),c(d);return}const b=v(f)||M(f);if(b){const _=O(b),S=a.getAttribute(e)||"",E=F(a),Qe=T(E),he=I(b,S,E,Qe);w(he),l(d,_,b,he)}else w(String(f)),c(d)}}),this._onPickerChange=function(){const f=x.value;if(f){const w=v(f);w&&l(d,f,w)}else c(d)},x.addEventListener("change",this._onPickerChange),this._onBlur=function(){const f=d.dom.value.trim();if(f===""){d._lastISO!==""&&c(d);return}if(d._lastISO){const b=v(d._lastISO);if(b){const _=d.dom.getAttribute(e)||"",S=F(d.dom),E=T(S);if(f===I(b,_,S,E))return}}const w=M(f);if(w){const b=O(w);l(d,b,w)}else if(d._lastISO){const b=v(d._lastISO);b&&d._displayFormatted(b)}else d.dom.value=""},a.addEventListener("blur",this._onBlur),this._onBtnClick=function(){d._openPicker()},k.addEventListener("click",this._onBtnClick);const D=a.form;if(D&&(this._form=D,this._onFormReset=function(){setTimeout(function(){const f=d.dom.value;if(f){const w=v(f)||M(f);if(w){const b=O(w);l(d,b,w);return}}c(d)},0)},D.addEventListener("reset",this._onFormReset)),h&&h!==""){const f=v(h);f&&l(d,h,f)}return this}m.prototype._initTextElement=function(){const a=this.dom,d=a.getAttribute("data-ln-value"),h=a.getAttribute("data-ln-date"),g=a.getAttribute("datetime");let y=null;a.tagName==="TIME"&&g!==null&&g!==""?y=g:d!==null&&d!==""?y=d:g!==null&&g!==""?y=g:h!==null&&h!==""&&h!=="true"&&!W.test(h)?y=h:y=a.textContent.trim();const A=v(y)||M(y);if(A&&!isNaN(A.getTime())){const C=O(A);this._rawValue=C,a.tagName!=="TIME"&&!a.hasAttribute("data-ln-value")&&a.setAttribute("data-ln-value",C),this._formatTextContent()}else this._rawValue=null},m.prototype._formatTextContent=function(){if(this._rawValue){const a=v(this._rawValue);if(a){let h=this.dom.getAttribute("data-ln-date-format");if(!h){const A=this.dom.getAttribute("data-ln-date");A&&W.test(A)&&(h=A)}const g=F(this.dom),y=T(g);this.dom.textContent=I(a,h||"medium",g,y)}}},m.prototype._openPicker=function(){if(typeof this._picker.showPicker=="function")try{this._picker.showPicker()}catch{this._picker.click()}else this._picker.click()},m.prototype._setHiddenRaw=function(a){o.set.call(this._hidden,a)},m.prototype._displayFormatted=function(a){const d=this.dom.getAttribute(e)||"",h=F(this.dom),g=T(h);this._isFormatting=!0,this.dom.value=I(a,d,h,g),this._isFormatting=!1},Object.defineProperty(m.prototype,"value",{get:function(){return this.isTextElement?this._rawValue||"":o.get.call(this._hidden)},set:function(a){if(this.isTextElement){if(!a||a===""){this._rawValue=null,this.dom.removeAttribute("data-ln-value"),this.dom.tagName==="TIME"&&this.dom.removeAttribute("datetime"),this.dom.textContent="";return}const h=v(a)||M(a);if(!h)return;const g=O(h);this._rawValue=g,this.dom.tagName==="TIME"?this.dom.setAttribute("datetime",g):this.dom.setAttribute("data-ln-value",g),this._formatTextContent();return}if(!a||a===""){c(this);return}const d=v(a);d&&l(this,a,d)}}),Object.defineProperty(m.prototype,"date",{get:function(){const a=this.value;return a?v(a):null},set:function(a){if(!a||!(a instanceof Date)||isNaN(a.getTime())){this.value="";return}this.value=O(a)}}),Object.defineProperty(m.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:this.dom.value}}),m.prototype.destroy=function(){if(!this.dom[t])return;if(r.delete(this),this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement){delete this.dom[t];return}this._form&&this._onFormReset&&this._form.removeEventListener("reset",this._onFormReset),this._picker.removeEventListener("change",this._onPickerChange),this.dom.removeEventListener("blur",this._onBlur),this._btn.removeEventListener("click",this._onBtnClick);const a=this.value;this._hidden.remove(),this._picker.remove(),this._btn.remove(),this._wrapper&&this._wrapper.parentNode&&(this._wrapper.parentNode.insertBefore(this.dom,this._wrapper),this._wrapper.remove()),delete this.dom.value,this.dom.name=this._hidden.name,this.dom.type="date",a&&(this.dom.value=a),delete this.dom[t]},de(e,t,m,"ln-date",{attributes:i,extraAttributes:["datetime","lang"],onAttributeChange:n})})()})();
@@ -85,24 +85,33 @@ import {
85
85
 
86
86
  // ─── Component Constructor & Methods ──────────────────────
87
87
 
88
+ const _instances = new Set();
89
+ let _localeListenerBound = false;
90
+
91
+ function _ensureLocaleListener() {
92
+ ensureLocaleObserver();
93
+ if (_localeListenerBound) return;
94
+ _localeListenerBound = true;
95
+ document.addEventListener('ln-core:locale-change', function () {
96
+ _instances.forEach(function (inst) {
97
+ if (inst.isTextElement) {
98
+ inst._formatTextContent();
99
+ } else if (inst.value) {
100
+ const date = parseDateInput(inst.value);
101
+ if (date) inst._displayFormatted(date);
102
+ }
103
+ });
104
+ });
105
+ }
106
+
88
107
  function _component(dom) {
89
108
  if (dom[DOM_ATTRIBUTE]) return dom[DOM_ATTRIBUTE];
90
109
  dom[DOM_ATTRIBUTE] = this;
91
110
 
92
111
  this.dom = dom;
93
112
  const self = this;
94
-
95
- // Subscribe to global locale changes
96
- this._onLocaleChange = function () {
97
- if (self.isTextElement) {
98
- self._formatTextContent();
99
- } else if (self.value) {
100
- const date = parseDateInput(self.value);
101
- if (date) self._displayFormatted(date);
102
- }
103
- };
104
- ensureLocaleObserver();
105
- document.addEventListener('ln-core:locale-change', this._onLocaleChange);
113
+ _instances.add(this);
114
+ _ensureLocaleListener();
106
115
 
107
116
  if (dom.tagName !== 'INPUT') {
108
117
  this.isTextElement = true;
@@ -448,6 +457,7 @@ import {
448
457
 
449
458
  _component.prototype.destroy = function () {
450
459
  if (!this.dom[DOM_ATTRIBUTE]) return;
460
+ _instances.delete(this);
451
461
  if (this._onLocaleChange) {
452
462
  document.removeEventListener('ln-core:locale-change', this._onLocaleChange);
453
463
  }