@livenetworks/ashlar 2.0.10 → 2.1.0
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.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- package/components/ln-ajax/src/ln-ajax.js +15 -26
- package/components/ln-api-connector/ln-api-connector.js +1 -1
- package/components/ln-api-queue/ln-api-queue.js +1 -1
- package/components/ln-autoresize/ln-autoresize.js +1 -1
- package/components/ln-autosave/ln-autosave.js +1 -1
- package/components/ln-chart/ln-chart.js +1 -1
- package/components/ln-circular-progress/ln-circular-progress.js +1 -1
- package/components/ln-confirm/ln-confirm.js +1 -1
- package/components/ln-core/helpers.js +1 -1
- package/components/ln-core/index.js +1 -1
- package/components/ln-core/lifecycle.js +97 -40
- package/components/ln-couchdb-connector/ln-couchdb-connector.js +1 -1
- package/components/ln-data-coordinator/ln-data-coordinator.js +1 -1
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-external-links/src/ln-external-links.js +9 -21
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-icon/src/ln-icon.js +14 -16
- package/components/ln-include/ln-include.js +1 -1
- package/components/ln-key/ln-key.js +1 -1
- package/components/ln-link/ln-link.js +1 -1
- package/components/ln-link/src/ln-link.js +16 -26
- package/components/ln-list/ln-list.js +1 -1
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-nav/src/ln-nav.js +5 -4
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-progress/src/ln-progress.js +9 -21
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -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 N(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!N(r))return}e.apply(console,t)}}function A(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function se(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function T(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){T(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ae(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ce(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let c=0;c<s.length;c++){const l=s[c];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let c=0;c<s.length;c++){const l=s[c];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&i[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let d=0;d<l.options.length;d++)l.options[d].selected&&o[l.name].push(l.options[d].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const d=Number(l.value);o[l.name]=l.value===""||isNaN(d)?null:d}else o[l.name]=l.value}return o}function ue(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function de(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const c=i.getAttribute("data-ln-fill-as")||i.name;if(!c||!(c in t))continue;const l=t[c];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(o[i.name]>1){const d=String(l).split(",").map(function(m){return m.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=ue(l);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let d=0;d<i.options.length;d++)i.options[d].selected=l.indexOf(i.options[d].value)!==-1;r.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=de,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=ae);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,T(function(){new MutationObserver(function(){A(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function pe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function be(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=pe,window.lnCore.getLocaleFallback=be,window.lnCore.ensureLocaleObserver=we);const M={};function j(e,t){M[e]||(M[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=M[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function me(e,t,n){if(e){const r=e.querySelector('[data-ln-template="'+t+'"]');if(r)return r.content.cloneNode(!0)}return j(t,n)}function P(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const c=n[i],l=c.getAttribute("data-ln-field");t[l]!=null&&(c.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const c=r[i],l=c.getAttribute("data-ln-attr").split(",");for(let d=0;d<l.length;d++){const m=l[d].trim().split(":");if(m.length!==2)continue;const b=m[0].trim(),v=m[1].trim();t[v]!=null&&c.setAttribute(b,t[v])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const c=o[i],l=c.getAttribute("data-ln-show");l in t&&c.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const c=s[i],l=c.getAttribute("data-ln-class").split(",");for(let d=0;d<l.length;d++){const m=l[d].trim().split(":");if(m.length!==2)continue;const b=m[0].trim(),v=m[1].trim();v in t&&c.classList.toggle(b,!!t[v])}}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 n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)P(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function U(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],c=i.attributes;for(let l=0;l<c.length;l++){const d=c[l];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Ce(e,t,n,r,o,s){const i={};for(let l=0;l<e.children.length;l++){const d=e.children[l],m=d.getAttribute("data-ln-render-key");m&&(i[m]=d)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const d=t[l],m=String(r(d));let b=i[m];if(b)o(b,d,l);else{const v=j(n,s);if(!v||(U(v,d),b=v.firstElementChild,!b))continue;b.setAttribute("data-ln-render-key",m),o(b,d,l)}c.appendChild(b)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=U,window.lnCore.fill=P,window.lnCore.lnFill=ge,window.lnCore.renderList=Ce);function D(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function W(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function K(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function V(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const I=new Map;function Q(e,t){const n=(e?e.join("|"):"")+"::"+t;if(I.has(n))return I.get(n);const r=new Set(e||[]),o=function(s,i){const c=s.getAttribute(i);return c!==null&&r.has(c)?c:t};return I.set(n,o),o}function z(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function J(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function G(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const c=l=>{o?console.warn(l,o):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(c(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(c(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return c(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function _e(e,t,n){for(const r in n){const[o,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function ye(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=Q(r.values,r.fallback);break;case"integer":o=W;break;case"float":o=z;break;case"boolean":o=K;break;case"list":o=V;break;case"json":o=J;break;case"string":default:o=D;break}o||(o=D),t[r.prop]=[o,n,r.fallback]}return t}function ve(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function xe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=_e,window.lnCore.attrSpec=ye,window.lnCore.attrStr=D,window.lnCore.attrInt=W,window.lnCore.attrBool=K,window.lnCore.attrList=V,window.lnCore.attrEnum=Q,window.lnCore.attrFloat=z,window.lnCore.attrJson=J);function B(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const c of i)if(!c[n]){window.lnCore._persistSink&&c.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(c,t);try{c[n]=new r(c)}catch(l){console.error("["+n+"] init failed",c,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ke(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 X(){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 Se(e){const t=X(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=xe(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function Y(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Le(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=X(),o=r.byAttr.get(n);if(R()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&N(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let c=0;c<s.length;c++)G(s[c].spec,i,n,s[c].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&Y(s,t,n,e.oldValue),r.reactiveWildcard.length&&Y(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const i=o[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(B(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function Te(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Le(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function Z(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ee(e){const t=Z();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,s=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o];B(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o],i=s.query,c=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&c.push(r);for(let l=0;l<c.length;l++){const d=c[l];if(!document.contains(d)){const m=d[s.attribute];if(m&&typeof m.destroy=="function")try{m.destroy()}catch(b){console.error("["+s.attribute+"] destroy failed",d,b)}delete d[s.attribute]}}}}}}function Oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,T(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Ee(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ee(e,t,n,r,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,l=o.onInit||null,d=o.onAttrChange||null,m=o.effects||null,b=o.attributes||null,v=b?ve(b):m,F=b?new Set(Object.keys(b)):null,E=o.persist||null;function k(h){const g=h||document.body;if(B(g,e,t,n),b&&R())for(const p in b){const _=b[p],w=Array.from(g.querySelectorAll("["+p+"]"));g.matches&&g.matches("["+p+"]")&&w.push(g);for(let C=0;C<w.length;C++){const x=w[C];N(x)&&G(_,x.getAttribute(p),p,r,x)}}l&&l(g)}const S=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let g;for(;(g=h.exec(e))!==null;)S.push(g[1])}else S.push(e);Se({selector:e,attribute:t,componentTag:r,attributes:b,ComponentFn:n,onInit:l,observed:S.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:F,persist:E}),Te();const a=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,u=o.subtreeQuery||(a?e:"["+e+"]");Z().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:u}),Oe(),window[t]=k,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ee);function f(){Ae()>0?ke(function(){k(document.body)}):k(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f(),k}function te(e){return(e||"").replace(/^#/,"")}function q(e){const t=e===void 0?location.hash:e,n={},r=te(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const c=i.indexOf(":"),l=c>-1?i.slice(0,c):i,d=c>-1?i.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(d)}catch{n[l]=d}}return n}function Ne(e){if(!e)return null;const t=q();return e in t?t[e]:null}function Me(e,t){if(!e)return;const n=q();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");te(location.hash)!==o&&(location.hash=o)}function De(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ie(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function Be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function qe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Re(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=q,window.lnCore.hashGet=Ne,window.lnCore.hashSet=Me,window.lnCore.hashLinkClick=De,window.lnCore.resolveHashNamespace=Ie,window.lnCore.hashSortEncode=Be,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=Re);function He(){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=He),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const n={"data-ln-editor":{type:"marker",description:"Mounts rich text editor instance on container"},"data-ln-editor-action":{type:"enum",values:["bold","italic","underline","strikethrough","heading-2","heading-3","heading-4","blockquote","code","paragraph","ordered-list","unordered-list","link","unlink","clear","confirm-link","cancel-link"],description:"Rich text toolbar formatting action"},"data-ln-editor-source":{type:"string",description:"Selector or ID of backing textarea synchronized with editor content"}},r={P:!0,BR:!0,STRONG:!0,B:!0,EM:!0,I:!0,U:!0,S:!0,A:!0,UL:!0,OL:!0,LI:!0,H2:!0,H3:!0,H4:!0,BLOCKQUOTE:!0,PRE:!0,CODE:!0,DIV:!0},o={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},s={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},i={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let c=0;function l(a){return!!(o[a]||s[a]||i[a]||a==="link")}function d(a){this.dom=a;const u=this;if(this._textarea=a.querySelector("textarea"),!this._textarea)return console.warn("[ln-editor] No <textarea> found inside",a),this;const f=this._textarea.getAttribute("placeholder")||"";this._textarea.setAttribute("data-ln-editor-source",""),this._surface=document.createElement("div"),this._surface.className="ln-editor__surface",this._surface.setAttribute("contenteditable","true"),this._surface.setAttribute("role","textbox"),this._surface.setAttribute("aria-multiline","true"),f&&this._surface.setAttribute("data-placeholder",f);const h=this._textarea.id;if(h){const w=a.querySelector('label[for="'+h+'"]');w&&(w.id||(w.id=h+"-label"),this._surface.setAttribute("aria-labelledby",w.id))}this._surface.id=h?h+"-surface":"ln-editor-surface-"+ ++c;const g=this._textarea.value.trim();g&&(this._surface.innerHTML=g);const p=a.querySelector('[role="toolbar"]');if(p&&p.nextSibling?a.insertBefore(this._surface,p.nextSibling):a.appendChild(this._surface),p){p.setAttribute("aria-controls",this._surface.id);const w=p.querySelectorAll("[data-ln-editor-action]");for(let C=0;C<w.length;C++){const x=w[C].getAttribute("data-ln-editor-action");l(x)&&w[C].setAttribute("aria-pressed","false")}}this._onInput=function(){u._syncToTextarea(),A(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom})},this._onMousedownToolbar=function(w){w.target.closest("[data-ln-editor-action]")&&w.preventDefault()},this._onClickToolbar=function(w){const C=w.target.closest("[data-ln-editor-action]");if(!C)return;const x=C.getAttribute("data-ln-editor-action");u._execAction(x)},this._onPaste=function(w){v(u,w)},this._onKeydown=function(w){k(u,w)},this._onSelectionChange=function(){document.contains(u._surface)&&u._updateActiveStates()},this._onFocus=function(){A(u.dom,"ln-editor:focus",{target:u.dom})},this._onBlur=function(){u._syncToTextarea(),A(u.dom,"ln-editor:blur",{target:u.dom})},this._onTextareaInput=function(){u._surface.innerHTML!==u._textarea.value&&(u._surface.innerHTML=u._textarea.value,A(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom}))},this._surface.addEventListener("input",this._onInput),this._surface.addEventListener("paste",this._onPaste),this._surface.addEventListener("keydown",this._onKeydown),this._surface.addEventListener("focus",this._onFocus),this._surface.addEventListener("blur",this._onBlur),this._textarea.addEventListener("input",this._onTextareaInput),p&&(p.addEventListener("mousedown",this._onMousedownToolbar),p.addEventListener("click",this._onClickToolbar)),document.addEventListener("selectionchange",this._onSelectionChange),this._onSetContent=function(w){const C=w.detail&&w.detail.html;C!==void 0&&(u._surface.innerHTML=C,u._syncToTextarea(),A(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom}))},a.addEventListener("ln-editor:set-content",this._onSetContent);const _=this._textarea.form;return _&&(this._onFormReset=function(){setTimeout(function(){u._surface.innerHTML=u._textarea.value,A(a,"ln-editor:changed",{html:u._textarea.value,target:a})},0)},_.addEventListener("reset",this._onFormReset)),this}d.prototype._syncToTextarea=function(){this._textarea&&(this._textarea.value=this._surface.innerHTML)},d.prototype._execAction=function(a){if(!(!a||se(this.dom,"ln-editor:before-change",{action:a,target:this.dom}).defaultPrevented)){if(this._surface.focus(),o[a])document.execCommand(o[a],!1,null);else if(s[a]){const f=s[a],h=m(this._surface);h&&h.toLowerCase()===f?document.execCommand("formatBlock",!1,"<p>"):document.execCommand("formatBlock",!1,"<"+f+">")}else i[a]?document.execCommand(i[a],!1,null):a==="link"?S(this):a==="unlink"?document.execCommand("unlink",!1,null):a==="clear"&&(document.execCommand("removeFormat",!1,null),document.execCommand("formatBlock",!1,"<p>"));this._syncToTextarea(),this._updateActiveStates()}},d.prototype._updateActiveStates=function(){const a=this.dom.querySelector('[role="toolbar"]');if(!a)return;const u=window.getSelection();if(!u||u.rangeCount===0)return;const f=u.anchorNode;if(!f||!this._surface.contains(f))return;const h=a.querySelectorAll("[data-ln-editor-action]");for(let g=0;g<h.length;g++){const p=h[g],_=p.getAttribute("data-ln-editor-action");let w=!1;if(o[_])try{w=document.queryCommandState(o[_])}catch{}else if(s[_]){const C=m(this._surface);w=C&&C.toLowerCase()===s[_]}else if(i[_])try{w=document.queryCommandState(i[_])}catch{}else _==="link"&&(w=!!b(u.anchorNode,"A",this._surface));l(_)&&p.setAttribute("aria-pressed",String(w)),w?p.classList.add("ln-editor-active"):p.classList.remove("ln-editor-active")}},d.prototype.getHTML=function(){return this._surface?this._surface.innerHTML:""},d.prototype.setHTML=function(a){this._surface&&(this._surface.innerHTML=a,this._syncToTextarea(),A(this.dom,"ln-editor:changed",{html:this._textarea.value,target:this.dom}))},d.prototype.destroy=function(){if(!this.dom[t])return;this._surface&&(this._surface.removeEventListener("input",this._onInput),this._surface.removeEventListener("paste",this._onPaste),this._surface.removeEventListener("keydown",this._onKeydown),this._surface.removeEventListener("focus",this._onFocus),this._surface.removeEventListener("blur",this._onBlur),this._surface.remove());const a=this.dom.querySelector('[role="toolbar"]');a&&(a.removeEventListener("mousedown",this._onMousedownToolbar),a.removeEventListener("click",this._onClickToolbar)),document.removeEventListener("selectionchange",this._onSelectionChange),this.dom.removeEventListener("ln-editor:set-content",this._onSetContent);const u=this._textarea?this._textarea.form:null;if(u&&this._onFormReset&&u.removeEventListener("reset",this._onFormReset),this._textarea&&(this._onTextareaInput&&this._textarea.removeEventListener("input",this._onTextareaInput),this._textarea.removeAttribute("data-ln-editor-source")),this._closeLinkPopover)this._closeLinkPopover();else{const f=this.dom.querySelector(".ln-editor__link-popover");f&&f.remove()}delete this.dom[t]};function m(a){const u=window.getSelection();if(!u||u.rangeCount===0)return null;let f=u.anchorNode;if(!f)return null;for(;f&&f!==a;){if(f.nodeType===1){const h=f.tagName;if(h==="H2"||h==="H3"||h==="H4"||h==="BLOCKQUOTE"||h==="PRE"||h==="P")return h}f=f.parentNode}return null}function b(a,u,f){for(;a&&a!==f;){if(a.nodeType===1&&a.tagName===u)return a;a=a.parentNode}return null}function v(a,u){u.preventDefault();let f="";if(u.clipboardData&&(f=u.clipboardData.getData("text/html"),!f)){const g=u.clipboardData.getData("text/plain");g&&(f=g.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>"),f="<p>"+f+"</p>")}if(!f)return;const h=F(f);h&&document.execCommand("insertHTML",!1,h)}function F(a){const u=document.createElement("div");return u.innerHTML=a,E(u),u.innerHTML}function E(a){const u=Array.from(a.childNodes);for(let f=0;f<u.length;f++){const h=u[f];if(h.nodeType!==3){if(h.nodeType!==1){a.removeChild(h);continue}if(r[h.tagName]){const g=Array.from(h.attributes);for(let p=0;p<g.length;p++){const _=g[p].name;if(h.tagName==="A"&&_==="href"){const w=h.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(w)||h.removeAttribute("href")}else h.removeAttribute(_)}h.tagName==="A"&&h.setAttribute("rel","noopener noreferrer"),E(h)}else{for(;h.firstChild;)a.insertBefore(h.firstChild,h);a.removeChild(h)}}}}function k(a,u){if(!(u.ctrlKey||u.metaKey))return;let f=null;switch(u.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(u.preventDefault(),a._execAction(f))}function S(a){const u=window.getSelection();if(!u||u.rangeCount===0)return;const f=b(u.anchorNode,"A",a._surface),h=u.getRangeAt(0).cloneRange();a._closeLinkPopover&&a._closeLinkPopover();const g=me(a.dom,"ln-editor-link-popover","ln-editor");if(!g)return;const p=g.firstElementChild;if(!p)return;const _=p.querySelector('input[type="url"]'),w=p.querySelector('[data-ln-editor-action="confirm-link"]'),C=p.querySelector('[data-ln-editor-action="cancel-link"]');f&&(_.value=f.getAttribute("href")||"");const x=a.dom.querySelector('[role="toolbar"]');x?x.after(p):a.dom.insertBefore(p,a._surface),_.focus();function ne(){const y=window.getSelection();y.removeAllRanges(),y.addRange(h)}function O(){document.removeEventListener("mousedown",ie),a._closeLinkPopover=null,p.remove()}function re(){const y=_.value.trim();if(O(),ne(),a._surface.focus(),y)if(f)f.setAttribute("href",y),f.setAttribute("rel","noopener noreferrer"),a._syncToTextarea(),A(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom});else{document.execCommand("createLink",!1,y);const L=window.getSelection();if(L&&L.anchorNode){const le=b(L.anchorNode,"A",a._surface);le&&(le.setAttribute("rel","noopener noreferrer"),a._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function oe(){O(),ne(),a._surface.focus()}function $e(){O()}function ie(y){const L=a.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!p.contains(y.target)&&!L&&$e()}a._closeLinkPopover=O,w.addEventListener("click",re),C.addEventListener("click",oe),_.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),re()):y.key==="Escape"&&(y.preventDefault(),oe())}),document.addEventListener("mousedown",ie)}ee(e,t,d,"ln-editor",{attributes:n})})()})();
|
|
1
|
+
(function(){"use strict";function $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function N(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let n=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){n=t[l];break}if(!N(n))return}e.apply(console,t)}}function x(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 ue(e,t,r){const n=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,n);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});return e.dispatchEvent(l),l}function E(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){E(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function de(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function fe(e,t){const 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 d=0;d<o.options.length;d++)o.options[d].selected&&l[o.name].push(o.options[d].value)}else if(r&&o.type==="hidden")l[o.name]=o.value;else if(r&&(o.type==="number"||o.type==="range")){const d=Number(o.value);l[o.name]=o.value===""||isNaN(d)?null:d}else l[o.name]=o.value}return l}function he(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function we(e,t){const 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 d=String(o).split(",").map(function(C){return C.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=he(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 d=0;d<i.options.length;d++)i.options[d].selected=o.indexOf(i.options[d].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=we,window.lnCore.serializeForm=fe,window.lnCore.resolveFormMethod=de);const j={};function pe(e,t){j[e]=t}function be(e){return j[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=pe,window.lnCore.getDataMapper=be);function me(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,E(function(){new MutationObserver(function(){x(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function ge(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];P[r]=t}function Ce(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return P[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ge,window.lnCore.getLocaleFallback=Ce,window.lnCore.ensureLocaleObserver=me);const q={};function U(e,t){q[e]||(q[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=q[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function _e(e,t,r){if(e){const n=e.querySelector('[data-ln-template="'+t+'"]');if(n)return n.content.cloneNode(!0)}return U(t,r)}function W(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 d=0;d<o.length;d++){const C=o[d].trim().split(":");if(C.length!==2)continue;const m=C[0].trim(),v=C[1].trim();t[v]!=null&&c.setAttribute(m,t[v])}}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 d=0;d<o.length;d++){const C=o[d].trim().split(":");if(C.length!==2)continue;const m=C[0].trim(),v=C[1].trim();v in t&&c.classList.toggle(m,!!t[v])}}return e}function ye(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const 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)W(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function K(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const 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 d=c[o];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,n))}}return e}function ve(e,t,r,n,l,s){const i={};for(let o=0;o<e.children.length;o++){const d=e.children[o],C=d.getAttribute("data-ln-render-key");C&&(i[C]=d)}const c=document.createDocumentFragment();for(let o=0;o<t.length;o++){const d=t[o],C=String(n(d));let m=i[C];if(m)l(m,d,o);else{const v=U(r,s);if(!v||(K(v,d),m=v.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",C),l(m,d,o)}c.appendChild(m)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=K,window.lnCore.fill=W,window.lnCore.lnFill=ye,window.lnCore.renderList=ve);function M(e,t,r){const n=e.getAttribute(t);return n===null?r:n}function V(e,t,r){const n=parseInt(e.getAttribute(t),10);return isNaN(n)?r:n}function Q(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 z(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const I=new Map;function J(e,t){const r=(e?e.join("|"):"")+"::"+t;if(I.has(r))return I.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 I.set(r,l),l}function G(e,t,r){const n=parseFloat(e.getAttribute(t));return isNaN(n)?r:n}function X(e,t,r){const n=e.getAttribute(t);if(!n)return r;try{return JSON.parse(n)}catch{return r}}function Y(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 Ae(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 xe(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=J(n.values,n.fallback);break;case"integer":l=V;break;case"float":l=G;break;case"boolean":l=Q;break;case"list":l=z;break;case"json":l=X;break;case"string":default:l=M;break}l||(l=M),t[n.prop]=[l,r,n.fallback]}return t}function ke(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 Se(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Ae,window.lnCore.attrSpec=xe,window.lnCore.attrStr=M,window.lnCore.attrInt=V,window.lnCore.attrBool=Q,window.lnCore.attrList=z,window.lnCore.attrEnum=J,window.lnCore.attrFloat=G,window.lnCore.attrJson=X);function S(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function Z(e,t,r,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)&&S(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let o=0;o<c.length;o++)S(c[o],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Le(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Te(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ee(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ee(e){const t=ee(),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=Se(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 te(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 Oe(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,n=ee(),l=n.byAttr.get(t),s=$()&&n.byDeclaredAttr&&n.byDeclaredAttr.has(t);if(!r&&!l&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&N(i)){const c=n.byDeclaredAttr.get(t),o=i.getAttribute(t);for(let d=0;d<c.length;d++)Y(c[d].spec,o,t,c[d].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&&te(c,i,t,e.oldValue),n.reactiveWildcard.length&&te(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):(Z(i,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(i))}}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,E(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Oe(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 B(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function F(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 Ne(e){const t=B();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)&&S(n,i);else if(n.matches&&n.matches(i.query)&&S(n,i),n.querySelectorAll){const c=n.querySelectorAll(i.query);for(let o=0;o<c.length;o++)S(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)&&F(n,i);else if(n.matches&&n.matches(c)&&F(n,i),n.querySelectorAll){const o=n.querySelectorAll(c);for(let d=0;d<o.length;d++)F(o[d],i)}}}}}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,E(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const n=t[r];if(n.type==="childList")try{Ne(n)}catch(l){console.error("[ln-core] lifecycle handler failed",n.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function qe(e){B().push(e),ne()}function re(e,t,r,n,l={}){const s=l.extraAttributes||[],i=l.onAttributeChange||null,c=l.onSubtreeChange||null,o=l.onInit||null,d=l.onAttrChange||null,C=l.effects||null,m=l.attributes||null,v=m?ke(m):C,H=m?new Set(Object.keys(m)):null,O=l.persist||null;function k(h){const b=h||document.body;if(Z(b,e,t,r),m&&$())for(const p in m){const _=m[p],w=Array.from(b.querySelectorAll("["+p+"]"));b.matches&&b.matches("["+p+"]")&&w.push(b);for(let g=0;g<w.length;g++){const A=w[g];N(A)&&Y(_,A.getAttribute(p),p,n,A)}}o&&o(b)}const L=[];if(e.indexOf("[")!==-1){const h=/\[([\w-]+)/g;let b;for(;(b=h.exec(e))!==null;)L.push(b[1])}else L.push(e);Ee({selector:e,attribute:t,componentTag:n,attributes:m,ComponentFn:r,onInit:o,observed:L.concat(s),onAttributeChange:i,onAttrChange:d,effects:v,declared:H,persist:O}),De();const a=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,u=l.subtreeQuery||(a?e:"["+e+"]");B().push({selector:e,attribute:t,ComponentFn:r,onInit:o,onSubtreeChange:c,query:u}),ne(),window[t]=k,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=re,window.lnCore.observeLifecycle=qe);function f(){Le()>0?Te(function(){k(document.body)}):k(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f(),k}function oe(e){return(e||"").replace(/^#/,"")}function R(e){const t=e===void 0?location.hash:e,r={},n=oe(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,d=c>-1?i.slice(c+1):"";if(o)try{r[o]=decodeURIComponent(d)}catch{r[o]=d}}return r}function Me(e){if(!e)return null;const t=R();return e in t?t[e]:null}function Ie(e,t){if(!e)return;const r=R();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");oe(location.hash)!==l&&(location.hash=l)}function Be(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Fe(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const 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 Re(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function He(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function $e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function je(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const 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=R,window.lnCore.hashGet=Me,window.lnCore.hashSet=Ie,window.lnCore.hashLinkClick=Be,window.lnCore.resolveHashNamespace=Fe,window.lnCore.hashSortEncode=Re,window.lnCore.hashSortDecode=He,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=je);function Pe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Pe),(function(){const e="data-ln-editor",t="lnEditor";if(window[t]!==void 0)return;const r={"data-ln-editor":{type:"marker",description:"Mounts rich text editor instance on container"},"data-ln-editor-action":{type:"enum",values:["bold","italic","underline","strikethrough","heading-2","heading-3","heading-4","blockquote","code","paragraph","ordered-list","unordered-list","link","unlink","clear","confirm-link","cancel-link"],description:"Rich text toolbar formatting action"},"data-ln-editor-source":{type:"string",description:"Selector or ID of backing textarea synchronized with editor content"}},n={P:!0,BR:!0,STRONG:!0,B:!0,EM:!0,I:!0,U:!0,S:!0,A:!0,UL:!0,OL:!0,LI:!0,H2:!0,H3:!0,H4:!0,BLOCKQUOTE:!0,PRE:!0,CODE:!0,DIV:!0},l={bold:"bold",italic:"italic",underline:"underline",strikethrough:"strikeThrough"},s={"heading-2":"h2","heading-3":"h3","heading-4":"h4",blockquote:"blockquote",code:"pre",paragraph:"p"},i={"ordered-list":"insertOrderedList","unordered-list":"insertUnorderedList"};let c=0;function o(a){return!!(l[a]||s[a]||i[a]||a==="link")}function d(a){this.dom=a;const u=this;if(this._textarea=a.querySelector("textarea"),!this._textarea)return console.warn("[ln-editor] No <textarea> found inside",a),this;const f=this._textarea.getAttribute("placeholder")||"";this._textarea.setAttribute("data-ln-editor-source",""),this._surface=document.createElement("div"),this._surface.className="ln-editor__surface",this._surface.setAttribute("contenteditable","true"),this._surface.setAttribute("role","textbox"),this._surface.setAttribute("aria-multiline","true"),f&&this._surface.setAttribute("data-placeholder",f);const h=this._textarea.id;if(h){const w=a.querySelector('label[for="'+h+'"]');w&&(w.id||(w.id=h+"-label"),this._surface.setAttribute("aria-labelledby",w.id))}this._surface.id=h?h+"-surface":"ln-editor-surface-"+ ++c;const b=this._textarea.value.trim();b&&(this._surface.innerHTML=b);const p=a.querySelector('[role="toolbar"]');if(p&&p.nextSibling?a.insertBefore(this._surface,p.nextSibling):a.appendChild(this._surface),p){p.setAttribute("aria-controls",this._surface.id);const w=p.querySelectorAll("[data-ln-editor-action]");for(let g=0;g<w.length;g++){const A=w[g].getAttribute("data-ln-editor-action");o(A)&&w[g].setAttribute("aria-pressed","false")}}this._onInput=function(){u._syncToTextarea(),x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom})},this._onMousedownToolbar=function(w){w.target.closest("[data-ln-editor-action]")&&w.preventDefault()},this._onClickToolbar=function(w){const g=w.target.closest("[data-ln-editor-action]");if(!g)return;const A=g.getAttribute("data-ln-editor-action");u._execAction(A)},this._onPaste=function(w){v(u,w)},this._onKeydown=function(w){k(u,w)},this._onSelectionChange=function(){document.contains(u._surface)&&u._updateActiveStates()},this._onFocus=function(){x(u.dom,"ln-editor:focus",{target:u.dom})},this._onBlur=function(){u._syncToTextarea(),x(u.dom,"ln-editor:blur",{target:u.dom})},this._onTextareaInput=function(){u._surface.innerHTML!==u._textarea.value&&(u._surface.innerHTML=u._textarea.value,x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom}))},this._surface.addEventListener("input",this._onInput),this._surface.addEventListener("paste",this._onPaste),this._surface.addEventListener("keydown",this._onKeydown),this._surface.addEventListener("focus",this._onFocus),this._surface.addEventListener("blur",this._onBlur),this._textarea.addEventListener("input",this._onTextareaInput),p&&(p.addEventListener("mousedown",this._onMousedownToolbar),p.addEventListener("click",this._onClickToolbar)),document.addEventListener("selectionchange",this._onSelectionChange),this._onSetContent=function(w){const g=w.detail&&w.detail.html;g!==void 0&&(u._surface.innerHTML=g,u._syncToTextarea(),x(u.dom,"ln-editor:changed",{html:u._textarea.value,target:u.dom}))},a.addEventListener("ln-editor:set-content",this._onSetContent);const _=this._textarea.form;return _&&(this._onFormReset=function(){setTimeout(function(){u._surface.innerHTML=u._textarea.value,x(a,"ln-editor:changed",{html:u._textarea.value,target:a})},0)},_.addEventListener("reset",this._onFormReset)),this}d.prototype._syncToTextarea=function(){this._textarea&&(this._textarea.value=this._surface.innerHTML)},d.prototype._execAction=function(a){if(!(!a||ue(this.dom,"ln-editor:before-change",{action:a,target:this.dom}).defaultPrevented)){if(this._surface.focus(),l[a])document.execCommand(l[a],!1,null);else if(s[a]){const f=s[a],h=C(this._surface);h&&h.toLowerCase()===f?document.execCommand("formatBlock",!1,"<p>"):document.execCommand("formatBlock",!1,"<"+f+">")}else i[a]?document.execCommand(i[a],!1,null):a==="link"?L(this):a==="unlink"?document.execCommand("unlink",!1,null):a==="clear"&&(document.execCommand("removeFormat",!1,null),document.execCommand("formatBlock",!1,"<p>"));this._syncToTextarea(),this._updateActiveStates()}},d.prototype._updateActiveStates=function(){const a=this.dom.querySelector('[role="toolbar"]');if(!a)return;const u=window.getSelection();if(!u||u.rangeCount===0)return;const f=u.anchorNode;if(!f||!this._surface.contains(f))return;const h=a.querySelectorAll("[data-ln-editor-action]");for(let b=0;b<h.length;b++){const p=h[b],_=p.getAttribute("data-ln-editor-action");let w=!1;if(l[_])try{w=document.queryCommandState(l[_])}catch{}else if(s[_]){const g=C(this._surface);w=g&&g.toLowerCase()===s[_]}else if(i[_])try{w=document.queryCommandState(i[_])}catch{}else _==="link"&&(w=!!m(u.anchorNode,"A",this._surface));o(_)&&p.setAttribute("aria-pressed",String(w)),w?p.classList.add("ln-editor-active"):p.classList.remove("ln-editor-active")}},d.prototype.getHTML=function(){return this._surface?this._surface.innerHTML:""},d.prototype.setHTML=function(a){this._surface&&(this._surface.innerHTML=a,this._syncToTextarea(),x(this.dom,"ln-editor:changed",{html:this._textarea.value,target:this.dom}))},d.prototype.destroy=function(){if(!this.dom[t])return;this._surface&&(this._surface.removeEventListener("input",this._onInput),this._surface.removeEventListener("paste",this._onPaste),this._surface.removeEventListener("keydown",this._onKeydown),this._surface.removeEventListener("focus",this._onFocus),this._surface.removeEventListener("blur",this._onBlur),this._surface.remove());const a=this.dom.querySelector('[role="toolbar"]');a&&(a.removeEventListener("mousedown",this._onMousedownToolbar),a.removeEventListener("click",this._onClickToolbar)),document.removeEventListener("selectionchange",this._onSelectionChange),this.dom.removeEventListener("ln-editor:set-content",this._onSetContent);const u=this._textarea?this._textarea.form:null;if(u&&this._onFormReset&&u.removeEventListener("reset",this._onFormReset),this._textarea&&(this._onTextareaInput&&this._textarea.removeEventListener("input",this._onTextareaInput),this._textarea.removeAttribute("data-ln-editor-source")),this._closeLinkPopover)this._closeLinkPopover();else{const f=this.dom.querySelector(".ln-editor__link-popover");f&&f.remove()}delete this.dom[t]};function C(a){const u=window.getSelection();if(!u||u.rangeCount===0)return null;let f=u.anchorNode;if(!f)return null;for(;f&&f!==a;){if(f.nodeType===1){const h=f.tagName;if(h==="H2"||h==="H3"||h==="H4"||h==="BLOCKQUOTE"||h==="PRE"||h==="P")return h}f=f.parentNode}return null}function m(a,u,f){for(;a&&a!==f;){if(a.nodeType===1&&a.tagName===u)return a;a=a.parentNode}return null}function v(a,u){u.preventDefault();let f="";if(u.clipboardData&&(f=u.clipboardData.getData("text/html"),!f)){const b=u.clipboardData.getData("text/plain");b&&(f=b.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>"),f="<p>"+f+"</p>")}if(!f)return;const h=H(f);h&&document.execCommand("insertHTML",!1,h)}function H(a){const u=document.createElement("div");return u.innerHTML=a,O(u),u.innerHTML}function O(a){const u=Array.from(a.childNodes);for(let f=0;f<u.length;f++){const h=u[f];if(h.nodeType!==3){if(h.nodeType!==1){a.removeChild(h);continue}if(n[h.tagName]){const b=Array.from(h.attributes);for(let p=0;p<b.length;p++){const _=b[p].name;if(h.tagName==="A"&&_==="href"){const w=h.getAttribute("href")||"";/^(https?:|mailto:|\/|#)/.test(w)||h.removeAttribute("href")}else h.removeAttribute(_)}h.tagName==="A"&&h.setAttribute("rel","noopener noreferrer"),O(h)}else{for(;h.firstChild;)a.insertBefore(h.firstChild,h);a.removeChild(h)}}}}function k(a,u){if(!(u.ctrlKey||u.metaKey))return;let f=null;switch(u.key.toLowerCase()){case"b":f="bold";break;case"i":f="italic";break;case"u":f="underline";break;case"k":f="link";break}f&&(u.preventDefault(),a._execAction(f))}function L(a){const u=window.getSelection();if(!u||u.rangeCount===0)return;const f=m(u.anchorNode,"A",a._surface),h=u.getRangeAt(0).cloneRange();a._closeLinkPopover&&a._closeLinkPopover();const b=_e(a.dom,"ln-editor-link-popover","ln-editor");if(!b)return;const p=b.firstElementChild;if(!p)return;const _=p.querySelector('input[type="url"]'),w=p.querySelector('[data-ln-editor-action="confirm-link"]'),g=p.querySelector('[data-ln-editor-action="cancel-link"]');f&&(_.value=f.getAttribute("href")||"");const A=a.dom.querySelector('[role="toolbar"]');A?A.after(p):a.dom.insertBefore(p,a._surface),_.focus();function ie(){const y=window.getSelection();y.removeAllRanges(),y.addRange(h)}function D(){document.removeEventListener("mousedown",ae),a._closeLinkPopover=null,p.remove()}function le(){const y=_.value.trim();if(D(),ie(),a._surface.focus(),y)if(f)f.setAttribute("href",y),f.setAttribute("rel","noopener noreferrer"),a._syncToTextarea(),x(a.dom,"ln-editor:changed",{html:a._textarea.value,target:a.dom});else{document.execCommand("createLink",!1,y);const T=window.getSelection();if(T&&T.anchorNode){const ce=m(T.anchorNode,"A",a._surface);ce&&(ce.setAttribute("rel","noopener noreferrer"),a._syncToTextarea())}}else f&&document.execCommand("unlink",!1,null)}function se(){D(),ie(),a._surface.focus()}function Ue(){D()}function ae(y){const T=a.dom.contains(y.target)&&y.target.closest('[data-ln-editor-action="link"]');!p.contains(y.target)&&!T&&Ue()}a._closeLinkPopover=D,w.addEventListener("click",le),g.addEventListener("click",se),_.addEventListener("keydown",function(y){y.key==="Enter"?(y.preventDefault(),le()):y.key==="Escape"&&(y.preventDefault(),se())}),document.addEventListener("mousedown",ae)}re(e,t,d,"ln-editor",{attributes:r})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function I(){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 C(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){i=t[l];break}if(!C(i))return}e.apply(console,t)}}function p(e,t,r){const i=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function w(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function N(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function T(e,t){const r=!!(t&&t.typed),i=t&&t.exclude,l={},a=e.elements,o={};if(r)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(o[n.name]=(o[n.name]||0)+1)}for(let s=0;s<a.length;s++){const n=a[s];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(i&&n.matches&&n.matches(i)))if(n.type==="checkbox")r&&o[n.name]===1?l[n.name]=n.checked:(l[n.name]||(l[n.name]=[]),n.checked&&l[n.name].push(n.value));else if(n.type==="radio")n.checked&&(l[n.name]=n.value);else if(n.type==="select-multiple"){l[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&l[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")l[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);l[n.name]=n.value===""||isNaN(c)?null:c}else l[n.name]=n.value}return l}function M(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function B(e,t){const r=e.elements,i=[],l={};for(let a=0;a<r.length;a++){const o=r[a];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let a=0;a<r.length;a++){const o=r[a];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const s=o.getAttribute("data-ln-fill-as")||o.name;if(!s||!(s in t))continue;const n=t[s];if(o.type==="checkbox"){if(Array.isArray(n))o.checked=n.indexOf(o.value)!==-1;else if(l[o.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});o.checked=c.indexOf(o.value)!==-1}else o.checked=M(n);i.push(o)}else if(o.type==="radio")o.checked=o.value===String(n),i.push(o);else if(o.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<o.options.length;c++)o.options[c].selected=n.indexOf(o.options[c].value)!==-1;i.push(o)}else o.value=n,o.tagName==="SELECT"&&n!=null&&o.setAttribute("data-ln-value",n),i.push(o)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=B,window.lnCore.serializeForm=T,window.lnCore.resolveFormMethod=N);const y={};function R(e,t){y[e]=t}function j(e){return y[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=R,window.lnCore.getDataMapper=j);function q(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,w(function(){new MutationObserver(function(){p(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const x={};function W(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];x[r]=t}function V(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return x[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=W,window.lnCore.getLocaleFallback=V,window.lnCore.ensureLocaleObserver=q);const b={};function U(e,t){b[e]||(b[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=b[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function A(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let o=0;o<r.length;o++){const s=r[o],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<i.length;o++){const s=i[o],n=s.getAttribute("data-ln-attr").split(",");for(let c=0;c<n.length;c++){const u=n[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const s=l[o],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let o=0;o<a.length;o++){const s=a[o],n=s.getAttribute("data-ln-class").split(",");for(let c=0;c<n.length;c++){const u=n[c].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function H(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<r.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[i],t??null),r[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)A(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function k(e,t){if(!e||!t)return e;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;r.nextNode();){const a=r.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(o,s){return t[s]!==void 0?t[s]:""}))}const i=function(a,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const o=l[a],s=o.attributes;for(let n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&o.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function J(e,t,r,i,l,a){const o={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(o[u]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(i(c));let d=o[u];if(d)l(d,c,n);else{const f=U(r,a);if(!f||(k(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),l(d,c,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=k,window.lnCore.fill=A,window.lnCore.lnFill=H,window.lnCore.renderList=J);function h(e,t,r){const i=e.getAttribute(t);return i===null?r:i}function v(e,t,r){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?r:i}function _(e,t,r=!1){const i=e.getAttribute(t);if(i===null)return!!r;const l=i.trim().toLowerCase();return!(l==="false"||l==="0")}function S(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const m=new Map;function L(e,t){const r=(e?e.join("|"):"")+"::"+t;if(m.has(r))return m.get(r);const i=new Set(e||[]),l=function(a,o){const s=a.getAttribute(o);return s!==null&&i.has(s)?s:t};return m.set(r,l),l}function O(e,t,r){const i=parseFloat(e.getAttribute(t));return isNaN(i)?r:i}function $(e,t,r){const i=e.getAttribute(t);if(!i)return r;try{return JSON.parse(i)}catch{return r}}function K(e,t,r,i,l){if(!e||t===null)return!0;const a=i||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const s=n=>{l?console.warn(n,l):console.warn(n)};if(o==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function z(e,t,r){for(const i in r){const[l,a,o]=r[i];Object.defineProperty(e,i,{get:function(){return l(t,a,o)},enumerable:!0,configurable:!0})}return e}function G(e){const t={};for(const r in e){const i=e[r];if(!i||!i.prop)continue;let l=i.read;if(!l&&i.type)switch(i.type){case"enum":l=L(i.values,i.fallback);break;case"integer":l=v;break;case"float":l=O;break;case"boolean":l=_;break;case"list":l=S;break;case"json":l=$;break;case"string":default:l=h;break}l||(l=h),t[i.prop]=[l,r,i.fallback]}return t}function P(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=z,window.lnCore.attrSpec=G,window.lnCore.attrStr=h,window.lnCore.attrInt=v,window.lnCore.attrBool=_,window.lnCore.attrList=S,window.lnCore.attrEnum=L,window.lnCore.attrFloat=O,window.lnCore.attrJson=$);function Q(e,t,r,i){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o=Array.from(e.querySelectorAll(a));e.matches&&e.matches(a)&&o.push(e);for(const s of o)if(!s[r]){window.lnCore._persistSink&&s.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(s,t);try{s[r]=new i(s)}catch(n){console.error("["+r+"] init failed",s,n)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function E(){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 X(e){const t=E(),r=e.observed||[];for(let i=0;i<r.length;i++){const l=r[i];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const l=t.byDeclaredAttr.get(i);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=P(e);if(i===null)t.reactiveWildcard.push(e);else for(const l of i)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function D(e,t,r,i){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const o=a.effects&&a.effects[r];o?o(t,r,i):a.onAttrChange&&(!a.declared||a.declared.has(r))&&a.onAttrChange(t,r,i)}}function Y(e){const t=e.target,r=e.attributeName;if(e.oldValue===t.getAttribute(r))return;const i=E(),l=i.byAttr.get(r);if(I()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(r)&&C(t)){const a=i.byDeclaredAttr.get(r),o=t.getAttribute(r);for(let s=0;s<a.length;s++)K(a[s].spec,o,r,a[s].componentTag,t)}if(window.lnCore._debugSink&&(r.indexOf("data-ln-")===0||l)&&window.lnCore._debugSink("attr",r,t,{oldValue:e.oldValue,newValue:t.getAttribute(r)}),r.indexOf("data-ln-")===0){const a=i.byReactive.get(r);a&&D(a,t,r,e.oldValue),i.reactiveWildcard.length&&D(i.reactiveWildcard,t,r,e.oldValue)}if(l)for(let a=0;a<l.length;a++){const o=l[a];if(o.handler){o.handler(t,r,e.oldValue);continue}o.onAttributeChange&&t[o.attribute]?o.onAttributeChange(t,r):(Q(t,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(t))}}function Z(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,w(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{Y(t[r])}catch(i){console.error("[ln-core] mutation handler failed",t[r].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function ee(e,t){X({observed:e,handler:t}),Z()}function F(e){return(e||"").replace(/^#/,"")}function g(e){const t=e===void 0?location.hash:e,r={},i=F(t);if(!i)return r;const l=i.split("&");for(let a=0;a<l.length;a++){const o=l[a];if(!o)continue;const s=o.indexOf(":"),n=s>-1?o.slice(0,s):o,c=s>-1?o.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function te(e){if(!e)return null;const t=g();return e in t?t[e]:null}function ne(e,t){if(!e)return;const r=g();t==null?delete r[e]:r[e]=String(t);const l=Object.keys(r).map(function(a){const o=r[a];return o===""?a:a+":"+encodeURIComponent(o)}).join("&");F(location.hash)!==l&&(location.hash=l)}function re(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 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 ie(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function le(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function se(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function ae(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),i=e.slice(t+1),l=i?i.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:r,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=g,window.lnCore.hashGet=te,window.lnCore.hashSet=ne,window.lnCore.hashLinkClick=re,window.lnCore.resolveHashNamespace=oe,window.lnCore.hashSortEncode=ie,window.lnCore.hashSortDecode=le,window.lnCore.hashFilterEncode=se,window.lnCore.hashFilterDecode=ae);function ce(){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=ce),(function(){const e="lnExternalLinks";if(window[e]!==void 0)return;function t(s){return s.hostname&&s.hostname!==window.location.hostname}function r(s){if(s.getAttribute("data-ln-external-link")==="processed"||!t(s))return;s.target="_blank";const n=(s.rel||"").split(/\s+/).filter(Boolean);n.includes("noopener")||n.push("noopener"),n.includes("noreferrer")||n.push("noreferrer"),s.rel=n.join(" ");const c=document.createElement("span");c.className="sr-only",c.textContent="(opens in new tab)",s.appendChild(c),s.setAttribute("data-ln-external-link","processed"),p(s,"ln-external-links:processed",{link:s,href:s.href})}function i(s){s=s||document.body;for(const n of s.querySelectorAll("a, area"))r(n)}function l(){w(function(){document.body.addEventListener("click",function(s){const n=s.target.closest("a, area");n&&n.getAttribute("data-ln-external-link")==="processed"&&p(n,"ln-external-links:clicked",{link:n,href:n.href,text:n.textContent||n.title||""})})},"ln-external-links")}function a(){w(function(){new MutationObserver(function(n){for(const c of n)if(c.type==="childList"){for(const u of c.addedNodes)if(u.nodeType===1&&(u.matches&&(u.matches("a")||u.matches("area"))&&r(u),u.querySelectorAll))for(const d of u.querySelectorAll("a, area"))r(d)}}).observe(document.body,{childList:!0,subtree:!0}),ee(["href"],function(n){n.matches&&(n.matches("a")||n.matches("area"))&&r(n)})},"ln-external-links")}function o(){l(),a(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){i()}):i()}window[e]={process:i},o()})()})();
|
|
1
|
+
(function(){"use strict";function T(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function A(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let s=1;s<t.length;s++)if(t[s]&&t[s].nodeType===1){r=t[s];break}if(!A(r))return}e.apply(console,t)}}function p(e,t,o){const r=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function w(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){w(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function M(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function B(e,t){const o=!!(t&&t.typed),r=t&&t.exclude,s={},c=e.elements,i={};if(o)for(let l=0;l<c.length;l++){const n=c[l];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let l=0;l<c.length;l++){const n=c[l];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(r&&n.matches&&n.matches(r)))if(n.type==="checkbox")o&&i[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 a=0;a<n.options.length;a++)n.options[a].selected&&s[n.name].push(n.options[a].value)}else if(o&&n.type==="hidden")s[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const a=Number(n.value);s[n.name]=n.value===""||isNaN(a)?null:a}else s[n.name]=n.value}return s}function R(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function j(e,t){const o=e.elements,r=[],s={};for(let c=0;c<o.length;c++){const i=o[c];i.name&&i.type==="checkbox"&&(s[i.name]=(s[i.name]||0)+1)}for(let c=0;c<o.length;c++){const i=o[c];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const l=i.getAttribute("data-ln-fill-as")||i.name;if(!l||!(l in t))continue;const n=t[l];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(s[i.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});i.checked=a.indexOf(i.value)!==-1}else i.checked=R(n);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),r.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;r.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=j,window.lnCore.serializeForm=B,window.lnCore.resolveFormMethod=M);const x={};function W(e,t){x[e]=t}function V(e){return x[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=W,window.lnCore.getDataMapper=V);function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,w(function(){new MutationObserver(function(){p(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const k={};function H(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];k[o]=t}function J(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return k[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=H,window.lnCore.getLocaleFallback=J,window.lnCore.ensureLocaleObserver=U);const b={};function K(e,t){b[e]||(b[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=b[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function v(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let i=0;i<o.length;i++){const l=o[i],n=l.getAttribute("data-ln-field");t[n]!=null&&(l.textContent=t[n])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const l=r[i],n=l.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&&l.setAttribute(d,t[f])}}const s=e.querySelectorAll("[data-ln-show]");for(let i=0;i<s.length;i++){const l=s[i],n=l.getAttribute("data-ln-show");n in t&&l.classList.toggle("hidden",!t[n])}const c=e.querySelectorAll("[data-ln-class]");for(let i=0;i<c.length;i++){const l=c[i],n=l.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&&l.classList.toggle(d,!!t[f])}}return e}function z(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<o.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[r],t??null),o[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)v(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function _(e,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(i,l){return t[l]!==void 0?t[l]:""}))}const r=function(c,i){return t[i]!==void 0?t[i]:""},s=Array.from(e.querySelectorAll("*"));e.nodeType===1&&s.push(e);for(let c=0;c<s.length;c++){const i=s[c],l=i.attributes;for(let n=0;n<l.length;n++){const a=l[n];a.value.indexOf("{{")!==-1&&i.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function G(e,t,o,r,s,c){const i={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(i[u]=a)}const l=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(r(a));let d=i[u];if(d)s(d,a,n);else{const f=K(o,c);if(!f||(_(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),s(d,a,n)}l.appendChild(d)}e.textContent="",e.appendChild(l)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=_,window.lnCore.fill=v,window.lnCore.lnFill=z,window.lnCore.renderList=G);function g(e,t,o){const r=e.getAttribute(t);return r===null?o:r}function S(e,t,o){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?o:r}function L(e,t,o=!1){const r=e.getAttribute(t);if(r===null)return!!o;const s=r.trim().toLowerCase();return!(s==="false"||s==="0")}function O(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const m=new Map;function E(e,t){const o=(e?e.join("|"):"")+"::"+t;if(m.has(o))return m.get(o);const r=new Set(e||[]),s=function(c,i){const l=c.getAttribute(i);return l!==null&&r.has(l)?l:t};return m.set(o,s),s}function D(e,t,o){const r=parseFloat(e.getAttribute(t));return isNaN(r)?o:r}function F(e,t,o){const r=e.getAttribute(t);if(!r)return o;try{return JSON.parse(r)}catch{return o}}function P(e,t,o,r,s){if(!e||t===null)return!0;const c=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const l=n=>{s?console.warn(n,s):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(l(`[${c}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(l(`[${c}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return l(`[${c}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(l(`[${c}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(l(`[${c}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(l(`[${c}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return l(`[${c}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,o){for(const r in o){const[s,c,i]=o[r];Object.defineProperty(e,r,{get:function(){return s(t,c,i)},enumerable:!0,configurable:!0})}return e}function X(e){const t={};for(const o in e){const r=e[o];if(!r||!r.prop)continue;let s=r.read;if(!s&&r.type)switch(r.type){case"enum":s=E(r.values,r.fallback);break;case"integer":s=S;break;case"float":s=D;break;case"boolean":s=L;break;case"list":s=O;break;case"json":s=F;break;case"string":default:s=g;break}s||(s=g),t[r.prop]=[s,o,r.fallback]}return t}function Y(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=Q,window.lnCore.attrSpec=X,window.lnCore.attrStr=g,window.lnCore.attrInt=S,window.lnCore.attrBool=L,window.lnCore.attrList=O,window.lnCore.attrEnum=E,window.lnCore.attrFloat=D,window.lnCore.attrJson=F);function h(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(o){console.error("["+t.attribute+"] init failed",e,o)}}}function Z(e,t,o,r){if(e.nodeType!==1)return;const c=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:o,ComponentFn:r};if(e.matches&&e.matches(c)&&h(e,i),e.querySelectorAll){const l=e.querySelectorAll(c);for(let n=0;n<l.length;n++)h(l[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function $(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ee(e){const t=$(),o=e.observed||[];for(let r=0;r<o.length;r++){const s=o[r];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 r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const s=t.byDeclaredAttr.get(r);s.some(c=>c.componentTag===e.componentTag)||s.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Y(e);if(r===null)t.reactiveWildcard.push(e);else for(const s of r)t.byReactive.has(s)||t.byReactive.set(s,[]),t.byReactive.get(s).push(e)}e.persist&&t.persist.push(e)}function q(e,t,o,r){for(let s=0;s<e.length;s++){const c=e[s];if(!t[c.attribute])continue;const i=c.effects&&c.effects[o];i?i(t,o,r):c.onAttrChange&&(!c.declared||c.declared.has(o))&&c.onAttrChange(t,o,r)}}function te(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,r=$(),s=r.byAttr.get(t),c=T()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!o&&!s&&!c)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(c&&A(i)){const l=r.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let a=0;a<l.length;a++)P(l[a].spec,n,t,l[a].componentTag,i)}if(window.lnCore._debugSink&&(o||s)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),o){const l=r.byReactive.get(t);l&&q(l,i,t,e.oldValue),r.reactiveWildcard.length&&q(r.reactiveWildcard,i,t,e.oldValue)}if(s)for(let l=0;l<s.length;l++){const n=s[l];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(Z(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,w(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{te(t[o])}catch(r){console.error("[ln-core] mutation handler failed",t[o].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function I(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function C(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function re(e){const t=I();if(t.length){if(e.target)for(let o=0;o<t.length;o++){const r=t[o];if(r.onSubtreeChange&&r.query){const s=r.query,c=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;c&&r.onSubtreeChange(c,e)}}for(let o=0;o<e.addedNodes.length;o++){const r=e.addedNodes[o];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let c=0;c<t.length;c++){const i=t[c];if(i.selector&&i.attribute&&i.ComponentFn){if(!s)r.matches&&r.matches(i.query)&&h(r,i);else if(r.matches&&r.matches(i.query)&&h(r,i),r.querySelectorAll){const l=r.querySelectorAll(i.query);for(let n=0;n<l.length;n++)h(l[n],i)}}i.onInit&&i.onInit(r)}}}for(let o=0;o<e.removedNodes.length;o++){const r=e.removedNodes[o];if(r.nodeType===1){const s=!!(r.firstElementChild||r.children&&r.children.length);for(let c=0;c<t.length;c++){const i=t[c],l=i.query;if(l){if(!s)r.matches&&r.matches(l)&&C(r,i);else if(r.matches&&r.matches(l)&&C(r,i),r.querySelectorAll){const n=r.querySelectorAll(l);for(let a=0;a<n.length;a++)C(n[a],i)}}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,w(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const r=t[o];if(r.type==="childList")try{re(r)}catch(s){console.error("[ln-core] lifecycle handler failed",r.target,s)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ie(e,t){ee({observed:e,handler:t}),ne()}function le(e){I().push(e),oe()}function N(e){return(e||"").replace(/^#/,"")}function y(e){const t=e===void 0?location.hash:e,o={},r=N(t);if(!r)return o;const s=r.split("&");for(let c=0;c<s.length;c++){const i=s[c];if(!i)continue;const l=i.indexOf(":"),n=l>-1?i.slice(0,l):i,a=l>-1?i.slice(l+1):"";if(n)try{o[n]=decodeURIComponent(a)}catch{o[n]=a}}return o}function se(e){if(!e)return null;const t=y();return e in t?t[e]:null}function ce(e,t){if(!e)return;const o=y();t==null?delete o[e]:o[e]=String(t);const s=Object.keys(o).map(function(c){const i=o[c];return i===""?c:c+":"+encodeURIComponent(i)}).join("&");N(location.hash)!==s&&(location.hash=s)}function ae(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function ue(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function de(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function fe(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function we(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function he(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),r=e.slice(t+1),s=r?r.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=y,window.lnCore.hashGet=se,window.lnCore.hashSet=ce,window.lnCore.hashLinkClick=ae,window.lnCore.resolveHashNamespace=ue,window.lnCore.hashSortEncode=de,window.lnCore.hashSortDecode=fe,window.lnCore.hashFilterEncode=we,window.lnCore.hashFilterDecode=he);function pe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=pe),(function(){const e="lnExternalLinks";if(window[e]!==void 0)return;function t(l){return l.hostname&&l.hostname!==window.location.hostname}function o(l){if(l.getAttribute("data-ln-external-link")==="processed"||!t(l))return;l.target="_blank";const n=(l.rel||"").split(/\s+/).filter(Boolean);n.includes("noopener")||n.push("noopener"),n.includes("noreferrer")||n.push("noreferrer"),l.rel=n.join(" ");const a=document.createElement("span");a.className="sr-only",a.textContent="(opens in new tab)",l.appendChild(a),l.setAttribute("data-ln-external-link","processed"),p(l,"ln-external-links:processed",{link:l,href:l.href})}function r(l){l=l||document.body;for(const n of l.querySelectorAll("a, area"))o(n)}function s(){w(function(){document.body.addEventListener("click",function(l){const n=l.target.closest("a, area");n&&n.getAttribute("data-ln-external-link")==="processed"&&p(n,"ln-external-links:clicked",{link:n,href:n.href,text:n.textContent||n.title||""})})},"ln-external-links")}function c(){w(function(){le({onInit:function(l){if(l.matches&&(l.matches("a")||l.matches("area"))&&o(l),l.querySelectorAll)for(const n of l.querySelectorAll("a, area"))o(n)}}),ie(["href"],function(l){l.matches&&(l.matches("a")||l.matches("area"))&&o(l)})},"ln-external-links")}function i(){s(),c(),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",function(){r()}):r()}window[e]={process:r},i()})()})();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dispatch, guardBody, observeAttributes } from '../../ln-core';
|
|
1
|
+
import { dispatch, guardBody, observeAttributes, observeLifecycle } from '../../ln-core';
|
|
2
2
|
|
|
3
3
|
(function() {
|
|
4
4
|
const DOM_ATTRIBUTE = 'lnExternalLinks';
|
|
@@ -64,31 +64,19 @@ import { dispatch, guardBody, observeAttributes } from '../../ln-core';
|
|
|
64
64
|
|
|
65
65
|
function _domObserver() {
|
|
66
66
|
guardBody(function() {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (node.querySelectorAll) {
|
|
77
|
-
for (const link of node.querySelectorAll('a, area')) {
|
|
78
|
-
_processLink(link);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
67
|
+
observeLifecycle({
|
|
68
|
+
onInit: function (node) {
|
|
69
|
+
if (node.matches && (node.matches('a') || node.matches('area'))) {
|
|
70
|
+
_processLink(node);
|
|
71
|
+
}
|
|
72
|
+
if (node.querySelectorAll) {
|
|
73
|
+
for (const link of node.querySelectorAll('a, area')) {
|
|
74
|
+
_processLink(link);
|
|
82
75
|
}
|
|
83
76
|
}
|
|
84
77
|
}
|
|
85
78
|
});
|
|
86
79
|
|
|
87
|
-
observer.observe(document.body, {
|
|
88
|
-
childList: true,
|
|
89
|
-
subtree: true
|
|
90
|
-
});
|
|
91
|
-
|
|
92
80
|
observeAttributes(['href'], function (el) {
|
|
93
81
|
if (el.matches && (el.matches('a') || el.matches('area'))) {
|
|
94
82
|
_processLink(el);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function U(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function D(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){r=t[o];break}if(!D(r))return}e.apply(console,t)}}function L(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function be(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(o),o}function q(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){q(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function K(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function ye(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function me(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,o={},s=e.elements,i={};if(n)for(let a=0;a<s.length;a++){const l=s[a];l.name&&l.type==="checkbox"&&!l.disabled&&(i[l.name]=(i[l.name]||0)+1)}for(let a=0;a<s.length;a++){const l=s[a];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")n&&i[l.name]===1?o[l.name]=l.checked:(o[l.name]||(o[l.name]=[]),l.checked&&o[l.name].push(l.value));else if(l.type==="radio")l.checked&&(o[l.name]=l.value);else if(l.type==="select-multiple"){o[l.name]=[];for(let f=0;f<l.options.length;f++)l.options[f].selected&&o[l.name].push(l.options[f].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const f=Number(l.value);o[l.name]=l.value===""||isNaN(f)?null:f}else o[l.name]=l.value}return o}function Ce(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function Ae(e,t){const n=e.elements,r=[],o={};for(let s=0;s<n.length;s++){const i=n[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const l=t[a];if(i.type==="checkbox"){if(Array.isArray(l))i.checked=l.indexOf(i.value)!==-1;else if(o[i.name]>1){const f=String(l).split(",").map(function(b){return b.trim()});i.checked=f.indexOf(i.value)!==-1}else i.checked=Ce(l);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(l),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(l))for(let f=0;f<i.options.length;f++)i.options[f].selected=l.indexOf(i.options[f].value)!==-1;r.push(i)}else i.value=l,i.tagName==="SELECT"&&l!=null&&i.setAttribute("data-ln-value",l),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=Ae,window.lnCore.serializeForm=me,window.lnCore.resolveFormMethod=ye);const Q={};function ve(e,t){Q[e]=t}function ke(e){return Q[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ve,window.lnCore.getDataMapper=ke);function _e(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,q(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function xe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];P[n]=t}function Se(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=xe,window.lnCore.getLocaleFallback=Se,window.lnCore.ensureLocaleObserver=_e);const N={};function Ie(e,t){N[e]||(N[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=N[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function J(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const a=n[i],l=a.getAttribute("data-ln-field");t[l]!=null&&(a.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const a=r[i],l=a.getAttribute("data-ln-attr").split(",");for(let f=0;f<l.length;f++){const b=l[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),A=b[1].trim();t[A]!=null&&a.setAttribute(m,t[A])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const a=o[i],l=a.getAttribute("data-ln-show");l in t&&a.classList.toggle("hidden",!t[l])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],l=a.getAttribute("data-ln-class").split(",");for(let f=0;f<l.length;f++){const b=l[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),A=b[1].trim();A in t&&a.classList.toggle(m,!!t[A])}}return e}function Ee(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)J(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function G(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,a){return t[a]!==void 0?t[a]:""}))}const r=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],a=i.attributes;for(let l=0;l<a.length;l++){const f=a[l];f.value.indexOf("{{")!==-1&&i.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Te(e,t,n,r,o,s){const i={};for(let l=0;l<e.children.length;l++){const f=e.children[l],b=f.getAttribute("data-ln-render-key");b&&(i[b]=f)}const a=document.createDocumentFragment();for(let l=0;l<t.length;l++){const f=t[l],b=String(r(f));let m=i[b];if(m)o(m,f,l);else{const A=Ie(n,s);if(!A||(G(A,f),m=A.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),o(m,f,l)}a.appendChild(m)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=G,window.lnCore.fill=J,window.lnCore.lnFill=Ee,window.lnCore.renderList=Te);function R(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function z(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function X(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function Y(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const B=new Map;function Z(e,t){const n=(e?e.join("|"):"")+"::"+t;if(B.has(n))return B.get(n);const r=new Set(e||[]),o=function(s,i){const a=s.getAttribute(i);return a!==null&&r.has(a)?a:t};return B.set(n,o),o}function ee(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function te(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function ne(e,t,n,r,o){if(!e||t===null)return!0;const s=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=l=>{o?console.warn(l,o):console.warn(l)};if(i==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const l=e.values||[];return l.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(a(`[${s}] Value ${l} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(a(`[${s}] Value ${l} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(l){return a(`[${s}] Invalid JSON for attribute "${n}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function re(e,t,n){for(const r in n){const[o,s,i]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function oe(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let o=r.read;if(!o&&r.type)switch(r.type){case"enum":o=Z(r.values,r.fallback);break;case"integer":o=z;break;case"float":o=ee;break;case"boolean":o=X;break;case"list":o=Y;break;case"json":o=te;break;case"string":default:o=R;break}o||(o=R),t[r.prop]=[o,n,r.fallback]}return t}function Le(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function qe(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=re,window.lnCore.attrSpec=oe,window.lnCore.attrStr=R,window.lnCore.attrInt=z,window.lnCore.attrBool=X,window.lnCore.attrList=Y,window.lnCore.attrEnum=Z,window.lnCore.attrFloat=ee,window.lnCore.attrJson=te);function M(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i=Array.from(e.querySelectorAll(s));e.matches&&e.matches(s)&&i.push(e);for(const a of i)if(!a[n]){window.lnCore._persistSink&&a.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(a,t);try{a[n]=new r(a)}catch(l){console.error("["+n+"] init failed",a,l)}}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Re(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function E(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ie(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Oe(e){const t=ie(),n=e.observed||[];for(let r=0;r<n.length;r++){const o=n[r];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const o=t.byDeclaredAttr.get(r);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=qe(e);if(r===null)t.reactiveWildcard.push(e);else for(const o of r)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function le(e,t,n,r){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[n];i?i(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Fe(e){const t=e.target,n=e.attributeName;if(e.oldValue===t.getAttribute(n))return;const r=ie(),o=r.byAttr.get(n);if(U()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(n)&&D(t)){const s=r.byDeclaredAttr.get(n),i=t.getAttribute(n);for(let a=0;a<s.length;a++)ne(s[a].spec,i,n,s[a].componentTag,t)}if(window.lnCore._debugSink&&(n.indexOf("data-ln-")===0||o)&&window.lnCore._debugSink("attr",n,t,{oldValue:e.oldValue,newValue:t.getAttribute(n)}),n.indexOf("data-ln-")===0){const s=r.byReactive.get(n);s&&le(s,t,n,e.oldValue),r.reactiveWildcard.length&&le(r.reactiveWildcard,t,n,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const i=o[s];if(i.handler){i.handler(t,n,e.oldValue);continue}i.onAttributeChange&&t[i.attribute]?i.onAttributeChange(t,n):(M(t,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(t))}}function De(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,q(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Fe(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function se(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function Ne(e){const t=se();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange){const o=r.query,s=e.target.nodeType===1?e.target.matches(o)?e.target:e.target.closest(o):e.target.parentElement?e.target.parentElement.closest(o):null;s&&r.onSubtreeChange(s,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o];M(r,s.selector,s.attribute,s.ComponentFn),s.onInit&&s.onInit(r)}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1)for(let o=0;o<t.length;o++){const s=t[o],i=s.query,a=Array.from(r.querySelectorAll(i));r.matches&&r.matches(i)&&a.push(r);for(let l=0;l<a.length;l++){const f=a[l];if(!document.contains(f)){const b=f[s.attribute];if(b&&typeof b.destroy=="function")try{b.destroy()}catch(m){console.error("["+s.attribute+"] destroy failed",f,m)}delete f[s.attribute]}}}}}}function Be(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,q(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Ne(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ae(e,t,n,r,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,a=o.onSubtreeChange||null,l=o.onInit||null,f=o.onAttrChange||null,b=o.effects||null,m=o.attributes||null,A=m?Le(m):b,v=m?new Set(Object.keys(m)):null,T=o.persist||null;function _(u){const d=u||document.body;if(M(d,e,t,n),m&&U())for(const c in m){const g=m[c],p=Array.from(d.querySelectorAll("["+c+"]"));d.matches&&d.matches("["+c+"]")&&p.push(d);for(let h=0;h<p.length;h++){const w=p[h];D(w)&&ne(g,w.getAttribute(c),c,r,w)}}l&&l(d)}const x=[];if(e.indexOf("[")!==-1){const u=/\[([\w-]+)/g;let d;for(;(d=u.exec(e))!==null;)x.push(d[1])}else x.push(e);Oe({selector:e,attribute:t,componentTag:r,attributes:m,ComponentFn:n,onInit:l,observed:x.concat(s),onAttributeChange:i,onAttrChange:f,effects:A,declared:v,persist:T}),De();const H=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,W=o.subtreeQuery||(H?e:"["+e+"]");se().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:a,query:W}),Be(),window[t]=_,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ae);function I(){Re()>0?E(function(){_(document.body)}):_(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I):I(),_}function ue(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function ce(e){return(e||"").replace(/^#/,"")}function $(e){const t=e===void 0?location.hash:e,n={},r=ce(t);if(!r)return n;const o=r.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const a=i.indexOf(":"),l=a>-1?i.slice(0,a):i,f=a>-1?i.slice(a+1):"";if(l)try{n[l]=decodeURIComponent(f)}catch{n[l]=f}}return n}function j(e){if(!e)return null;const t=$();return e in t?t[e]:null}function de(e,t){if(!e)return;const n=$();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const i=n[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");ce(location.hash)!==o&&(location.hash=o)}function Me(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function O(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function $e(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 fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function V(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=$,window.lnCore.hashGet=j,window.lnCore.hashSet=de,window.lnCore.hashLinkClick=Me,window.lnCore.resolveHashNamespace=O,window.lnCore.hashSortEncode=$e,window.lnCore.hashSortDecode=je,window.lnCore.hashFilterEncode=fe,window.lnCore.hashFilterDecode=V);function Ve(){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=Ve);function he(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let r=0;r<t.length;r++)if(String(t[r]).trim().toLowerCase()===n)return!0;return!1}function He(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function We(e,t,n){if(!t||typeof t!="object")return!0;const r=Object.keys(t);if(r.length===0)return!0;for(let o=0;o<r.length;o++){const s=t[r[o]];let i="";if(s.col!==null&&s.col!==void 0?i=e[s.col]||"":s.attr&&n&&typeof n.getAttribute=="function"&&(i=n.getAttribute(s.attr)||""),!he(i,s.values))return!1}return!0}function ge(e,t,n,r){if(r!=null&&!isNaN(r))return parseInt(r,10);if(t&&typeof t.getAttribute=="function"){const o=t.getAttribute("data-ln-filter-col");if(o!==null&&!isNaN(parseInt(o,10)))return parseInt(o,10);if(typeof t.closest=="function"){const s=t.closest("th");if(s&&typeof s.cellIndex=="number")return s.cellIndex;const i=t.closest("[data-ln-popover], [id]");if(i&&i.id){const a=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(a&&typeof a.querySelector=="function"){const l=a.querySelector('[data-ln-popover-for="'+i.id+'"]');if(l&&typeof l.closest=="function"){const f=l.closest("th");if(f&&typeof f.cellIndex=="number")return f.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const o=e.querySelectorAll("thead th, tr:first-child th"),s=String(n).trim().toLowerCase();for(let i=0;i<o.length;i++){const a=o[i],l=a.getAttribute("data-ln-table-filter-col")||a.getAttribute("data-ln-filter-col")||a.getAttribute("data-ln-filter-key")||a.getAttribute("data-ln-table-col")||a.getAttribute("data-ln-col")||a.getAttribute("data-ln-field");if(l&&l.trim().toLowerCase()===s)return typeof a.cellIndex=="number"?a.cellIndex:i}if(t){const i=t.closest?t.closest("[data-ln-popover], [id]"):null,a=i&&i.id||t.id||null;if(a)for(let l=0;l<o.length;l++){const f=o[l];if(typeof f.querySelector=="function"&&f.querySelector('[data-ln-popover-for="'+a+'"]'))return typeof f.cellIndex=="number"?f.cellIndex:l}}for(let i=0;i<o.length;i++){const a=o[i],f=Array.from(a.childNodes||[]).filter(m=>m.nodeType===3),b=(f.length>0?f.map(m=>m.textContent.trim()).join(" "):a.textContent||"").trim().toLowerCase();if(b&&b===s)return typeof a.cellIndex=="number"?a.cellIndex:i}}return null}function Ue(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let r=0;r<e.length;r++){const o=e[r];!t&&o.key&&(t=o.key),o.checked&&!o.isReset&&o.value&&n.push(o.value)}return{key:t,values:n}}function Ke(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function pe(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",r="data-ln-filter-value",o="data-ln-filter-hide",s="data-ln-filter-reset",i="data-ln-filter-col",a="data-ln-hash",l="data-ln-filter-values",f="data-ln-filter-target",b=new WeakMap;if(window[t]!==void 0)return;const m={"data-ln-filter":{prop:"targetId",type:"string",read:R,fallback:null,effect:I,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:I,description:"URL hash routing key for filter state persistence"},"data-ln-filter-values":{type:"string",effect:I,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-filter-target":{type:"marker",description:"Marker on target container or table observed by ln-filter"}},A=oe(m);function v(u){return u.hasAttribute(s)||!u.getAttribute(r)}function T(u){const d=u.dom.querySelectorAll("["+n+"]"),c=[];for(let p=0;p<d.length;p++){const h=d[p];c.push({key:h.getAttribute(n),value:h.getAttribute(r)||"",checked:h.checked,isReset:v(h)})}const g=Ue(c);return{key:g.key,values:g.values,targetId:u.targetId}}function _(u,d,c){const g=u.querySelectorAll("["+n+"]"),p=Array.isArray(c)&&c.length>0;for(let h=0;h<g.length;h++){const w=g[h];v(w)?w.checked=!p:p&&w.getAttribute(n)===d&&c.indexOf(w.getAttribute(r))!==-1?w.checked=!0:w.checked=!1}}function x(u){this.dom=u,re(this,u,A);const d=u.getAttribute(i);this.colIndex=d!==null?parseInt(d,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=O(u,"filter"),this.hashEnabled=!!this.nsKey;const c=this,g=ue(function(){c._render()});this._queueRender=g;const p=ue(function(){c._destroyed||c._applyDomFilter()});this._queueDomFilter=p;function h(){if(!c.targetId)return;const y=document.getElementById(c.targetId);y&&!y.hasAttribute(f)&&y.setAttribute(f,c.targetId)}this._ensureTargetMarked=h,h(),E(function(){c._destroyed||h()}),this._attachHandlers(),this._onHashChange=function(){if(c._destroyed||!c.hashEnabled)return;const y=j(c.nsKey),C=V(y);C&&C.key&&C.values.length>0?_(c.dom,C.key,C.values):_(c.dom,null,[]),c._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let w=!1;if(this.hashEnabled){const y=j(this.nsKey),C=V(y);C&&C.key&&C.values.length>0&&(_(u,C.key,C.values),E(function(){c._destroyed||c._render()}),w=!0)}if(!w){const y=pe(u.getAttribute(l));if(y.length>0){const C=u.querySelector("["+n+"]"),S=C?C.getAttribute(n):null;S&&(_(u,S,y),E(function(){c._destroyed||c._render()}),w=!0)}}if(!w){const y=u.querySelectorAll("["+n+"]");for(let C=0;C<y.length;C++)if(y[C].checked&&!v(y[C])){E(function(){c._destroyed||c._render()});break}}return this}x.prototype._attachHandlers=function(){const u=this;this._onDomChange=function(d){const c=d.target;if(!c||!c.hasAttribute||!c.hasAttribute(n))return;const g=Array.from(u.dom.querySelectorAll("["+n+"]"));if(v(c)){for(let p=0;p<g.length;p++)v(g[p])||(g[p].checked=!1);c.checked=!0,u._queueRender();return}if(c.checked){for(let h=0;h<g.length;h++)v(g[h])&&(g[h].checked=!1);let p=!1;for(let h=0;h<g.length;h++)if(v(g[h])){p=!0;break}if(p){let h=!0;for(let w=0;w<g.length;w++)if(!v(g[w])&&!g[w].checked){h=!1;break}if(h)for(let w=0;w<g.length;w++)v(g[w])?g[w].checked=!0:g[w].checked=!1}}else{let p=!1;for(let h=0;h<g.length;h++)if(!v(g[h])&&g[h].checked){p=!0;break}if(!p)for(let h=0;h<g.length;h++)v(g[h])&&(g[h].checked=!0)}u._queueRender()},this.dom.addEventListener("change",this._onDomChange)},x.prototype._render=function(){const u=this,d=T(this),c=this._lastSnapshot;if(!(!c||c.key!==d.key||He(c.values,d.values)))return;d.key===null||d.values.length;const p=document.getElementById(u.targetId),h={key:d.key,values:d.values.slice(),targetId:u.targetId};L(u.dom,"ln-filter:change",h);let w=!1;p&&p!==u.dom&&be(p,"ln-filter:change",h).defaultPrevented&&(w=!0);const y=c&&c.values.length>0,C=d.values.length===0;if(y&&C){const k={targetId:u.targetId};L(u.dom,"ln-filter:reset",k),p&&p!==u.dom&&L(p,"ln-filter:reset",k)}this._lastSnapshot={key:d.key,values:d.values.slice()};const S=Ke(d.values);if(S?this.dom.setAttribute(l,S):this.dom.removeAttribute(l),this.hashEnabled){const k=fe(d.key,d.values);de(this.nsKey,k)}w||u._applyDomFilter(p)},x.prototype._applyDomFilter=function(u){const d=u||document.getElementById(this.targetId);if(!d)return;const c=T(this),g=c.key===null||c.values.length===0,p=d.tagName==="TABLE"?d:d.querySelector?d.querySelector("table"):null;if(p)this._filterTableRows(c,p);else{const h=d.children;for(let w=0;w<h.length;w++){const y=h[w];if(y.removeAttribute(o),g)continue;const C=y.getAttribute("data-"+c.key);C!==null&&(he(C,c.values)||y.setAttribute(o,"true"))}}};function H(u){if(!u)return"";const d=u.querySelector?u.querySelector("[data-ln-value]"):null;return K(d||u)}function W(u){return!!(!u||typeof u!="object"||u.tagName==="TEMPLATE"||typeof u.hasAttribute=="function"&&(u.hasAttribute("data-ln-sort-exclude")||u.hasAttribute("hidden"))||u.classList&&u.classList.contains("hidden")||u.style&&u.style.display==="none"||typeof u.matches=="function"&&u.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof u.querySelector=="function"&&u.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}x.prototype._filterTableRows=function(u,d){if(!d){const y=document.getElementById(this.targetId);if(!y||(d=y.tagName==="TABLE"?y:y.querySelector?y.querySelector("table"):null,!d))return}const c=ge(d,this.dom,u.key,this.colIndex),g=u.key||this.dom.getAttribute("data-ln-filter-key")||(c!==null?"col"+c:"attr-filter"),p=u.values;b.has(d)||b.set(d,{});const h=b.get(d);g&&p.length>0?h[g]={col:c,values:p.slice(),attr:"data-"+g}:g&&delete h[g];const w=d.tBodies;for(let y=0;y<w.length;y++){const C=w[y].rows;for(let S=0;S<C.length;S++){const k=C[S];if(W(k))continue;const we={};for(let F=0;F<k.cells.length;F++)we[F]=H(k.cells[F]);We(we,h,k)?k.removeAttribute(o):k.setAttribute(o,"true")}}},x.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const u=document.getElementById(this.targetId);if(u){const d=u.tagName==="TABLE"?u:u.querySelector?u.querySelector("table"):null;if(d&&b.has(d)){const c=b.get(d),g=ge(d,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),p=this.dom.getAttribute("data-ln-filter-key")||(g!==null?"col"+g:this.colIndex!==null?"col"+this.colIndex:null);p&&c[p]&&(delete c[p],this._filterTableRows({key:null,values:[]},d)),Object.keys(c).length===0&&b.delete(d)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&u.removeAttribute(f)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t]};function I(u,d){const c=u[t];if(!(!c||c._destroyed))if(d===a)c.hashEnabled&&c._onHashChange&&window.removeEventListener("hashchange",c._onHashChange),c.nsKey=O(u,"filter"),c.hashEnabled=!!c.nsKey,c.hashEnabled&&window.addEventListener("hashchange",c._onHashChange);else if(d===l){const g=pe(u.getAttribute(l)),p=u.querySelector("["+n+"]"),h=p?p.getAttribute(n):null;h&&(_(u,h,g),c._render())}else d===e&&(c.targetId=u.getAttribute(e)||null,c._ensureTargetMarked(),c._render())}ae(e,t,x,"ln-filter",{attributes:m,subtreeQuery:"["+e+"], ["+f+"]",onSubtreeChange:function(u,d){if(d.addedNodes.length===0&&d.removedNodes.length===0)return;let c=null,g=null;if(u.hasAttribute(f)?(g=u,c=u.getAttribute(f)||u.id):u.hasAttribute(e)&&(c=u.getAttribute(e),g=c?document.getElementById(c):null),!c||!g)return;const p=document.querySelectorAll("["+e+'="'+c+'"]');for(let h=0;h<p.length;h++){const w=p[h][t];w&&!w._destroyed&&T(w).values.length>0&&w._queueDomFilter()}},persist:{attr:l,hashActive:function(u){return!!O(u,"filter")}}})})()})();
|
|
1
|
+
(function(){"use strict";function Q(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function N(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let r=null;for(let l=1;l<t.length;l++)if(t[l]&&t[l].nodeType===1){r=t[l];break}if(!N(r))return}e.apply(console,t)}}function L(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function Ce(e,t,n){const r=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r);const l=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});return e.dispatchEvent(l),l}function R(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){R(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function P(e){return e.hasAttribute("data-ln-value")?e.getAttribute("data-ln-value"):e.tagName==="TIME"&&e.hasAttribute("datetime")?e.getAttribute("datetime"):e.tagName==="DATA"&&e.hasAttribute("value")?e.getAttribute("value"):e.textContent.trim()}function Ae(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ve(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,l={},a=e.elements,i={};if(n)for(let s=0;s<a.length;s++){const o=a[s];o.name&&o.type==="checkbox"&&!o.disabled&&(i[o.name]=(i[o.name]||0)+1)}for(let s=0;s<a.length;s++){const o=a[s];if(!(!o.name||o.disabled||o.type==="file"||o.type==="submit"||o.type==="button")&&!(r&&o.matches&&o.matches(r)))if(o.type==="checkbox")n&&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 d=0;d<o.options.length;d++)o.options[d].selected&&l[o.name].push(o.options[d].value)}else if(n&&o.type==="hidden")l[o.name]=o.value;else if(n&&(o.type==="number"||o.type==="range")){const d=Number(o.value);l[o.name]=o.value===""||isNaN(d)?null:d}else l[o.name]=o.value}return l}function ke(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function _e(e,t){const n=e.elements,r=[],l={};for(let a=0;a<n.length;a++){const i=n[a];i.name&&i.type==="checkbox"&&(l[i.name]=(l[i.name]||0)+1)}for(let a=0;a<n.length;a++){const i=n[a];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const s=i.getAttribute("data-ln-fill-as")||i.name;if(!s||!(s in t))continue;const o=t[s];if(i.type==="checkbox"){if(Array.isArray(o))i.checked=o.indexOf(i.value)!==-1;else if(l[i.name]>1){const d=String(o).split(",").map(function(y){return y.trim()});i.checked=d.indexOf(i.value)!==-1}else i.checked=ke(o);r.push(i)}else if(i.type==="radio")i.checked=i.value===String(o),r.push(i);else if(i.type==="select-multiple"){if(Array.isArray(o))for(let d=0;d<i.options.length;d++)i.options[d].selected=o.indexOf(i.options[d].value)!==-1;r.push(i)}else i.value=o,i.tagName==="SELECT"&&o!=null&&i.setAttribute("data-ln-value",o),r.push(i)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=_e,window.lnCore.serializeForm=ve,window.lnCore.resolveFormMethod=Ae);const J={};function Se(e,t){J[e]=t}function xe(e){return J[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=Se,window.lnCore.getDataMapper=xe);function Ie(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,R(function(){new MutationObserver(function(){L(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const G={};function Ee(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];G[n]=t}function Te(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return G[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=Ee,window.lnCore.getLocaleFallback=Te,window.lnCore.ensureLocaleObserver=Ie);const B={};function qe(e,t){B[e]||(B[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=B[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function z(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let i=0;i<n.length;i++){const s=n[i],o=s.getAttribute("data-ln-field");t[o]!=null&&(s.textContent=t[o])}const r=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<r.length;i++){const s=r[i],o=s.getAttribute("data-ln-attr").split(",");for(let d=0;d<o.length;d++){const y=o[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),A=y[1].trim();t[A]!=null&&s.setAttribute(m,t[A])}}const l=e.querySelectorAll("[data-ln-show]");for(let i=0;i<l.length;i++){const s=l[i],o=s.getAttribute("data-ln-show");o in t&&s.classList.toggle("hidden",!t[o])}const a=e.querySelectorAll("[data-ln-class]");for(let i=0;i<a.length;i++){const s=a[i],o=s.getAttribute("data-ln-class").split(",");for(let d=0;d<o.length;d++){const y=o[d].trim().split(":");if(y.length!==2)continue;const m=y[0].trim(),A=y[1].trim();A in t&&s.classList.toggle(m,!!t[A])}}return e}function Le(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<n.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[r],t??null),n[r].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)z(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let n=0;n<t.length;n++)t[n].textContent=""}})));function X(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(i,s){return t[s]!==void 0?t[s]:""}))}const r=function(a,i){return t[i]!==void 0?t[i]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let a=0;a<l.length;a++){const i=l[a],s=i.attributes;for(let o=0;o<s.length;o++){const d=s[o];d.value.indexOf("{{")!==-1&&i.setAttribute(d.name,d.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Re(e,t,n,r,l,a){const i={};for(let o=0;o<e.children.length;o++){const d=e.children[o],y=d.getAttribute("data-ln-render-key");y&&(i[y]=d)}const s=document.createDocumentFragment();for(let o=0;o<t.length;o++){const d=t[o],y=String(r(d));let m=i[y];if(m)l(m,d,o);else{const A=qe(n,a);if(!A||(X(A,d),m=A.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",y),l(m,d,o)}s.appendChild(m)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=X,window.lnCore.fill=z,window.lnCore.lnFill=Le,window.lnCore.renderList=Re);function O(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function Y(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function Z(e,t,n=!1){const r=e.getAttribute(t);if(r===null)return!!n;const l=r.trim().toLowerCase();return!(l==="false"||l==="0")}function ee(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const M=new Map;function te(e,t){const n=(e?e.join("|"):"")+"::"+t;if(M.has(n))return M.get(n);const r=new Set(e||[]),l=function(a,i){const s=a.getAttribute(i);return s!==null&&r.has(s)?s:t};return M.set(n,l),l}function ne(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function re(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function oe(e,t,n,r,l){if(!e||t===null)return!0;const a=r||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const s=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"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const o=e.values||[];return o.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${o.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const o=parseInt(t,10);return e.min!==void 0&&o<e.min?(s(`[${a}] Value ${o} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&o>e.max?(s(`[${a}] Value ${o} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(o){return s(`[${a}] Invalid JSON for attribute "${n}": ${o.message}. Fallback: ${e.fallback}.`),!1}return!0}function ie(e,t,n){for(const r in n){const[l,a,i]=n[r];Object.defineProperty(e,r,{get:function(){return l(t,a,i)},enumerable:!0,configurable:!0})}return e}function le(e){const t={};for(const n in e){const r=e[n];if(!r||!r.prop)continue;let l=r.read;if(!l&&r.type)switch(r.type){case"enum":l=te(r.values,r.fallback);break;case"integer":l=Y;break;case"float":l=ne;break;case"boolean":l=Z;break;case"list":l=ee;break;case"json":l=re;break;case"string":default:l=O;break}l||(l=O),t[r.prop]=[l,n,r.fallback]}return t}function Oe(e){const t={};for(const n in e){const r=e[n];r&&r.effect&&(t[n]=r.effect)}return Object.keys(t).length?t:null}function De(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const n in e.effects)t.add(n);if(e.onAttrChange&&e.declared)for(const n of e.declared)t.add(n);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ie,window.lnCore.attrSpec=le,window.lnCore.attrStr=O,window.lnCore.attrInt=Y,window.lnCore.attrBool=Z,window.lnCore.attrList=ee,window.lnCore.attrEnum=te,window.lnCore.attrFloat=ne,window.lnCore.attrJson=re);function E(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function se(e,t,n,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(a)&&E(e,i),e.querySelectorAll){const s=e.querySelectorAll(a);for(let o=0;o<s.length;o++)E(s[o],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Fe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function T(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ae(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Ne(e){const t=ae(),n=e.observed||[];for(let r=0;r<n.length;r++){const l=n[r];t.byAttr.has(l)||t.byAttr.set(l,[]),t.byAttr.get(l).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const r in e.attributes){t.byDeclaredAttr.has(r)||t.byDeclaredAttr.set(r,[]);const l=t.byDeclaredAttr.get(r);l.some(a=>a.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=De(e);if(r===null)t.reactiveWildcard.push(e);else for(const l of r)t.byReactive.has(l)||t.byReactive.set(l,[]),t.byReactive.get(l).push(e)}e.persist&&t.persist.push(e)}function ce(e,t,n,r){for(let l=0;l<e.length;l++){const a=e[l];if(!t[a.attribute])continue;const i=a.effects&&a.effects[n];i?i(t,n,r):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,r)}}function Be(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=ae(),l=r.byAttr.get(t),a=Q()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!l&&!a)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(a&&N(i)){const s=r.byDeclaredAttr.get(t),o=i.getAttribute(t);for(let d=0;d<s.length;d++)oe(s[d].spec,o,t,s[d].componentTag,i)}if(window.lnCore._debugSink&&(n||l)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const s=r.byReactive.get(t);s&&ce(s,i,t,e.oldValue),r.reactiveWildcard.length&&ce(r.reactiveWildcard,i,t,e.oldValue)}if(l)for(let s=0;s<l.length;s++){const o=l[s];if(o.handler){o.handler(i,t,e.oldValue);continue}o.onAttributeChange&&i[o.attribute]?o.onAttributeChange(i,t):(se(i,o.selector,o.attribute,o.ComponentFn),o.onInit&&o.onInit(i))}}}function Me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Be(t[n])}catch(r){console.error("[ln-core] mutation handler failed",t[n].target,r)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function $(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function j(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function $e(e){const t=$();if(t.length){if(e.target)for(let n=0;n<t.length;n++){const r=t[n];if(r.onSubtreeChange&&r.query){const l=r.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;a&&r.onSubtreeChange(a,e)}}for(let n=0;n<e.addedNodes.length;n++){const r=e.addedNodes[n];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let a=0;a<t.length;a++){const i=t[a];if(i.selector&&i.attribute&&i.ComponentFn){if(!l)r.matches&&r.matches(i.query)&&E(r,i);else if(r.matches&&r.matches(i.query)&&E(r,i),r.querySelectorAll){const s=r.querySelectorAll(i.query);for(let o=0;o<s.length;o++)E(s[o],i)}}i.onInit&&i.onInit(r)}}}for(let n=0;n<e.removedNodes.length;n++){const r=e.removedNodes[n];if(r.nodeType===1){const l=!!(r.firstElementChild||r.children&&r.children.length);for(let a=0;a<t.length;a++){const i=t[a],s=i.query;if(s){if(!l)r.matches&&r.matches(s)&&j(r,i);else if(r.matches&&r.matches(s)&&j(r,i),r.querySelectorAll){const o=r.querySelectorAll(s);for(let d=0;d<o.length;d++)j(o[d],i)}}}}}}}function ue(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,R(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{$e(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function je(e){$().push(e),ue()}function de(e,t,n,r,l={}){const a=l.extraAttributes||[],i=l.onAttributeChange||null,s=l.onSubtreeChange||null,o=l.onInit||null,d=l.onAttrChange||null,y=l.effects||null,m=l.attributes||null,A=m?Oe(m):y,v=m?new Set(Object.keys(m)):null,q=l.persist||null;function _(c){const f=c||document.body;if(se(f,e,t,n),m&&Q())for(const u in m){const g=m[u],p=Array.from(f.querySelectorAll("["+u+"]"));f.matches&&f.matches("["+u+"]")&&p.push(f);for(let h=0;h<p.length;h++){const w=p[h];N(w)&&oe(g,w.getAttribute(u),u,r,w)}}o&&o(f)}const S=[];if(e.indexOf("[")!==-1){const c=/\[([\w-]+)/g;let f;for(;(f=c.exec(e))!==null;)S.push(f[1])}else S.push(e);Ne({selector:e,attribute:t,componentTag:r,attributes:m,ComponentFn:n,onInit:o,observed:S.concat(a),onAttributeChange:i,onAttrChange:d,effects:A,declared:v,persist:q}),Me();const U=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,K=l.subtreeQuery||(U?e:"["+e+"]");$().push({selector:e,attribute:t,ComponentFn:n,onInit:o,onSubtreeChange:s,query:K}),ue(),window[t]=_,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=de,window.lnCore.observeLifecycle=je);function I(){Fe()>0?T(function(){_(document.body)}):_(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I):I(),_}function fe(e,t){let n=!1;return function(){n||(n=!0,queueMicrotask(function(){n=!1,e()}))}}function he(e){return(e||"").replace(/^#/,"")}function V(e){const t=e===void 0?location.hash:e,n={},r=he(t);if(!r)return n;const l=r.split("&");for(let a=0;a<l.length;a++){const i=l[a];if(!i)continue;const s=i.indexOf(":"),o=s>-1?i.slice(0,s):i,d=s>-1?i.slice(s+1):"";if(o)try{n[o]=decodeURIComponent(d)}catch{n[o]=d}}return n}function H(e){if(!e)return null;const t=V();return e in t?t[e]:null}function ge(e,t){if(!e)return;const n=V();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(a){const i=n[a];return i===""?a:a+":"+encodeURIComponent(i)}).join("&");he(location.hash)!==l&&(location.hash=l)}function Ve(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function D(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const r=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return r?t?r+"-"+t:r:t||null}function He(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function We(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function pe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function W(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=V,window.lnCore.hashGet=H,window.lnCore.hashSet=ge,window.lnCore.hashLinkClick=Ve,window.lnCore.resolveHashNamespace=D,window.lnCore.hashSortEncode=He,window.lnCore.hashSortDecode=We,window.lnCore.hashFilterEncode=pe,window.lnCore.hashFilterDecode=W);function Ue(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ue);function we(e,t){if(!t||t.length===0)return!0;if(e==null)return!1;const n=String(e).trim().toLowerCase();for(let r=0;r<t.length;r++)if(String(t[r]).trim().toLowerCase()===n)return!0;return!1}function Ke(e,t){if(!Array.isArray(e)||!Array.isArray(t))return e!==t;if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function Qe(e,t,n){if(!t||typeof t!="object")return!0;const r=Object.keys(t);if(r.length===0)return!0;for(let l=0;l<r.length;l++){const a=t[r[l]];let i="";if(a.col!==null&&a.col!==void 0?i=e[a.col]||"":a.attr&&n&&typeof n.getAttribute=="function"&&(i=n.getAttribute(a.attr)||""),!we(i,a.values))return!1}return!0}function be(e,t,n,r){if(r!=null&&!isNaN(r))return parseInt(r,10);if(t&&typeof t.getAttribute=="function"){const l=t.getAttribute("data-ln-filter-col");if(l!==null&&!isNaN(parseInt(l,10)))return parseInt(l,10);if(typeof t.closest=="function"){const a=t.closest("th");if(a&&typeof a.cellIndex=="number")return a.cellIndex;const i=t.closest("[data-ln-popover], [id]");if(i&&i.id){const s=e&&e.ownerDocument?e.ownerDocument:t.ownerDocument||(typeof document<"u"?document:null);if(s&&typeof s.querySelector=="function"){const o=s.querySelector('[data-ln-popover-for="'+i.id+'"]');if(o&&typeof o.closest=="function"){const d=o.closest("th");if(d&&typeof d.cellIndex=="number")return d.cellIndex}}}}}if(e&&n&&typeof e.querySelectorAll=="function"){const l=e.querySelectorAll("thead th, tr:first-child th"),a=String(n).trim().toLowerCase();for(let i=0;i<l.length;i++){const s=l[i],o=s.getAttribute("data-ln-table-filter-col")||s.getAttribute("data-ln-filter-col")||s.getAttribute("data-ln-filter-key")||s.getAttribute("data-ln-table-col")||s.getAttribute("data-ln-col")||s.getAttribute("data-ln-field");if(o&&o.trim().toLowerCase()===a)return typeof s.cellIndex=="number"?s.cellIndex:i}if(t){const i=t.closest?t.closest("[data-ln-popover], [id]"):null,s=i&&i.id||t.id||null;if(s)for(let o=0;o<l.length;o++){const d=l[o];if(typeof d.querySelector=="function"&&d.querySelector('[data-ln-popover-for="'+s+'"]'))return typeof d.cellIndex=="number"?d.cellIndex:o}}for(let i=0;i<l.length;i++){const s=l[i],d=Array.from(s.childNodes||[]).filter(m=>m.nodeType===3),y=(d.length>0?d.map(m=>m.textContent.trim()).join(" "):s.textContent||"").trim().toLowerCase();if(y&&y===a)return typeof s.cellIndex=="number"?s.cellIndex:i}}return null}function Pe(e){if(!Array.isArray(e))return{key:null,values:[]};let t=null;const n=[];for(let r=0;r<e.length;r++){const l=e[r];!t&&l.key&&(t=l.key),l.checked&&!l.isReset&&l.value&&n.push(l.value)}return{key:t,values:n}}function Je(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function ye(e){return e?e.split(",").map(function(t){try{return decodeURIComponent(t)}catch{return t}}).filter(Boolean):[]}(function(){const e="data-ln-filter",t="lnFilter",n="data-ln-filter-key",r="data-ln-filter-value",l="data-ln-filter-hide",a="data-ln-filter-reset",i="data-ln-filter-col",s="data-ln-hash",o="data-ln-filter-values",d="data-ln-filter-target",y=new WeakMap;if(window[t]!==void 0)return;const m={"data-ln-filter":{prop:"targetId",type:"string",read:O,fallback:null,effect:I,description:"Target table or list element ID to filter"},"data-ln-hash":{type:"string",effect:I,description:"URL hash routing key for filter state persistence"},"data-ln-filter-values":{type:"string",effect:I,description:"Encoded active filter values"},"data-ln-filter-col":{type:"string",description:"Column name or index filter specifier"},"data-ln-filter-key":{type:"string",description:"Field key for filter matching"},"data-ln-filter-reset":{type:"trigger",description:"Filter reset button or option trigger"},"data-ln-filter-value":{type:"string",description:"Value to match for this filter input"},"data-ln-filter-hide":{type:"enum",values:["collapse","none"],fallback:"collapse",description:"CSS hiding strategy for non-matching rows"},"data-ln-filter-target":{type:"marker",description:"Marker on target container or table observed by ln-filter"}},A=le(m);function v(c){return c.hasAttribute(a)||!c.getAttribute(r)}function q(c){const f=c.dom.querySelectorAll("["+n+"]"),u=[];for(let p=0;p<f.length;p++){const h=f[p];u.push({key:h.getAttribute(n),value:h.getAttribute(r)||"",checked:h.checked,isReset:v(h)})}const g=Pe(u);return{key:g.key,values:g.values,targetId:c.targetId}}function _(c,f,u){const g=c.querySelectorAll("["+n+"]"),p=Array.isArray(u)&&u.length>0;for(let h=0;h<g.length;h++){const w=g[h];v(w)?w.checked=!p:p&&w.getAttribute(n)===f&&u.indexOf(w.getAttribute(r))!==-1?w.checked=!0:w.checked=!1}}function S(c){this.dom=c,ie(this,c,A);const f=c.getAttribute(i);this.colIndex=f!==null?parseInt(f,10):null,this._lastSnapshot=null,this._destroyed=!1,this.nsKey=D(c,"filter"),this.hashEnabled=!!this.nsKey;const u=this,g=fe(function(){u._render()});this._queueRender=g;const p=fe(function(){u._destroyed||u._applyDomFilter()});this._queueDomFilter=p;function h(){if(!u.targetId)return;const b=document.getElementById(u.targetId);b&&!b.hasAttribute(d)&&b.setAttribute(d,u.targetId)}this._ensureTargetMarked=h,h(),T(function(){u._destroyed||h()}),this._attachHandlers(),this._onHashChange=function(){if(u._destroyed||!u.hashEnabled)return;const b=H(u.nsKey),C=W(b);C&&C.key&&C.values.length>0?_(u.dom,C.key,C.values):_(u.dom,null,[]),u._render()},this.hashEnabled&&window.addEventListener("hashchange",this._onHashChange);let w=!1;if(this.hashEnabled){const b=H(this.nsKey),C=W(b);C&&C.key&&C.values.length>0&&(_(c,C.key,C.values),T(function(){u._destroyed||u._render()}),w=!0)}if(!w){const b=ye(c.getAttribute(o));if(b.length>0){const C=c.querySelector("["+n+"]"),x=C?C.getAttribute(n):null;x&&(_(c,x,b),T(function(){u._destroyed||u._render()}),w=!0)}}if(!w){const b=c.querySelectorAll("["+n+"]");for(let C=0;C<b.length;C++)if(b[C].checked&&!v(b[C])){T(function(){u._destroyed||u._render()});break}}return this}S.prototype._attachHandlers=function(){const c=this;this._onDomChange=function(f){const u=f.target;if(!u||!u.hasAttribute||!u.hasAttribute(n))return;const g=Array.from(c.dom.querySelectorAll("["+n+"]"));if(v(u)){for(let p=0;p<g.length;p++)v(g[p])||(g[p].checked=!1);u.checked=!0,c._queueRender();return}if(u.checked){for(let h=0;h<g.length;h++)v(g[h])&&(g[h].checked=!1);let p=!1;for(let h=0;h<g.length;h++)if(v(g[h])){p=!0;break}if(p){let h=!0;for(let w=0;w<g.length;w++)if(!v(g[w])&&!g[w].checked){h=!1;break}if(h)for(let w=0;w<g.length;w++)v(g[w])?g[w].checked=!0:g[w].checked=!1}}else{let p=!1;for(let h=0;h<g.length;h++)if(!v(g[h])&&g[h].checked){p=!0;break}if(!p)for(let h=0;h<g.length;h++)v(g[h])&&(g[h].checked=!0)}c._queueRender()},this.dom.addEventListener("change",this._onDomChange)},S.prototype._render=function(){const c=this,f=q(this),u=this._lastSnapshot;if(!(!u||u.key!==f.key||Ke(u.values,f.values)))return;f.key===null||f.values.length;const p=document.getElementById(c.targetId),h={key:f.key,values:f.values.slice(),targetId:c.targetId};L(c.dom,"ln-filter:change",h);let w=!1;p&&p!==c.dom&&Ce(p,"ln-filter:change",h).defaultPrevented&&(w=!0);const b=u&&u.values.length>0,C=f.values.length===0;if(b&&C){const k={targetId:c.targetId};L(c.dom,"ln-filter:reset",k),p&&p!==c.dom&&L(p,"ln-filter:reset",k)}this._lastSnapshot={key:f.key,values:f.values.slice()};const x=Je(f.values);if(x?this.dom.setAttribute(o,x):this.dom.removeAttribute(o),this.hashEnabled){const k=pe(f.key,f.values);ge(this.nsKey,k)}w||c._applyDomFilter(p)},S.prototype._applyDomFilter=function(c){const f=c||document.getElementById(this.targetId);if(!f)return;const u=q(this),g=u.key===null||u.values.length===0,p=f.tagName==="TABLE"?f:f.querySelector?f.querySelector("table"):null;if(p)this._filterTableRows(u,p);else{const h=f.children;for(let w=0;w<h.length;w++){const b=h[w];if(b.removeAttribute(l),g)continue;const C=b.getAttribute("data-"+u.key);C!==null&&(we(C,u.values)||b.setAttribute(l,"true"))}}};function U(c){if(!c)return"";const f=c.querySelector?c.querySelector("[data-ln-value]"):null;return P(f||c)}function K(c){return!!(!c||typeof c!="object"||c.tagName==="TEMPLATE"||typeof c.hasAttribute=="function"&&(c.hasAttribute("data-ln-sort-exclude")||c.hasAttribute("hidden"))||c.classList&&c.classList.contains("hidden")||c.style&&c.style.display==="none"||typeof c.matches=="function"&&c.matches(".empty-state, .ln-table__empty, .ln-table__empty-state, [data-ln-empty], [data-ln-empty-state], [data-ln-table-empty]")||typeof c.querySelector=="function"&&c.querySelector(".empty-state, [data-ln-empty], [data-ln-empty-state]"))}S.prototype._filterTableRows=function(c,f){if(!f){const b=document.getElementById(this.targetId);if(!b||(f=b.tagName==="TABLE"?b:b.querySelector?b.querySelector("table"):null,!f))return}const u=be(f,this.dom,c.key,this.colIndex),g=c.key||this.dom.getAttribute("data-ln-filter-key")||(u!==null?"col"+u:"attr-filter"),p=c.values;y.has(f)||y.set(f,{});const h=y.get(f);g&&p.length>0?h[g]={col:u,values:p.slice(),attr:"data-"+g}:g&&delete h[g];const w=f.tBodies;for(let b=0;b<w.length;b++){const C=w[b].rows;for(let x=0;x<C.length;x++){const k=C[x];if(K(k))continue;const me={};for(let F=0;F<k.cells.length;F++)me[F]=U(k.cells[F]);Qe(me,h,k)?k.removeAttribute(l):k.setAttribute(l,"true")}}},S.prototype.destroy=function(){if(!this.dom[t])return;this._destroyed=!0;const c=document.getElementById(this.targetId);if(c){const f=c.tagName==="TABLE"?c:c.querySelector?c.querySelector("table"):null;if(f&&y.has(f)){const u=y.get(f),g=be(f,this.dom,this.dom.getAttribute("data-ln-filter-key"),this.colIndex),p=this.dom.getAttribute("data-ln-filter-key")||(g!==null?"col"+g:this.colIndex!==null?"col"+this.colIndex:null);p&&u[p]&&(delete u[p],this._filterTableRows({key:null,values:[]},f)),Object.keys(u).length===0&&y.delete(f)}this.targetId&&document.querySelectorAll("["+e+'="'+this.targetId+'"]').length<=1&&c.removeAttribute(d)}this._onDomChange&&(this.dom.removeEventListener("change",this._onDomChange),delete this._onDomChange),this.hashEnabled&&this._onHashChange&&window.removeEventListener("hashchange",this._onHashChange),delete this.dom[t]};function I(c,f){const u=c[t];if(!(!u||u._destroyed))if(f===s)u.hashEnabled&&u._onHashChange&&window.removeEventListener("hashchange",u._onHashChange),u.nsKey=D(c,"filter"),u.hashEnabled=!!u.nsKey,u.hashEnabled&&window.addEventListener("hashchange",u._onHashChange);else if(f===o){const g=ye(c.getAttribute(o)),p=c.querySelector("["+n+"]"),h=p?p.getAttribute(n):null;h&&(_(c,h,g),u._render())}else f===e&&(u.targetId=c.getAttribute(e)||null,u._ensureTargetMarked(),u._render())}de(e,t,S,"ln-filter",{attributes:m,subtreeQuery:"["+e+"], ["+d+"]",onSubtreeChange:function(c,f){if(f.addedNodes.length===0&&f.removedNodes.length===0)return;let u=null,g=null;if(c.hasAttribute(d)?(g=c,u=c.getAttribute(d)||c.id):c.hasAttribute(e)&&(u=c.getAttribute(e),g=u?document.getElementById(u):null),!u||!g)return;const p=document.querySelectorAll("["+e+'="'+u+'"]');for(let h=0;h<p.length;h++){const w=p[h][t];w&&!w._destroyed&&q(w).values.length>0&&w._queueDomFilter()}},persist:{attr:o,hashActive:function(c){return!!D(c,"filter")}}})})()})();
|