@livenetworks/ashlar 2.1.10 → 2.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/COMPONENTS.md +1 -1
- 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-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/events.js +5 -2
- package/components/ln-core/lifecycle.js +25 -44
- 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/README.md +19 -0
- package/components/ln-data-store/ln-data-store.js +1 -1
- package/components/ln-data-store/ln-data-store.schema.json +92 -84
- package/components/ln-data-store/src/data-store-model.js +17 -0
- package/components/ln-data-store/src/ln-data-store.js +77 -1
- package/components/ln-date/ln-date.js +1 -1
- package/components/ln-debug/ln-debug.js +1 -1
- package/components/ln-debug/ln-debug.schema.json +28 -28
- package/components/ln-debug/src/debug-verifier.js +24 -30
- package/components/ln-debug/src/generated-attributes.js +1 -3
- package/components/ln-debug/src/ln-debug.js +3 -11
- package/components/ln-dropdown/ln-dropdown.js +1 -1
- package/components/ln-editor/ln-editor.js +1 -1
- package/components/ln-external-links/ln-external-links.js +1 -1
- package/components/ln-filter/ln-filter.js +1 -1
- package/components/ln-form/ln-form.js +1 -1
- package/components/ln-icon/ln-icon.js +1 -1
- package/components/ln-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-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-obfuscator/ln-obfuscator.js +1 -1
- package/components/ln-options/ln-options.js +1 -1
- package/components/ln-persist/ln-persist.js +1 -1
- package/components/ln-picklist/ln-picklist.js +1 -1
- package/components/ln-popover/ln-popover.js +1 -1
- package/components/ln-progress/ln-progress.js +1 -1
- package/components/ln-router/ln-router.js +1 -1
- package/components/ln-scroll/ln-scroll.js +1 -1
- package/components/ln-search/ln-search.js +1 -1
- package/components/ln-slug/ln-slug.js +1 -1
- package/components/ln-sort/ln-sort.js +1 -1
- package/components/ln-sortable/ln-sortable.js +1 -1
- package/components/ln-stat/ln-stat.js +1 -1
- package/components/ln-table/README.md +69 -38
- package/components/ln-table/ln-table.js +1 -1
- package/components/ln-table/ln-table.schema.json +11 -35
- package/components/ln-table/src/ln-table.js +306 -414
- package/components/ln-table/src/table-model.js +31 -0
- package/components/ln-table-coordinator/ln-table-coordinator.js +1 -1
- package/components/ln-tabs/ln-tabs.js +1 -1
- package/components/ln-time/ln-time.js +1 -1
- package/components/ln-toast/ln-toast.js +1 -1
- package/components/ln-toggle/ln-toggle.js +1 -1
- package/components/ln-tooltip/ln-tooltip.js +1 -1
- package/components/ln-translations/ln-translations.js +1 -1
- package/components/ln-ui-coordinator/ln-ui-coordinator.js +1 -1
- package/components/ln-upload/ln-upload.js +1 -1
- package/components/ln-validate/ln-validate.js +1 -1
- package/components/ln-websocket-connector/ln-websocket-connector.js +1 -1
- package/ln-ashlar.html-data.json +7 -17
- package/package.json +1 -1
- package/theme/config/mixins/_ln-table.scss +18 -10
- package/theme/config/mixins/_table.scss +15 -2
- package/web-types.json +14 -28
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function R(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function x(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!x(o))return}e.apply(console,t)}}function M(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function 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 re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let a=0;a<r.options.length;a++)r.options[a].selected&&i[r.name].push(r.options[a].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const a=Number(r.value);i[r.name]=r.value===""||isNaN(a)?null:a}else i[r.name]=r.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 n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const a=String(r).split(",").map(function(u){return u.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=ie(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let a=0;a<l.options.length;a++)l.options[a].selected=r.indexOf(l.options[a].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=re);const T={};function se(e,t){T[e]=t}function ce(e){return T[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,y(function(){new MutationObserver(function(){M(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const $={};function ue(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];$[n]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return $[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 n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const u=r[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 l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const u=r[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 n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(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 B(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let r=0;r<c.length;r++){const a=c[r];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function he(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const a=e.children[r],u=a.getAttribute("data-ln-render-key");u&&(l[u]=a)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],u=String(o(a));let d=l[u];if(d)i(d,a,r);else{const f=fe(n,s);if(!f||(B(f,a),d=f.firstElementChild,!d))continue;d.setAttribute("data-ln-render-key",u),i(d,a,r)}c.appendChild(d)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=B,window.lnCore.fill=N,window.lnCore.lnFill=we,window.lnCore.renderList=he);function _(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function j(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function U(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function W(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const S=new Map;function V(e,t){const n=(e?e.join("|"):"")+"::"+t;if(S.has(n))return S.get(n);const o=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&o.has(c)?c:t};return S.set(n,i),i}function H(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function P(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function Q(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function pe(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function be(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=V(o.values,o.fallback);break;case"integer":i=j;break;case"float":i=H;break;case"boolean":i=U;break;case"list":i=W;break;case"json":i=P;break;case"string":default:i=_;break}i||(i=_),t[o.prop]=[i,n,o.fallback]}return t}function ge(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function me(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=pe,window.lnCore.attrSpec=be,window.lnCore.attrStr=_,window.lnCore.attrInt=j,window.lnCore.attrBool=U,window.lnCore.attrList=W,window.lnCore.attrEnum=V,window.lnCore.attrFloat=H,window.lnCore.attrJson=P);function m(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function G(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&m(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)m(c[r],l)}}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 ye(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 Ae(e){const t=J(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=me(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function K(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function xe(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=J(),i=o.byAttr.get(t),s=R()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&x(l)){const c=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let a=0;a<c.length;a++)Q(c[a].spec,r,t,c[a].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=o.byReactive.get(t);c&&K(c,l,t,e.oldValue),o.reactiveWildcard.length&&K(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const r=i[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(G(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,y(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{xe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function k(){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 L(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function z(e){const t=k();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=E();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)s.matches&&s.matches(r.query)&&m(s,r);else if(s.matches&&s.matches(r.query)&&m(s,r),s.querySelectorAll){const a=s.querySelectorAll(r.query);for(let u=0;u<a.length;u++)m(a[u],r)}}r.onInit&&r.onInit(s)}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],a=r.query;if(a){if(!l)s.matches&&s.matches(a)&&L(s,r);else if(s.matches&&s.matches(a)&&L(s,r),s.querySelectorAll){const u=s.querySelectorAll(a);for(let d=0;d<u.length;d++)L(u[d],r)}}}}}}function X(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,y(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{z(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{z(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Se(e){k().push(e),e.onSubtreeChange&&e.query&&E().push(e),X()}function Z(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,r=i.onInit||null,a=i.onAttrChange||null,u=i.effects||null,d=i.attributes||null,f=d?ge(d):u,p=d?new Set(Object.keys(d)):null,w=i.persist||null;function b(q){const h=q||document.body;if(G(h,e,t,n),d&&R())for(const C in d){const Pe=d[C],D=Array.from(h.querySelectorAll("["+C+"]"));h.matches&&h.matches("["+C+"]")&&D.push(h);for(let I=0;I<D.length;I++){const F=D[I];x(F)&&Q(Pe,F.getAttribute(C),C,o,F)}}r&&r(h)}const g=[];if(e.indexOf("[")!==-1){const q=/\[([\w-]+)/g;let h;for(;(h=q.exec(e))!==null;)g.push(h[1])}else g.push(e);Ae({selector:e,attribute:t,componentTag:o,attributes:d,ComponentFn:n,onInit:r,observed:g.concat(s),onAttributeChange:l,onAttrChange:a,effects:f,declared:p,persist:w}),ve();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ee=i.subtreeQuery||(A?e:"["+e+"]"),te={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:ee};k().push(te),c&&ee&&E().push(te),X(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=Se,window.lnCore.withoutLifecycle=_e);function ne(){Ce()>0?ye(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),b}function Y(e){return(e||"").replace(/^#/,"")}function O(e){const t=e===void 0?location.hash:e,n={},o=Y(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,a=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(a)}catch{n[r]=a}}return n}function ke(e){if(!e)return null;const t=O();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const n=O();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");Y(location.hash)!==i&&(location.hash=i)}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 n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function qe(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function De(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function Fe(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=O,window.lnCore.hashGet=ke,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=Le,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=qe,window.lnCore.hashSortDecode=De,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=Fe);function Re(e){return(e||"").replace(/^\?/,"")}function Me(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=Re(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,l]of i.entries())n[s]=l;return n}function Te(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function $e(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function Ne(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function Be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Ue(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function We(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Me,window.lnCore.queryGet=Te,window.lnCore.querySet=$e,window.lnCore.resolveQueryParam=Ne,window.lnCore.querySortEncode=Be,window.lnCore.querySortDecode=je,window.lnCore.queryFilterEncode=Ue,window.lnCore.queryFilterDecode=We);function Ve(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ve);function He(e,t=100,n=0){const o=parseFloat(String(e))||0,i=parseFloat(String(t))||100,s=parseFloat(String(n))||0,l=Math.max(s,Math.min(o,i)),c=i-s;let r=0;return c>0&&(r=(l-s)/c*100),r=Math.max(0,Math.min(100,r)),{value:o,min:s,max:i,clampedValue:l,percentage:r}}(function(){const e="data-ln-circular-progress",t="lnCircularProgress";if(window[t]!==void 0)return;function n(f){const p=f[t];p&&d.call(p)}const o={"data-ln-circular-progress":{type:"float",fallback:0,min:0,effect:n,description:"Current circular progress value"},"data-ln-circular-progress-max":{type:"float",fallback:100,min:0,effect:n,description:"Maximum circular progress scale value"},"data-ln-circular-progress-label":{type:"string",effect:n,description:"Text label format or template inside circular progress"}},i="http://www.w3.org/2000/svg",s=36,l=16,c=2*Math.PI*l;function r(f){return this.dom=f,this.svg=null,this.trackCircle=null,this.progressCircle=null,this.labelEl=null,u.call(this),d.call(this),this}r.prototype.destroy=function(){this.dom[t]&&(this.svg&&this.svg.remove(),this.labelEl&&this.labelEl.remove(),delete this.dom[t])};function a(f,p){const w=document.createElementNS(i,f);for(const[b,g]of Object.entries(p))w.setAttribute(b,g);return w}function u(){this.svg=a("svg",{viewBox:"0 0 "+s+" "+s,width:s,height:s}),this.svg.classList.add("ln-circular-progress__svg"),this.trackCircle=a("circle",{cx:s/2,cy:s/2,r:l,fill:"none","stroke-width":"3"}),this.trackCircle.classList.add("ln-circular-progress__track"),this.progressCircle=a("circle",{cx:s/2,cy:s/2,r:l,fill:"none","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":c,"stroke-dashoffset":c,transform:"rotate(-90 "+s/2+" "+s/2+")"}),this.progressCircle.classList.add("ln-circular-progress__fill"),this.svg.appendChild(this.trackCircle),this.svg.appendChild(this.progressCircle),this.labelEl=document.createElement("strong"),this.labelEl.classList.add("ln-circular-progress__label"),this.dom.appendChild(this.svg),this.dom.appendChild(this.labelEl)}function d(){const f=this.dom.getAttribute("data-ln-circular-progress"),p=this.dom.getAttribute("data-ln-circular-progress-max"),w=He(f,p||100),b=c-w.percentage/100*c;this.progressCircle.setAttribute("stroke-dashoffset",b);const g=this.dom.getAttribute("data-ln-circular-progress-label"),A=g!==null?g:Math.round(w.percentage)+"%";this.labelEl.textContent=A,this.dom.setAttribute("role","progressbar"),this.dom.setAttribute("aria-valuemin",String(w.min)),this.dom.setAttribute("aria-valuemax",String(w.max)),this.dom.setAttribute("aria-valuenow",String(w.clampedValue)),this.dom.setAttribute("aria-valuetext",A),M(this.dom,"ln-circular-progress:change",{target:this.dom,value:w.value,max:w.max,percentage:w.percentage})}Z(e,t,r,"ln-circular-progress",{attributes:o})})()})();
|
|
1
|
+
(function(){"use strict";function F(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function x(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!x(o))return}e.apply(console,t)}}function R(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function C(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){C(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function re(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function oe(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&l[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let a=0;a<r.options.length;a++)r.options[a].selected&&i[r.name].push(r.options[a].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const a=Number(r.value);i[r.name]=r.value===""||isNaN(a)?null:a}else i[r.name]=r.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 n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(i[l.name]=(i[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(i[l.name]>1){const a=String(r).split(",").map(function(d){return d.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=ie(r);o.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),o.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let a=0;a<l.options.length;a++)l.options[a].selected=r.indexOf(l.options[a].value)!==-1;o.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),o.push(l)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=le,window.lnCore.serializeForm=oe,window.lnCore.resolveFormMethod=re);const M={};function se(e,t){M[e]=t}function ce(e){return M[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,C(function(){new MutationObserver(function(){R(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const T={};function ue(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];T[n]=t}function de(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return T[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 n=v[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const d=r[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();t[f]!=null&&c.setAttribute(u,t[f])}}const i=e.querySelectorAll("[data-ln-show]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const d=r[a].trim().split(":");if(d.length!==2)continue;const u=d[0].trim(),f=d[1].trim();f in t&&c.classList.toggle(u,!!t[f])}}return e}function 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 n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(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 N(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const o=function(s,l){return t[l]!==void 0?t[l]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const l=i[s],c=l.attributes;for(let r=0;r<c.length;r++){const a=c[r];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function he(e,t,n,o,i,s){const l={};for(let r=0;r<e.children.length;r++){const a=e.children[r],d=a.getAttribute("data-ln-render-key");d&&(l[d]=a)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],d=String(o(a));let u=l[d];if(u)i(u,a,r);else{const f=fe(n,s);if(!f||(N(f,a),u=f.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",d),i(u,a,r)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=N,window.lnCore.fill=$,window.lnCore.lnFill=we,window.lnCore.renderList=he);function _(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function B(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function j(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function U(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const S=new Map;function W(e,t){const n=(e?e.join("|"):"")+"::"+t;if(S.has(n))return S.get(n);const o=new Set(e||[]),i=function(s,l){const c=s.getAttribute(l);return c!==null&&o.has(c)?c:t};return S.set(n,i),i}function V(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function H(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function P(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{i?console.warn(r,i):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function pe(e,t,n){for(const o in n){const[i,s,l]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,l)},enumerable:!0,configurable:!0})}return e}function be(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=W(o.values,o.fallback);break;case"integer":i=B;break;case"float":i=V;break;case"boolean":i=j;break;case"list":i=U;break;case"json":i=H;break;case"string":default:i=_;break}i||(i=_),t[o.prop]=[i,n,o.fallback]}return t}function ge(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function me(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=pe,window.lnCore.attrSpec=be,window.lnCore.attrStr=_,window.lnCore.attrInt=B,window.lnCore.attrBool=j,window.lnCore.attrList=U,window.lnCore.attrEnum=W,window.lnCore.attrFloat=V,window.lnCore.attrJson=H);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 Q(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&y(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)y(c[r],l)}}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 ye(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 G(){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 Ae(e){const t=G(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=me(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function J(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function xe(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=G(),i=o.byAttr.get(t),s=F()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&x(l)){const c=o.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let a=0;a<c.length;a++)P(c[a].spec,r,t,c[a].componentTag,l)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=o.byReactive.get(t);c&&J(c,l,t,e.oldValue),o.reactiveWildcard.length&&J(o.reactiveWildcard,l,t,e.oldValue)}if(i)for(let c=0;c<i.length;c++){const r=i[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(Q(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function ve(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,C(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{xe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function k(){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 K(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function z(e){const t=k();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=E();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType!==1)continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],a=r.query;if(a&&(s.matches&&s.matches(a)&&(r.ComponentFn&&y(s,r),r.onInit&&r.onInit(s)),l&&s.querySelectorAll)){const d=s.querySelectorAll(a);for(let u=0;u<d.length;u++)r.ComponentFn&&y(d[u],r),r.onInit&&r.onInit(d[u])}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType!==1||document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],a=r.query;if(a&&(s.matches&&s.matches(a)&&K(s,r),l&&s.querySelectorAll)){const d=s.querySelectorAll(a);for(let u=0;u<d.length;u++)K(d[u],r)}}}}function X(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,C(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{z(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function _e(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{z(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Se(e){k().push(e),e.onSubtreeChange&&e.query&&E().push(e),X()}function Z(e,t,n,o,i={}){const s=i.extraAttributes||[],l=i.onAttributeChange||null,c=i.onSubtreeChange||null,r=i.onInit||null,a=i.onAttrChange||null,d=i.effects||null,u=i.attributes||null,f=u?ge(u):d,p=u?new Set(Object.keys(u)):null,w=i.persist||null;function b(O){const h=O||document.body;if(Q(h,e,t,n),u&&F())for(const m in u){const Pe=u[m],I=Array.from(h.querySelectorAll("["+m+"]"));h.matches&&h.matches("["+m+"]")&&I.push(h);for(let q=0;q<I.length;q++){const D=I[q];x(D)&&P(Pe,D.getAttribute(m),m,o,D)}}r&&r(h)}const g=[];if(e.indexOf("[")!==-1){const O=/\[([\w-]+)/g;let h;for(;(h=O.exec(e))!==null;)g.push(h[1])}else g.push(e);Ae({selector:e,attribute:t,componentTag:o,attributes:u,ComponentFn:n,onInit:r,observed:g.concat(s),onAttributeChange:l,onAttrChange:a,effects:f,declared:p,persist:w}),ve();const A=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,ee=i.subtreeQuery||(A?e:"["+e+"]"),te={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:ee};k().push(te),c&&ee&&E().push(te),X(),window[t]=b,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=Se,window.lnCore.withoutLifecycle=_e);function ne(){Ce()>0?ye(function(){b(document.body)}):b(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",ne):ne(),b}function Y(e){return(e||"").replace(/^#/,"")}function L(e){const t=e===void 0?location.hash:e,n={},o=Y(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const l=i[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,a=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(a)}catch{n[r]=a}}return n}function ke(e){if(!e)return null;const t=L();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const n=L();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");Y(location.hash)!==i&&(location.hash=i)}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 n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function 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 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 n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=L,window.lnCore.hashGet=ke,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=Le,window.lnCore.resolveHashNamespace=Oe,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=De,window.lnCore.hashFilterDecode=Fe);function Re(e){return(e||"").replace(/^\?/,"")}function Me(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=Re(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,l]of i.entries())n[s]=l;return n}function Te(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function $e(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function Ne(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function Be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function je(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Ue(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function We(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Me,window.lnCore.queryGet=Te,window.lnCore.querySet=$e,window.lnCore.resolveQueryParam=Ne,window.lnCore.querySortEncode=Be,window.lnCore.querySortDecode=je,window.lnCore.queryFilterEncode=Ue,window.lnCore.queryFilterDecode=We);function Ve(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=Ve);function He(e,t=100,n=0){const o=parseFloat(String(e))||0,i=parseFloat(String(t))||100,s=parseFloat(String(n))||0,l=Math.max(s,Math.min(o,i)),c=i-s;let r=0;return c>0&&(r=(l-s)/c*100),r=Math.max(0,Math.min(100,r)),{value:o,min:s,max:i,clampedValue:l,percentage:r}}(function(){const e="data-ln-circular-progress",t="lnCircularProgress";if(window[t]!==void 0)return;function n(f){const p=f[t];p&&u.call(p)}const o={"data-ln-circular-progress":{type:"float",fallback:0,min:0,effect:n,description:"Current circular progress value"},"data-ln-circular-progress-max":{type:"float",fallback:100,min:0,effect:n,description:"Maximum circular progress scale value"},"data-ln-circular-progress-label":{type:"string",effect:n,description:"Text label format or template inside circular progress"}},i="http://www.w3.org/2000/svg",s=36,l=16,c=2*Math.PI*l;function r(f){return this.dom=f,this.svg=null,this.trackCircle=null,this.progressCircle=null,this.labelEl=null,d.call(this),u.call(this),this}r.prototype.destroy=function(){this.dom[t]&&(this.svg&&this.svg.remove(),this.labelEl&&this.labelEl.remove(),delete this.dom[t])};function a(f,p){const w=document.createElementNS(i,f);for(const[b,g]of Object.entries(p))w.setAttribute(b,g);return w}function d(){this.svg=a("svg",{viewBox:"0 0 "+s+" "+s,width:s,height:s}),this.svg.classList.add("ln-circular-progress__svg"),this.trackCircle=a("circle",{cx:s/2,cy:s/2,r:l,fill:"none","stroke-width":"3"}),this.trackCircle.classList.add("ln-circular-progress__track"),this.progressCircle=a("circle",{cx:s/2,cy:s/2,r:l,fill:"none","stroke-width":"3","stroke-linecap":"round","stroke-dasharray":c,"stroke-dashoffset":c,transform:"rotate(-90 "+s/2+" "+s/2+")"}),this.progressCircle.classList.add("ln-circular-progress__fill"),this.svg.appendChild(this.trackCircle),this.svg.appendChild(this.progressCircle),this.labelEl=document.createElement("strong"),this.labelEl.classList.add("ln-circular-progress__label"),this.dom.appendChild(this.svg),this.dom.appendChild(this.labelEl)}function u(){const f=this.dom.getAttribute("data-ln-circular-progress"),p=this.dom.getAttribute("data-ln-circular-progress-max"),w=He(f,p||100),b=c-w.percentage/100*c;this.progressCircle.setAttribute("stroke-dashoffset",b);const g=this.dom.getAttribute("data-ln-circular-progress-label"),A=g!==null?g:Math.round(w.percentage)+"%";this.labelEl.textContent=A,this.dom.setAttribute("role","progressbar"),this.dom.setAttribute("aria-valuemin",String(w.min)),this.dom.setAttribute("aria-valuemax",String(w.max)),this.dom.setAttribute("aria-valuenow",String(w.clampedValue)),this.dom.setAttribute("aria-valuetext",A),R(this.dom,"ln-circular-progress:change",{target:this.dom,value:w.value,max:w.max,percentage:w.percentage})}Z(e,t,r,"ln-circular-progress",{attributes:o})})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function D(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function y(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){i=t[o];break}if(!y(i))return}e.apply(console,t)}}function F(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function g(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){g(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,o={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(i&&r.matches&&r.matches(i)))if(r.type==="checkbox")n&&l[r.name]===1?o[r.name]=r.checked:(o[r.name]||(o[r.name]=[]),r.checked&&o[r.name].push(r.value));else if(r.type==="radio")r.checked&&(o[r.name]=r.value);else if(r.type==="select-multiple"){o[r.name]=[];for(let u=0;u<r.options.length;u++)r.options[u].selected&&o[r.name].push(r.options[u].value)}else if(n&&r.type==="hidden")o[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const u=Number(r.value);o[r.name]=r.value===""||isNaN(u)?null:u}else o[r.name]=r.value}return o}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const n=e.elements,i=[],o={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(o[l.name]>1){const u=String(r).split(",").map(function(f){return f.trim()});l.checked=u.indexOf(l.value)!==-1}else l.checked=se(r);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let u=0;u<l.options.length;u++)l.options[u].selected=r.indexOf(l.options[u].value)!==-1;i.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=oe);const R={};function ue(e,t){R[e]=t}function ae(e){return R[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=ae);function de(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,g(function(){new MutationObserver(function(){F(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const N={};function fe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];N[n]=t}function we(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=fe,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=de);const A={};function he(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=A[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function $(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-attr").split(",");for(let u=0;u<r.length;u++){const f=r[u].trim().split(":");if(f.length!==2)continue;const a=f[0].trim(),d=f[1].trim();t[d]!=null&&c.setAttribute(a,t[d])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let u=0;u<r.length;u++){const f=r[u].trim().split(":");if(f.length!==2)continue;const a=f[0].trim(),d=f[1].trim();d in t&&c.classList.toggle(a,!!t[d])}}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 n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)$(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 M(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const i=function(s,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],c=l.attributes;for(let r=0;r<c.length;r++){const u=c[r];u.value.indexOf("{{")!==-1&&l.setAttribute(u.name,u.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function me(e,t,n,i,o,s){const l={};for(let r=0;r<e.children.length;r++){const u=e.children[r],f=u.getAttribute("data-ln-render-key");f&&(l[f]=u)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const u=t[r],f=String(i(u));let a=l[f];if(a)o(a,u,r);else{const d=he(n,s);if(!d||(M(d,u),a=d.firstElementChild,!a))continue;a.setAttribute("data-ln-render-key",f),o(a,u,r)}c.appendChild(a)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=M,window.lnCore.fill=$,window.lnCore.lnFill=be,window.lnCore.renderList=me);function v(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function B(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function U(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const o=i.trim().toLowerCase();return!(o==="false"||o==="0")}function j(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const _=new Map;function W(e,t){const n=(e?e.join("|"):"")+"::"+t;if(_.has(n))return _.get(n);const i=new Set(e||[]),o=function(s,l){const c=s.getAttribute(l);return c!==null&&i.has(c)?c:t};return _.set(n,o),o}function H(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function V(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function K(e,t,n,i,o){if(!e||t===null)return!0;const s=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{o?console.warn(r,o):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function P(e,t,n){for(const i in n){const[o,s,l]=n[i];Object.defineProperty(e,i,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function Q(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let o=i.read;if(!o&&i.type)switch(i.type){case"enum":o=W(i.values,i.fallback);break;case"integer":o=B;break;case"float":o=H;break;case"boolean":o=U;break;case"list":o=j;break;case"json":o=V;break;case"string":default:o=v;break}o||(o=v),t[i.prop]=[o,n,i.fallback]}return t}function pe(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function ge(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=P,window.lnCore.attrSpec=Q,window.lnCore.attrStr=v,window.lnCore.attrInt=B,window.lnCore.attrBool=U,window.lnCore.attrList=j,window.lnCore.attrEnum=W,window.lnCore.attrFloat=H,window.lnCore.attrJson=V);function b(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function J(e,t,n,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:i};if(e.matches&&e.matches(s)&&b(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)b(c[r],l)}}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 ye(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 G(){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 Ae(e){const t=G(),n=e.observed||[];for(let i=0;i<n.length;i++){const o=n[i];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 i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const o=t.byDeclaredAttr.get(i);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=ge(e);if(i===null)t.reactiveWildcard.push(e);else for(const o of i)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function z(e,t,n,i){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,i):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,i)}}function ve(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,i=G(),o=i.byAttr.get(t),s=D()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&y(l)){const c=i.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let u=0;u<c.length;u++)K(c[u].spec,r,t,c[u].componentTag,l)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=i.byReactive.get(t);c&&z(c,l,t,e.oldValue),i.reactiveWildcard.length&&z(i.reactiveWildcard,l,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const r=o[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(J(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,g(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ve(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function x(){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 n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function X(e){const t=x();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 i=S();if(e.target&&i.length)for(let o=0;o<i.length;o++){const s=i[o],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType===1){const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c];if(r.selector&&r.attribute&&r.ComponentFn){if(!l)s.matches&&s.matches(r.query)&&b(s,r);else if(s.matches&&s.matches(r.query)&&b(s,r),s.querySelectorAll){const u=s.querySelectorAll(r.query);for(let f=0;f<u.length;f++)b(u[f],r)}}r.onInit&&r.onInit(s)}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType===1){if(document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],u=r.query;if(u){if(!l)s.matches&&s.matches(u)&&k(s,r);else if(s.matches&&s.matches(u)&&k(s,r),s.querySelectorAll){const f=s.querySelectorAll(u);for(let a=0;a<f.length;a++)k(f[a],r)}}}}}}function Y(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,g(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{X(i)}catch(o){console.error("[ln-core] lifecycle handler failed",i.target,o)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let i=0;i<n.length;i++){const o=n[i];if(o.type==="childList")try{X(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Se(e){x().push(e),e.onSubtreeChange&&e.query&&S().push(e),Y()}function Z(e,t,n,i,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,r=o.onInit||null,u=o.onAttrChange||null,f=o.effects||null,a=o.attributes||null,d=a?pe(a):f,w=a?new Set(Object.keys(a)):null,m=o.persist||null;function C(L){const h=L||document.body;if(J(h,e,t,n),a&&D())for(const p in a){const Ke=a[p],O=Array.from(h.querySelectorAll("["+p+"]"));h.matches&&h.matches("["+p+"]")&&O.push(h);for(let q=0;q<O.length;q++){const I=O[q];y(I)&&K(Ke,I.getAttribute(p),p,i,I)}}r&&r(h)}const T=[];if(e.indexOf("[")!==-1){const L=/\[([\w-]+)/g;let h;for(;(h=L.exec(e))!==null;)T.push(h[1])}else T.push(e);Ae({selector:e,attribute:t,componentTag:i,attributes:a,ComponentFn:n,onInit:r,observed:T.concat(s),onAttributeChange:l,onAttrChange:u,effects:d,declared:w,persist:m}),_e();const Ve=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,te=o.subtreeQuery||(Ve?e:"["+e+"]"),ne={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:te};x().push(ne),c&&te&&S().push(ne),Y(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=Se,window.lnCore.withoutLifecycle=xe);function re(){Ce()>0?ye(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",re):re(),C}function ee(e){return(e||"").replace(/^#/,"")}function E(e){const t=e===void 0?location.hash:e,n={},i=ee(t);if(!i)return n;const o=i.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,u=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(u)}catch{n[r]=u}}return n}function ke(e){if(!e)return null;const t=E();return e in t?t[e]:null}function Ee(e,t){if(!e)return;const n=E();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");ee(location.hash)!==o&&(location.hash=o)}function Te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Oe(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 Ie(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),o=i?i.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=E,window.lnCore.hashGet=ke,window.lnCore.hashSet=Ee,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=qe,window.lnCore.hashFilterEncode=Ie,window.lnCore.hashFilterDecode=De);function Fe(e){return(e||"").replace(/^\?/,"")}function Re(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},i=Fe(t);if(!i)return n;const o=new URLSearchParams(i);for(const[s,l]of o.entries())n[s]=l;return n}function Ne(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function $e(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const i=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",i)}function Me(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const 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 Be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ue(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const i=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:i}}}return null}function je(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function We(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Re,window.lnCore.queryGet=Ne,window.lnCore.querySet=$e,window.lnCore.resolveQueryParam=Me,window.lnCore.querySortEncode=Be,window.lnCore.querySortDecode=Ue,window.lnCore.queryFilterEncode=je,window.lnCore.queryFilterDecode=We);function He(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=He),(function(){const e="data-ln-confirm",t="lnConfirm",n="data-ln-confirm-state",i="data-ln-confirm-announcer";if(window[t]!==void 0)return;function s(a,d,w){return a.getAttribute(d)||w}function l(a,d,w){const m=parseFloat(a.getAttribute(d));return isNaN(m)||m<=0?w:m}function c(a){const d=document.createElement("span");return d.setAttribute(i,""),d.setAttribute("role","alert"),d.textContent=a,d}const r={"data-ln-confirm":{prop:"confirmText",type:"string",read:s,fallback:"Confirm?",description:"Prompt text or confirmation action trigger"},"data-ln-confirm-timeout":{prop:"timeout",type:"float",read:l,fallback:3,min:.1,description:"Confirmation timeout in seconds before reverting"},"data-ln-confirm-state":{prop:"confirming",type:"enum",values:["confirming"],read:(a,d)=>a.getAttribute(d)==="confirming",description:'Active confirmation state marker on button ("confirming")'}},u=Q(r);function f(a){this.dom=a,P(this,a,u),this.revertTimer=null,this._submitted=!1,this.idleEl=a.querySelector("[data-ln-confirm-idle]"),this.activeEl=a.querySelector("[data-ln-confirm-active]"),this.isTwoElementMode=!!(this.idleEl||this.activeEl),this.originalText=this.isTwoElementMode?"":a.textContent.trim();const d=this;return this._onClick=function(w){if(!ie(w))if(!d.confirming)w.preventDefault(),w.stopImmediatePropagation(),d._enterConfirm();else{if(d._submitted)return;d._submitted=!0,d._reset()}},a.addEventListener("click",this._onClick),this}f.prototype._enterConfirm=function(){if(this.dom.setAttribute(n,"confirming"),this.originalAriaLabel=this.dom.getAttribute("aria-label"),this.originalAriaLive=this.dom.getAttribute("aria-live"),this.isTwoElementMode){this.idleEl&&this.idleEl.setAttribute("hidden","true"),this.activeEl&&this.activeEl.removeAttribute("hidden");const a=this.activeEl?this.activeEl.textContent.trim():"";a&&(this.dom.setAttribute("aria-label",a),this.dom.setAttribute("aria-live","polite"))}else{const a=this.dom.querySelector("svg.ln-icon use");a&&this.originalText===""?(this.isIconButton=!0,this.originalIconHref=a.getAttribute("href"),a.setAttribute("href","#ln-icon-check"),this.dom.setAttribute("aria-label",this.confirmText),this.dom.appendChild(c(this.confirmText))):this.dom.textContent=this.confirmText}this._startTimer(),F(this.dom,"ln-confirm:waiting",{target:this.dom})},f.prototype._startTimer=function(){this.revertTimer&&clearTimeout(this.revertTimer);const a=this,d=this.timeout*1e3;this.revertTimer=setTimeout(function(){a._reset()},d)},f.prototype._reset=function(){if(this._submitted=!1,this.dom.removeAttribute(n),this.isTwoElementMode)this.idleEl&&this.idleEl.removeAttribute("hidden"),this.activeEl&&this.activeEl.setAttribute("hidden","true");else if(this.isIconButton){const a=this.dom.querySelector("svg.ln-icon use");a&&this.originalIconHref&&a.setAttribute("href",this.originalIconHref);const d=this.dom.querySelector("["+i+"]");d&&d.remove(),this.isIconButton=!1,this.originalIconHref=null}else this.dom.textContent=this.originalText;this.originalAriaLabel!==null&&this.originalAriaLabel!==void 0?this.dom.setAttribute("aria-label",this.originalAriaLabel):this.dom.removeAttribute("aria-label"),this.originalAriaLabel=null,this.originalAriaLive!==null&&this.originalAriaLive!==void 0?this.dom.setAttribute("aria-live",this.originalAriaLive):this.dom.removeAttribute("aria-live"),this.originalAriaLive=null,this.revertTimer&&(clearTimeout(this.revertTimer),this.revertTimer=null)},f.prototype.destroy=function(){this.dom[t]&&(this.confirming&&this._reset(),this.dom.removeEventListener("click",this._onClick),delete this.dom[t])},Z(e,t,f,"ln-confirm",{attributes:r})})()})();
|
|
1
|
+
(function(){"use strict";function q(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function y(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let i=null;for(let o=1;o<t.length;o++)if(t[o]&&t[o].nodeType===1){i=t[o];break}if(!y(i))return}e.apply(console,t)}}function D(e,t,n){const i=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,i),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))}function p(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){p(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function ie(e){return!!(!e||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey||typeof e.button=="number"&&e.button!==0)}function oe(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function le(e,t){const n=!!(t&&t.typed),i=t&&t.exclude,o={},s=e.elements,l={};if(n)for(let c=0;c<s.length;c++){const r=s[c];r.name&&r.type==="checkbox"&&!r.disabled&&(l[r.name]=(l[r.name]||0)+1)}for(let c=0;c<s.length;c++){const r=s[c];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(i&&r.matches&&r.matches(i)))if(r.type==="checkbox")n&&l[r.name]===1?o[r.name]=r.checked:(o[r.name]||(o[r.name]=[]),r.checked&&o[r.name].push(r.value));else if(r.type==="radio")r.checked&&(o[r.name]=r.value);else if(r.type==="select-multiple"){o[r.name]=[];for(let a=0;a<r.options.length;a++)r.options[a].selected&&o[r.name].push(r.options[a].value)}else if(n&&r.type==="hidden")o[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const a=Number(r.value);o[r.name]=r.value===""||isNaN(a)?null:a}else o[r.name]=r.value}return o}function se(e){if(typeof e!="string")return!!e;const t=e.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!==""&&t!=="off"&&t!=="no"}function ce(e,t){const n=e.elements,i=[],o={};for(let s=0;s<n.length;s++){const l=n[s];l.name&&l.type==="checkbox"&&(o[l.name]=(o[l.name]||0)+1)}for(let s=0;s<n.length;s++){const l=n[s];if(l.type==="file"||l.type==="submit"||l.type==="button")continue;const c=l.getAttribute("data-ln-fill-as")||l.name;if(!c||!(c in t))continue;const r=t[c];if(l.type==="checkbox"){if(Array.isArray(r))l.checked=r.indexOf(l.value)!==-1;else if(o[l.name]>1){const a=String(r).split(",").map(function(f){return f.trim()});l.checked=a.indexOf(l.value)!==-1}else l.checked=se(r);i.push(l)}else if(l.type==="radio")l.checked=l.value===String(r),i.push(l);else if(l.type==="select-multiple"){if(Array.isArray(r))for(let a=0;a<l.options.length;a++)l.options[a].selected=r.indexOf(l.options[a].value)!==-1;i.push(l)}else l.value=r,l.tagName==="SELECT"&&r!=null&&l.setAttribute("data-ln-value",r),i.push(l)}return i}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ce,window.lnCore.serializeForm=le,window.lnCore.resolveFormMethod=oe);const F={};function ue(e,t){F[e]=t}function ae(e){return F[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=ue,window.lnCore.getDataMapper=ae);function de(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,p(function(){new MutationObserver(function(){D(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const R={};function fe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];R[n]=t}function we(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=fe,window.lnCore.getLocaleFallback=we,window.lnCore.ensureLocaleObserver=de);const A={};function he(e,t){A[e]||(A[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=A[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function N(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let l=0;l<n.length;l++){const c=n[l],r=c.getAttribute("data-ln-field");t[r]!=null&&(c.textContent=t[r])}const i=e.querySelectorAll("[data-ln-attr]");for(let l=0;l<i.length;l++){const c=i[l],r=c.getAttribute("data-ln-attr").split(",");for(let a=0;a<r.length;a++){const f=r[a].trim().split(":");if(f.length!==2)continue;const u=f[0].trim(),d=f[1].trim();t[d]!=null&&c.setAttribute(u,t[d])}}const o=e.querySelectorAll("[data-ln-show]");for(let l=0;l<o.length;l++){const c=o[l],r=c.getAttribute("data-ln-show");r in t&&c.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let l=0;l<s.length;l++){const c=s[l],r=c.getAttribute("data-ln-class").split(",");for(let a=0;a<r.length;a++){const f=r[a].trim().split(":");if(f.length!==2)continue;const u=f[0].trim(),d=f[1].trim();d in t&&c.classList.toggle(u,!!t[d])}}return e}function 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 n=e.querySelectorAll("[data-ln-form], [data-ln-fillable]");for(let i=0;i<n.length;i++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[i],t??null),n[i].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)N(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 $(e,t){if(!e||!t)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;n.nextNode();){const s=n.currentNode;s.textContent.indexOf("{{")!==-1&&(s.textContent=s.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(l,c){return t[c]!==void 0?t[c]:""}))}const i=function(s,l){return t[l]!==void 0?t[l]:""},o=Array.from(e.querySelectorAll("*"));e.nodeType===1&&o.push(e);for(let s=0;s<o.length;s++){const l=o[s],c=l.attributes;for(let r=0;r<c.length;r++){const a=c[r];a.value.indexOf("{{")!==-1&&l.setAttribute(a.name,a.value.replace(/\{\{\s*(\w+)\s*\}\}/g,i))}}return e}function me(e,t,n,i,o,s){const l={};for(let r=0;r<e.children.length;r++){const a=e.children[r],f=a.getAttribute("data-ln-render-key");f&&(l[f]=a)}const c=document.createDocumentFragment();for(let r=0;r<t.length;r++){const a=t[r],f=String(i(a));let u=l[f];if(u)o(u,a,r);else{const d=he(n,s);if(!d||($(d,a),u=d.firstElementChild,!u))continue;u.setAttribute("data-ln-render-key",f),o(u,a,r)}c.appendChild(u)}e.textContent="",e.appendChild(c)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=$,window.lnCore.fill=N,window.lnCore.lnFill=be,window.lnCore.renderList=me);function v(e,t,n){const i=e.getAttribute(t);return i===null?n:i}function M(e,t,n){const i=parseInt(e.getAttribute(t),10);return isNaN(i)?n:i}function B(e,t,n=!1){const i=e.getAttribute(t);if(i===null)return!!n;const o=i.trim().toLowerCase();return!(o==="false"||o==="0")}function U(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const _=new Map;function j(e,t){const n=(e?e.join("|"):"")+"::"+t;if(_.has(n))return _.get(n);const i=new Set(e||[]),o=function(s,l){const c=s.getAttribute(l);return c!==null&&i.has(c)?c:t};return _.set(n,o),o}function W(e,t,n){const i=parseFloat(e.getAttribute(t));return isNaN(i)?n:i}function H(e,t,n){const i=e.getAttribute(t);if(!i)return n;try{return JSON.parse(i)}catch{return n}}function V(e,t,n,i,o){if(!e||t===null)return!0;const s=i||"ln-component",l=e.type;if(l==="trigger"||l==="marker"||l==="string"||l==="list"||!l||t===""&&e.fallback!==void 0)return!0;const c=r=>{o?console.warn(r,o):console.warn(r)};if(l==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(c(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(l==="enum"){const r=e.values||[];return r.includes(t)?!0:(c(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(l==="integer"){if(!/^-?\d+$/.test(t))return c(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(c(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(c(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(l==="float")return isNaN(Number(t))?(c(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(l==="json")try{return JSON.parse(t),!0}catch(r){return c(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function K(e,t,n){for(const i in n){const[o,s,l]=n[i];Object.defineProperty(e,i,{get:function(){return o(t,s,l)},enumerable:!0,configurable:!0})}return e}function P(e){const t={};for(const n in e){const i=e[n];if(!i||!i.prop)continue;let o=i.read;if(!o&&i.type)switch(i.type){case"enum":o=j(i.values,i.fallback);break;case"integer":o=M;break;case"float":o=W;break;case"boolean":o=B;break;case"list":o=U;break;case"json":o=H;break;case"string":default:o=v;break}o||(o=v),t[i.prop]=[o,n,i.fallback]}return t}function pe(e){const t={};for(const n in e){const i=e[n];i&&i.effect&&(t[n]=i.effect)}return Object.keys(t).length?t:null}function ge(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=K,window.lnCore.attrSpec=P,window.lnCore.attrStr=v,window.lnCore.attrInt=M,window.lnCore.attrBool=B,window.lnCore.attrList=U,window.lnCore.attrEnum=j,window.lnCore.attrFloat=W,window.lnCore.attrJson=H);function g(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 Q(e,t,n,i){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",l={selector:t,attribute:n,ComponentFn:i};if(e.matches&&e.matches(s)&&g(e,l),e.querySelectorAll){const c=e.querySelectorAll(s);for(let r=0;r<c.length;r++)g(c[r],l)}}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 ye(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 Ae(e){const t=J(),n=e.observed||[];for(let i=0;i<n.length;i++){const o=n[i];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 i in e.attributes){t.byDeclaredAttr.has(i)||t.byDeclaredAttr.set(i,[]);const o=t.byDeclaredAttr.get(i);o.some(s=>s.componentTag===e.componentTag)||o.push({spec:e.attributes[i],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const i=ge(e);if(i===null)t.reactiveWildcard.push(e);else for(const o of i)t.byReactive.has(o)||t.byReactive.set(o,[]),t.byReactive.get(o).push(e)}e.persist&&t.persist.push(e)}function G(e,t,n,i){for(let o=0;o<e.length;o++){const s=e[o];if(!t[s.attribute])continue;const l=s.effects&&s.effects[n];l?l(t,n,i):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,i)}}function ve(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,i=J(),o=i.byAttr.get(t),s=q()&&i.byDeclaredAttr&&i.byDeclaredAttr.has(t);if(!n&&!o&&!s)return;const l=e.target;if(e.oldValue!==l.getAttribute(t)){if(s&&y(l)){const c=i.byDeclaredAttr.get(t),r=l.getAttribute(t);for(let a=0;a<c.length;a++)V(c[a].spec,r,t,c[a].componentTag,l)}if(window.lnCore._debugSink&&(n||o)&&window.lnCore._debugSink("attr",t,l,{oldValue:e.oldValue,newValue:l.getAttribute(t)}),n){const c=i.byReactive.get(t);c&&G(c,l,t,e.oldValue),i.reactiveWildcard.length&&G(i.reactiveWildcard,l,t,e.oldValue)}if(o)for(let c=0;c<o.length;c++){const r=o[c];if(r.handler){r.handler(l,t,e.oldValue);continue}r.onAttributeChange&&l[r.attribute]?r.onAttributeChange(l,t):(Q(l,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(l))}}}function _e(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,p(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{ve(t[n])}catch(i){console.error("[ln-core] mutation handler failed",t[n].target,i)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function x(){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 z(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(i){console.error("["+t.attribute+"] destroy failed",e,i)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function X(e){const t=x();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 i=S();if(e.target&&i.length)for(let o=0;o<i.length;o++){const s=i[o],l=s.query,c=e.target.nodeType===1?e.target.matches&&e.target.matches(l)?e.target:e.target.closest?e.target.closest(l):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(l):null;c&&s.onSubtreeChange(c,e)}for(let o=0;o<e.addedNodes.length;o++){const s=e.addedNodes[o];if(s.nodeType!==1)continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],a=r.query;if(a&&(s.matches&&s.matches(a)&&(r.ComponentFn&&g(s,r),r.onInit&&r.onInit(s)),l&&s.querySelectorAll)){const f=s.querySelectorAll(a);for(let u=0;u<f.length;u++)r.ComponentFn&&g(f[u],r),r.onInit&&r.onInit(f[u])}}}for(let o=0;o<e.removedNodes.length;o++){const s=e.removedNodes[o];if(s.nodeType!==1||document.contains(s))continue;const l=!!(s.firstElementChild||s.children&&s.children.length);for(let c=0;c<t.length;c++){const r=t[c],a=r.query;if(a&&(s.matches&&s.matches(a)&&z(s,r),l&&s.querySelectorAll)){const f=s.querySelectorAll(a);for(let u=0;u<f.length;u++)z(f[u],r)}}}}function Y(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,p(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const i=t[n];if(i.type==="childList")try{X(i)}catch(o){console.error("[ln-core] lifecycle handler failed",i.target,o)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function xe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let i=0;i<n.length;i++){const o=n[i];if(o.type==="childList")try{X(o)}catch(s){console.error("[ln-core] lifecycle handler failed",o.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Se(e){x().push(e),e.onSubtreeChange&&e.query&&S().push(e),Y()}function Z(e,t,n,i,o={}){const s=o.extraAttributes||[],l=o.onAttributeChange||null,c=o.onSubtreeChange||null,r=o.onInit||null,a=o.onAttrChange||null,f=o.effects||null,u=o.attributes||null,d=u?pe(u):f,w=u?new Set(Object.keys(u)):null,b=o.persist||null;function C(T){const h=T||document.body;if(Q(h,e,t,n),u&&q())for(const m in u){const Ke=u[m],L=Array.from(h.querySelectorAll("["+m+"]"));h.matches&&h.matches("["+m+"]")&&L.push(h);for(let O=0;O<L.length;O++){const I=L[O];y(I)&&V(Ke,I.getAttribute(m),m,i,I)}}r&&r(h)}const k=[];if(e.indexOf("[")!==-1){const T=/\[([\w-]+)/g;let h;for(;(h=T.exec(e))!==null;)k.push(h[1])}else k.push(e);Ae({selector:e,attribute:t,componentTag:i,attributes:u,ComponentFn:n,onInit:r,observed:k.concat(s),onAttributeChange:l,onAttrChange:a,effects:d,declared:w,persist:b}),_e();const Ve=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,te=o.subtreeQuery||(Ve?e:"["+e+"]"),ne={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:c,query:te};x().push(ne),c&&te&&S().push(ne),Y(),window[t]=C,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=Z,window.lnCore.observeLifecycle=Se,window.lnCore.withoutLifecycle=xe);function re(){Ce()>0?ye(function(){C(document.body)}):C(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",re):re(),C}function ee(e){return(e||"").replace(/^#/,"")}function E(e){const t=e===void 0?location.hash:e,n={},i=ee(t);if(!i)return n;const o=i.split("&");for(let s=0;s<o.length;s++){const l=o[s];if(!l)continue;const c=l.indexOf(":"),r=c>-1?l.slice(0,c):l,a=c>-1?l.slice(c+1):"";if(r)try{n[r]=decodeURIComponent(a)}catch{n[r]=a}}return n}function Ee(e){if(!e)return null;const t=E();return e in t?t[e]:null}function ke(e,t){if(!e)return;const n=E();t==null?delete n[e]:n[e]=String(t);const o=Object.keys(n).map(function(s){const l=n[s];return l===""?s:s+":"+encodeURIComponent(l)}).join("&");ee(location.hash)!==o&&(location.hash=o)}function Te(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function Le(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const i=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return i?t?i+"-"+t:i:t||null}function Oe(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 qe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function De(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),i=e.slice(t+1),o=i?i.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=E,window.lnCore.hashGet=Ee,window.lnCore.hashSet=ke,window.lnCore.hashLinkClick=Te,window.lnCore.resolveHashNamespace=Le,window.lnCore.hashSortEncode=Oe,window.lnCore.hashSortDecode=Ie,window.lnCore.hashFilterEncode=qe,window.lnCore.hashFilterDecode=De);function Fe(e){return(e||"").replace(/^\?/,"")}function Re(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},i=Fe(t);if(!i)return n;const o=new URLSearchParams(i);for(const[s,l]of o.entries())n[s]=l;return n}function Ne(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function $e(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const i=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",i)}function Me(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const 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 Be(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Ue(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const i=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:i}}}return null}function je(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function We(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Re,window.lnCore.queryGet=Ne,window.lnCore.querySet=$e,window.lnCore.resolveQueryParam=Me,window.lnCore.querySortEncode=Be,window.lnCore.querySortDecode=Ue,window.lnCore.queryFilterEncode=je,window.lnCore.queryFilterDecode=We);function He(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.uuid=He),(function(){const e="data-ln-confirm",t="lnConfirm",n="data-ln-confirm-state",i="data-ln-confirm-announcer";if(window[t]!==void 0)return;function s(u,d,w){return u.getAttribute(d)||w}function l(u,d,w){const b=parseFloat(u.getAttribute(d));return isNaN(b)||b<=0?w:b}function c(u){const d=document.createElement("span");return d.setAttribute(i,""),d.setAttribute("role","alert"),d.textContent=u,d}const r={"data-ln-confirm":{prop:"confirmText",type:"string",read:s,fallback:"Confirm?",description:"Prompt text or confirmation action trigger"},"data-ln-confirm-timeout":{prop:"timeout",type:"float",read:l,fallback:3,min:.1,description:"Confirmation timeout in seconds before reverting"},"data-ln-confirm-state":{prop:"confirming",type:"enum",values:["confirming"],read:(u,d)=>u.getAttribute(d)==="confirming",description:'Active confirmation state marker on button ("confirming")'}},a=P(r);function f(u){this.dom=u,K(this,u,a),this.revertTimer=null,this._submitted=!1,this.idleEl=u.querySelector("[data-ln-confirm-idle]"),this.activeEl=u.querySelector("[data-ln-confirm-active]"),this.isTwoElementMode=!!(this.idleEl||this.activeEl),this.originalText=this.isTwoElementMode?"":u.textContent.trim();const d=this;return this._onClick=function(w){if(!ie(w))if(!d.confirming)w.preventDefault(),w.stopImmediatePropagation(),d._enterConfirm();else{if(d._submitted)return;d._submitted=!0,d._reset()}},u.addEventListener("click",this._onClick),this}f.prototype._enterConfirm=function(){if(this.dom.setAttribute(n,"confirming"),this.originalAriaLabel=this.dom.getAttribute("aria-label"),this.originalAriaLive=this.dom.getAttribute("aria-live"),this.isTwoElementMode){this.idleEl&&this.idleEl.setAttribute("hidden","true"),this.activeEl&&this.activeEl.removeAttribute("hidden");const u=this.activeEl?this.activeEl.textContent.trim():"";u&&(this.dom.setAttribute("aria-label",u),this.dom.setAttribute("aria-live","polite"))}else{const u=this.dom.querySelector("svg.ln-icon use");u&&this.originalText===""?(this.isIconButton=!0,this.originalIconHref=u.getAttribute("href"),u.setAttribute("href","#ln-icon-check"),this.dom.setAttribute("aria-label",this.confirmText),this.dom.appendChild(c(this.confirmText))):this.dom.textContent=this.confirmText}this._startTimer(),D(this.dom,"ln-confirm:waiting",{target:this.dom})},f.prototype._startTimer=function(){this.revertTimer&&clearTimeout(this.revertTimer);const u=this,d=this.timeout*1e3;this.revertTimer=setTimeout(function(){u._reset()},d)},f.prototype._reset=function(){if(this._submitted=!1,this.dom.removeAttribute(n),this.isTwoElementMode)this.idleEl&&this.idleEl.removeAttribute("hidden"),this.activeEl&&this.activeEl.setAttribute("hidden","true");else if(this.isIconButton){const u=this.dom.querySelector("svg.ln-icon use");u&&this.originalIconHref&&u.setAttribute("href",this.originalIconHref);const d=this.dom.querySelector("["+i+"]");d&&d.remove(),this.isIconButton=!1,this.originalIconHref=null}else this.dom.textContent=this.originalText;this.originalAriaLabel!==null&&this.originalAriaLabel!==void 0?this.dom.setAttribute("aria-label",this.originalAriaLabel):this.dom.removeAttribute("aria-label"),this.originalAriaLabel=null,this.originalAriaLive!==null&&this.originalAriaLive!==void 0?this.dom.setAttribute("aria-live",this.originalAriaLive):this.dom.removeAttribute("aria-live"),this.originalAriaLive=null,this.revertTimer&&(clearTimeout(this.revertTimer),this.revertTimer=null)},f.prototype.destroy=function(){this.dom[t]&&(this.confirming&&this._reset(),this.dom.removeEventListener("click",this._onClick),delete this.dom[t])},Z(e,t,f,"ln-confirm",{attributes:r})})()})();
|
|
@@ -4,8 +4,11 @@ export function hasActiveDebug() {
|
|
|
4
4
|
if (typeof window === 'undefined') return false;
|
|
5
5
|
if (window.lnDebug === true) return true;
|
|
6
6
|
if (window.lnCore && window.lnCore._debugSink) return true;
|
|
7
|
-
if (typeof document !== 'undefined'
|
|
8
|
-
|
|
7
|
+
if (typeof document !== 'undefined') {
|
|
8
|
+
if (document.documentElement && document.documentElement.hasAttribute('data-ln-debug')) return true;
|
|
9
|
+
if (document.body) {
|
|
10
|
+
return document.body.hasAttribute('data-ln-debug') || document.body.querySelector('[data-ln-debug]') !== null;
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
return false;
|
|
11
14
|
}
|
|
@@ -280,57 +280,38 @@ function _handleChildListMutation(mutation) {
|
|
|
280
280
|
|
|
281
281
|
for (let j = 0; j < mutation.addedNodes.length; j++) {
|
|
282
282
|
const node = mutation.addedNodes[j];
|
|
283
|
-
if (node.nodeType
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
} else {
|
|
293
|
-
if (node.matches && node.matches(entry.query)) {
|
|
294
|
-
_initElement(node, entry);
|
|
295
|
-
}
|
|
296
|
-
if (node.querySelectorAll) {
|
|
297
|
-
const matchedList = node.querySelectorAll(entry.query);
|
|
298
|
-
for (let m = 0; m < matchedList.length; m++) {
|
|
299
|
-
_initElement(matchedList[m], entry);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
283
|
+
if (node.nodeType !== 1) continue;
|
|
284
|
+
const hasDesc = !!(node.firstElementChild || (node.children && node.children.length));
|
|
285
|
+
for (let r = 0; r < registry.length; r++) {
|
|
286
|
+
const entry = registry[r];
|
|
287
|
+
const q = entry.query;
|
|
288
|
+
if (!q) continue;
|
|
289
|
+
if (node.matches && node.matches(q)) {
|
|
290
|
+
if (entry.ComponentFn) _initElement(node, entry);
|
|
304
291
|
if (entry.onInit) entry.onInit(node);
|
|
305
292
|
}
|
|
293
|
+
if (hasDesc && node.querySelectorAll) {
|
|
294
|
+
const items = node.querySelectorAll(q);
|
|
295
|
+
for (let m = 0; m < items.length; m++) {
|
|
296
|
+
if (entry.ComponentFn) _initElement(items[m], entry);
|
|
297
|
+
if (entry.onInit) entry.onInit(items[m]);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
306
300
|
}
|
|
307
301
|
}
|
|
308
302
|
|
|
309
303
|
for (let j = 0; j < mutation.removedNodes.length; j++) {
|
|
310
304
|
const node = mutation.removedNodes[j];
|
|
311
|
-
if (node.nodeType
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
_destroyItem(node, entry);
|
|
322
|
-
}
|
|
323
|
-
} else {
|
|
324
|
-
if (node.matches && node.matches(query)) {
|
|
325
|
-
_destroyItem(node, entry);
|
|
326
|
-
}
|
|
327
|
-
if (node.querySelectorAll) {
|
|
328
|
-
const items = node.querySelectorAll(query);
|
|
329
|
-
for (let k = 0; k < items.length; k++) {
|
|
330
|
-
_destroyItem(items[k], entry);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
305
|
+
if (node.nodeType !== 1 || document.contains(node)) continue;
|
|
306
|
+
const hasDesc = !!(node.firstElementChild || (node.children && node.children.length));
|
|
307
|
+
for (let r = 0; r < registry.length; r++) {
|
|
308
|
+
const entry = registry[r];
|
|
309
|
+
const q = entry.query;
|
|
310
|
+
if (!q) continue;
|
|
311
|
+
if (node.matches && node.matches(q)) _destroyItem(node, entry);
|
|
312
|
+
if (hasDesc && node.querySelectorAll) {
|
|
313
|
+
const items = node.querySelectorAll(q);
|
|
314
|
+
for (let k = 0; k < items.length; k++) _destroyItem(items[k], entry);
|
|
334
315
|
}
|
|
335
316
|
}
|
|
336
317
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";function M(){return typeof window>"u"?!1:window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink?!0:typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null:!1}function j(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!j(o))return}e.apply(console,t)}}function v(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function L(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){L(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function le(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ae(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},l=e.elements,c={};if(n)for(let a=0;a<l.length;a++){const r=l[a];r.name&&r.type==="checkbox"&&!r.disabled&&(c[r.name]=(c[r.name]||0)+1)}for(let a=0;a<l.length;a++){const r=l[a];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&c[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let f=0;f<r.options.length;f++)r.options[f].selected&&i[r.name].push(r.options[f].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const f=Number(r.value);i[r.name]=r.value===""||isNaN(f)?null:f}else i[r.name]=r.value}return i}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 ue(e,t){const n=e.elements,o=[],i={};for(let l=0;l<n.length;l++){const c=n[l];c.name&&c.type==="checkbox"&&(i[c.name]=(i[c.name]||0)+1)}for(let l=0;l<n.length;l++){const c=n[l];if(c.type==="file"||c.type==="submit"||c.type==="button")continue;const a=c.getAttribute("data-ln-fill-as")||c.name;if(!a||!(a in t))continue;const r=t[a];if(c.type==="checkbox"){if(Array.isArray(r))c.checked=r.indexOf(c.value)!==-1;else if(i[c.name]>1){const f=String(r).split(",").map(function(b){return b.trim()});c.checked=f.indexOf(c.value)!==-1}else c.checked=de(r);o.push(c)}else if(c.type==="radio")c.checked=c.value===String(r),o.push(c);else if(c.type==="select-multiple"){if(Array.isArray(r))for(let f=0;f<c.options.length;f++)c.options[f].selected=r.indexOf(c.options[f].value)!==-1;o.push(c)}else c.value=r,c.tagName==="SELECT"&&r!=null&&c.setAttribute("data-ln-value",r),o.push(c)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ue,window.lnCore.serializeForm=ae,window.lnCore.resolveFormMethod=le);function k(...e){return e.filter(t=>t!=null&&t!=="").map((t,n)=>n===0?t.replace(/\/+$/,""):t.replace(/^\/+/,"").replace(/\/+$/,"")).filter(Boolean).join("/")}function T(e,t){return Object.assign({"Content-Type":"application/json",Accept:"application/json"},e,t?{Authorization:t}:null)}function fe(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(n){return console.error(`[${t}] Invalid headers JSON:`,n),{}}}const U={};function he(e,t){U[e]=t}function we(e){return U[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=he,window.lnCore.getDataMapper=we);function be(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,L(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const H={};function pe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];H[n]=t}function me(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return H[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=pe,window.lnCore.getLocaleFallback=me,window.lnCore.ensureLocaleObserver=be);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 W(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let c=0;c<n.length;c++){const a=n[c],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let c=0;c<o.length;c++){const a=o[c],r=a.getAttribute("data-ln-attr").split(",");for(let f=0;f<r.length;f++){const b=r[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),_=b[1].trim();t[_]!=null&&a.setAttribute(m,t[_])}}const i=e.querySelectorAll("[data-ln-show]");for(let c=0;c<i.length;c++){const a=i[c],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const l=e.querySelectorAll("[data-ln-class]");for(let c=0;c<l.length;c++){const a=l[c],r=a.getAttribute("data-ln-class").split(",");for(let f=0;f<r.length;f++){const b=r[f].trim().split(":");if(b.length!==2)continue;const m=b[0].trim(),_=b[1].trim();_ in t&&a.classList.toggle(m,!!t[_])}}return e}function 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 o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)W(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 l=n.currentNode;l.textContent.indexOf("{{")!==-1&&(l.textContent=l.textContent.replace(/\{\{\s*(\w+)\s*\}\}/g,function(c,a){return t[a]!==void 0?t[a]:""}))}const o=function(l,c){return t[c]!==void 0?t[c]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let l=0;l<i.length;l++){const c=i[l],a=c.attributes;for(let r=0;r<a.length;r++){const f=a[r];f.value.indexOf("{{")!==-1&&c.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Ce(e,t,n,o,i,l){const c={};for(let r=0;r<e.children.length;r++){const f=e.children[r],b=f.getAttribute("data-ln-render-key");b&&(c[b]=f)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const f=t[r],b=String(o(f));let m=c[b];if(m)i(m,f,r);else{const _=ge(n,l);if(!_||(J(_,f),m=_.firstElementChild,!m))continue;m.setAttribute("data-ln-render-key",b),i(m,f,r)}a.appendChild(m)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=J,window.lnCore.fill=W,window.lnCore.lnFill=ye,window.lnCore.renderList=Ce);function O(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function V(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function G(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function K(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const R=new Map;function Q(e,t){const n=(e?e.join("|"):"")+"::"+t;if(R.has(n))return R.get(n);const o=new Set(e||[]),i=function(l,c){const a=l.getAttribute(c);return a!==null&&o.has(a)?a:t};return R.set(n,i),i}function z(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function X(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function Y(e,t,n,o,i){if(!e||t===null)return!0;const l=o||"ln-component",c=e.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||t===""&&e.fallback!==void 0)return!0;const a=r=>{i?console.warn(r,i):console.warn(r)};if(c==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(a(`[${l}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const r=e.values||[];return r.includes(t)?!0:(a(`[${l}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(t))return a(`[${l}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(a(`[${l}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(a(`[${l}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(c==="float")return isNaN(Number(t))?(a(`[${l}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(t),!0}catch(r){return a(`[${l}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function Z(e,t,n){for(const o in n){const[i,l,c]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,l,c)},enumerable:!0,configurable:!0})}return e}function ee(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=Q(o.values,o.fallback);break;case"integer":i=V;break;case"float":i=z;break;case"boolean":i=G;break;case"list":i=K;break;case"json":i=X;break;case"string":default:i=O;break}i||(i=O),t[o.prop]=[i,n,o.fallback]}return t}function _e(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function ve(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=Z,window.lnCore.attrSpec=ee,window.lnCore.attrStr=O,window.lnCore.attrInt=V,window.lnCore.attrBool=G,window.lnCore.attrList=K,window.lnCore.attrEnum=Q,window.lnCore.attrFloat=z,window.lnCore.attrJson=X);function D(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function te(e,t,n,o){if(e.nodeType!==1)return;const l=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",c={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(l)&&D(e,c),e.querySelectorAll){const a=e.querySelectorAll(l);for(let r=0;r<a.length;r++)D(a[r],c)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ke(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function ne(){window.lnCore=window.lnCore||{};const e=window.lnCore._attrRegistry=window.lnCore._attrRegistry||{byAttr:new Map,reactive:[],persist:[]};return e.byReactive=e.byReactive||new Map,e.reactiveWildcard=e.reactiveWildcard||[],e}function Se(e){const t=ne(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(l=>l.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ve(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function re(e,t,n,o){for(let i=0;i<e.length;i++){const l=e[i];if(!t[l.attribute])continue;const c=l.effects&&l.effects[n];c?c(t,n,o):l.onAttrChange&&(!l.declared||l.declared.has(n))&&l.onAttrChange(t,n,o)}}function xe(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=ne(),i=o.byAttr.get(t),l=M()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!l)return;const c=e.target;if(e.oldValue!==c.getAttribute(t)){if(l&&j(c)){const a=o.byDeclaredAttr.get(t),r=c.getAttribute(t);for(let f=0;f<a.length;f++)Y(a[f].spec,r,t,a[f].componentTag,c)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,c,{oldValue:e.oldValue,newValue:c.getAttribute(t)}),n){const a=o.byReactive.get(t);a&&re(a,c,t,e.oldValue),o.reactiveWildcard.length&&re(o.reactiveWildcard,c,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const r=i[a];if(r.handler){r.handler(c,t,e.oldValue);continue}r.onAttributeChange&&c[r.attribute]?r.onAttributeChange(c,t):(te(c,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(c))}}}function Ee(){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{xe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function F(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function $(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function N(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=F();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=$();if(e.target&&o.length)for(let i=0;i<o.length;i++){const l=o[i],c=l.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;a&&l.onSubtreeChange(a,e)}for(let i=0;i<e.addedNodes.length;i++){const l=e.addedNodes[i];if(l.nodeType===1){const c=!!(l.firstElementChild||l.children&&l.children.length);for(let a=0;a<t.length;a++){const r=t[a];if(r.selector&&r.attribute&&r.ComponentFn){if(!c)l.matches&&l.matches(r.query)&&D(l,r);else if(l.matches&&l.matches(r.query)&&D(l,r),l.querySelectorAll){const f=l.querySelectorAll(r.query);for(let b=0;b<f.length;b++)D(f[b],r)}}r.onInit&&r.onInit(l)}}}for(let i=0;i<e.removedNodes.length;i++){const l=e.removedNodes[i];if(l.nodeType===1){if(document.contains(l))continue;const c=!!(l.firstElementChild||l.children&&l.children.length);for(let a=0;a<t.length;a++){const r=t[a],f=r.query;if(f){if(!c)l.matches&&l.matches(f)&&N(l,r);else if(l.matches&&l.matches(f)&&N(l,r),l.querySelectorAll){const b=l.querySelectorAll(f);for(let m=0;m<b.length;m++)N(b[m],r)}}}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,L(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{oe(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{oe(i)}catch(l){console.error("[ln-core] lifecycle handler failed",i.target,l)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Te(e){F().push(e),e.onSubtreeChange&&e.query&&$().push(e),ie()}function ce(e,t,n,o,i={}){const l=i.extraAttributes||[],c=i.onAttributeChange||null,a=i.onSubtreeChange||null,r=i.onInit||null,f=i.onAttrChange||null,b=i.effects||null,m=i.attributes||null,_=m?_e(m):b,P=m?new Set(Object.keys(m)):null,s=i.persist||null;function u(w){const C=w||document.body;if(te(C,e,t,n),m&&M())for(const x in m){const S=m[x],E=Array.from(C.querySelectorAll("["+x+"]"));C.matches&&C.matches("["+x+"]")&&E.push(C);for(let A=0;A<E.length;A++){const q=E[A];j(q)&&Y(S,q.getAttribute(x),x,o,q)}}r&&r(C)}const d=[];if(e.indexOf("[")!==-1){const w=/\[([\w-]+)/g;let C;for(;(C=w.exec(e))!==null;)d.push(C[1])}else d.push(e);Se({selector:e,attribute:t,componentTag:o,attributes:m,ComponentFn:n,onInit:r,observed:d.concat(l),onAttributeChange:c,onAttrChange:f,effects:_,declared:P,persist:s}),Ee();const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,g=i.subtreeQuery||(h?e:"["+e+"]"),y={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:a,query:g};F().push(y),a&&g&&$().push(y),ie(),window[t]=u,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ce,window.lnCore.observeLifecycle=Te,window.lnCore.withoutLifecycle=Oe);function p(){Ae()>0?ke(function(){u(document.body)}):u(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p):p(),u}function se(e){return(e||"").replace(/^#/,"")}function B(e){const t=e===void 0?location.hash:e,n={},o=se(t);if(!o)return n;const i=o.split("&");for(let l=0;l<i.length;l++){const c=i[l];if(!c)continue;const a=c.indexOf(":"),r=a>-1?c.slice(0,a):c,f=a>-1?c.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(f)}catch{n[r]=f}}return n}function De(e){if(!e)return null;const t=B();return e in t?t[e]:null}function Le(e,t){if(!e)return;const n=B();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(l){const c=n[l];return c===""?l:l+":"+encodeURIComponent(c)}).join("&");se(location.hash)!==i&&(location.hash=i)}function qe(e){return e.button===1||e.ctrlKey||e.metaKey||e.shiftKey?!1:(e.preventDefault(),!0)}function je(e,t){if(!e||!e.hasAttribute("data-ln-hash"))return null;const n=e.getAttribute("data-ln-hash");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function Ie(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Re(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function $e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(l){try{return decodeURIComponent(l)}catch{return l}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=B,window.lnCore.hashGet=De,window.lnCore.hashSet=Le,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=je,window.lnCore.hashSortEncode=Ie,window.lnCore.hashSortDecode=Re,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=$e);function Ne(e){return(e||"").replace(/^\?/,"")}function Be(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=Ne(t);if(!o)return n;const i=new URLSearchParams(o);for(const[l,c]of i.entries())n[l]=c;return n}function Pe(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Me(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function Ue(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function He(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function We(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Je(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ve(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Be,window.lnCore.queryGet=Pe,window.lnCore.querySet=Me,window.lnCore.resolveQueryParam=Ue,window.lnCore.querySortEncode=He,window.lnCore.querySortDecode=We,window.lnCore.queryFilterEncode=Je,window.lnCore.queryFilterDecode=Ve);function Ge(){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=Ge),(function(){const e="data-ln-couchdb-connector",t="lnCouchDbConnector",n="lnConnector";if(window[t]!==void 0)return;function o(s){const u=s[t];u&&u.refreshConfig()}const i={"data-ln-couchdb-connector":{type:"marker",description:"Mounts CouchDB/PouchDB connector bridging database and ln-ashlar data coordinators"},"data-ln-couchdb-url":{prop:"url",read:O,type:"string",fallback:"",effect:o,description:"CouchDB server base endpoint URL"},"data-ln-couchdb-db":{prop:"db",read:O,type:"string",fallback:"",effect:o,description:"Target CouchDB database name"},"data-ln-couchdb-auth":{prop:"auth",read:O,type:"string",fallback:"",effect:o,description:"Authentication credentials for CouchDB requests"},"data-ln-couchdb-headers":{effect:o,type:"json",fallback:null,description:"Custom HTTP headers in JSON or semicolon-separated format"}},l=ee(i);function c(s){const u=s&&s.content!==void 0?s.content:s,d=s&&s.message?s.message:null;return{content:u,message:d}}function a(s){return this.dom=s,Z(this,s,l),s[t]=this,s[n]=this,this.namespace="ln-couchdb-connector",this.refreshConfig(),this._deltaController=null,this._handlers=null,P(this),this}a.prototype.refreshConfig=function(){const s=this.dom;this.credentials="same-origin";const u=s.getAttribute("data-ln-couchdb-headers")||"";this.headers=fe(u,"ln-couchdb-connector"),this.auth&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-auth attribute. Storing basic authentication credentials in HTML DOM attributes is highly discouraged and vulnerable to XSS credential extraction. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),u.toLowerCase().includes("authorization")&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-headers attribute. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),v(s,"ln-couchdb-connector:config-changed",{url:this.url,db:this.db,auth:this.auth?"[REDACTED]":"",headers:this.headers})};function r(s,u,d){const h=Object.assign({},T(s.headers,s.auth),d||{});return u&&(h["Idempotency-Key"]=u),h}a.prototype.fetchDelta=function(s){const u=this;this._deltaController&&this._deltaController.abort(),this._deltaController=new AbortController;const d=this._deltaController.signal,h=["include_docs=true","feed=normal"];s&&h.push("since="+encodeURIComponent(s));const g=k(u.url,u.db,"_changes")+"?"+h.join("&");return window.fetch(g,{method:"GET",headers:T(u.headers,u.auth),credentials:u.credentials,signal:d}).then(y=>{if(!y.ok)throw new Error("HTTP "+y.status+": "+y.statusText);return y.json()}).then(y=>{const p=y.results||[];return{data:p.filter(w=>!w.deleted&&w.doc).map(w=>Object.assign({},w.doc,{id:w.doc._id})),deleted:p.filter(w=>w.deleted).map(w=>w.id),synced_at:y.last_seq||s||""}}).finally(()=>{u._deltaController&&u._deltaController.signal===d&&(u._deltaController=null)})};function f(s,u,d){const h=Object.assign({_id:u.id},u);return h._id||delete h._id,window.fetch(k(s.url,s.db),{method:"POST",headers:r(s,d),credentials:s.credentials,body:JSON.stringify(h)}).then(g=>{if(!g.ok)throw new Error("HTTP "+g.status+": "+g.statusText);return g.json()}).then(g=>{const y=c(g),p=y.content;return{record:Object.assign({},h,{id:p.id,_id:p.id,_rev:p.rev}),message:y.message}})}a.prototype.create=function(s,u){return f(this,s,u).then(d=>d.record)};function b(s,u,d,h){const g=Object.assign({id:String(u),_id:String(u)},d),y=g._rev||g.rev;return(y?Promise.resolve(y):window.fetch(k(s.url,s.db,null,u),{method:"GET",headers:T(s.headers,s.auth),credentials:s.credentials}).then(w=>{if(!w.ok)throw new Error("Could not retrieve document for revision mapping");return w.json().then(C=>C._rev)})).then(w=>{const C=Object.assign({},g,{_rev:w});delete C.rev;const x=r(s,h,{"If-Match":w});return window.fetch(k(s.url,s.db,null,u),{method:"PUT",headers:x,credentials:s.credentials,body:JSON.stringify(C)}).then(S=>{if(S.ok)return S.json().then(E=>{const A=c(E);return{record:Object.assign({},C,{_rev:A.content.rev}),message:A.message}});if(S.status===409)return S.json().then(E=>{const A=new Error("Conflict");throw A.status=409,A.data=E,A});throw new Error("HTTP "+S.status+": "+S.statusText)})})}a.prototype.update=function(s,u,d){return b(this,s,u,d).then(h=>h.record)};function m(s,u,d,h){return(d?Promise.resolve(d):window.fetch(k(s.url,s.db,null,u),{method:"GET",headers:T(s.headers,s.auth),credentials:s.credentials}).then(y=>{if(!y.ok)throw new Error("Could not retrieve document for revision delete");return y.json().then(p=>p._rev)})).then(y=>{const p=k(s.url,s.db,null,u)+"?rev="+encodeURIComponent(y);return window.fetch(p,{method:"DELETE",headers:r(s,h),credentials:s.credentials}).then(w=>{if(!w.ok)throw new Error("HTTP "+w.status+": "+w.statusText);return w.json()}).then(w=>{const C=c(w);return{response:C.content,message:C.message}})})}a.prototype.delete=function(s,u,d){return m(this,s,u,d).then(h=>h.response)};function _(s,u,d){return!u||u.length===0?Promise.resolve({response:{ok:!0,deletedCount:0},message:null}):window.fetch(k(s.url,s.db,"_all_docs"),{method:"POST",headers:T(s.headers,s.auth),credentials:s.credentials,body:JSON.stringify({keys:u})}).then(h=>{if(!h.ok)throw new Error("HTTP "+h.status+": "+h.statusText);return h.json()}).then(h=>{const y=(h.rows||[]).filter(p=>!p.error&&p.value&&p.value.rev).map(p=>({_id:p.id,_rev:p.value.rev,_deleted:!0}));return y.length===0?{response:{ok:!0,deletedCount:0},message:null}:window.fetch(k(s.url,s.db,"_bulk_docs"),{method:"POST",headers:r(s,d),credentials:s.credentials,body:JSON.stringify({docs:y})}).then(p=>{if(!p.ok)throw new Error("HTTP "+p.status+": "+p.statusText);return p.json()}).then(p=>{const w=c(p);return{response:{ok:!0,results:w.content,deletedCount:y.length},message:w.message}})})}a.prototype.bulkDelete=function(s,u){return _(this,s,u).then(d=>d.response)};function P(s){s._handlers={sync:function(u){const d=u.detail||{};s.fetchDelta(d.since).then(function(h){v(s.dom,"ln-couchdb-connector:fetched",{data:h,since:d.since,meta:d.meta||null})}).catch(function(h){h&&h.name==="AbortError"||v(s.dom,"ln-couchdb-connector:error",{action:"sync",error:h.message,status:h.status||0,since:d.since,meta:d.meta||null})})},create:function(u){const d=u.detail||{};f(s,d.data,d.idempotencyKey).then(function(h){v(s.dom,"ln-couchdb-connector:created",{record:h.record,tempId:d.tempId,message:h.message,meta:d.meta||null})}).catch(function(h){v(s.dom,"ln-couchdb-connector:error",{action:"create",error:h.message,status:h.status||0,tempId:d.tempId,meta:d.meta||null})})},update:function(u){const d=u.detail||{},h=Object.assign({},d.data);d.expected_version!==void 0&&(h._rev=d.expected_version),b(s,d.id,h,d.idempotencyKey).then(function(g){v(s.dom,"ln-couchdb-connector:updated",{record:g.record,id:d.id,message:g.message,meta:d.meta||null})}).catch(function(g){v(s.dom,"ln-couchdb-connector:error",{action:"update",error:g.message,status:g.status||0,id:d.id,data:g.status===409?g.data:null,conflictData:g.status===409?g.data:null,meta:d.meta||null})})},delete:function(u){const d=u.detail||{};m(s,d.id,d.rev,d.idempotencyKey).then(function(h){v(s.dom,"ln-couchdb-connector:deleted",{response:h.response,id:d.id,message:h.message,meta:d.meta||null})}).catch(function(h){v(s.dom,"ln-couchdb-connector:error",{action:"delete",error:h.message,status:h.status||0,id:d.id,meta:d.meta||null})})},bulkDelete:function(u){const d=u.detail||{};_(s,d.ids,d.idempotencyKey).then(function(h){v(s.dom,"ln-couchdb-connector:bulk-deleted",{response:h.response,ids:d.ids,message:h.message,meta:d.meta||null})}).catch(function(h){v(s.dom,"ln-couchdb-connector:error",{action:"bulk-delete",error:h.message,status:h.status||0,ids:d.ids,meta:d.meta||null})})}},s.dom.addEventListener("ln-couchdb-connector:request-sync",s._handlers.sync),s.dom.addEventListener("ln-couchdb-connector:request-create",s._handlers.create),s.dom.addEventListener("ln-couchdb-connector:request-update",s._handlers.update),s.dom.addEventListener("ln-couchdb-connector:request-delete",s._handlers.delete),s.dom.addEventListener("ln-couchdb-connector:request-bulk-delete",s._handlers.bulkDelete)}a.prototype.destroy=function(){if(!this.dom[t])return;const s=this;s._deltaController&&(s._deltaController.abort(),s._deltaController=null),s._handlers&&(s.dom.removeEventListener("ln-couchdb-connector:request-sync",s._handlers.sync),s.dom.removeEventListener("ln-couchdb-connector:request-create",s._handlers.create),s.dom.removeEventListener("ln-couchdb-connector:request-update",s._handlers.update),s.dom.removeEventListener("ln-couchdb-connector:request-delete",s._handlers.delete),s.dom.removeEventListener("ln-couchdb-connector:request-bulk-delete",s._handlers.bulkDelete),s._handlers=null),delete this.dom[t],delete this.dom[n]},ce(e,t,a,"ln-couchdb-connector",{attributes:i})})()})();
|
|
1
|
+
(function(){"use strict";function P(){if(typeof window>"u")return!1;if(window.lnDebug===!0||window.lnCore&&window.lnCore._debugSink)return!0;if(typeof document<"u"){if(document.documentElement&&document.documentElement.hasAttribute("data-ln-debug"))return!0;if(document.body)return document.body.hasAttribute("data-ln-debug")||document.body.querySelector("[data-ln-debug]")!==null}return!1}function I(e){if(typeof window>"u")return!1;if(window.lnDebug===!0)return!0;if(window.lnCore&&window.lnCore._debugIsContained)return e?window.lnCore._debugIsContained(e):window.lnCore._debugSink!==null;if(e&&e.closest){const t=e.closest("[data-ln-debug]");return!(!t||typeof document<"u"&&t===document.documentElement)}return typeof document<"u"&&document.body?document.body.hasAttribute("data-ln-debug"):!1}if(typeof window<"u"&&(window.lnCore=window.lnCore||{},!window.lnCore._warnBound)){window.lnCore._warnBound=!0;const e=console.warn;console.warn=function(...t){if(typeof t[0]=="string"&&(t[0].startsWith("[ln-")||t[0].startsWith("[lnCore"))){let o=null;for(let i=1;i<t.length;i++)if(t[i]&&t[i].nodeType===1){o=t[i];break}if(!I(o))return}e.apply(console,t)}}function v(e,t,n){const o=n||{};window.lnCore._debugSink&&window.lnCore._debugSink("event",t,e,o),e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:o}))}function D(e,t){if(!document.body){document.addEventListener("DOMContentLoaded",function(){D(e,t)}),console.warn("["+t+'] Script loaded before <body> — add "defer" to your <script> tag');return}e()}function se(e){const t=e.querySelector('input[name="_method"]');return((t&&t.value!==""?t.value:e.method)||"").toUpperCase()}function ae(e,t){const n=!!(t&&t.typed),o=t&&t.exclude,i={},s=e.elements,c={};if(n)for(let a=0;a<s.length;a++){const r=s[a];r.name&&r.type==="checkbox"&&!r.disabled&&(c[r.name]=(c[r.name]||0)+1)}for(let a=0;a<s.length;a++){const r=s[a];if(!(!r.name||r.disabled||r.type==="file"||r.type==="submit"||r.type==="button")&&!(o&&r.matches&&r.matches(o)))if(r.type==="checkbox")n&&c[r.name]===1?i[r.name]=r.checked:(i[r.name]||(i[r.name]=[]),r.checked&&i[r.name].push(r.value));else if(r.type==="radio")r.checked&&(i[r.name]=r.value);else if(r.type==="select-multiple"){i[r.name]=[];for(let f=0;f<r.options.length;f++)r.options[f].selected&&i[r.name].push(r.options[f].value)}else if(n&&r.type==="hidden")i[r.name]=r.value;else if(n&&(r.type==="number"||r.type==="range")){const f=Number(r.value);i[r.name]=r.value===""||isNaN(f)?null:f}else i[r.name]=r.value}return i}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 ue(e,t){const n=e.elements,o=[],i={};for(let s=0;s<n.length;s++){const c=n[s];c.name&&c.type==="checkbox"&&(i[c.name]=(i[c.name]||0)+1)}for(let s=0;s<n.length;s++){const c=n[s];if(c.type==="file"||c.type==="submit"||c.type==="button")continue;const a=c.getAttribute("data-ln-fill-as")||c.name;if(!a||!(a in t))continue;const r=t[a];if(c.type==="checkbox"){if(Array.isArray(r))c.checked=r.indexOf(c.value)!==-1;else if(i[c.name]>1){const f=String(r).split(",").map(function(p){return p.trim()});c.checked=f.indexOf(c.value)!==-1}else c.checked=de(r);o.push(c)}else if(c.type==="radio")c.checked=c.value===String(r),o.push(c);else if(c.type==="select-multiple"){if(Array.isArray(r))for(let f=0;f<c.options.length;f++)c.options[f].selected=r.indexOf(c.options[f].value)!==-1;o.push(c)}else c.value=r,c.tagName==="SELECT"&&r!=null&&c.setAttribute("data-ln-value",r),o.push(c)}return o}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.populateForm=ue,window.lnCore.serializeForm=ae,window.lnCore.resolveFormMethod=se);function k(...e){return e.filter(t=>t!=null&&t!=="").map((t,n)=>n===0?t.replace(/\/+$/,""):t.replace(/^\/+/,"").replace(/\/+$/,"")).filter(Boolean).join("/")}function T(e,t){return Object.assign({"Content-Type":"application/json",Accept:"application/json"},e,t?{Authorization:t}:null)}function fe(e,t="ln-core"){try{return e?JSON.parse(e):{}}catch(n){return console.error(`[${t}] Invalid headers JSON:`,n),{}}}const M={};function he(e,t){M[e]=t}function we(e){return M[e]||{ingress:t=>t,egress:t=>t}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerDataMapper=he,window.lnCore.getDataMapper=we);function be(){typeof window>"u"||(window.lnCore=window.lnCore||{},!window.lnCore._localeObserverBound&&(window.lnCore._localeObserverBound=!0,D(function(){new MutationObserver(function(){v(document,"ln-core:locale-change",{})}).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})},"ln-core")))}const U={};function pe(e,t){if(!e||typeof t!="object")return;const n=e.toLowerCase().split("-")[0];U[n]=t}function me(e){if(!e)return null;const t=e.toLowerCase().split("-")[0];return U[t]||null}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerLocaleFallback=pe,window.lnCore.getLocaleFallback=me,window.lnCore.ensureLocaleObserver=be);const j={};function ge(e,t){j[e]||(j[e]=document.querySelector('[data-ln-template="'+e+'"]'));const n=j[e];return n?n.content.cloneNode(!0):(console.warn("["+(t||"ln-core")+'] Template "'+e+'" not found'),null)}function H(e,t){if(!e||!t)return e;const n=e.querySelectorAll("[data-ln-field]");for(let c=0;c<n.length;c++){const a=n[c],r=a.getAttribute("data-ln-field");t[r]!=null&&(a.textContent=t[r])}const o=e.querySelectorAll("[data-ln-attr]");for(let c=0;c<o.length;c++){const a=o[c],r=a.getAttribute("data-ln-attr").split(",");for(let f=0;f<r.length;f++){const p=r[f].trim().split(":");if(p.length!==2)continue;const w=p[0].trim(),_=p[1].trim();t[_]!=null&&a.setAttribute(w,t[_])}}const i=e.querySelectorAll("[data-ln-show]");for(let c=0;c<i.length;c++){const a=i[c],r=a.getAttribute("data-ln-show");r in t&&a.classList.toggle("hidden",!t[r])}const s=e.querySelectorAll("[data-ln-class]");for(let c=0;c<s.length;c++){const a=s[c],r=a.getAttribute("data-ln-class").split(",");for(let f=0;f<r.length;f++){const p=r[f].trim().split(":");if(p.length!==2)continue;const w=p[0].trim(),_=p[1].trim();_ in t&&a.classList.toggle(w,!!t[_])}}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 o=0;o<n.length;o++)window.lnCore._debugSink&&window.lnCore._debugSink("event","ln-fill",n[o],t??null),n[o].dispatchEvent(new CustomEvent("ln-fill",{detail:t??null,bubbles:!0}));return e}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._fillBound||(window.lnCore._fillBound=!0,document.addEventListener("ln-fill",function(e){if(!(!e.target.matches||!e.target.matches("[data-ln-fillable]")))if(e.detail)H(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 W(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(c,a){return t[a]!==void 0?t[a]:""}))}const o=function(s,c){return t[c]!==void 0?t[c]:""},i=Array.from(e.querySelectorAll("*"));e.nodeType===1&&i.push(e);for(let s=0;s<i.length;s++){const c=i[s],a=c.attributes;for(let r=0;r<a.length;r++){const f=a[r];f.value.indexOf("{{")!==-1&&c.setAttribute(f.name,f.value.replace(/\{\{\s*(\w+)\s*\}\}/g,o))}}return e}function Ce(e,t,n,o,i,s){const c={};for(let r=0;r<e.children.length;r++){const f=e.children[r],p=f.getAttribute("data-ln-render-key");p&&(c[p]=f)}const a=document.createDocumentFragment();for(let r=0;r<t.length;r++){const f=t[r],p=String(o(f));let w=c[p];if(w)i(w,f,r);else{const _=ge(n,s);if(!_||(W(_,f),w=_.firstElementChild,!w))continue;w.setAttribute("data-ln-render-key",p),i(w,f,r)}a.appendChild(w)}e.textContent="",e.appendChild(a)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.fillTemplate=W,window.lnCore.fill=H,window.lnCore.lnFill=ye,window.lnCore.renderList=Ce);function O(e,t,n){const o=e.getAttribute(t);return o===null?n:o}function J(e,t,n){const o=parseInt(e.getAttribute(t),10);return isNaN(o)?n:o}function V(e,t,n=!1){const o=e.getAttribute(t);if(o===null)return!!n;const i=o.trim().toLowerCase();return!(i==="false"||i==="0")}function G(e,t){return(e.getAttribute(t)||"").split(",").map(n=>n.trim()).filter(Boolean)}const R=new Map;function K(e,t){const n=(e?e.join("|"):"")+"::"+t;if(R.has(n))return R.get(n);const o=new Set(e||[]),i=function(s,c){const a=s.getAttribute(c);return a!==null&&o.has(a)?a:t};return R.set(n,i),i}function Q(e,t,n){const o=parseFloat(e.getAttribute(t));return isNaN(o)?n:o}function z(e,t,n){const o=e.getAttribute(t);if(!o)return n;try{return JSON.parse(o)}catch{return n}}function X(e,t,n,o,i){if(!e||t===null)return!0;const s=o||"ln-component",c=e.type;if(c==="trigger"||c==="marker"||c==="string"||c==="list"||!c||t===""&&e.fallback!==void 0)return!0;const a=r=>{i?console.warn(r,i):console.warn(r)};if(c==="boolean"){const r=t.trim().toLowerCase();return r!==""&&r!=="true"&&r!=="false"&&r!=="1"&&r!=="0"?(a(`[${s}] Invalid value "${t}" for boolean attribute "${n}". Allowed: "true", "false", or presence-only.`),!1):!0}if(c==="enum"){const r=e.values||[];return r.includes(t)?!0:(a(`[${s}] Invalid value "${t}" for attribute "${n}". Allowed: ${r.join(", ")}. Fallback: "${e.fallback}".`),!1)}if(c==="integer"){if(!/^-?\d+$/.test(t))return a(`[${s}] Invalid integer "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1;const r=parseInt(t,10);return e.min!==void 0&&r<e.min?(a(`[${s}] Value ${r} for attribute "${n}" is less than min (${e.min}).`),!1):e.max!==void 0&&r>e.max?(a(`[${s}] Value ${r} for attribute "${n}" is greater than max (${e.max}).`),!1):!0}if(c==="float")return isNaN(Number(t))?(a(`[${s}] Invalid float "${t}" for attribute "${n}". Fallback: ${e.fallback}.`),!1):!0;if(c==="json")try{return JSON.parse(t),!0}catch(r){return a(`[${s}] Invalid JSON for attribute "${n}": ${r.message}. Fallback: ${e.fallback}.`),!1}return!0}function Y(e,t,n){for(const o in n){const[i,s,c]=n[o];Object.defineProperty(e,o,{get:function(){return i(t,s,c)},enumerable:!0,configurable:!0})}return e}function Z(e){const t={};for(const n in e){const o=e[n];if(!o||!o.prop)continue;let i=o.read;if(!i&&o.type)switch(o.type){case"enum":i=K(o.values,o.fallback);break;case"integer":i=J;break;case"float":i=Q;break;case"boolean":i=V;break;case"list":i=G;break;case"json":i=z;break;case"string":default:i=O;break}i||(i=O),t[o.prop]=[i,n,o.fallback]}return t}function _e(e){const t={};for(const n in e){const o=e[n];o&&o.effect&&(t[n]=o.effect)}return Object.keys(t).length?t:null}function ve(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=Y,window.lnCore.attrSpec=Z,window.lnCore.attrStr=O,window.lnCore.attrInt=J,window.lnCore.attrBool=V,window.lnCore.attrList=G,window.lnCore.attrEnum=K,window.lnCore.attrFloat=Q,window.lnCore.attrJson=z);function L(e,t){if(!e[t.attribute]){window.lnCore._persistSink&&e.hasAttribute&&e.hasAttribute("data-ln-persist")&&window.lnCore._persistSink(e,t.selector);try{e[t.attribute]=new t.ComponentFn(e)}catch(n){console.error("["+t.attribute+"] init failed",e,n)}}}function ee(e,t,n,o){if(e.nodeType!==1)return;const s=t.indexOf("[")!==-1||t.indexOf(".")!==-1||t.indexOf("#")!==-1?t:"["+t+"]",c={selector:t,attribute:n,ComponentFn:o};if(e.matches&&e.matches(s)&&L(e,c),e.querySelectorAll){const a=e.querySelectorAll(s);for(let r=0;r<a.length;r++)L(a[r],c)}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[]);function Ae(){return typeof window<"u"&&window.lnCore&&window.lnCore._bootHolds||0}function ke(e){typeof window<"u"?(window.lnCore=window.lnCore||{},window.lnCore._bootHolds=window.lnCore._bootHolds||0,window.lnCore._bootQueue=window.lnCore._bootQueue||[],window.lnCore._bootHolds>0?window.lnCore._bootQueue.push(e):setTimeout(e,0)):e()}function 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 Se(e){const t=te(),n=e.observed||[];for(let o=0;o<n.length;o++){const i=n[o];t.byAttr.has(i)||t.byAttr.set(i,[]),t.byAttr.get(i).push(e)}if(t.byDeclaredAttr=t.byDeclaredAttr||new Map,e.attributes)for(const o in e.attributes){t.byDeclaredAttr.has(o)||t.byDeclaredAttr.set(o,[]);const i=t.byDeclaredAttr.get(o);i.some(s=>s.componentTag===e.componentTag)||i.push({spec:e.attributes[o],componentTag:e.componentTag})}if(e.onAttrChange||e.effects){t.reactive.push(e);const o=ve(e);if(o===null)t.reactiveWildcard.push(e);else for(const i of o)t.byReactive.has(i)||t.byReactive.set(i,[]),t.byReactive.get(i).push(e)}e.persist&&t.persist.push(e)}function ne(e,t,n,o){for(let i=0;i<e.length;i++){const s=e[i];if(!t[s.attribute])continue;const c=s.effects&&s.effects[n];c?c(t,n,o):s.onAttrChange&&(!s.declared||s.declared.has(n))&&s.onAttrChange(t,n,o)}}function xe(e){const t=e.attributeName,n=t.indexOf("data-ln-")===0,o=te(),i=o.byAttr.get(t),s=P()&&o.byDeclaredAttr&&o.byDeclaredAttr.has(t);if(!n&&!i&&!s)return;const c=e.target;if(e.oldValue!==c.getAttribute(t)){if(s&&I(c)){const a=o.byDeclaredAttr.get(t),r=c.getAttribute(t);for(let f=0;f<a.length;f++)X(a[f].spec,r,t,a[f].componentTag,c)}if(window.lnCore._debugSink&&(n||i)&&window.lnCore._debugSink("attr",t,c,{oldValue:e.oldValue,newValue:c.getAttribute(t)}),n){const a=o.byReactive.get(t);a&&ne(a,c,t,e.oldValue),o.reactiveWildcard.length&&ne(o.reactiveWildcard,c,t,e.oldValue)}if(i)for(let a=0;a<i.length;a++){const r=i[a];if(r.handler){r.handler(c,t,e.oldValue);continue}r.onAttributeChange&&c[r.attribute]?r.onAttributeChange(c,t):(ee(c,r.selector,r.attribute,r.ComponentFn),r.onInit&&r.onInit(c))}}}function Ee(){window.lnCore=window.lnCore||{},!window.lnCore._attrObserverBound&&(window.lnCore._attrObserverBound=!0,D(function(){new MutationObserver(function(t){for(let n=0;n<t.length;n++)try{xe(t[n])}catch(o){console.error("[ln-core] mutation handler failed",t[n].target,o)}}).observe(document.body,{attributes:!0,subtree:!0,attributeOldValue:!0})},"ln-core"))}function F(){return window.lnCore=window.lnCore||{},window.lnCore._lifecycleRegistry=window.lnCore._lifecycleRegistry||[]}function $(){return window.lnCore=window.lnCore||{},window.lnCore._subtreeRegistry=window.lnCore._subtreeRegistry||[]}function re(e,t){if(!document.contains(e))if(t.attribute){const n=e[t.attribute];if(n&&typeof n.destroy=="function")try{n.destroy()}catch(o){console.error("["+t.attribute+"] destroy failed",e,o)}delete e[t.attribute]}else t.onDestroy&&t.onDestroy(e)}function oe(e){const t=F();if(!t.length)return;const n=e.target;if(n){const i=n.nodeType===1?n:n.parentElement;if(i&&(i.isContentEditable||i.closest&&i.closest('[contenteditable]:not([contenteditable="false"])')))return}const o=$();if(e.target&&o.length)for(let i=0;i<o.length;i++){const s=o[i],c=s.query,a=e.target.nodeType===1?e.target.matches&&e.target.matches(c)?e.target:e.target.closest?e.target.closest(c):null:e.target.parentElement&&e.target.parentElement.closest?e.target.parentElement.closest(c):null;a&&s.onSubtreeChange(a,e)}for(let i=0;i<e.addedNodes.length;i++){const s=e.addedNodes[i];if(s.nodeType!==1)continue;const c=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a],f=r.query;if(f&&(s.matches&&s.matches(f)&&(r.ComponentFn&&L(s,r),r.onInit&&r.onInit(s)),c&&s.querySelectorAll)){const p=s.querySelectorAll(f);for(let w=0;w<p.length;w++)r.ComponentFn&&L(p[w],r),r.onInit&&r.onInit(p[w])}}}for(let i=0;i<e.removedNodes.length;i++){const s=e.removedNodes[i];if(s.nodeType!==1||document.contains(s))continue;const c=!!(s.firstElementChild||s.children&&s.children.length);for(let a=0;a<t.length;a++){const r=t[a],f=r.query;if(f&&(s.matches&&s.matches(f)&&re(s,r),c&&s.querySelectorAll)){const p=s.querySelectorAll(f);for(let w=0;w<p.length;w++)re(p[w],r)}}}}function ie(){window.lnCore=window.lnCore||{},!window.lnCore._lifecycleObserverBound&&(window.lnCore._lifecycleObserverBound=!0,D(function(){const e=new MutationObserver(function(t){for(let n=0;n<t.length;n++){const o=t[n];if(o.type==="childList")try{oe(o)}catch(i){console.error("[ln-core] lifecycle handler failed",o.target,i)}}});window.lnCore._lifecycleObserver=e,e.observe(document.body,{childList:!0,subtree:!0})},"ln-core"))}function Oe(e){if(typeof window>"u")return e();window.lnCore=window.lnCore||{};const t=window.lnCore._lifecycleObserver;if(!t)return e();const n=t.takeRecords();for(let o=0;o<n.length;o++){const i=n[o];if(i.type==="childList")try{oe(i)}catch(s){console.error("[ln-core] lifecycle handler failed",i.target,s)}}t.disconnect();try{return e()}finally{t.observe(document.body,{childList:!0,subtree:!0})}}function Te(e){F().push(e),e.onSubtreeChange&&e.query&&$().push(e),ie()}function ce(e,t,n,o,i={}){const s=i.extraAttributes||[],c=i.onAttributeChange||null,a=i.onSubtreeChange||null,r=i.onInit||null,f=i.onAttrChange||null,p=i.effects||null,w=i.attributes||null,_=w?_e(w):p,B=w?new Set(Object.keys(w)):null,l=i.persist||null;function u(b){const C=b||document.body;if(ee(C,e,t,n),w&&P())for(const x in w){const S=w[x],E=Array.from(C.querySelectorAll("["+x+"]"));C.matches&&C.matches("["+x+"]")&&E.push(C);for(let A=0;A<E.length;A++){const q=E[A];I(q)&&X(S,q.getAttribute(x),x,o,q)}}r&&r(C)}const d=[];if(e.indexOf("[")!==-1){const b=/\[([\w-]+)/g;let C;for(;(C=b.exec(e))!==null;)d.push(C[1])}else d.push(e);Se({selector:e,attribute:t,componentTag:o,attributes:w,ComponentFn:n,onInit:r,observed:d.concat(s),onAttributeChange:c,onAttrChange:f,effects:_,declared:B,persist:l}),Ee();const h=e.indexOf("[")!==-1||e.indexOf(".")!==-1||e.indexOf("#")!==-1,g=i.subtreeQuery||(h?e:"["+e+"]"),y={selector:e,attribute:t,ComponentFn:n,onInit:r,onSubtreeChange:a,query:g};F().push(y),a&&g&&$().push(y),ie(),window[t]=u,typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.registerComponent=ce,window.lnCore.observeLifecycle=Te,window.lnCore.withoutLifecycle=Oe);function m(){Ae()>0?ke(function(){u(document.body)}):u(document.body)}return document.readyState==="loading"?document.addEventListener("DOMContentLoaded",m):m(),u}function le(e){return(e||"").replace(/^#/,"")}function N(e){const t=e===void 0?location.hash:e,n={},o=le(t);if(!o)return n;const i=o.split("&");for(let s=0;s<i.length;s++){const c=i[s];if(!c)continue;const a=c.indexOf(":"),r=a>-1?c.slice(0,a):c,f=a>-1?c.slice(a+1):"";if(r)try{n[r]=decodeURIComponent(f)}catch{n[r]=f}}return n}function De(e){if(!e)return null;const t=N();return e in t?t[e]:null}function Le(e,t){if(!e)return;const n=N();t==null?delete n[e]:n[e]=String(t);const i=Object.keys(n).map(function(s){const c=n[s];return c===""?s:s+":"+encodeURIComponent(c)}).join("&");le(location.hash)!==i&&(location.hash=i)}function qe(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 o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"-"+t:o:t||null}function je(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function Re(e){return!e||typeof e!="string"?null:e.endsWith(".asc")?{fieldOrColumn:e.slice(0,-4),direction:"asc"}:e.endsWith(".desc")?{fieldOrColumn:e.slice(0,-5),direction:"desc"}:null}function Fe(e,t){return!e||!Array.isArray(t)||t.length===0?null:e+":"+t.map(encodeURIComponent).join(",")}function $e(e){if(!e||typeof e!="string")return null;const t=e.indexOf(":");if(t===-1)return null;const n=e.slice(0,t),o=e.slice(t+1),i=o?o.split(",").map(function(s){try{return decodeURIComponent(s)}catch{return s}}).filter(Boolean):[];return{key:n,values:i}}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.hashParse=N,window.lnCore.hashGet=De,window.lnCore.hashSet=Le,window.lnCore.hashLinkClick=qe,window.lnCore.resolveHashNamespace=Ie,window.lnCore.hashSortEncode=je,window.lnCore.hashSortDecode=Re,window.lnCore.hashFilterEncode=Fe,window.lnCore.hashFilterDecode=$e);function Ne(e){return(e||"").replace(/^\?/,"")}function Be(e){const t=e===void 0?typeof window<"u"?window.location.search:"":e,n={},o=Ne(t);if(!o)return n;const i=new URLSearchParams(o);for(const[s,c]of i.entries())n[s]=c;return n}function Pe(e){if(!e||typeof window>"u")return null;const t=new URLSearchParams(window.location.search);return t.has(e)?t.get(e):null}function Me(e,t){if(!e||typeof window>"u")return;const n=new URL(window.location.href);if(t==null||t===""?n.searchParams.delete(e):n.searchParams.set(e,String(t)),n.search===window.location.search)return;const o=n.pathname+n.search+n.hash;window.history.replaceState(window.history.state,"",o)}function Ue(e,t){if(!e||!e.hasAttribute("data-ln-query"))return null;const n=e.getAttribute("data-ln-query");if(n&&n.trim()!=="")return n.trim();const o=e.getAttribute("data-ln-sort")||e.getAttribute("data-ln-search-for")||e.getAttribute("data-ln-search")||e.getAttribute("data-ln-filter")||e.id;return o?t?o+"_"+t:o:t||null}function He(e,t){return!t||t==="none"||e===null||e===void 0?null:String(e)+"."+t}function We(e,t){if(e&&typeof e=="string"){if(e.endsWith(".asc"))return{fieldOrColumn:e.slice(0,-4),direction:"asc"};if(e.endsWith(".desc"))return{fieldOrColumn:e.slice(0,-5),direction:"desc"}}if(t&&typeof t=="object"){const n=t.sort_field||t.sort_by;if(n){const o=t.sort_dir&&String(t.sort_dir).toLowerCase()==="desc"?"desc":"asc";return{fieldOrColumn:n,direction:o}}}return null}function Je(e){return!Array.isArray(e)||e.length===0?null:e.map(encodeURIComponent).join(",")}function Ve(e){return!e||typeof e!="string"?[]:e.split(",").map(function(t){try{return decodeURIComponent(t.trim())}catch{return t.trim()}}).filter(Boolean)}typeof window<"u"&&(window.lnCore=window.lnCore||{},window.lnCore.queryParse=Be,window.lnCore.queryGet=Pe,window.lnCore.querySet=Me,window.lnCore.resolveQueryParam=Ue,window.lnCore.querySortEncode=He,window.lnCore.querySortDecode=We,window.lnCore.queryFilterEncode=Je,window.lnCore.queryFilterDecode=Ve);function Ge(){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=Ge),(function(){const e="data-ln-couchdb-connector",t="lnCouchDbConnector",n="lnConnector";if(window[t]!==void 0)return;function o(l){const u=l[t];u&&u.refreshConfig()}const i={"data-ln-couchdb-connector":{type:"marker",description:"Mounts CouchDB/PouchDB connector bridging database and ln-ashlar data coordinators"},"data-ln-couchdb-url":{prop:"url",read:O,type:"string",fallback:"",effect:o,description:"CouchDB server base endpoint URL"},"data-ln-couchdb-db":{prop:"db",read:O,type:"string",fallback:"",effect:o,description:"Target CouchDB database name"},"data-ln-couchdb-auth":{prop:"auth",read:O,type:"string",fallback:"",effect:o,description:"Authentication credentials for CouchDB requests"},"data-ln-couchdb-headers":{effect:o,type:"json",fallback:null,description:"Custom HTTP headers in JSON or semicolon-separated format"}},s=Z(i);function c(l){const u=l&&l.content!==void 0?l.content:l,d=l&&l.message?l.message:null;return{content:u,message:d}}function a(l){return this.dom=l,Y(this,l,s),l[t]=this,l[n]=this,this.namespace="ln-couchdb-connector",this.refreshConfig(),this._deltaController=null,this._handlers=null,B(this),this}a.prototype.refreshConfig=function(){const l=this.dom;this.credentials="same-origin";const u=l.getAttribute("data-ln-couchdb-headers")||"";this.headers=fe(u,"ln-couchdb-connector"),this.auth&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-auth attribute. Storing basic authentication credentials in HTML DOM attributes is highly discouraged and vulnerable to XSS credential extraction. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),u.toLowerCase().includes("authorization")&&console.warn("[ln-couchdb-connector] Security Warning: Sensitive authorization credentials detected in data-ln-couchdb-headers attribute. Please use HttpOnly session cookies or a Backend Proxy Gateway instead."),v(l,"ln-couchdb-connector:config-changed",{url:this.url,db:this.db,auth:this.auth?"[REDACTED]":"",headers:this.headers})};function r(l,u,d){const h=Object.assign({},T(l.headers,l.auth),d||{});return u&&(h["Idempotency-Key"]=u),h}a.prototype.fetchDelta=function(l){const u=this;this._deltaController&&this._deltaController.abort(),this._deltaController=new AbortController;const d=this._deltaController.signal,h=["include_docs=true","feed=normal"];l&&h.push("since="+encodeURIComponent(l));const g=k(u.url,u.db,"_changes")+"?"+h.join("&");return window.fetch(g,{method:"GET",headers:T(u.headers,u.auth),credentials:u.credentials,signal:d}).then(y=>{if(!y.ok)throw new Error("HTTP "+y.status+": "+y.statusText);return y.json()}).then(y=>{const m=y.results||[];return{data:m.filter(b=>!b.deleted&&b.doc).map(b=>Object.assign({},b.doc,{id:b.doc._id})),deleted:m.filter(b=>b.deleted).map(b=>b.id),synced_at:y.last_seq||l||""}}).finally(()=>{u._deltaController&&u._deltaController.signal===d&&(u._deltaController=null)})};function f(l,u,d){const h=Object.assign({_id:u.id},u);return h._id||delete h._id,window.fetch(k(l.url,l.db),{method:"POST",headers:r(l,d),credentials:l.credentials,body:JSON.stringify(h)}).then(g=>{if(!g.ok)throw new Error("HTTP "+g.status+": "+g.statusText);return g.json()}).then(g=>{const y=c(g),m=y.content;return{record:Object.assign({},h,{id:m.id,_id:m.id,_rev:m.rev}),message:y.message}})}a.prototype.create=function(l,u){return f(this,l,u).then(d=>d.record)};function p(l,u,d,h){const g=Object.assign({id:String(u),_id:String(u)},d),y=g._rev||g.rev;return(y?Promise.resolve(y):window.fetch(k(l.url,l.db,null,u),{method:"GET",headers:T(l.headers,l.auth),credentials:l.credentials}).then(b=>{if(!b.ok)throw new Error("Could not retrieve document for revision mapping");return b.json().then(C=>C._rev)})).then(b=>{const C=Object.assign({},g,{_rev:b});delete C.rev;const x=r(l,h,{"If-Match":b});return window.fetch(k(l.url,l.db,null,u),{method:"PUT",headers:x,credentials:l.credentials,body:JSON.stringify(C)}).then(S=>{if(S.ok)return S.json().then(E=>{const A=c(E);return{record:Object.assign({},C,{_rev:A.content.rev}),message:A.message}});if(S.status===409)return S.json().then(E=>{const A=new Error("Conflict");throw A.status=409,A.data=E,A});throw new Error("HTTP "+S.status+": "+S.statusText)})})}a.prototype.update=function(l,u,d){return p(this,l,u,d).then(h=>h.record)};function w(l,u,d,h){return(d?Promise.resolve(d):window.fetch(k(l.url,l.db,null,u),{method:"GET",headers:T(l.headers,l.auth),credentials:l.credentials}).then(y=>{if(!y.ok)throw new Error("Could not retrieve document for revision delete");return y.json().then(m=>m._rev)})).then(y=>{const m=k(l.url,l.db,null,u)+"?rev="+encodeURIComponent(y);return window.fetch(m,{method:"DELETE",headers:r(l,h),credentials:l.credentials}).then(b=>{if(!b.ok)throw new Error("HTTP "+b.status+": "+b.statusText);return b.json()}).then(b=>{const C=c(b);return{response:C.content,message:C.message}})})}a.prototype.delete=function(l,u,d){return w(this,l,u,d).then(h=>h.response)};function _(l,u,d){return!u||u.length===0?Promise.resolve({response:{ok:!0,deletedCount:0},message:null}):window.fetch(k(l.url,l.db,"_all_docs"),{method:"POST",headers:T(l.headers,l.auth),credentials:l.credentials,body:JSON.stringify({keys:u})}).then(h=>{if(!h.ok)throw new Error("HTTP "+h.status+": "+h.statusText);return h.json()}).then(h=>{const y=(h.rows||[]).filter(m=>!m.error&&m.value&&m.value.rev).map(m=>({_id:m.id,_rev:m.value.rev,_deleted:!0}));return y.length===0?{response:{ok:!0,deletedCount:0},message:null}:window.fetch(k(l.url,l.db,"_bulk_docs"),{method:"POST",headers:r(l,d),credentials:l.credentials,body:JSON.stringify({docs:y})}).then(m=>{if(!m.ok)throw new Error("HTTP "+m.status+": "+m.statusText);return m.json()}).then(m=>{const b=c(m);return{response:{ok:!0,results:b.content,deletedCount:y.length},message:b.message}})})}a.prototype.bulkDelete=function(l,u){return _(this,l,u).then(d=>d.response)};function B(l){l._handlers={sync:function(u){const d=u.detail||{};l.fetchDelta(d.since).then(function(h){v(l.dom,"ln-couchdb-connector:fetched",{data:h,since:d.since,meta:d.meta||null})}).catch(function(h){h&&h.name==="AbortError"||v(l.dom,"ln-couchdb-connector:error",{action:"sync",error:h.message,status:h.status||0,since:d.since,meta:d.meta||null})})},create:function(u){const d=u.detail||{};f(l,d.data,d.idempotencyKey).then(function(h){v(l.dom,"ln-couchdb-connector:created",{record:h.record,tempId:d.tempId,message:h.message,meta:d.meta||null})}).catch(function(h){v(l.dom,"ln-couchdb-connector:error",{action:"create",error:h.message,status:h.status||0,tempId:d.tempId,meta:d.meta||null})})},update:function(u){const d=u.detail||{},h=Object.assign({},d.data);d.expected_version!==void 0&&(h._rev=d.expected_version),p(l,d.id,h,d.idempotencyKey).then(function(g){v(l.dom,"ln-couchdb-connector:updated",{record:g.record,id:d.id,message:g.message,meta:d.meta||null})}).catch(function(g){v(l.dom,"ln-couchdb-connector:error",{action:"update",error:g.message,status:g.status||0,id:d.id,data:g.status===409?g.data:null,conflictData:g.status===409?g.data:null,meta:d.meta||null})})},delete:function(u){const d=u.detail||{};w(l,d.id,d.rev,d.idempotencyKey).then(function(h){v(l.dom,"ln-couchdb-connector:deleted",{response:h.response,id:d.id,message:h.message,meta:d.meta||null})}).catch(function(h){v(l.dom,"ln-couchdb-connector:error",{action:"delete",error:h.message,status:h.status||0,id:d.id,meta:d.meta||null})})},bulkDelete:function(u){const d=u.detail||{};_(l,d.ids,d.idempotencyKey).then(function(h){v(l.dom,"ln-couchdb-connector:bulk-deleted",{response:h.response,ids:d.ids,message:h.message,meta:d.meta||null})}).catch(function(h){v(l.dom,"ln-couchdb-connector:error",{action:"bulk-delete",error:h.message,status:h.status||0,ids:d.ids,meta:d.meta||null})})}},l.dom.addEventListener("ln-couchdb-connector:request-sync",l._handlers.sync),l.dom.addEventListener("ln-couchdb-connector:request-create",l._handlers.create),l.dom.addEventListener("ln-couchdb-connector:request-update",l._handlers.update),l.dom.addEventListener("ln-couchdb-connector:request-delete",l._handlers.delete),l.dom.addEventListener("ln-couchdb-connector:request-bulk-delete",l._handlers.bulkDelete)}a.prototype.destroy=function(){if(!this.dom[t])return;const l=this;l._deltaController&&(l._deltaController.abort(),l._deltaController=null),l._handlers&&(l.dom.removeEventListener("ln-couchdb-connector:request-sync",l._handlers.sync),l.dom.removeEventListener("ln-couchdb-connector:request-create",l._handlers.create),l.dom.removeEventListener("ln-couchdb-connector:request-update",l._handlers.update),l.dom.removeEventListener("ln-couchdb-connector:request-delete",l._handlers.delete),l.dom.removeEventListener("ln-couchdb-connector:request-bulk-delete",l._handlers.bulkDelete),l._handlers=null),delete this.dom[t],delete this.dom[n]},ce(e,t,a,"ln-couchdb-connector",{attributes:i})})()})();
|