@livenetworks/ashlar 2.1.10 → 2.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/components/COMPONENTS.md +1 -1
  2. package/components/ln-accordion/ln-accordion.js +1 -1
  3. package/components/ln-ajax/ln-ajax.js +1 -1
  4. package/components/ln-api-connector/ln-api-connector.js +1 -1
  5. package/components/ln-api-queue/ln-api-queue.js +1 -1
  6. package/components/ln-autosave/ln-autosave.js +1 -1
  7. package/components/ln-chart/ln-chart.js +1 -1
  8. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  9. package/components/ln-confirm/ln-confirm.js +1 -1
  10. package/components/ln-core/events.js +5 -2
  11. package/components/ln-core/lifecycle.js +25 -44
  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/README.md +19 -0
  15. package/components/ln-data-store/ln-data-store.js +1 -1
  16. package/components/ln-data-store/ln-data-store.schema.json +92 -84
  17. package/components/ln-data-store/src/data-store-model.js +17 -0
  18. package/components/ln-data-store/src/ln-data-store.js +77 -1
  19. package/components/ln-date/ln-date.js +1 -1
  20. package/components/ln-debug/ln-debug.js +1 -1
  21. package/components/ln-debug/ln-debug.schema.json +28 -28
  22. package/components/ln-debug/src/debug-verifier.js +24 -30
  23. package/components/ln-debug/src/generated-attributes.js +1 -3
  24. package/components/ln-debug/src/ln-debug.js +3 -11
  25. package/components/ln-dropdown/ln-dropdown.js +1 -1
  26. package/components/ln-editor/ln-editor.js +1 -1
  27. package/components/ln-external-links/ln-external-links.js +1 -1
  28. package/components/ln-filter/ln-filter.js +1 -1
  29. package/components/ln-form/ln-form.js +1 -1
  30. package/components/ln-icon/ln-icon.js +1 -1
  31. package/components/ln-include/ln-include.js +1 -1
  32. package/components/ln-key/ln-key.js +1 -1
  33. package/components/ln-link/ln-link.js +1 -1
  34. package/components/ln-list/ln-list.js +1 -1
  35. package/components/ln-modal/ln-modal.js +1 -1
  36. package/components/ln-nav/ln-nav.js +1 -1
  37. package/components/ln-number/ln-number.js +1 -1
  38. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  39. package/components/ln-options/ln-options.js +1 -1
  40. package/components/ln-persist/ln-persist.js +1 -1
  41. package/components/ln-picklist/ln-picklist.js +1 -1
  42. package/components/ln-popover/ln-popover.js +1 -1
  43. package/components/ln-progress/ln-progress.js +1 -1
  44. package/components/ln-router/ln-router.js +1 -1
  45. package/components/ln-scroll/ln-scroll.js +1 -1
  46. package/components/ln-search/ln-search.js +1 -1
  47. package/components/ln-slug/ln-slug.js +1 -1
  48. package/components/ln-sort/ln-sort.js +1 -1
  49. package/components/ln-sortable/ln-sortable.js +1 -1
  50. package/components/ln-stat/ln-stat.js +1 -1
  51. package/components/ln-table/README.md +69 -38
  52. package/components/ln-table/ln-table.js +1 -1
  53. package/components/ln-table/ln-table.schema.json +11 -35
  54. package/components/ln-table/src/ln-table.js +306 -414
  55. package/components/ln-table/src/table-model.js +31 -0
  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-time/ln-time.js +1 -1
  59. package/components/ln-toast/ln-toast.js +1 -1
  60. package/components/ln-toggle/ln-toggle.js +1 -1
  61. package/components/ln-tooltip/ln-tooltip.js +1 -1
  62. package/components/ln-translations/ln-translations.js +1 -1
  63. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  64. package/components/ln-upload/ln-upload.js +1 -1
  65. package/components/ln-validate/ln-validate.js +1 -1
  66. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  67. package/ln-ashlar.html-data.json +7 -17
  68. package/package.json +1 -1
  69. package/theme/config/mixins/_ln-table.scss +18 -10
  70. package/theme/config/mixins/_table.scss +15 -2
  71. package/web-types.json +14 -28
@@ -1 +1 @@
1
- (function(){"use strict";function j(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function I(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!I(o))return}e.apply(console,t)}}function x(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function fe(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function q(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){q(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function he(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function we(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[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")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&i[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);i[r.name]=r.value===""||isNaN(d)?null:d}else i[r.name]=r.value}return i}function pe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function be(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const r=t[a];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const d=String(r).split(",").map(function(b){return b.trim()});l.checked=d.indexOf(l.value)!==-1}else l.checked=pe(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=be,window.lnCore.serializeForm=we,window.lnCore.resolveFormMethod=he);const P={};function me(e,t){P[e]=t}function ge(e){return P[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=me,window.lnCore.getDataMapper=ge);function ye(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,q(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 n=e.toLowerCase().split("-")[0];W[n]=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=ye);const N={};function K(e,t){N[e]||(N[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=N[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function ve(e,t,n){if(e){const o=e.querySelector('[data-ln-template="'+t+'"]');if(o)return o.content.cloneNode(!0)}return K(t,n)}function V(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const a=o[l],r=a.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 m=b[0].trim(),v=b[1].trim();t[v]!=null&&a.setAttribute(m,t[v])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[l],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],r=a.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 m=b[0].trim(),v=b[1].trim();v in t&&a.classList.toggle(m,!!t[v])}}return e}function Ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)V(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 Q(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],a=l.attributes;for(let r=0;r<a.length;r++){const d=a[r];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function xe(e,t,n,o,i,s){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 a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],b=String(o(d));let m=l[b];if(m)i(m,d,r);else{const v=K(n,s);if(!v||(Q(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),i(m,d,r)}a.appendChild(m)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=Q,window.lnCore.fill=V,window.lnCore.lnFill=Ae,window.lnCore.renderList=xe);function M(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function z(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function G(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function J(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const R=new Map;function X(e,t){const n=(e?e.join("|"):"")+"::"+t;if(R.has(n))return R.get(n);const o=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&o.has(a)?a:t};return R.set(n,i),i}function Y(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function Z(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function ee(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=r=>{i?console.warn(r,i):console.warn(r)};if(l==="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(l==="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(l==="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(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="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 Se(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function ke(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=X(o.values,o.fallback);break;case"integer":i=z;break;case"float":i=Y;break;case"boolean":i=G;break;case"list":i=J;break;case"json":i=Z;break;case"string":default:i=M;break}i||(i=M),t[o.prop]=[i,n,o.fallback]}return t}function Le(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function Ee(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Se,window.lnCore.attrSpec=ke,window.lnCore.attrStr=M,window.lnCore.attrInt=z,window.lnCore.attrBool=G,window.lnCore.attrList=J,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(n){console.error("["+t.attribute+"] init failed",e,n)}}}function te(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&L(e,l),e.querySelectorAll){const a=e.querySelectorAll(s);for(let r=0;r<a.length;r++)L(a[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Te(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function qe(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(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Ee(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 re(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function De(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=ne(),i=o.byAttr.get(t),s=j()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&I(l)){const a=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let d=0;d<a.length;d++)ee(a[d].spec,r,t,a[d].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const a=o.byReactive.get(t);a&&re(a,l,t,e.oldValue),o.reactiveWildcard.length&&re(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const r=i[a];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(te(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Ie(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,q(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{De(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function F(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function B(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function H(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=F();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}const o=B();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;a&&s.onSubtreeChange(a,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const l=!!(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(!l)s.matches&&s.matches(r.query)&&L(s,r);else if(s.matches&&s.matches(r.query)&&L(s,r),s.querySelectorAll){const d=s.querySelectorAll(r.query);for(let b=0;b<d.length;b++)L(d[b],r)}}r.onInit&&r.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(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(!l)s.matches&&s.matches(d)&&H(s,r);else if(s.matches&&s.matches(d)&&H(s,r),s.querySelectorAll){const b=s.querySelectorAll(d);for(let m=0;m<b.length;m++)H(b[m],r)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,q(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{oe(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ne(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{oe(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Me(e){F().push(e),e.onSubtreeChange&&e.query&&B().push(e),ie()}function le(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,r=i.onInit||null,d=i.onAttrChange||null,b=i.effects||null,m=i.attributes||null,v=m?Le(m):b,U=m?new Set(Object.keys(m)):null,O=i.persist||null;function S(_){const w=_||document.body;if(te(w,e,t,n),m&&j())for(const g in m){const p=m[g],y=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&y.push(w);for(let A=0;A<y.length;A++){const k=y[A];I(k)&&ee(p,k.getAttribute(g),g,o,k)}}r&&r(w)}const E=[];if(e.indexOf("[")!==-1){const _=/\[([\w-]+)/g;let w;for(;(w=_.exec(e))!==null;)E.push(w[1])}else E.push(e);Oe({selector:e,attribute:t,componentTag:o,attributes:m,ComponentFn:n,onInit:r,observed:E.concat(s),onAttributeChange:l,onAttrChange:d,effects:v,declared:U,persist:O}),Ie();const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,c=i.subtreeQuery||(u?e:"["+e+"]"),f={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:a,query:c};F().push(f),a&&c&&B().push(f),ie(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le,window.lnCore.observeLifecycle=Me,window.lnCore.withoutLifecycle=Ne);function h(){Te()>0?qe(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h(),S}function se(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},o=se(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const a=l.indexOf(":"),r=a>-1?l.slice(0,a):l,d=a>-1?l.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function Re(e){if(!e)return null;const t=$();return e in t?t[e]:null}function Fe(e,t){if(!e)return;const n=$();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");se(location.hash)!==i&&(location.hash=i)}function Be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function He(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function $e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ue(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 n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=Re,window.lnCore.hashSet=Fe,window.lnCore.hashLinkClick=Be,window.lnCore.resolveHashNamespace=He,window.lnCore.hashSortEncode=$e,window.lnCore.hashSortDecode=Ue,window.lnCore.hashFilterEncode=je,window.lnCore.hashFilterDecode=Pe);function We(e){return(e||"").replace(/^\?/,"")}function Ke(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=We(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,l]of i.entries())n[s]=l;return n}function Ve(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Qe(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function ze(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function Ge(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Je(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Xe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ye(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Ke,window.lnCore.queryGet=Ve,window.lnCore.querySet=Qe,window.lnCore.resolveQueryParam=ze,window.lnCore.querySortEncode=Ge,window.lnCore.querySortDecode=Je,window.lnCore.queryFilterEncode=Xe,window.lnCore.queryFilterDecode=Ye);function Ze(){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=Ze),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const n={"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},i={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},s={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},l={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let a=0;function r(u){return!!(i[u]||s[u]||l[u]||u==="link")}function d(u){this.dom=u;const c=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-"+ ++a;const _=this._textarea.value.trim();_&&(this._surface.innerHTML=_);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 y=0;y<p.length;y++){const A=p[y].getAttribute("data-ln-editor-action");r(A)&&p[y].setAttribute("aria-pressed","false")}}this._onInput=function(){c._syncToTextarea(),x(c.dom,"ln-editor:changed",{html:c._textarea.value,target:c.dom})},this._onMousedownToolbar=function(p){p.target.closest("[data-ln-editor-action]")&&p.preventDefault()},this._onClickToolbar=function(p){const y=p.target.closest("[data-ln-editor-action]");if(!y)return;const A=y.getAttribute("data-ln-editor-action");c._execAction(A)},this._onPaste=function(p){v(c,p)},this._onKeydown=function(p){S(c,p)},this._listeningSelection=!1,this._rafSelection=null,this._onSelectionChange=function(){c._rafSelection||(c._rafSelection=requestAnimationFrame(function(){c._rafSelection=null,document.contains(c._surface)&&c._updateActiveStates()}))},this._attachSelection=function(){c._listeningSelection||(c._listeningSelection=!0,document.addEventListener("selectionchange",c._onSelectionChange))},this._detachSelection=function(){c._listeningSelection&&(c._listeningSelection=!1,document.removeEventListener("selectionchange",c._onSelectionChange)),c._rafSelection&&(cancelAnimationFrame(c._rafSelection),c._rafSelection=null)},this._onFocus=function(){c._attachSelection(),c._updateActiveStates(),x(c.dom,"ln-editor:focus",{target:c.dom})},this._onBlur=function(){c._detachSelection(),c._syncToTextarea(),x(c.dom,"ln-editor:blur",{target:c.dom})},this._onTextareaInput=function(){c._surface.innerHTML!==c._textarea.value&&(c._surface.innerHTML=c._textarea.value,x(c.dom,"ln-editor:changed",{html:c._textarea.value,target:c.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 y=p.detail&&p.detail.html;y!==void 0&&(c._surface.innerHTML=y,c._syncToTextarea(),x(c.dom,"ln-editor:changed",{html:c._textarea.value,target:c.dom}))},u.addEventListener("ln-editor:set-content",this._onSetContent);const g=this._textarea.form;return g&&(this._onFormReset=function(){setTimeout(function(){c._surface.innerHTML=c._textarea.value,x(u,"ln-editor:changed",{html:c._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||fe(this.dom,"ln-editor:before-change",{action:u,target:this.dom}).defaultPrevented)){if(this._surface.focus(),i[u])document.execCommand(i[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 l[u]?document.execCommand(l[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 c=window.getSelection();if(!c||c.rangeCount===0)return;const f=c.anchorNode;if(!f||!this._surface.contains(f))return;const h=u.querySelectorAll("[data-ln-editor-action]");for(let _=0;_<h.length;_++){const w=h[_],g=w.getAttribute("data-ln-editor-action");let p=!1;if(i[g])try{p=document.queryCommandState(i[g])}catch{}else if(s[g]){const y=b(this._surface);p=y&&y.toLowerCase()===s[g]}else if(l[g])try{p=document.queryCommandState(l[g])}catch{}else g==="link"&&(p=!!m(c.anchorNode,"A",this._surface));if(r(g)){const y=String(p);w.getAttribute("aria-pressed")!==y&&w.setAttribute("aria-pressed",y)}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 c=this._textarea?this._textarea.form:null;if(c&&this._onFormReset&&c.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 c=window.getSelection();if(!c||c.rangeCount===0)return null;let f=c.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,c,f){for(;u&&u!==f;){if(u.nodeType===1&&u.tagName===c)return u;u=u.parentNode}return null}function v(u,c){c.preventDefault();let f="";if(c.clipboardData&&(f=c.clipboardData.getData("text/html"),!f)){const _=c.clipboardData.getData("text/plain");_&&(f=_.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=U(f);h&&document.execCommand("insertHTML",!1,h)}function U(u){const c=document.createElement("div");return c.innerHTML=u,O(c),c.innerHTML}function O(u){const c=Array.from(u.childNodes);for(let f=0;f<c.length;f++){const h=c[f];if(h.nodeType!==3){if(h.nodeType!==1){u.removeChild(h);continue}if(o[h.tagName]){const _=Array.from(h.attributes);for(let w=0;w<_.length;w++){const g=_[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"),O(h)}else{for(;h.firstChild;)u.insertBefore(h.firstChild,h);u.removeChild(h)}}}}function S(u,c){if(!(c.ctrlKey||c.metaKey))return;let f=null;switch(c.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(c.preventDefault(),u._execAction(f))}function E(u){const c=window.getSelection();if(!c||c.rangeCount===0)return;const f=m(c.anchorNode,"A",u._surface),h=c.getRangeAt(0).cloneRange();u._closeLinkPopover&&u._closeLinkPopover();const _=ve(u.dom,"ln-editor-link-popover","ln-editor");if(!_)return;const w=_.firstElementChild;if(!w)return;const g=w.querySelector('input[type="url"]'),p=w.querySelector('[data-ln-editor-action="confirm-link"]'),y=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 C=window.getSelection();C.removeAllRanges(),C.addRange(h)}function D(){document.removeEventListener("mousedown",ue),u._closeLinkPopover=null,w.remove()}function ce(){const C=g.value.trim();if(D(),k(),u._surface.focus(),C)if(f)f.setAttribute("href",C),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,C);const T=window.getSelection();if(T&&T.anchorNode){const de=m(T.anchorNode,"A",u._surface);de&&(de.setAttribute("rel","noopener noreferrer"),u._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function ae(){D(),k(),u._surface.focus()}function et(){D()}function ue(C){const T=u.dom.contains(C.target)&&C.target.closest('[data-ln-editor-action="link"]');!w.contains(C.target)&&!T&&et()}u._closeLinkPopover=D,p.addEventListener("click",ce),y.addEventListener("click",ae),g.addEventListener("keydown",function(C){C.key==="Enter"?(C.preventDefault(),ce()):C.key==="Escape"&&(C.preventDefault(),ae())}),document.addEventListener("mousedown",ue)}le(e,t,d,"ln-editor",{attributes:n})})()})();
1
+ (function(){"use strict";function U(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function I(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!I(o))return}e.apply(console,t)}}function x(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function fe(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function T(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){T(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function he(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function we(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[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")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&i[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);i[r.name]=r.value===""||isNaN(d)?null:d}else i[r.name]=r.value}return i}function pe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function be(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const a=l.getAttribute("data-ln-fill-as")||l.name;if(!a||!(a in t))continue;const r=t[a];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const d=String(r).split(",").map(function(m){return m.trim()});l.checked=d.indexOf(l.value)!==-1}else l.checked=pe(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=be,window.lnCore.serializeForm=we,window.lnCore.resolveFormMethod=he);const j={};function me(e,t){j[e]=t}function ge(e){return j[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=me,window.lnCore.getDataMapper=ge);function ye(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,T(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function Ce(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];P[n]=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=Ce,window.lnCore.getLocaleFallback=_e,window.lnCore.ensureLocaleObserver=ye);const N={};function W(e,t){N[e]||(N[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=N[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function ve(e,t,n){if(e){const o=e.querySelector('[data-ln-template="'+t+'"]');if(o)return o.content.cloneNode(!0)}return W(t,n)}function K(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const a=n[l],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const a=o[l],r=a.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const m=r[d].trim().split(":");if(m.length!==2)continue;const p=m[0].trim(),v=m[1].trim();t[v]!=null&&a.setAttribute(p,t[v])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const a=i[l],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const a=s[l],r=a.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const m=r[d].trim().split(":");if(m.length!==2)continue;const p=m[0].trim(),v=m[1].trim();v in t&&a.classList.toggle(p,!!t[v])}}return e}function Ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)K(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 V(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],a=l.attributes;for(let r=0;r<a.length;r++){const d=a[r];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function xe(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const d=e.children[r],m=d.getAttribute("data-ln-render-key");m&&(l[m]=d)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],m=String(o(d));let p=l[m];if(p)i(p,d,r);else{const v=W(n,s);if(!v||(V(v,d),p=v.firstElementChild,!p))continue;p.setAttribute("data-ln-render-key",m),i(p,d,r)}a.appendChild(p)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=V,window.lnCore.fill=K,window.lnCore.lnFill=Ae,window.lnCore.renderList=xe);function M(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function Q(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function z(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const F=new Map;function J(e,t){const n=(e?e.join("|"):"")+"::"+t;if(F.has(n))return F.get(n);const o=new Set(e||[]),i=function(s,l){const a=s.getAttribute(l);return a!==null&&o.has(a)?a:t};return F.set(n,i),i}function X(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function Y(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function Z(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const a=r=>{i?console.warn(r,i):console.warn(r)};if(l==="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(l==="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(l==="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(l==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="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 Se(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function ke(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=J(o.values,o.fallback);break;case"integer":i=Q;break;case"float":i=X;break;case"boolean":i=z;break;case"list":i=G;break;case"json":i=Y;break;case"string":default:i=M;break}i||(i=M),t[o.prop]=[i,n,o.fallback]}return t}function Le(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function Ee(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Se,window.lnCore.attrSpec=ke,window.lnCore.attrStr=M,window.lnCore.attrInt=Q,window.lnCore.attrBool=z,window.lnCore.attrList=G,window.lnCore.attrEnum=J,window.lnCore.attrFloat=X,window.lnCore.attrJson=Y);function q(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 ee(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&q(e,l),e.querySelectorAll){const a=e.querySelectorAll(s);for(let r=0;r<a.length;r++)q(a[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Te(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function qe(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 te(){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=te(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Ee(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 ne(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function De(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=te(),i=o.byAttr.get(t),s=U()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&I(l)){const a=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let d=0;d<a.length;d++)Z(a[d].spec,r,t,a[d].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const a=o.byReactive.get(t);a&&ne(a,l,t,e.oldValue),o.reactiveWildcard.length&&ne(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const r=i[a];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(ee(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Ie(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{De(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function R(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function B(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function re(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=R();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}const o=B();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;a&&s.onSubtreeChange(a,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType!==1)continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a],d=r.query;if(d&&(s.matches&&s.matches(d)&&(r.ComponentFn&&q(s,r),r.onInit&&r.onInit(s)),l&&s.querySelectorAll)){const m=s.querySelectorAll(d);for(let p=0;p<m.length;p++)r.ComponentFn&&q(m[p],r),r.onInit&&r.onInit(m[p])}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType!==1||document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a],d=r.query;if(d&&(s.matches&&s.matches(d)&&re(s,r),l&&s.querySelectorAll)){const m=s.querySelectorAll(d);for(let p=0;p<m.length;p++)re(m[p],r)}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,T(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{oe(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ne(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{oe(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Me(e){R().push(e),e.onSubtreeChange&&e.query&&B().push(e),ie()}function le(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,a=i.onSubtreeChange||null,r=i.onInit||null,d=i.onAttrChange||null,m=i.effects||null,p=i.attributes||null,v=p?Le(p):m,$=p?new Set(Object.keys(p)):null,O=i.persist||null;function S(C){const w=C||document.body;if(ee(w,e,t,n),p&&U())for(const g in p){const b=p[g],y=Array.from(w.querySelectorAll("["+g+"]"));w.matches&&w.matches("["+g+"]")&&y.push(w);for(let A=0;A<y.length;A++){const k=y[A];I(k)&&Z(b,k.getAttribute(g),g,o,k)}}r&&r(w)}const L=[];if(e.indexOf("[")!==-1){const C=/\[([\w-]+)/g;let w;for(;(w=C.exec(e))!==null;)L.push(w[1])}else L.push(e);Oe({selector:e,attribute:t,componentTag:o,attributes:p,ComponentFn:n,onInit:r,observed:L.concat(s),onAttributeChange:l,onAttrChange:d,effects:v,declared:$,persist:O}),Ie();const u=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,c=i.subtreeQuery||(u?e:"["+e+"]"),f={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:a,query:c};R().push(f),a&&c&&B().push(f),ie(),window[t]=S,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le,window.lnCore.observeLifecycle=Me,window.lnCore.withoutLifecycle=Ne);function h(){Te()>0?qe(function(){S(document.body)}):S(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",h):h(),S}function se(e){return(e||"").replace(/^#/,"")}function H(e){const t=e===void 0?location.hash:e,n={},o=se(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const a=l.indexOf(":"),r=a>-1?l.slice(0,a):l,d=a>-1?l.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function Fe(e){if(!e)return null;const t=H();return e in t?t[e]:null}function Re(e,t){if(!e)return;const n=H();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");se(location.hash)!==i&&(location.hash=i)}function Be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function He(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function $e(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ue(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 n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=H,window.lnCore.hashGet=Fe,window.lnCore.hashSet=Re,window.lnCore.hashLinkClick=Be,window.lnCore.resolveHashNamespace=He,window.lnCore.hashSortEncode=$e,window.lnCore.hashSortDecode=Ue,window.lnCore.hashFilterEncode=je,window.lnCore.hashFilterDecode=Pe);function We(e){return(e||"").replace(/^\?/,"")}function Ke(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=We(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,l]of i.entries())n[s]=l;return n}function Ve(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Qe(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function ze(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function Ge(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Je(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Xe(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ye(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Ke,window.lnCore.queryGet=Ve,window.lnCore.querySet=Qe,window.lnCore.resolveQueryParam=ze,window.lnCore.querySortEncode=Ge,window.lnCore.querySortDecode=Je,window.lnCore.queryFilterEncode=Xe,window.lnCore.queryFilterDecode=Ye);function Ze(){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=Ze),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const n={"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},i={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},s={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},l={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let a=0;function r(u){return!!(i[u]||s[u]||l[u]||u==="link")}function d(u){this.dom=u;const c=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 b=u.querySelector('label[for="'+h+'"]');b&&(b.id||(b.id=h+"-label"),this._surface.setAttribute("aria-labelledby",b.id))}this._surface.id=h?h+"-surface":"ln-editor-surface-"+ ++a;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 b=w.querySelectorAll("[data-ln-editor-action]");for(let y=0;y<b.length;y++){const A=b[y].getAttribute("data-ln-editor-action");r(A)&&b[y].setAttribute("aria-pressed","false")}}this._onInput=function(){c._syncToTextarea(),x(c.dom,"ln-editor:changed",{html:c._textarea.value,target:c.dom})},this._onMousedownToolbar=function(b){b.target.closest("[data-ln-editor-action]")&&b.preventDefault()},this._onClickToolbar=function(b){const y=b.target.closest("[data-ln-editor-action]");if(!y)return;const A=y.getAttribute("data-ln-editor-action");c._execAction(A)},this._onPaste=function(b){v(c,b)},this._onKeydown=function(b){S(c,b)},this._listeningSelection=!1,this._rafSelection=null,this._onSelectionChange=function(){c._rafSelection||(c._rafSelection=requestAnimationFrame(function(){c._rafSelection=null,document.contains(c._surface)&&c._updateActiveStates()}))},this._attachSelection=function(){c._listeningSelection||(c._listeningSelection=!0,document.addEventListener("selectionchange",c._onSelectionChange))},this._detachSelection=function(){c._listeningSelection&&(c._listeningSelection=!1,document.removeEventListener("selectionchange",c._onSelectionChange)),c._rafSelection&&(cancelAnimationFrame(c._rafSelection),c._rafSelection=null)},this._onFocus=function(){c._attachSelection(),c._updateActiveStates(),x(c.dom,"ln-editor:focus",{target:c.dom})},this._onBlur=function(){c._detachSelection(),c._syncToTextarea(),x(c.dom,"ln-editor:blur",{target:c.dom})},this._onTextareaInput=function(){c._surface.innerHTML!==c._textarea.value&&(c._surface.innerHTML=c._textarea.value,x(c.dom,"ln-editor:changed",{html:c._textarea.value,target:c.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(b){const y=b.detail&&b.detail.html;y!==void 0&&(c._surface.innerHTML=y,c._syncToTextarea(),x(c.dom,"ln-editor:changed",{html:c._textarea.value,target:c.dom}))},u.addEventListener("ln-editor:set-content",this._onSetContent);const g=this._textarea.form;return g&&(this._onFormReset=function(){setTimeout(function(){c._surface.innerHTML=c._textarea.value,x(u,"ln-editor:changed",{html:c._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||fe(this.dom,"ln-editor:before-change",{action:u,target:this.dom}).defaultPrevented)){if(this._surface.focus(),i[u])document.execCommand(i[u],!1,null);else if(s[u]){const f=s[u],h=m(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 c=window.getSelection();if(!c||c.rangeCount===0)return;const f=c.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 b=!1;if(i[g])try{b=document.queryCommandState(i[g])}catch{}else if(s[g]){const y=m(this._surface);b=y&&y.toLowerCase()===s[g]}else if(l[g])try{b=document.queryCommandState(l[g])}catch{}else g==="link"&&(b=!!p(c.anchorNode,"A",this._surface));if(r(g)){const y=String(b);w.getAttribute("aria-pressed")!==y&&w.setAttribute("aria-pressed",y)}b?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 c=this._textarea?this._textarea.form:null;if(c&&this._onFormReset&&c.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 m(u){const c=window.getSelection();if(!c||c.rangeCount===0)return null;let f=c.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 p(u,c,f){for(;u&&u!==f;){if(u.nodeType===1&&u.tagName===c)return u;u=u.parentNode}return null}function v(u,c){c.preventDefault();let f="";if(c.clipboardData&&(f=c.clipboardData.getData("text/html"),!f)){const C=c.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=$(f);h&&document.execCommand("insertHTML",!1,h)}function $(u){const c=document.createElement("div");return c.innerHTML=u,O(c),c.innerHTML}function O(u){const c=Array.from(u.childNodes);for(let f=0;f<c.length;f++){const h=c[f];if(h.nodeType!==3){if(h.nodeType!==1){u.removeChild(h);continue}if(o[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 b=h.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(b)||h.removeAttribute("href")}else h.removeAttribute(g)}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,c){if(!(c.ctrlKey||c.metaKey))return;let f=null;switch(c.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(c.preventDefault(),u._execAction(f))}function L(u){const c=window.getSelection();if(!c||c.rangeCount===0)return;const f=p(c.anchorNode,"A",u._surface),h=c.getRangeAt(0).cloneRange();u._closeLinkPopover&&u._closeLinkPopover();const C=ve(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"]'),b=w.querySelector('[data-ln-editor-action="confirm-link"]'),y=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 _=window.getSelection();_.removeAllRanges(),_.addRange(h)}function D(){document.removeEventListener("mousedown",ue),u._closeLinkPopover=null,w.remove()}function ce(){const _=g.value.trim();if(D(),k(),u._surface.focus(),_)if(f)f.setAttribute("href",_),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,_);const E=window.getSelection();if(E&&E.anchorNode){const de=p(E.anchorNode,"A",u._surface);de&&(de.setAttribute("rel","noopener noreferrer"),u._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function ae(){D(),k(),u._surface.focus()}function et(){D()}function ue(_){const E=u.dom.contains(_.target)&&_.target.closest('[data-ln-editor-action="link"]');!w.contains(_.target)&&!E&&et()}u._closeLinkPopover=D,b.addEventListener("click",ce),y.addEventListener("click",ae),g.addEventListener("keydown",function(_){_.key==="Enter"?(_.preventDefault(),ce()):_.key==="Escape"&&(_.preventDefault(),ae())}),document.addEventListener("mousedown",ue)}le(e,t,d,"ln-editor",{attributes:n})})()})();
@@ -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 l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];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,l={},c=e.elements,i={};if(r)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[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&&i[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let 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,o=[],l={};for(let c=0;c<r.length;c++){const i=r[c];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let c=0;c<r.length;c++){const i=r[c];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const s=i.getAttribute("data-ln-fill-as")||i.name;if(!s||!(s in t))continue;const n=t[s];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(l[i.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=j(n);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<i.options.length;a++)i.options[a].selected=n.indexOf(i.options[a].value)!==-1;o.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=W,window.lnCore.serializeForm=B,window.lnCore.resolveFormMethod=M);const x={};function U(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=U,window.lnCore.getDataMapper=V);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 _={};function J(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];_[r]=t}function K(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return _[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=J,window.lnCore.getLocaleFallback=K,window.lnCore.ensureLocaleObserver=H);const b={};function P(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 k(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const s=r[i],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const s=o[i],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 i=0;i<l.length;i++){const s=l[i],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let i=0;i<c.length;i++){const s=c[i],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 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)k(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 S(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(i,s){return t[s]!==void 0?t[s]:""}))}const o=function(c,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let c=0;c<l.length;c++){const i=l[c],s=i.attributes;for(let n=0;n<s.length;n++){const a=s[n];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Q(e,t,r,o,l,c){const i={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(i[u]=a)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(o(a));let d=i[u];if(d)l(d,a,n);else{const f=P(r,c);if(!f||(S(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=S,window.lnCore.fill=k,window.lnCore.lnFill=G,window.lnCore.renderList=Q);function g(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function v(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function L(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const l=o.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 q(e,t){const r=(e?e.join("|"):"")+"::"+t;if(m.has(r))return m.get(r);const o=new Set(e||[]),l=function(c,i){const s=c.getAttribute(i);return s!==null&&o.has(s)?s:t};return m.set(r,l),l}function D(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function O(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function z(e,t,r,o,l){if(!e||t===null)return!0;const c=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] 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:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="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(i==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="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 o in r){const[l,c,i]=r[o];Object.defineProperty(e,o,{get:function(){return l(t,c,i)},enumerable:!0,configurable:!0})}return e}function Y(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=q(o.values,o.fallback);break;case"integer":l=v;break;case"float":l=D;break;case"boolean":l=L;break;case"list":l=E;break;case"json":l=O;break;case"string":default:l=g;break}l||(l=g),t[o.prop]=[l,r,o.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=v,window.lnCore.attrBool=L,window.lnCore.attrList=E,window.lnCore.attrEnum=q,window.lnCore.attrFloat=D,window.lnCore.attrJson=O);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,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(c)&&h(e,i),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)h(s[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function F(){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=F(),r=e.observed||[];for(let o=0;o<r.length;o++){const l=r[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(c=>c.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Z(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function I(e,t,r,o){for(let l=0;l<e.length;l++){const c=e[l];if(!t[c.attribute])continue;const i=c.effects&&c.effects[r];i?i(t,r,o):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,o)}}function ne(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=F(),l=o.byAttr.get(t),c=T()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!l&&!c)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(c&&A(i)){const s=o.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let a=0;a<s.length;a++)z(s[a].spec,n,t,s[a].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const s=o.byReactive.get(t);s&&I(s,i,t,e.oldValue),o.reactiveWildcard.length&&I(o.reactiveWildcard,i,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const n=l[s];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(ee(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}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(o){console.error("[ln-core] mutation handler failed",t[r].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function R(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function y(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=$();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 o=R();if(e.target&&o.length)for(let l=0;l<o.length;l++){const c=o[l],i=c.query,s=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;s&&c.onSubtreeChange(s,e)}for(let l=0;l<e.addedNodes.length;l++){const c=e.addedNodes[l];if(c.nodeType===1){const i=!!(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(!i)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){if(document.contains(c))continue;const i=!!(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(!i)c.matches&&c.matches(a)&&y(c,n);else if(c.matches&&c.matches(a)&&y(c,n),c.querySelectorAll){const u=c.querySelectorAll(a);for(let d=0;d<u.length;d++)y(u[d],n)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,w(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{oe(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function le(e,t){te({observed:e,handler:t}),re()}function se(e){$().push(e),e.onSubtreeChange&&e.query&&R().push(e),ie()}function N(e){return(e||"").replace(/^#/,"")}function C(e){const t=e===void 0?location.hash:e,r={},o=N(t);if(!o)return r;const l=o.split("&");for(let c=0;c<l.length;c++){const i=l[c];if(!i)continue;const s=i.indexOf(":"),n=s>-1?i.slice(0,s):i,a=s>-1?i.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=C();return e in t?t[e]:null}function ae(e,t){if(!e)return;const r=C();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(c){const i=r[c];return i===""?c:c+":"+encodeURIComponent(i)}).join("&");N(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 o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function 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),o=e.slice(t+1),l=o?o.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=C,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(e){return(e||"").replace(/^\?/,"")}function ge(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},o=be(t);if(!o)return r;const l=new URLSearchParams(o);for(const[c,i]of l.entries())r[c]=i;return r}function me(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function ye(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const o=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",o)}function Ce(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function Ae(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function xe(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:o}}}return null}function _e(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function ke(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=ge,window.lnCore.queryGet=me,window.lnCore.querySet=ye,window.lnCore.resolveQueryParam=Ce,window.lnCore.querySortEncode=Ae,window.lnCore.querySortDecode=xe,window.lnCore.queryFilterEncode=_e,window.lnCore.queryFilterDecode=ke);function Se(){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=Se),(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 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 i(){l(),c(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){o()}):o()}window[e]={process:o},i()})()})();
1
+ (function(){"use strict";function T(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function y(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){o=t[l];break}if(!y(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,l={},c=e.elements,i={};if(r)for(let s=0;s<c.length;s++){const n=c[s];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[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&&i[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let 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,o=[],l={};for(let c=0;c<r.length;c++){const i=r[c];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let c=0;c<r.length;c++){const i=r[c];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const s=i.getAttribute("data-ln-fill-as")||i.name;if(!s||!(s in t))continue;const n=t[s];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(l[i.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=j(n);o.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),o.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<i.options.length;a++)i.options[a].selected=n.indexOf(i.options[a].value)!==-1;o.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),o.push(i)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=W,window.lnCore.serializeForm=B,window.lnCore.resolveFormMethod=M);const A={};function U(e,t){A[e]=t}function V(e){return A[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=U,window.lnCore.getDataMapper=V);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 x={};function J(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];x[r]=t}function K(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return x[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=J,window.lnCore.getLocaleFallback=K,window.lnCore.ensureLocaleObserver=H);const b={};function P(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 _(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const s=r[i],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const s=o[i],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 i=0;i<l.length;i++){const s=l[i],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let i=0;i<c.length;i++){const s=c[i],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 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)_(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 k(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(i,s){return t[s]!==void 0?t[s]:""}))}const o=function(c,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let c=0;c<l.length;c++){const i=l[c],s=i.attributes;for(let n=0;n<s.length;n++){const a=s[n];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Q(e,t,r,o,l,c){const i={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(i[u]=a)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(o(a));let d=i[u];if(d)l(d,a,n);else{const f=P(r,c);if(!f||(k(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=k,window.lnCore.fill=_,window.lnCore.lnFill=G,window.lnCore.renderList=Q);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 v(e,t,r=!1){const o=e.getAttribute(t);if(o===null)return!!r;const l=o.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 L(e,t){const r=(e?e.join("|"):"")+"::"+t;if(m.has(r))return m.get(r);const o=new Set(e||[]),l=function(c,i){const s=c.getAttribute(i);return s!==null&&o.has(s)?s:t};return m.set(r,l),l}function q(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function D(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function z(e,t,r,o,l){if(!e||t===null)return!0;const c=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${c}] 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:(s(`[${c}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="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(i==="float")return isNaN(Number(t))?(s(`[${c}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="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 o in r){const[l,c,i]=r[o];Object.defineProperty(e,o,{get:function(){return l(t,c,i)},enumerable:!0,configurable:!0})}return e}function Y(e){const t={};for(const r in e){const o=e[r];if(!o||!o.prop)continue;let l=o.read;if(!l&&o.type)switch(o.type){case"enum":l=L(o.values,o.fallback);break;case"integer":l=S;break;case"float":l=q;break;case"boolean":l=v;break;case"list":l=E;break;case"json":l=D;break;case"string":default:l=g;break}l||(l=g),t[o.prop]=[l,r,o.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=v,window.lnCore.attrList=E,window.lnCore.attrEnum=L,window.lnCore.attrFloat=q,window.lnCore.attrJson=D);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,o){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(c)&&h(e,i),e.querySelectorAll){const s=e.querySelectorAll(c);for(let n=0;n<s.length;n++)h(s[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function O(){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=O(),r=e.observed||[];for(let o=0;o<r.length;o++){const l=r[o];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const l=t.byDeclaredAttr.get(o);l.some(c=>c.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=Z(e);if(o===null)t.reactiveWildcard.push(e);else for(const l of o)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function F(e,t,r,o){for(let l=0;l<e.length;l++){const c=e[l];if(!t[c.attribute])continue;const i=c.effects&&c.effects[r];i?i(t,r,o):c.onAttrChange&&(!c.declared||c.declared.has(r))&&c.onAttrChange(t,r,o)}}function ne(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=O(),l=o.byAttr.get(t),c=T()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!l&&!c)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(c&&y(i)){const s=o.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let a=0;a<s.length;a++)z(s[a].spec,n,t,s[a].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const s=o.byReactive.get(t);s&&F(s,i,t,e.oldValue),o.reactiveWildcard.length&&F(o.reactiveWildcard,i,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const n=l[s];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(ee(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}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(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 $(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function R(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 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 o=$();if(e.target&&o.length)for(let l=0;l<o.length;l++){const c=o[l],i=c.query,s=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;s&&c.onSubtreeChange(s,e)}for(let l=0;l<e.addedNodes.length;l++){const c=e.addedNodes[l];if(c.nodeType!==1)continue;const i=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s],a=n.query;if(a&&(c.matches&&c.matches(a)&&(n.ComponentFn&&h(c,n),n.onInit&&n.onInit(c)),i&&c.querySelectorAll)){const u=c.querySelectorAll(a);for(let d=0;d<u.length;d++)n.ComponentFn&&h(u[d],n),n.onInit&&n.onInit(u[d])}}}for(let l=0;l<e.removedNodes.length;l++){const c=e.removedNodes[l];if(c.nodeType!==1||document.contains(c))continue;const i=!!(c.firstElementChild||c.children&&c.children.length);for(let s=0;s<t.length;s++){const n=t[s],a=n.query;if(a&&(c.matches&&c.matches(a)&&R(c,n),i&&c.querySelectorAll)){const u=c.querySelectorAll(a);for(let d=0;d<u.length;d++)R(u[d],n)}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,w(function(){const e=new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{oe(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}});window.lnCore._lifecycleObserver=e,e.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&&$().push(e),ie()}function N(e){return(e||"").replace(/^#/,"")}function C(e){const t=e===void 0?location.hash:e,r={},o=N(t);if(!o)return r;const l=o.split("&");for(let c=0;c<l.length;c++){const i=l[c];if(!i)continue;const s=i.indexOf(":"),n=s>-1?i.slice(0,s):i,a=s>-1?i.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=C();return e in t?t[e]:null}function ae(e,t){if(!e)return;const r=C();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(c){const i=r[c];return i===""?c:c+":"+encodeURIComponent(i)}).join("&");N(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 o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function fe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function 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),o=e.slice(t+1),l=o?o.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=C,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(e){return(e||"").replace(/^\?/,"")}function ge(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,r={},o=be(t);if(!o)return r;const l=new URLSearchParams(o);for(const[c,i]of l.entries())r[c]=i;return r}function me(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Ce(e,t){if(!e||typeof window>"u")return;const r=new URL(window.location.href);if(t==null||t===""?r.searchParams.delete(e):r.searchParams.set(e,String(t)),r.search===window.location.search)return;const o=r.pathname+r.search+r.hash;window.history.replaceState(window.history.state,"",o)}function ye(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const r=e.getAttribute("data-ln-query");if(r&&r.trim()!=="")return r.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function Ae(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function xe(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const r=t.sort_field||t.sort_by;if(r){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:r,direction:o}}}return null}function _e(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function ke(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=ge,window.lnCore.queryGet=me,window.lnCore.querySet=Ce,window.lnCore.resolveQueryParam=ye,window.lnCore.querySortEncode=Ae,window.lnCore.querySortDecode=xe,window.lnCore.queryFilterEncode=_e,window.lnCore.queryFilterDecode=ke);function Se(){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=Se),(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 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 i(){l(),c(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){o()}):o()}window[e]={process:o},i()})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function X(){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 j(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(!j(o))return}e.apply(console,t)}}function F(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function Te(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function 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 Z(e){return e.hasAttribute("value")?e.getAttribute("value"):e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.textContent.trim()}function Re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Fe(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&i[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);i[r.name]=r.value===""||isNaN(d)?null:d}else i[r.name]=r.value}return i}function Oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function De(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const d=String(r).split(",").map(function(b){return b.trim()});l.checked=d.indexOf(l.value)!==-1}else l.checked=Oe(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=De,window.lnCore.serializeForm=Fe,window.lnCore.resolveFormMethod=Re);const ee={};function Ne(e,t){ee[e]=t}function Be(e){return ee[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ne,window.lnCore.getDataMapper=Be);function Me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,O(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const te={};function $e(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];te[n]=t}function je(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return te[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=$e,window.lnCore.getLocaleFallback=je,window.lnCore.ensureLocaleObserver=Me);const P={};function Pe(e,t){P[e]||(P[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=P[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function ne(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],r=c.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 m=b[0].trim(),k=b[1].trim();t[k]!=null&&c.setAttribute(m,t[k])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const b=r[d].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),k=b[1].trim();k in t&&c.classList.toggle(m,!!t[k])}}return e}function He(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)ne(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 re(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let r=0;r<c.length;r++){const d=c[r];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Ve(e,t,n,o,i,s){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 c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],b=String(o(d));let m=l[b];if(m)i(m,d,r);else{const k=Pe(n,s);if(!k||(re(k,d),m=k.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),i(m,d,r)}c.appendChild(m)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=re,window.lnCore.fill=ne,window.lnCore.lnFill=He,window.lnCore.renderList=Ve);function D(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function oe(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function ie(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function le(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const H=new Map;function se(e,t){const n=(e?e.join("|"):"")+"::"+t;if(H.has(n))return H.get(n);const o=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&o.has(c)?c:t};return H.set(n,i),i}function ce(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function ae(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function ue(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function de(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=se(o.values,o.fallback);break;case"integer":i=oe;break;case"float":i=ce;break;case"boolean":i=ie;break;case"list":i=le;break;case"json":i=ae;break;case"string":default:i=D;break}i||(i=D),t[o.prop]=[i,n,o.fallback]}return t}function Ue(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function We(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=de,window.lnCore.attrSpec=fe,window.lnCore.attrStr=D,window.lnCore.attrInt=oe,window.lnCore.attrBool=ie,window.lnCore.attrList=le,window.lnCore.attrEnum=se,window.lnCore.attrFloat=ce,window.lnCore.attrJson=ae);function L(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function he(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&L(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)L(c[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ke(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function I(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 we(){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 Qe(e){const t=we(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=We(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 ye(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function Ge(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=we(),i=o.byAttr.get(t),s=X()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&j(l)){const c=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let d=0;d<c.length;d++)ue(c[d].spec,r,t,c[d].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=o.byReactive.get(t);c&&ye(c,l,t,e.oldValue),o.reactiveWildcard.length&&ye(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const r=i[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(he(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Je(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,O(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ge(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function V(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function U(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function W(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ge(e){const t=V();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}const o=U();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)s.matches&&s.matches(r.query)&&L(s,r);else if(s.matches&&s.matches(r.query)&&L(s,r),s.querySelectorAll){const d=s.querySelectorAll(r.query);for(let b=0;b<d.length;b++)L(d[b],r)}}r.onInit&&r.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],d=r.query;if(d){if(!l)s.matches&&s.matches(d)&&W(s,r);else if(s.matches&&s.matches(d)&&W(s,r),s.querySelectorAll){const b=s.querySelectorAll(d);for(let m=0;m<b.length;m++)W(b[m],r)}}}}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,O(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ge(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ze(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{ge(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ye(e){V().push(e),e.onSubtreeChange&&e.query&&U().push(e),pe()}function be(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,r=i.onInit||null,d=i.onAttrChange||null,b=i.effects||null,m=i.attributes||null,k=m?Ue(m):b,Y=m?new Set(Object.keys(m)):null,T=i.persist||null;function v(q){const a=q||document.body;if(he(a,e,t,n),m&&X())for(const f in m){const u=m[f],h=Array.from(a.querySelectorAll("["+f+"]"));a.matches&&a.matches("["+f+"]")&&h.push(a);for(let y=0;y<h.length;y++){const w=h[y];j(w)&&ue(u,w.getAttribute(f),f,o,w)}}r&&r(a)}const x=[];if(e.indexOf("[")!==-1){const q=/\[([\w-]+)/g;let a;for(;(a=q.exec(e))!==null;)x.push(a[1])}else x.push(e);Qe({selector:e,attribute:t,componentTag:o,attributes:m,ComponentFn:n,onInit:r,observed:x.concat(s),onAttributeChange:l,onAttrChange:d,effects:k,declared:Y,persist:T}),Je();const S=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,E=i.subtreeQuery||(S?e:"["+e+"]"),B={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:E};V().push(B),c&&E&&U().push(B),pe(),window[t]=v,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=be,window.lnCore.observeLifecycle=Ye,window.lnCore.withoutLifecycle=ze);function M(){Ke()>0?I(function(){v(document.body)}):v(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",M):M(),v}function me(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function Ce(e){return(e||"").replace(/^#/,"")}function K(e){const t=e===void 0?location.hash:e,n={},o=Ce(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,d=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function Q(e){if(!e)return null;const t=K();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const n=K();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");Ce(location.hash)!==i&&(location.hash=i)}function Xe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function N(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ze(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function et(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 G(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=K,window.lnCore.hashGet=Q,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=Xe,window.lnCore.resolveHashNamespace=N,window.lnCore.hashSortEncode=Ze,window.lnCore.hashSortDecode=et,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=G);function tt(e){return(e||"").replace(/^\?/,"")}function nt(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=tt(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,l]of i.entries())n[s]=l;return n}function J(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function ve(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function rt(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ot(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Se(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function z(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=nt,window.lnCore.queryGet=J,window.lnCore.querySet=ve,window.lnCore.resolveQueryParam=ke,window.lnCore.querySortEncode=rt,window.lnCore.querySortDecode=ot,window.lnCore.queryFilterEncode=Se,window.lnCore.queryFilterDecode=z);function it(){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=it);function Ee(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let o=0;o<t.length;o++)if(String(t[o]).trim().toLowerCase()===n)return!0;return!1}function lt(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 st(e,t,n){if(!t||typeof t!="object")return!0;const o=Object.keys(t);if(o.length===0)return!0;for(let i=0;i<o.length;i++){const s=t[o[i]];let l="";if(s.col!==null&&s.col!==void 0?l=e[s.col]||"":s.attr&&n&&typeof n.getAttribute=="function"&&(l=n.getAttribute(s.attr)||""),!Ee(l,s.values))return!1}return!0}function qe(e,t,n,o){if(o!=null&&!isNaN(o))return parseInt(o,10);if(t&&typeof t.getAttribute=="function"){const i=t.getAttribute("data-ln-filter-col");if(i!==null&&!isNaN(parseInt(i,10)))return parseInt(i,10);if(typeof t.closest=="function"){const s=t.closest("th");if(s&&typeof s.cellIndex=="number")return s.cellIndex;const l=t.closest("[data-ln-popover], [id]");if(l&&l.id){const c=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(c&&typeof c.querySelector=="function"){const r=c.querySelector('[data-ln-popover-for="'+l.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 i=e.querySelectorAll("thead th, tr:first-child th"),s=String(n).trim().toLowerCase();for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-table-filter-col")||c.getAttribute("data-ln-filter-col")||c.getAttribute("data-ln-filter-key")||c.getAttribute("data-ln-table-col")||c.getAttribute("data-ln-col")||c.getAttribute("data-ln-field");if(r&&r.trim().toLowerCase()===s)return typeof c.cellIndex=="number"?c.cellIndex:l}if(t){const l=t.closest?t.closest("[data-ln-popover], [id]"):null,c=l&&l.id||t.id||null;if(c)for(let r=0;r<i.length;r++){const d=i[r];if(typeof d.querySelector=="function"&&d.querySelector('[data-ln-popover-for="'+c+'"]'))return typeof d.cellIndex=="number"?d.cellIndex:r}}for(let l=0;l<i.length;l++){const c=i[l],d=Array.from(c.childNodes||[]).filter(m=>m.nodeType===3),b=(d.length>0?d.map(m=>m.textContent.trim()).join(" "):c.textContent||"").trim().toLowerCase();if(b&&b===s)return typeof c.cellIndex=="number"?c.cellIndex:l}}return null}function ct(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let o=0;o<e.length;o++){const i=e[o];!t&&i.key&&(t=i.key),i.checked&&!i.isReset&&i.value&&n.push(i.value)}return{key:t,values:n}}function at(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function xe(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",o="data-ln-filter-value",i="data-ln-filter-hide",s="data-ln-filter-reset",l="data-ln-filter-col",c="data-ln-hash",r="data-ln-query",d="data-ln-filter-values",b="data-ln-filter-target",m=new WeakMap;if(window[t]!==void 0)return;const k={"data-ln-filter":{prop:"targetId",type:"string",read:D,fallback:null,effect:q,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:q,description:"URL hash routing key for filter state persistence"},"data-ln-query":{type:"string",effect:q,description:"URL query parameter name for filter state synchronization"},"data-ln-filter-values":{type:"string",effect:q,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"}},Y=fe(k);function T(a){if(!a.hasAttribute(r))return null;const f=a.getAttribute(r);if(f&&f.trim()!=="")return f.trim();const u=a.getAttribute(l);if(u&&isNaN(parseInt(u,10)))return u.trim();const h=a.querySelector("["+n+"]");if(h){const y=h.getAttribute(n);if(y&&y.trim()!=="")return y.trim()}return ke(a,"filter")}function v(a){return a.hasAttribute(s)||!a.getAttribute(o)}function x(a){const f=a.dom.querySelectorAll("["+n+"]"),u=[];for(let y=0;y<f.length;y++){const w=f[y];u.push({key:w.getAttribute(n),value:w.getAttribute(o)||"",checked:w.checked,isReset:v(w)})}const h=ct(u);return{key:h.key,values:h.values,targetId:a.targetId}}function S(a,f,u){const h=a.querySelectorAll("["+n+"]"),y=Array.isArray(u)&&u.length>0;for(let w=0;w<h.length;w++){const g=h[w];v(g)?g.checked=!y:y&&g.getAttribute(n)===f&&u.indexOf(g.getAttribute(o))!==-1?g.checked=!0:g.checked=!1}}function E(a){this.dom=a,de(this,a,Y);const f=a.getAttribute(l);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=N(a,"filter"),this.hashEnabled=!!this.nsKey,this.queryParam=T(a),this.queryEnabled=!!this.queryParam;const u=this,h=me(function(){u._render()});this._queueRender=h;const y=me(function(){u._destroyed||u._applyDomFilter()});this._queueDomFilter=y;function w(){if(!u.targetId)return;const p=document.getElementById(u.targetId);p&&!p.hasAttribute(b)&&p.setAttribute(b,u.targetId)}this._ensureTargetMarked=w,w(),I(function(){u._destroyed||w()}),this._attachHandlers(),this._onHashChange=function(){if(u._destroyed||!u.hashEnabled)return;const p=Q(u.nsKey),C=G(p);C&&C.key&&C.values.length>0?S(u.dom,C.key,C.values):S(u.dom,null,[]),u._render()},this._onPopState=function(){if(u._destroyed||!u.queryEnabled)return;const p=J(u.queryParam),C=z(p),_=u.dom.querySelector("["+n+"]"),A=_?_.getAttribute(n):u.queryParam;S(u.dom,A,C),u._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange),this.queryEnabled&&window.addEventListener("popstate",this._onPopState);let g=!1;if(this.hashEnabled){const p=Q(this.nsKey),C=G(p);C&&C.key&&C.values.length>0&&(S(a,C.key,C.values),I(function(){u._destroyed||u._render()}),g=!0)}else if(this.queryEnabled){const p=J(this.queryParam),C=z(p);if(C.length>0){const _=a.querySelector("["+n+"]"),A=_?_.getAttribute(n):u.queryParam;S(a,A,C),I(function(){u._destroyed||u._render()}),g=!0}}if(!g){const p=xe(a.getAttribute(d));if(p.length>0){const C=a.querySelector("["+n+"]"),_=C?C.getAttribute(n):null;_&&(S(a,_,p),I(function(){u._destroyed||u._render()}),g=!0)}}if(!g){const p=a.querySelectorAll("["+n+"]");for(let C=0;C<p.length;C++)if(p[C].checked&&!v(p[C])){I(function(){u._destroyed||u._render()});break}}return this}E.prototype._attachHandlers=function(){const a=this;this._onDomChange=function(f){const u=f.target;if(!u||!u.hasAttribute||!u.hasAttribute(n))return;const h=Array.from(a.dom.querySelectorAll("["+n+"]"));if(v(u)){for(let y=0;y<h.length;y++)v(h[y])||(h[y].checked=!1);u.checked=!0,a._queueRender();return}if(u.checked){for(let w=0;w<h.length;w++)v(h[w])&&(h[w].checked=!1);let y=!1;for(let w=0;w<h.length;w++)if(v(h[w])){y=!0;break}if(y){let w=!0;for(let g=0;g<h.length;g++)if(!v(h[g])&&!h[g].checked){w=!1;break}if(w)for(let g=0;g<h.length;g++)v(h[g])?h[g].checked=!0:h[g].checked=!1}}else{let y=!1;for(let w=0;w<h.length;w++)if(!v(h[w])&&h[w].checked){y=!0;break}if(!y)for(let w=0;w<h.length;w++)v(h[w])&&(h[w].checked=!0)}a._queueRender()},this.dom.addEventListener("change",this._onDomChange)},E.prototype._render=function(){const a=this,f=x(this),u=this._lastSnapshot;if(!(!u||u.key!==f.key||lt(u.values,f.values)))return;f.key===null||f.values.length;const y=document.getElementById(a.targetId),w={key:f.key,values:f.values.slice(),targetId:a.targetId};F(a.dom,"ln-filter:change",w);let g=!1;y&&y!==a.dom&&Te(y,"ln-filter:change",w).defaultPrevented&&(g=!0);const p=u&&u.values.length>0,C=f.values.length===0;if(p&&C){const A={targetId:a.targetId};F(a.dom,"ln-filter:reset",A),y&&y!==a.dom&&F(y,"ln-filter:reset",A)}this._lastSnapshot={key:f.key,values:f.values.slice()};const _=at(f.values);if(_?this.dom.setAttribute(d,_):this.dom.removeAttribute(d),this.hashEnabled){const A=_e(f.key,f.values);Ae(this.nsKey,A)}else if(this.queryEnabled){const A=Se(f.values),R=this.queryParam||f.key;R&&ve(R,A)}g||a._applyDomFilter(y)},E.prototype._applyDomFilter=function(a){const f=a||document.getElementById(this.targetId);if(!f)return;const u=x(this),h=u.key===null||u.values.length===0,y=f.tagName==="TABLE"?f:f.querySelector?f.querySelector("table"):null;if(y)this._filterTableRows(u,y);else{const w=f.children;for(let g=0;g<w.length;g++){const p=w[g],C=h?null:p.getAttribute("data-"+u.key),_=!h&&C!==null&&!Ee(C,u.values),A=p.hasAttribute(i);_&&!A?p.setAttribute(i,"true"):!_&&A&&p.removeAttribute(i)}}};function B(a){if(!a)return"";const f=a.querySelector?a.querySelector("[data-ln-value]"):null;return Z(f||a)}function M(a){return!!(!a||typeof a!="object"||a.tagName==="TEMPLATE"||typeof a.hasAttribute=="function"&&(a.hasAttribute("data-ln-sort-exclude")||a.hasAttribute("hidden"))||a.classList&&a.classList.contains("hidden")||a.style&&a.style.display==="none"||typeof a.matches=="function"&&a.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof a.querySelector=="function"&&a.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}E.prototype._filterTableRows=function(a,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 u=qe(f,this.dom,a.key,this.colIndex),h=a.key||this.dom.getAttribute("data-ln-filter-key")||(u!==null?"col"+u:"attr-filter"),y=a.values;m.has(f)||m.set(f,{});const w=m.get(f);h&&y.length>0?w[h]={col:u,values:y.slice(),attr:"data-"+h}:h&&delete w[h];const g=f.tBodies;for(let p=0;p<g.length;p++){const C=g[p].rows;for(let _=0;_<C.length;_++){const A=C[_];if(M(A))continue;const R={};for(let $=0;$<A.cells.length;$++)R[$]=B(A.cells[$]);const Ie=!st(R,w,A),Le=A.hasAttribute(i);Ie&&!Le?A.setAttribute(i,"true"):!Ie&&Le&&A.removeAttribute(i)}}},E.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const a=document.getElementById(this.targetId);if(a){const f=a.tagName==="TABLE"?a:a.querySelector?a.querySelector("table"):null;if(f&&m.has(f)){const u=m.get(f),h=qe(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),y=this.dom.getAttribute("data-ln-filter-key")||(h!==null?"col"+h:this.colIndex!==null?"col"+this.colIndex:null);y&&u[y]&&(delete u[y],this._filterTableRows({key:null,values:[]},f)),Object.keys(u).length===0&&m.delete(f)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&a.removeAttribute(b)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),this.queryEnabled&&this._onPopState&&window.removeEventListener("popstate",this._onPopState),delete this.dom[t]};function q(a,f){const u=a[t];if(!(!u||u._destroyed))if(f===c)u.hashEnabled&&u._onHashChange&&window.removeEventListener("hashchange",u._onHashChange),u.nsKey=N(a,"filter"),u.hashEnabled=!!u.nsKey,u.hashEnabled&&window.addEventListener("hashchange",u._onHashChange);else if(f===r)u.queryEnabled&&u._onPopState&&window.removeEventListener("popstate",u._onPopState),u.queryParam=T(a),u.queryEnabled=!!u.queryParam,u.queryEnabled&&window.addEventListener("popstate",u._onPopState);else if(f===d){const h=xe(a.getAttribute(d)),y=a.querySelector("["+n+"]"),w=y?y.getAttribute(n):null;w&&(S(a,w,h),u._render())}else f===e&&(u.targetId=a.getAttribute(e)||null,u._ensureTargetMarked(),u._render())}be(e,t,E,"ln-filter",{attributes:k,subtreeQuery:"["+e+"], ["+b+"]",onSubtreeChange:function(a,f){if(f.addedNodes.length===0&&f.removedNodes.length===0)return;let u=null,h=null;if(a.hasAttribute(b)?(h=a,u=a.getAttribute(b)||a.id):a.hasAttribute(e)&&(u=a.getAttribute(e),h=u?document.getElementById(u):null),!u||!h)return;const y=document.querySelectorAll("["+e+'="'+u+'"]');for(let w=0;w<y.length;w++){const g=y[w][t];g&&!g._destroyed&&x(g).values.length>0&&g._queueDomFilter()}},persist:{attr:d,hashActive:function(a){return!!N(a,"filter")||!!T(a)}}})})()})();
1
+ (function(){"use strict";function Y(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function j(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(!j(o))return}e.apply(console,t)}}function R(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function Te(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o);const i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:o});return e.dispatchEvent(i),i}function F(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){F(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function X(e){return e.hasAttribute("value")?e.getAttribute("value"):e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.textContent.trim()}function Re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function Fe(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let u=0;u<s.length;u++){const r=s[u];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let u=0;u<s.length;u++){const r=s[u];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let d=0;d<r.options.length;d++)r.options[d].selected&&i[r.name].push(r.options[d].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const d=Number(r.value);i[r.name]=r.value===""||isNaN(d)?null:d}else i[r.name]=r.value}return i}function Oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function De(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const u=l.getAttribute("data-ln-fill-as")||l.name;if(!u||!(u in t))continue;const r=t[u];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const d=String(r).split(",").map(function(m){return m.trim()});l.checked=d.indexOf(l.value)!==-1}else l.checked=Oe(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=De,window.lnCore.serializeForm=Fe,window.lnCore.resolveFormMethod=Re);const Z={};function Ne(e,t){Z[e]=t}function Be(e){return Z[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Ne,window.lnCore.getDataMapper=Be);function Me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,F(function(){new MutationObserver(function(){R(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const ee={};function $e(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];ee[n]=t}function je(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return ee[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=$e,window.lnCore.getLocaleFallback=je,window.lnCore.ensureLocaleObserver=Me);const P={};function Pe(e,t){P[e]||(P[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=P[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function te(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const u=n[l],r=u.getAttribute("data-ln-field");t[r]!=null&&(u.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const u=o[l],r=u.getAttribute("data-ln-attr").split(",");for(let d=0;d<r.length;d++){const m=r[d].trim().split(":");if(m.length!==2)continue;const y=m[0].trim(),k=m[1].trim();t[k]!=null&&u.setAttribute(y,t[k])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const u=i[l],r=u.getAttribute("data-ln-show");r in t&&u.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const u=s[l],r=u.getAttribute("data-ln-class").split(",");for(let d=0;d<r.length;d++){const m=r[d].trim().split(":");if(m.length!==2)continue;const y=m[0].trim(),k=m[1].trim();k in t&&u.classList.toggle(y,!!t[k])}}return e}function He(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)te(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 ne(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,u){return t[u]!==void 0?t[u]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],u=l.attributes;for(let r=0;r<u.length;r++){const d=u[r];d.value.indexOf("{{")!==-1&&l.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Ve(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const d=e.children[r],m=d.getAttribute("data-ln-render-key");m&&(l[m]=d)}const u=document.createDocumentFragment();for(let r=0;r<t.length;r++){const d=t[r],m=String(o(d));let y=l[m];if(y)i(y,d,r);else{const k=Pe(n,s);if(!k||(ne(k,d),y=k.firstElementChild,!y))continue;y.setAttribute("data-ln-render-key",m),i(y,d,r)}u.appendChild(y)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=ne,window.lnCore.fill=te,window.lnCore.lnFill=He,window.lnCore.renderList=Ve);function O(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function re(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function oe(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function ie(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const H=new Map;function le(e,t){const n=(e?e.join("|"):"")+"::"+t;if(H.has(n))return H.get(n);const o=new Set(e||[]),i=function(s,l){const u=s.getAttribute(l);return u!==null&&o.has(u)?u:t};return H.set(n,i),i}function se(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function ue(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function ce(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const u=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(u(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(u(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return u(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(u(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(u(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(u(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return u(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function ae(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function de(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=le(o.values,o.fallback);break;case"integer":i=re;break;case"float":i=se;break;case"boolean":i=oe;break;case"list":i=ie;break;case"json":i=ue;break;case"string":default:i=O;break}i||(i=O),t[o.prop]=[i,n,o.fallback]}return t}function Ue(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function We(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=ae,window.lnCore.attrSpec=de,window.lnCore.attrStr=O,window.lnCore.attrInt=re,window.lnCore.attrBool=oe,window.lnCore.attrList=ie,window.lnCore.attrEnum=le,window.lnCore.attrFloat=se,window.lnCore.attrJson=ue);function D(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function fe(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&D(e,l),e.querySelectorAll){const u=e.querySelectorAll(s);for(let r=0;r<u.length;r++)D(u[r],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ke(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function I(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 he(){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 Qe(e){const t=he(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=We(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 we(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function Ge(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=he(),i=o.byAttr.get(t),s=Y()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&j(l)){const u=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let d=0;d<u.length;d++)ce(u[d].spec,r,t,u[d].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const u=o.byReactive.get(t);u&&we(u,l,t,e.oldValue),o.reactiveWildcard.length&&we(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let u=0;u<i.length;u++){const r=i[u];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(fe(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function Je(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,F(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Ge(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function V(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function U(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function ge(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=V();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}const o=U();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,u=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;u&&s.onSubtreeChange(u,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType!==1)continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let u=0;u<t.length;u++){const r=t[u],d=r.query;if(d&&(s.matches&&s.matches(d)&&(r.ComponentFn&&D(s,r),r.onInit&&r.onInit(s)),l&&s.querySelectorAll)){const m=s.querySelectorAll(d);for(let y=0;y<m.length;y++)r.ComponentFn&&D(m[y],r),r.onInit&&r.onInit(m[y])}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType!==1||document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let u=0;u<t.length;u++){const r=t[u],d=r.query;if(d&&(s.matches&&s.matches(d)&&ge(s,r),l&&s.querySelectorAll)){const m=s.querySelectorAll(d);for(let y=0;y<m.length;y++)ge(m[y],r)}}}}function pe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,F(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{ye(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ze(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{ye(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Ye(e){V().push(e),e.onSubtreeChange&&e.query&&U().push(e),pe()}function be(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,u=i.onSubtreeChange||null,r=i.onInit||null,d=i.onAttrChange||null,m=i.effects||null,y=i.attributes||null,k=y?Ue(y):m,z=y?new Set(Object.keys(y)):null,L=i.persist||null;function v(x){const c=x||document.body;if(fe(c,e,t,n),y&&Y())for(const f in y){const a=y[f],h=Array.from(c.querySelectorAll("["+f+"]"));c.matches&&c.matches("["+f+"]")&&h.push(c);for(let g=0;g<h.length;g++){const w=h[g];j(w)&&ce(a,w.getAttribute(f),f,o,w)}}r&&r(c)}const q=[];if(e.indexOf("[")!==-1){const x=/\[([\w-]+)/g;let c;for(;(c=x.exec(e))!==null;)q.push(c[1])}else q.push(e);Qe({selector:e,attribute:t,componentTag:o,attributes:y,ComponentFn:n,onInit:r,observed:q.concat(s),onAttributeChange:l,onAttrChange:d,effects:k,declared:z,persist:L}),Je();const S=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,E=i.subtreeQuery||(S?e:"["+e+"]"),B={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:u,query:E};V().push(B),u&&E&&U().push(B),pe(),window[t]=v,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=be,window.lnCore.observeLifecycle=Ye,window.lnCore.withoutLifecycle=ze);function M(){Ke()>0?I(function(){v(document.body)}):v(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",M):M(),v}function me(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function Ce(e){return(e||"").replace(/^#/,"")}function W(e){const t=e===void 0?location.hash:e,n={},o=Ce(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const u=l.indexOf(":"),r=u>-1?l.slice(0,u):l,d=u>-1?l.slice(u+1):"";if(r)try{n[r]=decodeURIComponent(d)}catch{n[r]=d}}return n}function K(e){if(!e)return null;const t=W();return e in t?t[e]:null}function Ae(e,t){if(!e)return;const n=W();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");Ce(location.hash)!==i&&(location.hash=i)}function Xe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function N(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ze(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function et(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 Q(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=W,window.lnCore.hashGet=K,window.lnCore.hashSet=Ae,window.lnCore.hashLinkClick=Xe,window.lnCore.resolveHashNamespace=N,window.lnCore.hashSortEncode=Ze,window.lnCore.hashSortDecode=et,window.lnCore.hashFilterEncode=_e,window.lnCore.hashFilterDecode=Q);function tt(e){return(e||"").replace(/^\?/,"")}function nt(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=tt(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,l]of i.entries())n[s]=l;return n}function G(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function ve(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function rt(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ot(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Se(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function J(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=nt,window.lnCore.queryGet=G,window.lnCore.querySet=ve,window.lnCore.resolveQueryParam=ke,window.lnCore.querySortEncode=rt,window.lnCore.querySortDecode=ot,window.lnCore.queryFilterEncode=Se,window.lnCore.queryFilterDecode=J);function it(){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=it);function Ee(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let o=0;o<t.length;o++)if(String(t[o]).trim().toLowerCase()===n)return!0;return!1}function lt(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 st(e,t,n){if(!t||typeof t!="object")return!0;const o=Object.keys(t);if(o.length===0)return!0;for(let i=0;i<o.length;i++){const s=t[o[i]];let l="";if(s.col!==null&&s.col!==void 0?l=e[s.col]||"":s.attr&&n&&typeof n.getAttribute=="function"&&(l=n.getAttribute(s.attr)||""),!Ee(l,s.values))return!1}return!0}function xe(e,t,n,o){if(o!=null&&!isNaN(o))return parseInt(o,10);if(t&&typeof t.getAttribute=="function"){const i=t.getAttribute("data-ln-filter-col");if(i!==null&&!isNaN(parseInt(i,10)))return parseInt(i,10);if(typeof t.closest=="function"){const s=t.closest("th");if(s&&typeof s.cellIndex=="number")return s.cellIndex;const l=t.closest("[data-ln-popover], [id]");if(l&&l.id){const u=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(u&&typeof u.querySelector=="function"){const r=u.querySelector('[data-ln-popover-for="'+l.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 i=e.querySelectorAll("thead th, tr:first-child th"),s=String(n).trim().toLowerCase();for(let l=0;l<i.length;l++){const u=i[l],r=u.getAttribute("data-ln-table-filter-col")||u.getAttribute("data-ln-filter-col")||u.getAttribute("data-ln-filter-key")||u.getAttribute("data-ln-table-col")||u.getAttribute("data-ln-col")||u.getAttribute("data-ln-field");if(r&&r.trim().toLowerCase()===s)return typeof u.cellIndex=="number"?u.cellIndex:l}if(t){const l=t.closest?t.closest("[data-ln-popover], [id]"):null,u=l&&l.id||t.id||null;if(u)for(let r=0;r<i.length;r++){const d=i[r];if(typeof d.querySelector=="function"&&d.querySelector('[data-ln-popover-for="'+u+'"]'))return typeof d.cellIndex=="number"?d.cellIndex:r}}for(let l=0;l<i.length;l++){const u=i[l],d=Array.from(u.childNodes||[]).filter(y=>y.nodeType===3),m=(d.length>0?d.map(y=>y.textContent.trim()).join(" "):u.textContent||"").trim().toLowerCase();if(m&&m===s)return typeof u.cellIndex=="number"?u.cellIndex:l}}return null}function ut(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let o=0;o<e.length;o++){const i=e[o];!t&&i.key&&(t=i.key),i.checked&&!i.isReset&&i.value&&n.push(i.value)}return{key:t,values:n}}function ct(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function qe(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",o="data-ln-filter-value",i="data-ln-filter-hide",s="data-ln-filter-reset",l="data-ln-filter-col",u="data-ln-hash",r="data-ln-query",d="data-ln-filter-values",m="data-ln-filter-target",y=new WeakMap;if(window[t]!==void 0)return;const k={"data-ln-filter":{prop:"targetId",type:"string",read:O,fallback:null,effect:x,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:x,description:"URL hash routing key for filter state persistence"},"data-ln-query":{type:"string",effect:x,description:"URL query parameter name for filter state synchronization"},"data-ln-filter-values":{type:"string",effect:x,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"}},z=de(k);function L(c){if(!c.hasAttribute(r))return null;const f=c.getAttribute(r);if(f&&f.trim()!=="")return f.trim();const a=c.getAttribute(l);if(a&&isNaN(parseInt(a,10)))return a.trim();const h=c.querySelector("["+n+"]");if(h){const g=h.getAttribute(n);if(g&&g.trim()!=="")return g.trim()}return ke(c,"filter")}function v(c){return c.hasAttribute(s)||!c.getAttribute(o)}function q(c){const f=c.dom.querySelectorAll("["+n+"]"),a=[];for(let g=0;g<f.length;g++){const w=f[g];a.push({key:w.getAttribute(n),value:w.getAttribute(o)||"",checked:w.checked,isReset:v(w)})}const h=ut(a);return{key:h.key,values:h.values,targetId:c.targetId}}function S(c,f,a){const h=c.querySelectorAll("["+n+"]"),g=Array.isArray(a)&&a.length>0;for(let w=0;w<h.length;w++){const p=h[w];v(p)?p.checked=!g:g&&p.getAttribute(n)===f&&a.indexOf(p.getAttribute(o))!==-1?p.checked=!0:p.checked=!1}}function E(c){this.dom=c,ae(this,c,z);const f=c.getAttribute(l);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=N(c,"filter"),this.hashEnabled=!!this.nsKey,this.queryParam=L(c),this.queryEnabled=!!this.queryParam;const a=this,h=me(function(){a._render()});this._queueRender=h;const g=me(function(){a._destroyed||a._applyDomFilter()});this._queueDomFilter=g;function w(){if(!a.targetId)return;const b=document.getElementById(a.targetId);b&&!b.hasAttribute(m)&&b.setAttribute(m,a.targetId)}this._ensureTargetMarked=w,w(),I(function(){a._destroyed||w()}),this._attachHandlers(),this._onHashChange=function(){if(a._destroyed||!a.hashEnabled)return;const b=K(a.nsKey),C=Q(b);C&&C.key&&C.values.length>0?S(a.dom,C.key,C.values):S(a.dom,null,[]),a._render()},this._onPopState=function(){if(a._destroyed||!a.queryEnabled)return;const b=G(a.queryParam),C=J(b),_=a.dom.querySelector("["+n+"]"),A=_?_.getAttribute(n):a.queryParam;S(a.dom,A,C),a._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange),this.queryEnabled&&window.addEventListener("popstate",this._onPopState);let p=!1;if(this.hashEnabled){const b=K(this.nsKey),C=Q(b);C&&C.key&&C.values.length>0&&(S(c,C.key,C.values),I(function(){a._destroyed||a._render()}),p=!0)}else if(this.queryEnabled){const b=G(this.queryParam),C=J(b);if(C.length>0){const _=c.querySelector("["+n+"]"),A=_?_.getAttribute(n):a.queryParam;S(c,A,C),I(function(){a._destroyed||a._render()}),p=!0}}if(!p){const b=qe(c.getAttribute(d));if(b.length>0){const C=c.querySelector("["+n+"]"),_=C?C.getAttribute(n):null;_&&(S(c,_,b),I(function(){a._destroyed||a._render()}),p=!0)}}if(!p){const b=c.querySelectorAll("["+n+"]");for(let C=0;C<b.length;C++)if(b[C].checked&&!v(b[C])){I(function(){a._destroyed||a._render()});break}}return this}E.prototype._attachHandlers=function(){const c=this;this._onDomChange=function(f){const a=f.target;if(!a||!a.hasAttribute||!a.hasAttribute(n))return;const h=Array.from(c.dom.querySelectorAll("["+n+"]"));if(v(a)){for(let g=0;g<h.length;g++)v(h[g])||(h[g].checked=!1);a.checked=!0,c._queueRender();return}if(a.checked){for(let w=0;w<h.length;w++)v(h[w])&&(h[w].checked=!1);let g=!1;for(let w=0;w<h.length;w++)if(v(h[w])){g=!0;break}if(g){let w=!0;for(let p=0;p<h.length;p++)if(!v(h[p])&&!h[p].checked){w=!1;break}if(w)for(let p=0;p<h.length;p++)v(h[p])?h[p].checked=!0:h[p].checked=!1}}else{let g=!1;for(let w=0;w<h.length;w++)if(!v(h[w])&&h[w].checked){g=!0;break}if(!g)for(let w=0;w<h.length;w++)v(h[w])&&(h[w].checked=!0)}c._queueRender()},this.dom.addEventListener("change",this._onDomChange)},E.prototype._render=function(){const c=this,f=q(this),a=this._lastSnapshot;if(!(!a||a.key!==f.key||lt(a.values,f.values)))return;f.key===null||f.values.length;const g=document.getElementById(c.targetId),w={key:f.key,values:f.values.slice(),targetId:c.targetId};R(c.dom,"ln-filter:change",w);let p=!1;g&&g!==c.dom&&Te(g,"ln-filter:change",w).defaultPrevented&&(p=!0);const b=a&&a.values.length>0,C=f.values.length===0;if(b&&C){const A={targetId:c.targetId};R(c.dom,"ln-filter:reset",A),g&&g!==c.dom&&R(g,"ln-filter:reset",A)}this._lastSnapshot={key:f.key,values:f.values.slice()};const _=ct(f.values);if(_?this.dom.setAttribute(d,_):this.dom.removeAttribute(d),this.hashEnabled){const A=_e(f.key,f.values);Ae(this.nsKey,A)}else if(this.queryEnabled){const A=Se(f.values),T=this.queryParam||f.key;T&&ve(T,A)}p||c._applyDomFilter(g)},E.prototype._applyDomFilter=function(c){const f=c||document.getElementById(this.targetId);if(!f)return;const a=q(this),h=a.key===null||a.values.length===0,g=f.tagName==="TABLE"?f:f.querySelector?f.querySelector("table"):null;if(g)this._filterTableRows(a,g);else{const w=f.children;for(let p=0;p<w.length;p++){const b=w[p],C=h?null:b.getAttribute("data-"+a.key),_=!h&&C!==null&&!Ee(C,a.values),A=b.hasAttribute(i);_&&!A?b.setAttribute(i,"true"):!_&&A&&b.removeAttribute(i)}}};function B(c){if(!c)return"";const f=c.querySelector?c.querySelector("[data-ln-value]"):null;return X(f||c)}function M(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]"))}E.prototype._filterTableRows=function(c,f){if(!f){const b=document.getElementById(this.targetId);if(!b||(f=b.tagName==="TABLE"?b:b.querySelector?b.querySelector("table"):null,!f))return}const a=xe(f,this.dom,c.key,this.colIndex),h=c.key||this.dom.getAttribute("data-ln-filter-key")||(a!==null?"col"+a:"attr-filter"),g=c.values;y.has(f)||y.set(f,{});const w=y.get(f);h&&g.length>0?w[h]={col:a,values:g.slice(),attr:"data-"+h}:h&&delete w[h];const p=f.tBodies;for(let b=0;b<p.length;b++){const C=p[b].rows;for(let _=0;_<C.length;_++){const A=C[_];if(M(A))continue;const T={};for(let $=0;$<A.cells.length;$++)T[$]=B(A.cells[$]);const Ie=!st(T,w,A),Le=A.hasAttribute(i);Ie&&!Le?A.setAttribute(i,"true"):!Ie&&Le&&A.removeAttribute(i)}}},E.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&&y.has(f)){const a=y.get(f),h=xe(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),g=this.dom.getAttribute("data-ln-filter-key")||(h!==null?"col"+h:this.colIndex!==null?"col"+this.colIndex:null);g&&a[g]&&(delete a[g],this._filterTableRows({key:null,values:[]},f)),Object.keys(a).length===0&&y.delete(f)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&c.removeAttribute(m)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),this.queryEnabled&&this._onPopState&&window.removeEventListener("popstate",this._onPopState),delete this.dom[t]};function x(c,f){const a=c[t];if(!(!a||a._destroyed))if(f===u)a.hashEnabled&&a._onHashChange&&window.removeEventListener("hashchange",a._onHashChange),a.nsKey=N(c,"filter"),a.hashEnabled=!!a.nsKey,a.hashEnabled&&window.addEventListener("hashchange",a._onHashChange);else if(f===r)a.queryEnabled&&a._onPopState&&window.removeEventListener("popstate",a._onPopState),a.queryParam=L(c),a.queryEnabled=!!a.queryParam,a.queryEnabled&&window.addEventListener("popstate",a._onPopState);else if(f===d){const h=qe(c.getAttribute(d)),g=c.querySelector("["+n+"]"),w=g?g.getAttribute(n):null;w&&(S(c,w,h),a._render())}else f===e&&(a.targetId=c.getAttribute(e)||null,a._ensureTargetMarked(),a._render())}be(e,t,E,"ln-filter",{attributes:k,subtreeQuery:"["+e+"], ["+m+"]",onSubtreeChange:function(c,f){if(f.addedNodes.length===0&&f.removedNodes.length===0)return;let a=null,h=null;if(c.hasAttribute(m)?(h=c,a=c.getAttribute(m)||c.id):c.hasAttribute(e)&&(a=c.getAttribute(e),h=a?document.getElementById(a):null),!a||!h)return;const g=document.querySelectorAll("["+e+'="'+a+'"]');for(let w=0;w<g.length;w++){const p=g[w][t];p&&!p._destroyed&&q(p).values.length>0&&p._queueDomFilter()}},persist:{attr:d,hashActive:function(c){return!!N(c,"filter")||!!L(c)}}})})()})();