@livenetworks/ashlar 2.1.0 → 2.1.2

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 (72) hide show
  1. package/components/ln-accordion/ln-accordion.js +1 -1
  2. package/components/ln-ajax/ln-ajax.js +1 -1
  3. package/components/ln-api-connector/ln-api-connector.js +1 -1
  4. package/components/ln-api-queue/ln-api-queue.js +1 -1
  5. package/components/ln-autoresize/ln-autoresize.js +1 -1
  6. package/components/ln-autoresize/src/ln-autoresize.js +3 -1
  7. package/components/ln-autosave/ln-autosave.js +1 -1
  8. package/components/ln-chart/ln-chart.js +1 -1
  9. package/components/ln-circular-progress/ln-circular-progress.js +1 -1
  10. package/components/ln-confirm/ln-confirm.js +1 -1
  11. package/components/ln-core/lifecycle.js +33 -12
  12. package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
  13. package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
  14. package/components/ln-data-store/ln-data-store.js +1 -1
  15. package/components/ln-date/ln-date.js +1 -1
  16. package/components/ln-date/src/ln-date.js +22 -13
  17. package/components/ln-debug/ln-debug.js +1 -1
  18. package/components/ln-dropdown/ln-dropdown.js +1 -1
  19. package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
  20. package/components/ln-dropdown/src/ln-dropdown.js +18 -5
  21. package/components/ln-editor/ln-editor.js +1 -1
  22. package/components/ln-editor/src/ln-editor.js +45 -12
  23. package/components/ln-external-links/ln-external-links.js +1 -1
  24. package/components/ln-filter/ln-filter.js +1 -1
  25. package/components/ln-filter/ln-filter.schema.json +1 -1
  26. package/components/ln-filter/src/ln-filter.js +11 -10
  27. package/components/ln-form/ln-form.js +1 -1
  28. package/components/ln-form/src/ln-form.js +11 -0
  29. package/components/ln-icon/ln-icon.js +1 -1
  30. package/components/ln-include/ln-include.js +1 -1
  31. package/components/ln-key/ln-key.js +1 -1
  32. package/components/ln-link/ln-link.js +1 -1
  33. package/components/ln-list/ln-list.js +1 -1
  34. package/components/ln-list/src/ln-list.js +14 -5
  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-number/src/ln-number.js +22 -12
  39. package/components/ln-obfuscator/ln-obfuscator.js +1 -1
  40. package/components/ln-options/ln-options.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-popover/ln-popover.schema.json +82 -82
  44. package/components/ln-popover/src/ln-popover.js +22 -5
  45. package/components/ln-progress/ln-progress.js +1 -1
  46. package/components/ln-router/ln-router.js +1 -1
  47. package/components/ln-scroll/ln-scroll.js +1 -1
  48. package/components/ln-search/ln-search.js +1 -1
  49. package/components/ln-search/ln-search.schema.json +103 -103
  50. package/components/ln-search/src/ln-search.js +9 -5
  51. package/components/ln-slug/ln-slug.js +1 -1
  52. package/components/ln-sort/ln-sort.js +1 -1
  53. package/components/ln-sortable/ln-sortable.js +1 -1
  54. package/components/ln-sortable/src/ln-sortable.js +52 -7
  55. package/components/ln-stat/ln-stat.js +1 -1
  56. package/components/ln-table/ln-table.js +1 -1
  57. package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
  58. package/components/ln-tabs/ln-tabs.js +1 -1
  59. package/components/ln-tabs/src/ln-tabs.js +12 -8
  60. package/components/ln-time/ln-time.js +1 -1
  61. package/components/ln-time/src/ln-time.js +17 -7
  62. package/components/ln-toast/ln-toast.js +1 -1
  63. package/components/ln-toggle/ln-toggle.js +1 -1
  64. package/components/ln-tooltip/ln-tooltip.js +1 -1
  65. package/components/ln-translations/ln-translations.js +1 -1
  66. package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
  67. package/components/ln-upload/ln-upload.js +1 -1
  68. package/components/ln-validate/ln-validate.js +1 -1
  69. package/components/ln-validate/src/ln-validate.js +21 -7
  70. package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
  71. package/package.json +1 -1
  72. package/web-types.json +1 -1
@@ -1 +1 @@
1
- (function(){"use strict";function M(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function v(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!v(n))return}e.apply(console,t)}}function q(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function Y(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ee(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const o=s[c];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let c=0;c<s.length;c++){const o=s[c];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(n&&o.matches&&o.matches(n)))if(o.type==="checkbox")r&&i[o.name]===1?l[o.name]=o.checked:(l[o.name]||(l[o.name]=[]),o.checked&&l[o.name].push(o.value));else if(o.type==="radio")o.checked&&(l[o.name]=o.value);else if(o.type==="select-multiple"){l[o.name]=[];for(let a=0;a<o.options.length;a++)o.options[a].selected&&l[o.name].push(o.options[a].value)}else if(r&&o.type==="hidden")l[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const a=Number(o.value);l[o.name]=o.value===""||isNaN(a)?null:a}else l[o.name]=o.value}return l}function te(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ne(e,t){const r=e.elements,n=[],l={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const o=t[c];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const a=String(o).split(",").map(function(d){return d.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=te(o);n.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),n.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let a=0;a<i.options.length;a++)i.options[a].selected=o.indexOf(i.options[a].value)!==-1;n.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),n.push(i)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ne,window.lnCore.serializeForm=ee,window.lnCore.resolveFormMethod=Y);const T={};function re(e,t){T[e]=t}function oe(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=oe);function ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function le(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];$[r]=t}function se(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=le,window.lnCore.getLocaleFallback=se,window.lnCore.ensureLocaleObserver=ie);const x={};function ce(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=x[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],o=c.getAttribute("data-ln-field");t[o]!=null&&(c.textContent=t[o])}const n=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<n.length;i++){const c=n[i],o=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<o.length;a++){const d=o[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(u,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],o=c.getAttribute("data-ln-show");o in t&&c.classList.toggle("hidden",!t[o])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],o=c.getAttribute("data-ln-class").split(",");for(let a=0;a<o.length;a++){const d=o[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(u,!!t[f])}}return e}function ae(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<r.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[n],t??null),r[n].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(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 R(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const n=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let o=0;o<c.length;o++){const a=c[o];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ue(e,t,r,n,l,s){const i={};for(let o=0;o<e.children.length;o++){const a=e.children[o],d=a.getAttribute("data-ln-render-key");d&&(i[d]=a)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const a=t[o],d=String(n(a));let u=i[d];if(u)l(u,a,o);else{const f=ce(r,s);if(!f||(R(f,a),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),l(u,a,o)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=N,window.lnCore.lnFill=ae,window.lnCore.renderList=ue);function k(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function B(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function j(e,t,r=!1){const n=e.getAttribute(t);if(n===null)return!!r;const l=n.trim().toLowerCase();return!(l==="false"||l==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const _=new Map;function W(e,t){const r=(e?e.join("|"):"")+"::"+t;if(_.has(r))return _.get(r);const n=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&n.has(c)?c:t};return _.set(r,l),l}function U(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function H(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function Q(e,t,r,n,l){if(!e||t===null)return!0;const s=n||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=o=>{l?console.warn(o,l):console.warn(o)};if(i==="boolean"){const o=t.trim().toLowerCase();return o!==""&&o!=="true"&&o!=="false"&&o!=="1"&&o!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(c(`[${s}] Value ${o} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(c(`[${s}] Value ${o} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return c(`[${s}] Invalid JSON for attribute "${r}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function de(e,t,r){for(const n in r){const[l,s,i]=r[n];Object.defineProperty(e,n,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function fe(e){const t={};for(const r in e){const n=e[r];if(!n||!n.prop)continue;let l=n.read;if(!l&&n.type)switch(n.type){case"enum":l=W(n.values,n.fallback);break;case"integer":l=B;break;case"float":l=U;break;case"boolean":l=j;break;case"list":l=V;break;case"json":l=H;break;case"string":default:l=k;break}l||(l=k),t[n.prop]=[l,r,n.fallback]}return t}function we(e){const t={};for(const r in e){const n=e[r];n&&n.effect&&(t[r]=n.effect)}return Object.keys(t).length?t:null}function he(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=de,window.lnCore.attrSpec=fe,window.lnCore.attrStr=k,window.lnCore.attrInt=B,window.lnCore.attrBool=j,window.lnCore.attrList=V,window.lnCore.attrEnum=W,window.lnCore.attrFloat=U,window.lnCore.attrJson=H);function m(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(s)&&m(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)m(c[o],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function pe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function be(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 K(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ge(e){const t=K(),r=e.observed||[];for(let n=0;n<r.length;n++){const l=r[n];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const l=t.byDeclaredAttr.get(n);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=he(e);if(n===null)t.reactiveWildcard.push(e);else for(const l of n)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function P(e,t,r,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,n):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,n)}}function me(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=K(),l=n.byAttr.get(t),s=M()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&v(i)){const c=n.byDeclaredAttr.get(t),o=i.getAttribute(t);for(let a=0;a<c.length;a++)Q(c[a].spec,o,t,c[a].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=n.byReactive.get(t);c&&P(c,i,t,e.oldValue),n.reactiveWildcard.length&&P(n.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const o=l[c];if(o.handler){o.handler(i,t,e.oldValue);continue}o.onAttributeChange&&i[o.attribute]?o.onAttributeChange(i,t):(J(i,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(i))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{me(t[r])}catch(n){console.error("[ln-core] mutation handler failed",t[r].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function S(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=S();if(t.length){if(e.target)for(let r=0;r<t.length;r++){const n=t[r];if(n.onSubtreeChange&&n.query){const l=n.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;s&&n.onSubtreeChange(s,e)}}for(let r=0;r<e.addedNodes.length;r++){const n=e.addedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)n.matches&&n.matches(i.query)&&m(n,i);else if(n.matches&&n.matches(i.query)&&m(n,i),n.querySelectorAll){const c=n.querySelectorAll(i.query);for(let o=0;o<c.length;o++)m(c[o],i)}}i.onInit&&i.onInit(n)}}}for(let r=0;r<e.removedNodes.length;r++){const n=e.removedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const i=t[s],c=i.query;if(c){if(!l)n.matches&&n.matches(c)&&E(n,i);else if(n.matches&&n.matches(c)&&E(n,i),n.querySelectorAll){const o=n.querySelectorAll(c);for(let a=0;a<o.length;a++)E(o[a],i)}}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{ye(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){S().push(e),G()}function z(e,t,r,n,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,o=l.onInit||null,a=l.onAttrChange||null,d=l.effects||null,u=l.attributes||null,f=u?we(u):d,p=u?new Set(Object.keys(u)):null,w=l.persist||null;function b(L){const h=L||document.body;if(J(h,e,t,r),u&&M())for(const C in u){const Me=u[C],D=Array.from(h.querySelectorAll("["+C+"]"));h.matches&&h.matches("["+C+"]")&&D.push(h);for(let I=0;I<D.length;I++){const F=D[I];v(F)&&Q(Me,F.getAttribute(C),C,n,F)}}o&&o(h)}const g=[];if(e.indexOf("[")!==-1){const L=/\[([\w-]+)/g;let h;for(;(h=L.exec(e))!==null;)g.push(h[1])}else g.push(e);ge({selector:e,attribute:t,componentTag:n,attributes:u,ComponentFn:r,onInit:o,observed:g.concat(s),onAttributeChange:i,onAttrChange:a,effects:f,declared:p,persist:w}),Ce();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Fe=l.subtreeQuery||(A?e:"["+e+"]");S().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:c,query:Fe}),G(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=z,window.lnCore.observeLifecycle=Ae);function Z(){pe()>0?be(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z):Z(),b}function X(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,r={},n=X(t);if(!n)return r;const l=n.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),o=c>-1?i.slice(0,c):i,a=c>-1?i.slice(c+1):"";if(o)try{r[o]=decodeURIComponent(a)}catch{r[o]=a}}return r}function ve(e){if(!e)return null;const t=O();return e in t?t[e]:null}function xe(e,t){if(!e)return;const r=O();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");X(location.hash)!==l&&(location.hash=l)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function _e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ee(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Le(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),n=e.slice(t+1),l=n?n.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=ve,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Ee,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=Le);function De(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=De);function Ie(e,t=100,r=0){const n=parseFloat(String(e))||0,l=parseFloat(String(t))||100,s=parseFloat(String(r))||0,i=Math.max(s,Math.min(n,l)),c=l-s;let o=0;return c>0&&(o=(i-s)/c*100),o=Math.max(0,Math.min(100,o)),{value:n,min:s,max:l,clampedValue:i,percentage:o}}(function(){const e="data-ln-circular-progress",t="lnCircularProgress";if(window[t]!==void 0)return;function r(f){const p=f[t];p&&u.call(p)}const n={"data-ln-circular-progress":{type:"float",fallback:0,min:0,effect:r,description:"Current circular progress value"},"data-ln-circular-progress-max":{type:"float",fallback:100,min:0,effect:r,description:"Maximum circular progress scale value"},"data-ln-circular-progress-label":{type:"string",effect:r,description:"Text label format or template inside circular progress"}},l="http://www.w3.org/2000/svg",s=36,i=16,c=2*Math.PI*i;function o(f){return this.dom=f,this.svg=null,this.trackCircle=null,this.progressCircle=null,this.labelEl=null,d.call(this),u.call(this),this}o.prototype.destroy=function(){this.dom[t]&&(this.svg&&this.svg.remove(),this.labelEl&&this.labelEl.remove(),delete this.dom[t])};function a(f,p){const w=document.createElementNS(l,f);for(const[b,g]of Object.entries(p))w.setAttribute(b,g);return w}function d(){this.svg=a("svg",{viewBox:"0 0 "+s+" "+s,width:s,height:s}),this.svg.classList.add("ln-circular-progress__svg"),this.trackCircle=a("circle",{cx:s/2,cy:s/2,r:i,fill:"none","stroke-width":"3"}),this.trackCircle.classList.add("ln-circular-progress__track"),this.progressCircle=a("circle",{cx:s/2,cy:s/2,r:i,fill:"none","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":c,"stroke-dashoffset":c,transform:"rotate(-90 "+s/2+" "+s/2+")"}),this.progressCircle.classList.add("ln-circular-progress__fill"),this.svg.appendChild(this.trackCircle),this.svg.appendChild(this.progressCircle),this.labelEl=document.createElement("strong"),this.labelEl.classList.add("ln-circular-progress__label"),this.dom.appendChild(this.svg),this.dom.appendChild(this.labelEl)}function u(){const f=this.dom.getAttribute("data-ln-circular-progress"),p=this.dom.getAttribute("data-ln-circular-progress-max"),w=Ie(f,p||100),b=c-w.percentage/100*c;this.progressCircle.setAttribute("stroke-dashoffset",b);const g=this.dom.getAttribute("data-ln-circular-progress-label"),A=g!==null?g:Math.round(w.percentage)+"%";this.labelEl.textContent=A,this.dom.setAttribute("role","progressbar"),this.dom.setAttribute("aria-valuemin",String(w.min)),this.dom.setAttribute("aria-valuemax",String(w.max)),this.dom.setAttribute("aria-valuenow",String(w.clampedValue)),this.dom.setAttribute("aria-valuetext",A),q(this.dom,"ln-circular-progress:change",{target:this.dom,value:w.value,max:w.max,percentage:w.percentage})}z(e,t,o,"ln-circular-progress",{attributes:n})})()})();
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 v(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){l=t[i];break}if(!v(l))return}e.apply(console,t)}}function q(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ne(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const r=!!(t&&t.typed),l=t&&t.exclude,i={},s=e.elements,o={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")r&&o[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&i[n.name].push(n.options[a].value)}else if(r&&n.type==="hidden")i[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const a=Number(n.value);i[n.name]=n.value===""||isNaN(a)?null:a}else i[n.name]=n.value}return i}function oe(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const r=e.elements,l=[],i={};for(let s=0;s<r.length;s++){const o=r[s];o.name&&o.type==="checkbox"&&(i[o.name]=(i[o.name]||0)+1)}for(let s=0;s<r.length;s++){const o=r[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const n=t[c];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(i[o.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});o.checked=a.indexOf(o.value)!==-1}else o.checked=oe(n);l.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),l.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<o.options.length;a++)o.options[a].selected=n.indexOf(o.options[a].value)!==-1;l.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),l.push(o)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=ne);const $={};function le(e,t){$[e]=t}function se(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=le,window.lnCore.getDataMapper=se);function ce(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function ae(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];N[r]=t}function ue(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=ue,window.lnCore.ensureLocaleObserver=ce);const x={};function de(e,t){x[e]||(x[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=x[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const c=r[o],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<l.length;o++){const c=l[o],n=c.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&&c.setAttribute(d,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let o=0;o<i.length;o++){const c=i[o],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const c=s[o],n=c.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&&c.classList.toggle(d,!!t[f])}}return e}function fe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<r.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[l],t??null),r[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)R(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function B(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,c){return t[c]!==void 0?t[c]:""}))}const l=function(s,o){return t[o]!==void 0?t[o]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const o=i[s],c=o.attributes;for(let n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function we(e,t,r,l,i,s){const o={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(o[u]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(l(a));let d=o[u];if(d)i(d,a,n);else{const f=de(r,s);if(!f||(B(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,a,n)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=R,window.lnCore.lnFill=fe,window.lnCore.renderList=we);function _(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function j(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function V(e,t,r=!1){const l=e.getAttribute(t);if(l===null)return!!r;const i=l.trim().toLowerCase();return!(i==="false"||i==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const k=new Map;function U(e,t){const r=(e?e.join("|"):"")+"::"+t;if(k.has(r))return k.get(r);const l=new Set(e||[]),i=function(s,o){const c=s.getAttribute(o);return c!==null&&l.has(c)?c:t};return k.set(r,i),i}function H(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function Q(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function J(e,t,r,l,i){if(!e||t===null)return!0;const s=l||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=n=>{i?console.warn(n,i):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function he(e,t,r){for(const l in r){const[i,s,o]=r[l];Object.defineProperty(e,l,{get:function(){return i(t,s,o)},enumerable:!0,configurable:!0})}return e}function be(e){const t={};for(const r in e){const l=e[r];if(!l||!l.prop)continue;let i=l.read;if(!i&&l.type)switch(l.type){case"enum":i=U(l.values,l.fallback);break;case"integer":i=j;break;case"float":i=H;break;case"boolean":i=V;break;case"list":i=W;break;case"json":i=Q;break;case"string":default:i=_;break}i||(i=_),t[l.prop]=[i,r,l.fallback]}return t}function pe(e){const t={};for(const r in e){const l=e[r];l&&l.effect&&(t[r]=l.effect)}return Object.keys(t).length?t:null}function ge(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=he,window.lnCore.attrSpec=be,window.lnCore.attrStr=_,window.lnCore.attrInt=j,window.lnCore.attrBool=V,window.lnCore.attrList=W,window.lnCore.attrEnum=U,window.lnCore.attrFloat=H,window.lnCore.attrJson=Q);function m(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 K(e,t,r,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:l};if(e.matches&&e.matches(s)&&m(e,o),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)m(c[n],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function me(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ce(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){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 ye(e){const t=P(),r=e.observed||[];for(let l=0;l<r.length;l++){const i=r[l];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 l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const i=t.byDeclaredAttr.get(l);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=ge(e);if(l===null)t.reactiveWildcard.push(e);else for(const i of l)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function G(e,t,r,l){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const o=s.effects&&s.effects[r];o?o(t,r,l):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,l)}}function Ae(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=P(),i=l.byAttr.get(t),s=T()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!i&&!s)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(s&&v(o)){const c=l.byDeclaredAttr.get(t),n=o.getAttribute(t);for(let a=0;a<c.length;a++)J(c[a].spec,n,t,c[a].componentTag,o)}if(window.lnCore._debugSink&&(r||i)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const c=l.byReactive.get(t);c&&G(c,o,t,e.oldValue),l.reactiveWildcard.length&&G(l.reactiveWildcard,o,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const n=i[c];if(n.handler){n.handler(o,t,e.oldValue);continue}n.onAttributeChange&&o[n.attribute]?n.onAttributeChange(o,t):(K(o,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(o))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ae(t[r])}catch(l){console.error("[ln-core] mutation handler failed",t[r].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function S(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function O(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function xe(e){const t=S();if(!t.length)return;const r=e.target;if(r){const i=r.nodeType===1?r:r.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=E();if(e.target&&l.length)for(let i=0;i<l.length;i++){const s=l[i],o=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!o)s.matches&&s.matches(n.query)&&m(s,n);else if(s.matches&&s.matches(n.query)&&m(s,n),s.querySelectorAll){const a=s.querySelectorAll(n.query);for(let u=0;u<a.length;u++)m(a[u],n)}}n.onInit&&n.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],a=n.query;if(a){if(!o)s.matches&&s.matches(a)&&O(s,n);else if(s.matches&&s.matches(a)&&O(s,n),s.querySelectorAll){const u=s.querySelectorAll(a);for(let d=0;d<u.length;d++)O(u[d],n)}}}}}}function z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{xe(l)}catch(i){console.error("[ln-core] lifecycle handler failed",l.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){S().push(e),e.onSubtreeChange&&e.query&&E().push(e),z()}function X(e,t,r,l,i={}){const s=i.extraAttributes||[],o=i.onAttributeChange||null,c=i.onSubtreeChange||null,n=i.onInit||null,a=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?pe(d):u,b=d?new Set(Object.keys(d)):null,w=i.persist||null;function p(D){const h=D||document.body;if(K(h,e,t,r),d&&T())for(const C in d){const qe=d[C],I=Array.from(h.querySelectorAll("["+C+"]"));h.matches&&h.matches("["+C+"]")&&I.push(h);for(let F=0;F<I.length;F++){const M=I[F];v(M)&&J(qe,M.getAttribute(C),C,l,M)}}n&&n(h)}const g=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let h;for(;(h=D.exec(e))!==null;)g.push(h[1])}else g.push(e);ye({selector:e,attribute:t,componentTag:l,attributes:d,ComponentFn:r,onInit:n,observed:g.concat(s),onAttributeChange:o,onAttrChange:a,effects:f,declared:b,persist:w}),ve();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Y=i.subtreeQuery||(A?e:"["+e+"]"),ee={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:Y};S().push(ee),c&&Y&&E().push(ee),z(),window[t]=p,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=_e);function te(){me()>0?Ce(function(){p(document.body)}):p(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",te):te(),p}function Z(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,r={},l=Z(t);if(!l)return r;const i=l.split("&");for(let s=0;s<i.length;s++){const o=i[s];if(!o)continue;const c=o.indexOf(":"),n=c>-1?o.slice(0,c):o,a=c>-1?o.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function ke(e){if(!e)return null;const t=L();return e in t?t[e]:null}function Se(e,t){if(!e)return;const r=L();t==null?delete r[e]:r[e]=String(t);const i=Object.keys(r).map(function(s){const o=r[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");Z(location.hash)!==i&&(location.hash=i)}function Ee(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Oe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Fe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),l=e.slice(t+1),i=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=ke,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=Ee,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=Fe);function Me(){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=Me);function Te(e,t=100,r=0){const l=parseFloat(String(e))||0,i=parseFloat(String(t))||100,s=parseFloat(String(r))||0,o=Math.max(s,Math.min(l,i)),c=i-s;let n=0;return c>0&&(n=(o-s)/c*100),n=Math.max(0,Math.min(100,n)),{value:l,min:s,max:i,clampedValue:o,percentage:n}}(function(){const e="data-ln-circular-progress",t="lnCircularProgress";if(window[t]!==void 0)return;function r(f){const b=f[t];b&&d.call(b)}const l={"data-ln-circular-progress":{type:"float",fallback:0,min:0,effect:r,description:"Current circular progress value"},"data-ln-circular-progress-max":{type:"float",fallback:100,min:0,effect:r,description:"Maximum circular progress scale value"},"data-ln-circular-progress-label":{type:"string",effect:r,description:"Text label format or template inside circular progress"}},i="http://www.w3.org/2000/svg",s=36,o=16,c=2*Math.PI*o;function n(f){return this.dom=f,this.svg=null,this.trackCircle=null,this.progressCircle=null,this.labelEl=null,u.call(this),d.call(this),this}n.prototype.destroy=function(){this.dom[t]&&(this.svg&&this.svg.remove(),this.labelEl&&this.labelEl.remove(),delete this.dom[t])};function a(f,b){const w=document.createElementNS(i,f);for(const[p,g]of Object.entries(b))w.setAttribute(p,g);return w}function u(){this.svg=a("svg",{viewBox:"0 0 "+s+" "+s,width:s,height:s}),this.svg.classList.add("ln-circular-progress__svg"),this.trackCircle=a("circle",{cx:s/2,cy:s/2,r:o,fill:"none","stroke-width":"3"}),this.trackCircle.classList.add("ln-circular-progress__track"),this.progressCircle=a("circle",{cx:s/2,cy:s/2,r:o,fill:"none","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":c,"stroke-dashoffset":c,transform:"rotate(-90 "+s/2+" "+s/2+")"}),this.progressCircle.classList.add("ln-circular-progress__fill"),this.svg.appendChild(this.trackCircle),this.svg.appendChild(this.progressCircle),this.labelEl=document.createElement("strong"),this.labelEl.classList.add("ln-circular-progress__label"),this.dom.appendChild(this.svg),this.dom.appendChild(this.labelEl)}function d(){const f=this.dom.getAttribute("data-ln-circular-progress"),b=this.dom.getAttribute("data-ln-circular-progress-max"),w=Te(f,b||100),p=c-w.percentage/100*c;this.progressCircle.setAttribute("stroke-dashoffset",p);const g=this.dom.getAttribute("data-ln-circular-progress-label"),A=g!==null?g:Math.round(w.percentage)+"%";this.labelEl.textContent=A,this.dom.setAttribute("role","progressbar"),this.dom.setAttribute("aria-valuemin",String(w.min)),this.dom.setAttribute("aria-valuemax",String(w.max)),this.dom.setAttribute("aria-valuenow",String(w.clampedValue)),this.dom.setAttribute("aria-valuetext",A),q(this.dom,"ln-circular-progress:change",{target:this.dom,value:w.value,max:w.max,percentage:w.percentage})}X(e,t,n,"ln-circular-progress",{attributes:l})})()})();
@@ -1 +1 @@
1
- (function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!y(n))return}e.apply(console,t)}}function q(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ee(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function te(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ne(e,t){const r=!!(t&&t.typed),n=t&&t.exclude,l={},s=e.elements,o={};if(r)for(let c=0;c<s.length;c++){const i=s[c];i.name&&i.type==="checkbox"&&!i.disabled&&(o[i.name]=(o[i.name]||0)+1)}for(let c=0;c<s.length;c++){const i=s[c];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(n&&i.matches&&i.matches(n)))if(i.type==="checkbox")r&&o[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let a=0;a<i.options.length;a++)i.options[a].selected&&l[i.name].push(i.options[a].value)}else if(r&&i.type==="hidden")l[i.name]=i.value;else if(r&&(i.type==="number"||i.type==="range")){const a=Number(i.value);l[i.name]=i.value===""||isNaN(a)?null:a}else l[i.name]=i.value}return l}function re(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ie(e,t){const r=e.elements,n=[],l={};for(let s=0;s<r.length;s++){const o=r[s];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<r.length;s++){const o=r[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const i=t[c];if(o.type==="checkbox"){if(Array.isArray(i))o.checked=i.indexOf(o.value)!==-1;else if(l[o.name]>1){const a=String(i).split(",").map(function(f){return f.trim()});o.checked=a.indexOf(o.value)!==-1}else o.checked=re(i);n.push(o)}else if(o.type==="radio")o.checked=o.value===String(i),n.push(o);else if(o.type==="select-multiple"){if(Array.isArray(i))for(let a=0;a<o.options.length;a++)o.options[a].selected=i.indexOf(o.options[a].value)!==-1;n.push(o)}else o.value=i,o.tagName==="SELECT"&&i!=null&&o.setAttribute("data-ln-value",i),n.push(o)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ie,window.lnCore.serializeForm=ne,window.lnCore.resolveFormMethod=te);const F={};function oe(e,t){F[e]=t}function le(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=oe,window.lnCore.getDataMapper=le);function se(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function ce(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];N[r]=t}function ae(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ce,window.lnCore.getLocaleFallback=ae,window.lnCore.ensureLocaleObserver=se);const A={};function ue(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=A[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 o=0;o<r.length;o++){const c=r[o],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const n=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<n.length;o++){const c=n[o],i=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<i.length;a++){const f=i[a].trim().split(":");if(f.length!==2)continue;const u=f[0].trim(),d=f[1].trim();t[d]!=null&&c.setAttribute(u,t[d])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const c=l[o],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const c=s[o],i=c.getAttribute("data-ln-class").split(",");for(let a=0;a<i.length;a++){const f=i[a].trim().split(":");if(f.length!==2)continue;const u=f[0].trim(),d=f[1].trim();d in t&&c.classList.toggle(u,!!t[d])}}return e}function de(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<r.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[n],t??null),r[n].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(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 M(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,c){return t[c]!==void 0?t[c]:""}))}const n=function(s,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const o=l[s],c=o.attributes;for(let i=0;i<c.length;i++){const a=c[i];a.value.indexOf("{{")!==-1&&o.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function fe(e,t,r,n,l,s){const o={};for(let i=0;i<e.children.length;i++){const a=e.children[i],f=a.getAttribute("data-ln-render-key");f&&(o[f]=a)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const a=t[i],f=String(n(a));let u=o[f];if(u)l(u,a,i);else{const d=ue(r,s);if(!d||(M(d,a),u=d.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",f),l(u,a,i)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=$,window.lnCore.lnFill=de,window.lnCore.renderList=fe);function v(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function R(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function B(e,t,r=!1){const n=e.getAttribute(t);if(n===null)return!!r;const l=n.trim().toLowerCase();return!(l==="false"||l==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const x=new Map;function U(e,t){const r=(e?e.join("|"):"")+"::"+t;if(x.has(r))return x.get(r);const n=new Set(e||[]),l=function(s,o){const c=s.getAttribute(o);return c!==null&&n.has(c)?c:t};return x.set(r,l),l}function W(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function H(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function V(e,t,r,n,l){if(!e||t===null)return!0;const s=n||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=i=>{l?console.warn(i,l):console.warn(i)};if(o==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${r}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function K(e,t,r){for(const n in r){const[l,s,o]=r[n];Object.defineProperty(e,n,{get:function(){return l(t,s,o)},enumerable:!0,configurable:!0})}return e}function P(e){const t={};for(const r in e){const n=e[r];if(!n||!n.prop)continue;let l=n.read;if(!l&&n.type)switch(n.type){case"enum":l=U(n.values,n.fallback);break;case"integer":l=R;break;case"float":l=W;break;case"boolean":l=B;break;case"list":l=j;break;case"json":l=H;break;case"string":default:l=v;break}l||(l=v),t[n.prop]=[l,r,n.fallback]}return t}function he(e){const t={};for(const r in e){const n=e[r];n&&n.effect&&(t[r]=n.effect)}return Object.keys(t).length?t:null}function we(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=K,window.lnCore.attrSpec=P,window.lnCore.attrStr=v,window.lnCore.attrInt=R,window.lnCore.attrBool=B,window.lnCore.attrList=j,window.lnCore.attrEnum=U,window.lnCore.attrFloat=W,window.lnCore.attrJson=H);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function Q(e,t,r,n){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:r,ComponentFn:n};if(e.matches&&e.matches(s)&&b(e,o),e.querySelectorAll){const c=e.querySelectorAll(s);for(let i=0;i<c.length;i++)b(c[i],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function be(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function me(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 J(){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 pe(e){const t=J(),r=e.observed||[];for(let n=0;n<r.length;n++){const l=r[n];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const l=t.byDeclaredAttr.get(n);l.some(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=we(e);if(n===null)t.reactiveWildcard.push(e);else for(const l of n)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function z(e,t,r,n){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const o=s.effects&&s.effects[r];o?o(t,r,n):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,n)}}function ge(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=J(),l=n.byAttr.get(t),s=D()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(s&&y(o)){const c=n.byDeclaredAttr.get(t),i=o.getAttribute(t);for(let a=0;a<c.length;a++)V(c[a].spec,i,t,c[a].componentTag,o)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),r){const c=n.byReactive.get(t);c&&z(c,o,t,e.oldValue),n.reactiveWildcard.length&&z(n.reactiveWildcard,o,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const i=l[c];if(i.handler){i.handler(o,t,e.oldValue);continue}i.onAttributeChange&&o[i.attribute]?i.onAttributeChange(o,t):(Q(o,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(o))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ge(t[r])}catch(n){console.error("[ln-core] mutation handler failed",t[r].target,n)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function k(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=_();if(t.length){if(e.target)for(let r=0;r<t.length;r++){const n=t[r];if(n.onSubtreeChange&&n.query){const l=n.query,s=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;s&&n.onSubtreeChange(s,e)}}for(let r=0;r<e.addedNodes.length;r++){const n=e.addedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const o=t[s];if(o.selector&&o.attribute&&o.ComponentFn){if(!l)n.matches&&n.matches(o.query)&&b(n,o);else if(n.matches&&n.matches(o.query)&&b(n,o),n.querySelectorAll){const c=n.querySelectorAll(o.query);for(let i=0;i<c.length;i++)b(c[i],o)}}o.onInit&&o.onInit(n)}}}for(let r=0;r<e.removedNodes.length;r++){const n=e.removedNodes[r];if(n.nodeType===1){const l=!!(n.firstElementChild||n.children&&n.children.length);for(let s=0;s<t.length;s++){const o=t[s],c=o.query;if(c){if(!l)n.matches&&n.matches(c)&&k(n,o);else if(n.matches&&n.matches(c)&&k(n,o),n.querySelectorAll){const i=n.querySelectorAll(c);for(let a=0;a<i.length;a++)k(i[a],o)}}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{ye(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ae(e){_().push(e),G()}function X(e,t,r,n,l={}){const s=l.extraAttributes||[],o=l.onAttributeChange||null,c=l.onSubtreeChange||null,i=l.onInit||null,a=l.onAttrChange||null,f=l.effects||null,u=l.attributes||null,d=u?he(u):f,h=u?new Set(Object.keys(u)):null,m=l.persist||null;function C(E){const w=E||document.body;if(Q(w,e,t,r),u&&D())for(const p in u){const qe=u[p],L=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&L.push(w);for(let O=0;O<L.length;O++){const I=L[O];y(I)&&V(qe,I.getAttribute(p),p,n,I)}}i&&i(w)}const T=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)T.push(w[1])}else T.push(e);pe({selector:e,attribute:t,componentTag:n,attributes:u,ComponentFn:r,onInit:i,observed:T.concat(s),onAttributeChange:o,onAttrChange:a,effects:d,declared:h,persist:m}),Ce();const Ie=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,De=l.subtreeQuery||(Ie?e:"["+e+"]");_().push({selector:e,attribute:t,ComponentFn:r,onInit:i,onSubtreeChange:c,query:De}),G(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=Ae);function Z(){be()>0?me(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z):Z(),C}function Y(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,r={},n=Y(t);if(!n)return r;const l=n.split("&");for(let s=0;s<l.length;s++){const o=l[s];if(!o)continue;const c=o.indexOf(":"),i=c>-1?o.slice(0,c):o,a=c>-1?o.slice(c+1):"";if(i)try{r[i]=decodeURIComponent(a)}catch{r[i]=a}}return r}function ve(e){if(!e)return null;const t=S();return e in t?t[e]:null}function xe(e,t){if(!e)return;const r=S();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const o=r[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");Y(location.hash)!==l&&(location.hash=l)}function _e(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ke(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Te(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ee(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Le(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),n=e.slice(t+1),l=n?n.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=ve,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=_e,window.lnCore.resolveHashNamespace=ke,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Te,window.lnCore.hashFilterEncode=Ee,window.lnCore.hashFilterDecode=Le);function Oe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Oe),(function(){const e="data-ln-confirm",t="lnConfirm",r="data-ln-confirm-state",n="data-ln-confirm-announcer";if(window[t]!==void 0)return;function s(u,d,h){return u.getAttribute(d)||h}function o(u,d,h){const m=parseFloat(u.getAttribute(d));return isNaN(m)||m<=0?h:m}function c(u){const d=document.createElement("span");return d.setAttribute(n,""),d.setAttribute("role","alert"),d.textContent=u,d}const i={"data-ln-confirm":{prop:"confirmText",type:"string",read:s,fallback:"Confirm?",description:"Prompt text or confirmation action trigger"},"data-ln-confirm-timeout":{prop:"timeout",type:"float",read:o,fallback:3,min:.1,description:"Confirmation timeout in seconds before reverting"},"data-ln-confirm-state":{prop:"confirming",type:"enum",values:["confirming"],read:(u,d)=>u.getAttribute(d)==="confirming",description:'Active confirmation state marker on button ("confirming")'}},a=P(i);function f(u){this.dom=u,K(this,u,a),this.revertTimer=null,this._submitted=!1,this.idleEl=u.querySelector("[data-ln-confirm-idle]"),this.activeEl=u.querySelector("[data-ln-confirm-active]"),this.isTwoElementMode=!!(this.idleEl||this.activeEl),this.originalText=this.isTwoElementMode?"":u.textContent.trim();const d=this;return this._onClick=function(h){if(!ee(h))if(!d.confirming)h.preventDefault(),h.stopImmediatePropagation(),d._enterConfirm();else{if(d._submitted)return;d._submitted=!0,d._reset()}},u.addEventListener("click",this._onClick),this}f.prototype._enterConfirm=function(){if(this.dom.setAttribute(r,"confirming"),this.originalAriaLabel=this.dom.getAttribute("aria-label"),this.originalAriaLive=this.dom.getAttribute("aria-live"),this.isTwoElementMode){this.idleEl&&this.idleEl.setAttribute("hidden","true"),this.activeEl&&this.activeEl.removeAttribute("hidden");const u=this.activeEl?this.activeEl.textContent.trim():"";u&&(this.dom.setAttribute("aria-label",u),this.dom.setAttribute("aria-live","polite"))}else{const u=this.dom.querySelector("svg.ln-icon use");u&&this.originalText===""?(this.isIconButton=!0,this.originalIconHref=u.getAttribute("href"),u.setAttribute("href","#ln-icon-check"),this.dom.setAttribute("aria-label",this.confirmText),this.dom.appendChild(c(this.confirmText))):this.dom.textContent=this.confirmText}this._startTimer(),q(this.dom,"ln-confirm:waiting",{target:this.dom})},f.prototype._startTimer=function(){this.revertTimer&&clearTimeout(this.revertTimer);const u=this,d=this.timeout*1e3;this.revertTimer=setTimeout(function(){u._reset()},d)},f.prototype._reset=function(){if(this._submitted=!1,this.dom.removeAttribute(r),this.isTwoElementMode)this.idleEl&&this.idleEl.removeAttribute("hidden"),this.activeEl&&this.activeEl.setAttribute("hidden","true");else if(this.isIconButton){const u=this.dom.querySelector("svg.ln-icon use");u&&this.originalIconHref&&u.setAttribute("href",this.originalIconHref);const d=this.dom.querySelector("["+n+"]");d&&d.remove(),this.isIconButton=!1,this.originalIconHref=null}else this.dom.textContent=this.originalText;this.originalAriaLabel!==null&&this.originalAriaLabel!==void 0?this.dom.setAttribute("aria-label",this.originalAriaLabel):this.dom.removeAttribute("aria-label"),this.originalAriaLabel=null,this.originalAriaLive!==null&&this.originalAriaLive!==void 0?this.dom.setAttribute("aria-live",this.originalAriaLive):this.dom.removeAttribute("aria-live"),this.originalAriaLive=null,this.revertTimer&&(clearTimeout(this.revertTimer),this.revertTimer=null)},f.prototype.destroy=function(){this.dom[t]&&(this.confirming&&this._reset(),this.dom.removeEventListener("click",this._onClick),delete this.dom[t])},X(e,t,f,"ln-confirm",{attributes:i})})()})();
1
+ (function(){"use strict";function q(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 F(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 g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const r=!!(t&&t.typed),o=t&&t.exclude,l={},s=e.elements,i={};if(r)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(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 le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function se(e,t){const r=e.elements,o=[],l={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const n=t[c];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(f){return f.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=le(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=se,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=ie);const N={};function ce(e,t){N[e]=t}function ae(e){return N[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ce,window.lnCore.getDataMapper=ae);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function de(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];$[r]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=de,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=ue);const A={};function he(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=A[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const c=r[i],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const o=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<o.length;i++){const c=o[i],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const f=n[a].trim().split(":");if(f.length!==2)continue;const u=f[0].trim(),d=f[1].trim();t[d]!=null&&c.setAttribute(u,t[d])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const c=l[i],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const f=n[a].trim().split(":");if(f.length!==2)continue;const u=f[0].trim(),d=f[1].trim();d in t&&c.classList.toggle(u,!!t[d])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<r.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[o],t??null),r[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function R(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const s=r.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const i=l[s],c=i.attributes;for(let n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function be(e,t,r,o,l,s){const i={};for(let n=0;n<e.children.length;n++){const a=e.children[n],f=a.getAttribute("data-ln-render-key");f&&(i[f]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],f=String(o(a));let u=i[f];if(u)l(u,a,n);else{const d=he(r,s);if(!d||(R(d,a),u=d.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",f),l(u,a,n)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=R,window.lnCore.fill=M,window.lnCore.lnFill=we,window.lnCore.renderList=be);function v(e,t,r){const o=e.getAttribute(t);return o===null?r:o}function B(e,t,r){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?r:o}function j(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 U(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const x=new Map;function W(e,t){const r=(e?e.join("|"):"")+"::"+t;if(x.has(r))return x.get(r);const o=new Set(e||[]),l=function(s,i){const c=s.getAttribute(i);return c!==null&&o.has(c)?c:t};return x.set(r,l),l}function H(e,t,r){const o=parseFloat(e.getAttribute(t));return isNaN(o)?r:o}function V(e,t,r){const o=e.getAttribute(t);if(!o)return r;try{return JSON.parse(o)}catch{return r}}function K(e,t,r,o,l){if(!e||t===null)return!0;const s=o||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=n=>{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"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function P(e,t,r){for(const o in r){const[l,s,i]=r[o];Object.defineProperty(e,o,{get:function(){return l(t,s,i)},enumerable:!0,configurable:!0})}return e}function Q(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=W(o.values,o.fallback);break;case"integer":l=B;break;case"float":l=H;break;case"boolean":l=j;break;case"list":l=U;break;case"json":l=V;break;case"string":default:l=v;break}l||(l=v),t[o.prop]=[l,r,o.fallback]}return t}function me(e){const t={};for(const r in e){const o=e[r];o&&o.effect&&(t[r]=o.effect)}return Object.keys(t).length?t:null}function pe(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=P,window.lnCore.attrSpec=Q,window.lnCore.attrStr=v,window.lnCore.attrInt=B,window.lnCore.attrBool=j,window.lnCore.attrList=U,window.lnCore.attrEnum=W,window.lnCore.attrFloat=H,window.lnCore.attrJson=V);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:o};if(e.matches&&e.matches(s)&&b(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)b(c[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ge(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ce(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function z(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ye(e){const t=z(),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(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=pe(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 G(e,t,r,o){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,o):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,o)}}function Ae(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,o=z(),l=o.byAttr.get(t),s=q()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&y(i)){const c=o.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let a=0;a<c.length;a++)K(c[a].spec,n,t,c[a].componentTag,i)}if(window.lnCore._debugSink&&(r||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const c=o.byReactive.get(t);c&&G(c,i,t,e.oldValue),o.reactiveWildcard.length&&G(o.reactiveWildcard,i,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const n=l[c];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(J(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Ae(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 k(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function E(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 xe(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=k();if(e.target&&o.length)for(let l=0;l<o.length;l++){const s=o[l],i=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;c&&s.onSubtreeChange(c,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!i)s.matches&&s.matches(n.query)&&b(s,n);else if(s.matches&&s.matches(n.query)&&b(s,n),s.querySelectorAll){const a=s.querySelectorAll(n.query);for(let f=0;f<a.length;f++)b(a[f],n)}}n.onInit&&n.onInit(s)}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],a=n.query;if(a){if(!i)s.matches&&s.matches(a)&&E(s,n);else if(s.matches&&s.matches(a)&&E(s,n),s.querySelectorAll){const f=s.querySelectorAll(a);for(let u=0;u<f.length;u++)E(f[u],n)}}}}}}function X(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const o=t[r];if(o.type==="childList")try{xe(o)}catch(l){console.error("[ln-core] lifecycle handler failed",o.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){_().push(e),e.onSubtreeChange&&e.query&&k().push(e),X()}function Y(e,t,r,o,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,n=l.onInit||null,a=l.onAttrChange||null,f=l.effects||null,u=l.attributes||null,d=u?me(u):f,h=u?new Set(Object.keys(u)):null,m=l.persist||null;function C(L){const w=L||document.body;if(J(w,e,t,r),u&&q())for(const p in u){const Ne=u[p],O=Array.from(w.querySelectorAll("["+p+"]"));w.matches&&w.matches("["+p+"]")&&O.push(w);for(let I=0;I<O.length;I++){const D=O[I];y(D)&&K(Ne,D.getAttribute(p),p,o,D)}}n&&n(w)}const T=[];if(e.indexOf("[")!==-1){const L=/\[([\w-]+)/g;let w;for(;(w=L.exec(e))!==null;)T.push(w[1])}else T.push(e);ye({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:r,onInit:n,observed:T.concat(s),onAttributeChange:i,onAttrChange:a,effects:d,declared:h,persist:m}),ve();const Fe=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ee=l.subtreeQuery||(Fe?e:"["+e+"]"),te={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:c,query:ee};_().push(te),c&&ee&&k().push(te),X(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=_e);function ne(){ge()>0?Ce(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),C}function Z(e){return(e||"").replace(/^#/,"")}function S(e){const t=e===void 0?location.hash:e,r={},o=Z(t);if(!o)return r;const l=o.split("&");for(let s=0;s<l.length;s++){const i=l[s];if(!i)continue;const c=i.indexOf(":"),n=c>-1?i.slice(0,c):i,a=c>-1?i.slice(c+1):"";if(n)try{r[n]=decodeURIComponent(a)}catch{r[n]=a}}return r}function ke(e){if(!e)return null;const t=S();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const r=S();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Z(location.hash)!==l&&(location.hash=l)}function Se(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Te(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 Le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Oe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),o=e.slice(t+1),l=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=S,window.lnCore.hashGet=ke,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=Se,window.lnCore.resolveHashNamespace=Te,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=Oe,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=De);function qe(){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=qe),(function(){const e="data-ln-confirm",t="lnConfirm",r="data-ln-confirm-state",o="data-ln-confirm-announcer";if(window[t]!==void 0)return;function s(u,d,h){return u.getAttribute(d)||h}function i(u,d,h){const m=parseFloat(u.getAttribute(d));return isNaN(m)||m<=0?h:m}function c(u){const d=document.createElement("span");return d.setAttribute(o,""),d.setAttribute("role","alert"),d.textContent=u,d}const n={"data-ln-confirm":{prop:"confirmText",type:"string",read:s,fallback:"Confirm?",description:"Prompt text or confirmation action trigger"},"data-ln-confirm-timeout":{prop:"timeout",type:"float",read:i,fallback:3,min:.1,description:"Confirmation timeout in seconds before reverting"},"data-ln-confirm-state":{prop:"confirming",type:"enum",values:["confirming"],read:(u,d)=>u.getAttribute(d)==="confirming",description:'Active confirmation state marker on button ("confirming")'}},a=Q(n);function f(u){this.dom=u,P(this,u,a),this.revertTimer=null,this._submitted=!1,this.idleEl=u.querySelector("[data-ln-confirm-idle]"),this.activeEl=u.querySelector("[data-ln-confirm-active]"),this.isTwoElementMode=!!(this.idleEl||this.activeEl),this.originalText=this.isTwoElementMode?"":u.textContent.trim();const d=this;return this._onClick=function(h){if(!re(h))if(!d.confirming)h.preventDefault(),h.stopImmediatePropagation(),d._enterConfirm();else{if(d._submitted)return;d._submitted=!0,d._reset()}},u.addEventListener("click",this._onClick),this}f.prototype._enterConfirm=function(){if(this.dom.setAttribute(r,"confirming"),this.originalAriaLabel=this.dom.getAttribute("aria-label"),this.originalAriaLive=this.dom.getAttribute("aria-live"),this.isTwoElementMode){this.idleEl&&this.idleEl.setAttribute("hidden","true"),this.activeEl&&this.activeEl.removeAttribute("hidden");const u=this.activeEl?this.activeEl.textContent.trim():"";u&&(this.dom.setAttribute("aria-label",u),this.dom.setAttribute("aria-live","polite"))}else{const u=this.dom.querySelector("svg.ln-icon use");u&&this.originalText===""?(this.isIconButton=!0,this.originalIconHref=u.getAttribute("href"),u.setAttribute("href","#ln-icon-check"),this.dom.setAttribute("aria-label",this.confirmText),this.dom.appendChild(c(this.confirmText))):this.dom.textContent=this.confirmText}this._startTimer(),F(this.dom,"ln-confirm:waiting",{target:this.dom})},f.prototype._startTimer=function(){this.revertTimer&&clearTimeout(this.revertTimer);const u=this,d=this.timeout*1e3;this.revertTimer=setTimeout(function(){u._reset()},d)},f.prototype._reset=function(){if(this._submitted=!1,this.dom.removeAttribute(r),this.isTwoElementMode)this.idleEl&&this.idleEl.removeAttribute("hidden"),this.activeEl&&this.activeEl.setAttribute("hidden","true");else if(this.isIconButton){const u=this.dom.querySelector("svg.ln-icon use");u&&this.originalIconHref&&u.setAttribute("href",this.originalIconHref);const d=this.dom.querySelector("["+o+"]");d&&d.remove(),this.isIconButton=!1,this.originalIconHref=null}else this.dom.textContent=this.originalText;this.originalAriaLabel!==null&&this.originalAriaLabel!==void 0?this.dom.setAttribute("aria-label",this.originalAriaLabel):this.dom.removeAttribute("aria-label"),this.originalAriaLabel=null,this.originalAriaLive!==null&&this.originalAriaLive!==void 0?this.dom.setAttribute("aria-live",this.originalAriaLive):this.dom.removeAttribute("aria-live"),this.originalAriaLive=null,this.revertTimer&&(clearTimeout(this.revertTimer),this.revertTimer=null)},f.prototype.destroy=function(){this.dom[t]&&(this.confirming&&this._reset(),this.dom.removeEventListener("click",this._onClick),delete this.dom[t])},Y(e,t,f,"ln-confirm",{attributes:n})})()})();
@@ -229,6 +229,12 @@ function _lifecycleRegistry() {
229
229
  return registry;
230
230
  }
231
231
 
232
+ function _subtreeRegistry() {
233
+ window.lnCore = window.lnCore || {};
234
+ const registry = window.lnCore._subtreeRegistry = window.lnCore._subtreeRegistry || [];
235
+ return registry;
236
+ }
237
+
232
238
  function _destroyItem(item, entry) {
233
239
  if (!document.contains(item)) {
234
240
  if (entry.attribute) {
@@ -251,16 +257,24 @@ function _handleChildListMutation(mutation) {
251
257
  const registry = _lifecycleRegistry();
252
258
  if (!registry.length) return;
253
259
 
254
- if (mutation.target) {
255
- for (let r = 0; r < registry.length; r++) {
256
- const entry = registry[r];
257
- if (entry.onSubtreeChange && entry.query) {
258
- const query = entry.query;
259
- const host = mutation.target.nodeType === 1
260
- ? (mutation.target.matches && mutation.target.matches(query) ? mutation.target : (mutation.target.closest ? mutation.target.closest(query) : null))
261
- : (mutation.target.parentElement && mutation.target.parentElement.closest ? mutation.target.parentElement.closest(query) : null);
262
- if (host) entry.onSubtreeChange(host, mutation);
263
- }
260
+ // Fast bailout: ignore mutations inside contenteditable / rich-text editor surfaces
261
+ const target = mutation.target;
262
+ if (target) {
263
+ const targetEl = target.nodeType === 1 ? target : target.parentElement;
264
+ if (targetEl && (targetEl.isContentEditable || (targetEl.closest && targetEl.closest('[contenteditable]:not([contenteditable="false"])')))) {
265
+ return;
266
+ }
267
+ }
268
+
269
+ const subtreeEntries = _subtreeRegistry();
270
+ if (mutation.target && subtreeEntries.length) {
271
+ for (let r = 0; r < subtreeEntries.length; r++) {
272
+ const entry = subtreeEntries[r];
273
+ const query = entry.query;
274
+ const host = mutation.target.nodeType === 1
275
+ ? (mutation.target.matches && mutation.target.matches(query) ? mutation.target : (mutation.target.closest ? mutation.target.closest(query) : null))
276
+ : (mutation.target.parentElement && mutation.target.parentElement.closest ? mutation.target.parentElement.closest(query) : null);
277
+ if (host) entry.onSubtreeChange(host, mutation);
264
278
  }
265
279
  }
266
280
 
@@ -363,6 +377,9 @@ export function observeAttributes(names, handler) {
363
377
  */
364
378
  export function observeLifecycle(entry) {
365
379
  _lifecycleRegistry().push(entry);
380
+ if (entry.onSubtreeChange && entry.query) {
381
+ _subtreeRegistry().push(entry);
382
+ }
366
383
  _ensureLifecycleObserver();
367
384
  }
368
385
 
@@ -429,14 +446,18 @@ export function registerComponent(selector, attribute, ComponentFn, componentTag
429
446
  const isComplex = selector.indexOf('[') !== -1 || selector.indexOf('.') !== -1 || selector.indexOf('#') !== -1;
430
447
  const query = options.subtreeQuery || (isComplex ? selector : '[' + selector + ']');
431
448
 
432
- _lifecycleRegistry().push({
449
+ const lifecycleEntry = {
433
450
  selector: selector,
434
451
  attribute: attribute,
435
452
  ComponentFn: ComponentFn,
436
453
  onInit: onInit,
437
454
  onSubtreeChange: onSubtreeChange,
438
455
  query: query
439
- });
456
+ };
457
+ _lifecycleRegistry().push(lifecycleEntry);
458
+ if (onSubtreeChange && query) {
459
+ _subtreeRegistry().push(lifecycleEntry);
460
+ }
440
461
  _ensureLifecycleObserver();
441
462
 
442
463
  window[attribute] = constructor;
@@ -1 +1 @@
1
- (function(){"use strict";function R(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function L(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let n=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){n=t[s];break}if(!L(n))return}e.apply(console,t)}}function _(e,t,o){const n=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}function D(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){D(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const o=!!(t&&t.typed),n=t&&t.exclude,s={},a=e.elements,i={};if(o)for(let c=0;c<a.length;c++){const r=a[c];r.name&&r.type==="checkbox"&&!r.disabled&&(i[r.name]=(i[r.name]||0)+1)}for(let c=0;c<a.length;c++){const r=a[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(n&&r.matches&&r.matches(n)))if(r.type==="checkbox")o&&i[r.name]===1?s[r.name]=r.checked:(s[r.name]||(s[r.name]=[]),r.checked&&s[r.name].push(r.value));else if(r.type==="radio")r.checked&&(s[r.name]=r.value);else if(r.type==="select-multiple"){s[r.name]=[];for(let h=0;h<r.options.length;h++)r.options[h].selected&&s[r.name].push(r.options[h].value)}else if(o&&r.type==="hidden")s[r.name]=r.value;else if(o&&(r.type==="number"||r.type==="range")){const h=Number(r.value);s[r.name]=r.value===""||isNaN(h)?null:h}else s[r.name]=r.value}return s}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const o=e.elements,n=[],s={};for(let a=0;a<o.length;a++){const i=o[a];i.name&&i.type==="checkbox"&&(s[i.name]=(s[i.name]||0)+1)}for(let a=0;a<o.length;a++){const i=o[a];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const r=t[c];if(i.type==="checkbox"){if(Array.isArray(r))i.checked=r.indexOf(i.value)!==-1;else if(s[i.name]>1){const h=String(r).split(",").map(function(C){return C.trim()});i.checked=h.indexOf(i.value)!==-1}else i.checked=se(r);n.push(i)}else if(i.type==="radio")i.checked=i.value===String(r),n.push(i);else if(i.type==="select-multiple"){if(Array.isArray(r))for(let h=0;h<i.options.length;h++)i.options[h].selected=r.indexOf(i.options[h].value)!==-1;n.push(i)}else i.value=r,i.tagName==="SELECT"&&r!=null&&i.setAttribute("data-ln-value",r),n.push(i)}return n}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=ie);function x(...e){return e.filter(t=>t!=null&&t!=="").map((t,o)=>o===0?t.replace(/\/+$/,""):t.replace(/^\/+/,"").replace(/\/+$/,"")).filter(Boolean).join("/")}function O(e,t){return Object.assign({"Content-Type":"application/json",Accept:"application/json"},e,t?{Authorization:t}:null)}function ae(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(o){return console.error(`[${t}] Invalid headers JSON:`,o),{}}}const M={};function de(e,t){M[e]=t}function ue(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=ue);function fe(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,D(function(){new MutationObserver(function(){_(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function he(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];P[o]=t}function we(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=he,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=fe);const j={};function be(e,t){j[e]||(j[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=j[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function H(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let i=0;i<o.length;i++){const c=o[i],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const n=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<n.length;i++){const c=n[i],r=c.getAttribute("data-ln-attr").split(",");for(let h=0;h<r.length;h++){const C=r[h].trim().split(":");if(C.length!==2)continue;const g=C[0].trim(),y=C[1].trim();t[y]!=null&&c.setAttribute(g,t[y])}}const s=e.querySelectorAll("[data-ln-show]");for(let i=0;i<s.length;i++){const c=s[i],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const a=e.querySelectorAll("[data-ln-class]");for(let i=0;i<a.length;i++){const c=a[i],r=c.getAttribute("data-ln-class").split(",");for(let h=0;h<r.length;h++){const C=r[h].trim().split(":");if(C.length!==2)continue;const g=C[0].trim(),y=C[1].trim();y in t&&c.classList.toggle(g,!!t[y])}}return e}function pe(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let n=0;n<o.length;n++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[n],t??null),o[n].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)H(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function U(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const a=o.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const n=function(a,i){return t[i]!==void 0?t[i]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let a=0;a<s.length;a++){const i=s[a],c=i.attributes;for(let r=0;r<c.length;r++){const h=c[r];h.value.indexOf("{{")!==-1&&i.setAttribute(h.name,h.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function me(e,t,o,n,s,a){const i={};for(let r=0;r<e.children.length;r++){const h=e.children[r],C=h.getAttribute("data-ln-render-key");C&&(i[C]=h)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const h=t[r],C=String(n(h));let g=i[C];if(g)s(g,h,r);else{const y=be(o,a);if(!y||(U(y,h),g=y.firstElementChild,!g))continue;g.setAttribute("data-ln-render-key",C),s(g,h,r)}c.appendChild(g)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=H,window.lnCore.lnFill=pe,window.lnCore.renderList=me);function E(e,t,o){const n=e.getAttribute(t);return n===null?o:n}function W(e,t,o){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?o:n}function J(e,t,o=!1){const n=e.getAttribute(t);if(n===null)return!!o;const s=n.trim().toLowerCase();return!(s==="false"||s==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const q=new Map;function K(e,t){const o=(e?e.join("|"):"")+"::"+t;if(q.has(o))return q.get(o);const n=new Set(e||[]),s=function(a,i){const c=a.getAttribute(i);return c!==null&&n.has(c)?c:t};return q.set(o,s),s}function G(e,t,o){const n=parseFloat(e.getAttribute(t));return isNaN(n)?o:n}function z(e,t,o){const n=e.getAttribute(t);if(!n)return o;try{return JSON.parse(n)}catch{return o}}function Q(e,t,o,n,s){if(!e||t===null)return!0;const a=n||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=r=>{s?console.warn(r,s):console.warn(r)};if(i==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${a}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${a}] Invalid value "${t}" for attribute "${o}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${a}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${a}] Value ${r} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${a}] Value ${r} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${a}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${a}] Invalid JSON for attribute "${o}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function X(e,t,o){for(const n in o){const[s,a,i]=o[n];Object.defineProperty(e,n,{get:function(){return s(t,a,i)},enumerable:!0,configurable:!0})}return e}function Y(e){const t={};for(const o in e){const n=e[o];if(!n||!n.prop)continue;let s=n.read;if(!s&&n.type)switch(n.type){case"enum":s=K(n.values,n.fallback);break;case"integer":s=W;break;case"float":s=G;break;case"boolean":s=J;break;case"list":s=V;break;case"json":s=z;break;case"string":default:s=E;break}s||(s=E),t[n.prop]=[s,o,n.fallback]}return t}function ge(e){const t={};for(const o in e){const n=e[o];n&&n.effect&&(t[o]=n.effect)}return Object.keys(t).length?t:null}function Ce(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=X,window.lnCore.attrSpec=Y,window.lnCore.attrStr=E,window.lnCore.attrInt=W,window.lnCore.attrBool=J,window.lnCore.attrList=V,window.lnCore.attrEnum=K,window.lnCore.attrFloat=G,window.lnCore.attrJson=z);function T(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function Z(e,t,o,n){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:o,ComponentFn:n};if(e.matches&&e.matches(a)&&T(e,i),e.querySelectorAll){const c=e.querySelectorAll(a);for(let r=0;r<c.length;r++)T(c[r],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ye(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ve(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ee(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function _e(e){const t=ee(),o=e.observed||[];for(let n=0;n<o.length;n++){const s=o[n];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const n in e.attributes){t.byDeclaredAttr.has(n)||t.byDeclaredAttr.set(n,[]);const s=t.byDeclaredAttr.get(n);s.some(a=>a.componentTag===e.componentTag)||s.push({spec:e.attributes[n],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const n=Ce(e);if(n===null)t.reactiveWildcard.push(e);else for(const s of n)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function te(e,t,o,n){for(let s=0;s<e.length;s++){const a=e[s];if(!t[a.attribute])continue;const i=a.effects&&a.effects[o];i?i(t,o,n):a.onAttrChange&&(!a.declared||a.declared.has(o))&&a.onAttrChange(t,o,n)}}function Ae(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,n=ee(),s=n.byAttr.get(t),a=R()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!o&&!s&&!a)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(a&&L(i)){const c=n.byDeclaredAttr.get(t),r=i.getAttribute(t);for(let h=0;h<c.length;h++)Q(c[h].spec,r,t,c[h].componentTag,i)}if(window.lnCore._debugSink&&(o||s)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),o){const c=n.byReactive.get(t);c&&te(c,i,t,e.oldValue),n.reactiveWildcard.length&&te(n.reactiveWildcard,i,t,e.oldValue)}if(s)for(let c=0;c<s.length;c++){const r=s[c];if(r.handler){r.handler(i,t,e.oldValue);continue}r.onAttributeChange&&i[r.attribute]?r.onAttributeChange(i,t):(Z(i,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(i))}}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,D(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{Ae(t[o])}catch(n){console.error("[ln-core] mutation handler failed",t[o].target,n)}}).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 $(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(n){console.error("["+t.attribute+"] destroy failed",e,n)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function xe(e){const t=I();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const n=t[o];if(n.onSubtreeChange&&n.query){const s=n.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(s)?e.target:e.target.closest?e.target.closest(s):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(s):null;a&&n.onSubtreeChange(a,e)}}for(let o=0;o<e.addedNodes.length;o++){const n=e.addedNodes[o];if(n.nodeType===1){const s=!!(n.firstElementChild||n.children&&n.children.length);for(let a=0;a<t.length;a++){const i=t[a];if(i.selector&&i.attribute&&i.ComponentFn){if(!s)n.matches&&n.matches(i.query)&&T(n,i);else if(n.matches&&n.matches(i.query)&&T(n,i),n.querySelectorAll){const c=n.querySelectorAll(i.query);for(let r=0;r<c.length;r++)T(c[r],i)}}i.onInit&&i.onInit(n)}}}for(let o=0;o<e.removedNodes.length;o++){const n=e.removedNodes[o];if(n.nodeType===1){const s=!!(n.firstElementChild||n.children&&n.children.length);for(let a=0;a<t.length;a++){const i=t[a],c=i.query;if(c){if(!s)n.matches&&n.matches(c)&&$(n,i);else if(n.matches&&n.matches(c)&&$(n,i),n.querySelectorAll){const r=n.querySelectorAll(c);for(let h=0;h<r.length;h++)$(r[h],i)}}}}}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,D(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const n=t[o];if(n.type==="childList")try{xe(n)}catch(s){console.error("[ln-core] lifecycle handler failed",n.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Se(e){I().push(e),ne()}function oe(e,t,o,n,s={}){const a=s.extraAttributes||[],i=s.onAttributeChange||null,c=s.onSubtreeChange||null,r=s.onInit||null,h=s.onAttrChange||null,C=s.effects||null,g=s.attributes||null,y=g?ge(g):C,B=g?new Set(Object.keys(g)):null,l=s.persist||null;function u(b){const w=b||document.body;if(Z(w,e,t,o),g&&R())for(const v in g){const F=g[v],A=Array.from(w.querySelectorAll("["+v+"]"));w.matches&&w.matches("["+v+"]")&&A.push(w);for(let S=0;S<A.length;S++){const k=A[S];L(k)&&Q(F,k.getAttribute(v),v,n,k)}}r&&r(w)}const d=[];if(e.indexOf("[")!==-1){const b=/\[([\w-]+)/g;let w;for(;(w=b.exec(e))!==null;)d.push(w[1])}else d.push(e);_e({selector:e,attribute:t,componentTag:n,attributes:g,ComponentFn:o,onInit:r,observed:d.concat(a),onAttributeChange:i,onAttrChange:h,effects:y,declared:B,persist:l}),ke();const f=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,p=s.subtreeQuery||(f?e:"["+e+"]");I().push({selector:e,attribute:t,ComponentFn:o,onInit:r,onSubtreeChange:c,query:p}),ne(),window[t]=u,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=oe,window.lnCore.observeLifecycle=Se);function m(){ye()>0?ve(function(){u(document.body)}):u(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",m):m(),u}function re(e){return(e||"").replace(/^#/,"")}function N(e){const t=e===void 0?location.hash:e,o={},n=re(t);if(!n)return o;const s=n.split("&");for(let a=0;a<s.length;a++){const i=s[a];if(!i)continue;const c=i.indexOf(":"),r=c>-1?i.slice(0,c):i,h=c>-1?i.slice(c+1):"";if(r)try{o[r]=decodeURIComponent(h)}catch{o[r]=h}}return o}function Ee(e){if(!e)return null;const t=N();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const o=N();t==null?delete o[e]:o[e]=String(t);const s=Object.keys(o).map(function(a){const i=o[a];return i===""?a:a+":"+encodeURIComponent(i)}).join("&");re(location.hash)!==s&&(location.hash=s)}function Te(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 o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const n=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return n?t?n+"-"+t:n:t||null}function Le(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function qe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ie(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),n=e.slice(t+1),s=n?n.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:o,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=N,window.lnCore.hashGet=Ee,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=De,window.lnCore.hashSortEncode=Le,window.lnCore.hashSortDecode=je,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=Ie);function $e(){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=$e),(function(){const e="data-ln-couchdb-connector",t="lnCouchDbConnector",o="lnConnector";if(window[t]!==void 0)return;function n(l){const u=l[t];u&&u.refreshConfig()}const s={"data-ln-couchdb-connector":{type:"marker",description:"Mounts CouchDB/PouchDB connector bridging database and ln-ashlar data coordinators"},"data-ln-couchdb-url":{prop:"url",read:E,type:"string",fallback:"",effect:n,description:"CouchDB server base endpoint URL"},"data-ln-couchdb-db":{prop:"db",read:E,type:"string",fallback:"",effect:n,description:"Target CouchDB database name"},"data-ln-couchdb-auth":{prop:"auth",read:E,type:"string",fallback:"",effect:n,description:"Authentication credentials for CouchDB requests"},"data-ln-couchdb-headers":{effect:n,type:"json",fallback:null,description:"Custom HTTP headers in JSON or semicolon-separated format"}},a=Y(s);function i(l){const u=l&&l.content!==void 0?l.content:l,d=l&&l.message?l.message:null;return{content:u,message:d}}function c(l){return this.dom=l,X(this,l,a),l[t]=this,l[o]=this,this.namespace="ln-couchdb-connector",this.refreshConfig(),this._deltaController=null,this._handlers=null,B(this),this}c.prototype.refreshConfig=function(){const l=this.dom;this.credentials="same-origin";const u=l.getAttribute("data-ln-couchdb-headers")||"";this.headers=ae(u,"ln-couchdb-connector"),this.auth&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-auth attribute. Storing basic authentication credentials in HTML DOM attributes is highly discouraged and vulnerable to XSS credential extraction. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),u.toLowerCase().includes("authorization")&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-headers attribute. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),_(l,"ln-couchdb-connector:config-changed",{url:this.url,db:this.db,auth:this.auth?"[REDACTED]":"",headers:this.headers})};function r(l,u,d){const f=Object.assign({},O(l.headers,l.auth),d||{});return u&&(f["Idempotency-Key"]=u),f}c.prototype.fetchDelta=function(l){const u=this;this._deltaController&&this._deltaController.abort(),this._deltaController=new AbortController;const d=this._deltaController.signal,f=["include_docs=true","feed=normal"];l&&f.push("since="+encodeURIComponent(l));const p=x(u.url,u.db,"_changes")+"?"+f.join("&");return window.fetch(p,{method:"GET",headers:O(u.headers,u.auth),credentials:u.credentials,signal:d}).then(m=>{if(!m.ok)throw new Error("HTTP "+m.status+": "+m.statusText);return m.json()}).then(m=>{const b=m.results||[];return{data:b.filter(w=>!w.deleted&&w.doc).map(w=>Object.assign({},w.doc,{id:w.doc._id})),deleted:b.filter(w=>w.deleted).map(w=>w.id),synced_at:m.last_seq||l||""}}).finally(()=>{u._deltaController&&u._deltaController.signal===d&&(u._deltaController=null)})};function h(l,u,d){const f=Object.assign({_id:u.id},u);return f._id||delete f._id,window.fetch(x(l.url,l.db),{method:"POST",headers:r(l,d),credentials:l.credentials,body:JSON.stringify(f)}).then(p=>{if(!p.ok)throw new Error("HTTP "+p.status+": "+p.statusText);return p.json()}).then(p=>{const m=i(p),b=m.content;return{record:Object.assign({},f,{id:b.id,_id:b.id,_rev:b.rev}),message:m.message}})}c.prototype.create=function(l,u){return h(this,l,u).then(d=>d.record)};function C(l,u,d,f){const p=Object.assign({id:String(u),_id:String(u)},d),m=p._rev||p.rev;return(m?Promise.resolve(m):window.fetch(x(l.url,l.db,null,u),{method:"GET",headers:O(l.headers,l.auth),credentials:l.credentials}).then(w=>{if(!w.ok)throw new Error("Could not retrieve document for revision mapping");return w.json().then(v=>v._rev)})).then(w=>{const v=Object.assign({},p,{_rev:w});delete v.rev;const F=r(l,f,{"If-Match":w});return window.fetch(x(l.url,l.db,null,u),{method:"PUT",headers:F,credentials:l.credentials,body:JSON.stringify(v)}).then(A=>{if(A.ok)return A.json().then(S=>{const k=i(S);return{record:Object.assign({},v,{_rev:k.content.rev}),message:k.message}});if(A.status===409)return A.json().then(S=>{const k=new Error("Conflict");throw k.status=409,k.data=S,k});throw new Error("HTTP "+A.status+": "+A.statusText)})})}c.prototype.update=function(l,u,d){return C(this,l,u,d).then(f=>f.record)};function g(l,u,d,f){return(d?Promise.resolve(d):window.fetch(x(l.url,l.db,null,u),{method:"GET",headers:O(l.headers,l.auth),credentials:l.credentials}).then(m=>{if(!m.ok)throw new Error("Could not retrieve document for revision delete");return m.json().then(b=>b._rev)})).then(m=>{const b=x(l.url,l.db,null,u)+"?rev="+encodeURIComponent(m);return window.fetch(b,{method:"DELETE",headers:r(l,f),credentials:l.credentials}).then(w=>{if(!w.ok)throw new Error("HTTP "+w.status+": "+w.statusText);return w.json()}).then(w=>{const v=i(w);return{response:v.content,message:v.message}})})}c.prototype.delete=function(l,u,d){return g(this,l,u,d).then(f=>f.response)};function y(l,u,d){return!u||u.length===0?Promise.resolve({response:{ok:!0,deletedCount:0},message:null}):window.fetch(x(l.url,l.db,"_all_docs"),{method:"POST",headers:O(l.headers,l.auth),credentials:l.credentials,body:JSON.stringify({keys:u})}).then(f=>{if(!f.ok)throw new Error("HTTP "+f.status+": "+f.statusText);return f.json()}).then(f=>{const m=(f.rows||[]).filter(b=>!b.error&&b.value&&b.value.rev).map(b=>({_id:b.id,_rev:b.value.rev,_deleted:!0}));return m.length===0?{response:{ok:!0,deletedCount:0},message:null}:window.fetch(x(l.url,l.db,"_bulk_docs"),{method:"POST",headers:r(l,d),credentials:l.credentials,body:JSON.stringify({docs:m})}).then(b=>{if(!b.ok)throw new Error("HTTP "+b.status+": "+b.statusText);return b.json()}).then(b=>{const w=i(b);return{response:{ok:!0,results:w.content,deletedCount:m.length},message:w.message}})})}c.prototype.bulkDelete=function(l,u){return y(this,l,u).then(d=>d.response)};function B(l){l._handlers={sync:function(u){const d=u.detail||{};l.fetchDelta(d.since).then(function(f){_(l.dom,"ln-couchdb-connector:fetched",{data:f,since:d.since,meta:d.meta||null})}).catch(function(f){f&&f.name==="AbortError"||_(l.dom,"ln-couchdb-connector:error",{action:"sync",error:f.message,status:f.status||0,since:d.since,meta:d.meta||null})})},create:function(u){const d=u.detail||{};h(l,d.data,d.idempotencyKey).then(function(f){_(l.dom,"ln-couchdb-connector:created",{record:f.record,tempId:d.tempId,message:f.message,meta:d.meta||null})}).catch(function(f){_(l.dom,"ln-couchdb-connector:error",{action:"create",error:f.message,status:f.status||0,tempId:d.tempId,meta:d.meta||null})})},update:function(u){const d=u.detail||{},f=Object.assign({},d.data);d.expected_version!==void 0&&(f._rev=d.expected_version),C(l,d.id,f,d.idempotencyKey).then(function(p){_(l.dom,"ln-couchdb-connector:updated",{record:p.record,id:d.id,message:p.message,meta:d.meta||null})}).catch(function(p){_(l.dom,"ln-couchdb-connector:error",{action:"update",error:p.message,status:p.status||0,id:d.id,data:p.status===409?p.data:null,conflictData:p.status===409?p.data:null,meta:d.meta||null})})},delete:function(u){const d=u.detail||{};g(l,d.id,d.rev,d.idempotencyKey).then(function(f){_(l.dom,"ln-couchdb-connector:deleted",{response:f.response,id:d.id,message:f.message,meta:d.meta||null})}).catch(function(f){_(l.dom,"ln-couchdb-connector:error",{action:"delete",error:f.message,status:f.status||0,id:d.id,meta:d.meta||null})})},bulkDelete:function(u){const d=u.detail||{};y(l,d.ids,d.idempotencyKey).then(function(f){_(l.dom,"ln-couchdb-connector:bulk-deleted",{response:f.response,ids:d.ids,message:f.message,meta:d.meta||null})}).catch(function(f){_(l.dom,"ln-couchdb-connector:error",{action:"bulk-delete",error:f.message,status:f.status||0,ids:d.ids,meta:d.meta||null})})}},l.dom.addEventListener("ln-couchdb-connector:request-sync",l._handlers.sync),l.dom.addEventListener("ln-couchdb-connector:request-create",l._handlers.create),l.dom.addEventListener("ln-couchdb-connector:request-update",l._handlers.update),l.dom.addEventListener("ln-couchdb-connector:request-delete",l._handlers.delete),l.dom.addEventListener("ln-couchdb-connector:request-bulk-delete",l._handlers.bulkDelete)}c.prototype.destroy=function(){if(!this.dom[t])return;const l=this;l._deltaController&&(l._deltaController.abort(),l._deltaController=null),l._handlers&&(l.dom.removeEventListener("ln-couchdb-connector:request-sync",l._handlers.sync),l.dom.removeEventListener("ln-couchdb-connector:request-create",l._handlers.create),l.dom.removeEventListener("ln-couchdb-connector:request-update",l._handlers.update),l.dom.removeEventListener("ln-couchdb-connector:request-delete",l._handlers.delete),l.dom.removeEventListener("ln-couchdb-connector:request-bulk-delete",l._handlers.bulkDelete),l._handlers=null),delete this.dom[t],delete this.dom[o]},oe(e,t,c,"ln-couchdb-connector",{attributes:s})})()})();
1
+ (function(){"use strict";function P(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function q(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){i=t[s];break}if(!q(i))return}e.apply(console,t)}}function v(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function L(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){L(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function le(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ce(e,t){const o=!!(t&&t.typed),i=t&&t.exclude,s={},c=e.elements,r={};if(o)for(let a=0;a<c.length;a++){const n=c[a];n.name&&n.type==="checkbox"&&!n.disabled&&(r[n.name]=(r[n.name]||0)+1)}for(let a=0;a<c.length;a++){const n=c[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")o&&r[n.name]===1?s[n.name]=n.checked:(s[n.name]||(s[n.name]=[]),n.checked&&s[n.name].push(n.value));else if(n.type==="radio")n.checked&&(s[n.name]=n.value);else if(n.type==="select-multiple"){s[n.name]=[];for(let f=0;f<n.options.length;f++)n.options[f].selected&&s[n.name].push(n.options[f].value)}else if(o&&n.type==="hidden")s[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const f=Number(n.value);s[n.name]=n.value===""||isNaN(f)?null:f}else s[n.name]=n.value}return s}function ae(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 o=e.elements,i=[],s={};for(let c=0;c<o.length;c++){const r=o[c];r.name&&r.type==="checkbox"&&(s[r.name]=(s[r.name]||0)+1)}for(let c=0;c<o.length;c++){const r=o[c];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const a=r.getAttribute("data-ln-fill-as")||r.name;if(!a||!(a in t))continue;const n=t[a];if(r.type==="checkbox"){if(Array.isArray(n))r.checked=n.indexOf(r.value)!==-1;else if(s[r.name]>1){const f=String(n).split(",").map(function(b){return b.trim()});r.checked=f.indexOf(r.value)!==-1}else r.checked=ae(n);i.push(r)}else if(r.type==="radio")r.checked=r.value===String(n),i.push(r);else if(r.type==="select-multiple"){if(Array.isArray(n))for(let f=0;f<r.options.length;f++)r.options[f].selected=n.indexOf(r.options[f].value)!==-1;i.push(r)}else r.value=n,r.tagName==="SELECT"&&n!=null&&r.setAttribute("data-ln-value",n),i.push(r)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=de,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=le);function k(...e){return e.filter(t=>t!=null&&t!=="").map((t,o)=>o===0?t.replace(/\/+$/,""):t.replace(/^\/+/,"").replace(/\/+$/,"")).filter(Boolean).join("/")}function T(e,t){return Object.assign({"Content-Type":"application/json",Accept:"application/json"},e,t?{Authorization:t}:null)}function ue(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(o){return console.error(`[${t}] Invalid headers JSON:`,o),{}}}const H={};function fe(e,t){H[e]=t}function he(e){return H[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=he);function we(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,L(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function be(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];U[o]=t}function pe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return U[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=be,window.lnCore.getLocaleFallback=pe,window.lnCore.ensureLocaleObserver=we);const I={};function me(e,t){I[e]||(I[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=I[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function W(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let r=0;r<o.length;r++){const a=o[r],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<i.length;r++){const a=i[r],n=a.getAttribute("data-ln-attr").split(",");for(let f=0;f<n.length;f++){const b=n[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),_=b[1].trim();t[_]!=null&&a.setAttribute(m,t[_])}}const s=e.querySelectorAll("[data-ln-show]");for(let r=0;r<s.length;r++){const a=s[r],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let r=0;r<c.length;r++){const a=c[r],n=a.getAttribute("data-ln-class").split(",");for(let f=0;f<n.length;f++){const b=n[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),_=b[1].trim();_ in t&&a.classList.toggle(m,!!t[_])}}return e}function ge(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<o.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[i],t??null),o[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)W(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function J(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const c=o.currentNode;c.textContent.indexOf("{{")!==-1&&(c.textContent=c.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,a){return t[a]!==void 0?t[a]:""}))}const i=function(c,r){return t[r]!==void 0?t[r]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let c=0;c<s.length;c++){const r=s[c],a=r.attributes;for(let n=0;n<a.length;n++){const f=a[n];f.value.indexOf("{{")!==-1&&r.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function Ce(e,t,o,i,s,c){const r={};for(let n=0;n<e.children.length;n++){const f=e.children[n],b=f.getAttribute("data-ln-render-key");b&&(r[b]=f)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const f=t[n],b=String(i(f));let m=r[b];if(m)s(m,f,n);else{const _=me(o,c);if(!_||(J(_,f),m=_.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),s(m,f,n)}a.appendChild(m)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=J,window.lnCore.fill=W,window.lnCore.lnFill=ge,window.lnCore.renderList=Ce);function O(e,t,o){const i=e.getAttribute(t);return i===null?o:i}function V(e,t,o){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?o:i}function K(e,t,o=!1){const i=e.getAttribute(t);if(i===null)return!!o;const s=i.trim().toLowerCase();return!(s==="false"||s==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const R=new Map;function z(e,t){const o=(e?e.join("|"):"")+"::"+t;if(R.has(o))return R.get(o);const i=new Set(e||[]),s=function(c,r){const a=c.getAttribute(r);return a!==null&&i.has(a)?a:t};return R.set(o,s),s}function Q(e,t,o){const i=parseFloat(e.getAttribute(t));return isNaN(i)?o:i}function X(e,t,o){const i=e.getAttribute(t);if(!i)return o;try{return JSON.parse(i)}catch{return o}}function Y(e,t,o,i,s){if(!e||t===null)return!0;const c=i||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const a=n=>{s?console.warn(n,s):console.warn(n)};if(r==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${c}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${c}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return a(`[${c}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${c}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${c}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(a(`[${c}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${c}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Z(e,t,o){for(const i in o){const[s,c,r]=o[i];Object.defineProperty(e,i,{get:function(){return s(t,c,r)},enumerable:!0,configurable:!0})}return e}function ee(e){const t={};for(const o in e){const i=e[o];if(!i||!i.prop)continue;let s=i.read;if(!s&&i.type)switch(i.type){case"enum":s=z(i.values,i.fallback);break;case"integer":s=V;break;case"float":s=Q;break;case"boolean":s=K;break;case"list":s=G;break;case"json":s=X;break;case"string":default:s=O;break}s||(s=O),t[i.prop]=[s,o,i.fallback]}return t}function ye(e){const t={};for(const o in e){const i=e[o];i&&i.effect&&(t[o]=i.effect)}return Object.keys(t).length?t:null}function _e(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const o in e.effects)t.add(o);if(e.onAttrChange&&e.declared)for(const o of e.declared)t.add(o);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Z,window.lnCore.attrSpec=ee,window.lnCore.attrStr=O,window.lnCore.attrInt=V,window.lnCore.attrBool=K,window.lnCore.attrList=G,window.lnCore.attrEnum=z,window.lnCore.attrFloat=Q,window.lnCore.attrJson=X);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(o){console.error("["+t.attribute+"] init failed",e,o)}}}function te(e,t,o,i){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:o,ComponentFn:i};if(e.matches&&e.matches(c)&&D(e,r),e.querySelectorAll){const a=e.querySelectorAll(c);for(let n=0;n<a.length;n++)D(a[n],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ae(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 ke(e){const t=ne(),o=e.observed||[];for(let i=0;i<o.length;i++){const s=o[i];t.byAttr.has(s)||t.byAttr.set(s,[]),t.byAttr.get(s).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const s=t.byDeclaredAttr.get(i);s.some(c=>c.componentTag===e.componentTag)||s.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=_e(e);if(i===null)t.reactiveWildcard.push(e);else for(const s of i)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function oe(e,t,o,i){for(let s=0;s<e.length;s++){const c=e[s];if(!t[c.attribute])continue;const r=c.effects&&c.effects[o];r?r(t,o,i):c.onAttrChange&&(!c.declared||c.declared.has(o))&&c.onAttrChange(t,o,i)}}function xe(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,i=ne(),s=i.byAttr.get(t),c=P()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!o&&!s&&!c)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(c&&q(r)){const a=i.byDeclaredAttr.get(t),n=r.getAttribute(t);for(let f=0;f<a.length;f++)Y(a[f].spec,n,t,a[f].componentTag,r)}if(window.lnCore._debugSink&&(o||s)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),o){const a=i.byReactive.get(t);a&&oe(a,r,t,e.oldValue),i.reactiveWildcard.length&&oe(i.reactiveWildcard,r,t,e.oldValue)}if(s)for(let a=0;a<s.length;a++){const n=s[a];if(n.handler){n.handler(r,t,e.oldValue);continue}n.onAttributeChange&&r[n.attribute]?n.onAttributeChange(r,t):(te(r,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(r))}}}function Se(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,L(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{xe(t[o])}catch(i){console.error("[ln-core] mutation handler failed",t[o].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function N(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function B(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Ee(e){const t=$();if(!t.length)return;const o=e.target;if(o){const s=o.nodeType===1?o:o.parentElement;if(s&&(s.isContentEditable||s.closest&&s.closest('[contenteditable]:not([contenteditable="false"])')))return}const i=N();if(e.target&&i.length)for(let s=0;s<i.length;s++){const c=i[s],r=c.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(r)?e.target:e.target.closest?e.target.closest(r):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(r):null;a&&c.onSubtreeChange(a,e)}for(let s=0;s<e.addedNodes.length;s++){const c=e.addedNodes[s];if(c.nodeType===1){const r=!!(c.firstElementChild||c.children&&c.children.length);for(let a=0;a<t.length;a++){const n=t[a];if(n.selector&&n.attribute&&n.ComponentFn){if(!r)c.matches&&c.matches(n.query)&&D(c,n);else if(c.matches&&c.matches(n.query)&&D(c,n),c.querySelectorAll){const f=c.querySelectorAll(n.query);for(let b=0;b<f.length;b++)D(f[b],n)}}n.onInit&&n.onInit(c)}}}for(let s=0;s<e.removedNodes.length;s++){const c=e.removedNodes[s];if(c.nodeType===1){const r=!!(c.firstElementChild||c.children&&c.children.length);for(let a=0;a<t.length;a++){const n=t[a],f=n.query;if(f){if(!r)c.matches&&c.matches(f)&&B(c,n);else if(c.matches&&c.matches(f)&&B(c,n),c.querySelectorAll){const b=c.querySelectorAll(f);for(let m=0;m<b.length;m++)B(b[m],n)}}}}}}function re(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,L(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const i=t[o];if(i.type==="childList")try{Ee(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){$().push(e),e.onSubtreeChange&&e.query&&N().push(e),re()}function ie(e,t,o,i,s={}){const c=s.extraAttributes||[],r=s.onAttributeChange||null,a=s.onSubtreeChange||null,n=s.onInit||null,f=s.onAttrChange||null,b=s.effects||null,m=s.attributes||null,_=m?ye(m):b,M=m?new Set(Object.keys(m)):null,l=s.persist||null;function u(w){const y=w||document.body;if(te(y,e,t,o),m&&P())for(const S in m){const x=m[S],E=Array.from(y.querySelectorAll("["+S+"]"));y.matches&&y.matches("["+S+"]")&&E.push(y);for(let A=0;A<E.length;A++){const j=E[A];q(j)&&Y(x,j.getAttribute(S),S,i,j)}}n&&n(y)}const d=[];if(e.indexOf("[")!==-1){const w=/\[([\w-]+)/g;let y;for(;(y=w.exec(e))!==null;)d.push(y[1])}else d.push(e);ke({selector:e,attribute:t,componentTag:i,attributes:m,ComponentFn:o,onInit:n,observed:d.concat(c),onAttributeChange:r,onAttrChange:f,effects:_,declared:M,persist:l}),Se();const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,g=s.subtreeQuery||(h?e:"["+e+"]"),C={selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:a,query:g};$().push(C),a&&g&&N().push(C),re(),window[t]=u,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ie,window.lnCore.observeLifecycle=Oe);function p(){ve()>0?Ae(function(){u(document.body)}):u(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p):p(),u}function se(e){return(e||"").replace(/^#/,"")}function F(e){const t=e===void 0?location.hash:e,o={},i=se(t);if(!i)return o;const s=i.split("&");for(let c=0;c<s.length;c++){const r=s[c];if(!r)continue;const a=r.indexOf(":"),n=a>-1?r.slice(0,a):r,f=a>-1?r.slice(a+1):"";if(n)try{o[n]=decodeURIComponent(f)}catch{o[n]=f}}return o}function Te(e){if(!e)return null;const t=F();return e in t?t[e]:null}function De(e,t){if(!e)return;const o=F();t==null?delete o[e]:o[e]=String(t);const s=Object.keys(o).map(function(c){const r=o[c];return r===""?c:c+":"+encodeURIComponent(r)}).join("&");se(location.hash)!==s&&(location.hash=s)}function Le(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function je(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function qe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Re(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function $e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),i=e.slice(t+1),s=i?i.split(",").map(function(c){try{return decodeURIComponent(c)}catch{return c}}).filter(Boolean):[];return{key:o,values:s}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=F,window.lnCore.hashGet=Te,window.lnCore.hashSet=De,window.lnCore.hashLinkClick=Le,window.lnCore.resolveHashNamespace=je,window.lnCore.hashSortEncode=qe,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=Re,window.lnCore.hashFilterDecode=$e);function Ne(){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=Ne),(function(){const e="data-ln-couchdb-connector",t="lnCouchDbConnector",o="lnConnector";if(window[t]!==void 0)return;function i(l){const u=l[t];u&&u.refreshConfig()}const s={"data-ln-couchdb-connector":{type:"marker",description:"Mounts CouchDB/PouchDB connector bridging database and ln-ashlar data coordinators"},"data-ln-couchdb-url":{prop:"url",read:O,type:"string",fallback:"",effect:i,description:"CouchDB server base endpoint URL"},"data-ln-couchdb-db":{prop:"db",read:O,type:"string",fallback:"",effect:i,description:"Target CouchDB database name"},"data-ln-couchdb-auth":{prop:"auth",read:O,type:"string",fallback:"",effect:i,description:"Authentication credentials for CouchDB requests"},"data-ln-couchdb-headers":{effect:i,type:"json",fallback:null,description:"Custom HTTP headers in JSON or semicolon-separated format"}},c=ee(s);function r(l){const u=l&&l.content!==void 0?l.content:l,d=l&&l.message?l.message:null;return{content:u,message:d}}function a(l){return this.dom=l,Z(this,l,c),l[t]=this,l[o]=this,this.namespace="ln-couchdb-connector",this.refreshConfig(),this._deltaController=null,this._handlers=null,M(this),this}a.prototype.refreshConfig=function(){const l=this.dom;this.credentials="same-origin";const u=l.getAttribute("data-ln-couchdb-headers")||"";this.headers=ue(u,"ln-couchdb-connector"),this.auth&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-auth attribute. Storing basic authentication credentials in HTML DOM attributes is highly discouraged and vulnerable to XSS credential extraction. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),u.toLowerCase().includes("authorization")&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-headers attribute. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),v(l,"ln-couchdb-connector:config-changed",{url:this.url,db:this.db,auth:this.auth?"[REDACTED]":"",headers:this.headers})};function n(l,u,d){const h=Object.assign({},T(l.headers,l.auth),d||{});return u&&(h["Idempotency-Key"]=u),h}a.prototype.fetchDelta=function(l){const u=this;this._deltaController&&this._deltaController.abort(),this._deltaController=new AbortController;const d=this._deltaController.signal,h=["include_docs=true","feed=normal"];l&&h.push("since="+encodeURIComponent(l));const g=k(u.url,u.db,"_changes")+"?"+h.join("&");return window.fetch(g,{method:"GET",headers:T(u.headers,u.auth),credentials:u.credentials,signal:d}).then(C=>{if(!C.ok)throw new Error("HTTP "+C.status+": "+C.statusText);return C.json()}).then(C=>{const p=C.results||[];return{data:p.filter(w=>!w.deleted&&w.doc).map(w=>Object.assign({},w.doc,{id:w.doc._id})),deleted:p.filter(w=>w.deleted).map(w=>w.id),synced_at:C.last_seq||l||""}}).finally(()=>{u._deltaController&&u._deltaController.signal===d&&(u._deltaController=null)})};function f(l,u,d){const h=Object.assign({_id:u.id},u);return h._id||delete h._id,window.fetch(k(l.url,l.db),{method:"POST",headers:n(l,d),credentials:l.credentials,body:JSON.stringify(h)}).then(g=>{if(!g.ok)throw new Error("HTTP "+g.status+": "+g.statusText);return g.json()}).then(g=>{const C=r(g),p=C.content;return{record:Object.assign({},h,{id:p.id,_id:p.id,_rev:p.rev}),message:C.message}})}a.prototype.create=function(l,u){return f(this,l,u).then(d=>d.record)};function b(l,u,d,h){const g=Object.assign({id:String(u),_id:String(u)},d),C=g._rev||g.rev;return(C?Promise.resolve(C):window.fetch(k(l.url,l.db,null,u),{method:"GET",headers:T(l.headers,l.auth),credentials:l.credentials}).then(w=>{if(!w.ok)throw new Error("Could not retrieve document for revision mapping");return w.json().then(y=>y._rev)})).then(w=>{const y=Object.assign({},g,{_rev:w});delete y.rev;const S=n(l,h,{"If-Match":w});return window.fetch(k(l.url,l.db,null,u),{method:"PUT",headers:S,credentials:l.credentials,body:JSON.stringify(y)}).then(x=>{if(x.ok)return x.json().then(E=>{const A=r(E);return{record:Object.assign({},y,{_rev:A.content.rev}),message:A.message}});if(x.status===409)return x.json().then(E=>{const A=new Error("Conflict");throw A.status=409,A.data=E,A});throw new Error("HTTP "+x.status+": "+x.statusText)})})}a.prototype.update=function(l,u,d){return b(this,l,u,d).then(h=>h.record)};function m(l,u,d,h){return(d?Promise.resolve(d):window.fetch(k(l.url,l.db,null,u),{method:"GET",headers:T(l.headers,l.auth),credentials:l.credentials}).then(C=>{if(!C.ok)throw new Error("Could not retrieve document for revision delete");return C.json().then(p=>p._rev)})).then(C=>{const p=k(l.url,l.db,null,u)+"?rev="+encodeURIComponent(C);return window.fetch(p,{method:"DELETE",headers:n(l,h),credentials:l.credentials}).then(w=>{if(!w.ok)throw new Error("HTTP "+w.status+": "+w.statusText);return w.json()}).then(w=>{const y=r(w);return{response:y.content,message:y.message}})})}a.prototype.delete=function(l,u,d){return m(this,l,u,d).then(h=>h.response)};function _(l,u,d){return!u||u.length===0?Promise.resolve({response:{ok:!0,deletedCount:0},message:null}):window.fetch(k(l.url,l.db,"_all_docs"),{method:"POST",headers:T(l.headers,l.auth),credentials:l.credentials,body:JSON.stringify({keys:u})}).then(h=>{if(!h.ok)throw new Error("HTTP "+h.status+": "+h.statusText);return h.json()}).then(h=>{const C=(h.rows||[]).filter(p=>!p.error&&p.value&&p.value.rev).map(p=>({_id:p.id,_rev:p.value.rev,_deleted:!0}));return C.length===0?{response:{ok:!0,deletedCount:0},message:null}:window.fetch(k(l.url,l.db,"_bulk_docs"),{method:"POST",headers:n(l,d),credentials:l.credentials,body:JSON.stringify({docs:C})}).then(p=>{if(!p.ok)throw new Error("HTTP "+p.status+": "+p.statusText);return p.json()}).then(p=>{const w=r(p);return{response:{ok:!0,results:w.content,deletedCount:C.length},message:w.message}})})}a.prototype.bulkDelete=function(l,u){return _(this,l,u).then(d=>d.response)};function M(l){l._handlers={sync:function(u){const d=u.detail||{};l.fetchDelta(d.since).then(function(h){v(l.dom,"ln-couchdb-connector:fetched",{data:h,since:d.since,meta:d.meta||null})}).catch(function(h){h&&h.name==="AbortError"||v(l.dom,"ln-couchdb-connector:error",{action:"sync",error:h.message,status:h.status||0,since:d.since,meta:d.meta||null})})},create:function(u){const d=u.detail||{};f(l,d.data,d.idempotencyKey).then(function(h){v(l.dom,"ln-couchdb-connector:created",{record:h.record,tempId:d.tempId,message:h.message,meta:d.meta||null})}).catch(function(h){v(l.dom,"ln-couchdb-connector:error",{action:"create",error:h.message,status:h.status||0,tempId:d.tempId,meta:d.meta||null})})},update:function(u){const d=u.detail||{},h=Object.assign({},d.data);d.expected_version!==void 0&&(h._rev=d.expected_version),b(l,d.id,h,d.idempotencyKey).then(function(g){v(l.dom,"ln-couchdb-connector:updated",{record:g.record,id:d.id,message:g.message,meta:d.meta||null})}).catch(function(g){v(l.dom,"ln-couchdb-connector:error",{action:"update",error:g.message,status:g.status||0,id:d.id,data:g.status===409?g.data:null,conflictData:g.status===409?g.data:null,meta:d.meta||null})})},delete:function(u){const d=u.detail||{};m(l,d.id,d.rev,d.idempotencyKey).then(function(h){v(l.dom,"ln-couchdb-connector:deleted",{response:h.response,id:d.id,message:h.message,meta:d.meta||null})}).catch(function(h){v(l.dom,"ln-couchdb-connector:error",{action:"delete",error:h.message,status:h.status||0,id:d.id,meta:d.meta||null})})},bulkDelete:function(u){const d=u.detail||{};_(l,d.ids,d.idempotencyKey).then(function(h){v(l.dom,"ln-couchdb-connector:bulk-deleted",{response:h.response,ids:d.ids,message:h.message,meta:d.meta||null})}).catch(function(h){v(l.dom,"ln-couchdb-connector:error",{action:"bulk-delete",error:h.message,status:h.status||0,ids:d.ids,meta:d.meta||null})})}},l.dom.addEventListener("ln-couchdb-connector:request-sync",l._handlers.sync),l.dom.addEventListener("ln-couchdb-connector:request-create",l._handlers.create),l.dom.addEventListener("ln-couchdb-connector:request-update",l._handlers.update),l.dom.addEventListener("ln-couchdb-connector:request-delete",l._handlers.delete),l.dom.addEventListener("ln-couchdb-connector:request-bulk-delete",l._handlers.bulkDelete)}a.prototype.destroy=function(){if(!this.dom[t])return;const l=this;l._deltaController&&(l._deltaController.abort(),l._deltaController=null),l._handlers&&(l.dom.removeEventListener("ln-couchdb-connector:request-sync",l._handlers.sync),l.dom.removeEventListener("ln-couchdb-connector:request-create",l._handlers.create),l.dom.removeEventListener("ln-couchdb-connector:request-update",l._handlers.update),l.dom.removeEventListener("ln-couchdb-connector:request-delete",l._handlers.delete),l.dom.removeEventListener("ln-couchdb-connector:request-bulk-delete",l._handlers.bulkDelete),l._handlers=null),delete this.dom[t],delete this.dom[o]},ie(e,t,a,"ln-couchdb-connector",{attributes:s})})()})();