@nodex.ui/core 1.0.0 → 1.0.1

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.
@@ -7,37 +7,48 @@
7
7
  /* Vendored from @odoo/owl@2.8.3's dist/owl.iife.min.js, patched to key off globalThis instead of top-level `this` (safe in both classic scripts and ES modules) — see scripts/build.mjs and src/owl/owl-dev-shim.js. */
8
8
  !function(t){"use strict";function e(t){t=t.slice();const e=[];let n;for(;(n=t[0])&&"string"==typeof n;)e.push(t.shift());return{modifiers:e,data:t}}const n={shouldNormalizeDom:!0,mainEventHandler:(t,n,o)=>("function"==typeof t?t(n):Array.isArray(t)&&(t=e(t).data)[0](t[1],n),!1)};class o{constructor(t,e){this.key=t,this.child=e}mount(t,e){this.parentEl=t,this.child.mount(t,e)}moveBeforeDOMNode(t,e){this.child.moveBeforeDOMNode(t,e)}moveBeforeVNode(t,e){this.moveBeforeDOMNode(t&&t.firstNode()||e)}patch(t,e){if(this===t)return;let n=this.child,o=t.child;this.key===t.key?n.patch(o,e):(o.mount(this.parentEl,n.firstNode()),e&&n.beforeRemove(),n.remove(),this.child=o,this.key=t.key)}beforeRemove(){this.child.beforeRemove()}remove(){this.child.remove()}firstNode(){return this.child.firstNode()}toString(){return this.child.toString()}}function s(t,e){return new o(t,e)}class r extends Error{}let i,l,a,c;if("undefined"!=typeof Element){({setAttribute:i,removeAttribute:l}=Element.prototype);const t=DOMTokenList.prototype;a=t.add,c=t.remove}const h=Array.isArray,{split:u,trim:d}=String.prototype,f=/\s+/;function p(t,e){switch(e){case!1:case void 0:l.call(this,t);break;case!0:i.call(this,t,"");break;default:i.call(this,t,e)}}function m(t){return function(e){p.call(this,t,e)}}function g(t){if(h(t))"class"===t[0]?y.call(this,t[1]):p.call(this,t[0],t[1]);else for(let e in t)"class"===e?y.call(this,t[e]):p.call(this,e,t[e])}function b(t,e){if(h(t)){const n=t[0],o=t[1];if(n===e[0]){if(o===e[1])return;"class"===n?w.call(this,o,e[1]):p.call(this,n,o)}else l.call(this,e[0]),p.call(this,n,o)}else{for(let n in e)n in t||("class"===n?w.call(this,"",e[n]):l.call(this,n));for(let n in t){const o=t[n];o!==e[n]&&("class"===n?w.call(this,o,e[n]):p.call(this,n,o))}}}function v(t){const e={};switch(typeof t){case"string":const n=d.call(t);if(!n)return{};let o=u.call(n,f);for(let t=0,n=o.length;t<n;t++)e[o[t]]=!0;return e;case"object":for(let n in t){const o=t[n];if(o){if(n=d.call(n),!n)continue;const t=u.call(n,f);for(let n of t)e[n]=o}}return e;case"undefined":return{};case"number":return{[t]:!0};default:return{[t]:!0}}}function y(t){t=""===t?{}:v(t);const e=this.classList;for(let n in t)a.call(e,n)}function w(t,e){e=""===e?{}:v(e),t=""===t?{}:v(t);const n=this.classList;for(let o in e)o in t||c.call(n,o);for(let o in t)o in e||a.call(n,o)}function $(t){let e=!1;return async(...n)=>{e||(e=!0,await Promise.resolve(),e=!1,t(...n))}}function x(t){if(!t)return!1;if(t.ownerDocument.contains(t))return!0;const e=t.getRootNode();return e instanceof ShadowRoot&&t.ownerDocument.contains(e.host)}class N extends EventTarget{trigger(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e}))}}class k extends String{}function T(t){return t instanceof k?t:void 0===t?E(""):"number"==typeof t?E(String(t)):([["&","&amp;"],["<","&lt;"],[">","&gt;"],["'","&#x27;"],['"',"&quot;"],["`","&#x60;"]].forEach((e=>{t=String(t).replace(new RegExp(e[0],"g"),e[1])})),E(t))}function E(t,...e){if(!Array.isArray(t))return new k(t);const n=t;let o="",s=0;for(;s<e.length;++s)o+=n[s]+T(e[s]);return o+=n[s],new k(o)}function A(t){const e=t.split(".")[0],o=t.includes(".capture");return t.includes(".synthetic")?function(t,e=!1){let o=`__event__synthetic_${t}`;e&&(o=`${o}_capture`);!function(t,e,o=!1){if(D[e])return;document.addEventListener(t,(t=>function(t,e){let o=e.target;for(;null!==o;){const s=o[t];if(s)for(const t of Object.values(s)){if(n.mainEventHandler(t,e,o))return}o=o.parentNode}}(e,t)),{capture:o}),D[e]=!0}(t,o,e);const s=C++;function r(t){const e=this[o]||{};e[s]=t,this[o]=e}function i(){delete this[o]}return{setup:r,update:r,remove:i}}(e,o):function(t,e=!1){let o=`__event__${t}_${_++}`;e&&(o=`${o}_capture`);function s(t){const e=t.currentTarget;if(!e||!x(e))return;const s=e[o];s&&n.mainEventHandler(s,t,e)}function r(n){this[o]=n,this.addEventListener(t,s,{capture:e})}function i(){delete this[o],this.removeEventListener(t,s,{capture:e})}function l(t){this[o]=t}return{setup:r,update:l,remove:i}}(e,o)}let _=1;let C=1;const D={};let S,O,R;if("undefined"!=typeof Node){const t=Node.prototype;S=t.insertBefore,O=(L=t,B="textContent",Object.getOwnPropertyDescriptor(L,B)).set,R=t.removeChild}var L,B;class P{constructor(t){this.children=t}mount(t,e){const n=this.children,o=n.length,s=new Array(o);for(let r=0;r<o;r++){let o=n[r];if(o)o.mount(t,e);else{const n=document.createTextNode("");s[r]=n,S.call(t,n,e)}}this.anchors=s,this.parentEl=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;const n=this.children,o=this.anchors;for(let s=0,r=n.length;s<r;s++){let r=n[s];if(r)r.moveBeforeDOMNode(t,e);else{const n=o[s];S.call(e,n,t)}}}moveBeforeVNode(t,e){if(t){const n=t.children[0];e=(n?n.firstNode():t.anchors[0])||null}const n=this.children,o=this.parentEl,s=this.anchors;for(let t=0,r=n.length;t<r;t++){let r=n[t];if(r)r.moveBeforeVNode(null,e);else{const n=s[t];S.call(o,n,e)}}}patch(t,e){if(this===t)return;const n=this.children,o=t.children,s=this.anchors,r=this.parentEl;for(let t=0,i=n.length;t<i;t++){const i=n[t],l=o[t];if(i)if(l)i.patch(l,e);else{const o=i.firstNode(),l=document.createTextNode("");s[t]=l,S.call(r,l,o),e&&i.beforeRemove(),i.remove(),n[t]=void 0}else if(l){n[t]=l;const e=s[t];l.mount(r,e),R.call(r,e)}}}beforeRemove(){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];n&&n.beforeRemove()}}remove(){const t=this.parentEl;if(this.isOnlyChild)O.call(t,"");else{const e=this.children,n=this.anchors;for(let o=0,s=e.length;o<s;o++){const s=e[o];s?s.remove():R.call(t,n[o])}}}firstNode(){const t=this.children[0];return t?t.firstNode():this.anchors[0]}toString(){return this.children.map((t=>t?t.toString():"")).join("")}}function j(t){return new P(t)}let M,I,W;if("undefined"!=typeof Node){const t=Node.prototype;M=t.insertBefore,W=t.removeChild,I=((t,e)=>Object.getOwnPropertyDescriptor(t,e))(CharacterData.prototype,"data").set}class V{constructor(t){this.text=t}mountNode(t,e,n){this.parentEl=e,M.call(e,t,n),this.el=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,M.call(e,this.el,t)}moveBeforeVNode(t,e){M.call(this.parentEl,this.el,t?t.el:e)}beforeRemove(){}remove(){W.call(this.parentEl,this.el)}firstNode(){return this.el}toString(){return this.text}}class F extends V{mount(t,e){this.mountNode(document.createTextNode(U(this.text)),t,e)}patch(t){const e=t.text;this.text!==e&&(I.call(this.el,U(e)),this.text=e)}}class K extends V{mount(t,e){this.mountNode(document.createComment(U(this.text)),t,e)}patch(){}}function z(t){return new F(t)}function H(t){return new K(t)}function U(t){switch(typeof t){case"string":return t;case"number":return String(t);case"boolean":return t?"true":"false";default:return t||""}}const q=(t,e)=>Object.getOwnPropertyDescriptor(t,e);let G,X,Y,Z,J;"undefined"!=typeof Node&&(G=Node.prototype,X=Element.prototype,Y=q(CharacterData.prototype,"data").set,Z=q(G,"firstChild").get,J=q(G,"nextSibling").get);const Q=()=>{};function tt(t){return function(e){this[t]=0===e?0:e?e.valueOf():""}}const et={};function nt(t){if(t in et)return et[t];const e=(new DOMParser).parseFromString(`<t>${t}</t>`,"text/xml").firstChild.firstChild;n.shouldNormalizeDom&&ot(e);const o=st(e),s=lt(o),r=function(t,e){let n=function(t,e){const{refN:n,collectors:o,children:s}=e,r=o.length;e.locations.sort(((t,e)=>t.idx-e.idx));const i=e.locations.map((t=>({refIdx:t.refIdx,setData:t.setData,updateData:t.updateData}))),l=i.length,a=s.length,c=s,h=n>0,u=G.cloneNode,d=G.insertBefore,f=X.remove;class p{constructor(t){this.data=t}beforeRemove(){}remove(){f.call(this.el)}firstNode(){return this.el}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,d.call(e,this.el,t)}moveBeforeVNode(t,e){d.call(this.parentEl,this.el,t?t.el:e)}toString(){const t=document.createElement("div");return this.mount(t,null),t.innerHTML}mount(e,n){const o=u.call(t,!0);d.call(e,o,n),this.el=o,this.parentEl=e}patch(t,e){}}h&&(p.prototype.mount=function(e,s){const h=u.call(t,!0),f=new Array(n);this.refs=f,f[0]=h;for(let t=0;t<r;t++){const e=o[t];f[e.idx]=e.getVal.call(f[e.prevIdx])}if(l){const t=this.data;for(let e=0;e<l;e++){const n=i[e];n.setData.call(f[n.refIdx],t[e])}}if(d.call(e,h,s),a){const t=this.children;for(let e=0;e<a;e++){const n=t[e];if(n){const t=c[e],o=t.afterRefIdx?f[t.afterRefIdx]:null;n.isOnlyChild=t.isOnlyChild,n.mount(f[t.parentRefIdx],o)}}}this.el=h,this.parentEl=e},p.prototype.patch=function(t,e){if(this===t)return;const n=this.refs;if(l){const e=this.data,o=t.data;for(let t=0;t<l;t++){const s=e[t],r=o[t];if(s!==r){const e=i[t];e.updateData.call(n[e.refIdx],r,s)}}this.data=o}if(a){let o=this.children;const s=t.children;for(let t=0;t<a;t++){const r=o[t],i=s[t];if(r)i?r.patch(i,e):(e&&r.beforeRemove(),r.remove(),o[t]=void 0);else if(i){const e=c[t],s=e.afterRefIdx?n[e.afterRefIdx]:null;i.mount(n[e.parentRefIdx],s),o[t]=i}}}});return p}(t,e);if(e.cbRefs.length){const t=e.cbRefs,o=e.refList;let s=t.length;n=class extends n{mount(t,e){o.push(new Array(s)),super.mount(t,e);for(let t of o.pop())t()}remove(){super.remove();for(let e of t){(0,this.data[e])(null)}}}}if(e.children.length)return n=class extends n{constructor(t,e){super(t),this.children=e}},n.prototype.beforeRemove=P.prototype.beforeRemove,(t,e=[])=>new n(t,e);return t=>new n(t)}(o.el,s);return et[t]=r,r}function ot(t){if(t.nodeType!==Node.TEXT_NODE||/\S/.test(t.textContent)){if(t.nodeType!==Node.ELEMENT_NODE||"pre"!==t.tagName)for(let e=t.childNodes.length-1;e>=0;--e)ot(t.childNodes.item(e))}else t.remove()}function st(t,e=null,n=null){switch(t.nodeType){case Node.ELEMENT_NODE:{let o=n&&n.currentNS;const s=t.tagName;let r;const i=[];if(s.startsWith("block-text-")){const t=parseInt(s.slice(11),10);i.push({type:"text",idx:t}),r=document.createTextNode("")}if(s.startsWith("block-child-")){n.isRef||rt(n);const t=parseInt(s.slice(12),10);i.push({type:"child",idx:t}),r=document.createTextNode("")}if(o||(o=t.namespaceURI),r||(r=o?document.createElementNS(o,s):document.createElement(s)),r instanceof Element){if(!n){document.createElement("template").content.appendChild(r)}const e=t.attributes;for(let t=0;t<e.length;t++){const n=e[t].name,o=e[t].value;if(n.startsWith("block-handler-")){const t=parseInt(n.slice(14),10);i.push({type:"handler",idx:t,event:o})}else if(n.startsWith("block-attribute-")){const t=parseInt(n.slice(16),10);i.push({type:"attribute",idx:t,name:o,tag:s})}else if(n.startsWith("block-property-")){const t=parseInt(n.slice(15),10);i.push({type:"property",idx:t,name:o,tag:s})}else"block-attributes"===n?i.push({type:"attributes",idx:parseInt(o,10)}):"block-ref"===n?i.push({type:"ref",idx:parseInt(o,10)}):r.setAttribute(e[t].name,o)}}const l={parent:e,firstChild:null,nextSibling:null,el:r,info:i,refN:0,currentNS:o};if(t.firstChild){const e=t.childNodes[0];if(1===t.childNodes.length&&e.nodeType===Node.ELEMENT_NODE&&e.tagName.startsWith("block-child-")){const t=e.tagName,n=parseInt(t.slice(12),10);i.push({idx:n,type:"child",isOnlyChild:!0})}else{l.firstChild=st(t.firstChild,l,l),r.appendChild(l.firstChild.el);let e=t.firstChild,n=l.firstChild;for(;e=e.nextSibling;)n.nextSibling=st(e,n,l),r.appendChild(n.nextSibling.el),n=n.nextSibling}}return l.info.length&&rt(l),l}case Node.TEXT_NODE:case Node.COMMENT_NODE:return{parent:e,firstChild:null,nextSibling:null,el:t.nodeType===Node.TEXT_NODE?document.createTextNode(t.textContent):document.createComment(t.textContent),info:[],refN:0,currentNS:null}}throw new r("boom")}function rt(t){t.isRef=!0;do{t.refN++}while(t=t.parent)}function it(t){let e=t.parent;for(;e&&e.nextSibling===t;)t=e,e=e.parent;return e}function lt(t,e,n){if(!e){e={collectors:[],locations:[],children:new Array(t.info.filter((t=>"child"===t.type)).length),cbRefs:[],refN:t.refN,refList:[]},n=0}if(t.refN){const o=n,s=t.isRef,r=t.firstChild?t.firstChild.refN:0,i=t.nextSibling?t.nextSibling.refN:0;if(s){for(let e of t.info)e.refIdx=o;t.refIdx=o,function(t,e){for(let n of e.info)switch(n.type){case"text":t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:at,updateData:at});break;case"child":n.isOnlyChild?t.children[n.idx]={parentRefIdx:n.refIdx,isOnlyChild:!0}:t.children[n.idx]={parentRefIdx:it(e).refIdx,afterRefIdx:n.refIdx};break;case"property":{const e=n.refIdx,o=tt(n.name);t.locations.push({idx:n.idx,refIdx:e,setData:o,updateData:o});break}case"attribute":{const e=n.refIdx;let o,s;"class"===n.name?(s=y,o=w):(s=m(n.name),o=s),t.locations.push({idx:n.idx,refIdx:e,setData:s,updateData:o});break}case"attributes":t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:g,updateData:b});break;case"handler":{const{setup:e,update:o}=A(n.event);t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:e,updateData:o});break}case"ref":const o=t.cbRefs.push(n.idx)-1;t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:ct(o,t.refList),updateData:Q})}}(e,t),n++}if(i){const s=n+r;e.collectors.push({idx:s,prevIdx:o,getVal:J}),lt(t.nextSibling,e,s)}r&&(e.collectors.push({idx:n,prevIdx:o,getVal:Z}),lt(t.firstChild,e,n))}return e}function at(t){Y.call(this,U(t))}function ct(t,e){return function(n){e[e.length-1][t]=()=>n(this)}}let ht,ut,dt,ft,pt,mt;if("undefined"!=typeof Node){const t=Node.prototype;ht=t.insertBefore,ut=t.appendChild,dt=t.removeChild,ft=((t,e)=>Object.getOwnPropertyDescriptor(t,e))(t,"textContent").set}class gt{constructor(t){this.children=t}mount(t,e){const n=this.children,o=document.createTextNode("");this.anchor=o,ht.call(t,o,e);const s=n.length;if(s){const e=n[0].mount;for(let r=0;r<s;r++)e.call(n[r],t,o)}this.parentEl=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;const n=this.children;for(let o=0,s=n.length;o<s;o++)n[o].moveBeforeDOMNode(t,e);e.insertBefore(this.anchor,t)}moveBeforeVNode(t,e){if(t){const n=t.children[0];e=(n?n.firstNode():t.anchor)||null}const n=this.children;for(let t=0,o=n.length;t<o;t++)n[t].moveBeforeVNode(null,e);this.parentEl.insertBefore(this.anchor,e)}patch(t,e){if(this===t)return;const n=this.children,o=t.children;if(0===o.length&&0===n.length)return;this.children=o;const s=o[0]||n[0],{mount:r,patch:i,remove:l,beforeRemove:a,moveBeforeVNode:c,firstNode:h}=s,u=this.anchor,d=this.isOnlyChild,f=this.parentEl;if(0===o.length&&d){if(e)for(let t=0,e=n.length;t<e;t++)a.call(n[t]);return ft.call(f,""),void ut.call(f,u)}let p,m=0,g=0,b=n[0],v=o[0],y=n.length-1,w=o.length-1,$=n[y],x=o[w];for(;m<=y&&g<=w;){if(null===b){b=n[++m];continue}if(null===$){$=n[--y];continue}let t=b.key,s=v.key;if(t===s){i.call(b,v,e),o[g]=b,b=n[++m],v=o[++g];continue}let l=$.key,a=x.key;if(l===a){i.call($,x,e),o[w]=$,$=n[--y],x=o[--w];continue}if(t===a){i.call(b,x,e),o[w]=b;const t=o[w+1];c.call(b,t,u),b=n[++m],x=o[--w];continue}if(l===s){i.call($,v,e),o[g]=$;const t=n[m];c.call($,t,u),$=n[--y],v=o[++g];continue}p=p||vt(n,m,y);let d=p[s];if(void 0===d)r.call(v,f,h.call(b)||null);else{const t=n[d];c.call(t,b,null),i.call(t,v,e),o[g]=t,n[d]=null}v=o[++g]}if(m<=y||g<=w)if(m>y){const t=o[w+1],e=t?h.call(t)||null:u;for(let t=g;t<=w;t++)r.call(o[t],f,e)}else for(let t=m;t<=y;t++){let o=n[t];o&&(e&&a.call(o),l.call(o))}}beforeRemove(){const t=this.children,e=t.length;if(e){const n=t[0].beforeRemove;for(let o=0;o<e;o++)n.call(t[o])}}remove(){const{parentEl:t,anchor:e}=this;if(this.isOnlyChild)ft.call(t,"");else{const n=this.children,o=n.length;if(o){const t=n[0].remove;for(let e=0;e<o;e++)t.call(n[e])}dt.call(t,e)}}firstNode(){const t=this.children[0];return t?t.firstNode():void 0}toString(){return this.children.map((t=>t.toString())).join("")}}function bt(t){return new gt(t)}function vt(t,e,n){let o={};for(let s=e;s<=n;s++)o[t[s].key]=s;return o}if("undefined"!=typeof Node){const t=Node.prototype;pt=t.insertBefore,mt=t.removeChild}class yt{constructor(t){this.content=[],this.html=t}mount(t,e){this.parentEl=t;const n=document.createElement("template");n.innerHTML=this.html,this.content=[...n.content.childNodes];for(let n of this.content)pt.call(t,n,e);if(!this.content.length){const n=document.createTextNode("");this.content.push(n),pt.call(t,n,e)}}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;for(let n of this.content)pt.call(e,n,t)}moveBeforeVNode(t,e){const n=t?t.content[0]:e;this.moveBeforeDOMNode(n)}patch(t){if(this===t)return;const e=t.html;if(this.html!==e){const n=this.parentEl,o=this.content[0],s=document.createElement("template");s.innerHTML=e;const r=[...s.content.childNodes];for(let t of r)pt.call(n,t,o);if(!r.length){const t=document.createTextNode("");r.push(t),pt.call(n,t,o)}this.remove(),this.content=r,this.html=t.html}}beforeRemove(){}remove(){const t=this.parentEl;for(let e of this.content)mt.call(t,e)}firstNode(){return this.content[0]}toString(){return this.html}}function wt(t){return new yt(t)}function $t(t,e,n=null){t.mount(e,n)}const xt=new WeakMap,Nt=new WeakMap;function kt(t,e){if(!t)return!1;const n=t.fiber;n&&xt.set(n,e);const o=Nt.get(t);if(o){let t=!1;for(let n=o.length-1;n>=0;n--)try{o[n](e),t=!0;break}catch(t){e=t}if(t)return!0}return kt(t.parent,e)}function Tt(t){let{error:e}=t;e instanceof r||(e=Object.assign(new r('An error occured in the owl lifecycle (see this Error\'s "cause" property)'),{cause:e}));const n="node"in t?t.node:t.fiber.node,o="fiber"in t?t.fiber:n.fiber;if(o){let t=o;do{t.node.fiber=t,xt.set(t,e),t=t.parent}while(t);xt.set(o.root,e)}if(!kt(n,e)){console.warn("[Owl] Unhandled error. Destroying the root component");try{n.app.destroy()}catch(t){console.error(t)}throw e}}function Et(){throw new r("Attempted to render cancelled fiber")}function At(t){let e=0;for(let n of t){let t=n.node;n.render=Et,0===t.status&&t.cancel(),t.fiber=null,n.bdom?t.forceNextRender=!0:e++,e+=At(n.children)}return e}class _t{constructor(t,e){if(this.bdom=null,this.children=[],this.appliedToDom=!1,this.deep=!1,this.childrenMap={},this.node=t,this.parent=e,e){this.deep=e.deep;const t=e.root;t.setCounter(t.counter+1),this.root=t,e.children.push(this)}else this.root=this}render(){let t=this.root.node,e=t.app.scheduler,n=t.parent;for(;n;){if(n.fiber){let o=n.fiber.root;if(0!==o.counter||!(t.parentKey in n.fiber.childrenMap))return void e.delayedRenders.push(this);n=o.node}t=n,n=n.parent}this._render()}_render(){const t=this.node,e=this.root;if(e){try{this.bdom=!0,this.bdom=t.renderFn()}catch(e){t.app.handleError({node:t,error:e})}e.setCounter(e.counter-1)}}}class Ct extends _t{constructor(){super(...arguments),this.counter=1,this.willPatch=[],this.patched=[],this.mounted=[],this.locked=!1}complete(){const t=this.node;let e;this.locked=!0;let n=this.mounted;try{for(e of this.willPatch){let t=e.node;if(t.fiber===e){const e=t.component;for(let n of t.willPatch)n.call(e)}}for(e=void 0,t._patch(),this.locked=!1;e=n.pop();)if(e.appliedToDom)for(let t of e.node.mounted)t();let o=this.patched;for(;e=o.pop();)if(e.appliedToDom)for(let t of e.node.patched)t()}catch(o){for(let t of n)t.node.willUnmount=[];this.locked=!1,t.app.handleError({fiber:e||this,error:o})}}setCounter(t){this.counter=t,0===t&&this.node.app.scheduler.flush()}}class Dt extends Ct{constructor(t,e,n={}){super(t,null),this.target=e,this.position=n.position||"last-child"}complete(){let t=this;try{const e=this.node;if(e.children=this.childrenMap,e.app.constructor.validateTarget(this.target),e.bdom)e.updateDom();else if(e.bdom=this.bdom,"last-child"===this.position||0===this.target.childNodes.length)$t(e.bdom,this.target);else{const t=this.target.childNodes[0];$t(e.bdom,this.target,t)}e.fiber=null,e.status=1,this.appliedToDom=!0;let n=this.mounted;for(;t=n.pop();)if(t.appliedToDom)for(let e of t.node.mounted)e()}catch(e){this.node.app.handleError({fiber:t,error:e})}}}const St=Symbol("Key changes"),Ot=()=>{throw new Error("Called NO_CALLBACK. Owl is broken, please report this to the maintainers.")},Rt=Object.prototype.toString,Lt=Object.prototype.hasOwnProperty,Bt=["Object","Array","Set","Map","WeakMap"],Pt=["Set","Map","WeakMap"];function jt(t){return Rt.call(Ft(t)).slice(8,-1)}function Mt(t){return"object"==typeof t&&Bt.includes(jt(t))}function It(t,e){return Mt(t)?Yt(t,e):t}const Wt=new WeakSet;function Vt(t){return Wt.add(t),t}function Ft(t){return Gt.has(t)?Gt.get(t):t}const Kt=new WeakMap;function zt(t,e,n){if(n===Ot)return;Kt.get(t)||Kt.set(t,new Map);const o=Kt.get(t);o.get(e)||o.set(e,new Set),o.get(e).add(n),Ut.has(n)||Ut.set(n,new Set),Ut.get(n).add(t)}function Ht(t,e){const n=Kt.get(t);if(!n)return;const o=n.get(e);if(o)for(const t of[...o])qt(t),t()}const Ut=new WeakMap;function qt(t){const e=Ut.get(t);if(e){for(const n of e){const e=Kt.get(n);if(e)for(const[n,o]of e.entries())o.delete(t),o.size||e.delete(n)}e.clear()}}const Gt=new WeakMap,Xt=new WeakMap;function Yt(t,e=Ot){if(!Mt(t))throw new r("Cannot make the given value reactive");if(Wt.has(t))return t;if(Gt.has(t))return Yt(Gt.get(t),e);Xt.has(t)||Xt.set(t,new WeakMap);const n=Xt.get(t);if(!n.has(e)){const o=jt(t),s=Pt.includes(o)?function(t,e,n){const o=oe[n](t,e);return Object.assign(Zt(e),{get:(t,n)=>Lt.call(o,n)?o[n]:(zt(t,n,e),It(t[n],e))})}(t,e,o):Zt(e),r=new Proxy(t,s);n.set(e,r),Gt.set(r,t)}return n.get(e)}function Zt(t){return{get(e,n,o){const s=Object.getOwnPropertyDescriptor(e,n);return!s||s.writable||s.configurable?(zt(e,n,t),It(Reflect.get(e,n,o),t)):Reflect.get(e,n,o)},set(t,e,n,o){const s=Lt.call(t,e),r=Reflect.get(t,e,o),i=Reflect.set(t,e,Ft(n),o);return!s&&Lt.call(t,e)&&Ht(t,St),(r!==Reflect.get(t,e,o)||"length"===e&&Array.isArray(t))&&Ht(t,e),i},deleteProperty(t,e){const n=Reflect.deleteProperty(t,e);return Ht(t,St),Ht(t,e),n},ownKeys:e=>(zt(e,St,t),Reflect.ownKeys(e)),has:(e,n)=>(zt(e,St,t),Reflect.has(e,n))}}function Jt(t,e,n){return o=>(o=Ft(o),zt(e,o,n),It(e[t](o),n))}function Qt(t,e,n){return function*(){zt(e,St,n);const o=e.keys();for(const s of e[t]()){const t=o.next().value;zt(e,t,n),yield It(s,n)}}}function te(t,e){return function(n,o){zt(t,St,e),t.forEach((function(s,r,i){zt(t,r,e),n.call(o,It(s,e),It(r,e),It(i,e))}),o)}}function ee(t,e,n){return(o,s)=>{o=Ft(o);const r=n.has(o),i=n[e](o),l=n[t](o,s);return r!==n.has(o)&&Ht(n,St),i!==n[e](o)&&Ht(n,o),l}}function ne(t){return()=>{const e=[...t.keys()];t.clear(),Ht(t,St);for(const n of e)Ht(t,n)}}const oe={Set:(t,e)=>({has:Jt("has",t,e),add:ee("add","has",t),delete:ee("delete","has",t),keys:Qt("keys",t,e),values:Qt("values",t,e),entries:Qt("entries",t,e),[Symbol.iterator]:Qt(Symbol.iterator,t,e),forEach:te(t,e),clear:ne(t),get size(){return zt(t,St,e),t.size}}),Map:(t,e)=>({has:Jt("has",t,e),get:Jt("get",t,e),set:ee("set","get",t),delete:ee("delete","has",t),keys:Qt("keys",t,e),values:Qt("values",t,e),entries:Qt("entries",t,e),[Symbol.iterator]:Qt(Symbol.iterator,t,e),forEach:te(t,e),clear:ne(t),get size(){return zt(t,St,e),t.size}}),WeakMap:(t,e)=>({has:Jt("has",t,e),get:Jt("get",t,e),set:ee("set","get",t),delete:ee("delete","has",t)})};let se=null;function re(){if(!se)throw new r("No active component (a hook function should only be called in 'setup')");return se}function ie(t,e){for(let n in e)void 0===t[n]&&(t[n]=e[n])}const le=new WeakMap;function ae(t){const e=re();let n=le.get(e);if(!n){const t={fn:$(e.render.bind(e,!1))};n=(...e)=>t.fn(...e),le.set(e,n),e.willDestroy.push(he.bind(null,t,n))}return Yt(t,n)}const ce=()=>{};function he(t,e){t.fn=ce,qt(e)}class ue{constructor(t,e,n,o,s){this.fiber=null,this.bdom=null,this.status=0,this.forceNextRender=!1,this.nextProps=null,this.children=Object.create(null),this.refs={},this.willStart=[],this.willUpdateProps=[],this.willUnmount=[],this.mounted=[],this.willPatch=[],this.patched=[],this.willDestroy=[],se=this,this.app=n,this.parent=o,this.props=e,this.parentKey=s;const r=t.defaultProps;e=Object.assign({},e),r&&ie(e,r);const i=o&&o.childEnv||n.env;this.childEnv=i;for(const t in e){const n=e[t];n&&"object"==typeof n&&Gt.has(n)&&(e[t]=ae(n))}this.component=new t(e,i,this);const l=Object.assign(Object.create(this.component),{this:this.component});this.renderFn=n.getTemplate(t.template).bind(this.component,l,this),this.component.setup(),se=null}mountComponent(t,e){const n=new Dt(this,t,e);this.app.scheduler.addFiber(n),this.initiateRender(n)}async initiateRender(t){this.fiber=t,this.mounted.length&&t.root.mounted.push(t);const e=this.component;try{await Promise.all(this.willStart.map((t=>t.call(e))))}catch(t){return void this.app.handleError({node:this,error:t})}0===this.status&&this.fiber===t&&t.render()}async render(t){if(this.status>=2)return;let e=this.fiber;if(e&&(e.root.locked||!0===e.bdom)&&(await Promise.resolve(),e=this.fiber),e){if(!e.bdom&&!xt.has(e))return void(t&&(e.deep=t));t=t||e.deep}else if(!this.bdom)return;const n=function(t){let e=t.fiber;if(e){let t=e.root;return t.locked=!0,t.setCounter(t.counter+1-At(e.children)),t.locked=!1,e.children=[],e.childrenMap={},e.bdom=null,xt.has(e)&&(xt.delete(e),xt.delete(t),e.appliedToDom=!1,e instanceof Ct&&(e.mounted=e instanceof Dt?[e]:[])),e}const n=new Ct(t,null);return t.willPatch.length&&n.willPatch.push(n),t.patched.length&&n.patched.push(n),n}(this);n.deep=t,this.fiber=n,this.app.scheduler.addFiber(n),await Promise.resolve(),this.status>=2||this.fiber!==n||!e&&n.parent||n.render()}cancel(){this._cancel(),delete this.parent.children[this.parentKey],this.app.scheduler.scheduleDestroy(this)}_cancel(){this.status=2;const t=this.children;for(let e in t)t[e]._cancel()}destroy(){let t=1===this.status;this._destroy(),t&&this.bdom.remove()}_destroy(){const t=this.component;if(1===this.status)for(let e of this.willUnmount)e.call(t);for(let t of Object.values(this.children))t._destroy();if(this.willDestroy.length)try{for(let e of this.willDestroy)e.call(t)}catch(t){this.app.handleError({error:t,node:this})}this.status=3}async updateAndRender(t,e){this.nextProps=t,t=Object.assign({},t);const n=function(t,e){let n=t.fiber;return n&&(At(n.children),n.root=null),new _t(t,e)}(this,e);this.fiber=n;const o=this.component,s=o.constructor.defaultProps;s&&ie(t,s),se=this;for(const e in t){const n=t[e];n&&"object"==typeof n&&Gt.has(n)&&(t[e]=ae(n))}se=null;const r=Promise.all(this.willUpdateProps.map((e=>e.call(o,t))));if(await r,n!==this.fiber)return;o.props=t,n.render();const i=e.root;this.willPatch.length&&i.willPatch.push(n),this.patched.length&&i.patched.push(n)}updateDom(){if(this.fiber)if(this.bdom===this.fiber.bdom)for(let t in this.children){this.children[t].updateDom()}else this.bdom.patch(this.fiber.bdom,!1),this.fiber.appliedToDom=!0,this.fiber=null}setRef(t,e){e&&(this.refs[t]=e)}firstNode(){const t=this.bdom;return t?t.firstNode():void 0}mount(t,e){const n=this.fiber.bdom;this.bdom=n,n.mount(t,e),this.status=1,this.fiber.appliedToDom=!0,this.children=this.fiber.childrenMap,this.fiber=null}moveBeforeDOMNode(t,e){this.bdom.moveBeforeDOMNode(t,e)}moveBeforeVNode(t,e){this.bdom.moveBeforeVNode(t?t.bdom:null,e)}patch(){this.fiber&&this.fiber.parent&&(this._patch(),this.props=this.nextProps)}_patch(){let t=!1;for(let e in this.children){t=!0;break}const e=this.fiber;this.children=e.childrenMap,this.bdom.patch(e.bdom,t),e.appliedToDom=!0,this.fiber=null}beforeRemove(){this._destroy()}remove(){this.bdom.remove()}get name(){return this.component.constructor.name}get subscriptions(){const t=le.get(this);return t?(e=t,[...Ut.get(e)||[]].map((t=>{const n=Kt.get(t);let o=[];if(n)for(const[t,s]of n)s.has(e)&&o.push(t);return{target:t,keys:o}}))):[];var e}}const de=Symbol("timeout"),fe={onWillStart:3e3,onWillUpdateProps:3e3};function pe(t,e){const n=new r,o=new r,s=re();return(...r)=>{const i=t=>{throw n.cause=t,n.message=t instanceof Error?`The following error occurred in ${e}: "${t.message}"`:`Something that is not an Error was thrown in ${e} (see this Error's "cause" property)`,n};let l;try{l=t(...r)}catch(t){i(t)}if(!(l instanceof Promise))return l;const a=fe[e];if(a){const t=s.fiber;Promise.race([l.catch((()=>{})),new Promise((t=>setTimeout((()=>t(de)),a)))]).then((n=>{n===de&&s.fiber===t&&s.status<=2&&(o.message=`${e}'s promise hasn't resolved after ${a/1e3} seconds`,console.log(o))}))}return l.catch(i)}}function me(t){const e=re(),n=e.app.dev?pe:t=>t;e.mounted.push(n(t.bind(e.component),"onMounted"))}function ge(t){const e=re(),n=e.app.dev?pe:t=>t;e.patched.push(n(t.bind(e.component),"onPatched"))}function be(t){const e=re(),n=e.app.dev?pe:t=>t;e.willUnmount.unshift(n(t.bind(e.component),"onWillUnmount"))}class ve{constructor(t,e,n){this.props=t,this.env=e,this.__owl__=n}setup(){}render(t=!1){this.__owl__.render(!0===t)}}ve.template="";const ye=z("").constructor;class we extends ye{constructor(t,e){super(""),this.target=null,this.selector=t,this.content=e}mount(t,e){super.mount(t,e),this.target=document.querySelector(this.selector),this.target?this.content.mount(this.target,null):this.content.mount(t,e)}beforeRemove(){this.content.beforeRemove()}remove(){this.content&&(super.remove(),this.content.remove(),this.content=null)}patch(t){super.patch(t),this.content?this.content.patch(t.content,!0):(this.content=t.content,this.content.mount(this.target,null))}}class $e extends ve{setup(){const t=this.__owl__;me((()=>{const e=t.bdom;if(!e.target){const t=document.querySelector(this.props.target);if(!t)throw new r("invalid portal target");e.content.moveBeforeDOMNode(t.firstChild,t)}})),be((()=>{t.bdom.remove()}))}}$e.template="__portal__",$e.props={target:{type:String},slots:!0};const xe=t=>Array.isArray(t),Ne=t=>"object"!=typeof t,ke=t=>"object"==typeof t&&t&&"value"in t;function Te(t){return"object"==typeof t&&"optional"in t&&t.optional||!1}function Ee(t){return"*"===t||!0===t?"value":t.name.toLowerCase()}function Ae(t){return Ne(t)?Ee(t):xe(t)?t.map(Ae).join(" or "):ke(t)?String(t.value):"element"in t?`list of ${Ae({type:t.element,optional:!1})}s`:"shape"in t?"object":Ae(t.type||"*")}function _e(t,e){var n;Array.isArray(e)&&(n=e,e=Object.fromEntries(n.map((t=>t.endsWith("?")?[t.slice(0,-1),{optional:!0}]:[t,{type:"*",optional:!1}])))),t=Ft(t);let o=[];for(let n in t)if(n in e){let s=Ce(n,t[n],e[n]);s&&o.push(s)}else"*"in e||o.push(`unknown key '${n}'`);for(let n in e){const s=e[n];if("*"!==n&&!Te(s)&&!(n in t)){const t="object"==typeof s&&!Array.isArray(s);let e="*"===s||(t&&"type"in s?"*"===s.type:t)?"":` (should be a ${Ae(s)})`;o.push(`'${n}' is missing${e}`)}}return o}function Ce(t,e,n){if(void 0===e)return Te(n)?null:`'${t}' is undefined (should be a ${Ae(n)})`;if(Ne(n))return function(t,e,n){if("function"==typeof n)if("object"==typeof e){if(!(e instanceof n))return`'${t}' is not a ${Ee(n)}`}else if(typeof e!==n.name.toLowerCase())return`'${t}' is not a ${Ee(n)}`;return null}(t,e,n);if(ke(n))return e===n.value?null:`'${t}' is not equal to '${n.value}'`;if(xe(n)){let o=n.find((n=>!Ce(t,e,n)));return o?null:`'${t}' is not a ${Ae(n)}`}let o=null;if("element"in n)o=function(t,e,n){if(!Array.isArray(e))return`'${t}' is not a list of ${Ae(n)}s`;for(let o=0;o<e.length;o++){const s=Ce(`${t}[${o}]`,e[o],n);if(s)return s}return null}(t,e,n.element);else if("shape"in n)if("object"!=typeof e||Array.isArray(e))o=`'${t}' is not an object`;else{const s=_e(e,n.shape);s.length&&(o=`'${t}' doesn't have the correct shape (${s.join(", ")})`)}else if("values"in n)if("object"!=typeof e||Array.isArray(e))o=`'${t}' is not an object`;else{const s=Object.entries(e).map((([t,e])=>Ce(t,e,n.values))).filter(Boolean);s.length&&(o=`some of the values in '${t}' are invalid (${s.join(", ")})`)}return"type"in n&&!o&&(o=Ce(t,e,n.type)),"validate"in n&&!o&&(o=n.validate(e)?null:`'${t}' is not valid`),o}const De=Object.create;function Se(t){const e=De(t);for(let n in t)e[n]=t[n];return e}const Oe=Symbol("isBoundary");class Re{constructor(t,e,n,o,s){this.fn=t,this.ctx=Se(e),this.component=n,this.node=o,this.key=s}evaluate(){return this.fn.call(this.component,this.ctx,this.node,this.key)}toString(){return this.evaluate().toString()}}function Le(t,e,n){const o="string"!=typeof t?t:n.constructor.components[t];if(!o)return;const s=o.props;if(!s)return void(n.__owl__.app.warnIfNoStaticProps&&console.warn(`Component '${o.name}' does not have a static props description`));const i=o.defaultProps;if(i){let t=t=>Array.isArray(s)?s.includes(t):t in s&&!("*"in s)&&!Te(s[t]);for(let e in i)if(t(e))throw new r(`A default value cannot be defined for a mandatory prop (name: '${e}', component: ${o.name})`)}const l=_e(e,s);if(l.length)throw new r(`Invalid props for component '${o.name}': `+l.join(", "))}const Be={withDefault:function(t,e){return null==t||!1===t?e:t},zero:Symbol("zero"),isBoundary:Oe,callSlot:function(t,e,n,o,r,i,l){n=n+"__slot_"+o;const a=t.props.slots||{},{__render:c,__ctx:h,__scope:u}=a[o]||{},d=De(h||{});u&&(d[u]=i);const f=c?c(d,e,n):null;if(l){let i,a;return f?i=r?s(o,f):f:a=l(t,e,n),j([i,a])}return f||z("")},capture:Se,withKey:function(t,e){return t.key=e,t},prepareList:function(t){let e,n;if(Array.isArray(t))e=t,n=t;else if(t instanceof Map)e=[...t.keys()],n=[...t.values()];else if(Symbol.iterator in Object(t))e=[...t],n=e;else{if(!t||"object"!=typeof t)throw new r(`Invalid loop expression: "${t}" is not iterable`);n=Object.values(t),e=Object.keys(t)}const o=n.length;return[e,n,o,new Array(o)]},setContextValue:function(t,e,n){const o=t;for(;!t.hasOwnProperty(e)&&!t.hasOwnProperty(Oe);){const e=t.__proto__;if(!e){t=o;break}t=e}t[e]=n},shallowEqual:function(t,e){for(let n=0,o=t.length;n<o;n++)if(t[n]!==e[n])return!1;return!0},toNumber:function(t){const e=parseFloat(t);return isNaN(e)?t:e},validateProps:Le,LazyValue:Re,safeOutput:function(t,e){if(null==t)return e?s("default",e):s("undefined",z(""));let n,o;switch(typeof t){case"object":t instanceof k?(n="string_safe",o=wt(t)):t instanceof Re?(n="lazy_value",o=t.evaluate()):t instanceof String?(n="string_unsafe",o=z(t)):(n="block_safe",o=t);break;case"string":n="string_unsafe",o=z(t);break;default:n="string_unsafe",o=z(String(t))}return s(n,o)},createCatcher:function(t){const e=Object.keys(t).length;class n{constructor(t,e){this.handlerFns=[],this.afterNode=null,this.child=t,this.handlerData=e}mount(e,n){this.parentEl=e,this.child.mount(e,n),this.afterNode=document.createTextNode(""),e.insertBefore(this.afterNode,n),this.wrapHandlerData();for(let n in t){const o=t[n],s=A(n);this.handlerFns[o]=s,s.setup.call(e,this.handlerData[o])}}wrapHandlerData(){for(let t=0;t<e;t++){let e=this.handlerData[t],n=e.length-2,o=e[n];const s=this;e[n]=function(t){const e=t.target;let n=s.child.firstNode();const r=s.afterNode;for(;n&&n!==r;){if(n.contains(e))return o.call(this,t);n=n.nextSibling}}}}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,this.child.moveBeforeDOMNode(t,e),e.insertBefore(this.afterNode,t)}moveBeforeVNode(t,e){t&&(e=t.firstNode()||e),this.child.moveBeforeVNode(t?t.child:null,e),this.parentEl.insertBefore(this.afterNode,e)}patch(t,n){if(this!==t){this.handlerData=t.handlerData,this.wrapHandlerData();for(let t=0;t<e;t++)this.handlerFns[t].update.call(this.parentEl,this.handlerData[t]);this.child.patch(t.child,n)}}beforeRemove(){this.child.beforeRemove()}remove(){for(let t=0;t<e;t++)this.handlerFns[t].remove.call(this.parentEl);this.child.remove(),this.afterNode.remove()}firstNode(){return this.child.firstNode()}toString(){return this.child.toString()}}return function(t,e){return new n(t,e)}},markRaw:Vt,OwlError:r,makeRefWrapper:function(t){let e=new Set;return(n,o)=>{if(e.has(n))throw new r(`Cannot set the same ref more than once in the same component, ref "${n}" was set multiple times in ${t.name}`);return e.add(n),o}}};function Pe(t){const e=(new DOMParser).parseFromString(t,"text/xml");if(e.getElementsByTagName("parsererror").length){let n="Invalid XML in template.";const o=e.getElementsByTagName("parsererror")[0].textContent;if(o){n+="\nThe parser has produced the following error message:\n"+o;const e=/\d+/g,s=e.exec(o);if(s){const r=Number(s[0]),i=t.split("\n")[r-1],l=e.exec(o);if(i&&l){const t=Number(l[0])-1;i[t]&&(n+=`\nThe error might be located at xml line ${r} column ${t}\n${i}\n${"-".repeat(t-1)}^`)}}}throw new r(n)}return e}const je={text:z,createBlock:nt,list:bt,multi:j,html:wt,toggler:s,comment:H};class Me{constructor(t={}){if(this.rawTemplates=Object.create(Ie),this.templates={},this.Portal=$e,this.dev=t.dev||!1,this.translateFn=t.translateFn,this.translatableAttributes=t.translatableAttributes,t.templates)if(t.templates instanceof Document||"string"==typeof t.templates)this.addTemplates(t.templates);else for(const e in t.templates)this.addTemplate(e,t.templates[e]);this.getRawTemplate=t.getTemplate,this.customDirectives=t.customDirectives||{},this.runtimeUtils={...Be,__globals__:t.globalValues||{}},this.hasGlobalValues=Boolean(t.globalValues&&Object.keys(t.globalValues).length)}static registerTemplate(t,e){Ie[t]=e}addTemplate(t,e){if(t in this.rawTemplates){if(!this.dev)return;const n=this.rawTemplates[t];if(("string"==typeof n?n:n instanceof Element?n.outerHTML:n.toString())===("string"==typeof e?e:e.outerHTML))return;throw new r(`Template ${t} already defined with different content`)}this.rawTemplates[t]=e}addTemplates(t){if(t){t=t instanceof Document?t:Pe(t);for(const e of t.querySelectorAll("[t-name]")){const t=e.getAttribute("t-name");this.addTemplate(t,e)}}}getTemplate(t){var e;if(!(t in this.templates)){const n=(null===(e=this.getRawTemplate)||void 0===e?void 0:e.call(this,t))||this.rawTemplates[t];if(void 0===n){let e="";try{e=` (for component "${re().component.constructor.name}")`}catch{}throw new r(`Missing template: "${t}"${e}`)}const o="function"==typeof n&&!(n instanceof Element)?n:this._compileTemplate(t,n),s=this.templates;this.templates[t]=function(e,n){return s[t].call(this,e,n)};const i=o(this,je,this.runtimeUtils);this.templates[t]=i}return this.templates[t]}_compileTemplate(t,e){throw new r("Unable to compile a template. Please use owl full build instead")}callTemplate(t,e,n,o,r){return s(e,this.getTemplate(e).call(t,n,o,r+e))}}const Ie={};function We(...t){const e="__template__"+We.nextId++,n=String.raw(...t);return Ie[e]=n,e}We.nextId=1,Me.registerTemplate("__portal__",(function(t,e,n){let{callSlot:o}=n;return function(t,e,n=""){return new we(t.props.target,o(t,e,n,"default",!1,null))}}));const Ve="true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,eval,void,Math,RegExp,Array,Object,Date,__globals__".split(","),Fe=Object.assign(Object.create(null),{and:"&&",or:"||",gt:">",gte:">=",lt:"<",lte:"<="}),Ke=Object.assign(Object.create(null),{"{":"LEFT_BRACE","}":"RIGHT_BRACE","[":"LEFT_BRACKET","]":"RIGHT_BRACKET",":":"COLON",",":"COMMA","(":"LEFT_PAREN",")":"RIGHT_PAREN"}),ze="...,.,===,==,+,!==,!=,!,||,&&,>=,>,<=,<,?,-,*,/,%,typeof ,=>,=,;,in ,new ,|,&,^,~".split(",");const He=[function(t){let e=t[0],n=e;if("'"!==e&&'"'!==e&&"`"!==e)return!1;let o,s=1;for(;t[s]&&t[s]!==n;){if(o=t[s],e+=o,"\\"===o){if(s++,o=t[s],!o)throw new r("Invalid expression");e+=o}s++}if(t[s]!==n)throw new r("Invalid expression");return e+=n,"`"===n?{type:"TEMPLATE_STRING",value:e,replace:t=>e.replace(/\$\{(.*?)\}/g,((e,n)=>"${"+t(n)+"}"))}:{type:"VALUE",value:e}},function(t){let e=t[0];if(e&&e.match(/[0-9]/)){let n=1;for(;t[n]&&t[n].match(/[0-9]|\./);)e+=t[n],n++;return{type:"VALUE",value:e}}return!1},function(t){for(let e of ze)if(t.startsWith(e))return{type:"OPERATOR",value:e};return!1},function(t){let e=t[0];if(e&&e.match(/[a-zA-Z_\$]/)){let n=1;for(;t[n]&&t[n].match(/\w/);)e+=t[n],n++;return e in Fe?{type:"OPERATOR",value:Fe[e],size:e.length}:{type:"SYMBOL",value:e}}return!1},function(t){const e=t[0];return!(!e||!(e in Ke))&&{type:Ke[e],value:e}}];const Ue=t=>t&&("LEFT_BRACE"===t.type||"COMMA"===t.type),qe=t=>t&&("RIGHT_BRACE"===t.type||"COMMA"===t.type);function Ge(t){const e=new Set,n=function(t){const e=[];let n,o=!0,s=t;try{for(;o;)if(s=s.trim(),s){for(let t of He)if(o=t(s),o){e.push(o),s=s.slice(o.size||o.value.length);break}}else o=!1}catch(t){n=t}if(s.length||n)throw new r(`Tokenizer error: could not tokenize \`${t}\``);return e}(t);let o=0,s=[];for(;o<n.length;){let t=n[o],r=n[o-1],i=n[o+1],l=s[s.length-1];switch(t.type){case"LEFT_BRACE":case"LEFT_BRACKET":case"LEFT_PAREN":s.push(t.type);break;case"RIGHT_BRACE":case"RIGHT_BRACKET":case"RIGHT_PAREN":s.pop()}let a="SYMBOL"===t.type&&!Ve.includes(t.value);if("SYMBOL"!==t.type||Ve.includes(t.value)||r&&("LEFT_BRACE"===l&&Ue(r)&&qe(i)&&(n.splice(o+1,0,{type:"COLON",value:":"},{...t}),i=n[o+1]),"OPERATOR"===r.type&&"."===r.value?a=!1:"LEFT_BRACE"!==r.type&&"COMMA"!==r.type||i&&"COLON"===i.type&&(a=!1)),"TEMPLATE_STRING"===t.type&&(t.value=t.replace((t=>Ye(t)))),i&&"OPERATOR"===i.type&&"=>"===i.value)if("RIGHT_PAREN"===t.type){let t=o-1;for(;t>0&&"LEFT_PAREN"!==n[t].type;)"SYMBOL"===n[t].type&&n[t].originalValue&&(n[t].value=n[t].originalValue,e.add(n[t].value)),t--}else e.add(t.value);a&&(t.varName=t.value,e.has(t.value)||(t.originalValue=t.value,t.value=`ctx['${t.value}']`)),o++}for(const t of n)"SYMBOL"===t.type&&t.varName&&e.has(t.value)&&(t.originalValue=t.value,t.value=`_${t.value}`,t.isLocal=!0);return n}const Xe=new Map([["in "," in "]]);function Ye(t){return Ge(t).map((t=>Xe.get(t.value)||t.value)).join("")}const Ze=/\{\{.*?\}\}|\#\{.*?\}/g;function Je(t,e){let n=t.match(Ze);if(n&&n[0].length===t.length)return`(${e(t.slice(2,"{"===n[0][0]?-2:-1))})`;let o=t.replace(Ze,(t=>"${"+e(t.slice(2,"{"===t[0]?-2:-1))+"}"));return"`"+o+"`"}function Qe(t){return Je(t,Ye)}const tn=/\s+/g;let en;"undefined"!=typeof document&&(en=document.implementation.createDocument(null,null,null));const nn=new Set(["stop","capture","prevent","self","synthetic"]);let on={};function sn(t=""){return on[t]=(on[t]||0)+1,t+on[t]}function rn(t,e){switch(t){case"input":return"checked"===e||"indeterminate"===e||"value"===e||"readonly"===e||"readOnly"===e||"disabled"===e;case"option":return"selected"===e||"disabled"===e;case"textarea":return"value"===e||"readonly"===e||"readOnly"===e||"disabled"===e;case"select":return"value"===e||"disabled"===e;case"button":case"optgroup":return"disabled"===e}return!1}function ln(t){return`\`${t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/,"\\${")}\``}class an{constructor(t,e){this.dynamicTagName=null,this.isRoot=!1,this.hasDynamicChildren=!1,this.children=[],this.data=[],this.childNumber=0,this.parentVar="",this.id=an.nextBlockId++,this.varName="b"+this.id,this.blockName="block"+this.id,this.target=t,this.type=e}insertData(t,e="d"){const n=sn(e);return this.target.addLine(`let ${n} = ${t};`),this.data.push(n)-1}insert(t){this.currentDom?this.currentDom.appendChild(t):this.dom=t}generateExpr(t){if("block"===this.type){const t=this.children.length;let e=this.data.length?`[${this.data.join(", ")}]`:t?"[]":"";return t&&(e+=", ["+this.children.map((t=>t.varName)).join(", ")+"]"),this.dynamicTagName?`toggler(${this.dynamicTagName}, ${this.blockName}(${this.dynamicTagName})(${e}))`:`${this.blockName}(${e})`}return"list"===this.type?`list(c_block${this.id})`:t}asXmlString(){const t=en.createElement("t");return t.appendChild(this.dom),t.innerHTML}}function cn(t,e){return Object.assign({block:null,index:0,forceNewBlock:!0,translate:t.translate,translationCtx:t.translationCtx,tKeyExpr:null,nameSpace:t.nameSpace,tModelSelectedExpr:t.tModelSelectedExpr},e)}an.nextBlockId=1;class hn{constructor(t,e){this.indentLevel=0,this.loopLevel=0,this.code=[],this.hasRoot=!1,this.hasCache=!1,this.shouldProtectScope=!1,this.hasRefWrapper=!1,this.name=t,this.on=e||null}addLine(t,e){const n=new Array(this.indentLevel+2).join(" ");void 0===e?this.code.push(n+t):this.code.splice(e,0,n+t)}generateCode(){let t=[];t.push(`function ${this.name}(ctx, node, key = "") {`),this.shouldProtectScope&&(t.push(" ctx = Object.create(ctx);"),t.push(" ctx[isBoundary] = 1")),this.hasRefWrapper&&t.push(" let refWrapper = makeRefWrapper(this.__owl__);"),this.hasCache&&(t.push(" let cache = ctx.cache || {};"),t.push(" let nextCache = ctx.cache = {};"));for(let e of this.code)t.push(e);return this.hasRoot||t.push("return text('');"),t.push("}"),t.join("\n ")}currentKey(t){let e=this.loopLevel?`key${this.loopLevel}`:"key";return t.tKeyExpr&&(e=`${t.tKeyExpr} + ${e}`),e}}const un=["alt","aria-label","aria-placeholder","aria-roledescription","aria-valuetext","label","placeholder","title"],dn=/^(\s*)([\s\S]+?)(\s*)$/;class fn{constructor(t,e){if(this.blocks=[],this.nextBlockId=1,this.isDebug=!1,this.targets=[],this.target=new hn("template"),this.translatableAttributes=un,this.staticDefs=[],this.slotNames=new Set,this.helpers=new Set,this.translateFn=e.translateFn||(t=>t),e.translatableAttributes){const t=new Set(un);for(let n of e.translatableAttributes)n.startsWith("-")?t.delete(n.slice(1)):t.add(n);this.translatableAttributes=[...t]}this.hasSafeContext=e.hasSafeContext||!1,this.dev=e.dev||!1,this.ast=t,this.templateName=e.name,e.hasGlobalValues&&this.helpers.add("__globals__")}generateCode(){const t=this.ast;this.isDebug=12===t.type,an.nextBlockId=1,on={},this.compileAST(t,{block:null,index:0,forceNewBlock:!1,isLast:!0,translate:!0,translationCtx:"",tKeyExpr:null});let e=[" let { text, createBlock, list, multi, html, toggler, comment } = bdom;"];this.helpers.size&&e.push(`let { ${[...this.helpers].join(", ")} } = helpers;`),this.templateName&&e.push(`// Template name: "${this.templateName}"`);for(let{id:t,expr:n}of this.staticDefs)e.push(`const ${t} = ${n};`);if(this.blocks.length){e.push("");for(let t of this.blocks)if(t.dom){let n=ln(t.asXmlString());t.dynamicTagName?(n=n.replace(/^`<\w+/,`\`<\${tag || '${t.dom.nodeName}'}`),n=n.replace(/\w+>`$/,`\${tag || '${t.dom.nodeName}'}>\``),e.push(`let ${t.blockName} = tag => createBlock(${n});`)):e.push(`let ${t.blockName} = createBlock(${n});`)}}if(this.targets.length)for(let t of this.targets)e.push(""),e=e.concat(t.generateCode());e.push(""),e=e.concat("return "+this.target.generateCode());const n=e.join("\n ");if(this.isDebug){const t=`[Owl Debug]\n${n}`;console.log(t)}return n}compileInNewTarget(t,e,n,o){const s=sn(t),r=this.target,i=new hn(s,o);return this.targets.push(i),this.target=i,this.compileAST(e,cn(n)),this.target=r,s}addLine(t,e){this.target.addLine(t,e)}define(t,e){this.addLine(`const ${t} = ${e};`)}insertAnchor(t,e=t.children.length){const n=`block-child-${e}`,o=en.createElement(n);t.insert(o)}createBlock(t,e,n){const o=this.target.hasRoot,s=new an(this.target,e);return o||(this.target.hasRoot=!0,s.isRoot=!0),t&&(t.children.push(s),"list"===t.type&&(s.parentVar=`c_block${t.id}`)),s}insertBlock(t,e,n){let o=e.generateExpr(t);if(e.parentVar){let t=this.target.currentKey(n);return this.helpers.add("withKey"),void this.addLine(`${e.parentVar}[${n.index}] = withKey(${o}, ${t});`)}n.tKeyExpr&&(o=`toggler(${n.tKeyExpr}, ${o})`),e.isRoot?(this.target.on&&(o=this.wrapWithEventCatcher(o,this.target.on)),this.addLine(`return ${o};`)):this.define(e.varName,o)}captureExpression(t,e=!1){if(!e&&!t.includes("=>"))return Ye(t);const n=Ge(t),o=new Map;return n.map((t=>{if(t.varName&&!t.isLocal){if(!o.has(t.varName)){const e=sn("v");o.set(t.varName,e),this.define(e,t.value)}t.value=o.get(t.varName)}return t.value})).join("")}translate(t,e){const n=dn.exec(t);return n[1]+this.translateFn(n[2],e)+n[3]}compileAST(t,e){switch(t.type){case 1:return this.compileComment(t,e);case 0:return this.compileText(t,e);case 2:return this.compileTDomNode(t,e);case 4:return this.compileTEsc(t,e);case 8:return this.compileTOut(t,e);case 5:return this.compileTIf(t,e);case 9:return this.compileTForeach(t,e);case 10:return this.compileTKey(t,e);case 3:return this.compileMulti(t,e);case 7:return this.compileTCall(t,e);case 15:return this.compileTCallBlock(t,e);case 6:return this.compileTSet(t,e);case 11:return this.compileComponent(t,e);case 12:return this.compileDebug(t,e);case 13:return this.compileLog(t,e);case 14:return this.compileTSlot(t,e);case 16:return this.compileTTranslation(t,e);case 17:return this.compileTTranslationContext(t,e);case 18:return this.compileTPortal(t,e)}}compileDebug(t,e){return this.addLine("debugger;"),t.content?this.compileAST(t.content,e):null}compileLog(t,e){return this.addLine(`console.log(${Ye(t.expr)});`),t.content?this.compileAST(t.content,e):null}compileComment(t,e){let{block:n,forceNewBlock:o}=e;if(!n||o)n=this.createBlock(n,"comment",e),this.insertBlock(`comment(${ln(t.value)})`,n,{...e,forceNewBlock:o&&!n});else{const e=en.createComment(t.value);n.insert(e)}return n.varName}compileText(t,e){let{block:n,forceNewBlock:o}=e,s=t.value;if(s&&!1!==e.translate&&(s=this.translate(s,e.translationCtx)),e.inPreTag||(s=s.replace(tn," ")),!n||o)n=this.createBlock(n,"text",e),this.insertBlock(`text(${ln(s)})`,n,{...e,forceNewBlock:o&&!n});else{const e=0===t.type?en.createTextNode:en.createComment;n.insert(e.call(en,s))}return n.varName}generateHandlerCode(t,e){const n=t.split(".").slice(1).map((t=>{if(!nn.has(t))throw new r(`Unknown event modifier: '${t}'`);return`"${t}"`}));let o="";return n.length&&(o=`${n.join(",")}, `),`[${o}${this.captureExpression(e)}, ctx]`}compileTDomNode(t,e){var n;let{block:o,forceNewBlock:s}=e;const r=!o||s||null!==t.dynamicTag||t.ns;let i=this.target.code.length;if(r&&((t.dynamicTag||e.tKeyExpr||t.ns)&&e.block&&this.insertAnchor(e.block),o=this.createBlock(o,"block",e),this.blocks.push(o),t.dynamicTag)){const e=sn("tag");this.define(e,Ye(t.dynamicTag)),o.dynamicTagName=e}const l={};for(let s in t.attrs){let r,i;if(s.startsWith("t-attf")){r=Qe(t.attrs[s]);const e=o.insertData(r,"attr");i=s.slice(7),l["block-attribute-"+e]=i}else if(s.startsWith("t-att"))if(i="t-att"===s?null:s.slice(6),r=Ye(t.attrs[s]),i&&rn(t.tag,i)){"readonly"===i&&(i="readOnly"),r="value"===i?`new String((${r}) === 0 ? 0 : ((${r}) || ""))`:`new Boolean(${r})`;l[`block-property-${o.insertData(r,"prop")}`]=i}else{const t=o.insertData(r,"attr");"t-att"===s?l["block-attributes"]=String(t):l[`block-attribute-${t}`]=i}else if(this.translatableAttributes.includes(s)){const o=(null===(n=t.attrsTranslationCtx)||void 0===n?void 0:n[s])||e.translationCtx;l[s]=this.translateFn(t.attrs[s],o)}else r=`"${t.attrs[s]}"`,i=s,l[s]=t.attrs[s];if("value"===i&&e.tModelSelectedExpr){l[`block-attribute-${o.insertData(`${e.tModelSelectedExpr} === ${r}`,"attr")}`]="selected"}}let a;if(t.model){const{hasDynamicChildren:e,baseExpr:n,expr:s,eventType:r,shouldNumberize:i,shouldTrim:c,targetAttr:h,specialInitTargetAttr:u}=t.model,d=Ye(n),f=sn("bExpr");this.define(f,d);const p=Ye(s),m=sn("expr");this.define(m,p);const g=`${f}[${m}]`;let b;if(u){let e=h in l&&`'${l[h]}'`;if(!e&&t.attrs){const n=t.attrs[`t-att-${h}`];n&&(e=Ye(n))}b=o.insertData(`${g} === ${e}`,"prop"),l[`block-property-${b}`]=u}else if(e){a=`${sn("bValue")}`,this.define(a,g)}else b=o.insertData(`${g}`,"prop"),l[`block-property-${b}`]=h;this.helpers.add("toNumber");let v=`ev.target.${h}`;v=c?`${v}.trim()`:v,v=i?`toNumber(${v})`:v;const y=`[(ev) => { ${g} = ${v}; }]`;b=o.insertData(y,"hdlr"),l[`block-handler-${b}`]=r}for(let e in t.on){const n=this.generateHandlerCode(e,t.on[e]);l[`block-handler-${o.insertData(n,"hdlr")}`]=e}if(t.ref){this.dev&&(this.helpers.add("makeRefWrapper"),this.target.hasRefWrapper=!0);const e=Ze.test(t.ref);let n=`\`${t.ref}\``;e&&(n=Je(t.ref,(t=>this.captureExpression(t,!0))));let s=`(el) => this.__owl__.setRef((${n}), el)`;this.dev&&(s=`refWrapper(${n}, ${s})`);const r=o.insertData(s,"ref");l["block-ref"]=String(r)}const c=t.ns||e.nameSpace,h=c?en.createElementNS(c,t.tag):en.createElement(t.tag);for(const[t,e]of Object.entries(l))"class"===t&&""===e||h.setAttribute(t,e);if(o.insert(h),t.content.length){const n=o.currentDom;o.currentDom=h;const s=t.content;for(let n=0;n<s.length;n++){const r=t.content[n],i=cn(e,{block:o,index:o.childNumber,forceNewBlock:!1,isLast:e.isLast&&n===s.length-1,tKeyExpr:e.tKeyExpr,nameSpace:c,tModelSelectedExpr:a,inPreTag:e.inPreTag||"pre"===t.tag});this.compileAST(r,i)}o.currentDom=n}if(r&&(this.insertBlock(`${o.blockName}(ddd)`,o,e),o.children.length&&o.hasDynamicChildren)){const t=this.target.code,e=o.children.slice();let n=e.shift();for(let o=i;o<t.length&&(!t[o].trimStart().startsWith(`const ${n.varName} `)||(t[o]=t[o].replace(`const ${n.varName}`,n.varName),n=e.shift(),n));o++);this.addLine(`let ${o.children.map((t=>t.varName)).join(", ")};`,i)}return o.varName}compileTEsc(t,e){let n,{block:o,forceNewBlock:s}=e;if("0"===t.expr?(this.helpers.add("zero"),n="ctx[zero]"):(n=Ye(t.expr),t.defaultValue&&(this.helpers.add("withDefault"),n=`withDefault(${n}, ${ln(t.defaultValue)})`)),!o||s)o=this.createBlock(o,"text",e),this.insertBlock(`text(${n})`,o,{...e,forceNewBlock:s&&!o});else{const t=o.insertData(n,"txt"),e=en.createElement(`block-text-${t}`);o.insert(e)}return o.varName}compileTOut(t,e){let n,{block:o}=e;if(o&&this.insertAnchor(o),o=this.createBlock(o,"html",e),"0"===t.expr)this.helpers.add("zero"),n="ctx[zero]";else if(t.body){let o=null;o=an.nextBlockId;const s=cn(e);this.compileAST({type:3,content:t.body},s),this.helpers.add("safeOutput"),n=`safeOutput(${Ye(t.expr)}, b${o})`}else this.helpers.add("safeOutput"),n=`safeOutput(${Ye(t.expr)})`;return this.insertBlock(n,o,e),o.varName}compileTIfBranch(t,e,n){this.target.indentLevel++;let o=e.children.length;this.compileAST(t,cn(n,{block:e,index:n.index})),e.children.length>o&&this.insertAnchor(e,o),this.target.indentLevel--}compileTIf(t,e,n){let{block:o,forceNewBlock:s}=e;const r=this.target.code.length,i=!o||"multi"!==o.type&&s;if(o&&(o.hasDynamicChildren=!0),(!o||"multi"!==o.type&&s)&&(o=this.createBlock(o,"multi",e)),this.addLine(`if (${Ye(t.condition)}) {`),this.compileTIfBranch(t.content,o,e),t.tElif)for(let n of t.tElif)this.addLine(`} else if (${Ye(n.condition)}) {`),this.compileTIfBranch(n.content,o,e);if(t.tElse&&(this.addLine("} else {"),this.compileTIfBranch(t.tElse,o,e)),this.addLine("}"),i){if(o.children.length){const t=this.target.code,e=o.children.slice();let n=e.shift();for(let o=r;o<t.length&&(!t[o].trimStart().startsWith(`const ${n.varName} `)||(t[o]=t[o].replace(`const ${n.varName}`,n.varName),n=e.shift(),n));o++);this.addLine(`let ${o.children.map((t=>t.varName)).join(", ")};`,r)}const t=o.children.map((t=>t.varName)).join(", ");this.insertBlock(`multi([${t}])`,o,e)}return o.varName}compileTForeach(t,e){let{block:n}=e;n&&this.insertAnchor(n),n=this.createBlock(n,"list",e),this.target.loopLevel++;const o=`i${this.target.loopLevel}`;this.addLine("ctx = Object.create(ctx);");const s=`v_block${n.id}`,r=`k_block${n.id}`,i=`l_block${n.id}`,l=`c_block${n.id}`;let a;this.helpers.add("prepareList"),this.define(`[${r}, ${s}, ${i}, ${l}]`,`prepareList(${Ye(t.collection)});`),this.dev&&this.define(`keys${n.id}`,"new Set()"),this.addLine(`for (let ${o} = 0; ${o} < ${i}; ${o}++) {`),this.target.indentLevel++,this.addLine(`ctx[\`${t.elem}\`] = ${r}[${o}];`),t.hasNoFirst||this.addLine(`ctx[\`${t.elem}_first\`] = ${o} === 0;`),t.hasNoLast||this.addLine(`ctx[\`${t.elem}_last\`] = ${o} === ${r}.length - 1;`),t.hasNoIndex||this.addLine(`ctx[\`${t.elem}_index\`] = ${o};`),t.hasNoValue||this.addLine(`ctx[\`${t.elem}_value\`] = ${s}[${o}];`),this.define(`key${this.target.loopLevel}`,t.key?Ye(t.key):o),this.dev&&(this.helpers.add("OwlError"),this.addLine(`if (keys${n.id}.has(String(key${this.target.loopLevel}))) { throw new OwlError(\`Got duplicate key in t-foreach: \${key${this.target.loopLevel}}\`)}`),this.addLine(`keys${n.id}.add(String(key${this.target.loopLevel}));`)),t.memo&&(this.target.hasCache=!0,a=sn(),this.define(`memo${a}`,Ye(t.memo)),this.define(`vnode${a}`,`cache[key${this.target.loopLevel}];`),this.addLine(`if (vnode${a}) {`),this.target.indentLevel++,this.addLine(`if (shallowEqual(vnode${a}.memo, memo${a})) {`),this.target.indentLevel++,this.addLine(`${l}[${o}] = vnode${a};`),this.addLine(`nextCache[key${this.target.loopLevel}] = vnode${a};`),this.addLine("continue;"),this.target.indentLevel--,this.addLine("}"),this.target.indentLevel--,this.addLine("}"));const c=cn(e,{block:n,index:o});return this.compileAST(t.body,c),t.memo&&this.addLine(`nextCache[key${this.target.loopLevel}] = Object.assign(${l}[${o}], {memo: memo${a}});`),this.target.indentLevel--,this.target.loopLevel--,this.addLine("}"),e.isLast||this.addLine("ctx = ctx.__proto__;"),this.insertBlock("l",n,e),n.varName}compileTKey(t,e){const n=sn("tKey_");return this.define(n,Ye(t.expr)),e=cn(e,{tKeyExpr:n,block:e.block,index:e.index}),this.compileAST(t.content,e)}compileMulti(t,e){let{block:n,forceNewBlock:o}=e;const s=!n||o;let r=this.target.code.length;if(s){let o=null;if(t.content.filter((t=>!t.hasNoRepresentation)).length<=1){for(let n of t.content){const t=this.compileAST(n,e);o=o||t}return o}n=this.createBlock(n,"multi",e)}let i=0;for(let o=0,s=t.content.length;o<s;o++){const r=t.content[o],l=!r.hasNoRepresentation,a=cn(e,{block:n,index:i,forceNewBlock:l,isLast:e.isLast&&o===s-1});this.compileAST(r,a),l&&i++}if(s){if(n.hasDynamicChildren&&n.children.length){const t=this.target.code,e=n.children.slice();let o=e.shift();for(let n=r;n<t.length&&(!t[n].trimStart().startsWith(`const ${o.varName} `)||(t[n]=t[n].replace(`const ${o.varName}`,o.varName),o=e.shift(),o));n++);this.addLine(`let ${n.children.map((t=>t.varName)).join(", ")};`,r)}const t=n.children.map((t=>t.varName)).join(", ");this.insertBlock(`multi([${t}])`,n,e)}return n.varName}compileTCall(t,e){let{block:n,forceNewBlock:o}=e,s=e.ctxVar||"ctx";t.context&&(s=sn("ctx"),this.addLine(`let ${s} = ${Ye(t.context)};`));const r=Ze.test(t.name),i=r?Qe(t.name):"`"+t.name+"`";if(n&&!o&&this.insertAnchor(n),n=this.createBlock(n,"multi",e),t.body){this.addLine(`${s} = Object.create(${s});`),this.addLine(`${s}[isBoundary] = 1;`),this.helpers.add("isBoundary");const n=cn(e,{ctxVar:s}),o=this.compileMulti({type:3,content:t.body},n);o&&(this.helpers.add("zero"),this.addLine(`${s}[zero] = ${o};`))}const l=this.generateComponentKey();if(r){const t=sn("template");this.staticDefs.find((t=>"call"===t.id))||this.staticDefs.push({id:"call",expr:"app.callTemplate.bind(app)"}),this.define(t,i),this.insertBlock(`call(this, ${t}, ${s}, node, ${l})`,n,{...e,forceNewBlock:!n})}else{const t=sn("callTemplate_");this.staticDefs.push({id:t,expr:`app.getTemplate(${i})`}),this.insertBlock(`${t}.call(this, ${s}, node, ${l})`,n,{...e,forceNewBlock:!n})}return t.body&&!e.isLast&&this.addLine(`${s} = ${s}.__proto__;`),n.varName}compileTCallBlock(t,e){let{block:n,forceNewBlock:o}=e;return n&&(o||this.insertAnchor(n)),n=this.createBlock(n,"multi",e),this.insertBlock(Ye(t.name),n,{...e,forceNewBlock:!n}),n.varName}compileTSet(t,e){this.target.shouldProtectScope=!0,this.helpers.add("isBoundary").add("withDefault");const n=t.value?Ye(t.value||""):"null";if(t.body){this.helpers.add("LazyValue");const o={type:3,content:t.body};let s=`new LazyValue(${this.compileInNewTarget("value",o,e)}, ctx, this, node, ${this.target.currentKey(e)})`;s=t.value?s?`withDefault(${n}, ${s})`:n:s,this.addLine(`ctx[\`${t.name}\`] = ${s};`)}else{let o;if(t.defaultValue){const s=ln(e.translate?this.translate(t.defaultValue,e.translationCtx):t.defaultValue);o=t.value?`withDefault(${n}, ${s})`:s}else o=n;this.helpers.add("setContextValue"),this.addLine(`setContextValue(${e.ctxVar||"ctx"}, "${t.name}", ${o});`)}return null}generateComponentKey(t="key"){const e=[sn("__")];for(let t=0;t<this.target.loopLevel;t++)e.push(`\${key${t+1}}`);return`${t} + \`${e.join("__")}\``}formatProp(t,e,n,o){if(t.endsWith(".translate")){const s=(null==n?void 0:n[t])||o;e=ln(this.translateFn(e,s))}else e=this.captureExpression(e);if(t.includes(".")){let[n,o]=t.split(".");switch(t=n,o){case"bind":e=`(${e}).bind(this)`;break;case"alike":case"translate":break;default:throw new r(`Invalid prop suffix: ${o}`)}}return`${t=/^[a-z_]+$/i.test(t)?t:`'${t}'`}: ${e||void 0}`}formatPropObject(t,e,n){return Object.entries(t).map((([t,o])=>this.formatProp(t,o,e,n)))}getPropString(t,e){let n=`{${t.join(",")}}`;return e&&(n=`Object.assign({}, ${Ye(e)}${t.length?", "+n:""})`),n}compileComponent(t,e){let{block:n}=e;const o="slots"in(t.props||{}),s=t.props?this.formatPropObject(t.props,t.propsTranslationCtx,e.translationCtx):[];let r="";if(t.slots){let n="ctx";!this.target.loopLevel&&this.hasSafeContext||(n=sn("ctx"),this.helpers.add("capture"),this.define(n,"capture(ctx)"));let o=[];for(let s in t.slots){const r=t.slots[s],i=[];if(r.content){const t=this.compileInNewTarget("slot",r.content,e,r.on);i.push(`__render: ${t}.bind(this), __ctx: ${n}`)}const l=t.slots[s].scope;l&&i.push(`__scope: "${l}"`),t.slots[s].attrs&&i.push(...this.formatPropObject(t.slots[s].attrs,t.slots[s].attrsTranslationCtx,e.translationCtx));const a=`{${i.join(", ")}}`;o.push(`'${s}': ${a}`)}r=`{${o.join(", ")}}`}!r||t.dynamicProps||o||(this.helpers.add("markRaw"),s.push(`slots: markRaw(${r})`));let i,l,a=this.getPropString(s,t.dynamicProps);(r&&(t.dynamicProps||o)||this.dev)&&(i=sn("props"),this.define(i,a),a=i),r&&(t.dynamicProps||o)&&(this.helpers.add("markRaw"),this.addLine(`${i}.slots = markRaw(Object.assign(${r}, ${i}.slots))`)),t.isDynamic?(l=sn("Comp"),this.define(l,Ye(t.name))):l=`\`${t.name}\``,this.dev&&this.addLine(`helpers.validateProps(${l}, ${i}, this);`),n&&(!1===e.forceNewBlock||e.tKeyExpr)&&this.insertAnchor(n);let c=this.generateComponentKey();e.tKeyExpr&&(c=`${e.tKeyExpr} + ${c}`);let h=sn("comp");const u=[];for(let e in t.props||{}){let[t,n]=e.split(".");n||u.push(`"${t}"`)}this.staticDefs.push({id:h,expr:`app.createComponent(${t.isDynamic?null:l}, ${!t.isDynamic}, ${!!t.slots}, ${!!t.dynamicProps}, [${u}])`}),t.isDynamic&&(c=`(${l}).name + ${c}`);let d=`${h}(${a}, ${c}, node, this, ${t.isDynamic?l:null})`;return t.isDynamic&&(d=`toggler(${l}, ${d})`),t.on&&(d=this.wrapWithEventCatcher(d,t.on)),n=this.createBlock(n,"multi",e),this.insertBlock(d,n,e),n.varName}wrapWithEventCatcher(t,e){this.helpers.add("createCatcher");let n=sn("catcher"),o={},s=[];for(let t in e){let n=sn("hdlr"),r=s.push(n)-1;o[t]=r;const i=this.generateHandlerCode(t,e[t]);this.define(n,i)}return this.staticDefs.push({id:n,expr:`createCatcher(${JSON.stringify(o)})`}),`${n}(${t}, [${s.join(",")}])`}compileTSlot(t,e){this.helpers.add("callSlot");let n,o,{block:s}=e,r=!1,i=!1;t.name.match(Ze)?(r=!0,i=!0,o=Qe(t.name)):(o="'"+t.name+"'",i=i||this.slotNames.has(t.name),this.slotNames.add(t.name));const l={...t.attrs},a=l["t-props"];delete l["t-props"];let c=this.target.loopLevel?`key${this.target.loopLevel}`:"key";i&&(c=this.generateComponentKey(c));const h=t.attrs?this.formatPropObject(l,t.attrsTranslationCtx,e.translationCtx):[],u=this.getPropString(h,a);if(t.defaultContent){n=`callSlot(ctx, node, ${c}, ${o}, ${r}, ${u}, ${this.compileInNewTarget("defaultContent",t.defaultContent,e)}.bind(this))`}else if(r){let t=sn("slot");this.define(t,o),n=`toggler(${t}, callSlot(ctx, node, ${c}, ${t}, ${r}, ${u}))`}else n=`callSlot(ctx, node, ${c}, ${o}, ${r}, ${u})`;return t.on&&(n=this.wrapWithEventCatcher(n,t.on)),s&&this.insertAnchor(s),s=this.createBlock(s,"multi",e),this.insertBlock(n,s,{...e,forceNewBlock:!1}),s.varName}compileTTranslation(t,e){return t.content?this.compileAST(t.content,Object.assign({},e,{translate:!1})):null}compileTTranslationContext(t,e){return t.content?this.compileAST(t.content,Object.assign({},e,{translationCtx:t.translationCtx})):null}compileTPortal(t,e){this.staticDefs.find((t=>"Portal"===t.id))||this.staticDefs.push({id:"Portal",expr:"app.Portal"});let{block:n}=e;const o=this.compileInNewTarget("slot",t.content,e);let s="ctx";!this.target.loopLevel&&this.hasSafeContext||(s=sn("ctx"),this.helpers.add("capture"),this.define(s,"capture(ctx)"));let r=sn("comp");this.staticDefs.push({id:r,expr:"app.createComponent(null, false, true, false, false)"});const i=`${r}({target: ${Ye(t.target)},slots: {'default': {__render: ${o}.bind(this), __ctx: ${s}}}}, ${this.generateComponentKey()}, node, ctx, Portal)`;return n&&this.insertAnchor(n),n=this.createBlock(n,"multi",e),this.insertBlock(i,n,{...e,forceNewBlock:!1}),n.varName}}const pn=new WeakMap;function mn(t,e){var n;return function(t){let e=t.querySelectorAll("[t-elif], [t-else]");for(let t=0,n=e.length;t<n;t++){let n=e[t],o=n.previousElementSibling,s=t=>o.getAttribute(t),i=t=>+!!n.getAttribute(t);if(!o||!s("t-if")&&!s("t-elif"))throw new r("t-elif and t-else directives must be preceded by a t-if or t-elif directive");{if(s("t-foreach"))throw new r("t-if cannot stay at the same level as t-foreach when using t-elif or t-else");if(["t-if","t-elif","t-else"].map(i).reduce((function(t,e){return t+e}))>1)throw new r("Only one conditional branching directive is allowed per node");let t;for(;(t=n.previousSibling)!==o;){if(t.nodeValue.trim().length&&8!==t.nodeType)throw new r("text is not allowed between branching directives");t.remove()}}}}(n=t),function(t){for(const e of["t-esc","t-out"]){const n=[...t.querySelectorAll(`[${e}]`)].filter((t=>t.tagName[0]===t.tagName[0].toUpperCase()||t.hasAttribute("t-component")));for(const t of n){if(t.childNodes.length)throw new r(`Cannot have ${e} on a component that already has content`);const n=t.getAttribute(e);t.removeAttribute(e);const o=t.ownerDocument.createElement("t");null!=n&&o.setAttribute(e,n),t.appendChild(o)}}}(n),gn(t,e)||{type:0,value:""}}function gn(t,e){return t instanceof Element?function(t,e){if(!e.customDirectives)return null;const n=t.getAttributeNames();for(let o of n){if("t-custom"===o||"t-custom-"===o)throw new r("Missing custom directive name with t-custom directive");if(o.startsWith("t-custom-")){const n=o.split(".")[0].slice(9),s=e.customDirectives[n];if(!s)throw new r(`Custom directive "${n}" is not defined`);const i=t.getAttribute(o),l=o.split(".").slice(1);t.removeAttribute(o);try{s(t,i,l)}catch(t){throw new r(`Custom directive "${n}" throw the following error: ${t}`)}return gn(t,e)}}return null}(t,e)||function(t,e){if(t.hasAttribute("t-debug")){t.removeAttribute("t-debug");const n=gn(t,e),o={type:12,content:n};return(null==n?void 0:n.hasNoRepresentation)&&(o.hasNoRepresentation=!0),o}if(t.hasAttribute("t-log")){const n=t.getAttribute("t-log");t.removeAttribute("t-log");const o=gn(t,e),s={type:13,expr:n,content:o};return(null==o?void 0:o.hasNoRepresentation)&&(s.hasNoRepresentation=!0),s}return null}(t,e)||function(t,e){if(!t.hasAttribute("t-foreach"))return null;const n=t.outerHTML,o=t.getAttribute("t-foreach");t.removeAttribute("t-foreach");const s=t.getAttribute("t-as")||"";t.removeAttribute("t-as");const i=t.getAttribute("t-key");if(!i)throw new r(`"Directive t-foreach should always be used with a t-key!" (expression: t-foreach="${o}" t-as="${s}")`);t.removeAttribute("t-key");const l=t.getAttribute("t-memo")||"";t.removeAttribute("t-memo");const a=gn(t,e);if(!a)return null;const c=!n.includes("t-call"),h=c&&!n.includes(`${s}_first`),u=c&&!n.includes(`${s}_last`),d=c&&!n.includes(`${s}_index`),f=c&&!n.includes(`${s}_value`);return{type:9,collection:o,elem:s,body:a,memo:l,key:i,hasNoFirst:h,hasNoLast:u,hasNoIndex:d,hasNoValue:f}}(t,e)||function(t,e){if(!t.hasAttribute("t-if"))return null;const n=t.getAttribute("t-if");t.removeAttribute("t-if");const o=gn(t,e)||{type:0,value:""};let s=t.nextElementSibling;const r=[];for(;s&&s.hasAttribute("t-elif");){const t=s.getAttribute("t-elif");s.removeAttribute("t-elif");const n=gn(s,e),o=s.nextElementSibling;s.remove(),s=o,n&&r.push({condition:t,content:n})}let i=null;s&&s.hasAttribute("t-else")&&(s.removeAttribute("t-else"),i=gn(s,e),s.remove());return{type:5,condition:n,content:o,tElif:r.length?r:null,tElse:i}}(t,e)||function(t,e){if(!t.hasAttribute("t-portal"))return null;const n=t.getAttribute("t-portal");t.removeAttribute("t-portal");const o=gn(t,e);if(!o)return{type:0,value:""};return{type:18,target:n,content:o}}(t,e)||function(t,e){if(!t.hasAttribute("t-call"))return null;const n=t.getAttribute("t-call"),o=t.getAttribute("t-call-context");if(t.removeAttribute("t-call"),t.removeAttribute("t-call-context"),"t"!==t.tagName){const s=gn(t,e),r={type:7,name:n,body:null,context:o};if(s&&2===s.type)return s.content=[r],s;if(s&&11===s.type)return{...s,slots:{default:{content:r,scope:null,on:null,attrs:null,attrsTranslationCtx:null}}}}const s=kn(t,e);return{type:7,name:n,body:s.length?s:null,context:o}}(t,e)||function(t,e){if(!t.hasAttribute("t-call-block"))return null;const n=t.getAttribute("t-call-block");return{type:15,name:n}}(t)||function(t,e){if("off"!==t.getAttribute("t-translation"))return null;t.removeAttribute("t-translation");const n=gn(t,e);if(3===(null==n?void 0:n.type)){return Tn(n.content.map(xn))}return xn(n)}(t,e)||function(t,e){const n=t.getAttribute("t-translation-context");if(!n)return null;t.removeAttribute("t-translation-context");const o=gn(t,e);if(3===(null==o?void 0:o.type)){return Tn(o.content.map((t=>Nn(t,n))))}return Nn(o,n)}(t,e)||function(t,e){if(!t.hasAttribute("t-key"))return null;const n=t.getAttribute("t-key");t.removeAttribute("t-key");const o=gn(t,e);if(!o)return null;const s={type:10,expr:n,content:o};o.hasNoRepresentation&&(s.hasNoRepresentation=!0);return s}(t,e)||function(t,e){if(!t.hasAttribute("t-esc"))return null;const n=t.getAttribute("t-esc");t.removeAttribute("t-esc");const o={type:4,expr:n,defaultValue:t.textContent||""};let s=t.getAttribute("t-ref");t.removeAttribute("t-ref");const r=gn(t,e);if(!r)return o;if(2===r.type)return{...r,ref:s,content:[o]};return o}(t,e)||function(t,e){if(!t.hasAttribute("t-out")&&!t.hasAttribute("t-raw"))return null;t.hasAttribute("t-raw")&&console.warn('t-raw has been deprecated in favor of t-out. If the value to render is not wrapped by the "markup" function, it will be escaped');const n=t.getAttribute("t-out")||t.getAttribute("t-raw");t.removeAttribute("t-out"),t.removeAttribute("t-raw");const o={type:8,expr:n,body:null},s=t.getAttribute("t-ref");t.removeAttribute("t-ref");const r=gn(t,e);if(!r)return o;if(2===r.type)return o.body=r.content.length?r.content:null,{...r,ref:s,content:[o]};return o}(t,e)||function(t,e){if(!t.hasAttribute("t-slot"))return null;const n=t.getAttribute("t-slot");t.removeAttribute("t-slot");let o=null,s=null,r=null;for(let e of t.getAttributeNames()){const n=t.getAttribute(e);if(e.startsWith("t-on-"))r=r||{},r[e.slice(5)]=n;else if(e.startsWith("t-translation-context-")){s=s||{},s[e.slice(22)]=n}else o=o||{},o[e]=n}return{type:14,name:n,attrs:o,attrsTranslationCtx:s,on:r,defaultContent:En(t,e)}}(t,e)||function(t,e){let n=t.tagName;const o=n[0];let s=t.hasAttribute("t-component");if(s&&"t"!==n)throw new r(`Directive 't-component' can only be used on <t> nodes (used on a <${n}>)`);if(o!==o.toUpperCase()&&!s)return null;s&&(n=t.getAttribute("t-component"),t.removeAttribute("t-component"));const i=t.getAttribute("t-props");t.removeAttribute("t-props");const l=t.getAttribute("t-slot-scope");t.removeAttribute("t-slot-scope");let a=null,c=null,h=null;for(let e of t.getAttributeNames()){const n=t.getAttribute(e);if(e.startsWith("t-translation-context-")){h=h||{},h[e.slice(22)]=n}else if(e.startsWith("t-")){if(!e.startsWith("t-on-")){const t=$n.get(e.split("-").slice(0,2).join("-"));throw new r(t||`unsupported directive on Component: ${e}`)}a=a||{},a[e.slice(5)]=n}else c=c||{},c[e]=n}let u=null;if(t.hasChildNodes()){const n=t.cloneNode(!0),o=Array.from(n.querySelectorAll("[t-set-slot]"));for(let t of o){if("t"!==t.tagName)throw new r(`Directive 't-set-slot' can only be used on <t> nodes (used on a <${t.tagName}>)`);const o=t.getAttribute("t-set-slot");let s=t.parentElement,i=!1;for(;s&&s!==n;){if(s.hasAttribute("t-component")||s.tagName[0]===s.tagName[0].toUpperCase()){i=!0;break}s=s.parentElement}if(i||!s)continue;t.removeAttribute("t-set-slot"),t.remove();const l=gn(t,e);let a=null,c=null,h=null,d=null;for(let e of t.getAttributeNames()){const n=t.getAttribute(e);if("t-slot-scope"!==e)if(e.startsWith("t-translation-context-")){h=h||{},h[e.slice(22)]=n}else e.startsWith("t-on-")?(a=a||{},a[e.slice(5)]=n):(c=c||{},c[e]=n);else d=n}u=u||{},u[o]={content:l,on:a,attrs:c,attrsTranslationCtx:h,scope:d}}const s=En(n,e);u=u||{},s&&!u.default&&(u.default={content:s,on:a,attrs:null,attrsTranslationCtx:null,scope:l})}return{type:11,name:n,isDynamic:s,dynamicProps:i,props:c,propsTranslationCtx:h,slots:u,on:a}}(t,e)||function(t,e){const{tagName:n}=t,o=t.getAttribute("t-tag");if(t.removeAttribute("t-tag"),"t"===n&&!o)return null;if(n.startsWith("block-"))throw new r(`Invalid tag name: '${n}'`);e=Object.assign({},e),"pre"===n&&(e.inPreTag=!0);let s=!e.nameSpace&&wn.has(n)?"http://www.w3.org/2000/svg":null;const i=t.getAttribute("t-ref");t.removeAttribute("t-ref");const l=t.getAttributeNames();let a=null,c=null,h=null,u=null;for(let o of l){const i=t.getAttribute(o);if("t-on"===o||"t-on-"===o)throw new r("Missing event name with t-on directive");if(o.startsWith("t-on-"))h=h||{},h[o.slice(5)]=i;else if(o.startsWith("t-model")){if(!["input","select","textarea"].includes(n))throw new r("The t-model directive only works with <input>, <textarea> and <select>");let s,l;if(vn.test(i)){const t=i.lastIndexOf(".");s=i.slice(0,t),l=`'${i.slice(t+1)}'`}else{if(!yn.test(i))throw new r(`Invalid t-model expression: "${i}" (it should be assignable)`);{const t=i.lastIndexOf("[");s=i.slice(0,t),l=i.slice(t+1,-1)}}const a=t.getAttribute("type"),c="input"===n,h="select"===n,d=c&&"checkbox"===a,f=c&&"radio"===a,p=o.includes(".trim"),m=p||o.includes(".lazy");u={baseExpr:s,expr:l,targetAttr:d?"checked":"value",specialInitTargetAttr:f?"checked":null,eventType:f?"click":h||m?"change":"input",hasDynamicChildren:!1,shouldTrim:p,shouldNumberize:o.includes(".number")},h&&((e=Object.assign({},e)).tModelInfo=u)}else{if(o.startsWith("block-"))throw new r(`Invalid attribute: '${o}'`);if("xmlns"===o)s=i;else if(o.startsWith("t-translation-context-")){c=c||{},c[o.slice(22)]=i}else if("t-name"!==o){if(o.startsWith("t-")&&!o.startsWith("t-att"))throw new r(`Unknown QWeb directive: '${o}'`);const t=e.tModelInfo;t&&["t-att-value","t-attf-value"].includes(o)&&(t.hasDynamicChildren=!0),a=a||{},a[o]=i}}}s&&(e.nameSpace=s);const d=kn(t,e);return{type:2,tag:n,dynamicTag:o,attrs:a,attrsTranslationCtx:c,on:h,ref:i,content:d,model:u,ns:s}}(t,e)||function(t,e){if(!t.hasAttribute("t-set"))return null;const n=t.getAttribute("t-set"),o=t.getAttribute("t-value")||null,s=t.innerHTML===t.textContent&&t.textContent||null;let r=null;t.textContent!==t.innerHTML&&(r=kn(t,e));return{type:6,name:n,value:o,defaultValue:s,body:r,hasNoRepresentation:!0}}(t,e)||function(t,e){if("t"!==t.tagName)return null;return En(t,e)}(t,e):function(t,e){if(t.nodeType===Node.TEXT_NODE){let n=t.textContent||"";return e.inPreTag||!bn.test(n)||n.trim()?{type:0,value:n}:null}if(t.nodeType===Node.COMMENT_NODE)return{type:1,value:t.textContent||""};return null}(t,e)}const bn=/[\r\n]/;const vn=/\.[\w_]+\s*$/,yn=/\[[^\[]+\]\s*$/,wn=new Set(["svg","g","path"]);const $n=new Map([["t-ref","t-ref is no longer supported on components. Consider exposing only the public part of the component's API through a callback prop."],["t-att","t-att makes no sense on component: props are already treated as expressions"],["t-attf","t-attf is not supported on components: use template strings for string interpolation in props"]]);function xn(t){const e={type:16,content:t};return(null==t?void 0:t.hasNoRepresentation)&&(e.hasNoRepresentation=!0),e}function Nn(t,e){const n={type:17,content:t,translationCtx:e};return(null==t?void 0:t.hasNoRepresentation)&&(n.hasNoRepresentation=!0),n}function kn(t,e){const n=[];for(let o of t.childNodes){const t=gn(o,e);t&&(3===t.type?n.push(...t.content):n.push(t))}return n}function Tn(t){const e={type:3,content:t};return t.every((t=>t.hasNoRepresentation))&&(e.hasNoRepresentation=!0),e}function En(t,e){const n=kn(t,e);switch(n.length){case 0:return null;case 1:return n[0];default:return Tn(n)}}function An(t,e={hasGlobalValues:!1}){const n=function(t,e){const n={inPreTag:!1,customDirectives:e};if("string"==typeof t)return mn(Pe(`<t>${t}</t>`).firstChild,n);let o=pn.get(t);return o||(o=mn(t.cloneNode(!0),n),pn.set(t,o)),o}(t,e.customDirectives),o=t instanceof Node?!(t instanceof Element)||null===t.querySelector("[t-set], [t-call]"):!t.includes("t-set")&&!t.includes("t-call"),s=new fn(n,{...e,hasSafeContext:o}).generateCode();try{return new Function("app, bdom, helpers",s)}catch(t){const{name:n}=e,o=new r(`Failed to compile ${n?`template "${n}"`:"anonymous template"}: ${t.message}\n\ngenerated code:\nfunction(app, bdom, helpers) {\n${s}\n}`);throw o.cause=t,o}}let _n;"undefined"!=typeof window&&(_n=window.requestAnimationFrame.bind(window));class Cn{constructor(){this.tasks=new Set,this.frame=0,this.delayedRenders=[],this.cancelledNodes=new Set,this.processing=!1,this.requestAnimationFrame=Cn.requestAnimationFrame}addFiber(t){this.tasks.add(t.root)}scheduleDestroy(t){this.cancelledNodes.add(t),0===this.frame&&(this.frame=this.requestAnimationFrame((()=>this.processTasks())))}flush(){if(this.delayedRenders.length){let t=this.delayedRenders;this.delayedRenders=[];for(let e of t)e.root&&3!==e.node.status&&e.node.fiber===e&&e.render()}0===this.frame&&(this.frame=this.requestAnimationFrame((()=>this.processTasks())))}processTasks(){if(!this.processing){this.processing=!0,this.frame=0;for(let t of this.cancelledNodes)t._destroy();this.cancelledNodes.clear();for(let t of this.tasks)this.processFiber(t);for(let t of this.tasks)3===t.node.status&&this.tasks.delete(t);this.processing=!1}}processFiber(t){if(t.root!==t)return void this.tasks.delete(t);const e=xt.has(t);e&&0!==t.counter?this.tasks.delete(t):3!==t.node.status?0===t.counter&&(e||t.complete(),t.appliedToDom&&this.tasks.delete(t)):this.tasks.delete(t)}}Cn.requestAnimationFrame=_n;let Dn=!1;const Sn=new Set;"undefined"!=typeof window&&(window.__OWL_DEVTOOLS__||(window.__OWL_DEVTOOLS__={apps:Sn,Fiber:_t,RootFiber:Ct,toRaw:Ft,reactive:Yt}));class On extends Me{constructor(t,e={}){super(e),this.scheduler=new Cn,this.subRoots=new Set,this.root=null,this.name=e.name||"",this.Root=t,Sn.add(this),e.test&&(this.dev=!0),this.warnIfNoStaticProps=e.warnIfNoStaticProps||!1,!this.dev||e.test||Dn||(console.info("Owl is running in 'dev' mode."),Dn=!0);const n=e.env||{},o=Object.getOwnPropertyDescriptors(n);this.env=Object.freeze(Object.create(Object.getPrototypeOf(n),o)),this.props=e.props||{}}mount(t,e){const n=this.createRoot(this.Root,{props:this.props});return this.root=n.node,this.subRoots.delete(n.node),n.mount(t,e)}createRoot(t,e={}){const n=e.props||{},o=this.env;e.env&&(this.env=e.env);const s=function(){let t=se;return()=>{se=t}}(),r=this.makeNode(t,n);return s(),e.env&&(this.env=o),this.subRoots.add(r),{node:r,mount:(e,o)=>{On.validateTarget(e),this.dev&&Le(t,n,{__owl__:{app:this}});return this.mountNode(r,e,o)},destroy:()=>{this.subRoots.delete(r),r.destroy(),this.scheduler.processTasks()}}}makeNode(t,e){return new ue(t,e,this,null,null)}mountNode(t,e,n){const o=new Promise(((e,n)=>{let o=!1;t.mounted.push((()=>{e(t.component),o=!0}));let s=Nt.get(t);s||(s=[],Nt.set(t,s)),s.unshift((t=>{throw o||n(t),t}))}));return t.mountComponent(e,n),o}destroy(){if(this.root){for(let t of this.subRoots)t.destroy();this.root.destroy(),this.scheduler.processTasks()}Sn.delete(this)}createComponent(t,e,n,o,s){const i=!e;let l;const a=0===s.length;l=n?(t,e)=>!0:o?function(t,e){for(let n in t)if(t[n]!==e[n])return!0;return Object.keys(t).length!==Object.keys(e).length}:a?(t,e)=>!1:function(t,e){for(let n of s)if(t[n]!==e[n])return!0;return!1};const c=ue.prototype.updateAndRender,h=ue.prototype.initiateRender;return(n,o,s,a,u)=>{let d=s.children,f=d[o];i&&f&&f.component.constructor!==u&&(f=void 0);const p=s.fiber;if(f)(l(f.props,n)||p.deep||f.forceNextRender)&&(f.forceNextRender=!1,c.call(f,n,p));else{if(e){const e=a.constructor.components;if(!e)throw new r(`Cannot find the definition of component "${t}", missing static components key in parent`);if(!(u=e[t]))throw new r(`Cannot find the definition of component "${t}"`);if(!(u.prototype instanceof ve))throw new r(`"${t}" is not a Component. It must inherit from the Component class`)}f=new ue(u,n,this,s,o),d[o]=f,h.call(f,new _t(f,p))}return p.childrenMap[o]=f,f}}handleError(...t){return Tt(...t)}}On.validateTarget=function(t){const e=t&&t.ownerDocument;if(e){if(!e.defaultView)throw new r("Cannot mount a component: the target document is not attached to a window (defaultView is missing)");if(t instanceof e.defaultView.HTMLElement||t instanceof ShadowRoot){if(!function(t,e){let n=t;const o=e.defaultView.ShadowRoot;for(;n;){if(n===e)return!0;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof o&&n.host))return!1;n=n.host}}return!1}(t,e))throw new r("Cannot mount a component on a detached dom node");return}}throw new r("Cannot mount component: the target is not a valid DOM element")},On.apps=Sn,On.version="2.8.3";function Rn(t,e){const n=Object.create(t),o=Object.getOwnPropertyDescriptors(e);return Object.freeze(Object.defineProperties(n,o))}function Ln(t){const e=re();e.childEnv=Rn(e.childEnv,t)}n.shouldNormalizeDom=!1,n.mainEventHandler=(t,n,o)=>{const{data:s,modifiers:i}=e(t);t=s;let l=!1;if(i.length){let t=!1;const e=n.target===o;for(const o of i)switch(o){case"self":if(t=!0,e)continue;return l;case"prevent":(t&&e||!t)&&n.preventDefault();continue;case"stop":(t&&e||!t)&&n.stopPropagation(),l=!0;continue}}if(Object.hasOwnProperty.call(t,0)){const e=t[0];if("function"!=typeof e)throw new r(`Invalid handler (expected a function, received: '${e}')`);let o=t[1]?t[1].__owl__:null;o&&1!==o.status||e.call(o?o.component:null,n)}return l};const Bn={config:n,mount:$t,patch:function(t,e,n=!1){t.patch(e,n)},remove:function(t,e=!1){e&&t.beforeRemove(),t.remove()},list:bt,multi:j,text:z,toggler:s,createBlock:nt,html:wt,comment:H},Pn={version:On.version};Me.prototype._compileTemplate=function(t,e){return An(e,{name:t,dev:this.dev,translateFn:this.translateFn,translatableAttributes:this.translatableAttributes,customDirectives:this.customDirectives,hasGlobalValues:this.hasGlobalValues})},t.App=On,t.Component=ve,t.EventBus=N,t.OwlError=r,t.__info__=Pn,t.batched=$,t.blockDom=Bn,t.htmlEscape=T,t.loadFile=async function(t){const e=await fetch(t);if(!e.ok)throw new r("Error while fetching xml templates");return await e.text()},t.markRaw=Vt,t.markup=E,t.mount=async function(t,e,n={}){return new On(t,n).mount(e,n)},t.onError=function(t){const e=re();let n=Nt.get(e);n||(n=[],Nt.set(e,n)),n.push(t.bind(e.component))},t.onMounted=me,t.onPatched=ge,t.onRendered=function(t){const e=re(),n=e.renderFn,o=e.app.dev?pe:t=>t;t=o(t.bind(e.component),"onRendered"),e.renderFn=()=>{const e=n();return t(),e}},t.onWillDestroy=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willDestroy.push(n(t.bind(e.component),"onWillDestroy"))},t.onWillPatch=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willPatch.unshift(n(t.bind(e.component),"onWillPatch"))},t.onWillRender=function(t){const e=re(),n=e.renderFn,o=e.app.dev?pe:t=>t;t=o(t.bind(e.component),"onWillRender"),e.renderFn=()=>(t(),n())},t.onWillStart=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willStart.push(n(t.bind(e.component),"onWillStart"))},t.onWillUnmount=be,t.onWillUpdateProps=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willUpdateProps.push(n(t.bind(e.component),"onWillUpdateProps"))},t.reactive=Yt,t.status=function(t){switch(t.__owl__.status){case 0:return"new";case 2:return"cancelled";case 1:return"mounted";case 3:return"destroyed"}},t.toRaw=Ft,t.useChildSubEnv=Ln,t.useComponent=function(){return se.component},t.useEffect=function(t,e=(()=>[NaN])){let n,o;me((()=>{o=e(),n=t(...o)})),ge((()=>{const s=e();s.some(((t,e)=>t!==o[e]))&&(o=s,n&&n(),n=t(...o))})),be((()=>n&&n()))},t.useEnv=function(){return re().component.env},t.useExternalListener=function(t,e,n,o){const s=re(),r=n.bind(s.component);me((()=>t.addEventListener(e,r,o))),be((()=>t.removeEventListener(e,r,o)))},t.useRef=function(t){const e=re().refs;return{get el(){const n=e[t];return x(n)?n:null}}},t.useState=ae,t.useSubEnv=function(t){const e=re();e.component.env=Rn(e.component.env,t),Ln(t)},t.validate=function(t,e){let n=_e(t,e);if(n.length)throw new r("Invalid object: "+n.join(", "))},t.validateType=Ce,t.whenReady=function(t){return new Promise((function(t){"loading"!==document.readyState?t(!0):document.addEventListener("DOMContentLoaded",t,!1)})).then(t||function(){})},t.xml=We,Object.defineProperty(t,"__esModule",{value:!0}),Pn.date="2026-03-30T13:05:32.099Z",Pn.hash="efae3e4",Pn.url="https://github.com/odoo/owl"}(globalThis.owl=globalThis.owl||{});
9
9
 
10
- var rc=Object.create;var Li=Object.defineProperty;var ic=Object.getOwnPropertyDescriptor;var nc=Object.getOwnPropertyNames;var ac=Object.getPrototypeOf,cc=Object.prototype.hasOwnProperty;var lc=(t,e,s)=>e in t?Li(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var Yt=(t,e,s)=>()=>{if(s)throw s[0];try{return t&&(e=t(t=0)),e}catch(o){throw s=[o],o}};var uc=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(s){throw e=0,s}},Rn=(t,e)=>{for(var s in e)Li(t,s,{get:e[s],enumerable:!0})},pc=(t,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of nc(e))!cc.call(t,n)&&n!==s&&Li(t,n,{get:()=>e[n],enumerable:!(o=ic(e,n))||o.enumerable});return t};var dc=(t,e,s)=>(s=t!=null?rc(ac(t)):{},pc(e||!t||!t.__esModule?Li(s,"default",{value:t,enumerable:!0}):s,t));var r=(t,e,s)=>lc(t,typeof e!="symbol"?e+"":e,s);function mc(t){return typeof t=="string"?document.querySelector(t):t instanceof Element?t:null}function tn(t,e,s={}){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}function fc(t,e={}){return t.hasAttribute("b-icon")?"icon":e.name||t.getAttribute("b-ui")}function gc(t,e){return e===document||e===t||e.contains(t)}function vc(t,e={}){return!e.allowBootstrapControl&&t.matches(bc)}function $n(t){return h.version=t,h}function Mn(){if(typeof MutationObserver>"u")return;let t=new MutationObserver(e=>{for(let s of e)for(let o of s.addedNodes)o instanceof Element&&h.mountAll(o)});return t.observe(document.documentElement,{childList:!0,subtree:!0}),t}function _n(){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{h.mountAll(),Mn()},{once:!0}):(h.mountAll(),Mn()))}var hc,Qi,bi,Ni,bc,en,h,U=Yt(()=>{hc="__NODEXUI_VERSION__",Qi=new Map,bi=new WeakMap,Ni="[b-ui], [b-icon]",bc="[data-bs-toggle], [data-bs-target], [data-bs-dismiss]";en=typeof window<"u"?window.thebase:void 0,h=en?.register?en:Object.assign(en||{},{version:hc,register(t,e){if(!t||!e)throw new Error("NodexUI.register requires a name and component definition.");return Qi.set(t,e),this},component(t){return Qi.get(t)},mount(t,e={}){let s=mc(t);if(!s||vc(s,e))return null;let o=fc(s,e),n=Qi.get(o);if(!n)return null;let a=bi.get(s);if(a?.name===o)return a;a&&(a.destroy?.(),bi.delete(s),tn(s,"nodexui:destroyed",{name:a.name}));let l=n.mount?.(s,this,e)||{},p={name:o,element:s,destroy:l.destroy};return bi.set(s,p),tn(s,"nodexui:mounted",{name:o,instance:p}),p},mountAll(t=document){let e=t||document,s=[...e.querySelectorAll?.(Ni)||[]];return e instanceof Element&&e.matches(Ni)&&s.unshift(e),s.map(o=>this.mount(o)).filter(Boolean)},destroy(t=document){let e=t||document,s=[...e.querySelectorAll?.(Ni)||[]];e instanceof Element&&e.matches(Ni)&&s.unshift(e);for(let o of s){let n=bi.get(o);n&&gc(o,e)&&(n.destroy?.(),bi.delete(o),tn(o,"nodexui:destroyed",{name:n.name}))}},theme:{set(t){let e=document.documentElement;if(typeof t=="string"){e.setAttribute("b-theme",t),e.dataset.bsTheme=t;return}for(let[s,o]of Object.entries(t||{})){let n=s==="radius"||s==="--b-radius"?"--base-radius":s.startsWith("--")?s:`--b-${s}`;e.style.setProperty(n,o)}}}});typeof window<"u"&&(window.thebase=h,window.NodexUI=h)});function f(...t){let e=[];for(let s of t)if(s){if(typeof s=="string")e.push(s);else if(Array.isArray(s)){let o=f(...s);o&&e.push(o)}else if(typeof s=="object")for(let[o,n]of Object.entries(s))n&&e.push(o)}return e.join(" ")}function i(t){return{type:t,optional:!0}}function gt(t,e,s){return t[e]??(s?t[s]:void 0)}function dt(t){return t===!0||t==="open"||t==="on"||t==="active"}function bt(...t){let e=[];for(let s of t)if(s){if(typeof s=="string"){let o=s.trim().replace(/;$/,"");o&&e.push(o)}else if(typeof s=="object")for(let[o,n]of Object.entries(s)){if(n==null||n==="")continue;let a=o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase());e.push(`${a}:${n}`)}}return e.join(";")}function lt(t){return t.state!==void 0?dt(t.state):t.open!==void 0?t.open:t["default-open"]!==void 0?t["default-open"]:t.defaultOpen??!1}function je(t){return t.state!==void 0||t.open!==void 0}var u,R=Yt(()=>{u={className:i(String),style:i([String,Object]),slots:i(Object)}});var Y,yc,Un,wc,Ac,Sc,Ec,Cc,kc,ze,Lc,sn,on,Nc,Q,at,Oc,Fe,Tc,Ic,Ot,st,ht,Bc,Rc,Mc,G,$c,At,_c,js,q,$,Pc,Uc,qc,Dc,Oi,rn=Yt(()=>{Y=globalThis.owl;if(!Y)throw new Error("NodexUI: load dist/nodexui.min.js or dist/nodexui.esm.js before this script (globalThis.owl is not set).");yc=Y.App,Un=Y.Component,wc=Y.EventBus,Ac=Y.OwlError,Sc=Y.__info__,Ec=Y.batched,Cc=Y.blockDom,kc=Y.htmlEscape,ze=Y.loadFile,Lc=Y.markRaw,sn=Y.markup,on=Y.mount,Nc=Y.onError,Q=Y.onMounted,at=Y.onPatched,Oc=Y.onRendered,Fe=Y.onWillDestroy,Tc=Y.onWillPatch,Ic=Y.onWillRender,Ot=Y.onWillStart,st=Y.onWillUnmount,ht=Y.onWillUpdateProps,Bc=Y.reactive,Rc=Y.status,Mc=Y.toRaw,G=Y.useChildSubEnv,$c=Y.useComponent,At=Y.useEffect,_c=Y.useEnv,js=Y.useExternalListener,q=Y.useRef,$=Y.useState,Pc=Y.useSubEnv,Uc=Y.validate,qc=Y.validateType,Dc=Y.whenReady,Oi=Y.xml});function qn(t){Object.assign(mi,t)}function jc(t){let e=t.components;e?e!==mi&&Object.getPrototypeOf(e)===Object.prototype&&Object.setPrototypeOf(e,mi):t.components=Object.create(mi)}function Dn(t){return typeof t!="string"||!/\st-(att|attf|model)([.\s=-]|$)/.test(t)?t:t.replace(/<([A-Z][\w.:-]*)(\s[^<>]*?)?(\/?)>/g,(e,s,o="",n="")=>`<${s}${zc(s,o)}${n}>`)}function zc(t,e){let s=/\st-(att|attf|model|on)([.\s=-]|$)/.test(e),o=e.replace(/(\s)t-att\s*=/g,"$1t-props=").replace(/(\s)t-att-([A-Za-z_][\w:.-]*)\s*=/g,"$1$2=").replace(/(\s)t-attf-([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(n,a,l,p,b)=>`${a}${l}=${p}${Kc(b)}${p}`);return o=o.replace(/(\s)t-model((?:\.[\w-]+)*)\s*=\s*(["'])(.*?)\3/g,(n,a,l,p,b)=>Vc(t,a,l,p,b,o)),s?Fc(o):o}function Fc(t){return t.replace(/(\s)([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(e,s,o,n,a)=>o.startsWith("t-")||o==="t-props"||Wc(a)?e:`${s}${o}=${n}${Hc(a)}${n}`)}function Hc(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function Wc(t){let e=t.trim();return!e||/^(['"`[{(]|-?\d+(?:\.\d+)?$)/.test(e)||/[?.()[\]+*/]|=>|===|!==|&&|\|\|/.test(e)||/^(true|false|null|undefined)$/.test(e)}function Kc(t){return`\`${t.replace(/`/g,"\\`").replace(/{{\s*([\s\S]*?)\s*}}|#\{\s*([\s\S]*?)\s*\}/g,(e,s,o)=>`\${${s||o}}`)}\``}function Vc(t,e,s,o,n,a){let l=/^(Checkbox|Switch)$/.test(t),p=Gc(t,s),b=l?"checked":"value",v=new RegExp(`\\s${b}\\s*=`).test(a)?"":`${e}${b}=${o}${n}${o}`,k=new RegExp(`\\s${p}\\s*=`).test(a)?"":`${e}${p}=${o}${Zc(n,s,l)}${o}`;return`${v}${k}`}function Gc(t,e){return e.includes(".lazy")?"onChange":/^(Input|Textarea)$/.test(t)?"onInput":"onChange"}function Zc(t,e,s){if(s)return`(value) => { ${t} = value; }`;let o="value";return e.includes(".trim")&&(o=`(typeof ${o} === 'string' ? ${o}.trim() : ${o})`),e.includes(".number")&&(o=`Number.isNaN(Number(${o})) ? ${o} : Number(${o})`),`(value) => { ${t} = ${o}; }`}function jn(t,...e){return Array.isArray(t?.raw)?Oi({raw:t.raw.map(Dn)},...e):Oi(t,...e)}function zs(t,e,s={}){let o=Dn(s.templates);return t.components={...mi,...t.components||{}},on(t,e,o===s.templates?s:{...s,templates:o})}async function Kd(t){let e=await(await fetch(t,{cache:"reload"})).text(),o=new DOMParser().parseFromString(e,"application/xml").querySelector("templates > t[t-name]");return o?o.innerHTML:e}var Hd,Wd,mi,c,_=Yt(()=>{rn();rn();Hd=on,Wd=Oi,mi={};c=class extends Un{constructor(...e){super(...e),jc(this.constructor)}}});function Xc(t){return typeof Image>"u"?Promise.resolve(!0):(nn.has(t)||nn.set(t,new Promise(e=>{let s=new Image;s.onload=()=>e(!0),s.onerror=()=>e(!1),s.src=t})),nn.get(t))}function Ti(t){return String(t||"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function fi(t,e={}){let s=Ti(t);if(!Yc.test(s))throw new Error(`NodexUI icon name is invalid: ${t}`);return`${String(e.baseUrl||h.icons.lucide.cdnBaseUrl).replace(/\/+$/,"")}/${s}.svg`}function ut(t,e,s={}){let o=s.url||fi(e,s),n=s.label??t.getAttribute("aria-label")??"";t.classList.add("b-icon"),t.style.setProperty("--b-icon-url",`url("${o.replace(/"/g,"%22")}")`),(s.size||t.getAttribute("b-att-size"))&&t.style.setProperty("--b-icon-size",s.size||t.getAttribute("b-att-size")),n?(t.setAttribute("role","img"),t.setAttribute("aria-label",n)):t.setAttribute("aria-hidden","true");let a=s.fallback===!1?null:s.fallback||Ii;return a&&!s.url&&Ti(e)!==Ti(a)&&Xc(o).then(l=>{if(l||!t.isConnected)return;let p=fi(a,s);t.style.setProperty("--b-icon-url",`url("${p.replace(/"/g,"%22")}")`)}),t}var zn,Jc,Ii,Yc,nn,It=Yt(()=>{U();zn="1.31.0",Jc=`https://cdn.jsdelivr.net/npm/lucide-static@${zn}/icons`,Ii="file",Yc=/^[a-z0-9][a-z0-9-]*$/,nn=new Map;h.icons={...h.icons||{},lucide:{version:zn,cdnBaseUrl:Jc,normalizeName:Ti,url:fi,render:ut}}});var mt,vt,Hs=Yt(()=>{mt={default:"btn-primary",secondary:"btn-secondary",destructive:"btn-danger",outline:"btn-outline-secondary",ghost:"btn-light",link:"btn-link"},vt={xs:"btn-xs",sm:"btn-sm",lg:"btn-lg",icon:"btn-icon","icon-xs":"btn-icon-xs","icon-sm":"btn-icon-sm","icon-lg":"btn-icon-lg"}});function Bi({variant:t="default",size:e,className:s}={}){return f("btn","b-button","b-clipboard-button",mt[t]||mt.default,vt[e],s)}async function Ws(t){let e=String(t??"");if(globalThis.navigator?.clipboard?.writeText)try{await globalThis.navigator.clipboard.writeText(e);return}catch{}if(typeof document>"u")throw new Error("NodexUI ClipboardButton: no clipboard API available in this environment.");let s=document.createElement("textarea");s.value=e,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",s.style.pointerEvents="none",document.body.append(s),s.select(),s.setSelectionRange(0,e.length);let o;try{o=document.execCommand("copy")}catch{o=!1}if(s.remove(),!o)throw new Error("NodexUI ClipboardButton: clipboard copy is unavailable in this browser/context.")}var an,Ri=Yt(()=>{R();Hs();an=["btn","b-button","b-clipboard-button",...Object.values(mt),...Object.values(vt)]});var pa=uc((la,ua)=>{var ca=(function(){var t=function(A,M){var L=236,T=17,x=A,I=s[M],m=null,d=0,B=null,S=[],N={},J=function(y,w){d=x*4+17,m=(function(g){for(var E=new Array(g),C=0;C<g;C+=1){E[C]=new Array(g);for(var D=0;D<g;D+=1)E[C][D]=null}return E})(d),X(0,0),X(d-7,0),X(0,d-7),ft(),ct(),Mt(y,w),x>=7&&Tt(y),B==null&&(B=sc(x,I,S)),$t(B,w)},X=function(y,w){for(var g=-1;g<=7;g+=1)if(!(y+g<=-1||d<=y+g))for(var E=-1;E<=7;E+=1)w+E<=-1||d<=w+E||(0<=g&&g<=6&&(E==0||E==6)||0<=E&&E<=6&&(g==0||g==6)||2<=g&&g<=4&&2<=E&&E<=4?m[y+g][w+E]=!0:m[y+g][w+E]=!1)},rt=function(){for(var y=0,w=0,g=0;g<8;g+=1){J(!0,g);var E=n.getLostPoint(N);(g==0||y>E)&&(y=E,w=g)}return w},ct=function(){for(var y=8;y<d-8;y+=1)m[y][6]==null&&(m[y][6]=y%2==0);for(var w=8;w<d-8;w+=1)m[6][w]==null&&(m[6][w]=w%2==0)},ft=function(){for(var y=n.getPatternPosition(x),w=0;w<y.length;w+=1)for(var g=0;g<y.length;g+=1){var E=y[w],C=y[g];if(m[E][C]==null)for(var D=-2;D<=2;D+=1)for(var H=-2;H<=2;H+=1)D==-2||D==2||H==-2||H==2||D==0&&H==0?m[E+D][C+H]=!0:m[E+D][C+H]=!1}},Tt=function(y){for(var w=n.getBCHTypeNumber(x),g=0;g<18;g+=1){var E=!y&&(w>>g&1)==1;m[Math.floor(g/3)][g%3+d-8-3]=E}for(var g=0;g<18;g+=1){var E=!y&&(w>>g&1)==1;m[g%3+d-8-3][Math.floor(g/3)]=E}},Mt=function(y,w){for(var g=I<<3|w,E=n.getBCHTypeInfo(g),C=0;C<15;C+=1){var D=!y&&(E>>C&1)==1;C<6?m[C][8]=D:C<8?m[C+1][8]=D:m[d-15+C][8]=D}for(var C=0;C<15;C+=1){var D=!y&&(E>>C&1)==1;C<8?m[8][d-C-1]=D:C<9?m[8][15-C-1+1]=D:m[8][15-C-1]=D}m[d-8][8]=!y},$t=function(y,w){for(var g=-1,E=d-1,C=7,D=0,H=n.getMaskFunction(w),F=d-1;F>0;F-=2)for(F==6&&(F-=1);;){for(var it=0;it<2;it+=1)if(m[E][F-it]==null){var pt=!1;D<y.length&&(pt=(y[D]>>>C&1)==1);var V=H(E,F-it);V&&(pt=!pt),m[E][F-it]=pt,C-=1,C==-1&&(D+=1,C=7)}if(E+=g,E<0||d<=E){E-=g,g=-g;break}}},qs=function(y,w){for(var g=0,E=0,C=0,D=new Array(w.length),H=new Array(w.length),F=0;F<w.length;F+=1){var it=w[F].dataCount,pt=w[F].totalCount-it;E=Math.max(E,it),C=Math.max(C,pt),D[F]=new Array(it);for(var V=0;V<D[F].length;V+=1)D[F][V]=255&y.getBuffer()[V+g];g+=it;var St=n.getErrorCorrectPolynomial(pt),Et=l(D[F],St.getLength()-1),Tn=Et.mod(St);H[F]=new Array(St.getLength()-1);for(var V=0;V<H[F].length;V+=1){var In=V+Tn.getLength()-H[F].length;H[F][V]=In>=0?Tn.getAt(In):0}}for(var Bn=0,V=0;V<w.length;V+=1)Bn+=w[V].totalCount;for(var Xi=new Array(Bn),ki=0,V=0;V<E;V+=1)for(var F=0;F<w.length;F+=1)V<D[F].length&&(Xi[ki]=D[F][V],ki+=1);for(var V=0;V<C;V+=1)for(var F=0;F<w.length;F+=1)V<H[F].length&&(Xi[ki]=H[F][V],ki+=1);return Xi},sc=function(y,w,g){for(var E=p.getRSBlocks(y,w),C=b(),D=0;D<g.length;D+=1){var H=g[D];C.put(H.getMode(),4),C.put(H.getLength(),n.getLengthInBits(H.getMode(),y)),H.write(C)}for(var F=0,D=0;D<E.length;D+=1)F+=E[D].dataCount;if(C.getLengthInBits()>F*8)throw"code length overflow. ("+C.getLengthInBits()+">"+F*8+")";for(C.getLengthInBits()+4<=F*8&&C.put(0,4);C.getLengthInBits()%8!=0;)C.putBit(!1);for(;!(C.getLengthInBits()>=F*8||(C.put(L,8),C.getLengthInBits()>=F*8));)C.put(T,8);return qs(C,E)};N.addData=function(y,w){w=w||"Byte";var g=null;switch(w){case"Numeric":g=v(y);break;case"Alphanumeric":g=k(y);break;case"Byte":g=O(y);break;case"Kanji":g=j(y);break;default:throw"mode:"+w}S.push(g),B=null},N.isDark=function(y,w){if(y<0||d<=y||w<0||d<=w)throw y+","+w;return m[y][w]},N.getModuleCount=function(){return d},N.make=function(){if(x<1){for(var y=1;y<40;y++){for(var w=p.getRSBlocks(y,I),g=b(),E=0;E<S.length;E++){var C=S[E];g.put(C.getMode(),4),g.put(C.getLength(),n.getLengthInBits(C.getMode(),y)),C.write(g)}for(var D=0,E=0;E<w.length;E++)D+=w[E].dataCount;if(g.getLengthInBits()<=D*8)break}x=y}J(!1,rt())},N.createTableTag=function(y,w){y=y||2,w=typeof w>"u"?y*4:w;var g="";g+='<table style="',g+=" border-width: 0px; border-style: none;",g+=" border-collapse: collapse;",g+=" padding: 0px; margin: "+w+"px;",g+='">',g+="<tbody>";for(var E=0;E<N.getModuleCount();E+=1){g+="<tr>";for(var C=0;C<N.getModuleCount();C+=1)g+='<td style="',g+=" border-width: 0px; border-style: none;",g+=" border-collapse: collapse;",g+=" padding: 0px; margin: 0px;",g+=" width: "+y+"px;",g+=" height: "+y+"px;",g+=" background-color: ",g+=N.isDark(E,C)?"#000000":"#ffffff",g+=";",g+='"/>';g+="</tr>"}return g+="</tbody>",g+="</table>",g},N.createSvgTag=function(y,w,g,E){var C={};typeof arguments[0]=="object"&&(C=arguments[0],y=C.cellSize,w=C.margin,g=C.alt,E=C.title),y=y||2,w=typeof w>"u"?y*4:w,g=typeof g=="string"?{text:g}:g||{},g.text=g.text||null,g.id=g.text?g.id||"qrcode-description":null,E=typeof E=="string"?{text:E}:E||{},E.text=E.text||null,E.id=E.text?E.id||"qrcode-title":null;var D=N.getModuleCount()*y+w*2,H,F,it,pt,V="",St;for(St="l"+y+",0 0,"+y+" -"+y+",0 0,-"+y+"z ",V+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',V+=C.scalable?"":' width="'+D+'px" height="'+D+'px"',V+=' viewBox="0 0 '+D+" "+D+'" ',V+=' preserveAspectRatio="xMinYMin meet"',V+=E.text||g.text?' role="img" aria-labelledby="'+Ds([E.id,g.id].join(" ").trim())+'"':"",V+=">",V+=E.text?'<title id="'+Ds(E.id)+'">'+Ds(E.text)+"</title>":"",V+=g.text?'<description id="'+Ds(g.id)+'">'+Ds(g.text)+"</description>":"",V+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',V+='<path d="',it=0;it<N.getModuleCount();it+=1)for(pt=it*y+w,H=0;H<N.getModuleCount();H+=1)N.isDark(it,H)&&(F=H*y+w,V+="M"+F+","+pt+St);return V+='" stroke="transparent" fill="black"/>',V+="</svg>",V},N.createDataURL=function(y,w){y=y||2,w=typeof w>"u"?y*4:w;var g=N.getModuleCount()*y+w*2,E=w,C=g-w;return nt(g,g,function(D,H){if(E<=D&&D<C&&E<=H&&H<C){var F=Math.floor((D-E)/y),it=Math.floor((H-E)/y);return N.isDark(it,F)?0:1}else return 1})},N.createImgTag=function(y,w,g){y=y||2,w=typeof w>"u"?y*4:w;var E=N.getModuleCount()*y+w*2,C="";return C+="<img",C+=' src="',C+=N.createDataURL(y,w),C+='"',C+=' width="',C+=E,C+='"',C+=' height="',C+=E,C+='"',g&&(C+=' alt="',C+=Ds(g),C+='"'),C+="/>",C};var Ds=function(y){for(var w="",g=0;g<y.length;g+=1){var E=y.charAt(g);switch(E){case"<":w+="&lt;";break;case">":w+="&gt;";break;case"&":w+="&amp;";break;case'"':w+="&quot;";break;default:w+=E;break}}return w},oc=function(y){var w=1;y=typeof y>"u"?w*2:y;var g=N.getModuleCount()*w+y*2,E=y,C=g-y,D,H,F,it,pt,V={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},St={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},Et="";for(D=0;D<g;D+=2){for(F=Math.floor((D-E)/w),it=Math.floor((D+1-E)/w),H=0;H<g;H+=1)pt="\u2588",E<=H&&H<C&&E<=D&&D<C&&N.isDark(F,Math.floor((H-E)/w))&&(pt=" "),E<=H&&H<C&&E<=D+1&&D+1<C&&N.isDark(it,Math.floor((H-E)/w))?pt+=" ":pt+="\u2588",Et+=y<1&&D+1>=C?St[pt]:V[pt];Et+=`
11
- `}return g%2&&y>0?Et.substring(0,Et.length-g-1)+Array(g+1).join("\u2580"):Et.substring(0,Et.length-1)};return N.createASCII=function(y,w){if(y=y||1,y<2)return oc(w);y-=1,w=typeof w>"u"?y*2:w;var g=N.getModuleCount()*y+w*2,E=w,C=g-w,D,H,F,it,pt=Array(y+1).join("\u2588\u2588"),V=Array(y+1).join(" "),St="",Et="";for(D=0;D<g;D+=1){for(F=Math.floor((D-E)/y),Et="",H=0;H<g;H+=1)it=1,E<=H&&H<C&&E<=D&&D<C&&N.isDark(F,Math.floor((H-E)/y))&&(it=0),Et+=it?pt:V;for(F=0;F<y;F+=1)St+=Et+`
12
- `}return St.substring(0,St.length-1)},N.renderTo2dContext=function(y,w){w=w||2;for(var g=N.getModuleCount(),E=0;E<g;E++)for(var C=0;C<g;C++)y.fillStyle=N.isDark(E,C)?"black":"white",y.fillRect(E*w,C*w,w,w)},N};t.stringToBytesFuncs={default:function(A){for(var M=[],L=0;L<A.length;L+=1){var T=A.charCodeAt(L);M.push(T&255)}return M}},t.stringToBytes=t.stringToBytesFuncs.default,t.createStringToBytes=function(A,M){var L=(function(){for(var x=z(A),I=function(){var ct=x.read();if(ct==-1)throw"eof";return ct},m=0,d={};;){var B=x.read();if(B==-1)break;var S=I(),N=I(),J=I(),X=String.fromCharCode(B<<8|S),rt=N<<8|J;d[X]=rt,m+=1}if(m!=M)throw m+" != "+M;return d})(),T=63;return function(x){for(var I=[],m=0;m<x.length;m+=1){var d=x.charCodeAt(m);if(d<128)I.push(d);else{var B=L[x.charAt(m)];typeof B=="number"?(B&255)==B?I.push(B):(I.push(B>>>8),I.push(B&255)):I.push(T)}}return I}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},s={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},n=(function(){var A=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],M=1335,L=7973,T=21522,x={},I=function(m){for(var d=0;m!=0;)d+=1,m>>>=1;return d};return x.getBCHTypeInfo=function(m){for(var d=m<<10;I(d)-I(M)>=0;)d^=M<<I(d)-I(M);return(m<<10|d)^T},x.getBCHTypeNumber=function(m){for(var d=m<<12;I(d)-I(L)>=0;)d^=L<<I(d)-I(L);return m<<12|d},x.getPatternPosition=function(m){return A[m-1]},x.getMaskFunction=function(m){switch(m){case o.PATTERN000:return function(d,B){return(d+B)%2==0};case o.PATTERN001:return function(d,B){return d%2==0};case o.PATTERN010:return function(d,B){return B%3==0};case o.PATTERN011:return function(d,B){return(d+B)%3==0};case o.PATTERN100:return function(d,B){return(Math.floor(d/2)+Math.floor(B/3))%2==0};case o.PATTERN101:return function(d,B){return d*B%2+d*B%3==0};case o.PATTERN110:return function(d,B){return(d*B%2+d*B%3)%2==0};case o.PATTERN111:return function(d,B){return(d*B%3+(d+B)%2)%2==0};default:throw"bad maskPattern:"+m}},x.getErrorCorrectPolynomial=function(m){for(var d=l([1],0),B=0;B<m;B+=1)d=d.multiply(l([1,a.gexp(B)],0));return d},x.getLengthInBits=function(m,d){if(1<=d&&d<10)switch(m){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw"mode:"+m}else if(d<27)switch(m){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw"mode:"+m}else if(d<41)switch(m){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw"mode:"+m}else throw"type:"+d},x.getLostPoint=function(m){for(var d=m.getModuleCount(),B=0,S=0;S<d;S+=1)for(var N=0;N<d;N+=1){for(var J=0,X=m.isDark(S,N),rt=-1;rt<=1;rt+=1)if(!(S+rt<0||d<=S+rt))for(var ct=-1;ct<=1;ct+=1)N+ct<0||d<=N+ct||rt==0&&ct==0||X==m.isDark(S+rt,N+ct)&&(J+=1);J>5&&(B+=3+J-5)}for(var S=0;S<d-1;S+=1)for(var N=0;N<d-1;N+=1){var ft=0;m.isDark(S,N)&&(ft+=1),m.isDark(S+1,N)&&(ft+=1),m.isDark(S,N+1)&&(ft+=1),m.isDark(S+1,N+1)&&(ft+=1),(ft==0||ft==4)&&(B+=3)}for(var S=0;S<d;S+=1)for(var N=0;N<d-6;N+=1)m.isDark(S,N)&&!m.isDark(S,N+1)&&m.isDark(S,N+2)&&m.isDark(S,N+3)&&m.isDark(S,N+4)&&!m.isDark(S,N+5)&&m.isDark(S,N+6)&&(B+=40);for(var N=0;N<d;N+=1)for(var S=0;S<d-6;S+=1)m.isDark(S,N)&&!m.isDark(S+1,N)&&m.isDark(S+2,N)&&m.isDark(S+3,N)&&m.isDark(S+4,N)&&!m.isDark(S+5,N)&&m.isDark(S+6,N)&&(B+=40);for(var Tt=0,N=0;N<d;N+=1)for(var S=0;S<d;S+=1)m.isDark(S,N)&&(Tt+=1);var Mt=Math.abs(100*Tt/d/d-50)/5;return B+=Mt*10,B},x})(),a=(function(){for(var A=new Array(256),M=new Array(256),L=0;L<8;L+=1)A[L]=1<<L;for(var L=8;L<256;L+=1)A[L]=A[L-4]^A[L-5]^A[L-6]^A[L-8];for(var L=0;L<255;L+=1)M[A[L]]=L;var T={};return T.glog=function(x){if(x<1)throw"glog("+x+")";return M[x]},T.gexp=function(x){for(;x<0;)x+=255;for(;x>=256;)x-=255;return A[x]},T})();function l(A,M){if(typeof A.length>"u")throw A.length+"/"+M;var L=(function(){for(var x=0;x<A.length&&A[x]==0;)x+=1;for(var I=new Array(A.length-x+M),m=0;m<A.length-x;m+=1)I[m]=A[m+x];return I})(),T={};return T.getAt=function(x){return L[x]},T.getLength=function(){return L.length},T.multiply=function(x){for(var I=new Array(T.getLength()+x.getLength()-1),m=0;m<T.getLength();m+=1)for(var d=0;d<x.getLength();d+=1)I[m+d]^=a.gexp(a.glog(T.getAt(m))+a.glog(x.getAt(d)));return l(I,0)},T.mod=function(x){if(T.getLength()-x.getLength()<0)return T;for(var I=a.glog(T.getAt(0))-a.glog(x.getAt(0)),m=new Array(T.getLength()),d=0;d<T.getLength();d+=1)m[d]=T.getAt(d);for(var d=0;d<x.getLength();d+=1)m[d]^=a.gexp(a.glog(x.getAt(d))+I);return l(m,0).mod(x)},T}var p=(function(){var A=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],M=function(x,I){var m={};return m.totalCount=x,m.dataCount=I,m},L={},T=function(x,I){switch(I){case s.L:return A[(x-1)*4+0];case s.M:return A[(x-1)*4+1];case s.Q:return A[(x-1)*4+2];case s.H:return A[(x-1)*4+3];default:return}};return L.getRSBlocks=function(x,I){var m=T(x,I);if(typeof m>"u")throw"bad rs block @ typeNumber:"+x+"/errorCorrectionLevel:"+I;for(var d=m.length/3,B=[],S=0;S<d;S+=1)for(var N=m[S*3+0],J=m[S*3+1],X=m[S*3+2],rt=0;rt<N;rt+=1)B.push(M(J,X));return B},L})(),b=function(){var A=[],M=0,L={};return L.getBuffer=function(){return A},L.getAt=function(T){var x=Math.floor(T/8);return(A[x]>>>7-T%8&1)==1},L.put=function(T,x){for(var I=0;I<x;I+=1)L.putBit((T>>>x-I-1&1)==1)},L.getLengthInBits=function(){return M},L.putBit=function(T){var x=Math.floor(M/8);A.length<=x&&A.push(0),T&&(A[x]|=128>>>M%8),M+=1},L},v=function(A){var M=e.MODE_NUMBER,L=A,T={};T.getMode=function(){return M},T.getLength=function(m){return L.length},T.write=function(m){for(var d=L,B=0;B+2<d.length;)m.put(x(d.substring(B,B+3)),10),B+=3;B<d.length&&(d.length-B==1?m.put(x(d.substring(B,B+1)),4):d.length-B==2&&m.put(x(d.substring(B,B+2)),7))};var x=function(m){for(var d=0,B=0;B<m.length;B+=1)d=d*10+I(m.charAt(B));return d},I=function(m){if("0"<=m&&m<="9")return m.charCodeAt(0)-48;throw"illegal char :"+m};return T},k=function(A){var M=e.MODE_ALPHA_NUM,L=A,T={};T.getMode=function(){return M},T.getLength=function(I){return L.length},T.write=function(I){for(var m=L,d=0;d+1<m.length;)I.put(x(m.charAt(d))*45+x(m.charAt(d+1)),11),d+=2;d<m.length&&I.put(x(m.charAt(d)),6)};var x=function(I){if("0"<=I&&I<="9")return I.charCodeAt(0)-48;if("A"<=I&&I<="Z")return I.charCodeAt(0)-65+10;switch(I){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+I}};return T},O=function(A){var M=e.MODE_8BIT_BYTE,L=A,T=t.stringToBytes(A),x={};return x.getMode=function(){return M},x.getLength=function(I){return T.length},x.write=function(I){for(var m=0;m<T.length;m+=1)I.put(T[m],8)},x},j=function(A){var M=e.MODE_KANJI,L=A,T=t.stringToBytesFuncs.SJIS;if(!T)throw"sjis not supported.";(function(m,d){var B=T(m);if(B.length!=2||(B[0]<<8|B[1])!=d)throw"sjis not supported."})("\u53CB",38726);var x=T(A),I={};return I.getMode=function(){return M},I.getLength=function(m){return~~(x.length/2)},I.write=function(m){for(var d=x,B=0;B+1<d.length;){var S=(255&d[B])<<8|255&d[B+1];if(33088<=S&&S<=40956)S-=33088;else if(57408<=S&&S<=60351)S-=49472;else throw"illegal char at "+(B+1)+"/"+S;S=(S>>>8&255)*192+(S&255),m.put(S,13),B+=2}if(B<d.length)throw"illegal char at "+(B+1)},I},K=function(){var A=[],M={};return M.writeByte=function(L){A.push(L&255)},M.writeShort=function(L){M.writeByte(L),M.writeByte(L>>>8)},M.writeBytes=function(L,T,x){T=T||0,x=x||L.length;for(var I=0;I<x;I+=1)M.writeByte(L[I+T])},M.writeString=function(L){for(var T=0;T<L.length;T+=1)M.writeByte(L.charCodeAt(T))},M.toByteArray=function(){return A},M.toString=function(){var L="";L+="[";for(var T=0;T<A.length;T+=1)T>0&&(L+=","),L+=A[T];return L+="]",L},M},Z=function(){var A=0,M=0,L=0,T="",x={},I=function(d){T+=String.fromCharCode(m(d&63))},m=function(d){if(!(d<0)){if(d<26)return 65+d;if(d<52)return 97+(d-26);if(d<62)return 48+(d-52);if(d==62)return 43;if(d==63)return 47}throw"n:"+d};return x.writeByte=function(d){for(A=A<<8|d&255,M+=8,L+=1;M>=6;)I(A>>>M-6),M-=6},x.flush=function(){if(M>0&&(I(A<<6-M),A=0,M=0),L%3!=0)for(var d=3-L%3,B=0;B<d;B+=1)T+="="},x.toString=function(){return T},x},z=function(A){var M=A,L=0,T=0,x=0,I={};I.read=function(){for(;x<8;){if(L>=M.length){if(x==0)return-1;throw"unexpected end of file./"+x}var d=M.charAt(L);if(L+=1,d=="=")return x=0,-1;if(d.match(/^\s$/))continue;T=T<<6|m(d.charCodeAt(0)),x+=6}var B=T>>>x-8&255;return x-=8,B};var m=function(d){if(65<=d&&d<=90)return d-65;if(97<=d&&d<=122)return d-97+26;if(48<=d&&d<=57)return d-48+52;if(d==43)return 62;if(d==47)return 63;throw"c:"+d};return I},et=function(A,M){var L=A,T=M,x=new Array(A*M),I={};I.setPixel=function(S,N,J){x[N*L+S]=J},I.write=function(S){S.writeString("GIF87a"),S.writeShort(L),S.writeShort(T),S.writeByte(128),S.writeByte(0),S.writeByte(0),S.writeByte(0),S.writeByte(0),S.writeByte(0),S.writeByte(255),S.writeByte(255),S.writeByte(255),S.writeString(","),S.writeShort(0),S.writeShort(0),S.writeShort(L),S.writeShort(T),S.writeByte(0);var N=2,J=d(N);S.writeByte(N);for(var X=0;J.length-X>255;)S.writeByte(255),S.writeBytes(J,X,255),X+=255;S.writeByte(J.length-X),S.writeBytes(J,X,J.length-X),S.writeByte(0),S.writeString(";")};var m=function(S){var N=S,J=0,X=0,rt={};return rt.write=function(ct,ft){if(ct>>>ft)throw"length over";for(;J+ft>=8;)N.writeByte(255&(ct<<J|X)),ft-=8-J,ct>>>=8-J,X=0,J=0;X=ct<<J|X,J=J+ft},rt.flush=function(){J>0&&N.writeByte(X)},rt},d=function(S){for(var N=1<<S,J=(1<<S)+1,X=S+1,rt=B(),ct=0;ct<N;ct+=1)rt.add(String.fromCharCode(ct));rt.add(String.fromCharCode(N)),rt.add(String.fromCharCode(J));var ft=K(),Tt=m(ft);Tt.write(N,X);var Mt=0,$t=String.fromCharCode(x[Mt]);for(Mt+=1;Mt<x.length;){var qs=String.fromCharCode(x[Mt]);Mt+=1,rt.contains($t+qs)?$t=$t+qs:(Tt.write(rt.indexOf($t),X),rt.size()<4095&&(rt.size()==1<<X&&(X+=1),rt.add($t+qs)),$t=qs)}return Tt.write(rt.indexOf($t),X),Tt.write(J,X),Tt.flush(),ft.toByteArray()},B=function(){var S={},N=0,J={};return J.add=function(X){if(J.contains(X))throw"dup key:"+X;S[X]=N,N+=1},J.size=function(){return N},J.indexOf=function(X){return S[X]},J.contains=function(X){return typeof S[X]<"u"},J};return I},nt=function(A,M,L){for(var T=et(A,M),x=0;x<M;x+=1)for(var I=0;I<A;I+=1)T.setPixel(I,x,L(I,x));var m=K();T.write(m);for(var d=Z(),B=m.toByteArray(),S=0;S<B.length;S+=1)d.writeByte(B[S]);return d.flush(),"data:image/gif;base64,"+d};return t})();(function(){ca.stringToBytesFuncs["UTF-8"]=function(t){function e(s){for(var o=[],n=0;n<s.length;n++){var a=s.charCodeAt(n);a<128?o.push(a):a<2048?o.push(192|a>>6,128|a&63):a<55296||a>=57344?o.push(224|a>>12,128|a>>6&63,128|a&63):(n++,a=65536+((a&1023)<<10|s.charCodeAt(n)&1023),o.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|a&63))}return o}return e(t)}})();(function(t){typeof define=="function"&&define.amd?define([],t):typeof la=="object"&&(ua.exports=t())})(function(){return ca})});var Ea={};Rn(Ea,{destroyNodexUiPreviews:()=>oi,enhanceMarkdownDiagrams:()=>Ai,expandSelfClosingTags:()=>fu,extractTagCaseMap:()=>eu,mountMarkdownEditor:()=>Si,normalizeOwlPreviewMarkup:()=>vu,parseMarkdown:()=>wi,primeNodexUiTemplates:()=>xu,renderMermaidBlocks:()=>wa,renderNodexUiBlocks:()=>Sa});function Zl(){return bn??(bn=import("./runtime/marked/marked.min.js").then(t=>{let e=t.marked||t.default?.marked||globalThis.marked;if(!e?.parse)throw new Error("NodexUI markdown: failed to load src/runtime/marked/marked.min.js");return e})),bn}function Jl(t){let e=t.closest("[data-bs-theme]")?.getAttribute("data-bs-theme")||document.documentElement.getAttribute("data-bs-theme");return(e?e==="dark":window.matchMedia?.("(prefers-color-scheme: dark)").matches)?"dark":"default"}function Yl(){return mn??(mn=import("./runtime/mermaid/mermaid.esm.min.mjs").then(t=>{let e=t.default||t;return e.initialize({startOnLoad:!1,securityLevel:"strict"}),e})),mn}function Xl(){return fn??(fn=import("./runtime/milkdown/milkdown-editor.js")),fn}async function wi(t,e={}){return(await Zl()).parse(String(t??""),{gfm:!0,breaks:!1,...e})}function vn(t,e,s,o=""){t.classList.add("b-markdown-diagram-error"),t.replaceChildren();let n=document.createElement("p");if(n.className="b-markdown-diagram-error-message",n.textContent=`Unable to render ${e} diagram: ${s?.message||s}`,t.append(n),o){let a=document.createElement("pre"),l=document.createElement("code");l.textContent=o,a.append(l),t.append(a)}}async function wa(t){let e=[...t.querySelectorAll("pre > code.language-mermaid")];if(!e.length)return;let s;try{s=await Yl()}catch(o){e.forEach(n=>{let a=n.closest("pre");a.replaceChildren(),a.className="b-markdown-diagram b-markdown-mermaid",vn(a,"mermaid",o,n.textContent)});return}s.initialize({startOnLoad:!1,securityLevel:"strict",theme:Jl(t)});for(let o of e){let n=o.textContent,a=o.closest("pre");a.replaceChildren(),a.className="b-markdown-diagram b-markdown-mermaid";try{let{svg:l}=await s.render(`b-mermaid-${++Gl}`,n);a.innerHTML=l}catch(l){vn(a,"mermaid",l,n)}}}function Ql(t){let e=globalThis.thebase;if(!e?.mountAll)return;let s=document.createElement("div");s.setAttribute("b-ui","toast"),s.setAttribute("b-att-state","open"),s.setAttribute("b-att-delay","2000"),s.className="b-markdown-b-copy-toast",s.textContent=t,document.body.append(s),e.mountAll(s),s.addEventListener("nodexui:close",()=>s.remove(),{once:!0})}function tu(t){let e=document.createElement("div");e.className="b-markdown-b-code";let s=document.createElement("button");s.type="button",s.className="b-markdown-b-copy";let o=document.createElement("span");ut(o,"copy",{label:"Copy code"}),s.append(o),s.addEventListener("click",async()=>{try{await Ws(t),s.dispatchEvent(new CustomEvent("nodexui:markdown-copy",{bubbles:!0,detail:{source:t}})),Ql("Copied to clipboard")}catch(l){s.dispatchEvent(new CustomEvent("nodexui:markdown-copy-error",{bubbles:!0,detail:{error:l}}))}}),e.append(s);let n=document.createElement("pre"),a=document.createElement("code");a.className="b-markdown-b-code-lines";for(let l of t.replace(/\n$/,"").split(`
13
- `)){let p=document.createElement("span");p.className="b-markdown-b-code-line",p.textContent=l,a.append(p)}return n.append(a),e.append(n),e}function ga(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function eu(t){let e=new Map;for(let s of t.matchAll(/<\/?([A-Z][A-Za-z0-9]*)\b/g))e.set(s[1].toLowerCase(),s[1]);return e}function su(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=globalThis.thebase,o=t.get(e.localName)||e.localName,n=ga(o),a=!!s?.component?.(n),l=ot(e.getAttribute("className")||e.getAttribute("class"));if(!a){let p=`b-${n}`;return e.className=l?`${p} ${l}`:p,e}e.setAttribute("b-ui",n),l&&(e.className=l);for(let p of[...e.attributes]){if(p.name==="class"||p.name==="className"||p.name==="b-ui"||/^on[A-Z]/.test(p.name))continue;let b=ot(p.value);e.removeAttribute(p.name),!(b===""||b==="false")&&e.setAttribute(`b-att-${ga(p.name)}`,b==="true"?"true":b)}return e}}function ot(t){if(!t)return"";let e=t.trim();return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Hi(t,e){for(;t.firstChild;)e.append(t.firstChild)}function Nt(t,e){return Hi(t,e),t.replaceWith(e),e}function ou(t){let e=document.createElement("div");e.setAttribute("b-field-group","");let s=ot(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Nt(t,e)}function ru(t){let e=document.createElement("div");e.setAttribute("b-ui","field");let s=ot(t.getAttribute("orientation")||""),o=ot(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-orientation",s),o&&(e.className=o),Nt(t,e)}function iu(t){let e=document.createElement("label");e.setAttribute("b-field-label","");let s=ot(t.getAttribute("for")||""),o=ot(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("for",s),o&&(e.className=o),Nt(t,e)}function va(t,e,s){let o=document.createElement(e);o.setAttribute(s,"");let n=ot(t.getAttribute("className")||t.getAttribute("class"));return n&&(o.className=n),Nt(t,o)}function nu(t){let e=t.getAttribute("type")||"",s=t.hasAttribute("variant")||t.hasAttribute("size")||t.hasAttribute("className")||t.hasAttribute("onClick")||t.hasAttribute("label")||e.trim().startsWith("'")||e.trim().startsWith('"');if(t.hasAttribute("b-ui")||!s)return t;let o=document.createElement("button");o.setAttribute("b-ui","button");let n=ot(e||"button"),a=ot(t.getAttribute("variant")||""),l=ot(t.getAttribute("size")||""),p=ot(t.getAttribute("className")||t.getAttribute("class")),b=ot(t.getAttribute("label")||"");return o.type=n||"button",a&&o.setAttribute("b-att-variant",a),l&&o.setAttribute("b-att-size",l),p&&(o.className=p),b&&!t.childNodes.length&&(o.textContent=b),Nt(t,o)}function au(t){if(t.hasAttribute("b-ui")||t.hasAttribute("b-icon"))return t;let e=ot(t.getAttribute("name")||t.getAttribute("icon")||"");if(!e)return t;let s=document.createElement("span");s.setAttribute("b-ui","icon"),s.setAttribute("b-att-icon",e);let o=ot(t.getAttribute("size")||""),n=ot(t.getAttribute("label")||""),a=ot(t.getAttribute("className")||t.getAttribute("class"));return o&&s.setAttribute("b-att-size",o),n&&s.setAttribute("b-att-label",n),a&&(s.className=a),Nt(t,s)}function cu(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","alert");let s=ot(t.getAttribute("variant")||""),o=ot(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-variant",s),o&&(e.className=o),Nt(t,e)}function gn(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=document.createElement("div"),o=ot(e.getAttribute("className")||e.getAttribute("class"));return s.className=o?`${t} ${o}`:t,Nt(e,s)}}function lu(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","accordion"),ot(t.getAttribute("multiple"))==="true"&&e.setAttribute("b-att-multiple","true");let s=ot(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Nt(t,e)}function uu(t){if(t.hasAttribute("b-accordion-item"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-item",""),ot(t.getAttribute("state"))==="open"&&e.setAttribute("b-att-state","open");let s=ot(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Nt(t,e)}function pu(t){if(t.hasAttribute("b-accordion-trigger"))return t;let e=document.createElement("button");e.type="button",e.setAttribute("b-accordion-trigger","");let s=ot(t.getAttribute("className")||t.getAttribute("class"));s&&(e.className=s),Hi(t,e);let o=document.createElement("span");return o.setAttribute("b-icon","chevron-down"),o.className="b-accordion-trigger-icon",e.append(o),t.replaceWith(e),e}function du(t){if(t.hasAttribute("b-accordion-panel"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-panel","");let s=ot(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Nt(t,e)}function hu(t){return xa+=1,`${t}-${xa}`}function Lt(t,e,s){return o=>{if(o.hasAttribute("b-ui"))return o;let n=document.createElement(t);t==="button"&&(n.type="button"),s&&n.setAttribute(s,"");let a=ot(o.getAttribute("className")||o.getAttribute("class"));return n.className=a?`${e} ${a}`:e,Nt(o,n)}}function bu(){let t=document.createElement("button");t.type="button",t.className="btn b-button btn-light btn-icon-sm b-dialog-close b-dialog-close-control",t.setAttribute("b-dialog-close",""),t.setAttribute("aria-label","Close");let e=document.createElement("span");e.setAttribute("b-ui","icon"),e.setAttribute("b-att-icon","x");let s=document.createElement("span");return s.className="visually-hidden",s.textContent="Close",t.append(e,s),t}function ya({tagPrefix:t,componentName:e,triggerTag:s,triggerClassName:o,panelClassName:n,closeButton:a}){return l=>{if(l.hasAttribute("b-ui"))return l;let p=l.querySelector(`:scope > ${t}trigger`),b=l.querySelector(`:scope > ${t}content`);if(!b)return l;let v=hu(`b-preview-${e}`),k=document.createElement(s);s==="button"&&(k.type="button"),k.className=o,k.setAttribute("b-att-trigger",`#${v}`),p&&Hi(p,k);let O=document.createElement("div");O.setAttribute("b-ui",e),O.id=v,O.setAttribute("b-att-trigger",`[b-att-trigger='#${v}']`);let j=document.createElement("div");j.className=n;let K=ot(b.getAttribute("size")||"");return K&&j.setAttribute("data-size",K),Hi(b,j),a&&j.append(a()),O.append(j),l.before(k,O),l.remove(),O}}function fu(t){return t.replace(/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^"'>])*?)\/>/g,(e,s,o)=>mu.has(s.toLowerCase())?e:`<${s}${o}></${s}>`)}function gu(t){t.querySelectorAll("t[t-esc]").forEach(e=>{let o=e.getAttribute("t-esc")?.includes(".length")?"0":"";e.replaceWith(document.createTextNode(`${o}${e.textContent||""}`))})}function vu(t,e){gu(t);let s={fieldgroup:ou,field:ru,fieldlabel:iu,fielddescription:n=>va(n,"p","b-field-description"),fielderror:n=>va(n,"p","b-field-error"),button:nu,icon:au,alert:cu,alerttitle:gn("b-alert-title"),alertdescription:gn("b-alert-description"),alertaction:gn("b-alert-action"),accordion:lu,accordionitem:uu,accordiontrigger:pu,accordioncontent:du,dialog:ya({tagPrefix:"dialog",componentName:"dialog",triggerTag:"span",triggerClassName:"b-dialog-trigger",panelClassName:"b-dialog-panel",closeButton:bu}),dialogheader:Lt("div","b-dialog-header"),dialogfooter:Lt("div","b-dialog-footer"),dialogtitle:Lt("h2","b-dialog-title"),dialogdescription:Lt("p","b-dialog-description"),dialogclose:Lt("button","btn b-button btn-outline-secondary b-dialog-close","b-dialog-close"),alertdialog:ya({tagPrefix:"alertdialog",componentName:"alert-dialog",triggerTag:"button",triggerClassName:"btn b-button btn-outline-secondary b-alert-dialog-trigger",panelClassName:"b-dialog-panel b-alert-dialog-panel"}),alertdialogheader:Lt("div","b-dialog-header b-alert-dialog-header"),alertdialogfooter:Lt("div","b-dialog-footer b-alert-dialog-footer"),alertdialogmedia:Lt("div","b-alert-dialog-media"),alertdialogtitle:Lt("h2","b-dialog-title b-alert-dialog-title"),alertdialogdescription:Lt("p","b-dialog-description b-alert-dialog-description"),alertdialogcancel:Lt("button","btn b-button btn-outline-secondary b-alert-dialog-cancel","b-alert-dialog-cancel"),alertdialogaction:Lt("button","btn b-button btn-primary b-alert-dialog-action","b-alert-dialog-action")},o=su(e);for(let n of[...t.querySelectorAll("*")]){let a=n.localName.toLowerCase();s[a]?s[a](n):e.has(a)&&o(n)}}function xu(t){Fi=Promise.resolve(t)}function yu(){return Fi??(Fi=ze("/dist/nodexui.templates.xml")),Fi}function oi(t){let e=xn.get(t);if(e){xn.delete(t);for(let s of e)try{s.destroy()}catch{}}}function Au(t){return new Set([...t.matchAll(wu)].map(e=>e[1]))}function Cu(t){let e=new Set;for(let s of t.matchAll(Su))e.add(s[1]);for(let s of t.matchAll(Eu))e.add(s[2]);return e}function ku(t){let e=jn({raw:[t]}),s=Au(t);class o extends c{setup(){this.state=$(Object.fromEntries([...s].map(a=>[a,""])))}}r(o,"template",e);for(let n of Cu(t))o.prototype[n]=function(){};return o}function Aa(t){t.querySelector("[data-slot='dropdown-menu'], .b-dropdown-menu, [b-ui='dropdown-menu'], [b-dropdown-menu]")&&t.classList.add("b-markdown-b-preview-overlay")}async function Lu(t,e){let[s,o]=await Promise.all([yu(),ku(e)]),n=await zs(o,t,{templates:s});return Aa(t),n}function Nu(t,e){let s=globalThis.thebase;if(!s?.mountAll)throw new Error("NodexUI runtime not found on the page \u2014 load dist/nodexui.min.js before mounting Markdown.");t.innerHTML=e,Aa(t),s.mountAll(t)}async function Sa(t){oi(t);let e=[...t.querySelectorAll("pre > code.language-base-ui")];if(!e.length)return;let s=new Set;for(let o of e){let n=o.textContent,a=o.closest("pre");a.replaceChildren(),a.className="b-markdown-live b-markdown-nodexui";let l=document.createElement("div");l.className="b-markdown-b-preview",a.append(l,tu(n));try{/<[A-Z]/.test(n)?s.add(await Lu(l,n)):Nu(l,n)}catch(p){vn(a,"NodexUI component",p,n)}}s.size&&xn.set(t,s)}function Ou(t){for(let e of t.querySelectorAll("li > input[type=checkbox]:not([aria-label])"))e.setAttribute("aria-label",e.parentElement.textContent.trim())}async function Ai(t,{mermaid:e=!0,nodexUi:s=!0}={}){Ou(t),e&&await wa(t),s&&await Sa(t)}async function Si(t){return(await Xl()).createMilkdownMarkdownEditor(t)}var bn,mn,fn,Gl,xa,mu,Fi,xn,wu,Su,Eu,Wi=Yt(()=>{_();It();Ri();Gl=0;xa=0;mu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);xn=new WeakMap;wu=/\bstate\.([A-Za-z_$][\w$]*)/g;Su=/\bthis\.([A-Za-z_$][\w$]*)\s*\(/g,Eu=/\bt-on-[\w:-]+\s*=\s*(["'])([A-Za-z_$][\w$]*)\1/g});U();R();var Pn="1.0.0";_();var Ln={};Rn(Ln,{Accordion:()=>Zo,AccordionContent:()=>Yo,AccordionItem:()=>Jo,AccordionTrigger:()=>ns,Alert:()=>Pt,AlertAction:()=>Vs,AlertDescription:()=>Xt,AlertDialog:()=>fo,AlertDialogAction:()=>Xe,AlertDialogCancel:()=>Ye,AlertDialogContent:()=>go,AlertDialogDescription:()=>Ao,AlertDialogFooter:()=>xo,AlertDialogHeader:()=>vo,AlertDialogMedia:()=>yo,AlertDialogTitle:()=>wo,AlertDialogTrigger:()=>Je,AlertTitle:()=>Ks,ApiDoc:()=>Zt,ApiDocGroup:()=>Jt,AspectRatio:()=>zr,Attachment:()=>Nr,AttachmentAction:()=>ks,AttachmentActions:()=>Rr,AttachmentContent:()=>Tr,AttachmentDescription:()=>Br,AttachmentDropzone:()=>$r,AttachmentGroup:()=>Mr,AttachmentMedia:()=>Or,AttachmentTitle:()=>Ir,AttachmentTrigger:()=>Ls,Avatar:()=>_r,Badge:()=>Ct,BlockViewer:()=>$s,Breadcrumb:()=>Ce,BreadcrumbEllipsis:()=>cs,BreadcrumbItem:()=>Le,BreadcrumbLink:()=>Ne,BreadcrumbList:()=>ke,BreadcrumbPage:()=>Oe,BreadcrumbSeparator:()=>Ft,Bubble:()=>Fr,Button:()=>P,ButtonGroup:()=>Kr,ButtonGroupSeparator:()=>Vr,ButtonGroupText:()=>Gr,Calendar:()=>Ss,Card:()=>ee,CardBody:()=>oe,CardDescription:()=>ie,CardFooter:()=>Gs,CardHeader:()=>se,CardTitle:()=>re,Carousel:()=>Er,CarouselNext:()=>Cs,CarouselPrevious:()=>Es,CarouselSlide:()=>Cr,Chart:()=>Sr,Checkbox:()=>xe,ClipboardButton:()=>_t,CodeEditor:()=>Ke,Collapsible:()=>Xo,CollapsibleContent:()=>Qo,CollapsibleTrigger:()=>as,Combobox:()=>wr,Command:()=>Ar,ContextMenu:()=>Wo,ContextMenuContent:()=>Vo,ContextMenuItem:()=>Go,ContextMenuTrigger:()=>Ko,DataTable:()=>As,DatePicker:()=>yr,Dialog:()=>pe,DialogClose:()=>Ve,DialogContent:()=>qt,DialogDescription:()=>me,DialogFooter:()=>he,DialogHeader:()=>de,DialogTitle:()=>be,DialogTrigger:()=>Zs,Direction:()=>Hr,Drawer:()=>So,DrawerClose:()=>ts,DrawerContent:()=>Eo,DrawerDescription:()=>No,DrawerFooter:()=>ko,DrawerHeader:()=>Co,DrawerTitle:()=>Lo,DrawerTrigger:()=>Qe,DropdownMenu:()=>ye,DropdownMenuCheckboxItem:()=>rs,DropdownMenuContent:()=>we,DropdownMenuGroup:()=>Do,DropdownMenuItem:()=>Ae,DropdownMenuLabel:()=>jo,DropdownMenuRadioGroup:()=>zo,DropdownMenuRadioItem:()=>is,DropdownMenuSeparator:()=>Fo,DropdownMenuShortcut:()=>Ho,DropdownMenuSub:()=>Se,DropdownMenuSubContent:()=>Ee,DropdownMenuSubTrigger:()=>jt,DropdownMenuTrigger:()=>Dt,Empty:()=>Js,EmptyContent:()=>eo,EmptyDescription:()=>to,EmptyHeader:()=>Ys,EmptyMedia:()=>Xs,EmptyTitle:()=>Qs,Field:()=>$e,FieldContent:()=>Yr,FieldDescription:()=>Pe,FieldError:()=>Ue,FieldGroup:()=>Me,FieldLabel:()=>_e,FieldLegend:()=>Jr,FieldSeparator:()=>Qr,FieldSet:()=>Zr,FieldTitle:()=>Xr,Form:()=>Us,HoverCard:()=>Po,HoverCardContent:()=>qo,HoverCardTrigger:()=>Uo,Icon:()=>tt,Input:()=>ne,InputOtp:()=>co,Item:()=>Wr,Kbd:()=>Qt,Label:()=>ti,Markdown:()=>Gt,MarkdownTree:()=>Ms,MarkdownTreeNode:()=>Ci,Marker:()=>ro,Menubar:()=>rr,Message:()=>Pr,MessageScroller:()=>Ur,NativeSelect:()=>ve,NavigationMenu:()=>sr,NavigationMenuItem:()=>or,Pagination:()=>tr,PaginationItem:()=>er,Popover:()=>$o,PopoverContent:()=>_o,PopoverTrigger:()=>os,Progress:()=>jr,Pwa:()=>ii,PwaBody:()=>ui,PwaClose:()=>Ps,PwaContent:()=>ni,PwaDescription:()=>li,PwaFooter:()=>di,PwaHeader:()=>ai,PwaSteps:()=>pi,PwaTitle:()=>ci,PwaTrigger:()=>_s,QRCard:()=>Ts,Questionnaire:()=>qr,QuestionnaireNext:()=>Os,QuestionnairePrevious:()=>Ns,QuestionnaireStep:()=>Dr,RadioGroup:()=>io,RadioGroupItem:()=>no,Resizable:()=>kr,ScrollArea:()=>Lr,Select:()=>uo,SelectContent:()=>po,SelectItem:()=>ho,SelectTrigger:()=>Ze,Separator:()=>so,Sheet:()=>Oo,SheetClose:()=>ss,SheetContent:()=>To,SheetDescription:()=>Mo,SheetFooter:()=>Bo,SheetHeader:()=>Io,SheetTitle:()=>Ro,SheetTrigger:()=>es,Shell:()=>fs,ShellContent:()=>vs,ShellHeader:()=>vr,ShellMain:()=>gr,ShellNav:()=>fr,ShellSidebar:()=>gs,ShellSidebarHeader:()=>mr,ShellUserMenu:()=>xs,Sidebar:()=>Wt,SidebarClose:()=>ps,SidebarContent:()=>Te,SidebarFooter:()=>nr,SidebarGroup:()=>Ie,SidebarGroupAction:()=>ds,SidebarGroupCollapsible:()=>hs,SidebarGroupContent:()=>ur,SidebarGroupLabel:()=>Be,SidebarHeader:()=>ir,SidebarInput:()=>cr,SidebarInset:()=>ar,SidebarMenu:()=>Kt,SidebarMenuAction:()=>bs,SidebarMenuBadge:()=>dr,SidebarMenuButton:()=>Ht,SidebarMenuItem:()=>Re,SidebarMenuSkeleton:()=>hr,SidebarMenuSub:()=>pr,SidebarMenuSubButton:()=>ms,SidebarMenuSubItem:()=>br,SidebarProvider:()=>yi,SidebarRail:()=>us,SidebarSeparator:()=>lr,SidebarTrigger:()=>ls,Skeleton:()=>fe,Slider:()=>ao,Spinner:()=>te,Switch:()=>Ge,TabContent:()=>ue,TabTrigger:()=>Ut,Table:()=>xr,Tabs:()=>ae,TabsContainer:()=>ce,TabsList:()=>le,TextEditor:()=>hi,Textarea:()=>ge,ThemeButton:()=>Vt,Toast:()=>zt,Toggle:()=>Is,ToggleGroup:()=>si,ToggleGroupItem:()=>Bs,Tooltip:()=>Rt,Typography:()=>oo,createNamedIcon:()=>Fs,findMarkdownTreeNode:()=>Cn,iconComponentName:()=>ha});_();R();_();It();R();var tt=class extends c{setup(){this.state=$({failed:!1}),At(e=>{if(this.state.failed=!1,typeof Image>"u"||!e||e===Ii)return;let s=new Image;return s.onerror=()=>{this.state.failed=!0},s.src=this.buildUrl(e),()=>{s.onload=null,s.onerror=null}},()=>[this.name])}buildUrl(e){return fi(e,{baseUrl:gt(this.props,"base-url","baseUrl")})}get name(){return gt(this.props,"icon","name")}get url(){return this.buildUrl(this.state.failed?Ii:this.name)}get style(){let e=[`--b-icon-url:url("${this.url.replace(/"/g,"%22")}")`];return this.props.size&&e.push(`--b-icon-size:${this.props.size}`),bt(e.join(";"),this.props.style)}get classNames(){return f("b-icon",this.props.className)}};r(tt,"template","nodexui.Icon"),r(tt,"props",{icon:i(String),name:i(String),label:i(String),title:i(String),size:i(String),"base-url":i(String),baseUrl:i(String),className:i(String),style:i([String,Object])});function Fs(t){return class extends tt{get name(){return gt(this.props,"icon","name")||t}}}Hs();var P=class extends c{setup(){this.rootRef=q("root"),this.props.getRef&&(Q(()=>this.props.getRef(this.rootRef.el)),st(()=>this.props.getRef(null)))}get classNames(){return this.props.unstyled?f(this.props.className):f("btn","b-button",mt[this.props.variant]||mt.default,vt[this.props.size],this.isIconOnly&&"b-button-icon",this.props.className)}get iconPosition(){return gt(this.props,"icon-position","iconPosition")==="end"?"end":"start"}get ariaLabel(){return gt(this.props,"aria-label","ariaLabel")}get ariaPressed(){return gt(this.props,"aria-pressed","ariaPressed")}get ariaInvalid(){let e=gt(this.props,"aria-invalid","ariaInvalid");return e===!0?"true":e}get isIconOnly(){return!!(this.props.icon&&!this.props.label&&!this.props.slots?.default)}onClick(e){if(this.props.href&&this.props.disabled){e.preventDefault();return}this.props.onClick?.(e)}};r(P,"template","nodexui.Button"),r(P,"components",{Icon:tt}),r(P,"props",{variant:i(String),size:i(String),type:i(String),href:i(String),disabled:i(Boolean),label:i(String),icon:i(String),"icon-position":i(String),iconPosition:i(String),unstyled:i(Boolean),attrs:i(Object),getRef:i(Function),...u,id:i(String),title:i(String),"aria-label":i(String),ariaLabel:i(String),"aria-pressed":i(String),ariaPressed:i(String),"aria-invalid":i([String,Boolean]),ariaInvalid:i([String,Boolean]),onClick:i(Function)});_();R();Ri();var _t=class extends c{setup(){this.state=$({copied:!1}),this.resetTimer=null,st(()=>window.clearTimeout(this.resetTimer))}get classNames(){return Bi(this.props)}get resetDelay(){return gt(this.props,"reset-delay","resetDelay")??2e3}get iconName(){return this.state.copied?this.props.copiedIcon||"check":this.props.icon||"copy"}get label(){return this.state.copied&&this.props.copiedLabel?this.props.copiedLabel:this.props.label}get ariaLabel(){return gt(this.props,"aria-label","ariaLabel")||this.label}get attrs(){return{"data-copied":this.state.copied?"true":void 0}}async onClick(e){if(this.props.disabled)return;let s=this.props.getValue?this.props.getValue():this.props.value??"";try{await Ws(s),this.state.copied=!0,window.clearTimeout(this.resetTimer),this.resetTimer=window.setTimeout(()=>{this.state.copied=!1},this.resetDelay),this.props.onCopy?.({value:s,event:e})}catch(o){this.props.onCopyError?.({error:o,event:e})}}};r(_t,"template","nodexui.ClipboardButton"),r(_t,"components",{Button:P}),r(_t,"props",{variant:i(String),size:i(String),value:i(String),getValue:i(Function),label:i(String),copiedLabel:i(String),icon:i(String),copiedIcon:i(String),"reset-delay":i(Number),resetDelay:i(Number),disabled:i(Boolean),...u,"aria-label":i(String),ariaLabel:i(String),onCopy:i(Function),onCopyError:i(Function)});_();R();_();function W(){let t=globalThis.bootstrap;if(!t)throw new Error("NodexUI: load dist/bootstrap.bundle.min.js before this script (globalThis.bootstrap is not set).");return t}R();var Fn={default:"b-alert-default",destructive:"b-alert-destructive",info:"b-alert-default",success:"alert-success",warning:"alert-warning",danger:"b-alert-destructive"},Pt=class extends c{setup(){this.rootRef=q("root"),this.bootstrapAlert=null,this.props.dismissible&&(Q(()=>{this.bootstrapAlert=new(W()).Alert(this.rootRef.el)}),st(()=>{this.bootstrapAlert?.dispose()}))}get classNames(){return f("alert","b-alert",Fn[this.props.variant]||Fn.default,this.props.dismissible&&"alert-dismissible",this.props.dismissible&&"fade",this.props.dismissible&&"show",this.props.className)}};r(Pt,"template","nodexui.Alert"),r(Pt,"components",{Button:P}),r(Pt,"props",{variant:i(String),dismissible:i(Boolean),...u});var Ks=class extends c{};r(Ks,"template","nodexui.AlertTitle"),r(Ks,"props",u);var Xt=class extends c{};r(Xt,"template","nodexui.AlertDescription"),r(Xt,"props",u);var Vs=class extends c{};r(Vs,"template","nodexui.AlertAction"),r(Vs,"props",u);_();R();var He={primary:"b-badge-primary",secondary:"b-badge-secondary",success:"b-badge-success",warning:"b-badge-warning",danger:"b-badge-danger",info:"b-badge-info",muted:"b-badge-muted"};var Ct=class extends c{get classNames(){return f("badge",He[this.props.variant]||He.secondary,this.props.pill&&"rounded-pill",this.props.className)}};r(Ct,"template","nodexui.Badge"),r(Ct,"props",{variant:i(String),pill:i(Boolean),label:i(String),...u});_();R();var Qt=class extends c{get classNames(){return f("b-kbd",this.props.className)}};r(Qt,"template","nodexui.Kbd"),r(Qt,"props",{...u});_();R();var te=class extends c{get classNames(){return f("b-spinner",this.props.type==="grow"?"spinner-grow":"spinner-border",this.props.className)}get label(){return this.props.label||"Loading"}};r(te,"template","nodexui.Spinner"),r(te,"props",{type:i(String),label:i(String),className:i(String),style:i([String,Object])});var Bt={line:["//"],block:["/*","*/"],quotes:`"'`},Mi={line:["#"],quotes:`"'`},Hn="auto break case char const continue default do double else enum extern float for goto if inline int long register restrict return short signed sizeof static struct switch typedef union unsigned void volatile while include define ifdef ifndef endif pragma",Qc="abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new null package private protected public return short static strictfp super switch synchronized this throw throws transient true false try var void volatile while record",Wn="async await break case catch class const continue debugger default delete do else export extends false finally for from function if import in instanceof let new null of return static super switch this throw true try typeof undefined var void while with yield",gi={plaintext:{label:"Plain text",indent:" "},javascript:{label:"JavaScript",...Bt,quotes:"\"'`",multiline:"`",indent:" ",keywords:Wn,builtins:"console document window JSON Math Object Array Promise Map Set Date Number String Boolean Symbol require module exports process"},typescript:{annotations:!0,label:"TypeScript",...Bt,quotes:"\"'`",multiline:"`",indent:" ",keywords:`${Wn} abstract as declare enum implements interface keyof namespace private protected public readonly type`,builtins:"console JSON Math Object Array Promise Map Set Date Number string number boolean any unknown never void Record Partial Readonly"},go:{label:"Go",...Bt,quotes:"\"'`",multiline:"`",indent:" ",keywords:"break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var nil true false",builtins:"append cap close complex copy delete imag len make new panic print println real recover string int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 uintptr float32 float64 bool byte rune error any context fmt"},c:{label:"C",...Bt,indent:" ",keywords:Hn,builtins:"NULL size_t printf scanf malloc free memcpy memset strlen strcmp FILE stdin stdout stderr uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t bool"},cpp:{label:"C++",...Bt,indent:" ",keywords:`${Hn} alignas alignof and bool catch class constexpr const_cast decltype delete dynamic_cast explicit export false friend mutable namespace new noexcept nullptr operator or private protected public reinterpret_cast static_assert static_cast template this throw true try typeid typename using virtual override final`,builtins:"std string vector map set unordered_map unique_ptr shared_ptr cout cin endl size_t NULL"},java:{annotations:!0,label:"Java",...Bt,indent:" ",keywords:Qc,builtins:"String System Object Integer Long Double Boolean List Map Set ArrayList HashMap Exception Override Math"},csharp:{label:"C#",...Bt,indent:" ",keywords:"abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using var virtual void volatile while async await record",builtins:"Console String List Dictionary Task Math Exception"},kotlin:{annotations:!0,label:"Kotlin",...Bt,quotes:`"'`,indent:" ",keywords:"abstract as break by catch class companion const constructor continue data do else enum false final finally for fun if import in infix init inline interface internal is lateinit null object open operator override package private protected public return sealed super suspend this throw true try typealias val var when while",builtins:"String Int Long Double Boolean List Map Set Any Unit println"},swift:{label:"Swift",...Bt,indent:" ",keywords:"as associatedtype break case catch class continue default defer deinit do else enum extension fallthrough false fileprivate for func guard if import in init inout internal is let nil open operator private protocol public repeat rethrows return self static struct subscript super switch throw throws true try typealias var where while async await",builtins:"String Int Double Bool Array Dictionary Set Any print"},rust:{label:"Rust",...Bt,quotes:'"',indent:" ",keywords:"as async await break const continue crate dyn else enum extern false fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait true type unsafe use where while",builtins:"String Vec Option Result Some None Ok Err Box Rc Arc println format vec i8 i16 i32 i64 u8 u16 u32 u64 usize isize f32 f64 bool str"},php:{label:"PHP",variables:!0,line:["//","#"],block:["/*","*/"],quotes:`"'`,indent:" ",keywords:"abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty extends final finally fn for foreach function global if implements include instanceof interface isset namespace new null or print private protected public require return static switch this throw trait true false try unset use var while yield",builtins:"count strlen array_map array_filter in_array json_encode json_decode var_dump"},python:{annotations:!0,label:"Python",...Mi,indent:" ",keywords:"and as assert async await break class continue def del elif else except False finally for from global if import in is lambda None nonlocal not or pass raise return True try while with yield match case",builtins:"print len range str int float bool list dict set tuple open isinstance super self cls enumerate zip map filter sorted sum min max abs"},ruby:{label:"Ruby",...Mi,indent:" ",keywords:"BEGIN END alias and begin break case class def defined do else elsif end ensure false for if in module next nil not or redo rescue retry return self super then true undef unless until when while yield",builtins:"puts print require require_relative attr_accessor attr_reader attr_writer lambda proc raise"},bash:{label:"Shell",variables:!0,...Mi,indent:" ",keywords:"case do done elif else esac fi for function if in select then until while",builtins:"echo cd ls cat grep sed awk export source exit read printf test set unset local return trap"},sql:{label:"SQL",line:["--"],block:["/*","*/"],quotes:`"'`,indent:" ",ci:!0,keywords:"add all alter and as asc begin between by case check column commit constraint create cross database default delete desc distinct drop else end exists foreign from full group having if in index inner insert into is join key left like limit not null offset on or order outer primary references returning right rollback select set table then transaction union unique update values view when where with",builtins:"count sum avg min max coalesce now cast varchar text integer int bigint boolean timestamp date numeric serial"},json:{label:"JSON",plainWords:!0,keys:!0,quotes:'"',indent:" ",keywords:"true false null"},yaml:{label:"YAML",plainWords:!0,keys:!0,...Mi,indent:" ",keywords:"true false null yes no on off"},css:{label:"CSS",plainWords:!0,keys:"prop",dashed:!0,hex:!0,block:["/*","*/"],quotes:`"'`,indent:" ",keywords:"important inherit initial unset auto none",builtins:"var calc rgb rgba hsl hsla url"},html:{label:"HTML",plainWords:!0,tags:!0,block:["<!--","-->"],quotes:`"'`,indent:" "},lua:{label:"Lua",line:["--"],block:["--[[","]]"],quotes:`"'`,indent:" ",keywords:"and break do else elseif end false for function goto if in local nil not or repeat return then true until while",builtins:"assert error ipairs next pairs pcall print select tonumber tostring type unpack xpcall string table math os"}};gi.xml={...gi.html,label:"XML"};var tl={js:"javascript",jsx:"javascript",node:"javascript",ts:"typescript",tsx:"typescript",golang:"go",h:"c","c++":"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"csharp","c#":"csharp",kt:"kotlin",rs:"rust",py:"python",rb:"ruby",sh:"bash",shell:"bash",zsh:"bash",postgres:"sql",postgresql:"sql",mysql:"sql",mjs:"javascript",cjs:"javascript",htm:"html",yml:"yaml",svg:"xml",text:"plaintext",txt:"plaintext"},el={comment:"b-code-comment",string:"b-code-string",number:"b-code-number",keyword:"b-code-keyword",builtin:"b-code-builtin",function:"b-code-function",type:"b-code-type",tag:"b-code-tag",attr:"b-code-attr",meta:"b-code-meta",variable:"b-code-variable",plain:""},ln=/[A-Za-z_$]/,Jn=/[A-Za-z0-9_$]/,Yn=/[A-Za-z0-9_:-]/,sl=/[0-9A-Za-z_.]/,Kn=/[0-9]/,ol=/[A-Za-z0-9_-]/,Vn=/^#[0-9a-fA-F]{3,8}\b/,rl=/^&#?\w+;/,il=/[A-Za-z/!?]/,cn=new Map;function Gn(t,e){return new Set((t?e?t.toLowerCase():t:"").split(" ").filter(Boolean))}function xi(t){let e=String(t??"").trim().toLowerCase(),s=tl[e]??e,o=s in gi?s:"plaintext";if(!cn.has(o)){let n=gi[o];cn.set(o,{id:o,...n,keywordSet:Gn(n.keywords,n.ci),builtinSet:Gn(n.builtins,n.ci)})}return cn.get(o)}function Xn(t){let e=String(t??"").split(/[?#]/)[0].split("/").pop();return e.includes(".")?e.split(".").pop().toLowerCase():""}var Dh=Object.keys(gi);function vi(t,e,s){let o=e;for(;o<t.length&&s.test(t[o]);)o+=1;return o}function nl(t,e,s){if(s.block&&t.startsWith(s.block[0],e)){let n=t.indexOf(s.block[1],e+s.block[0].length);return n===-1?t.length:n+s.block[1].length}if(!s.line?.some(n=>t.startsWith(n,e)))return-1;let o=t.indexOf(`
14
- `,e);return o===-1?t.length:o}function Qn(t,e,s){let o=t[e],n=s.multiline?.includes(o),a=e+1;for(;a<t.length&&t[a]!==o&&(n||t[a]!==`
15
- `);)a+=t[a]==="\\"?2:1;return Math.min(t.length,t[a]===o?a+1:a)}function al(t,e){let s=e-1;for(;s>=0&&/\s/.test(t[s]);)s-=1;return t[s]}function Zn(t,e,s,o){return!o.keys||!/^\s*:(?!:|\/\/)/.test(t.slice(s,s+8))?!1:o.keys!=="prop"||"{;".includes(al(t,e))}function cl(t,e,s,o){let n=o.ci?t.slice(e,s).toLowerCase():t.slice(e,s);if(o.keywordSet.has(n))return"keyword";let a=t[e-1]==="."||t[e-1]===":";return o.builtinSet.has(n)&&!a?"builtin":o.plainWords?"plain":/^\s*\(/.test(t.slice(s,s+8))?"function":/^[A-Z][A-Za-z0-9_$]*[a-z]/.test(n)?"type":"plain"}function ll(t,e,s,o){let n=t[e],a=/^(\/|\?)?>/.exec(t.slice(e,e+2));return a?(o.inTag=!1,["tag",e+a[0].length]):s.quotes.includes(n)?["string",Qn(t,e,s)]:ln.test(n)?["attr",vi(t,e+1,Yn)]:["plain",e+1]}function ul(t,e,s){if(t[e]==="<"&&il.test(t[e+1]??""))return s.inTag=!0,["tag",vi(t,e+2,Yn)];let o=t[e]==="&"?rl.exec(t.slice(e,e+12)):null;return o?["number",e+o[0].length]:["plain",e+1]}function pl(t,e,s){let o=t[e];return!(o==="$"&&s.variables||o==="@"&&s.annotations)||!ln.test(t[e+1]??"")?null:[o==="$"?"variable":"meta",vi(t,e+2,Jn)]}function dl(t,e,s,o,n){let a=t[e];if(n.inTag)return ll(t,e,s,n);let l=nl(t,e,s);if(l!==-1)return["comment",l];if(s.tags)return ul(t,e,n);if(s.quotes?.includes(a)){let j=Qn(t,e,s);return[Zn(t,e,j,s)?"attr":"string",j]}if(s.hex&&a==="#"&&Vn.test(t.slice(e,e+10)))return["number",e+Vn.exec(t.slice(e,e+10))[0].length];if(Kn.test(a)||a==="."&&Kn.test(t[e+1]??""))return["number",vi(t,e+1,sl)];let p=pl(t,e,s);if(p)return p;let b=s.dashed&&a==="-"&&/[A-Za-z-]/.test(t[e+1]??"");if(!ln.test(a)&&!b)return["plain",e+1];let v=vi(t,e+1,s.dashed?ol:Jn);if(Zn(t,e,v,s))return["attr",v];let k=cl(t,e,v,s);return[k==="plain"&&o.has(t.slice(e,v))&&t[e-1]!=="."?"builtin":k,v]}function $i(t,e,s=[]){let o=xi(e),n=new Set(s),a={inTag:!1},l=[],p=0;for(;p<t.length;){let[b,v]=dl(t,p,o,n,a),k=t.slice(p,v),O=l[l.length-1];b==="plain"&&O?.kind==="plain"?O.text+=k:l.push({kind:b,text:k,className:el[b]}),p=v}return l}function ta(t,e){return t.startsWith(" ")?1:/^ */.exec(t.slice(0,e.length))[0].length}var hl=new Set(["javascript","typescript","go","c","cpp","java","csharp","kotlin","swift","rust","php","css","lua","html","xml"]),bl=new Set("area base br col embed hr img input link meta source track wbr".split(" ")),ml=/^[}\])]+/,fl=/\b(function|if|for|while|repeat)\b/g,gl=/\b(end|until)\b/g,vl=/^(else|elseif)\b/,xl=/^(end|until)\b/;function We(t,e){return(t.match(e)??[]).length}function yl(t,e){let s=new Uint8Array(t.length),o="",n=0;for(let{kind:a,text:l}of $i(t,e)){let p=a==="comment"||a==="string";o+=p?l.replace(/[^\n]/g," "):l,p&&s.fill(1,n,n+l.length),n+=l.length}return{masked:o,inside:s}}function wl(t,e){let s=p=>!(e&&bl.has(p.toLowerCase())),o=[...t.matchAll(/<([A-Za-z][\w:.-]*)/g)].filter(p=>s(p[1])).length,n=[...t.matchAll(/<([A-Za-z][\w:.-]*)[^<>]*\/>/g)].filter(p=>s(p[1])).length,a=t.includes("<")?0:We(t,/\/>/g);return{leading:We(/^(?:<\/[^>]*>\s*)+/.exec(t)?.[0]??"",/<\//g),net:o-n-a-We(t,/<\//g)}}function Al(t,e){let s=t.trim();if(e.tags)return wl(s,e.id==="html");let o=e.id==="lua",n=ml.exec(s)?.[0].length??0,a=We(s,/[{([]/g)-We(s,/[})\]]/g);if(!o)return{leading:n,net:a};let l=We(s,fl)+(/^do\b/.test(s)?1:0)-We(s,gl);return{leading:n||(vl.test(s)||xl.test(s)?1:0),net:a+l}}function Sl(t,e){return(t.id==="c"||t.id==="cpp")&&e.startsWith("#")}function El(t,e){let{masked:s,inside:o}=yl(t,e.id),n=[],a=0,l=0;for(let p of t.split(`
16
- `)){let b=s.slice(l,l+p.length),v=l>0&&o[l-1]===1;l+=p.length+1;let k=p.trim(),{leading:O,net:j}=Al(b,e);v?n.push(p.trimEnd()):k?Sl(e,k)?n.push(k):n.push(e.indent.repeat(Math.max(0,a-O))+k):n.push(""),a=Math.max(0,a+j)}return n}function Cl(t){return t.split(`
17
- `).map(e=>e.trimEnd())}function kl(t){return`${t.filter((s,o)=>s!==""||o>0&&t[o-1]!=="").join(`
10
+ var Sc=Object.create;var wn=Object.defineProperty;var Ac=Object.getOwnPropertyDescriptor;var Ec=Object.getOwnPropertyNames;var Cc=Object.getPrototypeOf,kc=Object.prototype.hasOwnProperty;var Lc=(t,e,s)=>e in t?wn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var Nc=(t,e,s)=>()=>{if(s)throw s[0];try{return t&&(e=t(t=0)),e}catch(o){throw s=[o],o}};var Tc=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(s){throw e=0,s}},_i=(t,e)=>{for(var s in e)wn(t,s,{get:e[s],enumerable:!0})},Oc=(t,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ec(e))!kc.call(t,i)&&i!==s&&wn(t,i,{get:()=>e[i],enumerable:!(o=Ac(e,i))||o.enumerable});return t};var Ic=(t,e,s)=>(s=t!=null?Sc(Cc(t)):{},Oc(e||!t||!t.__esModule?wn(s,"default",{value:t,enumerable:!0}):s,t));var r=(t,e,s)=>Lc(t,typeof e!="symbol"?e+"":e,s);var ba=Tc((ha,ma)=>{var da=(function(){var t=function(N,M){var k=236,B=17,x=N,T=s[M],b=null,h=0,O=null,A=[],L={},H=function(y,w){h=x*4+17,b=(function(g){for(var E=new Array(g),C=0;C<g;C+=1){E[C]=new Array(g);for(var _=0;_<g;_+=1)E[C][_]=null}return E})(h),V(0,0),V(h-7,0),V(0,h-7),ht(),it(),It(y,w),x>=7&&Nt(y),O==null&&(O=yc(x,T,A)),Bt(O,w)},V=function(y,w){for(var g=-1;g<=7;g+=1)if(!(y+g<=-1||h<=y+g))for(var E=-1;E<=7;E+=1)w+E<=-1||h<=w+E||(0<=g&&g<=6&&(E==0||E==6)||0<=E&&E<=6&&(g==0||g==6)||2<=g&&g<=4&&2<=E&&E<=4?b[y+g][w+E]=!0:b[y+g][w+E]=!1)},et=function(){for(var y=0,w=0,g=0;g<8;g+=1){H(!0,g);var E=i.getLostPoint(L);(g==0||y>E)&&(y=E,w=g)}return w},it=function(){for(var y=8;y<h-8;y+=1)b[y][6]==null&&(b[y][6]=y%2==0);for(var w=8;w<h-8;w+=1)b[6][w]==null&&(b[6][w]=w%2==0)},ht=function(){for(var y=i.getPatternPosition(x),w=0;w<y.length;w+=1)for(var g=0;g<y.length;g+=1){var E=y[w],C=y[g];if(b[E][C]==null)for(var _=-2;_<=2;_+=1)for(var D=-2;D<=2;D+=1)_==-2||_==2||D==-2||D==2||_==0&&D==0?b[E+_][C+D]=!0:b[E+_][C+D]=!1}},Nt=function(y){for(var w=i.getBCHTypeNumber(x),g=0;g<18;g+=1){var E=!y&&(w>>g&1)==1;b[Math.floor(g/3)][g%3+h-8-3]=E}for(var g=0;g<18;g+=1){var E=!y&&(w>>g&1)==1;b[g%3+h-8-3][Math.floor(g/3)]=E}},It=function(y,w){for(var g=T<<3|w,E=i.getBCHTypeInfo(g),C=0;C<15;C+=1){var _=!y&&(E>>C&1)==1;C<6?b[C][8]=_:C<8?b[C+1][8]=_:b[h-15+C][8]=_}for(var C=0;C<15;C+=1){var _=!y&&(E>>C&1)==1;C<8?b[8][h-C-1]=_:C<9?b[8][15-C-1+1]=_:b[8][15-C-1]=_}b[h-8][8]=!y},Bt=function(y,w){for(var g=-1,E=h-1,C=7,_=0,D=i.getMaskFunction(w),q=h-1;q>0;q-=2)for(q==6&&(q-=1);;){for(var st=0;st<2;st+=1)if(b[E][q-st]==null){var lt=!1;_<y.length&&(lt=(y[_]>>>C&1)==1);var F=D(E,q-st);F&&(lt=!lt),b[E][q-st]=lt,C-=1,C==-1&&(_+=1,C=7)}if(E+=g,E<0||h<=E){E-=g,g=-g;break}}},$s=function(y,w){for(var g=0,E=0,C=0,_=new Array(w.length),D=new Array(w.length),q=0;q<w.length;q+=1){var st=w[q].dataCount,lt=w[q].totalCount-st;E=Math.max(E,st),C=Math.max(C,lt),_[q]=new Array(st);for(var F=0;F<_[q].length;F+=1)_[q][F]=255&y.getBuffer()[F+g];g+=st;var wt=i.getErrorCorrectPolynomial(lt),St=c(_[q],wt.getLength()-1),Ri=St.mod(wt);D[q]=new Array(wt.getLength()-1);for(var F=0;F<D[q].length;F+=1){var Mi=F+Ri.getLength()-D[q].length;D[q][F]=Mi>=0?Ri.getAt(Mi):0}}for(var $i=0,F=0;F<w.length;F+=1)$i+=w[F].totalCount;for(var Xn=new Array($i),yn=0,F=0;F<E;F+=1)for(var q=0;q<w.length;q+=1)F<_[q].length&&(Xn[yn]=_[q][F],yn+=1);for(var F=0;F<C;F+=1)for(var q=0;q<w.length;q+=1)F<D[q].length&&(Xn[yn]=D[q][F],yn+=1);return Xn},yc=function(y,w,g){for(var E=u.getRSBlocks(y,w),C=d(),_=0;_<g.length;_+=1){var D=g[_];C.put(D.getMode(),4),C.put(D.getLength(),i.getLengthInBits(D.getMode(),y)),D.write(C)}for(var q=0,_=0;_<E.length;_+=1)q+=E[_].dataCount;if(C.getLengthInBits()>q*8)throw"code length overflow. ("+C.getLengthInBits()+">"+q*8+")";for(C.getLengthInBits()+4<=q*8&&C.put(0,4);C.getLengthInBits()%8!=0;)C.putBit(!1);for(;!(C.getLengthInBits()>=q*8||(C.put(k,8),C.getLengthInBits()>=q*8));)C.put(B,8);return $s(C,E)};L.addData=function(y,w){w=w||"Byte";var g=null;switch(w){case"Numeric":g=v(y);break;case"Alphanumeric":g=S(y);break;case"Byte":g=P(y);break;case"Kanji":g=U(y);break;default:throw"mode:"+w}A.push(g),O=null},L.isDark=function(y,w){if(y<0||h<=y||w<0||h<=w)throw y+","+w;return b[y][w]},L.getModuleCount=function(){return h},L.make=function(){if(x<1){for(var y=1;y<40;y++){for(var w=u.getRSBlocks(y,T),g=d(),E=0;E<A.length;E++){var C=A[E];g.put(C.getMode(),4),g.put(C.getLength(),i.getLengthInBits(C.getMode(),y)),C.write(g)}for(var _=0,E=0;E<w.length;E++)_+=w[E].dataCount;if(g.getLengthInBits()<=_*8)break}x=y}H(!1,et())},L.createTableTag=function(y,w){y=y||2,w=typeof w>"u"?y*4:w;var g="";g+='<table style="',g+=" border-width: 0px; border-style: none;",g+=" border-collapse: collapse;",g+=" padding: 0px; margin: "+w+"px;",g+='">',g+="<tbody>";for(var E=0;E<L.getModuleCount();E+=1){g+="<tr>";for(var C=0;C<L.getModuleCount();C+=1)g+='<td style="',g+=" border-width: 0px; border-style: none;",g+=" border-collapse: collapse;",g+=" padding: 0px; margin: 0px;",g+=" width: "+y+"px;",g+=" height: "+y+"px;",g+=" background-color: ",g+=L.isDark(E,C)?"#000000":"#ffffff",g+=";",g+='"/>';g+="</tr>"}return g+="</tbody>",g+="</table>",g},L.createSvgTag=function(y,w,g,E){var C={};typeof arguments[0]=="object"&&(C=arguments[0],y=C.cellSize,w=C.margin,g=C.alt,E=C.title),y=y||2,w=typeof w>"u"?y*4:w,g=typeof g=="string"?{text:g}:g||{},g.text=g.text||null,g.id=g.text?g.id||"qrcode-description":null,E=typeof E=="string"?{text:E}:E||{},E.text=E.text||null,E.id=E.text?E.id||"qrcode-title":null;var _=L.getModuleCount()*y+w*2,D,q,st,lt,F="",wt;for(wt="l"+y+",0 0,"+y+" -"+y+",0 0,-"+y+"z ",F+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',F+=C.scalable?"":' width="'+_+'px" height="'+_+'px"',F+=' viewBox="0 0 '+_+" "+_+'" ',F+=' preserveAspectRatio="xMinYMin meet"',F+=E.text||g.text?' role="img" aria-labelledby="'+_s([E.id,g.id].join(" ").trim())+'"':"",F+=">",F+=E.text?'<title id="'+_s(E.id)+'">'+_s(E.text)+"</title>":"",F+=g.text?'<description id="'+_s(g.id)+'">'+_s(g.text)+"</description>":"",F+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',F+='<path d="',st=0;st<L.getModuleCount();st+=1)for(lt=st*y+w,D=0;D<L.getModuleCount();D+=1)L.isDark(st,D)&&(q=D*y+w,F+="M"+q+","+lt+wt);return F+='" stroke="transparent" fill="black"/>',F+="</svg>",F},L.createDataURL=function(y,w){y=y||2,w=typeof w>"u"?y*4:w;var g=L.getModuleCount()*y+w*2,E=w,C=g-w;return vt(g,g,function(_,D){if(E<=_&&_<C&&E<=D&&D<C){var q=Math.floor((_-E)/y),st=Math.floor((D-E)/y);return L.isDark(st,q)?0:1}else return 1})},L.createImgTag=function(y,w,g){y=y||2,w=typeof w>"u"?y*4:w;var E=L.getModuleCount()*y+w*2,C="";return C+="<img",C+=' src="',C+=L.createDataURL(y,w),C+='"',C+=' width="',C+=E,C+='"',C+=' height="',C+=E,C+='"',g&&(C+=' alt="',C+=_s(g),C+='"'),C+="/>",C};var _s=function(y){for(var w="",g=0;g<y.length;g+=1){var E=y.charAt(g);switch(E){case"<":w+="&lt;";break;case">":w+="&gt;";break;case"&":w+="&amp;";break;case'"':w+="&quot;";break;default:w+=E;break}}return w},wc=function(y){var w=1;y=typeof y>"u"?w*2:y;var g=L.getModuleCount()*w+y*2,E=y,C=g-y,_,D,q,st,lt,F={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},wt={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},St="";for(_=0;_<g;_+=2){for(q=Math.floor((_-E)/w),st=Math.floor((_+1-E)/w),D=0;D<g;D+=1)lt="\u2588",E<=D&&D<C&&E<=_&&_<C&&L.isDark(q,Math.floor((D-E)/w))&&(lt=" "),E<=D&&D<C&&E<=_+1&&_+1<C&&L.isDark(st,Math.floor((D-E)/w))?lt+=" ":lt+="\u2588",St+=y<1&&_+1>=C?wt[lt]:F[lt];St+=`
11
+ `}return g%2&&y>0?St.substring(0,St.length-g-1)+Array(g+1).join("\u2580"):St.substring(0,St.length-1)};return L.createASCII=function(y,w){if(y=y||1,y<2)return wc(w);y-=1,w=typeof w>"u"?y*2:w;var g=L.getModuleCount()*y+w*2,E=w,C=g-w,_,D,q,st,lt=Array(y+1).join("\u2588\u2588"),F=Array(y+1).join(" "),wt="",St="";for(_=0;_<g;_+=1){for(q=Math.floor((_-E)/y),St="",D=0;D<g;D+=1)st=1,E<=D&&D<C&&E<=_&&_<C&&L.isDark(q,Math.floor((D-E)/y))&&(st=0),St+=st?lt:F;for(q=0;q<y;q+=1)wt+=St+`
12
+ `}return wt.substring(0,wt.length-1)},L.renderTo2dContext=function(y,w){w=w||2;for(var g=L.getModuleCount(),E=0;E<g;E++)for(var C=0;C<g;C++)y.fillStyle=L.isDark(E,C)?"black":"white",y.fillRect(E*w,C*w,w,w)},L};t.stringToBytesFuncs={default:function(N){for(var M=[],k=0;k<N.length;k+=1){var B=N.charCodeAt(k);M.push(B&255)}return M}},t.stringToBytes=t.stringToBytesFuncs.default,t.createStringToBytes=function(N,M){var k=(function(){for(var x=J(N),T=function(){var it=x.read();if(it==-1)throw"eof";return it},b=0,h={};;){var O=x.read();if(O==-1)break;var A=T(),L=T(),H=T(),V=String.fromCharCode(O<<8|A),et=L<<8|H;h[V]=et,b+=1}if(b!=M)throw b+" != "+M;return h})(),B=63;return function(x){for(var T=[],b=0;b<x.length;b+=1){var h=x.charCodeAt(b);if(h<128)T.push(h);else{var O=k[x.charAt(b)];typeof O=="number"?(O&255)==O?T.push(O):(T.push(O>>>8),T.push(O&255)):T.push(B)}}return T}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},s={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},i=(function(){var N=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],M=1335,k=7973,B=21522,x={},T=function(b){for(var h=0;b!=0;)h+=1,b>>>=1;return h};return x.getBCHTypeInfo=function(b){for(var h=b<<10;T(h)-T(M)>=0;)h^=M<<T(h)-T(M);return(b<<10|h)^B},x.getBCHTypeNumber=function(b){for(var h=b<<12;T(h)-T(k)>=0;)h^=k<<T(h)-T(k);return b<<12|h},x.getPatternPosition=function(b){return N[b-1]},x.getMaskFunction=function(b){switch(b){case o.PATTERN000:return function(h,O){return(h+O)%2==0};case o.PATTERN001:return function(h,O){return h%2==0};case o.PATTERN010:return function(h,O){return O%3==0};case o.PATTERN011:return function(h,O){return(h+O)%3==0};case o.PATTERN100:return function(h,O){return(Math.floor(h/2)+Math.floor(O/3))%2==0};case o.PATTERN101:return function(h,O){return h*O%2+h*O%3==0};case o.PATTERN110:return function(h,O){return(h*O%2+h*O%3)%2==0};case o.PATTERN111:return function(h,O){return(h*O%3+(h+O)%2)%2==0};default:throw"bad maskPattern:"+b}},x.getErrorCorrectPolynomial=function(b){for(var h=c([1],0),O=0;O<b;O+=1)h=h.multiply(c([1,a.gexp(O)],0));return h},x.getLengthInBits=function(b,h){if(1<=h&&h<10)switch(b){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw"mode:"+b}else if(h<27)switch(b){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw"mode:"+b}else if(h<41)switch(b){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw"mode:"+b}else throw"type:"+h},x.getLostPoint=function(b){for(var h=b.getModuleCount(),O=0,A=0;A<h;A+=1)for(var L=0;L<h;L+=1){for(var H=0,V=b.isDark(A,L),et=-1;et<=1;et+=1)if(!(A+et<0||h<=A+et))for(var it=-1;it<=1;it+=1)L+it<0||h<=L+it||et==0&&it==0||V==b.isDark(A+et,L+it)&&(H+=1);H>5&&(O+=3+H-5)}for(var A=0;A<h-1;A+=1)for(var L=0;L<h-1;L+=1){var ht=0;b.isDark(A,L)&&(ht+=1),b.isDark(A+1,L)&&(ht+=1),b.isDark(A,L+1)&&(ht+=1),b.isDark(A+1,L+1)&&(ht+=1),(ht==0||ht==4)&&(O+=3)}for(var A=0;A<h;A+=1)for(var L=0;L<h-6;L+=1)b.isDark(A,L)&&!b.isDark(A,L+1)&&b.isDark(A,L+2)&&b.isDark(A,L+3)&&b.isDark(A,L+4)&&!b.isDark(A,L+5)&&b.isDark(A,L+6)&&(O+=40);for(var L=0;L<h;L+=1)for(var A=0;A<h-6;A+=1)b.isDark(A,L)&&!b.isDark(A+1,L)&&b.isDark(A+2,L)&&b.isDark(A+3,L)&&b.isDark(A+4,L)&&!b.isDark(A+5,L)&&b.isDark(A+6,L)&&(O+=40);for(var Nt=0,L=0;L<h;L+=1)for(var A=0;A<h;A+=1)b.isDark(A,L)&&(Nt+=1);var It=Math.abs(100*Nt/h/h-50)/5;return O+=It*10,O},x})(),a=(function(){for(var N=new Array(256),M=new Array(256),k=0;k<8;k+=1)N[k]=1<<k;for(var k=8;k<256;k+=1)N[k]=N[k-4]^N[k-5]^N[k-6]^N[k-8];for(var k=0;k<255;k+=1)M[N[k]]=k;var B={};return B.glog=function(x){if(x<1)throw"glog("+x+")";return M[x]},B.gexp=function(x){for(;x<0;)x+=255;for(;x>=256;)x-=255;return N[x]},B})();function c(N,M){if(typeof N.length>"u")throw N.length+"/"+M;var k=(function(){for(var x=0;x<N.length&&N[x]==0;)x+=1;for(var T=new Array(N.length-x+M),b=0;b<N.length-x;b+=1)T[b]=N[b+x];return T})(),B={};return B.getAt=function(x){return k[x]},B.getLength=function(){return k.length},B.multiply=function(x){for(var T=new Array(B.getLength()+x.getLength()-1),b=0;b<B.getLength();b+=1)for(var h=0;h<x.getLength();h+=1)T[b+h]^=a.gexp(a.glog(B.getAt(b))+a.glog(x.getAt(h)));return c(T,0)},B.mod=function(x){if(B.getLength()-x.getLength()<0)return B;for(var T=a.glog(B.getAt(0))-a.glog(x.getAt(0)),b=new Array(B.getLength()),h=0;h<B.getLength();h+=1)b[h]=B.getAt(h);for(var h=0;h<x.getLength();h+=1)b[h]^=a.gexp(a.glog(x.getAt(h))+T);return c(b,0).mod(x)},B}var u=(function(){var N=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],M=function(x,T){var b={};return b.totalCount=x,b.dataCount=T,b},k={},B=function(x,T){switch(T){case s.L:return N[(x-1)*4+0];case s.M:return N[(x-1)*4+1];case s.Q:return N[(x-1)*4+2];case s.H:return N[(x-1)*4+3];default:return}};return k.getRSBlocks=function(x,T){var b=B(x,T);if(typeof b>"u")throw"bad rs block @ typeNumber:"+x+"/errorCorrectionLevel:"+T;for(var h=b.length/3,O=[],A=0;A<h;A+=1)for(var L=b[A*3+0],H=b[A*3+1],V=b[A*3+2],et=0;et<L;et+=1)O.push(M(H,V));return O},k})(),d=function(){var N=[],M=0,k={};return k.getBuffer=function(){return N},k.getAt=function(B){var x=Math.floor(B/8);return(N[x]>>>7-B%8&1)==1},k.put=function(B,x){for(var T=0;T<x;T+=1)k.putBit((B>>>x-T-1&1)==1)},k.getLengthInBits=function(){return M},k.putBit=function(B){var x=Math.floor(M/8);N.length<=x&&N.push(0),B&&(N[x]|=128>>>M%8),M+=1},k},v=function(N){var M=e.MODE_NUMBER,k=N,B={};B.getMode=function(){return M},B.getLength=function(b){return k.length},B.write=function(b){for(var h=k,O=0;O+2<h.length;)b.put(x(h.substring(O,O+3)),10),O+=3;O<h.length&&(h.length-O==1?b.put(x(h.substring(O,O+1)),4):h.length-O==2&&b.put(x(h.substring(O,O+2)),7))};var x=function(b){for(var h=0,O=0;O<b.length;O+=1)h=h*10+T(b.charAt(O));return h},T=function(b){if("0"<=b&&b<="9")return b.charCodeAt(0)-48;throw"illegal char :"+b};return B},S=function(N){var M=e.MODE_ALPHA_NUM,k=N,B={};B.getMode=function(){return M},B.getLength=function(T){return k.length},B.write=function(T){for(var b=k,h=0;h+1<b.length;)T.put(x(b.charAt(h))*45+x(b.charAt(h+1)),11),h+=2;h<b.length&&T.put(x(b.charAt(h)),6)};var x=function(T){if("0"<=T&&T<="9")return T.charCodeAt(0)-48;if("A"<=T&&T<="Z")return T.charCodeAt(0)-65+10;switch(T){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+T}};return B},P=function(N){var M=e.MODE_8BIT_BYTE,k=N,B=t.stringToBytes(N),x={};return x.getMode=function(){return M},x.getLength=function(T){return B.length},x.write=function(T){for(var b=0;b<B.length;b+=1)T.put(B[b],8)},x},U=function(N){var M=e.MODE_KANJI,k=N,B=t.stringToBytesFuncs.SJIS;if(!B)throw"sjis not supported.";(function(b,h){var O=B(b);if(O.length!=2||(O[0]<<8|O[1])!=h)throw"sjis not supported."})("\u53CB",38726);var x=B(N),T={};return T.getMode=function(){return M},T.getLength=function(b){return~~(x.length/2)},T.write=function(b){for(var h=x,O=0;O+1<h.length;){var A=(255&h[O])<<8|255&h[O+1];if(33088<=A&&A<=40956)A-=33088;else if(57408<=A&&A<=60351)A-=49472;else throw"illegal char at "+(O+1)+"/"+A;A=(A>>>8&255)*192+(A&255),b.put(A,13),O+=2}if(O<h.length)throw"illegal char at "+(O+1)},T},Y=function(){var N=[],M={};return M.writeByte=function(k){N.push(k&255)},M.writeShort=function(k){M.writeByte(k),M.writeByte(k>>>8)},M.writeBytes=function(k,B,x){B=B||0,x=x||k.length;for(var T=0;T<x;T+=1)M.writeByte(k[T+B])},M.writeString=function(k){for(var B=0;B<k.length;B+=1)M.writeByte(k.charCodeAt(B))},M.toByteArray=function(){return N},M.toString=function(){var k="";k+="[";for(var B=0;B<N.length;B+=1)B>0&&(k+=","),k+=N[B];return k+="]",k},M},ot=function(){var N=0,M=0,k=0,B="",x={},T=function(h){B+=String.fromCharCode(b(h&63))},b=function(h){if(!(h<0)){if(h<26)return 65+h;if(h<52)return 97+(h-26);if(h<62)return 48+(h-52);if(h==62)return 43;if(h==63)return 47}throw"n:"+h};return x.writeByte=function(h){for(N=N<<8|h&255,M+=8,k+=1;M>=6;)T(N>>>M-6),M-=6},x.flush=function(){if(M>0&&(T(N<<6-M),N=0,M=0),k%3!=0)for(var h=3-k%3,O=0;O<h;O+=1)B+="="},x.toString=function(){return B},x},J=function(N){var M=N,k=0,B=0,x=0,T={};T.read=function(){for(;x<8;){if(k>=M.length){if(x==0)return-1;throw"unexpected end of file./"+x}var h=M.charAt(k);if(k+=1,h=="=")return x=0,-1;if(h.match(/^\s$/))continue;B=B<<6|b(h.charCodeAt(0)),x+=6}var O=B>>>x-8&255;return x-=8,O};var b=function(h){if(65<=h&&h<=90)return h-65;if(97<=h&&h<=122)return h-97+26;if(48<=h&&h<=57)return h-48+52;if(h==43)return 62;if(h==47)return 63;throw"c:"+h};return T},Q=function(N,M){var k=N,B=M,x=new Array(N*M),T={};T.setPixel=function(A,L,H){x[L*k+A]=H},T.write=function(A){A.writeString("GIF87a"),A.writeShort(k),A.writeShort(B),A.writeByte(128),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(255),A.writeByte(255),A.writeByte(255),A.writeString(","),A.writeShort(0),A.writeShort(0),A.writeShort(k),A.writeShort(B),A.writeByte(0);var L=2,H=h(L);A.writeByte(L);for(var V=0;H.length-V>255;)A.writeByte(255),A.writeBytes(H,V,255),V+=255;A.writeByte(H.length-V),A.writeBytes(H,V,H.length-V),A.writeByte(0),A.writeString(";")};var b=function(A){var L=A,H=0,V=0,et={};return et.write=function(it,ht){if(it>>>ht)throw"length over";for(;H+ht>=8;)L.writeByte(255&(it<<H|V)),ht-=8-H,it>>>=8-H,V=0,H=0;V=it<<H|V,H=H+ht},et.flush=function(){H>0&&L.writeByte(V)},et},h=function(A){for(var L=1<<A,H=(1<<A)+1,V=A+1,et=O(),it=0;it<L;it+=1)et.add(String.fromCharCode(it));et.add(String.fromCharCode(L)),et.add(String.fromCharCode(H));var ht=Y(),Nt=b(ht);Nt.write(L,V);var It=0,Bt=String.fromCharCode(x[It]);for(It+=1;It<x.length;){var $s=String.fromCharCode(x[It]);It+=1,et.contains(Bt+$s)?Bt=Bt+$s:(Nt.write(et.indexOf(Bt),V),et.size()<4095&&(et.size()==1<<V&&(V+=1),et.add(Bt+$s)),Bt=$s)}return Nt.write(et.indexOf(Bt),V),Nt.write(H,V),Nt.flush(),ht.toByteArray()},O=function(){var A={},L=0,H={};return H.add=function(V){if(H.contains(V))throw"dup key:"+V;A[V]=L,L+=1},H.size=function(){return L},H.indexOf=function(V){return A[V]},H.contains=function(V){return typeof A[V]<"u"},H};return T},vt=function(N,M,k){for(var B=Q(N,M),x=0;x<M;x+=1)for(var T=0;T<N;T+=1)B.setPixel(T,x,k(T,x));var b=Y();B.write(b);for(var h=ot(),O=b.toByteArray(),A=0;A<O.length;A+=1)h.writeByte(O[A]);return h.flush(),"data:image/gif;base64,"+h};return t})();(function(){da.stringToBytesFuncs["UTF-8"]=function(t){function e(s){for(var o=[],i=0;i<s.length;i++){var a=s.charCodeAt(i);a<128?o.push(a):a<2048?o.push(192|a>>6,128|a&63):a<55296||a>=57344?o.push(224|a>>12,128|a>>6&63,128|a&63):(i++,a=65536+((a&1023)<<10|s.charCodeAt(i)&1023),o.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|a&63))}return o}return e(t)}})();(function(t){typeof define=="function"&&define.amd?define([],t):typeof ha=="object"&&(ma.exports=t())})(function(){return da})});var Ra={};_i(Ra,{expandSelfClosingTags:()=>Ia,extractTagCaseMap:()=>Oa,normalizeOwlPreviewMarkup:()=>Ba});function ka(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Oa(t){let e=new Map;for(let s of t.matchAll(/<\/?([A-Z][A-Za-z0-9]*)\b/g))e.set(s[1].toLowerCase(),s[1]);return e}function Eu(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=globalThis.thebase,o=t.get(e.localName)||e.localName,i=ka(o),a=!!s?.component?.(i),c=tt(e.getAttribute("className")||e.getAttribute("class"));if(!a){let u=`b-${i}`;return e.className=c?`${u} ${c}`:u,e}e.setAttribute("b-ui",i),c&&(e.className=c);for(let u of[...e.attributes]){if(u.name==="class"||u.name==="className"||u.name==="b-ui"||/^on[A-Z]/.test(u.name))continue;let d=tt(u.value);e.removeAttribute(u.name),!(d===""||d==="false")&&e.setAttribute(`b-att-${ka(u.name)}`,d==="true"?"true":d)}return e}}function tt(t){if(!t)return"";let e=t.trim();return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Pn(t,e){for(;t.firstChild;)e.append(t.firstChild)}function kt(t,e){return Pn(t,e),t.replaceWith(e),e}function Cu(t){let e=document.createElement("div");e.setAttribute("b-field-group","");let s=tt(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),kt(t,e)}function ku(t){let e=document.createElement("div");e.setAttribute("b-ui","field");let s=tt(t.getAttribute("orientation")||""),o=tt(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-orientation",s),o&&(e.className=o),kt(t,e)}function Lu(t){let e=document.createElement("label");e.setAttribute("b-field-label","");let s=tt(t.getAttribute("for")||""),o=tt(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("for",s),o&&(e.className=o),kt(t,e)}function La(t,e,s){let o=document.createElement(e);o.setAttribute(s,"");let i=tt(t.getAttribute("className")||t.getAttribute("class"));return i&&(o.className=i),kt(t,o)}function Nu(t){let e=t.getAttribute("type")||"",s=t.hasAttribute("variant")||t.hasAttribute("size")||t.hasAttribute("className")||t.hasAttribute("onClick")||t.hasAttribute("label")||e.trim().startsWith("'")||e.trim().startsWith('"');if(t.hasAttribute("b-ui")||!s)return t;let o=document.createElement("button");o.setAttribute("b-ui","button");let i=tt(e||"button"),a=tt(t.getAttribute("variant")||""),c=tt(t.getAttribute("size")||""),u=tt(t.getAttribute("className")||t.getAttribute("class")),d=tt(t.getAttribute("label")||"");return o.type=i||"button",a&&o.setAttribute("b-att-variant",a),c&&o.setAttribute("b-att-size",c),u&&(o.className=u),d&&!t.childNodes.length&&(o.textContent=d),kt(t,o)}function Tu(t){if(t.hasAttribute("b-ui")||t.hasAttribute("b-icon"))return t;let e=tt(t.getAttribute("name")||t.getAttribute("icon")||"");if(!e)return t;let s=document.createElement("span");s.setAttribute("b-ui","icon"),s.setAttribute("b-att-icon",e);let o=tt(t.getAttribute("size")||""),i=tt(t.getAttribute("label")||""),a=tt(t.getAttribute("className")||t.getAttribute("class"));return o&&s.setAttribute("b-att-size",o),i&&s.setAttribute("b-att-label",i),a&&(s.className=a),kt(t,s)}function Ou(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","alert");let s=tt(t.getAttribute("variant")||""),o=tt(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-variant",s),o&&(e.className=o),kt(t,e)}function mi(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=document.createElement("div"),o=tt(e.getAttribute("className")||e.getAttribute("class"));return s.className=o?`${t} ${o}`:t,kt(e,s)}}function Iu(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","accordion"),tt(t.getAttribute("multiple"))==="true"&&e.setAttribute("b-att-multiple","true");let s=tt(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),kt(t,e)}function Bu(t){if(t.hasAttribute("b-accordion-item"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-item",""),tt(t.getAttribute("state"))==="open"&&e.setAttribute("b-att-state","open");let s=tt(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),kt(t,e)}function Ru(t){if(t.hasAttribute("b-accordion-trigger"))return t;let e=document.createElement("button");e.type="button",e.setAttribute("b-accordion-trigger","");let s=tt(t.getAttribute("className")||t.getAttribute("class"));s&&(e.className=s),Pn(t,e);let o=document.createElement("span");return o.setAttribute("b-icon","chevron-down"),o.className="b-accordion-trigger-icon",e.append(o),t.replaceWith(e),e}function Mu(t){if(t.hasAttribute("b-accordion-panel"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-panel","");let s=tt(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),kt(t,e)}function $u(t){return Na+=1,`${t}-${Na}`}function Ct(t,e,s){return o=>{if(o.hasAttribute("b-ui"))return o;let i=document.createElement(t);t==="button"&&(i.type="button"),s&&i.setAttribute(s,"");let a=tt(o.getAttribute("className")||o.getAttribute("class"));return i.className=a?`${e} ${a}`:e,kt(o,i)}}function _u(){let t=document.createElement("button");t.type="button",t.className="btn b-button btn-light btn-icon-sm b-dialog-close b-dialog-close-control",t.setAttribute("b-dialog-close",""),t.setAttribute("aria-label","Close");let e=document.createElement("span");e.setAttribute("b-ui","icon"),e.setAttribute("b-att-icon","x");let s=document.createElement("span");return s.className="visually-hidden",s.textContent="Close",t.append(e,s),t}function Ta({tagPrefix:t,componentName:e,triggerTag:s,triggerClassName:o,panelClassName:i,closeButton:a}){return c=>{if(c.hasAttribute("b-ui"))return c;let u=c.querySelector(`:scope > ${t}trigger`),d=c.querySelector(`:scope > ${t}content`);if(!d)return c;let v=$u(`b-preview-${e}`),S=document.createElement(s);s==="button"&&(S.type="button"),S.className=o,S.setAttribute("b-att-trigger",`#${v}`),u&&Pn(u,S);let P=document.createElement("div");P.setAttribute("b-ui",e),P.id=v,P.setAttribute("b-att-trigger",`[b-att-trigger='#${v}']`);let U=document.createElement("div");U.className=i;let Y=tt(d.getAttribute("size")||"");return Y&&U.setAttribute("data-size",Y),Pn(d,U),a&&U.append(a()),P.append(U),c.before(S,P),c.remove(),P}}function Ia(t){return t.replace(/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^"'>])*?)\/>/g,(e,s,o)=>Uu.has(s.toLowerCase())?e:`<${s}${o}></${s}>`)}function Pu(t){t.querySelectorAll("t[t-esc]").forEach(e=>{let o=e.getAttribute("t-esc")?.includes(".length")?"0":"";e.replaceWith(document.createTextNode(`${o}${e.textContent||""}`))})}function Ba(t,e){Pu(t);let s={fieldgroup:Cu,field:ku,fieldlabel:Lu,fielddescription:i=>La(i,"p","b-field-description"),fielderror:i=>La(i,"p","b-field-error"),button:Nu,icon:Tu,alert:Ou,alerttitle:mi("b-alert-title"),alertdescription:mi("b-alert-description"),alertaction:mi("b-alert-action"),accordion:Iu,accordionitem:Bu,accordiontrigger:Ru,accordioncontent:Mu,dialog:Ta({tagPrefix:"dialog",componentName:"dialog",triggerTag:"span",triggerClassName:"b-dialog-trigger",panelClassName:"b-dialog-panel",closeButton:_u}),dialogheader:Ct("div","b-dialog-header"),dialogfooter:Ct("div","b-dialog-footer"),dialogtitle:Ct("h2","b-dialog-title"),dialogdescription:Ct("p","b-dialog-description"),dialogclose:Ct("button","btn b-button btn-outline-secondary b-dialog-close","b-dialog-close"),alertdialog:Ta({tagPrefix:"alertdialog",componentName:"alert-dialog",triggerTag:"button",triggerClassName:"btn b-button btn-outline-secondary b-alert-dialog-trigger",panelClassName:"b-dialog-panel b-alert-dialog-panel"}),alertdialogheader:Ct("div","b-dialog-header b-alert-dialog-header"),alertdialogfooter:Ct("div","b-dialog-footer b-alert-dialog-footer"),alertdialogmedia:Ct("div","b-alert-dialog-media"),alertdialogtitle:Ct("h2","b-dialog-title b-alert-dialog-title"),alertdialogdescription:Ct("p","b-dialog-description b-alert-dialog-description"),alertdialogcancel:Ct("button","btn b-button btn-outline-secondary b-alert-dialog-cancel","b-alert-dialog-cancel"),alertdialogaction:Ct("button","btn b-button btn-primary b-alert-dialog-action","b-alert-dialog-action")},o=Eu(e);for(let i of[...t.querySelectorAll("*")]){let a=i.localName.toLowerCase();s[a]?s[a](i):e.has(a)&&o(i)}}var Na,Uu,bi=Nc(()=>{Na=0;Uu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"])});var Bc="__NODEXUI_VERSION__",Qn=new Map,un=new WeakMap,Sn="[b-ui], [b-icon]",Rc="[data-bs-toggle], [data-bs-target], [data-bs-dismiss]";function Mc(t){return typeof t=="string"?document.querySelector(t):t instanceof Element?t:null}function ti(t,e,s={}){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}function $c(t,e={}){return t.hasAttribute("b-icon")?"icon":e.name||t.getAttribute("b-ui")}function _c(t,e){return e===document||e===t||e.contains(t)}function Uc(t,e={}){return!e.allowBootstrapControl&&t.matches(Rc)}var ei=typeof window<"u"?window.thebase:void 0,m=ei?.register?ei:Object.assign(ei||{},{version:Bc,register(t,e){if(!t||!e)throw new Error("NodexUI.register requires a name and component definition.");return Qn.set(t,e),this},component(t){return Qn.get(t)},mount(t,e={}){let s=Mc(t);if(!s||Uc(s,e))return null;let o=$c(s,e),i=Qn.get(o);if(!i)return null;let a=un.get(s);if(a?.name===o)return a;a&&(a.destroy?.(),un.delete(s),ti(s,"nodexui:destroyed",{name:a.name}));let c=i.mount?.(s,this,e)||{},u={name:o,element:s,destroy:c.destroy};return un.set(s,u),ti(s,"nodexui:mounted",{name:o,instance:u}),u},mountAll(t=document){let e=t||document,s=[...e.querySelectorAll?.(Sn)||[]];return e instanceof Element&&e.matches(Sn)&&s.unshift(e),s.map(o=>this.mount(o)).filter(Boolean)},destroy(t=document){let e=t||document,s=[...e.querySelectorAll?.(Sn)||[]];e instanceof Element&&e.matches(Sn)&&s.unshift(e);for(let o of s){let i=un.get(o);i&&_c(o,e)&&(i.destroy?.(),un.delete(o),ti(o,"nodexui:destroyed",{name:i.name}))}},theme:{set(t){let e=document.documentElement;if(typeof t=="string"){e.setAttribute("b-theme",t),e.dataset.bsTheme=t;return}for(let[s,o]of Object.entries(t||{})){let i=s==="radius"||s==="--b-radius"?"--base-radius":s.startsWith("--")?s:`--b-${s}`;e.style.setProperty(i,o)}}}});typeof window<"u"&&(window.thebase=m,window.NodexUI=m);function Pi(t){return m.version=t,m}function Ui(){if(typeof MutationObserver>"u")return;let t=new MutationObserver(e=>{for(let s of e)for(let o of s.addedNodes)o instanceof Element&&m.mountAll(o)});return t.observe(document.documentElement,{childList:!0,subtree:!0}),t}function qi(){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{m.mountAll(),Ui()},{once:!0}):(m.mountAll(),Ui()))}function f(...t){let e=[];for(let s of t)if(s){if(typeof s=="string")e.push(s);else if(Array.isArray(s)){let o=f(...s);o&&e.push(o)}else if(typeof s=="object")for(let[o,i]of Object.entries(s))i&&e.push(o)}return e.join(" ")}function n(t){return{type:t,optional:!0}}var p={className:n(String),style:n([String,Object]),slots:n(Object)};function X(t,e,s){return t[e]??(s?t[s]:void 0)}function ut(t){return t===!0||t==="open"||t==="on"||t==="active"}function pt(...t){let e=[];for(let s of t)if(s){if(typeof s=="string"){let o=s.trim().replace(/;$/,"");o&&e.push(o)}else if(typeof s=="object")for(let[o,i]of Object.entries(s)){if(i==null||i==="")continue;let a=o.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.push(`${a}:${i}`)}}return e.join(";")}function at(t){return t.state!==void 0?ut(t.state):t.open!==void 0?t.open:t["default-open"]!==void 0?t["default-open"]:t.defaultOpen??!1}function Ue(t){return t.state!==void 0||t.open!==void 0}var Di="1.0.1";var W=globalThis.owl;if(!W)throw new Error("NodexUI: load dist/nodexui.min.js or dist/nodexui.esm.js before this script (globalThis.owl is not set).");var qc=W.App,ji=W.Component,Dc=W.EventBus,jc=W.OwlError,Fc=W.__info__,zc=W.batched,Hc=W.blockDom,Wc=W.htmlEscape,Pe=W.loadFile,Kc=W.markRaw,si=W.markup,oi=W.mount,Vc=W.onError,K=W.onMounted,rt=W.onPatched,Zc=W.onRendered,qe=W.onWillDestroy,Gc=W.onWillPatch,ri=W.onWillRender,xt=W.onWillStart,G=W.onWillUnmount,nt=W.onWillUpdateProps,Jc=W.reactive,Yc=W.status,Xc=W.toRaw,z=W.useChildSubEnv,Qc=W.useComponent,yt=W.useEffect,tl=W.useEnv,Us=W.useExternalListener,$=W.useRef,I=W.useState,el=W.useSubEnv,sl=W.validate,ol=W.validateType,rl=W.whenReady,An=W.xml;var Rh=oi,Mh=An,pn={};function Fi(t){Object.assign(pn,t)}function nl(t){let e=t.components;e?e!==pn&&Object.getPrototypeOf(e)===Object.prototype&&Object.setPrototypeOf(e,pn):t.components=Object.create(pn)}var l=class extends ji{constructor(...e){super(...e),nl(this.constructor)}};function zi(t){return typeof t!="string"||!/\st-(att|attf|model)([.\s=-]|$)/.test(t)?t:t.replace(/<([A-Z][\w.:-]*)(\s[^<>]*?)?(\/?)>/g,(e,s,o="",i="")=>`<${s}${il(s,o)}${i}>`)}function il(t,e){let s=/\st-(att|attf|model|on)([.\s=-]|$)/.test(e),o=e.replace(/(\s)t-att\s*=/g,"$1t-props=").replace(/(\s)t-att-([A-Za-z_][\w:.-]*)\s*=/g,"$1$2=").replace(/(\s)t-attf-([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(i,a,c,u,d)=>`${a}${c}=${u}${ul(d)}${u}`);return o=o.replace(/(\s)t-model((?:\.[\w-]+)*)\s*=\s*(["'])(.*?)\3/g,(i,a,c,u,d)=>pl(t,a,c,u,d,o)),s?al(o):o}function al(t){return t.replace(/(\s)([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(e,s,o,i,a)=>o.startsWith("t-")||o==="t-props"||ll(a)?e:`${s}${o}=${i}${cl(a)}${i}`)}function cl(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function ll(t){let e=t.trim();return!e||/^(['"`[{(]|-?\d+(?:\.\d+)?$)/.test(e)||/[?.()[\]+*/]|=>|===|!==|&&|\|\|/.test(e)||/^(true|false|null|undefined)$/.test(e)}function ul(t){return`\`${t.replace(/`/g,"\\`").replace(/{{\s*([\s\S]*?)\s*}}|#\{\s*([\s\S]*?)\s*\}/g,(e,s,o)=>`\${${s||o}}`)}\``}function pl(t,e,s,o,i,a){let c=/^(Checkbox|Switch)$/.test(t),u=dl(t,s),d=c?"checked":"value",v=new RegExp(`\\s${d}\\s*=`).test(a)?"":`${e}${d}=${o}${i}${o}`,S=new RegExp(`\\s${u}\\s*=`).test(a)?"":`${e}${u}=${o}${hl(i,s,c)}${o}`;return`${v}${S}`}function dl(t,e){return e.includes(".lazy")?"onChange":/^(Input|Textarea)$/.test(t)?"onInput":"onChange"}function hl(t,e,s){if(s)return`(value) => { ${t} = value; }`;let o="value";return e.includes(".trim")&&(o=`(typeof ${o} === 'string' ? ${o}.trim() : ${o})`),e.includes(".number")&&(o=`Number.isNaN(Number(${o})) ? ${o} : Number(${o})`),`(value) => { ${t} = ${o}; }`}function Hi(t,...e){return Array.isArray(t?.raw)?An({raw:t.raw.map(zi)},...e):An(t,...e)}function Ps(t,e,s={}){let o=zi(s.templates);return t.components={...pn,...t.components||{}},oi(t,e,o===s.templates?s:{...s,templates:o})}async function $h(t){let e=await(await fetch(t,{cache:"reload"})).text(),o=new DOMParser().parseFromString(e,"application/xml").querySelector("templates > t[t-name]");return o?o.innerHTML:e}var Ni={};_i(Ni,{Accordion:()=>Ho,AccordionContent:()=>Ko,AccordionItem:()=>Wo,AccordionTrigger:()=>ss,Alert:()=>Mt,AlertAction:()=>Fs,AlertDescription:()=>Zt,AlertDialog:()=>uo,AlertDialogAction:()=>Ze,AlertDialogCancel:()=>Ve,AlertDialogContent:()=>po,AlertDialogDescription:()=>go,AlertDialogFooter:()=>mo,AlertDialogHeader:()=>ho,AlertDialogMedia:()=>bo,AlertDialogTitle:()=>fo,AlertDialogTrigger:()=>Ke,AlertTitle:()=>js,ApiDoc:()=>Kt,ApiDocGroup:()=>Vt,AspectRatio:()=>Ur,Attachment:()=>Ar,AttachmentAction:()=>Ss,AttachmentActions:()=>Nr,AttachmentContent:()=>Cr,AttachmentDescription:()=>Lr,AttachmentDropzone:()=>Or,AttachmentGroup:()=>Tr,AttachmentMedia:()=>Er,AttachmentTitle:()=>kr,AttachmentTrigger:()=>As,Avatar:()=>Ir,Badge:()=>At,BlockViewer:()=>Is,Breadcrumb:()=>we,BreadcrumbEllipsis:()=>rs,BreadcrumbItem:()=>Ae,BreadcrumbLink:()=>Ee,BreadcrumbList:()=>Se,BreadcrumbPage:()=>Ce,BreadcrumbSeparator:()=>Dt,Bubble:()=>Pr,Button:()=>R,ButtonGroup:()=>jr,ButtonGroupSeparator:()=>Fr,ButtonGroupText:()=>zr,Calendar:()=>xs,Card:()=>Yt,CardBody:()=>Qt,CardDescription:()=>ee,CardFooter:()=>zs,CardHeader:()=>Xt,CardTitle:()=>te,Carousel:()=>xr,CarouselNext:()=>ws,CarouselPrevious:()=>ys,CarouselSlide:()=>yr,Chart:()=>vr,Checkbox:()=>be,ClipboardButton:()=>Rt,CodeEditor:()=>Fe,Collapsible:()=>Vo,CollapsibleContent:()=>Zo,CollapsibleTrigger:()=>os,Combobox:()=>fr,Command:()=>gr,ContextMenu:()=>Do,ContextMenuContent:()=>Fo,ContextMenuItem:()=>zo,ContextMenuTrigger:()=>jo,DataTable:()=>vs,DatePicker:()=>br,Dialog:()=>ae,DialogClose:()=>ze,DialogContent:()=>_t,DialogDescription:()=>pe,DialogFooter:()=>le,DialogHeader:()=>ce,DialogTitle:()=>ue,DialogTrigger:()=>Hs,Direction:()=>qr,DocViewer:()=>Os,Drawer:()=>vo,DrawerClose:()=>Je,DrawerContent:()=>xo,DrawerDescription:()=>Ao,DrawerFooter:()=>wo,DrawerHeader:()=>yo,DrawerTitle:()=>So,DrawerTrigger:()=>Ge,DropdownMenu:()=>fe,DropdownMenuCheckboxItem:()=>ts,DropdownMenuContent:()=>ge,DropdownMenuGroup:()=>$o,DropdownMenuItem:()=>ve,DropdownMenuLabel:()=>_o,DropdownMenuRadioGroup:()=>Uo,DropdownMenuRadioItem:()=>es,DropdownMenuSeparator:()=>Po,DropdownMenuShortcut:()=>qo,DropdownMenuSub:()=>xe,DropdownMenuSubContent:()=>ye,DropdownMenuSubTrigger:()=>Pt,DropdownMenuTrigger:()=>Ut,Empty:()=>Ws,EmptyContent:()=>Js,EmptyDescription:()=>Gs,EmptyHeader:()=>Ks,EmptyMedia:()=>Vs,EmptyTitle:()=>Zs,Field:()=>Ie,FieldContent:()=>Kr,FieldDescription:()=>Re,FieldError:()=>Me,FieldGroup:()=>Oe,FieldLabel:()=>Be,FieldLegend:()=>Wr,FieldSeparator:()=>Zr,FieldSet:()=>Hr,FieldTitle:()=>Vr,Form:()=>Ms,HoverCard:()=>Bo,HoverCardContent:()=>Mo,HoverCardTrigger:()=>Ro,Icon:()=>Z,Input:()=>se,InputOtp:()=>oo,Item:()=>Dr,Kbd:()=>Gt,Label:()=>Gr,Markdown:()=>Lt,MarkdownTree:()=>Wt,MarkdownTreeNode:()=>vn,Marker:()=>Qs,Menubar:()=>Qo,Message:()=>Br,MessageScroller:()=>Rr,NativeSelect:()=>me,NavigationMenu:()=>Yo,NavigationMenuItem:()=>Xo,Pagination:()=>Go,PaginationItem:()=>Jo,Popover:()=>Oo,PopoverContent:()=>Io,PopoverTrigger:()=>Qe,Progress:()=>_r,Pwa:()=>tn,PwaBody:()=>nn,PwaClose:()=>Rs,PwaContent:()=>en,PwaDescription:()=>rn,PwaFooter:()=>cn,PwaHeader:()=>sn,PwaSteps:()=>an,PwaTitle:()=>on,PwaTrigger:()=>Bs,QRCard:()=>ks,Questionnaire:()=>Mr,QuestionnaireNext:()=>Cs,QuestionnairePrevious:()=>Es,QuestionnaireStep:()=>$r,RadioGroup:()=>to,RadioGroupItem:()=>eo,Resizable:()=>wr,ScrollArea:()=>Sr,Select:()=>no,SelectContent:()=>io,SelectItem:()=>ao,SelectTrigger:()=>We,Separator:()=>Ys,Sheet:()=>Eo,SheetClose:()=>Xe,SheetContent:()=>Co,SheetDescription:()=>To,SheetFooter:()=>Lo,SheetHeader:()=>ko,SheetTitle:()=>No,SheetTrigger:()=>Ye,Shell:()=>ds,ShellContent:()=>ms,ShellHeader:()=>hr,ShellMain:()=>dr,ShellNav:()=>pr,ShellSidebar:()=>hs,ShellSidebarHeader:()=>ur,ShellUserMenu:()=>bs,Sidebar:()=>Ft,SidebarClose:()=>as,SidebarContent:()=>ke,SidebarFooter:()=>er,SidebarGroup:()=>Le,SidebarGroupAction:()=>cs,SidebarGroupCollapsible:()=>ls,SidebarGroupContent:()=>nr,SidebarGroupLabel:()=>Ne,SidebarHeader:()=>tr,SidebarInput:()=>or,SidebarInset:()=>sr,SidebarMenu:()=>zt,SidebarMenuAction:()=>us,SidebarMenuBadge:()=>ar,SidebarMenuButton:()=>jt,SidebarMenuItem:()=>Te,SidebarMenuSkeleton:()=>cr,SidebarMenuSub:()=>ir,SidebarMenuSubButton:()=>ps,SidebarMenuSubItem:()=>lr,SidebarProvider:()=>fn,SidebarRail:()=>is,SidebarSeparator:()=>rr,SidebarTrigger:()=>ns,Skeleton:()=>de,Slider:()=>so,Spinner:()=>Jt,Switch:()=>He,TabContent:()=>ie,TabTrigger:()=>$t,Table:()=>mr,Tabs:()=>oe,TabsContainer:()=>re,TabsList:()=>ne,TextEditor:()=>ln,Textarea:()=>he,ThemeButton:()=>Ht,Toast:()=>qt,Toggle:()=>Ls,ToggleGroup:()=>Yr,ToggleGroupItem:()=>Ns,Tooltip:()=>Ot,Typography:()=>Xs,createNamedIcon:()=>qs,findMarkdownTreeNode:()=>Qr,iconComponentName:()=>ga});var Wi="1.31.0",ml=`https://cdn.jsdelivr.net/npm/lucide-static@${Wi}/icons`,Cn="file",bl=/^[a-z0-9][a-z0-9-]*$/,ni=new Map;function fl(t){return typeof Image>"u"?Promise.resolve(!0):(ni.has(t)||ni.set(t,new Promise(e=>{let s=new Image;s.onload=()=>e(!0),s.onerror=()=>e(!1),s.src=t})),ni.get(t))}function En(t){return String(t||"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function dn(t,e={}){let s=En(t);if(!bl.test(s))throw new Error(`NodexUI icon name is invalid: ${t}`);return`${String(e.baseUrl||m.icons.lucide.cdnBaseUrl).replace(/\/+$/,"")}/${s}.svg`}function ct(t,e,s={}){let o=s.url||dn(e,s),i=s.label??t.getAttribute("aria-label")??"";t.classList.add("b-icon"),t.style.setProperty("--b-icon-url",`url("${o.replace(/"/g,"%22")}")`),(s.size||t.getAttribute("b-att-size"))&&t.style.setProperty("--b-icon-size",s.size||t.getAttribute("b-att-size")),i?(t.setAttribute("role","img"),t.setAttribute("aria-label",i)):t.setAttribute("aria-hidden","true");let a=s.fallback===!1?null:s.fallback||Cn;return a&&!s.url&&En(e)!==En(a)&&fl(o).then(c=>{if(c||!t.isConnected)return;let u=dn(a,s);t.style.setProperty("--b-icon-url",`url("${u.replace(/"/g,"%22")}")`)}),t}m.icons={...m.icons||{},lucide:{version:Wi,cdnBaseUrl:ml,normalizeName:En,url:dn,render:ct}};var Z=class extends l{setup(){this.state=I({failed:!1}),yt(e=>{if(this.state.failed=!1,typeof Image>"u"||!e||e===Cn)return;let s=new Image;return s.onerror=()=>{this.state.failed=!0},s.src=this.buildUrl(e),()=>{s.onload=null,s.onerror=null}},()=>[this.name])}buildUrl(e){return dn(e,{baseUrl:X(this.props,"base-url","baseUrl")})}get name(){return X(this.props,"icon","name")}get url(){return this.buildUrl(this.state.failed?Cn:this.name)}get style(){let e=[`--b-icon-url:url("${this.url.replace(/"/g,"%22")}")`];return this.props.size&&e.push(`--b-icon-size:${this.props.size}`),pt(e.join(";"),this.props.style)}get classNames(){return f("b-icon",this.props.className)}};r(Z,"template","nodexui.Icon"),r(Z,"props",{icon:n(String),name:n(String),label:n(String),title:n(String),size:n(String),"base-url":n(String),baseUrl:n(String),className:n(String),style:n([String,Object])});function qs(t){return class extends Z{get name(){return X(this.props,"icon","name")||t}}}var dt={default:"btn-primary",secondary:"btn-secondary",destructive:"btn-danger",outline:"btn-outline-secondary",ghost:"btn-light",link:"btn-link"},mt={xs:"btn-xs",sm:"btn-sm",lg:"btn-lg",icon:"btn-icon","icon-xs":"btn-icon-xs","icon-sm":"btn-icon-sm","icon-lg":"btn-icon-lg"};var R=class extends l{setup(){this.rootRef=$("root"),this.props.getRef&&(K(()=>this.props.getRef(this.rootRef.el)),G(()=>this.props.getRef(null)))}get classNames(){return this.props.unstyled?f(this.props.className):f("btn","b-button",dt[this.props.variant]||dt.default,mt[this.props.size],this.isIconOnly&&"b-button-icon",this.props.className)}get iconPosition(){return X(this.props,"icon-position","iconPosition")==="end"?"end":"start"}get ariaLabel(){return X(this.props,"aria-label","ariaLabel")}get ariaPressed(){return X(this.props,"aria-pressed","ariaPressed")}get ariaInvalid(){let e=X(this.props,"aria-invalid","ariaInvalid");return e===!0?"true":e}get isIconOnly(){return!!(this.props.icon&&!this.props.label&&!this.props.slots?.default)}onClick(e){if(this.props.href&&this.props.disabled){e.preventDefault();return}this.props.onClick?.(e)}};r(R,"template","nodexui.Button"),r(R,"components",{Icon:Z}),r(R,"props",{variant:n(String),size:n(String),type:n(String),href:n(String),disabled:n(Boolean),label:n(String),icon:n(String),"icon-position":n(String),iconPosition:n(String),unstyled:n(Boolean),attrs:n(Object),getRef:n(Function),...p,id:n(String),title:n(String),"aria-label":n(String),ariaLabel:n(String),"aria-pressed":n(String),ariaPressed:n(String),"aria-invalid":n([String,Boolean]),ariaInvalid:n([String,Boolean]),onClick:n(Function)});var ii=["btn","b-button","b-clipboard-button",...Object.values(dt),...Object.values(mt)];function kn({variant:t="default",size:e,className:s}={}){return f("btn","b-button","b-clipboard-button",dt[t]||dt.default,mt[e],s)}async function Ds(t){let e=String(t??"");if(globalThis.navigator?.clipboard?.writeText)try{await globalThis.navigator.clipboard.writeText(e);return}catch{}if(typeof document>"u")throw new Error("NodexUI ClipboardButton: no clipboard API available in this environment.");let s=document.createElement("textarea");s.value=e,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",s.style.pointerEvents="none",document.body.append(s),s.select(),s.setSelectionRange(0,e.length);let o;try{o=document.execCommand("copy")}catch{o=!1}if(s.remove(),!o)throw new Error("NodexUI ClipboardButton: clipboard copy is unavailable in this browser/context.")}var Rt=class extends l{setup(){this.state=I({copied:!1}),this.resetTimer=null,G(()=>window.clearTimeout(this.resetTimer))}get classNames(){return kn(this.props)}get resetDelay(){return X(this.props,"reset-delay","resetDelay")??2e3}get iconName(){return this.state.copied?this.props.copiedIcon||"check":this.props.icon||"copy"}get label(){return this.state.copied&&this.props.copiedLabel?this.props.copiedLabel:this.props.label}get ariaLabel(){return X(this.props,"aria-label","ariaLabel")||this.label}get attrs(){return{"data-copied":this.state.copied?"true":void 0}}async onClick(e){if(this.props.disabled)return;let s=this.props.getValue?this.props.getValue():this.props.value??"";try{await Ds(s),this.state.copied=!0,window.clearTimeout(this.resetTimer),this.resetTimer=window.setTimeout(()=>{this.state.copied=!1},this.resetDelay),this.props.onCopy?.({value:s,event:e})}catch(o){this.props.onCopyError?.({error:o,event:e})}}};r(Rt,"template","nodexui.ClipboardButton"),r(Rt,"components",{Button:R}),r(Rt,"props",{variant:n(String),size:n(String),value:n(String),getValue:n(Function),label:n(String),copiedLabel:n(String),icon:n(String),copiedIcon:n(String),"reset-delay":n(Number),resetDelay:n(Number),disabled:n(Boolean),...p,"aria-label":n(String),ariaLabel:n(String),onCopy:n(Function),onCopyError:n(Function)});function j(){let t=globalThis.bootstrap;if(!t)throw new Error("NodexUI: load dist/bootstrap.bundle.min.js before this script (globalThis.bootstrap is not set).");return t}var Ki={default:"b-alert-default",destructive:"b-alert-destructive",info:"b-alert-default",success:"alert-success",warning:"alert-warning",danger:"b-alert-destructive"},Mt=class extends l{setup(){this.rootRef=$("root"),this.bootstrapAlert=null,this.props.dismissible&&(K(()=>{this.bootstrapAlert=new(j()).Alert(this.rootRef.el)}),G(()=>{this.bootstrapAlert?.dispose()}))}get classNames(){return f("alert","b-alert",Ki[this.props.variant]||Ki.default,this.props.dismissible&&"alert-dismissible",this.props.dismissible&&"fade",this.props.dismissible&&"show",this.props.className)}};r(Mt,"template","nodexui.Alert"),r(Mt,"components",{Button:R}),r(Mt,"props",{variant:n(String),dismissible:n(Boolean),...p});var js=class extends l{};r(js,"template","nodexui.AlertTitle"),r(js,"props",p);var Zt=class extends l{};r(Zt,"template","nodexui.AlertDescription"),r(Zt,"props",p);var Fs=class extends l{};r(Fs,"template","nodexui.AlertAction"),r(Fs,"props",p);var De={primary:"b-badge-primary",secondary:"b-badge-secondary",success:"b-badge-success",warning:"b-badge-warning",danger:"b-badge-danger",info:"b-badge-info",muted:"b-badge-muted"};var At=class extends l{get classNames(){return f("badge",De[this.props.variant]||De.secondary,this.props.pill&&"rounded-pill",this.props.className)}};r(At,"template","nodexui.Badge"),r(At,"props",{variant:n(String),pill:n(Boolean),label:n(String),...p});var Gt=class extends l{get classNames(){return f("b-kbd",this.props.className)}};r(Gt,"template","nodexui.Kbd"),r(Gt,"props",{...p});var Jt=class extends l{get classNames(){return f("b-spinner",this.props.type==="grow"?"spinner-grow":"spinner-border",this.props.className)}get label(){return this.props.label||"Loading"}};r(Jt,"template","nodexui.Spinner"),r(Jt,"props",{type:n(String),label:n(String),className:n(String),style:n([String,Object])});var Tt={line:["//"],block:["/*","*/"],quotes:`"'`},Ln={line:["#"],quotes:`"'`},Vi="auto break case char const continue default do double else enum extern float for goto if inline int long register restrict return short signed sizeof static struct switch typedef union unsigned void volatile while include define ifdef ifndef endif pragma",gl="abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new null package private protected public return short static strictfp super switch synchronized this throw throws transient true false try var void volatile while record",Zi="async await break case catch class const continue debugger default delete do else export extends false finally for from function if import in instanceof let new null of return static super switch this throw true try typeof undefined var void while with yield",hn={plaintext:{label:"Plain text",indent:" "},javascript:{label:"JavaScript",...Tt,quotes:"\"'`",multiline:"`",indent:" ",keywords:Zi,builtins:"console document window JSON Math Object Array Promise Map Set Date Number String Boolean Symbol require module exports process"},typescript:{annotations:!0,label:"TypeScript",...Tt,quotes:"\"'`",multiline:"`",indent:" ",keywords:`${Zi} abstract as declare enum implements interface keyof namespace private protected public readonly type`,builtins:"console JSON Math Object Array Promise Map Set Date Number string number boolean any unknown never void Record Partial Readonly"},go:{label:"Go",...Tt,quotes:"\"'`",multiline:"`",indent:" ",keywords:"break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var nil true false",builtins:"append cap close complex copy delete imag len make new panic print println real recover string int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 uintptr float32 float64 bool byte rune error any context fmt"},c:{label:"C",...Tt,indent:" ",keywords:Vi,builtins:"NULL size_t printf scanf malloc free memcpy memset strlen strcmp FILE stdin stdout stderr uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t bool"},cpp:{label:"C++",...Tt,indent:" ",keywords:`${Vi} alignas alignof and bool catch class constexpr const_cast decltype delete dynamic_cast explicit export false friend mutable namespace new noexcept nullptr operator or private protected public reinterpret_cast static_assert static_cast template this throw true try typeid typename using virtual override final`,builtins:"std string vector map set unordered_map unique_ptr shared_ptr cout cin endl size_t NULL"},java:{annotations:!0,label:"Java",...Tt,indent:" ",keywords:gl,builtins:"String System Object Integer Long Double Boolean List Map Set ArrayList HashMap Exception Override Math"},csharp:{label:"C#",...Tt,indent:" ",keywords:"abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using var virtual void volatile while async await record",builtins:"Console String List Dictionary Task Math Exception"},kotlin:{annotations:!0,label:"Kotlin",...Tt,quotes:`"'`,indent:" ",keywords:"abstract as break by catch class companion const constructor continue data do else enum false final finally for fun if import in infix init inline interface internal is lateinit null object open operator override package private protected public return sealed super suspend this throw true try typealias val var when while",builtins:"String Int Long Double Boolean List Map Set Any Unit println"},swift:{label:"Swift",...Tt,indent:" ",keywords:"as associatedtype break case catch class continue default defer deinit do else enum extension fallthrough false fileprivate for func guard if import in init inout internal is let nil open operator private protocol public repeat rethrows return self static struct subscript super switch throw throws true try typealias var where while async await",builtins:"String Int Double Bool Array Dictionary Set Any print"},rust:{label:"Rust",...Tt,quotes:'"',indent:" ",keywords:"as async await break const continue crate dyn else enum extern false fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait true type unsafe use where while",builtins:"String Vec Option Result Some None Ok Err Box Rc Arc println format vec i8 i16 i32 i64 u8 u16 u32 u64 usize isize f32 f64 bool str"},php:{label:"PHP",variables:!0,line:["//","#"],block:["/*","*/"],quotes:`"'`,indent:" ",keywords:"abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty extends final finally fn for foreach function global if implements include instanceof interface isset namespace new null or print private protected public require return static switch this throw trait true false try unset use var while yield",builtins:"count strlen array_map array_filter in_array json_encode json_decode var_dump"},python:{annotations:!0,label:"Python",...Ln,indent:" ",keywords:"and as assert async await break class continue def del elif else except False finally for from global if import in is lambda None nonlocal not or pass raise return True try while with yield match case",builtins:"print len range str int float bool list dict set tuple open isinstance super self cls enumerate zip map filter sorted sum min max abs"},ruby:{label:"Ruby",...Ln,indent:" ",keywords:"BEGIN END alias and begin break case class def defined do else elsif end ensure false for if in module next nil not or redo rescue retry return self super then true undef unless until when while yield",builtins:"puts print require require_relative attr_accessor attr_reader attr_writer lambda proc raise"},bash:{label:"Shell",variables:!0,...Ln,indent:" ",keywords:"case do done elif else esac fi for function if in select then until while",builtins:"echo cd ls cat grep sed awk export source exit read printf test set unset local return trap"},sql:{label:"SQL",line:["--"],block:["/*","*/"],quotes:`"'`,indent:" ",ci:!0,keywords:"add all alter and as asc begin between by case check column commit constraint create cross database default delete desc distinct drop else end exists foreign from full group having if in index inner insert into is join key left like limit not null offset on or order outer primary references returning right rollback select set table then transaction union unique update values view when where with",builtins:"count sum avg min max coalesce now cast varchar text integer int bigint boolean timestamp date numeric serial"},json:{label:"JSON",plainWords:!0,keys:!0,quotes:'"',indent:" ",keywords:"true false null"},yaml:{label:"YAML",plainWords:!0,keys:!0,...Ln,indent:" ",keywords:"true false null yes no on off"},css:{label:"CSS",plainWords:!0,keys:"prop",dashed:!0,hex:!0,block:["/*","*/"],quotes:`"'`,indent:" ",keywords:"important inherit initial unset auto none",builtins:"var calc rgb rgba hsl hsla url"},html:{label:"HTML",plainWords:!0,tags:!0,block:["<!--","-->"],quotes:`"'`,indent:" "},lua:{label:"Lua",line:["--"],block:["--[[","]]"],quotes:`"'`,indent:" ",keywords:"and break do else elseif end false for function goto if in local nil not or repeat return then true until while",builtins:"assert error ipairs next pairs pcall print select tonumber tostring type unpack xpcall string table math os"}};hn.xml={...hn.html,label:"XML"};var vl={js:"javascript",jsx:"javascript",node:"javascript",ts:"typescript",tsx:"typescript",golang:"go",h:"c","c++":"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"csharp","c#":"csharp",kt:"kotlin",rs:"rust",py:"python",rb:"ruby",sh:"bash",shell:"bash",zsh:"bash",postgres:"sql",postgresql:"sql",mysql:"sql",mjs:"javascript",cjs:"javascript",htm:"html",yml:"yaml",svg:"xml",text:"plaintext",txt:"plaintext"},xl={comment:"b-code-comment",string:"b-code-string",number:"b-code-number",keyword:"b-code-keyword",builtin:"b-code-builtin",function:"b-code-function",type:"b-code-type",tag:"b-code-tag",attr:"b-code-attr",meta:"b-code-meta",variable:"b-code-variable",plain:""},ci=/[A-Za-z_$]/,Qi=/[A-Za-z0-9_$]/,ta=/[A-Za-z0-9_:-]/,yl=/[0-9A-Za-z_.]/,Gi=/[0-9]/,wl=/[A-Za-z0-9_-]/,Ji=/^#[0-9a-fA-F]{3,8}\b/,Sl=/^&#?\w+;/,Al=/[A-Za-z/!?]/,ai=new Map;function Yi(t,e){return new Set((t?e?t.toLowerCase():t:"").split(" ").filter(Boolean))}function bn(t){let e=String(t??"").trim().toLowerCase(),s=vl[e]??e,o=s in hn?s:"plaintext";if(!ai.has(o)){let i=hn[o];ai.set(o,{id:o,...i,keywordSet:Yi(i.keywords,i.ci),builtinSet:Yi(i.builtins,i.ci)})}return ai.get(o)}function ea(t){let e=String(t??"").split(/[?#]/)[0].split("/").pop();return e.includes(".")?e.split(".").pop().toLowerCase():""}var Tm=Object.keys(hn);function mn(t,e,s){let o=e;for(;o<t.length&&s.test(t[o]);)o+=1;return o}function El(t,e,s){if(s.block&&t.startsWith(s.block[0],e)){let i=t.indexOf(s.block[1],e+s.block[0].length);return i===-1?t.length:i+s.block[1].length}if(!s.line?.some(i=>t.startsWith(i,e)))return-1;let o=t.indexOf(`
13
+ `,e);return o===-1?t.length:o}function sa(t,e,s){let o=t[e],i=s.multiline?.includes(o),a=e+1;for(;a<t.length&&t[a]!==o&&(i||t[a]!==`
14
+ `);)a+=t[a]==="\\"?2:1;return Math.min(t.length,t[a]===o?a+1:a)}function Cl(t,e){let s=e-1;for(;s>=0&&/\s/.test(t[s]);)s-=1;return t[s]}function Xi(t,e,s,o){return!o.keys||!/^\s*:(?!:|\/\/)/.test(t.slice(s,s+8))?!1:o.keys!=="prop"||"{;".includes(Cl(t,e))}function kl(t,e,s,o){let i=o.ci?t.slice(e,s).toLowerCase():t.slice(e,s);if(o.keywordSet.has(i))return"keyword";let a=t[e-1]==="."||t[e-1]===":";return o.builtinSet.has(i)&&!a?"builtin":o.plainWords?"plain":/^\s*\(/.test(t.slice(s,s+8))?"function":/^[A-Z][A-Za-z0-9_$]*[a-z]/.test(i)?"type":"plain"}function Ll(t,e,s,o){let i=t[e],a=/^(\/|\?)?>/.exec(t.slice(e,e+2));return a?(o.inTag=!1,["tag",e+a[0].length]):s.quotes.includes(i)?["string",sa(t,e,s)]:ci.test(i)?["attr",mn(t,e+1,ta)]:["plain",e+1]}function Nl(t,e,s){if(t[e]==="<"&&Al.test(t[e+1]??""))return s.inTag=!0,["tag",mn(t,e+2,ta)];let o=t[e]==="&"?Sl.exec(t.slice(e,e+12)):null;return o?["number",e+o[0].length]:["plain",e+1]}function Tl(t,e,s){let o=t[e];return!(o==="$"&&s.variables||o==="@"&&s.annotations)||!ci.test(t[e+1]??"")?null:[o==="$"?"variable":"meta",mn(t,e+2,Qi)]}function Ol(t,e,s,o,i){let a=t[e];if(i.inTag)return Ll(t,e,s,i);let c=El(t,e,s);if(c!==-1)return["comment",c];if(s.tags)return Nl(t,e,i);if(s.quotes?.includes(a)){let U=sa(t,e,s);return[Xi(t,e,U,s)?"attr":"string",U]}if(s.hex&&a==="#"&&Ji.test(t.slice(e,e+10)))return["number",e+Ji.exec(t.slice(e,e+10))[0].length];if(Gi.test(a)||a==="."&&Gi.test(t[e+1]??""))return["number",mn(t,e+1,yl)];let u=Tl(t,e,s);if(u)return u;let d=s.dashed&&a==="-"&&/[A-Za-z-]/.test(t[e+1]??"");if(!ci.test(a)&&!d)return["plain",e+1];let v=mn(t,e+1,s.dashed?wl:Qi);if(Xi(t,e,v,s))return["attr",v];let S=kl(t,e,v,s);return[S==="plain"&&o.has(t.slice(e,v))&&t[e-1]!=="."?"builtin":S,v]}function Nn(t,e,s=[]){let o=bn(e),i=new Set(s),a={inTag:!1},c=[],u=0;for(;u<t.length;){let[d,v]=Ol(t,u,o,i,a),S=t.slice(u,v),P=c[c.length-1];d==="plain"&&P?.kind==="plain"?P.text+=S:c.push({kind:d,text:S,className:xl[d]}),u=v}return c}function oa(t,e){return t.startsWith(" ")?1:/^ */.exec(t.slice(0,e.length))[0].length}var Il=new Set(["javascript","typescript","go","c","cpp","java","csharp","kotlin","swift","rust","php","css","lua","html","xml"]),Bl=new Set("area base br col embed hr img input link meta source track wbr".split(" ")),Rl=/^[}\])]+/,Ml=/\b(function|if|for|while|repeat)\b/g,$l=/\b(end|until)\b/g,_l=/^(else|elseif)\b/,Ul=/^(end|until)\b/;function je(t,e){return(t.match(e)??[]).length}function Pl(t,e){let s=new Uint8Array(t.length),o="",i=0;for(let{kind:a,text:c}of Nn(t,e)){let u=a==="comment"||a==="string";o+=u?c.replace(/[^\n]/g," "):c,u&&s.fill(1,i,i+c.length),i+=c.length}return{masked:o,inside:s}}function ql(t,e){let s=u=>!(e&&Bl.has(u.toLowerCase())),o=[...t.matchAll(/<([A-Za-z][\w:.-]*)/g)].filter(u=>s(u[1])).length,i=[...t.matchAll(/<([A-Za-z][\w:.-]*)[^<>]*\/>/g)].filter(u=>s(u[1])).length,a=t.includes("<")?0:je(t,/\/>/g);return{leading:je(/^(?:<\/[^>]*>\s*)+/.exec(t)?.[0]??"",/<\//g),net:o-i-a-je(t,/<\//g)}}function Dl(t,e){let s=t.trim();if(e.tags)return ql(s,e.id==="html");let o=e.id==="lua",i=Rl.exec(s)?.[0].length??0,a=je(s,/[{([]/g)-je(s,/[})\]]/g);if(!o)return{leading:i,net:a};let c=je(s,Ml)+(/^do\b/.test(s)?1:0)-je(s,$l);return{leading:i||(_l.test(s)||Ul.test(s)?1:0),net:a+c}}function jl(t,e){return(t.id==="c"||t.id==="cpp")&&e.startsWith("#")}function Fl(t,e){let{masked:s,inside:o}=Pl(t,e.id),i=[],a=0,c=0;for(let u of t.split(`
15
+ `)){let d=s.slice(c,c+u.length),v=c>0&&o[c-1]===1;c+=u.length+1;let S=u.trim(),{leading:P,net:U}=Dl(d,e);v?i.push(u.trimEnd()):S?jl(e,S)?i.push(S):i.push(e.indent.repeat(Math.max(0,a-P))+S):i.push(""),a=Math.max(0,a+U)}return i}function zl(t){return t.split(`
16
+ `).map(e=>e.trimEnd())}function Hl(t){return`${t.filter((s,o)=>s!==""||o>0&&t[o-1]!=="").join(`
18
17
  `).replace(/^\n+|\n+$/g,"")}
19
- `}function ea(t,e){let s=xi(e),o=String(t??"").replace(/\r\n?/g,`
18
+ `}function ra(t,e){let s=bn(e),o=String(t??"").replace(/\r\n?/g,`
20
19
  `);return o.trim()?s.id==="json"?`${JSON.stringify(JSON.parse(o),null,2)}
21
- `:kl(hl.has(s.id)?El(o,s):Cl(o)):""}var Ke=class extends c{setup(){this.state=$({text:null,name:"",loading:!1,error:"",editing:!this.props.readonly}),this.fileInput=q("fileInput"),this.input=q("input"),this.controller=null,Q(()=>this.syncInput()),at(()=>this.syncInput()),Ot(()=>this.loadUrl(this.props.src)),ht(e=>{if(e.readonly!==this.props.readonly&&(this.state.editing=!e.readonly),e.src!==this.props.src)return this.loadUrl(e.src)}),st(()=>this.controller?.abort()),this.tabReleased=!1}get classNames(){return f("b-code-editor",this.props.className)}get code(){return this.state.text??this.props.value??""}get codeLang(){return this.props.codeLang??Xn(this.state.name||this.props.src)}get language(){return xi(this.codeLang)}get globals(){return this.props.globals??[]}get isReadonly(){return!this.state.editing}get showToggle(){return this.props.toggle!==!1}get showFormat(){return this.props.format!==!1&&!this.isReadonly}get ariaLabel(){return this.props.title||`${this.language.label} code`}get tokens(){return $i(`${this.code}
20
+ `:Hl(Il.has(s.id)?Fl(o,s):zl(o)):""}var Fe=class extends l{setup(){this.state=I({text:null,name:"",loading:!1,error:"",editing:!this.props.readonly}),this.fileInput=$("fileInput"),this.input=$("input"),this.controller=null,K(()=>this.syncInput()),rt(()=>this.syncInput()),xt(()=>this.loadUrl(this.props.src)),nt(e=>{if(e.readonly!==this.props.readonly&&(this.state.editing=!e.readonly),e.src!==this.props.src)return this.loadUrl(e.src)}),G(()=>this.controller?.abort()),this.tabReleased=!1}get classNames(){return f("b-code-editor",this.props.className)}get code(){return this.state.text??this.props.value??""}get codeLang(){return this.props.codeLang??ea(this.state.name||this.props.src)}get language(){return bn(this.codeLang)}get globals(){return this.props.globals??[]}get isReadonly(){return!this.state.editing}get showToggle(){return this.props.toggle!==!1}get showFormat(){return this.props.format!==!1&&!this.isReadonly}get ariaLabel(){return this.props.title||`${this.language.label} code`}get tokens(){return Nn(`${this.code}
22
21
  `,this.codeLang,this.globals)}get lineCount(){return this.code.split(`
23
22
  `).length}get lineLabel(){return`${this.lineCount} ${this.lineCount===1?"line":"lines"}`}get lineNumbers(){return Array.from({length:this.lineCount},(e,s)=>s+1).join(`
24
- `)}commit(e){(this.state.text!==null||!this.props.onChange)&&(this.state.text=e),this.props.onChange?.(e)}async loadUrl(e){if(this.controller?.abort(),!!e){this.controller=new globalThis.AbortController,this.state.loading=!0,this.state.error="";try{let s=await fetch(e,{signal:this.controller.signal});if(!s.ok)throw new Error(`Could not load ${e} (HTTP ${s.status})`);this.setFile(await s.text(),e)}catch(s){s.name!=="AbortError"&&this.fail(s)}this.state.loading=!1}}syncInput(){let e=this.input.el;if(!e||e.value===this.code)return;let{selectionStart:s,selectionEnd:o}=e;e.value=this.code,e.setSelectionRange(Math.min(s,this.code.length),Math.min(o,this.code.length))}toggleEditing(){this.state.editing=!this.state.editing}format(){try{this.commit(ea(this.code,this.codeLang)),this.state.error=""}catch(e){this.fail(e)}}openPicker(){this.fileInput.el.click()}async onFileChange(e){let s=e.target.files[0];if(e.target.value="",!!s)try{this.setFile(await s.text(),s.name)}catch(o){this.fail(o)}}setFile(e,s){Object.assign(this.state,{text:e,name:s,error:""}),this.props.onLoad?.({code:e,name:s})}fail(e){this.state.error=e.message,this.props.onError?.(e)}onInput(e){this.commit(e.target.value),this.revealCaret(e.target)}revealCaret(e){let s=e.closest(".b-code-editor-box");if(!s||!e.isConnected)return;let o=getComputedStyle(e),n=parseFloat(o.paddingTop)||0,a=parseFloat(o.lineHeight)||21,l=e.value.slice(0,e.selectionEnd),p=l.split(`
25
- `).length-1,b=n+p*a;b-n<s.scrollTop?s.scrollTop=Math.max(0,b-n):b+a+n>s.scrollTop+s.clientHeight&&(s.scrollTop=b+a+n-s.clientHeight);let v=l.slice(l.lastIndexOf(`
26
- `)+1).replaceAll(" "," ".repeat(4)).length,k=this.measure??(this.measure=document.createElement("canvas").getContext("2d"));if(!k)return;k.font=`${o.fontSize} ${o.fontFamily}`;let O=e.offsetLeft+parseFloat(o.paddingLeft)+v*k.measureText("0").width,j=s.querySelector(".b-code-editor-gutter")?.offsetWidth??0;O<s.scrollLeft+j?s.scrollLeft=Math.max(0,O-j-n):O+n>s.scrollLeft+s.clientWidth&&(s.scrollLeft=O+n-s.clientWidth)}onKeydown(e){let s=e.target;if(requestAnimationFrame(()=>this.revealCaret(s)),e.key==="F"&&e.shiftKey&&e.altKey&&this.showFormat){e.preventDefault(),this.format();return}if(e.key==="Escape"){this.tabReleased=!0;return}let o=this.tabReleased;if(this.tabReleased=!1,e.key==="Tab"&&!o)e.preventDefault(),e.shiftKey?this.outdentLine(s):s.setRangeText(this.language.indent,s.selectionStart,s.selectionEnd,"end");else if(e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.altKey){e.preventDefault();let n=s.value.lastIndexOf(`
27
- `,s.selectionStart-1)+1,a=/^[ \t]*/.exec(s.value.slice(n,s.selectionStart))[0];s.setRangeText(`
23
+ `)}commit(e){(this.state.text!==null||!this.props.onChange)&&(this.state.text=e),this.props.onChange?.(e)}async loadUrl(e){if(this.controller?.abort(),!!e){this.controller=new globalThis.AbortController,this.state.loading=!0,this.state.error="";try{let s=await fetch(e,{signal:this.controller.signal});if(!s.ok)throw new Error(`Could not load ${e} (HTTP ${s.status})`);this.setFile(await s.text(),e)}catch(s){s.name!=="AbortError"&&this.fail(s)}this.state.loading=!1}}syncInput(){let e=this.input.el;if(!e||e.value===this.code)return;let{selectionStart:s,selectionEnd:o}=e;e.value=this.code,e.setSelectionRange(Math.min(s,this.code.length),Math.min(o,this.code.length))}toggleEditing(){this.state.editing=!this.state.editing}format(){try{this.commit(ra(this.code,this.codeLang)),this.state.error=""}catch(e){this.fail(e)}}openPicker(){this.fileInput.el.click()}async onFileChange(e){let s=e.target.files[0];if(e.target.value="",!!s)try{this.setFile(await s.text(),s.name)}catch(o){this.fail(o)}}setFile(e,s){Object.assign(this.state,{text:e,name:s,error:""}),this.props.onLoad?.({code:e,name:s})}fail(e){this.state.error=e.message,this.props.onError?.(e)}onInput(e){this.commit(e.target.value),this.revealCaret(e.target)}revealCaret(e){let s=e.closest(".b-code-editor-box");if(!s||!e.isConnected)return;let o=getComputedStyle(e),i=parseFloat(o.paddingTop)||0,a=parseFloat(o.lineHeight)||21,c=e.value.slice(0,e.selectionEnd),u=c.split(`
24
+ `).length-1,d=i+u*a;d-i<s.scrollTop?s.scrollTop=Math.max(0,d-i):d+a+i>s.scrollTop+s.clientHeight&&(s.scrollTop=d+a+i-s.clientHeight);let v=c.slice(c.lastIndexOf(`
25
+ `)+1).replaceAll(" "," ".repeat(4)).length,S=this.measure??(this.measure=document.createElement("canvas").getContext("2d"));if(!S)return;S.font=`${o.fontSize} ${o.fontFamily}`;let P=e.offsetLeft+parseFloat(o.paddingLeft)+v*S.measureText("0").width,U=s.querySelector(".b-code-editor-gutter")?.offsetWidth??0;P<s.scrollLeft+U?s.scrollLeft=Math.max(0,P-U-i):P+i>s.scrollLeft+s.clientWidth&&(s.scrollLeft=P+i-s.clientWidth)}onKeydown(e){let s=e.target;if(requestAnimationFrame(()=>this.revealCaret(s)),e.key==="F"&&e.shiftKey&&e.altKey&&this.showFormat){e.preventDefault(),this.format();return}if(e.key==="Escape"){this.tabReleased=!0;return}let o=this.tabReleased;if(this.tabReleased=!1,e.key==="Tab"&&!o)e.preventDefault(),e.shiftKey?this.outdentLine(s):s.setRangeText(this.language.indent,s.selectionStart,s.selectionEnd,"end");else if(e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.altKey){e.preventDefault();let i=s.value.lastIndexOf(`
26
+ `,s.selectionStart-1)+1,a=/^[ \t]*/.exec(s.value.slice(i,s.selectionStart))[0];s.setRangeText(`
28
27
  ${a}`,s.selectionStart,s.selectionEnd,"end")}else return;this.commit(s.value)}outdentLine(e){let s=e.value.lastIndexOf(`
29
- `,e.selectionStart-1)+1,o=ta(e.value.slice(s),this.language.indent);if(!o)return;let{selectionStart:n,selectionEnd:a}=e;e.setRangeText("",s,s+o,"preserve"),e.setSelectionRange(Math.max(s,n-o),Math.max(s,a-o))}};r(Ke,"template","nodexui.CodeEditor"),r(Ke,"components",{Alert:Pt,AlertDescription:Xt,Badge:Ct,Button:P,ClipboardButton:_t,Kbd:Qt,Spinner:te}),r(Ke,"props",{value:i(String),codeLang:i(String),src:i(String),upload:i(Boolean),format:i(Boolean),toggle:i(Boolean),onChange:i(Function),onLoad:i(Function),onError:i(Function),readonly:i(Boolean),title:i(String),globals:i(Array),hint:i(String),id:i(String),...u});_();R();var ee=class extends c{get tag(){return this.props.tag||"div"}};r(ee,"template","nodexui.Card"),r(ee,"props",{...u,tag:i(String)});var se=class extends c{};r(se,"template","nodexui.CardHeader"),r(se,"props",u);var oe=class extends c{};r(oe,"template","nodexui.CardBody"),r(oe,"props",u);var Gs=class extends c{};r(Gs,"template","nodexui.CardFooter"),r(Gs,"props",u);var re=class extends c{};r(re,"template","nodexui.CardTitle"),r(re,"props",u);var ie=class extends c{};r(ie,"template","nodexui.CardDescription"),r(ie,"props",u);R();_();R();_();R();var Rt=class extends c{setup(){this.state=$({open:dt(this.props.state)}),this.triggerRef=q("trigger"),this.bufferRef=q("buffer"),this.bootstrapTooltip=null,this.lastContentHtml=null,this.onShown=()=>{this.state.open=!0},this.onHidden=()=>{this.state.open=!1},Q(()=>{this.lastContentHtml=this.currentContentHtml();let e=this.triggerElement();this.bootstrapTooltip=new(W()).Tooltip(e,{title:this.lastContentHtml,html:!0,trigger:"hover focus"}),e.addEventListener("shown.bs.tooltip",this.onShown),e.addEventListener("hidden.bs.tooltip",this.onHidden),dt(this.props.state)&&this.bootstrapTooltip.show()}),at(()=>{let e=this.currentContentHtml();e!==this.lastContentHtml&&(this.lastContentHtml=e,this.bootstrapTooltip?.setContent({".tooltip-inner":e}))}),st(()=>{let e=this.triggerElement();e?.removeEventListener("shown.bs.tooltip",this.onShown),e?.removeEventListener("hidden.bs.tooltip",this.onHidden),this.bootstrapTooltip?.dispose()})}triggerElement(){return this.triggerRef.el?.firstElementChild||this.triggerRef.el}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}show(){this.bootstrapTooltip?.show()}hide(){this.bootstrapTooltip?.hide()}};r(Rt,"template","nodexui.Tooltip"),r(Rt,"props",{content:i(String),state:i(String),...u});var Ll=Fs("circle-question-mark"),Nl=0,kt={label:i(String),labelBackground:i(String),supportingText:i(String),useTip:i(Number),errorText:i(String),leadingIcon:i(String),trailingIcon:i(String),maxLength:i(Number),invalid:i(Boolean),placeholder:i(String),disabled:i(Boolean),slots:i(Object)},xt=class extends c{setup(){this.supportId=`b-input-support-${Nl++}`,this.box=q("box"),this.slotRefs={start:q("start"),end:q("end"),footer:q("footer")},Q(()=>this.measureSlots()),at(()=>this.measureSlots())}get field(){return this.env.fieldProps?.()??{}}get label(){return this.props.label??this.field.label}get labelStyle(){let e=this.props.labelBackground??this.field.labelBackground;return e?`--b-label-bg:${e}`:void 0}get isOutlined(){return!!this.label||this.hasStart||this.hasEnd||this.hasFooter}get hasStart(){return!!this.props.slots?.start}get hasEnd(){return!!this.props.slots?.end}get hasFooter(){return!!this.props.slots?.footer}measureSlots(){let e=this.box.el;if(!e)return;let{start:s,end:o,footer:n}=this.slotRefs;e.style.setProperty("--b-slot-start",`${s.el?.offsetWidth??0}px`),e.style.setProperty("--b-slot-end",`${o.el?.offsetWidth??0}px`),e.style.setProperty("--b-slot-footer",`${n.el?.offsetHeight??0}px`)}get isInvalid(){return!!(this.props.invalid||this.field.invalid||this.errorText)}get errorText(){return this.props.errorText??this.field.error}get helperText(){return this.props.supportingText||this.field.description}get useTip(){return Number(this.props.useTip??this.field.useTip??0)===1}get supportingText(){return this.errorText||(this.useTip?void 0:this.helperText)}get tipText(){return this.useTip&&!this.errorText?this.helperText:void 0}get leadingIcon(){return this.props.leadingIcon}get trailingIcon(){return this.isInvalid?"circle-alert":this.props.trailingIcon}get fieldPlaceholder(){return this.props.placeholder??(this.isOutlined?" ":void 0)}get counter(){return`${(this.props.value??"").length}/${this.props.maxLength}`}get controlClass(){return this.isOutlined&&"b-outlined-control"}get describedBy(){return this.supportingText?this.supportId:void 0}get outlinedClassNames(){return f("b-input-outlined",this.isInvalid&&"is-invalid",this.props.disabled&&"is-disabled",this.props.placeholder&&"has-placeholder",this.leadingIcon&&"has-leading",this.trailingIcon&&"has-trailing",this.hasStart&&"has-start",this.hasEnd&&"has-end",this.hasFooter&&"has-footer")}};r(xt,"components",{Icon:tt,IconCircleQuestionMark:Ll,Tooltip:Rt});function _i({tag:t="input",type:e}={}){return t==="select"?"form-select":e==="checkbox"||e==="radio"?"form-check-input":"form-control"}var ne=class extends xt{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return f("b-input",_i({tag:"input",type:this.props.type}),this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(ne,"template","nodexui.Input"),r(ne,"props",{...kt,value:i(String),type:i(String),readonly:i(Boolean),className:i(String),style:i([String,Object]),id:i(String),list:i(String),autocomplete:i(String),"aria-label":i(String),ariaLabel:i(String),min:i([String,Number]),max:i([String,Number]),step:i([String,Number]),onInput:i(Function),onChange:i(Function)});_();R();var un={default:"b-tabs-list-default",line:"b-tabs-list-line"};function Pi(t,e,s,o="horizontal"){let n=o==="vertical",p=t===(n?"ArrowDown":"ArrowRight")?1:t===(n?"ArrowUp":"ArrowLeft")?-1:0;return!p||s===0?-1:(e+p+s)%s}var Ol=0;function sa(t){return String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}var ae=class extends c{setup(){this.tabsState=$({active:this.props.value??this.props.defaultValue??""}),this.instanceId=`t${++Ol}`,G({tabs:this.tabsState,selectTab:e=>this.select(e),tabsId:this.instanceId,orientation:this.orientation}),ht(e=>{e.value!==void 0&&(this.tabsState.active=e.value)})}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return f("b-tabs",this.props.className)}select(e){this.props.value===void 0&&(this.tabsState.active=e),this.props.onChange?.(e)}};r(ae,"template","nodexui.Tabs"),r(ae,"props",{value:i(String),defaultValue:i(String),orientation:i(String),onChange:i(Function),...u});var ce=class extends c{};r(ce,"template","nodexui.TabsContainer"),r(ce,"props",{...u});var le=class extends c{setup(){this.listRef=q("list")}get classNames(){return f("nav","b-tabs-list",un[this.props.variant]||un.default,this.props.className)}onKeyDown(e){let s=[...this.listRef.el.querySelectorAll("[role='tab']")],o=s.indexOf(e.target),n=Pi(e.key,o,s.length,this.env.orientation);n!==-1&&(e.preventDefault(),s[n].focus(),s[n].click())}};r(le,"template","nodexui.TabsList"),r(le,"props",{variant:i(String),...u});var Ut=class extends c{setup(){this.rootEl=null,this.tabInstance=null,this.onShown=()=>this.env.selectTab(this.props.value)}onRootRef(e){e?(this.rootEl=e,this.tabInstance=W().Tab.getOrCreateInstance(e),e.addEventListener("shown.bs.tab",this.onShown)):this.rootEl&&(this.rootEl.removeEventListener("shown.bs.tab",this.onShown),this.tabInstance?.dispose(),this.tabInstance=null,this.rootEl=null)}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`b-tabs-panel-${this.env.tabsId}-${sa(this.props.value)}`}get classNames(){return f("nav-link","b-tabs-trigger",this.isActive&&"active",this.props.className)}get tabAttrs(){return{role:"tab","data-bs-target":`#${this.panelId}`,"aria-selected":this.isActive?"true":"false",tabindex:this.isActive?0:-1}}onClick(){this.props.disabled||this.tabInstance?.show()}};r(Ut,"template","nodexui.TabTrigger"),r(Ut,"components",{Button:P}),r(Ut,"props",{value:{type:String},disabled:i(Boolean),...u});var ue=class extends c{setup(){this.initialActive=this.isActive}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`b-tabs-panel-${this.env.tabsId}-${sa(this.props.value)}`}};r(ue,"template","nodexui.TabContent"),r(ue,"props",{value:{type:String},...u});_();R();_();R();function yt(t,e){ht(s=>{je(s)&&(t.open=lt(s),t.open?e?.instance?.show():e?.instance?.hide())})}function wt(t,e,s){je(t)||(e.open=s),t.onOpenChange?.(s)}function Ui(t,e){let s=null;Q(()=>{s=new(W()).Collapse(t.el,{toggle:!1})}),at(()=>{if(!s)return;let o=t.el.classList.contains("show");e()&&!o?s.show():!e()&&o&&s.hide()}),st(()=>s?.dispose())}var pe=class extends c{setup(){this.dialogState=$({open:lt(this.props)}),this.control={instance:null},G({dialog:this.dialogState,dialogControl:this.control,setDialogOpen:e=>this.setOpen(e)}),yt(this.dialogState,this.control)}setOpen(e){wt(this.props,this.dialogState,e)}};r(pe,"template","nodexui.Dialog"),r(pe,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),style:i([String,Object]),slots:i(Object)});var Zs=class extends c{onClick(){this.env.dialogControl.instance?.show()}};r(Zs,"template","nodexui.DialogTrigger"),r(Zs,"props",u);var qt=class extends c{setup(){this.rootRef=q("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDialogOpen(!0),this.onHidden=()=>{this.env.setDialogOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},Q(()=>{this.env.dialogControl.instance=W().Modal.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,focus:!0}),this.rootRef.el.addEventListener("show.bs.modal",this.onShow),this.rootRef.el.addEventListener("shown.bs.modal",this.onShown),this.rootRef.el.addEventListener("hidden.bs.modal",this.onHidden),this.env.dialog.open&&this.env.dialogControl.instance.show()}),st(()=>{this.rootRef.el.removeEventListener("show.bs.modal",this.onShow),this.rootRef.el.removeEventListener("shown.bs.modal",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.modal",this.onHidden),this.env.dialogControl.instance?.dispose(),this.env.dialogControl.instance=null})}get showCloseButton(){return this.props.showCloseButton!==!1&&this.props["show-close-button"]!==!1}};r(qt,"template","nodexui.DialogContent"),r(qt,"components",{Button:P}),r(qt,"props",{...u,showCloseButton:i(Boolean),"show-close-button":i(Boolean)});var de=class extends c{};r(de,"template","nodexui.DialogHeader"),r(de,"props",u);var he=class extends c{};r(he,"template","nodexui.DialogFooter"),r(he,"props",u);var be=class extends c{};r(be,"template","nodexui.DialogTitle"),r(be,"props",u);var me=class extends c{};r(me,"template","nodexui.DialogDescription"),r(me,"props",u);var Ve=class extends c{};r(Ve,"template","nodexui.DialogClose"),r(Ve,"components",{Button:P}),r(Ve,"props",u);_();R();var oa={default:"b-empty-default",outline:"b-empty-outline",background:"b-empty-background"},Tl={default:"b-empty-media-default",icon:"b-empty-media-icon"},Js=class extends c{get classNames(){return f("b-empty",oa[this.props.variant]||oa.default,this.props.className)}};r(Js,"template","nodexui.Empty"),r(Js,"props",{variant:i(String),...u});var Ys=class extends c{};r(Ys,"template","nodexui.EmptyHeader"),r(Ys,"props",u);var Xs=class extends c{get variant(){return this.props.variant==="icon"?"icon":"default"}get classNames(){return f("b-empty-media",Tl[this.variant],this.props.className)}};r(Xs,"template","nodexui.EmptyMedia"),r(Xs,"props",{variant:i(String),...u});var Qs=class extends c{};r(Qs,"template","nodexui.EmptyTitle"),r(Qs,"props",u);var to=class extends c{};r(to,"template","nodexui.EmptyDescription"),r(to,"props",u);var eo=class extends c{};r(eo,"template","nodexui.EmptyContent"),r(eo,"props",u);_();R();var so=class extends c{get vertical(){return this.props.orientation==="vertical"}get classNames(){return f("b-separator",this.vertical?"b-separator-vertical":"b-separator-horizontal",this.props.className)}};r(so,"template","nodexui.Separator"),r(so,"props",{orientation:i(String),className:i(String),style:i([String,Object])});_();R();var fe=class extends c{get classNames(){return f("b-skeleton",this.props.shape==="circle"?"b-skeleton-circle":"b-skeleton-block",this.props.className)}};r(fe,"template","nodexui.Skeleton"),r(fe,"props",{shape:i(String),className:i(String),style:i([String,Object])});_();R();var Il={lead:"lead",muted:"text-body-secondary",code:"b-code",kbd:"b-kbd",h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"b-list"},Bl={h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"ul"},oo=class extends c{get tag(){return this.props.tag||Bl[this.props.variant]||"p"}get classNames(){return f("b-typography",Il[this.props.variant],this.props.className)}};r(oo,"template","nodexui.Typography"),r(oo,"props",{variant:i(String),tag:i(String),...u});_();R();var ro=class extends c{get classNames(){return f("b-marker",this.props.className)}get variant(){return this.props.variant}};r(ro,"template","nodexui.Marker"),r(ro,"props",{variant:i(String),...u});R();var ge=class extends xt{get outlinedClassNames(){return f(super.outlinedClassNames,"is-anchored")}get classNames(){return f("form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.resize==="none"&&"b-textarea-no-resize",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(ge,"template","nodexui.Textarea"),r(ge,"props",{...kt,value:i(String),rows:i(Number),readonly:i(Boolean),resize:i(String),className:i(String),style:i([String,Object]),id:i(String),onInput:i(Function),onChange:i(Function)});R();var ve=class extends xt{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return f("b-native-select","form-select",this.controlClass,this.isInvalid&&"is-invalid",(this.props.size==="sm"||this.props.size==="lg")&&`form-select-${this.props.size}`,this.props.className)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(ve,"template","nodexui.NativeSelect"),r(ve,"props",{...kt,value:i(String),size:i(String),...u,"aria-label":i(String),ariaLabel:i(String),id:i(String),onChange:i(Function)});_();R();var xe=class extends c{onChange(e){this.props.onChange?.(e.target.checked,e)}};r(xe,"template","nodexui.Checkbox"),r(xe,"props",{checked:i(Boolean),disabled:i(Boolean),...u,id:i(String),onChange:i(Function)});_();R();var io=class extends c{setup(){G({radioGroupValue:()=>this.props.value,radioGroupDisabled:()=>this.props.disabled,radioGroupName:()=>this.props.name||"b-radio-group",selectRadio:e=>this.props.onChange?.(e)})}get classNames(){return f("b-radio-group",this.props.className)}};r(io,"template","nodexui.RadioGroup"),r(io,"props",{value:i(String),name:i(String),disabled:i(Boolean),...u,onChange:i(Function)});var no=class extends c{get checked(){return this.env.radioGroupValue()===this.props.value}get disabled(){return this.props.disabled||this.env.radioGroupDisabled()}onChange(){this.disabled||this.env.selectRadio(this.props.value)}};r(no,"template","nodexui.RadioGroupItem"),r(no,"props",{value:{type:String},disabled:i(Boolean),...u});_();R();var Rl=Fs("circle-question-mark"),Ge=class extends c{get tipText(){return Number(this.props.useTip??0)===1?this.props.supportingText:void 0}get supportingText(){return this.tipText?void 0:this.props.supportingText}onChange(e){this.props.onChange?.(e.target.checked,e)}};r(Ge,"template","nodexui.Switch"),r(Ge,"components",{IconCircleQuestionMark:Rl,Tooltip:Rt}),r(Ge,"props",{checked:i(Boolean),disabled:i(Boolean),supportingText:i(String),useTip:i(Number),...u,onChange:i(Function)});_();R();var ao=class extends c{get classNames(){return f("b-slider",this.props.className)}onInput(e){e.target.style.setProperty("--b-slider-value",`${e.target.value}%`),this.props.onChange?.(e.target.value,e)}};r(ao,"template","nodexui.Slider"),r(ao,"props",{value:i([Number,String]),min:i([Number,String]),max:i([Number,String]),step:i([Number,String]),disabled:i(Boolean),className:i(String),style:i([String,Object]),onChange:i(Function)});_();R();var co=class extends c{setup(){this.length=this.props.length||6;let e=(this.props.value||"").split("");this.state=$({digits:Array.from({length:this.length},(s,o)=>e[o]||"")}),this.rootRef=q("root")}get classNames(){return f("b-input-otp",this.props.className)}get boxes(){return this.state.digits.map((e,s)=>({index:s,value:e}))}emit(){this.props.onChange?.(this.state.digits.join(""))}onInput(e,s){let o=s.target.value.slice(-1);this.state.digits[e]=o,o&&this.rootRef.el&&[...this.rootRef.el.querySelectorAll("input")][e+1]?.focus(),this.emit()}onPaste(e){let s=e.clipboardData.getData("text").trim();if(s){e.preventDefault();for(let o=0;o<this.length;o++)this.state.digits[o]=s[o]||"";this.emit()}}};r(co,"template","nodexui.InputOtp"),r(co,"props",{length:i(Number),value:i(String),disabled:i(Boolean),className:i(String),style:i([String,Object]),onChange:i(Function)});_();_();function lo(t,{defaultOpen:e=!1,onOpenChange:s}={}){let o=$({open:e}),n=b=>{o.open!==b&&(o.open=b,s?.(b))},a=()=>n(!o.open),l=b=>{t.el&&!t.el.contains(b.target)&&n(!1)},p=b=>{b.key==="Escape"&&n(!1)};return At(b=>{if(b)return document.addEventListener("click",l),document.addEventListener("keydown",p),()=>{document.removeEventListener("click",l),document.removeEventListener("keydown",p)}},()=>[o.open]),st(()=>{document.removeEventListener("click",l),document.removeEventListener("keydown",p)}),{state:o,setOpen:n,toggle:a}}R();var uo=class extends xt{setup(){super.setup(),this.rootRef=q("root");let{state:e,setOpen:s,toggle:o}=lo(this.rootRef,{defaultOpen:dt(this.props.state)});this.disclosure=e,G({select:this.disclosure,selectValue:()=>this.props.value,selectToggle:o,selectClose:()=>s(!1),selectChoose:n=>{this.props.onChange?.(n),s(!1)}})}get outlinedClassNames(){return f(super.outlinedClassNames,"is-anchored",this.props.value&&"is-floated")}get rootStyle(){return bt(this.labelStyle,this.props.style)}get classNames(){return f("b-select",this.isOutlined&&this.outlinedClassNames,this.props.className)}};r(uo,"template","nodexui.Select"),r(uo,"props",{...kt,value:i(String),state:i(String),onChange:i(Function),...u});var Ze=class extends c{get attrs(){return{"aria-haspopup":"listbox","aria-expanded":this.env.select.open?"true":"false"}}onClick(){this.env.selectToggle()}};r(Ze,"template","nodexui.SelectTrigger"),r(Ze,"components",{Button:P}),r(Ze,"props",u);var po=class extends c{get open(){return this.env.select.open}};r(po,"template","nodexui.SelectContent"),r(po,"props",u);var ho=class extends c{get selected(){return this.env.selectValue()===this.props.value}onClick(){this.env.selectChoose(this.props.value)}};r(ho,"template","nodexui.SelectItem"),r(ho,"props",{value:{type:String},...u});_();function bo(t){return[...t.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")].filter(e=>!e.disabled&&!e.hidden)}function pn(t,e){if(t.key!=="Tab")return;let s=bo(e);if(!s.length){t.preventDefault();return}let o=s[0],n=s[s.length-1];t.shiftKey&&document.activeElement===o?(t.preventDefault(),n.focus()):!t.shiftKey&&document.activeElement===n&&(t.preventDefault(),o.focus())}function qi(t,{closeSelector:e,trapFocus:s=!1}={}){let o=t.getAttribute("b-att-trigger"),n=o?document.querySelector(o):null,a=[...t.querySelectorAll(e)],l=null,p=()=>bo(t),b=()=>{l=document.activeElement,t.hidden=!1,t.setAttribute("b-att-state","open"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),p()[0]?.focus(),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},v=()=>{t.hidden=!0,t.setAttribute("b-att-state","closed"),l?.focus?.(),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))},k=j=>{if(j.key==="Escape"){v();return}!s||t.hidden||pn(j,t)},O=j=>{j.target===t&&v()};return n?.addEventListener("click",b),a.forEach(j=>j.addEventListener("click",v)),t.addEventListener("keydown",k),t.addEventListener("click",O),(!t.getAttribute("b-att-state")||t.getAttribute("b-att-state")==="closed")&&(t.hidden=!0),{open:b,close:v,destroy:()=>{n?.removeEventListener("click",b),a.forEach(j=>j.removeEventListener("click",v)),t.removeEventListener("keydown",k),t.removeEventListener("click",O)}}}function mo(t,e,s,o){let n=t.getAttribute("b-att-trigger"),a=n?document.querySelector(n):null,l=null,p=()=>{l=document.activeElement},b=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},v=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0})),l?.focus?.(),l=null},k=()=>e.show(),O=()=>e.hide();return t.addEventListener(`show.bs.${s}`,p),t.addEventListener(`shown.bs.${s}`,b),t.addEventListener(`hidden.bs.${s}`,v),a?.addEventListener("click",k),t.setAttribute("b-att-state","closed"),t[o]={open:k,close:O},{destroy:()=>{a?.removeEventListener("click",k),t.removeEventListener(`show.bs.${s}`,p),t.removeEventListener(`shown.bs.${s}`,b),t.removeEventListener(`hidden.bs.${s}`,v),e.dispose(),delete t[o]}}}R();var fo=class extends c{setup(){this.alertDialogState=$({open:lt(this.props)}),G({alertDialog:this.alertDialogState,setAlertDialogOpen:e=>this.setOpen(e)}),yt(this.alertDialogState)}setOpen(e){wt(this.props,this.alertDialogState,e)}};r(fo,"template","nodexui.AlertDialog"),r(fo,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var Je=class extends c{get attrs(){return{"data-slot":"alert-dialog-trigger"}}onClick(){this.env.setAlertDialogOpen(!0)}};r(Je,"template","nodexui.AlertDialogTrigger"),r(Je,"components",{Button:P}),r(Je,"props",u);var go=class extends c{get size(){return this.props.size==="sm"?"sm":"default"}setup(){this.rootRef=q("root"),At(e=>{if(!e)return;let s=document.activeElement;return bo(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.alertDialog.open])}get open(){return this.env.alertDialog.open}onKeyDown(e){if(e.key==="Escape"){this.env.setAlertDialogOpen(!1);return}pn(e,this.rootRef.el)}};r(go,"template","nodexui.AlertDialogContent"),r(go,"props",{...u,size:i(String)});var vo=class extends c{};r(vo,"template","nodexui.AlertDialogHeader"),r(vo,"props",u);var xo=class extends c{};r(xo,"template","nodexui.AlertDialogFooter"),r(xo,"props",u);var yo=class extends c{};r(yo,"template","nodexui.AlertDialogMedia"),r(yo,"props",u);var wo=class extends c{};r(wo,"template","nodexui.AlertDialogTitle"),r(wo,"props",u);var Ao=class extends c{};r(Ao,"template","nodexui.AlertDialogDescription"),r(Ao,"props",u);var Ye=class extends c{get attrs(){return{"data-slot":"alert-dialog-cancel"}}onClick(){this.env.setAlertDialogOpen(!1)}};r(Ye,"template","nodexui.AlertDialogCancel"),r(Ye,"components",{Button:P}),r(Ye,"props",u);var Xe=class extends c{get attrs(){return{"data-slot":"alert-dialog-action"}}onClick(){this.props.onClick?.(),this.env.setAlertDialogOpen(!1)}};r(Xe,"template","nodexui.AlertDialogAction"),r(Xe,"components",{Button:P}),r(Xe,"props",{...u,onClick:i(Function)});_();R();var So=class extends c{setup(){this.drawerState=$({open:lt(this.props)}),this.control={instance:null},G({drawer:this.drawerState,drawerControl:this.control,setDrawerOpen:e=>this.setOpen(e)}),yt(this.drawerState,this.control)}setOpen(e){wt(this.props,this.drawerState,e)}};r(So,"template","nodexui.Drawer"),r(So,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var Qe=class extends c{onClick(){this.env.drawerControl.instance?.show()}};r(Qe,"template","nodexui.DrawerTrigger"),r(Qe,"components",{Button:P}),r(Qe,"props",u);var Eo=class extends c{setup(){this.rootRef=q("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDrawerOpen(!0),this.onHidden=()=>{this.env.setDrawerOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},Q(()=>{this.env.drawerControl.instance=W().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawer.open&&this.env.drawerControl.instance.show()}),st(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawerControl.instance?.dispose(),this.env.drawerControl.instance=null})}get open(){return this.env.drawer.open}};r(Eo,"template","nodexui.DrawerContent"),r(Eo,"props",u);var Co=class extends c{};r(Co,"template","nodexui.DrawerHeader"),r(Co,"props",u);var ko=class extends c{};r(ko,"template","nodexui.DrawerFooter"),r(ko,"props",u);var Lo=class extends c{};r(Lo,"template","nodexui.DrawerTitle"),r(Lo,"props",u);var No=class extends c{};r(No,"template","nodexui.DrawerDescription"),r(No,"props",u);var ts=class extends c{get attrs(){return{"data-bs-dismiss":"offcanvas"}}};r(ts,"template","nodexui.DrawerClose"),r(ts,"components",{Button:P}),r(ts,"props",u);_();R();var Oo=class extends c{setup(){this.sheetState=$({open:lt(this.props),side:this.props.side}),this.control={instance:null},G({sheet:this.sheetState,sheetControl:this.control,setSheetOpen:e=>this.setOpen(e)}),yt(this.sheetState,this.control),ht(e=>{this.sheetState.side=e.side})}setOpen(e){wt(this.props,this.sheetState,e)}};r(Oo,"template","nodexui.Sheet"),r(Oo,"props",{open:i(Boolean),state:i(String),side:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var es=class extends c{onClick(){this.env.sheetControl.instance?.show()}};r(es,"template","nodexui.SheetTrigger"),r(es,"components",{Button:P}),r(es,"props",u);var To=class extends c{setup(){this.rootRef=q("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setSheetOpen(!0),this.onHidden=()=>{this.env.setSheetOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},Q(()=>{this.env.sheetControl.instance=W().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheet.open&&this.env.sheetControl.instance.show()}),st(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheetControl.instance?.dispose(),this.env.sheetControl.instance=null})}get open(){return this.env.sheet.open}get side(){return this.props.side??this.env.sheet.side}get placementClass(){return this.side==="left"?"offcanvas-start":"offcanvas-end"}};r(To,"template","nodexui.SheetContent"),r(To,"props",{...u,side:i(String)});var Io=class extends c{};r(Io,"template","nodexui.SheetHeader"),r(Io,"props",u);var Bo=class extends c{};r(Bo,"template","nodexui.SheetFooter"),r(Bo,"props",u);var Ro=class extends c{};r(Ro,"template","nodexui.SheetTitle"),r(Ro,"props",u);var Mo=class extends c{};r(Mo,"template","nodexui.SheetDescription"),r(Mo,"props",u);var ss=class extends c{};r(ss,"template","nodexui.SheetClose"),r(ss,"components",{Button:P}),r(ss,"props",u);_();R();var $o=class extends c{setup(){let e=$({open:dt(this.props.state)});this.control={instance:null,bufferEl:null,lastContentHtml:null};let s=o=>{e.open!==o&&(e.open=o,this.props.onOpenChange?.(o))};G({popover:e,popoverControl:this.control,popoverSetOpen:s,popoverToggle:()=>this.control.instance?.toggle(),popoverClose:()=>this.control.instance?.hide()})}};r($o,"template","nodexui.Popover"),r($o,"props",{state:i(String),onOpenChange:i(Function),...u});var os=class extends c{setup(){this.rootRef={el:null},this.getRef=e=>{this.rootRef.el=e},this.onShown=()=>this.env.popoverSetOpen(!0),this.onHidden=()=>this.env.popoverSetOpen(!1),Q(()=>{let e=this.env.popoverControl,s=e.bufferEl?.innerHTML??"";e.lastContentHtml=s,e.instance=new(W()).Popover(this.rootRef.el,{content:s,html:!0,trigger:"manual"}),this.rootRef.el.addEventListener("shown.bs.popover",this.onShown),this.rootRef.el.addEventListener("hidden.bs.popover",this.onHidden)}),st(()=>{this.rootRef.el.removeEventListener("shown.bs.popover",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.popover",this.onHidden),this.env.popoverControl.instance?.dispose(),this.env.popoverControl.instance=null})}get attrs(){return{"aria-haspopup":"dialog","aria-expanded":this.env.popover.open?"true":"false"}}onClick(){this.env.popoverControl.instance?.toggle()}};r(os,"template","nodexui.PopoverTrigger"),r(os,"components",{Button:P}),r(os,"props",u);var _o=class extends c{get style(){return bt("display:none",this.props.style)}setup(){this.bufferRef=q("buffer"),Q(()=>{this.env.popoverControl.bufferEl=this.bufferRef.el}),at(()=>{let e=this.env.popoverControl;e.bufferEl=this.bufferRef.el;let s=this.currentContentHtml();e.instance&&s!==e.lastContentHtml&&(e.lastContentHtml=s,e.instance.setContent({".popover-body":s}))})}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}};r(_o,"template","nodexui.PopoverContent"),r(_o,"props",{...u,content:i(String)});_();R();var Po=class extends c{setup(){this.state=$({open:!1}),G({hoverCard:this.state})}open(){this.state.open=!0}close(){this.state.open=!1}onKeyDown(e){e.key==="Escape"&&this.close()}};r(Po,"template","nodexui.HoverCard"),r(Po,"props",{...u});var Uo=class extends c{};r(Uo,"template","nodexui.HoverCardTrigger"),r(Uo,"props",u);var qo=class extends c{get open(){return this.env.hoverCard.open}};r(qo,"template","nodexui.HoverCardContent"),r(qo,"props",u);_();R();var dn={...u,disabled:i(Boolean),inset:i(Boolean),onClick:i(Function),onSelect:i(Function),variant:i(String)},ye=class extends c{setup(){this.rootRef=q("root");let e=$({open:dt(this.props.state)});this.control={instance:null};let s=a=>{e.open!==a&&(e.open=a,this.props.onOpenChange?.(a))};G({dropdownMenu:e,dropdownControl:this.control,dropdownSetOpen:s,dropdownToggle:()=>this.control.instance?.toggle(),dropdownClose:()=>this.control.instance?.hide()});let o=a=>{this.rootRef.el&&!this.rootRef.el.contains(a.target)&&this.control.instance?.hide()},n=a=>{a.key==="Escape"&&this.control.instance?.hide()};At(a=>{if(a)return document.addEventListener("click",o),document.addEventListener("keydown",n),()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",n)}},()=>[e.open]),st(()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",n)})}};r(ye,"template","nodexui.DropdownMenu"),r(ye,"props",{state:i(String),onOpenChange:i(Function),...u});var Dt=class extends c{setup(){this.rootRef={el:null},this.onShown=()=>this.env.dropdownSetOpen(!0),this.onHidden=()=>this.env.dropdownSetOpen(!1),this.getRef=e=>{e?(this.rootRef.el=e,this.env.dropdownControl.instance=W().Dropdown.getOrCreateInstance(e),e.addEventListener("shown.bs.dropdown",this.onShown),e.addEventListener("hidden.bs.dropdown",this.onHidden)):this.rootRef.el&&(this.rootRef.el.removeEventListener("shown.bs.dropdown",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.dropdown",this.onHidden),this.env.dropdownControl.instance?.dispose(),this.env.dropdownControl.instance=null,this.rootRef.el=null)}}get classNames(){return f("btn","b-button","btn-outline-secondary","b-dropdown-menu-trigger",this.props.className)}get attrs(){return{"data-slot":"dropdown-menu-trigger","aria-haspopup":"menu","aria-expanded":this.env.dropdownMenu.open?"true":"false"}}onClick(){this.env.dropdownToggle()}};r(Dt,"template","nodexui.DropdownMenuTrigger"),r(Dt,"components",{Button:P}),r(Dt,"props",u);var we=class extends c{get open(){return this.env.dropdownMenu.open}get classNames(){return f("b-dropdown-menu-content","dropdown-menu",this.open?"show":"",this.props.className)}};r(we,"template","nodexui.DropdownMenuContent"),r(we,"props",{...u,align:i(String),alignOffset:i(Number),side:i(String),sideOffset:i(Number)});var Do=class extends c{};r(Do,"template","nodexui.DropdownMenuGroup"),r(Do,"props",u);var jo=class extends c{};r(jo,"template","nodexui.DropdownMenuLabel"),r(jo,"props",{...u,inset:i(Boolean)});var Ae=class extends c{get variant(){return this.props.variant||"default"}onClick(e){this.props.disabled||(this.props.onClick?.(e),this.props.onSelect?.(e),this.env.dropdownClose())}};r(Ae,"template","nodexui.DropdownMenuItem"),r(Ae,"props",dn);var rs=class extends c{onClick(e){this.props.disabled||(this.props.onCheckedChange?.(!this.props.checked,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};r(rs,"template","nodexui.DropdownMenuCheckboxItem"),r(rs,"components",{Icon:tt}),r(rs,"props",{...dn,checked:i(Boolean),onCheckedChange:i(Function)});var zo=class extends c{setup(){G({dropdownRadio:{value:this.props.value,onValueChange:this.props.onValueChange}})}};r(zo,"template","nodexui.DropdownMenuRadioGroup"),r(zo,"props",{...u,value:i(String),onValueChange:i(Function)});var is=class extends c{get checked(){return this.env.dropdownRadio?.value===this.props.value}onClick(e){this.props.disabled||(this.env.dropdownRadio?.onValueChange?.(this.props.value,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};r(is,"template","nodexui.DropdownMenuRadioItem"),r(is,"components",{Icon:tt}),r(is,"props",{...dn,value:i(String)});var Fo=class extends c{};r(Fo,"template","nodexui.DropdownMenuSeparator"),r(Fo,"props",u);var Ho=class extends c{};r(Ho,"template","nodexui.DropdownMenuShortcut"),r(Ho,"props",u);var Se=class extends c{setup(){this.rootRef=q("root");let{state:e,setOpen:s,toggle:o}=lo(this.rootRef);G({dropdownSub:e,dropdownSubToggle:o,dropdownSubOpen:()=>s(!0),dropdownSubClose:()=>s(!1)})}};r(Se,"template","nodexui.DropdownMenuSub"),r(Se,"props",u);var jt=class extends c{onMouseEnter(){this.props.disabled||this.env.dropdownSubOpen()}onClick(){this.props.disabled||this.env.dropdownSubToggle()}};r(jt,"template","nodexui.DropdownMenuSubTrigger"),r(jt,"components",{Icon:tt}),r(jt,"props",{...u,disabled:i(Boolean),inset:i(Boolean)});var Ee=class extends c{get open(){return this.env.dropdownSub.open}};r(Ee,"template","nodexui.DropdownMenuSubContent"),r(Ee,"props",u);_();R();var Wo=class extends c{setup(){this.state=$({open:!1,x:0,y:0});let e=()=>{this.state.open=!1};this.close=e,G({contextMenu:this.state,contextMenuOpenAt:(s,o)=>{this.state.open=!0,this.state.x=s,this.state.y=o},contextMenuClose:e}),document.addEventListener("click",e),st(()=>document.removeEventListener("click",e))}};r(Wo,"template","nodexui.ContextMenu"),r(Wo,"props",{className:i(String),slots:i(Object)});var Ko=class extends c{onContextMenu(e){e.preventDefault(),this.env.contextMenuOpenAt(e.clientX,e.clientY)}};r(Ko,"template","nodexui.ContextMenuTrigger"),r(Ko,"props",u);var Vo=class extends c{setup(){this.rootRef=q("root")}get open(){return this.env.contextMenu.open}get style(){return bt(`left:${this.env.contextMenu.x}px;top:${this.env.contextMenu.y}px`,this.props.style)}};r(Vo,"template","nodexui.ContextMenuContent"),r(Vo,"props",u);var Go=class extends c{onClick(){this.props.onClick?.(),this.env.contextMenuClose()}};r(Go,"template","nodexui.ContextMenuItem"),r(Go,"props",{...u,onClick:i(Function)});_();R();var Ml={"top-left":["top-0","start-0"],"top-right":["top-0","end-0"],"bottom-left":["bottom-0","start-0"],"bottom-right":["bottom-0","end-0"]};function Di(t){let e=Ml[t];return e?["toast-container","position-fixed","p-3","pe-auto",...e]:null}var zt=class extends c{setup(){this.state=$({open:lt(this.props)}),this.rootRef=q("root"),this.bootstrapToast=null,this.handleShown=()=>{this.state.open=!0},this.handleHidden=()=>{this.state.open=!1,this.props.onOpenChange?.(!1)},Q(()=>{this.mountBootstrapToast(this.props.delay),this.state.open&&this.bootstrapToast.show()}),ht(e=>{let s=je(e)?lt(e):this.state.open;e.delay!==this.props.delay?(this.bootstrapToast?.dispose(),this.mountBootstrapToast(e.delay),s&&this.bootstrapToast.show()):s!==this.state.open&&(s?this.bootstrapToast?.show():this.bootstrapToast?.hide())}),st(()=>{this.bootstrapToast?.dispose()})}mountBootstrapToast(e){let s=this.rootRef.el,o=e??3e3;this.bootstrapToast=new(W()).Toast(s,{autohide:o>0,delay:o||3e3}),s.addEventListener("shown.bs.toast",this.handleShown),s.addEventListener("hidden.bs.toast",this.handleHidden)}get classNames(){return f("toast","fade","b-toast",Di(this.props.position),this.props.className)}get role(){return this.props.variant==="danger"?"alert":"status"}get hasActionSlot(){return!!this.props.slots?.action}close(){this.bootstrapToast?.hide()}};r(zt,"template","nodexui.Toast"),r(zt,"components",{Button:P}),r(zt,"props",{open:i(Boolean),state:i(String),variant:i(String),delay:i(Number),position:i(String),...u,onOpenChange:i(Function)});_();R();var Zo=class extends c{setup(){this.state=$({open:new Set}),G({accordion:this.state,accordionToggle:e=>this.toggle(e)})}toggle(e){let s=!this.state.open.has(e);this.props.multiple||this.state.open.clear(),s?this.state.open.add(e):this.state.open.delete(e),this.props.onChange?.(s)}};r(Zo,"template","nodexui.Accordion"),r(Zo,"props",{multiple:i(Boolean),onChange:i(Function),...u});var Jo=class extends c{setup(){G({accordionItemState:this.props.state,accordionItemValue:this.props.value})}};r(Jo,"template","nodexui.AccordionItem"),r(Jo,"props",{value:{type:String},state:i(String),...u});var ns=class extends c{get open(){return this.env.accordionItemState!==void 0?dt(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}get triggerAttrs(){return{"data-slot":"accordion-trigger","aria-expanded":this.open?"true":"false"}}onClick(){this.env.accordionToggle(this.env.accordionItemValue)}};r(ns,"template","nodexui.AccordionTrigger"),r(ns,"components",{Icon:tt,Button:P}),r(ns,"props",u);var Yo=class extends c{setup(){this.rootRef=q("root"),this.initialOpen=this.open,Ui(this.rootRef,()=>this.open)}get open(){return this.env.accordionItemState!==void 0?dt(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}};r(Yo,"template","nodexui.AccordionContent"),r(Yo,"props",u);_();R();var Xo=class extends c{setup(){this.state=$({open:lt(this.props)}),G({collapsible:this.state,collapsibleToggle:()=>this.toggle()}),yt(this.state)}toggle(){let e=!this.state.open;wt(this.props,this.state,e)}};r(Xo,"template","nodexui.Collapsible"),r(Xo,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),...u});var as=class extends c{get attrs(){return{"aria-expanded":this.env.collapsible.open?"true":"false"}}onClick(){this.env.collapsibleToggle()}};r(as,"template","nodexui.CollapsibleTrigger"),r(as,"components",{Button:P}),r(as,"props",u);var Qo=class extends c{setup(){this.rootRef=q("root"),this.initialOpen=this.open,Ui(this.rootRef,()=>this.open)}get open(){return this.env.collapsible.open}};r(Qo,"template","nodexui.CollapsibleContent"),r(Qo,"props",u);_();R();var Ce=class extends c{};r(Ce,"template","nodexui.Breadcrumb"),r(Ce,"props",{...u});var ke=class extends c{};r(ke,"template","nodexui.BreadcrumbList"),r(ke,"props",{...u});var Le=class extends c{get classNames(){return f("b-breadcrumb-item",this.props.current&&"b-breadcrumb-page",this.props.className)}};r(Le,"template","nodexui.BreadcrumbItem"),r(Le,"props",{current:i(Boolean),...u});var Ne=class extends c{get classNames(){return f("b-breadcrumb-link",this.props.className)}onClick(e){this.props.onClick?.(e)}};r(Ne,"template","nodexui.BreadcrumbLink"),r(Ne,"props",{href:i(String),target:i(String),rel:i(String),...u,onClick:i(Function)});var Oe=class extends c{get classNames(){return f("b-breadcrumb-page",this.props.className)}};r(Oe,"template","nodexui.BreadcrumbPage"),r(Oe,"props",{...u});var Ft=class extends c{get classNames(){return f("b-breadcrumb-separator",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};r(Ft,"template","nodexui.BreadcrumbSeparator"),r(Ft,"components",{Icon:tt}),r(Ft,"props",{...u});var cs=class extends c{get classNames(){return f("b-breadcrumb-ellipsis",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};r(cs,"template","nodexui.BreadcrumbEllipsis"),r(cs,"components",{Icon:tt}),r(cs,"props",{...u});_();R();var tr=class extends c{get classNames(){return f("b-pagination",this.props.className)}};r(tr,"template","nodexui.Pagination"),r(tr,"props",{...u});var er=class extends c{get classNames(){return f("page-item",this.props.current&&"active",this.props.disabled&&"disabled")}onClick(){this.props.disabled||this.props.onClick?.()}};r(er,"template","nodexui.PaginationItem"),r(er,"props",{current:i(Boolean),disabled:i(Boolean),style:i([String,Object]),onClick:i(Function),slots:i(Object)});_();R();var sr=class extends c{setup(){this.rootRef=q("root")}onKeyDown(e){let s=[...this.rootRef.el.querySelectorAll("a, button")].filter(a=>!a.disabled),o=s.indexOf(e.target),n=e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;!n||o<0||(e.preventDefault(),s[(o+n+s.length)%s.length]?.focus())}};r(sr,"template","nodexui.NavigationMenu"),r(sr,"props",{...u});var or=class extends c{};r(or,"template","nodexui.NavigationMenuItem"),r(or,"props",{href:i(String),...u});_();R();var rr=class extends c{get classNames(){return f("b-menubar",this.props.className)}};r(rr,"template","nodexui.Menubar"),r(rr,"props",{...u});_();R();var ra={...u,href:i(String)};function ia(t){globalThis.matchMedia?.("(max-width: 991.98px)").matches&&t.setSidebarOpen?.(!1)}var Wt=class extends c{setup(){this.state=$({open:lt(this.props)}),G({sidebar:this.state,setSidebarOpen:e=>this.setOpen(e)}),yt(this.state)}setOpen(e){wt(this.props,this.state,e)}get sidebarState(){return this.state.open?"expanded":"collapsed"}get side(){return this.props.side||"left"}get variant(){return this.props.variant||"sidebar"}get collapsible(){return this.props.collapsible||"offcanvas"}get classNames(){return f("b-sidebar-root",this.props.className)}onKeyDown(e){e.key==="Escape"&&this.setOpen(!1)}};r(Wt,"template","nodexui.Sidebar"),r(Wt,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),side:i(String),variant:i(String),collapsible:i(String),...u});var yi=class extends Wt{};r(yi,"template","nodexui.Sidebar");var ls=class extends c{onClick(){if(this.env.setShellCollapsed&&!globalThis.matchMedia?.("(max-width: 991.98px)").matches){this.env.setShellCollapsed(!this.env.shell.collapsed);return}this.env.setSidebarOpen(!this.env.sidebar.open)}};r(ls,"template","nodexui.SidebarTrigger"),r(ls,"components",{Icon:tt,Button:P}),r(ls,"props",{...u,icon:i(String),label:i(String)});var Te=class extends c{get open(){return this.env.sidebar.open}};r(Te,"template","nodexui.SidebarContent"),r(Te,"props",u);var ir=class extends c{};r(ir,"template","nodexui.SidebarHeader"),r(ir,"props",u);var nr=class extends c{};r(nr,"template","nodexui.SidebarFooter"),r(nr,"props",u);var ar=class extends c{};r(ar,"template","nodexui.SidebarInset"),r(ar,"props",u);var us=class extends c{onClick(){this.env.setSidebarOpen(!this.env.sidebar.open)}};r(us,"template","nodexui.SidebarRail"),r(us,"components",{Button:P}),r(us,"props",u);var cr=class extends c{};r(cr,"template","nodexui.SidebarInput"),r(cr,"props",{className:i(String),style:i([String,Object]),placeholder:i(String),value:i(String),type:i(String)});var lr=class extends c{};r(lr,"template","nodexui.SidebarSeparator"),r(lr,"props",u);var ps=class extends c{onClick(){this.env.setSidebarOpen(!1)}};r(ps,"template","nodexui.SidebarClose"),r(ps,"components",{Icon:tt,Button:P}),r(ps,"props",{...u,icon:i(String),label:i(String)});var Ie=class extends c{};r(Ie,"template","nodexui.SidebarGroup"),r(Ie,"props",{muted:i(Boolean),...u});var Be=class extends c{};r(Be,"template","nodexui.SidebarGroupLabel"),r(Be,"props",ra);var ds=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r(ds,"template","nodexui.SidebarGroupAction"),r(ds,"components",{Button:P}),r(ds,"props",{icon:i(String),"aria-label":i(String),ariaLabel:i(String),onClick:i(Function),...u});var ur=class extends c{};r(ur,"template","nodexui.SidebarGroupContent"),r(ur,"props",u);var hs=class extends c{setup(){let e=this.props["default-open"]!==void 0||this.props.defaultOpen!==void 0;this.state=$({open:je(this.props)||e?lt(this.props):!0}),yt(this.state)}get open(){return this.state.open}toggle(){let e=!this.state.open;wt(this.props,this.state,e)}};r(hs,"template","nodexui.SidebarGroupCollapsible"),r(hs,"components",{Icon:tt,Button:P}),r(hs,"props",{label:{type:String},open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),...u});var Kt=class extends c{};r(Kt,"template","nodexui.SidebarMenu"),r(Kt,"props",u);var Re=class extends c{};r(Re,"template","nodexui.SidebarMenuItem"),r(Re,"props",u);var Ht=class extends c{get classNames(){return f("b-sidebar-menu-button",this.isActive&&"is-active",this.props.variant&&`is-${this.props.variant}`,this.props.size&&`is-${this.props.size}`,this.props.className)}get isActive(){return this.props.active||this.props.isActive}onClick(e){this.props.onClick?.(e),ia(this.env)}};r(Ht,"template","nodexui.SidebarMenuButton"),r(Ht,"components",{Icon:tt,Button:P}),r(Ht,"props",{href:i(String),icon:i(String),active:i(Boolean),isActive:i(Boolean),variant:i(String),size:i(String),tooltip:i(String),disabled:i(Boolean),onClick:i(Function),...u});var bs=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r(bs,"template","nodexui.SidebarMenuAction"),r(bs,"components",{Button:P}),r(bs,"props",{icon:i(String),"aria-label":i(String),ariaLabel:i(String),showOnHover:i(Boolean),onClick:i(Function),...u});var pr=class extends c{};r(pr,"template","nodexui.SidebarMenuSub"),r(pr,"props",u);var dr=class extends c{};r(dr,"template","nodexui.SidebarMenuBadge"),r(dr,"props",u);var hr=class extends c{setup(){this.state=$({width:this.props.width||`${Math.floor(Math.random()*40)+50}%`})}get style(){return bt(`--b-sidebar-skeleton-width:${this.state.width}`,this.props.style)}};r(hr,"template","nodexui.SidebarMenuSkeleton"),r(hr,"props",{showIcon:i(Boolean),width:i(String),className:i(String),style:i([String,Object])});var br=class extends c{};r(br,"template","nodexui.SidebarMenuSubItem"),r(br,"props",u);var ms=class extends c{get classNames(){return f("b-sidebar-menu-sub-button",(this.props.active||this.props.isActive)&&"is-active",this.props.size&&`is-${this.props.size}`,this.props.className)}onClick(e){this.props.onClick?.(e),ia(this.env)}};r(ms,"template","nodexui.SidebarMenuSubButton"),r(ms,"components",{Button:P}),r(ms,"props",{...ra,active:i(Boolean),isActive:i(Boolean),size:i(String),onClick:i(Function)});_();R();var fs=class extends c{setup(){this.state=$({collapsed:this.props.collapsed??this.props.defaultCollapsed??!1,authState:this.props.authState??null}),G({shell:this.state,setShellCollapsed:e=>this.setCollapsed(e)}),ht(e=>{e.collapsed!==void 0&&(this.state.collapsed=e.collapsed),this.state.authState=e.authState??null})}setCollapsed(e){this.props.collapsed===void 0&&(this.state.collapsed=e),this.props.onCollapsedChange?.(e)}dismissToast(){this.props.onToastOpenChange?.(!1)}runToastAction(){this.props.toast?.onAction?.()}};r(fs,"template","nodexui.Shell"),r(fs,"components",{Sidebar:Wt,Toast:zt,Button:P}),r(fs,"props",{open:i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),collapsed:i(Boolean),defaultCollapsed:i(Boolean),onCollapsedChange:i(Function),authState:i(Object),toast:i(Object),onToastOpenChange:i(Function),notificationPage:i(Function),pwa:i(Function),...u});var gs=class extends c{};r(gs,"template","nodexui.ShellSidebar"),r(gs,"components",{SidebarContent:Te}),r(gs,"props",u);var mr=class extends c{};r(mr,"template","nodexui.ShellSidebarHeader"),r(mr,"props",u);var fr=class extends c{};r(fr,"template","nodexui.ShellNav"),r(fr,"props",u);var gr=class extends c{};r(gr,"template","nodexui.ShellMain"),r(gr,"props",u);var vr=class extends c{};r(vr,"template","nodexui.ShellHeader"),r(vr,"props",u);var vs=class extends c{};r(vs,"template","nodexui.ShellContent"),r(vs,"components",{Skeleton:fe}),r(vs,"props",{loading:i(Boolean),...u});var xs=class extends c{get authState(){return this.env.shell.authState}logout(){this.authState?.onLogout?.()}};r(xs,"template","nodexui.ShellUserMenu"),r(xs,"components",{Button:P}),r(xs,"props",u);_();R();var xr=class extends c{get classNames(){return f("table","b-table",this.props.striped!==!1&&"table-striped",this.props.hover!==!1&&"table-hover",this.props.className)}};r(xr,"template","nodexui.Table"),r(xr,"props",{striped:i(Boolean),hover:i(Boolean),responsive:i(Boolean),...u});_();R();var $l=[{key:"status",label:"Status",format:"capitalize"},{key:"email",label:"Email",sortable:!0,filterable:!0},{key:"amount",label:"Amount",align:"right",format:"currency"}],_l=[{id:"728ed52f",status:"success",email:"ken99@example.com",amount:316},{id:"489e1d42",status:"success",email:"abe45@example.com",amount:242},{id:"6b0888f6",status:"processing",email:"monserrat44@example.com",amount:837},{id:"a1dc8c4e",status:"success",email:"silas22@example.com",amount:874},{id:"15b96de0",status:"failed",email:"carmella@example.com",amount:721}],Pl=[{label:"Copy payment ID"},{label:"View customer"},{label:"View payment details"}],ys=4,ws=8,Ul=32,As=class extends c{setup(){this.state=$({query:"",sortKey:null,sortDir:1,page:0,pageSize:this.initialPageSize,selectedKeys:[],hiddenColumns:this.columns.filter(e=>e.hidden||e.visible===!1).map(e=>e.key),columnsOpen:!1,actionRowKey:null,actionMenuStyle:null}),this.actionsMenuRef=q("actionsMenu"),this.actionsMenuTriggerEl=null,js(window,"click",this.onWindowClick,!0),js(window,"keydown",this.onWindowKeydown),js(window,"resize",this.closeRowActions),js(window,"scroll",this.closeRowActions,!0),at(()=>this.refreshActionsMenuPosition())}get columns(){return this.props.columns?.length?this.props.columns:$l}get rows(){return this.props.rows?.length?this.props.rows:_l}get usesDefaultRows(){return!this.props.rows?.length}get initialPageSize(){return this.props["page-size"]??this.props.pageSize??10}get pageSizeOptions(){return this.props["page-size-options"]??this.props.pageSizeOptions??[10,20,50,80]}get rowActions(){return this.props["row-actions"]??this.props.rowActions??(this.usesDefaultRows?Pl:[])}get variant(){return this.props.variant||"default"}get classNames(){return f("b-data-table",`b-data-table-${this.variant}`,this.props.className)}get viewportStyle(){let e=this.props["max-height"]??this.props.maxHeight;return e?`max-height: ${typeof e=="number"?`${e}px`:e};`:""}get hasSearch(){return this.props.searchable!==!1}get hasSorting(){return this.props.sortable!==!1}get hasPagination(){return this.props.pagination!==!1}get hasColumnToggle(){return this.props["column-toggle"]??this.props.columnToggle??!0}get hasToolbarActions(){return!!this.props.slots?.toolbarActions}get hasSelection(){return this.props.selectable??this.usesDefaultRows}get visibleColumns(){return this.columns.filter(e=>!this.state.hiddenColumns.includes(e.key))}get visibleRows(){let e=this.state.query.toLowerCase(),s=this.columns.filter(a=>a.filterable===!0),o=(s.length?s:this.columns).map(a=>a.key),n=this.rows.filter(a=>!e||o.some(l=>String(a[l]).toLowerCase().includes(e)));return this.state.sortKey&&(n=[...n].sort((a,l)=>String(a[this.state.sortKey]).localeCompare(String(l[this.state.sortKey]))*this.state.sortDir)),n}get pageCount(){return Math.max(1,Math.ceil(this.visibleRows.length/this.state.pageSize))}get pageRows(){if(!this.hasPagination)return this.visibleRows;let s=Math.min(this.state.page,this.pageCount-1)*this.state.pageSize;return this.visibleRows.slice(s,s+this.state.pageSize)}get selectedCount(){return this.state.selectedKeys.length}get selectionLabel(){return`${this.selectedCount} of ${this.visibleRows.length} row(s) selected.`}get emptyLabel(){return this.props["empty-label"]??this.props.emptyLabel??"No results."}get filterPlaceholder(){return this.props["filter-placeholder"]??this.props.filterPlaceholder??"Filter emails..."}get canPreviousPage(){return this.hasPagination&&this.state.page>0}get canNextPage(){return this.hasPagination&&this.state.page<this.pageCount-1}get pageLabel(){return`Page ${Math.min(this.state.page,this.pageCount-1)+1} of ${this.pageCount}`}rowKey(e,s){return e.id??e.key??s}isSelected(e,s){return this.state.selectedKeys.includes(this.rowKey(e,s))}isColumnSortable(e){return this.hasSorting&&e.sortable===!0}onSearchInput(e){this.state.query=e.target.value,this.state.page=0}sortBy(e){let s=this.columns.find(o=>o.key===e);!s||!this.isColumnSortable(s)||(this.state.sortKey===e?this.state.sortDir=-this.state.sortDir:(this.state.sortKey=e,this.state.sortDir=1))}sortIcon(e){return this.state.sortKey!==e?"arrow-up-down":this.state.sortDir===1?"arrow-up":"arrow-down"}toggleColumn(e){this.state.hiddenColumns.includes(e)?this.state.hiddenColumns=this.state.hiddenColumns.filter(s=>s!==e):this.state.hiddenColumns=[...this.state.hiddenColumns,e]}toggleColumnsMenu(){this.state.columnsOpen=!this.state.columnsOpen}toggleRowActions(e,s,o){let n=this.rowKey(e,s);if(this.state.actionRowKey===n){this.closeRowActions();return}this.actionsMenuTriggerEl=o.currentTarget,this.state.actionRowKey=n,this.state.actionMenuStyle=this.estimateActionMenuStyle(o.currentTarget)}closeRowActions(){this.state.actionRowKey!==null&&(this.state.actionRowKey=null,this.state.actionMenuStyle=null,this.actionsMenuTriggerEl=null)}get openRowAction(){if(this.state.actionRowKey===null)return null;let e=this.pageRows.findIndex((s,o)=>this.rowKey(s,o)===this.state.actionRowKey);return e===-1?null:{row:this.pageRows[e],index:e}}estimateActionMenuStyle(e){let s=e.getBoundingClientRect(),o=this.rowActions.length*Ul+ys*2,n=window.innerHeight-s.bottom,l=n<o+ys&&s.top>n?Math.max(ws,s.top-ys-o):s.bottom+ys,p=Math.min(Math.max(ws,s.right-160),window.innerWidth-160-ws);return`position: fixed; top: ${Math.round(l)}px; left: ${Math.round(p)}px;`}refreshActionsMenuPosition(){if(this.state.actionRowKey===null||!this.actionsMenuTriggerEl)return;let e=this.actionsMenuRef.el;if(!e)return;let s=this.actionsMenuTriggerEl.getBoundingClientRect(),o=e.getBoundingClientRect(),n=window.innerHeight-s.bottom,a=s.top,p=n<o.height+ys&&a>n?Math.max(ws,s.top-ys-o.height):Math.min(s.bottom+ys,window.innerHeight-o.height-ws),b=Math.min(Math.max(ws,s.right-o.width),window.innerWidth-o.width-ws),v=`position: fixed; top: ${Math.round(p)}px; left: ${Math.round(b)}px;`;this.state.actionMenuStyle!==v&&(this.state.actionMenuStyle=v)}onWindowClick(e){this.state.actionRowKey===null||this.actionsMenuRef.el?.contains(e.target)||this.actionsMenuTriggerEl?.contains(e.target)||this.closeRowActions()}onWindowKeydown(e){e.key==="Escape"&&this.closeRowActions()}setPage(e){this.state.page=Math.max(0,Math.min(e,this.pageCount-1))}setPageSize(e){this.state.pageSize=Number(e),this.state.page=0}optionValue(e){return`${e}`}toggleRow(e,s,o){let n=this.rowKey(e,s);this.state.selectedKeys=o?[...new Set([...this.state.selectedKeys,n])]:this.state.selectedKeys.filter(a=>a!==n),this.props.onSelectionChange?.(this.state.selectedKeys)}toggleAllVisible(e){let s=this.pageRows.map((o,n)=>this.rowKey(o,n));this.state.selectedKeys=e?[...new Set([...this.state.selectedKeys,...s])]:this.state.selectedKeys.filter(o=>!s.includes(o)),this.props.onSelectionChange?.(this.state.selectedKeys)}onAction(e,s,o){e.onSelect?.(s,o),this.props.onRowAction?.(e,s,o),this.closeRowActions()}columnLabel(e){return e.label??e.key}cellValue(e,s){let o=e[s.key];if(s.format==="currency"){let n=Number(o);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(Number.isFinite(n)?n:0)}if(s.format==="capitalize"){let n=String(o??"");return n.charAt(0).toUpperCase()+n.slice(1)}return o??""}cellComponentProps(e,s){return s.componentProps?s.componentProps(e,s):{row:e,column:s,value:e[s.key]}}};r(As,"template","nodexui.DataTable"),r(As,"components",{Button:P,Icon:tt}),r(As,"props",{columns:i(Array),rows:i(Array),variant:i(String),searchable:i(Boolean),sortable:i(Boolean),pagination:i(Boolean),selectable:i(Boolean),"column-toggle":i(Boolean),columnToggle:i(Boolean),"row-actions":i(Array),rowActions:i(Array),"page-size":i(Number),pageSize:i(Number),"page-size-options":i(Array),pageSizeOptions:i(Array),"filter-placeholder":i(String),filterPlaceholder:i(String),"empty-label":i(String),emptyLabel:i(String),onRowAction:i(Function),onSelectionChange:i(Function),...u,"max-height":i([String,Number]),maxHeight:i([String,Number])});_();R();var ql=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}),Dl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ss=class extends c{get baseDate(){return this.props.selected?new Date(`${this.props.selected}T00:00:00`):new Date}get month0(){return(this.props.month??this.baseDate.getMonth()+1)-1}get year(){return this.props.year??this.baseDate.getFullYear()}get headerLabel(){return ql.format(new Date(this.year,this.month0,1))}get weekdays(){return Dl}get days(){let e=new Date(this.year,this.month0+1,0).getDate(),s=new Date(this.year,this.month0,1).getDay(),o=[];for(let n=0;n<s;n++)o.push(null);for(let n=1;n<=e;n++){let a=`${this.year}-${String(this.month0+1).padStart(2,"0")}-${String(n).padStart(2,"0")}`;o.push({day:n,value:a,selected:a===this.props.selected})}return o}onSelect(e){this.props.onChange?.(e)}};r(Ss,"template","nodexui.Calendar"),r(Ss,"components",{Button:P}),r(Ss,"props",{selected:i(String),month:i(Number),year:i(Number),className:i(String),style:i([String,Object]),onChange:i(Function)});R();var yr=class extends xt{get classNames(){return f("b-date-picker","form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onChange?.(e.target.value,e)}};r(yr,"template","nodexui.DatePicker"),r(yr,"props",{...kt,value:i(String),className:i(String),style:i([String,Object]),onChange:i(Function)});_();R();var wr=class extends xt{setup(){super.setup(),this.rootRef=q("root");let{state:e}=lo(this.rootRef);this.disclosure=e,this.state=$({query:this.selectedLabel})}get classNames(){return f("form-control",this.controlClass,this.isInvalid&&"is-invalid")}get selectedLabel(){return this.props.options.find(e=>e.value===this.props.value)?.label||""}get filteredOptions(){let e=this.state.query.toLowerCase();return this.props.options.filter(s=>s.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value,this.disclosure.open=!0}onFocus(){this.disclosure.open=!0}choose(e){this.state.query=e.label,this.disclosure.open=!1,this.props.onChange?.(e.value)}};r(wr,"template","nodexui.Combobox"),r(wr,"props",{options:{type:Array},...kt,value:i(String),className:i(String),style:i([String,Object]),id:i(String),onChange:i(Function)});_();R();var Ar=class extends c{setup(){this.state=$({query:""})}get filteredItems(){let e=this.state.query.toLowerCase();return this.props.items.filter(s=>s.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value}select(e){this.props.onSelect?.(e.value)}};r(Ar,"template","nodexui.Command"),r(Ar,"props",{items:{type:Array},placeholder:i(String),className:i(String),style:i([String,Object]),onSelect:i(Function)});_();R();var Sr=class extends c{get classNames(){return f("b-chart",this.props.type&&`b-chart-${this.props.type}`,this.props.variant&&`b-chart-${this.props.variant}`,this.props.className)}};r(Sr,"template","nodexui.Chart"),r(Sr,"props",{config:i([String,Object]),label:i(String),type:i(String),value:i([String,Number]),variant:i(String),...u});_();R();var Er=class extends c{setup(){this.state=$({index:this.props.defaultIndex??0}),this.rootRef=q("root"),this.bootstrapCarousel=null,this.onSlid=e=>{this.state.index=e.to,this.props.onChange?.(this.state.index)},G({carousel:this.state,carouselInstance:()=>this.bootstrapCarousel}),Q(()=>{this.bootstrapCarousel=new(W()).Carousel(this.rootRef.el,{interval:!1,wrap:!0,touch:!0}),this.rootRef.el.addEventListener("slid.bs.carousel",this.onSlid)}),st(()=>{this.rootRef.el.removeEventListener("slid.bs.carousel",this.onSlid),this.bootstrapCarousel?.dispose()})}};r(Er,"template","nodexui.Carousel"),r(Er,"props",{slideCount:{type:Number},defaultIndex:i(Number),onChange:i(Function),...u});var Cr=class extends c{setup(){this.rootRef=q("root"),this.initialActive=this.active,at(()=>{if(!this.rootRef.el)return;let e=this.rootRef.el.classList.contains("active");this.active&&!e?this.rootRef.el.classList.add("active"):!this.active&&e&&this.rootRef.el.classList.remove("active")})}get active(){return this.props.state!==void 0?dt(this.props.state):this.env.carousel.index===this.props.index}};r(Cr,"template","nodexui.CarouselSlide"),r(Cr,"props",{index:{type:Number},state:i(String),...u});var Es=class extends c{onClick(){this.env.carouselInstance()?.prev()}};r(Es,"template","nodexui.CarouselPrevious"),r(Es,"components",{Button:P}),r(Es,"props",u);var Cs=class extends c{onClick(){this.env.carouselInstance()?.next()}};r(Cs,"template","nodexui.CarouselNext"),r(Cs,"components",{Button:P}),r(Cs,"props",u);_();R();var kr=class extends c{setup(){this.panelRef=q("panel"),this.state=$({width:null})}get panelStyle(){return this.state.width?`width:${this.state.width}px`:""}onPointerDown(e){let s=e.clientX,o=this.panelRef.el.getBoundingClientRect().width,n=this.props.min||160,a=this.props.max||720,l=b=>{this.state.width=Math.min(a,Math.max(n,o+b.clientX-s))},p=()=>{document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",p),this.props.onChange?.(this.state.width)};document.addEventListener("pointermove",l),document.addEventListener("pointerup",p)}};r(kr,"template","nodexui.Resizable"),r(kr,"props",{min:i(Number),max:i(Number),onChange:i(Function),...u});_();R();var Lr=class extends c{get classNames(){return f("b-scroll-area",this.props.className)}};r(Lr,"template","nodexui.ScrollArea"),r(Lr,"props",u);_();R();var na={idle:"b-attachment-idle",uploading:"b-attachment-uploading",processing:"b-attachment-processing",error:"b-attachment-error",done:"b-attachment-done"},aa={default:"b-attachment-default",sm:"b-attachment-sm",xs:"b-attachment-xs"},Nr=class extends c{get state(){return na[this.props.state]?this.props.state:"done"}get size(){return aa[this.props.size]?this.props.size:"default"}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return f("b-attachment",na[this.state],aa[this.size],`b-attachment-${this.orientation}`,!this.hasContent&&"b-attachment-picker",this.props.className)}get hasContent(){return!!this.props.slots?.default}onChange(e){this.props.onChange?.([...e.target.files])}};r(Nr,"template","nodexui.Attachment"),r(Nr,"props",{state:i(String),size:i(String),orientation:i(String),multiple:i(Boolean),...u,onChange:i(Function)});var Or=class extends c{get variant(){return this.props.variant==="image"?"image":"icon"}get classNames(){return f("b-attachment-media",`b-attachment-media-${this.variant}`,this.props.className)}};r(Or,"template","nodexui.AttachmentMedia"),r(Or,"props",{variant:i(String),...u});var Tr=class extends c{};r(Tr,"template","nodexui.AttachmentContent"),r(Tr,"props",u);var Ir=class extends c{};r(Ir,"template","nodexui.AttachmentTitle"),r(Ir,"props",u);var Br=class extends c{};r(Br,"template","nodexui.AttachmentDescription"),r(Br,"props",u);var Rr=class extends c{};r(Rr,"template","nodexui.AttachmentActions"),r(Rr,"props",u);var ks=class extends c{get variant(){return this.props.variant||"ghost"}get size(){return this.props.size||"icon-xs"}get className(){return f("b-button-icon","b-attachment-action",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r(ks,"template","nodexui.AttachmentAction"),r(ks,"components",{Button:P}),r(ks,"props",{type:i(String),variant:i(String),size:i(String),disabled:i(Boolean),label:i(String),...u,"aria-label":i(String),ariaLabel:i(String),onClick:i(Function)});var Ls=class extends c{get classNames(){return f("b-attachment-trigger",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};r(Ls,"template","nodexui.AttachmentTrigger"),r(Ls,"components",{Button:P}),r(Ls,"props",{href:i(String),target:i(String),rel:i(String),type:i(String),className:i(String),style:i([String,Object]),"aria-label":i(String),ariaLabel:i(String),onClick:i(Function)});var Mr=class extends c{get classNames(){return f("b-attachment-group",this.props.className)}};r(Mr,"template","nodexui.AttachmentGroup"),r(Mr,"props",{...u});var $r=class extends c{setup(){this.state=$({dragging:!1}),this.fileInput=q("fileInput")}get hasContent(){return!!this.props.slots?.default}get classNames(){return f("b-attachment-dropzone",this.state.dragging&&"b-attachment-dropzone-dragging",this.props.disabled&&"b-attachment-dropzone-disabled",this.props.className)}openPicker(){this.props.disabled||this.fileInput.el?.click()}onInputChange(e){let s=Array.from(e.target.files??[]);e.target.value="",s.length&&this.props.onFilesSelected?.(s)}onDragOver(e){e.preventDefault(),!this.props.disabled&&(this.state.dragging=!0)}onDragLeave(){this.state.dragging=!1}onDrop(e){if(e.preventDefault(),this.state.dragging=!1,this.props.disabled)return;let s=Array.from(e.dataTransfer?.files??[]);s.length&&this.props.onFilesSelected?.(s)}};r($r,"template","nodexui.AttachmentDropzone"),r($r,"props",{multiple:i(Boolean),disabled:i(Boolean),...u,onFilesSelected:i(Function)});_();R();var _r=class extends c{setup(){this.state=$({errored:!1})}get showImage(){return!!this.props.src&&!this.state.errored}onError(){this.state.errored=!0}};r(_r,"template","nodexui.Avatar"),r(_r,"props",{src:i(String),alt:i(String),title:i(String),...u});_();R();var Pr=class extends c{get classNames(){return f("b-message",this.props.className)}get side(){return this.props.side||"incoming"}};r(Pr,"template","nodexui.Message"),r(Pr,"props",{side:i(String),...u});_();R();var Ur=class extends c{setup(){this.rootRef=q("root"),At(()=>{this.props.autoscroll!==!1&&this.rootRef.el&&(this.rootRef.el.scrollTop=this.rootRef.el.scrollHeight)})}};r(Ur,"template","nodexui.MessageScroller"),r(Ur,"props",{autoscroll:i(Boolean),...u});_();R();var qr=class extends c{setup(){this.state=$({index:0}),G({questionnaire:this.state,questionnaireShow:e=>this.show(e)})}show(e){this.state.index=Math.min(this.props.stepCount-1,Math.max(0,e)),this.props.onChange?.(this.state.index)}};r(qr,"template","nodexui.Questionnaire"),r(qr,"props",{stepCount:{type:Number},onChange:i(Function),...u});var Dr=class extends c{get active(){return this.props.state!==void 0?dt(this.props.state):this.env.questionnaire.index===this.props.index}};r(Dr,"template","nodexui.QuestionnaireStep"),r(Dr,"props",{index:{type:Number},state:i(String),...u});var Ns=class extends c{get disabled(){return this.env.questionnaire.index===0}onClick(){this.env.questionnaireShow(this.env.questionnaire.index-1)}};r(Ns,"template","nodexui.QuestionnairePrevious"),r(Ns,"components",{Button:P}),r(Ns,"props",u);var Os=class extends c{onClick(){this.env.questionnaireShow(this.env.questionnaire.index+1)}};r(Os,"template","nodexui.QuestionnaireNext"),r(Os,"components",{Button:P}),r(Os,"props",{...u,stepCount:i(Number)});_();R();var jr=class extends c{get max(){return this.props.max||100}get value(){return Math.min(this.max,Math.max(0,this.props.value||0))}get style(){return bt(`--b-progress-value:${this.value/this.max*100}%`,this.props.style)}get classNames(){return f("progress b-progress",this.props.className)}};r(jr,"template","nodexui.Progress"),r(jr,"props",{value:i(Number),max:i(Number),className:i(String),style:i([String,Object])});_();R();var ji=dc(pa(),1);ji.default.stringToBytes=ji.default.stringToBytesFuncs["UTF-8"];function da(t,{ecc:e="M"}={}){let s=(0,ji.default)(0,e);return s.addData(String(t)),s.make(),{size:s.getModuleCount(),isDark:(o,n)=>s.isDark(o,n)}}var Ts=class extends c{get code(){let{matrix:e}=this.props;if(e)return e;let s=this.props.qrContent;return s?(this.encoded?.text!==s&&(this.encoded={text:s,matrix:da(s)}),this.encoded.matrix):{size:0}}get path(){let{size:e,isDark:s}=this.code,o=[];for(let n=0;n<e;n+=1)for(let a=0;a<e;a+=1)s(n,a)&&o.push(`M${a} ${n}h1v1h-1z`);return o.join("")}get size(){return this.code.size}};r(Ts,"template","nodexui.QRCard"),r(Ts,"components",{Card:ee,CardBody:oe,CardHeader:se,CardTitle:re,CardDescription:ie}),r(Ts,"props",{matrix:i(Object),qrContent:i(String),label:i(String),title:i(String),description:i(String),...u});_();R();var zr=class extends c{get classNames(){return f("b-aspect-ratio",this.props.className)}get style(){let e=this.props.ratio||`${this.props.width||16} / ${this.props.height||9}`;return bt(`--b-aspect-ratio:${e}`,this.props.style)}};r(zr,"template","nodexui.AspectRatio"),r(zr,"props",{ratio:i(String),width:i(Number),height:i(Number),...u});_();R();var Fr=class extends c{get classNames(){return f("b-bubble",this.props.className)}get side(){return this.props.side}};r(Fr,"template","nodexui.Bubble"),r(Fr,"props",{side:i(String),...u});_();R();var Hr=class extends c{get dir(){return this.props.dir==="rtl"?"rtl":"ltr"}};r(Hr,"template","nodexui.Direction"),r(Hr,"props",{dir:i(String),...u});_();R();var Wr=class extends c{get classNames(){return f("b-item",this.props.className)}get variant(){return this.props.variant}};r(Wr,"template","nodexui.Item"),r(Wr,"props",{variant:i(String),...u});_();R();var Kr=class extends c{get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return f("b-button-group",this.orientation==="vertical"?"btn-group-vertical":"btn-group",(this.props.size==="sm"||this.props.size==="lg")&&`btn-group-${this.props.size}`,this.props.className)}get ariaLabel(){return this.props["aria-label"]}get ariaLabelledby(){return this.props["aria-labelledby"]}};r(Kr,"template","nodexui.ButtonGroup"),r(Kr,"props",{orientation:i(String),size:i(String),"aria-label":i(String),"aria-labelledby":i(String),...u});var Vr=class extends c{get orientation(){return this.props.orientation==="horizontal"?"horizontal":"vertical"}get classNames(){return f("b-button-group-separator",`b-button-group-separator-${this.orientation}`,this.props.className)}};r(Vr,"template","nodexui.ButtonGroupSeparator"),r(Vr,"props",{orientation:i(String),className:i(String),style:i([String,Object])});var Gr=class extends c{get classNames(){return f("b-button-group-text",this.props.className)}};r(Gr,"template","nodexui.ButtonGroupText"),r(Gr,"props",{...u});_();R();var Zr=class extends c{get classNames(){return f("b-field-set",this.props.className)}};r(Zr,"template","nodexui.FieldSet"),r(Zr,"props",{...u});var Jr=class extends c{get variant(){return this.props.variant||"legend"}get classNames(){return f("b-field-legend",this.props.className)}};r(Jr,"template","nodexui.FieldLegend"),r(Jr,"props",{variant:i(String),...u});var Me=class extends c{get classNames(){return f("b-field-group",this.props.className)}};r(Me,"template","nodexui.FieldGroup"),r(Me,"props",{...u});var $e=class extends c{setup(){G({fieldProps:()=>this.props})}get orientation(){return this.props.orientation||"vertical"}get classNames(){return f("b-field",`b-field-orientation-${this.orientation}`,this.props.className)}};r($e,"template","nodexui.Field"),r($e,"props",{orientation:i(String),invalid:i(Boolean),label:i(String),labelBackground:i(String),description:i(String),useTip:i(Number),error:i(String),...u});var Yr=class extends c{get classNames(){return f("b-field-content",this.props.className)}};r(Yr,"template","nodexui.FieldContent"),r(Yr,"props",{...u});var _e=class extends c{get classNames(){return f("b-field-label",this.props.className)}};r(_e,"template","nodexui.FieldLabel"),r(_e,"props",{for:i(String),...u});var Xr=class extends c{get classNames(){return f("b-field-title",this.props.className)}};r(Xr,"template","nodexui.FieldTitle"),r(Xr,"props",{...u});var Pe=class extends c{get classNames(){return f("b-field-description",this.props.className)}};r(Pe,"template","nodexui.FieldDescription"),r(Pe,"props",{...u});var Qr=class extends c{get hasContent(){return!!this.props.slots?.default}get classNames(){return f("b-field-separator",this.props.className)}};r(Qr,"template","nodexui.FieldSeparator"),r(Qr,"props",{...u});var Ue=class extends c{get classNames(){return f("b-field-error",this.props.className)}};r(Ue,"template","nodexui.FieldError"),r(Ue,"props",{message:i(String),...u});function ha(t){return`Icon${String(t).split("-").filter(Boolean).map(s=>s[0].toUpperCase()+s.slice(1)).join("")}`}_();R();var ti=class extends c{get classNames(){return f("form-label","b-label","b-label",this.props.className)}get state(){return this.props.state||(this.props.required?"required":void 0)}};r(ti,"template","nodexui.Label"),r(ti,"props",{for:i(String),required:i(Boolean),state:i(String),...u});_();var jl="b-theme",zl="theme",Fl="[b-theme-toggle]",Hl="[b-theme-label]";function hn(t){return t==="dark"?"dark":"light"}function Wl(t){return typeof globalThis.location>"u"?null:new URLSearchParams(globalThis.location.search).get(t)}function Kl(t,e=document.documentElement){let s=hn(t);return globalThis.thebase?.theme?.set?globalThis.thebase.theme.set(s):e&&(e.setAttribute("b-theme",s),e.setAttribute("data-bs-theme",s)),s}function ba(t,e,s){try{t.contentWindow?.NodexUI?.theme.set(e),t.contentDocument?.documentElement.setAttribute("b-theme",e),t.contentDocument?.documentElement.setAttribute("data-bs-theme",e)}catch{let o=new URL(t.getAttribute("src"),globalThis.location.href);o.searchParams.set(s,e),t.setAttribute("src",o.pathname+o.search+o.hash)}}function Vl(t){typeof document>"u"||typeof CustomEvent>"u"||document.dispatchEvent(new CustomEvent("nodexui:theme-change",{detail:{theme:t}}))}function qe(t={}){let e=t.storageKey||jl,s=t.queryKey||zl,o=t.toggleSelector??Fl,n=t.labelSelector??Hl,a=t.root||(typeof document>"u"?null:document.documentElement);function l(){return Wl(s)}function p(){return hn(l()||globalThis.localStorage?.getItem(e)||a?.getAttribute("b-theme")||"light")}function b(K){typeof document>"u"||!o||document.querySelectorAll(o).forEach(Z=>{Z.setAttribute("aria-pressed",K==="dark"?"true":"false");let z=n?Z.querySelector(n):null;z&&(z.textContent=K==="dark"?"Light theme":"Dark theme")})}function v(K){typeof document>"u"||document.querySelectorAll("iframe").forEach(Z=>ba(Z,K,s))}function k(K,Z={}){let z=Kl(K,a);return!Z.skipStorage&&!l()&&globalThis.localStorage?.setItem(e,z),b(z),v(z),Vl(z),z}function O(){return k(a?.getAttribute("b-theme")==="dark"?"light":"dark")}function j(){if(typeof document>"u")return p();let K=p();return k(K,{skipStorage:!!l()}),o&&document.addEventListener("click",Z=>{Z.target.closest?.(o)&&O()}),document.querySelectorAll("iframe").forEach(Z=>{Z.addEventListener("load",()=>ba(Z,a?.getAttribute("b-theme")||K,s))}),K}return{current:p,set:k,toggle:O,syncFrames:v,init:j}}var ma=qe();typeof window<"u"&&(window.NodexUITheme=ma);R();R();Hs();var fa=["btn","b-theme-button",...Object.values(mt),...Object.values(vt)];function ei(t){let e=t==="dark";return{icon:e?"sun":"moon",label:e?"Switch to light theme":"Switch to dark theme",pressed:e?"true":"false"}}function zi({variant:t="outline",size:e,className:s}={}){return f("btn","b-theme-button",mt[t]||mt.outline,vt[e],s)}var Vt=class extends c{setup(){this.theme=qe({storageKey:gt(this.props,"storage-key","storageKey")}),this.state=$({theme:this.theme.current()}),this.onThemeChange=e=>{this.state.theme=e.detail?.theme||this.theme.current()},Q(()=>{this.state.theme=this.theme.set(this.theme.current(),{skipStorage:!0}),document.addEventListener("nodexui:theme-change",this.onThemeChange)}),st(()=>document.removeEventListener("nodexui:theme-change",this.onThemeChange))}get iconName(){return ei(this.state.theme).icon}get baseUrl(){return gt(this.props,"base-url")}get label(){return ei(this.state.theme).label}get pressed(){return ei(this.state.theme).pressed}get classNames(){return zi(this.props)}get attrs(){return{"b-theme-button":""}}onClick(){let e=this.theme.toggle();this.state.theme=e,this.props.onChange?.(e)}};r(Vt,"template","nodexui.ThemeButton"),r(Vt,"components",{Icon:tt,Button:P}),r(Vt,"props",{variant:i(String),size:i(String),"base-url":i(String),"storage-key":i(String),storageKey:i(String),className:i(String),style:i([String,Object]),onChange:i(Function)});_();R();var Is=class extends c{get classNames(){return f("b-toggle","btn",this.props.variant==="outline"?"btn-outline-secondary":"btn-light",this.props.className)}get pressed(){return this.props.state!==void 0?dt(this.props.state):!!this.props.pressed}onClick(){this.props.onChange?.(!this.pressed)}};r(Is,"template","nodexui.Toggle"),r(Is,"components",{Button:P}),r(Is,"props",{pressed:i(Boolean),state:i(String),variant:i(String),...u,onChange:i(Function)});_();R();var si=class extends c{setup(){this.state=$({selected:new Set}),G({toggleGroup:this.state,toggleGroupSelect:e=>this.select(e)})}select(e){this.props.multiple?this.state.selected.has(e)?this.state.selected.delete(e):this.state.selected.add(e):this.state.selected=this.state.selected.has(e)?new Set:new Set([e]);let s=this.props.multiple?[...this.state.selected]:[...this.state.selected][0];this.props.onChange?.(s)}};r(si,"template","nodexui.ToggleGroup"),r(si,"props",{multiple:i(Boolean),onChange:i(Function),...u});var Bs=class extends c{get pressed(){return this.env.toggleGroup.selected.has(this.props.value)}onClick(){this.env.toggleGroupSelect(this.props.value)}};r(Bs,"template","nodexui.ToggleGroupItem"),r(Bs,"components",{Button:P}),r(Bs,"props",{value:{type:String},...u});_();R();_();R();Wi();function Ki(t){let e=String(t??""),s=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e);if(!s)return{data:{},content:e};let o={};for(let n of s[1].split(/\r?\n/)){let a=n.trim();if(!a||a.startsWith("#"))continue;let l=a.indexOf(":");if(l===-1)continue;let p=a.slice(0,l).trim();p&&(o[p]=Tu(a.slice(l+1).trim()))}return{data:o,content:e.slice(s[0].length)}}function Ca(t){return t.length>=2&&(t[0]==='"'&&t.at(-1)==='"'||t[0]==="'"&&t.at(-1)==="'")?t.slice(1,-1):t}function Tu(t){if(t==="")return"";if(t==="true")return!0;if(t==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1).trim();return e?e.split(",").map(s=>Ca(s.trim())):[]}return Ca(t)}var Gt=class extends c{setup(){this.rootRef=q("root"),this.editorRef=q("editor"),this.editorHandle=null,this.state=$({html:"",source:"",status:"loading",error:"",frontmatter:{}}),Ot(()=>this.load(this.props)),ht(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),Q(()=>this.afterRender()),at(()=>this.afterRender()),Fe(()=>{this.destroyEditor(),this.rootRef.el&&oi(this.rootRef.el)})}get classNames(){return f("b-markdown",this.props.className)}get editorLabel(){return this.props.collaborative?"Collaborative Markdown editor":"Markdown editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src}shouldRestartEditor(e){return e.editable!==this.props.editable||e.collaborative!==this.props.collaborative||e.room!==this.props.room||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=e.content??"";if(e.src)try{let o=await fetch(e.src);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);s=await o.text()}catch(o){this.state.status="error",this.state.error=o.message||String(o);return}try{this.state.source=s;let{data:o,content:n}=Ki(s);this.state.frontmatter=o,this.state.html=sn(await wi(n)),this.state.status="ready"}catch(o){this.state.status="error",this.state.error=o.message||String(o)}}get hasFrontmatterMeta(){let e=this.state.frontmatter;return!!(e.tags?.length||e.authors?.length)}enhance(){let e=this.rootRef.el;!e||this.state.status!=="ready"||Ai(e,{mermaid:this.props.mermaid!==!1,nodexUi:this.props.nodexUi!==!1})}afterRender(){this.props.editable?this.mountEditor():this.enhance()}async mountEditor(){let e=this.editorRef.el;if(!(!e||this.editorHandle||this.state.status!=="ready"))try{this.editorHandle=await Si({root:e,value:this.state.source,collaborative:!!this.props.collaborative,room:this.props.room||"b-markdown",password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(s,o,n)=>{this.state.source=s,this.props.onChange?.(s,o,n)}})}catch(s){this.state.status="error",this.state.error=s.message||String(s)}}destroyEditor(){this.editorHandle?.destroy?.(),this.editorHandle=null}};r(Gt,"template","nodexui.Markdown"),r(Gt,"components",{Badge:Ct}),r(Gt,"props",{content:i(String),src:i(String),mermaid:i(Boolean),nodexUi:i(Boolean),editable:i(Boolean),collaborative:i(Boolean),room:i(String),password:i(String),signaling:i(Array),user:i(Object),onChange:i(Function),className:i(String),style:i([String,Object])});var ka={implicit:"Implicit",password:"Resource Owner Password Credentials",application:"Client Credentials",accessCode:"Authorization Code"},Iu=["POST","PUT","PATCH"];function Rs(t){try{return sessionStorage.getItem(t)||""}catch{return""}}function Ei(t,e){try{e?sessionStorage.setItem(t,e):sessionStorage.removeItem(t)}catch{}}function wn(){return!!(Rs("apikey")||Rs("oauthkey"))}function yn(t){return t.example!==void 0?String(t.example):t.default!==void 0?String(t.default):t.enum?.length?String(t.enum[0]):t.type==="integer"||t.type==="number"?t.format==="int64"?"10":"1":t.type==="boolean"?"true":t.required&&t.in==="path"?"string":""}function An(t,e){let s=Rs("apikey"),o=Rs("oauthkey");for(let n of t.security)n.type==="apiKey"&&n.in==="header"?e.header[n.name]=s:n.type==="apiKey"&&n.in==="query"?e.query[n.name]=s:n.type==="basic"?e.header.Authorization=s?`Basic ${s}`:"":(n.type==="oauth2"||n.type==="bearer")&&(e.header.Authorization=o?`Bearer ${o}`:"")}function La(t,e){let s={baseUrl:e,path:{},query:{},header:{},bodyText:"",mimeType:t.consumes?.[0]||"application/json"};return t.parameters.path.forEach(o=>{s.path[o.name]=yn(o)}),t.parameters.query.forEach(o=>{s.query[o.name]=o.required?yn(o):""}),t.parameters.header.forEach(o=>{s.header[o.name]=o.required?yn(o):""}),t.produces?.length&&(s.header.Accept=t.produces.includes("application/json")?"application/json":t.produces[0]),t.parameters.body&&(s.mimeType=t.parameters.body.contentType||s.mimeType,s.bodyText=Sn(t.parameters.body.example)),An(t,s),s}function Sn(t){return typeof t=="string"?t:JSON.stringify(t,null,2)??""}function En(t,e){let s=t.path;for(let[n,a]of Object.entries(e.path))s=s.replace(`{${n}}`,encodeURIComponent(a??""));let o=!!t.parameters.body&&Iu.includes(t.method);return{method:t.method,url:`${e.baseUrl}${s}`,query:Object.entries(e.query).filter(([,n])=>n!==""),headers:Object.entries(e.header).filter(([,n])=>n!==""),bodyText:o?e.bodyText:"",mimeType:e.mimeType}}function Na(t){let e=t.query.length?`${t.url}?${new URLSearchParams(t.query)}`:t.url,s=Object.fromEntries(t.headers);return t.bodyText&&(s["Content-Type"]=s["Content-Type"]||t.mimeType),{url:e,headers:s,headerLines:Object.entries(s).map(([o,n])=>`${o}: ${n}`).join(`
30
- `)}}async function Oa(t,e){let s=performance.now(),o=await fetch(e.url,{method:t.method,headers:e.headers,body:t.bodyText||void 0}),n=Math.round(performance.now()-s),a=await o.text();return{status:o.status,statusText:o.statusText,ms:n,headerLines:[...o.headers.entries()].map(([l,p])=>`${l}: ${p}`).join(`
31
- `),bodyText:Bu(a)}}function Bu(t){try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}}function Ta(t){let e=parseInt(t,10);return t==="default"||Number.isNaN(e)?"default":e<300?"2xx":e<400?"3xx":e<500?"4xx":"5xx"}function Ia(t,e,s){if(!t)return"";try{let o=new URL(e),n=new URL(s.derivedBaseUrl||s.baseUrl||e),a=new URL(t,`${o.href.replace(/\/$/,"")}/`);return a.host===n.host&&(a.protocol=o.protocol,a.username=o.username,a.password=o.password,a.host=o.host),a.href}catch{return String(t)}}function Ba(){return Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("")}function Ra({def:t,clientId:e,scopes:s,state:o,redirectUri:n,baseUrl:a,doc:l}){let p=new URL(Ia(t.authorizationUrl,a,l));return p.searchParams.set("response_type",t.flow==="implicit"?"token":"code"),e&&p.searchParams.set("client_id",e),p.searchParams.set("redirect_uri",n),s.length&&p.searchParams.set("scope",s.join(" ")),p.searchParams.set("state",o),p.toString()}async function Ma(t,e,s,o){if(!t)throw new Error("No tokenUrl defined for this scheme.");let n=new URLSearchParams;for(let[p,b]of Object.entries(e))b&&n.set(p,b);let a=await fetch(Ia(t,s,o),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:n.toString()}),l=await a.json().catch(()=>({}));if(!a.ok||!l.access_token)throw new Error(l.error_description||l.error||`HTTP ${a.status}`);return l.access_token}function $a(t,e,s){let o={client_id:e.clientId,client_secret:e.clientSecret,scope:s.join(" ")};return t==="password"?{grant_type:"password",username:e.username,password:e.password,...o}:{grant_type:"client_credentials",...o}}var _a;function Ru(){return _a??(_a=import("./runtime/lazy/apidoc.logic.js"))}var Mu=["curl","csharp","go","node","ruby","php"],$u="(max-width: 1100px)";function Pa(t){return t==="DELETE"?"DEL":t}function _u(){let t=[...document.scripts].find(e=>/\/nodexui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(e.src));return t?`${t.src.replace(/[?#].*$/,"").replace(/\/[^/]*$/,"")}/apidoc`:""}var Jt=class extends c{get children(){return this.props.groups.filter(e=>e.parent===this.props.group.name)}methodLabel(e){return Pa(e)}};r(Jt,"template","nodexui.ApiDocGroup"),r(Jt,"props",{group:Object,groups:Array,current:String,href:Function,onSelect:Function});Jt.components={ApiDocGroup:Jt,Icon:tt};var Zt=class extends c{setup(){this.rootRef=q("root"),this.mainRef=q("main"),this.doc=null,this.pendingOAuth=new Map,this.watchers=new Set,this.rowsCache=new WeakMap,this.overlayQuery=window.matchMedia($u),this.state=$({status:"loading",error:"",current:"introduction",lang:this.props.language||"curl",sidebarOpen:!this.overlayQuery.matches,systemTheme:"light",themeOverride:"",drafts:{},snippet:"",result:null,respTab:0,respView:{},authOpen:!1,authed:wn(),stored:{apikey:"",oauthkey:""},inputs:{apikey:"",oauthkey:""},oauth:{},oauthStatus:{}}),this.onHashChange=()=>this.setCurrent(this.routeId()),this.onViewportChange=()=>{this.state.sidebarOpen=!this.overlayQuery.matches},this.onDocumentClick=e=>this.closeSidebarOnOutsideClick(e),this.onOAuthMessage=e=>this.handleOAuthMessage(e),this.onThemeChange=()=>this.readSystemTheme(),Ot(()=>this.load(this.props)),ht(e=>this.shouldReload(e)?this.load(e):void 0),Q(()=>this.addListeners()),Fe(()=>this.removeListeners())}get classNames(){return f("b-apidoc",this.props.className)}get rootStyle(){return bt(this.props.height?`--b-apidoc-height:${this.props.height}`:"",this.props.style)}get theme(){return(this.props.theme==="light"||this.props.theme==="dark"?this.props.theme:"")||this.state.themeOverride||this.state.systemTheme}get title(){return this.props.title||this.doc?.info.title||"API Documentation"}get tryItEnabled(){return this.props.tryIt!==!1}get hasSecurity(){return this.props.authorize!==!1&&Object.keys(this.doc?.securityDefinitions||{}).length>0}get languages(){let e=this.logic?.LANGUAGES||[],s=this.props.languages;return s?.length?e.filter(o=>s.includes(o.id)):e}get currentLanguage(){return this.languages.find(e=>e.id===this.state.lang)||this.languages[0]}get op(){return this.state.current==="introduction"?null:this.doc.findOperation(this.state.current)}get draft(){return this.state.drafts[this.state.current]}get showTryIt(){return this.tryItEnabled&&!!this.op}get sidebarGroups(){let e=this.doc.groups.filter(s=>!s.parent);return this.doc.webhooks.length&&e.push({id:"webhooks",name:"Webhooks",items:this.doc.webhooks,kind:""}),e}get breadcrumb(){let e=this.op;if(!e)return[{label:"Home",id:"introduction",home:!0},{label:"Introduction"}];let s=this.doc.groups.find(o=>o.name===e.tag);return[{label:"Home",id:"introduction",home:!0},{label:this.title,id:"introduction"},{label:e.tag,id:s?s.items[0].id:"introduction"},{label:e.summary}]}get authSchemes(){return Object.entries(this.doc.securityDefinitions).map(([e,s])=>({key:e,def:s,scopes:Object.entries(s.scopes||{})}))}get serverOptions(){return this.doc.servers.length?this.doc.servers:[{url:this.doc.baseUrl,name:"",description:""}]}get tryItParams(){let{path:e,query:s,header:o}=this.op.parameters;return[...e.map(n=>({...n,group:"path"})),...s.map(n=>({...n,group:"query"})),...o.map(n=>({...n,group:"header"}))]}get selectedBaseUrl(){return this.draft?.baseUrl||this.doc.baseUrl}methodLabel(e){return Pa(e)}statusClass(e){return Ta(e)}formatExample(e){return Sn(e)}serverLabel(e){let s=[e.name,e.description].filter(Boolean).join(" \u2014 ");return s?`${s} (${e.url})`:e.url}languageTone(e){return Mu.includes(e)?e:"default"}encodingEntries(e){return Object.entries(e)}oauthFlowLabel(e){return ka[e]||e||"unknown"}schemaRows(e){return this.rowsCache.has(e)||this.rowsCache.set(e,this.doc.schemaRows(e)),this.rowsCache.get(e)}depth(e){return(e.match(/\./g)||[]).length}lineNumbers(e){return String(e||"").split(`
32
- `).map((s,o)=>o+1)}iconUrl(e){let s=this.props.assetBase??this.assetBase??(this.assetBase=_u());return s?`${s.replace(/\/$/,"")}/${e.icon}`:""}href(e){return this.props.hash?`#/${e}`:"#"}shouldReload(e){return e.src!==this.props.src||e.spec!==this.props.spec||e.serverUrl!==this.props.serverUrl}async load(e){this.state.status="loading";try{this.logic=await Ru(),this.doc=e.spec?this.logic.buildOpenApiDoc(e.spec,e.serverUrl):await this.logic.loadOpenApiDoc(e.src,e.serverUrl)}catch(s){this.state.status="error",this.state.error=s.message||String(s),e.onError?.(s);return}this.state.drafts={},this.state.current=this.routeId(e),this.ensureDraft(),this.state.status="ready",this.updateSnippet(),e.onLoad?.(this.doc)}routeId(e=this.props){let s=e.hash?location.hash.replace(/^#\//,""):e.operation;return s&&this.doc.findOperation(s)?s:"introduction"}go(e,s){this.props.hash||(e.preventDefault(),this.setCurrent(s)),this.overlayQuery.matches&&(this.state.sidebarOpen=!1)}setCurrent(e){let s=this.state;s.current=e,s.result=null,s.respTab=0,s.respView={},this.ensureDraft(),this.updateSnippet(),this.mainRef.el&&(this.mainRef.el.scrollTop=0),this.props.onNavigate?.(e)}ensureDraft(){let e=this.op;e&&!this.state.drafts[e.id]&&(this.state.drafts[e.id]=La(e,this.doc.baseUrl))}toggleSidebar(){this.state.sidebarOpen=!this.state.sidebarOpen}closeSidebarOnOutsideClick(e){!this.overlayQuery.matches||!this.state.sidebarOpen||e.target.closest?.(".sidebar-shell, .sidebar-toggle")||(this.state.sidebarOpen=!1)}selectResponse(e){this.state.respTab=Number(e)}setResponseView(e,s){this.state.respView[e]=s}setLanguage(e){this.state.lang=e,this.updateSnippet()}onBaseUrl(e){this.draft.baseUrl=e,this.updateSnippet()}onParam(e,s,o){this.draft[s][o]=e,this.updateSnippet()}onBody(e){this.draft.bodyText=e,this.updateSnippet()}async updateSnippet(){let e=this.op;if(!e||!this.tryItEnabled)return;let s=this.currentLanguage;try{this.state.snippet=await this.logic.generateSnippet(s.id,En(e,this.draft))}catch(o){this.state.snippet=`// Could not generate ${s.label} snippet: ${o.message}`}}async send(){let e=this.op,s=En(e,this.draft),o=Na(s),n={method:s.method,url:o.url,headerLines:o.headerLines,bodyText:s.bodyText};this.state.result={phase:"sending",sent:n};let a;try{a={phase:"done",sent:n,res:await Oa(s,o)}}catch(l){a={phase:"error",sent:n,message:l.message}}this.state.current===e.id&&(this.state.result=a)}clearResult(){this.state.result=null}collapseRequest(){this.rootRef.el.querySelectorAll(".tryit-card details").forEach((e,s)=>{s<3&&(e.open=!1)})}toggleTheme(){this.state.themeOverride=this.theme==="dark"?"light":"dark"}readSystemTheme(){let e=document.documentElement.getAttribute("data-bs-theme"),s=e?e==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches;this.state.systemTheme=s?"dark":"light"}openAuth(){var s;let e=this.state;e.stored.apikey=Rs("apikey"),e.stored.oauthkey=Rs("oauthkey"),e.inputs.apikey=e.stored.apikey,e.inputs.oauthkey=e.stored.oauthkey;for(let{key:o,def:n}of this.authSchemes)(s=e.oauth)[o]??(s[o]={clientId:"",clientSecret:"",username:"",password:"",scopes:Object.keys(n.scopes||{})});e.authOpen=!0}closeAuth(){this.state.authOpen=!1}setAuthOpen(e){this.state.authOpen=e}setAuthInput(e,s){this.state.inputs[e]=s}setField(e,s,o){e[s]=o}saveAuth(){Ei("apikey",this.state.inputs.apikey.trim()),Ei("oauthkey",this.state.inputs.oauthkey.trim()),this.closeAuth(),this.applyAuthToAll()}clearAuth(e){Ei(e,""),this.state.stored[e]="",this.state.inputs[e]="",this.applyAuthToAll()}applyAuthToAll(){for(let[e,s]of Object.entries(this.state.drafts))An(this.doc.findOperation(e),s);this.state.authed=wn(),this.updateSnippet()}toggleScope(e,s){let o=this.state.oauth[e].scopes,n=o.indexOf(s);n<0?o.push(s):o.splice(n,1)}setOAuthStatus(e,s,o=!1){this.state.oauthStatus[e]={message:s,isError:o}}applyOAuthToken(e,s,o){Ei("oauthkey",s),this.state.stored.oauthkey=s,this.state.inputs.oauthkey=s,Object.assign(this.state.oauth[e],{clientId:o.clientId,clientSecret:o.clientSecret}),this.applyAuthToAll(),this.setOAuthStatus(e,"Token acquired.")}async fetchToken(e,s,o){try{let n=await Ma(this.doc.securityDefinitions[e].tokenUrl,s,this.selectedBaseUrl,this.doc);this.applyOAuthToken(e,n,o)}catch(n){this.setOAuthStatus(e,`Token request failed: ${n.message}. This is usually a CORS restriction on the auth server.`,!0)}}startOAuth2Flow(e){let s=this.doc.securityDefinitions[e],o=this.state.oauth[e],n=[...o.scopes];if(s.flow==="implicit"||s.flow==="accessCode")return this.openOAuthPopup(e,s,o,n);if(s.flow==="password"||s.flow==="application")return this.setOAuthStatus(e,"Requesting token\u2026"),this.fetchToken(e,$a(s.flow,o,n),o);this.setOAuthStatus(e,`Unsupported OAuth2 flow: ${s.flow}`,!0)}openOAuthPopup(e,s,o,n){if(!s.authorizationUrl)return this.setOAuthStatus(e,"No authorizationUrl defined for this scheme.",!0);let a=Ba(),l=Ra({def:s,clientId:o.clientId,scopes:n,state:a,redirectUri:this.redirectUri,baseUrl:this.selectedBaseUrl,doc:this.doc}),p=window.open(l,`oauth2-authorize-${e}`,"width=560,height=680");if(!p)return this.setOAuthStatus(e,"Popup blocked \u2014 allow popups for this site and try again.",!0);this.pendingOAuth.set(a,{key:e,flow:s.flow,fields:{...o}}),this.setOAuthStatus(e,"Waiting for authorization in the popup\u2026"),this.watchPopup(p,a,e)}watchPopup(e,s,o){let n=setInterval(()=>{e.closed&&(clearInterval(n),this.watchers.delete(n),this.pendingOAuth.delete(s)&&this.setOAuthStatus(o,"Authorization window was closed before completing.",!0))},500);this.watchers.add(n)}get redirectUri(){return this.props.oauthRedirectUri||new URL("oauth2-redirect.html",document.baseURI).href}handleOAuthMessage(e){let s=e.data;if(e.origin!==window.location.origin||s?.source!=="oauth2-redirect")return;let o=this.pendingOAuth.get(s.state);if(!o)return;this.pendingOAuth.delete(s.state);let{key:n,flow:a,fields:l}=o;if(s.error)return this.setOAuthStatus(n,`Authorization failed: ${s.error}${s.errorDescription?" - "+s.errorDescription:""}`,!0);if(a==="implicit")return s.accessToken?this.applyOAuthToken(n,s.accessToken,l):this.setOAuthStatus(n,"Authorization server did not return an access token.",!0);if(!s.code)return this.setOAuthStatus(n,"Authorization server did not return a code.",!0);this.setOAuthStatus(n,"Exchanging code for token\u2026"),this.fetchToken(n,{grant_type:"authorization_code",code:s.code,redirect_uri:this.redirectUri,client_id:l.clientId,client_secret:l.clientSecret},l)}addListeners(){this.readSystemTheme(),this.themeObserver=new MutationObserver(this.onThemeChange),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-bs-theme"]}),window.addEventListener("hashchange",this.onHashChange),window.addEventListener("message",this.onOAuthMessage),document.addEventListener("click",this.onDocumentClick),this.overlayQuery.addEventListener("change",this.onViewportChange)}removeListeners(){this.themeObserver?.disconnect(),window.removeEventListener("hashchange",this.onHashChange),window.removeEventListener("message",this.onOAuthMessage),document.removeEventListener("click",this.onDocumentClick),this.overlayQuery.removeEventListener("change",this.onViewportChange),this.watchers.forEach(clearInterval)}};r(Zt,"template","nodexui.ApiDoc"),r(Zt,"components",{ApiDocGroup:Jt,Markdown:Gt,Badge:Ct,Breadcrumb:Ce,BreadcrumbItem:Le,BreadcrumbLink:Ne,BreadcrumbList:ke,BreadcrumbPage:Oe,BreadcrumbSeparator:Ft,Button:P,Checkbox:xe,Dialog:pe,DialogContent:qt,DialogDescription:me,DialogFooter:he,DialogHeader:de,DialogTitle:be,Icon:tt,Input:ne,NativeSelect:ve,TabContent:ue,Tabs:ae,TabsContainer:ce,TabsList:le,TabTrigger:Ut,Textarea:ge}),r(Zt,"props",{src:i(String),spec:i(Object),title:i(String),serverUrl:i(String),theme:i(String),themeToggle:i(Boolean),hash:i(Boolean),operation:i(String),tryIt:i(Boolean),authorize:i(Boolean),languages:i(Array),language:i(String),assetBase:i(String),oauthRedirectUri:i(String),height:i(String),onLoad:i(Function),onError:i(Function),onNavigate:i(Function),className:i(String),style:i([String,Object])});_();R();function Cn(t,e){if(!t)return null;if(t.type==="file"&&(t.path===e||t.meta?.slug===e))return t;for(let s of t.children||[]){let o=Cn(s,e);if(o)return o}return null}function Pu(t){return t.replace(/\.[^./]+$/,"").replace(/[_-]+/g," ").trim().split(/\s+/).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}var ri=class ri extends c{get label(){let e=this.props.node.meta;return e?.sidebar_label||e?.title||Pu(this.props.node.name)}get hasSubfolders(){return(this.props.node.children||[]).some(e=>e.type==="dir")}select(e){this.props.onSelect(e)}};r(ri,"template","nodexui.MarkdownTreeNode"),r(ri,"components",{MarkdownTreeNode:ri,Icon:tt,SidebarGroupLabel:Be,SidebarMenu:Kt,SidebarMenuItem:Re,SidebarMenuButton:Ht,DropdownMenu:ye,DropdownMenuTrigger:Dt,DropdownMenuContent:we,DropdownMenuItem:Ae,DropdownMenuSub:Se,DropdownMenuSubTrigger:jt,DropdownMenuSubContent:Ee}),r(ri,"props",{node:{type:Object},activePath:i(String),onSelect:{type:Function},nested:i(Boolean)});var Ci=ri,Ms=class extends c{setup(){this.state=$({tree:null,status:"loading",error:""}),Ot(()=>this.load())}async load(){this.state.status="loading",this.state.error="";try{let e=await fetch(this.props.src);if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);this.state.tree=await e.json(),this.state.status="ready"}catch(e){this.state.status="error",this.state.error=e.message||String(e)}}};r(Ms,"template","nodexui.MarkdownTree"),r(Ms,"components",{MarkdownTreeNode:Ci,SidebarGroup:Ie,SidebarMenu:Kt}),r(Ms,"props",{src:{type:String},activePath:i(String),onSelect:{type:Function},className:i(String),style:i([String,Object])});_();function Ua(t=document.querySelector("[b-block-code-template]")){let o=((t?.tagName==="SCRIPT"?t.textContent:t?.innerHTML)?.replace(/^\n/,"").replace(/\s+$/,"")||"").split(`
33
- `),n=o.filter(l=>l.trim()).map(l=>l.match(/^\s*/)?.[0].length||0),a=n.length?Math.min(...n):0;return o.map(l=>l.slice(a)).join(`
34
- `)}function qa(t,e=0){let s=" ".repeat(e),o=[];for(let n of t.childNodes){if(n.nodeType===Node.TEXT_NODE){let p=n.textContent.trim();p&&o.push(`${s}${p}`);continue}if(n.nodeType!==Node.ELEMENT_NODE)continue;let a=[...n.attributes].map(p=>` ${p.name}="${p.value}"`).join("");if(![...n.childNodes].some(p=>p.nodeType===Node.ELEMENT_NODE||p.nodeType===Node.TEXT_NODE&&p.textContent.trim())){o.push(`${s}<${n.localName}${a}>${n.textContent.trim()}</${n.localName}>`);continue}o.push(`${s}<${n.localName}${a}>`),o.push(...qa(n,e+1)),o.push(`${s}</${n.localName}>`)}return o}async function Da(t){if(!t?.trim())return"";let{expandSelfClosingTags:e,extractTagCaseMap:s,normalizeOwlPreviewMarkup:o}=await Promise.resolve().then(()=>(Wi(),Ea)),n=document.createElement("div");return n.innerHTML=e(t),o(n,s(t)),qa(n).join(`
35
- `)}function ja(t){t.querySelectorAll('[b-block="dashboard-01"], [b-block^="sidebar-"]').forEach(e=>{let s=e.querySelector("[b-block-sidebar-toggle], button[aria-label='Toggle sidebar']"),o=e.querySelector("[b-block-sidebar]");!s||!o||(e.setAttribute("b-att-sidebar",e.getAttribute("b-att-sidebar")||"open"),s.setAttribute("b-block-sidebar-toggle",""),s.setAttribute("aria-expanded",e.getAttribute("b-att-sidebar")==="open"?"true":"false"),s.addEventListener("click",()=>{let n=e.getAttribute("b-att-sidebar")!=="open";e.setAttribute("b-att-sidebar",n?"open":"collapsed"),s.setAttribute("aria-expanded",n?"true":"false")}))}),t.querySelectorAll('[b-block^="sidebar-"] [b-block-subnav]').forEach(e=>{let s=e.previousElementSibling;s&&(s.setAttribute("b-block-subnav-toggle",""),s.setAttribute("aria-expanded","true"),e.setAttribute("b-att-state","open"),s.addEventListener("click",o=>{o.preventDefault();let n=e.getAttribute("b-att-state")!=="open";e.setAttribute("b-att-state",n?"open":"collapsed"),s.setAttribute("aria-expanded",n?"true":"false")}))})}R();var Vi=qe({storageKey:"b-example-theme",toggleSelector:"",labelSelector:""}),Uu=[{key:"docs",label:"Docs",href:"/docs"},{key:"icons",label:"Icons",href:"/docs/icons"},{key:"examples",label:"Examples",href:"/examples/index.html"},{key:"blocks",label:"Blocks",href:"/blocks"}],qu={desktop:"",tablet:"768px",mobile:"390px"},Du="/dist/icons/lucide";function ju(){return document.querySelector("[b-block-code-template]")}function zu(t){return t.match(/<templates[^>]*>([\s\S]*)<\/templates>/)?.[1]||t}function Fu(t){for(let e of t.querySelectorAll?.("[b-block] [b-icon], [b-block] [b-ui='icon']")||[])!e.hasAttribute("b-icon-base-url")&&!e.hasAttribute("b-att-base-url")&&e.setAttribute("b-icon-base-url",Du)}var $s=class extends c{setup(){this.navItems=this.props.navItems||Uu,this.previewFrame=q("previewFrame"),this.embedRoot=q("embedRoot"),this.code=Ua(),this.state=$({mode:"preview",viewport:"desktop",copyLabel:"Copy code",embed:new URLSearchParams(globalThis.location.search).get("embed")==="1",codeVariant:"owl",staticTemplate:"",staticTemplateStatus:"idle"}),Q(()=>this.mountPreview()),at(()=>this.mountStaticNodexUI())}get activeCode(){return this.state.codeVariant==="template"?this.state.staticTemplateStatus==="ready"?this.state.staticTemplate:"Converting to a static template...":this.code}async setCodeVariant(e){if(this.state.codeVariant=e,e==="template"&&this.state.staticTemplateStatus==="idle"){this.state.staticTemplateStatus="loading";let s=await Da(this.code);this.state.staticTemplate=s,this.state.staticTemplateStatus="ready"}}get title(){return document.body.dataset.blockTitle||document.title||"Block"}get description(){return document.body.dataset.blockDescription||"Preview and copy this NodexUI block."}get previewStyle(){let e=qu[this.state.viewport]||"";return e?`max-width:${e}`:""}setMode(e){this.state.mode=e}setViewport(e){this.state.viewport=e}async copyCode(){await globalThis.navigator?.clipboard?.writeText(this.activeCode),this.state.copyLabel="Copied"}mountPreview(){this.state.embed&&(document.body.className="m-0");let e=this.state.embed?this.embedRoot.el:this.previewFrame.el,s=ju();if(!(!e||!s)){if(s.tagName==="SCRIPT"){this.mountOwlPreview(e,s);return}e.replaceChildren(s.content.cloneNode(!0)),this.mountStaticNodexUI(e),ja(e)}}async mountOwlPreview(e,s){e.replaceChildren();class o extends c{setup(){this.state=$({collapsed:!1})}}r(o,"template","examples.SidebarBlock");let n=[await ze("/dist/nodexui.templates.xml"),s.textContent].map(zu).join(`
36
- `);await zs(o,e,{templates:`<templates>${n}</templates>`}),Vi.set(Vi.current(),{skipStorage:!0})}mountStaticNodexUI(e=document){Fu(e),globalThis.thebase?.mountAll(e),Vi.set(Vi.current(),{skipStorage:!0})}};r($s,"template","nodexui.BlockViewer"),r($s,"components",{Button:P,Icon:tt,ThemeButton:Vt}),r($s,"props",{navItems:i(Array)});_();R();var ii=class extends c{setup(){this.pwaState=$({open:lt(this.props)}),G({pwa:this.pwaState,setPwaOpen:e=>this.setOpen(e)}),yt(this.pwaState)}setOpen(e){wt(this.props,this.pwaState,e)}};r(ii,"template","nodexui.Pwa"),r(ii,"props",{open:i(Boolean),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var _s=class extends c{onClick(){this.env.setPwaOpen(!0)}};r(_s,"template","nodexui.PwaTrigger"),r(_s,"components",{Button:P}),r(_s,"props",u);var ni=class extends c{setup(){this.rootRef=q("root"),At(e=>{if(!e)return;let s=document.activeElement;return bo(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.pwa.open])}get open(){return this.env.pwa.open}onKeyDown(e){e.key==="Escape"&&this.env.setPwaOpen(!1)}onBackdropClick(e){e.target===this.rootRef.el&&this.env.setPwaOpen(!1)}};r(ni,"template","nodexui.PwaContent"),r(ni,"props",u);var ai=class extends c{};r(ai,"template","nodexui.PwaHeader"),r(ai,"props",u);var ci=class extends c{};r(ci,"template","nodexui.PwaTitle"),r(ci,"props",u);var li=class extends c{};r(li,"template","nodexui.PwaDescription"),r(li,"props",u);var ui=class extends c{};r(ui,"template","nodexui.PwaBody"),r(ui,"props",u);var pi=class extends c{get steps(){return Array.isArray(this.props.steps)?this.props.steps:[]}};r(pi,"template","nodexui.PwaSteps"),r(pi,"props",{...u,steps:i(Array)});var di=class extends c{};r(di,"template","nodexui.PwaFooter"),r(di,"props",u);var Ps=class extends c{onClick(){this.env.setPwaOpen(!1)}};r(Ps,"template","nodexui.PwaClose"),r(Ps,"components",{Button:P}),r(Ps,"props",u);_();R();var za="",Fa="";function Ha(t,e){return typeof t=="string"?t:e}function Hu(t){return{title:t.submitted&&t.title.trim().length>0&&t.title.trim().length<5?"Bug title must be at least 5 characters.":"",description:t.submitted&&t.description.length>0&&t.description.length<20?"Description must be at least 20 characters.":""}}var Us=class extends c{setup(){this.state=$({title:Ha(this.props.title,za),description:Ha(this.props.description,Fa),submitted:!1})}get classNames(){return f("b-form",this.props.className)}get titlePlaceholder(){return this.props.titlePlaceholder||"Login button not working on mobile"}get descriptionPlaceholder(){return this.props.descriptionPlaceholder||"I'm having an issue with the login button on mobile."}get maxDescriptionLength(){return this.props.maxDescriptionLength||100}get descriptionLength(){return this.state.description.length}get errors(){return Hu(this.state)}get titleInvalid(){return!!this.errors.title}get descriptionInvalid(){return!!this.errors.description}reset(){this.state.title=za,this.state.description=Fa,this.state.submitted=!1}submit(e){e.preventDefault(),this.state.submitted=!0,!this.titleInvalid&&!this.descriptionInvalid&&this.props.onSubmit?.({title:this.state.title.trim(),description:this.state.description})}};r(Us,"template","nodexui.Form"),r(Us,"components",{Button:P,Field:$e,FieldDescription:Pe,FieldError:Ue,FieldGroup:Me,FieldLabel:_e}),r(Us,"props",{title:i(String),description:i(String),titlePlaceholder:i(String),descriptionPlaceholder:i(String),maxDescriptionLength:i(Number),className:i(String),style:i([String,Object]),onSubmit:i(Function)});_();R();var kn;function Wu(){return kn??(kn=import("./runtime/milkdown/milkdown-text-editor.js")),kn}async function Gi(t){return(await Wu()).createMilkdownTextEditor(t)}function Zi({collaborative:t,providerType:e,url:s}={}){return!!t||!!(e&&s)}var hi=class extends c{setup(){this.editorRef=q("editor"),this.editorHandle=null,this.mountPromise=null,this.mountToken=0,this.isDestroyed=!1,this.state=$({content:"",status:"loading",error:""}),Ot(()=>this.load(this.props)),ht(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),Q(()=>this.mountEditor()),at(()=>this.mountEditor()),Fe(()=>{this.isDestroyed=!0,this.destroyEditor()})}get classNames(){return f("b-text-editor",this.props.className)}get isCollaborative(){return Zi({collaborative:this.props.collaborative,providerType:this.props.provider,url:this.props.url})}get editorLabel(){return this.isCollaborative?"Collaborative rich text editor":"Rich text editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src}shouldRestartEditor(e){return e.collaborative!==this.props.collaborative||e.provider!==this.props.provider||e.room!==this.props.room||e.url!==this.props.url||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=e.content??"";if(e.src)try{let o=await fetch(e.src);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);s=await o.text()}catch(o){this.state.status="error",this.state.error=o.message||String(o);return}this.state.content=s,this.state.status="ready"}async mountEditor(){let e=this.editorRef.el;if(this.isDestroyed||!e||this.editorHandle||this.mountPromise||this.state.status!=="ready")return;let s=++this.mountToken;return this.mountPromise=(async()=>{try{let o=await Gi({root:e,value:this.state.content,placeholder:this.props.placeholder,collaborative:this.isCollaborative,providerType:this.props.provider,room:this.props.room||"b-text-editor",url:this.props.url,password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(n,a,l)=>{this.state.content=n,this.props.onChange?.(n,a,l)}});if(s!==this.mountToken){o.destroy?.();return}this.editorHandle=o}catch(o){s===this.mountToken&&(this.state.status="error",this.state.error=o.message||String(o))}finally{this.mountPromise=null,this.isDestroyed||this.mountEditor()}})(),this.mountPromise}destroyEditor(){this.mountToken++,this.editorHandle?.destroy?.(),this.editorHandle=null}};r(hi,"template","nodexui.TextEditor"),r(hi,"props",{content:i(String),src:i(String),placeholder:i(String),collaborative:i(Boolean),provider:i(String),room:i(String),url:i(String),password:i(String),signaling:i(Array),user:i(Object),onChange:i(Function),className:i(String),style:i([String,Object])});U();function Ku(t){let{open:e,close:s,destroy:o}=qi(t,{closeSelector:"[b-alert-dialog-cancel], [b-alert-dialog-action], [b-alert-dialog-close]",trapFocus:!0});return t.setAttribute("role","alertdialog"),t.NodexUIAlertDialog={open:e,close:s},{destroy:()=>{o(),delete t.NodexUIAlertDialog}}}h.register("alert-dialog",{type:"owl",mount:Ku});U();var Nn={default:"b-alert-default",destructive:"b-alert-destructive",info:"b-alert-default",success:"alert-success",warning:"alert-warning",danger:"b-alert-destructive"};function Vu(t){t.classList.add("alert","b-alert",Nn[t.getAttribute("b-att-variant")||"default"]||Nn.default),t.setAttribute("role",t.getAttribute("role")||"alert");let e=null;if(!!t.getAttribute("b-att-dismissible")){if(t.classList.add("alert-dismissible","fade","show"),!t.querySelector('[data-bs-dismiss="alert"]')){let o=document.createElement("button");o.type="button",o.className="btn-close",o.setAttribute("data-bs-dismiss","alert"),o.setAttribute("aria-label","Close"),t.appendChild(o)}e=new(W()).Alert(t)}return{destroy:()=>{e?.dispose(),t.classList.remove("alert","b-alert","alert-dismissible","fade","show",...Object.values(Nn))}}}h.register("alert",{type:"static",mount:Vu});_();U();function Wa(t,e){return t.getAttribute(e)!=="false"}function Gu(t){let e=t.getAttribute("b-att-templates");if(e)return e;let s=[...document.scripts].find(o=>/\/nodexui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(o.src));return s?s.src.replace(/[?#].*$/,"").replace(/[^/]*$/,"nodexui.templates.xml"):"/dist/nodexui.templates.xml"}function Zu(t){let e=(o,n)=>t.dispatchEvent(new CustomEvent(`nodexui:${o}`,{bubbles:!0,detail:n})),s=t.getAttribute("b-att-languages");return{src:t.getAttribute("b-att-src")||void 0,title:t.getAttribute("b-att-title")||void 0,serverUrl:t.getAttribute("b-att-server-url")||void 0,theme:t.getAttribute("b-att-theme")||void 0,themeToggle:t.getAttribute("b-att-theme-toggle")==="true",hash:t.getAttribute("b-att-hash")==="true",operation:t.getAttribute("b-att-operation")||void 0,tryIt:Wa(t,"b-att-try-it"),authorize:Wa(t,"b-att-authorize"),languages:s?s.split(",").map(o=>o.trim()).filter(Boolean):void 0,language:t.getAttribute("b-att-language")||void 0,assetBase:t.getAttribute("b-att-asset-base")??void 0,oauthRedirectUri:t.getAttribute("b-att-oauth-redirect-uri")||void 0,height:t.getAttribute("b-att-height")||void 0,onLoad:o=>e("load",{info:o.info,operations:o.groups.flatMap(n=>n.items).length}),onError:o=>e("error",{error:o}),onNavigate:o=>e("navigate",{id:o})}}function Ju(t){let e=Zu(t),s=ze(Gu(t)).then(o=>zs(Zt,t,{templates:o,props:e}));return{destroy:async()=>{(await s).destroy()}}}h.register("apidoc",{type:"owl",mount:Ju});U();function Yu(t){let e=[...t.querySelectorAll("[b-accordion-item]")],s=t.getAttribute("b-att-multiple")==="true",o=new Map,n=new Map,a=new Map,l=(p,b)=>{let v=p.querySelector("[b-accordion-trigger]");p.setAttribute("b-att-state",b?"open":"closed"),v?.setAttribute("aria-expanded",String(b)),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{open:b}}))};return t.setAttribute("role","presentation"),t.classList.add("accordion"),e.forEach((p,b)=>{let v=p.querySelector("[b-accordion-trigger]"),k=p.querySelector("[b-accordion-panel]");if(!k)return;p.classList.add("accordion-item"),v?.classList.add("accordion-button"),k.classList.add("accordion-collapse");let O=k.id||`b-accordion-panel-${b}`;k.id=O;let j=p.getAttribute("b-att-state")==="open";k.classList.add("collapse"),j&&k.classList.add("show");let K=new(W()).Collapse(k,{toggle:!1});a.set(p,K);let Z=()=>l(p,!0),z=()=>l(p,!1);k.addEventListener("shown.bs.collapse",Z),k.addEventListener("hidden.bs.collapse",z),n.set(p,{onShown:Z,onHidden:z}),v?.setAttribute("aria-expanded",String(j)),v?.setAttribute("aria-controls",O);let et=()=>{let nt=k.classList.contains("show");!s&&!nt&&e.forEach(A=>{if(A===p)return;let M=a.get(A),L=A.querySelector("[b-accordion-panel]");M&&L?.classList.contains("show")&&M.hide()}),nt?K.hide():K.show()};o.set(p,et),v?.addEventListener("click",et)}),{destroy:()=>{e.forEach(p=>{let b=p.querySelector("[b-accordion-trigger]"),v=p.querySelector("[b-accordion-panel]");b?.removeEventListener("click",o.get(p));let k=n.get(p);v&&k&&(v.removeEventListener("shown.bs.collapse",k.onShown),v.removeEventListener("hidden.bs.collapse",k.onHidden)),a.get(p)?.dispose()}),o.clear(),n.clear(),a.clear()}}}h.register("accordion",{type:"owl",mount:Yu});U();function Xu(t){let e=t.getAttribute("b-att-ratio")||`${t.getAttribute("b-att-width")||16} / ${t.getAttribute("b-att-height")||9}`;return t.classList.add("b-aspect-ratio"),t.style.setProperty("--b-aspect-ratio",e),{destroy:()=>t.classList.remove("b-aspect-ratio")}}h.register("aspect-ratio",{type:"static",mount:Xu});U();Hs();var Qu=["idle","uploading","processing","error","done"],tp=["default","sm","xs"],ep=["content","title","description","actions"];function Ka(t,e){t.classList.add(`b-attachment-${e}`),t.setAttribute("data-slot",`attachment-${e}`)}function sp(t){let e=t.querySelector("input[type='file']"),s=t.querySelector("[b-attachment-list]"),o=Qu.includes(t.getAttribute("b-att-state"))?t.getAttribute("b-att-state"):"done",n=tp.includes(t.getAttribute("b-att-size"))?t.getAttribute("b-att-size"):"default",a=t.getAttribute("b-att-orientation")==="vertical"?"vertical":"horizontal";t.classList.add("b-attachment"),t.classList.add(`b-attachment-${o}`,`b-attachment-${n}`,`b-attachment-${a}`),t.setAttribute("data-state",o),t.setAttribute("data-size",n),t.setAttribute("data-orientation",a),t.setAttribute("data-slot","attachment"),e&&t.classList.add("b-attachment-picker"),t.querySelectorAll("[b-attachment-media]").forEach(p=>{let b=p.getAttribute("b-att-variant")==="image"?"image":"icon";Ka(p,"media"),p.classList.add(`b-attachment-media-${b}`),p.setAttribute("data-variant",b)}),ep.forEach(p=>t.querySelectorAll(`[b-attachment-${p}]`).forEach(b=>Ka(b,p))),t.querySelectorAll("[b-attachment-action]").forEach(p=>{let b=mt[p.getAttribute("b-att-variant")]||mt.ghost,v=vt[p.getAttribute("b-att-size")]||vt["icon-xs"];p.classList.add("btn","b-button",b,v,"b-button-icon","b-attachment-action"),p.setAttribute("data-slot","attachment-action"),!p.getAttribute("type")&&p.tagName==="BUTTON"&&p.setAttribute("type","button")}),t.querySelectorAll("[b-attachment-trigger]").forEach(p=>{p.classList.add("b-attachment-trigger"),p.setAttribute("data-slot","attachment-trigger"),!p.getAttribute("type")&&p.tagName==="BUTTON"&&p.setAttribute("type","button")}),e?.classList.add("form-control");let l=()=>{s&&(s.innerHTML=[...e.files].map(p=>`<li>${p.name}</li>`).join("")),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{files:[...e.files]}}))};return e?.addEventListener("change",l),{destroy:()=>e?.removeEventListener("change",l)}}function op(t){return t.classList.add("b-attachment-group"),t.setAttribute("data-slot","attachment-group"),{destroy:()=>t.classList.remove("b-attachment-group")}}function rp(t){let e=t.querySelector("input[type='file']");t.classList.add("b-attachment-dropzone"),t.setAttribute("data-slot","attachment-dropzone");let s=()=>e?.click(),o=b=>{b.preventDefault(),t.classList.add("b-attachment-dropzone-dragging")},n=()=>t.classList.remove("b-attachment-dropzone-dragging"),a=b=>{b.length&&t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{files:b}}))},l=b=>{b.preventDefault(),t.classList.remove("b-attachment-dropzone-dragging"),a([...b.dataTransfer?.files??[]])},p=()=>{a([...e?.files??[]]),e&&(e.value="")};return t.addEventListener("click",s),t.addEventListener("dragover",o),t.addEventListener("dragleave",n),t.addEventListener("drop",l),e?.addEventListener("change",p),{destroy:()=>{t.removeEventListener("click",s),t.removeEventListener("dragover",o),t.removeEventListener("dragleave",n),t.removeEventListener("drop",l),e?.removeEventListener("change",p)}}}h.register("attachment",{type:"owl",mount:sp});h.register("attachment-group",{type:"static",mount:op});h.register("attachment-dropzone",{type:"static",mount:rp});U();function ip(t){t.classList.add("b-avatar");let e=t.querySelector("img"),s=t.querySelector("[b-avatar-fallback]");if(e&&s){let o=()=>{e.hidden=!0,s.hidden=!1};return s.hidden=!!e.getAttribute("src"),e.addEventListener("error",o),{destroy:()=>e.removeEventListener("error",o)}}return{}}h.register("avatar",{type:"static",mount:ip});U();function np(t){let e=He[t.getAttribute("b-att-variant")||"secondary"]||He.secondary;return t.classList.add("badge",e),t.getAttribute("b-att-pill")==="true"&&t.classList.add("rounded-pill"),{destroy:()=>t.classList.remove("badge","rounded-pill",...Object.values(He))}}h.register("badge",{type:"static",mount:np});U();It();function Va(t){return[...t.children].filter(e=>!e.matches("[b-breadcrumb-separator], .b-breadcrumb-separator"))}function Za(t,e,s){return ut(t,e,{size:s}),t}function ap(){let t=document.createElement("li"),e=document.createElement("span");return t.setAttribute("b-breadcrumb-separator",""),t.setAttribute("data-slot","breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),t.className="b-breadcrumb-separator",e.className="b-breadcrumb-separator-icon",t.append(Za(e,"chevron-right","var(--b3_5)")),t}function cp(t){t.classList.add("b-breadcrumb-separator"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true")}function lp(t){if(t.classList.add("b-breadcrumb-ellipsis"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-ellipsis"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),!t.querySelector(".b-icon")){let e=document.createElement("span");e.className="b-breadcrumb-ellipsis-icon",t.prepend(Za(e,"ellipsis","var(--b4)"))}if(!t.querySelector(".visually-hidden")){let e=document.createElement("span");e.className="visually-hidden",e.textContent="More",t.append(e)}}function Ga(t){t.classList.add("b-breadcrumb-page"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-page"),t.setAttribute("role",t.getAttribute("role")||"link"),t.setAttribute("aria-disabled","true"),t.setAttribute("aria-current","page")}function up(t){let e=t.querySelector("ol, ul")||t;t.classList.add("b-breadcrumb"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb"),t.setAttribute("aria-label",t.getAttribute("aria-label")||"breadcrumb"),e.classList.add("breadcrumb","b-breadcrumb-list"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"breadcrumb-list");for(let o of e.querySelectorAll("[b-breadcrumb-separator], .b-breadcrumb-separator"))cp(o);for(let o of e.querySelectorAll("[b-breadcrumb-ellipsis], .b-breadcrumb-ellipsis"))lp(o);for(let o of e.querySelectorAll("[b-breadcrumb-page], .b-breadcrumb-page"))Ga(o);e.querySelector("[b-breadcrumb-separator], .b-breadcrumb-separator")||Va(e).slice(0,-1).forEach(n=>n.after(ap()));let s=Va(e);return s.forEach((o,n)=>{o.classList.add("b-breadcrumb-item"),o.setAttribute("data-slot",o.getAttribute("data-slot")||"breadcrumb-item");for(let a of o.querySelectorAll("a"))a.classList.add("b-breadcrumb-link"),a.setAttribute("data-slot",a.getAttribute("data-slot")||"breadcrumb-link");if(n===s.length-1){let a=o.querySelector("[b-breadcrumb-page], .b-breadcrumb-page");a?Ga(a):(o.classList.add("b-breadcrumb-page"),o.setAttribute("aria-current",o.getAttribute("aria-current")||"page"))}}),{destroy:()=>{t.classList.remove("b-breadcrumb"),e.classList.remove("breadcrumb","b-breadcrumb-list");for(let o of e.querySelectorAll("[b-breadcrumb-separator]"))o.remove()}}}h.register("breadcrumb",{type:"owl",mount:up});U();function pp(t){return t.classList.add("b-bubble"),t.getAttribute("role")||t.setAttribute("role","listitem"),{destroy:()=>t.classList.remove("b-bubble")}}h.register("bubble",{type:"static",mount:pp});U();It();Hs();function dp(t){return[...t.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE&&e.textContent.trim()).map(e=>{let s=document.createElement("span");return s.textContent=e.textContent.trim(),e.replaceWith(s),s})}function hp(t){let e=t.getAttribute("b-att-icon"),s=t.getAttribute("b-att-icon-position")==="end"?"end":"start",o=!!t.textContent.trim(),n=e&&o?dp(t):[],a=null;return t.classList.add("btn","b-button",mt[t.getAttribute("b-att-variant")||"default"]||"btn-primary"),vt[t.getAttribute("b-att-size")]&&t.classList.add(vt[t.getAttribute("b-att-size")]),t.dataset.slot="button",e&&(a=document.createElement("span"),a.setAttribute("b-icon",e),a.dataset.icon=`inline-${s}`,ut(a,e,{label:""}),t.insertBefore(a,s==="end"?null:t.firstChild),t.dataset.icon=`inline-${s}`,o||(t.dataset.iconOnly="true",t.classList.add("b-button-icon"))),{destroy:()=>{a?.remove();for(let l of n)l.replaceWith(document.createTextNode(l.textContent));t.classList.remove("btn","b-button","b-button-icon",...Object.values(mt),...Object.values(vt)),t.removeAttribute("data-slot"),t.removeAttribute("data-icon"),t.removeAttribute("data-icon-only")}}}h.register("button",{type:"static",mount:hp});U();function bp(t){let e=t.getAttribute("b-att-orientation")==="vertical",s=t.getAttribute("b-att-size"),o=[...t.querySelectorAll("[b-button-group-separator]")],n=[...t.querySelectorAll("[b-button-group-text]")];return t.classList.add("b-button-group",e?"btn-group-vertical":"btn-group"),(s==="sm"||s==="lg")&&t.classList.add(`btn-group-${s}`),t.setAttribute("role",t.getAttribute("role")||"group"),o.forEach(a=>{let l=a.getAttribute("b-att-orientation")==="horizontal"?"horizontal":"vertical";a.classList.add("b-button-group-separator",`b-button-group-separator-${l}`),a.setAttribute("data-orientation",l),a.setAttribute("role","separator")}),n.forEach(a=>{a.classList.add("b-button-group-text")}),{destroy:()=>{t.classList.remove("b-button-group","btn-group","btn-group-vertical","btn-group-sm","btn-group-lg")}}}h.register("button-group",{type:"static",mount:bp});U();var mp=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"});function fp(t){let e=t.getAttribute("b-att-selected")?new Date(`${t.getAttribute("b-att-selected")}T00:00:00`):new Date,s=Number(t.getAttribute("b-att-month")??e.getMonth()+1)-1,o=Number(t.getAttribute("b-att-year")??e.getFullYear()),n=new Date(o,s,1),a=new Date(o,s+1,0).getDate(),l=n.getDay();t.classList.add("b-calendar"),t.querySelector("[b-calendar-grid]")||(t.innerHTML=`
37
- <div class="b-calendar__header">${mp.format(n)}</div>
28
+ `,e.selectionStart-1)+1,o=oa(e.value.slice(s),this.language.indent);if(!o)return;let{selectionStart:i,selectionEnd:a}=e;e.setRangeText("",s,s+o,"preserve"),e.setSelectionRange(Math.max(s,i-o),Math.max(s,a-o))}};r(Fe,"template","nodexui.CodeEditor"),r(Fe,"components",{Alert:Mt,AlertDescription:Zt,Badge:At,Button:R,ClipboardButton:Rt,Kbd:Gt,Spinner:Jt}),r(Fe,"props",{value:n(String),codeLang:n(String),src:n(String),upload:n(Boolean),format:n(Boolean),toggle:n(Boolean),onChange:n(Function),onLoad:n(Function),onError:n(Function),readonly:n(Boolean),title:n(String),globals:n(Array),hint:n(String),id:n(String),...p});var Yt=class extends l{get tag(){return this.props.tag||"div"}};r(Yt,"template","nodexui.Card"),r(Yt,"props",{...p,tag:n(String)});var Xt=class extends l{};r(Xt,"template","nodexui.CardHeader"),r(Xt,"props",p);var Qt=class extends l{};r(Qt,"template","nodexui.CardBody"),r(Qt,"props",p);var zs=class extends l{};r(zs,"template","nodexui.CardFooter"),r(zs,"props",p);var te=class extends l{};r(te,"template","nodexui.CardTitle"),r(te,"props",p);var ee=class extends l{};r(ee,"template","nodexui.CardDescription"),r(ee,"props",p);var Ot=class extends l{setup(){this.state=I({open:ut(this.props.state)}),this.triggerRef=$("trigger"),this.bufferRef=$("buffer"),this.bootstrapTooltip=null,this.lastContentHtml=null,this.onShown=()=>{this.state.open=!0},this.onHidden=()=>{this.state.open=!1},K(()=>{this.lastContentHtml=this.currentContentHtml();let e=this.triggerElement();this.bootstrapTooltip=new(j()).Tooltip(e,{title:this.lastContentHtml,html:!0,trigger:"hover focus"}),e.addEventListener("shown.bs.tooltip",this.onShown),e.addEventListener("hidden.bs.tooltip",this.onHidden),ut(this.props.state)&&this.bootstrapTooltip.show()}),rt(()=>{let e=this.currentContentHtml();e!==this.lastContentHtml&&(this.lastContentHtml=e,this.bootstrapTooltip?.setContent({".tooltip-inner":e}))}),G(()=>{let e=this.triggerElement();e?.removeEventListener("shown.bs.tooltip",this.onShown),e?.removeEventListener("hidden.bs.tooltip",this.onHidden),this.bootstrapTooltip?.dispose()})}triggerElement(){return this.triggerRef.el?.firstElementChild||this.triggerRef.el}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}show(){this.bootstrapTooltip?.show()}hide(){this.bootstrapTooltip?.hide()}};r(Ot,"template","nodexui.Tooltip"),r(Ot,"props",{content:n(String),state:n(String),...p});var Wl=qs("circle-question-mark"),Kl=0,Et={label:n(String),labelBackground:n(String),supportingText:n(String),useTip:n(Number),errorText:n(String),leadingIcon:n(String),trailingIcon:n(String),maxLength:n(Number),invalid:n(Boolean),placeholder:n(String),disabled:n(Boolean),slots:n(Object)},bt=class extends l{setup(){this.supportId=`b-input-support-${Kl++}`,this.box=$("box"),this.slotRefs={start:$("start"),end:$("end"),footer:$("footer")},K(()=>this.measureSlots()),rt(()=>this.measureSlots())}get field(){return this.env.fieldProps?.()??{}}get label(){return this.props.label??this.field.label}get labelStyle(){let e=this.props.labelBackground??this.field.labelBackground;return e?`--b-label-bg:${e}`:void 0}get isOutlined(){return!!this.label||this.hasStart||this.hasEnd||this.hasFooter}get hasStart(){return!!this.props.slots?.start}get hasEnd(){return!!this.props.slots?.end}get hasFooter(){return!!this.props.slots?.footer}measureSlots(){let e=this.box.el;if(!e)return;let{start:s,end:o,footer:i}=this.slotRefs;e.style.setProperty("--b-slot-start",`${s.el?.offsetWidth??0}px`),e.style.setProperty("--b-slot-end",`${o.el?.offsetWidth??0}px`),e.style.setProperty("--b-slot-footer",`${i.el?.offsetHeight??0}px`)}get isInvalid(){return!!(this.props.invalid||this.field.invalid||this.errorText)}get errorText(){return this.props.errorText??this.field.error}get helperText(){return this.props.supportingText||this.field.description}get useTip(){return Number(this.props.useTip??this.field.useTip??0)===1}get supportingText(){return this.errorText||(this.useTip?void 0:this.helperText)}get tipText(){return this.useTip&&!this.errorText?this.helperText:void 0}get leadingIcon(){return this.props.leadingIcon}get trailingIcon(){return this.isInvalid?"circle-alert":this.props.trailingIcon}get fieldPlaceholder(){return this.props.placeholder??(this.isOutlined?" ":void 0)}get counter(){return`${(this.props.value??"").length}/${this.props.maxLength}`}get controlClass(){return this.isOutlined&&"b-outlined-control"}get describedBy(){return this.supportingText?this.supportId:void 0}get outlinedClassNames(){return f("b-input-outlined",this.isInvalid&&"is-invalid",this.props.disabled&&"is-disabled",this.props.placeholder&&"has-placeholder",this.leadingIcon&&"has-leading",this.trailingIcon&&"has-trailing",this.hasStart&&"has-start",this.hasEnd&&"has-end",this.hasFooter&&"has-footer")}};r(bt,"components",{Icon:Z,IconCircleQuestionMark:Wl,Tooltip:Ot});function Tn({tag:t="input",type:e}={}){return t==="select"?"form-select":e==="checkbox"||e==="radio"?"form-check-input":"form-control"}var se=class extends bt{get ariaLabel(){return X(this.props,"aria-label","ariaLabel")}get classNames(){return f("b-input",Tn({tag:"input",type:this.props.type}),this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(se,"template","nodexui.Input"),r(se,"props",{...Et,value:n(String),type:n(String),readonly:n(Boolean),className:n(String),style:n([String,Object]),id:n(String),list:n(String),autocomplete:n(String),"aria-label":n(String),ariaLabel:n(String),min:n([String,Number]),max:n([String,Number]),step:n([String,Number]),onInput:n(Function),onChange:n(Function)});var li={default:"b-tabs-list-default",line:"b-tabs-list-line"};function On(t,e,s,o="horizontal"){let i=o==="vertical",u=t===(i?"ArrowDown":"ArrowRight")?1:t===(i?"ArrowUp":"ArrowLeft")?-1:0;return!u||s===0?-1:(e+u+s)%s}var Vl=0;function na(t){return String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}var oe=class extends l{setup(){this.tabsState=I({active:this.props.value??this.props.defaultValue??""}),this.instanceId=`t${++Vl}`,z({tabs:this.tabsState,selectTab:e=>this.select(e),tabsId:this.instanceId,orientation:this.orientation}),nt(e=>{e.value!==void 0&&(this.tabsState.active=e.value)})}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return f("b-tabs",this.props.className)}select(e){this.props.value===void 0&&(this.tabsState.active=e),this.props.onChange?.(e)}};r(oe,"template","nodexui.Tabs"),r(oe,"props",{value:n(String),defaultValue:n(String),orientation:n(String),onChange:n(Function),...p});var re=class extends l{};r(re,"template","nodexui.TabsContainer"),r(re,"props",{...p});var ne=class extends l{setup(){this.listRef=$("list")}get classNames(){return f("nav","b-tabs-list",li[this.props.variant]||li.default,this.props.className)}onKeyDown(e){let s=[...this.listRef.el.querySelectorAll("[role='tab']")],o=s.indexOf(e.target),i=On(e.key,o,s.length,this.env.orientation);i!==-1&&(e.preventDefault(),s[i].focus(),s[i].click())}};r(ne,"template","nodexui.TabsList"),r(ne,"props",{variant:n(String),...p});var $t=class extends l{setup(){this.rootEl=null,this.tabInstance=null,this.onShown=()=>this.env.selectTab(this.props.value)}onRootRef(e){e?(this.rootEl=e,this.tabInstance=j().Tab.getOrCreateInstance(e),e.addEventListener("shown.bs.tab",this.onShown)):this.rootEl&&(this.rootEl.removeEventListener("shown.bs.tab",this.onShown),this.tabInstance?.dispose(),this.tabInstance=null,this.rootEl=null)}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`b-tabs-panel-${this.env.tabsId}-${na(this.props.value)}`}get classNames(){return f("nav-link","b-tabs-trigger",this.isActive&&"active",this.props.className)}get tabAttrs(){return{role:"tab","data-bs-target":`#${this.panelId}`,"aria-selected":this.isActive?"true":"false",tabindex:this.isActive?0:-1}}onClick(){this.props.disabled||this.tabInstance?.show()}};r($t,"template","nodexui.TabTrigger"),r($t,"components",{Button:R}),r($t,"props",{value:{type:String},disabled:n(Boolean),...p});var ie=class extends l{setup(){this.initialActive=this.isActive}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`b-tabs-panel-${this.env.tabsId}-${na(this.props.value)}`}};r(ie,"template","nodexui.TabContent"),r(ie,"props",{value:{type:String},...p});function ft(t,e){nt(s=>{Ue(s)&&(t.open=at(s),t.open?e?.instance?.show():e?.instance?.hide())})}function gt(t,e,s){Ue(t)||(e.open=s),t.onOpenChange?.(s)}function In(t,e){let s=null;K(()=>{s=new(j()).Collapse(t.el,{toggle:!1})}),rt(()=>{if(!s)return;let o=t.el.classList.contains("show");e()&&!o?s.show():!e()&&o&&s.hide()}),G(()=>s?.dispose())}var ae=class extends l{setup(){this.dialogState=I({open:at(this.props)}),this.control={instance:null},z({dialog:this.dialogState,dialogControl:this.control,setDialogOpen:e=>this.setOpen(e)}),ft(this.dialogState,this.control)}setOpen(e){gt(this.props,this.dialogState,e)}};r(ae,"template","nodexui.Dialog"),r(ae,"props",{open:n(Boolean),state:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),style:n([String,Object]),slots:n(Object)});var Hs=class extends l{onClick(){this.env.dialogControl.instance?.show()}};r(Hs,"template","nodexui.DialogTrigger"),r(Hs,"props",p);var _t=class extends l{setup(){this.rootRef=$("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDialogOpen(!0),this.onHidden=()=>{this.env.setDialogOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},K(()=>{this.env.dialogControl.instance=j().Modal.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,focus:!0}),this.rootRef.el.addEventListener("show.bs.modal",this.onShow),this.rootRef.el.addEventListener("shown.bs.modal",this.onShown),this.rootRef.el.addEventListener("hidden.bs.modal",this.onHidden),this.env.dialog.open&&this.env.dialogControl.instance.show()}),G(()=>{this.rootRef.el.removeEventListener("show.bs.modal",this.onShow),this.rootRef.el.removeEventListener("shown.bs.modal",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.modal",this.onHidden),this.env.dialogControl.instance?.dispose(),this.env.dialogControl.instance=null})}get showCloseButton(){return this.props.showCloseButton!==!1&&this.props["show-close-button"]!==!1}};r(_t,"template","nodexui.DialogContent"),r(_t,"components",{Button:R}),r(_t,"props",{...p,showCloseButton:n(Boolean),"show-close-button":n(Boolean)});var ce=class extends l{};r(ce,"template","nodexui.DialogHeader"),r(ce,"props",p);var le=class extends l{};r(le,"template","nodexui.DialogFooter"),r(le,"props",p);var ue=class extends l{};r(ue,"template","nodexui.DialogTitle"),r(ue,"props",p);var pe=class extends l{};r(pe,"template","nodexui.DialogDescription"),r(pe,"props",p);var ze=class extends l{};r(ze,"template","nodexui.DialogClose"),r(ze,"components",{Button:R}),r(ze,"props",p);var ia={default:"b-empty-default",outline:"b-empty-outline",background:"b-empty-background"},Zl={default:"b-empty-media-default",icon:"b-empty-media-icon"},Ws=class extends l{get classNames(){return f("b-empty",ia[this.props.variant]||ia.default,this.props.className)}};r(Ws,"template","nodexui.Empty"),r(Ws,"props",{variant:n(String),...p});var Ks=class extends l{};r(Ks,"template","nodexui.EmptyHeader"),r(Ks,"props",p);var Vs=class extends l{get variant(){return this.props.variant==="icon"?"icon":"default"}get classNames(){return f("b-empty-media",Zl[this.variant],this.props.className)}};r(Vs,"template","nodexui.EmptyMedia"),r(Vs,"props",{variant:n(String),...p});var Zs=class extends l{};r(Zs,"template","nodexui.EmptyTitle"),r(Zs,"props",p);var Gs=class extends l{};r(Gs,"template","nodexui.EmptyDescription"),r(Gs,"props",p);var Js=class extends l{};r(Js,"template","nodexui.EmptyContent"),r(Js,"props",p);var Ys=class extends l{get vertical(){return this.props.orientation==="vertical"}get classNames(){return f("b-separator",this.vertical?"b-separator-vertical":"b-separator-horizontal",this.props.className)}};r(Ys,"template","nodexui.Separator"),r(Ys,"props",{orientation:n(String),className:n(String),style:n([String,Object])});var de=class extends l{get classNames(){return f("b-skeleton",this.props.shape==="circle"?"b-skeleton-circle":"b-skeleton-block",this.props.className)}};r(de,"template","nodexui.Skeleton"),r(de,"props",{shape:n(String),className:n(String),style:n([String,Object])});var Gl={lead:"lead",muted:"text-body-secondary",code:"b-code",kbd:"b-kbd",h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"b-list"},Jl={h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"ul"},Xs=class extends l{get tag(){return this.props.tag||Jl[this.props.variant]||"p"}get classNames(){return f("b-typography",Gl[this.props.variant],this.props.className)}};r(Xs,"template","nodexui.Typography"),r(Xs,"props",{variant:n(String),tag:n(String),...p});var Qs=class extends l{get classNames(){return f("b-marker",this.props.className)}get variant(){return this.props.variant}};r(Qs,"template","nodexui.Marker"),r(Qs,"props",{variant:n(String),...p});var he=class extends bt{get outlinedClassNames(){return f(super.outlinedClassNames,"is-anchored")}get classNames(){return f("form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.resize==="none"&&"b-textarea-no-resize",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(he,"template","nodexui.Textarea"),r(he,"props",{...Et,value:n(String),rows:n(Number),readonly:n(Boolean),resize:n(String),className:n(String),style:n([String,Object]),id:n(String),onInput:n(Function),onChange:n(Function)});var me=class extends bt{get ariaLabel(){return X(this.props,"aria-label","ariaLabel")}get classNames(){return f("b-native-select","form-select",this.controlClass,this.isInvalid&&"is-invalid",(this.props.size==="sm"||this.props.size==="lg")&&`form-select-${this.props.size}`,this.props.className)}onChange(e){this.props.onChange?.(e.target.value,e)}};r(me,"template","nodexui.NativeSelect"),r(me,"props",{...Et,value:n(String),size:n(String),...p,"aria-label":n(String),ariaLabel:n(String),id:n(String),onChange:n(Function)});var be=class extends l{onChange(e){this.props.onChange?.(e.target.checked,e)}};r(be,"template","nodexui.Checkbox"),r(be,"props",{checked:n(Boolean),disabled:n(Boolean),...p,id:n(String),onChange:n(Function)});var to=class extends l{setup(){z({radioGroupValue:()=>this.props.value,radioGroupDisabled:()=>this.props.disabled,radioGroupName:()=>this.props.name||"b-radio-group",selectRadio:e=>this.props.onChange?.(e)})}get classNames(){return f("b-radio-group",this.props.className)}};r(to,"template","nodexui.RadioGroup"),r(to,"props",{value:n(String),name:n(String),disabled:n(Boolean),...p,onChange:n(Function)});var eo=class extends l{get checked(){return this.env.radioGroupValue()===this.props.value}get disabled(){return this.props.disabled||this.env.radioGroupDisabled()}onChange(){this.disabled||this.env.selectRadio(this.props.value)}};r(eo,"template","nodexui.RadioGroupItem"),r(eo,"props",{value:{type:String},disabled:n(Boolean),...p});var Yl=qs("circle-question-mark"),He=class extends l{get tipText(){return Number(this.props.useTip??0)===1?this.props.supportingText:void 0}get supportingText(){return this.tipText?void 0:this.props.supportingText}onChange(e){this.props.onChange?.(e.target.checked,e)}};r(He,"template","nodexui.Switch"),r(He,"components",{IconCircleQuestionMark:Yl,Tooltip:Ot}),r(He,"props",{checked:n(Boolean),disabled:n(Boolean),supportingText:n(String),useTip:n(Number),...p,onChange:n(Function)});var so=class extends l{get classNames(){return f("b-slider",this.props.className)}onInput(e){e.target.style.setProperty("--b-slider-value",`${e.target.value}%`),this.props.onChange?.(e.target.value,e)}};r(so,"template","nodexui.Slider"),r(so,"props",{value:n([Number,String]),min:n([Number,String]),max:n([Number,String]),step:n([Number,String]),disabled:n(Boolean),className:n(String),style:n([String,Object]),onChange:n(Function)});var oo=class extends l{setup(){this.length=this.props.length||6;let e=(this.props.value||"").split("");this.state=I({digits:Array.from({length:this.length},(s,o)=>e[o]||"")}),this.rootRef=$("root")}get classNames(){return f("b-input-otp",this.props.className)}get boxes(){return this.state.digits.map((e,s)=>({index:s,value:e}))}emit(){this.props.onChange?.(this.state.digits.join(""))}onInput(e,s){let o=s.target.value.slice(-1);this.state.digits[e]=o,o&&this.rootRef.el&&[...this.rootRef.el.querySelectorAll("input")][e+1]?.focus(),this.emit()}onPaste(e){let s=e.clipboardData.getData("text").trim();if(s){e.preventDefault();for(let o=0;o<this.length;o++)this.state.digits[o]=s[o]||"";this.emit()}}};r(oo,"template","nodexui.InputOtp"),r(oo,"props",{length:n(Number),value:n(String),disabled:n(Boolean),className:n(String),style:n([String,Object]),onChange:n(Function)});function ro(t,{defaultOpen:e=!1,onOpenChange:s}={}){let o=I({open:e}),i=d=>{o.open!==d&&(o.open=d,s?.(d))},a=()=>i(!o.open),c=d=>{t.el&&!t.el.contains(d.target)&&i(!1)},u=d=>{d.key==="Escape"&&i(!1)};return yt(d=>{if(d)return document.addEventListener("click",c),document.addEventListener("keydown",u),()=>{document.removeEventListener("click",c),document.removeEventListener("keydown",u)}},()=>[o.open]),G(()=>{document.removeEventListener("click",c),document.removeEventListener("keydown",u)}),{state:o,setOpen:i,toggle:a}}var no=class extends bt{setup(){super.setup(),this.rootRef=$("root");let{state:e,setOpen:s,toggle:o}=ro(this.rootRef,{defaultOpen:ut(this.props.state)});this.disclosure=e,z({select:this.disclosure,selectValue:()=>this.props.value,selectToggle:o,selectClose:()=>s(!1),selectChoose:i=>{this.props.onChange?.(i),s(!1)}})}get outlinedClassNames(){return f(super.outlinedClassNames,"is-anchored",this.props.value&&"is-floated")}get rootStyle(){return pt(this.labelStyle,this.props.style)}get classNames(){return f("b-select",this.isOutlined&&this.outlinedClassNames,this.props.className)}};r(no,"template","nodexui.Select"),r(no,"props",{...Et,value:n(String),state:n(String),onChange:n(Function),...p});var We=class extends l{get attrs(){return{"aria-haspopup":"listbox","aria-expanded":this.env.select.open?"true":"false"}}onClick(){this.env.selectToggle()}};r(We,"template","nodexui.SelectTrigger"),r(We,"components",{Button:R}),r(We,"props",p);var io=class extends l{get open(){return this.env.select.open}};r(io,"template","nodexui.SelectContent"),r(io,"props",p);var ao=class extends l{get selected(){return this.env.selectValue()===this.props.value}onClick(){this.env.selectChoose(this.props.value)}};r(ao,"template","nodexui.SelectItem"),r(ao,"props",{value:{type:String},...p});function co(t){return[...t.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")].filter(e=>!e.disabled&&!e.hidden)}function ui(t,e){if(t.key!=="Tab")return;let s=co(e);if(!s.length){t.preventDefault();return}let o=s[0],i=s[s.length-1];t.shiftKey&&document.activeElement===o?(t.preventDefault(),i.focus()):!t.shiftKey&&document.activeElement===i&&(t.preventDefault(),o.focus())}function Bn(t,{closeSelector:e,trapFocus:s=!1}={}){let o=t.getAttribute("b-att-trigger"),i=o?document.querySelector(o):null,a=[...t.querySelectorAll(e)],c=null,u=()=>co(t),d=()=>{t.hidden&&(c=document.activeElement,t.hidden=!1,t.setAttribute("b-att-state","open"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),u()[0]?.focus(),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0})))},v=()=>{t.hidden=!0,t.setAttribute("b-att-state","closed"),c?.focus?.(),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))},S=U=>{if(U.key==="Escape"){v();return}!s||t.hidden||ui(U,t)},P=U=>{U.target===t&&v()};return i?.addEventListener("click",d),a.forEach(U=>U.addEventListener("click",v)),t.addEventListener("keydown",S),t.addEventListener("click",P),(!t.getAttribute("b-att-state")||t.getAttribute("b-att-state")==="closed")&&(t.hidden=!0),{open:d,close:v,destroy:()=>{i?.removeEventListener("click",d),a.forEach(U=>U.removeEventListener("click",v)),t.removeEventListener("keydown",S),t.removeEventListener("click",P)}}}function lo(t,e,s,o){let i=t.getAttribute("b-att-trigger"),a=i?document.querySelector(i):null,c=null,u=()=>{c=document.activeElement},d=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},v=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0})),c?.focus?.(),c=null},S=()=>e.show(),P=()=>e.hide();return t.addEventListener(`show.bs.${s}`,u),t.addEventListener(`shown.bs.${s}`,d),t.addEventListener(`hidden.bs.${s}`,v),a?.addEventListener("click",S),t.setAttribute("b-att-state","closed"),t[o]={open:S,close:P},{destroy:()=>{a?.removeEventListener("click",S),t.removeEventListener(`show.bs.${s}`,u),t.removeEventListener(`shown.bs.${s}`,d),t.removeEventListener(`hidden.bs.${s}`,v),e.dispose(),delete t[o]}}}var uo=class extends l{setup(){this.alertDialogState=I({open:at(this.props)}),z({alertDialog:this.alertDialogState,setAlertDialogOpen:e=>this.setOpen(e)}),ft(this.alertDialogState)}setOpen(e){gt(this.props,this.alertDialogState,e)}};r(uo,"template","nodexui.AlertDialog"),r(uo,"props",{open:n(Boolean),state:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),slots:n(Object)});var Ke=class extends l{get attrs(){return{"data-slot":"alert-dialog-trigger"}}onClick(){this.env.setAlertDialogOpen(!0)}};r(Ke,"template","nodexui.AlertDialogTrigger"),r(Ke,"components",{Button:R}),r(Ke,"props",p);var po=class extends l{get size(){return this.props.size==="sm"?"sm":"default"}setup(){this.rootRef=$("root"),yt(e=>{if(!e)return;let s=document.activeElement;return co(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.alertDialog.open])}get open(){return this.env.alertDialog.open}onKeyDown(e){if(e.key==="Escape"){this.env.setAlertDialogOpen(!1);return}ui(e,this.rootRef.el)}};r(po,"template","nodexui.AlertDialogContent"),r(po,"props",{...p,size:n(String)});var ho=class extends l{};r(ho,"template","nodexui.AlertDialogHeader"),r(ho,"props",p);var mo=class extends l{};r(mo,"template","nodexui.AlertDialogFooter"),r(mo,"props",p);var bo=class extends l{};r(bo,"template","nodexui.AlertDialogMedia"),r(bo,"props",p);var fo=class extends l{};r(fo,"template","nodexui.AlertDialogTitle"),r(fo,"props",p);var go=class extends l{};r(go,"template","nodexui.AlertDialogDescription"),r(go,"props",p);var Ve=class extends l{get attrs(){return{"data-slot":"alert-dialog-cancel"}}onClick(){this.env.setAlertDialogOpen(!1)}};r(Ve,"template","nodexui.AlertDialogCancel"),r(Ve,"components",{Button:R}),r(Ve,"props",p);var Ze=class extends l{get attrs(){return{"data-slot":"alert-dialog-action"}}onClick(){this.props.onClick?.(),this.env.setAlertDialogOpen(!1)}};r(Ze,"template","nodexui.AlertDialogAction"),r(Ze,"components",{Button:R}),r(Ze,"props",{...p,onClick:n(Function)});var vo=class extends l{setup(){this.drawerState=I({open:at(this.props)}),this.control={instance:null},z({drawer:this.drawerState,drawerControl:this.control,setDrawerOpen:e=>this.setOpen(e)}),ft(this.drawerState,this.control)}setOpen(e){gt(this.props,this.drawerState,e)}};r(vo,"template","nodexui.Drawer"),r(vo,"props",{open:n(Boolean),state:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),slots:n(Object)});var Ge=class extends l{onClick(){this.env.drawerControl.instance?.show()}};r(Ge,"template","nodexui.DrawerTrigger"),r(Ge,"components",{Button:R}),r(Ge,"props",p);var xo=class extends l{setup(){this.rootRef=$("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDrawerOpen(!0),this.onHidden=()=>{this.env.setDrawerOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},K(()=>{this.env.drawerControl.instance=j().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawer.open&&this.env.drawerControl.instance.show()}),G(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawerControl.instance?.dispose(),this.env.drawerControl.instance=null})}get open(){return this.env.drawer.open}};r(xo,"template","nodexui.DrawerContent"),r(xo,"props",p);var yo=class extends l{};r(yo,"template","nodexui.DrawerHeader"),r(yo,"props",p);var wo=class extends l{};r(wo,"template","nodexui.DrawerFooter"),r(wo,"props",p);var So=class extends l{};r(So,"template","nodexui.DrawerTitle"),r(So,"props",p);var Ao=class extends l{};r(Ao,"template","nodexui.DrawerDescription"),r(Ao,"props",p);var Je=class extends l{get attrs(){return{"data-bs-dismiss":"offcanvas"}}};r(Je,"template","nodexui.DrawerClose"),r(Je,"components",{Button:R}),r(Je,"props",p);var Eo=class extends l{setup(){this.sheetState=I({open:at(this.props),side:this.props.side}),this.control={instance:null},z({sheet:this.sheetState,sheetControl:this.control,setSheetOpen:e=>this.setOpen(e)}),ft(this.sheetState,this.control),nt(e=>{this.sheetState.side=e.side})}setOpen(e){gt(this.props,this.sheetState,e)}};r(Eo,"template","nodexui.Sheet"),r(Eo,"props",{open:n(Boolean),state:n(String),side:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),slots:n(Object)});var Ye=class extends l{onClick(){this.env.sheetControl.instance?.show()}};r(Ye,"template","nodexui.SheetTrigger"),r(Ye,"components",{Button:R}),r(Ye,"props",p);var Co=class extends l{setup(){this.rootRef=$("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setSheetOpen(!0),this.onHidden=()=>{this.env.setSheetOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},K(()=>{this.env.sheetControl.instance=j().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheet.open&&this.env.sheetControl.instance.show()}),G(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheetControl.instance?.dispose(),this.env.sheetControl.instance=null})}get open(){return this.env.sheet.open}get side(){return this.props.side??this.env.sheet.side}get placementClass(){return this.side==="left"?"offcanvas-start":"offcanvas-end"}};r(Co,"template","nodexui.SheetContent"),r(Co,"props",{...p,side:n(String)});var ko=class extends l{};r(ko,"template","nodexui.SheetHeader"),r(ko,"props",p);var Lo=class extends l{};r(Lo,"template","nodexui.SheetFooter"),r(Lo,"props",p);var No=class extends l{};r(No,"template","nodexui.SheetTitle"),r(No,"props",p);var To=class extends l{};r(To,"template","nodexui.SheetDescription"),r(To,"props",p);var Xe=class extends l{};r(Xe,"template","nodexui.SheetClose"),r(Xe,"components",{Button:R}),r(Xe,"props",p);var Oo=class extends l{setup(){let e=I({open:ut(this.props.state)});this.control={instance:null,bufferEl:null,lastContentHtml:null};let s=o=>{e.open!==o&&(e.open=o,this.props.onOpenChange?.(o))};z({popover:e,popoverControl:this.control,popoverSetOpen:s,popoverToggle:()=>this.control.instance?.toggle(),popoverClose:()=>this.control.instance?.hide()})}};r(Oo,"template","nodexui.Popover"),r(Oo,"props",{state:n(String),onOpenChange:n(Function),...p});var Qe=class extends l{setup(){this.rootRef={el:null},this.getRef=e=>{this.rootRef.el=e},this.onShown=()=>this.env.popoverSetOpen(!0),this.onHidden=()=>this.env.popoverSetOpen(!1),K(()=>{let e=this.env.popoverControl,s=e.bufferEl?.innerHTML??"";e.lastContentHtml=s,e.instance=new(j()).Popover(this.rootRef.el,{content:s,html:!0,trigger:"manual"}),this.rootRef.el.addEventListener("shown.bs.popover",this.onShown),this.rootRef.el.addEventListener("hidden.bs.popover",this.onHidden)}),G(()=>{this.rootRef.el.removeEventListener("shown.bs.popover",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.popover",this.onHidden),this.env.popoverControl.instance?.dispose(),this.env.popoverControl.instance=null})}get attrs(){return{"aria-haspopup":"dialog","aria-expanded":this.env.popover.open?"true":"false"}}onClick(){this.env.popoverControl.instance?.toggle()}};r(Qe,"template","nodexui.PopoverTrigger"),r(Qe,"components",{Button:R}),r(Qe,"props",p);var Io=class extends l{get style(){return pt("display:none",this.props.style)}setup(){this.bufferRef=$("buffer"),K(()=>{this.env.popoverControl.bufferEl=this.bufferRef.el}),rt(()=>{let e=this.env.popoverControl;e.bufferEl=this.bufferRef.el;let s=this.currentContentHtml();e.instance&&s!==e.lastContentHtml&&(e.lastContentHtml=s,e.instance.setContent({".popover-body":s}))})}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}};r(Io,"template","nodexui.PopoverContent"),r(Io,"props",{...p,content:n(String)});var Bo=class extends l{setup(){this.state=I({open:!1}),z({hoverCard:this.state})}open(){this.state.open=!0}close(){this.state.open=!1}onKeyDown(e){e.key==="Escape"&&this.close()}};r(Bo,"template","nodexui.HoverCard"),r(Bo,"props",{...p});var Ro=class extends l{};r(Ro,"template","nodexui.HoverCardTrigger"),r(Ro,"props",p);var Mo=class extends l{get open(){return this.env.hoverCard.open}};r(Mo,"template","nodexui.HoverCardContent"),r(Mo,"props",p);var pi={...p,disabled:n(Boolean),inset:n(Boolean),onClick:n(Function),onSelect:n(Function),variant:n(String)},fe=class extends l{setup(){this.rootRef=$("root");let e=I({open:ut(this.props.state)});this.control={instance:null};let s=a=>{e.open!==a&&(e.open=a,this.props.onOpenChange?.(a))};z({dropdownMenu:e,dropdownControl:this.control,dropdownSetOpen:s,dropdownToggle:()=>this.control.instance?.toggle(),dropdownClose:()=>this.control.instance?.hide()});let o=a=>{this.rootRef.el&&!this.rootRef.el.contains(a.target)&&this.control.instance?.hide()},i=a=>{a.key==="Escape"&&this.control.instance?.hide()};yt(a=>{if(a)return document.addEventListener("click",o),document.addEventListener("keydown",i),()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",i)}},()=>[e.open]),G(()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",i)})}};r(fe,"template","nodexui.DropdownMenu"),r(fe,"props",{state:n(String),onOpenChange:n(Function),...p});var Ut=class extends l{setup(){this.rootRef={el:null},this.onShown=()=>this.env.dropdownSetOpen(!0),this.onHidden=()=>this.env.dropdownSetOpen(!1),this.getRef=e=>{e?(this.rootRef.el=e,this.env.dropdownControl.instance=j().Dropdown.getOrCreateInstance(e),e.addEventListener("shown.bs.dropdown",this.onShown),e.addEventListener("hidden.bs.dropdown",this.onHidden)):this.rootRef.el&&(this.rootRef.el.removeEventListener("shown.bs.dropdown",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.dropdown",this.onHidden),this.env.dropdownControl.instance?.dispose(),this.env.dropdownControl.instance=null,this.rootRef.el=null)}}get classNames(){return f("btn","b-button","btn-outline-secondary","b-dropdown-menu-trigger",this.props.className)}get attrs(){return{"data-slot":"dropdown-menu-trigger","aria-haspopup":"menu","aria-expanded":this.env.dropdownMenu.open?"true":"false"}}onClick(){this.env.dropdownToggle()}};r(Ut,"template","nodexui.DropdownMenuTrigger"),r(Ut,"components",{Button:R}),r(Ut,"props",p);var ge=class extends l{get open(){return this.env.dropdownMenu.open}get classNames(){return f("b-dropdown-menu-content","dropdown-menu",this.open?"show":"",this.props.className)}};r(ge,"template","nodexui.DropdownMenuContent"),r(ge,"props",{...p,align:n(String),alignOffset:n(Number),side:n(String),sideOffset:n(Number)});var $o=class extends l{};r($o,"template","nodexui.DropdownMenuGroup"),r($o,"props",p);var _o=class extends l{};r(_o,"template","nodexui.DropdownMenuLabel"),r(_o,"props",{...p,inset:n(Boolean)});var ve=class extends l{get variant(){return this.props.variant||"default"}onClick(e){this.props.disabled||(this.props.onClick?.(e),this.props.onSelect?.(e),this.env.dropdownClose())}};r(ve,"template","nodexui.DropdownMenuItem"),r(ve,"props",pi);var ts=class extends l{onClick(e){this.props.disabled||(this.props.onCheckedChange?.(!this.props.checked,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};r(ts,"template","nodexui.DropdownMenuCheckboxItem"),r(ts,"components",{Icon:Z}),r(ts,"props",{...pi,checked:n(Boolean),onCheckedChange:n(Function)});var Uo=class extends l{setup(){z({dropdownRadio:{value:this.props.value,onValueChange:this.props.onValueChange}})}};r(Uo,"template","nodexui.DropdownMenuRadioGroup"),r(Uo,"props",{...p,value:n(String),onValueChange:n(Function)});var es=class extends l{get checked(){return this.env.dropdownRadio?.value===this.props.value}onClick(e){this.props.disabled||(this.env.dropdownRadio?.onValueChange?.(this.props.value,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};r(es,"template","nodexui.DropdownMenuRadioItem"),r(es,"components",{Icon:Z}),r(es,"props",{...pi,value:n(String)});var Po=class extends l{};r(Po,"template","nodexui.DropdownMenuSeparator"),r(Po,"props",p);var qo=class extends l{};r(qo,"template","nodexui.DropdownMenuShortcut"),r(qo,"props",p);var xe=class extends l{setup(){this.rootRef=$("root");let{state:e,setOpen:s,toggle:o}=ro(this.rootRef);z({dropdownSub:e,dropdownSubToggle:o,dropdownSubOpen:()=>s(!0),dropdownSubClose:()=>s(!1)})}};r(xe,"template","nodexui.DropdownMenuSub"),r(xe,"props",p);var Pt=class extends l{onMouseEnter(){this.props.disabled||this.env.dropdownSubOpen()}onClick(){this.props.disabled||this.env.dropdownSubToggle()}};r(Pt,"template","nodexui.DropdownMenuSubTrigger"),r(Pt,"components",{Icon:Z}),r(Pt,"props",{...p,disabled:n(Boolean),inset:n(Boolean)});var ye=class extends l{get open(){return this.env.dropdownSub.open}};r(ye,"template","nodexui.DropdownMenuSubContent"),r(ye,"props",p);var Do=class extends l{setup(){this.state=I({open:!1,x:0,y:0});let e=()=>{this.state.open=!1};this.close=e,z({contextMenu:this.state,contextMenuOpenAt:(s,o)=>{this.state.open=!0,this.state.x=s,this.state.y=o},contextMenuClose:e}),document.addEventListener("click",e),G(()=>document.removeEventListener("click",e))}};r(Do,"template","nodexui.ContextMenu"),r(Do,"props",{className:n(String),slots:n(Object)});var jo=class extends l{onContextMenu(e){e.preventDefault(),this.env.contextMenuOpenAt(e.clientX,e.clientY)}};r(jo,"template","nodexui.ContextMenuTrigger"),r(jo,"props",p);var Fo=class extends l{setup(){this.rootRef=$("root")}get open(){return this.env.contextMenu.open}get style(){return pt(`left:${this.env.contextMenu.x}px;top:${this.env.contextMenu.y}px`,this.props.style)}};r(Fo,"template","nodexui.ContextMenuContent"),r(Fo,"props",p);var zo=class extends l{onClick(){this.props.onClick?.(),this.env.contextMenuClose()}};r(zo,"template","nodexui.ContextMenuItem"),r(zo,"props",{...p,onClick:n(Function)});var Xl={"top-left":["top-0","start-0"],"top-right":["top-0","end-0"],"bottom-left":["bottom-0","start-0"],"bottom-right":["bottom-0","end-0"]};function Rn(t){let e=Xl[t];return e?["toast-container","position-fixed","p-3","pe-auto",...e]:null}var qt=class extends l{setup(){this.state=I({open:at(this.props)}),this.rootRef=$("root"),this.bootstrapToast=null,this.handleShown=()=>{this.state.open=!0},this.handleHidden=()=>{this.state.open=!1,this.props.onOpenChange?.(!1)},K(()=>{this.mountBootstrapToast(this.props.delay),this.state.open&&this.bootstrapToast.show()}),nt(e=>{let s=Ue(e)?at(e):this.state.open;e.delay!==this.props.delay?(this.bootstrapToast?.dispose(),this.mountBootstrapToast(e.delay),s&&this.bootstrapToast.show()):s!==this.state.open&&(s?this.bootstrapToast?.show():this.bootstrapToast?.hide())}),G(()=>{this.bootstrapToast?.dispose()})}mountBootstrapToast(e){let s=this.rootRef.el,o=e??3e3;this.bootstrapToast=new(j()).Toast(s,{autohide:o>0,delay:o||3e3}),s.addEventListener("shown.bs.toast",this.handleShown),s.addEventListener("hidden.bs.toast",this.handleHidden)}get classNames(){return f("toast","fade","b-toast",Rn(this.props.position),this.props.className)}get role(){return this.props.variant==="danger"?"alert":"status"}get hasActionSlot(){return!!this.props.slots?.action}close(){this.bootstrapToast?.hide()}};r(qt,"template","nodexui.Toast"),r(qt,"components",{Button:R}),r(qt,"props",{open:n(Boolean),state:n(String),variant:n(String),delay:n(Number),position:n(String),...p,onOpenChange:n(Function)});var Ho=class extends l{setup(){this.state=I({open:new Set}),z({accordion:this.state,accordionToggle:e=>this.toggle(e)})}toggle(e){let s=!this.state.open.has(e);this.props.multiple||this.state.open.clear(),s?this.state.open.add(e):this.state.open.delete(e),this.props.onChange?.(s)}};r(Ho,"template","nodexui.Accordion"),r(Ho,"props",{multiple:n(Boolean),onChange:n(Function),...p});var Wo=class extends l{setup(){z({accordionItemState:this.props.state,accordionItemValue:this.props.value})}};r(Wo,"template","nodexui.AccordionItem"),r(Wo,"props",{value:{type:String},state:n(String),...p});var ss=class extends l{get open(){return this.env.accordionItemState!==void 0?ut(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}get triggerAttrs(){return{"data-slot":"accordion-trigger","aria-expanded":this.open?"true":"false"}}onClick(){this.env.accordionToggle(this.env.accordionItemValue)}};r(ss,"template","nodexui.AccordionTrigger"),r(ss,"components",{Icon:Z,Button:R}),r(ss,"props",p);var Ko=class extends l{setup(){this.rootRef=$("root"),this.initialOpen=this.open,In(this.rootRef,()=>this.open)}get open(){return this.env.accordionItemState!==void 0?ut(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}};r(Ko,"template","nodexui.AccordionContent"),r(Ko,"props",p);var Vo=class extends l{setup(){this.state=I({open:at(this.props)}),z({collapsible:this.state,collapsibleToggle:()=>this.toggle()}),ft(this.state)}toggle(){let e=!this.state.open;gt(this.props,this.state,e)}};r(Vo,"template","nodexui.Collapsible"),r(Vo,"props",{open:n(Boolean),state:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),...p});var os=class extends l{get attrs(){return{"aria-expanded":this.env.collapsible.open?"true":"false"}}onClick(){this.env.collapsibleToggle()}};r(os,"template","nodexui.CollapsibleTrigger"),r(os,"components",{Button:R}),r(os,"props",p);var Zo=class extends l{setup(){this.rootRef=$("root"),this.initialOpen=this.open,In(this.rootRef,()=>this.open)}get open(){return this.env.collapsible.open}};r(Zo,"template","nodexui.CollapsibleContent"),r(Zo,"props",p);var we=class extends l{};r(we,"template","nodexui.Breadcrumb"),r(we,"props",{...p});var Se=class extends l{};r(Se,"template","nodexui.BreadcrumbList"),r(Se,"props",{...p});var Ae=class extends l{get classNames(){return f("b-breadcrumb-item",this.props.current&&"b-breadcrumb-page",this.props.className)}};r(Ae,"template","nodexui.BreadcrumbItem"),r(Ae,"props",{current:n(Boolean),...p});var Ee=class extends l{get classNames(){return f("b-breadcrumb-link",this.props.className)}onClick(e){this.props.onClick?.(e)}};r(Ee,"template","nodexui.BreadcrumbLink"),r(Ee,"props",{href:n(String),target:n(String),rel:n(String),...p,onClick:n(Function)});var Ce=class extends l{get classNames(){return f("b-breadcrumb-page",this.props.className)}};r(Ce,"template","nodexui.BreadcrumbPage"),r(Ce,"props",{...p});var Dt=class extends l{get classNames(){return f("b-breadcrumb-separator",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};r(Dt,"template","nodexui.BreadcrumbSeparator"),r(Dt,"components",{Icon:Z}),r(Dt,"props",{...p});var rs=class extends l{get classNames(){return f("b-breadcrumb-ellipsis",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};r(rs,"template","nodexui.BreadcrumbEllipsis"),r(rs,"components",{Icon:Z}),r(rs,"props",{...p});var Go=class extends l{get classNames(){return f("b-pagination",this.props.className)}};r(Go,"template","nodexui.Pagination"),r(Go,"props",{...p});var Jo=class extends l{get classNames(){return f("page-item",this.props.current&&"active",this.props.disabled&&"disabled")}onClick(){this.props.disabled||this.props.onClick?.()}};r(Jo,"template","nodexui.PaginationItem"),r(Jo,"props",{current:n(Boolean),disabled:n(Boolean),style:n([String,Object]),onClick:n(Function),slots:n(Object)});var Yo=class extends l{setup(){this.rootRef=$("root")}onKeyDown(e){let s=[...this.rootRef.el.querySelectorAll("a, button")].filter(a=>!a.disabled),o=s.indexOf(e.target),i=e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;!i||o<0||(e.preventDefault(),s[(o+i+s.length)%s.length]?.focus())}};r(Yo,"template","nodexui.NavigationMenu"),r(Yo,"props",{...p});var Xo=class extends l{};r(Xo,"template","nodexui.NavigationMenuItem"),r(Xo,"props",{href:n(String),...p});var Qo=class extends l{get classNames(){return f("b-menubar",this.props.className)}};r(Qo,"template","nodexui.Menubar"),r(Qo,"props",{...p});var aa={...p,href:n(String)},Ql="(max-width: 991.98px)",ca=()=>!!globalThis.matchMedia?.(Ql).matches;function la(t){ca()&&t.setSidebarOpen?.(!1)}var Ft=class extends l{setup(){this.state=I({open:at(this.props)}),z({sidebar:this.state,setSidebarOpen:e=>this.setOpen(e)}),ft(this.state)}setOpen(e){gt(this.props,this.state,e)}get sidebarState(){return this.state.open?"expanded":"collapsed"}get side(){return this.props.side||"left"}get variant(){return this.props.variant||"sidebar"}get collapsible(){return this.props.collapsible||"offcanvas"}get classNames(){return f("b-sidebar-root",this.props.className)}onKeyDown(e){e.key==="Escape"&&this.setOpen(!1)}};r(Ft,"template","nodexui.Sidebar"),r(Ft,"props",{open:n(Boolean),state:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),side:n(String),variant:n(String),collapsible:n(String),...p});var fn=class extends Ft{};r(fn,"template","nodexui.Sidebar");var ns=class extends l{onClick(){if(this.env.setShellCollapsed&&!ca()){this.env.setShellCollapsed(!this.env.shell.collapsed);return}this.env.setSidebarOpen(!this.env.sidebar.open)}};r(ns,"template","nodexui.SidebarTrigger"),r(ns,"components",{Icon:Z,Button:R}),r(ns,"props",{...p,icon:n(String),label:n(String)});var ke=class extends l{get open(){return this.env.sidebar.open}};r(ke,"template","nodexui.SidebarContent"),r(ke,"props",p);var tr=class extends l{};r(tr,"template","nodexui.SidebarHeader"),r(tr,"props",p);var er=class extends l{};r(er,"template","nodexui.SidebarFooter"),r(er,"props",p);var sr=class extends l{};r(sr,"template","nodexui.SidebarInset"),r(sr,"props",p);var is=class extends l{onClick(){this.env.setSidebarOpen(!this.env.sidebar.open)}};r(is,"template","nodexui.SidebarRail"),r(is,"components",{Button:R}),r(is,"props",p);var or=class extends l{};r(or,"template","nodexui.SidebarInput"),r(or,"props",{className:n(String),style:n([String,Object]),placeholder:n(String),value:n(String),type:n(String)});var rr=class extends l{};r(rr,"template","nodexui.SidebarSeparator"),r(rr,"props",p);var as=class extends l{onClick(){this.env.setSidebarOpen(!1)}};r(as,"template","nodexui.SidebarClose"),r(as,"components",{Icon:Z,Button:R}),r(as,"props",{...p,icon:n(String),label:n(String)});var Le=class extends l{};r(Le,"template","nodexui.SidebarGroup"),r(Le,"props",{muted:n(Boolean),...p});var Ne=class extends l{};r(Ne,"template","nodexui.SidebarGroupLabel"),r(Ne,"props",aa);var cs=class extends l{get ariaLabel(){return X(this.props,"aria-label","ariaLabel")}};r(cs,"template","nodexui.SidebarGroupAction"),r(cs,"components",{Button:R}),r(cs,"props",{icon:n(String),"aria-label":n(String),ariaLabel:n(String),onClick:n(Function),...p});var nr=class extends l{};r(nr,"template","nodexui.SidebarGroupContent"),r(nr,"props",p);var ls=class extends l{setup(){let e=this.props["default-open"]!==void 0||this.props.defaultOpen!==void 0;this.state=I({open:Ue(this.props)||e?at(this.props):!0}),ft(this.state)}get open(){return this.state.open}toggle(){let e=!this.state.open;gt(this.props,this.state,e)}};r(ls,"template","nodexui.SidebarGroupCollapsible"),r(ls,"components",{Icon:Z,Button:R}),r(ls,"props",{label:{type:String},open:n(Boolean),state:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),...p});var zt=class extends l{};r(zt,"template","nodexui.SidebarMenu"),r(zt,"props",p);var Te=class extends l{};r(Te,"template","nodexui.SidebarMenuItem"),r(Te,"props",p);var jt=class extends l{get classNames(){return f("b-sidebar-menu-button",this.isActive&&"is-active",this.props.variant&&`is-${this.props.variant}`,this.props.size&&`is-${this.props.size}`,this.props.className)}get isActive(){return this.props.active||this.props.isActive}onClick(e){this.props.onClick?.(e),la(this.env)}};r(jt,"template","nodexui.SidebarMenuButton"),r(jt,"components",{Icon:Z,Button:R}),r(jt,"props",{href:n(String),icon:n(String),active:n(Boolean),isActive:n(Boolean),variant:n(String),size:n(String),tooltip:n(String),disabled:n(Boolean),onClick:n(Function),...p});var us=class extends l{get ariaLabel(){return X(this.props,"aria-label","ariaLabel")}};r(us,"template","nodexui.SidebarMenuAction"),r(us,"components",{Button:R}),r(us,"props",{icon:n(String),"aria-label":n(String),ariaLabel:n(String),showOnHover:n(Boolean),onClick:n(Function),...p});var ir=class extends l{};r(ir,"template","nodexui.SidebarMenuSub"),r(ir,"props",p);var ar=class extends l{};r(ar,"template","nodexui.SidebarMenuBadge"),r(ar,"props",p);var cr=class extends l{setup(){this.state=I({width:this.props.width||`${Math.floor(Math.random()*40)+50}%`})}get style(){return pt(`--b-sidebar-skeleton-width:${this.state.width}`,this.props.style)}};r(cr,"template","nodexui.SidebarMenuSkeleton"),r(cr,"props",{showIcon:n(Boolean),width:n(String),className:n(String),style:n([String,Object])});var lr=class extends l{};r(lr,"template","nodexui.SidebarMenuSubItem"),r(lr,"props",p);var ps=class extends l{get classNames(){return f("b-sidebar-menu-sub-button",(this.props.active||this.props.isActive)&&"is-active",this.props.size&&`is-${this.props.size}`,this.props.className)}onClick(e){this.props.onClick?.(e),la(this.env)}};r(ps,"template","nodexui.SidebarMenuSubButton"),r(ps,"components",{Button:R}),r(ps,"props",{...aa,active:n(Boolean),isActive:n(Boolean),size:n(String),onClick:n(Function)});var ds=class extends l{setup(){this.state=I({collapsed:this.props.collapsed??this.props.defaultCollapsed??!1,authState:this.props.authState??null}),z({shell:this.state,setShellCollapsed:e=>this.setCollapsed(e)}),nt(e=>{e.collapsed!==void 0&&(this.state.collapsed=e.collapsed),this.state.authState=e.authState??null})}setCollapsed(e){this.props.collapsed===void 0&&(this.state.collapsed=e),this.props.onCollapsedChange?.(e)}dismissToast(){this.props.onToastOpenChange?.(!1)}runToastAction(){this.props.toast?.onAction?.()}};r(ds,"template","nodexui.Shell"),r(ds,"components",{Sidebar:Ft,Toast:qt,Button:R}),r(ds,"props",{open:n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),collapsed:n(Boolean),defaultCollapsed:n(Boolean),onCollapsedChange:n(Function),authState:n(Object),toast:n(Object),onToastOpenChange:n(Function),notificationPage:n(Function),pwa:n(Function),...p});var hs=class extends l{};r(hs,"template","nodexui.ShellSidebar"),r(hs,"components",{SidebarContent:ke}),r(hs,"props",p);var ur=class extends l{};r(ur,"template","nodexui.ShellSidebarHeader"),r(ur,"props",p);var pr=class extends l{};r(pr,"template","nodexui.ShellNav"),r(pr,"props",p);var dr=class extends l{};r(dr,"template","nodexui.ShellMain"),r(dr,"props",p);var hr=class extends l{};r(hr,"template","nodexui.ShellHeader"),r(hr,"props",p);var ms=class extends l{};r(ms,"template","nodexui.ShellContent"),r(ms,"components",{Skeleton:de}),r(ms,"props",{loading:n(Boolean),...p});var bs=class extends l{get authState(){return this.env.shell.authState}logout(){this.authState?.onLogout?.()}};r(bs,"template","nodexui.ShellUserMenu"),r(bs,"components",{Button:R}),r(bs,"props",p);var mr=class extends l{get classNames(){return f("table","b-table",this.props.striped!==!1&&"table-striped",this.props.hover!==!1&&"table-hover",this.props.className)}};r(mr,"template","nodexui.Table"),r(mr,"props",{striped:n(Boolean),hover:n(Boolean),responsive:n(Boolean),...p});var di=[],tu=new Intl.Collator,fs=4,gs=8,eu=32,vs=class extends l{setup(){this.state=I({query:"",sortKey:null,sortDir:1,page:0,pageSize:this.initialPageSize,selectedKeys:[],hiddenColumns:this.columns.filter(e=>e.hidden||e.visible===!1).map(e=>e.key),columnsOpen:!1,actionRowKey:null,actionMenuStyle:null}),this.actionsMenuRef=$("actionsMenu"),this.actionsMenuTriggerEl=null,Us(window,"click",this.onWindowClick,!0),Us(window,"keydown",this.onWindowKeydown),Us(window,"resize",this.closeRowActions),Us(window,"scroll",this.closeRowActions,!0),rt(()=>this.refreshActionsMenuPosition()),ri(()=>{this.visibleRowsCache=null})}get columns(){return this.props.columns??di}get rows(){return this.props.rows??di}get initialPageSize(){return X(this.props,"page-size","pageSize")??10}get pageSizeOptions(){return X(this.props,"page-size-options","pageSizeOptions")??[10,20,50,80]}get rowActions(){return X(this.props,"row-actions","rowActions")??di}get variant(){return this.props.variant||"default"}get classNames(){return f("b-data-table",`b-data-table-${this.variant}`,this.props.className)}get viewportStyle(){let e=X(this.props,"max-height","maxHeight");return e?`max-height: ${typeof e=="number"?`${e}px`:e};`:""}get hasSearch(){return this.props.searchable!==!1}get hasSorting(){return this.props.sortable!==!1}get hasPagination(){return this.props.pagination!==!1}get hasColumnToggle(){return X(this.props,"column-toggle","columnToggle")??!0}get hasToolbarActions(){return!!this.props.slots?.toolbarActions}get hasSelection(){return this.props.selectable??!1}get visibleColumns(){return this.columns.filter(e=>!this.state.hiddenColumns.includes(e.key))}get visibleRows(){let{query:e,sortKey:s,sortDir:o}=this.state,{rows:i,columns:a}=this,c=this.visibleRowsCache;if(c&&c.rows===i&&c.columns===a&&c.query===e&&c.sortKey===s&&c.sortDir===o)return c.result;let u=e.toLowerCase(),d=a.filter(P=>P.filterable===!0),v=(d.length?d:a).map(P=>P.key),S=i.filter(P=>!u||v.some(U=>String(P[U]).toLowerCase().includes(u)));return s&&(S=[...S].sort((P,U)=>tu.compare(String(P[s]),String(U[s]))*o)),this.visibleRowsCache={rows:i,columns:a,query:e,sortKey:s,sortDir:o,result:S},S}get pageCount(){return Math.max(1,Math.ceil(this.visibleRows.length/this.state.pageSize))}get pageRows(){if(!this.hasPagination)return this.visibleRows;let s=Math.min(this.state.page,this.pageCount-1)*this.state.pageSize;return this.visibleRows.slice(s,s+this.state.pageSize)}get selectedCount(){return this.state.selectedKeys.length}get selectionLabel(){return`${this.selectedCount} of ${this.visibleRows.length} row(s) selected.`}get emptyLabel(){return X(this.props,"empty-label","emptyLabel")??"No results."}get filterPlaceholder(){return X(this.props,"filter-placeholder","filterPlaceholder")??"Filter rows..."}get canPreviousPage(){return this.hasPagination&&this.state.page>0}get canNextPage(){return this.hasPagination&&this.state.page<this.pageCount-1}get pageLabel(){return`Page ${Math.min(this.state.page,this.pageCount-1)+1} of ${this.pageCount}`}rowKey(e,s){return e.id??e.key??s}isSelected(e,s){return this.state.selectedKeys.includes(this.rowKey(e,s))}isColumnSortable(e){return this.hasSorting&&e.sortable===!0}onSearchInput(e){this.state.query=e.target.value,this.state.page=0}sortBy(e){let s=this.columns.find(o=>o.key===e);!s||!this.isColumnSortable(s)||(this.state.sortKey===e?this.state.sortDir=-this.state.sortDir:(this.state.sortKey=e,this.state.sortDir=1))}sortIcon(e){return this.state.sortKey!==e?"arrow-up-down":this.state.sortDir===1?"arrow-up":"arrow-down"}toggleColumn(e){this.state.hiddenColumns.includes(e)?this.state.hiddenColumns=this.state.hiddenColumns.filter(s=>s!==e):this.state.hiddenColumns=[...this.state.hiddenColumns,e]}toggleColumnsMenu(){this.state.columnsOpen=!this.state.columnsOpen}toggleRowActions(e,s,o){let i=this.rowKey(e,s);if(this.state.actionRowKey===i){this.closeRowActions();return}this.actionsMenuTriggerEl=o.currentTarget,this.state.actionRowKey=i,this.state.actionMenuStyle=this.estimateActionMenuStyle(o.currentTarget)}closeRowActions(){this.state.actionRowKey!==null&&(this.state.actionRowKey=null,this.state.actionMenuStyle=null,this.actionsMenuTriggerEl=null)}get openRowAction(){if(this.state.actionRowKey===null)return null;let e=this.pageRows.findIndex((s,o)=>this.rowKey(s,o)===this.state.actionRowKey);return e===-1?null:{row:this.pageRows[e],index:e}}estimateActionMenuStyle(e){let s=e.getBoundingClientRect(),o=this.rowActions.length*eu+fs*2,i=window.innerHeight-s.bottom,c=i<o+fs&&s.top>i?Math.max(gs,s.top-fs-o):s.bottom+fs,u=Math.min(Math.max(gs,s.right-160),window.innerWidth-160-gs);return`position: fixed; top: ${Math.round(c)}px; left: ${Math.round(u)}px;`}refreshActionsMenuPosition(){if(this.state.actionRowKey===null||!this.actionsMenuTriggerEl)return;let e=this.actionsMenuRef.el;if(!e)return;let s=this.actionsMenuTriggerEl.getBoundingClientRect(),o=e.getBoundingClientRect(),i=window.innerHeight-s.bottom,a=s.top,u=i<o.height+fs&&a>i?Math.max(gs,s.top-fs-o.height):Math.min(s.bottom+fs,window.innerHeight-o.height-gs),d=Math.min(Math.max(gs,s.right-o.width),window.innerWidth-o.width-gs),v=`position: fixed; top: ${Math.round(u)}px; left: ${Math.round(d)}px;`;this.state.actionMenuStyle!==v&&(this.state.actionMenuStyle=v)}onWindowClick(e){this.state.actionRowKey===null||this.actionsMenuRef.el?.contains(e.target)||this.actionsMenuTriggerEl?.contains(e.target)||this.closeRowActions()}onWindowKeydown(e){e.key==="Escape"&&this.closeRowActions()}setPage(e){this.state.page=Math.max(0,Math.min(e,this.pageCount-1))}setPageSize(e){this.state.pageSize=Number(e),this.state.page=0}optionValue(e){return`${e}`}toggleRow(e,s,o){let i=this.rowKey(e,s);this.state.selectedKeys=o?[...new Set([...this.state.selectedKeys,i])]:this.state.selectedKeys.filter(a=>a!==i),this.props.onSelectionChange?.(this.state.selectedKeys)}toggleAllVisible(e){let s=this.pageRows.map((o,i)=>this.rowKey(o,i));this.state.selectedKeys=e?[...new Set([...this.state.selectedKeys,...s])]:this.state.selectedKeys.filter(o=>!s.includes(o)),this.props.onSelectionChange?.(this.state.selectedKeys)}onAction(e,s,o){e.onSelect?.(s,o),this.props.onRowAction?.(e,s,o),this.closeRowActions()}columnLabel(e){return e.label??e.key}cellValue(e,s){let o=e[s.key];if(s.format==="currency"){let i=Number(o);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(Number.isFinite(i)?i:0)}if(s.format==="capitalize"){let i=String(o??"");return i.charAt(0).toUpperCase()+i.slice(1)}return o??""}cellComponentProps(e,s){return s.componentProps?s.componentProps(e,s):{row:e,column:s,value:e[s.key]}}};r(vs,"template","nodexui.DataTable"),r(vs,"components",{Button:R,Icon:Z}),r(vs,"props",{columns:n(Array),rows:n(Array),variant:n(String),searchable:n(Boolean),sortable:n(Boolean),pagination:n(Boolean),selectable:n(Boolean),"column-toggle":n(Boolean),columnToggle:n(Boolean),"row-actions":n(Array),rowActions:n(Array),"page-size":n(Number),pageSize:n(Number),"page-size-options":n(Array),pageSizeOptions:n(Array),"filter-placeholder":n(String),filterPlaceholder:n(String),"empty-label":n(String),emptyLabel:n(String),onRowAction:n(Function),onSelectionChange:n(Function),...p,"max-height":n([String,Number]),maxHeight:n([String,Number])});var su=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}),ou=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],xs=class extends l{get baseDate(){return this.props.selected?new Date(`${this.props.selected}T00:00:00`):new Date}get month0(){return(this.props.month??this.baseDate.getMonth()+1)-1}get year(){return this.props.year??this.baseDate.getFullYear()}get headerLabel(){return su.format(new Date(this.year,this.month0,1))}get weekdays(){return ou}get days(){let e=new Date(this.year,this.month0+1,0).getDate(),s=new Date(this.year,this.month0,1).getDay(),o=[];for(let i=0;i<s;i++)o.push(null);for(let i=1;i<=e;i++){let a=`${this.year}-${String(this.month0+1).padStart(2,"0")}-${String(i).padStart(2,"0")}`;o.push({day:i,value:a,selected:a===this.props.selected})}return o}onSelect(e){this.props.onChange?.(e)}};r(xs,"template","nodexui.Calendar"),r(xs,"components",{Button:R}),r(xs,"props",{selected:n(String),month:n(Number),year:n(Number),className:n(String),style:n([String,Object]),onChange:n(Function)});var br=class extends bt{get classNames(){return f("b-date-picker","form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onChange?.(e.target.value,e)}};r(br,"template","nodexui.DatePicker"),r(br,"props",{...Et,value:n(String),className:n(String),style:n([String,Object]),onChange:n(Function)});var fr=class extends bt{setup(){super.setup(),this.rootRef=$("root");let{state:e}=ro(this.rootRef);this.disclosure=e,this.state=I({query:this.selectedLabel})}get classNames(){return f("form-control",this.controlClass,this.isInvalid&&"is-invalid")}get selectedLabel(){return this.props.options.find(e=>e.value===this.props.value)?.label||""}get filteredOptions(){let e=this.state.query.toLowerCase();return this.props.options.filter(s=>s.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value,this.disclosure.open=!0}onFocus(){this.disclosure.open=!0}choose(e){this.state.query=e.label,this.disclosure.open=!1,this.props.onChange?.(e.value)}};r(fr,"template","nodexui.Combobox"),r(fr,"props",{options:{type:Array},...Et,value:n(String),className:n(String),style:n([String,Object]),id:n(String),onChange:n(Function)});var gr=class extends l{setup(){this.state=I({query:""})}get filteredItems(){let e=this.state.query.toLowerCase();return this.props.items.filter(s=>s.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value}select(e){this.props.onSelect?.(e.value)}};r(gr,"template","nodexui.Command"),r(gr,"props",{items:{type:Array},placeholder:n(String),className:n(String),style:n([String,Object]),onSelect:n(Function)});var vr=class extends l{get classNames(){return f("b-chart",this.props.type&&`b-chart-${this.props.type}`,this.props.variant&&`b-chart-${this.props.variant}`,this.props.className)}};r(vr,"template","nodexui.Chart"),r(vr,"props",{config:n([String,Object]),label:n(String),type:n(String),value:n([String,Number]),variant:n(String),...p});var xr=class extends l{setup(){this.state=I({index:this.props.defaultIndex??0}),this.rootRef=$("root"),this.bootstrapCarousel=null,this.onSlid=e=>{this.state.index=e.to,this.props.onChange?.(this.state.index)},z({carousel:this.state,carouselInstance:()=>this.bootstrapCarousel}),K(()=>{this.bootstrapCarousel=new(j()).Carousel(this.rootRef.el,{interval:!1,wrap:!0,touch:!0}),this.rootRef.el.addEventListener("slid.bs.carousel",this.onSlid)}),G(()=>{this.rootRef.el.removeEventListener("slid.bs.carousel",this.onSlid),this.bootstrapCarousel?.dispose()})}};r(xr,"template","nodexui.Carousel"),r(xr,"props",{slideCount:{type:Number},defaultIndex:n(Number),onChange:n(Function),...p});var yr=class extends l{setup(){this.rootRef=$("root"),this.initialActive=this.active,rt(()=>{if(!this.rootRef.el)return;let e=this.rootRef.el.classList.contains("active");this.active&&!e?this.rootRef.el.classList.add("active"):!this.active&&e&&this.rootRef.el.classList.remove("active")})}get active(){return this.props.state!==void 0?ut(this.props.state):this.env.carousel.index===this.props.index}};r(yr,"template","nodexui.CarouselSlide"),r(yr,"props",{index:{type:Number},state:n(String),...p});var ys=class extends l{onClick(){this.env.carouselInstance()?.prev()}};r(ys,"template","nodexui.CarouselPrevious"),r(ys,"components",{Button:R}),r(ys,"props",p);var ws=class extends l{onClick(){this.env.carouselInstance()?.next()}};r(ws,"template","nodexui.CarouselNext"),r(ws,"components",{Button:R}),r(ws,"props",p);var wr=class extends l{setup(){this.panelRef=$("panel"),this.state=I({width:null})}get panelStyle(){return this.state.width?`width:${this.state.width}px`:""}onPointerDown(e){let s=e.clientX,o=this.panelRef.el.getBoundingClientRect().width,i=this.props.min||160,a=this.props.max||720,c=d=>{this.state.width=Math.min(a,Math.max(i,o+d.clientX-s))},u=()=>{document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",u),this.props.onChange?.(this.state.width)};document.addEventListener("pointermove",c),document.addEventListener("pointerup",u)}};r(wr,"template","nodexui.Resizable"),r(wr,"props",{min:n(Number),max:n(Number),onChange:n(Function),...p});var Sr=class extends l{get classNames(){return f("b-scroll-area",this.props.className)}};r(Sr,"template","nodexui.ScrollArea"),r(Sr,"props",p);var ua={idle:"b-attachment-idle",uploading:"b-attachment-uploading",processing:"b-attachment-processing",error:"b-attachment-error",done:"b-attachment-done"},pa={default:"b-attachment-default",sm:"b-attachment-sm",xs:"b-attachment-xs"},Ar=class extends l{get state(){return ua[this.props.state]?this.props.state:"done"}get size(){return pa[this.props.size]?this.props.size:"default"}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return f("b-attachment",ua[this.state],pa[this.size],`b-attachment-${this.orientation}`,!this.hasContent&&"b-attachment-picker",this.props.className)}get hasContent(){return!!this.props.slots?.default}onChange(e){this.props.onChange?.([...e.target.files])}};r(Ar,"template","nodexui.Attachment"),r(Ar,"props",{state:n(String),size:n(String),orientation:n(String),multiple:n(Boolean),...p,onChange:n(Function)});var Er=class extends l{get variant(){return this.props.variant==="image"?"image":"icon"}get classNames(){return f("b-attachment-media",`b-attachment-media-${this.variant}`,this.props.className)}};r(Er,"template","nodexui.AttachmentMedia"),r(Er,"props",{variant:n(String),...p});var Cr=class extends l{};r(Cr,"template","nodexui.AttachmentContent"),r(Cr,"props",p);var kr=class extends l{};r(kr,"template","nodexui.AttachmentTitle"),r(kr,"props",p);var Lr=class extends l{};r(Lr,"template","nodexui.AttachmentDescription"),r(Lr,"props",p);var Nr=class extends l{};r(Nr,"template","nodexui.AttachmentActions"),r(Nr,"props",p);var Ss=class extends l{get variant(){return this.props.variant||"ghost"}get size(){return this.props.size||"icon-xs"}get className(){return f("b-button-icon","b-attachment-action",this.props.className)}get ariaLabel(){return X(this.props,"aria-label","ariaLabel")}onClick(e){this.props.onClick?.(e)}};r(Ss,"template","nodexui.AttachmentAction"),r(Ss,"components",{Button:R}),r(Ss,"props",{type:n(String),variant:n(String),size:n(String),disabled:n(Boolean),label:n(String),...p,"aria-label":n(String),ariaLabel:n(String),onClick:n(Function)});var As=class extends l{get classNames(){return f("b-attachment-trigger",this.props.className)}get ariaLabel(){return X(this.props,"aria-label","ariaLabel")}onClick(e){this.props.onClick?.(e)}};r(As,"template","nodexui.AttachmentTrigger"),r(As,"components",{Button:R}),r(As,"props",{href:n(String),target:n(String),rel:n(String),type:n(String),className:n(String),style:n([String,Object]),"aria-label":n(String),ariaLabel:n(String),onClick:n(Function)});var Tr=class extends l{get classNames(){return f("b-attachment-group",this.props.className)}};r(Tr,"template","nodexui.AttachmentGroup"),r(Tr,"props",{...p});var Or=class extends l{setup(){this.state=I({dragging:!1}),this.fileInput=$("fileInput")}get hasContent(){return!!this.props.slots?.default}get classNames(){return f("b-attachment-dropzone",this.state.dragging&&"b-attachment-dropzone-dragging",this.props.disabled&&"b-attachment-dropzone-disabled",this.props.className)}openPicker(){this.props.disabled||this.fileInput.el?.click()}onInputChange(e){let s=Array.from(e.target.files??[]);e.target.value="",s.length&&this.props.onFilesSelected?.(s)}onDragOver(e){e.preventDefault(),!this.props.disabled&&(this.state.dragging=!0)}onDragLeave(){this.state.dragging=!1}onDrop(e){if(e.preventDefault(),this.state.dragging=!1,this.props.disabled)return;let s=Array.from(e.dataTransfer?.files??[]);s.length&&this.props.onFilesSelected?.(s)}};r(Or,"template","nodexui.AttachmentDropzone"),r(Or,"props",{multiple:n(Boolean),disabled:n(Boolean),...p,onFilesSelected:n(Function)});var Ir=class extends l{setup(){this.state=I({errored:!1})}get showImage(){return!!this.props.src&&!this.state.errored}onError(){this.state.errored=!0}};r(Ir,"template","nodexui.Avatar"),r(Ir,"props",{src:n(String),alt:n(String),title:n(String),...p});var Br=class extends l{get classNames(){return f("b-message",this.props.className)}get side(){return this.props.side||"incoming"}};r(Br,"template","nodexui.Message"),r(Br,"props",{side:n(String),...p});var Rr=class extends l{setup(){this.rootRef=$("root"),yt(()=>{this.props.autoscroll!==!1&&this.rootRef.el&&(this.rootRef.el.scrollTop=this.rootRef.el.scrollHeight)})}};r(Rr,"template","nodexui.MessageScroller"),r(Rr,"props",{autoscroll:n(Boolean),...p});var Mr=class extends l{setup(){this.state=I({index:0}),z({questionnaire:this.state,questionnaireShow:e=>this.show(e)})}show(e){this.state.index=Math.min(this.props.stepCount-1,Math.max(0,e)),this.props.onChange?.(this.state.index)}};r(Mr,"template","nodexui.Questionnaire"),r(Mr,"props",{stepCount:{type:Number},onChange:n(Function),...p});var $r=class extends l{get active(){return this.props.state!==void 0?ut(this.props.state):this.env.questionnaire.index===this.props.index}};r($r,"template","nodexui.QuestionnaireStep"),r($r,"props",{index:{type:Number},state:n(String),...p});var Es=class extends l{get disabled(){return this.env.questionnaire.index===0}onClick(){this.env.questionnaireShow(this.env.questionnaire.index-1)}};r(Es,"template","nodexui.QuestionnairePrevious"),r(Es,"components",{Button:R}),r(Es,"props",p);var Cs=class extends l{onClick(){this.env.questionnaireShow(this.env.questionnaire.index+1)}};r(Cs,"template","nodexui.QuestionnaireNext"),r(Cs,"components",{Button:R}),r(Cs,"props",{...p,stepCount:n(Number)});var _r=class extends l{get max(){return this.props.max||100}get value(){return Math.min(this.max,Math.max(0,this.props.value||0))}get style(){return pt(`--b-progress-value:${this.value/this.max*100}%`,this.props.style)}get classNames(){return f("progress b-progress",this.props.className)}};r(_r,"template","nodexui.Progress"),r(_r,"props",{value:n(Number),max:n(Number),className:n(String),style:n([String,Object])});var Mn=Ic(ba(),1);Mn.default.stringToBytes=Mn.default.stringToBytesFuncs["UTF-8"];function fa(t,{ecc:e="M"}={}){let s=(0,Mn.default)(0,e);return s.addData(String(t)),s.make(),{size:s.getModuleCount(),isDark:(o,i)=>s.isDark(o,i)}}var ks=class extends l{get code(){let{matrix:e}=this.props;if(e)return e;let s=this.props.qrContent;return s?(this.encoded?.text!==s&&(this.encoded={text:s,matrix:fa(s)}),this.encoded.matrix):{size:0}}get path(){let{size:e,isDark:s}=this.code,o=[];for(let i=0;i<e;i+=1)for(let a=0;a<e;a+=1)s(i,a)&&o.push(`M${a} ${i}h1v1h-1z`);return o.join("")}get size(){return this.code.size}};r(ks,"template","nodexui.QRCard"),r(ks,"components",{Card:Yt,CardBody:Qt,CardHeader:Xt,CardTitle:te,CardDescription:ee}),r(ks,"props",{matrix:n(Object),qrContent:n(String),label:n(String),title:n(String),description:n(String),...p});var Ur=class extends l{get classNames(){return f("b-aspect-ratio",this.props.className)}get style(){let e=this.props.ratio||`${this.props.width||16} / ${this.props.height||9}`;return pt(`--b-aspect-ratio:${e}`,this.props.style)}};r(Ur,"template","nodexui.AspectRatio"),r(Ur,"props",{ratio:n(String),width:n(Number),height:n(Number),...p});var Pr=class extends l{get classNames(){return f("b-bubble",this.props.className)}get side(){return this.props.side}};r(Pr,"template","nodexui.Bubble"),r(Pr,"props",{side:n(String),...p});var qr=class extends l{get dir(){return this.props.dir==="rtl"?"rtl":"ltr"}};r(qr,"template","nodexui.Direction"),r(qr,"props",{dir:n(String),...p});var Dr=class extends l{get classNames(){return f("b-item",this.props.className)}get variant(){return this.props.variant}};r(Dr,"template","nodexui.Item"),r(Dr,"props",{variant:n(String),...p});var jr=class extends l{get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return f("b-button-group",this.orientation==="vertical"?"btn-group-vertical":"btn-group",(this.props.size==="sm"||this.props.size==="lg")&&`btn-group-${this.props.size}`,this.props.className)}get ariaLabel(){return this.props["aria-label"]}get ariaLabelledby(){return this.props["aria-labelledby"]}};r(jr,"template","nodexui.ButtonGroup"),r(jr,"props",{orientation:n(String),size:n(String),"aria-label":n(String),"aria-labelledby":n(String),...p});var Fr=class extends l{get orientation(){return this.props.orientation==="horizontal"?"horizontal":"vertical"}get classNames(){return f("b-button-group-separator",`b-button-group-separator-${this.orientation}`,this.props.className)}};r(Fr,"template","nodexui.ButtonGroupSeparator"),r(Fr,"props",{orientation:n(String),className:n(String),style:n([String,Object])});var zr=class extends l{get classNames(){return f("b-button-group-text",this.props.className)}};r(zr,"template","nodexui.ButtonGroupText"),r(zr,"props",{...p});var Hr=class extends l{get classNames(){return f("b-field-set",this.props.className)}};r(Hr,"template","nodexui.FieldSet"),r(Hr,"props",{...p});var Wr=class extends l{get variant(){return this.props.variant||"legend"}get classNames(){return f("b-field-legend",this.props.className)}};r(Wr,"template","nodexui.FieldLegend"),r(Wr,"props",{variant:n(String),...p});var Oe=class extends l{get classNames(){return f("b-field-group",this.props.className)}};r(Oe,"template","nodexui.FieldGroup"),r(Oe,"props",{...p});var Ie=class extends l{setup(){z({fieldProps:()=>this.props})}get orientation(){return this.props.orientation||"vertical"}get classNames(){return f("b-field",`b-field-orientation-${this.orientation}`,this.props.className)}};r(Ie,"template","nodexui.Field"),r(Ie,"props",{orientation:n(String),invalid:n(Boolean),label:n(String),labelBackground:n(String),description:n(String),useTip:n(Number),error:n(String),...p});var Kr=class extends l{get classNames(){return f("b-field-content",this.props.className)}};r(Kr,"template","nodexui.FieldContent"),r(Kr,"props",{...p});var Be=class extends l{get classNames(){return f("b-field-label",this.props.className)}};r(Be,"template","nodexui.FieldLabel"),r(Be,"props",{for:n(String),...p});var Vr=class extends l{get classNames(){return f("b-field-title",this.props.className)}};r(Vr,"template","nodexui.FieldTitle"),r(Vr,"props",{...p});var Re=class extends l{get classNames(){return f("b-field-description",this.props.className)}};r(Re,"template","nodexui.FieldDescription"),r(Re,"props",{...p});var Zr=class extends l{get hasContent(){return!!this.props.slots?.default}get classNames(){return f("b-field-separator",this.props.className)}};r(Zr,"template","nodexui.FieldSeparator"),r(Zr,"props",{...p});var Me=class extends l{get classNames(){return f("b-field-error",this.props.className)}};r(Me,"template","nodexui.FieldError"),r(Me,"props",{message:n(String),...p});function ga(t){return`Icon${String(t).split("-").filter(Boolean).map(s=>s[0].toUpperCase()+s.slice(1)).join("")}`}var Gr=class extends l{get classNames(){return f("form-label","b-label","b-label",this.props.className)}get state(){return this.props.state||(this.props.required?"required":void 0)}};r(Gr,"template","nodexui.Label"),r(Gr,"props",{for:n(String),required:n(Boolean),state:n(String),...p});var ru="b-theme",nu="theme",iu="[b-theme-toggle]",au="[b-theme-label]";function hi(t){return t==="dark"?"dark":"light"}function cu(t){return typeof globalThis.location>"u"?null:new URLSearchParams(globalThis.location.search).get(t)}function lu(t,e=document.documentElement){let s=hi(t);return globalThis.thebase?.theme?.set?globalThis.thebase.theme.set(s):e&&(e.setAttribute("b-theme",s),e.setAttribute("data-bs-theme",s)),s}function va(t,e,s){try{t.contentWindow?.NodexUI?.theme.set(e),t.contentDocument?.documentElement.setAttribute("b-theme",e),t.contentDocument?.documentElement.setAttribute("data-bs-theme",e)}catch{let o=new URL(t.getAttribute("src"),globalThis.location.href);o.searchParams.set(s,e),t.setAttribute("src",o.pathname+o.search+o.hash)}}function uu(t){typeof document>"u"||typeof CustomEvent>"u"||document.dispatchEvent(new CustomEvent("nodexui:theme-change",{detail:{theme:t}}))}function $e(t={}){let e=t.storageKey||ru,s=t.queryKey||nu,o=t.toggleSelector??iu,i=t.labelSelector??au,a=t.root||(typeof document>"u"?null:document.documentElement);function c(){return cu(s)}function u(){return hi(c()||globalThis.localStorage?.getItem(e)||a?.getAttribute("b-theme")||"light")}function d(Y){typeof document>"u"||!o||document.querySelectorAll(o).forEach(ot=>{ot.setAttribute("aria-pressed",Y==="dark"?"true":"false");let J=i?ot.querySelector(i):null;J&&(J.textContent=Y==="dark"?"Light theme":"Dark theme")})}function v(Y){typeof document>"u"||document.querySelectorAll("iframe").forEach(ot=>va(ot,Y,s))}function S(Y,ot={}){let J=lu(Y,a);return!ot.skipStorage&&!c()&&globalThis.localStorage?.setItem(e,J),d(J),v(J),uu(J),J}function P(){return S(a?.getAttribute("b-theme")==="dark"?"light":"dark")}function U(){if(typeof document>"u")return u();let Y=u();return S(Y,{skipStorage:!!c()}),o&&document.addEventListener("click",ot=>{ot.target.closest?.(o)&&P()}),document.querySelectorAll("iframe").forEach(ot=>{ot.addEventListener("load",()=>va(ot,a?.getAttribute("b-theme")||Y,s))}),Y}return{current:u,set:S,toggle:P,syncFrames:v,init:U}}var xa=$e();typeof window<"u"&&(window.NodexUITheme=xa);var ya=["btn","b-theme-button",...Object.values(dt),...Object.values(mt)];function Jr(t){let e=t==="dark";return{icon:e?"sun":"moon",label:e?"Switch to light theme":"Switch to dark theme",pressed:e?"true":"false"}}function $n({variant:t="outline",size:e,className:s}={}){return f("btn","b-theme-button",dt[t]||dt.outline,mt[e],s)}var Ht=class extends l{setup(){this.theme=$e({storageKey:X(this.props,"storage-key","storageKey")}),this.state=I({theme:this.theme.current()}),this.onThemeChange=e=>{this.state.theme=e.detail?.theme||this.theme.current()},K(()=>{this.state.theme=this.theme.set(this.theme.current(),{skipStorage:!0}),document.addEventListener("nodexui:theme-change",this.onThemeChange)}),G(()=>document.removeEventListener("nodexui:theme-change",this.onThemeChange))}get iconName(){return Jr(this.state.theme).icon}get baseUrl(){return X(this.props,"base-url")}get label(){return Jr(this.state.theme).label}get pressed(){return Jr(this.state.theme).pressed}get classNames(){return $n(this.props)}get attrs(){return{"b-theme-button":""}}onClick(){let e=this.theme.toggle();this.state.theme=e,this.props.onChange?.(e)}};r(Ht,"template","nodexui.ThemeButton"),r(Ht,"components",{Icon:Z,Button:R}),r(Ht,"props",{variant:n(String),size:n(String),"base-url":n(String),"storage-key":n(String),storageKey:n(String),className:n(String),style:n([String,Object]),onChange:n(Function)});var Ls=class extends l{get classNames(){return f("b-toggle","btn",this.props.variant==="outline"?"btn-outline-secondary":"btn-light",this.props.className)}get pressed(){return this.props.state!==void 0?ut(this.props.state):!!this.props.pressed}onClick(){this.props.onChange?.(!this.pressed)}};r(Ls,"template","nodexui.Toggle"),r(Ls,"components",{Button:R}),r(Ls,"props",{pressed:n(Boolean),state:n(String),variant:n(String),...p,onChange:n(Function)});var Yr=class extends l{setup(){this.state=I({selected:new Set}),z({toggleGroup:this.state,toggleGroupSelect:e=>this.select(e)})}select(e){this.props.multiple?this.state.selected.has(e)?this.state.selected.delete(e):this.state.selected.add(e):this.state.selected=this.state.selected.has(e)?new Set:new Set([e]);let s=this.props.multiple?[...this.state.selected]:[...this.state.selected][0];this.props.onChange?.(s)}};r(Yr,"template","nodexui.ToggleGroup"),r(Yr,"props",{multiple:n(Boolean),onChange:n(Function),...p});var Ns=class extends l{get pressed(){return this.env.toggleGroup.selected.has(this.props.value)}onClick(){this.env.toggleGroupSelect(this.props.value)}};r(Ns,"template","nodexui.ToggleGroupItem"),r(Ns,"components",{Button:R}),r(Ns,"props",{value:{type:String},...p});var pu=/^ {0,3}(`{3,}|~{3,})/,du=/^(?:import\s+(?:["'{*]|[A-Za-z_$][\w$]*\s*(?:,|from\b))|export\s+(?:const|let|var|default|function|class|async)\b)/,hu=/^import\s+(?:([A-Za-z_$][\w$]*)\s*,?\s*)?(?:\{([^}]*)\}\s*)?from\s*(["'])([^"']+)\3\s*;?\s*$/,Ea=/^export\s+const\s+([A-Za-z_$][\w$]*)\s*=\s*([\s\S]+?);?\s*$/;function _n(t){return t?new URL(t,document.baseURI).href:document.baseURI}function Un(t){let e={source:"",islands:[],imports:[],state:{}},s=[],o=[],i=null;for(let a of String(t??"").split(`
29
+ `)){let c=pu.exec(a);!i&&c?(o.length&&s.push(wa(o.join(`
30
+ `),e)),o=[a],i=c[1]):i&&mu(a,i)?(s.push([...o,a].join(`
31
+ `)),o=[],i=null):o.push(a)}return o.length&&s.push(i?o.join(`
32
+ `):wa(o.join(`
33
+ `),e)),e.source=s.join(`
34
+ `),e}function mu(t,e){let s=/^ {0,3}(`{3,}|~{3,})\s*$/.exec(t);return!!s&&s[1][0]===e[0]&&s[1].length>=e.length}function wa(t,e){let s="",o=0;for(;o<t.length;){if((o===0||t[o-1]===`
35
+ `)&&du.test(t.slice(o,o+120))){let c=gu(t,o);wu(t.slice(o,c).trim(),e),o=c;continue}let a=t[o]==="`"?vu(t,o):t[o]==="<"&&/[A-Z]/.test(t[o+1]??"")?xu(t,o,s,e):null;s+=a?a.text:t[o],o=a?a.end:o+1}return s}function bu(t,e){let s=/\n[ \t]*\n/g;s.lastIndex=e;let o=s.exec(t);return o?o.index+1:t.length}function Sa(t,e,s){let o=t.indexOf(`
36
+ `,e);return o<0||o>=s?s:o}function fu(t){try{return JSON.parse(Ea.exec(t.trim())?.[2]),!0}catch{return!1}}function gu(t,e){let s=bu(t,e),o=Sa(t,e,s);for(;t.startsWith("export",e)&&o+1<s&&!fu(t.slice(e,o));)o=Sa(t,o+1,s);return o}function vu(t,e){let s=1;for(;t[e+s]==="`";)s+=1;let o="`".repeat(s),i=t.indexOf(`
37
+ `,e),a=t.slice(0,i<0?t.length:i).indexOf(o,e+s),c=a<0?e+s:a+s;return{text:t.slice(e,c),end:c}}function xu(t,e,s,o){let i=yu(t,e);if(i<0)return null;let a=s.slice(s.lastIndexOf(`
38
+ `)+1),c=/^\s*$/.test(a)&&/^[ \t]*(\n|$)/.test(t.slice(i)),u=o.islands.length;o.islands.push({markup:t.slice(e,i),block:c});let d=c?"div":"span";return{text:`<${d} class="b-markdown-island" data-mdx-island="${u}"></${d}>${c?`
39
+ `:""}`,end:i}}function Aa(t,e){let s="";for(let o=e+1;o<t.length;o+=1){let i=t[o];if(s)i===s&&(s="");else if(i==='"'||i==="'")s=i;else if(i===">")return{end:o+1,selfClosing:t[o-1]==="/"}}return null}function yu(t,e){let s=Aa(t,e);if(!s)return-1;if(s.selfClosing)return s.end;let o=/^<([A-Z]\w*)/.exec(t.slice(e,e+80))[1],i=new RegExp(`<(/?)${o}(?=[\\s/>])`,"g");i.lastIndex=s.end;let a=1;for(let c=i.exec(t);c;c=i.exec(t)){if(c[1]){if(a-=1,a===0)return t.indexOf(">",c.index)+1;continue}let u=Aa(t,c.index);if(!u)return-1;u.selfClosing||(a+=1),i.lastIndex=u.end}return-1}function wu(t,e){if(t.startsWith("import")){let o=hu.exec(t);if(!o)throw new Error(`Unsupported import in Markdown: ${t}`);let[,i,a="",,c]=o;i&&e.imports.push({specifier:c,imported:"default",local:i});for(let u of a.split(",").map(d=>d.trim()).filter(Boolean)){let[d,v=d]=u.split(/\s+as\s+/);e.imports.push({specifier:c,imported:d,local:v})}return}let s=Ea.exec(t);if(!s)throw new Error(`Unsupported export in Markdown (use \`export const name = <JSON>\`): ${t}`);try{e.state[s[1]]=JSON.parse(s[2])}catch{throw new Error(`export const ${s[1]} must be a JSON value`)}}function Su(t,e){if(!/^(\.{0,2}\/|[a-z][a-z0-9+.-]*:)/i.test(t))return t;let s=new URL(t,e);if(s.origin!==window.location.origin)throw new Error(`Import blocked (not same-origin): ${t}`);return s.href}function Au(t){return typeof t=="function"&&typeof t.template=="string"}async function Ca(t,e,s=o=>import(o)){let o={components:{},values:{}};for(let i of t.imports){let c=(await s(Su(i.specifier,e)))[i.imported];if(c===void 0)throw new Error(`"${i.imported}" is not exported by "${i.specifier}"`);(Au(c)?o.components:o.values)[i.local]=c}return o}bi();var fi,gi,vi,qu=0;function Du(){return fi??(fi=import("./runtime/marked/marked.min.js").then(t=>{let e=t.marked||t.default?.marked||globalThis.marked;if(!e?.parse)throw new Error("NodexUI markdown: failed to load src/runtime/marked/marked.min.js");return e})),fi}function ju(t){let e=t.closest("[data-bs-theme]")?.getAttribute("data-bs-theme")||document.documentElement.getAttribute("data-bs-theme");return(e?e==="dark":window.matchMedia?.("(prefers-color-scheme: dark)").matches)?"dark":"default"}function Fu(){return gi??(gi=import("./runtime/mermaid/mermaid.esm.min.js").then(t=>t.default||t)),gi}function zu(){return vi??(vi=import("./runtime/milkdown/milkdown-editor.js")),vi}async function Dn(t,e={}){return(await Du()).parse(String(t??""),{gfm:!0,breaks:!1,...e})}function qn(t,e,s,o=""){t.classList.add("b-markdown-diagram-error"),t.replaceChildren();let i=document.createElement("p");if(i.className="b-markdown-diagram-error-message",i.textContent=`Unable to render ${e} diagram: ${s?.message||s}`,t.append(i),o){let a=document.createElement("pre"),c=document.createElement("code");c.textContent=o,a.append(c),t.append(a)}}async function Hu(t){let e=[...t.querySelectorAll("pre > code.language-mermaid")];if(!e.length)return;let s;try{s=await Fu()}catch(o){e.forEach(i=>{let a=i.closest("pre");a.replaceChildren(),a.className="b-markdown-diagram b-markdown-mermaid",qn(a,"mermaid",o,i.textContent)});return}s.initialize({startOnLoad:!1,securityLevel:"strict",theme:ju(t)});for(let o of e){let i=o.textContent,a=o.closest("pre");a.replaceChildren(),a.className="b-markdown-diagram b-markdown-mermaid";try{let{svg:c}=await s.render(`b-mermaid-${++qu}`,i);a.isConnected&&(a.innerHTML=c)}catch(c){a.isConnected&&qn(a,"mermaid",c,i)}}}function Wu(t){let e=globalThis.thebase;if(!e?.mountAll)return;let s=document.createElement("div");s.setAttribute("b-ui","toast"),s.setAttribute("b-att-state","open"),s.setAttribute("b-att-delay","2000"),s.className="b-markdown-b-copy-toast",s.textContent=t,document.body.append(s),e.mountAll(s),s.addEventListener("nodexui:close",()=>s.remove(),{once:!0})}function Ku(t){let e=document.createElement("div");e.className="b-markdown-b-code";let s=document.createElement("button");s.type="button",s.className="b-markdown-b-copy";let o=document.createElement("span");ct(o,"copy",{label:"Copy code"}),s.append(o),s.addEventListener("click",async()=>{try{await Ds(t),s.dispatchEvent(new CustomEvent("nodexui:markdown-copy",{bubbles:!0,detail:{source:t}})),Wu("Copied to clipboard")}catch(c){s.dispatchEvent(new CustomEvent("nodexui:markdown-copy-error",{bubbles:!0,detail:{error:c}}))}}),e.append(s);let i=document.createElement("pre"),a=document.createElement("code");a.className="b-markdown-b-code-lines";for(let c of t.replace(/\n$/,"").split(`
40
+ `)){let u=document.createElement("span");u.className="b-markdown-b-code-line",u.textContent=c,a.append(u)}return i.append(a),e.append(i),e}var xi;function Vu(){return xi??(xi=Pe("/dist/nodexui.templates.xml")),xi}var yi=new WeakMap;function gn(t){let e=yi.get(t);if(e){yi.delete(t);for(let s of e)try{s.destroy()}catch{}}}var Zu=/\bstate\.([A-Za-z_$][\w$]*)/g;function Gu(t){return new Set([...t.matchAll(Zu)].map(e=>e[1]))}var Ju=/\bthis\.([A-Za-z_$][\w$]*)\s*\(/g,Yu=/\bt-on-[\w:-]+\s*=\s*(["'])([A-Za-z_$][\w$]*)\1/g;function Xu(t){let e=new Set;for(let s of t.matchAll(Ju))e.add(s[1]);for(let s of t.matchAll(Yu))e.add(s[2]);return e}function Qu(t,{components:e={},values:s={},state:o}={}){let i=Hi({raw:[t]}),a=Gu(t);class c extends l{setup(){let d=o??{};for(let v of a)d[v]??(d[v]="");this.state=I(d);for(let[v,S]of Object.entries(s))this[v]=typeof S=="function"?S.bind(this):S}}r(c,"template",i),r(c,"components",{...e});for(let u of Xu(t))c.prototype[u]=function(){};return c}function $a(t){t.querySelector("[data-slot='dropdown-menu'], .b-dropdown-menu, [b-ui='dropdown-menu'], [b-dropdown-menu]")&&t.classList.add("b-markdown-b-preview-overlay")}async function Ma(t,e,s){let[o,i]=await Promise.all([Vu(),Qu(e,s)]),a=await Ps(i,t,{templates:o});return $a(t),a}function tp(t,e){let s=globalThis.thebase;if(!s?.mountAll)throw new Error("NodexUI runtime not found on the page \u2014 load dist/nodexui.min.js before mounting Markdown.");t.innerHTML=e,$a(t),s.mountAll(t)}async function ep(t,{mdx:e,baseUrl:s}={}){gn(t);let o=[...t.querySelectorAll("pre > code.language-base-ui, pre > code.language-base-ui-render")],i=e?[...t.querySelectorAll("[data-mdx-island]")].filter(d=>!d.hasChildNodes()):[];if(!o.length&&!i.length)return;let a=new Set,c={},u=null;try{e?.imports.length&&(c=await Ca(e,s))}catch(d){u=d}for(let d of o){let v=d.textContent,S=d.closest("pre"),P=d.classList.contains("language-base-ui-render");S.replaceChildren(),S.className=P?"b-markdown-live b-markdown-nodexui b-markdown-render":"b-markdown-live b-markdown-nodexui";let U=document.createElement("div");U.className="b-markdown-b-preview",S.append(U),P||S.append(Ku(v));try{if(/<[A-Z]/.test(v)){if(u)throw u;a.add(await Ma(U,v,c))}else tp(U,v)}catch(Y){qn(S,"NodexUI component",Y,v)}}for(let d of i){let{markup:v}=e.islands[Number(d.dataset.mdxIsland)];try{if(u)throw u;a.add(await Ma(d,v,{...c,state:e.state}))}catch(S){qn(d,"MDX component",S,v)}}a.size&&yi.set(t,a)}function sp(t){for(let e of t.querySelectorAll("li > input[type=checkbox]:not([aria-label])"))e.setAttribute("aria-label",e.parentElement.textContent.trim())}async function jn(t,{mermaid:e=!0,nodexUi:s=!0,mdx:o,baseUrl:i}={}){sp(t),e&&await Hu(t),s&&await ep(t,{mdx:o,baseUrl:i})}async function Fn(t){return(await zu()).createMilkdownMarkdownEditor(t)}function zn(t){let e=String(t??""),s=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e);if(!s)return{data:{},content:e};let o={};for(let i of s[1].split(/\r?\n/)){let a=i.trim();if(!a||a.startsWith("#"))continue;let c=a.indexOf(":");if(c===-1)continue;let u=a.slice(0,c).trim();u&&(o[u]=op(a.slice(c+1).trim()))}return{data:o,content:e.slice(s[0].length)}}function _a(t){return t.length>=2&&(t[0]==='"'&&t.at(-1)==='"'||t[0]==="'"&&t.at(-1)==="'")?t.slice(1,-1):t}function op(t){if(t==="")return"";if(t==="true")return!0;if(t==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1).trim();return e?e.split(",").map(s=>_a(s.trim())):[]}return _a(t)}function Qr(t,e){if(!t)return null;if(t.type==="file"&&(t.path===e||t.meta?.slug===e))return t;for(let s of t.children||[]){let o=Qr(s,e);if(o)return o}return null}function Hn(t,e){if(t.type==="dir"&&t.path===e)return t;for(let s of t.children||[]){let o=s.type==="dir"?Hn(s,e):null;if(o)return o}return null}function rp(t){return t.replace(/\.[^./]+$/,"").replace(/[_-]+/g," ").trim().split(/\s+/).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}function Ua(t){return t.meta?.sidebar_label||t.meta?.title||rp(t.name)}function Pa(t,{exclude:e,formatLabel:s},o){if(t.type==="file"){let a=s?.(t),c=a?{...t,meta:{...t.meta,sidebar_label:a}}:t;return Ua(c).toLowerCase().includes(o)?c:null}let i=(t.children||[]).filter(a=>!e?.includes(a.path)).map(a=>Pa(a,{exclude:e,formatLabel:s},o)).filter(Boolean);return o&&!i.length?null:{...t,children:i}}function np(t,{include:e,exclude:s,filter:o,formatLabel:i}){let a=e?{...t,children:e.map(c=>Qr(t,c)).filter(Boolean)}:t;return Pa(a,{exclude:s,formatLabel:i},(o||"").trim().toLowerCase())??{...t,children:[]}}var Xr=class Xr extends l{setup(){this.state=I({open:!1})}toggle(){this.state.open=!this.state.open}get label(){return Ua(this.props.node)}get hasSubfolders(){return(this.props.node.children||[]).some(e=>e.type==="dir")}select(e){this.props.onSelect(e)}};r(Xr,"template","nodexui.MarkdownTreeNode"),r(Xr,"components",{MarkdownTreeNode:Xr,Icon:Z,SidebarGroupLabel:Ne,SidebarMenu:zt,SidebarMenuItem:Te,SidebarMenuButton:jt,DropdownMenu:fe,DropdownMenuTrigger:Ut,DropdownMenuContent:ge,DropdownMenuItem:ve,DropdownMenuSub:xe,DropdownMenuSubTrigger:Pt,DropdownMenuSubContent:ye}),r(Xr,"props",{node:{type:Object},activePath:n(String),onSelect:{type:Function},nested:n(Boolean)});var vn=Xr,Wt=class extends l{setup(){this.state=I({tree:null,status:"loading",error:""}),xt(()=>this.load())}get rootNode(){let e=this.state.tree;return np(this.props.root?Hn(e,this.props.root)??e:e,this.props)}async load(){this.state.status="loading",this.state.error="";try{let e=await fetch(this.props.src);if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);this.state.tree=await e.json(),this.state.status="ready"}catch(e){this.state.status="error",this.state.error=e.message||String(e)}}};r(Wt,"template","nodexui.MarkdownTree"),r(Wt,"components",{MarkdownTreeNode:vn,SidebarGroup:Le,SidebarMenu:zt}),r(Wt,"props",{src:{type:String},root:n(String),include:n(Array),exclude:n(Array),filter:n(String),formatLabel:n(Function),activePath:n(String),onSelect:{type:Function},className:n(String),style:n([String,Object])});var wi=new Map;function ip(t){return wi.has(t)||wi.set(t,fetch(t).then(e=>e.ok?e.json():null).catch(()=>null)),wi.get(t)}async function ap(t){let e=await fetch(t);if(e.ok)return e;let s=t.endsWith("/")?t:t.slice(0,t.lastIndexOf("/")+1);for(let o of["readme.md","README.md"]){let i=await fetch(s+o).catch(()=>null);if(i?.ok)return i}return e}var Lt=class extends l{setup(){this.rootRef=$("root"),this.editorRef=$("editor"),this.editorHandle=null,this.manifest=null,this.mdx=null,this.state=I({html:"",source:"",status:"loading",error:"",frontmatter:{}}),xt(()=>this.load(this.props)),nt(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),K(()=>this.afterRender()),rt(()=>this.afterRender()),qe(()=>{this.destroyEditor(),this.rootRef.el&&gn(this.rootRef.el)})}get classNames(){return f("b-markdown",this.props.className)}onLinkClick(e){let{tree:s,src:o,onNavigate:i}=this.props,a=e.target.closest?.("a[href]");if(!s||!i||!o||!a||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey)return;let c=a.getAttribute("href");if(!c||c.startsWith("#")||/^[a-z][a-z0-9+.-]*:/i.test(c)||c.startsWith("//"))return;let u=new URL(c,new URL(o,window.location.origin)),d=Qr(this.manifest,decodeURIComponent(u.pathname.replace(/^\//,"")));d&&(e.preventDefault(),i(d.path,u.hash))}get editorLabel(){return this.props.collaborative?"Collaborative Markdown editor":"Markdown editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src||e.tree!==this.props.tree}shouldRestartEditor(e){return e.editable!==this.props.editable||e.collaborative!==this.props.collaborative||e.room!==this.props.room||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=e.content??"";if(this.manifest=e.tree?await ip(e.tree):null,e.src)try{let o=await ap(e.src);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);s=await o.text()}catch(o){this.state.status="error",this.state.error=o.message||String(o);return}try{this.state.source=s;let{data:o,content:i}=zn(s);this.state.frontmatter=o,this.mdx=this.props.nodexUi===!1?null:Un(i),this.state.html=si(await Dn(this.mdx?.source??i)),this.state.status="ready"}catch(o){this.state.status="error",this.state.error=o.message||String(o)}}get hasFrontmatterMeta(){let e=this.state.frontmatter;return!!(e.tags?.length||e.authors?.length)}enhance(){let e=this.rootRef.el;!e||this.state.status!=="ready"||jn(e,{mermaid:this.props.mermaid!==!1,nodexUi:this.props.nodexUi!==!1,mdx:this.mdx,baseUrl:_n(this.props.src)})}afterRender(){this.props.editable?this.mountEditor():this.enhance()}async mountEditor(){let e=this.editorRef.el;if(!(!e||this.editorHandle||this.state.status!=="ready"))try{this.editorHandle=await Fn({root:e,value:this.state.source,collaborative:!!this.props.collaborative,room:this.props.room||"b-markdown",password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(s,o,i)=>{this.state.source=s,this.props.onChange?.(s,o,i)}})}catch(s){this.state.status="error",this.state.error=s.message||String(s)}}destroyEditor(){this.editorHandle?.destroy?.(),this.editorHandle=null}};r(Lt,"template","nodexui.Markdown"),r(Lt,"components",{Badge:At}),r(Lt,"props",{content:n(String),src:n(String),mermaid:n(Boolean),nodexUi:n(Boolean),editable:n(Boolean),collaborative:n(Boolean),room:n(String),password:n(String),signaling:n(Array),user:n(Object),onChange:n(Function),tree:n(String),onNavigate:n(Function),className:n(String),style:n([String,Object])});var qa={implicit:"Implicit",password:"Resource Owner Password Credentials",application:"Client Credentials",accessCode:"Authorization Code"},cp=["POST","PUT","PATCH"];function Ts(t){try{return sessionStorage.getItem(t)||""}catch{return""}}function xn(t,e){try{e?sessionStorage.setItem(t,e):sessionStorage.removeItem(t)}catch{}}function Ai(){return!!(Ts("apikey")||Ts("oauthkey"))}function Si(t){return t.example!==void 0?String(t.example):t.default!==void 0?String(t.default):t.enum?.length?String(t.enum[0]):t.type==="integer"||t.type==="number"?t.format==="int64"?"10":"1":t.type==="boolean"?"true":t.required&&t.in==="path"?"string":""}function Ei(t,e){let s=Ts("apikey"),o=Ts("oauthkey");for(let i of t.security)i.type==="apiKey"&&i.in==="header"?e.header[i.name]=s:i.type==="apiKey"&&i.in==="query"?e.query[i.name]=s:i.type==="basic"?e.header.Authorization=s?`Basic ${s}`:"":(i.type==="oauth2"||i.type==="bearer")&&(e.header.Authorization=o?`Bearer ${o}`:"")}function Da(t,e){let s={baseUrl:e,path:{},query:{},header:{},bodyText:"",mimeType:t.consumes?.[0]||"application/json"};return t.parameters.path.forEach(o=>{s.path[o.name]=Si(o)}),t.parameters.query.forEach(o=>{s.query[o.name]=o.required?Si(o):""}),t.parameters.header.forEach(o=>{s.header[o.name]=o.required?Si(o):""}),t.produces?.length&&(s.header.Accept=t.produces.includes("application/json")?"application/json":t.produces[0]),t.parameters.body&&(s.mimeType=t.parameters.body.contentType||s.mimeType,s.bodyText=Ci(t.parameters.body.example)),Ei(t,s),s}function Ci(t){return typeof t=="string"?t:JSON.stringify(t,null,2)??""}function ki(t,e){let s=t.path;for(let[i,a]of Object.entries(e.path))s=s.replace(`{${i}}`,encodeURIComponent(a??""));let o=!!t.parameters.body&&cp.includes(t.method);return{method:t.method,url:`${e.baseUrl}${s}`,query:Object.entries(e.query).filter(([,i])=>i!==""),headers:Object.entries(e.header).filter(([,i])=>i!==""),bodyText:o?e.bodyText:"",mimeType:e.mimeType}}function ja(t){let e=t.query.length?`${t.url}?${new URLSearchParams(t.query)}`:t.url,s=Object.fromEntries(t.headers);return t.bodyText&&(s["Content-Type"]=s["Content-Type"]||t.mimeType),{url:e,headers:s,headerLines:Object.entries(s).map(([o,i])=>`${o}: ${i}`).join(`
41
+ `)}}async function Fa(t,e){let s=performance.now(),o=await fetch(e.url,{method:t.method,headers:e.headers,body:t.bodyText||void 0}),i=Math.round(performance.now()-s),a=await o.text();return{status:o.status,statusText:o.statusText,ms:i,headerLines:[...o.headers.entries()].map(([c,u])=>`${c}: ${u}`).join(`
42
+ `),bodyText:lp(a)}}function lp(t){try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}}function za(t){let e=parseInt(t,10);return t==="default"||Number.isNaN(e)?"default":e<300?"2xx":e<400?"3xx":e<500?"4xx":"5xx"}function Ha(t,e,s){if(!t)return"";try{let o=new URL(e),i=new URL(s.derivedBaseUrl||s.baseUrl||e),a=new URL(t,`${o.href.replace(/\/$/,"")}/`);return a.host===i.host&&(a.protocol=o.protocol,a.username=o.username,a.password=o.password,a.host=o.host),a.href}catch{return String(t)}}function Wa(){return Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("")}function Ka({def:t,clientId:e,scopes:s,state:o,redirectUri:i,baseUrl:a,doc:c}){let u=new URL(Ha(t.authorizationUrl,a,c));return u.searchParams.set("response_type",t.flow==="implicit"?"token":"code"),e&&u.searchParams.set("client_id",e),u.searchParams.set("redirect_uri",i),s.length&&u.searchParams.set("scope",s.join(" ")),u.searchParams.set("state",o),u.toString()}async function Va(t,e,s,o){if(!t)throw new Error("No tokenUrl defined for this scheme.");let i=new URLSearchParams;for(let[u,d]of Object.entries(e))d&&i.set(u,d);let a=await fetch(Ha(t,s,o),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:i.toString()}),c=await a.json().catch(()=>({}));if(!a.ok||!c.access_token)throw new Error(c.error_description||c.error||`HTTP ${a.status}`);return c.access_token}function Za(t,e,s){let o={client_id:e.clientId,client_secret:e.clientSecret,scope:s.join(" ")};return t==="password"?{grant_type:"password",username:e.username,password:e.password,...o}:{grant_type:"client_credentials",...o}}var Ga;function up(){return Ga??(Ga=import("./runtime/lazy/apidoc.logic.js"))}var pp=["curl","csharp","go","node","ruby","php"],dp="(max-width: 1100px)",hp=3;function Ya(t){return t==="DELETE"?"DEL":t}function mp(){let t=[...document.scripts].find(e=>/\/nodexui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(e.src));return t?`${t.src.replace(/[?#].*$/,"").replace(/\/[^/]*$/,"")}/apidoc`:""}var Ja=new WeakMap;function bp(t){let e=Ja.get(t);if(!e){e=new Map;for(let s of t)e.has(s.parent)||e.set(s.parent,[]),e.get(s.parent).push(s);Ja.set(t,e)}return e}var Vt=class extends l{constructor(){super(...arguments);r(this,"methodLabel",Ya)}get children(){return bp(this.props.groups).get(this.props.group.name)||[]}};r(Vt,"template","nodexui.ApiDocGroup"),r(Vt,"props",{group:Object,groups:Array,current:String,href:Function,onSelect:Function});Vt.components={ApiDocGroup:Vt,Icon:Z};var Kt=class extends l{constructor(){super(...arguments);r(this,"methodLabel",Ya);r(this,"statusClass",za);r(this,"formatExample",Ci)}setup(){this.rootRef=$("root"),this.mainRef=$("main"),this.doc=null,this.pendingOAuth=new Map,this.watchers=new Set,this.rowsCache=new WeakMap,this.snippetSeq=0,this.overlayQuery=window.matchMedia(dp),this.state=I({status:"loading",error:"",current:"introduction",lang:this.props.language||"curl",sidebarOpen:!this.overlayQuery.matches,systemTheme:"light",themeOverride:"",drafts:{},snippet:"",result:null,respTab:0,respView:{},authOpen:!1,authed:Ai(),stored:{apikey:"",oauthkey:""},inputs:{apikey:"",oauthkey:""},oauth:{},oauthStatus:{}}),this.onHashChange=()=>this.setCurrent(this.routeId()),this.onViewportChange=()=>{this.state.sidebarOpen=!this.overlayQuery.matches},this.onDocumentClick=s=>this.closeSidebarOnOutsideClick(s),this.onOAuthMessage=s=>this.handleOAuthMessage(s),this.onThemeChange=()=>this.readSystemTheme(),xt(()=>this.load(this.props)),nt(s=>this.shouldReload(s)?this.load(s):void 0),K(()=>this.addListeners()),qe(()=>this.removeListeners())}get classNames(){return f("b-apidoc",this.props.className)}get rootStyle(){return pt(this.props.height?`--b-apidoc-height:${this.props.height}`:"",this.props.style)}get theme(){return(this.props.theme==="light"||this.props.theme==="dark"?this.props.theme:"")||this.state.themeOverride||this.state.systemTheme}get title(){return this.props.title||this.doc?.info.title||"API Documentation"}get tryItEnabled(){return this.props.tryIt!==!1}get hasSecurity(){return this.props.authorize!==!1&&Object.keys(this.doc?.securityDefinitions||{}).length>0}get languages(){let s=this.logic?.LANGUAGES||[],o=this.props.languages;return o?.length?s.filter(i=>o.includes(i.id)):s}get currentLanguage(){return this.languages.find(s=>s.id===this.state.lang)||this.languages[0]}get op(){return this.state.current==="introduction"?null:this.doc.findOperation(this.state.current)}get draft(){return this.state.drafts[this.state.current]}get showTryIt(){return this.tryItEnabled&&!!this.op}get sidebarGroups(){let s=this.doc.groups.filter(o=>!o.parent);return this.doc.webhooks.length&&s.push({id:"webhooks",name:"Webhooks",items:this.doc.webhooks,kind:""}),s}get breadcrumb(){let s=this.op;if(!s)return[{label:"Home",id:"introduction",home:!0},{label:"Introduction"}];let o=this.doc.groups.find(i=>i.name===s.tag);return[{label:"Home",id:"introduction",home:!0},{label:this.title,id:"introduction"},{label:s.tag,id:o?o.items[0].id:"introduction"},{label:s.summary}]}get authSchemes(){return Object.entries(this.doc.securityDefinitions).map(([s,o])=>({key:s,def:o,scopes:Object.entries(o.scopes||{})}))}get serverOptions(){return this.doc.servers.length?this.doc.servers:[{url:this.doc.baseUrl,name:"",description:""}]}get tryItParams(){let{path:s,query:o,header:i}=this.op.parameters;return[...s.map(a=>({...a,group:"path"})),...o.map(a=>({...a,group:"query"})),...i.map(a=>({...a,group:"header"}))]}get selectedBaseUrl(){return this.draft?.baseUrl||this.doc.baseUrl}serverLabel(s){let o=[s.name,s.description].filter(Boolean).join(" \u2014 ");return o?`${o} (${s.url})`:s.url}languageTone(s){return pp.includes(s)?s:"default"}encodingEntries(s){return Object.entries(s)}oauthFlowLabel(s){return qa[s]||s||"unknown"}schemaRows(s){return this.rowsCache.has(s)||this.rowsCache.set(s,this.doc.schemaRows(s)),this.rowsCache.get(s)}depth(s){return(s.match(/\./g)||[]).length}lineNumbers(s){return String(s||"").split(`
43
+ `).map((o,i)=>i+1)}iconUrl(s){let o=this.props.assetBase??this.assetBase??(this.assetBase=mp());return o?`${o.replace(/\/$/,"")}/${s.icon}`:""}href(s){return this.props.hash?`#/${s}`:"#"}shouldReload(s){return s.src!==this.props.src||s.spec!==this.props.spec||s.serverUrl!==this.props.serverUrl}async load(s){this.state.status="loading";try{this.logic=await up(),this.doc=s.spec?this.logic.buildOpenApiDoc(s.spec,s.serverUrl):await this.logic.loadOpenApiDoc(s.src,s.serverUrl)}catch(o){this.state.status="error",this.state.error=o.message||String(o),s.onError?.(o);return}this.state.drafts={},this.state.current=this.routeId(s),this.ensureDraft(),this.state.status="ready",this.updateSnippet(),s.onLoad?.(this.doc)}routeId(s=this.props){let o=s.hash?location.hash.replace(/^#\//,""):s.operation;return o&&this.doc.findOperation(o)?o:"introduction"}go(s,o){this.props.hash||(s.preventDefault(),this.setCurrent(o)),this.overlayQuery.matches&&(this.state.sidebarOpen=!1)}setCurrent(s){let o=this.state;o.current=s,o.result=null,o.respTab=0,o.respView={},this.ensureDraft(),this.updateSnippet(),this.mainRef.el&&(this.mainRef.el.scrollTop=0),this.props.onNavigate?.(s)}ensureDraft(){let s=this.op;s&&!this.state.drafts[s.id]&&(this.state.drafts[s.id]=Da(s,this.doc.baseUrl))}toggleSidebar(){this.state.sidebarOpen=!this.state.sidebarOpen}closeSidebarOnOutsideClick(s){!this.overlayQuery.matches||!this.state.sidebarOpen||s.target.closest?.(".sidebar-shell, .sidebar-toggle")||(this.state.sidebarOpen=!1)}selectResponse(s){this.state.respTab=Number(s)}setResponseView(s,o){this.state.respView[s]=o}setLanguage(s){this.state.lang=s,this.updateSnippet()}onBaseUrl(s){this.draft.baseUrl=s,this.updateSnippet()}onParam(s,o,i){this.draft[o][i]=s,this.updateSnippet()}onBody(s){this.draft.bodyText=s,this.updateSnippet()}async updateSnippet(){let s=this.op;if(!s||!this.tryItEnabled)return;let o=this.currentLanguage,i=++this.snippetSeq,a;try{a=await this.logic.generateSnippet(o.id,ki(s,this.draft))}catch(c){a=`// Could not generate ${o.label} snippet: ${c.message}`}i===this.snippetSeq&&(this.state.snippet=a)}async send(){let s=this.op,o=ki(s,this.draft),i=ja(o),a={method:o.method,url:i.url,headerLines:i.headerLines,bodyText:o.bodyText};this.state.result={phase:"sending",sent:a};let c;try{c={phase:"done",sent:a,res:await Fa(o,i)}}catch(u){c={phase:"error",sent:a,message:u.message}}this.state.current===s.id&&(this.state.result=c)}clearResult(){this.state.result=null}collapseRequest(){this.rootRef.el.querySelectorAll(".tryit-card details").forEach((s,o)=>{o<hp&&(s.open=!1)})}toggleTheme(){this.state.themeOverride=this.theme==="dark"?"light":"dark"}readSystemTheme(){let s=document.documentElement.getAttribute("data-bs-theme"),o=s?s==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches;this.state.systemTheme=o?"dark":"light"}openAuth(){var o;let s=this.state;s.stored.apikey=Ts("apikey"),s.stored.oauthkey=Ts("oauthkey"),s.inputs.apikey=s.stored.apikey,s.inputs.oauthkey=s.stored.oauthkey;for(let{key:i,def:a}of this.authSchemes)(o=s.oauth)[i]??(o[i]={clientId:"",clientSecret:"",username:"",password:"",scopes:Object.keys(a.scopes||{})});s.authOpen=!0}closeAuth(){this.state.authOpen=!1}setAuthOpen(s){this.state.authOpen=s}setAuthInput(s,o){this.state.inputs[s]=o}setField(s,o,i){s[o]=i}saveAuth(){xn("apikey",this.state.inputs.apikey.trim()),xn("oauthkey",this.state.inputs.oauthkey.trim()),this.closeAuth(),this.applyAuthToAll()}clearAuth(s){xn(s,""),this.state.stored[s]="",this.state.inputs[s]="",this.applyAuthToAll()}applyAuthToAll(){for(let[s,o]of Object.entries(this.state.drafts))Ei(this.doc.findOperation(s),o);this.state.authed=Ai(),this.updateSnippet()}toggleScope(s,o){let i=this.state.oauth[s].scopes,a=i.indexOf(o);a<0?i.push(o):i.splice(a,1)}setOAuthStatus(s,o,i=!1){this.state.oauthStatus[s]={message:o,isError:i}}applyOAuthToken(s,o,i){xn("oauthkey",o),this.state.stored.oauthkey=o,this.state.inputs.oauthkey=o,Object.assign(this.state.oauth[s],{clientId:i.clientId,clientSecret:i.clientSecret}),this.applyAuthToAll(),this.setOAuthStatus(s,"Token acquired.")}async fetchToken(s,o,i){try{let a=await Va(this.doc.securityDefinitions[s].tokenUrl,o,this.selectedBaseUrl,this.doc);this.applyOAuthToken(s,a,i)}catch(a){this.setOAuthStatus(s,`Token request failed: ${a.message}. This is usually a CORS restriction on the auth server.`,!0)}}startOAuth2Flow(s){let o=this.doc.securityDefinitions[s],i=this.state.oauth[s],a=[...i.scopes];if(o.flow==="implicit"||o.flow==="accessCode")return this.openOAuthPopup(s,o,i,a);if(o.flow==="password"||o.flow==="application")return this.setOAuthStatus(s,"Requesting token\u2026"),this.fetchToken(s,Za(o.flow,i,a),i);this.setOAuthStatus(s,`Unsupported OAuth2 flow: ${o.flow}`,!0)}openOAuthPopup(s,o,i,a){if(!o.authorizationUrl)return this.setOAuthStatus(s,"No authorizationUrl defined for this scheme.",!0);let c=Wa(),u=Ka({def:o,clientId:i.clientId,scopes:a,state:c,redirectUri:this.redirectUri,baseUrl:this.selectedBaseUrl,doc:this.doc}),d=window.open(u,`oauth2-authorize-${s}`,"width=560,height=680");if(!d)return this.setOAuthStatus(s,"Popup blocked \u2014 allow popups for this site and try again.",!0);this.pendingOAuth.set(c,{key:s,flow:o.flow,fields:{...i}}),this.setOAuthStatus(s,"Waiting for authorization in the popup\u2026"),this.watchPopup(d,c,s)}watchPopup(s,o,i){let a=setInterval(()=>{s.closed&&(clearInterval(a),this.watchers.delete(a),this.pendingOAuth.delete(o)&&this.setOAuthStatus(i,"Authorization window was closed before completing.",!0))},500);this.watchers.add(a)}get redirectUri(){return this.props.oauthRedirectUri||new URL("oauth2-redirect.html",document.baseURI).href}handleOAuthMessage(s){let o=s.data;if(s.origin!==window.location.origin||o?.source!=="oauth2-redirect")return;let i=this.pendingOAuth.get(o.state);if(!i)return;this.pendingOAuth.delete(o.state);let{key:a,flow:c,fields:u}=i;if(o.error)return this.setOAuthStatus(a,`Authorization failed: ${o.error}${o.errorDescription?" - "+o.errorDescription:""}`,!0);if(c==="implicit")return o.accessToken?this.applyOAuthToken(a,o.accessToken,u):this.setOAuthStatus(a,"Authorization server did not return an access token.",!0);if(!o.code)return this.setOAuthStatus(a,"Authorization server did not return a code.",!0);this.setOAuthStatus(a,"Exchanging code for token\u2026"),this.fetchToken(a,{grant_type:"authorization_code",code:o.code,redirect_uri:this.redirectUri,client_id:u.clientId,client_secret:u.clientSecret},u)}addListeners(){this.readSystemTheme(),this.themeObserver=new MutationObserver(this.onThemeChange),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-bs-theme"]}),window.addEventListener("hashchange",this.onHashChange),window.addEventListener("message",this.onOAuthMessage),document.addEventListener("click",this.onDocumentClick),this.overlayQuery.addEventListener("change",this.onViewportChange)}removeListeners(){this.themeObserver?.disconnect(),window.removeEventListener("hashchange",this.onHashChange),window.removeEventListener("message",this.onOAuthMessage),document.removeEventListener("click",this.onDocumentClick),this.overlayQuery.removeEventListener("change",this.onViewportChange),this.watchers.forEach(clearInterval)}};r(Kt,"template","nodexui.ApiDoc"),r(Kt,"components",{ApiDocGroup:Vt,Markdown:Lt,Badge:At,Breadcrumb:we,BreadcrumbItem:Ae,BreadcrumbLink:Ee,BreadcrumbList:Se,BreadcrumbPage:Ce,BreadcrumbSeparator:Dt,Button:R,Checkbox:be,Dialog:ae,DialogContent:_t,DialogDescription:pe,DialogFooter:le,DialogHeader:ce,DialogTitle:ue,Icon:Z,Input:se,NativeSelect:me,TabContent:ie,Tabs:oe,TabsContainer:re,TabsList:ne,TabTrigger:$t,Textarea:he}),r(Kt,"props",{src:n(String),spec:n(Object),title:n(String),serverUrl:n(String),theme:n(String),themeToggle:n(Boolean),hash:n(Boolean),operation:n(String),tryIt:n(Boolean),authorize:n(Boolean),languages:n(Array),language:n(String),assetBase:n(String),oauthRedirectUri:n(String),height:n(String),onLoad:n(Function),onError:n(Function),onNavigate:n(Function),className:n(String),style:n([String,Object])});function Xa(t){let e=(t?.children||[]).filter(o=>o.type==="file"),s=e.find(o=>/^(readme|index)\.md$/i.test(o.name))||e[0];if(s)return s.path;for(let o of t?.children||[]){let i=o.type==="dir"?Xa(o):"";if(i)return i}return""}var Os=class extends l{constructor(){super(...arguments);r(this,"onHashChange",()=>{let s=this.pathFromHash();s&&(this.state.path=s)});r(this,"select",(s,o)=>{this.props.onNavigate?.(s,o),this.props.toHash?window.location.hash=this.props.toHash(s):this.props.hashPrefix?window.location.hash=this.props.hashPrefix+s:this.state.path=s})}setup(){this.state=I({path:""}),xt(()=>this.start()),nt(s=>{s.path&&s.path!==this.props.path&&(this.state.path=s.path)}),K(()=>window.addEventListener("hashchange",this.onHashChange)),G(()=>window.removeEventListener("hashchange",this.onHashChange))}get classNames(){return f("b-doc-viewer",{"b-doc-viewer-split":this.props.part},this.props.className)}get docSrc(){return(this.props.base??"/").replace(/\/?$/,"/")+this.state.path}async start(){let s=this.pathFromHash();if(s||this.props.path){this.state.path=s||this.props.path;return}let o=await fetch(this.props.tree).then(a=>a.json()),i=this.props.root?Hn(o,this.props.root)??o:o;this.state.path=Xa(i)}pathFromHash(){if(this.props.fromHash)return this.props.fromHash(window.location.hash);let s=this.props.hashPrefix,o=decodeURIComponent(window.location.hash);return s&&o.startsWith(s)?o.slice(s.length):""}};r(Os,"template","nodexui.DocViewer"),r(Os,"components",{Markdown:Lt,MarkdownTree:Wt}),r(Os,"props",{tree:{type:String},root:n(String),base:n(String),path:n(String),hashPrefix:n(String),part:n(String),include:n(Array),exclude:n(Array),filter:n(String),formatLabel:n(Function),toHash:n(Function),fromHash:n(Function),onNavigate:n(Function),className:n(String),style:n([String,Object])});function Qa(t=document.querySelector("[b-block-code-template]")){let o=((t?.tagName==="SCRIPT"?t.textContent:t?.innerHTML)?.replace(/^\n/,"").replace(/\s+$/,"")||"").split(`
44
+ `),i=o.filter(c=>c.trim()).map(c=>c.match(/^\s*/)?.[0].length||0),a=i.length?Math.min(...i):0;return o.map(c=>c.slice(a)).join(`
45
+ `)}function tc(t,e=0){let s=" ".repeat(e),o=[];for(let i of t.childNodes){if(i.nodeType===Node.TEXT_NODE){let u=i.textContent.trim();u&&o.push(`${s}${u}`);continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let a=[...i.attributes].map(u=>` ${u.name}="${u.value}"`).join("");if(![...i.childNodes].some(u=>u.nodeType===Node.ELEMENT_NODE||u.nodeType===Node.TEXT_NODE&&u.textContent.trim())){o.push(`${s}<${i.localName}${a}>${i.textContent.trim()}</${i.localName}>`);continue}o.push(`${s}<${i.localName}${a}>`),o.push(...tc(i,e+1)),o.push(`${s}</${i.localName}>`)}return o}async function ec(t){if(!t?.trim())return"";let{expandSelfClosingTags:e,extractTagCaseMap:s,normalizeOwlPreviewMarkup:o}=await Promise.resolve().then(()=>(bi(),Ra)),i=document.createElement("div");return i.innerHTML=e(t),o(i,s(t)),tc(i).join(`
46
+ `)}function sc(t){t.querySelectorAll('[b-block="dashboard-01"], [b-block^="sidebar-"]').forEach(e=>{let s=e.querySelector("[b-block-sidebar-toggle], button[aria-label='Toggle sidebar']"),o=e.querySelector("[b-block-sidebar]");!s||!o||(e.setAttribute("b-att-sidebar",e.getAttribute("b-att-sidebar")||"open"),s.setAttribute("b-block-sidebar-toggle",""),s.setAttribute("aria-expanded",e.getAttribute("b-att-sidebar")==="open"?"true":"false"),s.addEventListener("click",()=>{let i=e.getAttribute("b-att-sidebar")!=="open";e.setAttribute("b-att-sidebar",i?"open":"collapsed"),s.setAttribute("aria-expanded",i?"true":"false")}))}),t.querySelectorAll('[b-block^="sidebar-"] [b-block-subnav]').forEach(e=>{let s=e.previousElementSibling;s&&(s.setAttribute("b-block-subnav-toggle",""),s.setAttribute("aria-expanded","true"),e.setAttribute("b-att-state","open"),s.addEventListener("click",o=>{o.preventDefault();let i=e.getAttribute("b-att-state")!=="open";e.setAttribute("b-att-state",i?"open":"collapsed"),s.setAttribute("aria-expanded",i?"true":"false")}))})}var Wn=$e({storageKey:"b-example-theme",toggleSelector:"",labelSelector:""}),fp=[{key:"docs",label:"Docs",href:"/docs"},{key:"icons",label:"Icons",href:"/docs/icons"},{key:"examples",label:"Examples",href:"/examples/index.html"},{key:"blocks",label:"Blocks",href:"/blocks"}],gp={desktop:"",tablet:"768px",mobile:"390px"},vp="/dist/icons/lucide";function xp(){return document.querySelector("[b-block-code-template]")}function yp(t){return t.match(/<templates[^>]*>([\s\S]*)<\/templates>/)?.[1]||t}function wp(t){for(let e of t.querySelectorAll?.("[b-block] [b-icon], [b-block] [b-ui='icon']")||[])!e.hasAttribute("b-icon-base-url")&&!e.hasAttribute("b-att-base-url")&&e.setAttribute("b-icon-base-url",vp)}var Is=class extends l{setup(){this.navItems=this.props.navItems||fp,this.previewFrame=$("previewFrame"),this.embedRoot=$("embedRoot"),this.code=Qa(),this.state=I({mode:"preview",viewport:"desktop",copyLabel:"Copy code",embed:new URLSearchParams(globalThis.location.search).get("embed")==="1",codeVariant:"owl",staticTemplate:"",staticTemplateStatus:"idle"}),K(()=>this.mountPreview()),rt(()=>this.mountStaticNodexUI())}get activeCode(){return this.state.codeVariant==="template"?this.state.staticTemplateStatus==="ready"?this.state.staticTemplate:"Converting to a static template...":this.code}async setCodeVariant(e){if(this.state.codeVariant=e,e==="template"&&this.state.staticTemplateStatus==="idle"){this.state.staticTemplateStatus="loading";let s=await ec(this.code);this.state.staticTemplate=s,this.state.staticTemplateStatus="ready"}}get title(){return document.body.dataset.blockTitle||document.title||"Block"}get description(){return document.body.dataset.blockDescription||"Preview and copy this NodexUI block."}get previewStyle(){let e=gp[this.state.viewport]||"";return e?`max-width:${e}`:""}setMode(e){this.state.mode=e}setViewport(e){this.state.viewport=e}async copyCode(){await globalThis.navigator?.clipboard?.writeText(this.activeCode),this.state.copyLabel="Copied"}mountPreview(){this.state.embed&&(document.body.className="m-0");let e=this.state.embed?this.embedRoot.el:this.previewFrame.el,s=xp();if(!(!e||!s)){if(s.tagName==="SCRIPT"){this.mountOwlPreview(e,s);return}e.replaceChildren(s.content.cloneNode(!0)),this.mountStaticNodexUI(e),sc(e)}}async mountOwlPreview(e,s){e.replaceChildren();class o extends l{setup(){this.state=I({collapsed:!1})}}r(o,"template","examples.SidebarBlock");let i=[await Pe("/dist/nodexui.templates.xml"),s.textContent].map(yp).join(`
47
+ `);await Ps(o,e,{templates:`<templates>${i}</templates>`}),Wn.set(Wn.current(),{skipStorage:!0})}mountStaticNodexUI(e=document){wp(e),globalThis.thebase?.mountAll(e),Wn.set(Wn.current(),{skipStorage:!0})}};r(Is,"template","nodexui.BlockViewer"),r(Is,"components",{Button:R,Icon:Z,ThemeButton:Ht}),r(Is,"props",{navItems:n(Array)});var tn=class extends l{setup(){this.pwaState=I({open:at(this.props)}),z({pwa:this.pwaState,setPwaOpen:e=>this.setOpen(e)}),ft(this.pwaState)}setOpen(e){gt(this.props,this.pwaState,e)}};r(tn,"template","nodexui.Pwa"),r(tn,"props",{open:n(Boolean),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),slots:n(Object)});var Bs=class extends l{onClick(){this.env.setPwaOpen(!0)}};r(Bs,"template","nodexui.PwaTrigger"),r(Bs,"components",{Button:R}),r(Bs,"props",p);var en=class extends l{setup(){this.rootRef=$("root"),yt(e=>{if(!e)return;let s=document.activeElement;return co(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.pwa.open])}get open(){return this.env.pwa.open}onKeyDown(e){e.key==="Escape"&&this.env.setPwaOpen(!1)}onBackdropClick(e){e.target===this.rootRef.el&&this.env.setPwaOpen(!1)}};r(en,"template","nodexui.PwaContent"),r(en,"props",p);var sn=class extends l{};r(sn,"template","nodexui.PwaHeader"),r(sn,"props",p);var on=class extends l{};r(on,"template","nodexui.PwaTitle"),r(on,"props",p);var rn=class extends l{};r(rn,"template","nodexui.PwaDescription"),r(rn,"props",p);var nn=class extends l{};r(nn,"template","nodexui.PwaBody"),r(nn,"props",p);var an=class extends l{get steps(){return Array.isArray(this.props.steps)?this.props.steps:[]}};r(an,"template","nodexui.PwaSteps"),r(an,"props",{...p,steps:n(Array)});var cn=class extends l{};r(cn,"template","nodexui.PwaFooter"),r(cn,"props",p);var Rs=class extends l{onClick(){this.env.setPwaOpen(!1)}};r(Rs,"template","nodexui.PwaClose"),r(Rs,"components",{Button:R}),r(Rs,"props",p);var oc="",rc="";function nc(t,e){return typeof t=="string"?t:e}function Sp(t){return{title:t.submitted&&t.title.trim().length>0&&t.title.trim().length<5?"Bug title must be at least 5 characters.":"",description:t.submitted&&t.description.length>0&&t.description.length<20?"Description must be at least 20 characters.":""}}var Ms=class extends l{setup(){this.state=I({title:nc(this.props.title,oc),description:nc(this.props.description,rc),submitted:!1})}get classNames(){return f("b-form",this.props.className)}get titlePlaceholder(){return this.props.titlePlaceholder||"Login button not working on mobile"}get descriptionPlaceholder(){return this.props.descriptionPlaceholder||"I'm having an issue with the login button on mobile."}get maxDescriptionLength(){return this.props.maxDescriptionLength||100}get descriptionLength(){return this.state.description.length}get errors(){return Sp(this.state)}get titleInvalid(){return!!this.errors.title}get descriptionInvalid(){return!!this.errors.description}reset(){this.state.title=oc,this.state.description=rc,this.state.submitted=!1}submit(e){e.preventDefault(),this.state.submitted=!0,!this.titleInvalid&&!this.descriptionInvalid&&this.props.onSubmit?.({title:this.state.title.trim(),description:this.state.description})}};r(Ms,"template","nodexui.Form"),r(Ms,"components",{Button:R,Field:Ie,FieldDescription:Re,FieldError:Me,FieldGroup:Oe,FieldLabel:Be}),r(Ms,"props",{title:n(String),description:n(String),titlePlaceholder:n(String),descriptionPlaceholder:n(String),maxDescriptionLength:n(Number),className:n(String),style:n([String,Object]),onSubmit:n(Function)});var Li;function Ap(){return Li??(Li=import("./runtime/milkdown/milkdown-text-editor.js")),Li}async function Kn(t){return(await Ap()).createMilkdownTextEditor(t)}function Vn({collaborative:t,providerType:e,url:s}={}){return!!t||!!(e&&s)}var ln=class extends l{setup(){this.editorRef=$("editor"),this.editorHandle=null,this.mountPromise=null,this.mountToken=0,this.isDestroyed=!1,this.state=I({content:"",status:"loading",error:""}),xt(()=>this.load(this.props)),nt(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),K(()=>this.mountEditor()),rt(()=>this.mountEditor()),qe(()=>{this.isDestroyed=!0,this.destroyEditor()})}get classNames(){return f("b-text-editor",this.props.className)}get isCollaborative(){return Vn({collaborative:this.props.collaborative,providerType:this.props.provider,url:this.props.url})}get editorLabel(){return this.isCollaborative?"Collaborative rich text editor":"Rich text editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src}shouldRestartEditor(e){return e.collaborative!==this.props.collaborative||e.provider!==this.props.provider||e.room!==this.props.room||e.url!==this.props.url||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=e.content??"";if(e.src)try{let o=await fetch(e.src);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);s=await o.text()}catch(o){this.state.status="error",this.state.error=o.message||String(o);return}this.state.content=s,this.state.status="ready"}async mountEditor(){let e=this.editorRef.el;if(this.isDestroyed||!e||this.editorHandle||this.mountPromise||this.state.status!=="ready")return;let s=++this.mountToken;return this.mountPromise=(async()=>{try{let o=await Kn({root:e,value:this.state.content,placeholder:this.props.placeholder,collaborative:this.isCollaborative,providerType:this.props.provider,room:this.props.room||"b-text-editor",url:this.props.url,password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(i,a,c)=>{this.state.content=i,this.props.onChange?.(i,a,c)}});if(s!==this.mountToken){o.destroy?.();return}this.editorHandle=o}catch(o){s===this.mountToken&&(this.state.status="error",this.state.error=o.message||String(o))}finally{this.mountPromise=null,this.isDestroyed||this.mountEditor()}})(),this.mountPromise}destroyEditor(){this.mountToken++,this.editorHandle?.destroy?.(),this.editorHandle=null}};r(ln,"template","nodexui.TextEditor"),r(ln,"props",{content:n(String),src:n(String),placeholder:n(String),collaborative:n(Boolean),provider:n(String),room:n(String),url:n(String),password:n(String),signaling:n(Array),user:n(Object),onChange:n(Function),className:n(String),style:n([String,Object])});function Ep(t){let{open:e,close:s,destroy:o}=Bn(t,{closeSelector:"[b-alert-dialog-cancel], [b-alert-dialog-action], [b-alert-dialog-close]",trapFocus:!0});return t.setAttribute("role","alertdialog"),t.NodexUIAlertDialog={open:e,close:s},{destroy:()=>{o(),delete t.NodexUIAlertDialog}}}m.register("alert-dialog",{type:"owl",mount:Ep});var Ti={default:"b-alert-default",destructive:"b-alert-destructive",info:"b-alert-default",success:"alert-success",warning:"alert-warning",danger:"b-alert-destructive"};function Cp(t){t.classList.add("alert","b-alert",Ti[t.getAttribute("b-att-variant")||"default"]||Ti.default),t.setAttribute("role",t.getAttribute("role")||"alert");let e=null;if(!!t.getAttribute("b-att-dismissible")){if(t.classList.add("alert-dismissible","fade","show"),!t.querySelector('[data-bs-dismiss="alert"]')){let o=document.createElement("button");o.type="button",o.className="btn-close",o.setAttribute("data-bs-dismiss","alert"),o.setAttribute("aria-label","Close"),t.appendChild(o)}e=new(j()).Alert(t)}return{destroy:()=>{e?.dispose(),t.classList.remove("alert","b-alert","alert-dismissible","fade","show",...Object.values(Ti))}}}m.register("alert",{type:"static",mount:Cp});function ic(t,e){return t.getAttribute(e)!=="false"}function kp(t){let e=t.getAttribute("b-att-templates");if(e)return e;let s=[...document.scripts].find(o=>/\/nodexui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(o.src));return s?s.src.replace(/[?#].*$/,"").replace(/[^/]*$/,"nodexui.templates.xml"):"/dist/nodexui.templates.xml"}function Lp(t){let e=(o,i)=>t.dispatchEvent(new CustomEvent(`nodexui:${o}`,{bubbles:!0,detail:i})),s=t.getAttribute("b-att-languages");return{src:t.getAttribute("b-att-src")||void 0,title:t.getAttribute("b-att-title")||void 0,serverUrl:t.getAttribute("b-att-server-url")||void 0,theme:t.getAttribute("b-att-theme")||void 0,themeToggle:t.getAttribute("b-att-theme-toggle")==="true",hash:t.getAttribute("b-att-hash")==="true",operation:t.getAttribute("b-att-operation")||void 0,tryIt:ic(t,"b-att-try-it"),authorize:ic(t,"b-att-authorize"),languages:s?s.split(",").map(o=>o.trim()).filter(Boolean):void 0,language:t.getAttribute("b-att-language")||void 0,assetBase:t.getAttribute("b-att-asset-base")??void 0,oauthRedirectUri:t.getAttribute("b-att-oauth-redirect-uri")||void 0,height:t.getAttribute("b-att-height")||void 0,onLoad:o=>e("load",{info:o.info,operations:o.groups.flatMap(i=>i.items).length}),onError:o=>e("error",{error:o}),onNavigate:o=>e("navigate",{id:o})}}function Np(t){let e=Lp(t),s=Pe(kp(t)).then(o=>Ps(Kt,t,{templates:o,props:e}));return{destroy:async()=>{(await s).destroy()}}}m.register("apidoc",{type:"owl",mount:Np});function Tp(t){let e=[...t.querySelectorAll("[b-accordion-item]")],s=t.getAttribute("b-att-multiple")==="true",o=new Map,i=new Map,a=new Map,c=(u,d)=>{let v=u.querySelector("[b-accordion-trigger]");u.setAttribute("b-att-state",d?"open":"closed"),v?.setAttribute("aria-expanded",String(d)),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{open:d}}))};return t.setAttribute("role","presentation"),t.classList.add("accordion"),e.forEach((u,d)=>{let v=u.querySelector("[b-accordion-trigger]"),S=u.querySelector("[b-accordion-panel]");if(!S)return;u.classList.add("accordion-item"),v?.classList.add("accordion-button"),S.classList.add("accordion-collapse");let P=S.id||`b-accordion-panel-${d}`;S.id=P;let U=u.getAttribute("b-att-state")==="open";S.classList.add("collapse"),U&&S.classList.add("show");let Y=new(j()).Collapse(S,{toggle:!1});a.set(u,Y);let ot=()=>c(u,!0),J=()=>c(u,!1);S.addEventListener("shown.bs.collapse",ot),S.addEventListener("hidden.bs.collapse",J),i.set(u,{onShown:ot,onHidden:J}),v?.setAttribute("aria-expanded",String(U)),v?.setAttribute("aria-controls",P);let Q=()=>{let vt=S.classList.contains("show");!s&&!vt&&e.forEach(N=>{if(N===u)return;let M=a.get(N),k=N.querySelector("[b-accordion-panel]");M&&k?.classList.contains("show")&&M.hide()}),vt?Y.hide():Y.show()};o.set(u,Q),v?.addEventListener("click",Q)}),{destroy:()=>{e.forEach(u=>{let d=u.querySelector("[b-accordion-trigger]"),v=u.querySelector("[b-accordion-panel]");d?.removeEventListener("click",o.get(u));let S=i.get(u);v&&S&&(v.removeEventListener("shown.bs.collapse",S.onShown),v.removeEventListener("hidden.bs.collapse",S.onHidden)),a.get(u)?.dispose()}),o.clear(),i.clear(),a.clear()}}}m.register("accordion",{type:"owl",mount:Tp});function Op(t){let e=t.getAttribute("b-att-ratio")||`${t.getAttribute("b-att-width")||16} / ${t.getAttribute("b-att-height")||9}`;return t.classList.add("b-aspect-ratio"),t.style.setProperty("--b-aspect-ratio",e),{destroy:()=>t.classList.remove("b-aspect-ratio")}}m.register("aspect-ratio",{type:"static",mount:Op});var Ip=["idle","uploading","processing","error","done"],Bp=["default","sm","xs"],Rp=["content","title","description","actions"];function ac(t,e){t.classList.add(`b-attachment-${e}`),t.setAttribute("data-slot",`attachment-${e}`)}function Mp(t){let e=t.querySelector("input[type='file']"),s=t.querySelector("[b-attachment-list]"),o=Ip.includes(t.getAttribute("b-att-state"))?t.getAttribute("b-att-state"):"done",i=Bp.includes(t.getAttribute("b-att-size"))?t.getAttribute("b-att-size"):"default",a=t.getAttribute("b-att-orientation")==="vertical"?"vertical":"horizontal";t.classList.add("b-attachment"),t.classList.add(`b-attachment-${o}`,`b-attachment-${i}`,`b-attachment-${a}`),t.setAttribute("data-state",o),t.setAttribute("data-size",i),t.setAttribute("data-orientation",a),t.setAttribute("data-slot","attachment"),e&&t.classList.add("b-attachment-picker"),t.querySelectorAll("[b-attachment-media]").forEach(u=>{let d=u.getAttribute("b-att-variant")==="image"?"image":"icon";ac(u,"media"),u.classList.add(`b-attachment-media-${d}`),u.setAttribute("data-variant",d)}),Rp.forEach(u=>t.querySelectorAll(`[b-attachment-${u}]`).forEach(d=>ac(d,u))),t.querySelectorAll("[b-attachment-action]").forEach(u=>{let d=dt[u.getAttribute("b-att-variant")]||dt.ghost,v=mt[u.getAttribute("b-att-size")]||mt["icon-xs"];u.classList.add("btn","b-button",d,v,"b-button-icon","b-attachment-action"),u.setAttribute("data-slot","attachment-action"),!u.getAttribute("type")&&u.tagName==="BUTTON"&&u.setAttribute("type","button")}),t.querySelectorAll("[b-attachment-trigger]").forEach(u=>{u.classList.add("b-attachment-trigger"),u.setAttribute("data-slot","attachment-trigger"),!u.getAttribute("type")&&u.tagName==="BUTTON"&&u.setAttribute("type","button")}),e?.classList.add("form-control");let c=()=>{s&&(s.innerHTML=[...e.files].map(u=>`<li>${u.name}</li>`).join("")),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{files:[...e.files]}}))};return e?.addEventListener("change",c),{destroy:()=>e?.removeEventListener("change",c)}}function $p(t){return t.classList.add("b-attachment-group"),t.setAttribute("data-slot","attachment-group"),{destroy:()=>t.classList.remove("b-attachment-group")}}function _p(t){let e=t.querySelector("input[type='file']");t.classList.add("b-attachment-dropzone"),t.setAttribute("data-slot","attachment-dropzone");let s=()=>e?.click(),o=d=>{d.preventDefault(),t.classList.add("b-attachment-dropzone-dragging")},i=()=>t.classList.remove("b-attachment-dropzone-dragging"),a=d=>{d.length&&t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{files:d}}))},c=d=>{d.preventDefault(),t.classList.remove("b-attachment-dropzone-dragging"),a([...d.dataTransfer?.files??[]])},u=()=>{a([...e?.files??[]]),e&&(e.value="")};return t.addEventListener("click",s),t.addEventListener("dragover",o),t.addEventListener("dragleave",i),t.addEventListener("drop",c),e?.addEventListener("change",u),{destroy:()=>{t.removeEventListener("click",s),t.removeEventListener("dragover",o),t.removeEventListener("dragleave",i),t.removeEventListener("drop",c),e?.removeEventListener("change",u)}}}m.register("attachment",{type:"owl",mount:Mp});m.register("attachment-group",{type:"static",mount:$p});m.register("attachment-dropzone",{type:"static",mount:_p});function Up(t){t.classList.add("b-avatar");let e=t.querySelector("img"),s=t.querySelector("[b-avatar-fallback]");if(e&&s){let o=()=>{e.hidden=!0,s.hidden=!1};return s.hidden=!!e.getAttribute("src"),e.addEventListener("error",o),{destroy:()=>e.removeEventListener("error",o)}}return{}}m.register("avatar",{type:"static",mount:Up});function Pp(t){let e=De[t.getAttribute("b-att-variant")||"secondary"]||De.secondary;return t.classList.add("badge",e),t.getAttribute("b-att-pill")==="true"&&t.classList.add("rounded-pill"),{destroy:()=>t.classList.remove("badge","rounded-pill",...Object.values(De))}}m.register("badge",{type:"static",mount:Pp});function cc(t){return[...t.children].filter(e=>!e.matches("[b-breadcrumb-separator], .b-breadcrumb-separator"))}function uc(t,e,s){return ct(t,e,{size:s}),t}function qp(){let t=document.createElement("li"),e=document.createElement("span");return t.setAttribute("b-breadcrumb-separator",""),t.setAttribute("data-slot","breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),t.className="b-breadcrumb-separator",e.className="b-breadcrumb-separator-icon",t.append(uc(e,"chevron-right","var(--b3_5)")),t}function Dp(t){t.classList.add("b-breadcrumb-separator"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true")}function jp(t){if(t.classList.add("b-breadcrumb-ellipsis"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-ellipsis"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),!t.querySelector(".b-icon")){let e=document.createElement("span");e.className="b-breadcrumb-ellipsis-icon",t.prepend(uc(e,"ellipsis","var(--b4)"))}if(!t.querySelector(".visually-hidden")){let e=document.createElement("span");e.className="visually-hidden",e.textContent="More",t.append(e)}}function lc(t){t.classList.add("b-breadcrumb-page"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-page"),t.setAttribute("role",t.getAttribute("role")||"link"),t.setAttribute("aria-disabled","true"),t.setAttribute("aria-current","page")}function Fp(t){let e=t.querySelector("ol, ul")||t;t.classList.add("b-breadcrumb"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb"),t.setAttribute("aria-label",t.getAttribute("aria-label")||"breadcrumb"),e.classList.add("breadcrumb","b-breadcrumb-list"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"breadcrumb-list");for(let o of e.querySelectorAll("[b-breadcrumb-separator], .b-breadcrumb-separator"))Dp(o);for(let o of e.querySelectorAll("[b-breadcrumb-ellipsis], .b-breadcrumb-ellipsis"))jp(o);for(let o of e.querySelectorAll("[b-breadcrumb-page], .b-breadcrumb-page"))lc(o);e.querySelector("[b-breadcrumb-separator], .b-breadcrumb-separator")||cc(e).slice(0,-1).forEach(i=>i.after(qp()));let s=cc(e);return s.forEach((o,i)=>{o.classList.add("b-breadcrumb-item"),o.setAttribute("data-slot",o.getAttribute("data-slot")||"breadcrumb-item");for(let a of o.querySelectorAll("a"))a.classList.add("b-breadcrumb-link"),a.setAttribute("data-slot",a.getAttribute("data-slot")||"breadcrumb-link");if(i===s.length-1){let a=o.querySelector("[b-breadcrumb-page], .b-breadcrumb-page");a?lc(a):(o.classList.add("b-breadcrumb-page"),o.setAttribute("aria-current",o.getAttribute("aria-current")||"page"))}}),{destroy:()=>{t.classList.remove("b-breadcrumb"),e.classList.remove("breadcrumb","b-breadcrumb-list");for(let o of e.querySelectorAll("[b-breadcrumb-separator]"))o.remove()}}}m.register("breadcrumb",{type:"owl",mount:Fp});function zp(t){return t.classList.add("b-bubble"),t.getAttribute("role")||t.setAttribute("role","listitem"),{destroy:()=>t.classList.remove("b-bubble")}}m.register("bubble",{type:"static",mount:zp});function Hp(t){return[...t.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE&&e.textContent.trim()).map(e=>{let s=document.createElement("span");return s.textContent=e.textContent.trim(),e.replaceWith(s),s})}function Wp(t){let e=t.getAttribute("b-att-icon"),s=t.getAttribute("b-att-icon-position")==="end"?"end":"start",o=!!t.textContent.trim(),i=e&&o?Hp(t):[],a=null;return t.classList.add("btn","b-button",dt[t.getAttribute("b-att-variant")||"default"]||"btn-primary"),mt[t.getAttribute("b-att-size")]&&t.classList.add(mt[t.getAttribute("b-att-size")]),t.dataset.slot="button",e&&(a=document.createElement("span"),a.setAttribute("b-icon",e),a.dataset.icon=`inline-${s}`,ct(a,e,{label:""}),t.insertBefore(a,s==="end"?null:t.firstChild),t.dataset.icon=`inline-${s}`,o||(t.dataset.iconOnly="true",t.classList.add("b-button-icon"))),{destroy:()=>{a?.remove();for(let c of i)c.replaceWith(document.createTextNode(c.textContent));t.classList.remove("btn","b-button","b-button-icon",...Object.values(dt),...Object.values(mt)),t.removeAttribute("data-slot"),t.removeAttribute("data-icon"),t.removeAttribute("data-icon-only")}}}m.register("button",{type:"static",mount:Wp});function Kp(t){let e=t.getAttribute("b-att-orientation")==="vertical",s=t.getAttribute("b-att-size"),o=[...t.querySelectorAll("[b-button-group-separator]")],i=[...t.querySelectorAll("[b-button-group-text]")];return t.classList.add("b-button-group",e?"btn-group-vertical":"btn-group"),(s==="sm"||s==="lg")&&t.classList.add(`btn-group-${s}`),t.setAttribute("role",t.getAttribute("role")||"group"),o.forEach(a=>{let c=a.getAttribute("b-att-orientation")==="horizontal"?"horizontal":"vertical";a.classList.add("b-button-group-separator",`b-button-group-separator-${c}`),a.setAttribute("data-orientation",c),a.setAttribute("role","separator")}),i.forEach(a=>{a.classList.add("b-button-group-text")}),{destroy:()=>{t.classList.remove("b-button-group","btn-group","btn-group-vertical","btn-group-sm","btn-group-lg")}}}m.register("button-group",{type:"static",mount:Kp});var Vp=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"});function Zp(t){let e=t.getAttribute("b-att-selected")?new Date(`${t.getAttribute("b-att-selected")}T00:00:00`):new Date,s=Number(t.getAttribute("b-att-month")??e.getMonth()+1)-1,o=Number(t.getAttribute("b-att-year")??e.getFullYear()),i=new Date(o,s,1),a=new Date(o,s+1,0).getDate(),c=i.getDay();t.classList.add("b-calendar"),t.querySelector("[b-calendar-grid]")||(t.innerHTML=`
48
+ <div class="b-calendar__header">${Vp.format(i)}</div>
38
49
  <div class="b-calendar__weekdays">${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(v=>`<span>${v}</span>`).join("")}</div>
39
50
  <div b-calendar-grid class="b-calendar__grid"></div>
40
- `);let p=t.querySelector("[b-calendar-grid]");p.innerHTML="";for(let v=0;v<l;v+=1)p.append(document.createElement("span"));for(let v=1;v<=a;v+=1){let k=document.createElement("button"),O=`${o}-${String(s+1).padStart(2,"0")}-${String(v).padStart(2,"0")}`;k.type="button",k.textContent=String(v),k.setAttribute("b-att-value",O),k.setAttribute("aria-pressed",String(O===t.getAttribute("b-att-selected"))),p.append(k)}let b=v=>{let k=v.target.closest("button[b-att-value]");k&&(t.setAttribute("b-att-selected",k.getAttribute("b-att-value")),p.querySelectorAll("button").forEach(O=>O.setAttribute("aria-pressed",String(O===k))),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:k.getAttribute("b-att-value")}})))};return p.addEventListener("click",b),{destroy:()=>p.removeEventListener("click",b)}}h.register("calendar",{type:"owl",mount:fp});U();function gp(t){return t.classList.add("card","b-card"),t.querySelector("[b-card-header]")?.classList.add("card-header"),t.querySelector("[b-card-body]")?.classList.add("card-body"),t.querySelector("[b-card-footer]")?.classList.add("card-footer"),{destroy:()=>t.classList.remove("card","b-card")}}h.register("card",{type:"static",mount:gp});U();function vp(t){let e=[...t.querySelectorAll("[b-carousel-slide]")],s=t.querySelector("[b-carousel-prev]"),o=t.querySelector("[b-carousel-next]");if(t.classList.add("carousel","slide"),e.length&&!e[0].parentElement.classList.contains("carousel-inner")){let v=document.createElement("div");v.classList.add("carousel-inner"),e[0].before(v),e.forEach(k=>v.appendChild(k))}let n=Math.max(0,e.findIndex(v=>v.getAttribute("b-att-state")==="active"));e.forEach((v,k)=>{v.classList.add("carousel-item"),k===n&&v.classList.add("active"),v.setAttribute("b-att-state",k===n?"active":"inactive")});let a=e.length?new(W()).Carousel(t,{interval:!1,wrap:!0,touch:!0}):null,l=v=>{e.forEach((k,O)=>{k.setAttribute("b-att-state",O===v.to?"active":"inactive")}),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{index:v.to}}))};t.addEventListener("slid.bs.carousel",l);let p=()=>a?.prev(),b=()=>a?.next();return s?.addEventListener("click",p),o?.addEventListener("click",b),{destroy:()=>{s?.removeEventListener("click",p),o?.removeEventListener("click",b),t.removeEventListener("slid.bs.carousel",l),a?.dispose()}}}h.register("carousel",{type:"owl",mount:vp});U();function Ja(t,e,s=0){let o=Number(t.getAttribute(e));return Number.isFinite(o)?o:s}function xp(t){let e=t.getAttribute("b-att-config")||t.querySelector("script[type='application/json']")?.textContent;if(!e)return null;try{return JSON.parse(e)}catch{return null}}function yp(t,e){let s=globalThis.getComputedStyle(t),o=[1,2,3,4,5].map(l=>s.getPropertyValue(`--b-chart-${l}`).trim()),n=s.getPropertyValue("--b-muted-foreground").trim(),a=s.getPropertyValue("--b-chart-grid").trim()||s.getPropertyValue("--b-border").trim();return e.options={maintainAspectRatio:!1,plugins:{legend:{labels:{boxWidth:8,boxHeight:8,color:n,font:{size:12}}},tooltip:{titleFont:{size:12},bodyFont:{size:12},cornerRadius:10,padding:10},...e.options?.plugins||{}},scales:{x:{border:{display:!1},grid:{display:!1},ticks:{color:n,font:{size:12}}},y:{border:{display:!1},grid:{color:a},ticks:{color:n,font:{size:12}}},...e.options?.scales||{}},...e.options},e.data?.datasets?.forEach((l,p)=>{l.backgroundColor||(l.backgroundColor=o[p%o.length]),l.borderColor||(l.borderColor=o[p%o.length]),l.borderRadius??(l.borderRadius=4)}),e}function wp(t,e,s){if(t.querySelector("[b-chart-tooltip]"))return;let o=document.createElement("span");o.setAttribute("b-chart-tooltip",""),o.textContent=`${e}: ${s}`,t.append(o)}function Ap(t){t.classList.add("b-chart"),t.setAttribute("role",t.getAttribute("role")||"figure");let e=t.querySelector("canvas"),s=null;if(e&&globalThis.Chart){let a=xp(t);a&&(s=new globalThis.Chart(e,yp(t,a)))}let o=[...t.querySelectorAll("[b-att-value]")],n=Math.max(1,...o.map(a=>Ja(a,"b-att-value")));return o.forEach((a,l)=>{let p=Ja(a,"b-att-value"),b=a.getAttribute("b-att-label")||a.textContent.trim()||`Series ${l+1}`,v=Math.max(0,Math.min(100,p/n*100));a.style.setProperty("--b-chart-value",`${v}%`),a.style.setProperty("--b-chart-index",String(l%5+1)),a.style.setProperty("--b-chart-color",`var(--b-chart-${l%5+1})`),a.setAttribute("role",a.getAttribute("role")||"listitem"),a.setAttribute("aria-label",a.getAttribute("aria-label")||`${b} ${p}`),wp(a,b,p)}),[...t.querySelectorAll("[b-chart-series], [b-chart-legend] > *")].forEach((a,l)=>{a.style.setProperty("--b-chart-color",a.style.getPropertyValue("--b-chart-color")||`var(--b-chart-${l%5+1})`)}),{destroy:()=>{s?.destroy?.(),t.classList.remove("b-chart")}}}h.register("chart",{type:"static",mount:Ap});U();function Ji(t,e){let s=t.matches("input")?t:t.querySelector(`input[type='${e}']`),o=t.matches("input")?t.closest("label, .form-check"):t;return s?.classList.add("form-check-input"),o?.classList.add("form-check","b-check"),{destroy:()=>{s?.classList.remove("form-check-input"),o?.classList.remove("form-check","b-check")}}}h.register("checkbox",{type:"static",mount:t=>Ji(t,"checkbox")});U();It();Ri();function Sp(t){let e=t.getAttribute("b-att-value");if(e!==null)return e;let s=t.getAttribute("b-att-target");if(s){let o=document.querySelector(s);if(o)return o.textContent??""}return t.textContent??""}function Ep(t){t.classList.remove(...an),t.className=`${t.className} ${Bi({variant:t.getAttribute("b-att-variant")||"default",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button";let e=t.querySelector("[b-clipboard-button-icon]");e||(e=document.createElement("span"),e.setAttribute("b-clipboard-button-icon",""),t.prepend(e));let s=t.getAttribute("b-att-icon")||"copy",o=t.getAttribute("b-att-copied-icon")||"check";ut(e,s,{label:""});let n=null,a=async()=>{if(t.disabled)return;let l=Sp(t);try{await Ws(l),ut(e,o,{label:""}),t.setAttribute("data-copied","true"),t.dispatchEvent(new CustomEvent("nodexui:clipboard-copy",{bubbles:!0,detail:{value:l}})),window.clearTimeout(n),n=window.setTimeout(()=>{ut(e,s,{label:""}),t.removeAttribute("data-copied")},Number(t.getAttribute("b-att-reset-delay"))||2e3)}catch(p){t.dispatchEvent(new CustomEvent("nodexui:clipboard-copy-error",{bubbles:!0,detail:{error:p}}))}};return t.addEventListener("click",a),{destroy:()=>{t.removeEventListener("click",a),window.clearTimeout(n),e.remove(),t.classList.remove(...an),t.removeAttribute("data-copied")}}}h.register("clipboard-button",{type:"static",mount:Ep});U();function Cp(t){let e=t.querySelector("[b-collapsible-trigger]"),s=t.querySelector("[b-collapsible-panel]"),o=v=>{t.setAttribute("b-att-state",v?"open":"closed"),e?.setAttribute("aria-expanded",String(v)),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{open:v}}))};if(!s){let v=()=>o(t.getAttribute("b-att-state")!=="open");return e?.setAttribute("aria-expanded",String(t.getAttribute("b-att-state")==="open")),e?.addEventListener("click",v),{destroy:()=>e?.removeEventListener("click",v)}}let n=t.getAttribute("b-att-state")==="open";s.classList.add("collapse"),n&&s.classList.add("show");let a=new(W()).Collapse(s,{toggle:!1}),l=()=>o(!0),p=()=>o(!1);s.addEventListener("shown.bs.collapse",l),s.addEventListener("hidden.bs.collapse",p),e?.setAttribute("aria-expanded",String(n));let b=()=>{s.classList.contains("show")?a.hide():a.show()};return e?.addEventListener("click",b),{destroy:()=>{e?.removeEventListener("click",b),s.removeEventListener("shown.bs.collapse",l),s.removeEventListener("hidden.bs.collapse",p),a.dispose()}}}h.register("collapsible",{type:"owl",mount:Cp});U();function kp(t){let e=t.querySelector("input"),s=t.querySelector("[b-combobox-list]"),o=()=>[...s?.querySelectorAll("[b-att-value]")||[]];t.classList.add("b-combobox"),e?.setAttribute("role","combobox"),e?.setAttribute("aria-expanded","false"),s?.setAttribute("role","listbox"),s&&(s.hidden=!0);let n=p=>{s&&(s.hidden=!p),e?.setAttribute("aria-expanded",String(p))},a=()=>{let p=e.value.toLowerCase();o().forEach(b=>{b.hidden=!b.textContent.toLowerCase().includes(p)}),n(!0)},l=p=>{let b=p.target.closest("[b-att-value]");b&&(e.value=b.textContent.trim(),t.setAttribute("b-att-value",b.getAttribute("b-att-value")),n(!1),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:b.getAttribute("b-att-value")}})))};return e?.addEventListener("input",a),e?.addEventListener("focus",()=>n(!0)),s?.addEventListener("click",l),{destroy:()=>{e?.removeEventListener("input",a),s?.removeEventListener("click",l)}}}h.register("combobox",{type:"owl",mount:kp});U();function Lp(t){let e=t.querySelector("input"),s=()=>[...t.querySelectorAll("[b-command-item]")];t.classList.add("b-command"),t.setAttribute("role",t.getAttribute("role")||"dialog"),e?.classList.add("form-control");let o=()=>{let a=(e?.value||"").toLowerCase();s().forEach(l=>{l.hidden=!l.textContent.toLowerCase().includes(a)})},n=a=>{let l=a.target.closest("[b-command-item]");l&&t.dispatchEvent(new CustomEvent("nodexui:select",{bubbles:!0,detail:{value:l.getAttribute("b-att-value")||l.textContent.trim()}}))};return e?.addEventListener("input",o),t.addEventListener("click",n),{destroy:()=>{e?.removeEventListener("input",o),t.removeEventListener("click",n)}}}h.register("command",{type:"owl",mount:Lp});U();function Np(t){let e=t.querySelector("[b-context-menu-content]");if(!e)return{};e.hidden=!0,e.setAttribute("role","menu");let s=a=>{a.preventDefault(),e.hidden=!1,e.style.left=`${a.clientX}px`,e.style.top=`${a.clientY}px`,t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},o=()=>{e.hidden=!0,t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))},n=a=>{a.key==="Escape"&&o()};return t.addEventListener("contextmenu",s),document.addEventListener("click",o),t.addEventListener("keydown",n),{destroy:()=>{t.removeEventListener("contextmenu",s),document.removeEventListener("click",o),t.removeEventListener("keydown",n)}}}h.register("context-menu",{type:"owl",mount:Np});U();It();var Ya=[["728ed52f","Success","ken99@example.com","$316.00"],["489e1d42","Success","abe45@example.com","$242.00"],["6b0888f6","Processing","monserrat44@example.com","$837.00"],["a1dc8c4e","Success","silas22@example.com","$874.00"],["15b96de0","Failed","carmella@example.com","$721.00"]];function Op(t){t.querySelector("table")||(t.innerHTML=`
51
+ `);let u=t.querySelector("[b-calendar-grid]");u.innerHTML="";for(let v=0;v<c;v+=1)u.append(document.createElement("span"));for(let v=1;v<=a;v+=1){let S=document.createElement("button"),P=`${o}-${String(s+1).padStart(2,"0")}-${String(v).padStart(2,"0")}`;S.type="button",S.textContent=String(v),S.setAttribute("b-att-value",P),S.setAttribute("aria-pressed",String(P===t.getAttribute("b-att-selected"))),u.append(S)}let d=v=>{let S=v.target.closest("button[b-att-value]");S&&(t.setAttribute("b-att-selected",S.getAttribute("b-att-value")),u.querySelectorAll("button").forEach(P=>P.setAttribute("aria-pressed",String(P===S))),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:S.getAttribute("b-att-value")}})))};return u.addEventListener("click",d),{destroy:()=>u.removeEventListener("click",d)}}m.register("calendar",{type:"owl",mount:Zp});function Gp(t){return t.classList.add("card","b-card"),t.querySelector("[b-card-header]")?.classList.add("card-header"),t.querySelector("[b-card-body]")?.classList.add("card-body"),t.querySelector("[b-card-footer]")?.classList.add("card-footer"),{destroy:()=>t.classList.remove("card","b-card")}}m.register("card",{type:"static",mount:Gp});function Jp(t){let e=[...t.querySelectorAll("[b-carousel-slide]")],s=t.querySelector("[b-carousel-prev]"),o=t.querySelector("[b-carousel-next]");if(t.classList.add("carousel","slide"),e.length&&!e[0].parentElement.classList.contains("carousel-inner")){let v=document.createElement("div");v.classList.add("carousel-inner"),e[0].before(v),e.forEach(S=>v.appendChild(S))}let i=Math.max(0,e.findIndex(v=>v.getAttribute("b-att-state")==="active"));e.forEach((v,S)=>{v.classList.add("carousel-item"),S===i&&v.classList.add("active"),v.setAttribute("b-att-state",S===i?"active":"inactive")});let a=e.length?new(j()).Carousel(t,{interval:!1,wrap:!0,touch:!0}):null,c=v=>{e.forEach((S,P)=>{S.setAttribute("b-att-state",P===v.to?"active":"inactive")}),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{index:v.to}}))};t.addEventListener("slid.bs.carousel",c);let u=()=>a?.prev(),d=()=>a?.next();return s?.addEventListener("click",u),o?.addEventListener("click",d),{destroy:()=>{s?.removeEventListener("click",u),o?.removeEventListener("click",d),t.removeEventListener("slid.bs.carousel",c),a?.dispose()}}}m.register("carousel",{type:"owl",mount:Jp});function pc(t,e,s=0){let o=Number(t.getAttribute(e));return Number.isFinite(o)?o:s}function Yp(t){let e=t.getAttribute("b-att-config")||t.querySelector("script[type='application/json']")?.textContent;if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Xp(t,e){let s=globalThis.getComputedStyle(t),o=[1,2,3,4,5].map(c=>s.getPropertyValue(`--b-chart-${c}`).trim()),i=s.getPropertyValue("--b-muted-foreground").trim(),a=s.getPropertyValue("--b-chart-grid").trim()||s.getPropertyValue("--b-border").trim();return e.options={maintainAspectRatio:!1,plugins:{legend:{labels:{boxWidth:8,boxHeight:8,color:i,font:{size:12}}},tooltip:{titleFont:{size:12},bodyFont:{size:12},cornerRadius:10,padding:10},...e.options?.plugins||{}},scales:{x:{border:{display:!1},grid:{display:!1},ticks:{color:i,font:{size:12}}},y:{border:{display:!1},grid:{color:a},ticks:{color:i,font:{size:12}}},...e.options?.scales||{}},...e.options},e.data?.datasets?.forEach((c,u)=>{c.backgroundColor||(c.backgroundColor=o[u%o.length]),c.borderColor||(c.borderColor=o[u%o.length]),c.borderRadius??(c.borderRadius=4)}),e}function Qp(t,e,s){if(t.querySelector("[b-chart-tooltip]"))return;let o=document.createElement("span");o.setAttribute("b-chart-tooltip",""),o.textContent=`${e}: ${s}`,t.append(o)}function td(t){t.classList.add("b-chart"),t.setAttribute("role",t.getAttribute("role")||"figure");let e=t.querySelector("canvas"),s=null;if(e&&globalThis.Chart){let a=Yp(t);a&&(s=new globalThis.Chart(e,Xp(t,a)))}let o=[...t.querySelectorAll("[b-att-value]")],i=Math.max(1,...o.map(a=>pc(a,"b-att-value")));return o.forEach((a,c)=>{let u=pc(a,"b-att-value"),d=a.getAttribute("b-att-label")||a.textContent.trim()||`Series ${c+1}`,v=Math.max(0,Math.min(100,u/i*100));a.style.setProperty("--b-chart-value",`${v}%`),a.style.setProperty("--b-chart-index",String(c%5+1)),a.style.setProperty("--b-chart-color",`var(--b-chart-${c%5+1})`),a.setAttribute("role",a.getAttribute("role")||"listitem"),a.setAttribute("aria-label",a.getAttribute("aria-label")||`${d} ${u}`),Qp(a,d,u)}),[...t.querySelectorAll("[b-chart-series], [b-chart-legend] > *")].forEach((a,c)=>{a.style.setProperty("--b-chart-color",a.style.getPropertyValue("--b-chart-color")||`var(--b-chart-${c%5+1})`)}),{destroy:()=>{s?.destroy?.(),t.classList.remove("b-chart")}}}m.register("chart",{type:"static",mount:td});function Zn(t,e){let s=t.matches("input")?t:t.querySelector(`input[type='${e}']`),o=t.matches("input")?t.closest("label, .form-check"):t;return s?.classList.add("form-check-input"),o?.classList.add("form-check","b-check"),{destroy:()=>{s?.classList.remove("form-check-input"),o?.classList.remove("form-check","b-check")}}}m.register("checkbox",{type:"static",mount:t=>Zn(t,"checkbox")});function ed(t){let e=t.getAttribute("b-att-value");if(e!==null)return e;let s=t.getAttribute("b-att-target");if(s){let o=document.querySelector(s);if(o)return o.textContent??""}return t.textContent??""}function sd(t){t.classList.remove(...ii),t.className=`${t.className} ${kn({variant:t.getAttribute("b-att-variant")||"default",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button";let e=t.querySelector("[b-clipboard-button-icon]");e||(e=document.createElement("span"),e.setAttribute("b-clipboard-button-icon",""),t.prepend(e));let s=t.getAttribute("b-att-icon")||"copy",o=t.getAttribute("b-att-copied-icon")||"check";ct(e,s,{label:""});let i=null,a=async()=>{if(t.disabled)return;let c=ed(t);try{await Ds(c),ct(e,o,{label:""}),t.setAttribute("data-copied","true"),t.dispatchEvent(new CustomEvent("nodexui:clipboard-copy",{bubbles:!0,detail:{value:c}})),window.clearTimeout(i),i=window.setTimeout(()=>{ct(e,s,{label:""}),t.removeAttribute("data-copied")},Number(t.getAttribute("b-att-reset-delay"))||2e3)}catch(u){t.dispatchEvent(new CustomEvent("nodexui:clipboard-copy-error",{bubbles:!0,detail:{error:u}}))}};return t.addEventListener("click",a),{destroy:()=>{t.removeEventListener("click",a),window.clearTimeout(i),e.remove(),t.classList.remove(...ii),t.removeAttribute("data-copied")}}}m.register("clipboard-button",{type:"static",mount:sd});function od(t){let e=t.querySelector("[b-collapsible-trigger]"),s=t.querySelector("[b-collapsible-panel]"),o=v=>{t.setAttribute("b-att-state",v?"open":"closed"),e?.setAttribute("aria-expanded",String(v)),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{open:v}}))};if(!s){let v=()=>o(t.getAttribute("b-att-state")!=="open");return e?.setAttribute("aria-expanded",String(t.getAttribute("b-att-state")==="open")),e?.addEventListener("click",v),{destroy:()=>e?.removeEventListener("click",v)}}let i=t.getAttribute("b-att-state")==="open";s.classList.add("collapse"),i&&s.classList.add("show");let a=new(j()).Collapse(s,{toggle:!1}),c=()=>o(!0),u=()=>o(!1);s.addEventListener("shown.bs.collapse",c),s.addEventListener("hidden.bs.collapse",u),e?.setAttribute("aria-expanded",String(i));let d=()=>{s.classList.contains("show")?a.hide():a.show()};return e?.addEventListener("click",d),{destroy:()=>{e?.removeEventListener("click",d),s.removeEventListener("shown.bs.collapse",c),s.removeEventListener("hidden.bs.collapse",u),a.dispose()}}}m.register("collapsible",{type:"owl",mount:od});function rd(t){let e=t.querySelector("input"),s=t.querySelector("[b-combobox-list]"),o=()=>[...s?.querySelectorAll("[b-att-value]")||[]];t.classList.add("b-combobox"),e?.setAttribute("role","combobox"),e?.setAttribute("aria-expanded","false"),s?.setAttribute("role","listbox"),s&&(s.hidden=!0);let i=u=>{s&&(s.hidden=!u),e?.setAttribute("aria-expanded",String(u))},a=()=>{let u=e.value.toLowerCase();o().forEach(d=>{d.hidden=!d.textContent.toLowerCase().includes(u)}),i(!0)},c=u=>{let d=u.target.closest("[b-att-value]");d&&(e.value=d.textContent.trim(),t.setAttribute("b-att-value",d.getAttribute("b-att-value")),i(!1),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:d.getAttribute("b-att-value")}})))};return e?.addEventListener("input",a),e?.addEventListener("focus",()=>i(!0)),s?.addEventListener("click",c),{destroy:()=>{e?.removeEventListener("input",a),s?.removeEventListener("click",c)}}}m.register("combobox",{type:"owl",mount:rd});function nd(t){let e=t.querySelector("input"),s=()=>[...t.querySelectorAll("[b-command-item]")];t.classList.add("b-command"),t.setAttribute("role",t.getAttribute("role")||"dialog"),e?.classList.add("form-control");let o=()=>{let a=(e?.value||"").toLowerCase();s().forEach(c=>{c.hidden=!c.textContent.toLowerCase().includes(a)})},i=a=>{let c=a.target.closest("[b-command-item]");c&&t.dispatchEvent(new CustomEvent("nodexui:select",{bubbles:!0,detail:{value:c.getAttribute("b-att-value")||c.textContent.trim()}}))};return e?.addEventListener("input",o),t.addEventListener("click",i),{destroy:()=>{e?.removeEventListener("input",o),t.removeEventListener("click",i)}}}m.register("command",{type:"owl",mount:nd});function id(t){let e=t.querySelector("[b-context-menu-content]");if(!e)return{};e.hidden=!0,e.setAttribute("role","menu");let s=a=>{a.preventDefault(),e.hidden=!1,e.style.left=`${a.clientX}px`,e.style.top=`${a.clientY}px`,t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},o=()=>{e.hidden=!0,t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))},i=a=>{a.key==="Escape"&&o()};return t.addEventListener("contextmenu",s),document.addEventListener("click",o),t.addEventListener("keydown",i),{destroy:()=>{t.removeEventListener("contextmenu",s),document.removeEventListener("click",o),t.removeEventListener("keydown",i)}}}m.register("context-menu",{type:"owl",mount:id});var dc=[["728ed52f","Success","ken99@example.com","$316.00"],["489e1d42","Success","abe45@example.com","$242.00"],["6b0888f6","Processing","monserrat44@example.com","$837.00"],["a1dc8c4e","Success","silas22@example.com","$874.00"],["15b96de0","Failed","carmella@example.com","$721.00"]];function ad(t){t.querySelector("table")||(t.innerHTML=`
41
52
  <div class="b-data-table__toolbar">
42
53
  <input b-table-search type="search" class="form-control b-data-table__search" placeholder="Filter emails...">
43
54
  <div class="b-data-table__columns"><button type="button" class="btn b-button btn-outline-secondary" data-slot="button" data-icon="inline-end" aria-label="Toggle columns"><span>Columns</span><span b-icon="chevron-down" data-icon="inline-end"></span></button></div>
@@ -45,11 +56,11 @@ ${a}`,s.selectionStart,s.selectionEnd,"end")}else return;this.commit(s.value)}ou
45
56
  <div class="b-data-table__viewport">
46
57
  <table class="table b-data-table__table">
47
58
  <thead><tr><th class="b-data-table__selection-cell"><input type="checkbox" class="form-check-input" aria-label="Select all rows"></th><th>Status</th><th b-att-sortable="true">Email <span class="b-data-table__sort-icon" data-icon="arrow-up-down" aria-hidden="true"></span></th><th class="text-end">Amount</th><th class="b-data-table__actions-cell"><span class="visually-hidden">Actions</span></th></tr></thead>
48
- <tbody>${Ya.map(e=>`<tr data-row-key="${e[0]}"><td class="b-data-table__selection-cell"><input type="checkbox" class="form-check-input" aria-label="Select row"></td><td>${e[1]}</td><td>${e[2]}</td><td class="text-end"><span class="b-data-table__money">${e[3]}</span></td><td class="b-data-table__actions-cell"><button type="button" class="btn b-button btn-ghost b-button-icon" aria-label="Open menu" data-slot="button" data-icon="inline-start" data-icon-only="true"><span b-icon="ellipsis"></span></button></td></tr>`).join("")}</tbody>
59
+ <tbody>${dc.map(e=>`<tr data-row-key="${e[0]}"><td class="b-data-table__selection-cell"><input type="checkbox" class="form-check-input" aria-label="Select row"></td><td>${e[1]}</td><td>${e[2]}</td><td class="text-end"><span class="b-data-table__money">${e[3]}</span></td><td class="b-data-table__actions-cell"><button type="button" class="btn b-button btn-ghost b-button-icon" aria-label="Open menu" data-slot="button" data-icon="inline-start" data-icon-only="true"><span b-icon="ellipsis"></span></button></td></tr>`).join("")}</tbody>
49
60
  </table>
50
61
  </div>
51
62
  <div class="b-data-table__cards">
52
- ${Ya.map(e=>`<div class="b-data-table__card" data-row-key="${e[0]}">
63
+ ${dc.map(e=>`<div class="b-data-table__card" data-row-key="${e[0]}">
53
64
  <div class="b-data-table__card-header"><input type="checkbox" class="form-check-input" aria-label="Select row"><div class="b-data-table__actions"><button type="button" class="btn b-button btn-ghost b-button-icon" aria-label="Open menu" data-slot="button" data-icon="inline-start" data-icon-only="true"><span b-icon="ellipsis"></span></button></div></div>
54
65
  <div class="b-data-table__card-field"><span class="b-data-table__card-label">Status</span><span class="b-data-table__card-value">${e[1]}</span></div>
55
66
  <div class="b-data-table__card-field"><span class="b-data-table__card-label">Email</span><span class="b-data-table__card-value">${e[2]}</span></div>
@@ -57,4 +68,4 @@ ${a}`,s.selectionStart,s.selectionEnd,"end")}else return;this.commit(s.value)}ou
57
68
  </div>`).join("")}
58
69
  </div>
59
70
  <div class="b-data-table__pagination"><div class="b-data-table__selection-summary">0 of 5 row(s) selected.</div><div class="b-data-table__pager"><button type="button" class="btn b-button btn-outline-secondary btn-sm" disabled>Previous</button><button type="button" class="btn b-button btn-outline-secondary btn-sm" disabled>Next</button></div></div>
60
- `)}function Tp(t){Op(t),t.querySelectorAll("[b-icon]").forEach(z=>ut(z,z.getAttribute("b-icon"),{label:""}));let e=t.querySelector("table")||t,s=t.querySelector("[b-table-search]"),o=t.querySelector(".b-data-table__selection-summary"),n=t.getAttribute("b-att-variant");t.classList.add("b-data-table"),n&&t.classList.add(`b-data-table-${n}`),e.classList.add("table");let a=t.querySelector(".b-data-table__cards"),l=()=>[...e.querySelectorAll("tbody tr")],p=z=>a?.querySelector(`[data-row-key="${z.dataset.rowKey}"]`),b=()=>[...e.querySelectorAll("tbody input[type='checkbox']")],v=()=>{o&&(o.textContent=`${b().filter(z=>z.checked).length} of ${l().filter(z=>!z.hidden).length} row(s) selected.`)},k=()=>{let z=(s?.value||"").toLowerCase();l().forEach(et=>{let A=!(et.cells[2]||et.cells[1]||et.cells[0]).textContent.toLowerCase().includes(z);et.hidden=A;let M=p(et);M&&(M.hidden=A)}),v()},O=(z,et)=>{let nt=e.tBodies[0];l().sort((A,M)=>A.cells[z].textContent.localeCompare(M.cells[z].textContent)*et).forEach(A=>{nt.append(A);let M=p(A);M&&a.append(M)})},j=z=>{let et=z.target.closest("th");if(!et)return;let nt=et.getAttribute("b-att-sort")==="asc"?-1:1;e.querySelectorAll("th").forEach(A=>A.removeAttribute("b-att-sort")),et.setAttribute("b-att-sort",nt===1?"asc":"desc"),O([...et.parentElement.children].indexOf(et),nt)},K=(z,et)=>{let A=p(z)?.querySelector("input[type='checkbox']");A&&A.checked!==et&&(A.checked=et)},Z=z=>{let et=z.target;if(et?.matches("input[type='checkbox']")){let nt=et.closest("tr"),A=et.closest(".b-data-table__card");if(nt)K(nt,et.checked);else if(A){let L=l().find(T=>T.dataset.rowKey===A.dataset.rowKey)?.querySelector("input[type='checkbox']");L&&L.checked!==et.checked&&(L.checked=et.checked)}}v()};return s?.addEventListener("input",k),e.tHead?.addEventListener("click",j),e.addEventListener("change",Z),a?.addEventListener("change",Z),v(),{destroy:()=>{s?.removeEventListener("input",k),e.tHead?.removeEventListener("click",j),e.removeEventListener("change",Z),a?.removeEventListener("change",Z)}}}h.register("data-table",{type:"owl",mount:Tp});U();function Ip(t){let e=t.matches("input")?t:t.querySelector("input[type='date'], input");t.classList.add("b-date-picker"),e?.classList.add("form-control"),e?.setAttribute("type",e.getAttribute("type")||"date");let s=()=>{t.setAttribute("b-att-value",e.value),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:e.value}}))};return e?.addEventListener("input",s),{destroy:()=>e?.removeEventListener("input",s)}}h.register("date-picker",{type:"owl",mount:Ip});U();function Bp(t){let e=t.querySelector("[b-dialog-panel]");if(t.classList.add("modal","fade","b-dialog-backdrop"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),e){let n=document.createElement("div");n.className="modal-dialog modal-dialog-centered",e.replaceWith(n),n.append(e),e.classList.add("modal-content")}[...t.querySelectorAll("[b-dialog-close]")].forEach(n=>n.setAttribute("data-bs-dismiss","modal"));let o=W().Modal.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,focus:!0});return mo(t,o,"modal","NodexUIDialog")}h.register("dialog",{type:"owl",mount:Bp});U();function Rp(t){let e=t.getAttribute("b-att-dir")||t.getAttribute("dir")||"ltr";return t.setAttribute("dir",e==="rtl"?"rtl":"ltr"),{}}h.register("direction",{type:"static",mount:Rp});U();function Mp(t){t.classList.add("offcanvas","offcanvas-bottom","b-drawer-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-drawer-close]")].forEach(o=>o.setAttribute("data-bs-dismiss","offcanvas"));let s=W().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return mo(t,s,"offcanvas","NodexUIDrawer")}h.register("drawer",{type:"owl",mount:Mp});U();It();var Qa="a, button, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']";function Xa(t,e){t?.classList.add(e)}function $p(t,e){if(!e||t.querySelector("[b-dropdown-indicator], [data-slot$='indicator']"))return;let s=document.createElement("span");s.setAttribute("b-dropdown-indicator",""),s.append(ut(document.createElement("span"),"check")),t.prepend(s)}function _p(t){t.setAttribute("data-slot",t.getAttribute("data-slot")||"dropdown-menu-content"),t.querySelectorAll("[b-dropdown-group]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-group"),e.setAttribute("role",e.getAttribute("role")||"group")}),t.querySelectorAll("[b-dropdown-label]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-label"),e.classList.add("dropdown-header")}),t.querySelectorAll("[b-dropdown-separator]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-separator"),e.classList.add("dropdown-divider"),e.setAttribute("role",e.getAttribute("role")||"separator")}),t.querySelectorAll("[b-dropdown-shortcut]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-shortcut")}),t.querySelectorAll("[b-dropdown-checkbox-item], [b-dropdown-radio-item]").forEach(e=>{let s=e.hasAttribute("b-dropdown-radio-item");e.setAttribute("role",s?"menuitemradio":"menuitemcheckbox"),e.setAttribute("data-slot",s?"dropdown-menu-radio-item":"dropdown-menu-checkbox-item"),e.classList.add("dropdown-item"),e.setAttribute("aria-checked",e.hasAttribute("checked")||e.getAttribute("aria-checked")==="true"?"true":"false"),$p(e,e.getAttribute("aria-checked")==="true")}),t.querySelectorAll(Qa).forEach(e=>{e.setAttribute("role",e.getAttribute("role")||"menuitem"),e.setAttribute("tabindex",e.getAttribute("tabindex")||"0"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"dropdown-menu-item"),e.classList.add("dropdown-item")})}function Pp(t){let e=[];return t.querySelectorAll("[b-dropdown-sub]").forEach(s=>{let o=s.querySelector("[b-dropdown-sub-trigger]"),n=s.querySelector("[b-dropdown-sub-content]");if(!o||!n)return;if(Xa(o,"b-dropdown-menu-sub-trigger"),Xa(n,"b-dropdown-menu-sub-content"),o.setAttribute("data-slot","dropdown-menu-sub-trigger"),o.setAttribute("role","menuitem"),o.setAttribute("aria-haspopup","menu"),n.setAttribute("data-slot","dropdown-menu-sub-content"),n.setAttribute("role","menu"),n.hidden=!0,!o.querySelector(".b-dropdown-menu-sub-trigger-icon")){let v=ut(document.createElement("span"),"chevron-right");v.classList.add("b-dropdown-menu-sub-trigger-icon"),o.append(v)}let a=v=>{n.hidden=!v,o.setAttribute("data-state",v?"open":"closed"),o.setAttribute("aria-expanded",String(v))},l=()=>a(!0),p=()=>a(!1),b=v=>{v.preventDefault(),a(n.hidden)};s.addEventListener("mouseenter",l),s.addEventListener("mouseleave",p),o.addEventListener("focus",l),o.addEventListener("click",b),e.push(()=>{s.removeEventListener("mouseenter",l),s.removeEventListener("mouseleave",p),o.removeEventListener("focus",l),o.removeEventListener("click",b)})}),()=>e.forEach(s=>s())}function Up(t){let e=t.querySelector("[b-dropdown-trigger]"),s=t.querySelector("[b-dropdown-menu]");if(!e||!s)return{destroy:()=>{}};t.classList.add("dropdown"),s.classList.add("dropdown-menu"),e.setAttribute("aria-haspopup","menu"),s.setAttribute("role","menu");let o=W().Dropdown.getOrCreateInstance(e),n=j=>{t.setAttribute("b-att-state",j?"open":"closed"),e.setAttribute("aria-expanded",String(j)),t.dispatchEvent(new CustomEvent(j?"nodexui:open":"nodexui:close",{bubbles:!0}))},a=()=>n(!0),l=()=>n(!1);e.addEventListener("shown.bs.dropdown",a),e.addEventListener("hidden.bs.dropdown",l);let p=()=>o.toggle();e.addEventListener("click",p);let b=j=>{j.key==="Escape"?(o.hide(),e.focus()):j.key==="ArrowDown"&&!s.classList.contains("show")&&(j.preventDefault(),o.show(),[...s.querySelectorAll("a, button, [tabindex]:not([tabindex='-1'])")][0]?.focus())};t.addEventListener("keydown",b);let v=j=>{t.contains(j.target)||o.hide()};document.addEventListener("click",v),_p(s);let k=Pp(s),O=j=>{let K=j.target.closest(Qa);!K||K.closest("[b-dropdown-sub]")||o.hide()};return s.addEventListener("click",O),{destroy:()=>{k(),s.removeEventListener("click",O),document.removeEventListener("click",v),t.removeEventListener("keydown",b),e.removeEventListener("click",p),e.removeEventListener("shown.bs.dropdown",a),e.removeEventListener("hidden.bs.dropdown",l),o.dispose()}}}h.register("dropdown-menu",{type:"owl",mount:Up});U();var On={default:"b-empty-default",outline:"b-empty-outline",background:"b-empty-background"};function qp(t){let e=t.getAttribute("b-att-variant")||"default",s=[...t.querySelectorAll("[b-empty-media]")];return t.setAttribute("role",t.getAttribute("role")||"status"),t.classList.add("b-empty",On[e]||On.default),t.querySelectorAll("[b-empty-header]").forEach(o=>o.classList.add("b-empty-header")),t.querySelectorAll("[b-empty-title]").forEach(o=>o.classList.add("b-empty-title")),t.querySelectorAll("[b-empty-description]").forEach(o=>o.classList.add("b-empty-description")),t.querySelectorAll("[b-empty-content]").forEach(o=>o.classList.add("b-empty-content")),s.forEach(o=>{let n=o.getAttribute("b-att-variant")==="icon"?"icon":"default";o.classList.add("b-empty-media",`b-empty-media-${n}`),o.setAttribute("data-variant",n)}),{destroy:()=>{t.classList.remove("b-empty",...Object.values(On))}}}h.register("empty",{type:"owl",mount:qp});U();function Yi(t,e){t?.classList.add(...e.filter(Boolean))}function De(t,e,s,o){t.querySelectorAll(e).forEach(n=>{n.setAttribute("data-slot",s),Yi(n,[o])})}function Dp(t){return t.querySelector("input, textarea, select, [role='checkbox'], [role='radio'], [role='switch']")}function jp(t,e){return e.id?e.id:`${t?.id||"b-field"}-error`}function zp(t){let e=t.getAttribute("b-att-slot")||t.getAttribute("data-slot")||"field",s=[];if(e==="field-set")t.setAttribute("data-slot","field-set"),Yi(t,["b-field-set"]),s.push("b-field-set");else if(e==="field-group")t.setAttribute("data-slot","field-group"),Yi(t,["b-field-group"]),s.push("b-field-group");else{let a=t.getAttribute("b-att-orientation")||t.getAttribute("data-orientation")||"vertical";t.setAttribute("role",t.getAttribute("role")||"group"),t.setAttribute("data-slot","field"),t.setAttribute("data-orientation",a),Yi(t,["b-field",`b-field-orientation-${a}`]),s.push("b-field",`b-field-orientation-${a}`)}De(t,"legend[b-field-legend], [b-field-legend]","field-legend","b-field-legend"),De(t,"[b-field-group]","field-group","b-field-group"),De(t,"[b-field-content]","field-content","b-field-content"),De(t,"label[b-field-label], [b-field-label], [b-label]","field-label","b-field-label"),De(t,"[b-field-title]","field-label","b-field-title"),De(t,"[b-field-description]","field-description","b-field-description"),De(t,"[b-field-separator]","field-separator","b-field-separator"),De(t,"[b-field-error], [b-error]","field-error","b-field-error"),t.querySelectorAll("[b-field-separator]").forEach(a=>{if(!a.querySelector(".b-field-separator-line")){let l=document.createElement("span");l.className="b-field-separator-line",l.setAttribute("aria-hidden","true"),a.prepend(l)}a.textContent.trim()&&a.setAttribute("data-content","true")});let o=Dp(t),n=t.querySelector("[b-field-error], [b-error], [data-slot='field-error']");if(o&&n){n.setAttribute("role",n.getAttribute("role")||"alert");let a=jp(o,n);n.id=a,o.setAttribute("aria-describedby",a),o.setAttribute("aria-invalid","true"),t.setAttribute("data-invalid","true")}return{destroy:()=>t.classList.remove(...s)}}h.register("field",{type:"static",mount:zp});U();function Fp(t){t.classList.add("b-form"),t.setAttribute("data-slot","form"),t.setAttribute("novalidate","");let e=t.querySelector("[name='title']"),s=t.querySelector("[name='description']"),o=t.querySelector("[b-form-counter], .b-form-counter-text"),n=Number(s?.getAttribute("maxlength")||100),a=()=>{o&&s&&(o.textContent=`${s.value.length}/${n} characters`)},l=()=>{e&&(e.value=""),s&&(s.value=""),a()},p=t.querySelector("[b-form-reset]");return p?.addEventListener("click",l),s?.addEventListener("input",a),a(),{destroy(){p?.removeEventListener("click",l),s?.removeEventListener("input",a)}}}h.register("form",{type:"static",mount:Fp});U();function Hp(t){let e=t.querySelector("[b-hover-card-trigger]"),s=t.querySelector("[b-hover-card-content]");if(!e||!s)return{};let o=()=>{s.hidden=!1,e.setAttribute("aria-expanded","true")},n=()=>{s.hidden=!0,e.setAttribute("aria-expanded","false")},a=l=>{l.key==="Escape"&&n()};return e.setAttribute("aria-haspopup","dialog"),s.setAttribute("role","dialog"),n(),t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",n),t.addEventListener("focusin",o),t.addEventListener("focusout",n),t.addEventListener("keydown",a),{destroy:()=>{t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",n),t.removeEventListener("focusin",o),t.removeEventListener("focusout",n),t.removeEventListener("keydown",a)}}}h.register("hover-card",{type:"owl",mount:Hp});U();It();function Wp(t){let e=t.getAttribute("b-icon")||t.getAttribute("b-att-icon")||t.getAttribute("aria-label");return e?(ut(t,e,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url"),label:t.getAttribute("b-att-label")??t.getAttribute("aria-label")??"",size:t.getAttribute("b-icon-size")||t.getAttribute("b-att-size")}),{destroy:()=>{t.classList.remove("b-icon"),t.style.removeProperty("--b-icon-url"),t.style.removeProperty("--b-icon-size"),!t.getAttribute("b-att-label")&&!t.getAttribute("aria-label")&&t.removeAttribute("aria-hidden")}}):{}}h.register("icon",{type:"static",mount:Wp});U();function Kp(t){let e=_i({tag:t.tagName.toLowerCase(),type:t.getAttribute("type")});return t.classList.add(e),{destroy:()=>t.classList.remove(e)}}h.register("input",{type:"static",mount:Kp});U();function Vp(t){let e=[...t.querySelectorAll("input")];t.classList.add("b-input-otp"),e.forEach(a=>{a.classList.add("form-control"),a.inputMode=a.inputMode||"numeric",a.maxLength=a.maxLength>0?a.maxLength:1});let s=()=>{let a=e.map(l=>l.value).join("");t.setAttribute("b-att-value",a),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:a}}))},o=a=>{let l=e.indexOf(a.target);a.target.value&&e[l+1]&&e[l+1].focus(),s()},n=a=>{let l=a.clipboardData.getData("text").trim();l&&(a.preventDefault(),e.forEach((p,b)=>{p.value=l[b]||""}),s())};return e.forEach(a=>a.addEventListener("input",o)),t.addEventListener("paste",n),{destroy:()=>{e.forEach(a=>a.removeEventListener("input",o)),t.removeEventListener("paste",n)}}}h.register("input-otp",{type:"owl",mount:Vp});U();function Gp(t){return t.classList.add("b-item"),{destroy:()=>t.classList.remove("b-item")}}h.register("item",{type:"static",mount:Gp});U();function Zp(t){return t.classList.add("b-kbd"),{destroy:()=>t.classList.remove("b-kbd")}}h.register("kbd",{type:"static",mount:Zp});U();function Jp(t){return t.classList.add("form-label","b-label","b-label"),t.getAttribute("b-att-required")==="true"&&t.setAttribute("b-att-state","required"),{destroy:()=>t.classList.remove("form-label","b-label","b-label")}}h.register("label",{type:"static",mount:Jp});U();function Yp(t){return t.classList.add("b-marker"),{destroy:()=>t.classList.remove("b-marker")}}h.register("marker",{type:"static",mount:Yp});U();Wi();function Xp(t){let e=t.querySelector("script[type='text/markdown'], template");return e?e.tagName==="TEMPLATE"?e.content.textContent:e.textContent:t.getAttribute("b-att-content")||t.textContent||""}function Qp(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function td(t){t.classList.add("b-markdown");let e=t.getAttribute("b-att-src"),s=t.getAttribute("b-att-mermaid")!=="false",o=t.getAttribute("b-att-base-ui")!=="false",n=t.getAttribute("b-att-editable")==="true",a=t.getAttribute("b-att-collaborative")==="true",l=t.getAttribute("b-att-room")||"b-markdown",p=t.getAttribute("b-att-password")||void 0,b=Qp(t.getAttribute("b-att-signaling")),v=!1,k=null;function O(K){v||(t.setAttribute("data-status","error"),t.textContent=`Unable to render Markdown: ${K?.message||K}`,t.dispatchEvent(new CustomEvent("nodexui:markdown-error",{bubbles:!0,detail:{error:K}})))}async function j(){let K=Xp(t);t.setAttribute("data-status","loading");let Z=K;if(e)try{let A=await fetch(e);if(!A.ok)throw new Error(`${A.status} ${A.statusText}`);Z=await A.text()}catch(A){O(A);return}if(n){t.replaceChildren(),t.classList.add("b-markdown-editable"),t.setAttribute("data-status","ready");let A=document.createElement("div");A.className="b-markdown-editor",A.setAttribute("data-slot","markdown-editor"),A.setAttribute("role","group"),A.setAttribute("aria-label",a?"Collaborative Markdown editor":"Markdown editor"),t.append(A);try{if(k=await Si({root:A,value:Z,collaborative:a,room:l,password:p,signaling:b,onChange:(M,L)=>{t.dispatchEvent(new CustomEvent("nodexui:markdown-change",{bubbles:!0,detail:{markdown:M,previousMarkdown:L}}))}}),v){k?.destroy?.(),k=null;return}}catch(M){O(M);return}t.dispatchEvent(new CustomEvent("nodexui:markdown-editor-ready",{bubbles:!0,detail:{collaborative:a,room:l}}));return}let{data:z,content:et}=Ki(Z),nt;try{nt=await wi(et)}catch(A){O(A);return}v||(t.innerHTML=nt,t.setAttribute("data-status","ready"),await Ai(t,{mermaid:s,nodexUi:o}),v||t.dispatchEvent(new CustomEvent("nodexui:markdown-render",{bubbles:!0,detail:{html:nt,frontmatter:z}})))}return j(),{destroy:()=>{v=!0,k?.destroy?.(),k=null,oi(t),t.classList.remove("b-markdown"),t.classList.remove("b-markdown-editable"),t.removeAttribute("data-status")}}}h.register("markdown",{type:"static",mount:td});U();function ed(t){return t.classList.add("b-message"),t.setAttribute("b-att-side",t.getAttribute("b-att-side")||"incoming"),t.setAttribute("role",t.getAttribute("role")||"listitem"),{}}h.register("message",{type:"static",mount:ed});U();function sd(t){t.classList.add("b-message-scroller");let e=()=>{t.getAttribute("b-att-autoscroll")!=="false"&&(t.scrollTop=t.scrollHeight)},s=new window.MutationObserver(e);return s.observe(t,{childList:!0,subtree:!0}),window.requestAnimationFrame(e),{destroy:()=>s.disconnect()}}h.register("message-scroller",{type:"owl",mount:sd});U();function od(t){t.setAttribute("role","menubar"),t.classList.add("b-menubar");for(let e of t.querySelectorAll("a, button"))e.setAttribute("role","menuitem");return{destroy:()=>t.classList.remove("b-menubar")}}h.register("menubar",{type:"static",mount:od});U();function rd(t){return t.classList.add("form-select"),(t.getAttribute("b-att-size")==="sm"||t.getAttribute("b-att-size")==="lg")&&t.classList.add(`form-select-${t.getAttribute("b-att-size")}`),{destroy:()=>t.classList.remove("form-select","form-select-sm","form-select-lg")}}h.register("native-select",{type:"static",mount:rd});U();function id(t){t.classList.add("nav");let e=[...t.querySelectorAll("a, button")].filter(o=>!o.disabled);e.forEach(o=>o.classList.add("nav-link"));let s=o=>{let n=e.indexOf(o.target),a=o.key==="ArrowRight"?1:o.key==="ArrowLeft"?-1:0;!a||n<0||(o.preventDefault(),e[(n+a+e.length)%e.length]?.focus())};return t.setAttribute("role",t.getAttribute("role")||"menubar"),e.forEach(o=>o.setAttribute("role","menuitem")),t.addEventListener("keydown",s),{destroy:()=>t.removeEventListener("keydown",s)}}h.register("navigation-menu",{type:"owl",mount:id});U();function nd(t){let e=t.querySelector("ol, ul")||t,s=[...e.children];return t.classList.add("b-pagination"),e.classList.add("pagination"),s.forEach(o=>{let n=o.querySelector("a, button");o.classList.add("page-item"),n?.classList.add("page-link"),n?.getAttribute("aria-current")==="page"&&o.classList.add("active"),(n?.hasAttribute("disabled")||n?.getAttribute("aria-disabled")==="true")&&o.classList.add("disabled")}),t.setAttribute("aria-label",t.getAttribute("aria-label")||"Pagination"),{destroy:()=>{t.classList.remove("b-pagination"),e.classList.remove("pagination")}}}h.register("pagination",{type:"owl",mount:nd});U();function ad(t){let e=t.querySelector("[b-popover-trigger]")||t,s=t.querySelector("[b-popover-content]"),o=s?s.innerHTML:"";s?.remove(),e.setAttribute("aria-haspopup","dialog");let n=new(W()).Popover(e,{content:o,html:!0,trigger:"click"}),a=()=>{t.setAttribute("b-att-state","open"),e.setAttribute("aria-expanded","true"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},l=()=>{t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))};return e.addEventListener("shown.bs.popover",a),e.addEventListener("hidden.bs.popover",l),t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),{destroy:()=>{e.removeEventListener("shown.bs.popover",a),e.removeEventListener("hidden.bs.popover",l),n.dispose()}}}h.register("popover",{type:"owl",mount:ad});U();function cd(t){let e=Number(t.getAttribute("b-att-max")||t.getAttribute("aria-valuemax")||100),s=Math.min(e,Math.max(0,Number(t.getAttribute("b-att-value")||t.getAttribute("aria-valuenow")||0)));if(t.classList.add("progress","b-progress"),t.setAttribute("role","progressbar"),t.setAttribute("aria-valuemin","0"),t.setAttribute("aria-valuemax",String(e)),t.setAttribute("aria-valuenow",String(s)),t.style.setProperty("--b-progress-value",`${s/e*100}%`),!t.querySelector("[b-progress-indicator]")){let o=document.createElement("span");o.className="progress-bar",o.setAttribute("b-progress-indicator",""),t.append(o)}return{destroy:()=>t.classList.remove("progress","b-progress")}}h.register("progress",{type:"static",mount:cd});U();function ld(t){let{open:e,close:s,destroy:o}=qi(t,{closeSelector:"[b-pwa-close]"});return t.NodexUIPwa={open:e,close:s},{destroy:()=>{o(),delete t.NodexUIPwa}}}h.register("pwa",{type:"owl",mount:ld});U();function ud(t){return t.classList.add("card","b-card","b-qr-card"),{}}h.register("qr-card",{type:"static",mount:ud});U();function pd(t){let e=[...t.querySelectorAll("[b-question]")],s=t.querySelector("[b-question-prev]"),o=t.querySelector("[b-question-next]"),n=0,a=b=>{n=Math.min(e.length-1,Math.max(0,b)),e.forEach((v,k)=>{v.hidden=k!==n,v.setAttribute("b-att-state",k===n?"active":"inactive")}),s&&(s.disabled=n===0),o&&(o.disabled=n===e.length-1),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{index:n}}))},l=()=>a(n-1),p=()=>a(n+1);return s?.addEventListener("click",l),o?.addEventListener("click",p),e.length&&a(0),{destroy:()=>{s?.removeEventListener("click",l),o?.removeEventListener("click",p)}}}h.register("questionnaire",{type:"owl",mount:pd});U();h.register("radio-group",{type:"static",mount:t=>Ji(t,"radio")});U();function dd(t){let e=t.querySelector("[b-resizable-panel]")||t,s=t.querySelector("[b-resizable-handle]");if(!s)return{};let o=Number(t.getAttribute("b-att-min")||160),n=Number(t.getAttribute("b-att-max")||720),a=l=>{let p=l.clientX,b=e.getBoundingClientRect().width,v=O=>{e.style.width=`${Math.min(n,Math.max(o,b+O.clientX-p))}px`},k=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",k),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{width:e.style.width}}))};document.addEventListener("pointermove",v),document.addEventListener("pointerup",k)};return s.addEventListener("pointerdown",a),{destroy:()=>s.removeEventListener("pointerdown",a)}}h.register("resizable",{type:"owl",mount:dd});U();function hd(t){return t.classList.add("b-scroll-area"),t.tabIndex=t.tabIndex>=0?t.tabIndex:0,t.setAttribute("role",t.getAttribute("role")||"region"),{}}h.register("scroll-area",{type:"static",mount:hd});U();function bd(t){let e=t.getAttribute("b-att-orientation")==="vertical";return t.classList.add("b-separator",e?"b-separator-vertical":"b-separator-horizontal"),t.setAttribute("role",t.getAttribute("role")||"separator"),t.setAttribute("aria-orientation",e?"vertical":"horizontal"),{destroy:()=>t.classList.remove("b-separator","b-separator-vertical","b-separator-horizontal")}}h.register("separator",{type:"static",mount:bd});U();function tc(t,{triggerSelector:e,panelSelector:s,ariaHaspopup:o,panelRole:n,onKeyDown:a}={}){let l=t.querySelector(e),p=t.querySelector(s),b=j=>{!p||!l||(p.hidden=!j,t.setAttribute("b-att-state",j?"open":"closed"),l.setAttribute("aria-expanded",String(j)),t.dispatchEvent(new CustomEvent(j?"nodexui:open":"nodexui:close",{bubbles:!0})))},v=()=>b(p?.hidden!==!1),k=j=>{j.key==="Escape"&&(b(!1),l?.focus()),a?.(j,{setOpen:b,panel:p,trigger:l})},O=j=>{t.contains(j.target)||b(!1)};return l?.setAttribute("aria-haspopup",o),p?.setAttribute("role",n),p&&(p.hidden=!0),l?.addEventListener("click",v),t.addEventListener("keydown",k),document.addEventListener("click",O),{trigger:l,panel:p,setOpen:b,destroy:()=>{l?.removeEventListener("click",v),t.removeEventListener("keydown",k),document.removeEventListener("click",O)}}}function md(t){let{setOpen:e,destroy:s}=tc(t,{triggerSelector:"[b-select-trigger]",panelSelector:"[b-select-content]",ariaHaspopup:"listbox",panelRole:"listbox"}),o=t.querySelector("[b-select-trigger]"),n=t.querySelector("[b-select-value]"),a=l=>{let p=l.target.closest("[b-select-item]");if(!(!p||!t.contains(p))){for(let b of t.querySelectorAll("[b-select-item]"))b.setAttribute("aria-selected",String(b===p));n&&(n.textContent=p.textContent.trim()),t.setAttribute("b-att-value",p.getAttribute("b-att-value")||p.textContent.trim()),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:t.getAttribute("b-att-value")}})),e(!1),o?.focus()}};for(let l of t.querySelectorAll("[b-select-item]"))l.setAttribute("role","option");return t.addEventListener("click",a),{destroy:()=>{t.removeEventListener("click",a),s()}}}h.register("select",{type:"owl",mount:md});U();function fd(t){let e=[...t.querySelectorAll("[b-shell-collapse-trigger]")],s=n=>{t.setAttribute("b-att-collapsed",n?"true":"false"),t.dispatchEvent(new CustomEvent(n?"nodexui:collapse":"nodexui:expand",{bubbles:!0}))},o=()=>s(t.getAttribute("b-att-collapsed")!=="true");return e.forEach(n=>n.addEventListener("click",o)),s(t.getAttribute("b-att-collapsed")==="true"),t.NodexUIShell={collapse:()=>s(!0),expand:()=>s(!1),toggle:o},{destroy:()=>{e.forEach(n=>n.removeEventListener("click",o)),delete t.NodexUIShell}}}h.register("shell",{type:"owl",mount:fd});U();function gd(t){let e=t.getAttribute("b-att-side")==="left"?"offcanvas-start":"offcanvas-end";t.classList.add("offcanvas",e,"b-sheet-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-sheet-close]")].forEach(n=>n.setAttribute("data-bs-dismiss","offcanvas"));let o=W().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return mo(t,o,"offcanvas","NodexUISheet")}h.register("sheet",{type:"owl",mount:gd});U();var vd={"[b-sidebar-header]":["b-sidebar-header","sidebar-header","header"],"[b-sidebar-content]":["b-sidebar-content","sidebar-content","content"],"[b-sidebar-footer]":["b-sidebar-footer","sidebar-footer","footer"],"[b-sidebar-group]":["b-sidebar-group","sidebar-group","group"],"[b-sidebar-group-label]":["b-sidebar-group-label","sidebar-group-label","group-label"],"[b-sidebar-group-action]":["b-sidebar-group-action","sidebar-group-action","group-action"],"[b-sidebar-group-content]":["b-sidebar-group-content","sidebar-group-content","group-content"],"[b-sidebar-menu]":["b-sidebar-menu","sidebar-menu","menu"],"[b-sidebar-menu-item]":["b-sidebar-menu-item","sidebar-menu-item","menu-item"],"[b-sidebar-menu-button]":["b-sidebar-menu-button","sidebar-menu-button","menu-button"],"[b-sidebar-menu-action]":["b-sidebar-menu-action","sidebar-menu-action","menu-action"],"[b-sidebar-menu-badge]":["b-sidebar-menu-badge","sidebar-menu-badge","menu-badge"],"[b-sidebar-menu-sub]":["b-sidebar-menu-sub","sidebar-menu-sub","menu-sub"],"[b-sidebar-menu-sub-item]":["b-sidebar-menu-sub-item","sidebar-menu-sub-item","menu-sub-item"],"[b-sidebar-menu-sub-button]":["b-sidebar-menu-sub-button","sidebar-menu-sub-button","menu-sub-button"],"[b-sidebar-separator]":["b-sidebar-separator","sidebar-separator","separator"]};function xd(t){let e=[];for(let[s,[o,n,a]]of Object.entries(vd))for(let l of t.querySelectorAll(s))l.classList.add(o),l.dataset.slot=n,l.dataset.sidebar=a,(l.hasAttribute("b-att-active")||l.getAttribute("aria-current")==="page")&&(l.classList.add("is-active"),l.dataset.active="true"),e.push([l,o]);return e}function yd(t){let e=t.getAttribute("b-att-trigger")?document.querySelector(t.getAttribute("b-att-trigger")):null,s=[...t.querySelectorAll("[b-sidebar-close]")],o=xd(t),n=b=>{t.setAttribute("b-att-state",b?"open":"closed"),t.classList.toggle("is-open",b),t.dataset.state=b?"expanded":"collapsed",t.dispatchEvent(new CustomEvent(b?"nodexui:open":"nodexui:close",{bubbles:!0}))},a=()=>n(!0),l=()=>n(!1),p=b=>{b.key==="Escape"&&l()};return e?.addEventListener("click",a),s.forEach(b=>b.addEventListener("click",l)),t.addEventListener("keydown",p),t.dataset.sidebar="sidebar",t.dataset.slot="sidebar",n(t.getAttribute("b-att-state")==="open"),t.NodexUISidebar={open:a,close:l},{destroy:()=>{e?.removeEventListener("click",a),s.forEach(b=>b.removeEventListener("click",l)),t.removeEventListener("keydown",p);for(let[b,v]of o)b.classList.remove(v,"is-active"),b.removeAttribute("data-slot"),b.removeAttribute("data-sidebar"),b.removeAttribute("data-active");t.removeAttribute("data-sidebar"),t.removeAttribute("data-slot"),t.removeAttribute("data-state"),delete t.NodexUISidebar}}}h.register("sidebar",{type:"owl",mount:yd});U();function wd(t){t.classList.add("b-slider");let e=()=>{t.style.setProperty("--b-slider-value",`${t.value}%`),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:t.value}}))};return e(),t.addEventListener("input",e),{destroy:()=>{t.removeEventListener("input",e),t.classList.remove("b-slider")}}}h.register("slider",{type:"static",mount:wd});U();function Ad(t){let e=t.getAttribute("b-att-shape")==="circle"?"b-skeleton-circle":"b-skeleton-block";return t.classList.add("b-skeleton",e),t.setAttribute("aria-hidden",t.getAttribute("aria-hidden")||"true"),{destroy:()=>t.classList.remove("b-skeleton","b-skeleton-circle","b-skeleton-block")}}h.register("skeleton",{type:"static",mount:Ad});U();function Sd(t){let e=t.getAttribute("b-att-type")==="grow",s=t.getAttribute("b-att-label")||"Loading";if(t.classList.add(e?"spinner-grow":"spinner-border"),t.setAttribute("role",t.getAttribute("role")||"status"),!t.querySelector(".visually-hidden")){let o=document.createElement("span");o.className="visually-hidden",o.textContent=s,t.append(o)}return{destroy:()=>t.classList.remove("spinner-border","spinner-grow")}}h.register("spinner",{type:"static",mount:Sd});U();function Ed(t){let e=t.matches("input")?t:t.querySelector("input[type='checkbox']"),s=t.matches("input")?t.closest("label, .form-check"):t;return e?.classList.add("form-check-input"),e?.setAttribute("role",e.getAttribute("role")||"switch"),s?.classList.add("form-check","form-switch","b-switch"),{destroy:()=>{e?.classList.remove("form-check-input"),s?.classList.remove("form-check","form-switch","b-switch")}}}h.register("switch",{type:"static",mount:Ed});U();function Cd(t){if(t.classList.add("table","b-table"),t.getAttribute("b-att-striped")!=="false"&&t.classList.add("table-striped"),t.getAttribute("b-att-hover")!=="false"&&t.classList.add("table-hover"),t.getAttribute("b-att-responsive")==="true"&&!t.parentElement?.classList.contains("table-responsive")){let e=document.createElement("div");return e.className="table-responsive",t.before(e),e.append(t),{destroy:()=>{e.before(t),e.remove(),t.classList.remove("table","b-table","table-striped","table-hover")}}}return{destroy:()=>t.classList.remove("table","b-table","table-striped","table-hover")}}h.register("table",{type:"static",mount:Cd});U();function kd(t){t.classList.add("b-tabs-host");let e=[...t.querySelectorAll("[b-tab]")],s=[...t.querySelectorAll("[b-panel]")],o=new Map(s.map(O=>[O.getAttribute("b-panel"),O])),n=new Map,a=new Map,l=new Map,p=new Map,b=e[0]?.parentElement;b&&!b.hasAttribute("role")&&b.setAttribute("role","tablist"),b?.classList.add("nav");let v=t.getAttribute("b-att-value")||e[0]?.getAttribute("b-tab")||"",k=O=>{t.setAttribute("b-att-value",O),e.forEach(j=>{j.tabIndex=j.getAttribute("b-tab")===O?0:-1}),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:O}}))};return e.forEach((O,j)=>{let K=O.getAttribute("b-tab"),Z=o.get(K),z=K===v;if(O.setAttribute("role","tab"),O.classList.add("nav-link"),O.tabIndex=z?0:-1,z&&O.classList.add("active"),Z){let L=Z.id||`b-tabs-panel-${K}`;Z.id=L,Z.setAttribute("role","tabpanel"),Z.classList.add("tab-pane","fade"),z&&Z.classList.add("show","active"),O.setAttribute("data-bs-target",`#${L}`)}let et=W().Tab.getOrCreateInstance(O);n.set(O,et);let nt=()=>et.show();O.addEventListener("click",nt),a.set(O,nt);let A=()=>k(K);O.addEventListener("shown.bs.tab",A),p.set(O,A);let M=L=>{let T=Pi(L.key,j,e.length);if(T===-1)return;L.preventDefault();let x=e[T];x.focus(),n.get(x)?.show()};O.addEventListener("keydown",M),l.set(O,M)}),v&&t.setAttribute("b-att-value",v),{destroy:()=>{e.forEach(O=>{O.removeEventListener("click",a.get(O)),O.removeEventListener("keydown",l.get(O)),O.removeEventListener("shown.bs.tab",p.get(O)),n.get(O)?.dispose()}),a.clear(),l.clear(),p.clear(),n.clear()}}}h.register("tabs",{type:"owl",mount:kd});U();function Ld(t){return t.classList.add("form-control"),t.getAttribute("b-att-resize")==="none"&&t.classList.add("b-textarea-no-resize"),{destroy:()=>t.classList.remove("form-control","b-textarea-no-resize")}}h.register("textarea",{type:"static",mount:Ld});U();function Nd(t){let e=t.querySelector("template, script[type='text/html']");return e?e.tagName==="TEMPLATE"?e.innerHTML:e.textContent:t.getAttribute("b-att-content")||t.innerHTML||""}function Od(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function Td(t){t.classList.add("b-text-editor");let e=t.getAttribute("b-att-src"),s=t.getAttribute("b-att-provider")||void 0,o=t.getAttribute("b-att-room")||"b-text-editor",n=t.getAttribute("b-att-url")||void 0,a=Zi({collaborative:t.getAttribute("b-att-collaborative")==="true",providerType:s,url:n}),l=t.getAttribute("b-att-password")||void 0,p=Od(t.getAttribute("b-att-signaling")),b=t.getAttribute("b-att-placeholder")||void 0,v=!1,k=null;function O(K){v||(t.setAttribute("data-status","error"),t.textContent=`Unable to mount text editor: ${K?.message||K}`,t.dispatchEvent(new CustomEvent("nodexui:text-editor-error",{bubbles:!0,detail:{error:K}})))}async function j(){t.setAttribute("data-status","loading");let K=Nd(t);if(e)try{let z=await fetch(e);if(!z.ok)throw new Error(`${z.status} ${z.statusText}`);K=await z.text()}catch(z){O(z);return}t.replaceChildren();let Z=document.createElement("div");Z.className="b-text-editor-shell",Z.setAttribute("data-slot","text-editor-shell"),Z.setAttribute("role","group"),Z.setAttribute("aria-label",a?"Collaborative rich text editor":"Rich text editor"),t.append(Z);try{if(k=await Gi({root:Z,value:K,placeholder:b,collaborative:a,providerType:s,room:o,url:n,password:l,signaling:p,onChange:(z,et)=>{t.dispatchEvent(new CustomEvent("nodexui:text-editor-change",{bubbles:!0,detail:{html:z,previousHtml:et}}))}}),v){k?.destroy?.(),k=null;return}}catch(z){O(z);return}t.setAttribute("data-status","ready"),t.dispatchEvent(new CustomEvent("nodexui:text-editor-ready",{bubbles:!0,detail:{collaborative:a,room:o}}))}return j(),{destroy:()=>{v=!0,k?.destroy?.(),k=null,t.classList.remove("b-text-editor"),t.removeAttribute("data-status")}}}h.register("text-editor",{type:"static",mount:Td});It();U();function Id(t,e){let s=ei(e);t.classList.remove(...fa),t.className=`${t.className} ${zi({variant:t.getAttribute("b-att-variant")||"outline",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button",t.setAttribute("aria-label",s.label),t.setAttribute("title",s.label),t.setAttribute("aria-pressed",s.pressed);let o=t.querySelector("[b-theme-button-icon]");o||(o=document.createElement("span"),o.setAttribute("b-theme-button-icon",""),t.prepend(o)),o.setAttribute("b-icon",s.icon),ut(o,s.icon,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url")});let n=t.querySelector("[b-theme-button-label]");n||(n=document.createElement("span"),n.className="visually-hidden",n.setAttribute("b-theme-button-label",""),t.append(n)),n.textContent=s.label}function Bd(t){let e=qe({storageKey:t.getAttribute("b-att-storage-key")||void 0,toggleSelector:"[b-theme-toggle]",labelSelector:"[b-theme-label]"}),s=(a=e.current())=>Id(t,a),o=()=>s(e.toggle()),n=a=>s(a.detail?.theme);return s(e.set(e.current(),{skipStorage:!0})),t.addEventListener("click",o),document.addEventListener("nodexui:theme-change",n),{destroy:()=>{t.removeEventListener("click",o),document.removeEventListener("nodexui:theme-change",n)}}}h.register("theme-button",{type:"static",mount:Bd});U();R();function Rd(t){let e=[...t.querySelectorAll("[b-toast-close]")],s=t.getAttribute("b-att-delay"),o=s===null?3e3:Number(s),n=Di(t.getAttribute("b-att-position"));t.className=f(t.className,"toast","fade",n),t.setAttribute("role",t.getAttribute("b-att-variant")==="danger"?"alert":"status"),e.forEach(k=>k.setAttribute("data-bs-dismiss","toast"));let a=new(W()).Toast(t,{autohide:o>0,delay:o||3e3}),l=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},p=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))};t.addEventListener("shown.bs.toast",l),t.addEventListener("hidden.bs.toast",p);let b=()=>a.show(),v=()=>a.hide();return t.getAttribute("b-att-state")==="open"&&b(),t.NodexUIToast={show:b,hide:v},{destroy:()=>{t.removeEventListener("shown.bs.toast",l),t.removeEventListener("hidden.bs.toast",p),a.dispose(),delete t.NodexUIToast}}}h.register("toast",{type:"owl",mount:Rd});U();function Md(t){let e=t.querySelector("[b-tooltip-trigger]")||t,s=t.querySelector("[b-tooltip-content]");!s&&t.getAttribute("b-att-content")&&(s=document.createElement("span"),s.setAttribute("b-tooltip-content",""),s.textContent=t.getAttribute("b-att-content"),t.appendChild(s));let o=s?s.innerHTML:"";s?.remove();let n=new(W()).Tooltip(e,{title:o,html:!0,trigger:"hover focus"}),a=()=>t.setAttribute("b-att-state","open"),l=()=>t.setAttribute("b-att-state","closed");return e.addEventListener("shown.bs.tooltip",a),e.addEventListener("hidden.bs.tooltip",l),t.setAttribute("b-att-state","closed"),{destroy:()=>{e.removeEventListener("shown.bs.tooltip",a),e.removeEventListener("hidden.bs.tooltip",l),n.dispose()}}}h.register("tooltip",{type:"owl",mount:Md});U();function $d(t){t.classList.add("btn",t.getAttribute("b-att-variant")==="outline"?"btn-outline-secondary":"btn-light"),t.setAttribute("aria-pressed",t.getAttribute("aria-pressed")||"false");let e=()=>{let s=t.getAttribute("aria-pressed")!=="true";t.setAttribute("aria-pressed",String(s)),t.setAttribute("b-att-state",s?"on":"off"),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{pressed:s}}))};return t.addEventListener("click",e),{destroy:()=>t.removeEventListener("click",e)}}h.register("toggle",{type:"owl",mount:$d});U();function _d(t){let e=[...t.querySelectorAll("[b-att-value], button")],s=t.getAttribute("b-att-multiple")==="true";t.classList.add("btn-group"),t.setAttribute("role",s?"group":"radiogroup"),e.forEach(n=>{n.classList.add("btn","btn-outline-secondary"),n.setAttribute("aria-pressed",n.getAttribute("aria-pressed")||"false")});let o=n=>{let a=n.target.closest("button, [b-att-value]");if(!a||!t.contains(a))return;s||e.forEach(p=>p.setAttribute("aria-pressed","false")),a.setAttribute("aria-pressed",String(a.getAttribute("aria-pressed")!=="true"));let l=e.filter(p=>p.getAttribute("aria-pressed")==="true").map(p=>p.getAttribute("b-att-value")||p.textContent.trim());t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:s?l:l[0]}}))};return t.addEventListener("click",o),{destroy:()=>t.removeEventListener("click",o)}}h.register("toggle-group",{type:"owl",mount:_d});U();var ec={lead:"lead",muted:"text-body-secondary",code:"b-code",kbd:"b-kbd",h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"b-list"};function Pd(t){let e=ec[t.getAttribute("b-att-variant")||"body"];return t.classList.add("b-typography"),e&&t.classList.add(e),{destroy:()=>t.classList.remove("b-typography",...Object.values(ec))}}h.register("typography",{type:"static",mount:Pd});_();qn(Ln);$n(Pn);_n();var vC=h;export{Zo as Accordion,Yo as AccordionContent,Jo as AccordionItem,ns as AccordionTrigger,Pt as Alert,Vs as AlertAction,Xt as AlertDescription,fo as AlertDialog,Xe as AlertDialogAction,Ye as AlertDialogCancel,go as AlertDialogContent,Ao as AlertDialogDescription,xo as AlertDialogFooter,vo as AlertDialogHeader,yo as AlertDialogMedia,wo as AlertDialogTitle,Je as AlertDialogTrigger,Ks as AlertTitle,Zt as ApiDoc,Jt as ApiDocGroup,yc as App,zr as AspectRatio,Nr as Attachment,ks as AttachmentAction,Rr as AttachmentActions,Tr as AttachmentContent,Br as AttachmentDescription,$r as AttachmentDropzone,Mr as AttachmentGroup,Or as AttachmentMedia,Ir as AttachmentTitle,Ls as AttachmentTrigger,_r as Avatar,Ct as Badge,$s as BlockViewer,Ce as Breadcrumb,cs as BreadcrumbEllipsis,Le as BreadcrumbItem,Ne as BreadcrumbLink,ke as BreadcrumbList,Oe as BreadcrumbPage,Ft as BreadcrumbSeparator,Fr as Bubble,P as Button,Kr as ButtonGroup,Vr as ButtonGroupSeparator,Gr as ButtonGroupText,Ss as Calendar,ee as Card,oe as CardBody,ie as CardDescription,Gs as CardFooter,se as CardHeader,re as CardTitle,Er as Carousel,Cs as CarouselNext,Es as CarouselPrevious,Cr as CarouselSlide,Sr as Chart,xe as Checkbox,_t as ClipboardButton,Ke as CodeEditor,Xo as Collapsible,Qo as CollapsibleContent,as as CollapsibleTrigger,wr as Combobox,Ar as Command,c as Component,Wo as ContextMenu,Vo as ContextMenuContent,Go as ContextMenuItem,Ko as ContextMenuTrigger,As as DataTable,yr as DatePicker,pe as Dialog,Ve as DialogClose,qt as DialogContent,me as DialogDescription,he as DialogFooter,de as DialogHeader,be as DialogTitle,Zs as DialogTrigger,Hr as Direction,So as Drawer,ts as DrawerClose,Eo as DrawerContent,No as DrawerDescription,ko as DrawerFooter,Co as DrawerHeader,Lo as DrawerTitle,Qe as DrawerTrigger,ye as DropdownMenu,rs as DropdownMenuCheckboxItem,we as DropdownMenuContent,Do as DropdownMenuGroup,Ae as DropdownMenuItem,jo as DropdownMenuLabel,zo as DropdownMenuRadioGroup,is as DropdownMenuRadioItem,Fo as DropdownMenuSeparator,Ho as DropdownMenuShortcut,Se as DropdownMenuSub,Ee as DropdownMenuSubContent,jt as DropdownMenuSubTrigger,Dt as DropdownMenuTrigger,Js as Empty,eo as EmptyContent,to as EmptyDescription,Ys as EmptyHeader,Xs as EmptyMedia,Qs as EmptyTitle,wc as EventBus,$e as Field,Yr as FieldContent,Pe as FieldDescription,Ue as FieldError,Me as FieldGroup,_e as FieldLabel,Jr as FieldLegend,Qr as FieldSeparator,Zr as FieldSet,Xr as FieldTitle,Us as Form,Po as HoverCard,qo as HoverCardContent,Uo as HoverCardTrigger,tt as Icon,ne as Input,co as InputOtp,Wr as Item,Qt as Kbd,ti as Label,Gt as Markdown,Ms as MarkdownTree,Ci as MarkdownTreeNode,ro as Marker,rr as Menubar,Pr as Message,Ur as MessageScroller,ve as NativeSelect,sr as NavigationMenu,or as NavigationMenuItem,h as NodexUI,Ln as NodexUIComponents,ma as NodexUITheme,Ac as OwlError,tr as Pagination,er as PaginationItem,$o as Popover,_o as PopoverContent,os as PopoverTrigger,jr as Progress,ii as Pwa,ui as PwaBody,Ps as PwaClose,ni as PwaContent,li as PwaDescription,di as PwaFooter,ai as PwaHeader,pi as PwaSteps,ci as PwaTitle,_s as PwaTrigger,Ts as QRCard,qr as Questionnaire,Os as QuestionnaireNext,Ns as QuestionnairePrevious,Dr as QuestionnaireStep,io as RadioGroup,no as RadioGroupItem,kr as Resizable,Lr as ScrollArea,uo as Select,po as SelectContent,ho as SelectItem,Ze as SelectTrigger,so as Separator,Oo as Sheet,ss as SheetClose,To as SheetContent,Mo as SheetDescription,Bo as SheetFooter,Io as SheetHeader,Ro as SheetTitle,es as SheetTrigger,fs as Shell,vs as ShellContent,vr as ShellHeader,gr as ShellMain,fr as ShellNav,gs as ShellSidebar,mr as ShellSidebarHeader,xs as ShellUserMenu,Wt as Sidebar,ps as SidebarClose,Te as SidebarContent,nr as SidebarFooter,Ie as SidebarGroup,ds as SidebarGroupAction,hs as SidebarGroupCollapsible,ur as SidebarGroupContent,Be as SidebarGroupLabel,ir as SidebarHeader,cr as SidebarInput,ar as SidebarInset,Kt as SidebarMenu,bs as SidebarMenuAction,dr as SidebarMenuBadge,Ht as SidebarMenuButton,Re as SidebarMenuItem,hr as SidebarMenuSkeleton,pr as SidebarMenuSub,ms as SidebarMenuSubButton,br as SidebarMenuSubItem,yi as SidebarProvider,us as SidebarRail,lr as SidebarSeparator,ls as SidebarTrigger,fe as Skeleton,ao as Slider,te as Spinner,Ge as Switch,ue as TabContent,Ut as TabTrigger,xr as Table,ae as Tabs,ce as TabsContainer,le as TabsList,hi as TextEditor,ge as Textarea,Vt as ThemeButton,zt as Toast,Is as Toggle,si as ToggleGroup,Bs as ToggleGroupItem,Rt as Tooltip,oo as Typography,Sc as __info__,Ec as batched,Cc as blockDom,f as cn,Fs as createNamedIcon,qe as createThemeController,vC as default,Cn as findMarkdownTreeNode,kc as htmlEscape,ha as iconComponentName,ze as loadFile,Kd as loadTemplate,Lc as markRaw,sn as markup,bt as mergeStyle,zs as mount,hn as normalizeTheme,Nc as onError,Q as onMounted,at as onPatched,Oc as onRendered,Fe as onWillDestroy,Tc as onWillPatch,Ic as onWillRender,Ot as onWillStart,st as onWillUnmount,ht as onWillUpdateProps,Hd as rawMount,Wd as rawXml,Bc as reactive,qn as registerGlobalComponents,Rc as status,Mc as toRaw,G as useChildSubEnv,$c as useComponent,At as useEffect,_c as useEnv,js as useExternalListener,q as useRef,$ as useState,Pc as useSubEnv,Uc as validate,qc as validateType,Dc as whenReady,jn as xml};
71
+ `)}function cd(t){ad(t),t.querySelectorAll("[b-icon]").forEach(J=>ct(J,J.getAttribute("b-icon"),{label:""}));let e=t.querySelector("table")||t,s=t.querySelector("[b-table-search]"),o=t.querySelector(".b-data-table__selection-summary"),i=t.getAttribute("b-att-variant");t.classList.add("b-data-table"),i&&t.classList.add(`b-data-table-${i}`),e.classList.add("table");let a=t.querySelector(".b-data-table__cards"),c=()=>[...e.querySelectorAll("tbody tr")],u=J=>a?.querySelector(`[data-row-key="${J.dataset.rowKey}"]`),d=()=>[...e.querySelectorAll("tbody input[type='checkbox']")],v=()=>{o&&(o.textContent=`${d().filter(J=>J.checked).length} of ${c().filter(J=>!J.hidden).length} row(s) selected.`)},S=()=>{let J=(s?.value||"").toLowerCase();c().forEach(Q=>{let N=!(Q.cells[2]||Q.cells[1]||Q.cells[0]).textContent.toLowerCase().includes(J);Q.hidden=N;let M=u(Q);M&&(M.hidden=N)}),v()},P=(J,Q)=>{let vt=e.tBodies[0];c().sort((N,M)=>N.cells[J].textContent.localeCompare(M.cells[J].textContent)*Q).forEach(N=>{vt.append(N);let M=u(N);M&&a.append(M)})},U=J=>{let Q=J.target.closest("th");if(!Q)return;let vt=Q.getAttribute("b-att-sort")==="asc"?-1:1;e.querySelectorAll("th").forEach(N=>N.removeAttribute("b-att-sort")),Q.setAttribute("b-att-sort",vt===1?"asc":"desc"),P([...Q.parentElement.children].indexOf(Q),vt)},Y=(J,Q)=>{let N=u(J)?.querySelector("input[type='checkbox']");N&&N.checked!==Q&&(N.checked=Q)},ot=J=>{let Q=J.target;if(Q?.matches("input[type='checkbox']")){let vt=Q.closest("tr"),N=Q.closest(".b-data-table__card");if(vt)Y(vt,Q.checked);else if(N){let k=c().find(B=>B.dataset.rowKey===N.dataset.rowKey)?.querySelector("input[type='checkbox']");k&&k.checked!==Q.checked&&(k.checked=Q.checked)}}v()};return s?.addEventListener("input",S),e.tHead?.addEventListener("click",U),e.addEventListener("change",ot),a?.addEventListener("change",ot),v(),{destroy:()=>{s?.removeEventListener("input",S),e.tHead?.removeEventListener("click",U),e.removeEventListener("change",ot),a?.removeEventListener("change",ot)}}}m.register("data-table",{type:"owl",mount:cd});function ld(t){let e=t.matches("input")?t:t.querySelector("input[type='date'], input");t.classList.add("b-date-picker"),e?.classList.add("form-control"),e?.setAttribute("type",e.getAttribute("type")||"date");let s=()=>{t.setAttribute("b-att-value",e.value),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:e.value}}))};return e?.addEventListener("input",s),{destroy:()=>e?.removeEventListener("input",s)}}m.register("date-picker",{type:"owl",mount:ld});function ud(t){let e=t.querySelector("[b-dialog-panel]");if(t.classList.add("modal","fade","b-dialog-backdrop"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),e){let i=document.createElement("div");i.className="modal-dialog modal-dialog-centered",e.replaceWith(i),i.append(e),e.classList.add("modal-content")}[...t.querySelectorAll("[b-dialog-close]")].forEach(i=>i.setAttribute("data-bs-dismiss","modal"));let o=j().Modal.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,focus:!0});return lo(t,o,"modal","NodexUIDialog")}m.register("dialog",{type:"owl",mount:ud});function pd(t){let e=t.getAttribute("b-att-dir")||t.getAttribute("dir")||"ltr";return t.setAttribute("dir",e==="rtl"?"rtl":"ltr"),{}}m.register("direction",{type:"static",mount:pd});function dd(t){t.classList.add("offcanvas","offcanvas-bottom","b-drawer-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-drawer-close]")].forEach(o=>o.setAttribute("data-bs-dismiss","offcanvas"));let s=j().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return lo(t,s,"offcanvas","NodexUIDrawer")}m.register("drawer",{type:"owl",mount:dd});var mc="a, button, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']";function hc(t,e){t?.classList.add(e)}function hd(t,e){if(!e||t.querySelector("[b-dropdown-indicator], [data-slot$='indicator']"))return;let s=document.createElement("span");s.setAttribute("b-dropdown-indicator",""),s.append(ct(document.createElement("span"),"check")),t.prepend(s)}function md(t){t.setAttribute("data-slot",t.getAttribute("data-slot")||"dropdown-menu-content"),t.querySelectorAll("[b-dropdown-group]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-group"),e.setAttribute("role",e.getAttribute("role")||"group")}),t.querySelectorAll("[b-dropdown-label]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-label"),e.classList.add("dropdown-header")}),t.querySelectorAll("[b-dropdown-separator]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-separator"),e.classList.add("dropdown-divider"),e.setAttribute("role",e.getAttribute("role")||"separator")}),t.querySelectorAll("[b-dropdown-shortcut]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-shortcut")}),t.querySelectorAll("[b-dropdown-checkbox-item], [b-dropdown-radio-item]").forEach(e=>{let s=e.hasAttribute("b-dropdown-radio-item");e.setAttribute("role",s?"menuitemradio":"menuitemcheckbox"),e.setAttribute("data-slot",s?"dropdown-menu-radio-item":"dropdown-menu-checkbox-item"),e.classList.add("dropdown-item"),e.setAttribute("aria-checked",e.hasAttribute("checked")||e.getAttribute("aria-checked")==="true"?"true":"false"),hd(e,e.getAttribute("aria-checked")==="true")}),t.querySelectorAll(mc).forEach(e=>{e.setAttribute("role",e.getAttribute("role")||"menuitem"),e.setAttribute("tabindex",e.getAttribute("tabindex")||"0"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"dropdown-menu-item"),e.classList.add("dropdown-item")})}function Oi(t,e,s){e.hidden=!s,t.setAttribute("data-state",s?"open":"closed"),t.setAttribute("aria-expanded",String(s))}function bd(t){let e=t.querySelector("[b-dropdown-sub-trigger]"),s=t.querySelector("[b-dropdown-sub-content]");if(!e||!s)return()=>{};if(hc(e,"b-dropdown-menu-sub-trigger"),hc(s,"b-dropdown-menu-sub-content"),e.setAttribute("data-slot","dropdown-menu-sub-trigger"),e.setAttribute("role","menuitem"),e.setAttribute("aria-haspopup","menu"),s.setAttribute("data-slot","dropdown-menu-sub-content"),s.setAttribute("role","menu"),s.hidden=!0,!e.querySelector(".b-dropdown-menu-sub-trigger-icon")){let c=ct(document.createElement("span"),"chevron-right");c.classList.add("b-dropdown-menu-sub-trigger-icon"),e.append(c)}let o=()=>Oi(e,s,!0),i=()=>Oi(e,s,!1),a=c=>{c.preventDefault(),Oi(e,s,s.hidden)};return t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",i),e.addEventListener("focus",o),e.addEventListener("click",a),()=>{t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",i),e.removeEventListener("focus",o),e.removeEventListener("click",a)}}function fd(t){let e=[...t.querySelectorAll("[b-dropdown-sub]")].map(bd);return()=>e.forEach(s=>s())}function gd(t){let e=t.querySelector("[b-dropdown-trigger]"),s=t.querySelector("[b-dropdown-menu]");if(!e||!s)return{destroy:()=>{}};t.classList.add("dropdown"),s.classList.add("dropdown-menu"),e.setAttribute("aria-haspopup","menu"),s.setAttribute("role","menu");let o=j().Dropdown.getOrCreateInstance(e),i=U=>{t.setAttribute("b-att-state",U?"open":"closed"),e.setAttribute("aria-expanded",String(U)),t.dispatchEvent(new CustomEvent(U?"nodexui:open":"nodexui:close",{bubbles:!0}))},a=()=>i(!0),c=()=>i(!1);e.addEventListener("shown.bs.dropdown",a),e.addEventListener("hidden.bs.dropdown",c);let u=()=>o.toggle();e.addEventListener("click",u);let d=U=>{U.key==="Escape"?(o.hide(),e.focus()):U.key==="ArrowDown"&&!s.classList.contains("show")&&(U.preventDefault(),o.show(),[...s.querySelectorAll("a, button, [tabindex]:not([tabindex='-1'])")][0]?.focus())};t.addEventListener("keydown",d);let v=U=>{t.contains(U.target)||o.hide()};document.addEventListener("click",v),md(s);let S=fd(s),P=U=>{let Y=U.target.closest(mc);!Y||Y.closest("[b-dropdown-sub]")||o.hide()};return s.addEventListener("click",P),{destroy:()=>{S(),s.removeEventListener("click",P),document.removeEventListener("click",v),t.removeEventListener("keydown",d),e.removeEventListener("click",u),e.removeEventListener("shown.bs.dropdown",a),e.removeEventListener("hidden.bs.dropdown",c),o.dispose()}}}m.register("dropdown-menu",{type:"owl",mount:gd});var Ii={default:"b-empty-default",outline:"b-empty-outline",background:"b-empty-background"};function vd(t){let e=t.getAttribute("b-att-variant")||"default",s=[...t.querySelectorAll("[b-empty-media]")];return t.setAttribute("role",t.getAttribute("role")||"status"),t.classList.add("b-empty",Ii[e]||Ii.default),t.querySelectorAll("[b-empty-header]").forEach(o=>o.classList.add("b-empty-header")),t.querySelectorAll("[b-empty-title]").forEach(o=>o.classList.add("b-empty-title")),t.querySelectorAll("[b-empty-description]").forEach(o=>o.classList.add("b-empty-description")),t.querySelectorAll("[b-empty-content]").forEach(o=>o.classList.add("b-empty-content")),s.forEach(o=>{let i=o.getAttribute("b-att-variant")==="icon"?"icon":"default";o.classList.add("b-empty-media",`b-empty-media-${i}`),o.setAttribute("data-variant",i)}),{destroy:()=>{t.classList.remove("b-empty",...Object.values(Ii))}}}m.register("empty",{type:"owl",mount:vd});function Gn(t,e){t?.classList.add(...e.filter(Boolean))}function _e(t,e,s,o){t.querySelectorAll(e).forEach(i=>{i.setAttribute("data-slot",s),Gn(i,[o])})}function xd(t){return t.querySelector("input, textarea, select, [role='checkbox'], [role='radio'], [role='switch']")}function yd(t,e){return e.id?e.id:`${t?.id||"b-field"}-error`}function wd(t){let e=t.getAttribute("b-att-slot")||t.getAttribute("data-slot")||"field",s=[];if(e==="field-set")t.setAttribute("data-slot","field-set"),Gn(t,["b-field-set"]),s.push("b-field-set");else if(e==="field-group")t.setAttribute("data-slot","field-group"),Gn(t,["b-field-group"]),s.push("b-field-group");else{let a=t.getAttribute("b-att-orientation")||t.getAttribute("data-orientation")||"vertical";t.setAttribute("role",t.getAttribute("role")||"group"),t.setAttribute("data-slot","field"),t.setAttribute("data-orientation",a),Gn(t,["b-field",`b-field-orientation-${a}`]),s.push("b-field",`b-field-orientation-${a}`)}_e(t,"legend[b-field-legend], [b-field-legend]","field-legend","b-field-legend"),_e(t,"[b-field-group]","field-group","b-field-group"),_e(t,"[b-field-content]","field-content","b-field-content"),_e(t,"label[b-field-label], [b-field-label], [b-label]","field-label","b-field-label"),_e(t,"[b-field-title]","field-label","b-field-title"),_e(t,"[b-field-description]","field-description","b-field-description"),_e(t,"[b-field-separator]","field-separator","b-field-separator"),_e(t,"[b-field-error], [b-error]","field-error","b-field-error"),t.querySelectorAll("[b-field-separator]").forEach(a=>{if(!a.querySelector(".b-field-separator-line")){let c=document.createElement("span");c.className="b-field-separator-line",c.setAttribute("aria-hidden","true"),a.prepend(c)}a.textContent.trim()&&a.setAttribute("data-content","true")});let o=xd(t),i=t.querySelector("[b-field-error], [b-error], [data-slot='field-error']");if(o&&i){i.setAttribute("role",i.getAttribute("role")||"alert");let a=yd(o,i);i.id=a,o.setAttribute("aria-describedby",a),o.setAttribute("aria-invalid","true"),t.setAttribute("data-invalid","true")}return{destroy:()=>t.classList.remove(...s)}}m.register("field",{type:"static",mount:wd});function Sd(t){t.classList.add("b-form"),t.setAttribute("data-slot","form"),t.setAttribute("novalidate","");let e=t.querySelector("[name='title']"),s=t.querySelector("[name='description']"),o=t.querySelector("[b-form-counter], .b-form-counter-text"),i=Number(s?.getAttribute("maxlength")||100),a=()=>{o&&s&&(o.textContent=`${s.value.length}/${i} characters`)},c=()=>{e&&(e.value=""),s&&(s.value=""),a()},u=t.querySelector("[b-form-reset]");return u?.addEventListener("click",c),s?.addEventListener("input",a),a(),{destroy(){u?.removeEventListener("click",c),s?.removeEventListener("input",a)}}}m.register("form",{type:"static",mount:Sd});function Ad(t){let e=t.querySelector("[b-hover-card-trigger]"),s=t.querySelector("[b-hover-card-content]");if(!e||!s)return{};let o=()=>{s.hidden=!1,e.setAttribute("aria-expanded","true")},i=()=>{s.hidden=!0,e.setAttribute("aria-expanded","false")},a=c=>{c.key==="Escape"&&i()};return e.setAttribute("aria-haspopup","dialog"),s.setAttribute("role","dialog"),i(),t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",i),t.addEventListener("focusin",o),t.addEventListener("focusout",i),t.addEventListener("keydown",a),{destroy:()=>{t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",i),t.removeEventListener("focusin",o),t.removeEventListener("focusout",i),t.removeEventListener("keydown",a)}}}m.register("hover-card",{type:"owl",mount:Ad});function Ed(t){let e=t.getAttribute("b-icon")||t.getAttribute("b-att-icon")||t.getAttribute("aria-label");return e?(ct(t,e,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url"),label:t.getAttribute("b-att-label")??t.getAttribute("aria-label")??"",size:t.getAttribute("b-icon-size")||t.getAttribute("b-att-size")}),{destroy:()=>{t.classList.remove("b-icon"),t.style.removeProperty("--b-icon-url"),t.style.removeProperty("--b-icon-size"),!t.getAttribute("b-att-label")&&!t.getAttribute("aria-label")&&t.removeAttribute("aria-hidden")}}):{}}m.register("icon",{type:"static",mount:Ed});function Cd(t){let e=Tn({tag:t.tagName.toLowerCase(),type:t.getAttribute("type")});return t.classList.add(e),{destroy:()=>t.classList.remove(e)}}m.register("input",{type:"static",mount:Cd});function kd(t){let e=[...t.querySelectorAll("input")];t.classList.add("b-input-otp"),e.forEach(a=>{a.classList.add("form-control"),a.inputMode=a.inputMode||"numeric",a.maxLength=a.maxLength>0?a.maxLength:1});let s=()=>{let a=e.map(c=>c.value).join("");t.setAttribute("b-att-value",a),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:a}}))},o=a=>{let c=e.indexOf(a.target);a.target.value&&e[c+1]&&e[c+1].focus(),s()},i=a=>{let c=a.clipboardData.getData("text").trim();c&&(a.preventDefault(),e.forEach((u,d)=>{u.value=c[d]||""}),s())};return e.forEach(a=>a.addEventListener("input",o)),t.addEventListener("paste",i),{destroy:()=>{e.forEach(a=>a.removeEventListener("input",o)),t.removeEventListener("paste",i)}}}m.register("input-otp",{type:"owl",mount:kd});function Ld(t){return t.classList.add("b-item"),{destroy:()=>t.classList.remove("b-item")}}m.register("item",{type:"static",mount:Ld});function Nd(t){return t.classList.add("b-kbd"),{destroy:()=>t.classList.remove("b-kbd")}}m.register("kbd",{type:"static",mount:Nd});function Td(t){return t.classList.add("form-label","b-label","b-label"),t.getAttribute("b-att-required")==="true"&&t.setAttribute("b-att-state","required"),{destroy:()=>t.classList.remove("form-label","b-label","b-label")}}m.register("label",{type:"static",mount:Td});function Od(t){return t.classList.add("b-marker"),{destroy:()=>t.classList.remove("b-marker")}}m.register("marker",{type:"static",mount:Od});function Jn(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}async function Yn(t){let e=await fetch(t);if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);return e.text()}function Id(t){let e=t.querySelector("script[type='text/markdown'], template");return e?e.tagName==="TEMPLATE"?e.content.textContent:e.textContent:t.getAttribute("b-att-content")||t.textContent||""}function Bd(t){return{src:t.getAttribute("b-att-src"),mermaid:t.getAttribute("b-att-mermaid")!=="false",nodexUi:t.getAttribute("b-att-base-ui")!=="false",editable:t.getAttribute("b-att-editable")==="true",collaborative:t.getAttribute("b-att-collaborative")==="true",room:t.getAttribute("b-att-room")||"b-markdown",password:t.getAttribute("b-att-password")||void 0,signaling:Jn(t.getAttribute("b-att-signaling"))}}function Bi(t,e){if(t.destroyed)return;let{element:s}=t;s.setAttribute("data-status","error"),s.textContent=`Unable to render Markdown: ${e?.message||e}`,s.dispatchEvent(new CustomEvent("nodexui:markdown-error",{bubbles:!0,detail:{error:e}}))}async function Rd(t,e){let{element:s,options:o}=t,{collaborative:i,room:a}=o;s.replaceChildren(),s.classList.add("b-markdown-editable"),s.setAttribute("data-status","ready");let c=document.createElement("div");c.className="b-markdown-editor",c.setAttribute("data-slot","markdown-editor"),c.setAttribute("role","group"),c.setAttribute("aria-label",i?"Collaborative Markdown editor":"Markdown editor"),s.append(c);try{t.editorHandle=await Fn({root:c,value:e,collaborative:i,room:a,password:o.password,signaling:o.signaling,onChange:(u,d)=>{s.dispatchEvent(new CustomEvent("nodexui:markdown-change",{bubbles:!0,detail:{markdown:u,previousMarkdown:d}}))}})}catch(u){Bi(t,u);return}if(t.destroyed){bc(t);return}s.dispatchEvent(new CustomEvent("nodexui:markdown-editor-ready",{bubbles:!0,detail:{collaborative:i,room:a}}))}async function Md(t,e){let{element:s,options:o}=t,{data:i,content:a}=zn(e),c,u;try{u=o.nodexUi===!1?null:Un(a),c=await Dn(u?.source??a)}catch(d){Bi(t,d);return}t.destroyed||(s.innerHTML=c,s.setAttribute("data-status","ready"),await jn(s,{mermaid:o.mermaid,nodexUi:o.nodexUi,mdx:u,baseUrl:_n(o.src)}),!t.destroyed&&s.dispatchEvent(new CustomEvent("nodexui:markdown-render",{bubbles:!0,detail:{html:c,frontmatter:i}})))}async function $d(t){let{element:e,options:s}=t;e.setAttribute("data-status","loading");let o=Id(e);if(s.src)try{o=await Yn(s.src)}catch(i){Bi(t,i);return}s.editable?await Rd(t,o):await Md(t,o)}function bc(t){t.editorHandle?.destroy?.(),t.editorHandle=null}function _d(t){let{element:e}=t;t.destroyed=!0,bc(t),gn(e),e.classList.remove("b-markdown","b-markdown-editable"),e.removeAttribute("data-status")}function Ud(t){t.classList.add("b-markdown");let e={element:t,options:Bd(t),destroyed:!1,editorHandle:null};return $d(e),{destroy:()=>_d(e)}}m.register("markdown",{type:"static",mount:Ud});function Pd(t){return t.classList.add("b-message"),t.setAttribute("b-att-side",t.getAttribute("b-att-side")||"incoming"),t.setAttribute("role",t.getAttribute("role")||"listitem"),{}}m.register("message",{type:"static",mount:Pd});function qd(t){t.classList.add("b-message-scroller");let e=()=>{t.getAttribute("b-att-autoscroll")!=="false"&&(t.scrollTop=t.scrollHeight)},s=new window.MutationObserver(e);return s.observe(t,{childList:!0,subtree:!0}),window.requestAnimationFrame(e),{destroy:()=>s.disconnect()}}m.register("message-scroller",{type:"owl",mount:qd});function Dd(t){t.setAttribute("role","menubar"),t.classList.add("b-menubar");for(let e of t.querySelectorAll("a, button"))e.setAttribute("role","menuitem");return{destroy:()=>t.classList.remove("b-menubar")}}m.register("menubar",{type:"static",mount:Dd});function jd(t){return t.classList.add("form-select"),(t.getAttribute("b-att-size")==="sm"||t.getAttribute("b-att-size")==="lg")&&t.classList.add(`form-select-${t.getAttribute("b-att-size")}`),{destroy:()=>t.classList.remove("form-select","form-select-sm","form-select-lg")}}m.register("native-select",{type:"static",mount:jd});function Fd(t){t.classList.add("nav");let e=[...t.querySelectorAll("a, button")].filter(o=>!o.disabled);e.forEach(o=>o.classList.add("nav-link"));let s=o=>{let i=e.indexOf(o.target),a=o.key==="ArrowRight"?1:o.key==="ArrowLeft"?-1:0;!a||i<0||(o.preventDefault(),e[(i+a+e.length)%e.length]?.focus())};return t.setAttribute("role",t.getAttribute("role")||"menubar"),e.forEach(o=>o.setAttribute("role","menuitem")),t.addEventListener("keydown",s),{destroy:()=>t.removeEventListener("keydown",s)}}m.register("navigation-menu",{type:"owl",mount:Fd});function zd(t){let e=t.querySelector("ol, ul")||t,s=[...e.children];return t.classList.add("b-pagination"),e.classList.add("pagination"),s.forEach(o=>{let i=o.querySelector("a, button");o.classList.add("page-item"),i?.classList.add("page-link"),i?.getAttribute("aria-current")==="page"&&o.classList.add("active"),(i?.hasAttribute("disabled")||i?.getAttribute("aria-disabled")==="true")&&o.classList.add("disabled")}),t.setAttribute("aria-label",t.getAttribute("aria-label")||"Pagination"),{destroy:()=>{t.classList.remove("b-pagination"),e.classList.remove("pagination")}}}m.register("pagination",{type:"owl",mount:zd});function Hd(t){let e=t.querySelector("[b-popover-trigger]")||t,s=t.querySelector("[b-popover-content]"),o=s?s.innerHTML:"";s?.remove(),e.setAttribute("aria-haspopup","dialog");let i=new(j()).Popover(e,{content:o,html:!0,trigger:"click"}),a=()=>{t.setAttribute("b-att-state","open"),e.setAttribute("aria-expanded","true"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},c=()=>{t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))};return e.addEventListener("shown.bs.popover",a),e.addEventListener("hidden.bs.popover",c),t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),{destroy:()=>{e.removeEventListener("shown.bs.popover",a),e.removeEventListener("hidden.bs.popover",c),i.dispose()}}}m.register("popover",{type:"owl",mount:Hd});function Wd(t){let e=Number(t.getAttribute("b-att-max")||t.getAttribute("aria-valuemax")||100),s=Math.min(e,Math.max(0,Number(t.getAttribute("b-att-value")||t.getAttribute("aria-valuenow")||0)));if(t.classList.add("progress","b-progress"),t.setAttribute("role","progressbar"),t.setAttribute("aria-valuemin","0"),t.setAttribute("aria-valuemax",String(e)),t.setAttribute("aria-valuenow",String(s)),t.style.setProperty("--b-progress-value",`${s/e*100}%`),!t.querySelector("[b-progress-indicator]")){let o=document.createElement("span");o.className="progress-bar",o.setAttribute("b-progress-indicator",""),t.append(o)}return{destroy:()=>t.classList.remove("progress","b-progress")}}m.register("progress",{type:"static",mount:Wd});function Kd(t){let{open:e,close:s,destroy:o}=Bn(t,{closeSelector:"[b-pwa-close]"});return t.NodexUIPwa={open:e,close:s},{destroy:()=>{o(),delete t.NodexUIPwa}}}m.register("pwa",{type:"owl",mount:Kd});function Vd(t){return t.classList.add("card","b-card","b-qr-card"),{}}m.register("qr-card",{type:"static",mount:Vd});function Zd(t){let e=[...t.querySelectorAll("[b-question]")],s=t.querySelector("[b-question-prev]"),o=t.querySelector("[b-question-next]"),i=0,a=d=>{i=Math.min(e.length-1,Math.max(0,d)),e.forEach((v,S)=>{v.hidden=S!==i,v.setAttribute("b-att-state",S===i?"active":"inactive")}),s&&(s.disabled=i===0),o&&(o.disabled=i===e.length-1),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{index:i}}))},c=()=>a(i-1),u=()=>a(i+1);return s?.addEventListener("click",c),o?.addEventListener("click",u),e.length&&a(0),{destroy:()=>{s?.removeEventListener("click",c),o?.removeEventListener("click",u)}}}m.register("questionnaire",{type:"owl",mount:Zd});m.register("radio-group",{type:"static",mount:t=>Zn(t,"radio")});function Gd(t){let e=t.querySelector("[b-resizable-panel]")||t,s=t.querySelector("[b-resizable-handle]");if(!s)return{};let o=Number(t.getAttribute("b-att-min")||160),i=Number(t.getAttribute("b-att-max")||720),a=c=>{let u=c.clientX,d=e.getBoundingClientRect().width,v=P=>{e.style.width=`${Math.min(i,Math.max(o,d+P.clientX-u))}px`},S=()=>{document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",S),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{width:e.style.width}}))};document.addEventListener("pointermove",v),document.addEventListener("pointerup",S)};return s.addEventListener("pointerdown",a),{destroy:()=>s.removeEventListener("pointerdown",a)}}m.register("resizable",{type:"owl",mount:Gd});function Jd(t){return t.classList.add("b-scroll-area"),t.tabIndex=t.tabIndex>=0?t.tabIndex:0,t.setAttribute("role",t.getAttribute("role")||"region"),{}}m.register("scroll-area",{type:"static",mount:Jd});function Yd(t){let e=t.getAttribute("b-att-orientation")==="vertical";return t.classList.add("b-separator",e?"b-separator-vertical":"b-separator-horizontal"),t.setAttribute("role",t.getAttribute("role")||"separator"),t.setAttribute("aria-orientation",e?"vertical":"horizontal"),{destroy:()=>t.classList.remove("b-separator","b-separator-vertical","b-separator-horizontal")}}m.register("separator",{type:"static",mount:Yd});function fc(t,{triggerSelector:e,panelSelector:s,ariaHaspopup:o,panelRole:i,onKeyDown:a}={}){let c=t.querySelector(e),u=t.querySelector(s),d=U=>{!u||!c||(u.hidden=!U,t.setAttribute("b-att-state",U?"open":"closed"),c.setAttribute("aria-expanded",String(U)),t.dispatchEvent(new CustomEvent(U?"nodexui:open":"nodexui:close",{bubbles:!0})))},v=()=>d(u?.hidden!==!1),S=U=>{U.key==="Escape"&&(d(!1),c?.focus()),a?.(U,{setOpen:d,panel:u,trigger:c})},P=U=>{t.contains(U.target)||d(!1)};return c?.setAttribute("aria-haspopup",o),u?.setAttribute("role",i),u&&(u.hidden=!0),c?.addEventListener("click",v),t.addEventListener("keydown",S),document.addEventListener("click",P),{trigger:c,panel:u,setOpen:d,destroy:()=>{c?.removeEventListener("click",v),t.removeEventListener("keydown",S),document.removeEventListener("click",P)}}}function Xd(t){let{setOpen:e,destroy:s}=fc(t,{triggerSelector:"[b-select-trigger]",panelSelector:"[b-select-content]",ariaHaspopup:"listbox",panelRole:"listbox"}),o=t.querySelector("[b-select-trigger]"),i=t.querySelector("[b-select-value]"),a=c=>{let u=c.target.closest("[b-select-item]");if(!(!u||!t.contains(u))){for(let d of t.querySelectorAll("[b-select-item]"))d.setAttribute("aria-selected",String(d===u));i&&(i.textContent=u.textContent.trim()),t.setAttribute("b-att-value",u.getAttribute("b-att-value")||u.textContent.trim()),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:t.getAttribute("b-att-value")}})),e(!1),o?.focus()}};for(let c of t.querySelectorAll("[b-select-item]"))c.setAttribute("role","option");return t.addEventListener("click",a),{destroy:()=>{t.removeEventListener("click",a),s()}}}m.register("select",{type:"owl",mount:Xd});function Qd(t){let e=[...t.querySelectorAll("[b-shell-collapse-trigger]")],s=i=>{t.setAttribute("b-att-collapsed",i?"true":"false"),t.dispatchEvent(new CustomEvent(i?"nodexui:collapse":"nodexui:expand",{bubbles:!0}))},o=()=>s(t.getAttribute("b-att-collapsed")!=="true");return e.forEach(i=>i.addEventListener("click",o)),s(t.getAttribute("b-att-collapsed")==="true"),t.NodexUIShell={collapse:()=>s(!0),expand:()=>s(!1),toggle:o},{destroy:()=>{e.forEach(i=>i.removeEventListener("click",o)),delete t.NodexUIShell}}}m.register("shell",{type:"owl",mount:Qd});function th(t){let e=t.getAttribute("b-att-side")==="left"?"offcanvas-start":"offcanvas-end";t.classList.add("offcanvas",e,"b-sheet-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-sheet-close]")].forEach(i=>i.setAttribute("data-bs-dismiss","offcanvas"));let o=j().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return lo(t,o,"offcanvas","NodexUISheet")}m.register("sheet",{type:"owl",mount:th});var eh={"[b-sidebar-header]":["b-sidebar-header","sidebar-header","header"],"[b-sidebar-content]":["b-sidebar-content","sidebar-content","content"],"[b-sidebar-footer]":["b-sidebar-footer","sidebar-footer","footer"],"[b-sidebar-group]":["b-sidebar-group","sidebar-group","group"],"[b-sidebar-group-label]":["b-sidebar-group-label","sidebar-group-label","group-label"],"[b-sidebar-group-action]":["b-sidebar-group-action","sidebar-group-action","group-action"],"[b-sidebar-group-content]":["b-sidebar-group-content","sidebar-group-content","group-content"],"[b-sidebar-menu]":["b-sidebar-menu","sidebar-menu","menu"],"[b-sidebar-menu-item]":["b-sidebar-menu-item","sidebar-menu-item","menu-item"],"[b-sidebar-menu-button]":["b-sidebar-menu-button","sidebar-menu-button","menu-button"],"[b-sidebar-menu-action]":["b-sidebar-menu-action","sidebar-menu-action","menu-action"],"[b-sidebar-menu-badge]":["b-sidebar-menu-badge","sidebar-menu-badge","menu-badge"],"[b-sidebar-menu-sub]":["b-sidebar-menu-sub","sidebar-menu-sub","menu-sub"],"[b-sidebar-menu-sub-item]":["b-sidebar-menu-sub-item","sidebar-menu-sub-item","menu-sub-item"],"[b-sidebar-menu-sub-button]":["b-sidebar-menu-sub-button","sidebar-menu-sub-button","menu-sub-button"],"[b-sidebar-separator]":["b-sidebar-separator","sidebar-separator","separator"]};function sh(t){let e=[];for(let[s,[o,i,a]]of Object.entries(eh))for(let c of t.querySelectorAll(s))c.classList.add(o),c.dataset.slot=i,c.dataset.sidebar=a,(c.hasAttribute("b-att-active")||c.getAttribute("aria-current")==="page")&&(c.classList.add("is-active"),c.dataset.active="true"),e.push([c,o]);return e}function oh(t){let e=t.getAttribute("b-att-trigger")?document.querySelector(t.getAttribute("b-att-trigger")):null,s=[...t.querySelectorAll("[b-sidebar-close]")],o=sh(t),i=d=>{t.setAttribute("b-att-state",d?"open":"closed"),t.classList.toggle("is-open",d),t.dataset.state=d?"expanded":"collapsed",t.dispatchEvent(new CustomEvent(d?"nodexui:open":"nodexui:close",{bubbles:!0}))},a=()=>i(!0),c=()=>i(!1),u=d=>{d.key==="Escape"&&c()};return e?.addEventListener("click",a),s.forEach(d=>d.addEventListener("click",c)),t.addEventListener("keydown",u),t.dataset.sidebar="sidebar",t.dataset.slot="sidebar",i(t.getAttribute("b-att-state")==="open"),t.NodexUISidebar={open:a,close:c},{destroy:()=>{e?.removeEventListener("click",a),s.forEach(d=>d.removeEventListener("click",c)),t.removeEventListener("keydown",u);for(let[d,v]of o)d.classList.remove(v,"is-active"),d.removeAttribute("data-slot"),d.removeAttribute("data-sidebar"),d.removeAttribute("data-active");t.removeAttribute("data-sidebar"),t.removeAttribute("data-slot"),t.removeAttribute("data-state"),delete t.NodexUISidebar}}}m.register("sidebar",{type:"owl",mount:oh});function rh(t){t.classList.add("b-slider");let e=()=>{t.style.setProperty("--b-slider-value",`${t.value}%`),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:t.value}}))};return e(),t.addEventListener("input",e),{destroy:()=>{t.removeEventListener("input",e),t.classList.remove("b-slider")}}}m.register("slider",{type:"static",mount:rh});function nh(t){let e=t.getAttribute("b-att-shape")==="circle"?"b-skeleton-circle":"b-skeleton-block";return t.classList.add("b-skeleton",e),t.setAttribute("aria-hidden",t.getAttribute("aria-hidden")||"true"),{destroy:()=>t.classList.remove("b-skeleton","b-skeleton-circle","b-skeleton-block")}}m.register("skeleton",{type:"static",mount:nh});function ih(t){let e=t.getAttribute("b-att-type")==="grow",s=t.getAttribute("b-att-label")||"Loading";if(t.classList.add(e?"spinner-grow":"spinner-border"),t.setAttribute("role",t.getAttribute("role")||"status"),!t.querySelector(".visually-hidden")){let o=document.createElement("span");o.className="visually-hidden",o.textContent=s,t.append(o)}return{destroy:()=>t.classList.remove("spinner-border","spinner-grow")}}m.register("spinner",{type:"static",mount:ih});function ah(t){let e=t.matches("input")?t:t.querySelector("input[type='checkbox']"),s=t.matches("input")?t.closest("label, .form-check"):t;return e?.classList.add("form-check-input"),e?.setAttribute("role",e.getAttribute("role")||"switch"),s?.classList.add("form-check","form-switch","b-switch"),{destroy:()=>{e?.classList.remove("form-check-input"),s?.classList.remove("form-check","form-switch","b-switch")}}}m.register("switch",{type:"static",mount:ah});function ch(t){if(t.classList.add("table","b-table"),t.getAttribute("b-att-striped")!=="false"&&t.classList.add("table-striped"),t.getAttribute("b-att-hover")!=="false"&&t.classList.add("table-hover"),t.getAttribute("b-att-responsive")==="true"&&!t.parentElement?.classList.contains("table-responsive")){let e=document.createElement("div");return e.className="table-responsive",t.before(e),e.append(t),{destroy:()=>{e.before(t),e.remove(),t.classList.remove("table","b-table","table-striped","table-hover")}}}return{destroy:()=>t.classList.remove("table","b-table","table-striped","table-hover")}}m.register("table",{type:"static",mount:ch});function lh(t,e,s){t.setAttribute("b-att-value",s),e.forEach(o=>{o.tabIndex=o.getAttribute("b-tab")===s?0:-1}),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:s}}))}function uh(t,e,s){let o=On(t.key,e,s.length);if(o===-1)return;t.preventDefault();let i=s[o];i.focus(),j().Tab.getOrCreateInstance(i).show()}function ph(t,e,s,o,i){let a=e[s],c=a.getAttribute("b-tab"),u=o.get(c),d=c===i;if(a.setAttribute("role","tab"),a.classList.add("nav-link"),a.tabIndex=d?0:-1,d&&a.classList.add("active"),u){let Y=u.id||`b-tabs-panel-${c}`;u.id=Y,u.setAttribute("role","tabpanel"),u.classList.add("tab-pane","fade"),d&&u.classList.add("show","active"),a.setAttribute("data-bs-target",`#${Y}`)}let v=j().Tab.getOrCreateInstance(a),S=()=>v.show(),P=()=>lh(t,e,c),U=Y=>uh(Y,s,e);return a.addEventListener("click",S),a.addEventListener("shown.bs.tab",P),a.addEventListener("keydown",U),()=>{a.removeEventListener("click",S),a.removeEventListener("keydown",U),a.removeEventListener("shown.bs.tab",P),v.dispose()}}function dh(t){t.classList.add("b-tabs-host");let e=[...t.querySelectorAll("[b-tab]")],s=[...t.querySelectorAll("[b-panel]")],o=new Map(s.map(u=>[u.getAttribute("b-panel"),u])),i=e[0]?.parentElement;i&&!i.hasAttribute("role")&&i.setAttribute("role","tablist"),i?.classList.add("nav");let a=t.getAttribute("b-att-value")||e[0]?.getAttribute("b-tab")||"",c=e.map((u,d)=>ph(t,e,d,o,a));return a&&t.setAttribute("b-att-value",a),{destroy:()=>c.forEach(u=>u())}}m.register("tabs",{type:"owl",mount:dh});function hh(t){return t.classList.add("form-control"),t.getAttribute("b-att-resize")==="none"&&t.classList.add("b-textarea-no-resize"),{destroy:()=>t.classList.remove("form-control","b-textarea-no-resize")}}m.register("textarea",{type:"static",mount:hh});function mh(t){let e=t.querySelector("template, script[type='text/html']");return e?e.tagName==="TEMPLATE"?e.innerHTML:e.textContent:t.getAttribute("b-att-content")||t.innerHTML||""}function bh(t){let e=t.getAttribute("b-att-provider")||void 0,s=t.getAttribute("b-att-url")||void 0;return{src:t.getAttribute("b-att-src"),providerType:e,room:t.getAttribute("b-att-room")||"b-text-editor",url:s,collaborative:Vn({collaborative:t.getAttribute("b-att-collaborative")==="true",providerType:e,url:s}),password:t.getAttribute("b-att-password")||void 0,signaling:Jn(t.getAttribute("b-att-signaling")),placeholder:t.getAttribute("b-att-placeholder")||void 0}}function gc(t,e){if(t.destroyed)return;let{element:s}=t;s.setAttribute("data-status","error"),s.textContent=`Unable to mount text editor: ${e?.message||e}`,s.dispatchEvent(new CustomEvent("nodexui:text-editor-error",{bubbles:!0,detail:{error:e}}))}function vc(t){t.editorHandle?.destroy?.(),t.editorHandle=null}async function fh(t,e){let{element:s,options:o}=t,{collaborative:i,room:a}=o;s.replaceChildren();let c=document.createElement("div");c.className="b-text-editor-shell",c.setAttribute("data-slot","text-editor-shell"),c.setAttribute("role","group"),c.setAttribute("aria-label",i?"Collaborative rich text editor":"Rich text editor"),s.append(c);try{t.editorHandle=await Kn({root:c,value:e,placeholder:o.placeholder,collaborative:i,providerType:o.providerType,room:a,url:o.url,password:o.password,signaling:o.signaling,onChange:(u,d)=>{s.dispatchEvent(new CustomEvent("nodexui:text-editor-change",{bubbles:!0,detail:{html:u,previousHtml:d}}))}})}catch(u){gc(t,u);return}if(t.destroyed){vc(t);return}s.setAttribute("data-status","ready"),s.dispatchEvent(new CustomEvent("nodexui:text-editor-ready",{bubbles:!0,detail:{collaborative:i,room:a}}))}async function gh(t){let{element:e,options:s}=t;e.setAttribute("data-status","loading");let o=mh(e);if(s.src)try{o=await Yn(s.src)}catch(i){gc(t,i);return}await fh(t,o)}function vh(t){t.destroyed=!0,vc(t),t.element.classList.remove("b-text-editor"),t.element.removeAttribute("data-status")}function xh(t){t.classList.add("b-text-editor");let e={element:t,options:bh(t),destroyed:!1,editorHandle:null};return gh(e),{destroy:()=>vh(e)}}m.register("text-editor",{type:"static",mount:xh});function yh(t,e){let s=Jr(e);t.classList.remove(...ya),t.className=`${t.className} ${$n({variant:t.getAttribute("b-att-variant")||"outline",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button",t.setAttribute("aria-label",s.label),t.setAttribute("title",s.label),t.setAttribute("aria-pressed",s.pressed);let o=t.querySelector("[b-theme-button-icon]");o||(o=document.createElement("span"),o.setAttribute("b-theme-button-icon",""),t.prepend(o)),o.setAttribute("b-icon",s.icon),ct(o,s.icon,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url")});let i=t.querySelector("[b-theme-button-label]");i||(i=document.createElement("span"),i.className="visually-hidden",i.setAttribute("b-theme-button-label",""),t.append(i)),i.textContent=s.label}function wh(t){let e=$e({storageKey:t.getAttribute("b-att-storage-key")||void 0,toggleSelector:"[b-theme-toggle]",labelSelector:"[b-theme-label]"}),s=(a=e.current())=>yh(t,a),o=()=>s(e.toggle()),i=a=>s(a.detail?.theme);return s(e.set(e.current(),{skipStorage:!0})),t.addEventListener("click",o),document.addEventListener("nodexui:theme-change",i),{destroy:()=>{t.removeEventListener("click",o),document.removeEventListener("nodexui:theme-change",i)}}}m.register("theme-button",{type:"static",mount:wh});function Sh(t){let e=[...t.querySelectorAll("[b-toast-close]")],s=t.getAttribute("b-att-delay"),o=s===null?3e3:Number(s),i=Rn(t.getAttribute("b-att-position"));t.className=f(t.className,"toast","fade",i),t.setAttribute("role",t.getAttribute("b-att-variant")==="danger"?"alert":"status"),e.forEach(S=>S.setAttribute("data-bs-dismiss","toast"));let a=new(j()).Toast(t,{autohide:o>0,delay:o||3e3}),c=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},u=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))};t.addEventListener("shown.bs.toast",c),t.addEventListener("hidden.bs.toast",u);let d=()=>a.show(),v=()=>a.hide();return t.getAttribute("b-att-state")==="open"&&d(),t.NodexUIToast={show:d,hide:v},{destroy:()=>{t.removeEventListener("shown.bs.toast",c),t.removeEventListener("hidden.bs.toast",u),a.dispose(),delete t.NodexUIToast}}}m.register("toast",{type:"owl",mount:Sh});function Ah(t){let e=t.querySelector("[b-tooltip-trigger]")||t,s=t.querySelector("[b-tooltip-content]");!s&&t.getAttribute("b-att-content")&&(s=document.createElement("span"),s.setAttribute("b-tooltip-content",""),s.textContent=t.getAttribute("b-att-content"),t.appendChild(s));let o=s?s.innerHTML:"";s?.remove();let i=new(j()).Tooltip(e,{title:o,html:!0,trigger:"hover focus"}),a=()=>t.setAttribute("b-att-state","open"),c=()=>t.setAttribute("b-att-state","closed");return e.addEventListener("shown.bs.tooltip",a),e.addEventListener("hidden.bs.tooltip",c),t.setAttribute("b-att-state","closed"),{destroy:()=>{e.removeEventListener("shown.bs.tooltip",a),e.removeEventListener("hidden.bs.tooltip",c),i.dispose()}}}m.register("tooltip",{type:"owl",mount:Ah});function Eh(t){t.classList.add("btn",t.getAttribute("b-att-variant")==="outline"?"btn-outline-secondary":"btn-light"),t.setAttribute("aria-pressed",t.getAttribute("aria-pressed")||"false");let e=()=>{let s=t.getAttribute("aria-pressed")!=="true";t.setAttribute("aria-pressed",String(s)),t.setAttribute("b-att-state",s?"on":"off"),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{pressed:s}}))};return t.addEventListener("click",e),{destroy:()=>t.removeEventListener("click",e)}}m.register("toggle",{type:"owl",mount:Eh});function Ch(t){let e=[...t.querySelectorAll("[b-att-value], button")],s=t.getAttribute("b-att-multiple")==="true";t.classList.add("btn-group"),t.setAttribute("role",s?"group":"radiogroup"),e.forEach(i=>{i.classList.add("btn","btn-outline-secondary"),i.setAttribute("aria-pressed",i.getAttribute("aria-pressed")||"false")});let o=i=>{let a=i.target.closest("button, [b-att-value]");if(!a||!t.contains(a))return;s||e.forEach(u=>u.setAttribute("aria-pressed","false")),a.setAttribute("aria-pressed",String(a.getAttribute("aria-pressed")!=="true"));let c=e.filter(u=>u.getAttribute("aria-pressed")==="true").map(u=>u.getAttribute("b-att-value")||u.textContent.trim());t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:s?c:c[0]}}))};return t.addEventListener("click",o),{destroy:()=>t.removeEventListener("click",o)}}m.register("toggle-group",{type:"owl",mount:Ch});var xc={lead:"lead",muted:"text-body-secondary",code:"b-code",kbd:"b-kbd",h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"b-list"};function kh(t){let e=xc[t.getAttribute("b-att-variant")||"body"];return t.classList.add("b-typography"),e&&t.classList.add(e),{destroy:()=>t.classList.remove("b-typography",...Object.values(xc))}}m.register("typography",{type:"static",mount:kh});Fi(Ni);Pi(Di);qi();var E0=m;export{Ho as Accordion,Ko as AccordionContent,Wo as AccordionItem,ss as AccordionTrigger,Mt as Alert,Fs as AlertAction,Zt as AlertDescription,uo as AlertDialog,Ze as AlertDialogAction,Ve as AlertDialogCancel,po as AlertDialogContent,go as AlertDialogDescription,mo as AlertDialogFooter,ho as AlertDialogHeader,bo as AlertDialogMedia,fo as AlertDialogTitle,Ke as AlertDialogTrigger,js as AlertTitle,Kt as ApiDoc,Vt as ApiDocGroup,qc as App,Ur as AspectRatio,Ar as Attachment,Ss as AttachmentAction,Nr as AttachmentActions,Cr as AttachmentContent,Lr as AttachmentDescription,Or as AttachmentDropzone,Tr as AttachmentGroup,Er as AttachmentMedia,kr as AttachmentTitle,As as AttachmentTrigger,Ir as Avatar,At as Badge,Is as BlockViewer,we as Breadcrumb,rs as BreadcrumbEllipsis,Ae as BreadcrumbItem,Ee as BreadcrumbLink,Se as BreadcrumbList,Ce as BreadcrumbPage,Dt as BreadcrumbSeparator,Pr as Bubble,R as Button,jr as ButtonGroup,Fr as ButtonGroupSeparator,zr as ButtonGroupText,xs as Calendar,Yt as Card,Qt as CardBody,ee as CardDescription,zs as CardFooter,Xt as CardHeader,te as CardTitle,xr as Carousel,ws as CarouselNext,ys as CarouselPrevious,yr as CarouselSlide,vr as Chart,be as Checkbox,Rt as ClipboardButton,Fe as CodeEditor,Vo as Collapsible,Zo as CollapsibleContent,os as CollapsibleTrigger,fr as Combobox,gr as Command,l as Component,Do as ContextMenu,Fo as ContextMenuContent,zo as ContextMenuItem,jo as ContextMenuTrigger,vs as DataTable,br as DatePicker,ae as Dialog,ze as DialogClose,_t as DialogContent,pe as DialogDescription,le as DialogFooter,ce as DialogHeader,ue as DialogTitle,Hs as DialogTrigger,qr as Direction,Os as DocViewer,vo as Drawer,Je as DrawerClose,xo as DrawerContent,Ao as DrawerDescription,wo as DrawerFooter,yo as DrawerHeader,So as DrawerTitle,Ge as DrawerTrigger,fe as DropdownMenu,ts as DropdownMenuCheckboxItem,ge as DropdownMenuContent,$o as DropdownMenuGroup,ve as DropdownMenuItem,_o as DropdownMenuLabel,Uo as DropdownMenuRadioGroup,es as DropdownMenuRadioItem,Po as DropdownMenuSeparator,qo as DropdownMenuShortcut,xe as DropdownMenuSub,ye as DropdownMenuSubContent,Pt as DropdownMenuSubTrigger,Ut as DropdownMenuTrigger,Ws as Empty,Js as EmptyContent,Gs as EmptyDescription,Ks as EmptyHeader,Vs as EmptyMedia,Zs as EmptyTitle,Dc as EventBus,Ie as Field,Kr as FieldContent,Re as FieldDescription,Me as FieldError,Oe as FieldGroup,Be as FieldLabel,Wr as FieldLegend,Zr as FieldSeparator,Hr as FieldSet,Vr as FieldTitle,Ms as Form,Bo as HoverCard,Mo as HoverCardContent,Ro as HoverCardTrigger,Z as Icon,se as Input,oo as InputOtp,Dr as Item,Gt as Kbd,Gr as Label,Lt as Markdown,Wt as MarkdownTree,vn as MarkdownTreeNode,Qs as Marker,Qo as Menubar,Br as Message,Rr as MessageScroller,me as NativeSelect,Yo as NavigationMenu,Xo as NavigationMenuItem,m as NodexUI,Ni as NodexUIComponents,xa as NodexUITheme,jc as OwlError,Go as Pagination,Jo as PaginationItem,Oo as Popover,Io as PopoverContent,Qe as PopoverTrigger,_r as Progress,tn as Pwa,nn as PwaBody,Rs as PwaClose,en as PwaContent,rn as PwaDescription,cn as PwaFooter,sn as PwaHeader,an as PwaSteps,on as PwaTitle,Bs as PwaTrigger,ks as QRCard,Mr as Questionnaire,Cs as QuestionnaireNext,Es as QuestionnairePrevious,$r as QuestionnaireStep,to as RadioGroup,eo as RadioGroupItem,wr as Resizable,Sr as ScrollArea,no as Select,io as SelectContent,ao as SelectItem,We as SelectTrigger,Ys as Separator,Eo as Sheet,Xe as SheetClose,Co as SheetContent,To as SheetDescription,Lo as SheetFooter,ko as SheetHeader,No as SheetTitle,Ye as SheetTrigger,ds as Shell,ms as ShellContent,hr as ShellHeader,dr as ShellMain,pr as ShellNav,hs as ShellSidebar,ur as ShellSidebarHeader,bs as ShellUserMenu,Ft as Sidebar,as as SidebarClose,ke as SidebarContent,er as SidebarFooter,Le as SidebarGroup,cs as SidebarGroupAction,ls as SidebarGroupCollapsible,nr as SidebarGroupContent,Ne as SidebarGroupLabel,tr as SidebarHeader,or as SidebarInput,sr as SidebarInset,zt as SidebarMenu,us as SidebarMenuAction,ar as SidebarMenuBadge,jt as SidebarMenuButton,Te as SidebarMenuItem,cr as SidebarMenuSkeleton,ir as SidebarMenuSub,ps as SidebarMenuSubButton,lr as SidebarMenuSubItem,fn as SidebarProvider,is as SidebarRail,rr as SidebarSeparator,ns as SidebarTrigger,de as Skeleton,so as Slider,Jt as Spinner,He as Switch,ie as TabContent,$t as TabTrigger,mr as Table,oe as Tabs,re as TabsContainer,ne as TabsList,ln as TextEditor,he as Textarea,Ht as ThemeButton,qt as Toast,Ls as Toggle,Yr as ToggleGroup,Ns as ToggleGroupItem,Ot as Tooltip,Xs as Typography,Fc as __info__,zc as batched,Hc as blockDom,f as cn,qs as createNamedIcon,$e as createThemeController,E0 as default,Qr as findMarkdownTreeNode,Wc as htmlEscape,ga as iconComponentName,Pe as loadFile,$h as loadTemplate,Kc as markRaw,si as markup,pt as mergeStyle,Ps as mount,hi as normalizeTheme,Vc as onError,K as onMounted,rt as onPatched,Zc as onRendered,qe as onWillDestroy,Gc as onWillPatch,ri as onWillRender,xt as onWillStart,G as onWillUnmount,nt as onWillUpdateProps,Rh as rawMount,Mh as rawXml,Jc as reactive,Fi as registerGlobalComponents,Yc as status,Xc as toRaw,z as useChildSubEnv,Qc as useComponent,yt as useEffect,tl as useEnv,Us as useExternalListener,$ as useRef,I as useState,el as useSubEnv,sl as validate,ol as validateType,rl as whenReady,Hi as xml};