@livenetworks/ashlar 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ln-accordion/ln-accordion.js +1 -1
- package/components/ln-ajax/ln-ajax.js +1 -1
- 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-autoresize/src/ln-autoresize.js +3 -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/lifecycle.js +24 -12
- 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-date/src/ln-date.js +22 -13
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-dropdown/ln-dropdown.schema.json +90 -90
- package/components/ln-dropdown/src/ln-dropdown.js +18 -5
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-filter/ln-filter.schema.json +1 -1
- package/components/ln-filter/src/ln-filter.js +11 -10
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-form/src/ln-form.js +11 -0
- package/components/ln-icon/ln-icon.js +1 -1
- 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-list/ln-list.js +1 -1
- package/components/ln-list/src/ln-list.js +14 -5
- package/components/ln-modal/ln-modal.js +1 -1
- package/components/ln-nav/ln-nav.js +1 -1
- package/components/ln-number/ln-number.js +1 -1
- package/components/ln-number/src/ln-number.js +22 -12
- package/components/ln-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-popover/ln-popover.schema.json +82 -82
- package/components/ln-popover/src/ln-popover.js +22 -5
- package/components/ln-progress/ln-progress.js +1 -1
- 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-search/ln-search.schema.json +103 -103
- package/components/ln-search/src/ln-search.js +9 -5
- 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-sortable/src/ln-sortable.js +52 -7
- 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-tabs/src/ln-tabs.js +12 -8
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-time/src/ln-time.js +17 -7
- 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-validate/src/ln-validate.js +21 -7
- 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 $(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function v(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let r=1;r<t.length;r++)if(t[r]&&t[r].nodeType===1){i=t[r];break}if(!v(i))return}e.apply(console,t)}}function I(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function ee(e,t,o){const i=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i);const r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:i});return e.dispatchEvent(r),r}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function te(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ne(e,t){const o=!!(t&&t.typed),i=t&&t.exclude,r={},a=e.elements,l={};if(o)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(l[n.name]=(l[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")o&&l[n.name]===1?r[n.name]=n.checked:(r[n.name]||(r[n.name]=[]),n.checked&&r[n.name].push(n.value));else if(n.type==="radio")n.checked&&(r[n.name]=n.value);else if(n.type==="select-multiple"){r[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&r[n.name].push(n.options[c].value)}else if(o&&n.type==="hidden")r[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const c=Number(n.value);r[n.name]=n.value===""||isNaN(c)?null:c}else r[n.name]=n.value}return r}function re(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function oe(e,t){const o=e.elements,i=[],r={};for(let a=0;a<o.length;a++){const l=o[a];l.name&&l.type==="checkbox"&&(r[l.name]=(r[l.name]||0)+1)}for(let a=0;a<o.length;a++){const l=o[a];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const s=l.getAttribute("data-ln-fill-as")||l.name;if(!s||!(s in t))continue;const n=t[s];if(l.type==="checkbox"){if(Array.isArray(n))l.checked=n.indexOf(l.value)!==-1;else if(r[l.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});l.checked=c.indexOf(l.value)!==-1}else l.checked=re(n);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(n),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<l.options.length;c++)l.options[c].selected=n.indexOf(l.options[c].value)!==-1;i.push(l)}else l.value=n,l.tagName==="SELECT"&&n!=null&&l.setAttribute("data-ln-value",n),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=oe,window.lnCore.serializeForm=ne,window.lnCore.resolveFormMethod=te);const T={};function ie(e,t){T[e]=t}function le(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ie,window.lnCore.getDataMapper=le);function se(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const F={};function ae(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];F[o]=t}function ce(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return F[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ae,window.lnCore.getLocaleFallback=ce,window.lnCore.ensureLocaleObserver=se);const A={};function ue(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=A[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let l=0;l<o.length;l++){const s=o[l],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const s=i[l],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 r=e.querySelectorAll("[data-ln-show]");for(let l=0;l<r.length;l++){const s=r[l],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let l=0;l<a.length;l++){const s=a[l],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 de(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<o.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[i],t??null),o[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)R(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 M(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const a=o.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,s){return t[s]!==void 0?t[s]:""}))}const i=function(a,l){return t[l]!==void 0?t[l]:""},r=Array.from(e.querySelectorAll("*"));e.nodeType===1&&r.push(e);for(let a=0;a<r.length;a++){const l=r[a],s=l.attributes;for(let n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&l.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function fe(e,t,o,i,r,a){const l={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(l[u]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(i(c));let d=l[u];if(d)r(d,c,n);else{const f=ue(o,a);if(!f||(M(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),r(d,c,n)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=R,window.lnCore.lnFill=de,window.lnCore.renderList=fe);function x(e,t,o){const i=e.getAttribute(t);return i===null?o:i}function j(e,t,o){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?o:i}function k(e,t,o=!1){const i=e.getAttribute(t);if(i===null)return!!o;const r=i.trim().toLowerCase();return!(r==="false"||r==="0")}function B(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const _=new Map;function W(e,t){const o=(e?e.join("|"):"")+"::"+t;if(_.has(o))return _.get(o);const i=new Set(e||[]),r=function(a,l){const s=a.getAttribute(l);return s!==null&&i.has(s)?s:t};return _.set(o,r),r}function H(e,t,o){const i=parseFloat(e.getAttribute(t));return isNaN(i)?o:i}function U(e,t,o){const i=e.getAttribute(t);if(!i)return o;try{return JSON.parse(i)}catch{return o}}function V(e,t,o,i,r){if(!e||t===null)return!0;const a=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const s=n=>{r?console.warn(n,r):console.warn(n)};if(l==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(s(`[${a}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(s(`[${a}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(n){return s(`[${a}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function P(e,t,o){for(const i in o){const[r,a,l]=o[i];Object.defineProperty(e,i,{get:function(){return r(t,a,l)},enumerable:!0,configurable:!0})}return e}function Q(e){const t={};for(const o in e){const i=e[o];if(!i||!i.prop)continue;let r=i.read;if(!r&&i.type)switch(i.type){case"enum":r=W(i.values,i.fallback);break;case"integer":r=j;break;case"float":r=H;break;case"boolean":r=k;break;case"list":r=B;break;case"json":r=U;break;case"string":default:r=x;break}r||(r=x),t[i.prop]=[r,o,i.fallback]}return t}function we(e){const t={};for(const o in e){const i=e[o];i&&i.effect&&(t[o]=i.effect)}return Object.keys(t).length?t:null}function he(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=P,window.lnCore.attrSpec=Q,window.lnCore.attrStr=x,window.lnCore.attrInt=j,window.lnCore.attrBool=k,window.lnCore.attrList=B,window.lnCore.attrEnum=W,window.lnCore.attrFloat=H,window.lnCore.attrJson=U);function p(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,i){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:o,ComponentFn:i};if(e.matches&&e.matches(a)&&p(e,l),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)p(s[n],l)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function be(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function J(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ge(e){const t=J(),o=e.observed||[];for(let i=0;i<o.length;i++){const r=o[i];t.byAttr.has(r)||t.byAttr.set(r,[]),t.byAttr.get(r).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const r=t.byDeclaredAttr.get(i);r.some(a=>a.componentTag===e.componentTag)||r.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=he(e);if(i===null)t.reactiveWildcard.push(e);else for(const r of i)t.byReactive.has(r)||t.byReactive.set(r,[]),t.byReactive.get(r).push(e)}e.persist&&t.persist.push(e)}function K(e,t,o,i){for(let r=0;r<e.length;r++){const a=e[r];if(!t[a.attribute])continue;const l=a.effects&&a.effects[o];l?l(t,o,i):a.onAttrChange&&(!a.declared||a.declared.has(o))&&a.onAttrChange(t,o,i)}}function Ce(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,i=J(),r=i.byAttr.get(t),a=$()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!o&&!r&&!a)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(a&&v(l)){const s=i.byDeclaredAttr.get(t),n=l.getAttribute(t);for(let c=0;c<s.length;c++)V(s[c].spec,n,t,s[c].componentTag,l)}if(window.lnCore._debugSink&&(o||r)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),o){const s=i.byReactive.get(t);s&&K(s,l,t,e.oldValue),i.reactiveWildcard.length&&K(i.reactiveWildcard,l,t,e.oldValue)}if(r)for(let s=0;s<r.length;s++){const n=r[s];if(n.handler){n.handler(l,t,e.oldValue);continue}n.onAttributeChange&&l[n.attribute]?n.onAttributeChange(l,t):(z(l,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(l))}}}function me(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{Ce(t[o])}catch(i){console.error("[ln-core] mutation handler failed",t[o].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function S(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function L(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ye(e){const t=S();if(!t.length)return;const o=e.target;if(o){const i=o.nodeType===1?o:o.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let i=0;i<t.length;i++){const r=t[i];if(r.onSubtreeChange&&r.query){const a=r.query,l=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;l&&r.onSubtreeChange(l,e)}}for(let i=0;i<e.addedNodes.length;i++){const r=e.addedNodes[i];if(r.nodeType===1){const a=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const s=t[l];if(s.selector&&s.attribute&&s.ComponentFn){if(!a)r.matches&&r.matches(s.query)&&p(r,s);else if(r.matches&&r.matches(s.query)&&p(r,s),r.querySelectorAll){const n=r.querySelectorAll(s.query);for(let c=0;c<n.length;c++)p(n[c],s)}}s.onInit&&s.onInit(r)}}}for(let i=0;i<e.removedNodes.length;i++){const r=e.removedNodes[i];if(r.nodeType===1){const a=!!(r.firstElementChild||r.children&&r.children.length);for(let l=0;l<t.length;l++){const s=t[l],n=s.query;if(n){if(!a)r.matches&&r.matches(n)&&L(r,s);else if(r.matches&&r.matches(n)&&L(r,s),r.querySelectorAll){const c=r.querySelectorAll(n);for(let u=0;u<c.length;u++)L(c[u],s)}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const i=t[o];if(i.type==="childList")try{ye(i)}catch(r){console.error("[ln-core] lifecycle handler failed",i.target,r)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ve(e){S().push(e),G()}function X(e,t,o,i,r={}){const a=r.extraAttributes||[],l=r.onAttributeChange||null,s=r.onSubtreeChange||null,n=r.onInit||null,c=r.onAttrChange||null,u=r.effects||null,d=r.attributes||null,f=d?we(d):u,w=d?new Set(Object.keys(d)):null,g=r.persist||null;function b(E){const h=E||document.body;if(z(h,e,t,o),d&&$())for(const m in d){const $e=d[m],D=Array.from(h.querySelectorAll("["+m+"]"));h.matches&&h.matches("["+m+"]")&&D.push(h);for(let N=0;N<D.length;N++){const q=D[N];v(q)&&V($e,q.getAttribute(m),m,i,q)}}n&&n(h)}const C=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let h;for(;(h=E.exec(e))!==null;)C.push(h[1])}else C.push(e);ge({selector:e,attribute:t,componentTag:i,attributes:d,ComponentFn:o,onInit:n,observed:C.concat(a),onAttributeChange:l,onAttrChange:c,effects:f,declared:w,persist:g}),me();const Ne=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,qe=r.subtreeQuery||(Ne?e:"["+e+"]");S().push({selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:s,query:qe}),G(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=ve);function Z(){be()>0?pe(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z):Z(),b}function Y(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,o={},i=Y(t);if(!i)return o;const r=i.split("&");for(let a=0;a<r.length;a++){const l=r[a];if(!l)continue;const s=l.indexOf(":"),n=s>-1?l.slice(0,s):l,c=s>-1?l.slice(s+1):"";if(n)try{o[n]=decodeURIComponent(c)}catch{o[n]=c}}return o}function Ae(e){if(!e)return null;const t=O();return e in t?t[e]:null}function xe(e,t){if(!e)return;const o=O();t==null?delete o[e]:o[e]=String(t);const r=Object.keys(o).map(function(a){const l=o[a];return l===""?a:a+":"+encodeURIComponent(l)}).join("&");Y(location.hash)!==r&&(location.hash=r)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function _e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const o=e.getAttribute("data-ln-hash");if(o&&o.trim()!=="")return o.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Se(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 Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ee(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),i=e.slice(t+1),r=i?i.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:o,values:r}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=Ae,window.lnCore.hashSet=xe,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=Ee);function De(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=De),(function(){const e="data-ln-nav",t="lnNav";if(window[t]!==void 0)return;const o={"data-ln-nav":{effect:l,type:"string",fallback:"active",description:"CSS class name applied to active navigation links"},"data-ln-nav-exact":{prop:"exact",read:k,effect:l,type:"boolean",fallback:!1,description:"Match exact URL pathname instead of prefix matching"}},i=Q(o);if(history._lnNavCallbacks=history._lnNavCallbacks||[],!history._lnNavPatched){const s=history.pushState;history.pushState=function(){s.apply(history,arguments);for(const c of history._lnNavCallbacks)c()};const n=history.replaceState;history.replaceState=function(){n.apply(history,arguments);for(const c of history._lnNavCallbacks)c()},history._lnNavPatched=!0}function r(s){return this.dom=s,P(this,s,i),this.activeClass=s.getAttribute(e)||"active",this.updateHandler=()=>this.update(),window.addEventListener("popstate",this.updateHandler),history._lnNavCallbacks.push(this.updateHandler),this.observer=null,this.update(),this}r.prototype.update=function(){if(!this.activeClass||ee(this.dom,"ln-nav:before-update",{target:this.dom}).defaultPrevented)return;const n=Array.from(this.dom.querySelectorAll("a")),c=window.location.pathname,u=a(c),d=[];for(const f of n){const w=f.getAttribute("href");if(!w||w==="#"||w.startsWith("#")||w.startsWith("javascript:")||w.startsWith("mailto:")||w.startsWith("tel:")){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}if(f.hostname&&f.hostname!==window.location.hostname){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}const g=a(w),b=g===u,C=!this.exact&&g!=="/"&&u.startsWith(g+"/");b||C?(f.classList.add(this.activeClass),f.setAttribute("aria-current","page"),d.push(f)):(f.classList.remove(this.activeClass),f.removeAttribute("aria-current"))}I(this.dom,"ln-nav:update",{target:this.dom,activeLinks:d})},r.prototype.destroy=function(){if(!this.dom[t])return;this.observer&&this.observer.disconnect(),window.removeEventListener("popstate",this.updateHandler);const s=history._lnNavCallbacks.indexOf(this.updateHandler);s!==-1&&history._lnNavCallbacks.splice(s,1),delete this.dom[t]};function a(s){try{return new URL(s,window.location.href).pathname.replace(/\/$/,"")||"/"}catch{return s.replace(/\/$/,"")||"/"}}function l(s,n){const c=s[t];if(c){if(n===e){if(!s.hasAttribute(e)){c.destroy();return}const u=c.activeClass,d=s.getAttribute(e)||"active";if(u!==d){const f=s.querySelectorAll("a");for(const w of f)u&&w.classList.remove(u);c.activeClass=d}}c.update()}}X(e,t,r,"ln-nav",{attributes:o,onSubtreeChange:function(s){s[t]&&s[t].update()}})})()})();
|
|
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 v(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!v(l))return}e.apply(console,t)}}function T(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function re(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l);const o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:l});return e.dispatchEvent(o),o}function y(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){y(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ie(e,t){const r=!!(t&&t.typed),l=t&&t.exclude,o={},s=e.elements,i={};if(r)for(let a=0;a<s.length;a++){const n=s[a];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[n.name]||0)+1)}for(let a=0;a<s.length;a++){const n=s[a];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")r&&i[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&o[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")o[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);o[n.name]=n.value===""||isNaN(c)?null:c}else o[n.name]=n.value}return o}function le(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function se(e,t){const r=e.elements,l=[],o={};for(let s=0;s<r.length;s++){const i=r[s];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let s=0;s<r.length;s++){const i=r[s];if(i.type==="file"||i.type==="submit"||i.type==="button")continue;const a=i.getAttribute("data-ln-fill-as")||i.name;if(!a||!(a in t))continue;const n=t[a];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(o[i.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=le(n);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<i.options.length;c++)i.options[c].selected=n.indexOf(i.options[c].value)!==-1;l.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=se,window.lnCore.serializeForm=ie,window.lnCore.resolveFormMethod=oe);const F={};function ae(e,t){F[e]=t}function ce(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ae,window.lnCore.getDataMapper=ce);function ue(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,y(function(){new MutationObserver(function(){T(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function de(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];R[r]=t}function fe(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=de,window.lnCore.getLocaleFallback=fe,window.lnCore.ensureLocaleObserver=ue);const A={};function we(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=A[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const a=r[i],n=a.getAttribute("data-ln-field");t[n]!=null&&(a.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const a=l[i],n=a.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&&a.setAttribute(d,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const a=o[i],n=a.getAttribute("data-ln-show");n in t&&a.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let i=0;i<s.length;i++){const a=s[i],n=a.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&&a.classList.toggle(d,!!t[f])}}return e}function he(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<r.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[l],t??null),r[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)M(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function j(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,a){return t[a]!==void 0?t[a]:""}))}const l=function(s,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const i=o[s],a=i.attributes;for(let n=0;n<a.length;n++){const c=a[n];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function be(e,t,r,l,o,s){const i={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(i[u]=c)}const a=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(l(c));let d=i[u];if(d)o(d,c,n);else{const f=we(r,s);if(!f||(j(f,c),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),o(d,c,n)}a.appendChild(d)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=M,window.lnCore.lnFill=he,window.lnCore.renderList=be);function x(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function B(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function _(e,t,r=!1){const l=e.getAttribute(t);if(l===null)return!!r;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const k=new Map;function H(e,t){const r=(e?e.join("|"):"")+"::"+t;if(k.has(r))return k.get(r);const l=new Set(e||[]),o=function(s,i){const a=s.getAttribute(i);return a!==null&&l.has(a)?a:t};return k.set(r,o),o}function U(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function V(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function P(e,t,r,l,o){if(!e||t===null)return!0;const s=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const a=n=>{o?console.warn(n,o):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(a(`[${s}] Value ${n} for attribute "${r}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(a(`[${s}] Value ${n} for attribute "${r}" is greater than max (${e.max}).`),!1):!0}if(i==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="json")try{return JSON.parse(t),!0}catch(n){return a(`[${s}] Invalid JSON for attribute "${r}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function Q(e,t,r){for(const l in r){const[o,s,i]=r[l];Object.defineProperty(e,l,{get:function(){return o(t,s,i)},enumerable:!0,configurable:!0})}return e}function z(e){const t={};for(const r in e){const l=e[r];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=H(l.values,l.fallback);break;case"integer":o=B;break;case"float":o=U;break;case"boolean":o=_;break;case"list":o=W;break;case"json":o=V;break;case"string":default:o=x;break}o||(o=x),t[l.prop]=[o,r,l.fallback]}return t}function pe(e){const t={};for(const r in e){const l=e[r];l&&l.effect&&(t[r]=l.effect)}return Object.keys(t).length?t:null}function ge(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=z,window.lnCore.attrStr=x,window.lnCore.attrInt=B,window.lnCore.attrBool=_,window.lnCore.attrList=W,window.lnCore.attrEnum=H,window.lnCore.attrFloat=U,window.lnCore.attrJson=V);function p(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function J(e,t,r,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:l};if(e.matches&&e.matches(s)&&p(e,i),e.querySelectorAll){const a=e.querySelectorAll(s);for(let n=0;n<a.length;n++)p(a[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ce(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function me(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function K(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ye(e){const t=K(),r=e.observed||[];for(let l=0;l<r.length;l++){const o=r[l];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=ge(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function G(e,t,r,l){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const i=s.effects&&s.effects[r];i?i(t,r,l):s.onAttrChange&&(!s.declared||s.declared.has(r))&&s.onAttrChange(t,r,l)}}function ve(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=K(),o=l.byAttr.get(t),s=I()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&v(i)){const a=l.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let c=0;c<a.length;c++)P(a[c].spec,n,t,a[c].componentTag,i)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const a=l.byReactive.get(t);a&&G(a,i,t,e.oldValue),l.reactiveWildcard.length&&G(l.reactiveWildcard,i,t,e.oldValue)}if(o)for(let a=0;a<o.length;a++){const n=o[a];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(J(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ve(t[r])}catch(l){console.error("[ln-core] mutation handler failed",t[r].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function S(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function L(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function E(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function xe(e){const t=S();if(!t.length)return;const r=e.target;if(r){const o=r.nodeType===1?r:r.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=L();if(e.target&&l.length)for(let o=0;o<l.length;o++){const s=l[o],i=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(i)?e.target:e.target.closest?e.target.closest(i):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(i):null;a&&s.onSubtreeChange(a,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a];if(n.selector&&n.attribute&&n.ComponentFn){if(!i)s.matches&&s.matches(n.query)&&p(s,n);else if(s.matches&&s.matches(n.query)&&p(s,n),s.querySelectorAll){const c=s.querySelectorAll(n.query);for(let u=0;u<c.length;u++)p(c[u],n)}}n.onInit&&n.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){const i=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const n=t[a],c=n.query;if(c){if(!i)s.matches&&s.matches(c)&&E(s,n);else if(s.matches&&s.matches(c)&&E(s,n),s.querySelectorAll){const u=s.querySelectorAll(c);for(let d=0;d<u.length;d++)E(u[d],n)}}}}}}function X(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{xe(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){S().push(e),e.onSubtreeChange&&e.query&&L().push(e),X()}function Y(e,t,r,l,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,a=o.onSubtreeChange||null,n=o.onInit||null,c=o.onAttrChange||null,u=o.effects||null,d=o.attributes||null,f=d?pe(d):u,w=d?new Set(Object.keys(d)):null,g=o.persist||null;function b(D){const h=D||document.body;if(J(h,e,t,r),d&&I())for(const m in d){const Te=d[m],N=Array.from(h.querySelectorAll("["+m+"]"));h.matches&&h.matches("["+m+"]")&&N.push(h);for(let q=0;q<N.length;q++){const $=N[q];v($)&&P(Te,$.getAttribute(m),m,l,$)}}n&&n(h)}const C=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let h;for(;(h=D.exec(e))!==null;)C.push(h[1])}else C.push(e);ye({selector:e,attribute:t,componentTag:l,attributes:d,ComponentFn:r,onInit:n,observed:C.concat(s),onAttributeChange:i,onAttrChange:c,effects:f,declared:w,persist:g}),Ae();const Ie=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ee=o.subtreeQuery||(Ie?e:"["+e+"]"),te={selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:a,query:ee};S().push(te),a&&ee&&L().push(te),X(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=_e);function ne(){Ce()>0?me(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),b}function Z(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,r={},l=Z(t);if(!l)return r;const o=l.split("&");for(let s=0;s<o.length;s++){const i=o[s];if(!i)continue;const a=i.indexOf(":"),n=a>-1?i.slice(0,a):i,c=a>-1?i.slice(a+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function ke(e){if(!e)return null;const t=O();return e in t?t[e]:null}function Se(e,t){if(!e)return;const r=O();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(s){const i=r[s];return i===""?s:s+":"+encodeURIComponent(i)}).join("&");Z(location.hash)!==o&&(location.hash=o)}function Le(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ee(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Oe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ne(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function qe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),l=e.slice(t+1),o=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=ke,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=Le,window.lnCore.resolveHashNamespace=Ee,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Ne,window.lnCore.hashFilterDecode=qe);function $e(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=$e),(function(){const e="data-ln-nav",t="lnNav";if(window[t]!==void 0)return;const r={"data-ln-nav":{effect:i,type:"string",fallback:"active",description:"CSS class name applied to active navigation links"},"data-ln-nav-exact":{prop:"exact",read:_,effect:i,type:"boolean",fallback:!1,description:"Match exact URL pathname instead of prefix matching"}},l=z(r);if(history._lnNavCallbacks=history._lnNavCallbacks||[],!history._lnNavPatched){const a=history.pushState;history.pushState=function(){a.apply(history,arguments);for(const c of history._lnNavCallbacks)c()};const n=history.replaceState;history.replaceState=function(){n.apply(history,arguments);for(const c of history._lnNavCallbacks)c()},history._lnNavPatched=!0}function o(a){return this.dom=a,Q(this,a,l),this.activeClass=a.getAttribute(e)||"active",this.updateHandler=()=>this.update(),window.addEventListener("popstate",this.updateHandler),history._lnNavCallbacks.push(this.updateHandler),this.observer=null,this.update(),this}o.prototype.update=function(){if(!this.activeClass||re(this.dom,"ln-nav:before-update",{target:this.dom}).defaultPrevented)return;const n=Array.from(this.dom.querySelectorAll("a")),c=window.location.pathname,u=s(c),d=[];for(const f of n){const w=f.getAttribute("href");if(!w||w==="#"||w.startsWith("#")||w.startsWith("javascript:")||w.startsWith("mailto:")||w.startsWith("tel:")){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}if(f.hostname&&f.hostname!==window.location.hostname){f.classList.remove(this.activeClass),f.removeAttribute("aria-current");continue}const g=s(w),b=g===u,C=!this.exact&&g!=="/"&&u.startsWith(g+"/");b||C?(f.classList.add(this.activeClass),f.setAttribute("aria-current","page"),d.push(f)):(f.classList.remove(this.activeClass),f.removeAttribute("aria-current"))}T(this.dom,"ln-nav:update",{target:this.dom,activeLinks:d})},o.prototype.destroy=function(){if(!this.dom[t])return;this.observer&&this.observer.disconnect(),window.removeEventListener("popstate",this.updateHandler);const a=history._lnNavCallbacks.indexOf(this.updateHandler);a!==-1&&history._lnNavCallbacks.splice(a,1),delete this.dom[t]};function s(a){try{return new URL(a,window.location.href).pathname.replace(/\/$/,"")||"/"}catch{return a.replace(/\/$/,"")||"/"}}function i(a,n){const c=a[t];if(c){if(n===e){if(!a.hasAttribute(e)){c.destroy();return}const u=c.activeClass,d=a.getAttribute(e)||"active";if(u!==d){const f=a.querySelectorAll("a");for(const w of f)u&&w.classList.remove(u);c.activeClass=d}}c.update()}}Y(e,t,o,"ln-nav",{attributes:r,onSubtreeChange:function(a){a[t]&&a[t].update()}})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function V(){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 F(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(!F(r))return}e.apply(console,t)}}function v(e,t,i){const r=i||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,r),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:r}))}function S(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){S(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function se(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ae(e,t){const i=!!(t&&t.typed),r=t&&t.exclude,o={},a=e.elements,n={};if(i)for(let s=0;s<a.length;s++){const l=a[s];l.name&&l.type==="checkbox"&&!l.disabled&&(n[l.name]=(n[l.name]||0)+1)}for(let s=0;s<a.length;s++){const l=a[s];if(!(!l.name||l.disabled||l.type==="file"||l.type==="submit"||l.type==="button")&&!(r&&l.matches&&l.matches(r)))if(l.type==="checkbox")i&&n[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 u=0;u<l.options.length;u++)l.options[u].selected&&o[l.name].push(l.options[u].value)}else if(i&&l.type==="hidden")o[l.name]=l.value;else if(i&&(l.type==="number"||l.type==="range")){const u=Number(l.value);o[l.name]=l.value===""||isNaN(u)?null:u}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 ce(e,t){const i=e.elements,r=[],o={};for(let a=0;a<i.length;a++){const n=i[a];n.name&&n.type==="checkbox"&&(o[n.name]=(o[n.name]||0)+1)}for(let a=0;a<i.length;a++){const n=i[a];if(n.type==="file"||n.type==="submit"||n.type==="button")continue;const s=n.getAttribute("data-ln-fill-as")||n.name;if(!s||!(s in t))continue;const l=t[s];if(n.type==="checkbox"){if(Array.isArray(l))n.checked=l.indexOf(n.value)!==-1;else if(o[n.name]>1){const u=String(l).split(",").map(function(c){return c.trim()});n.checked=u.indexOf(n.value)!==-1}else n.checked=ue(l);r.push(n)}else if(n.type==="radio")n.checked=n.value===String(l),r.push(n);else if(n.type==="select-multiple"){if(Array.isArray(l))for(let u=0;u<n.options.length;u++)n.options[u].selected=l.indexOf(n.options[u].value)!==-1;r.push(n)}else n.value=l,n.tagName==="SELECT"&&l!=null&&n.setAttribute("data-ln-value",l),r.push(n)}return r}function de(e,t,{get:i,set:r}){Object.defineProperty(e,"value",{get:function(){return i?i.call(this):t.get.call(this)},set:function(o){r?r.call(this,o,a=>t.set.call(this,a)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=ae,window.lnCore.resolveFormMethod=se);const B={};function fe(e,t){B[e]=t}function he(e){return B[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=fe,window.lnCore.getDataMapper=he);function y(e){const t=e?e.closest("[lang]"):null,i=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return i?i.trim():"en-US"}function W(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,S(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const P={};function we(e,t){if(!e||typeof t!="object")return;const i=e.toLowerCase().split("-")[0];P[i]=t}function pe(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=we,window.lnCore.getLocaleFallback=pe,window.lnCore.ensureLocaleObserver=W);const L={};function me(e,t){L[e]||(L[e]=document.querySelector('[data-ln-template="'+e+'"]'));const i=L[e];return i?i.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function U(e,t){if(!e||!t)return e;const i=e.querySelectorAll("[data-ln-field]");for(let n=0;n<i.length;n++){const s=i[n],l=s.getAttribute("data-ln-field");t[l]!=null&&(s.textContent=t[l])}const r=e.querySelectorAll("[data-ln-attr]");for(let n=0;n<r.length;n++){const s=r[n],l=s.getAttribute("data-ln-attr").split(",");for(let u=0;u<l.length;u++){const c=l[u].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),f=c[1].trim();t[f]!=null&&s.setAttribute(d,t[f])}}const o=e.querySelectorAll("[data-ln-show]");for(let n=0;n<o.length;n++){const s=o[n],l=s.getAttribute("data-ln-show");l in t&&s.classList.toggle("hidden",!t[l])}const a=e.querySelectorAll("[data-ln-class]");for(let n=0;n<a.length;n++){const s=a[n],l=s.getAttribute("data-ln-class").split(",");for(let u=0;u<l.length;u++){const c=l[u].trim().split(":");if(c.length!==2)continue;const d=c[0].trim(),f=c[1].trim();f in t&&s.classList.toggle(d,!!t[f])}}return e}function be(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const i=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let r=0;r<i.length;r++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",i[r],t??null),i[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)U(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let i=0;i<t.length;i++)t[i].textContent=""}})));function K(e,t){if(!e||!t)return e;const i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;i.nextNode();){const a=i.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(n,s){return t[s]!==void 0?t[s]:""}))}const r=function(a,n){return t[n]!==void 0?t[n]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let a=0;a<o.length;a++){const n=o[a],s=n.attributes;for(let l=0;l<s.length;l++){const u=s[l];u.value.indexOf("{{")!==-1&&n.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ge(e,t,i,r,o,a){const n={};for(let l=0;l<e.children.length;l++){const u=e.children[l],c=u.getAttribute("data-ln-render-key");c&&(n[c]=u)}const s=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],c=String(r(u));let d=n[c];if(d)o(d,u,l);else{const f=me(i,a);if(!f||(K(f,u),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",c),o(d,u,l)}s.appendChild(d)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=K,window.lnCore.fill=U,window.lnCore.lnFill=be,window.lnCore.renderList=ge);function O(e,t,i){const r=e.getAttribute(t);return r===null?i:r}function Q(e,t,i){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?i:r}function G(e,t,i=!1){const r=e.getAttribute(t);if(r===null)return!!i;const o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function J(e,t){return(e.getAttribute(t)||"").split(",").map(i=>i.trim()).filter(Boolean)}const T=new Map;function z(e,t){const i=(e?e.join("|"):"")+"::"+t;if(T.has(i))return T.get(i);const r=new Set(e||[]),o=function(a,n){const s=a.getAttribute(n);return s!==null&&r.has(s)?s:t};return T.set(i,o),o}function X(e,t,i){const r=parseFloat(e.getAttribute(t));return isNaN(r)?i:r}function Y(e,t,i){const r=e.getAttribute(t);if(!r)return i;try{return JSON.parse(r)}catch{return i}}function Z(e,t,i,r,o){if(!e||t===null)return!0;const a=r||"ln-component",n=e.type;if(n==="trigger"||n==="marker"||n==="string"||n==="list"||!n||t===""&&e.fallback!==void 0)return!0;const s=l=>{o?console.warn(l,o):console.warn(l)};if(n==="boolean"){const l=t.trim().toLowerCase();return l!==""&&l!=="true"&&l!=="false"&&l!=="1"&&l!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${i}". Allowed: "true", "false", or presence-only.`),!1):!0}if(n==="enum"){const l=e.values||[];return l.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${i}". Allowed: ${l.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(n==="integer"){if(!/^-?\d+$/.test(t))return s(`[${a}] Invalid integer "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1;const l=parseInt(t,10);return e.min!==void 0&&l<e.min?(s(`[${a}] Value ${l} for attribute "${i}" is less than min (${e.min}).`),!1):e.max!==void 0&&l>e.max?(s(`[${a}] Value ${l} for attribute "${i}" is greater than max (${e.max}).`),!1):!0}if(n==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${i}". Fallback: ${e.fallback}.`),!1):!0;if(n==="json")try{return JSON.parse(t),!0}catch(l){return s(`[${a}] Invalid JSON for attribute "${i}": ${l.message}. Fallback: ${e.fallback}.`),!1}return!0}function ye(e,t,i){for(const r in i){const[o,a,n]=i[r];Object.defineProperty(e,r,{get:function(){return o(t,a,n)},enumerable:!0,configurable:!0})}return e}function Ce(e){const t={};for(const i in e){const r=e[i];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=Q;break;case"float":o=X;break;case"boolean":o=G;break;case"list":o=J;break;case"json":o=Y;break;case"string":default:o=O;break}o||(o=O),t[r.prop]=[o,i,r.fallback]}return t}function _e(e){const t={};for(const i in e){const r=e[i];r&&r.effect&&(t[i]=r.effect)}return Object.keys(t).length?t:null}function ve(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const i in e.effects)t.add(i);if(e.onAttrChange&&e.declared)for(const i of e.declared)t.add(i);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=ye,window.lnCore.attrSpec=Ce,window.lnCore.attrStr=O,window.lnCore.attrInt=Q,window.lnCore.attrBool=G,window.lnCore.attrList=J,window.lnCore.attrEnum=z,window.lnCore.attrFloat=X,window.lnCore.attrJson=Y);function N(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(i){console.error("["+t.attribute+"] init failed",e,i)}}}function ee(e,t,i,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",n={selector:t,attribute:i,ComponentFn:r};if(e.matches&&e.matches(a)&&N(e,n),e.querySelectorAll){const s=e.querySelectorAll(a);for(let l=0;l<s.length;l++)N(s[l],n)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function xe(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ae(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function te(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function De(e){const t=te(),i=e.observed||[];for(let r=0;r<i.length;r++){const o=i[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(a=>a.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=ve(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 ne(e,t,i,r){for(let o=0;o<e.length;o++){const a=e[o];if(!t[a.attribute])continue;const n=a.effects&&a.effects[i];n?n(t,i,r):a.onAttrChange&&(!a.declared||a.declared.has(i))&&a.onAttrChange(t,i,r)}}function Ee(e){const t=e.attributeName,i=t.indexOf("data-ln-")===0,r=te(),o=r.byAttr.get(t),a=V()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!i&&!o&&!a)return;const n=e.target;if(e.oldValue!==n.getAttribute(t)){if(a&&F(n)){const s=r.byDeclaredAttr.get(t),l=n.getAttribute(t);for(let u=0;u<s.length;u++)Z(s[u].spec,l,t,s[u].componentTag,n)}if(window.lnCore._debugSink&&(i||o)&&window.lnCore._debugSink("attr",t,n,{oldValue:e.oldValue,newValue:n.getAttribute(t)}),i){const s=r.byReactive.get(t);s&&ne(s,n,t,e.oldValue),r.reactiveWildcard.length&&ne(r.reactiveWildcard,n,t,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const l=o[s];if(l.handler){l.handler(n,t,e.oldValue);continue}l.onAttributeChange&&n[l.attribute]?l.onAttributeChange(n,t):(ee(n,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(n))}}}function Ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,S(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++)try{Ee(t[i])}catch(r){console.error("[ln-core] mutation handler failed",t[i].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 $(e,t){if(!document.contains(e))if(t.attribute){const i=e[t.attribute];if(i&&typeof i.destroy=="function")try{i.destroy()}catch(r){console.error("["+t.attribute+"] destroy failed",e,r)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function Se(e){const t=I();if(!t.length)return;const i=e.target;if(i){const r=i.nodeType===1?i:i.parentElement;if(r&&(r.isContentEditable||r.closest&&r.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let r=0;r<t.length;r++){const o=t[r];if(o.onSubtreeChange&&o.query){const a=o.query,n=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;n&&o.onSubtreeChange(n,e)}}for(let r=0;r<e.addedNodes.length;r++){const o=e.addedNodes[r];if(o.nodeType===1){const a=!!(o.firstElementChild||o.children&&o.children.length);for(let n=0;n<t.length;n++){const s=t[n];if(s.selector&&s.attribute&&s.ComponentFn){if(!a)o.matches&&o.matches(s.query)&&N(o,s);else if(o.matches&&o.matches(s.query)&&N(o,s),o.querySelectorAll){const l=o.querySelectorAll(s.query);for(let u=0;u<l.length;u++)N(l[u],s)}}s.onInit&&s.onInit(o)}}}for(let r=0;r<e.removedNodes.length;r++){const o=e.removedNodes[r];if(o.nodeType===1){const a=!!(o.firstElementChild||o.children&&o.children.length);for(let n=0;n<t.length;n++){const s=t[n],l=s.query;if(l){if(!a)o.matches&&o.matches(l)&&$(o,s);else if(o.matches&&o.matches(l)&&$(o,s),o.querySelectorAll){const u=o.querySelectorAll(l);for(let c=0;c<u.length;c++)$(u[c],s)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,S(function(){new MutationObserver(function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.type==="childList")try{Se(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ke(e){I().push(e),ie()}function re(e,t,i,r,o={}){const a=o.extraAttributes||[],n=o.onAttributeChange||null,s=o.onSubtreeChange||null,l=o.onInit||null,u=o.onAttrChange||null,c=o.effects||null,d=o.attributes||null,f=d?_e(d):c,p=d?new Set(Object.keys(d)):null,w=o.persist||null;function m(E){const h=E||document.body;if(ee(h,e,t,i),d&&V())for(const g in d){const R=d[g],H=Array.from(h.querySelectorAll("["+g+"]"));h.matches&&h.matches("["+g+"]")&&H.push(h);for(let j=0;j<H.length;j++){const M=H[j];F(M)&&Z(R,M.getAttribute(g),g,r,M)}}l&&l(h)}const b=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let h;for(;(h=E.exec(e))!==null;)b.push(h[1])}else b.push(e);De({selector:e,attribute:t,componentTag:r,attributes:d,ComponentFn:i,onInit:l,observed:b.concat(a),onAttributeChange:n,onAttrChange:u,effects:f,declared:p,persist:w}),Ne();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,D=o.subtreeQuery||(A?e:"["+e+"]");I().push({selector:e,attribute:t,ComponentFn:i,onInit:l,onSubtreeChange:s,query:D}),ie(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=re,window.lnCore.observeLifecycle=ke);function x(){xe()>0?Ae(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",x):x(),m}function oe(e){return(e||"").replace(/^#/,"")}function q(e){const t=e===void 0?location.hash:e,i={},r=oe(t);if(!r)return i;const o=r.split("&");for(let a=0;a<o.length;a++){const n=o[a];if(!n)continue;const s=n.indexOf(":"),l=s>-1?n.slice(0,s):n,u=s>-1?n.slice(s+1):"";if(l)try{i[l]=decodeURIComponent(u)}catch{i[l]=u}}return i}function Re(e){if(!e)return null;const t=q();return e in t?t[e]:null}function Fe(e,t){if(!e)return;const i=q();t==null?delete i[e]:i[e]=String(t);const o=Object.keys(i).map(function(a){const n=i[a];return n===""?a:a+":"+encodeURIComponent(n)}).join("&");oe(location.hash)!==o&&(location.hash=o)}function Le(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 i=e.getAttribute("data-ln-hash");if(i&&i.trim()!=="")return i.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 Te(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ie(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function $e(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function qe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const i=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:i,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=q,window.lnCore.hashGet=Re,window.lnCore.hashSet=Fe,window.lnCore.hashLinkClick=Le,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Te,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=qe);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);const _={};function k(e){const t=e||"default";if(!_[t]){const i=new Intl.NumberFormat(e,{useGrouping:!0}),r=i.formatToParts(1234.5);let o="",a=".";for(let n=0;n<r.length;n++)r[n].type==="group"&&(o=r[n].value),r[n].type==="decimal"&&(a=r[n].value);_[t]={groupSep:o,decimalSep:a,fmt:i}}return _[t]}function le(e,t,i){if(e==null||typeof e!="string")return"";let r=e.trim();return r===""?"":(r=r.replace(/[$€£¥]/g,""),t&&(r=r.split(t).join("")),r=r.replace(/\s/g,""),i&&i!=="."&&(r=r.replace(i,".")),r=r.replace(/[^\d.-]/g,""),r)}function je(e,t){if(typeof e=="number")return isNaN(e)?NaN:e;if(e==null||typeof e!="string")return NaN;const i=e.trim();if(i===""||i==="-")return NaN;const r=k(t),o=le(i,r.groupSep,r.decimalSep);if(o===""||o==="-")return NaN;const a=parseFloat(o);return isNaN(a)?NaN:a}function C(e,t,i={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",o=i.maxDecimals!=null?parseInt(i.maxDecimals,10):null,a=i.userDecimals!=null?i.userDecimals:null;if(o!==null){const n=r+"|max:"+o;return _[n]||(_[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:o})),_[n].format(e)}if(a!==null&&a>0){const n=r+"|exact:"+a;return _[n]||(_[n]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:a,maximumFractionDigits:a})),_[n].format(e)}return k(t).fmt.format(e)}function Me(e,t){if(!e)return 0;if(t<=0)return e.startsWith("-")?1:0;let i=t,r=0;for(let o=0;o<e.length&&i>0;o++)r=o+1,/[0-9]/.test(e[o])&&i--;return i>0&&(r=e.length),r}(function(){const e="data-ln-number",t="lnNumber";if(window[t]!==void 0)return;function i(n){const s=n[t];s&&(s.isTextElement?s._initTextElement():isNaN(s.value)||s._displayFormatted(s.value))}const r={"data-ln-number":{type:"marker",effect:i,description:"Activates localized number formatting on input or text element"},"data-ln-value":{type:"float",effect:i,description:"Raw unformatted numeric value"},"data-ln-number-decimals":{type:"integer",fallback:0,min:0,max:20,effect:i,description:"Number of decimal fraction digits"},"data-ln-number-min":{type:"float",effect:i,description:"Minimum allowed numeric value"},"data-ln-number-max":{type:"float",effect:i,description:"Maximum allowed numeric value"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");function a(n){if(n[t])return n[t];n[t]=this,this.dom=n;const s=this;if(this._onLocaleChange=function(){s.isTextElement?s._formatTextContent():isNaN(s.value)||s._displayFormatted(s.value)},W(),document.addEventListener("ln-core:locale-change",this._onLocaleChange),n.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;const l=document.createElement("input");l.type="hidden",l.name=n.name,n.removeAttribute("name"),n.hasAttribute("data-ln-fill-as")&&l.setAttribute("data-ln-fill-as",n.getAttribute("data-ln-fill-as")),n.type="text",n.setAttribute("inputmode","decimal"),n.insertAdjacentElement("afterend",l),this._hidden=l,Object.defineProperty(l,"value",{get:function(){return o.get.call(l)},set:function(c){if(o.set.call(l,c),c!==""&&!isNaN(parseFloat(c))){const d=s.dom.getAttribute("data-ln-number-decimals");s._setDisplayRaw(C(parseFloat(c),y(s.dom),{maxDecimals:d}))}else s._setDisplayRaw("");s.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),de(n,o,{get:function(){return o.get.call(n)},set:function(c){if(c===""){s._setDisplayRaw(""),s._setHiddenRaw(""),n.dispatchEvent(new Event("input",{bubbles:!0}));return}const d=typeof c=="number"?c:parseFloat(String(c));if(isNaN(d))s._setDisplayRaw(String(c)),s._setHiddenRaw("");else{s._setHiddenRaw(d);const f=n.getAttribute("data-ln-number-decimals");s._setDisplayRaw(C(d,y(n),{maxDecimals:f}))}n.dispatchEvent(new Event("input",{bubbles:!0}))}}),this._onInput=function(){s._handleInput()},n.addEventListener("input",this._onInput),this._onKeyDown=function(c){if(c.key!=="Backspace")return;const d=n.selectionStart,f=n.selectionEnd;if(d!==f||d===0)return;const p=k(y(n)),w=o.get.call(n),m=w[d-1];if(m===p.groupSep||/\s/.test(m)){c.preventDefault();const b=d-2>=0?d-2:0,A=w.slice(0,b)+w.slice(d);o.set.call(n,A),n.setSelectionRange(b,b),n.dispatchEvent(new Event("input",{bubbles:!0}))}},n.addEventListener("keydown",this._onKeyDown),this._onPaste=function(c){c.preventDefault();const d=(c.clipboardData||window.clipboardData).getData("text"),f=je(d,y(n));s.value=isNaN(f)?NaN:f},n.addEventListener("paste",this._onPaste);const u=n.value;if(u!==""){const c=parseFloat(u);if(!isNaN(c)){const d=n.getAttribute("data-ln-number-decimals");this._setHiddenRaw(c),this._setDisplayRaw(C(c,y(n),{maxDecimals:d})),n.dispatchEvent(new Event("input",{bubbles:!0}))}}return n.form&&(this._onFormReset=function(){setTimeout(function(){const c=n.defaultValue;if(c!==""){const d=parseFloat(c);if(!isNaN(d)){const f=n.getAttribute("data-ln-number-decimals");s._setHiddenRaw(d),s._setDisplayRaw(C(d,y(n),{maxDecimals:f})),n.dispatchEvent(new Event("input",{bubbles:!0}));return}}s._setHiddenRaw(""),s._setDisplayRaw(""),n.dispatchEvent(new Event("input",{bubbles:!0}))},0)},n.form.addEventListener("reset",this._onFormReset)),this}a.prototype._initTextElement=function(){const n=this.dom;let s=n.getAttribute("data-ln-value"),l=n.getAttribute("data-ln-number"),u=null;s!==null&&s!==""?u=s:l!==null&&l!==""&&l!=="true"?u=l:u=n.textContent.trim();const c=parseFloat(u);isNaN(c)?this._rawValue=null:(this._rawValue=c,n.hasAttribute("data-ln-value")||n.setAttribute("data-ln-value",String(c)),this._formatTextContent())},a.prototype._formatTextContent=function(){if(this._rawValue!==null&&!isNaN(this._rawValue)){const n=this.dom.getAttribute("data-ln-number-decimals");this.dom.textContent=C(this._rawValue,y(this.dom),{maxDecimals:n})}},a.prototype._handleInput=function(){const n=this.dom,s=o.get.call(n);if(s===""){this._setHiddenRaw(""),v(n,"ln-number:input",{value:NaN,formatted:""});return}if(s==="-"){this._setHiddenRaw(""),v(n,"ln-number:input",{value:NaN,formatted:"-"});return}const l=n.selectionStart;let u=0;for(let h=0;h<l;h++)/[0-9]/.test(s[h])&&u++;const c=y(n),d=k(c);let f=s,p=le(s,d.groupSep,d.decimalSep),w=parseFloat(p);if(isNaN(w)){this._setHiddenRaw(""),v(n,"ln-number:input",{value:NaN,formatted:s});return}const m=n.getAttribute("data-ln-number-decimals"),b=p.indexOf(".");if(m!==null&&b!==-1){const h=parseInt(m,10),g=p.slice(b+1);if(h===0)p=p.slice(0,b),f=f.split(d.decimalSep)[0],w=parseFloat(p),this._setDisplayRaw(f);else if(g.length>h){p=p.slice(0,b+1+h);const R=f.split(d.decimalSep);f=R[0]+d.decimalSep+R[1].slice(0,h),w=parseFloat(p),this._setDisplayRaw(f)}}const A=n.getAttribute("data-ln-number-max");if(A!==null&&w>parseFloat(A)){const h=parseFloat(A),g=C(h,c,{maxDecimals:m});this._setDisplayRaw(g),this._setHiddenRaw(h),n.setSelectionRange(g.length,g.length),v(n,"ln-number:input",{value:h,formatted:g});return}if(f.endsWith(d.decimalSep)||d.decimalSep!=="."&&f.endsWith(".")){this._setHiddenRaw(w),v(n,"ln-number:input",{value:w,formatted:f});return}const D=p.indexOf(".");if(D!==-1&&p.slice(D+1).endsWith("0")){this._setHiddenRaw(w),v(n,"ln-number:input",{value:w,formatted:f});return}let x;if(m!==null)x=C(w,c,{maxDecimals:m});else{const h=D!==-1?p.slice(D+1).length:0;x=C(w,c,{userDecimals:h})}this._setDisplayRaw(x);const E=Me(x,u);n.setSelectionRange(E,E),this._setHiddenRaw(w),v(n,"ln-number:input",{value:w,formatted:x})},a.prototype._setHiddenRaw=function(n){this._hidden&&o.set.call(this._hidden,String(n))},a.prototype._setDisplayRaw=function(n){this.isTextElement?this.dom.textContent=String(n):o.set.call(this.dom,String(n))},a.prototype._displayFormatted=function(n){if(this.isTextElement)this._formatTextContent();else{const s=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(C(n,y(this.dom),{maxDecimals:s}))}},Object.defineProperty(a.prototype,"value",{get:function(){if(this.isTextElement)return this._rawValue;const n=o.get.call(this._hidden);return n===""?NaN:parseFloat(n)},set:function(n){const s=typeof n=="number"?n:parseFloat(n);if(this.isTextElement){isNaN(s)?(this._rawValue=null,this.dom.textContent=""):(this._rawValue=s,this.dom.setAttribute("data-ln-value",String(s)),this._formatTextContent());return}if(isNaN(s)){this._setDisplayRaw(""),this._setHiddenRaw(""),this.dom.dispatchEvent(new Event("input",{bubbles:!0}));return}this._setHiddenRaw(s);const l=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(C(s,y(this.dom),{maxDecimals:l})),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(a.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:o.get.call(this.dom)}}),a.prototype.destroy=function(){this.dom[t]&&(this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement||(this._onFormReset&&this.dom.form&&this.dom.form.removeEventListener("reset",this._onFormReset),this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("keydown",this._onKeyDown),this.dom.removeEventListener("paste",this._onPaste),this._hidden&&(this.dom.name=this._hidden.name,this._hidden.remove()),this.dom.type="number",this.dom.removeAttribute("inputmode")),delete this.dom[t])},re(e,t,a,"ln-number",{attributes:r,extraAttributes:["lang"],onAttributeChange:i})})()})();
|
|
1
|
+
(function(){"use strict";function W(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function T(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(!T(r))return}e.apply(console,t)}}function D(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 L(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){L(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ue(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={},a=e.elements,s={};if(n)for(let u=0;u<a.length;u++){const i=a[u];i.name&&i.type==="checkbox"&&!i.disabled&&(s[i.name]=(s[i.name]||0)+1)}for(let u=0;u<a.length;u++){const i=a[u];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&s[i.name]===1?o[i.name]=i.checked:(o[i.name]||(o[i.name]=[]),i.checked&&o[i.name].push(i.value));else if(i.type==="radio")i.checked&&(o[i.name]=i.value);else if(i.type==="select-multiple"){o[i.name]=[];for(let l=0;l<i.options.length;l++)i.options[l].selected&&o[i.name].push(i.options[l].value)}else if(n&&i.type==="hidden")o[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const l=Number(i.value);o[i.name]=i.value===""||isNaN(l)?null:l}else o[i.name]=i.value}return o}function de(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function fe(e,t){const n=e.elements,r=[],o={};for(let a=0;a<n.length;a++){const s=n[a];s.name&&s.type==="checkbox"&&(o[s.name]=(o[s.name]||0)+1)}for(let a=0;a<n.length;a++){const s=n[a];if(s.type==="file"||s.type==="submit"||s.type==="button")continue;const u=s.getAttribute("data-ln-fill-as")||s.name;if(!u||!(u in t))continue;const i=t[u];if(s.type==="checkbox"){if(Array.isArray(i))s.checked=i.indexOf(s.value)!==-1;else if(o[s.name]>1){const l=String(i).split(",").map(function(c){return c.trim()});s.checked=l.indexOf(s.value)!==-1}else s.checked=de(i);r.push(s)}else if(s.type==="radio")s.checked=s.value===String(i),r.push(s);else if(s.type==="select-multiple"){if(Array.isArray(i))for(let l=0;l<s.options.length;l++)s.options[l].selected=i.indexOf(s.options[l].value)!==-1;r.push(s)}else s.value=i,s.tagName==="SELECT"&&i!=null&&s.setAttribute("data-ln-value",i),r.push(s)}return r}function he(e,t,{get:n,set:r}){Object.defineProperty(e,"value",{get:function(){return n?n.call(this):t.get.call(this)},set:function(o){r?r.call(this,o,a=>t.set.call(this,a)):t.set.call(this,o)},configurable:!0})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=fe,window.lnCore.serializeForm=ce,window.lnCore.resolveFormMethod=ue);const P={};function we(e,t){P[e]=t}function pe(e){return P[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=we,window.lnCore.getDataMapper=pe);function _(e){const t=e?e.closest("[lang]"):null,n=(t?t.getAttribute("lang")||t.lang:null)||(typeof document<"u"&&document.documentElement?document.documentElement.getAttribute("lang")||document.documentElement.lang:null)||(typeof navigator<"u"?navigator.language:null);return n?n.trim():"en-US"}function U(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,L(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const K={};function me(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];K[n]=t}function be(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=me,window.lnCore.getLocaleFallback=be,window.lnCore.ensureLocaleObserver=U);const I={};function ge(e,t){I[e]||(I[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=I[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function Q(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let s=0;s<n.length;s++){const u=n[s],i=u.getAttribute("data-ln-field");t[i]!=null&&(u.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let s=0;s<r.length;s++){const u=r[s],i=u.getAttribute("data-ln-attr").split(",");for(let l=0;l<i.length;l++){const c=i[l].trim().split(":");if(c.length!==2)continue;const f=c[0].trim(),d=c[1].trim();t[d]!=null&&u.setAttribute(f,t[d])}}const o=e.querySelectorAll("[data-ln-show]");for(let s=0;s<o.length;s++){const u=o[s],i=u.getAttribute("data-ln-show");i in t&&u.classList.toggle("hidden",!t[i])}const a=e.querySelectorAll("[data-ln-class]");for(let s=0;s<a.length;s++){const u=a[s],i=u.getAttribute("data-ln-class").split(",");for(let l=0;l<i.length;l++){const c=i[l].trim().split(":");if(c.length!==2)continue;const f=c[0].trim(),d=c[1].trim();d in t&&u.classList.toggle(f,!!t[d])}}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 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)Q(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 a=n.currentNode;a.textContent.indexOf("{{")!==-1&&(a.textContent=a.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(s,u){return t[u]!==void 0?t[u]:""}))}const r=function(a,s){return t[s]!==void 0?t[s]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let a=0;a<o.length;a++){const s=o[a],u=s.attributes;for(let i=0;i<u.length;i++){const l=u[i];l.value.indexOf("{{")!==-1&&s.setAttribute(l.name,l.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Ce(e,t,n,r,o,a){const s={};for(let i=0;i<e.children.length;i++){const l=e.children[i],c=l.getAttribute("data-ln-render-key");c&&(s[c]=l)}const u=document.createDocumentFragment();for(let i=0;i<t.length;i++){const l=t[i],c=String(r(l));let f=s[c];if(f)o(f,l,i);else{const d=ge(n,a);if(!d||(G(d,l),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",c),o(f,l,i)}u.appendChild(f)}e.textContent="",e.appendChild(u)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=G,window.lnCore.fill=Q,window.lnCore.lnFill=ye,window.lnCore.renderList=Ce);function $(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function J(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 o=r.trim().toLowerCase();return!(o==="false"||o==="0")}function X(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const q=new Map;function Y(e,t){const n=(e?e.join("|"):"")+"::"+t;if(q.has(n))return q.get(n);const r=new Set(e||[]),o=function(a,s){const u=a.getAttribute(s);return u!==null&&r.has(u)?u:t};return q.set(n,o),o}function Z(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function ee(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function te(e,t,n,r,o){if(!e||t===null)return!0;const a=r||"ln-component",s=e.type;if(s==="trigger"||s==="marker"||s==="string"||s==="list"||!s||t===""&&e.fallback!==void 0)return!0;const u=i=>{o?console.warn(i,o):console.warn(i)};if(s==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(u(`[${a}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(s==="enum"){const i=e.values||[];return i.includes(t)?!0:(u(`[${a}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(s==="integer"){if(!/^-?\d+$/.test(t))return u(`[${a}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(u(`[${a}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(u(`[${a}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(s==="float")return isNaN(Number(t))?(u(`[${a}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(s==="json")try{return JSON.parse(t),!0}catch(i){return u(`[${a}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function _e(e,t,n){for(const r in n){const[o,a,s]=n[r];Object.defineProperty(e,r,{get:function(){return o(t,a,s)},enumerable:!0,configurable:!0})}return e}function ve(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=Y(r.values,r.fallback);break;case"integer":o=J;break;case"float":o=Z;break;case"boolean":o=z;break;case"list":o=X;break;case"json":o=ee;break;case"string":default:o=$;break}o||(o=$),t[r.prop]=[o,n,r.fallback]}return t}function xe(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 Ae(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=ve,window.lnCore.attrStr=$,window.lnCore.attrInt=J,window.lnCore.attrBool=z,window.lnCore.attrList=X,window.lnCore.attrEnum=Y,window.lnCore.attrFloat=Z,window.lnCore.attrJson=ee);function F(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 ne(e,t,n,r){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",s={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(a)&&F(e,s),e.querySelectorAll){const u=e.querySelectorAll(a);for(let i=0;i<u.length;i++)F(u[i],s)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ee(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function De(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 Ne(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(a=>a.componentTag===e.componentTag)||o.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Ae(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 re(e,t,n,r){for(let o=0;o<e.length;o++){const a=e[o];if(!t[a.attribute])continue;const s=a.effects&&a.effects[n];s?s(t,n,r):a.onAttrChange&&(!a.declared||a.declared.has(n))&&a.onAttrChange(t,n,r)}}function Se(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=ie(),o=r.byAttr.get(t),a=W()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!o&&!a)return;const s=e.target;if(e.oldValue!==s.getAttribute(t)){if(a&&T(s)){const u=r.byDeclaredAttr.get(t),i=s.getAttribute(t);for(let l=0;l<u.length;l++)te(u[l].spec,i,t,u[l].componentTag,s)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,s,{oldValue:e.oldValue,newValue:s.getAttribute(t)}),n){const u=r.byReactive.get(t);u&&re(u,s,t,e.oldValue),r.reactiveWildcard.length&&re(r.reactiveWildcard,s,t,e.oldValue)}if(o)for(let u=0;u<o.length;u++){const i=o[u];if(i.handler){i.handler(s,t,e.oldValue);continue}i.onAttributeChange&&s[i.attribute]?i.onAttributeChange(s,t):(ne(s,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(s))}}}function ke(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,L(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Se(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 H(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function j(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function M(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 Re(e){const t=H();if(!t.length)return;const n=e.target;if(n){const o=n.nodeType===1?n:n.parentElement;if(o&&(o.isContentEditable||o.closest&&o.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=j();if(e.target&&r.length)for(let o=0;o<r.length;o++){const a=r[o],s=a.query,u=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;u&&a.onSubtreeChange(u,e)}for(let o=0;o<e.addedNodes.length;o++){const a=e.addedNodes[o];if(a.nodeType===1){const s=!!(a.firstElementChild||a.children&&a.children.length);for(let u=0;u<t.length;u++){const i=t[u];if(i.selector&&i.attribute&&i.ComponentFn){if(!s)a.matches&&a.matches(i.query)&&F(a,i);else if(a.matches&&a.matches(i.query)&&F(a,i),a.querySelectorAll){const l=a.querySelectorAll(i.query);for(let c=0;c<l.length;c++)F(l[c],i)}}i.onInit&&i.onInit(a)}}}for(let o=0;o<e.removedNodes.length;o++){const a=e.removedNodes[o];if(a.nodeType===1){const s=!!(a.firstElementChild||a.children&&a.children.length);for(let u=0;u<t.length;u++){const i=t[u],l=i.query;if(l){if(!s)a.matches&&a.matches(l)&&M(a,i);else if(a.matches&&a.matches(l)&&M(a,i),a.querySelectorAll){const c=a.querySelectorAll(l);for(let f=0;f<c.length;f++)M(c[f],i)}}}}}}function oe(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,L(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Re(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Fe(e){H().push(e),e.onSubtreeChange&&e.query&&j().push(e),oe()}function le(e,t,n,r,o={}){const a=o.extraAttributes||[],s=o.onAttributeChange||null,u=o.onSubtreeChange||null,i=o.onInit||null,l=o.onAttrChange||null,c=o.effects||null,f=o.attributes||null,d=f?xe(f):c,h=f?new Set(Object.keys(f)):null,p=o.persist||null;function m(N){const y=N||document.body;if(ne(y,e,t,n),f&&W())for(const S in f){const g=f[S],x=Array.from(y.querySelectorAll("["+S+"]"));y.matches&&y.matches("["+S+"]")&&x.push(y);for(let R=0;R<x.length;R++){const B=x[R];T(B)&&te(g,B.getAttribute(S),S,r,B)}}i&&i(y)}const w=[];if(e.indexOf("[")!==-1){const N=/\[([\w-]+)/g;let y;for(;(y=N.exec(e))!==null;)w.push(y[1])}else w.push(e);Ne({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:i,observed:w.concat(a),onAttributeChange:s,onAttrChange:l,effects:d,declared:h,persist:p}),ke();const b=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,C=o.subtreeQuery||(b?e:"["+e+"]"),E={selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:u,query:C};H().push(E),u&&C&&j().push(E),oe(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=le,window.lnCore.observeLifecycle=Fe);function k(){Ee()>0?De(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k(),m}function se(e){return(e||"").replace(/^#/,"")}function V(e){const t=e===void 0?location.hash:e,n={},r=se(t);if(!r)return n;const o=r.split("&");for(let a=0;a<o.length;a++){const s=o[a];if(!s)continue;const u=s.indexOf(":"),i=u>-1?s.slice(0,u):s,l=u>-1?s.slice(u+1):"";if(i)try{n[i]=decodeURIComponent(l)}catch{n[i]=l}}return n}function Le(e){if(!e)return null;const t=V();return e in t?t[e]:null}function Oe(e,t){if(!e)return;const n=V();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(a){const s=n[a];return s===""?a:a+":"+encodeURIComponent(s)}).join("&");se(location.hash)!==o&&(location.hash=o)}function Te(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 $e(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 He(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 n=e.slice(0,t),r=e.slice(t+1),o=r?r.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:n,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=V,window.lnCore.hashGet=Le,window.lnCore.hashSet=Oe,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=Ie,window.lnCore.hashSortEncode=$e,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=He,window.lnCore.hashFilterDecode=je);function Me(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Me);const A={};function O(e){const t=e||"default";if(!A[t]){const n=new Intl.NumberFormat(e,{useGrouping:!0}),r=n.formatToParts(1234.5);let o="",a=".";for(let s=0;s<r.length;s++)r[s].type==="group"&&(o=r[s].value),r[s].type==="decimal"&&(a=r[s].value);A[t]={groupSep:o,decimalSep:a,fmt:n}}return A[t]}function ae(e,t,n){if(e==null||typeof e!="string")return"";let r=e.trim();return r===""?"":(r=r.replace(/[$€£¥]/g,""),t&&(r=r.split(t).join("")),r=r.replace(/\s/g,""),n&&n!=="."&&(r=r.replace(n,".")),r=r.replace(/[^\d.-]/g,""),r)}function Ve(e,t){if(typeof e=="number")return isNaN(e)?NaN:e;if(e==null||typeof e!="string")return NaN;const n=e.trim();if(n===""||n==="-")return NaN;const r=O(t),o=ae(n,r.groupSep,r.decimalSep);if(o===""||o==="-")return NaN;const a=parseFloat(o);return isNaN(a)?NaN:a}function v(e,t,n={}){if(typeof e!="number"||isNaN(e)||!Number.isFinite(e))return"";const r=t||"default",o=n.maxDecimals!=null?parseInt(n.maxDecimals,10):null,a=n.userDecimals!=null?n.userDecimals:null;if(o!==null){const s=r+"|max:"+o;return A[s]||(A[s]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:0,maximumFractionDigits:o})),A[s].format(e)}if(a!==null&&a>0){const s=r+"|exact:"+a;return A[s]||(A[s]=new Intl.NumberFormat(t,{useGrouping:!0,minimumFractionDigits:a,maximumFractionDigits:a})),A[s].format(e)}return O(t).fmt.format(e)}function Be(e,t){if(!e)return 0;if(t<=0)return e.startsWith("-")?1:0;let n=t,r=0;for(let o=0;o<e.length&&n>0;o++)r=o+1,/[0-9]/.test(e[o])&&n--;return n>0&&(r=e.length),r}(function(){const e="data-ln-number",t="lnNumber";if(window[t]!==void 0)return;function n(l){const c=l[t];c&&(c.isTextElement?c._initTextElement():isNaN(c.value)||c._displayFormatted(c.value))}const r={"data-ln-number":{type:"marker",effect:n,description:"Activates localized number formatting on input or text element"},"data-ln-value":{type:"float",effect:n,description:"Raw unformatted numeric value"},"data-ln-number-decimals":{type:"integer",fallback:0,min:0,max:20,effect:n,description:"Number of decimal fraction digits"},"data-ln-number-min":{type:"float",effect:n,description:"Minimum allowed numeric value"},"data-ln-number-max":{type:"float",effect:n,description:"Maximum allowed numeric value"}},o=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"),a=new Set;let s=!1;function u(){U(),!s&&(s=!0,document.addEventListener("ln-core:locale-change",function(){a.forEach(function(l){l.isTextElement?l._formatTextContent():isNaN(l.value)||l._displayFormatted(l.value)})}))}function i(l){if(l[t])return l[t];if(l[t]=this,this.dom=l,a.add(this),u(),l.tagName!=="INPUT")return this.isTextElement=!0,this._initTextElement(),this;const c=document.createElement("input");c.type="hidden",c.name=l.name,l.removeAttribute("name"),l.hasAttribute("data-ln-fill-as")&&c.setAttribute("data-ln-fill-as",l.getAttribute("data-ln-fill-as")),l.type="text",l.setAttribute("inputmode","decimal"),l.insertAdjacentElement("afterend",c),this._hidden=c,Object.defineProperty(c,"value",{get:function(){return o.get.call(c)},set:function(d){if(o.set.call(c,d),d!==""&&!isNaN(parseFloat(d))){const h=self.dom.getAttribute("data-ln-number-decimals");self._setDisplayRaw(v(parseFloat(d),_(self.dom),{maxDecimals:h}))}else self._setDisplayRaw("");self.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),he(l,o,{get:function(){return o.get.call(l)},set:function(d){if(d===""){self._setDisplayRaw(""),self._setHiddenRaw(""),l.dispatchEvent(new Event("input",{bubbles:!0}));return}const h=typeof d=="number"?d:parseFloat(String(d));if(isNaN(h))self._setDisplayRaw(String(d)),self._setHiddenRaw("");else{self._setHiddenRaw(h);const p=l.getAttribute("data-ln-number-decimals");self._setDisplayRaw(v(h,_(l),{maxDecimals:p}))}l.dispatchEvent(new Event("input",{bubbles:!0}))}}),this._onInput=function(){self._handleInput()},l.addEventListener("input",this._onInput),this._onKeyDown=function(d){if(d.key!=="Backspace")return;const h=l.selectionStart,p=l.selectionEnd;if(h!==p||h===0)return;const m=O(_(l)),w=o.get.call(l),b=w[h-1];if(b===m.groupSep||/\s/.test(b)){d.preventDefault();const C=h-2>=0?h-2:0,E=w.slice(0,C)+w.slice(h);o.set.call(l,E),l.setSelectionRange(C,C),l.dispatchEvent(new Event("input",{bubbles:!0}))}},l.addEventListener("keydown",this._onKeyDown),this._onPaste=function(d){d.preventDefault();const h=(d.clipboardData||window.clipboardData).getData("text"),p=Ve(h,_(l));self.value=isNaN(p)?NaN:p},l.addEventListener("paste",this._onPaste);const f=l.value;if(f!==""){const d=parseFloat(f);if(!isNaN(d)){const h=l.getAttribute("data-ln-number-decimals");this._setHiddenRaw(d),this._setDisplayRaw(v(d,_(l),{maxDecimals:h})),l.dispatchEvent(new Event("input",{bubbles:!0}))}}return l.form&&(this._onFormReset=function(){setTimeout(function(){const d=l.defaultValue;if(d!==""){const h=parseFloat(d);if(!isNaN(h)){const p=l.getAttribute("data-ln-number-decimals");self._setHiddenRaw(h),self._setDisplayRaw(v(h,_(l),{maxDecimals:p})),l.dispatchEvent(new Event("input",{bubbles:!0}));return}}self._setHiddenRaw(""),self._setDisplayRaw(""),l.dispatchEvent(new Event("input",{bubbles:!0}))},0)},l.form.addEventListener("reset",this._onFormReset)),this}i.prototype._initTextElement=function(){const l=this.dom;let c=l.getAttribute("data-ln-value"),f=l.getAttribute("data-ln-number"),d=null;c!==null&&c!==""?d=c:f!==null&&f!==""&&f!=="true"?d=f:d=l.textContent.trim();const h=parseFloat(d);isNaN(h)?this._rawValue=null:(this._rawValue=h,l.hasAttribute("data-ln-value")||l.setAttribute("data-ln-value",String(h)),this._formatTextContent())},i.prototype._formatTextContent=function(){if(this._rawValue!==null&&!isNaN(this._rawValue)){const l=this.dom.getAttribute("data-ln-number-decimals");this.dom.textContent=v(this._rawValue,_(this.dom),{maxDecimals:l})}},i.prototype._handleInput=function(){const l=this.dom,c=o.get.call(l);if(c===""){this._setHiddenRaw(""),D(l,"ln-number:input",{value:NaN,formatted:""});return}if(c==="-"){this._setHiddenRaw(""),D(l,"ln-number:input",{value:NaN,formatted:"-"});return}const f=l.selectionStart;let d=0;for(let g=0;g<f;g++)/[0-9]/.test(c[g])&&d++;const h=_(l),p=O(h);let m=c,w=ae(c,p.groupSep,p.decimalSep),b=parseFloat(w);if(isNaN(b)){this._setHiddenRaw(""),D(l,"ln-number:input",{value:NaN,formatted:c});return}const C=l.getAttribute("data-ln-number-decimals"),E=w.indexOf(".");if(C!==null&&E!==-1){const g=parseInt(C,10),x=w.slice(E+1);if(g===0)w=w.slice(0,E),m=m.split(p.decimalSep)[0],b=parseFloat(w),this._setDisplayRaw(m);else if(x.length>g){w=w.slice(0,E+1+g);const R=m.split(p.decimalSep);m=R[0]+p.decimalSep+R[1].slice(0,g),b=parseFloat(w),this._setDisplayRaw(m)}}const k=l.getAttribute("data-ln-number-max");if(k!==null&&b>parseFloat(k)){const g=parseFloat(k),x=v(g,h,{maxDecimals:C});this._setDisplayRaw(x),this._setHiddenRaw(g),l.setSelectionRange(x.length,x.length),D(l,"ln-number:input",{value:g,formatted:x});return}if(m.endsWith(p.decimalSep)||p.decimalSep!=="."&&m.endsWith(".")){this._setHiddenRaw(b),D(l,"ln-number:input",{value:b,formatted:m});return}const N=w.indexOf(".");if(N!==-1&&w.slice(N+1).endsWith("0")){this._setHiddenRaw(b),D(l,"ln-number:input",{value:b,formatted:m});return}let y;if(C!==null)y=v(b,h,{maxDecimals:C});else{const g=N!==-1?w.slice(N+1).length:0;y=v(b,h,{userDecimals:g})}this._setDisplayRaw(y);const S=Be(y,d);l.setSelectionRange(S,S),this._setHiddenRaw(b),D(l,"ln-number:input",{value:b,formatted:y})},i.prototype._setHiddenRaw=function(l){this._hidden&&o.set.call(this._hidden,String(l))},i.prototype._setDisplayRaw=function(l){this.isTextElement?this.dom.textContent=String(l):o.set.call(this.dom,String(l))},i.prototype._displayFormatted=function(l){if(this.isTextElement)this._formatTextContent();else{const c=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(v(l,_(this.dom),{maxDecimals:c}))}},Object.defineProperty(i.prototype,"value",{get:function(){if(this.isTextElement)return this._rawValue;const l=o.get.call(this._hidden);return l===""?NaN:parseFloat(l)},set:function(l){const c=typeof l=="number"?l:parseFloat(l);if(this.isTextElement){isNaN(c)?(this._rawValue=null,this.dom.textContent=""):(this._rawValue=c,this.dom.setAttribute("data-ln-value",String(c)),this._formatTextContent());return}if(isNaN(c)){this._setDisplayRaw(""),this._setHiddenRaw(""),this.dom.dispatchEvent(new Event("input",{bubbles:!0}));return}this._setHiddenRaw(c);const f=this.dom.getAttribute("data-ln-number-decimals");this._setDisplayRaw(v(c,_(this.dom),{maxDecimals:f})),this.dom.dispatchEvent(new Event("input",{bubbles:!0}))}}),Object.defineProperty(i.prototype,"formatted",{get:function(){return this.isTextElement?this.dom.textContent:o.get.call(this.dom)}}),i.prototype.destroy=function(){this.dom[t]&&(a.delete(this),this._onLocaleChange&&document.removeEventListener("ln-core:locale-change",this._onLocaleChange),this.isTextElement||(this._onFormReset&&this.dom.form&&this.dom.form.removeEventListener("reset",this._onFormReset),this.dom.removeEventListener("input",this._onInput),this.dom.removeEventListener("keydown",this._onKeyDown),this.dom.removeEventListener("paste",this._onPaste),this._hidden&&(this.dom.name=this._hidden.name,this._hidden.remove()),this.dom.type="number",this.dom.removeAttribute("inputmode")),delete this.dom[t])},le(e,t,i,"ln-number",{attributes:r,extraAttributes:["lang"],onAttributeChange:n})})()})();
|
|
@@ -30,22 +30,31 @@ import { calculateCursorPosition } from './number-model.js';
|
|
|
30
30
|
|
|
31
31
|
// ─── Component ─────────────────────────────────────────────
|
|
32
32
|
|
|
33
|
+
const _instances = new Set();
|
|
34
|
+
let _localeListenerBound = false;
|
|
35
|
+
|
|
36
|
+
function _ensureLocaleListener() {
|
|
37
|
+
ensureLocaleObserver();
|
|
38
|
+
if (_localeListenerBound) return;
|
|
39
|
+
_localeListenerBound = true;
|
|
40
|
+
document.addEventListener('ln-core:locale-change', function () {
|
|
41
|
+
_instances.forEach(function (inst) {
|
|
42
|
+
if (inst.isTextElement) {
|
|
43
|
+
inst._formatTextContent();
|
|
44
|
+
} else if (!isNaN(inst.value)) {
|
|
45
|
+
inst._displayFormatted(inst.value);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
33
51
|
function _component(dom) {
|
|
34
52
|
if (dom[DOM_ATTRIBUTE]) return dom[DOM_ATTRIBUTE];
|
|
35
53
|
dom[DOM_ATTRIBUTE] = this;
|
|
36
54
|
this.dom = dom;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this._onLocaleChange = function () {
|
|
41
|
-
if (self.isTextElement) {
|
|
42
|
-
self._formatTextContent();
|
|
43
|
-
} else if (!isNaN(self.value)) {
|
|
44
|
-
self._displayFormatted(self.value);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
ensureLocaleObserver();
|
|
48
|
-
document.addEventListener('ln-core:locale-change', this._onLocaleChange);
|
|
55
|
+
|
|
56
|
+
_instances.add(this);
|
|
57
|
+
_ensureLocaleListener();
|
|
49
58
|
|
|
50
59
|
if (dom.tagName !== 'INPUT') {
|
|
51
60
|
this.isTextElement = true;
|
|
@@ -396,6 +405,7 @@ import { calculateCursorPosition } from './number-model.js';
|
|
|
396
405
|
|
|
397
406
|
_component.prototype.destroy = function () {
|
|
398
407
|
if (!this.dom[DOM_ATTRIBUTE]) return;
|
|
408
|
+
_instances.delete(this);
|
|
399
409
|
if (this._onLocaleChange) {
|
|
400
410
|
document.removeEventListener('ln-core:locale-change', this._onLocaleChange);
|
|
401
411
|
}
|
|
@@ -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 k(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(!k(r))return}e.apply(console,t)}}function q(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 A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ce(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ue(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 u=0;u<l.options.length;u++)l.options[u].selected&&o[l.name].push(l.options[u].value)}else if(n&&l.type==="hidden")o[l.name]=l.value;else if(n&&(l.type==="number"||l.type==="range")){const u=Number(l.value);o[l.name]=l.value===""||isNaN(u)?null:u}else o[l.name]=l.value}return o}function ae(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function fe(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 u=String(l).split(",").map(function(a){return a.trim()});i.checked=u.indexOf(i.value)!==-1}else i.checked=ae(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 u=0;u<i.options.length;u++)i.options[u].selected=l.indexOf(i.options[u].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=fe,window.lnCore.serializeForm=ue,window.lnCore.resolveFormMethod=ce);const $={};function de(e,t){$[e]=t}function he(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=de,window.lnCore.getDataMapper=he);function we(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){q(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function be(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];R[n]=t}function ge(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return R[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=be,window.lnCore.getLocaleFallback=ge,window.lnCore.ensureLocaleObserver=we);const _={};function pe(e,t){_[e]||(_[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=_[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function M(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 u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),h=a[1].trim();t[h]!=null&&c.setAttribute(f,t[h])}}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 u=0;u<l.length;u++){const a=l[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),h=a[1].trim();h in t&&c.classList.toggle(f,!!t[h])}}return e}function me(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)M(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 j(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 u=c[l];u.value.indexOf("{{")!==-1&&i.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function ye(e,t,n,r,o,s){const i={};for(let l=0;l<e.children.length;l++){const u=e.children[l],a=u.getAttribute("data-ln-render-key");a&&(i[a]=u)}const c=document.createDocumentFragment();for(let l=0;l<t.length;l++){const u=t[l],a=String(r(u));let f=i[a];if(f)o(f,u,l);else{const h=pe(n,s);if(!h||(j(h,u),f=h.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",a),o(f,u,l)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=j,window.lnCore.fill=M,window.lnCore.lnFill=me,window.lnCore.renderList=ye);function S(e,t,n){const r=e.getAttribute(t);return r===null?n:r}function H(e,t,n){const r=parseInt(e.getAttribute(t),10);return isNaN(r)?n:r}function W(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 U(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const v=new Map;function V(e,t){const n=(e?e.join("|"):"")+"::"+t;if(v.has(n))return v.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 v.set(n,o),o}function J(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function K(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function Q(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 Ce(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 Ae(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=V(r.values,r.fallback);break;case"integer":o=H;break;case"float":o=J;break;case"boolean":o=W;break;case"list":o=U;break;case"json":o=K;break;case"string":default:o=S;break}o||(o=S),t[r.prop]=[o,n,r.fallback]}return t}function xe(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 ke(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=Ce,window.lnCore.attrSpec=Ae,window.lnCore.attrStr=S,window.lnCore.attrInt=H,window.lnCore.attrBool=W,window.lnCore.attrList=U,window.lnCore.attrEnum=V,window.lnCore.attrFloat=J,window.lnCore.attrJson=K);function y(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 z(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(s)&&y(e,i),e.querySelectorAll){const c=e.querySelectorAll(s);for(let l=0;l<c.length;l++)y(c[l],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function _e(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Se(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function ve(e){const t=P(),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=ke(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 X(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 Te(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=P(),o=r.byAttr.get(t),s=I()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(s&&k(i)){const c=r.byDeclaredAttr.get(t),l=i.getAttribute(t);for(let u=0;u<c.length;u++)Q(c[u].spec,l,t,c[u].componentTag,i)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&X(c,i,t,e.oldValue),r.reactiveWildcard.length&&X(r.reactiveWildcard,i,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const l=o[c];if(l.handler){l.handler(i,t,e.oldValue);continue}l.onAttributeChange&&i[l.attribute]?l.onAttributeChange(i,t):(z(i,l.selector,l.attribute,l.ComponentFn),l.onInit&&l.onInit(i))}}}function Ee(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Te(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 T(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(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 Oe(e){const t=T();if(!t.length)return;const n=e.target;if(n){const r=n.nodeType===1?n:n.parentElement;if(r&&(r.isContentEditable||r.closest&&r.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let r=0;r<t.length;r++){const o=t[r];if(o.onSubtreeChange&&o.query){const s=o.query,i=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;i&&o.onSubtreeChange(i,e)}}for(let r=0;r<e.addedNodes.length;r++){const o=e.addedNodes[r];if(o.nodeType===1){const s=!!(o.firstElementChild||o.children&&o.children.length);for(let i=0;i<t.length;i++){const c=t[i];if(c.selector&&c.attribute&&c.ComponentFn){if(!s)o.matches&&o.matches(c.query)&&y(o,c);else if(o.matches&&o.matches(c.query)&&y(o,c),o.querySelectorAll){const l=o.querySelectorAll(c.query);for(let u=0;u<l.length;u++)y(l[u],c)}}c.onInit&&c.onInit(o)}}}for(let r=0;r<e.removedNodes.length;r++){const o=e.removedNodes[r];if(o.nodeType===1){const s=!!(o.firstElementChild||o.children&&o.children.length);for(let i=0;i<t.length;i++){const c=t[i],l=c.query;if(l){if(!s)o.matches&&o.matches(l)&&E(o,c);else if(o.matches&&o.matches(l)&&E(o,c),o.querySelectorAll){const u=o.querySelectorAll(l);for(let a=0;a<u.length;a++)E(u[a],c)}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Oe(r)}catch(o){console.error("[ln-core] lifecycle handler failed",r.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Ne(e){T().push(e),G()}function Z(e,t,n,r,o={}){const s=o.extraAttributes||[],i=o.onAttributeChange||null,c=o.onSubtreeChange||null,l=o.onInit||null,u=o.onAttrChange||null,a=o.effects||null,f=o.attributes||null,h=f?xe(f):a,p=f?new Set(Object.keys(f)):null,x=o.persist||null;function m(L){const g=L||document.body;if(z(g,e,t,n),f&&I())for(const C in f){const He=f[C],D=Array.from(g.querySelectorAll("["+C+"]"));g.matches&&g.matches("["+C+"]")&&D.push(g);for(let B=0;B<D.length;B++){const F=D[B];k(F)&&Q(He,F.getAttribute(C),C,r,F)}}l&&l(g)}const d=[];if(e.indexOf("[")!==-1){const L=/\[([\w-]+)/g;let g;for(;(g=L.exec(e))!==null;)d.push(g[1])}else d.push(e);ve({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:l,observed:d.concat(s),onAttributeChange:i,onAttrChange:u,effects:h,declared:p,persist:x}),Ee();const w=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,b=o.subtreeQuery||(w?e:"["+e+"]");T().push({selector:e,attribute:t,ComponentFn:n,onInit:l,onSubtreeChange:c,query:b}),G(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=Ne);function se(){_e()>0?Se(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",se):se(),m}function Y(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,n={},r=Y(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,u=c>-1?i.slice(c+1):"";if(l)try{n[l]=decodeURIComponent(u)}catch{n[l]=u}}return n}function Le(e){if(!e)return null;const t=O();return e in t?t[e]:null}function De(e,t){if(!e)return;const n=O();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("&");Y(location.hash)!==o&&(location.hash=o)}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 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 Ie(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 $e(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=O,window.lnCore.hashGet=Le,window.lnCore.hashSet=De,window.lnCore.hashLinkClick=Be,window.lnCore.resolveHashNamespace=Fe,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=$e,window.lnCore.hashFilterDecode=Re);function Me(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Me);function ee(e,t){if(e.length!==1)return e;const n=e.charCodeAt(0);if(n>=65&&n<=90){const r=((n-65+t)%26+26)%26;return String.fromCharCode(65+r)}if(n>=97&&n<=122){const r=((n-97+t)%26+26)%26;return String.fromCharCode(97+r)}if(n>=48&&n<=57){const r=((n-48+t)%10+10)%10;return String.fromCharCode(48+r)}return e}function te(e){if(e==null||e==="")return"";const t=String(e);if(typeof TextEncoder<"u"&&typeof btoa<"u"){const n=new TextEncoder().encode(t);let r="";const o=n.length;for(let s=0;s<o;s++)r+=String.fromCharCode(n[s]);return btoa(r)}return typeof Buffer<"u"?Buffer.from(t,"utf-8").toString("base64"):""}function ne(e){if(e==null||e==="")return"";try{const t=String(e).trim();if(typeof atob<"u"&&typeof TextDecoder<"u"){const n=atob(t),r=new Uint8Array(n.length);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return new TextDecoder().decode(r)}if(typeof Buffer<"u")return Buffer.from(t,"base64").toString("utf-8")}catch{return e}return e}function re(e,t){const n=String(t||"ln-ashlar");let r;typeof TextEncoder<"u"?r=new TextEncoder().encode(n):typeof Buffer<"u"?r=Buffer.from(n,"utf-8"):r=[108,110];const o=r.length||1,s=new Uint8Array(e.length);for(let i=0;i<e.length;i++)s[i]=e[i]^r[i%o];return s}function oe(e,t="ln-ashlar"){if(e==null||e==="")return"";const n=String(e);let r;if(typeof TextEncoder<"u")r=new TextEncoder().encode(n);else if(typeof Buffer<"u")r=Buffer.from(n,"utf-8");else return"";const o=re(r,t);let s="";for(let i=0;i<o.length;i++)s+=String.fromCharCode(o[i]);return typeof btoa<"u"?btoa(s):typeof Buffer<"u"?Buffer.from(o).toString("base64"):""}function ie(e,t="ln-ashlar"){if(e==null||e==="")return"";try{const n=String(e).trim();let r="";if(typeof atob<"u")r=atob(n);else if(typeof Buffer<"u")r=Buffer.from(n,"base64").toString("binary");else return e;const o=new Uint8Array(r.length);for(let i=0;i<r.length;i++)o[i]=r.charCodeAt(i);const s=re(o,t);if(typeof TextDecoder<"u")return new TextDecoder().decode(s);if(typeof Buffer<"u")return Buffer.from(s).toString("utf-8")}catch{return e}return e}function le(e){if(typeof e=="number"||typeof e=="string"&&/^-?\d+$/.test(String(e).trim()))return{codec:"rot",shift:Number(e)||13,key:"ln-ashlar"};if(e&&typeof e=="object"){const t=(e.codec||(e.key?"xor":"rot")).toLowerCase().trim(),n=t==="xor"||t==="base64"?t:"rot",r=Number(e.shift)||13,o=e.key||"ln-ashlar";return{codec:n,shift:r,key:o}}return{codec:"rot",shift:13,key:"ln-ashlar"}}function je(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=le(t);return n.codec==="base64"?te(e):n.codec==="xor"?oe(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>ee(r,n.shift))}function N(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=le(t);return n.codec==="base64"?ne(e):n.codec==="xor"?ie(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>ee(r,-n.shift))}(function(){const e="data-ln-obfuscator",t="lnObfuscator";if(window[t]!==void 0)return;function n(i){const c=i[t];c&&c.deobfuscate()}const r={"data-ln-obfuscator":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Codec used to deobfuscate text or links"},"data-ln-obfuscator-codec":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Explicit codec override attribute"},"data-ln-obfuscator-key":{type:"string",effect:n,description:"Encryption or masking key for XOR codec"}};function o(i){return i[t]?i[t]:(i[t]=this,this.dom=i,this._originalTextNodes=null,this._originalHref=null,this.deobfuscate(),this)}o.prototype.deobfuscate=function(){const i=!!(this.dom.matches&&(this.dom.matches("a")||this.dom.matches("area")));if(this._originalHref===null&&i&&this.dom.hasAttribute("href")&&(this._originalHref=this.dom.getAttribute("href")),(!this._originalTextNodes||this._originalTextNodes.length===0||this._originalTextNodes.some(d=>!this.dom.contains(d.node)))&&(this._originalTextNodes=[],typeof document<"u"&&document.createTreeWalker)){const d=document.createTreeWalker(this.dom,NodeFilter.SHOW_TEXT,{acceptNode:function(w){return w.parentElement&&w.parentElement.classList&&w.parentElement.classList.contains("sr-only")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;d.nextNode();)this._originalTextNodes.push({node:d.currentNode,raw:d.currentNode.nodeValue})}const l=this.dom.getAttribute(e),u=parseInt(l,10),a=isNaN(u)?13:u,f=(this.dom.getAttribute("data-ln-obfuscator-codec")||"").toLowerCase().trim(),h=this.dom.getAttribute("data-ln-obfuscator-key");let p="rot";f==="xor"||f==="base64"?p=f:h&&(p="xor");const x=h||"ln-ashlar",m={codec:p,shift:a,key:x};if(i&&this.dom.getAttribute("data-ln-external-link")==="processed"){const d=this.dom.querySelectorAll(".sr-only");for(let b=0;b<d.length;b++)d[b].remove();this.dom.removeAttribute("data-ln-external-link"),this.dom.removeAttribute("target");const w=(this.dom.rel||"").split(/\s+/).filter(function(b){return b&&b!=="noopener"&&b!=="noreferrer"});w.length>0?this.dom.rel=w.join(" "):this.dom.removeAttribute("rel")}if(this._originalTextNodes)for(let d=0;d<this._originalTextNodes.length;d++){const w=this._originalTextNodes[d];w.node&&w.raw&&w.raw.length>0&&(w.node.nodeValue=N(w.raw,m))}if(i&&this._originalHref){const d=N(this._originalHref,m);this.dom.setAttribute("href",d)}q(this.dom,"ln-obfuscator:deobfuscated",{target:this.dom,codec:p,shift:a,key:p==="xor"?x:null})},o.prototype.destroy=function(){if(this.dom[t]){if(this._originalTextNodes)for(let i=0;i<this._originalTextNodes.length;i++){const c=this._originalTextNodes[i];c.node&&c.raw&&(c.node.nodeValue=c.raw)}this._originalHref!==null&&this.dom.setAttribute("href",this._originalHref),delete this.dom[t]}};const s=Z(e,t,o,"ln-obfuscator",{attributes:r});s.obfuscate=je,s.deobfuscate=N,s.utf8ToBase64=te,s.base64ToUtf8=ne,s.xorObfuscate=oe,s.xorDeobfuscate=ie})()})();
|
|
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 _(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(!_(r))return}e.apply(console,t)}}function R(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 A(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){A(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 fe(e,t){const n=!!(t&&t.typed),r=t&&t.exclude,l={},s=e.elements,o={};if(n)for(let c=0;c<s.length;c++){const i=s[c];i.name&&i.type==="checkbox"&&!i.disabled&&(o[i.name]=(o[i.name]||0)+1)}for(let c=0;c<s.length;c++){const i=s[c];if(!(!i.name||i.disabled||i.type==="file"||i.type==="submit"||i.type==="button")&&!(r&&i.matches&&i.matches(r)))if(i.type==="checkbox")n&&o[i.name]===1?l[i.name]=i.checked:(l[i.name]||(l[i.name]=[]),i.checked&&l[i.name].push(i.value));else if(i.type==="radio")i.checked&&(l[i.name]=i.value);else if(i.type==="select-multiple"){l[i.name]=[];for(let u=0;u<i.options.length;u++)i.options[u].selected&&l[i.name].push(i.options[u].value)}else if(n&&i.type==="hidden")l[i.name]=i.value;else if(n&&(i.type==="number"||i.type==="range")){const u=Number(i.value);l[i.name]=i.value===""||isNaN(u)?null:u}else l[i.name]=i.value}return l}function de(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function he(e,t){const n=e.elements,r=[],l={};for(let s=0;s<n.length;s++){const o=n[s];o.name&&o.type==="checkbox"&&(l[o.name]=(l[o.name]||0)+1)}for(let s=0;s<n.length;s++){const o=n[s];if(o.type==="file"||o.type==="submit"||o.type==="button")continue;const c=o.getAttribute("data-ln-fill-as")||o.name;if(!c||!(c in t))continue;const i=t[c];if(o.type==="checkbox"){if(Array.isArray(i))o.checked=i.indexOf(o.value)!==-1;else if(l[o.name]>1){const u=String(i).split(",").map(function(a){return a.trim()});o.checked=u.indexOf(o.value)!==-1}else o.checked=de(i);r.push(o)}else if(o.type==="radio")o.checked=o.value===String(i),r.push(o);else if(o.type==="select-multiple"){if(Array.isArray(i))for(let u=0;u<o.options.length;u++)o.options[u].selected=i.indexOf(o.options[u].value)!==-1;r.push(o)}else o.value=i,o.tagName==="SELECT"&&i!=null&&o.setAttribute("data-ln-value",i),r.push(o)}return r}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=he,window.lnCore.serializeForm=fe,window.lnCore.resolveFormMethod=ae);const $={};function we(e,t){$[e]=t}function be(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=we,window.lnCore.getDataMapper=be);function ge(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,A(function(){new MutationObserver(function(){R(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const M={};function pe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];M[n]=t}function me(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return M[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=pe,window.lnCore.getLocaleFallback=me,window.lnCore.ensureLocaleObserver=ge);const k={};function ye(e,t){k[e]||(k[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=k[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 o=0;o<n.length;o++){const c=n[o],i=c.getAttribute("data-ln-field");t[i]!=null&&(c.textContent=t[i])}const r=e.querySelectorAll("[data-ln-attr]");for(let o=0;o<r.length;o++){const c=r[o],i=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<i.length;u++){const a=i[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),h=a[1].trim();t[h]!=null&&c.setAttribute(f,t[h])}}const l=e.querySelectorAll("[data-ln-show]");for(let o=0;o<l.length;o++){const c=l[o],i=c.getAttribute("data-ln-show");i in t&&c.classList.toggle("hidden",!t[i])}const s=e.querySelectorAll("[data-ln-class]");for(let o=0;o<s.length;o++){const c=s[o],i=c.getAttribute("data-ln-class").split(",");for(let u=0;u<i.length;u++){const a=i[u].trim().split(":");if(a.length!==2)continue;const f=a[0].trim(),h=a[1].trim();h in t&&c.classList.toggle(f,!!t[h])}}return e}function Ce(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 H(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(o,c){return t[c]!==void 0?t[c]:""}))}const r=function(s,o){return t[o]!==void 0?t[o]:""},l=Array.from(e.querySelectorAll("*"));e.nodeType===1&&l.push(e);for(let s=0;s<l.length;s++){const o=l[s],c=o.attributes;for(let i=0;i<c.length;i++){const u=c[i];u.value.indexOf("{{")!==-1&&o.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,r))}}return e}function Ae(e,t,n,r,l,s){const o={};for(let i=0;i<e.children.length;i++){const u=e.children[i],a=u.getAttribute("data-ln-render-key");a&&(o[a]=u)}const c=document.createDocumentFragment();for(let i=0;i<t.length;i++){const u=t[i],a=String(r(u));let f=o[a];if(f)l(f,u,i);else{const h=ye(n,s);if(!h||(H(h,u),f=h.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",a),l(f,u,i)}c.appendChild(f)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=H,window.lnCore.fill=j,window.lnCore.lnFill=Ce,window.lnCore.renderList=Ae);function S(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 U(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 V(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const v=new Map;function J(e,t){const n=(e?e.join("|"):"")+"::"+t;if(v.has(n))return v.get(n);const r=new Set(e||[]),l=function(s,o){const c=s.getAttribute(o);return c!==null&&r.has(c)?c:t};return v.set(n,l),l}function K(e,t,n){const r=parseFloat(e.getAttribute(t));return isNaN(r)?n:r}function Q(e,t,n){const r=e.getAttribute(t);if(!r)return n;try{return JSON.parse(r)}catch{return n}}function z(e,t,n,r,l){if(!e||t===null)return!0;const s=r||"ln-component",o=e.type;if(o==="trigger"||o==="marker"||o==="string"||o==="list"||!o||t===""&&e.fallback!==void 0)return!0;const c=i=>{l?console.warn(i,l):console.warn(i)};if(o==="boolean"){const i=t.trim().toLowerCase();return i!==""&&i!=="true"&&i!=="false"&&i!=="1"&&i!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(o==="enum"){const i=e.values||[];return i.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${i.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(o==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const i=parseInt(t,10);return e.min!==void 0&&i<e.min?(c(`[${s}] Value ${i} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&i>e.max?(c(`[${s}] Value ${i} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(o==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(o==="json")try{return JSON.parse(t),!0}catch(i){return c(`[${s}] Invalid JSON for attribute "${n}": ${i.message}. Fallback: ${e.fallback}.`),!1}return!0}function xe(e,t,n){for(const r in n){const[l,s,o]=n[r];Object.defineProperty(e,r,{get:function(){return l(t,s,o)},enumerable:!0,configurable:!0})}return e}function _e(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=J(r.values,r.fallback);break;case"integer":l=W;break;case"float":l=K;break;case"boolean":l=U;break;case"list":l=V;break;case"json":l=Q;break;case"string":default:l=S;break}l||(l=S),t[r.prop]=[l,n,r.fallback]}return t}function ke(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 Se(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=xe,window.lnCore.attrSpec=_e,window.lnCore.attrStr=S,window.lnCore.attrInt=W,window.lnCore.attrBool=U,window.lnCore.attrList=V,window.lnCore.attrEnum=J,window.lnCore.attrFloat=K,window.lnCore.attrJson=Q);function y(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 P(e,t,n,r){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",o={selector:t,attribute:n,ComponentFn:r};if(e.matches&&e.matches(s)&&y(e,o),e.querySelectorAll){const c=e.querySelectorAll(s);for(let i=0;i<c.length;i++)y(c[i],o)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ve(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function 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 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 Ee(e){const t=X(),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(s=>s.componentTag===e.componentTag)||l.push({spec:e.attributes[r],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const r=Se(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 G(e,t,n,r){for(let l=0;l<e.length;l++){const s=e[l];if(!t[s.attribute])continue;const o=s.effects&&s.effects[n];o?o(t,n,r):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,r)}}function Oe(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,r=X(),l=r.byAttr.get(t),s=q()&&r.byDeclaredAttr&&r.byDeclaredAttr.has(t);if(!n&&!l&&!s)return;const o=e.target;if(e.oldValue!==o.getAttribute(t)){if(s&&_(o)){const c=r.byDeclaredAttr.get(t),i=o.getAttribute(t);for(let u=0;u<c.length;u++)z(c[u].spec,i,t,c[u].componentTag,o)}if(window.lnCore._debugSink&&(n||l)&&window.lnCore._debugSink("attr",t,o,{oldValue:e.oldValue,newValue:o.getAttribute(t)}),n){const c=r.byReactive.get(t);c&&G(c,o,t,e.oldValue),r.reactiveWildcard.length&&G(r.reactiveWildcard,o,t,e.oldValue)}if(l)for(let c=0;c<l.length;c++){const i=l[c];if(i.handler){i.handler(o,t,e.oldValue);continue}i.onAttributeChange&&o[i.attribute]?i.onAttributeChange(o,t):(P(o,i.selector,i.attribute,i.ComponentFn),i.onInit&&i.onInit(o))}}}function Ne(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,A(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{Oe(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 T(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function E(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function O(e,t){if(!document.contains(e))if(t.attribute){const 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 Le(e){const t=T();if(!t.length)return;const n=e.target;if(n){const l=n.nodeType===1?n:n.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}const r=E();if(e.target&&r.length)for(let l=0;l<r.length;l++){const s=r[l],o=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(o)?e.target:e.target.closest?e.target.closest(o):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(o):null;c&&s.onSubtreeChange(c,e)}for(let l=0;l<e.addedNodes.length;l++){const s=e.addedNodes[l];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const i=t[c];if(i.selector&&i.attribute&&i.ComponentFn){if(!o)s.matches&&s.matches(i.query)&&y(s,i);else if(s.matches&&s.matches(i.query)&&y(s,i),s.querySelectorAll){const u=s.querySelectorAll(i.query);for(let a=0;a<u.length;a++)y(u[a],i)}}i.onInit&&i.onInit(s)}}}for(let l=0;l<e.removedNodes.length;l++){const s=e.removedNodes[l];if(s.nodeType===1){const o=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const i=t[c],u=i.query;if(u){if(!o)s.matches&&s.matches(u)&&O(s,i);else if(s.matches&&s.matches(u)&&O(s,i),s.querySelectorAll){const a=s.querySelectorAll(u);for(let f=0;f<a.length;f++)O(a[f],i)}}}}}}function Z(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,A(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.type==="childList")try{Le(r)}catch(l){console.error("[ln-core] lifecycle handler failed",r.target,l)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function De(e){T().push(e),e.onSubtreeChange&&e.query&&E().push(e),Z()}function Y(e,t,n,r,l={}){const s=l.extraAttributes||[],o=l.onAttributeChange||null,c=l.onSubtreeChange||null,i=l.onInit||null,u=l.onAttrChange||null,a=l.effects||null,f=l.attributes||null,h=f?ke(f):a,p=f?new Set(Object.keys(f)):null,x=l.persist||null;function m(D){const g=D||document.body;if(P(g,e,t,n),f&&q())for(const C in f){const Ue=f[C],B=Array.from(g.querySelectorAll("["+C+"]"));g.matches&&g.matches("["+C+"]")&&B.push(g);for(let F=0;F<B.length;F++){const I=B[F];_(I)&&z(Ue,I.getAttribute(C),C,r,I)}}i&&i(g)}const d=[];if(e.indexOf("[")!==-1){const D=/\[([\w-]+)/g;let g;for(;(g=D.exec(e))!==null;)d.push(g[1])}else d.push(e);Ee({selector:e,attribute:t,componentTag:r,attributes:f,ComponentFn:n,onInit:i,observed:d.concat(s),onAttributeChange:o,onAttrChange:u,effects:h,declared:p,persist:x}),Ne();const w=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,b=l.subtreeQuery||(w?e:"["+e+"]"),ce={selector:e,attribute:t,ComponentFn:n,onInit:i,onSubtreeChange:c,query:b};T().push(ce),c&&b&&E().push(ce),Z(),window[t]=m,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=De);function ue(){ve()>0?Te(function(){m(document.body)}):m(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ue):ue(),m}function ee(e){return(e||"").replace(/^#/,"")}function N(e){const t=e===void 0?location.hash:e,n={},r=ee(t);if(!r)return n;const l=r.split("&");for(let s=0;s<l.length;s++){const o=l[s];if(!o)continue;const c=o.indexOf(":"),i=c>-1?o.slice(0,c):o,u=c>-1?o.slice(c+1):"";if(i)try{n[i]=decodeURIComponent(u)}catch{n[i]=u}}return n}function Be(e){if(!e)return null;const t=N();return e in t?t[e]:null}function Fe(e,t){if(!e)return;const n=N();t==null?delete n[e]:n[e]=String(t);const l=Object.keys(n).map(function(s){const o=n[s];return o===""?s:s+":"+encodeURIComponent(o)}).join("&");ee(location.hash)!==l&&(location.hash=l)}function Ie(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function qe(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 Re(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function $e(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Me(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 n=e.slice(0,t),r=e.slice(t+1),l=r?r.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:l}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=N,window.lnCore.hashGet=Be,window.lnCore.hashSet=Fe,window.lnCore.hashLinkClick=Ie,window.lnCore.resolveHashNamespace=qe,window.lnCore.hashSortEncode=Re,window.lnCore.hashSortDecode=$e,window.lnCore.hashFilterEncode=Me,window.lnCore.hashFilterDecode=je);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 te(e,t){if(e.length!==1)return e;const n=e.charCodeAt(0);if(n>=65&&n<=90){const r=((n-65+t)%26+26)%26;return String.fromCharCode(65+r)}if(n>=97&&n<=122){const r=((n-97+t)%26+26)%26;return String.fromCharCode(97+r)}if(n>=48&&n<=57){const r=((n-48+t)%10+10)%10;return String.fromCharCode(48+r)}return e}function ne(e){if(e==null||e==="")return"";const t=String(e);if(typeof TextEncoder<"u"&&typeof btoa<"u"){const n=new TextEncoder().encode(t);let r="";const l=n.length;for(let s=0;s<l;s++)r+=String.fromCharCode(n[s]);return btoa(r)}return typeof Buffer<"u"?Buffer.from(t,"utf-8").toString("base64"):""}function re(e){if(e==null||e==="")return"";try{const t=String(e).trim();if(typeof atob<"u"&&typeof TextDecoder<"u"){const n=atob(t),r=new Uint8Array(n.length);for(let l=0;l<n.length;l++)r[l]=n.charCodeAt(l);return new TextDecoder().decode(r)}if(typeof Buffer<"u")return Buffer.from(t,"base64").toString("utf-8")}catch{return e}return e}function oe(e,t){const n=String(t||"ln-ashlar");let r;typeof TextEncoder<"u"?r=new TextEncoder().encode(n):typeof Buffer<"u"?r=Buffer.from(n,"utf-8"):r=[108,110];const l=r.length||1,s=new Uint8Array(e.length);for(let o=0;o<e.length;o++)s[o]=e[o]^r[o%l];return s}function ie(e,t="ln-ashlar"){if(e==null||e==="")return"";const n=String(e);let r;if(typeof TextEncoder<"u")r=new TextEncoder().encode(n);else if(typeof Buffer<"u")r=Buffer.from(n,"utf-8");else return"";const l=oe(r,t);let s="";for(let o=0;o<l.length;o++)s+=String.fromCharCode(l[o]);return typeof btoa<"u"?btoa(s):typeof Buffer<"u"?Buffer.from(l).toString("base64"):""}function le(e,t="ln-ashlar"){if(e==null||e==="")return"";try{const n=String(e).trim();let r="";if(typeof atob<"u")r=atob(n);else if(typeof Buffer<"u")r=Buffer.from(n,"base64").toString("binary");else return e;const l=new Uint8Array(r.length);for(let o=0;o<r.length;o++)l[o]=r.charCodeAt(o);const s=oe(l,t);if(typeof TextDecoder<"u")return new TextDecoder().decode(s);if(typeof Buffer<"u")return Buffer.from(s).toString("utf-8")}catch{return e}return e}function se(e){if(typeof e=="number"||typeof e=="string"&&/^-?\d+$/.test(String(e).trim()))return{codec:"rot",shift:Number(e)||13,key:"ln-ashlar"};if(e&&typeof e=="object"){const t=(e.codec||(e.key?"xor":"rot")).toLowerCase().trim(),n=t==="xor"||t==="base64"?t:"rot",r=Number(e.shift)||13,l=e.key||"ln-ashlar";return{codec:n,shift:r,key:l}}return{codec:"rot",shift:13,key:"ln-ashlar"}}function We(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=se(t);return n.codec==="base64"?ne(e):n.codec==="xor"?ie(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>te(r,n.shift))}function L(e,t=13){if(e==null||(typeof e!="string"&&(e=String(e)),e.length===0))return"";const n=se(t);return n.codec==="base64"?re(e):n.codec==="xor"?le(e,n.key):e.replace(/[a-zA-Z0-9]/g,r=>te(r,-n.shift))}(function(){const e="data-ln-obfuscator",t="lnObfuscator";if(window[t]!==void 0)return;function n(o){const c=o[t];c&&c.deobfuscate()}const r={"data-ln-obfuscator":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Codec used to deobfuscate text or links"},"data-ln-obfuscator-codec":{type:"enum",values:["rot13","base64","xor"],fallback:"rot13",effect:n,description:"Explicit codec override attribute"},"data-ln-obfuscator-key":{type:"string",effect:n,description:"Encryption or masking key for XOR codec"}};function l(o){return o[t]?o[t]:(o[t]=this,this.dom=o,this._originalTextNodes=null,this._originalHref=null,this.deobfuscate(),this)}l.prototype.deobfuscate=function(){const o=!!(this.dom.matches&&(this.dom.matches("a")||this.dom.matches("area")));if(this._originalHref===null&&o&&this.dom.hasAttribute("href")&&(this._originalHref=this.dom.getAttribute("href")),(!this._originalTextNodes||this._originalTextNodes.length===0||this._originalTextNodes.some(d=>!this.dom.contains(d.node)))&&(this._originalTextNodes=[],typeof document<"u"&&document.createTreeWalker)){const d=document.createTreeWalker(this.dom,NodeFilter.SHOW_TEXT,{acceptNode:function(w){return w.parentElement&&w.parentElement.classList&&w.parentElement.classList.contains("sr-only")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;d.nextNode();)this._originalTextNodes.push({node:d.currentNode,raw:d.currentNode.nodeValue})}const i=this.dom.getAttribute(e),u=parseInt(i,10),a=isNaN(u)?13:u,f=(this.dom.getAttribute("data-ln-obfuscator-codec")||"").toLowerCase().trim(),h=this.dom.getAttribute("data-ln-obfuscator-key");let p="rot";f==="xor"||f==="base64"?p=f:h&&(p="xor");const x=h||"ln-ashlar",m={codec:p,shift:a,key:x};if(o&&this.dom.getAttribute("data-ln-external-link")==="processed"){const d=this.dom.querySelectorAll(".sr-only");for(let b=0;b<d.length;b++)d[b].remove();this.dom.removeAttribute("data-ln-external-link"),this.dom.removeAttribute("target");const w=(this.dom.rel||"").split(/\s+/).filter(function(b){return b&&b!=="noopener"&&b!=="noreferrer"});w.length>0?this.dom.rel=w.join(" "):this.dom.removeAttribute("rel")}if(this._originalTextNodes)for(let d=0;d<this._originalTextNodes.length;d++){const w=this._originalTextNodes[d];w.node&&w.raw&&w.raw.length>0&&(w.node.nodeValue=L(w.raw,m))}if(o&&this._originalHref){const d=L(this._originalHref,m);this.dom.setAttribute("href",d)}R(this.dom,"ln-obfuscator:deobfuscated",{target:this.dom,codec:p,shift:a,key:p==="xor"?x:null})},l.prototype.destroy=function(){if(this.dom[t]){if(this._originalTextNodes)for(let o=0;o<this._originalTextNodes.length;o++){const c=this._originalTextNodes[o];c.node&&c.raw&&(c.node.nodeValue=c.raw)}this._originalHref!==null&&this.dom.setAttribute("href",this._originalHref),delete this.dom[t]}};const s=Y(e,t,l,"ln-obfuscator",{attributes:r});s.obfuscate=We,s.deobfuscate=L,s.utf8ToBase64=ne,s.base64ToUtf8=re,s.xorObfuscate=ie,s.xorDeobfuscate=le})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function q(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function 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 l=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){l=t[o];break}if(!A(l))return}e.apply(console,t)}}function I(e,t,r){const l=r||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ee(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function te(e,t){const r=!!(t&&t.typed),l=t&&t.exclude,o={},a=e.elements,i={};if(r)for(let s=0;s<a.length;s++){const n=a[s];n.name&&n.type==="checkbox"&&!n.disabled&&(i[n.name]=(i[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")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")r&&i[n.name]===1?o[n.name]=n.checked:(o[n.name]||(o[n.name]=[]),n.checked&&o[n.name].push(n.value));else if(n.type==="radio")n.checked&&(o[n.name]=n.value);else if(n.type==="select-multiple"){o[n.name]=[];for(let c=0;c<n.options.length;c++)n.options[c].selected&&o[n.name].push(n.options[c].value)}else if(r&&n.type==="hidden")o[n.name]=n.value;else if(r&&(n.type==="number"||n.type==="range")){const c=Number(n.value);o[n.name]=n.value===""||isNaN(c)?null:c}else o[n.name]=n.value}return o}function ne(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function oe(e,t){const r=e.elements,l=[],o={};for(let a=0;a<r.length;a++){const i=r[a];i.name&&i.type==="checkbox"&&(o[i.name]=(o[i.name]||0)+1)}for(let a=0;a<r.length;a++){const i=r[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 n=t[s];if(i.type==="checkbox"){if(Array.isArray(n))i.checked=n.indexOf(i.value)!==-1;else if(o[i.name]>1){const c=String(n).split(",").map(function(u){return u.trim()});i.checked=c.indexOf(i.value)!==-1}else i.checked=ne(n);l.push(i)}else if(i.type==="radio")i.checked=i.value===String(n),l.push(i);else if(i.type==="select-multiple"){if(Array.isArray(n))for(let c=0;c<i.options.length;c++)i.options[c].selected=n.indexOf(i.options[c].value)!==-1;l.push(i)}else i.value=n,i.tagName==="SELECT"&&n!=null&&i.setAttribute("data-ln-value",n),l.push(i)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=oe,window.lnCore.serializeForm=te,window.lnCore.resolveFormMethod=ee);const T={};function re(e,t){T[e]=t}function ie(e){return T[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=re,window.lnCore.getDataMapper=ie);function le(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){I(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function se(e,t){if(!e||typeof t!="object")return;const r=e.toLowerCase().split("-")[0];$[r]=t}function ae(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=se,window.lnCore.getLocaleFallback=ae,window.lnCore.ensureLocaleObserver=le);const v={};function ce(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const r=v[e];return r?r.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const r=e.querySelectorAll("[data-ln-field]");for(let i=0;i<r.length;i++){const s=r[i],n=s.getAttribute("data-ln-field");t[n]!=null&&(s.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let i=0;i<l.length;i++){const s=l[i],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 f=u[0].trim(),d=u[1].trim();t[d]!=null&&s.setAttribute(f,t[d])}}const o=e.querySelectorAll("[data-ln-show]");for(let i=0;i<o.length;i++){const s=o[i],n=s.getAttribute("data-ln-show");n in t&&s.classList.toggle("hidden",!t[n])}const a=e.querySelectorAll("[data-ln-class]");for(let i=0;i<a.length;i++){const s=a[i],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 f=u[0].trim(),d=u[1].trim();d in t&&s.classList.toggle(f,!!t[d])}}return e}function ue(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const r=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<r.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",r[l],t??null),r[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let r=0;r<t.length;r++)t[r].textContent=""}})));function M(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(i,s){return t[s]!==void 0?t[s]:""}))}const l=function(a,i){return t[i]!==void 0?t[i]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let a=0;a<o.length;a++){const i=o[a],s=i.attributes;for(let n=0;n<s.length;n++){const c=s[n];c.value.indexOf("{{")!==-1&&i.setAttribute(c.name,c.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function de(e,t,r,l,o,a){const i={};for(let n=0;n<e.children.length;n++){const c=e.children[n],u=c.getAttribute("data-ln-render-key");u&&(i[u]=c)}const s=document.createDocumentFragment();for(let n=0;n<t.length;n++){const c=t[n],u=String(l(c));let f=i[u];if(f)o(f,c,n);else{const d=ce(r,a);if(!d||(M(d,c),f=d.firstElementChild,!f))continue;f.setAttribute("data-ln-render-key",u),o(f,c,n)}s.appendChild(f)}e.textContent="",e.appendChild(s)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=N,window.lnCore.lnFill=ue,window.lnCore.renderList=de);function h(e,t,r){const l=e.getAttribute(t);return l===null?r:l}function R(e,t,r){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?r:l}function B(e,t,r=!1){const l=e.getAttribute(t);if(l===null)return!!r;const o=l.trim().toLowerCase();return!(o==="false"||o==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(r=>r.trim()).filter(Boolean)}const x=new Map;function W(e,t){const r=(e?e.join("|"):"")+"::"+t;if(x.has(r))return x.get(r);const l=new Set(e||[]),o=function(a,i){const s=a.getAttribute(i);return s!==null&&l.has(s)?s:t};return x.set(r,o),o}function U(e,t,r){const l=parseFloat(e.getAttribute(t));return isNaN(l)?r:l}function V(e,t,r){const l=e.getAttribute(t);if(!l)return r;try{return JSON.parse(l)}catch{return r}}function H(e,t,r,l,o){if(!e||t===null)return!0;const a=l||"ln-component",i=e.type;if(i==="trigger"||i==="marker"||i==="string"||i==="list"||!i||t===""&&e.fallback!==void 0)return!0;const s=n=>{o?console.warn(n,o):console.warn(n)};if(i==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(s(`[${a}] Invalid value "${t}" for boolean attribute "${r}". Allowed: "true", "false", or presence-only.`),!1):!0}if(i==="enum"){const n=e.values||[];return n.includes(t)?!0:(s(`[${a}] Invalid value "${t}" for attribute "${r}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(i==="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(i==="float")return isNaN(Number(t))?(s(`[${a}] Invalid float "${t}" for attribute "${r}". Fallback: ${e.fallback}.`),!1):!0;if(i==="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 Q(e,t,r){for(const l in r){const[o,a,i]=r[l];Object.defineProperty(e,l,{get:function(){return o(t,a,i)},enumerable:!0,configurable:!0})}return e}function J(e){const t={};for(const r in e){const l=e[r];if(!l||!l.prop)continue;let o=l.read;if(!o&&l.type)switch(l.type){case"enum":o=W(l.values,l.fallback);break;case"integer":o=R;break;case"float":o=U;break;case"boolean":o=B;break;case"list":o=j;break;case"json":o=V;break;case"string":default:o=h;break}o||(o=h),t[l.prop]=[o,r,l.fallback]}return t}function fe(e){const t={};for(const r in e){const l=e[r];l&&l.effect&&(t[r]=l.effect)}return Object.keys(t).length?t:null}function we(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const r in e.effects)t.add(r);if(e.onAttrChange&&e.declared)for(const r of e.declared)t.add(r);return t}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.defineAttrs=Q,window.lnCore.attrSpec=J,window.lnCore.attrStr=h,window.lnCore.attrInt=R,window.lnCore.attrBool=B,window.lnCore.attrList=j,window.lnCore.attrEnum=W,window.lnCore.attrFloat=U,window.lnCore.attrJson=V);function p(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(r){console.error("["+t.attribute+"] init failed",e,r)}}}function K(e,t,r,l){if(e.nodeType!==1)return;const a=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",i={selector:t,attribute:r,ComponentFn:l};if(e.matches&&e.matches(a)&&p(e,i),e.querySelectorAll){const s=e.querySelectorAll(a);for(let n=0;n<s.length;n++)p(s[n],i)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function he(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function pe(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function P(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function be(e){const t=P(),r=e.observed||[];for(let l=0;l<r.length;l++){const o=r[l];t.byAttr.has(o)||t.byAttr.set(o,[]),t.byAttr.get(o).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const o=t.byDeclaredAttr.get(l);o.some(a=>a.componentTag===e.componentTag)||o.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=we(e);if(l===null)t.reactiveWildcard.push(e);else for(const o of l)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function z(e,t,r,l){for(let o=0;o<e.length;o++){const a=e[o];if(!t[a.attribute])continue;const i=a.effects&&a.effects[r];i?i(t,r,l):a.onAttrChange&&(!a.declared||a.declared.has(r))&&a.onAttrChange(t,r,l)}}function ge(e){const t=e.attributeName,r=t.indexOf("data-ln-")===0,l=P(),o=l.byAttr.get(t),a=q()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!r&&!o&&!a)return;const i=e.target;if(e.oldValue!==i.getAttribute(t)){if(a&&A(i)){const s=l.byDeclaredAttr.get(t),n=i.getAttribute(t);for(let c=0;c<s.length;c++)H(s[c].spec,n,t,s[c].componentTag,i)}if(window.lnCore._debugSink&&(r||o)&&window.lnCore._debugSink("attr",t,i,{oldValue:e.oldValue,newValue:i.getAttribute(t)}),r){const s=l.byReactive.get(t);s&&z(s,i,t,e.oldValue),l.reactiveWildcard.length&&z(l.reactiveWildcard,i,t,e.oldValue)}if(o)for(let s=0;s<o.length;s++){const n=o[s];if(n.handler){n.handler(i,t,e.oldValue);continue}n.onAttributeChange&&i[n.attribute]?n.onAttributeChange(i,t):(K(i,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(i))}}}function Ce(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++)try{ge(t[r])}catch(l){console.error("[ln-core] mutation handler failed",t[r].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function S(e,t){if(!document.contains(e))if(t.attribute){const r=e[t.attribute];if(r&&typeof r.destroy=="function")try{r.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function me(e){const t=_();if(!t.length)return;const r=e.target;if(r){const l=r.nodeType===1?r:r.parentElement;if(l&&(l.isContentEditable||l.closest&&l.closest('[contenteditable]:not([contenteditable="false"])')))return}if(e.target)for(let l=0;l<t.length;l++){const o=t[l];if(o.onSubtreeChange&&o.query){const a=o.query,i=e.target.nodeType===1?e.target.matches&&e.target.matches(a)?e.target:e.target.closest?e.target.closest(a):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(a):null;i&&o.onSubtreeChange(i,e)}}for(let l=0;l<e.addedNodes.length;l++){const o=e.addedNodes[l];if(o.nodeType===1){const a=!!(o.firstElementChild||o.children&&o.children.length);for(let i=0;i<t.length;i++){const s=t[i];if(s.selector&&s.attribute&&s.ComponentFn){if(!a)o.matches&&o.matches(s.query)&&p(o,s);else if(o.matches&&o.matches(s.query)&&p(o,s),o.querySelectorAll){const n=o.querySelectorAll(s.query);for(let c=0;c<n.length;c++)p(n[c],s)}}s.onInit&&s.onInit(o)}}}for(let l=0;l<e.removedNodes.length;l++){const o=e.removedNodes[l];if(o.nodeType===1){const a=!!(o.firstElementChild||o.children&&o.children.length);for(let i=0;i<t.length;i++){const s=t[i],n=s.query;if(n){if(!a)o.matches&&o.matches(n)&&S(o,s);else if(o.matches&&o.matches(n)&&S(o,s),o.querySelectorAll){const c=o.querySelectorAll(n);for(let u=0;u<c.length;u++)S(c[u],s)}}}}}}function G(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let r=0;r<t.length;r++){const l=t[r];if(l.type==="childList")try{me(l)}catch(o){console.error("[ln-core] lifecycle handler failed",l.target,o)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function ye(e){_().push(e),G()}function X(e,t,r,l,o={}){const a=o.extraAttributes||[],i=o.onAttributeChange||null,s=o.onSubtreeChange||null,n=o.onInit||null,c=o.onAttrChange||null,u=o.effects||null,f=o.attributes||null,d=f?fe(f):u,b=f?new Set(Object.keys(f)):null,g=o.persist||null;function y(E){const w=E||document.body;if(K(w,e,t,r),f&&q())for(const C in f){const qe=f[C],L=Array.from(w.querySelectorAll("["+C+"]"));w.matches&&w.matches("["+C+"]")&&L.push(w);for(let D=0;D<L.length;D++){const F=L[D];A(F)&&H(qe,F.getAttribute(C),C,l,F)}}n&&n(w)}const O=[];if(e.indexOf("[")!==-1){const E=/\[([\w-]+)/g;let w;for(;(w=E.exec(e))!==null;)O.push(w[1])}else O.push(e);be({selector:e,attribute:t,componentTag:l,attributes:f,ComponentFn:r,onInit:n,observed:O.concat(a),onAttributeChange:i,onAttrChange:c,effects:d,declared:b,persist:g}),Ce();const De=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,Fe=o.subtreeQuery||(De?e:"["+e+"]");_().push({selector:e,attribute:t,ComponentFn:r,onInit:n,onSubtreeChange:s,query:Fe}),G(),window[t]=y,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=X,window.lnCore.observeLifecycle=ye);function Z(){he()>0?pe(function(){y(document.body)}):y(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Z):Z(),y}function Y(e){return(e||"").replace(/^#/,"")}function k(e){const t=e===void 0?location.hash:e,r={},l=Y(t);if(!l)return r;const o=l.split("&");for(let a=0;a<o.length;a++){const i=o[a];if(!i)continue;const s=i.indexOf(":"),n=s>-1?i.slice(0,s):i,c=s>-1?i.slice(s+1):"";if(n)try{r[n]=decodeURIComponent(c)}catch{r[n]=c}}return r}function Ae(e){if(!e)return null;const t=k();return e in t?t[e]:null}function ve(e,t){if(!e)return;const r=k();t==null?delete r[e]:r[e]=String(t);const o=Object.keys(r).map(function(a){const i=r[a];return i===""?a:a+":"+encodeURIComponent(i)}).join("&");Y(location.hash)!==o&&(location.hash=o)}function xe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function _e(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const r=e.getAttribute("data-ln-hash");if(r&&r.trim()!=="")return r.trim();const l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Se(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function ke(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Oe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Ee(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const r=e.slice(0,t),l=e.slice(t+1),o=l?l.split(",").map(function(a){try{return decodeURIComponent(a)}catch{return a}}).filter(Boolean):[];return{key:r,values:o}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=k,window.lnCore.hashGet=Ae,window.lnCore.hashSet=ve,window.lnCore.hashLinkClick=xe,window.lnCore.resolveHashNamespace=_e,window.lnCore.hashSortEncode=Se,window.lnCore.hashSortDecode=ke,window.lnCore.hashFilterEncode=Oe,window.lnCore.hashFilterDecode=Ee);function Le(){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=Le),(function(){const e="data-ln-options",t="lnOptions";if(window[t]!==void 0)return;const r={"data-ln-options":{prop:"_storeName",type:"string",read:h,fallback:"",description:"Store or coordinator addressing to populate options from"},"data-ln-options-value":{prop:"_valueField",type:"string",read:h,fallback:"id",description:"Field name used for option value attribute"},"data-ln-options-label":{prop:"_labelField",type:"string",read:h,fallback:"name",description:"Field name used for option visible label text"}},l=J(r);function o(a){this.dom=a,Q(this,a,l);const i=this;return this._onSetData=function(s){s.detail&&i._rebuild(s.detail.data||[])},a.addEventListener("ln-options:set-data",this._onSetData),I(a,"ln-options:request-data",{options:this._storeName}),this}o.prototype._rebuild=function(a){const i=this.dom,s=this._valueField,n=this._labelField,c=i.getAttribute("data-ln-value")||i.value,u=i.querySelectorAll("option");for(let d=u.length-1;d>=0;d--)u[d].value!==""&&i.removeChild(u[d]);for(let d=0;d<a.length;d++){const b=a[d],g=document.createElement("option");g.value=String(b[s]),g.textContent=b[n]!=null?b[n]:"",i.appendChild(g)}const f=i.options;for(let d=0;d<f.length;d++)if(f[d].value===String(c)){i.value=String(c);break}},o.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-options:set-data",this._onSetData),delete this.dom[t])},X(e,t,o,"ln-options",{attributes:r})})()})();
|
|
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 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 l=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){l=t[i];break}if(!A(l))return}e.apply(console,t)}}function T(e,t,o){const l=o||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,l),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:l}))}function m(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){m(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function re(e,t){const o=!!(t&&t.typed),l=t&&t.exclude,i={},s=e.elements,r={};if(o)for(let c=0;c<s.length;c++){const n=s[c];n.name&&n.type==="checkbox"&&!n.disabled&&(r[n.name]=(r[n.name]||0)+1)}for(let c=0;c<s.length;c++){const n=s[c];if(!(!n.name||n.disabled||n.type==="file"||n.type==="submit"||n.type==="button")&&!(l&&n.matches&&n.matches(l)))if(n.type==="checkbox")o&&r[n.name]===1?i[n.name]=n.checked:(i[n.name]||(i[n.name]=[]),n.checked&&i[n.name].push(n.value));else if(n.type==="radio")n.checked&&(i[n.name]=n.value);else if(n.type==="select-multiple"){i[n.name]=[];for(let a=0;a<n.options.length;a++)n.options[a].selected&&i[n.name].push(n.options[a].value)}else if(o&&n.type==="hidden")i[n.name]=n.value;else if(o&&(n.type==="number"||n.type==="range")){const a=Number(n.value);i[n.name]=n.value===""||isNaN(a)?null:a}else i[n.name]=n.value}return i}function ie(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function le(e,t){const o=e.elements,l=[],i={};for(let s=0;s<o.length;s++){const r=o[s];r.name&&r.type==="checkbox"&&(i[r.name]=(i[r.name]||0)+1)}for(let s=0;s<o.length;s++){const r=o[s];if(r.type==="file"||r.type==="submit"||r.type==="button")continue;const c=r.getAttribute("data-ln-fill-as")||r.name;if(!c||!(c in t))continue;const n=t[c];if(r.type==="checkbox"){if(Array.isArray(n))r.checked=n.indexOf(r.value)!==-1;else if(i[r.name]>1){const a=String(n).split(",").map(function(u){return u.trim()});r.checked=a.indexOf(r.value)!==-1}else r.checked=ie(n);l.push(r)}else if(r.type==="radio")r.checked=r.value===String(n),l.push(r);else if(r.type==="select-multiple"){if(Array.isArray(n))for(let a=0;a<r.options.length;a++)r.options[a].selected=n.indexOf(r.options[a].value)!==-1;l.push(r)}else r.value=n,r.tagName==="SELECT"&&n!=null&&r.setAttribute("data-ln-value",n),l.push(r)}return l}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=re,window.lnCore.resolveFormMethod=oe);const $={};function se(e,t){$[e]=t}function ce(e){return $[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=se,window.lnCore.getDataMapper=ce);function ae(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,m(function(){new MutationObserver(function(){T(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function ue(e,t){if(!e||typeof t!="object")return;const o=e.toLowerCase().split("-")[0];N[o]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return N[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=ue,window.lnCore.getLocaleFallback=de,window.lnCore.ensureLocaleObserver=ae);const v={};function fe(e,t){v[e]||(v[e]=document.querySelector('[data-ln-template="'+e+'"]'));const o=v[e];return o?o.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function R(e,t){if(!e||!t)return e;const o=e.querySelectorAll("[data-ln-field]");for(let r=0;r<o.length;r++){const c=o[r],n=c.getAttribute("data-ln-field");t[n]!=null&&(c.textContent=t[n])}const l=e.querySelectorAll("[data-ln-attr]");for(let r=0;r<l.length;r++){const c=l[r],n=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();t[f]!=null&&c.setAttribute(d,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let r=0;r<i.length;r++){const c=i[r],n=c.getAttribute("data-ln-show");n in t&&c.classList.toggle("hidden",!t[n])}const s=e.querySelectorAll("[data-ln-class]");for(let r=0;r<s.length;r++){const c=s[r],n=c.getAttribute("data-ln-class").split(",");for(let a=0;a<n.length;a++){const u=n[a].trim().split(":");if(u.length!==2)continue;const d=u[0].trim(),f=u[1].trim();f in t&&c.classList.toggle(d,!!t[f])}}return e}function we(e,t){e.matches&&e.matches("[data-ln-form], [data-ln-fillable]")&&(window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",e,t??null),e.dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0})));const o=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let l=0;l<o.length;l++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",o[l],t??null),o[l].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)R(e.target,e.detail);else{const t=e.target.querySelectorAll("[data-ln-field]");for(let o=0;o<t.length;o++)t[o].textContent=""}})));function M(e,t){if(!e||!t)return e;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;o.nextNode();){const s=o.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(r,c){return t[c]!==void 0?t[c]:""}))}const l=function(s,r){return t[r]!==void 0?t[r]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const r=i[s],c=r.attributes;for(let n=0;n<c.length;n++){const a=c[n];a.value.indexOf("{{")!==-1&&r.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,l))}}return e}function he(e,t,o,l,i,s){const r={};for(let n=0;n<e.children.length;n++){const a=e.children[n],u=a.getAttribute("data-ln-render-key");u&&(r[u]=a)}const c=document.createDocumentFragment();for(let n=0;n<t.length;n++){const a=t[n],u=String(l(a));let d=r[u];if(d)i(d,a,n);else{const f=fe(o,s);if(!f||(M(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,a,n)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=R,window.lnCore.lnFill=we,window.lnCore.renderList=he);function h(e,t,o){const l=e.getAttribute(t);return l===null?o:l}function B(e,t,o){const l=parseInt(e.getAttribute(t),10);return isNaN(l)?o:l}function j(e,t,o=!1){const l=e.getAttribute(t);if(l===null)return!!o;const i=l.trim().toLowerCase();return!(i==="false"||i==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(o=>o.trim()).filter(Boolean)}const x=new Map;function U(e,t){const o=(e?e.join("|"):"")+"::"+t;if(x.has(o))return x.get(o);const l=new Set(e||[]),i=function(s,r){const c=s.getAttribute(r);return c!==null&&l.has(c)?c:t};return x.set(o,i),i}function V(e,t,o){const l=parseFloat(e.getAttribute(t));return isNaN(l)?o:l}function H(e,t,o){const l=e.getAttribute(t);if(!l)return o;try{return JSON.parse(l)}catch{return o}}function Q(e,t,o,l,i){if(!e||t===null)return!0;const s=l||"ln-component",r=e.type;if(r==="trigger"||r==="marker"||r==="string"||r==="list"||!r||t===""&&e.fallback!==void 0)return!0;const c=n=>{i?console.warn(n,i):console.warn(n)};if(r==="boolean"){const n=t.trim().toLowerCase();return n!==""&&n!=="true"&&n!=="false"&&n!=="1"&&n!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${o}". Allowed: "true", "false", or presence-only.`),!1):!0}if(r==="enum"){const n=e.values||[];return n.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${o}". Allowed: ${n.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(r==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1;const n=parseInt(t,10);return e.min!==void 0&&n<e.min?(c(`[${s}] Value ${n} for attribute "${o}" is less than min (${e.min}).`),!1):e.max!==void 0&&n>e.max?(c(`[${s}] Value ${n} for attribute "${o}" is greater than max (${e.max}).`),!1):!0}if(r==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${o}". Fallback: ${e.fallback}.`),!1):!0;if(r==="json")try{return JSON.parse(t),!0}catch(n){return c(`[${s}] Invalid JSON for attribute "${o}": ${n.message}. Fallback: ${e.fallback}.`),!1}return!0}function J(e,t,o){for(const l in o){const[i,s,r]=o[l];Object.defineProperty(e,l,{get:function(){return i(t,s,r)},enumerable:!0,configurable:!0})}return e}function K(e){const t={};for(const o in e){const l=e[o];if(!l||!l.prop)continue;let i=l.read;if(!i&&l.type)switch(l.type){case"enum":i=U(l.values,l.fallback);break;case"integer":i=B;break;case"float":i=V;break;case"boolean":i=j;break;case"list":i=W;break;case"json":i=H;break;case"string":default:i=h;break}i||(i=h),t[l.prop]=[i,o,l.fallback]}return t}function pe(e){const t={};for(const o in e){const l=e[o];l&&l.effect&&(t[o]=l.effect)}return Object.keys(t).length?t:null}function be(e){if(e.onAttrChange&&!e.declared)return null;const t=new Set;if(e.effects)for(const 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=J,window.lnCore.attrSpec=K,window.lnCore.attrStr=h,window.lnCore.attrInt=B,window.lnCore.attrBool=j,window.lnCore.attrList=W,window.lnCore.attrEnum=U,window.lnCore.attrFloat=V,window.lnCore.attrJson=H);function p(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 P(e,t,o,l){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",r={selector:t,attribute:o,ComponentFn:l};if(e.matches&&e.matches(s)&&p(e,r),e.querySelectorAll){const c=e.querySelectorAll(s);for(let n=0;n<c.length;n++)p(c[n],r)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function ge(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function Ce(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function z(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function me(e){const t=z(),o=e.observed||[];for(let l=0;l<o.length;l++){const i=o[l];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const l in e.attributes){t.byDeclaredAttr.has(l)||t.byDeclaredAttr.set(l,[]);const i=t.byDeclaredAttr.get(l);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[l],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const l=be(e);if(l===null)t.reactiveWildcard.push(e);else for(const i of l)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function G(e,t,o,l){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const r=s.effects&&s.effects[o];r?r(t,o,l):s.onAttrChange&&(!s.declared||s.declared.has(o))&&s.onAttrChange(t,o,l)}}function ye(e){const t=e.attributeName,o=t.indexOf("data-ln-")===0,l=z(),i=l.byAttr.get(t),s=I()&&l.byDeclaredAttr&&l.byDeclaredAttr.has(t);if(!o&&!i&&!s)return;const r=e.target;if(e.oldValue!==r.getAttribute(t)){if(s&&A(r)){const c=l.byDeclaredAttr.get(t),n=r.getAttribute(t);for(let a=0;a<c.length;a++)Q(c[a].spec,n,t,c[a].componentTag,r)}if(window.lnCore._debugSink&&(o||i)&&window.lnCore._debugSink("attr",t,r,{oldValue:e.oldValue,newValue:r.getAttribute(t)}),o){const c=l.byReactive.get(t);c&&G(c,r,t,e.oldValue),l.reactiveWildcard.length&&G(l.reactiveWildcard,r,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const n=i[c];if(n.handler){n.handler(r,t,e.oldValue);continue}n.onAttributeChange&&r[n.attribute]?n.onAttributeChange(r,t):(P(r,n.selector,n.attribute,n.ComponentFn),n.onInit&&n.onInit(r))}}}function Ae(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,m(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++)try{ye(t[o])}catch(l){console.error("[ln-core] mutation handler failed",t[o].target,l)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function _(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function S(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function k(e,t){if(!document.contains(e))if(t.attribute){const o=e[t.attribute];if(o&&typeof o.destroy=="function")try{o.destroy()}catch(l){console.error("["+t.attribute+"] destroy failed",e,l)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function ve(e){const t=_();if(!t.length)return;const o=e.target;if(o){const i=o.nodeType===1?o:o.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const l=S();if(e.target&&l.length)for(let i=0;i<l.length;i++){const s=l[i],r=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(r)?e.target:e.target.closest?e.target.closest(r):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(r):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const r=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c];if(n.selector&&n.attribute&&n.ComponentFn){if(!r)s.matches&&s.matches(n.query)&&p(s,n);else if(s.matches&&s.matches(n.query)&&p(s,n),s.querySelectorAll){const a=s.querySelectorAll(n.query);for(let u=0;u<a.length;u++)p(a[u],n)}}n.onInit&&n.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){const r=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const n=t[c],a=n.query;if(a){if(!r)s.matches&&s.matches(a)&&k(s,n);else if(s.matches&&s.matches(a)&&k(s,n),s.querySelectorAll){const u=s.querySelectorAll(a);for(let d=0;d<u.length;d++)k(u[d],n)}}}}}}function X(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,m(function(){new MutationObserver(function(t){for(let o=0;o<t.length;o++){const l=t[o];if(l.type==="childList")try{ve(l)}catch(i){console.error("[ln-core] lifecycle handler failed",l.target,i)}}}).observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){_().push(e),e.onSubtreeChange&&e.query&&S().push(e),X()}function Y(e,t,o,l,i={}){const s=i.extraAttributes||[],r=i.onAttributeChange||null,c=i.onSubtreeChange||null,n=i.onInit||null,a=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?pe(d):u,b=d?new Set(Object.keys(d)):null,g=i.persist||null;function y(L){const w=L||document.body;if(P(w,e,t,o),d&&I())for(const C in d){const Te=d[C],D=Array.from(w.querySelectorAll("["+C+"]"));w.matches&&w.matches("["+C+"]")&&D.push(w);for(let F=0;F<D.length;F++){const q=D[F];A(q)&&Q(Te,q.getAttribute(C),C,l,q)}}n&&n(w)}const O=[];if(e.indexOf("[")!==-1){const L=/\[([\w-]+)/g;let w;for(;(w=L.exec(e))!==null;)O.push(w[1])}else O.push(e);me({selector:e,attribute:t,componentTag:l,attributes:d,ComponentFn:o,onInit:n,observed:O.concat(s),onAttributeChange:r,onAttrChange:a,effects:f,declared:b,persist:g}),Ae();const Ie=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ee=i.subtreeQuery||(Ie?e:"["+e+"]"),te={selector:e,attribute:t,ComponentFn:o,onInit:n,onSubtreeChange:c,query:ee};_().push(te),c&&ee&&S().push(te),X(),window[t]=y,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Y,window.lnCore.observeLifecycle=xe);function ne(){ge()>0?Ce(function(){y(document.body)}):y(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),y}function Z(e){return(e||"").replace(/^#/,"")}function E(e){const t=e===void 0?location.hash:e,o={},l=Z(t);if(!l)return o;const i=l.split("&");for(let s=0;s<i.length;s++){const r=i[s];if(!r)continue;const c=r.indexOf(":"),n=c>-1?r.slice(0,c):r,a=c>-1?r.slice(c+1):"";if(n)try{o[n]=decodeURIComponent(a)}catch{o[n]=a}}return o}function _e(e){if(!e)return null;const t=E();return e in t?t[e]:null}function Se(e,t){if(!e)return;const o=E();t==null?delete o[e]:o[e]=String(t);const i=Object.keys(o).map(function(s){const r=o[s];return r===""?s:s+":"+encodeURIComponent(r)}).join("&");Z(location.hash)!==i&&(location.hash=i)}function ke(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Ee(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 l=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return l?t?l+"-"+t:l:t||null}function Oe(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 De(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Fe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const o=e.slice(0,t),l=e.slice(t+1),i=l?l.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:o,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=E,window.lnCore.hashGet=_e,window.lnCore.hashSet=Se,window.lnCore.hashLinkClick=ke,window.lnCore.resolveHashNamespace=Ee,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Le,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=Fe);function qe(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=qe),(function(){const e="data-ln-options",t="lnOptions";if(window[t]!==void 0)return;const o={"data-ln-options":{prop:"_storeName",type:"string",read:h,fallback:"",description:"Store or coordinator addressing to populate options from"},"data-ln-options-value":{prop:"_valueField",type:"string",read:h,fallback:"id",description:"Field name used for option value attribute"},"data-ln-options-label":{prop:"_labelField",type:"string",read:h,fallback:"name",description:"Field name used for option visible label text"}},l=K(o);function i(s){this.dom=s,J(this,s,l);const r=this;return this._onSetData=function(c){c.detail&&r._rebuild(c.detail.data||[])},s.addEventListener("ln-options:set-data",this._onSetData),T(s,"ln-options:request-data",{options:this._storeName}),this}i.prototype._rebuild=function(s){const r=this.dom,c=this._valueField,n=this._labelField,a=r.getAttribute("data-ln-value")||r.value,u=r.querySelectorAll("option");for(let f=u.length-1;f>=0;f--)u[f].value!==""&&r.removeChild(u[f]);for(let f=0;f<s.length;f++){const b=s[f],g=document.createElement("option");g.value=String(b[c]),g.textContent=b[n]!=null?b[n]:"",r.appendChild(g)}const d=r.options;for(let f=0;f<d.length;f++)if(d[f].value===String(a)){r.value=String(a);break}},i.prototype.destroy=function(){this.dom[t]&&(this.dom.removeEventListener("ln-options:set-data",this._onSetData),delete this.dom[t])},Y(e,t,i,"ln-options",{attributes:o})})()})();
|