@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 $(){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 q(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(!q(o))return}e.apply(console,t)}}function x(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 ue(e,t,i){const o=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const n=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(n),n}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(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 i=!!(t&&t.typed),o=t&&t.exclude,n={},c=e.elements,l={};if(i)for(let s=0;s<c.length;s++){const r=c[s];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let s=0;s<c.length;s++){const r=c[s];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")i&&l[r.name]===1?n[r.name]=r.checked:(n[r.name]||(n[r.name]=[]),r.checked&&n[r.name].push(r.value));else if(r.type==="radio")r.checked&&(n[r.name]=r.value);else if(r.type==="select-multiple"){n[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&n[r.name].push(r.options[d].value)}else if(i&&r.type==="hidden")n[r.name]=r.value;else if(i&&(r.type==="number"||r.type==="range")){const d=Number(r.value);n[r.name]=r.value===""||isNaN(d)?null:d}else n[r.name]=r.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 we(e,t){const i=e.elements,o=[],n={};for(let c=0;c<i.length;c++){const l=i[c];l.name&&l.type==="checkbox"&&(n[l.name]=(n[l.name]||0)+1)}for(let c=0;c<i.length;c++){const l=i[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const r=t[s];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(n[l.name]>1){const d=String(r).split(",").map(function(b){return b.trim()});l.checked=d.indexOf(l.value)!==-1}else l.checked=he(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let d=0;d<l.options.length;d++)l.options[d].selected=r.indexOf(l.options[d].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=we,window.lnCore.serializeForm=fe,window.lnCore.resolveFormMethod=de);const j={};function pe(e,t){j[e]=t}function be(e){return j[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=pe,window.lnCore.getDataMapper=be);function me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function ge(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];P[i]=t}function _e(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return P[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ge,window.lnCore.getLocaleFallback=_e,window.lnCore.ensureLocaleObserver=me);const N={};function U(e,t){N[e]||(N[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=N[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function Ce(e,t,i){if(e){const o=e.querySelector('[data-ln-template="'+t+'"]');if(o)return o.content.cloneNode(!0)}return U(t,i)}function W(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let l=0;l<i.length;l++){const s=i[l],r=s.getAttribute("data-ln-field");t[r]!=null&&(s.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const s=o[l],r=s.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const b=r[d].trim().split(":");if(b.length!==2)continue;const _=b[0].trim(),v=b[1].trim();t[v]!=null&&s.setAttribute(_,t[v])}}const n=e.querySelectorAll("[data-ln-show]");for(let l=0;l<n.length;l++){const s=n[l],r=s.getAttribute("data-ln-show");r in t&&s.classList.toggle("hidden",!t[r])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],r=s.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const b=r[d].trim().split(":");if(b.length!==2)continue;const _=b[0].trim(),v=b[1].trim();v in t&&s.classList.toggle(_,!!t[v])}}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 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)W(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 K(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(l,s){return t[s]!==void 0?t[s]:""}))}const o=function(c,l){return t[l]!==void 0?t[l]:""},n=Array.from(e.querySelectorAll("*"));e.nodeType===1&&n.push(e);for(let c=0;c<n.length;c++){const l=n[c],s=l.attributes;for(let r=0;r<s.length;r++){const d=s[r];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function ve(e,t,i,o,n,c){const l={};for(let r=0;r<e.children.length;r++){const d=e.children[r],b=d.getAttribute("data-ln-render-key");b&&(l[b]=d)}const s=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],b=String(o(d));let _=l[b];if(_)n(_,d,r);else{const v=U(i,c);if(!v||(K(v,d),_=v.firstElementChild,!_))continue;_.setAttribute("data-ln-render-key",b),n(_,d,r)}s.appendChild(_)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=K,window.lnCore.fill=W,window.lnCore.lnFill=ye,window.lnCore.renderList=ve);function M(e,t,i){const o=e.getAttribute(t);return o===null?i:o}function V(e,t,i){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?i:o}function Q(e,t,i=!1){const o=e.getAttribute(t);if(o===null)return!!i;const n=o.trim().toLowerCase();return!(n==="false"||n==="0")}function z(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const I=new Map;function J(e,t){const i=(e?e.join("|"):"")+"::"+t;if(I.has(i))return I.get(i);const o=new Set(e||[]),n=function(c,l){const s=c.getAttribute(l);return s!==null&&o.has(s)?s:t};return I.set(i,n),n}function G(e,t,i){const o=parseFloat(e.getAttribute(t));return isNaN(o)?i:o}function X(e,t,i){const o=e.getAttribute(t);if(!o)return i;try{return JSON.parse(o)}catch{return i}}function Y(e,t,i,o,n){if(!e||t===null)return!0;const c=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=r=>{n?console.warn(r,n):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${i}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(s(`[${c}] Value ${r} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(s(`[${c}] Value ${r} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return s(`[${c}] Invalid JSON for attribute "${i}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function Ae(e,t,i){for(const o in i){const[n,c,l]=i[o];Object.defineProperty(e,o,{get:function(){return n(t,c,l)},enumerable:!0,configurable:!0})}return e}function xe(e){const t={};for(const i in e){const o=e[i];if(!o||!o.prop)continue;let n=o.read;if(!n&&o.type)switch(o.type){case"enum":n=J(o.values,o.fallback);break;case"integer":n=V;break;case"float":n=G;break;case"boolean":n=Q;break;case"list":n=z;break;case"json":n=X;break;case"string":default:n=M;break}n||(n=M),t[o.prop]=[n,i,o.fallback]}return t}function Se(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 ke(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=Ae,window.lnCore.attrSpec=xe,window.lnCore.attrStr=M,window.lnCore.attrInt=V,window.lnCore.attrBool=Q,window.lnCore.attrList=z,window.lnCore.attrEnum=J,window.lnCore.attrFloat=G,window.lnCore.attrJson=X);function k(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 Z(e,t,i,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:i,ComponentFn:o};if(e.matches&&e.matches(c)&&k(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let r=0;r<s.length;r++)k(s[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Le(){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 ee(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ee(e){const t=ee(),i=e.observed||[];for(let o=0;o<i.length;o++){const n=i[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=ke(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 te(e,t,i,o){for(let n=0;n<e.length;n++){const c=e[n];if(!t[c.attribute])continue;const l=c.effects&&c.effects[i];l?l(t,i,o):c.onAttrChange&&(!c.declared||c.declared.has(i))&&c.onAttrChange(t,i,o)}}function Oe(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,o=ee(),n=o.byAttr.get(t),c=$()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!i&&!n&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&q(l)){const s=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let d=0;d<s.length;d++)Y(s[d].spec,r,t,s[d].componentTag,l)}if(window.lnCore._debugSink&&(i||n)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),i){const s=o.byReactive.get(t);s&&te(s,l,t,e.oldValue),o.reactiveWildcard.length&&te(o.reactiveWildcard,l,t,e.oldValue)}if(n)for(let s=0;s<n.length;s++){const r=n[s];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(Z(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{Oe(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 B(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function F(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 qe(e){const t=B();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 n=t[o];if(n.onSubtreeChange&&n.query){const c=n.query,l=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;l&&n.onSubtreeChange(l,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 l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)n.matches&&n.matches(s.query)&&k(n,s);else if(n.matches&&n.matches(s.query)&&k(n,s),n.querySelectorAll){const r=n.querySelectorAll(s.query);for(let d=0;d<r.length;d++)k(r[d],s)}}s.onInit&&s.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 l=0;l<t.length;l++){const s=t[l],r=s.query;if(r){if(!c)n.matches&&n.matches(r)&&F(n,s);else if(n.matches&&n.matches(r)&&F(n,s),n.querySelectorAll){const d=n.querySelectorAll(r);for(let b=0;b<d.length;b++)F(d[b],s)}}}}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const o=t[i];if(o.type==="childList")try{qe(o)}catch(n){console.error("[ln-core] lifecycle handler failed",o.target,n)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ne(e){B().push(e),ne()}function re(e,t,i,o,n={}){const c=n.extraAttributes||[],l=n.onAttributeChange||null,s=n.onSubtreeChange||null,r=n.onInit||null,d=n.onAttrChange||null,b=n.effects||null,_=n.attributes||null,v=_?Se(_):b,H=_?new Set(Object.keys(_)):null,O=n.persist||null;function S(h){const m=h||document.body;if(Z(m,e,t,i),_&&$())for(const w in _){const C=_[w],p=Array.from(m.querySelectorAll("["+w+"]"));m.matches&&m.matches("["+w+"]")&&p.push(m);for(let g=0;g<p.length;g++){const A=p[g];q(A)&&Y(C,A.getAttribute(w),w,o,A)}}r&&r(m)}const L=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let m;for(;(m=h.exec(e))!==null;)L.push(m[1])}else L.push(e);Ee({selector:e,attribute:t,componentTag:o,attributes:_,ComponentFn:i,onInit:r,observed:L.concat(c),onAttributeChange:l,onAttrChange:d,effects:v,declared:H,persist:O}),De();const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,a=n.subtreeQuery||(u?e:"["+e+"]");B().push({selector:e,attribute:t,ComponentFn:i,onInit:r,onSubtreeChange:s,query:a}),ne(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=re,window.lnCore.observeLifecycle=Ne);function f(){Le()>0?Te(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f(),S}function oe(e){return(e||"").replace(/^#/,"")}function R(e){const t=e===void 0?location.hash:e,i={},o=oe(t);if(!o)return i;const n=o.split("&");for(let c=0;c<n.length;c++){const l=n[c];if(!l)continue;const s=l.indexOf(":"),r=s>-1?l.slice(0,s):l,d=s>-1?l.slice(s+1):"";if(r)try{i[r]=decodeURIComponent(d)}catch{i[r]=d}}return i}function Me(e){if(!e)return null;const t=R();return e in t?t[e]:null}function Ie(e,t){if(!e)return;const i=R();t==null?delete i[e]:i[e]=String(t);const n=Object.keys(i).map(function(c){const l=i[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");oe(location.hash)!==n&&(location.hash=n)}function Be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Fe(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 Re(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function He(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 je(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),n=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:i,values:n}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=R,window.lnCore.hashGet=Me,window.lnCore.hashSet=Ie,window.lnCore.hashLinkClick=Be,window.lnCore.resolveHashNamespace=Fe,window.lnCore.hashSortEncode=Re,window.lnCore.hashSortDecode=He,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=je);function Pe(){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=Pe),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const i={"data-ln-editor":{type:"marker",description:"Mounts rich text editor instance on container"},"data-ln-editor-action":{type:"enum",values:["bold","italic","underline","strikethrough","heading-2","heading-3","heading-4","blockquote","code","paragraph","ordered-list","unordered-list","link","unlink","clear","confirm-link","cancel-link"],description:"Rich text toolbar formatting action"},"data-ln-editor-source":{type:"string",description:"Selector or ID of backing textarea synchronized with editor content"}},o={P:!0,BR:!0,STRONG:!0,B:!0,EM:!0,I:!0,U:!0,S:!0,A:!0,UL:!0,OL:!0,LI:!0,H2:!0,H3:!0,H4:!0,BLOCKQUOTE:!0,PRE:!0,CODE:!0,DIV:!0},n={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},c={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},l={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let s=0;function r(u){return!!(n[u]||c[u]||l[u]||u==="link")}function d(u){this.dom=u;const a=this;if(this._textarea=u.querySelector("textarea"),!this._textarea)return console.warn("[ln-editor] No <textarea> found inside",u),this;const f=this._textarea.getAttribute("placeholder")||"";this._textarea.setAttribute("data-ln-editor-source",""),this._surface=document.createElement("div"),this._surface.className="ln-editor__surface",this._surface.setAttribute("contenteditable","true"),this._surface.setAttribute("role","textbox"),this._surface.setAttribute("aria-multiline","true"),f&&this._surface.setAttribute("data-placeholder",f);const h=this._textarea.id;if(h){const p=u.querySelector('label[for="'+h+'"]');p&&(p.id||(p.id=h+"-label"),this._surface.setAttribute("aria-labelledby",p.id))}this._surface.id=h?h+"-surface":"ln-editor-surface-"+ ++s;const m=this._textarea.value.trim();m&&(this._surface.innerHTML=m);const w=u.querySelector('[role="toolbar"]');if(w&&w.nextSibling?u.insertBefore(this._surface,w.nextSibling):u.appendChild(this._surface),w){w.setAttribute("aria-controls",this._surface.id);const p=w.querySelectorAll("[data-ln-editor-action]");for(let g=0;g<p.length;g++){const A=p[g].getAttribute("data-ln-editor-action");r(A)&&p[g].setAttribute("aria-pressed","false")}}this._onInput=function(){a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom})},this._onMousedownToolbar=function(p){p.target.closest("[data-ln-editor-action]")&&p.preventDefault()},this._onClickToolbar=function(p){const g=p.target.closest("[data-ln-editor-action]");if(!g)return;const A=g.getAttribute("data-ln-editor-action");a._execAction(A)},this._onPaste=function(p){v(a,p)},this._onKeydown=function(p){S(a,p)},this._listeningSelection=!1,this._rafSelection=null,this._onSelectionChange=function(){a._rafSelection||(a._rafSelection=requestAnimationFrame(function(){a._rafSelection=null,document.contains(a._surface)&&a._updateActiveStates()}))},this._attachSelection=function(){a._listeningSelection||(a._listeningSelection=!0,document.addEventListener("selectionchange",a._onSelectionChange))},this._detachSelection=function(){a._listeningSelection&&(a._listeningSelection=!1,document.removeEventListener("selectionchange",a._onSelectionChange)),a._rafSelection&&(cancelAnimationFrame(a._rafSelection),a._rafSelection=null)},this._onFocus=function(){a._attachSelection(),a._updateActiveStates(),x(a.dom,"ln-editor:focus",{target:a.dom})},this._onBlur=function(){a._detachSelection(),a._syncToTextarea(),x(a.dom,"ln-editor:blur",{target:a.dom})},this._onTextareaInput=function(){a._surface.innerHTML!==a._textarea.value&&(a._surface.innerHTML=a._textarea.value,x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},this._surface.addEventListener("input",this._onInput),this._surface.addEventListener("paste",this._onPaste),this._surface.addEventListener("keydown",this._onKeydown),this._surface.addEventListener("focus",this._onFocus),this._surface.addEventListener("blur",this._onBlur),this._textarea.addEventListener("input",this._onTextareaInput),w&&(w.addEventListener("mousedown",this._onMousedownToolbar),w.addEventListener("click",this._onClickToolbar)),this._onSetContent=function(p){const g=p.detail&&p.detail.html;g!==void 0&&(a._surface.innerHTML=g,a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},u.addEventListener("ln-editor:set-content",this._onSetContent);const C=this._textarea.form;return C&&(this._onFormReset=function(){setTimeout(function(){a._surface.innerHTML=a._textarea.value,x(u,"ln-editor:changed",{html:a._textarea.value,target:u})},0)},C.addEventListener("reset",this._onFormReset)),this}d.prototype._syncToTextarea=function(){this._textarea&&(this._textarea.value=this._surface.innerHTML)},d.prototype._execAction=function(u){if(!(!u||ue(this.dom,"ln-editor:before-change",{action:u,target:this.dom}).defaultPrevented)){if(this._surface.focus(),n[u])document.execCommand(n[u],!1,null);else if(c[u]){const f=c[u],h=b(this._surface);h&&h.toLowerCase()===f?document.execCommand("formatBlock",!1,"<p>"):document.execCommand("formatBlock",!1,"<"+f+">")}else l[u]?document.execCommand(l[u],!1,null):u==="link"?L(this):u==="unlink"?document.execCommand("unlink",!1,null):u==="clear"&&(document.execCommand("removeFormat",!1,null),document.execCommand("formatBlock",!1,"<p>"));this._syncToTextarea(),this._updateActiveStates()}},d.prototype._updateActiveStates=function(){const u=this.dom.querySelector('[role="toolbar"]');if(!u)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=a.anchorNode;if(!f||!this._surface.contains(f))return;const h=u.querySelectorAll("[data-ln-editor-action]");for(let m=0;m<h.length;m++){const w=h[m],C=w.getAttribute("data-ln-editor-action");let p=!1;if(n[C])try{p=document.queryCommandState(n[C])}catch{}else if(c[C]){const g=b(this._surface);p=g&&g.toLowerCase()===c[C]}else if(l[C])try{p=document.queryCommandState(l[C])}catch{}else C==="link"&&(p=!!_(a.anchorNode,"A",this._surface));if(r(C)){const g=String(p);w.getAttribute("aria-pressed")!==g&&w.setAttribute("aria-pressed",g)}p?w.classList.contains("ln-editor-active")||w.classList.add("ln-editor-active"):w.classList.contains("ln-editor-active")&&w.classList.remove("ln-editor-active")}},d.prototype.getHTML=function(){return this._surface?this._surface.innerHTML:""},d.prototype.setHTML=function(u){this._surface&&(this._surface.innerHTML=u,this._syncToTextarea(),x(this.dom,"ln-editor:changed",{html:this._textarea.value,target:this.dom}))},d.prototype.destroy=function(){if(!this.dom[t])return;this._surface&&(this._surface.removeEventListener("input",this._onInput),this._surface.removeEventListener("paste",this._onPaste),this._surface.removeEventListener("keydown",this._onKeydown),this._surface.removeEventListener("focus",this._onFocus),this._surface.removeEventListener("blur",this._onBlur),this._surface.remove());const u=this.dom.querySelector('[role="toolbar"]');u&&(u.removeEventListener("mousedown",this._onMousedownToolbar),u.removeEventListener("click",this._onClickToolbar)),this._detachSelection?this._detachSelection():document.removeEventListener("selectionchange",this._onSelectionChange),this.dom.removeEventListener("ln-editor:set-content",this._onSetContent);const a=this._textarea?this._textarea.form:null;if(a&&this._onFormReset&&a.removeEventListener("reset",this._onFormReset),this._textarea&&(this._onTextareaInput&&this._textarea.removeEventListener("input",this._onTextareaInput),this._textarea.removeAttribute("data-ln-editor-source")),this._closeLinkPopover)this._closeLinkPopover();else{const f=this.dom.querySelector(".ln-editor__link-popover");f&&f.remove()}delete this.dom[t]};function b(u){const a=window.getSelection();if(!a||a.rangeCount===0)return null;let f=a.anchorNode;if(!f)return null;for(;f&&f!==u;){if(f.nodeType===1){const h=f.tagName;if(h==="H2"||h==="H3"||h==="H4"||h==="BLOCKQUOTE"||h==="PRE"||h==="P")return h}f=f.parentNode}return null}function _(u,a,f){for(;u&&u!==f;){if(u.nodeType===1&&u.tagName===a)return u;u=u.parentNode}return null}function v(u,a){a.preventDefault();let f="";if(a.clipboardData&&(f=a.clipboardData.getData("text/html"),!f)){const m=a.clipboardData.getData("text/plain");m&&(f=m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>"),f="<p>"+f+"</p>")}if(!f)return;const h=H(f);h&&document.execCommand("insertHTML",!1,h)}function H(u){const a=document.createElement("div");return a.innerHTML=u,O(a),a.innerHTML}function O(u){const a=Array.from(u.childNodes);for(let f=0;f<a.length;f++){const h=a[f];if(h.nodeType!==3){if(h.nodeType!==1){u.removeChild(h);continue}if(o[h.tagName]){const m=Array.from(h.attributes);for(let w=0;w<m.length;w++){const C=m[w].name;if(h.tagName==="A"&&C==="href"){const p=h.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(p)||h.removeAttribute("href")}else h.removeAttribute(C)}h.tagName==="A"&&h.setAttribute("rel","noopener noreferrer"),O(h)}else{for(;h.firstChild;)u.insertBefore(h.firstChild,h);u.removeChild(h)}}}}function S(u,a){if(!(a.ctrlKey||a.metaKey))return;let f=null;switch(a.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(a.preventDefault(),u._execAction(f))}function L(u){const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=_(a.anchorNode,"A",u._surface),h=a.getRangeAt(0).cloneRange();u._closeLinkPopover&&u._closeLinkPopover();const m=Ce(u.dom,"ln-editor-link-popover","ln-editor");if(!m)return;const w=m.firstElementChild;if(!w)return;const C=w.querySelector('input[type="url"]'),p=w.querySelector('[data-ln-editor-action="confirm-link"]'),g=w.querySelector('[data-ln-editor-action="cancel-link"]');f&&(C.value=f.getAttribute("href")||"");const A=u.dom.querySelector('[role="toolbar"]');A?A.after(w):u.dom.insertBefore(w,u._surface),C.focus();function ie(){const y=window.getSelection();y.removeAllRanges(),y.addRange(h)}function D(){document.removeEventListener("mousedown",ae),u._closeLinkPopover=null,w.remove()}function le(){const y=C.value.trim();if(D(),ie(),u._surface.focus(),y)if(f)f.setAttribute("href",y),f.setAttribute("rel","noopener noreferrer"),u._syncToTextarea(),x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom});else{document.execCommand("createLink",!1,y);const T=window.getSelection();if(T&&T.anchorNode){const ce=_(T.anchorNode,"A",u._surface);ce&&(ce.setAttribute("rel","noopener noreferrer"),u._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function se(){D(),ie(),u._surface.focus()}function Ue(){D()}function ae(y){const T=u.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!w.contains(y.target)&&!T&&Ue()}u._closeLinkPopover=D,p.addEventListener("click",le),g.addEventListener("click",se),C.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),le()):y.key==="Escape"&&(y.preventDefault(),se())}),document.addEventListener("mousedown",ae)}re(e,t,d,"ln-editor",{attributes:i})})()})();
1
+ (function(){"use strict";function P(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function N(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!N(l))return}e.apply(console,t)}}function x(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function de(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(o),o}function O(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){O(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function fe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function he(e,t){const r=!!(t&&t.typed),l=t&&t.exclude,o={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")r&&i[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let d=0;d<n.options.length;d++)n.options[d].selected&&o[n.name].push(n.options[d].value)}else if(r&&n.type==="hidden")o[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const d=Number(n.value);o[n.name]=n.value===""||isNaN(d)?null:d}else o[n.name]=n.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 pe(e,t){const r=e.elements,l=[],o={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const n=t[c];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(o[i.name]>1){const d=String(n).split(",").map(function(b){return b.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=we(n);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let d=0;d<i.options.length;d++)i.options[d].selected=n.indexOf(i.options[d].value)!==-1;l.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=pe,window.lnCore.serializeForm=he,window.lnCore.resolveFormMethod=fe);const U={};function be(e,t){U[e]=t}function me(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=be,window.lnCore.getDataMapper=me);function ge(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,O(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const W={};function _e(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];W[r]=t}function Ce(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return W[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=_e,window.lnCore.getLocaleFallback=Ce,window.lnCore.ensureLocaleObserver=ge);const M={};function K(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=M[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function ye(e,t,r){if(e){const l=e.querySelector('[data-ln-template="'+t+'"]');if(l)return l.content.cloneNode(!0)}return K(t,r)}function V(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const c=l[i],n=c.getAttribute("data-ln-attr").split(",");for(let d=0;d<n.length;d++){const b=n[d].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),v=b[1].trim();t[v]!=null&&c.setAttribute(m,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],n=c.getAttribute("data-ln-class").split(",");for(let d=0;d<n.length;d++){const b=n[d].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),v=b[1].trim();v in t&&c.classList.toggle(m,!!t[v])}}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 r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<r.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[l],t??null),r[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)V(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 Q(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const l=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],c=i.attributes;for(let n=0;n<c.length;n++){const d=c[n];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function Ae(e,t,r,l,o,s){const i={};for(let n=0;n<e.children.length;n++){const d=e.children[n],b=d.getAttribute("data-ln-render-key");b&&(i[b]=d)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const d=t[n],b=String(l(d));let m=i[b];if(m)o(m,d,n);else{const v=K(r,s);if(!v||(Q(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),o(m,d,n)}c.appendChild(m)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=V,window.lnCore.lnFill=ve,window.lnCore.renderList=Ae);function I(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function z(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function J(e,t,r=!1){const l=e.getAttribute(t);if(l===null)return!!r;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const B=new Map;function X(e,t){const r=(e?e.join("|"):"")+"::"+t;if(B.has(r))return B.get(r);const l=new Set(e||[]),o=function(s,i){const c=s.getAttribute(i);return c!==null&&l.has(c)?c:t};return B.set(r,o),o}function Y(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function Z(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function ee(e,t,r,l,o){if(!e||t===null)return!0;const s=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=n=>{o?console.warn(n,o):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function xe(e,t,r){for(const l in r){const[o,s,i]=r[l];Object.defineProperty(e,l,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function Se(e){const t={};for(const r in e){const l=e[r];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=X(l.values,l.fallback);break;case"integer":o=z;break;case"float":o=Y;break;case"boolean":o=J;break;case"list":o=G;break;case"json":o=Z;break;case"string":default:o=I;break}o||(o=I),t[l.prop]=[o,r,l.fallback]}return t}function ke(e){const t={};for(const r in e){const l=e[r];l&&l.effect&&(t[r]=l.effect)}return Object.keys(t).length?t:null}function Le(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=xe,window.lnCore.attrSpec=Se,window.lnCore.attrStr=I,window.lnCore.attrInt=z,window.lnCore.attrBool=J,window.lnCore.attrList=G,window.lnCore.attrEnum=X,window.lnCore.attrFloat=Y,window.lnCore.attrJson=Z);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(r){console.error("["+t.attribute+"] init failed",e,r)}}}function te(e,t,r,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:l};if(e.matches&&e.matches(s)&&L(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)L(c[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ee(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function 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 ne(){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 Oe(e){const t=ne(),r=e.observed||[];for(let l=0;l<r.length;l++){const o=r[l];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=Le(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function re(e,t,r,l){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,l):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,l)}}function De(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=ne(),o=l.byAttr.get(t),s=P()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&N(i)){const c=l.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let d=0;d<c.length;d++)ee(c[d].spec,n,t,c[d].componentTag,i)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=l.byReactive.get(t);c&&re(c,i,t,e.oldValue),l.reactiveWildcard.length&&re(l.reactiveWildcard,i,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const n=o[c];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(te(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function qe(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,O(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{De(t[r])}catch(l){console.error("[ln-core] mutation handler failed",t[r].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function F(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function R(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function H(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ne(e){const t=F();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}const l=R();if(e.target&&l.length)for(let o=0;o<l.length;o++){const s=l[o],i=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):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 i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!i)s.matches&&s.matches(n.query)&&L(s,n);else if(s.matches&&s.matches(n.query)&&L(s,n),s.querySelectorAll){const d=s.querySelectorAll(n.query);for(let b=0;b<d.length;b++)L(d[b],n)}}n.onInit&&n.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],d=n.query;if(d){if(!i)s.matches&&s.matches(d)&&H(s,n);else if(s.matches&&s.matches(d)&&H(s,n),s.querySelectorAll){const b=s.querySelectorAll(d);for(let m=0;m<b.length;m++)H(b[m],n)}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,O(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{Ne(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Me(e){F().push(e),e.onSubtreeChange&&e.query&&R().push(e),oe()}function ie(e,t,r,l,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,n=o.onInit||null,d=o.onAttrChange||null,b=o.effects||null,m=o.attributes||null,v=m?ke(m):b,j=m?new Set(Object.keys(m)):null,D=o.persist||null;function S(C){const w=C||document.body;if(te(w,e,t,r),m&&P())for(const g in m){const p=m[g],_=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&_.push(w);for(let A=0;A<_.length;A++){const k=_[A];N(k)&&ee(p,k.getAttribute(g),g,l,k)}}n&&n(w)}const E=[];if(e.indexOf("[")!==-1){const C=/\[([\w-]+)/g;let w;for(;(w=C.exec(e))!==null;)E.push(w[1])}else E.push(e);Oe({selector:e,attribute:t,componentTag:l,attributes:m,ComponentFn:r,onInit:n,observed:E.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:j,persist:D}),qe();const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,a=o.subtreeQuery||(u?e:"["+e+"]"),f={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:a};F().push(f),c&&a&&R().push(f),oe(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ie,window.lnCore.observeLifecycle=Me);function h(){Ee()>0?Te(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h(),S}function le(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,r={},l=le(t);if(!l)return r;const o=l.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const c=i.indexOf(":"),n=c>-1?i.slice(0,c):i,d=c>-1?i.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(d)}catch{r[n]=d}}return r}function Ie(e){if(!e)return null;const t=$();return e in t?t[e]:null}function Be(e,t){if(!e)return;const r=$();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");le(location.hash)!==o&&(location.hash=o)}function Fe(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 l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function He(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function $e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function je(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Pe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),l=e.slice(t+1),o=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Ie,window.lnCore.hashSet=Be,window.lnCore.hashLinkClick=Fe,window.lnCore.resolveHashNamespace=Re,window.lnCore.hashSortEncode=He,window.lnCore.hashSortDecode=$e,window.lnCore.hashFilterEncode=je,window.lnCore.hashFilterDecode=Pe);function Ue(){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=Ue),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const r={"data-ln-editor":{type:"marker",description:"Mounts rich text editor instance on container"},"data-ln-editor-action":{type:"enum",values:["bold","italic","underline","strikethrough","heading-2","heading-3","heading-4","blockquote","code","paragraph","ordered-list","unordered-list","link","unlink","clear","confirm-link","cancel-link"],description:"Rich text toolbar formatting action"},"data-ln-editor-source":{type:"string",description:"Selector or ID of backing textarea synchronized with editor content"}},l={P:!0,BR:!0,STRONG:!0,B:!0,EM:!0,I:!0,U:!0,S:!0,A:!0,UL:!0,OL:!0,LI:!0,H2:!0,H3:!0,H4:!0,BLOCKQUOTE:!0,PRE:!0,CODE:!0,DIV:!0},o={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},s={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},i={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let c=0;function n(u){return!!(o[u]||s[u]||i[u]||u==="link")}function d(u){this.dom=u;const a=this;if(this._textarea=u.querySelector("textarea"),!this._textarea)return console.warn("[ln-editor] No <textarea> found inside",u),this;const f=this._textarea.getAttribute("placeholder")||"";this._textarea.setAttribute("data-ln-editor-source",""),this._surface=document.createElement("div"),this._surface.className="ln-editor__surface",this._surface.setAttribute("contenteditable","true"),this._surface.setAttribute("role","textbox"),this._surface.setAttribute("aria-multiline","true"),f&&this._surface.setAttribute("data-placeholder",f);const h=this._textarea.id;if(h){const p=u.querySelector('label[for="'+h+'"]');p&&(p.id||(p.id=h+"-label"),this._surface.setAttribute("aria-labelledby",p.id))}this._surface.id=h?h+"-surface":"ln-editor-surface-"+ ++c;const C=this._textarea.value.trim();C&&(this._surface.innerHTML=C);const w=u.querySelector('[role="toolbar"]');if(w&&w.nextSibling?u.insertBefore(this._surface,w.nextSibling):u.appendChild(this._surface),w){w.setAttribute("aria-controls",this._surface.id);const p=w.querySelectorAll("[data-ln-editor-action]");for(let _=0;_<p.length;_++){const A=p[_].getAttribute("data-ln-editor-action");n(A)&&p[_].setAttribute("aria-pressed","false")}}this._onInput=function(){a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom})},this._onMousedownToolbar=function(p){p.target.closest("[data-ln-editor-action]")&&p.preventDefault()},this._onClickToolbar=function(p){const _=p.target.closest("[data-ln-editor-action]");if(!_)return;const A=_.getAttribute("data-ln-editor-action");a._execAction(A)},this._onPaste=function(p){v(a,p)},this._onKeydown=function(p){S(a,p)},this._listeningSelection=!1,this._rafSelection=null,this._onSelectionChange=function(){a._rafSelection||(a._rafSelection=requestAnimationFrame(function(){a._rafSelection=null,document.contains(a._surface)&&a._updateActiveStates()}))},this._attachSelection=function(){a._listeningSelection||(a._listeningSelection=!0,document.addEventListener("selectionchange",a._onSelectionChange))},this._detachSelection=function(){a._listeningSelection&&(a._listeningSelection=!1,document.removeEventListener("selectionchange",a._onSelectionChange)),a._rafSelection&&(cancelAnimationFrame(a._rafSelection),a._rafSelection=null)},this._onFocus=function(){a._attachSelection(),a._updateActiveStates(),x(a.dom,"ln-editor:focus",{target:a.dom})},this._onBlur=function(){a._detachSelection(),a._syncToTextarea(),x(a.dom,"ln-editor:blur",{target:a.dom})},this._onTextareaInput=function(){a._surface.innerHTML!==a._textarea.value&&(a._surface.innerHTML=a._textarea.value,x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},this._surface.addEventListener("input",this._onInput),this._surface.addEventListener("paste",this._onPaste),this._surface.addEventListener("keydown",this._onKeydown),this._surface.addEventListener("focus",this._onFocus),this._surface.addEventListener("blur",this._onBlur),this._textarea.addEventListener("input",this._onTextareaInput),w&&(w.addEventListener("mousedown",this._onMousedownToolbar),w.addEventListener("click",this._onClickToolbar)),this._onSetContent=function(p){const _=p.detail&&p.detail.html;_!==void 0&&(a._surface.innerHTML=_,a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom}))},u.addEventListener("ln-editor:set-content",this._onSetContent);const g=this._textarea.form;return g&&(this._onFormReset=function(){setTimeout(function(){a._surface.innerHTML=a._textarea.value,x(u,"ln-editor:changed",{html:a._textarea.value,target:u})},0)},g.addEventListener("reset",this._onFormReset)),this}d.prototype._syncToTextarea=function(){this._textarea&&(this._textarea.value=this._surface.innerHTML)},d.prototype._execAction=function(u){if(!(!u||de(this.dom,"ln-editor:before-change",{action:u,target:this.dom}).defaultPrevented)){if(this._surface.focus(),o[u])document.execCommand(o[u],!1,null);else if(s[u]){const f=s[u],h=b(this._surface);h&&h.toLowerCase()===f?document.execCommand("formatBlock",!1,"<p>"):document.execCommand("formatBlock",!1,"<"+f+">")}else i[u]?document.execCommand(i[u],!1,null):u==="link"?E(this):u==="unlink"?document.execCommand("unlink",!1,null):u==="clear"&&(document.execCommand("removeFormat",!1,null),document.execCommand("formatBlock",!1,"<p>"));this._syncToTextarea(),this._updateActiveStates()}},d.prototype._updateActiveStates=function(){const u=this.dom.querySelector('[role="toolbar"]');if(!u)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=a.anchorNode;if(!f||!this._surface.contains(f))return;const h=u.querySelectorAll("[data-ln-editor-action]");for(let C=0;C<h.length;C++){const w=h[C],g=w.getAttribute("data-ln-editor-action");let p=!1;if(o[g])try{p=document.queryCommandState(o[g])}catch{}else if(s[g]){const _=b(this._surface);p=_&&_.toLowerCase()===s[g]}else if(i[g])try{p=document.queryCommandState(i[g])}catch{}else g==="link"&&(p=!!m(a.anchorNode,"A",this._surface));if(n(g)){const _=String(p);w.getAttribute("aria-pressed")!==_&&w.setAttribute("aria-pressed",_)}p?w.classList.contains("ln-editor-active")||w.classList.add("ln-editor-active"):w.classList.contains("ln-editor-active")&&w.classList.remove("ln-editor-active")}},d.prototype.getHTML=function(){return this._surface?this._surface.innerHTML:""},d.prototype.setHTML=function(u){this._surface&&(this._surface.innerHTML=u,this._syncToTextarea(),x(this.dom,"ln-editor:changed",{html:this._textarea.value,target:this.dom}))},d.prototype.destroy=function(){if(!this.dom[t])return;this._surface&&(this._surface.removeEventListener("input",this._onInput),this._surface.removeEventListener("paste",this._onPaste),this._surface.removeEventListener("keydown",this._onKeydown),this._surface.removeEventListener("focus",this._onFocus),this._surface.removeEventListener("blur",this._onBlur),this._surface.remove());const u=this.dom.querySelector('[role="toolbar"]');u&&(u.removeEventListener("mousedown",this._onMousedownToolbar),u.removeEventListener("click",this._onClickToolbar)),this._detachSelection?this._detachSelection():document.removeEventListener("selectionchange",this._onSelectionChange),this.dom.removeEventListener("ln-editor:set-content",this._onSetContent);const a=this._textarea?this._textarea.form:null;if(a&&this._onFormReset&&a.removeEventListener("reset",this._onFormReset),this._textarea&&(this._onTextareaInput&&this._textarea.removeEventListener("input",this._onTextareaInput),this._textarea.removeAttribute("data-ln-editor-source")),this._closeLinkPopover)this._closeLinkPopover();else{const f=this.dom.querySelector(".ln-editor__link-popover");f&&f.remove()}delete this.dom[t]};function b(u){const a=window.getSelection();if(!a||a.rangeCount===0)return null;let f=a.anchorNode;if(!f)return null;for(;f&&f!==u;){if(f.nodeType===1){const h=f.tagName;if(h==="H2"||h==="H3"||h==="H4"||h==="BLOCKQUOTE"||h==="PRE"||h==="P")return h}f=f.parentNode}return null}function m(u,a,f){for(;u&&u!==f;){if(u.nodeType===1&&u.tagName===a)return u;u=u.parentNode}return null}function v(u,a){a.preventDefault();let f="";if(a.clipboardData&&(f=a.clipboardData.getData("text/html"),!f)){const C=a.clipboardData.getData("text/plain");C&&(f=C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>"),f="<p>"+f+"</p>")}if(!f)return;const h=j(f);h&&document.execCommand("insertHTML",!1,h)}function j(u){const a=document.createElement("div");return a.innerHTML=u,D(a),a.innerHTML}function D(u){const a=Array.from(u.childNodes);for(let f=0;f<a.length;f++){const h=a[f];if(h.nodeType!==3){if(h.nodeType!==1){u.removeChild(h);continue}if(l[h.tagName]){const C=Array.from(h.attributes);for(let w=0;w<C.length;w++){const g=C[w].name;if(h.tagName==="A"&&g==="href"){const p=h.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(p)||h.removeAttribute("href")}else h.removeAttribute(g)}h.tagName==="A"&&h.setAttribute("rel","noopener noreferrer"),D(h)}else{for(;h.firstChild;)u.insertBefore(h.firstChild,h);u.removeChild(h)}}}}function S(u,a){if(!(a.ctrlKey||a.metaKey))return;let f=null;switch(a.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(a.preventDefault(),u._execAction(f))}function E(u){const a=window.getSelection();if(!a||a.rangeCount===0)return;const f=m(a.anchorNode,"A",u._surface),h=a.getRangeAt(0).cloneRange();u._closeLinkPopover&&u._closeLinkPopover();const C=ye(u.dom,"ln-editor-link-popover","ln-editor");if(!C)return;const w=C.firstElementChild;if(!w)return;const g=w.querySelector('input[type="url"]'),p=w.querySelector('[data-ln-editor-action="confirm-link"]'),_=w.querySelector('[data-ln-editor-action="cancel-link"]');f&&(g.value=f.getAttribute("href")||"");const A=u.dom.querySelector('[role="toolbar"]');A?A.after(w):u.dom.insertBefore(w,u._surface),g.focus();function k(){const y=window.getSelection();y.removeAllRanges(),y.addRange(h)}function q(){document.removeEventListener("mousedown",ce),u._closeLinkPopover=null,w.remove()}function se(){const y=g.value.trim();if(q(),k(),u._surface.focus(),y)if(f)f.setAttribute("href",y),f.setAttribute("rel","noopener noreferrer"),u._syncToTextarea(),x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom});else{document.execCommand("createLink",!1,y);const T=window.getSelection();if(T&&T.anchorNode){const ue=m(T.anchorNode,"A",u._surface);ue&&(ue.setAttribute("rel","noopener noreferrer"),u._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function ae(){q(),k(),u._surface.focus()}function We(){q()}function ce(y){const T=u.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!w.contains(y.target)&&!T&&We()}u._closeLinkPopover=q,p.addEventListener("click",se),_.addEventListener("click",ae),g.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),se()):y.key==="Escape"&&(y.preventDefault(),ae())}),document.addEventListener("mousedown",ce)}ie(e,t,d,"ln-editor",{attributes:r})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function T(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!A(o))return}e.apply(console,t)}}function p(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 w(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function M(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function B(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,i={},c=e.elements,l={};if(r)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[n.name]||0)+1)}for(let s=0;s<c.length;s++){const n=c[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(o&&n.matches&&n.matches(o)))if(n.type==="checkbox")r&&l[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&i[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);i[n.name]=n.value===""||isNaN(a)?null:a}else i[n.name]=n.value}return i}function R(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function j(e,t){const r=e.elements,o=[],i={};for(let c=0;c<r.length;c++){const l=r[c];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<r.length;c++){const l=r[c];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const n=t[s];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(i[l.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=R(n);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<l.options.length;a++)l.options[a].selected=n.indexOf(l.options[a].value)!==-1;o.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=j,window.lnCore.serializeForm=B,window.lnCore.resolveFormMethod=M);const x={};function W(e,t){x[e]=t}function V(e){return x[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=W,window.lnCore.getDataMapper=V);function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,w(function(){new MutationObserver(function(){p(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const k={};function H(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];k[r]=t}function J(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return k[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=H,window.lnCore.getLocaleFallback=J,window.lnCore.ensureLocaleObserver=U);const b={};function K(e,t){b[e]||(b[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=b[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function v(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let l=0;l<r.length;l++){const s=r[l],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const s=o[l],n=s.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const s=i[l],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let l=0;l<c.length;l++){const s=c[l],n=s.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function z(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)v(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function _(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const o=function(c,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let c=0;c<i.length;c++){const l=i[c],s=l.attributes;for(let n=0;n<s.length;n++){const a=s[n];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function G(e,t,r,o,i,c){const l={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(l[u]=a)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(o(a));let d=l[u];if(d)i(d,a,n);else{const f=K(r,c);if(!f||(_(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,a,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=_,window.lnCore.fill=v,window.lnCore.lnFill=z,window.lnCore.renderList=G);function g(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function S(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function L(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function E(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const m=new Map;function O(e,t){const r=(e?e.join("|"):"")+"::"+t;if(m.has(r))return m.get(r);const o=new Set(e||[]),i=function(c,l){const s=c.getAttribute(l);return s!==null&&o.has(s)?s:t};return m.set(r,i),i}function D(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function F(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function P(e,t,r,o,i){if(!e||t===null)return!0;const c=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=n=>{i?console.warn(n,i):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${c}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${c}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${c}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,r){for(const o in r){const[i,c,l]=r[o];Object.defineProperty(e,o,{get:function(){return i(t,c,l)},enumerable:!0,configurable:!0})}return e}function X(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=O(o.values,o.fallback);break;case"integer":i=S;break;case"float":i=D;break;case"boolean":i=L;break;case"list":i=E;break;case"json":i=F;break;case"string":default:i=g;break}i||(i=g),t[o.prop]=[i,r,o.fallback]}return t}function Y(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=X,window.lnCore.attrStr=g,window.lnCore.attrInt=S,window.lnCore.attrBool=L,window.lnCore.attrList=E,window.lnCore.attrEnum=O,window.lnCore.attrFloat=D,window.lnCore.attrJson=F);function h(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 Z(e,t,r,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(c)&&h(e,l),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)h(s[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function $(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ee(e){const t=$(),r=e.observed||[];for(let o=0;o<r.length;o++){const i=r[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(c=>c.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Y(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function q(e,t,r,o){for(let i=0;i<e.length;i++){const c=e[i];if(!t[c.attribute])continue;const l=c.effects&&c.effects[r];l?l(t,r,o):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,o)}}function te(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=$(),i=o.byAttr.get(t),c=T()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!i&&!c)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(c&&A(l)){const s=o.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let a=0;a<s.length;a++)P(s[a].spec,n,t,s[a].componentTag,l)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),r){const s=o.byReactive.get(t);s&&q(s,l,t,e.oldValue),o.reactiveWildcard.length&&q(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let s=0;s<i.length;s++){const n=i[s];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(Z(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{te(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 I(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function C(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 re(e){const t=I();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 i=t[o];if(i.onSubtreeChange&&i.query){const c=i.query,l=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;l&&i.onSubtreeChange(l,e)}}for(let o=0;o<e.addedNodes.length;o++){const i=e.addedNodes[o];if(i.nodeType===1){const c=!!(i.firstElementChild||i.children&&i.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!c)i.matches&&i.matches(s.query)&&h(i,s);else if(i.matches&&i.matches(s.query)&&h(i,s),i.querySelectorAll){const n=i.querySelectorAll(s.query);for(let a=0;a<n.length;a++)h(n[a],s)}}s.onInit&&s.onInit(i)}}}for(let o=0;o<e.removedNodes.length;o++){const i=e.removedNodes[o];if(i.nodeType===1){const c=!!(i.firstElementChild||i.children&&i.children.length);for(let l=0;l<t.length;l++){const s=t[l],n=s.query;if(n){if(!c)i.matches&&i.matches(n)&&C(i,s);else if(i.matches&&i.matches(n)&&C(i,s),i.querySelectorAll){const a=i.querySelectorAll(n);for(let u=0;u<a.length;u++)C(a[u],s)}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{re(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ie(e,t){ee({observed:e,handler:t}),ne()}function le(e){I().push(e),oe()}function N(e){return(e||"").replace(/^#/,"")}function y(e){const t=e===void 0?location.hash:e,r={},o=N(t);if(!o)return r;const i=o.split("&");for(let c=0;c<i.length;c++){const l=i[c];if(!l)continue;const s=l.indexOf(":"),n=s>-1?l.slice(0,s):l,a=s>-1?l.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function se(e){if(!e)return null;const t=y();return e in t?t[e]:null}function ce(e,t){if(!e)return;const r=y();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(c){const l=r[c];return l===""?c:c+":"+encodeURIComponent(l)}).join("&");N(location.hash)!==i&&(location.hash=i)}function ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ue(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 de(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function fe(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 we(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 r=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=y,window.lnCore.hashGet=se,window.lnCore.hashSet=ce,window.lnCore.hashLinkClick=ae,window.lnCore.resolveHashNamespace=ue,window.lnCore.hashSortEncode=de,window.lnCore.hashSortDecode=fe,window.lnCore.hashFilterEncode=we,window.lnCore.hashFilterDecode=he);function pe(){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=pe),(function(){const e="lnExternalLinks";if(window[e]!==void 0)return;function t(s){return s.hostname&&s.hostname!==window.location.hostname}function r(s){if(s.getAttribute("data-ln-external-link")==="processed"||!t(s))return;s.target="_blank";const n=(s.rel||"").split(/\s+/).filter(Boolean);n.includes("noopener")||n.push("noopener"),n.includes("noreferrer")||n.push("noreferrer"),s.rel=n.join(" ");const a=document.createElement("span");a.className="sr-only",a.textContent="(opens in new tab)",s.appendChild(a),s.setAttribute("data-ln-external-link","processed"),p(s,"ln-external-links:processed",{link:s,href:s.href})}function o(s){s=s||document.body;for(const n of s.querySelectorAll("a, area"))r(n)}function i(){w(function(){document.body.addEventListener("click",function(s){const n=s.target.closest("a, area");n&&n.getAttribute("data-ln-external-link")==="processed"&&p(n,"ln-external-links:clicked",{link:n,href:n.href,text:n.textContent||n.title||""})})},"ln-external-links")}function c(){w(function(){le({onInit:function(s){if(s.matches&&(s.matches("a")||s.matches("area"))&&r(s),s.querySelectorAll)for(const n of s.querySelectorAll("a, area"))r(n)}}),ie(["href"],function(s){s.matches&&(s.matches("a")||s.matches("area"))&&r(s)})},"ln-external-links")}function l(){i(),c(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){o()}):o()}window[e]={process:o},l()})()})();
1
+ (function(){"use strict";function R(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!A(i))return}e.apply(console,t)}}function p(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function w(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function M(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function B(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,l={},c=e.elements,o={};if(r)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let s=0;s<c.length;s++){const n=c[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&l[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);l[n.name]=n.value===""||isNaN(a)?null:a}else l[n.name]=n.value}return l}function j(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function W(e,t){const r=e.elements,i=[],l={};for(let c=0;c<r.length;c++){const o=r[c];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let c=0;c<r.length;c++){const o=r[c];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const n=t[s];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});o.checked=a.indexOf(o.value)!==-1}else o.checked=j(n);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<o.options.length;a++)o.options[a].selected=n.indexOf(o.options[a].value)!==-1;i.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),i.push(o)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=W,window.lnCore.serializeForm=B,window.lnCore.resolveFormMethod=M);const x={};function V(e,t){x[e]=t}function U(e){return x[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=V,window.lnCore.getDataMapper=U);function H(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,w(function(){new MutationObserver(function(){p(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const k={};function J(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];k[r]=t}function K(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return k[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=J,window.lnCore.getLocaleFallback=K,window.lnCore.ensureLocaleObserver=H);const b={};function z(e,t){b[e]||(b[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=b[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function v(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const s=r[o],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const s=i[o],n=s.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const s=l[o],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let o=0;o<c.length;o++){const s=c[o],n=s.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function G(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)v(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function _(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const c=r.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return t[s]!==void 0?t[s]:""}))}const i=function(c,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let c=0;c<l.length;c++){const o=l[c],s=o.attributes;for(let n=0;n<s.length;n++){const a=s[n];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function P(e,t,r,i,l,c){const o={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(o[u]=a)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(i(a));let d=o[u];if(d)l(d,a,n);else{const f=z(r,c);if(!f||(_(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,a,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=_,window.lnCore.fill=v,window.lnCore.lnFill=G,window.lnCore.renderList=P);function g(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function S(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function L(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function E(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const m=new Map;function O(e,t){const r=(e?e.join("|"):"")+"::"+t;if(m.has(r))return m.get(r);const i=new Set(e||[]),l=function(c,o){const s=c.getAttribute(o);return s!==null&&i.has(s)?s:t};return m.set(r,l),l}function D(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function F(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function Q(e,t,r,i,l){if(!e||t===null)return!0;const c=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${c}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${c}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${c}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${c}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function X(e,t,r){for(const i in r){const[l,c,o]=r[i];Object.defineProperty(e,i,{get:function(){return l(t,c,o)},enumerable:!0,configurable:!0})}return e}function Y(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=O(i.values,i.fallback);break;case"integer":l=S;break;case"float":l=D;break;case"boolean":l=L;break;case"list":l=E;break;case"json":l=F;break;case"string":default:l=g;break}l||(l=g),t[i.prop]=[l,r,i.fallback]}return t}function Z(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=X,window.lnCore.attrSpec=Y,window.lnCore.attrStr=g,window.lnCore.attrInt=S,window.lnCore.attrBool=L,window.lnCore.attrList=E,window.lnCore.attrEnum=O,window.lnCore.attrFloat=D,window.lnCore.attrJson=F);function h(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 ee(e,t,r,i){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:i};if(e.matches&&e.matches(c)&&h(e,o),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)h(s[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function $(){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 te(e){const t=$(),r=e.observed||[];for(let i=0;i<r.length;i++){const l=r[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(c=>c.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=Z(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function q(e,t,r,i){for(let l=0;l<e.length;l++){const c=e[l];if(!t[c.attribute])continue;const o=c.effects&&c.effects[r];o?o(t,r,i):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,i)}}function ne(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,i=$(),l=i.byAttr.get(t),c=R()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!r&&!l&&!c)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(c&&A(o)){const s=i.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let a=0;a<s.length;a++)Q(s[a].spec,n,t,s[a].componentTag,o)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const s=i.byReactive.get(t);s&&q(s,o,t,e.oldValue),i.reactiveWildcard.length&&q(i.reactiveWildcard,o,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const n=l[s];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(ee(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ne(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function I(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function N(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function C(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=I();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=N();if(e.target&&i.length)for(let l=0;l<i.length;l++){const c=i[l],o=c.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;s&&c.onSubtreeChange(s,e)}for(let l=0;l<e.addedNodes.length;l++){const c=e.addedNodes[l];if(c.nodeType===1){const o=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)c.matches&&c.matches(n.query)&&h(c,n);else if(c.matches&&c.matches(n.query)&&h(c,n),c.querySelectorAll){const a=c.querySelectorAll(n.query);for(let u=0;u<a.length;u++)h(a[u],n)}}n.onInit&&n.onInit(c)}}}for(let l=0;l<e.removedNodes.length;l++){const c=e.removedNodes[l];if(c.nodeType===1){const o=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s],a=n.query;if(a){if(!o)c.matches&&c.matches(a)&&C(c,n);else if(c.matches&&c.matches(a)&&C(c,n),c.querySelectorAll){const u=c.querySelectorAll(a);for(let d=0;d<u.length;d++)C(u[d],n)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const i=t[r];if(i.type==="childList")try{oe(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function le(e,t){te({observed:e,handler:t}),re()}function se(e){I().push(e),e.onSubtreeChange&&e.query&&N().push(e),ie()}function T(e){return(e||"").replace(/^#/,"")}function y(e){const t=e===void 0?location.hash:e,r={},i=T(t);if(!i)return r;const l=i.split("&");for(let c=0;c<l.length;c++){const o=l[c];if(!o)continue;const s=o.indexOf(":"),n=s>-1?o.slice(0,s):o,a=s>-1?o.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function ce(e){if(!e)return null;const t=y();return e in t?t[e]:null}function ae(e,t){if(!e)return;const r=y();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(c){const o=r[c];return o===""?c:c+":"+encodeURIComponent(o)}).join("&");T(location.hash)!==l&&(location.hash=l)}function ue(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function de(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const 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 fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function we(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function he(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function pe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=y,window.lnCore.hashGet=ce,window.lnCore.hashSet=ae,window.lnCore.hashLinkClick=ue,window.lnCore.resolveHashNamespace=de,window.lnCore.hashSortEncode=fe,window.lnCore.hashSortDecode=we,window.lnCore.hashFilterEncode=he,window.lnCore.hashFilterDecode=pe);function be(){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=be),(function(){const e="lnExternalLinks";if(window[e]!==void 0)return;function t(s){return s.hostname&&s.hostname!==window.location.hostname}function r(s){if(s.getAttribute("data-ln-external-link")==="processed"||!t(s))return;s.target="_blank";const n=(s.rel||"").split(/\s+/).filter(Boolean);n.includes("noopener")||n.push("noopener"),n.includes("noreferrer")||n.push("noreferrer"),s.rel=n.join(" ");const a=document.createElement("span");a.className="sr-only",a.textContent="(opens in new tab)",s.appendChild(a),s.setAttribute("data-ln-external-link","processed"),p(s,"ln-external-links:processed",{link:s,href:s.href})}function i(s){s=s||document.body;for(const n of s.querySelectorAll("a, area"))r(n)}function l(){w(function(){document.body.addEventListener("click",function(s){const n=s.target.closest("a, area");n&&n.getAttribute("data-ln-external-link")==="processed"&&p(n,"ln-external-links:clicked",{link:n,href:n.href,text:n.textContent||n.title||""})})},"ln-external-links")}function c(){w(function(){se({onInit:function(s){if(s.matches&&(s.matches("a")||s.matches("area"))&&r(s),s.querySelectorAll)for(const n of s.querySelectorAll("a, area"))r(n)}}),le(["href"],function(s){s.matches&&(s.matches("a")||s.matches("area"))&&r(s)})},"ln-external-links")}function o(){l(),c(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){i()}):i()}window[e]={process:i},o()})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function Q(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function N(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 r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){i=t[r];break}if(!N(i))return}e.apply(console,t)}}function L(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 Ce(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(r),r}function R(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){R(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function P(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function Ae(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ve(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,r={},a=e.elements,l={};if(n)for(let s=0;s<a.length;s++){const o=a[s];o.name&&o.type==="checkbox"&&!o.disabled&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<a.length;s++){const o=a[s];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(i&&o.matches&&o.matches(i)))if(o.type==="checkbox")n&&l[o.name]===1?r[o.name]=o.checked:(r[o.name]||(r[o.name]=[]),o.checked&&r[o.name].push(o.value));else if(o.type==="radio")o.checked&&(r[o.name]=o.value);else if(o.type==="select-multiple"){r[o.name]=[];for(let d=0;d<o.options.length;d++)o.options[d].selected&&r[o.name].push(o.options[d].value)}else if(n&&o.type==="hidden")r[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const d=Number(o.value);r[o.name]=o.value===""||isNaN(d)?null:d}else r[o.name]=o.value}return r}function ke(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function _e(e,t){const n=e.elements,i=[],r={};for(let a=0;a<n.length;a++){const l=n[a];l.name&&l.type==="checkbox"&&(r[l.name]=(r[l.name]||0)+1)}for(let a=0;a<n.length;a++){const l=n[a];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const o=t[s];if(l.type==="checkbox"){if(Array.isArray(o))l.checked=o.indexOf(l.value)!==-1;else if(r[l.name]>1){const d=String(o).split(",").map(function(w){return w.trim()});l.checked=d.indexOf(l.value)!==-1}else l.checked=ke(o);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(o),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(o))for(let d=0;d<l.options.length;d++)l.options[d].selected=o.indexOf(l.options[d].value)!==-1;i.push(l)}else l.value=o,l.tagName==="SELECT"&&o!=null&&l.setAttribute("data-ln-value",o),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=_e,window.lnCore.serializeForm=ve,window.lnCore.resolveFormMethod=Ae);const J={};function Se(e,t){J[e]=t}function xe(e){return J[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Se,window.lnCore.getDataMapper=xe);function Ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,R(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const G={};function Ee(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];G[n]=t}function Te(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return G[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Ee,window.lnCore.getLocaleFallback=Te,window.lnCore.ensureLocaleObserver=Ie);const B={};function qe(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 z(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const s=n[l],o=s.getAttribute("data-ln-field");t[o]!=null&&(s.textContent=t[o])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const s=i[l],o=s.getAttribute("data-ln-attr").split(",");for(let d=0;d<o.length;d++){const w=o[d].trim().split(":");if(w.length!==2)continue;const m=w[0].trim(),A=w[1].trim();t[A]!=null&&s.setAttribute(m,t[A])}}const r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const s=r[l],o=s.getAttribute("data-ln-show");o in t&&s.classList.toggle("hidden",!t[o])}const a=e.querySelectorAll("[data-ln-class]");for(let l=0;l<a.length;l++){const s=a[l],o=s.getAttribute("data-ln-class").split(",");for(let d=0;d<o.length;d++){const w=o[d].trim().split(":");if(w.length!==2)continue;const m=w[0].trim(),A=w[1].trim();A in t&&s.classList.toggle(m,!!t[A])}}return e}function Le(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)z(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 X(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const i=function(a,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let a=0;a<r.length;a++){const l=r[a],s=l.attributes;for(let o=0;o<s.length;o++){const d=s[o];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Re(e,t,n,i,r,a){const l={};for(let o=0;o<e.children.length;o++){const d=e.children[o],w=d.getAttribute("data-ln-render-key");w&&(l[w]=d)}const s=document.createDocumentFragment();for(let o=0;o<t.length;o++){const d=t[o],w=String(i(d));let m=l[w];if(m)r(m,d,o);else{const A=qe(n,a);if(!A||(X(A,d),m=A.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",w),r(m,d,o)}s.appendChild(m)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=X,window.lnCore.fill=z,window.lnCore.lnFill=Le,window.lnCore.renderList=Re);function O(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function Y(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function Z(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const r=i.trim().toLowerCase();return!(r==="false"||r==="0")}function ee(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const M=new Map;function te(e,t){const n=(e?e.join("|"):"")+"::"+t;if(M.has(n))return M.get(n);const i=new Set(e||[]),r=function(a,l){const s=a.getAttribute(l);return s!==null&&i.has(s)?s:t};return M.set(n,r),r}function ne(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function re(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function oe(e,t,n,i,r){if(!e||t===null)return!0;const a=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=o=>{r?console.warn(o,r):console.warn(o)};if(l==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const o=e.values||[];return o.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(s(`[${a}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(s(`[${a}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(o){return s(`[${a}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ie(e,t,n){for(const i in n){const[r,a,l]=n[i];Object.defineProperty(e,i,{get:function(){return r(t,a,l)},enumerable:!0,configurable:!0})}return e}function le(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let r=i.read;if(!r&&i.type)switch(i.type){case"enum":r=te(i.values,i.fallback);break;case"integer":r=Y;break;case"float":r=ne;break;case"boolean":r=Z;break;case"list":r=ee;break;case"json":r=re;break;case"string":default:r=O;break}r||(r=O),t[i.prop]=[r,n,i.fallback]}return t}function Oe(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=ie,window.lnCore.attrSpec=le,window.lnCore.attrStr=O,window.lnCore.attrInt=Y,window.lnCore.attrBool=Z,window.lnCore.attrList=ee,window.lnCore.attrEnum=te,window.lnCore.attrFloat=ne,window.lnCore.attrJson=re);function E(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 a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:i};if(e.matches&&e.matches(a)&&E(e,l),e.querySelectorAll){const s=e.querySelectorAll(a);for(let o=0;o<s.length;o++)E(s[o],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function T(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 Ne(e){const t=ae(),n=e.observed||[];for(let i=0;i<n.length;i++){const r=n[i];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).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 r=t.byDeclaredAttr.get(i);r.some(a=>a.componentTag===e.componentTag)||r.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 r of i)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function ce(e,t,n,i){for(let r=0;r<e.length;r++){const a=e[r];if(!t[a.attribute])continue;const l=a.effects&&a.effects[n];l?l(t,n,i):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,i)}}function Be(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,i=ae(),r=i.byAttr.get(t),a=Q()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!n&&!r&&!a)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(a&&N(l)){const s=i.byDeclaredAttr.get(t),o=l.getAttribute(t);for(let d=0;d<s.length;d++)oe(s[d].spec,o,t,s[d].componentTag,l)}if(window.lnCore._debugSink&&(n||r)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const s=i.byReactive.get(t);s&&ce(s,l,t,e.oldValue),i.reactiveWildcard.length&&ce(i.reactiveWildcard,l,t,e.oldValue)}if(r)for(let s=0;s<r.length;s++){const o=r[s];if(o.handler){o.handler(l,t,e.oldValue);continue}o.onAttributeChange&&l[o.attribute]?o.onAttributeChange(l,t):(se(l,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(l))}}}function Me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Be(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 $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function j(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 $e(e){const t=$();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let i=0;i<t.length;i++){const r=t[i];if(r.onSubtreeChange&&r.query){const a=r.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;l&&r.onSubtreeChange(l,e)}}for(let i=0;i<e.addedNodes.length;i++){const r=e.addedNodes[i];if(r.nodeType===1){const a=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!a)r.matches&&r.matches(s.query)&&E(r,s);else if(r.matches&&r.matches(s.query)&&E(r,s),r.querySelectorAll){const o=r.querySelectorAll(s.query);for(let d=0;d<o.length;d++)E(o[d],s)}}s.onInit&&s.onInit(r)}}}for(let i=0;i<e.removedNodes.length;i++){const r=e.removedNodes[i];if(r.nodeType===1){const a=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const s=t[l],o=s.query;if(o){if(!a)r.matches&&r.matches(o)&&j(r,s);else if(r.matches&&r.matches(o)&&j(r,s),r.querySelectorAll){const d=r.querySelectorAll(o);for(let w=0;w<d.length;w++)j(d[w],s)}}}}}}function ue(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{$e(i)}catch(r){console.error("[ln-core] lifecycle handler failed",i.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function je(e){$().push(e),ue()}function de(e,t,n,i,r={}){const a=r.extraAttributes||[],l=r.onAttributeChange||null,s=r.onSubtreeChange||null,o=r.onInit||null,d=r.onAttrChange||null,w=r.effects||null,m=r.attributes||null,A=m?Oe(m):w,v=m?new Set(Object.keys(m)):null,q=r.persist||null;function _(c){const f=c||document.body;if(se(f,e,t,n),m&&Q())for(const u in m){const g=m[u],p=Array.from(f.querySelectorAll("["+u+"]"));f.matches&&f.matches("["+u+"]")&&p.push(f);for(let h=0;h<p.length;h++){const b=p[h];N(b)&&oe(g,b.getAttribute(u),u,i,b)}}o&&o(f)}const S=[];if(e.indexOf("[")!==-1){const c=/\[([\w-]+)/g;let f;for(;(f=c.exec(e))!==null;)S.push(f[1])}else S.push(e);Ne({selector:e,attribute:t,componentTag:i,attributes:m,ComponentFn:n,onInit:o,observed:S.concat(a),onAttributeChange:l,onAttrChange:d,effects:A,declared:v,persist:q}),Me();const U=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,K=r.subtreeQuery||(U?e:"["+e+"]");$().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:s,query:K}),ue(),window[t]=_,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=de,window.lnCore.observeLifecycle=je);function I(){Fe()>0?T(function(){_(document.body)}):_(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I):I(),_}function fe(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function he(e){return(e||"").replace(/^#/,"")}function V(e){const t=e===void 0?location.hash:e,n={},i=he(t);if(!i)return n;const r=i.split("&");for(let a=0;a<r.length;a++){const l=r[a];if(!l)continue;const s=l.indexOf(":"),o=s>-1?l.slice(0,s):l,d=s>-1?l.slice(s+1):"";if(o)try{n[o]=decodeURIComponent(d)}catch{n[o]=d}}return n}function H(e){if(!e)return null;const t=V();return e in t?t[e]:null}function ge(e,t){if(!e)return;const n=V();t==null?delete n[e]:n[e]=String(t);const r=Object.keys(n).map(function(a){const l=n[a];return l===""?a:a+":"+encodeURIComponent(l)}).join("&");he(location.hash)!==r&&(location.hash=r)}function Ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function D(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 He(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function We(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 W(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),r=i?i.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=V,window.lnCore.hashGet=H,window.lnCore.hashSet=ge,window.lnCore.hashLinkClick=Ve,window.lnCore.resolveHashNamespace=D,window.lnCore.hashSortEncode=He,window.lnCore.hashSortDecode=We,window.lnCore.hashFilterEncode=pe,window.lnCore.hashFilterDecode=W);function Ue(){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=Ue);function be(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let i=0;i<t.length;i++)if(String(t[i]).trim().toLowerCase()===n)return!0;return!1}function Ke(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function Qe(e,t,n){if(!t||typeof t!="object")return!0;const i=Object.keys(t);if(i.length===0)return!0;for(let r=0;r<i.length;r++){const a=t[i[r]];let l="";if(a.col!==null&&a.col!==void 0?l=e[a.col]||"":a.attr&&n&&typeof n.getAttribute=="function"&&(l=n.getAttribute(a.attr)||""),!be(l,a.values))return!1}return!0}function we(e,t,n,i){if(i!=null&&!isNaN(i))return parseInt(i,10);if(t&&typeof t.getAttribute=="function"){const r=t.getAttribute("data-ln-filter-col");if(r!==null&&!isNaN(parseInt(r,10)))return parseInt(r,10);if(typeof t.closest=="function"){const a=t.closest("th");if(a&&typeof a.cellIndex=="number")return a.cellIndex;const l=t.closest("[data-ln-popover], [id]");if(l&&l.id){const s=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(s&&typeof s.querySelector=="function"){const o=s.querySelector('[data-ln-popover-for="'+l.id+'"]');if(o&&typeof o.closest=="function"){const d=o.closest("th");if(d&&typeof d.cellIndex=="number")return d.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const r=e.querySelectorAll("thead th, tr:first-child th"),a=String(n).trim().toLowerCase();for(let l=0;l<r.length;l++){const s=r[l],o=s.getAttribute("data-ln-table-filter-col")||s.getAttribute("data-ln-filter-col")||s.getAttribute("data-ln-filter-key")||s.getAttribute("data-ln-table-col")||s.getAttribute("data-ln-col")||s.getAttribute("data-ln-field");if(o&&o.trim().toLowerCase()===a)return typeof s.cellIndex=="number"?s.cellIndex:l}if(t){const l=t.closest?t.closest("[data-ln-popover], [id]"):null,s=l&&l.id||t.id||null;if(s)for(let o=0;o<r.length;o++){const d=r[o];if(typeof d.querySelector=="function"&&d.querySelector('[data-ln-popover-for="'+s+'"]'))return typeof d.cellIndex=="number"?d.cellIndex:o}}for(let l=0;l<r.length;l++){const s=r[l],d=Array.from(s.childNodes||[]).filter(m=>m.nodeType===3),w=(d.length>0?d.map(m=>m.textContent.trim()).join(" "):s.textContent||"").trim().toLowerCase();if(w&&w===a)return typeof s.cellIndex=="number"?s.cellIndex:l}}return null}function Pe(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let i=0;i<e.length;i++){const r=e[i];!t&&r.key&&(t=r.key),r.checked&&!r.isReset&&r.value&&n.push(r.value)}return{key:t,values:n}}function Je(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function ye(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",i="data-ln-filter-value",r="data-ln-filter-hide",a="data-ln-filter-reset",l="data-ln-filter-col",s="data-ln-hash",o="data-ln-filter-values",d="data-ln-filter-target",w=new WeakMap;if(window[t]!==void 0)return;const m={"data-ln-filter":{prop:"targetId",type:"string",read:O,fallback:null,effect:I,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:I,description:"URL hash routing key for filter state persistence"},"data-ln-filter-values":{type:"string",effect:I,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-filter-target":{type:"marker",description:"Marker on target container or table observed by ln-filter"}},A=le(m);function v(c){return c.hasAttribute(a)||!c.getAttribute(i)}function q(c){const f=c.dom.querySelectorAll("["+n+"]"),u=[];for(let p=0;p<f.length;p++){const h=f[p];u.push({key:h.getAttribute(n),value:h.getAttribute(i)||"",checked:h.checked,isReset:v(h)})}const g=Pe(u);return{key:g.key,values:g.values,targetId:c.targetId}}function _(c,f,u){const g=c.querySelectorAll("["+n+"]"),p=Array.isArray(u)&&u.length>0;for(let h=0;h<g.length;h++){const b=g[h];v(b)?b.checked=!p:p&&b.getAttribute(n)===f&&u.indexOf(b.getAttribute(i))!==-1?b.checked=!0:b.checked=!1}}function S(c){this.dom=c,ie(this,c,A);const f=c.getAttribute(l);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=D(c,"filter"),this.hashEnabled=!!this.nsKey;const u=this,g=fe(function(){u._render()});this._queueRender=g;const p=fe(function(){u._destroyed||u._applyDomFilter()});this._queueDomFilter=p;function h(){if(!u.targetId)return;const y=document.getElementById(u.targetId);y&&!y.hasAttribute(d)&&y.setAttribute(d,u.targetId)}this._ensureTargetMarked=h,h(),T(function(){u._destroyed||h()}),this._attachHandlers(),this._onHashChange=function(){if(u._destroyed||!u.hashEnabled)return;const y=H(u.nsKey),C=W(y);C&&C.key&&C.values.length>0?_(u.dom,C.key,C.values):_(u.dom,null,[]),u._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let b=!1;if(this.hashEnabled){const y=H(this.nsKey),C=W(y);C&&C.key&&C.values.length>0&&(_(c,C.key,C.values),T(function(){u._destroyed||u._render()}),b=!0)}if(!b){const y=ye(c.getAttribute(o));if(y.length>0){const C=c.querySelector("["+n+"]"),x=C?C.getAttribute(n):null;x&&(_(c,x,y),T(function(){u._destroyed||u._render()}),b=!0)}}if(!b){const y=c.querySelectorAll("["+n+"]");for(let C=0;C<y.length;C++)if(y[C].checked&&!v(y[C])){T(function(){u._destroyed||u._render()});break}}return this}S.prototype._attachHandlers=function(){const c=this;this._onDomChange=function(f){const u=f.target;if(!u||!u.hasAttribute||!u.hasAttribute(n))return;const g=Array.from(c.dom.querySelectorAll("["+n+"]"));if(v(u)){for(let p=0;p<g.length;p++)v(g[p])||(g[p].checked=!1);u.checked=!0,c._queueRender();return}if(u.checked){for(let h=0;h<g.length;h++)v(g[h])&&(g[h].checked=!1);let p=!1;for(let h=0;h<g.length;h++)if(v(g[h])){p=!0;break}if(p){let h=!0;for(let b=0;b<g.length;b++)if(!v(g[b])&&!g[b].checked){h=!1;break}if(h)for(let b=0;b<g.length;b++)v(g[b])?g[b].checked=!0:g[b].checked=!1}}else{let p=!1;for(let h=0;h<g.length;h++)if(!v(g[h])&&g[h].checked){p=!0;break}if(!p)for(let h=0;h<g.length;h++)v(g[h])&&(g[h].checked=!0)}c._queueRender()},this.dom.addEventListener("change",this._onDomChange)},S.prototype._render=function(){const c=this,f=q(this),u=this._lastSnapshot;if(!(!u||u.key!==f.key||Ke(u.values,f.values)))return;f.key===null||f.values.length;const p=document.getElementById(c.targetId),h={key:f.key,values:f.values.slice(),targetId:c.targetId};L(c.dom,"ln-filter:change",h);let b=!1;p&&p!==c.dom&&Ce(p,"ln-filter:change",h).defaultPrevented&&(b=!0);const y=u&&u.values.length>0,C=f.values.length===0;if(y&&C){const k={targetId:c.targetId};L(c.dom,"ln-filter:reset",k),p&&p!==c.dom&&L(p,"ln-filter:reset",k)}this._lastSnapshot={key:f.key,values:f.values.slice()};const x=Je(f.values);if(x?this.dom.setAttribute(o,x):this.dom.removeAttribute(o),this.hashEnabled){const k=pe(f.key,f.values);ge(this.nsKey,k)}b||c._applyDomFilter(p)},S.prototype._applyDomFilter=function(c){const f=c||document.getElementById(this.targetId);if(!f)return;const u=q(this),g=u.key===null||u.values.length===0,p=f.tagName==="TABLE"?f:f.querySelector?f.querySelector("table"):null;if(p)this._filterTableRows(u,p);else{const h=f.children;for(let b=0;b<h.length;b++){const y=h[b];if(y.removeAttribute(r),g)continue;const C=y.getAttribute("data-"+u.key);C!==null&&(be(C,u.values)||y.setAttribute(r,"true"))}}};function U(c){if(!c)return"";const f=c.querySelector?c.querySelector("[data-ln-value]"):null;return P(f||c)}function K(c){return!!(!c||typeof c!="object"||c.tagName==="TEMPLATE"||typeof c.hasAttribute=="function"&&(c.hasAttribute("data-ln-sort-exclude")||c.hasAttribute("hidden"))||c.classList&&c.classList.contains("hidden")||c.style&&c.style.display==="none"||typeof c.matches=="function"&&c.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof c.querySelector=="function"&&c.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}S.prototype._filterTableRows=function(c,f){if(!f){const y=document.getElementById(this.targetId);if(!y||(f=y.tagName==="TABLE"?y:y.querySelector?y.querySelector("table"):null,!f))return}const u=we(f,this.dom,c.key,this.colIndex),g=c.key||this.dom.getAttribute("data-ln-filter-key")||(u!==null?"col"+u:"attr-filter"),p=c.values;w.has(f)||w.set(f,{});const h=w.get(f);g&&p.length>0?h[g]={col:u,values:p.slice(),attr:"data-"+g}:g&&delete h[g];const b=f.tBodies;for(let y=0;y<b.length;y++){const C=b[y].rows;for(let x=0;x<C.length;x++){const k=C[x];if(K(k))continue;const me={};for(let F=0;F<k.cells.length;F++)me[F]=U(k.cells[F]);Qe(me,h,k)?k.removeAttribute(r):k.setAttribute(r,"true")}}},S.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const c=document.getElementById(this.targetId);if(c){const f=c.tagName==="TABLE"?c:c.querySelector?c.querySelector("table"):null;if(f&&w.has(f)){const u=w.get(f),g=we(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),p=this.dom.getAttribute("data-ln-filter-key")||(g!==null?"col"+g:this.colIndex!==null?"col"+this.colIndex:null);p&&u[p]&&(delete u[p],this._filterTableRows({key:null,values:[]},f)),Object.keys(u).length===0&&w.delete(f)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&c.removeAttribute(d)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t]};function I(c,f){const u=c[t];if(!(!u||u._destroyed))if(f===s)u.hashEnabled&&u._onHashChange&&window.removeEventListener("hashchange",u._onHashChange),u.nsKey=D(c,"filter"),u.hashEnabled=!!u.nsKey,u.hashEnabled&&window.addEventListener("hashchange",u._onHashChange);else if(f===o){const g=ye(c.getAttribute(o)),p=c.querySelector("["+n+"]"),h=p?p.getAttribute(n):null;h&&(_(c,h,g),u._render())}else f===e&&(u.targetId=c.getAttribute(e)||null,u._ensureTargetMarked(),u._render())}de(e,t,S,"ln-filter",{attributes:m,subtreeQuery:"["+e+"], ["+d+"]",onSubtreeChange:function(c,f){if(f.addedNodes.length===0&&f.removedNodes.length===0)return;let u=null,g=null;if(c.hasAttribute(d)?(g=c,u=c.getAttribute(d)||c.id):c.hasAttribute(e)&&(u=c.getAttribute(e),g=u?document.getElementById(u):null),!u||!g)return;const p=document.querySelectorAll("["+e+'="'+u+'"]');for(let h=0;h<p.length;h++){const b=p[h][t];b&&!b._destroyed&&q(b).values.length>0&&b._queueDomFilter()}},persist:{attr:o,hashActive:function(c){return!!D(c,"filter")}}})})()})();
1
+ (function(){"use strict";function P(){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 B(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!B(l))return}e.apply(console,t)}}function L(e,t,n){const l=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function ke(e,t,n){const l=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(o),o}function R(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){R(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function J(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function _e(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Se(e,t){const n=!!(t&&t.typed),l=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let a=0;a<s.length;a++){const r=s[a];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(l&&r.matches&&r.matches(l)))if(r.type==="checkbox")n&&i[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 d=0;d<r.options.length;d++)r.options[d].selected&&o[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")o[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);o[r.name]=r.value===""||isNaN(d)?null:d}else o[r.name]=r.value}return o}function xe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Ie(e,t){const n=e.elements,l=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const r=t[a];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(o[i.name]>1){const d=String(r).split(",").map(function(y){return y.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=xe(r);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let d=0;d<i.options.length;d++)i.options[d].selected=r.indexOf(i.options[d].value)!==-1;l.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Ie,window.lnCore.serializeForm=Se,window.lnCore.resolveFormMethod=_e);const G={};function Ee(e,t){G[e]=t}function Te(e){return G[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ee,window.lnCore.getDataMapper=Te);function qe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,R(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const z={};function Le(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];z[n]=t}function Re(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=Le,window.lnCore.getLocaleFallback=Re,window.lnCore.ensureLocaleObserver=qe);const M={};function Oe(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=M[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 i=0;i<n.length;i++){const a=n[i],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const a=l[i],r=a.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const y=r[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),v=y[1].trim();t[v]!=null&&a.setAttribute(m,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const a=o[i],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],r=a.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const y=r[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),v=y[1].trim();v in t&&a.classList.toggle(m,!!t[v])}}return e}function De(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 l=0;l<n.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[l],t??null),n[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)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 Y(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(i,a){return t[a]!==void 0?t[a]:""}))}const l=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],a=i.attributes;for(let r=0;r<a.length;r++){const d=a[r];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function Fe(e,t,n,l,o,s){const i={};for(let r=0;r<e.children.length;r++){const d=e.children[r],y=d.getAttribute("data-ln-render-key");y&&(i[y]=d)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],y=String(l(d));let m=i[y];if(m)o(m,d,r);else{const v=Oe(n,s);if(!v||(Y(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",y),o(m,d,r)}a.appendChild(m)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Y,window.lnCore.fill=X,window.lnCore.lnFill=De,window.lnCore.renderList=Fe);function O(e,t,n){const l=e.getAttribute(t);return l===null?n:l}function Z(e,t,n){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?n:l}function ee(e,t,n=!1){const l=e.getAttribute(t);if(l===null)return!!n;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function te(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const $=new Map;function ne(e,t){const n=(e?e.join("|"):"")+"::"+t;if($.has(n))return $.get(n);const l=new Set(e||[]),o=function(s,i){const a=s.getAttribute(i);return a!==null&&l.has(a)?a:t};return $.set(n,o),o}function re(e,t,n){const l=parseFloat(e.getAttribute(t));return isNaN(l)?n:l}function oe(e,t,n){const l=e.getAttribute(t);if(!l)return n;try{return JSON.parse(l)}catch{return n}}function ie(e,t,n,l,o){if(!e||t===null)return!0;const s=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=r=>{o?console.warn(r,o):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(a(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(a(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return a(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function le(e,t,n){for(const l in n){const[o,s,i]=n[l];Object.defineProperty(e,l,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function se(e){const t={};for(const n in e){const l=e[n];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=ne(l.values,l.fallback);break;case"integer":o=Z;break;case"float":o=re;break;case"boolean":o=ee;break;case"list":o=te;break;case"json":o=oe;break;case"string":default:o=O;break}o||(o=O),t[l.prop]=[o,n,l.fallback]}return t}function Ne(e){const t={};for(const n in e){const l=e[n];l&&l.effect&&(t[n]=l.effect)}return Object.keys(t).length?t:null}function Be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const 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=le,window.lnCore.attrSpec=se,window.lnCore.attrStr=O,window.lnCore.attrInt=Z,window.lnCore.attrBool=ee,window.lnCore.attrList=te,window.lnCore.attrEnum=ne,window.lnCore.attrFloat=re,window.lnCore.attrJson=oe);function E(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 ae(e,t,n,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:l};if(e.matches&&e.matches(s)&&E(e,i),e.querySelectorAll){const a=e.querySelectorAll(s);for(let r=0;r<a.length;r++)E(a[r],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function T(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 ce(){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 $e(e){const t=ce(),n=e.observed||[];for(let l=0;l<n.length;l++){const o=n[l];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=Be(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function ue(e,t,n,l){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,l):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,l)}}function He(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,l=ce(),o=l.byAttr.get(t),s=P()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&B(i)){const a=l.byDeclaredAttr.get(t),r=i.getAttribute(t);for(let d=0;d<a.length;d++)ie(a[d].spec,r,t,a[d].componentTag,i)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const a=l.byReactive.get(t);a&&ue(a,i,t,e.oldValue),l.reactiveWildcard.length&&ue(l.reactiveWildcard,i,t,e.oldValue)}if(o)for(let a=0;a<o.length;a++){const r=o[a];if(r.handler){r.handler(i,t,e.oldValue);continue}r.onAttributeChange&&i[r.attribute]?r.onAttributeChange(i,t):(ae(i,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(i))}}}function je(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{He(t[n])}catch(l){console.error("[ln-core] mutation handler failed",t[n].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function V(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ve(e){const t=H();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=j();if(e.target&&l.length)for(let o=0;o<l.length;o++){const s=l[o],i=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;a&&s.onSubtreeChange(a,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a];if(r.selector&&r.attribute&&r.ComponentFn){if(!i)s.matches&&s.matches(r.query)&&E(s,r);else if(s.matches&&s.matches(r.query)&&E(s,r),s.querySelectorAll){const d=s.querySelectorAll(r.query);for(let y=0;y<d.length;y++)E(d[y],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 i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a],d=r.query;if(d){if(!i)s.matches&&s.matches(d)&&V(s,r);else if(s.matches&&s.matches(d)&&V(s,r),s.querySelectorAll){const y=s.querySelectorAll(d);for(let m=0;m<y.length;m++)V(y[m],r)}}}}}}function de(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const l=t[n];if(l.type==="childList")try{Ve(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function We(e){H().push(e),e.onSubtreeChange&&e.query&&j().push(e),de()}function fe(e,t,n,l,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,a=o.onSubtreeChange||null,r=o.onInit||null,d=o.onAttrChange||null,y=o.effects||null,m=o.attributes||null,v=m?Ne(m):y,k=m?new Set(Object.keys(m)):null,q=o.persist||null;function S(f){const c=f||document.body;if(ae(c,e,t,n),m&&P())for(const g in m){const w=m[g],h=Array.from(c.querySelectorAll("["+g+"]"));c.matches&&c.matches("["+g+"]")&&h.push(c);for(let b=0;b<h.length;b++){const p=h[b];B(p)&&ie(w,p.getAttribute(g),g,l,p)}}r&&r(c)}const x=[];if(e.indexOf("[")!==-1){const f=/\[([\w-]+)/g;let c;for(;(c=f.exec(e))!==null;)x.push(c[1])}else x.push(e);$e({selector:e,attribute:t,componentTag:l,attributes:m,ComponentFn:n,onInit:r,observed:x.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:k,persist:q}),je();const Q=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,F=o.subtreeQuery||(Q?e:"["+e+"]"),I={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:a,query:F};H().push(I),a&&F&&j().push(I),de(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=fe,window.lnCore.observeLifecycle=We);function u(){Me()>0?T(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",u):u(),S}function he(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function ge(e){return(e||"").replace(/^#/,"")}function W(e){const t=e===void 0?location.hash:e,n={},l=ge(t);if(!l)return n;const o=l.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const a=i.indexOf(":"),r=a>-1?i.slice(0,a):i,d=a>-1?i.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function U(e){if(!e)return null;const t=W();return e in t?t[e]:null}function we(e,t){if(!e)return;const n=W();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");ge(location.hash)!==o&&(location.hash=o)}function Ue(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function D(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 l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Ke(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Qe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function be(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function K(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),l=e.slice(t+1),o=l?l.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=W,window.lnCore.hashGet=U,window.lnCore.hashSet=we,window.lnCore.hashLinkClick=Ue,window.lnCore.resolveHashNamespace=D,window.lnCore.hashSortEncode=Ke,window.lnCore.hashSortDecode=Qe,window.lnCore.hashFilterEncode=be,window.lnCore.hashFilterDecode=K);function Pe(){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=Pe);function pe(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let l=0;l<t.length;l++)if(String(t[l]).trim().toLowerCase()===n)return!0;return!1}function Je(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function Ge(e,t,n){if(!t||typeof t!="object")return!0;const l=Object.keys(t);if(l.length===0)return!0;for(let o=0;o<l.length;o++){const s=t[l[o]];let i="";if(s.col!==null&&s.col!==void 0?i=e[s.col]||"":s.attr&&n&&typeof n.getAttribute=="function"&&(i=n.getAttribute(s.attr)||""),!pe(i,s.values))return!1}return!0}function ye(e,t,n,l){if(l!=null&&!isNaN(l))return parseInt(l,10);if(t&&typeof t.getAttribute=="function"){const o=t.getAttribute("data-ln-filter-col");if(o!==null&&!isNaN(parseInt(o,10)))return parseInt(o,10);if(typeof t.closest=="function"){const s=t.closest("th");if(s&&typeof s.cellIndex=="number")return s.cellIndex;const i=t.closest("[data-ln-popover], [id]");if(i&&i.id){const a=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(a&&typeof a.querySelector=="function"){const r=a.querySelector('[data-ln-popover-for="'+i.id+'"]');if(r&&typeof r.closest=="function"){const d=r.closest("th");if(d&&typeof d.cellIndex=="number")return d.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const o=e.querySelectorAll("thead th, tr:first-child th"),s=String(n).trim().toLowerCase();for(let i=0;i<o.length;i++){const a=o[i],r=a.getAttribute("data-ln-table-filter-col")||a.getAttribute("data-ln-filter-col")||a.getAttribute("data-ln-filter-key")||a.getAttribute("data-ln-table-col")||a.getAttribute("data-ln-col")||a.getAttribute("data-ln-field");if(r&&r.trim().toLowerCase()===s)return typeof a.cellIndex=="number"?a.cellIndex:i}if(t){const i=t.closest?t.closest("[data-ln-popover], [id]"):null,a=i&&i.id||t.id||null;if(a)for(let r=0;r<o.length;r++){const d=o[r];if(typeof d.querySelector=="function"&&d.querySelector('[data-ln-popover-for="'+a+'"]'))return typeof d.cellIndex=="number"?d.cellIndex:r}}for(let i=0;i<o.length;i++){const a=o[i],d=Array.from(a.childNodes||[]).filter(m=>m.nodeType===3),y=(d.length>0?d.map(m=>m.textContent.trim()).join(" "):a.textContent||"").trim().toLowerCase();if(y&&y===s)return typeof a.cellIndex=="number"?a.cellIndex:i}}return null}function ze(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let l=0;l<e.length;l++){const o=e[l];!t&&o.key&&(t=o.key),o.checked&&!o.isReset&&o.value&&n.push(o.value)}return{key:t,values:n}}function Xe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function me(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",l="data-ln-filter-value",o="data-ln-filter-hide",s="data-ln-filter-reset",i="data-ln-filter-col",a="data-ln-hash",r="data-ln-filter-values",d="data-ln-filter-target",y=new WeakMap;if(window[t]!==void 0)return;const m={"data-ln-filter":{prop:"targetId",type:"string",read:O,fallback:null,effect:I,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:I,description:"URL hash routing key for filter state persistence"},"data-ln-filter-values":{type:"string",effect:I,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-filter-target":{type:"marker",description:"Marker on target container or table observed by ln-filter"}},v=se(m);function k(u){return u.hasAttribute(s)||!u.getAttribute(l)}function q(u){const f=u.dom.querySelectorAll("["+n+"]"),c=[];for(let w=0;w<f.length;w++){const h=f[w];c.push({key:h.getAttribute(n),value:h.getAttribute(l)||"",checked:h.checked,isReset:k(h)})}const g=ze(c);return{key:g.key,values:g.values,targetId:u.targetId}}function S(u,f,c){const g=u.querySelectorAll("["+n+"]"),w=Array.isArray(c)&&c.length>0;for(let h=0;h<g.length;h++){const b=g[h];k(b)?b.checked=!w:w&&b.getAttribute(n)===f&&c.indexOf(b.getAttribute(l))!==-1?b.checked=!0:b.checked=!1}}function x(u){this.dom=u,le(this,u,v);const f=u.getAttribute(i);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=D(u,"filter"),this.hashEnabled=!!this.nsKey;const c=this,g=he(function(){c._render()});this._queueRender=g;const w=he(function(){c._destroyed||c._applyDomFilter()});this._queueDomFilter=w;function h(){if(!c.targetId)return;const p=document.getElementById(c.targetId);p&&!p.hasAttribute(d)&&p.setAttribute(d,c.targetId)}this._ensureTargetMarked=h,h(),T(function(){c._destroyed||h()}),this._attachHandlers(),this._onHashChange=function(){if(c._destroyed||!c.hashEnabled)return;const p=U(c.nsKey),C=K(p);C&&C.key&&C.values.length>0?S(c.dom,C.key,C.values):S(c.dom,null,[]),c._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let b=!1;if(this.hashEnabled){const p=U(this.nsKey),C=K(p);C&&C.key&&C.values.length>0&&(S(u,C.key,C.values),T(function(){c._destroyed||c._render()}),b=!0)}if(!b){const p=me(u.getAttribute(r));if(p.length>0){const C=u.querySelector("["+n+"]"),_=C?C.getAttribute(n):null;_&&(S(u,_,p),T(function(){c._destroyed||c._render()}),b=!0)}}if(!b){const p=u.querySelectorAll("["+n+"]");for(let C=0;C<p.length;C++)if(p[C].checked&&!k(p[C])){T(function(){c._destroyed||c._render()});break}}return this}x.prototype._attachHandlers=function(){const u=this;this._onDomChange=function(f){const c=f.target;if(!c||!c.hasAttribute||!c.hasAttribute(n))return;const g=Array.from(u.dom.querySelectorAll("["+n+"]"));if(k(c)){for(let w=0;w<g.length;w++)k(g[w])||(g[w].checked=!1);c.checked=!0,u._queueRender();return}if(c.checked){for(let h=0;h<g.length;h++)k(g[h])&&(g[h].checked=!1);let w=!1;for(let h=0;h<g.length;h++)if(k(g[h])){w=!0;break}if(w){let h=!0;for(let b=0;b<g.length;b++)if(!k(g[b])&&!g[b].checked){h=!1;break}if(h)for(let b=0;b<g.length;b++)k(g[b])?g[b].checked=!0:g[b].checked=!1}}else{let w=!1;for(let h=0;h<g.length;h++)if(!k(g[h])&&g[h].checked){w=!0;break}if(!w)for(let h=0;h<g.length;h++)k(g[h])&&(g[h].checked=!0)}u._queueRender()},this.dom.addEventListener("change",this._onDomChange)},x.prototype._render=function(){const u=this,f=q(this),c=this._lastSnapshot;if(!(!c||c.key!==f.key||Je(c.values,f.values)))return;f.key===null||f.values.length;const w=document.getElementById(u.targetId),h={key:f.key,values:f.values.slice(),targetId:u.targetId};L(u.dom,"ln-filter:change",h);let b=!1;w&&w!==u.dom&&ke(w,"ln-filter:change",h).defaultPrevented&&(b=!0);const p=c&&c.values.length>0,C=f.values.length===0;if(p&&C){const A={targetId:u.targetId};L(u.dom,"ln-filter:reset",A),w&&w!==u.dom&&L(w,"ln-filter:reset",A)}this._lastSnapshot={key:f.key,values:f.values.slice()};const _=Xe(f.values);if(_?this.dom.setAttribute(r,_):this.dom.removeAttribute(r),this.hashEnabled){const A=be(f.key,f.values);we(this.nsKey,A)}b||u._applyDomFilter(w)},x.prototype._applyDomFilter=function(u){const f=u||document.getElementById(this.targetId);if(!f)return;const c=q(this),g=c.key===null||c.values.length===0,w=f.tagName==="TABLE"?f:f.querySelector?f.querySelector("table"):null;if(w)this._filterTableRows(c,w);else{const h=f.children;for(let b=0;b<h.length;b++){const p=h[b],C=g?null:p.getAttribute("data-"+c.key),_=!g&&C!==null&&!pe(C,c.values),A=p.hasAttribute(o);_&&!A?p.setAttribute(o,"true"):!_&&A&&p.removeAttribute(o)}}};function Q(u){if(!u)return"";const f=u.querySelector?u.querySelector("[data-ln-value]"):null;return J(f||u)}function F(u){return!!(!u||typeof u!="object"||u.tagName==="TEMPLATE"||typeof u.hasAttribute=="function"&&(u.hasAttribute("data-ln-sort-exclude")||u.hasAttribute("hidden"))||u.classList&&u.classList.contains("hidden")||u.style&&u.style.display==="none"||typeof u.matches=="function"&&u.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof u.querySelector=="function"&&u.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}x.prototype._filterTableRows=function(u,f){if(!f){const p=document.getElementById(this.targetId);if(!p||(f=p.tagName==="TABLE"?p:p.querySelector?p.querySelector("table"):null,!f))return}const c=ye(f,this.dom,u.key,this.colIndex),g=u.key||this.dom.getAttribute("data-ln-filter-key")||(c!==null?"col"+c:"attr-filter"),w=u.values;y.has(f)||y.set(f,{});const h=y.get(f);g&&w.length>0?h[g]={col:c,values:w.slice(),attr:"data-"+g}:g&&delete h[g];const b=f.tBodies;for(let p=0;p<b.length;p++){const C=b[p].rows;for(let _=0;_<C.length;_++){const A=C[_];if(F(A))continue;const Ce={};for(let N=0;N<A.cells.length;N++)Ce[N]=Q(A.cells[N]);const Ae=!Ge(Ce,h,A),ve=A.hasAttribute(o);Ae&&!ve?A.setAttribute(o,"true"):!Ae&&ve&&A.removeAttribute(o)}}},x.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const u=document.getElementById(this.targetId);if(u){const f=u.tagName==="TABLE"?u:u.querySelector?u.querySelector("table"):null;if(f&&y.has(f)){const c=y.get(f),g=ye(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),w=this.dom.getAttribute("data-ln-filter-key")||(g!==null?"col"+g:this.colIndex!==null?"col"+this.colIndex:null);w&&c[w]&&(delete c[w],this._filterTableRows({key:null,values:[]},f)),Object.keys(c).length===0&&y.delete(f)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&u.removeAttribute(d)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t]};function I(u,f){const c=u[t];if(!(!c||c._destroyed))if(f===a)c.hashEnabled&&c._onHashChange&&window.removeEventListener("hashchange",c._onHashChange),c.nsKey=D(u,"filter"),c.hashEnabled=!!c.nsKey,c.hashEnabled&&window.addEventListener("hashchange",c._onHashChange);else if(f===r){const g=me(u.getAttribute(r)),w=u.querySelector("["+n+"]"),h=w?w.getAttribute(n):null;h&&(S(u,h,g),c._render())}else f===e&&(c.targetId=u.getAttribute(e)||null,c._ensureTargetMarked(),c._render())}fe(e,t,x,"ln-filter",{attributes:m,subtreeQuery:"["+e+"], ["+d+"]",onSubtreeChange:function(u,f){if(f.addedNodes.length===0&&f.removedNodes.length===0)return;let c=null,g=null;if(u.hasAttribute(d)?(g=u,c=u.getAttribute(d)||u.id):u.hasAttribute(e)&&(c=u.getAttribute(e),g=c?document.getElementById(c):null),!c||!g)return;const w=document.querySelectorAll("["+e+'="'+c+'"]');for(let h=0;h<w.length;h++){const b=w[h][t];b&&!b._destroyed&&q(b).values.length>0&&b._queueDomFilter()}},persist:{attr:r,hashActive:function(u){return!!D(u,"filter")}}})})()})();
@@ -52,7 +52,7 @@
52
52
  "description": "Column name or index filter specifier"
53
53
  },
54
54
  "data-ln-filter-hide": {
55
- "direction": "runtime",
55
+ "direction": "both",
56
56
  "sources": [
57
57
  "ln-filter.scss",
58
58
  "src/ln-filter.js"
@@ -317,14 +317,13 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
317
317
  const children = target.children;
318
318
  for (let i = 0; i < children.length; i++) {
319
319
  const el = children[i];
320
- el.removeAttribute(HIDE_ATTR);
321
- if (isReset) continue;
322
-
323
- const attr = el.getAttribute('data-' + active.key);
324
- if (attr === null) continue;
325
-
326
- if (!matchesFilterValues(attr, active.values)) {
320
+ const attr = !isReset ? el.getAttribute('data-' + active.key) : null;
321
+ const shouldHide = !isReset && attr !== null && !matchesFilterValues(attr, active.values);
322
+ const isHidden = el.hasAttribute(HIDE_ATTR);
323
+ if (shouldHide && !isHidden) {
327
324
  el.setAttribute(HIDE_ATTR, 'true');
325
+ } else if (!shouldHide && isHidden) {
326
+ el.removeAttribute(HIDE_ATTR);
328
327
  }
329
328
  }
330
329
  }
@@ -388,10 +387,12 @@ import { arraysDiffer, decodeFilterValues, deriveActiveFilters, encodeFilterValu
388
387
  cellValuesByCol[c] = _readCell(row.cells[c]);
389
388
  }
390
389
 
391
- if (evaluateRowFilters(cellValuesByCol, filters, row)) {
392
- row.removeAttribute(HIDE_ATTR);
393
- } else {
390
+ const shouldHide = !evaluateRowFilters(cellValuesByCol, filters, row);
391
+ const isHidden = row.hasAttribute(HIDE_ATTR);
392
+ if (shouldHide && !isHidden) {
394
393
  row.setAttribute(HIDE_ATTR, 'true');
394
+ } else if (!shouldHide && isHidden) {
395
+ row.removeAttribute(HIDE_ATTR);
395
396
  }
396
397
  }
397
398
  }