@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.
@@ -1,46 +0,0 @@
1
- var al=Object.create;var yn=Object.defineProperty;var ll=Object.getOwnPropertyDescriptor;var pl=Object.getOwnPropertyNames;var cl=Object.getPrototypeOf,ul=Object.prototype.hasOwnProperty;var dl=(e,t,s)=>t in e?yn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var Nt=(e,t,s)=>()=>{if(s)throw s[0];try{return e&&(t=e(e=0)),t}catch(o){throw s=[o],o}};var hl=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(s){throw t=0,s}},jn=(e,t)=>{for(var s in t)yn(e,s,{get:t[s],enumerable:!0})},ml=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pl(t))!ul.call(e,i)&&i!==s&&yn(e,i,{get:()=>t[i],enumerable:!(o=ll(t,i))||o.enumerable});return e};var fl=(e,t,s)=>(s=e!=null?al(cl(e)):{},ml(t||!e||!e.__esModule?yn(s,"default",{value:e,enumerable:!0}):s,e));var r=(e,t,s)=>dl(e,typeof t!="symbol"?t+"":t,s);var V,gl,Bi,bl,xl,vl,yl,wl,Sl,De,Cl,Fn,Ii,kl,J,rt,Al,je,El,Nl,Tt,X,lt,Tl,Ol,Ll,z,Rl,vt,Bl,Us,B,O,Il,Pl,_l,$l,qn,zn=Nt(()=>{V=globalThis.owl;if(!V)throw new Error("NodexUI: load dist/nodexui.min.js or dist/nodexui.esm.js before this script (globalThis.owl is not set).");gl=V.App,Bi=V.Component,bl=V.EventBus,xl=V.OwlError,vl=V.__info__,yl=V.batched,wl=V.blockDom,Sl=V.htmlEscape,De=V.loadFile,Cl=V.markRaw,Fn=V.markup,Ii=V.mount,kl=V.onError,J=V.onMounted,rt=V.onPatched,Al=V.onRendered,je=V.onWillDestroy,El=V.onWillPatch,Nl=V.onWillRender,Tt=V.onWillStart,X=V.onWillUnmount,lt=V.onWillUpdateProps,Tl=V.reactive,Ol=V.status,Ll=V.toRaw,z=V.useChildSubEnv,Rl=V.useComponent,vt=V.useEffect,Bl=V.useEnv,Us=V.useExternalListener,B=V.useRef,O=V.useState,Il=V.useSubEnv,Pl=V.validate,_l=V.validateType,$l=V.whenReady,qn=V.xml});function Pi(e){Object.assign(an,e)}function Ml(e){let t=e.components;t?t!==an&&Object.getPrototypeOf(t)===Object.prototype&&Object.setPrototypeOf(t,an):e.components=Object.create(an)}function _i(e){return typeof e!="string"||!/\st-(att|attf|model)([.\s=-]|$)/.test(e)?e:e.replace(/<([A-Z][\w.:-]*)(\s[^<>]*?)?(\/?)>/g,(t,s,o="",i="")=>`<${s}${Ul(s,o)}${i}>`)}function Ul(e,t){let s=/\st-(att|attf|model|on)([.\s=-]|$)/.test(t),o=t.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,l,u,h,S)=>`${l}${u}=${h}${ql(S)}${h}`);return o=o.replace(/(\s)t-model((?:\.[\w-]+)*)\s*=\s*(["'])(.*?)\3/g,(i,l,u,h,S)=>zl(e,l,u,h,S,o)),s?Dl(o):o}function Dl(e){return e.replace(/(\s)([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(t,s,o,i,l)=>o.startsWith("t-")||o==="t-props"||Fl(l)?t:`${s}${o}=${i}${jl(l)}${i}`)}function jl(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function Fl(e){let t=e.trim();return!t||/^(['"`[{(]|-?\d+(?:\.\d+)?$)/.test(t)||/[?.()[\]+*/]|=>|===|!==|&&|\|\|/.test(t)||/^(true|false|null|undefined)$/.test(t)}function ql(e){return`\`${e.replace(/`/g,"\\`").replace(/{{\s*([\s\S]*?)\s*}}|#\{\s*([\s\S]*?)\s*\}/g,(t,s,o)=>`\${${s||o}}`)}\``}function zl(e,t,s,o,i,l){let u=/^(Checkbox|Switch)$/.test(e),h=Hl(e,s),S=u?"checked":"value",M=new RegExp(`\\s${S}\\s*=`).test(l)?"":`${t}${S}=${o}${i}${o}`,U=new RegExp(`\\s${h}\\s*=`).test(l)?"":`${t}${h}=${o}${Wl(i,s,u)}${o}`;return`${M}${U}`}function Hl(e,t){return t.includes(".lazy")?"onChange":/^(Input|Textarea)$/.test(e)?"onInput":"onChange"}function Wl(e,t,s){if(s)return`(value) => { ${e} = value; }`;let o="value";return t.includes(".trim")&&(o=`(typeof ${o} === 'string' ? ${o}.trim() : ${o})`),t.includes(".number")&&(o=`Number.isNaN(Number(${o})) ? ${o} : Number(${o})`),`(value) => { ${e} = ${o}; }`}function $i(e,...t){return Array.isArray(e?.raw)?qn({raw:e.raw.map(_i)},...t):qn(e,...t)}function Ds(e,t,s={}){let o=_i(s.templates);return e.components={...an,...e.components||{}},Ii(e,t,o===s.templates?s:{...s,templates:o})}var an,a,R=Nt(()=>{zn();zn();an={};a=class extends Bi{constructor(...t){super(...t),Ml(this.constructor)}}});function m(...e){let t=[];for(let s of e)if(s){if(typeof s=="string")t.push(s);else if(Array.isArray(s)){let o=m(...s);o&&t.push(o)}else if(typeof s=="object")for(let[o,i]of Object.entries(s))i&&t.push(o)}return t.join(" ")}function n(e){return{type:e,optional:!0}}function ht(e,t,s){return e[t]??(s?e[s]:void 0)}function pt(e){return e===!0||e==="open"||e==="on"||e==="active"}function dt(...e){let t=[];for(let s of e)if(s){if(typeof s=="string"){let o=s.trim().replace(/;$/,"");o&&t.push(o)}else if(typeof s=="object")for(let[o,i]of Object.entries(s)){if(i==null||i==="")continue;let l=o.replace(/[A-Z]/g,u=>"-"+u.toLowerCase());t.push(`${l}:${i}`)}}return t.join(";")}function it(e){return e.state!==void 0?pt(e.state):e.open!==void 0?e.open:e["default-open"]!==void 0?e["default-open"]:e.defaultOpen??!1}function Fe(e){return e.state!==void 0||e.open!==void 0}var p,N=Nt(()=>{p={className:n(String),style:n([String,Object]),slots:n(Object)}});function Gl(e){return typeof e=="string"?document.querySelector(e):e instanceof Element?e:null}function Wn(e,t,s={}){e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:s}))}function Zl(e,t={}){return e.hasAttribute("b-icon")?"icon":t.name||e.getAttribute("b-ui")}function Jl(e,t){return t===document||t===e||t.contains(e)}function Yl(e,t={}){return!t.allowBootstrapControl&&e.matches(Vl)}var Kl,Hn,ln,wn,Vl,Kn,_t,Vn=Nt(()=>{Kl="__NODEXUI_VERSION__",Hn=new Map,ln=new WeakMap,wn="[b-ui], [b-icon]",Vl="[data-bs-toggle], [data-bs-target], [data-bs-dismiss]";Kn=typeof window<"u"?window.thebase:void 0,_t=Kn?.register?Kn:Object.assign(Kn||{},{version:Kl,register(e,t){if(!e||!t)throw new Error("NodexUI.register requires a name and component definition.");return Hn.set(e,t),this},component(e){return Hn.get(e)},mount(e,t={}){let s=Gl(e);if(!s||Yl(s,t))return null;let o=Zl(s,t),i=Hn.get(o);if(!i)return null;let l=ln.get(s);if(l?.name===o)return l;l&&(l.destroy?.(),ln.delete(s),Wn(s,"nodexui:destroyed",{name:l.name}));let u=i.mount?.(s,this,t)||{},h={name:o,element:s,destroy:u.destroy};return ln.set(s,h),Wn(s,"nodexui:mounted",{name:o,instance:h}),h},mountAll(e=document){let t=e||document,s=[...t.querySelectorAll?.(wn)||[]];return t instanceof Element&&t.matches(wn)&&s.unshift(t),s.map(o=>this.mount(o)).filter(Boolean)},destroy(e=document){let t=e||document,s=[...t.querySelectorAll?.(wn)||[]];t instanceof Element&&t.matches(wn)&&s.unshift(t);for(let o of s){let i=ln.get(o);i&&Jl(o,t)&&(i.destroy?.(),ln.delete(o),Wn(o,"nodexui:destroyed",{name:i.name}))}},theme:{set(e){let t=document.documentElement;if(typeof e=="string"){t.setAttribute("b-theme",e),t.dataset.bsTheme=e;return}for(let[s,o]of Object.entries(e||{})){let i=s==="radius"||s==="--b-radius"?"--base-radius":s.startsWith("--")?s:`--b-${s}`;t.style.setProperty(i,o)}}}});typeof window<"u"&&(window.thebase=_t,window.NodexUI=_t)});function tp(e){return typeof Image>"u"?Promise.resolve(!0):(Gn.has(e)||Gn.set(e,new Promise(t=>{let s=new Image;s.onload=()=>t(!0),s.onerror=()=>t(!1),s.src=e})),Gn.get(e))}function Sn(e){return String(e||"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function pn(e,t={}){let s=Sn(e);if(!Xl.test(s))throw new Error(`NodexUI icon name is invalid: ${e}`);return`${String(t.baseUrl||_t.icons.lucide.cdnBaseUrl).replace(/\/+$/,"")}/${s}.svg`}function Zn(e,t,s={}){let o=s.url||pn(t,s),i=s.label??e.getAttribute("aria-label")??"";e.classList.add("b-icon"),e.style.setProperty("--b-icon-url",`url("${o.replace(/"/g,"%22")}")`),(s.size||e.getAttribute("b-att-size"))&&e.style.setProperty("--b-icon-size",s.size||e.getAttribute("b-att-size")),i?(e.setAttribute("role","img"),e.setAttribute("aria-label",i)):e.setAttribute("aria-hidden","true");let l=s.fallback===!1?null:s.fallback||Cn;return l&&!s.url&&Sn(t)!==Sn(l)&&tp(o).then(u=>{if(u||!e.isConnected)return;let h=pn(l,s);e.style.setProperty("--b-icon-url",`url("${h.replace(/"/g,"%22")}")`)}),e}var Mi,Ql,Cn,Xl,Gn,Jn=Nt(()=>{Vn();Mi="1.31.0",Ql=`https://cdn.jsdelivr.net/npm/lucide-static@${Mi}/icons`,Cn="file",Xl=/^[a-z0-9][a-z0-9-]*$/,Gn=new Map;_t.icons={..._t.icons||{},lucide:{version:Mi,cdnBaseUrl:Ql,normalizeName:Sn,url:pn,render:Zn}}});var Ot,Yt,kn=Nt(()=>{Ot={default:"btn-primary",secondary:"btn-secondary",destructive:"btn-danger",outline:"btn-outline-secondary",ghost:"btn-light",link:"btn-link"},Yt={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 Ui({variant:e="default",size:t,className:s}={}){return m("btn","b-button","b-clipboard-button",Ot[e]||Ot.default,Yt[t],s)}async function An(e){let t=String(e??"");if(globalThis.navigator?.clipboard?.writeText)try{await globalThis.navigator.clipboard.writeText(t);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=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",s.style.pointerEvents="none",document.body.append(s),s.select(),s.setSelectionRange(0,t.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 ed,Yn=Nt(()=>{N();kn();ed=["btn","b-button","b-clipboard-button",...Object.values(Ot),...Object.values(Yt)]});var ua=hl((pa,ca)=>{var la=(function(){var e=function(P,_){var E=236,T=17,g=P,k=s[_],d=null,c=0,A=null,v=[],C={},K=function(b,x){c=g*4+17,d=(function(f){for(var y=new Array(f),w=0;w<f;w+=1){y[w]=new Array(f);for(var I=0;I<f;I+=1)y[w][I]=null}return y})(c),G(0,0),G(c-7,0),G(0,c-7),ut(),nt(),It(b,x),g>=7&&Lt(b),A==null&&(A=nl(g,k,v)),Pt(A,x)},G=function(b,x){for(var f=-1;f<=7;f+=1)if(!(b+f<=-1||c<=b+f))for(var y=-1;y<=7;y+=1)x+y<=-1||c<=x+y||(0<=f&&f<=6&&(y==0||y==6)||0<=y&&y<=6&&(f==0||f==6)||2<=f&&f<=4&&2<=y&&y<=4?d[b+f][x+y]=!0:d[b+f][x+y]=!1)},et=function(){for(var b=0,x=0,f=0;f<8;f+=1){K(!0,f);var y=i.getLostPoint(C);(f==0||b>y)&&(b=y,x=f)}return x},nt=function(){for(var b=8;b<c-8;b+=1)d[b][6]==null&&(d[b][6]=b%2==0);for(var x=8;x<c-8;x+=1)d[6][x]==null&&(d[6][x]=x%2==0)},ut=function(){for(var b=i.getPatternPosition(g),x=0;x<b.length;x+=1)for(var f=0;f<b.length;f+=1){var y=b[x],w=b[f];if(d[y][w]==null)for(var I=-2;I<=2;I+=1)for(var j=-2;j<=2;j+=1)I==-2||I==2||j==-2||j==2||I==0&&j==0?d[y+I][w+j]=!0:d[y+I][w+j]=!1}},Lt=function(b){for(var x=i.getBCHTypeNumber(g),f=0;f<18;f+=1){var y=!b&&(x>>f&1)==1;d[Math.floor(f/3)][f%3+c-8-3]=y}for(var f=0;f<18;f+=1){var y=!b&&(x>>f&1)==1;d[f%3+c-8-3][Math.floor(f/3)]=y}},It=function(b,x){for(var f=k<<3|x,y=i.getBCHTypeInfo(f),w=0;w<15;w+=1){var I=!b&&(y>>w&1)==1;w<6?d[w][8]=I:w<8?d[w+1][8]=I:d[c-15+w][8]=I}for(var w=0;w<15;w+=1){var I=!b&&(y>>w&1)==1;w<8?d[8][c-w-1]=I:w<9?d[8][15-w-1+1]=I:d[8][15-w-1]=I}d[c-8][8]=!b},Pt=function(b,x){for(var f=-1,y=c-1,w=7,I=0,j=i.getMaskFunction(x),D=c-1;D>0;D-=2)for(D==6&&(D-=1);;){for(var st=0;st<2;st+=1)if(d[y][D-st]==null){var at=!1;I<b.length&&(at=(b[I]>>>w&1)==1);var q=j(y,D-st);q&&(at=!at),d[y][D-st]=at,w-=1,w==-1&&(I+=1,w=7)}if(y+=f,y<0||c<=y){y-=f,f=-f;break}}},$s=function(b,x){for(var f=0,y=0,w=0,I=new Array(x.length),j=new Array(x.length),D=0;D<x.length;D+=1){var st=x[D].dataCount,at=x[D].totalCount-st;y=Math.max(y,st),w=Math.max(w,at),I[D]=new Array(st);for(var q=0;q<I[D].length;q+=1)I[D][q]=255&b.getBuffer()[q+f];f+=st;var yt=i.getErrorCorrectPolynomial(at),wt=u(I[D],yt.getLength()-1),Oi=wt.mod(yt);j[D]=new Array(yt.getLength()-1);for(var q=0;q<j[D].length;q+=1){var Li=q+Oi.getLength()-j[D].length;j[D][q]=Li>=0?Oi.getAt(Li):0}}for(var Ri=0,q=0;q<x.length;q+=1)Ri+=x[q].totalCount;for(var Dn=new Array(Ri),vn=0,q=0;q<y;q+=1)for(var D=0;D<x.length;D+=1)q<I[D].length&&(Dn[vn]=I[D][q],vn+=1);for(var q=0;q<w;q+=1)for(var D=0;D<x.length;D+=1)q<j[D].length&&(Dn[vn]=j[D][q],vn+=1);return Dn},nl=function(b,x,f){for(var y=h.getRSBlocks(b,x),w=S(),I=0;I<f.length;I+=1){var j=f[I];w.put(j.getMode(),4),w.put(j.getLength(),i.getLengthInBits(j.getMode(),b)),j.write(w)}for(var D=0,I=0;I<y.length;I+=1)D+=y[I].dataCount;if(w.getLengthInBits()>D*8)throw"code length overflow. ("+w.getLengthInBits()+">"+D*8+")";for(w.getLengthInBits()+4<=D*8&&w.put(0,4);w.getLengthInBits()%8!=0;)w.putBit(!1);for(;!(w.getLengthInBits()>=D*8||(w.put(E,8),w.getLengthInBits()>=D*8));)w.put(T,8);return $s(w,y)};C.addData=function(b,x){x=x||"Byte";var f=null;switch(x){case"Numeric":f=M(b);break;case"Alphanumeric":f=U(b);break;case"Byte":f=F(b);break;case"Kanji":f=H(b);break;default:throw"mode:"+x}v.push(f),A=null},C.isDark=function(b,x){if(b<0||c<=b||x<0||c<=x)throw b+","+x;return d[b][x]},C.getModuleCount=function(){return c},C.make=function(){if(g<1){for(var b=1;b<40;b++){for(var x=h.getRSBlocks(b,k),f=S(),y=0;y<v.length;y++){var w=v[y];f.put(w.getMode(),4),f.put(w.getLength(),i.getLengthInBits(w.getMode(),b)),w.write(f)}for(var I=0,y=0;y<x.length;y++)I+=x[y].dataCount;if(f.getLengthInBits()<=I*8)break}g=b}K(!1,et())},C.createTableTag=function(b,x){b=b||2,x=typeof x>"u"?b*4:x;var f="";f+='<table style="',f+=" border-width: 0px; border-style: none;",f+=" border-collapse: collapse;",f+=" padding: 0px; margin: "+x+"px;",f+='">',f+="<tbody>";for(var y=0;y<C.getModuleCount();y+=1){f+="<tr>";for(var w=0;w<C.getModuleCount();w+=1)f+='<td style="',f+=" border-width: 0px; border-style: none;",f+=" border-collapse: collapse;",f+=" padding: 0px; margin: 0px;",f+=" width: "+b+"px;",f+=" height: "+b+"px;",f+=" background-color: ",f+=C.isDark(y,w)?"#000000":"#ffffff",f+=";",f+='"/>';f+="</tr>"}return f+="</tbody>",f+="</table>",f},C.createSvgTag=function(b,x,f,y){var w={};typeof arguments[0]=="object"&&(w=arguments[0],b=w.cellSize,x=w.margin,f=w.alt,y=w.title),b=b||2,x=typeof x>"u"?b*4:x,f=typeof f=="string"?{text:f}:f||{},f.text=f.text||null,f.id=f.text?f.id||"qrcode-description":null,y=typeof y=="string"?{text:y}:y||{},y.text=y.text||null,y.id=y.text?y.id||"qrcode-title":null;var I=C.getModuleCount()*b+x*2,j,D,st,at,q="",yt;for(yt="l"+b+",0 0,"+b+" -"+b+",0 0,-"+b+"z ",q+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',q+=w.scalable?"":' width="'+I+'px" height="'+I+'px"',q+=' viewBox="0 0 '+I+" "+I+'" ',q+=' preserveAspectRatio="xMinYMin meet"',q+=y.text||f.text?' role="img" aria-labelledby="'+Ms([y.id,f.id].join(" ").trim())+'"':"",q+=">",q+=y.text?'<title id="'+Ms(y.id)+'">'+Ms(y.text)+"</title>":"",q+=f.text?'<description id="'+Ms(f.id)+'">'+Ms(f.text)+"</description>":"",q+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',q+='<path d="',st=0;st<C.getModuleCount();st+=1)for(at=st*b+x,j=0;j<C.getModuleCount();j+=1)C.isDark(st,j)&&(D=j*b+x,q+="M"+D+","+at+yt);return q+='" stroke="transparent" fill="black"/>',q+="</svg>",q},C.createDataURL=function(b,x){b=b||2,x=typeof x>"u"?b*4:x;var f=C.getModuleCount()*b+x*2,y=x,w=f-x;return Et(f,f,function(I,j){if(y<=I&&I<w&&y<=j&&j<w){var D=Math.floor((I-y)/b),st=Math.floor((j-y)/b);return C.isDark(st,D)?0:1}else return 1})},C.createImgTag=function(b,x,f){b=b||2,x=typeof x>"u"?b*4:x;var y=C.getModuleCount()*b+x*2,w="";return w+="<img",w+=' src="',w+=C.createDataURL(b,x),w+='"',w+=' width="',w+=y,w+='"',w+=' height="',w+=y,w+='"',f&&(w+=' alt="',w+=Ms(f),w+='"'),w+="/>",w};var Ms=function(b){for(var x="",f=0;f<b.length;f+=1){var y=b.charAt(f);switch(y){case"<":x+="&lt;";break;case">":x+="&gt;";break;case"&":x+="&amp;";break;case'"':x+="&quot;";break;default:x+=y;break}}return x},il=function(b){var x=1;b=typeof b>"u"?x*2:b;var f=C.getModuleCount()*x+b*2,y=b,w=f-b,I,j,D,st,at,q={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},yt={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},wt="";for(I=0;I<f;I+=2){for(D=Math.floor((I-y)/x),st=Math.floor((I+1-y)/x),j=0;j<f;j+=1)at="\u2588",y<=j&&j<w&&y<=I&&I<w&&C.isDark(D,Math.floor((j-y)/x))&&(at=" "),y<=j&&j<w&&y<=I+1&&I+1<w&&C.isDark(st,Math.floor((j-y)/x))?at+=" ":at+="\u2588",wt+=b<1&&I+1>=w?yt[at]:q[at];wt+=`
2
- `}return f%2&&b>0?wt.substring(0,wt.length-f-1)+Array(f+1).join("\u2580"):wt.substring(0,wt.length-1)};return C.createASCII=function(b,x){if(b=b||1,b<2)return il(x);b-=1,x=typeof x>"u"?b*2:x;var f=C.getModuleCount()*b+x*2,y=x,w=f-x,I,j,D,st,at=Array(b+1).join("\u2588\u2588"),q=Array(b+1).join(" "),yt="",wt="";for(I=0;I<f;I+=1){for(D=Math.floor((I-y)/b),wt="",j=0;j<f;j+=1)st=1,y<=j&&j<w&&y<=I&&I<w&&C.isDark(D,Math.floor((j-y)/b))&&(st=0),wt+=st?at:q;for(D=0;D<b;D+=1)yt+=wt+`
3
- `}return yt.substring(0,yt.length-1)},C.renderTo2dContext=function(b,x){x=x||2;for(var f=C.getModuleCount(),y=0;y<f;y++)for(var w=0;w<f;w++)b.fillStyle=C.isDark(y,w)?"black":"white",b.fillRect(y*x,w*x,x,x)},C};e.stringToBytesFuncs={default:function(P){for(var _=[],E=0;E<P.length;E+=1){var T=P.charCodeAt(E);_.push(T&255)}return _}},e.stringToBytes=e.stringToBytesFuncs.default,e.createStringToBytes=function(P,_){var E=(function(){for(var g=W(P),k=function(){var nt=g.read();if(nt==-1)throw"eof";return nt},d=0,c={};;){var A=g.read();if(A==-1)break;var v=k(),C=k(),K=k(),G=String.fromCharCode(A<<8|v),et=C<<8|K;c[G]=et,d+=1}if(d!=_)throw d+" != "+_;return c})(),T=63;return function(g){for(var k=[],d=0;d<g.length;d+=1){var c=g.charCodeAt(d);if(c<128)k.push(c);else{var A=E[g.charAt(d)];typeof A=="number"?(A&255)==A?k.push(A):(k.push(A>>>8),k.push(A&255)):k.push(T)}}return k}};var t={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 P=[[],[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]],_=1335,E=7973,T=21522,g={},k=function(d){for(var c=0;d!=0;)c+=1,d>>>=1;return c};return g.getBCHTypeInfo=function(d){for(var c=d<<10;k(c)-k(_)>=0;)c^=_<<k(c)-k(_);return(d<<10|c)^T},g.getBCHTypeNumber=function(d){for(var c=d<<12;k(c)-k(E)>=0;)c^=E<<k(c)-k(E);return d<<12|c},g.getPatternPosition=function(d){return P[d-1]},g.getMaskFunction=function(d){switch(d){case o.PATTERN000:return function(c,A){return(c+A)%2==0};case o.PATTERN001:return function(c,A){return c%2==0};case o.PATTERN010:return function(c,A){return A%3==0};case o.PATTERN011:return function(c,A){return(c+A)%3==0};case o.PATTERN100:return function(c,A){return(Math.floor(c/2)+Math.floor(A/3))%2==0};case o.PATTERN101:return function(c,A){return c*A%2+c*A%3==0};case o.PATTERN110:return function(c,A){return(c*A%2+c*A%3)%2==0};case o.PATTERN111:return function(c,A){return(c*A%3+(c+A)%2)%2==0};default:throw"bad maskPattern:"+d}},g.getErrorCorrectPolynomial=function(d){for(var c=u([1],0),A=0;A<d;A+=1)c=c.multiply(u([1,l.gexp(A)],0));return c},g.getLengthInBits=function(d,c){if(1<=c&&c<10)switch(d){case t.MODE_NUMBER:return 10;case t.MODE_ALPHA_NUM:return 9;case t.MODE_8BIT_BYTE:return 8;case t.MODE_KANJI:return 8;default:throw"mode:"+d}else if(c<27)switch(d){case t.MODE_NUMBER:return 12;case t.MODE_ALPHA_NUM:return 11;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 10;default:throw"mode:"+d}else if(c<41)switch(d){case t.MODE_NUMBER:return 14;case t.MODE_ALPHA_NUM:return 13;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 12;default:throw"mode:"+d}else throw"type:"+c},g.getLostPoint=function(d){for(var c=d.getModuleCount(),A=0,v=0;v<c;v+=1)for(var C=0;C<c;C+=1){for(var K=0,G=d.isDark(v,C),et=-1;et<=1;et+=1)if(!(v+et<0||c<=v+et))for(var nt=-1;nt<=1;nt+=1)C+nt<0||c<=C+nt||et==0&&nt==0||G==d.isDark(v+et,C+nt)&&(K+=1);K>5&&(A+=3+K-5)}for(var v=0;v<c-1;v+=1)for(var C=0;C<c-1;C+=1){var ut=0;d.isDark(v,C)&&(ut+=1),d.isDark(v+1,C)&&(ut+=1),d.isDark(v,C+1)&&(ut+=1),d.isDark(v+1,C+1)&&(ut+=1),(ut==0||ut==4)&&(A+=3)}for(var v=0;v<c;v+=1)for(var C=0;C<c-6;C+=1)d.isDark(v,C)&&!d.isDark(v,C+1)&&d.isDark(v,C+2)&&d.isDark(v,C+3)&&d.isDark(v,C+4)&&!d.isDark(v,C+5)&&d.isDark(v,C+6)&&(A+=40);for(var C=0;C<c;C+=1)for(var v=0;v<c-6;v+=1)d.isDark(v,C)&&!d.isDark(v+1,C)&&d.isDark(v+2,C)&&d.isDark(v+3,C)&&d.isDark(v+4,C)&&!d.isDark(v+5,C)&&d.isDark(v+6,C)&&(A+=40);for(var Lt=0,C=0;C<c;C+=1)for(var v=0;v<c;v+=1)d.isDark(v,C)&&(Lt+=1);var It=Math.abs(100*Lt/c/c-50)/5;return A+=It*10,A},g})(),l=(function(){for(var P=new Array(256),_=new Array(256),E=0;E<8;E+=1)P[E]=1<<E;for(var E=8;E<256;E+=1)P[E]=P[E-4]^P[E-5]^P[E-6]^P[E-8];for(var E=0;E<255;E+=1)_[P[E]]=E;var T={};return T.glog=function(g){if(g<1)throw"glog("+g+")";return _[g]},T.gexp=function(g){for(;g<0;)g+=255;for(;g>=256;)g-=255;return P[g]},T})();function u(P,_){if(typeof P.length>"u")throw P.length+"/"+_;var E=(function(){for(var g=0;g<P.length&&P[g]==0;)g+=1;for(var k=new Array(P.length-g+_),d=0;d<P.length-g;d+=1)k[d]=P[d+g];return k})(),T={};return T.getAt=function(g){return E[g]},T.getLength=function(){return E.length},T.multiply=function(g){for(var k=new Array(T.getLength()+g.getLength()-1),d=0;d<T.getLength();d+=1)for(var c=0;c<g.getLength();c+=1)k[d+c]^=l.gexp(l.glog(T.getAt(d))+l.glog(g.getAt(c)));return u(k,0)},T.mod=function(g){if(T.getLength()-g.getLength()<0)return T;for(var k=l.glog(T.getAt(0))-l.glog(g.getAt(0)),d=new Array(T.getLength()),c=0;c<T.getLength();c+=1)d[c]=T.getAt(c);for(var c=0;c<g.getLength();c+=1)d[c]^=l.gexp(l.glog(g.getAt(c))+k);return u(d,0).mod(g)},T}var h=(function(){var P=[[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]],_=function(g,k){var d={};return d.totalCount=g,d.dataCount=k,d},E={},T=function(g,k){switch(k){case s.L:return P[(g-1)*4+0];case s.M:return P[(g-1)*4+1];case s.Q:return P[(g-1)*4+2];case s.H:return P[(g-1)*4+3];default:return}};return E.getRSBlocks=function(g,k){var d=T(g,k);if(typeof d>"u")throw"bad rs block @ typeNumber:"+g+"/errorCorrectionLevel:"+k;for(var c=d.length/3,A=[],v=0;v<c;v+=1)for(var C=d[v*3+0],K=d[v*3+1],G=d[v*3+2],et=0;et<C;et+=1)A.push(_(K,G));return A},E})(),S=function(){var P=[],_=0,E={};return E.getBuffer=function(){return P},E.getAt=function(T){var g=Math.floor(T/8);return(P[g]>>>7-T%8&1)==1},E.put=function(T,g){for(var k=0;k<g;k+=1)E.putBit((T>>>g-k-1&1)==1)},E.getLengthInBits=function(){return _},E.putBit=function(T){var g=Math.floor(_/8);P.length<=g&&P.push(0),T&&(P[g]|=128>>>_%8),_+=1},E},M=function(P){var _=t.MODE_NUMBER,E=P,T={};T.getMode=function(){return _},T.getLength=function(d){return E.length},T.write=function(d){for(var c=E,A=0;A+2<c.length;)d.put(g(c.substring(A,A+3)),10),A+=3;A<c.length&&(c.length-A==1?d.put(g(c.substring(A,A+1)),4):c.length-A==2&&d.put(g(c.substring(A,A+2)),7))};var g=function(d){for(var c=0,A=0;A<d.length;A+=1)c=c*10+k(d.charAt(A));return c},k=function(d){if("0"<=d&&d<="9")return d.charCodeAt(0)-48;throw"illegal char :"+d};return T},U=function(P){var _=t.MODE_ALPHA_NUM,E=P,T={};T.getMode=function(){return _},T.getLength=function(k){return E.length},T.write=function(k){for(var d=E,c=0;c+1<d.length;)k.put(g(d.charAt(c))*45+g(d.charAt(c+1)),11),c+=2;c<d.length&&k.put(g(d.charAt(c)),6)};var g=function(k){if("0"<=k&&k<="9")return k.charCodeAt(0)-48;if("A"<=k&&k<="Z")return k.charCodeAt(0)-65+10;switch(k){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 :"+k}};return T},F=function(P){var _=t.MODE_8BIT_BYTE,E=P,T=e.stringToBytes(P),g={};return g.getMode=function(){return _},g.getLength=function(k){return T.length},g.write=function(k){for(var d=0;d<T.length;d+=1)k.put(T[d],8)},g},H=function(P){var _=t.MODE_KANJI,E=P,T=e.stringToBytesFuncs.SJIS;if(!T)throw"sjis not supported.";(function(d,c){var A=T(d);if(A.length!=2||(A[0]<<8|A[1])!=c)throw"sjis not supported."})("\u53CB",38726);var g=T(P),k={};return k.getMode=function(){return _},k.getLength=function(d){return~~(g.length/2)},k.write=function(d){for(var c=g,A=0;A+1<c.length;){var v=(255&c[A])<<8|255&c[A+1];if(33088<=v&&v<=40956)v-=33088;else if(57408<=v&&v<=60351)v-=49472;else throw"illegal char at "+(A+1)+"/"+v;v=(v>>>8&255)*192+(v&255),d.put(v,13),A+=2}if(A<c.length)throw"illegal char at "+(A+1)},k},Z=function(){var P=[],_={};return _.writeByte=function(E){P.push(E&255)},_.writeShort=function(E){_.writeByte(E),_.writeByte(E>>>8)},_.writeBytes=function(E,T,g){T=T||0,g=g||E.length;for(var k=0;k<g;k+=1)_.writeByte(E[k+T])},_.writeString=function(E){for(var T=0;T<E.length;T+=1)_.writeByte(E.charCodeAt(T))},_.toByteArray=function(){return P},_.toString=function(){var E="";E+="[";for(var T=0;T<P.length;T+=1)T>0&&(E+=","),E+=P[T];return E+="]",E},_},$=function(){var P=0,_=0,E=0,T="",g={},k=function(c){T+=String.fromCharCode(d(c&63))},d=function(c){if(!(c<0)){if(c<26)return 65+c;if(c<52)return 97+(c-26);if(c<62)return 48+(c-52);if(c==62)return 43;if(c==63)return 47}throw"n:"+c};return g.writeByte=function(c){for(P=P<<8|c&255,_+=8,E+=1;_>=6;)k(P>>>_-6),_-=6},g.flush=function(){if(_>0&&(k(P<<6-_),P=0,_=0),E%3!=0)for(var c=3-E%3,A=0;A<c;A+=1)T+="="},g.toString=function(){return T},g},W=function(P){var _=P,E=0,T=0,g=0,k={};k.read=function(){for(;g<8;){if(E>=_.length){if(g==0)return-1;throw"unexpected end of file./"+g}var c=_.charAt(E);if(E+=1,c=="=")return g=0,-1;if(c.match(/^\s$/))continue;T=T<<6|d(c.charCodeAt(0)),g+=6}var A=T>>>g-8&255;return g-=8,A};var d=function(c){if(65<=c&&c<=90)return c-65;if(97<=c&&c<=122)return c-97+26;if(48<=c&&c<=57)return c-48+52;if(c==43)return 62;if(c==47)return 63;throw"c:"+c};return k},xt=function(P,_){var E=P,T=_,g=new Array(P*_),k={};k.setPixel=function(v,C,K){g[C*E+v]=K},k.write=function(v){v.writeString("GIF87a"),v.writeShort(E),v.writeShort(T),v.writeByte(128),v.writeByte(0),v.writeByte(0),v.writeByte(0),v.writeByte(0),v.writeByte(0),v.writeByte(255),v.writeByte(255),v.writeByte(255),v.writeString(","),v.writeShort(0),v.writeShort(0),v.writeShort(E),v.writeShort(T),v.writeByte(0);var C=2,K=c(C);v.writeByte(C);for(var G=0;K.length-G>255;)v.writeByte(255),v.writeBytes(K,G,255),G+=255;v.writeByte(K.length-G),v.writeBytes(K,G,K.length-G),v.writeByte(0),v.writeString(";")};var d=function(v){var C=v,K=0,G=0,et={};return et.write=function(nt,ut){if(nt>>>ut)throw"length over";for(;K+ut>=8;)C.writeByte(255&(nt<<K|G)),ut-=8-K,nt>>>=8-K,G=0,K=0;G=nt<<K|G,K=K+ut},et.flush=function(){K>0&&C.writeByte(G)},et},c=function(v){for(var C=1<<v,K=(1<<v)+1,G=v+1,et=A(),nt=0;nt<C;nt+=1)et.add(String.fromCharCode(nt));et.add(String.fromCharCode(C)),et.add(String.fromCharCode(K));var ut=Z(),Lt=d(ut);Lt.write(C,G);var It=0,Pt=String.fromCharCode(g[It]);for(It+=1;It<g.length;){var $s=String.fromCharCode(g[It]);It+=1,et.contains(Pt+$s)?Pt=Pt+$s:(Lt.write(et.indexOf(Pt),G),et.size()<4095&&(et.size()==1<<G&&(G+=1),et.add(Pt+$s)),Pt=$s)}return Lt.write(et.indexOf(Pt),G),Lt.write(K,G),Lt.flush(),ut.toByteArray()},A=function(){var v={},C=0,K={};return K.add=function(G){if(K.contains(G))throw"dup key:"+G;v[G]=C,C+=1},K.size=function(){return C},K.indexOf=function(G){return v[G]},K.contains=function(G){return typeof v[G]<"u"},K};return k},Et=function(P,_,E){for(var T=xt(P,_),g=0;g<_;g+=1)for(var k=0;k<P;k+=1)T.setPixel(k,g,E(k,g));var d=Z();T.write(d);for(var c=$(),A=d.toByteArray(),v=0;v<A.length;v+=1)c.writeByte(A[v]);return c.flush(),"data:image/gif;base64,"+c};return e})();(function(){la.stringToBytesFuncs["UTF-8"]=function(e){function t(s){for(var o=[],i=0;i<s.length;i++){var l=s.charCodeAt(i);l<128?o.push(l):l<2048?o.push(192|l>>6,128|l&63):l<55296||l>=57344?o.push(224|l>>12,128|l>>6&63,128|l&63):(i++,l=65536+((l&1023)<<10|s.charCodeAt(i)&1023),o.push(240|l>>18,128|l>>12&63,128|l>>6&63,128|l&63))}return o}return t(e)}})();(function(e){typeof define=="function"&&define.amd?define([],e):typeof pa=="object"&&(ca.exports=e())})(function(){return la})});var ka={};jn(ka,{destroyNodexUiPreviews:()=>In,enhanceMarkdownDiagrams:()=>ci,expandSelfClosingTags:()=>vc,extractTagCaseMap:()=>rc,mountMarkdownEditor:()=>ui,normalizeOwlPreviewMarkup:()=>wc,parseMarkdown:()=>pi,primeNodexUiTemplates:()=>Sc,renderMermaidBlocks:()=>wa,renderNodexUiBlocks:()=>Ca});function Qp(){return oi??(oi=import("./runtime/marked/marked.min.js").then(e=>{let t=e.marked||e.default?.marked||globalThis.marked;if(!t?.parse)throw new Error("NodexUI markdown: failed to load src/runtime/marked/marked.min.js");return t})),oi}function Xp(e){let t=e.closest("[data-bs-theme]")?.getAttribute("data-bs-theme")||document.documentElement.getAttribute("data-bs-theme");return(t?t==="dark":window.matchMedia?.("(prefers-color-scheme: dark)").matches)?"dark":"default"}function tc(){return ri??(ri=import("./runtime/mermaid/mermaid.esm.min.mjs").then(e=>{let t=e.default||e;return t.initialize({startOnLoad:!1,securityLevel:"strict"}),t})),ri}function ec(){return ni??(ni=import("./runtime/milkdown/milkdown-editor.js")),ni}async function pi(e,t={}){return(await Qp()).parse(String(e??""),{gfm:!0,breaks:!1,...t})}function ai(e,t,s,o=""){e.classList.add("b-markdown-diagram-error"),e.replaceChildren();let i=document.createElement("p");if(i.className="b-markdown-diagram-error-message",i.textContent=`Unable to render ${t} diagram: ${s?.message||s}`,e.append(i),o){let l=document.createElement("pre"),u=document.createElement("code");u.textContent=o,l.append(u),e.append(l)}}async function wa(e){let t=[...e.querySelectorAll("pre > code.language-mermaid")];if(!t.length)return;let s;try{s=await tc()}catch(o){t.forEach(i=>{let l=i.closest("pre");l.replaceChildren(),l.className="b-markdown-diagram b-markdown-mermaid",ai(l,"mermaid",o,i.textContent)});return}s.initialize({startOnLoad:!1,securityLevel:"strict",theme:Xp(e)});for(let o of t){let i=o.textContent,l=o.closest("pre");l.replaceChildren(),l.className="b-markdown-diagram b-markdown-mermaid";try{let{svg:u}=await s.render(`b-mermaid-${++Yp}`,i);l.innerHTML=u}catch(u){ai(l,"mermaid",u,i)}}}function sc(e){let t=globalThis.thebase;if(!t?.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=e,document.body.append(s),t.mountAll(s),s.addEventListener("nodexui:close",()=>s.remove(),{once:!0})}function oc(e){let t=document.createElement("div");t.className="b-markdown-b-code";let s=document.createElement("button");s.type="button",s.className="b-markdown-b-copy";let o=document.createElement("span");Zn(o,"copy",{label:"Copy code"}),s.append(o),s.addEventListener("click",async()=>{try{await An(e),s.dispatchEvent(new CustomEvent("nodexui:markdown-copy",{bubbles:!0,detail:{source:e}})),sc("Copied to clipboard")}catch(u){s.dispatchEvent(new CustomEvent("nodexui:markdown-copy-error",{bubbles:!0,detail:{error:u}}))}}),t.append(s);let i=document.createElement("pre"),l=document.createElement("code");l.className="b-markdown-b-code-lines";for(let u of e.replace(/\n$/,"").split(`
4
- `)){let h=document.createElement("span");h.className="b-markdown-b-code-line",h.textContent=u,l.append(h)}return i.append(l),t.append(i),t}function ba(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function rc(e){let t=new Map;for(let s of e.matchAll(/<\/?([A-Z][A-Za-z0-9]*)\b/g))t.set(s[1].toLowerCase(),s[1]);return t}function nc(e){return t=>{if(t.hasAttribute("b-ui"))return t;let s=globalThis.thebase,o=e.get(t.localName)||t.localName,i=ba(o),l=!!s?.component?.(i),u=tt(t.getAttribute("className")||t.getAttribute("class"));if(!l){let h=`b-${i}`;return t.className=u?`${h} ${u}`:h,t}t.setAttribute("b-ui",i),u&&(t.className=u);for(let h of[...t.attributes]){if(h.name==="class"||h.name==="className"||h.name==="b-ui"||/^on[A-Z]/.test(h.name))continue;let S=tt(h.value);t.removeAttribute(h.name),!(S===""||S==="false")&&t.setAttribute(`b-att-${ba(h.name)}`,S==="true"?"true":S)}return t}}function tt(e){if(!e)return"";let t=e.trim();return t.startsWith("'")&&t.endsWith("'")||t.startsWith('"')&&t.endsWith('"')?t.slice(1,-1):t}function Bn(e,t){for(;e.firstChild;)t.append(e.firstChild)}function At(e,t){return Bn(e,t),e.replaceWith(t),t}function ic(e){let t=document.createElement("div");t.setAttribute("b-field-group","");let s=tt(e.getAttribute("className")||e.getAttribute("class"));return s&&(t.className=s),At(e,t)}function ac(e){let t=document.createElement("div");t.setAttribute("b-ui","field");let s=tt(e.getAttribute("orientation")||""),o=tt(e.getAttribute("className")||e.getAttribute("class"));return s&&t.setAttribute("b-att-orientation",s),o&&(t.className=o),At(e,t)}function lc(e){let t=document.createElement("label");t.setAttribute("b-field-label","");let s=tt(e.getAttribute("for")||""),o=tt(e.getAttribute("className")||e.getAttribute("class"));return s&&t.setAttribute("for",s),o&&(t.className=o),At(e,t)}function xa(e,t,s){let o=document.createElement(t);o.setAttribute(s,"");let i=tt(e.getAttribute("className")||e.getAttribute("class"));return i&&(o.className=i),At(e,o)}function pc(e){let t=e.getAttribute("type")||"",s=e.hasAttribute("variant")||e.hasAttribute("size")||e.hasAttribute("className")||e.hasAttribute("onClick")||e.hasAttribute("label")||t.trim().startsWith("'")||t.trim().startsWith('"');if(e.hasAttribute("b-ui")||!s)return e;let o=document.createElement("button");o.setAttribute("b-ui","button");let i=tt(t||"button"),l=tt(e.getAttribute("variant")||""),u=tt(e.getAttribute("size")||""),h=tt(e.getAttribute("className")||e.getAttribute("class")),S=tt(e.getAttribute("label")||"");return o.type=i||"button",l&&o.setAttribute("b-att-variant",l),u&&o.setAttribute("b-att-size",u),h&&(o.className=h),S&&!e.childNodes.length&&(o.textContent=S),At(e,o)}function cc(e){if(e.hasAttribute("b-ui")||e.hasAttribute("b-icon"))return e;let t=tt(e.getAttribute("name")||e.getAttribute("icon")||"");if(!t)return e;let s=document.createElement("span");s.setAttribute("b-ui","icon"),s.setAttribute("b-att-icon",t);let o=tt(e.getAttribute("size")||""),i=tt(e.getAttribute("label")||""),l=tt(e.getAttribute("className")||e.getAttribute("class"));return o&&s.setAttribute("b-att-size",o),i&&s.setAttribute("b-att-label",i),l&&(s.className=l),At(e,s)}function uc(e){if(e.hasAttribute("b-ui"))return e;let t=document.createElement("div");t.setAttribute("b-ui","alert");let s=tt(e.getAttribute("variant")||""),o=tt(e.getAttribute("className")||e.getAttribute("class"));return s&&t.setAttribute("b-att-variant",s),o&&(t.className=o),At(e,t)}function ii(e){return t=>{if(t.hasAttribute("b-ui"))return t;let s=document.createElement("div"),o=tt(t.getAttribute("className")||t.getAttribute("class"));return s.className=o?`${e} ${o}`:e,At(t,s)}}function dc(e){if(e.hasAttribute("b-ui"))return e;let t=document.createElement("div");t.setAttribute("b-ui","accordion"),tt(e.getAttribute("multiple"))==="true"&&t.setAttribute("b-att-multiple","true");let s=tt(e.getAttribute("className")||e.getAttribute("class"));return s&&(t.className=s),At(e,t)}function hc(e){if(e.hasAttribute("b-accordion-item"))return e;let t=document.createElement("div");t.setAttribute("b-accordion-item",""),tt(e.getAttribute("state"))==="open"&&t.setAttribute("b-att-state","open");let s=tt(e.getAttribute("className")||e.getAttribute("class"));return s&&(t.className=s),At(e,t)}function mc(e){if(e.hasAttribute("b-accordion-trigger"))return e;let t=document.createElement("button");t.type="button",t.setAttribute("b-accordion-trigger","");let s=tt(e.getAttribute("className")||e.getAttribute("class"));s&&(t.className=s),Bn(e,t);let o=document.createElement("span");return o.setAttribute("b-icon","chevron-down"),o.className="b-accordion-trigger-icon",t.append(o),e.replaceWith(t),t}function fc(e){if(e.hasAttribute("b-accordion-panel"))return e;let t=document.createElement("div");t.setAttribute("b-accordion-panel","");let s=tt(e.getAttribute("className")||e.getAttribute("class"));return s&&(t.className=s),At(e,t)}function gc(e){return va+=1,`${e}-${va}`}function kt(e,t,s){return o=>{if(o.hasAttribute("b-ui"))return o;let i=document.createElement(e);e==="button"&&(i.type="button"),s&&i.setAttribute(s,"");let l=tt(o.getAttribute("className")||o.getAttribute("class"));return i.className=l?`${t} ${l}`:t,At(o,i)}}function bc(){let e=document.createElement("button");e.type="button",e.className="btn b-button btn-light btn-icon-sm b-dialog-close b-dialog-close-control",e.setAttribute("b-dialog-close",""),e.setAttribute("aria-label","Close");let t=document.createElement("span");t.setAttribute("b-ui","icon"),t.setAttribute("b-att-icon","x");let s=document.createElement("span");return s.className="visually-hidden",s.textContent="Close",e.append(t,s),e}function ya({tagPrefix:e,componentName:t,triggerTag:s,triggerClassName:o,panelClassName:i,closeButton:l}){return u=>{if(u.hasAttribute("b-ui"))return u;let h=u.querySelector(`:scope > ${e}trigger`),S=u.querySelector(`:scope > ${e}content`);if(!S)return u;let M=gc(`b-preview-${t}`),U=document.createElement(s);s==="button"&&(U.type="button"),U.className=o,U.setAttribute("b-att-trigger",`#${M}`),h&&Bn(h,U);let F=document.createElement("div");F.setAttribute("b-ui",t),F.id=M,F.setAttribute("b-att-trigger",`[b-att-trigger='#${M}']`);let H=document.createElement("div");H.className=i;let Z=tt(S.getAttribute("size")||"");return Z&&H.setAttribute("data-size",Z),Bn(S,H),l&&H.append(l()),F.append(H),u.before(U,F),u.remove(),F}}function vc(e){return e.replace(/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^"'>])*?)\/>/g,(t,s,o)=>xc.has(s.toLowerCase())?t:`<${s}${o}></${s}>`)}function yc(e){e.querySelectorAll("t[t-esc]").forEach(t=>{let o=t.getAttribute("t-esc")?.includes(".length")?"0":"";t.replaceWith(document.createTextNode(`${o}${t.textContent||""}`))})}function wc(e,t){yc(e);let s={fieldgroup:ic,field:ac,fieldlabel:lc,fielddescription:i=>xa(i,"p","b-field-description"),fielderror:i=>xa(i,"p","b-field-error"),button:pc,icon:cc,alert:uc,alerttitle:ii("b-alert-title"),alertdescription:ii("b-alert-description"),alertaction:ii("b-alert-action"),accordion:dc,accordionitem:hc,accordiontrigger:mc,accordioncontent:fc,dialog:ya({tagPrefix:"dialog",componentName:"dialog",triggerTag:"span",triggerClassName:"b-dialog-trigger",panelClassName:"b-dialog-panel",closeButton:bc}),dialogheader:kt("div","b-dialog-header"),dialogfooter:kt("div","b-dialog-footer"),dialogtitle:kt("h2","b-dialog-title"),dialogdescription:kt("p","b-dialog-description"),dialogclose:kt("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:kt("div","b-dialog-header b-alert-dialog-header"),alertdialogfooter:kt("div","b-dialog-footer b-alert-dialog-footer"),alertdialogmedia:kt("div","b-alert-dialog-media"),alertdialogtitle:kt("h2","b-dialog-title b-alert-dialog-title"),alertdialogdescription:kt("p","b-dialog-description b-alert-dialog-description"),alertdialogcancel:kt("button","btn b-button btn-outline-secondary b-alert-dialog-cancel","b-alert-dialog-cancel"),alertdialogaction:kt("button","btn b-button btn-primary b-alert-dialog-action","b-alert-dialog-action")},o=nc(t);for(let i of[...e.querySelectorAll("*")]){let l=i.localName.toLowerCase();s[l]?s[l](i):t.has(l)&&o(i)}}function Sc(e){Rn=Promise.resolve(e)}function Cc(){return Rn??(Rn=De("/dist/nodexui.templates.xml")),Rn}function In(e){let t=li.get(e);if(t){li.delete(e);for(let s of t)try{s.destroy()}catch{}}}function Ac(e){return new Set([...e.matchAll(kc)].map(t=>t[1]))}function Tc(e){let t=new Set;for(let s of e.matchAll(Ec))t.add(s[1]);for(let s of e.matchAll(Nc))t.add(s[2]);return t}function Oc(e){let t=$i({raw:[e]}),s=Ac(e);class o extends a{setup(){this.state=O(Object.fromEntries([...s].map(l=>[l,""])))}}r(o,"template",t);for(let i of Tc(e))o.prototype[i]=function(){};return o}function Sa(e){e.querySelector("[data-slot='dropdown-menu'], .b-dropdown-menu, [b-ui='dropdown-menu'], [b-dropdown-menu]")&&e.classList.add("b-markdown-b-preview-overlay")}async function Lc(e,t){let[s,o]=await Promise.all([Cc(),Oc(t)]),i=await Ds(o,e,{templates:s});return Sa(e),i}function Rc(e,t){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.");e.innerHTML=t,Sa(e),s.mountAll(e)}async function Ca(e){In(e);let t=[...e.querySelectorAll("pre > code.language-base-ui")];if(!t.length)return;let s=new Set;for(let o of t){let i=o.textContent,l=o.closest("pre");l.replaceChildren(),l.className="b-markdown-live b-markdown-nodexui";let u=document.createElement("div");u.className="b-markdown-b-preview",l.append(u,oc(i));try{/<[A-Z]/.test(i)?s.add(await Lc(u,i)):Rc(u,i)}catch(h){ai(l,"NodexUI component",h,i)}}s.size&&li.set(e,s)}function Bc(e){for(let t of e.querySelectorAll("li > input[type=checkbox]:not([aria-label])"))t.setAttribute("aria-label",t.parentElement.textContent.trim())}async function ci(e,{mermaid:t=!0,nodexUi:s=!0}={}){Bc(e),t&&await wa(e),s&&await Ca(e)}async function ui(e){return(await ec()).createMilkdownMarkdownEditor(e)}var oi,ri,ni,Yp,va,xc,Rn,li,kc,Ec,Nc,di=Nt(()=>{R();Jn();Yn();Yp=0;va=0;xc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);li=new WeakMap;kc=/\bstate\.([A-Za-z_$][\w$]*)/g;Ec=/\bthis\.([A-Za-z_$][\w$]*)\s*\(/g,Nc=/\bt-on-[\w:-]+\s*=\s*(["'])([A-Za-z_$][\w$]*)\1/g});function $c(e,t,s){let o=String(e||"").trim();if(!o)return"";let i=o.replace(/\{([^}]+)\}/g,(l,u)=>{let h=s&&typeof s=="object"?s[u]:null;return h&&h.default!==void 0?String(h.default):`{${u}}`});try{return new URL(i,`${t}/`).href.replace(/\/$/,"")}catch{return i.replace(/\/$/,"")}}function ct(e,t){if(e&&typeof e=="object"&&typeof e.$ref=="string"){let s=e.$ref.replace(/^#\//,"").split("/"),o=t;for(let i of s)o=o?.[decodeURIComponent(i.replace(/~1/g,"/").replace(/~0/g,"~"))];return o?{...o}:{}}return e}function Si(e,t){if(!Array.isArray(e?.allOf))return e;let s={...e,properties:{...e.properties},required:[...e.required||[]]};delete s.allOf;for(let o of e.allOf){let i=Si(ct(o,t),t)||{};Object.assign(s.properties,i.properties),s.required.push(...i.required||[]),s.type||(s.type=i.type)}return s}function Mc(e,t){if(!e)return null;let s=ct(e,t);return!s||typeof s!="object"?null:s}function wi(e){return e&&typeof e.$ref=="string"?e.$ref.split("/").pop():null}function Ua(e,t){if(!e||typeof e!="object")return null;for(let[s,o]of Object.entries(e)){let i=Mc(o,t);if(i){if(i.dataValue!==void 0)return{key:s,label:i.summary||s,value:i.dataValue,isAuto:!1};if(i.serializedValue!==void 0)return{key:s,label:i.summary||s,value:i.serializedValue,isAuto:!1};if(i.value!==void 0)return{key:s,label:i.summary||s,value:i.value,isAuto:!1};if(i.externalValue)return{key:s,label:i.summary||s,value:i.externalValue,isAuto:!1}}}return null}function Ci(e){if(e){if(e.example!==void 0)return e.example;if(e.default!==void 0)return e.default;if(Array.isArray(e.enum)&&e.enum.length)return e.enum[0]}}function xi(e,t){if(!e)return null;let s=Ua(e.examples,t);if(s)return s;if(e.example!==void 0)return{label:"media example",value:e.example,isAuto:!1};let o=ct(e.schema,t),i=Ci(o);return i!==void 0?{label:"schema example",value:i,isAuto:!1}:null}function Da(e,t){let s=Ua(e.examples,t);if(s)return s;if(e.example!==void 0)return{label:"example",value:e.example,isAuto:!1};let o=ct(e.schema,t),i=Ci(o);return i!==void 0?{label:"schema example",value:i,isAuto:!1}:null}function Zr(e,t,s=new Set){if(!e)return null;let o=wi(e);if(o){if(s.has(o))return{};s=new Set(s).add(o)}let i=Si(ct(e,t),t);if(!i)return null;let l=Ci(i);if(l!==void 0)return l;if(i.type==="array"||i.items)return[Zr(i.items||{},t,s)];if(i.properties||i.type==="object"){let u={};for(let[h,S]of Object.entries(i.properties||{}))u[h]=Zr(S,t,s);return u}switch(i.type){case"integer":return i.minimum??0;case"number":return i.minimum??0;case"boolean":return!0;case"string":return i.format==="date-time"?new Date().toISOString():i.format==="date"?new Date().toISOString().slice(0,10):i.format==="byte"?"base64==":i.title||"string";default:return null}}function bn(e,t,{depth:s=0,prefix:o="",seen:i=new Set,required:l=!1,selfRow:u=!0}={}){if(!e||s>4)return[];let h=wi(e);if(h){if(i.has(h))return[];i=new Set(i).add(h)}let S=Si(ct(e,t),t),M=[],U=S.contentMediaType||S.contentEncoding?[S.contentMediaType,S.contentEncoding&&`encoding:${S.contentEncoding}`].filter(Boolean).join(", "):"",F=S.discriminator?.propertyName?`discriminator: ${S.discriminator.propertyName}`:"";if(Array.isArray(S.prefixItems))return u&&M.push({path:o||"items",type:"tuple",required:l,description:S.description||""}),S.prefixItems.forEach((H,Z)=>{M.push(...bn(H,t,{depth:s+1,prefix:`${o}[${Z}]`,seen:i,required:!1}))}),S.items&&M.push(...bn(S.items,t,{depth:s+1,prefix:`${o}[n]`,seen:i,required:!1})),M;if(S.type==="array"||S.items)return u&&M.push({path:o||"items",type:"array",required:l,description:S.description||""}),M.push(...bn(S.items||{},t,{depth:s+1,prefix:`${o}[]`,seen:i,required:!1})),M;if(S.properties||S.type==="object"||S.patternProperties){let H=new Set(S.required||[]);for(let[Z,$]of Object.entries(S.properties||{})){let W=ct($,t),xt=o?`${o}.${Z}`:Z;M.push({path:xt,type:W.type||(W.$ref?wi($):"any")||"any",format:W.format||"",enum:W.enum,required:H.has(Z),description:W.description||""}),(W.type==="object"||W.properties||W.type==="array"||W.items)&&M.push(...bn($,t,{depth:s+1,prefix:xt,seen:i,required:H.has(Z),selfRow:!1}))}for(let[Z,$]of Object.entries(S.patternProperties||{})){let W=ct($,t);M.push({path:o?`${o}.<${Z}>`:`<${Z}>`,type:W.type||"any",format:W.format||"",required:!1,description:W.description||""})}return M}return M.push({path:o||"value",type:S.type||"any",format:S.format||"",enum:S.enum,required:l,description:[S.description,U,F].filter(Boolean).join(" \u2014 ")}),M}function Uc(e){let t=Da(e,this);return{name:e.name,in:e.in,required:!!e.required,type:e.type||e.schema?.type||"string",format:e.format||e.schema?.format||"",description:e.description||"",default:e.default??e.schema?.default,enum:e.enum||e.schema?.enum,example:t?t.value:void 0,exampleLabel:t?t.label:""}}function jc(e){if(e.type==="http")return{...e,type:String(e.scheme).toLowerCase()==="basic"?"basic":"bearer"};if(e.type==="openIdConnect")return{...e,type:"bearer",oauth2MetadataUrl:e.openIdConnectUrl};if(e.type!=="oauth2"||!e.flows)return e;let[t,s]=Object.entries(e.flows)[0]||[];return{...e,...s,flow:Dc[t]||t,scopes:s?.scopes||{}}}function ja(e){let t=e.securityDefinitions||e.components?.securitySchemes||{};return Object.fromEntries(Object.entries(t).map(([s,o])=>[s,jc(ct(o,e))]))}function Fc(e,t){let s=ja(t),o=e.security||t.security||[],i=[];for(let l of o)for(let u of Object.keys(l)){let h=s[u];h&&i.push({key:u,...h})}return i}function vi(e,t,s,o){let i={path:[],query:[],header:[],formData:[],body:null};for(let M of o.parameters||[]){let U=ct(M,e);if(U.in==="body"){let F={schema:U.schema},H=xi(F,e);i.body={required:!!U.required,schema:U.schema,description:U.description||"",contentType:"application/json",example:H?H.value:Zr(U.schema,e),exampleLabel:H?H.label:"auto",exampleIsAuto:!H}}else i[U.in]&&i[U.in].push(Uc.call(e,U))}if(o.requestBody){let M=ct(o.requestBody,e)||{},[U,F]=Object.entries(M.content||{})[0]||[];if(U&&F){let H=xi(F,e);i.body={required:!!M.required,schema:F.schema||null,description:M.description||"",contentType:U,encoding:F.encoding||null,itemSchema:F.itemSchema||null,example:H?H.value:Zr(F.schema,e),exampleLabel:H?H.label:"auto",exampleIsAuto:!H}}}let l=Object.entries(o.responses||{}).map(([M,U])=>{let F=ct(U,e)||{},[H,Z]=Object.entries(F.content||{})[0]||[],$=Z?xi(Z,e):null;return{status:M,summary:F.summary||"",description:F.description||"",contentType:H||"application/json",schema:Z?.schema||F.schema||null,encoding:Z?.encoding||null,headers:qc(F.headers,e),links:zc(F.links,e),example:$?$.value:Z?.schema?Zr(Z.schema,e):null,exampleLabel:$?$.label:"auto",exampleIsAuto:!$&&!!Z?.schema}}).sort((M,U)=>{let F=Ma(M.status),H=Ma(U.status);return F-H}),u=Hc(o.callbacks,e),h=s.toUpperCase();return{id:(o.operationId||`${s}-${t}`).replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase(),method:h,path:t,tag:o.tags&&o.tags[0]||"default",summary:o.summary||o.operationId||`${h} ${t}`,description:o.description||"",deprecated:!!o.deprecated,produces:o.produces||e.produces||["application/json"],consumes:o.consumes||e.consumes||(i.body?["application/json"]:[]),parameters:i,responses:l,callbacks:u,externalDocs:o.externalDocs||null,security:Fc(o,e)}}function qc(e,t){return!e||typeof e!="object"?[]:Object.entries(e).map(([s,o])=>{let i=ct(o,t)||{},l=Da({...i,in:"header"},t);return{name:s,required:!!i.required,deprecated:!!i.deprecated,type:i.schema?.type||"string",description:i.description||"",example:l?l.value:void 0}})}function zc(e,t){return!e||typeof e!="object"?[]:Object.entries(e).map(([s,o])=>{let i=ct(o,t)||{};return{name:s,operationId:i.operationId||"",operationRef:i.operationRef||"",description:i.description||"",parameters:i.parameters||{}}})}function Hc(e,t){if(!e||typeof e!="object")return[];let s=[];for(let[o,i]of Object.entries(e)){let l=ct(i,t)||{};for(let[u,h]of Object.entries(l)){let S=ct(h,t)||{};for(let M of yi)S[M]&&s.push({name:o,expression:u,method:M.toUpperCase(),summary:S[M].summary||"",description:S[M].description||""})}}return s}function Ma(e){if(e==="default")return 999;let t=parseInt(e,10);return Number.isNaN(t)?998:t}async function Fa(e,t=""){let s=await fetch(e);if(!s.ok)throw new Error(`Failed to fetch spec: HTTP ${s.status}`);return ki(await s.json(),t)}function ki(e,t=""){if(!e||typeof e!="object"||!e.paths&&!e.webhooks)throw new Error("Not an OpenAPI document (missing paths).");let s=e.schemes&&e.schemes.includes("https")?"https":e.schemes?.[0]||"https",o=e.host||location.host,i=e.basePath||"",l=`${s}://${o}${i}`.replace(/\/$/,""),u=t?[{name:"",url:t.replace(/\/$/,""),description:""}]:Array.isArray(e.servers)&&e.servers.length?e.servers.map($=>({name:$?.name||"",url:$c($?.url,l,$?.variables),description:String($?.description||"").trim()})).filter($=>$.url):[{name:"",url:l,description:""}],h=u[0]?.url||l,S=(e.tags||[]).map($=>$.name),M=new Map((e.tags||[]).map($=>[$.name,$])),U=[];for(let[$,W]of Object.entries(e.paths||{})){let xt=ct(W,e)||{};for(let Et of yi)xt[Et]&&U.push(vi(e,$,Et,xt[Et]));for(let[Et,P]of Object.entries(xt.additionalOperations||{}))U.push(vi(e,$,Et.toLowerCase(),P))}let F=[];for(let[$,W]of Object.entries(e.webhooks||{})){let xt=ct(W,e)||{};for(let Et of yi)xt[Et]&&F.push(vi(e,$,Et,xt[Et]))}let Z=[...new Set([...S,...U.map($=>$.tag)])].map($=>{let W=M.get($);return{id:$.replace(/[^a-zA-Z0-9]+/g,"-").toLowerCase(),name:$,summary:W?.summary||"",description:W?.description||"",parent:W?.parent||"",kind:W?.kind||"",items:U.filter(xt=>xt.tag===$)}}).filter($=>$.items.length);return{spec:e,info:e.info||{},baseUrl:h,derivedBaseUrl:l,servers:u,securityDefinitions:ja(e),groups:Z,webhooks:F,resolveRef:$=>ct($,e),generateExample:$=>Zr($,e),schemaRows:$=>bn($,e),findOperation:$=>U.find(W=>W.id===$)||F.find(W=>W.id===$),firstOperation:()=>U[0]}}var yi,Dc,qa=Nt(()=>{yi=["get","post","put","patch","delete","options","head","trace","query"];Dc={authorizationCode:"accessCode",implicit:"implicit",password:"password",clientCredentials:"application"}});function Wc(e){let t=new URL(e.url);return(e.query||[]).forEach(([s,o])=>{s&&t.searchParams.set(s,String(o||""))}),t.toString()}function Kc(e,t){let s=[];return(e.headers||[]).forEach(([i,l])=>{i&&s.push([i,String(l??"")])}),t&&e.bodyText&&!Vc(s,"Content-Type")&&s.push(["Content-Type",e.mimeType||"application/json"]),s}function Vc(e,t){let s=t.toLowerCase();return e.some(function(o){return String(o[0]||"").toLowerCase()===s})}function Gc(e,t){return String(e||"").split(`
5
- `).map(function(s){return t+s}).join(`
6
- `)}function bt(e){return String(e).replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function Q(e){return String(e).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Zc(e){return String(e).replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}function Jc(e){return String(e).replace(/`/g,'` + "`" + `')}function Yc(e){return String(e).replace(/\\/g,"\\\\").replace(/"""/g,'\\"\\"\\"')}function Pn(e){return String(e).replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function _n(e){return String(e).replace(/\\/g,"\\\\").replace(/'/g,"\\\\'")}function $n(e){return String(e).replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\n/g,"\\n")}function Mn(e){return String(e).replace(/`/g,"``").replace(/"/g,'`"')}function Qc(e){return String(e).replace(/\]=\]/g,']==] .. "]=" .. [=[')}function Xc(e,t){let s=t&&t.quote==="double"?'"':"'";return e.map(function(i){let l=s==='"'?Q(i[0]):bt(i[0]),u=s==='"'?Q(i[1]):bt(i[1]);return s+l+s+": "+s+u+s}).join(`,
7
- `)}function tu(e,t,s){let o=["curl --request "+e.method];return s.forEach(function(i){o.push("--header '"+bt(i[0]+": "+i[1])+"'")}),e.bodyText&&o.push("--data '"+bt(e.bodyText)+"'"),o.push("'"+bt(t)+"'"),o.join(` \\
8
- `)}function za(e,t,s){let o=["const url = '"+bt(t)+"';","const options = {"," method: '"+bt(e.method)+"',"];return s.length&&(o.push(" headers: {"),o.push(Gc(Xc(s)," ")),o.push(" },")),e.bodyText&&o.push(" body: `"+Zc(e.bodyText)+"`,"),o.push("};","","const response = await fetch(url, options);","const data = await response.text();","console.log(response.status, data);"),o.join(`
9
- `)}function eu(e,t,s){return za(e,t,s)}function su(e,t,s){let o=["import requests","","url = '"+bt(t)+"'"];return s.length?(o.push("headers = {"),s.forEach(function(i){o.push(" '"+bt(i[0])+"': '"+bt(i[1])+"',")}),o.push("}")):o.push("headers = {}"),e.bodyText?(o.push("",'payload = """'+Yc(e.bodyText)+'"""'),o.push("response = requests.request('"+bt(e.method)+"', url, headers=headers, data=payload)")):o.push("","response = requests.request('"+bt(e.method)+"', url, headers=headers)"),o.push("print(response.status_code)","print(response.text)"),o.join(`
10
- `)}function ou(e,t,s){let o=["package main","","import (",' "fmt"',' "io"',' "net/http"'];return e.bodyText&&o.push(' "strings"'),o.push(")","","func main() {"),e.bodyText?(o.push(" body := strings.NewReader(`"+Jc(e.bodyText)+"`)"),o.push(' req, err := http.NewRequest("'+e.method+'", "'+t+'", body)')):o.push(' req, err := http.NewRequest("'+e.method+'", "'+t+'", nil)'),o.push(" if err != nil {"," panic(err)"," }"),s.forEach(function(i){o.push(' req.Header.Set("'+Q(i[0])+'", "'+Q(i[1])+'")')}),o.push(""," res, err := http.DefaultClient.Do(req)"," if err != nil {"," panic(err)"," }"," defer res.Body.Close()",""," data, err := io.ReadAll(res.Body)"," if err != nil {"," panic(err)"," }",""," fmt.Println(res.StatusCode)"," fmt.Println(string(data))","}"),o.join(`
11
- `)}function ru(e,t,s){let o=["OkHttpClient client = new OkHttpClient();","","Request.Builder builder = new Request.Builder()",' .url("'+Q(t)+'")'];return s.forEach(function(i){o.push(' .addHeader("'+Q(i[0])+'", "'+Q(i[1])+'")')}),e.bodyText?o.push(";","",'MediaType mediaType = MediaType.parse("'+Q(e.mimeType||"application/json")+'");','RequestBody body = RequestBody.create("""'+Q(e.bodyText)+'""", mediaType);','Request request = builder.method("'+e.method+'", body).build();'):o.push(";","",'Request request = builder.method("'+e.method+'", null).build();'),o.push("","try (Response response = client.newCall(request).execute()) {"," System.out.println(response.code());",' System.out.println(response.body() != null ? response.body().string() : "");',"}"),o.join(`
12
- `)}function nu(e,t,s){let i=["using var client = new HttpClient();","using var request = new HttpRequestMessage(HttpMethod."+(e.method.charAt(0)+e.method.slice(1).toLowerCase())+', "'+Q(t)+'");'];return s.forEach(function(l){i.push('request.Headers.TryAddWithoutValidation("'+Q(l[0])+'", "'+Q(l[1])+'");')}),e.bodyText&&i.push('request.Content = new StringContent("""'+Q(e.bodyText)+'""", Encoding.UTF8, "'+Q(e.mimeType||"application/json")+'");'),i.push("","using var response = await client.SendAsync(request);","var body = await response.Content.ReadAsStringAsync();","Console.WriteLine((int)response.StatusCode);","Console.WriteLine(body);"),i.join(`
13
- `)}function iu(e,t,s){let o=["$ch = curl_init();","curl_setopt_array($ch, ["," CURLOPT_URL => '"+Pn(t)+"',"," CURLOPT_CUSTOMREQUEST => '"+Pn(e.method)+"',"," CURLOPT_RETURNTRANSFER => true,"];return s.length&&(o.push(" CURLOPT_HTTPHEADER => ["),s.forEach(function(i){o.push(" '"+Pn(i[0]+": "+i[1])+"',")}),o.push(" ],")),e.bodyText&&o.push(" CURLOPT_POSTFIELDS => '"+Pn(e.bodyText)+"',"),o.push("]);","","$response = curl_exec($ch);","echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE) . PHP_EOL;","echo $response;","curl_close($ch);"),o.join(`
14
- `)}function au(e,t,s){let o=e.method.charAt(0)+e.method.slice(1).toLowerCase(),i=['require "uri"','require "net/http"',"","uri = URI('"+_n(t)+"')","http = Net::HTTP.new(uri.host, uri.port)",'http.use_ssl = uri.scheme == "https"',"","request = Net::HTTP::"+o+".new(uri)"];return s.forEach(function(l){i.push("request['"+_n(l[0])+"'] = '"+_n(l[1])+"'")}),e.bodyText&&i.push("request.body = '"+_n(e.bodyText)+"'"),i.push("","response = http.request(request)","puts response.code","puts response.body"),i.join(`
15
- `)}function lu(e,t,s){let o=["#include <curl/curl.h>","","int main(void) {"," CURL *curl = curl_easy_init();"," if (!curl) return 1;",""," struct curl_slist *headers = NULL;"];return s.forEach(function(i){o.push(' headers = curl_slist_append(headers, "'+$n(i[0]+": "+i[1])+'");')}),o.push(' curl_easy_setopt(curl, CURLOPT_URL, "'+$n(t)+'");'),o.push(' curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "'+$n(e.method)+'");'),s.length&&o.push(" curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);"),e.bodyText&&o.push(' curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "'+$n(e.bodyText)+'");'),o.push(""," curl_easy_perform(curl);"," curl_slist_free_all(headers);"," curl_easy_cleanup(curl);"," return 0;","}"),o.join(`
16
- `)}function pu(e,t,s){let o=['var request = URLRequest(url: URL(string: "'+Q(t)+'")!)','request.httpMethod = "'+Q(e.method)+'"'];return s.forEach(function(i){o.push('request.setValue("'+Q(i[1])+'", forHTTPHeaderField: "'+Q(i[0])+'")')}),e.bodyText&&o.push('request.httpBody = """',e.bodyText,'""".data(using: .utf8)'),o.push("","URLSession.shared.dataTask(with: request) { data, response, error in"," if let error = error {"," print(error)"," return"," }"," let status = (response as? HTTPURLResponse)?.statusCode ?? 0"," print(status)",' print(String(data: data ?? Data(), encoding: .utf8) ?? "")',"}.resume()"),o.join(`
17
- `)}function cu(e,t,s){let o=['NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"'+Q(t)+'"]];','request.HTTPMethod = @"'+Q(e.method)+'";'];return s.forEach(function(i){o.push('[request setValue:@"'+Q(i[1])+'" forHTTPHeaderField:@"'+Q(i[0])+'"];')}),e.bodyText&&o.push('request.HTTPBody = [@"'+Q(e.bodyText)+'" dataUsingEncoding:NSUTF8StringEncoding];'),o.push("","NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request"," completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"," if (error) {",' NSLog(@"%@", error);'," return;"," }"," NSInteger status = [(NSHTTPURLResponse *)response statusCode];"," NSString *body = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];",' NSLog(@"%ld", (long)status);',' NSLog(@"%@", body);',"}];","[task resume];"),o.join(`
18
- `)}function uu(e,t,s){let o=["val client = OkHttpClient()"];return e.bodyText&&o.push('val body = """',e.bodyText,'""".trimIndent().toRequestBody("'+Q(e.mimeType||"application/json")+'".toMediaType())'),o.push("val request = Request.Builder()",' .url("'+Q(t)+'")'),s.forEach(function(i){o.push(' .addHeader("'+Q(i[0])+'", "'+Q(i[1])+'")')}),o.push(e.bodyText?' .method("'+e.method+'", body)':' .method("'+e.method+'", null)'," .build()","","client.newCall(request).execute().use { response ->"," println(response.code)"," println(response.body?.string().orEmpty())","}"),o.join(`
19
- `)}function du(e,t,s){let o=["let client = reqwest::Client::new();","let response = client"," ."+e.method.toLowerCase()+'("'+Q(t)+'")'];return s.forEach(function(i){o.push(' .header("'+Q(i[0])+'", "'+Q(i[1])+'")')}),e.bodyText&&o.push(' .body(r#"'+e.bodyText.replace(/"#/g,'"#""#')+'"#)'),o.push(" .send()"," .await?;","",'println!("{}", response.status());','println!("{}", response.text().await?);'),o.join(`
20
- `)}function hu(e,t,s){let o=["$headers = @{"];return s.forEach(function(i){o.push(' "'+Mn(i[0])+'" = "'+Mn(i[1])+'"')}),o.push("}",""),e.bodyText&&o.push('$body = @"',e.bodyText,'"@',""),o.push("$response = Invoke-RestMethod -Method "+e.method+' -Uri "'+Mn(t)+'" -Headers $headers'+(e.bodyText?' -Body $body -ContentType "'+Mn(e.mimeType||"application/json")+'"':""),"$response | ConvertTo-Json -Depth 10"),o.join(`
21
- `)}function mu(e,t,s){let o=["import 'package:http/http.dart' as http;","","final uri = Uri.parse('"+bt(t)+"');","final headers = <String, String>{"];return s.forEach(function(i){o.push(" '"+bt(i[0])+"': '"+bt(i[1])+"',")}),o.push("};",""),e.bodyText?o.push("final response = await http."+e.method.toLowerCase()+"(uri, headers: headers, body: '''"+e.bodyText.replace(/'''/g,"'' '")+"''');"):o.push("final response = await http."+e.method.toLowerCase()+"(uri, headers: headers);"),o.push("print('Status: ${response.statusCode}');","print(response.body);"),o.join(`
22
- `)}function fu(e,t,s){let o=['local http = require("socket.http")','local ltn12 = require("ltn12")',"","local response_body = {}","local headers = {"];return s.forEach(function(i){o.push(' ["'+Q(i[0])+'"] = "'+Q(i[1])+'",')}),o.push("}",""),e.bodyText&&(o.push("local body = [==["+Qc(e.bodyText)+"]==]",""),o.push('headers["Content-Length"] = tostring(#body)')),o.push("local _, code = http.request{",' url = "'+Q(t)+'",',' method = "'+Q(e.method)+'",'," headers = headers,"),e.bodyText&&o.push(" source = ltn12.source.string(body),"),o.push(" sink = ltn12.sink.table(response_body),","}","",'print("Status: " .. tostring(code))',"print(table.concat(response_body))"),o.join(`
23
- `)}async function Ha(e,t){let s=Ai.find(function(l){return l.id===e});if(!s)throw new Error("Unknown language: "+e);let o=Kc(t,!0),i=Wc(t);return gu[s.id](t,i,o)}var Ai,gu,Wa=Nt(()=>{Ai=[{id:"curl",label:"CURL",icon:"img/bash-plain.svg"},{id:"csharp",label:"CSHARP",icon:"img/csharp-original.svg"},{id:"go",label:"GO",icon:"img/go-original-wordmark.svg"},{id:"node",label:"NODEJS",icon:"img/nodejs-original.svg"},{id:"ruby",label:"RUBY",icon:"img/ruby-plain.svg"},{id:"php",label:"PHP",icon:"img/php-original.svg"},{id:"javascript",label:"JAVASCRIPT",icon:"img/javascript-original.svg"},{id:"python",label:"PYTHON",icon:"img/python-original.svg"},{id:"java",label:"JAVA",icon:"img/java-original.svg"},{id:"c",label:"C",icon:"img/c-original.svg"},{id:"swift",label:"SWIFT",icon:"img/swift-original.svg"},{id:"objc",label:"OBJECTIVE-C",icon:"img/objectivec-plain.svg"},{id:"kotlin",label:"KOTLIN",icon:"img/kotlin-original.svg"},{id:"rust",label:"RUST",icon:"img/rust-original.svg"},{id:"powershell",label:"POWERSHELL",icon:"img/windows8-original.svg"},{id:"dart",label:"DART",icon:"img/dart-original.svg"},{id:"lua",label:"LUA",icon:"img/lua.svg"}];gu={curl:tu,javascript:za,node:eu,python:su,go:ou,java:ru,csharp:nu,php:iu,ruby:au,c:lu,swift:pu,objc:cu,kotlin:uu,rust:du,powershell:hu,dart:mu,lua:fu}});var Ka={};jn(Ka,{LANGUAGES:()=>Ai,buildOpenApiDoc:()=>ki,generateSnippet:()=>Ha,loadOpenApiDoc:()=>Fa});var Va=Nt(()=>{qa();Wa()});R();var Ti={};jn(Ti,{Accordion:()=>qo,AccordionContent:()=>Ho,AccordionItem:()=>zo,AccordionTrigger:()=>os,Alert:()=>Mt,AlertAction:()=>qs,AlertDescription:()=>Qt,AlertDialog:()=>lo,AlertDialogAction:()=>Ze,AlertDialogCancel:()=>Ge,AlertDialogContent:()=>po,AlertDialogDescription:()=>fo,AlertDialogFooter:()=>uo,AlertDialogHeader:()=>co,AlertDialogMedia:()=>ho,AlertDialogTitle:()=>mo,AlertDialogTrigger:()=>Ve,AlertTitle:()=>Fs,ApiDoc:()=>Rs,ApiDocGroup:()=>Zt,AspectRatio:()=>_r,Attachment:()=>wr,AttachmentAction:()=>Cs,AttachmentActions:()=>Er,AttachmentContent:()=>Cr,AttachmentDescription:()=>Ar,AttachmentDropzone:()=>Tr,AttachmentGroup:()=>Nr,AttachmentMedia:()=>Sr,AttachmentTitle:()=>kr,AttachmentTrigger:()=>ks,Avatar:()=>Or,Badge:()=>St,BlockViewer:()=>Jt,Breadcrumb:()=>Ae,BreadcrumbEllipsis:()=>ns,BreadcrumbItem:()=>Ne,BreadcrumbLink:()=>Te,BreadcrumbList:()=>Ee,BreadcrumbPage:()=>Oe,BreadcrumbSeparator:()=>zt,Bubble:()=>$r,Button:()=>L,ButtonGroup:()=>Dr,ButtonGroupSeparator:()=>jr,ButtonGroupText:()=>Fr,Calendar:()=>ys,Card:()=>ee,CardBody:()=>oe,CardDescription:()=>ne,CardFooter:()=>zs,CardHeader:()=>se,CardTitle:()=>re,Carousel:()=>br,CarouselNext:()=>Ss,CarouselPrevious:()=>ws,CarouselSlide:()=>xr,Chart:()=>gr,Checkbox:()=>ve,ClipboardButton:()=>$t,CodeEditor:()=>ze,Collapsible:()=>Wo,CollapsibleContent:()=>Ko,CollapsibleTrigger:()=>rs,Combobox:()=>mr,Command:()=>fr,ContextMenu:()=>Uo,ContextMenuContent:()=>jo,ContextMenuItem:()=>Fo,ContextMenuTrigger:()=>Do,DataTable:()=>vs,DatePicker:()=>hr,Dialog:()=>ue,DialogClose:()=>He,DialogContent:()=>Dt,DialogDescription:()=>fe,DialogFooter:()=>he,DialogHeader:()=>de,DialogTitle:()=>me,DialogTrigger:()=>Hs,Direction:()=>Mr,Drawer:()=>go,DrawerClose:()=>Ye,DrawerContent:()=>bo,DrawerDescription:()=>wo,DrawerFooter:()=>vo,DrawerHeader:()=>xo,DrawerTitle:()=>yo,DrawerTrigger:()=>Je,DropdownMenu:()=>ye,DropdownMenuCheckboxItem:()=>es,DropdownMenuContent:()=>we,DropdownMenuGroup:()=>Io,DropdownMenuItem:()=>Se,DropdownMenuLabel:()=>Po,DropdownMenuRadioGroup:()=>_o,DropdownMenuRadioItem:()=>ss,DropdownMenuSeparator:()=>$o,DropdownMenuShortcut:()=>Mo,DropdownMenuSub:()=>Ce,DropdownMenuSubContent:()=>ke,DropdownMenuSubTrigger:()=>Ft,DropdownMenuTrigger:()=>jt,Empty:()=>Ws,EmptyContent:()=>Js,EmptyDescription:()=>Zs,EmptyHeader:()=>Ks,EmptyMedia:()=>Vs,EmptyTitle:()=>Gs,Field:()=>_e,FieldContent:()=>Hr,FieldDescription:()=>Me,FieldError:()=>Ue,FieldGroup:()=>Pe,FieldLabel:()=>$e,FieldLegend:()=>zr,FieldSeparator:()=>Kr,FieldSet:()=>qr,FieldTitle:()=>Wr,Form:()=>_s,HoverCard:()=>Lo,HoverCardContent:()=>Bo,HoverCardTrigger:()=>Ro,Icon:()=>Y,Input:()=>ie,InputOtp:()=>oo,Item:()=>Ur,Kbd:()=>Xt,Label:()=>Vr,Markdown:()=>Gt,MarkdownTree:()=>Bs,MarkdownTreeNode:()=>xn,Marker:()=>Xs,Menubar:()=>Yo,Message:()=>Lr,MessageScroller:()=>Rr,NativeSelect:()=>xe,NavigationMenu:()=>Zo,NavigationMenuItem:()=>Jo,Pagination:()=>Vo,PaginationItem:()=>Go,Popover:()=>To,PopoverContent:()=>Oo,PopoverTrigger:()=>ts,Progress:()=>Pr,Pwa:()=>Yr,PwaBody:()=>sn,PwaClose:()=>Ps,PwaContent:()=>Qr,PwaDescription:()=>en,PwaFooter:()=>rn,PwaHeader:()=>Xr,PwaSteps:()=>on,PwaTitle:()=>tn,PwaTrigger:()=>Is,QRCard:()=>Ns,Questionnaire:()=>Br,QuestionnaireNext:()=>Es,QuestionnairePrevious:()=>As,QuestionnaireStep:()=>Ir,RadioGroup:()=>to,RadioGroupItem:()=>eo,Resizable:()=>vr,ScrollArea:()=>yr,Select:()=>no,SelectContent:()=>io,SelectItem:()=>ao,SelectTrigger:()=>Ke,Separator:()=>Ys,Sheet:()=>So,SheetClose:()=>Xe,SheetContent:()=>Co,SheetDescription:()=>No,SheetFooter:()=>Ao,SheetHeader:()=>ko,SheetTitle:()=>Eo,SheetTrigger:()=>Qe,Shell:()=>hs,ShellContent:()=>fs,ShellHeader:()=>ur,ShellMain:()=>cr,ShellNav:()=>pr,ShellSidebar:()=>ms,ShellSidebarHeader:()=>lr,ShellUserMenu:()=>gs,Sidebar:()=>Wt,SidebarClose:()=>ls,SidebarContent:()=>Le,SidebarFooter:()=>Xo,SidebarGroup:()=>Re,SidebarGroupAction:()=>ps,SidebarGroupCollapsible:()=>cs,SidebarGroupContent:()=>or,SidebarGroupLabel:()=>Be,SidebarHeader:()=>Qo,SidebarInput:()=>er,SidebarInset:()=>tr,SidebarMenu:()=>Kt,SidebarMenuAction:()=>us,SidebarMenuBadge:()=>nr,SidebarMenuButton:()=>Ht,SidebarMenuItem:()=>Ie,SidebarMenuSkeleton:()=>ir,SidebarMenuSub:()=>rr,SidebarMenuSubButton:()=>ds,SidebarMenuSubItem:()=>ar,SidebarProvider:()=>mn,SidebarRail:()=>as,SidebarSeparator:()=>sr,SidebarTrigger:()=>is,Skeleton:()=>ge,Slider:()=>so,Spinner:()=>te,Switch:()=>We,TabContent:()=>ce,TabTrigger:()=>Ut,Table:()=>dr,Tabs:()=>ae,TabsContainer:()=>le,TabsList:()=>pe,TextEditor:()=>nn,Textarea:()=>be,ThemeButton:()=>Vt,Toast:()=>qt,Toggle:()=>Ts,ToggleGroup:()=>Gr,ToggleGroupItem:()=>Os,Tooltip:()=>Bt,Typography:()=>Qs,createNamedIcon:()=>js,findMarkdownTreeNode:()=>Ei,iconComponentName:()=>ha});R();N();R();Jn();N();var Y=class extends a{setup(){this.state=O({failed:!1}),vt(t=>{if(this.state.failed=!1,typeof Image>"u"||!t||t===Cn)return;let s=new Image;return s.onerror=()=>{this.state.failed=!0},s.src=this.buildUrl(t),()=>{s.onload=null,s.onerror=null}},()=>[this.name])}buildUrl(t){return pn(t,{baseUrl:ht(this.props,"base-url","baseUrl")})}get name(){return ht(this.props,"icon","name")}get url(){return this.buildUrl(this.state.failed?Cn:this.name)}get style(){let t=[`--b-icon-url:url("${this.url.replace(/"/g,"%22")}")`];return this.props.size&&t.push(`--b-icon-size:${this.props.size}`),dt(t.join(";"),this.props.style)}get classNames(){return m("b-icon",this.props.className)}};r(Y,"template","nodexui.Icon"),r(Y,"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 js(e){return class extends Y{get name(){return ht(this.props,"icon","name")||e}}}kn();var L=class extends a{setup(){this.rootRef=B("root"),this.props.getRef&&(J(()=>this.props.getRef(this.rootRef.el)),X(()=>this.props.getRef(null)))}get classNames(){return this.props.unstyled?m(this.props.className):m("btn","b-button",Ot[this.props.variant]||Ot.default,Yt[this.props.size],this.isIconOnly&&"b-button-icon",this.props.className)}get iconPosition(){return ht(this.props,"icon-position","iconPosition")==="end"?"end":"start"}get ariaLabel(){return ht(this.props,"aria-label","ariaLabel")}get ariaPressed(){return ht(this.props,"aria-pressed","ariaPressed")}get ariaInvalid(){let t=ht(this.props,"aria-invalid","ariaInvalid");return t===!0?"true":t}get isIconOnly(){return!!(this.props.icon&&!this.props.label&&!this.props.slots?.default)}onClick(t){if(this.props.href&&this.props.disabled){t.preventDefault();return}this.props.onClick?.(t)}};r(L,"template","nodexui.Button"),r(L,"components",{Icon:Y}),r(L,"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)});R();N();Yn();var $t=class extends a{setup(){this.state=O({copied:!1}),this.resetTimer=null,X(()=>window.clearTimeout(this.resetTimer))}get classNames(){return Ui(this.props)}get resetDelay(){return ht(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 ht(this.props,"aria-label","ariaLabel")||this.label}get attrs(){return{"data-copied":this.state.copied?"true":void 0}}async onClick(t){if(this.props.disabled)return;let s=this.props.getValue?this.props.getValue():this.props.value??"";try{await An(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:t})}catch(o){this.props.onCopyError?.({error:o,event:t})}}};r($t,"template","nodexui.ClipboardButton"),r($t,"components",{Button:L}),r($t,"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)});R();N();R();function ot(){let e=globalThis.bootstrap;if(!e)throw new Error("NodexUI: load dist/bootstrap.bundle.min.js before this script (globalThis.bootstrap is not set).");return e}N();var Di={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 a{setup(){this.rootRef=B("root"),this.bootstrapAlert=null,this.props.dismissible&&(J(()=>{this.bootstrapAlert=new(ot()).Alert(this.rootRef.el)}),X(()=>{this.bootstrapAlert?.dispose()}))}get classNames(){return m("alert","b-alert",Di[this.props.variant]||Di.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:L}),r(Mt,"props",{variant:n(String),dismissible:n(Boolean),...p});var Fs=class extends a{};r(Fs,"template","nodexui.AlertTitle"),r(Fs,"props",p);var Qt=class extends a{};r(Qt,"template","nodexui.AlertDescription"),r(Qt,"props",p);var qs=class extends a{};r(qs,"template","nodexui.AlertAction"),r(qs,"props",p);R();N();var Qn={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 St=class extends a{get classNames(){return m("badge",Qn[this.props.variant]||Qn.secondary,this.props.pill&&"rounded-pill",this.props.className)}};r(St,"template","nodexui.Badge"),r(St,"props",{variant:n(String),pill:n(Boolean),label:n(String),...p});R();N();var Xt=class extends a{get classNames(){return m("b-kbd",this.props.className)}};r(Xt,"template","nodexui.Kbd"),r(Xt,"props",{...p});R();N();var te=class extends a{get classNames(){return m("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:n(String),label:n(String),className:n(String),style:n([String,Object])});var Rt={line:["//"],block:["/*","*/"],quotes:`"'`},En={line:["#"],quotes:`"'`},ji="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",ep="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",Fi="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",cn={plaintext:{label:"Plain text",indent:" "},javascript:{label:"JavaScript",...Rt,quotes:"\"'`",multiline:"`",indent:" ",keywords:Fi,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",...Rt,quotes:"\"'`",multiline:"`",indent:" ",keywords:`${Fi} 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",...Rt,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",...Rt,indent:" ",keywords:ji,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++",...Rt,indent:" ",keywords:`${ji} 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",...Rt,indent:" ",keywords:ep,builtins:"String System Object Integer Long Double Boolean List Map Set ArrayList HashMap Exception Override Math"},csharp:{label:"C#",...Rt,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",...Rt,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",...Rt,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",...Rt,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",...En,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",...En,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,...En,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,...En,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"}};cn.xml={...cn.html,label:"XML"};var sp={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"},op={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:""},ti=/[A-Za-z_$]/,Ki=/[A-Za-z0-9_$]/,Vi=/[A-Za-z0-9_:-]/,rp=/[0-9A-Za-z_.]/,qi=/[0-9]/,np=/[A-Za-z0-9_-]/,zi=/^#[0-9a-fA-F]{3,8}\b/,ip=/^&#?\w+;/,ap=/[A-Za-z/!?]/,Xn=new Map;function Hi(e,t){return new Set((e?t?e.toLowerCase():e:"").split(" ").filter(Boolean))}function dn(e){let t=String(e??"").trim().toLowerCase(),s=sp[t]??t,o=s in cn?s:"plaintext";if(!Xn.has(o)){let i=cn[o];Xn.set(o,{id:o,...i,keywordSet:Hi(i.keywords,i.ci),builtinSet:Hi(i.builtins,i.ci)})}return Xn.get(o)}function Gi(e){let t=String(e??"").split(/[?#]/)[0].split("/").pop();return t.includes(".")?t.split(".").pop().toLowerCase():""}var Ld=Object.keys(cn);function un(e,t,s){let o=t;for(;o<e.length&&s.test(e[o]);)o+=1;return o}function lp(e,t,s){if(s.block&&e.startsWith(s.block[0],t)){let i=e.indexOf(s.block[1],t+s.block[0].length);return i===-1?e.length:i+s.block[1].length}if(!s.line?.some(i=>e.startsWith(i,t)))return-1;let o=e.indexOf(`
24
- `,t);return o===-1?e.length:o}function Zi(e,t,s){let o=e[t],i=s.multiline?.includes(o),l=t+1;for(;l<e.length&&e[l]!==o&&(i||e[l]!==`
25
- `);)l+=e[l]==="\\"?2:1;return Math.min(e.length,e[l]===o?l+1:l)}function pp(e,t){let s=t-1;for(;s>=0&&/\s/.test(e[s]);)s-=1;return e[s]}function Wi(e,t,s,o){return!o.keys||!/^\s*:(?!:|\/\/)/.test(e.slice(s,s+8))?!1:o.keys!=="prop"||"{;".includes(pp(e,t))}function cp(e,t,s,o){let i=o.ci?e.slice(t,s).toLowerCase():e.slice(t,s);if(o.keywordSet.has(i))return"keyword";let l=e[t-1]==="."||e[t-1]===":";return o.builtinSet.has(i)&&!l?"builtin":o.plainWords?"plain":/^\s*\(/.test(e.slice(s,s+8))?"function":/^[A-Z][A-Za-z0-9_$]*[a-z]/.test(i)?"type":"plain"}function up(e,t,s,o){let i=e[t],l=/^(\/|\?)?>/.exec(e.slice(t,t+2));return l?(o.inTag=!1,["tag",t+l[0].length]):s.quotes.includes(i)?["string",Zi(e,t,s)]:ti.test(i)?["attr",un(e,t+1,Vi)]:["plain",t+1]}function dp(e,t,s){if(e[t]==="<"&&ap.test(e[t+1]??""))return s.inTag=!0,["tag",un(e,t+2,Vi)];let o=e[t]==="&"?ip.exec(e.slice(t,t+12)):null;return o?["number",t+o[0].length]:["plain",t+1]}function hp(e,t,s){let o=e[t];return!(o==="$"&&s.variables||o==="@"&&s.annotations)||!ti.test(e[t+1]??"")?null:[o==="$"?"variable":"meta",un(e,t+2,Ki)]}function mp(e,t,s,o,i){let l=e[t];if(i.inTag)return up(e,t,s,i);let u=lp(e,t,s);if(u!==-1)return["comment",u];if(s.tags)return dp(e,t,i);if(s.quotes?.includes(l)){let H=Zi(e,t,s);return[Wi(e,t,H,s)?"attr":"string",H]}if(s.hex&&l==="#"&&zi.test(e.slice(t,t+10)))return["number",t+zi.exec(e.slice(t,t+10))[0].length];if(qi.test(l)||l==="."&&qi.test(e[t+1]??""))return["number",un(e,t+1,rp)];let h=hp(e,t,s);if(h)return h;let S=s.dashed&&l==="-"&&/[A-Za-z-]/.test(e[t+1]??"");if(!ti.test(l)&&!S)return["plain",t+1];let M=un(e,t+1,s.dashed?np:Ki);if(Wi(e,t,M,s))return["attr",M];let U=cp(e,t,M,s);return[U==="plain"&&o.has(e.slice(t,M))&&e[t-1]!=="."?"builtin":U,M]}function Nn(e,t,s=[]){let o=dn(t),i=new Set(s),l={inTag:!1},u=[],h=0;for(;h<e.length;){let[S,M]=mp(e,h,o,i,l),U=e.slice(h,M),F=u[u.length-1];S==="plain"&&F?.kind==="plain"?F.text+=U:u.push({kind:S,text:U,className:op[S]}),h=M}return u}function Ji(e,t){return e.startsWith(" ")?1:/^ */.exec(e.slice(0,t.length))[0].length}var fp=new Set(["javascript","typescript","go","c","cpp","java","csharp","kotlin","swift","rust","php","css","lua","html","xml"]),gp=new Set("area base br col embed hr img input link meta source track wbr".split(" ")),bp=/^[}\])]+/,xp=/\b(function|if|for|while|repeat)\b/g,vp=/\b(end|until)\b/g,yp=/^(else|elseif)\b/,wp=/^(end|until)\b/;function qe(e,t){return(e.match(t)??[]).length}function Sp(e,t){let s=new Uint8Array(e.length),o="",i=0;for(let{kind:l,text:u}of Nn(e,t)){let h=l==="comment"||l==="string";o+=h?u.replace(/[^\n]/g," "):u,h&&s.fill(1,i,i+u.length),i+=u.length}return{masked:o,inside:s}}function Cp(e,t){let s=h=>!(t&&gp.has(h.toLowerCase())),o=[...e.matchAll(/<([A-Za-z][\w:.-]*)/g)].filter(h=>s(h[1])).length,i=[...e.matchAll(/<([A-Za-z][\w:.-]*)[^<>]*\/>/g)].filter(h=>s(h[1])).length,l=e.includes("<")?0:qe(e,/\/>/g);return{leading:qe(/^(?:<\/[^>]*>\s*)+/.exec(e)?.[0]??"",/<\//g),net:o-i-l-qe(e,/<\//g)}}function kp(e,t){let s=e.trim();if(t.tags)return Cp(s,t.id==="html");let o=t.id==="lua",i=bp.exec(s)?.[0].length??0,l=qe(s,/[{([]/g)-qe(s,/[})\]]/g);if(!o)return{leading:i,net:l};let u=qe(s,xp)+(/^do\b/.test(s)?1:0)-qe(s,vp);return{leading:i||(yp.test(s)||wp.test(s)?1:0),net:l+u}}function Ap(e,t){return(e.id==="c"||e.id==="cpp")&&t.startsWith("#")}function Ep(e,t){let{masked:s,inside:o}=Sp(e,t.id),i=[],l=0,u=0;for(let h of e.split(`
26
- `)){let S=s.slice(u,u+h.length),M=u>0&&o[u-1]===1;u+=h.length+1;let U=h.trim(),{leading:F,net:H}=kp(S,t);M?i.push(h.trimEnd()):U?Ap(t,U)?i.push(U):i.push(t.indent.repeat(Math.max(0,l-F))+U):i.push(""),l=Math.max(0,l+H)}return i}function Np(e){return e.split(`
27
- `).map(t=>t.trimEnd())}function Tp(e){return`${e.filter((s,o)=>s!==""||o>0&&e[o-1]!=="").join(`
28
- `).replace(/^\n+|\n+$/g,"")}
29
- `}function Yi(e,t){let s=dn(t),o=String(e??"").replace(/\r\n?/g,`
30
- `);return o.trim()?s.id==="json"?`${JSON.stringify(JSON.parse(o),null,2)}
31
- `:Tp(fp.has(s.id)?Ep(o,s):Np(o)):""}var ze=class extends a{setup(){this.state=O({text:null,name:"",loading:!1,error:"",editing:!this.props.readonly}),this.fileInput=B("fileInput"),this.input=B("input"),this.controller=null,J(()=>this.syncInput()),rt(()=>this.syncInput()),Tt(()=>this.loadUrl(this.props.src)),lt(t=>{if(t.readonly!==this.props.readonly&&(this.state.editing=!t.readonly),t.src!==this.props.src)return this.loadUrl(t.src)}),X(()=>this.controller?.abort()),this.tabReleased=!1}get classNames(){return m("b-code-editor",this.props.className)}get code(){return this.state.text??this.props.value??""}get codeLang(){return this.props.codeLang??Gi(this.state.name||this.props.src)}get language(){return dn(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}
32
- `,this.codeLang,this.globals)}get lineCount(){return this.code.split(`
33
- `).length}get lineLabel(){return`${this.lineCount} ${this.lineCount===1?"line":"lines"}`}get lineNumbers(){return Array.from({length:this.lineCount},(t,s)=>s+1).join(`
34
- `)}commit(t){(this.state.text!==null||!this.props.onChange)&&(this.state.text=t),this.props.onChange?.(t)}async loadUrl(t){if(this.controller?.abort(),!!t){this.controller=new globalThis.AbortController,this.state.loading=!0,this.state.error="";try{let s=await fetch(t,{signal:this.controller.signal});if(!s.ok)throw new Error(`Could not load ${t} (HTTP ${s.status})`);this.setFile(await s.text(),t)}catch(s){s.name!=="AbortError"&&this.fail(s)}this.state.loading=!1}}syncInput(){let t=this.input.el;if(!t||t.value===this.code)return;let{selectionStart:s,selectionEnd:o}=t;t.value=this.code,t.setSelectionRange(Math.min(s,this.code.length),Math.min(o,this.code.length))}toggleEditing(){this.state.editing=!this.state.editing}format(){try{this.commit(Yi(this.code,this.codeLang)),this.state.error=""}catch(t){this.fail(t)}}openPicker(){this.fileInput.el.click()}async onFileChange(t){let s=t.target.files[0];if(t.target.value="",!!s)try{this.setFile(await s.text(),s.name)}catch(o){this.fail(o)}}setFile(t,s){Object.assign(this.state,{text:t,name:s,error:""}),this.props.onLoad?.({code:t,name:s})}fail(t){this.state.error=t.message,this.props.onError?.(t)}onInput(t){this.commit(t.target.value),this.revealCaret(t.target)}revealCaret(t){let s=t.closest(".b-code-editor-box");if(!s||!t.isConnected)return;let o=getComputedStyle(t),i=parseFloat(o.paddingTop)||0,l=parseFloat(o.lineHeight)||21,u=t.value.slice(0,t.selectionEnd),h=u.split(`
35
- `).length-1,S=i+h*l;S-i<s.scrollTop?s.scrollTop=Math.max(0,S-i):S+l+i>s.scrollTop+s.clientHeight&&(s.scrollTop=S+l+i-s.clientHeight);let M=u.slice(u.lastIndexOf(`
36
- `)+1).replaceAll(" "," ".repeat(4)).length,U=this.measure??(this.measure=document.createElement("canvas").getContext("2d"));if(!U)return;U.font=`${o.fontSize} ${o.fontFamily}`;let F=t.offsetLeft+parseFloat(o.paddingLeft)+M*U.measureText("0").width,H=s.querySelector(".b-code-editor-gutter")?.offsetWidth??0;F<s.scrollLeft+H?s.scrollLeft=Math.max(0,F-H-i):F+i>s.scrollLeft+s.clientWidth&&(s.scrollLeft=F+i-s.clientWidth)}onKeydown(t){let s=t.target;if(requestAnimationFrame(()=>this.revealCaret(s)),t.key==="F"&&t.shiftKey&&t.altKey&&this.showFormat){t.preventDefault(),this.format();return}if(t.key==="Escape"){this.tabReleased=!0;return}let o=this.tabReleased;if(this.tabReleased=!1,t.key==="Tab"&&!o)t.preventDefault(),t.shiftKey?this.outdentLine(s):s.setRangeText(this.language.indent,s.selectionStart,s.selectionEnd,"end");else if(t.key==="Enter"&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey&&!t.altKey){t.preventDefault();let i=s.value.lastIndexOf(`
37
- `,s.selectionStart-1)+1,l=/^[ \t]*/.exec(s.value.slice(i,s.selectionStart))[0];s.setRangeText(`
38
- ${l}`,s.selectionStart,s.selectionEnd,"end")}else return;this.commit(s.value)}outdentLine(t){let s=t.value.lastIndexOf(`
39
- `,t.selectionStart-1)+1,o=Ji(t.value.slice(s),this.language.indent);if(!o)return;let{selectionStart:i,selectionEnd:l}=t;t.setRangeText("",s,s+o,"preserve"),t.setSelectionRange(Math.max(s,i-o),Math.max(s,l-o))}};r(ze,"template","nodexui.CodeEditor"),r(ze,"components",{Alert:Mt,AlertDescription:Qt,Badge:St,Button:L,ClipboardButton:$t,Kbd:Xt,Spinner:te}),r(ze,"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});R();N();var ee=class extends a{get tag(){return this.props.tag||"div"}};r(ee,"template","nodexui.Card"),r(ee,"props",{...p,tag:n(String)});var se=class extends a{};r(se,"template","nodexui.CardHeader"),r(se,"props",p);var oe=class extends a{};r(oe,"template","nodexui.CardBody"),r(oe,"props",p);var zs=class extends a{};r(zs,"template","nodexui.CardFooter"),r(zs,"props",p);var re=class extends a{};r(re,"template","nodexui.CardTitle"),r(re,"props",p);var ne=class extends a{};r(ne,"template","nodexui.CardDescription"),r(ne,"props",p);N();R();N();R();N();var Bt=class extends a{setup(){this.state=O({open:pt(this.props.state)}),this.triggerRef=B("trigger"),this.bufferRef=B("buffer"),this.bootstrapTooltip=null,this.lastContentHtml=null,this.onShown=()=>{this.state.open=!0},this.onHidden=()=>{this.state.open=!1},J(()=>{this.lastContentHtml=this.currentContentHtml();let t=this.triggerElement();this.bootstrapTooltip=new(ot()).Tooltip(t,{title:this.lastContentHtml,html:!0,trigger:"hover focus"}),t.addEventListener("shown.bs.tooltip",this.onShown),t.addEventListener("hidden.bs.tooltip",this.onHidden),pt(this.props.state)&&this.bootstrapTooltip.show()}),rt(()=>{let t=this.currentContentHtml();t!==this.lastContentHtml&&(this.lastContentHtml=t,this.bootstrapTooltip?.setContent({".tooltip-inner":t}))}),X(()=>{let t=this.triggerElement();t?.removeEventListener("shown.bs.tooltip",this.onShown),t?.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(Bt,"template","nodexui.Tooltip"),r(Bt,"props",{content:n(String),state:n(String),...p});var Op=js("circle-question-mark"),Lp=0,Ct={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)},mt=class extends a{setup(){this.supportId=`b-input-support-${Lp++}`,this.box=B("box"),this.slotRefs={start:B("start"),end:B("end"),footer:B("footer")},J(()=>this.measureSlots()),rt(()=>this.measureSlots())}get field(){return this.env.fieldProps?.()??{}}get label(){return this.props.label??this.field.label}get labelStyle(){let t=this.props.labelBackground??this.field.labelBackground;return t?`--b-label-bg:${t}`: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 t=this.box.el;if(!t)return;let{start:s,end:o,footer:i}=this.slotRefs;t.style.setProperty("--b-slot-start",`${s.el?.offsetWidth??0}px`),t.style.setProperty("--b-slot-end",`${o.el?.offsetWidth??0}px`),t.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 m("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(mt,"components",{Icon:Y,IconCircleQuestionMark:Op,Tooltip:Bt});function Qi({tag:e="input",type:t}={}){return e==="select"?"form-select":t==="checkbox"||t==="radio"?"form-check-input":"form-control"}var ie=class extends mt{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return m("b-input",Qi({tag:"input",type:this.props.type}),this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(t){this.props.onInput?.(t.target.value,t)}onChange(t){this.props.onChange?.(t.target.value,t)}};r(ie,"template","nodexui.Input"),r(ie,"props",{...Ct,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)});R();N();var ei={default:"b-tabs-list-default",line:"b-tabs-list-line"};function Xi(e,t,s,o="horizontal"){let i=o==="vertical",h=e===(i?"ArrowDown":"ArrowRight")?1:e===(i?"ArrowUp":"ArrowLeft")?-1:0;return!h||s===0?-1:(t+h+s)%s}var Rp=0;function ta(e){return String(e).replace(/[^a-zA-Z0-9_-]/g,"_")}var ae=class extends a{setup(){this.tabsState=O({active:this.props.value??this.props.defaultValue??""}),this.instanceId=`t${++Rp}`,z({tabs:this.tabsState,selectTab:t=>this.select(t),tabsId:this.instanceId,orientation:this.orientation}),lt(t=>{t.value!==void 0&&(this.tabsState.active=t.value)})}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return m("b-tabs",this.props.className)}select(t){this.props.value===void 0&&(this.tabsState.active=t),this.props.onChange?.(t)}};r(ae,"template","nodexui.Tabs"),r(ae,"props",{value:n(String),defaultValue:n(String),orientation:n(String),onChange:n(Function),...p});var le=class extends a{};r(le,"template","nodexui.TabsContainer"),r(le,"props",{...p});var pe=class extends a{setup(){this.listRef=B("list")}get classNames(){return m("nav","b-tabs-list",ei[this.props.variant]||ei.default,this.props.className)}onKeyDown(t){let s=[...this.listRef.el.querySelectorAll("[role='tab']")],o=s.indexOf(t.target),i=Xi(t.key,o,s.length,this.env.orientation);i!==-1&&(t.preventDefault(),s[i].focus(),s[i].click())}};r(pe,"template","nodexui.TabsList"),r(pe,"props",{variant:n(String),...p});var Ut=class extends a{setup(){this.rootEl=null,this.tabInstance=null,this.onShown=()=>this.env.selectTab(this.props.value)}onRootRef(t){t?(this.rootEl=t,this.tabInstance=ot().Tab.getOrCreateInstance(t),t.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}-${ta(this.props.value)}`}get classNames(){return m("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:L}),r(Ut,"props",{value:{type:String},disabled:n(Boolean),...p});var ce=class extends a{setup(){this.initialActive=this.isActive}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`b-tabs-panel-${this.env.tabsId}-${ta(this.props.value)}`}};r(ce,"template","nodexui.TabContent"),r(ce,"props",{value:{type:String},...p});R();N();R();N();function ft(e,t){lt(s=>{Fe(s)&&(e.open=it(s),e.open?t?.instance?.show():t?.instance?.hide())})}function gt(e,t,s){Fe(e)||(t.open=s),e.onOpenChange?.(s)}function Tn(e,t){let s=null;J(()=>{s=new(ot()).Collapse(e.el,{toggle:!1})}),rt(()=>{if(!s)return;let o=e.el.classList.contains("show");t()&&!o?s.show():!t()&&o&&s.hide()}),X(()=>s?.dispose())}var ue=class extends a{setup(){this.dialogState=O({open:it(this.props)}),this.control={instance:null},z({dialog:this.dialogState,dialogControl:this.control,setDialogOpen:t=>this.setOpen(t)}),ft(this.dialogState,this.control)}setOpen(t){gt(this.props,this.dialogState,t)}};r(ue,"template","nodexui.Dialog"),r(ue,"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 a{onClick(){this.env.dialogControl.instance?.show()}};r(Hs,"template","nodexui.DialogTrigger"),r(Hs,"props",p);var Dt=class extends a{setup(){this.rootRef=B("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},J(()=>{this.env.dialogControl.instance=ot().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()}),X(()=>{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(Dt,"template","nodexui.DialogContent"),r(Dt,"components",{Button:L}),r(Dt,"props",{...p,showCloseButton:n(Boolean),"show-close-button":n(Boolean)});var de=class extends a{};r(de,"template","nodexui.DialogHeader"),r(de,"props",p);var he=class extends a{};r(he,"template","nodexui.DialogFooter"),r(he,"props",p);var me=class extends a{};r(me,"template","nodexui.DialogTitle"),r(me,"props",p);var fe=class extends a{};r(fe,"template","nodexui.DialogDescription"),r(fe,"props",p);var He=class extends a{};r(He,"template","nodexui.DialogClose"),r(He,"components",{Button:L}),r(He,"props",p);R();N();var ea={default:"b-empty-default",outline:"b-empty-outline",background:"b-empty-background"},Bp={default:"b-empty-media-default",icon:"b-empty-media-icon"},Ws=class extends a{get classNames(){return m("b-empty",ea[this.props.variant]||ea.default,this.props.className)}};r(Ws,"template","nodexui.Empty"),r(Ws,"props",{variant:n(String),...p});var Ks=class extends a{};r(Ks,"template","nodexui.EmptyHeader"),r(Ks,"props",p);var Vs=class extends a{get variant(){return this.props.variant==="icon"?"icon":"default"}get classNames(){return m("b-empty-media",Bp[this.variant],this.props.className)}};r(Vs,"template","nodexui.EmptyMedia"),r(Vs,"props",{variant:n(String),...p});var Gs=class extends a{};r(Gs,"template","nodexui.EmptyTitle"),r(Gs,"props",p);var Zs=class extends a{};r(Zs,"template","nodexui.EmptyDescription"),r(Zs,"props",p);var Js=class extends a{};r(Js,"template","nodexui.EmptyContent"),r(Js,"props",p);R();N();var Ys=class extends a{get vertical(){return this.props.orientation==="vertical"}get classNames(){return m("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])});R();N();var ge=class extends a{get classNames(){return m("b-skeleton",this.props.shape==="circle"?"b-skeleton-circle":"b-skeleton-block",this.props.className)}};r(ge,"template","nodexui.Skeleton"),r(ge,"props",{shape:n(String),className:n(String),style:n([String,Object])});R();N();var Ip={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"},Pp={h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"ul"},Qs=class extends a{get tag(){return this.props.tag||Pp[this.props.variant]||"p"}get classNames(){return m("b-typography",Ip[this.props.variant],this.props.className)}};r(Qs,"template","nodexui.Typography"),r(Qs,"props",{variant:n(String),tag:n(String),...p});R();N();var Xs=class extends a{get classNames(){return m("b-marker",this.props.className)}get variant(){return this.props.variant}};r(Xs,"template","nodexui.Marker"),r(Xs,"props",{variant:n(String),...p});N();var be=class extends mt{get outlinedClassNames(){return m(super.outlinedClassNames,"is-anchored")}get classNames(){return m("form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.resize==="none"&&"b-textarea-no-resize",this.props.className)}onInput(t){this.props.onInput?.(t.target.value,t)}onChange(t){this.props.onChange?.(t.target.value,t)}};r(be,"template","nodexui.Textarea"),r(be,"props",{...Ct,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)});N();var xe=class extends mt{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return m("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(t){this.props.onChange?.(t.target.value,t)}};r(xe,"template","nodexui.NativeSelect"),r(xe,"props",{...Ct,value:n(String),size:n(String),...p,"aria-label":n(String),ariaLabel:n(String),id:n(String),onChange:n(Function)});R();N();var ve=class extends a{onChange(t){this.props.onChange?.(t.target.checked,t)}};r(ve,"template","nodexui.Checkbox"),r(ve,"props",{checked:n(Boolean),disabled:n(Boolean),...p,id:n(String),onChange:n(Function)});R();N();var to=class extends a{setup(){z({radioGroupValue:()=>this.props.value,radioGroupDisabled:()=>this.props.disabled,radioGroupName:()=>this.props.name||"b-radio-group",selectRadio:t=>this.props.onChange?.(t)})}get classNames(){return m("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 a{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});R();N();var _p=js("circle-question-mark"),We=class extends a{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(t){this.props.onChange?.(t.target.checked,t)}};r(We,"template","nodexui.Switch"),r(We,"components",{IconCircleQuestionMark:_p,Tooltip:Bt}),r(We,"props",{checked:n(Boolean),disabled:n(Boolean),supportingText:n(String),useTip:n(Number),...p,onChange:n(Function)});R();N();var so=class extends a{get classNames(){return m("b-slider",this.props.className)}onInput(t){t.target.style.setProperty("--b-slider-value",`${t.target.value}%`),this.props.onChange?.(t.target.value,t)}};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)});R();N();var oo=class extends a{setup(){this.length=this.props.length||6;let t=(this.props.value||"").split("");this.state=O({digits:Array.from({length:this.length},(s,o)=>t[o]||"")}),this.rootRef=B("root")}get classNames(){return m("b-input-otp",this.props.className)}get boxes(){return this.state.digits.map((t,s)=>({index:s,value:t}))}emit(){this.props.onChange?.(this.state.digits.join(""))}onInput(t,s){let o=s.target.value.slice(-1);this.state.digits[t]=o,o&&this.rootRef.el&&[...this.rootRef.el.querySelectorAll("input")][t+1]?.focus(),this.emit()}onPaste(t){let s=t.clipboardData.getData("text").trim();if(s){t.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)});R();R();function ro(e,{defaultOpen:t=!1,onOpenChange:s}={}){let o=O({open:t}),i=S=>{o.open!==S&&(o.open=S,s?.(S))},l=()=>i(!o.open),u=S=>{e.el&&!e.el.contains(S.target)&&i(!1)},h=S=>{S.key==="Escape"&&i(!1)};return vt(S=>{if(S)return document.addEventListener("click",u),document.addEventListener("keydown",h),()=>{document.removeEventListener("click",u),document.removeEventListener("keydown",h)}},()=>[o.open]),X(()=>{document.removeEventListener("click",u),document.removeEventListener("keydown",h)}),{state:o,setOpen:i,toggle:l}}N();var no=class extends mt{setup(){super.setup(),this.rootRef=B("root");let{state:t,setOpen:s,toggle:o}=ro(this.rootRef,{defaultOpen:pt(this.props.state)});this.disclosure=t,z({select:this.disclosure,selectValue:()=>this.props.value,selectToggle:o,selectClose:()=>s(!1),selectChoose:i=>{this.props.onChange?.(i),s(!1)}})}get outlinedClassNames(){return m(super.outlinedClassNames,"is-anchored",this.props.value&&"is-floated")}get rootStyle(){return dt(this.labelStyle,this.props.style)}get classNames(){return m("b-select",this.isOutlined&&this.outlinedClassNames,this.props.className)}};r(no,"template","nodexui.Select"),r(no,"props",{...Ct,value:n(String),state:n(String),onChange:n(Function),...p});var Ke=class extends a{get attrs(){return{"aria-haspopup":"listbox","aria-expanded":this.env.select.open?"true":"false"}}onClick(){this.env.selectToggle()}};r(Ke,"template","nodexui.SelectTrigger"),r(Ke,"components",{Button:L}),r(Ke,"props",p);var io=class extends a{get open(){return this.env.select.open}};r(io,"template","nodexui.SelectContent"),r(io,"props",p);var ao=class extends a{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});R();function hn(e){return[...e.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")].filter(t=>!t.disabled&&!t.hidden)}function sa(e,t){if(e.key!=="Tab")return;let s=hn(t);if(!s.length){e.preventDefault();return}let o=s[0],i=s[s.length-1];e.shiftKey&&document.activeElement===o?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),o.focus())}N();var lo=class extends a{setup(){this.alertDialogState=O({open:it(this.props)}),z({alertDialog:this.alertDialogState,setAlertDialogOpen:t=>this.setOpen(t)}),ft(this.alertDialogState)}setOpen(t){gt(this.props,this.alertDialogState,t)}};r(lo,"template","nodexui.AlertDialog"),r(lo,"props",{open:n(Boolean),state:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),slots:n(Object)});var Ve=class extends a{get attrs(){return{"data-slot":"alert-dialog-trigger"}}onClick(){this.env.setAlertDialogOpen(!0)}};r(Ve,"template","nodexui.AlertDialogTrigger"),r(Ve,"components",{Button:L}),r(Ve,"props",p);var po=class extends a{get size(){return this.props.size==="sm"?"sm":"default"}setup(){this.rootRef=B("root"),vt(t=>{if(!t)return;let s=document.activeElement;return hn(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.alertDialog.open])}get open(){return this.env.alertDialog.open}onKeyDown(t){if(t.key==="Escape"){this.env.setAlertDialogOpen(!1);return}sa(t,this.rootRef.el)}};r(po,"template","nodexui.AlertDialogContent"),r(po,"props",{...p,size:n(String)});var co=class extends a{};r(co,"template","nodexui.AlertDialogHeader"),r(co,"props",p);var uo=class extends a{};r(uo,"template","nodexui.AlertDialogFooter"),r(uo,"props",p);var ho=class extends a{};r(ho,"template","nodexui.AlertDialogMedia"),r(ho,"props",p);var mo=class extends a{};r(mo,"template","nodexui.AlertDialogTitle"),r(mo,"props",p);var fo=class extends a{};r(fo,"template","nodexui.AlertDialogDescription"),r(fo,"props",p);var Ge=class extends a{get attrs(){return{"data-slot":"alert-dialog-cancel"}}onClick(){this.env.setAlertDialogOpen(!1)}};r(Ge,"template","nodexui.AlertDialogCancel"),r(Ge,"components",{Button:L}),r(Ge,"props",p);var Ze=class extends a{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:L}),r(Ze,"props",{...p,onClick:n(Function)});R();N();var go=class extends a{setup(){this.drawerState=O({open:it(this.props)}),this.control={instance:null},z({drawer:this.drawerState,drawerControl:this.control,setDrawerOpen:t=>this.setOpen(t)}),ft(this.drawerState,this.control)}setOpen(t){gt(this.props,this.drawerState,t)}};r(go,"template","nodexui.Drawer"),r(go,"props",{open:n(Boolean),state:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),slots:n(Object)});var Je=class extends a{onClick(){this.env.drawerControl.instance?.show()}};r(Je,"template","nodexui.DrawerTrigger"),r(Je,"components",{Button:L}),r(Je,"props",p);var bo=class extends a{setup(){this.rootRef=B("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},J(()=>{this.env.drawerControl.instance=ot().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()}),X(()=>{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(bo,"template","nodexui.DrawerContent"),r(bo,"props",p);var xo=class extends a{};r(xo,"template","nodexui.DrawerHeader"),r(xo,"props",p);var vo=class extends a{};r(vo,"template","nodexui.DrawerFooter"),r(vo,"props",p);var yo=class extends a{};r(yo,"template","nodexui.DrawerTitle"),r(yo,"props",p);var wo=class extends a{};r(wo,"template","nodexui.DrawerDescription"),r(wo,"props",p);var Ye=class extends a{get attrs(){return{"data-bs-dismiss":"offcanvas"}}};r(Ye,"template","nodexui.DrawerClose"),r(Ye,"components",{Button:L}),r(Ye,"props",p);R();N();var So=class extends a{setup(){this.sheetState=O({open:it(this.props),side:this.props.side}),this.control={instance:null},z({sheet:this.sheetState,sheetControl:this.control,setSheetOpen:t=>this.setOpen(t)}),ft(this.sheetState,this.control),lt(t=>{this.sheetState.side=t.side})}setOpen(t){gt(this.props,this.sheetState,t)}};r(So,"template","nodexui.Sheet"),r(So,"props",{open:n(Boolean),state:n(String),side:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),slots:n(Object)});var Qe=class extends a{onClick(){this.env.sheetControl.instance?.show()}};r(Qe,"template","nodexui.SheetTrigger"),r(Qe,"components",{Button:L}),r(Qe,"props",p);var Co=class extends a{setup(){this.rootRef=B("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},J(()=>{this.env.sheetControl.instance=ot().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()}),X(()=>{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 a{};r(ko,"template","nodexui.SheetHeader"),r(ko,"props",p);var Ao=class extends a{};r(Ao,"template","nodexui.SheetFooter"),r(Ao,"props",p);var Eo=class extends a{};r(Eo,"template","nodexui.SheetTitle"),r(Eo,"props",p);var No=class extends a{};r(No,"template","nodexui.SheetDescription"),r(No,"props",p);var Xe=class extends a{};r(Xe,"template","nodexui.SheetClose"),r(Xe,"components",{Button:L}),r(Xe,"props",p);R();N();var To=class extends a{setup(){let t=O({open:pt(this.props.state)});this.control={instance:null,bufferEl:null,lastContentHtml:null};let s=o=>{t.open!==o&&(t.open=o,this.props.onOpenChange?.(o))};z({popover:t,popoverControl:this.control,popoverSetOpen:s,popoverToggle:()=>this.control.instance?.toggle(),popoverClose:()=>this.control.instance?.hide()})}};r(To,"template","nodexui.Popover"),r(To,"props",{state:n(String),onOpenChange:n(Function),...p});var ts=class extends a{setup(){this.rootRef={el:null},this.getRef=t=>{this.rootRef.el=t},this.onShown=()=>this.env.popoverSetOpen(!0),this.onHidden=()=>this.env.popoverSetOpen(!1),J(()=>{let t=this.env.popoverControl,s=t.bufferEl?.innerHTML??"";t.lastContentHtml=s,t.instance=new(ot()).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)}),X(()=>{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(ts,"template","nodexui.PopoverTrigger"),r(ts,"components",{Button:L}),r(ts,"props",p);var Oo=class extends a{get style(){return dt("display:none",this.props.style)}setup(){this.bufferRef=B("buffer"),J(()=>{this.env.popoverControl.bufferEl=this.bufferRef.el}),rt(()=>{let t=this.env.popoverControl;t.bufferEl=this.bufferRef.el;let s=this.currentContentHtml();t.instance&&s!==t.lastContentHtml&&(t.lastContentHtml=s,t.instance.setContent({".popover-body":s}))})}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}};r(Oo,"template","nodexui.PopoverContent"),r(Oo,"props",{...p,content:n(String)});R();N();var Lo=class extends a{setup(){this.state=O({open:!1}),z({hoverCard:this.state})}open(){this.state.open=!0}close(){this.state.open=!1}onKeyDown(t){t.key==="Escape"&&this.close()}};r(Lo,"template","nodexui.HoverCard"),r(Lo,"props",{...p});var Ro=class extends a{};r(Ro,"template","nodexui.HoverCardTrigger"),r(Ro,"props",p);var Bo=class extends a{get open(){return this.env.hoverCard.open}};r(Bo,"template","nodexui.HoverCardContent"),r(Bo,"props",p);R();N();var si={...p,disabled:n(Boolean),inset:n(Boolean),onClick:n(Function),onSelect:n(Function),variant:n(String)},ye=class extends a{setup(){this.rootRef=B("root");let t=O({open:pt(this.props.state)});this.control={instance:null};let s=l=>{t.open!==l&&(t.open=l,this.props.onOpenChange?.(l))};z({dropdownMenu:t,dropdownControl:this.control,dropdownSetOpen:s,dropdownToggle:()=>this.control.instance?.toggle(),dropdownClose:()=>this.control.instance?.hide()});let o=l=>{this.rootRef.el&&!this.rootRef.el.contains(l.target)&&this.control.instance?.hide()},i=l=>{l.key==="Escape"&&this.control.instance?.hide()};vt(l=>{if(l)return document.addEventListener("click",o),document.addEventListener("keydown",i),()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",i)}},()=>[t.open]),X(()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",i)})}};r(ye,"template","nodexui.DropdownMenu"),r(ye,"props",{state:n(String),onOpenChange:n(Function),...p});var jt=class extends a{setup(){this.rootRef={el:null},this.onShown=()=>this.env.dropdownSetOpen(!0),this.onHidden=()=>this.env.dropdownSetOpen(!1),this.getRef=t=>{t?(this.rootRef.el=t,this.env.dropdownControl.instance=ot().Dropdown.getOrCreateInstance(t),t.addEventListener("shown.bs.dropdown",this.onShown),t.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 m("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(jt,"template","nodexui.DropdownMenuTrigger"),r(jt,"components",{Button:L}),r(jt,"props",p);var we=class extends a{get open(){return this.env.dropdownMenu.open}get classNames(){return m("b-dropdown-menu-content","dropdown-menu",this.open?"show":"",this.props.className)}};r(we,"template","nodexui.DropdownMenuContent"),r(we,"props",{...p,align:n(String),alignOffset:n(Number),side:n(String),sideOffset:n(Number)});var Io=class extends a{};r(Io,"template","nodexui.DropdownMenuGroup"),r(Io,"props",p);var Po=class extends a{};r(Po,"template","nodexui.DropdownMenuLabel"),r(Po,"props",{...p,inset:n(Boolean)});var Se=class extends a{get variant(){return this.props.variant||"default"}onClick(t){this.props.disabled||(this.props.onClick?.(t),this.props.onSelect?.(t),this.env.dropdownClose())}};r(Se,"template","nodexui.DropdownMenuItem"),r(Se,"props",si);var es=class extends a{onClick(t){this.props.disabled||(this.props.onCheckedChange?.(!this.props.checked,t),this.props.onClick?.(t),this.props.onSelect?.(t))}};r(es,"template","nodexui.DropdownMenuCheckboxItem"),r(es,"components",{Icon:Y}),r(es,"props",{...si,checked:n(Boolean),onCheckedChange:n(Function)});var _o=class extends a{setup(){z({dropdownRadio:{value:this.props.value,onValueChange:this.props.onValueChange}})}};r(_o,"template","nodexui.DropdownMenuRadioGroup"),r(_o,"props",{...p,value:n(String),onValueChange:n(Function)});var ss=class extends a{get checked(){return this.env.dropdownRadio?.value===this.props.value}onClick(t){this.props.disabled||(this.env.dropdownRadio?.onValueChange?.(this.props.value,t),this.props.onClick?.(t),this.props.onSelect?.(t))}};r(ss,"template","nodexui.DropdownMenuRadioItem"),r(ss,"components",{Icon:Y}),r(ss,"props",{...si,value:n(String)});var $o=class extends a{};r($o,"template","nodexui.DropdownMenuSeparator"),r($o,"props",p);var Mo=class extends a{};r(Mo,"template","nodexui.DropdownMenuShortcut"),r(Mo,"props",p);var Ce=class extends a{setup(){this.rootRef=B("root");let{state:t,setOpen:s,toggle:o}=ro(this.rootRef);z({dropdownSub:t,dropdownSubToggle:o,dropdownSubOpen:()=>s(!0),dropdownSubClose:()=>s(!1)})}};r(Ce,"template","nodexui.DropdownMenuSub"),r(Ce,"props",p);var Ft=class extends a{onMouseEnter(){this.props.disabled||this.env.dropdownSubOpen()}onClick(){this.props.disabled||this.env.dropdownSubToggle()}};r(Ft,"template","nodexui.DropdownMenuSubTrigger"),r(Ft,"components",{Icon:Y}),r(Ft,"props",{...p,disabled:n(Boolean),inset:n(Boolean)});var ke=class extends a{get open(){return this.env.dropdownSub.open}};r(ke,"template","nodexui.DropdownMenuSubContent"),r(ke,"props",p);R();N();var Uo=class extends a{setup(){this.state=O({open:!1,x:0,y:0});let t=()=>{this.state.open=!1};this.close=t,z({contextMenu:this.state,contextMenuOpenAt:(s,o)=>{this.state.open=!0,this.state.x=s,this.state.y=o},contextMenuClose:t}),document.addEventListener("click",t),X(()=>document.removeEventListener("click",t))}};r(Uo,"template","nodexui.ContextMenu"),r(Uo,"props",{className:n(String),slots:n(Object)});var Do=class extends a{onContextMenu(t){t.preventDefault(),this.env.contextMenuOpenAt(t.clientX,t.clientY)}};r(Do,"template","nodexui.ContextMenuTrigger"),r(Do,"props",p);var jo=class extends a{setup(){this.rootRef=B("root")}get open(){return this.env.contextMenu.open}get style(){return dt(`left:${this.env.contextMenu.x}px;top:${this.env.contextMenu.y}px`,this.props.style)}};r(jo,"template","nodexui.ContextMenuContent"),r(jo,"props",p);var Fo=class extends a{onClick(){this.props.onClick?.(),this.env.contextMenuClose()}};r(Fo,"template","nodexui.ContextMenuItem"),r(Fo,"props",{...p,onClick:n(Function)});R();N();var $p={"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 oa(e){let t=$p[e];return t?["toast-container","position-fixed","p-3","pe-auto",...t]:null}var qt=class extends a{setup(){this.state=O({open:it(this.props)}),this.rootRef=B("root"),this.bootstrapToast=null,this.handleShown=()=>{this.state.open=!0},this.handleHidden=()=>{this.state.open=!1,this.props.onOpenChange?.(!1)},J(()=>{this.mountBootstrapToast(this.props.delay),this.state.open&&this.bootstrapToast.show()}),lt(t=>{let s=Fe(t)?it(t):this.state.open;t.delay!==this.props.delay?(this.bootstrapToast?.dispose(),this.mountBootstrapToast(t.delay),s&&this.bootstrapToast.show()):s!==this.state.open&&(s?this.bootstrapToast?.show():this.bootstrapToast?.hide())}),X(()=>{this.bootstrapToast?.dispose()})}mountBootstrapToast(t){let s=this.rootRef.el,o=t??3e3;this.bootstrapToast=new(ot()).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 m("toast","fade","b-toast",oa(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:L}),r(qt,"props",{open:n(Boolean),state:n(String),variant:n(String),delay:n(Number),position:n(String),...p,onOpenChange:n(Function)});R();N();var qo=class extends a{setup(){this.state=O({open:new Set}),z({accordion:this.state,accordionToggle:t=>this.toggle(t)})}toggle(t){let s=!this.state.open.has(t);this.props.multiple||this.state.open.clear(),s?this.state.open.add(t):this.state.open.delete(t),this.props.onChange?.(s)}};r(qo,"template","nodexui.Accordion"),r(qo,"props",{multiple:n(Boolean),onChange:n(Function),...p});var zo=class extends a{setup(){z({accordionItemState:this.props.state,accordionItemValue:this.props.value})}};r(zo,"template","nodexui.AccordionItem"),r(zo,"props",{value:{type:String},state:n(String),...p});var os=class extends a{get open(){return this.env.accordionItemState!==void 0?pt(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(os,"template","nodexui.AccordionTrigger"),r(os,"components",{Icon:Y,Button:L}),r(os,"props",p);var Ho=class extends a{setup(){this.rootRef=B("root"),this.initialOpen=this.open,Tn(this.rootRef,()=>this.open)}get open(){return this.env.accordionItemState!==void 0?pt(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}};r(Ho,"template","nodexui.AccordionContent"),r(Ho,"props",p);R();N();var Wo=class extends a{setup(){this.state=O({open:it(this.props)}),z({collapsible:this.state,collapsibleToggle:()=>this.toggle()}),ft(this.state)}toggle(){let t=!this.state.open;gt(this.props,this.state,t)}};r(Wo,"template","nodexui.Collapsible"),r(Wo,"props",{open:n(Boolean),state:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),...p});var rs=class extends a{get attrs(){return{"aria-expanded":this.env.collapsible.open?"true":"false"}}onClick(){this.env.collapsibleToggle()}};r(rs,"template","nodexui.CollapsibleTrigger"),r(rs,"components",{Button:L}),r(rs,"props",p);var Ko=class extends a{setup(){this.rootRef=B("root"),this.initialOpen=this.open,Tn(this.rootRef,()=>this.open)}get open(){return this.env.collapsible.open}};r(Ko,"template","nodexui.CollapsibleContent"),r(Ko,"props",p);R();N();var Ae=class extends a{};r(Ae,"template","nodexui.Breadcrumb"),r(Ae,"props",{...p});var Ee=class extends a{};r(Ee,"template","nodexui.BreadcrumbList"),r(Ee,"props",{...p});var Ne=class extends a{get classNames(){return m("b-breadcrumb-item",this.props.current&&"b-breadcrumb-page",this.props.className)}};r(Ne,"template","nodexui.BreadcrumbItem"),r(Ne,"props",{current:n(Boolean),...p});var Te=class extends a{get classNames(){return m("b-breadcrumb-link",this.props.className)}onClick(t){this.props.onClick?.(t)}};r(Te,"template","nodexui.BreadcrumbLink"),r(Te,"props",{href:n(String),target:n(String),rel:n(String),...p,onClick:n(Function)});var Oe=class extends a{get classNames(){return m("b-breadcrumb-page",this.props.className)}};r(Oe,"template","nodexui.BreadcrumbPage"),r(Oe,"props",{...p});var zt=class extends a{get classNames(){return m("b-breadcrumb-separator",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};r(zt,"template","nodexui.BreadcrumbSeparator"),r(zt,"components",{Icon:Y}),r(zt,"props",{...p});var ns=class extends a{get classNames(){return m("b-breadcrumb-ellipsis",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};r(ns,"template","nodexui.BreadcrumbEllipsis"),r(ns,"components",{Icon:Y}),r(ns,"props",{...p});R();N();var Vo=class extends a{get classNames(){return m("b-pagination",this.props.className)}};r(Vo,"template","nodexui.Pagination"),r(Vo,"props",{...p});var Go=class extends a{get classNames(){return m("page-item",this.props.current&&"active",this.props.disabled&&"disabled")}onClick(){this.props.disabled||this.props.onClick?.()}};r(Go,"template","nodexui.PaginationItem"),r(Go,"props",{current:n(Boolean),disabled:n(Boolean),style:n([String,Object]),onClick:n(Function),slots:n(Object)});R();N();var Zo=class extends a{setup(){this.rootRef=B("root")}onKeyDown(t){let s=[...this.rootRef.el.querySelectorAll("a, button")].filter(l=>!l.disabled),o=s.indexOf(t.target),i=t.key==="ArrowRight"?1:t.key==="ArrowLeft"?-1:0;!i||o<0||(t.preventDefault(),s[(o+i+s.length)%s.length]?.focus())}};r(Zo,"template","nodexui.NavigationMenu"),r(Zo,"props",{...p});var Jo=class extends a{};r(Jo,"template","nodexui.NavigationMenuItem"),r(Jo,"props",{href:n(String),...p});R();N();var Yo=class extends a{get classNames(){return m("b-menubar",this.props.className)}};r(Yo,"template","nodexui.Menubar"),r(Yo,"props",{...p});R();N();var ra={...p,href:n(String)};function na(e){globalThis.matchMedia?.("(max-width: 991.98px)").matches&&e.setSidebarOpen?.(!1)}var Wt=class extends a{setup(){this.state=O({open:it(this.props)}),z({sidebar:this.state,setSidebarOpen:t=>this.setOpen(t)}),ft(this.state)}setOpen(t){gt(this.props,this.state,t)}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 m("b-sidebar-root",this.props.className)}onKeyDown(t){t.key==="Escape"&&this.setOpen(!1)}};r(Wt,"template","nodexui.Sidebar"),r(Wt,"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 mn=class extends Wt{};r(mn,"template","nodexui.Sidebar");var is=class extends a{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(is,"template","nodexui.SidebarTrigger"),r(is,"components",{Icon:Y,Button:L}),r(is,"props",{...p,icon:n(String),label:n(String)});var Le=class extends a{get open(){return this.env.sidebar.open}};r(Le,"template","nodexui.SidebarContent"),r(Le,"props",p);var Qo=class extends a{};r(Qo,"template","nodexui.SidebarHeader"),r(Qo,"props",p);var Xo=class extends a{};r(Xo,"template","nodexui.SidebarFooter"),r(Xo,"props",p);var tr=class extends a{};r(tr,"template","nodexui.SidebarInset"),r(tr,"props",p);var as=class extends a{onClick(){this.env.setSidebarOpen(!this.env.sidebar.open)}};r(as,"template","nodexui.SidebarRail"),r(as,"components",{Button:L}),r(as,"props",p);var er=class extends a{};r(er,"template","nodexui.SidebarInput"),r(er,"props",{className:n(String),style:n([String,Object]),placeholder:n(String),value:n(String),type:n(String)});var sr=class extends a{};r(sr,"template","nodexui.SidebarSeparator"),r(sr,"props",p);var ls=class extends a{onClick(){this.env.setSidebarOpen(!1)}};r(ls,"template","nodexui.SidebarClose"),r(ls,"components",{Icon:Y,Button:L}),r(ls,"props",{...p,icon:n(String),label:n(String)});var Re=class extends a{};r(Re,"template","nodexui.SidebarGroup"),r(Re,"props",{muted:n(Boolean),...p});var Be=class extends a{};r(Be,"template","nodexui.SidebarGroupLabel"),r(Be,"props",ra);var ps=class extends a{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(t){this.props.onClick?.(t)}};r(ps,"template","nodexui.SidebarGroupAction"),r(ps,"components",{Button:L}),r(ps,"props",{icon:n(String),"aria-label":n(String),ariaLabel:n(String),onClick:n(Function),...p});var or=class extends a{};r(or,"template","nodexui.SidebarGroupContent"),r(or,"props",p);var cs=class extends a{setup(){let t=this.props["default-open"]!==void 0||this.props.defaultOpen!==void 0;this.state=O({open:Fe(this.props)||t?it(this.props):!0}),ft(this.state)}get open(){return this.state.open}toggle(){let t=!this.state.open;gt(this.props,this.state,t)}};r(cs,"template","nodexui.SidebarGroupCollapsible"),r(cs,"components",{Icon:Y,Button:L}),r(cs,"props",{label:{type:String},open:n(Boolean),state:n(String),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),...p});var Kt=class extends a{};r(Kt,"template","nodexui.SidebarMenu"),r(Kt,"props",p);var Ie=class extends a{};r(Ie,"template","nodexui.SidebarMenuItem"),r(Ie,"props",p);var Ht=class extends a{get classNames(){return m("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(t){this.props.onClick?.(t),na(this.env)}};r(Ht,"template","nodexui.SidebarMenuButton"),r(Ht,"components",{Icon:Y,Button:L}),r(Ht,"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 a{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(t){this.props.onClick?.(t)}};r(us,"template","nodexui.SidebarMenuAction"),r(us,"components",{Button:L}),r(us,"props",{icon:n(String),"aria-label":n(String),ariaLabel:n(String),showOnHover:n(Boolean),onClick:n(Function),...p});var rr=class extends a{};r(rr,"template","nodexui.SidebarMenuSub"),r(rr,"props",p);var nr=class extends a{};r(nr,"template","nodexui.SidebarMenuBadge"),r(nr,"props",p);var ir=class extends a{setup(){this.state=O({width:this.props.width||`${Math.floor(Math.random()*40)+50}%`})}get style(){return dt(`--b-sidebar-skeleton-width:${this.state.width}`,this.props.style)}};r(ir,"template","nodexui.SidebarMenuSkeleton"),r(ir,"props",{showIcon:n(Boolean),width:n(String),className:n(String),style:n([String,Object])});var ar=class extends a{};r(ar,"template","nodexui.SidebarMenuSubItem"),r(ar,"props",p);var ds=class extends a{get classNames(){return m("b-sidebar-menu-sub-button",(this.props.active||this.props.isActive)&&"is-active",this.props.size&&`is-${this.props.size}`,this.props.className)}onClick(t){this.props.onClick?.(t),na(this.env)}};r(ds,"template","nodexui.SidebarMenuSubButton"),r(ds,"components",{Button:L}),r(ds,"props",{...ra,active:n(Boolean),isActive:n(Boolean),size:n(String),onClick:n(Function)});R();N();var hs=class extends a{setup(){this.state=O({collapsed:this.props.collapsed??this.props.defaultCollapsed??!1,authState:this.props.authState??null}),z({shell:this.state,setShellCollapsed:t=>this.setCollapsed(t)}),lt(t=>{t.collapsed!==void 0&&(this.state.collapsed=t.collapsed),this.state.authState=t.authState??null})}setCollapsed(t){this.props.collapsed===void 0&&(this.state.collapsed=t),this.props.onCollapsedChange?.(t)}dismissToast(){this.props.onToastOpenChange?.(!1)}runToastAction(){this.props.toast?.onAction?.()}};r(hs,"template","nodexui.Shell"),r(hs,"components",{Sidebar:Wt,Toast:qt,Button:L}),r(hs,"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 ms=class extends a{};r(ms,"template","nodexui.ShellSidebar"),r(ms,"components",{SidebarContent:Le}),r(ms,"props",p);var lr=class extends a{};r(lr,"template","nodexui.ShellSidebarHeader"),r(lr,"props",p);var pr=class extends a{};r(pr,"template","nodexui.ShellNav"),r(pr,"props",p);var cr=class extends a{};r(cr,"template","nodexui.ShellMain"),r(cr,"props",p);var ur=class extends a{};r(ur,"template","nodexui.ShellHeader"),r(ur,"props",p);var fs=class extends a{};r(fs,"template","nodexui.ShellContent"),r(fs,"components",{Skeleton:ge}),r(fs,"props",{loading:n(Boolean),...p});var gs=class extends a{get authState(){return this.env.shell.authState}logout(){this.authState?.onLogout?.()}};r(gs,"template","nodexui.ShellUserMenu"),r(gs,"components",{Button:L}),r(gs,"props",p);R();N();var dr=class extends a{get classNames(){return m("table","b-table",this.props.striped!==!1&&"table-striped",this.props.hover!==!1&&"table-hover",this.props.className)}};r(dr,"template","nodexui.Table"),r(dr,"props",{striped:n(Boolean),hover:n(Boolean),responsive:n(Boolean),...p});R();N();var Mp=[{key:"status",label:"Status",format:"capitalize"},{key:"email",label:"Email",sortable:!0,filterable:!0},{key:"amount",label:"Amount",align:"right",format:"currency"}],Up=[{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}],Dp=[{label:"Copy payment ID"},{label:"View customer"},{label:"View payment details"}],bs=4,xs=8,jp=32,vs=class extends a{setup(){this.state=O({query:"",sortKey:null,sortDir:1,page:0,pageSize:this.initialPageSize,selectedKeys:[],hiddenColumns:this.columns.filter(t=>t.hidden||t.visible===!1).map(t=>t.key),columnsOpen:!1,actionRowKey:null,actionMenuStyle:null}),this.actionsMenuRef=B("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())}get columns(){return this.props.columns?.length?this.props.columns:Mp}get rows(){return this.props.rows?.length?this.props.rows:Up}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?Dp:[])}get variant(){return this.props.variant||"default"}get classNames(){return m("b-data-table",`b-data-table-${this.variant}`,this.props.className)}get viewportStyle(){let t=this.props["max-height"]??this.props.maxHeight;return t?`max-height: ${typeof t=="number"?`${t}px`:t};`:""}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(t=>!this.state.hiddenColumns.includes(t.key))}get visibleRows(){let t=this.state.query.toLowerCase(),s=this.columns.filter(l=>l.filterable===!0),o=(s.length?s:this.columns).map(l=>l.key),i=this.rows.filter(l=>!t||o.some(u=>String(l[u]).toLowerCase().includes(t)));return this.state.sortKey&&(i=[...i].sort((l,u)=>String(l[this.state.sortKey]).localeCompare(String(u[this.state.sortKey]))*this.state.sortDir)),i}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(t,s){return t.id??t.key??s}isSelected(t,s){return this.state.selectedKeys.includes(this.rowKey(t,s))}isColumnSortable(t){return this.hasSorting&&t.sortable===!0}onSearchInput(t){this.state.query=t.target.value,this.state.page=0}sortBy(t){let s=this.columns.find(o=>o.key===t);!s||!this.isColumnSortable(s)||(this.state.sortKey===t?this.state.sortDir=-this.state.sortDir:(this.state.sortKey=t,this.state.sortDir=1))}sortIcon(t){return this.state.sortKey!==t?"arrow-up-down":this.state.sortDir===1?"arrow-up":"arrow-down"}toggleColumn(t){this.state.hiddenColumns.includes(t)?this.state.hiddenColumns=this.state.hiddenColumns.filter(s=>s!==t):this.state.hiddenColumns=[...this.state.hiddenColumns,t]}toggleColumnsMenu(){this.state.columnsOpen=!this.state.columnsOpen}toggleRowActions(t,s,o){let i=this.rowKey(t,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 t=this.pageRows.findIndex((s,o)=>this.rowKey(s,o)===this.state.actionRowKey);return t===-1?null:{row:this.pageRows[t],index:t}}estimateActionMenuStyle(t){let s=t.getBoundingClientRect(),o=this.rowActions.length*jp+bs*2,i=window.innerHeight-s.bottom,u=i<o+bs&&s.top>i?Math.max(xs,s.top-bs-o):s.bottom+bs,h=Math.min(Math.max(xs,s.right-160),window.innerWidth-160-xs);return`position: fixed; top: ${Math.round(u)}px; left: ${Math.round(h)}px;`}refreshActionsMenuPosition(){if(this.state.actionRowKey===null||!this.actionsMenuTriggerEl)return;let t=this.actionsMenuRef.el;if(!t)return;let s=this.actionsMenuTriggerEl.getBoundingClientRect(),o=t.getBoundingClientRect(),i=window.innerHeight-s.bottom,l=s.top,h=i<o.height+bs&&l>i?Math.max(xs,s.top-bs-o.height):Math.min(s.bottom+bs,window.innerHeight-o.height-xs),S=Math.min(Math.max(xs,s.right-o.width),window.innerWidth-o.width-xs),M=`position: fixed; top: ${Math.round(h)}px; left: ${Math.round(S)}px;`;this.state.actionMenuStyle!==M&&(this.state.actionMenuStyle=M)}onWindowClick(t){this.state.actionRowKey===null||this.actionsMenuRef.el?.contains(t.target)||this.actionsMenuTriggerEl?.contains(t.target)||this.closeRowActions()}onWindowKeydown(t){t.key==="Escape"&&this.closeRowActions()}setPage(t){this.state.page=Math.max(0,Math.min(t,this.pageCount-1))}setPageSize(t){this.state.pageSize=Number(t),this.state.page=0}optionValue(t){return`${t}`}toggleRow(t,s,o){let i=this.rowKey(t,s);this.state.selectedKeys=o?[...new Set([...this.state.selectedKeys,i])]:this.state.selectedKeys.filter(l=>l!==i),this.props.onSelectionChange?.(this.state.selectedKeys)}toggleAllVisible(t){let s=this.pageRows.map((o,i)=>this.rowKey(o,i));this.state.selectedKeys=t?[...new Set([...this.state.selectedKeys,...s])]:this.state.selectedKeys.filter(o=>!s.includes(o)),this.props.onSelectionChange?.(this.state.selectedKeys)}onAction(t,s,o){t.onSelect?.(s,o),this.props.onRowAction?.(t,s,o),this.closeRowActions()}columnLabel(t){return t.label??t.key}cellValue(t,s){let o=t[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(t,s){return s.componentProps?s.componentProps(t,s):{row:t,column:s,value:t[s.key]}}};r(vs,"template","nodexui.DataTable"),r(vs,"components",{Button:L,Icon:Y}),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])});R();N();var Fp=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}),qp=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ys=class extends a{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 Fp.format(new Date(this.year,this.month0,1))}get weekdays(){return qp}get days(){let t=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<=t;i++){let l=`${this.year}-${String(this.month0+1).padStart(2,"0")}-${String(i).padStart(2,"0")}`;o.push({day:i,value:l,selected:l===this.props.selected})}return o}onSelect(t){this.props.onChange?.(t)}};r(ys,"template","nodexui.Calendar"),r(ys,"components",{Button:L}),r(ys,"props",{selected:n(String),month:n(Number),year:n(Number),className:n(String),style:n([String,Object]),onChange:n(Function)});N();var hr=class extends mt{get classNames(){return m("b-date-picker","form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(t){this.props.onChange?.(t.target.value,t)}};r(hr,"template","nodexui.DatePicker"),r(hr,"props",{...Ct,value:n(String),className:n(String),style:n([String,Object]),onChange:n(Function)});R();N();var mr=class extends mt{setup(){super.setup(),this.rootRef=B("root");let{state:t}=ro(this.rootRef);this.disclosure=t,this.state=O({query:this.selectedLabel})}get classNames(){return m("form-control",this.controlClass,this.isInvalid&&"is-invalid")}get selectedLabel(){return this.props.options.find(t=>t.value===this.props.value)?.label||""}get filteredOptions(){let t=this.state.query.toLowerCase();return this.props.options.filter(s=>s.label.toLowerCase().includes(t))}onInput(t){this.state.query=t.target.value,this.disclosure.open=!0}onFocus(){this.disclosure.open=!0}choose(t){this.state.query=t.label,this.disclosure.open=!1,this.props.onChange?.(t.value)}};r(mr,"template","nodexui.Combobox"),r(mr,"props",{options:{type:Array},...Ct,value:n(String),className:n(String),style:n([String,Object]),id:n(String),onChange:n(Function)});R();N();var fr=class extends a{setup(){this.state=O({query:""})}get filteredItems(){let t=this.state.query.toLowerCase();return this.props.items.filter(s=>s.label.toLowerCase().includes(t))}onInput(t){this.state.query=t.target.value}select(t){this.props.onSelect?.(t.value)}};r(fr,"template","nodexui.Command"),r(fr,"props",{items:{type:Array},placeholder:n(String),className:n(String),style:n([String,Object]),onSelect:n(Function)});R();N();var gr=class extends a{get classNames(){return m("b-chart",this.props.type&&`b-chart-${this.props.type}`,this.props.variant&&`b-chart-${this.props.variant}`,this.props.className)}};r(gr,"template","nodexui.Chart"),r(gr,"props",{config:n([String,Object]),label:n(String),type:n(String),value:n([String,Number]),variant:n(String),...p});R();N();var br=class extends a{setup(){this.state=O({index:this.props.defaultIndex??0}),this.rootRef=B("root"),this.bootstrapCarousel=null,this.onSlid=t=>{this.state.index=t.to,this.props.onChange?.(this.state.index)},z({carousel:this.state,carouselInstance:()=>this.bootstrapCarousel}),J(()=>{this.bootstrapCarousel=new(ot()).Carousel(this.rootRef.el,{interval:!1,wrap:!0,touch:!0}),this.rootRef.el.addEventListener("slid.bs.carousel",this.onSlid)}),X(()=>{this.rootRef.el.removeEventListener("slid.bs.carousel",this.onSlid),this.bootstrapCarousel?.dispose()})}};r(br,"template","nodexui.Carousel"),r(br,"props",{slideCount:{type:Number},defaultIndex:n(Number),onChange:n(Function),...p});var xr=class extends a{setup(){this.rootRef=B("root"),this.initialActive=this.active,rt(()=>{if(!this.rootRef.el)return;let t=this.rootRef.el.classList.contains("active");this.active&&!t?this.rootRef.el.classList.add("active"):!this.active&&t&&this.rootRef.el.classList.remove("active")})}get active(){return this.props.state!==void 0?pt(this.props.state):this.env.carousel.index===this.props.index}};r(xr,"template","nodexui.CarouselSlide"),r(xr,"props",{index:{type:Number},state:n(String),...p});var ws=class extends a{onClick(){this.env.carouselInstance()?.prev()}};r(ws,"template","nodexui.CarouselPrevious"),r(ws,"components",{Button:L}),r(ws,"props",p);var Ss=class extends a{onClick(){this.env.carouselInstance()?.next()}};r(Ss,"template","nodexui.CarouselNext"),r(Ss,"components",{Button:L}),r(Ss,"props",p);R();N();var vr=class extends a{setup(){this.panelRef=B("panel"),this.state=O({width:null})}get panelStyle(){return this.state.width?`width:${this.state.width}px`:""}onPointerDown(t){let s=t.clientX,o=this.panelRef.el.getBoundingClientRect().width,i=this.props.min||160,l=this.props.max||720,u=S=>{this.state.width=Math.min(l,Math.max(i,o+S.clientX-s))},h=()=>{document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",h),this.props.onChange?.(this.state.width)};document.addEventListener("pointermove",u),document.addEventListener("pointerup",h)}};r(vr,"template","nodexui.Resizable"),r(vr,"props",{min:n(Number),max:n(Number),onChange:n(Function),...p});R();N();var yr=class extends a{get classNames(){return m("b-scroll-area",this.props.className)}};r(yr,"template","nodexui.ScrollArea"),r(yr,"props",p);R();N();var ia={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"},wr=class extends a{get state(){return ia[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 m("b-attachment",ia[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(t){this.props.onChange?.([...t.target.files])}};r(wr,"template","nodexui.Attachment"),r(wr,"props",{state:n(String),size:n(String),orientation:n(String),multiple:n(Boolean),...p,onChange:n(Function)});var Sr=class extends a{get variant(){return this.props.variant==="image"?"image":"icon"}get classNames(){return m("b-attachment-media",`b-attachment-media-${this.variant}`,this.props.className)}};r(Sr,"template","nodexui.AttachmentMedia"),r(Sr,"props",{variant:n(String),...p});var Cr=class extends a{};r(Cr,"template","nodexui.AttachmentContent"),r(Cr,"props",p);var kr=class extends a{};r(kr,"template","nodexui.AttachmentTitle"),r(kr,"props",p);var Ar=class extends a{};r(Ar,"template","nodexui.AttachmentDescription"),r(Ar,"props",p);var Er=class extends a{};r(Er,"template","nodexui.AttachmentActions"),r(Er,"props",p);var Cs=class extends a{get variant(){return this.props.variant||"ghost"}get size(){return this.props.size||"icon-xs"}get className(){return m("b-button-icon","b-attachment-action",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(t){this.props.onClick?.(t)}};r(Cs,"template","nodexui.AttachmentAction"),r(Cs,"components",{Button:L}),r(Cs,"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 ks=class extends a{get classNames(){return m("b-attachment-trigger",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(t){this.props.onClick?.(t)}};r(ks,"template","nodexui.AttachmentTrigger"),r(ks,"components",{Button:L}),r(ks,"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 Nr=class extends a{get classNames(){return m("b-attachment-group",this.props.className)}};r(Nr,"template","nodexui.AttachmentGroup"),r(Nr,"props",{...p});var Tr=class extends a{setup(){this.state=O({dragging:!1}),this.fileInput=B("fileInput")}get hasContent(){return!!this.props.slots?.default}get classNames(){return m("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(t){let s=Array.from(t.target.files??[]);t.target.value="",s.length&&this.props.onFilesSelected?.(s)}onDragOver(t){t.preventDefault(),!this.props.disabled&&(this.state.dragging=!0)}onDragLeave(){this.state.dragging=!1}onDrop(t){if(t.preventDefault(),this.state.dragging=!1,this.props.disabled)return;let s=Array.from(t.dataTransfer?.files??[]);s.length&&this.props.onFilesSelected?.(s)}};r(Tr,"template","nodexui.AttachmentDropzone"),r(Tr,"props",{multiple:n(Boolean),disabled:n(Boolean),...p,onFilesSelected:n(Function)});R();N();var Or=class extends a{setup(){this.state=O({errored:!1})}get showImage(){return!!this.props.src&&!this.state.errored}onError(){this.state.errored=!0}};r(Or,"template","nodexui.Avatar"),r(Or,"props",{src:n(String),alt:n(String),title:n(String),...p});R();N();var Lr=class extends a{get classNames(){return m("b-message",this.props.className)}get side(){return this.props.side||"incoming"}};r(Lr,"template","nodexui.Message"),r(Lr,"props",{side:n(String),...p});R();N();var Rr=class extends a{setup(){this.rootRef=B("root"),vt(()=>{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});R();N();var Br=class extends a{setup(){this.state=O({index:0}),z({questionnaire:this.state,questionnaireShow:t=>this.show(t)})}show(t){this.state.index=Math.min(this.props.stepCount-1,Math.max(0,t)),this.props.onChange?.(this.state.index)}};r(Br,"template","nodexui.Questionnaire"),r(Br,"props",{stepCount:{type:Number},onChange:n(Function),...p});var Ir=class extends a{get active(){return this.props.state!==void 0?pt(this.props.state):this.env.questionnaire.index===this.props.index}};r(Ir,"template","nodexui.QuestionnaireStep"),r(Ir,"props",{index:{type:Number},state:n(String),...p});var As=class extends a{get disabled(){return this.env.questionnaire.index===0}onClick(){this.env.questionnaireShow(this.env.questionnaire.index-1)}};r(As,"template","nodexui.QuestionnairePrevious"),r(As,"components",{Button:L}),r(As,"props",p);var Es=class extends a{onClick(){this.env.questionnaireShow(this.env.questionnaire.index+1)}};r(Es,"template","nodexui.QuestionnaireNext"),r(Es,"components",{Button:L}),r(Es,"props",{...p,stepCount:n(Number)});R();N();var Pr=class extends a{get max(){return this.props.max||100}get value(){return Math.min(this.max,Math.max(0,this.props.value||0))}get style(){return dt(`--b-progress-value:${this.value/this.max*100}%`,this.props.style)}get classNames(){return m("progress b-progress",this.props.className)}};r(Pr,"template","nodexui.Progress"),r(Pr,"props",{value:n(Number),max:n(Number),className:n(String),style:n([String,Object])});R();N();var On=fl(ua(),1);On.default.stringToBytes=On.default.stringToBytesFuncs["UTF-8"];function da(e,{ecc:t="M"}={}){let s=(0,On.default)(0,t);return s.addData(String(e)),s.make(),{size:s.getModuleCount(),isDark:(o,i)=>s.isDark(o,i)}}var Ns=class extends a{get code(){let{matrix:t}=this.props;if(t)return t;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:t,isDark:s}=this.code,o=[];for(let i=0;i<t;i+=1)for(let l=0;l<t;l+=1)s(i,l)&&o.push(`M${l} ${i}h1v1h-1z`);return o.join("")}get size(){return this.code.size}};r(Ns,"template","nodexui.QRCard"),r(Ns,"components",{Card:ee,CardBody:oe,CardHeader:se,CardTitle:re,CardDescription:ne}),r(Ns,"props",{matrix:n(Object),qrContent:n(String),label:n(String),title:n(String),description:n(String),...p});R();N();var _r=class extends a{get classNames(){return m("b-aspect-ratio",this.props.className)}get style(){let t=this.props.ratio||`${this.props.width||16} / ${this.props.height||9}`;return dt(`--b-aspect-ratio:${t}`,this.props.style)}};r(_r,"template","nodexui.AspectRatio"),r(_r,"props",{ratio:n(String),width:n(Number),height:n(Number),...p});R();N();var $r=class extends a{get classNames(){return m("b-bubble",this.props.className)}get side(){return this.props.side}};r($r,"template","nodexui.Bubble"),r($r,"props",{side:n(String),...p});R();N();var Mr=class extends a{get dir(){return this.props.dir==="rtl"?"rtl":"ltr"}};r(Mr,"template","nodexui.Direction"),r(Mr,"props",{dir:n(String),...p});R();N();var Ur=class extends a{get classNames(){return m("b-item",this.props.className)}get variant(){return this.props.variant}};r(Ur,"template","nodexui.Item"),r(Ur,"props",{variant:n(String),...p});R();N();var Dr=class extends a{get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return m("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(Dr,"template","nodexui.ButtonGroup"),r(Dr,"props",{orientation:n(String),size:n(String),"aria-label":n(String),"aria-labelledby":n(String),...p});var jr=class extends a{get orientation(){return this.props.orientation==="horizontal"?"horizontal":"vertical"}get classNames(){return m("b-button-group-separator",`b-button-group-separator-${this.orientation}`,this.props.className)}};r(jr,"template","nodexui.ButtonGroupSeparator"),r(jr,"props",{orientation:n(String),className:n(String),style:n([String,Object])});var Fr=class extends a{get classNames(){return m("b-button-group-text",this.props.className)}};r(Fr,"template","nodexui.ButtonGroupText"),r(Fr,"props",{...p});R();N();var qr=class extends a{get classNames(){return m("b-field-set",this.props.className)}};r(qr,"template","nodexui.FieldSet"),r(qr,"props",{...p});var zr=class extends a{get variant(){return this.props.variant||"legend"}get classNames(){return m("b-field-legend",this.props.className)}};r(zr,"template","nodexui.FieldLegend"),r(zr,"props",{variant:n(String),...p});var Pe=class extends a{get classNames(){return m("b-field-group",this.props.className)}};r(Pe,"template","nodexui.FieldGroup"),r(Pe,"props",{...p});var _e=class extends a{setup(){z({fieldProps:()=>this.props})}get orientation(){return this.props.orientation||"vertical"}get classNames(){return m("b-field",`b-field-orientation-${this.orientation}`,this.props.className)}};r(_e,"template","nodexui.Field"),r(_e,"props",{orientation:n(String),invalid:n(Boolean),label:n(String),labelBackground:n(String),description:n(String),useTip:n(Number),error:n(String),...p});var Hr=class extends a{get classNames(){return m("b-field-content",this.props.className)}};r(Hr,"template","nodexui.FieldContent"),r(Hr,"props",{...p});var $e=class extends a{get classNames(){return m("b-field-label",this.props.className)}};r($e,"template","nodexui.FieldLabel"),r($e,"props",{for:n(String),...p});var Wr=class extends a{get classNames(){return m("b-field-title",this.props.className)}};r(Wr,"template","nodexui.FieldTitle"),r(Wr,"props",{...p});var Me=class extends a{get classNames(){return m("b-field-description",this.props.className)}};r(Me,"template","nodexui.FieldDescription"),r(Me,"props",{...p});var Kr=class extends a{get hasContent(){return!!this.props.slots?.default}get classNames(){return m("b-field-separator",this.props.className)}};r(Kr,"template","nodexui.FieldSeparator"),r(Kr,"props",{...p});var Ue=class extends a{get classNames(){return m("b-field-error",this.props.className)}};r(Ue,"template","nodexui.FieldError"),r(Ue,"props",{message:n(String),...p});function ha(e){return`Icon${String(e).split("-").filter(Boolean).map(s=>s[0].toUpperCase()+s.slice(1)).join("")}`}R();N();var Vr=class extends a{get classNames(){return m("form-label","b-label","b-label",this.props.className)}get state(){return this.props.state||(this.props.required?"required":void 0)}};r(Vr,"template","nodexui.Label"),r(Vr,"props",{for:n(String),required:n(Boolean),state:n(String),...p});R();var zp="b-theme",Hp="theme",Wp="[b-theme-toggle]",Kp="[b-theme-label]";function fa(e){return e==="dark"?"dark":"light"}function Vp(e){return typeof globalThis.location>"u"?null:new URLSearchParams(globalThis.location.search).get(e)}function Gp(e,t=document.documentElement){let s=fa(e);return globalThis.thebase?.theme?.set?globalThis.thebase.theme.set(s):t&&(t.setAttribute("b-theme",s),t.setAttribute("data-bs-theme",s)),s}function ma(e,t,s){try{e.contentWindow?.NodexUI?.theme.set(t),e.contentDocument?.documentElement.setAttribute("b-theme",t),e.contentDocument?.documentElement.setAttribute("data-bs-theme",t)}catch{let o=new URL(e.getAttribute("src"),globalThis.location.href);o.searchParams.set(s,t),e.setAttribute("src",o.pathname+o.search+o.hash)}}function Zp(e){typeof document>"u"||typeof CustomEvent>"u"||document.dispatchEvent(new CustomEvent("nodexui:theme-change",{detail:{theme:e}}))}function fn(e={}){let t=e.storageKey||zp,s=e.queryKey||Hp,o=e.toggleSelector??Wp,i=e.labelSelector??Kp,l=e.root||(typeof document>"u"?null:document.documentElement);function u(){return Vp(s)}function h(){return fa(u()||globalThis.localStorage?.getItem(t)||l?.getAttribute("b-theme")||"light")}function S(Z){typeof document>"u"||!o||document.querySelectorAll(o).forEach($=>{$.setAttribute("aria-pressed",Z==="dark"?"true":"false");let W=i?$.querySelector(i):null;W&&(W.textContent=Z==="dark"?"Light theme":"Dark theme")})}function M(Z){typeof document>"u"||document.querySelectorAll("iframe").forEach($=>ma($,Z,s))}function U(Z,$={}){let W=Gp(Z,l);return!$.skipStorage&&!u()&&globalThis.localStorage?.setItem(t,W),S(W),M(W),Zp(W),W}function F(){return U(l?.getAttribute("b-theme")==="dark"?"light":"dark")}function H(){if(typeof document>"u")return h();let Z=h();return U(Z,{skipStorage:!!u()}),o&&document.addEventListener("click",$=>{$.target.closest?.(o)&&F()}),document.querySelectorAll("iframe").forEach($=>{$.addEventListener("load",()=>ma($,l?.getAttribute("b-theme")||Z,s))}),Z}return{current:h,set:U,toggle:F,syncFrames:M,init:H}}var Jp=fn();typeof window<"u"&&(window.NodexUITheme=Jp);N();N();kn();var Rx=["btn","b-theme-button",...Object.values(Ot),...Object.values(Yt)];function Ln(e){let t=e==="dark";return{icon:t?"sun":"moon",label:t?"Switch to light theme":"Switch to dark theme",pressed:t?"true":"false"}}function ga({variant:e="outline",size:t,className:s}={}){return m("btn","b-theme-button",Ot[e]||Ot.outline,Yt[t],s)}var Vt=class extends a{setup(){this.theme=fn({storageKey:ht(this.props,"storage-key","storageKey")}),this.state=O({theme:this.theme.current()}),this.onThemeChange=t=>{this.state.theme=t.detail?.theme||this.theme.current()},J(()=>{this.state.theme=this.theme.set(this.theme.current(),{skipStorage:!0}),document.addEventListener("nodexui:theme-change",this.onThemeChange)}),X(()=>document.removeEventListener("nodexui:theme-change",this.onThemeChange))}get iconName(){return Ln(this.state.theme).icon}get baseUrl(){return ht(this.props,"base-url")}get label(){return Ln(this.state.theme).label}get pressed(){return Ln(this.state.theme).pressed}get classNames(){return ga(this.props)}get attrs(){return{"b-theme-button":""}}onClick(){let t=this.theme.toggle();this.state.theme=t,this.props.onChange?.(t)}};r(Vt,"template","nodexui.ThemeButton"),r(Vt,"components",{Icon:Y,Button:L}),r(Vt,"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)});R();N();var Ts=class extends a{get classNames(){return m("b-toggle","btn",this.props.variant==="outline"?"btn-outline-secondary":"btn-light",this.props.className)}get pressed(){return this.props.state!==void 0?pt(this.props.state):!!this.props.pressed}onClick(){this.props.onChange?.(!this.pressed)}};r(Ts,"template","nodexui.Toggle"),r(Ts,"components",{Button:L}),r(Ts,"props",{pressed:n(Boolean),state:n(String),variant:n(String),...p,onChange:n(Function)});R();N();var Gr=class extends a{setup(){this.state=O({selected:new Set}),z({toggleGroup:this.state,toggleGroupSelect:t=>this.select(t)})}select(t){this.props.multiple?this.state.selected.has(t)?this.state.selected.delete(t):this.state.selected.add(t):this.state.selected=this.state.selected.has(t)?new Set:new Set([t]);let s=this.props.multiple?[...this.state.selected]:[...this.state.selected][0];this.props.onChange?.(s)}};r(Gr,"template","nodexui.ToggleGroup"),r(Gr,"props",{multiple:n(Boolean),onChange:n(Function),...p});var Os=class extends a{get pressed(){return this.env.toggleGroup.selected.has(this.props.value)}onClick(){this.env.toggleGroupSelect(this.props.value)}};r(Os,"template","nodexui.ToggleGroupItem"),r(Os,"components",{Button:L}),r(Os,"props",{value:{type:String},...p});R();N();R();N();di();function Ea(e){let t=String(e??""),s=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(t);if(!s)return{data:{},content:t};let o={};for(let i of s[1].split(/\r?\n/)){let l=i.trim();if(!l||l.startsWith("#"))continue;let u=l.indexOf(":");if(u===-1)continue;let h=l.slice(0,u).trim();h&&(o[h]=Ic(l.slice(u+1).trim()))}return{data:o,content:t.slice(s[0].length)}}function Aa(e){return e.length>=2&&(e[0]==='"'&&e.at(-1)==='"'||e[0]==="'"&&e.at(-1)==="'")?e.slice(1,-1):e}function Ic(e){if(e==="")return"";if(e==="true")return!0;if(e==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(e))return Number(e);if(e.startsWith("[")&&e.endsWith("]")){let t=e.slice(1,-1).trim();return t?t.split(",").map(s=>Aa(s.trim())):[]}return Aa(e)}var Gt=class extends a{setup(){this.rootRef=B("root"),this.editorRef=B("editor"),this.editorHandle=null,this.state=O({html:"",source:"",status:"loading",error:"",frontmatter:{}}),Tt(()=>this.load(this.props)),lt(t=>{if(this.shouldReload(t))return this.load(t);this.shouldRestartEditor(t)&&this.destroyEditor()}),J(()=>this.afterRender()),rt(()=>this.afterRender()),je(()=>{this.destroyEditor(),this.rootRef.el&&In(this.rootRef.el)})}get classNames(){return m("b-markdown",this.props.className)}get editorLabel(){return this.props.collaborative?"Collaborative Markdown editor":"Markdown editor"}shouldReload(t){return t.content!==this.props.content||t.src!==this.props.src}shouldRestartEditor(t){return t.editable!==this.props.editable||t.collaborative!==this.props.collaborative||t.room!==this.props.room||t.password!==this.props.password||t.signaling!==this.props.signaling}async load(t){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=t.content??"";if(t.src)try{let o=await fetch(t.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}=Ea(s);this.state.frontmatter=o,this.state.html=Fn(await pi(i)),this.state.status="ready"}catch(o){this.state.status="error",this.state.error=o.message||String(o)}}get hasFrontmatterMeta(){let t=this.state.frontmatter;return!!(t.tags?.length||t.authors?.length)}enhance(){let t=this.rootRef.el;!t||this.state.status!=="ready"||ci(t,{mermaid:this.props.mermaid!==!1,nodexUi:this.props.nodexUi!==!1})}afterRender(){this.props.editable?this.mountEditor():this.enhance()}async mountEditor(){let t=this.editorRef.el;if(!(!t||this.editorHandle||this.state.status!=="ready"))try{this.editorHandle=await ui({root:t,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(Gt,"template","nodexui.Markdown"),r(Gt,"components",{Badge:St}),r(Gt,"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),className:n(String),style:n([String,Object])});var Na={implicit:"Implicit",password:"Resource Owner Password Credentials",application:"Client Credentials",accessCode:"Authorization Code"},Pc=["POST","PUT","PATCH"];function Ls(e){try{return sessionStorage.getItem(e)||""}catch{return""}}function gn(e,t){try{t?sessionStorage.setItem(e,t):sessionStorage.removeItem(e)}catch{}}function mi(){return!!(Ls("apikey")||Ls("oauthkey"))}function hi(e){return e.example!==void 0?String(e.example):e.default!==void 0?String(e.default):e.enum?.length?String(e.enum[0]):e.type==="integer"||e.type==="number"?e.format==="int64"?"10":"1":e.type==="boolean"?"true":e.required&&e.in==="path"?"string":""}function fi(e,t){let s=Ls("apikey"),o=Ls("oauthkey");for(let i of e.security)i.type==="apiKey"&&i.in==="header"?t.header[i.name]=s:i.type==="apiKey"&&i.in==="query"?t.query[i.name]=s:i.type==="basic"?t.header.Authorization=s?`Basic ${s}`:"":(i.type==="oauth2"||i.type==="bearer")&&(t.header.Authorization=o?`Bearer ${o}`:"")}function Ta(e,t){let s={baseUrl:t,path:{},query:{},header:{},bodyText:"",mimeType:e.consumes?.[0]||"application/json"};return e.parameters.path.forEach(o=>{s.path[o.name]=hi(o)}),e.parameters.query.forEach(o=>{s.query[o.name]=o.required?hi(o):""}),e.parameters.header.forEach(o=>{s.header[o.name]=o.required?hi(o):""}),e.produces?.length&&(s.header.Accept=e.produces.includes("application/json")?"application/json":e.produces[0]),e.parameters.body&&(s.mimeType=e.parameters.body.contentType||s.mimeType,s.bodyText=gi(e.parameters.body.example)),fi(e,s),s}function gi(e){return typeof e=="string"?e:JSON.stringify(e,null,2)??""}function bi(e,t){let s=e.path;for(let[i,l]of Object.entries(t.path))s=s.replace(`{${i}}`,encodeURIComponent(l??""));let o=!!e.parameters.body&&Pc.includes(e.method);return{method:e.method,url:`${t.baseUrl}${s}`,query:Object.entries(t.query).filter(([,i])=>i!==""),headers:Object.entries(t.header).filter(([,i])=>i!==""),bodyText:o?t.bodyText:"",mimeType:t.mimeType}}function Oa(e){let t=e.query.length?`${e.url}?${new URLSearchParams(e.query)}`:e.url,s=Object.fromEntries(e.headers);return e.bodyText&&(s["Content-Type"]=s["Content-Type"]||e.mimeType),{url:t,headers:s,headerLines:Object.entries(s).map(([o,i])=>`${o}: ${i}`).join(`
40
- `)}}async function La(e,t){let s=performance.now(),o=await fetch(t.url,{method:e.method,headers:t.headers,body:e.bodyText||void 0}),i=Math.round(performance.now()-s),l=await o.text();return{status:o.status,statusText:o.statusText,ms:i,headerLines:[...o.headers.entries()].map(([u,h])=>`${u}: ${h}`).join(`
41
- `),bodyText:_c(l)}}function _c(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function Ra(e){let t=parseInt(e,10);return e==="default"||Number.isNaN(t)?"default":t<300?"2xx":t<400?"3xx":t<500?"4xx":"5xx"}function Ba(e,t,s){if(!e)return"";try{let o=new URL(t),i=new URL(s.derivedBaseUrl||s.baseUrl||t),l=new URL(e,`${o.href.replace(/\/$/,"")}/`);return l.host===i.host&&(l.protocol=o.protocol,l.username=o.username,l.password=o.password,l.host=o.host),l.href}catch{return String(e)}}function Ia(){return Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("")}function Pa({def:e,clientId:t,scopes:s,state:o,redirectUri:i,baseUrl:l,doc:u}){let h=new URL(Ba(e.authorizationUrl,l,u));return h.searchParams.set("response_type",e.flow==="implicit"?"token":"code"),t&&h.searchParams.set("client_id",t),h.searchParams.set("redirect_uri",i),s.length&&h.searchParams.set("scope",s.join(" ")),h.searchParams.set("state",o),h.toString()}async function _a(e,t,s,o){if(!e)throw new Error("No tokenUrl defined for this scheme.");let i=new URLSearchParams;for(let[h,S]of Object.entries(t))S&&i.set(h,S);let l=await fetch(Ba(e,s,o),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:i.toString()}),u=await l.json().catch(()=>({}));if(!l.ok||!u.access_token)throw new Error(u.error_description||u.error||`HTTP ${l.status}`);return u.access_token}function $a(e,t,s){let o={client_id:t.clientId,client_secret:t.clientSecret,scope:s.join(" ")};return e==="password"?{grant_type:"password",username:t.username,password:t.password,...o}:{grant_type:"client_credentials",...o}}var Ga;function bu(){return Ga??(Ga=Promise.resolve().then(()=>(Va(),Ka)))}var xu=["curl","csharp","go","node","ruby","php"],vu="(max-width: 1100px)";function Za(e){return e==="DELETE"?"DEL":e}function yu(){let e=[...document.scripts].find(t=>/\/nodexui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(t.src));return e?`${e.src.replace(/[?#].*$/,"").replace(/\/[^/]*$/,"")}/apidoc`:""}var Zt=class extends a{get children(){return this.props.groups.filter(t=>t.parent===this.props.group.name)}methodLabel(t){return Za(t)}};r(Zt,"template","nodexui.ApiDocGroup"),r(Zt,"props",{group:Object,groups:Array,current:String,href:Function,onSelect:Function});Zt.components={ApiDocGroup:Zt,Icon:Y};var Rs=class extends a{setup(){this.rootRef=B("root"),this.mainRef=B("main"),this.doc=null,this.pendingOAuth=new Map,this.watchers=new Set,this.rowsCache=new WeakMap,this.overlayQuery=window.matchMedia(vu),this.state=O({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:mi(),stored:{apikey:"",oauthkey:""},inputs:{apikey:"",oauthkey:""},oauth:{},oauthStatus:{}}),this.onHashChange=()=>this.setCurrent(this.routeId()),this.onViewportChange=()=>{this.state.sidebarOpen=!this.overlayQuery.matches},this.onDocumentClick=t=>this.closeSidebarOnOutsideClick(t),this.onOAuthMessage=t=>this.handleOAuthMessage(t),this.onThemeChange=()=>this.readSystemTheme(),Tt(()=>this.load(this.props)),lt(t=>this.shouldReload(t)?this.load(t):void 0),J(()=>this.addListeners()),je(()=>this.removeListeners())}get classNames(){return m("b-apidoc",this.props.className)}get rootStyle(){return dt(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 t=this.logic?.LANGUAGES||[],s=this.props.languages;return s?.length?t.filter(o=>s.includes(o.id)):t}get currentLanguage(){return this.languages.find(t=>t.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 t=this.doc.groups.filter(s=>!s.parent);return this.doc.webhooks.length&&t.push({id:"webhooks",name:"Webhooks",items:this.doc.webhooks,kind:""}),t}get breadcrumb(){let t=this.op;if(!t)return[{label:"Home",id:"introduction",home:!0},{label:"Introduction"}];let s=this.doc.groups.find(o=>o.name===t.tag);return[{label:"Home",id:"introduction",home:!0},{label:this.title,id:"introduction"},{label:t.tag,id:s?s.items[0].id:"introduction"},{label:t.summary}]}get authSchemes(){return Object.entries(this.doc.securityDefinitions).map(([t,s])=>({key:t,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:t,query:s,header:o}=this.op.parameters;return[...t.map(i=>({...i,group:"path"})),...s.map(i=>({...i,group:"query"})),...o.map(i=>({...i,group:"header"}))]}get selectedBaseUrl(){return this.draft?.baseUrl||this.doc.baseUrl}methodLabel(t){return Za(t)}statusClass(t){return Ra(t)}formatExample(t){return gi(t)}serverLabel(t){let s=[t.name,t.description].filter(Boolean).join(" \u2014 ");return s?`${s} (${t.url})`:t.url}languageTone(t){return xu.includes(t)?t:"default"}encodingEntries(t){return Object.entries(t)}oauthFlowLabel(t){return Na[t]||t||"unknown"}schemaRows(t){return this.rowsCache.has(t)||this.rowsCache.set(t,this.doc.schemaRows(t)),this.rowsCache.get(t)}depth(t){return(t.match(/\./g)||[]).length}lineNumbers(t){return String(t||"").split(`
42
- `).map((s,o)=>o+1)}iconUrl(t){let s=this.props.assetBase??this.assetBase??(this.assetBase=yu());return s?`${s.replace(/\/$/,"")}/${t.icon}`:""}href(t){return this.props.hash?`#/${t}`:"#"}shouldReload(t){return t.src!==this.props.src||t.spec!==this.props.spec||t.serverUrl!==this.props.serverUrl}async load(t){this.state.status="loading";try{this.logic=await bu(),this.doc=t.spec?this.logic.buildOpenApiDoc(t.spec,t.serverUrl):await this.logic.loadOpenApiDoc(t.src,t.serverUrl)}catch(s){this.state.status="error",this.state.error=s.message||String(s),t.onError?.(s);return}this.state.drafts={},this.state.current=this.routeId(t),this.ensureDraft(),this.state.status="ready",this.updateSnippet(),t.onLoad?.(this.doc)}routeId(t=this.props){let s=t.hash?location.hash.replace(/^#\//,""):t.operation;return s&&this.doc.findOperation(s)?s:"introduction"}go(t,s){this.props.hash||(t.preventDefault(),this.setCurrent(s)),this.overlayQuery.matches&&(this.state.sidebarOpen=!1)}setCurrent(t){let s=this.state;s.current=t,s.result=null,s.respTab=0,s.respView={},this.ensureDraft(),this.updateSnippet(),this.mainRef.el&&(this.mainRef.el.scrollTop=0),this.props.onNavigate?.(t)}ensureDraft(){let t=this.op;t&&!this.state.drafts[t.id]&&(this.state.drafts[t.id]=Ta(t,this.doc.baseUrl))}toggleSidebar(){this.state.sidebarOpen=!this.state.sidebarOpen}closeSidebarOnOutsideClick(t){!this.overlayQuery.matches||!this.state.sidebarOpen||t.target.closest?.(".sidebar-shell, .sidebar-toggle")||(this.state.sidebarOpen=!1)}selectResponse(t){this.state.respTab=Number(t)}setResponseView(t,s){this.state.respView[t]=s}setLanguage(t){this.state.lang=t,this.updateSnippet()}onBaseUrl(t){this.draft.baseUrl=t,this.updateSnippet()}onParam(t,s,o){this.draft[s][o]=t,this.updateSnippet()}onBody(t){this.draft.bodyText=t,this.updateSnippet()}async updateSnippet(){let t=this.op;if(!t||!this.tryItEnabled)return;let s=this.currentLanguage;try{this.state.snippet=await this.logic.generateSnippet(s.id,bi(t,this.draft))}catch(o){this.state.snippet=`// Could not generate ${s.label} snippet: ${o.message}`}}async send(){let t=this.op,s=bi(t,this.draft),o=Oa(s),i={method:s.method,url:o.url,headerLines:o.headerLines,bodyText:s.bodyText};this.state.result={phase:"sending",sent:i};let l;try{l={phase:"done",sent:i,res:await La(s,o)}}catch(u){l={phase:"error",sent:i,message:u.message}}this.state.current===t.id&&(this.state.result=l)}clearResult(){this.state.result=null}collapseRequest(){this.rootRef.el.querySelectorAll(".tryit-card details").forEach((t,s)=>{s<3&&(t.open=!1)})}toggleTheme(){this.state.themeOverride=this.theme==="dark"?"light":"dark"}readSystemTheme(){let t=document.documentElement.getAttribute("data-bs-theme"),s=t?t==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches;this.state.systemTheme=s?"dark":"light"}openAuth(){var s;let t=this.state;t.stored.apikey=Ls("apikey"),t.stored.oauthkey=Ls("oauthkey"),t.inputs.apikey=t.stored.apikey,t.inputs.oauthkey=t.stored.oauthkey;for(let{key:o,def:i}of this.authSchemes)(s=t.oauth)[o]??(s[o]={clientId:"",clientSecret:"",username:"",password:"",scopes:Object.keys(i.scopes||{})});t.authOpen=!0}closeAuth(){this.state.authOpen=!1}setAuthOpen(t){this.state.authOpen=t}setAuthInput(t,s){this.state.inputs[t]=s}setField(t,s,o){t[s]=o}saveAuth(){gn("apikey",this.state.inputs.apikey.trim()),gn("oauthkey",this.state.inputs.oauthkey.trim()),this.closeAuth(),this.applyAuthToAll()}clearAuth(t){gn(t,""),this.state.stored[t]="",this.state.inputs[t]="",this.applyAuthToAll()}applyAuthToAll(){for(let[t,s]of Object.entries(this.state.drafts))fi(this.doc.findOperation(t),s);this.state.authed=mi(),this.updateSnippet()}toggleScope(t,s){let o=this.state.oauth[t].scopes,i=o.indexOf(s);i<0?o.push(s):o.splice(i,1)}setOAuthStatus(t,s,o=!1){this.state.oauthStatus[t]={message:s,isError:o}}applyOAuthToken(t,s,o){gn("oauthkey",s),this.state.stored.oauthkey=s,this.state.inputs.oauthkey=s,Object.assign(this.state.oauth[t],{clientId:o.clientId,clientSecret:o.clientSecret}),this.applyAuthToAll(),this.setOAuthStatus(t,"Token acquired.")}async fetchToken(t,s,o){try{let i=await _a(this.doc.securityDefinitions[t].tokenUrl,s,this.selectedBaseUrl,this.doc);this.applyOAuthToken(t,i,o)}catch(i){this.setOAuthStatus(t,`Token request failed: ${i.message}. This is usually a CORS restriction on the auth server.`,!0)}}startOAuth2Flow(t){let s=this.doc.securityDefinitions[t],o=this.state.oauth[t],i=[...o.scopes];if(s.flow==="implicit"||s.flow==="accessCode")return this.openOAuthPopup(t,s,o,i);if(s.flow==="password"||s.flow==="application")return this.setOAuthStatus(t,"Requesting token\u2026"),this.fetchToken(t,$a(s.flow,o,i),o);this.setOAuthStatus(t,`Unsupported OAuth2 flow: ${s.flow}`,!0)}openOAuthPopup(t,s,o,i){if(!s.authorizationUrl)return this.setOAuthStatus(t,"No authorizationUrl defined for this scheme.",!0);let l=Ia(),u=Pa({def:s,clientId:o.clientId,scopes:i,state:l,redirectUri:this.redirectUri,baseUrl:this.selectedBaseUrl,doc:this.doc}),h=window.open(u,`oauth2-authorize-${t}`,"width=560,height=680");if(!h)return this.setOAuthStatus(t,"Popup blocked \u2014 allow popups for this site and try again.",!0);this.pendingOAuth.set(l,{key:t,flow:s.flow,fields:{...o}}),this.setOAuthStatus(t,"Waiting for authorization in the popup\u2026"),this.watchPopup(h,l,t)}watchPopup(t,s,o){let i=setInterval(()=>{t.closed&&(clearInterval(i),this.watchers.delete(i),this.pendingOAuth.delete(s)&&this.setOAuthStatus(o,"Authorization window was closed before completing.",!0))},500);this.watchers.add(i)}get redirectUri(){return this.props.oauthRedirectUri||new URL("oauth2-redirect.html",document.baseURI).href}handleOAuthMessage(t){let s=t.data;if(t.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:i,flow:l,fields:u}=o;if(s.error)return this.setOAuthStatus(i,`Authorization failed: ${s.error}${s.errorDescription?" - "+s.errorDescription:""}`,!0);if(l==="implicit")return s.accessToken?this.applyOAuthToken(i,s.accessToken,u):this.setOAuthStatus(i,"Authorization server did not return an access token.",!0);if(!s.code)return this.setOAuthStatus(i,"Authorization server did not return a code.",!0);this.setOAuthStatus(i,"Exchanging code for token\u2026"),this.fetchToken(i,{grant_type:"authorization_code",code:s.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(Rs,"template","nodexui.ApiDoc"),r(Rs,"components",{ApiDocGroup:Zt,Markdown:Gt,Badge:St,Breadcrumb:Ae,BreadcrumbItem:Ne,BreadcrumbLink:Te,BreadcrumbList:Ee,BreadcrumbPage:Oe,BreadcrumbSeparator:zt,Button:L,Checkbox:ve,Dialog:ue,DialogContent:Dt,DialogDescription:fe,DialogFooter:he,DialogHeader:de,DialogTitle:me,Icon:Y,Input:ie,NativeSelect:xe,TabContent:ce,Tabs:ae,TabsContainer:le,TabsList:pe,TabTrigger:Ut,Textarea:be}),r(Rs,"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])});R();N();function Ei(e,t){if(!e)return null;if(e.type==="file"&&(e.path===t||e.meta?.slug===t))return e;for(let s of e.children||[]){let o=Ei(s,t);if(o)return o}return null}function wu(e){return e.replace(/\.[^./]+$/,"").replace(/[_-]+/g," ").trim().split(/\s+/).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}var Jr=class Jr extends a{get label(){let t=this.props.node.meta;return t?.sidebar_label||t?.title||wu(this.props.node.name)}get hasSubfolders(){return(this.props.node.children||[]).some(t=>t.type==="dir")}select(t){this.props.onSelect(t)}};r(Jr,"template","nodexui.MarkdownTreeNode"),r(Jr,"components",{MarkdownTreeNode:Jr,Icon:Y,SidebarGroupLabel:Be,SidebarMenu:Kt,SidebarMenuItem:Ie,SidebarMenuButton:Ht,DropdownMenu:ye,DropdownMenuTrigger:jt,DropdownMenuContent:we,DropdownMenuItem:Se,DropdownMenuSub:Ce,DropdownMenuSubTrigger:Ft,DropdownMenuSubContent:ke}),r(Jr,"props",{node:{type:Object},activePath:n(String),onSelect:{type:Function},nested:n(Boolean)});var xn=Jr,Bs=class extends a{setup(){this.state=O({tree:null,status:"loading",error:""}),Tt(()=>this.load())}async load(){this.state.status="loading",this.state.error="";try{let t=await fetch(this.props.src);if(!t.ok)throw new Error(`${t.status} ${t.statusText}`);this.state.tree=await t.json(),this.state.status="ready"}catch(t){this.state.status="error",this.state.error=t.message||String(t)}}};r(Bs,"template","nodexui.MarkdownTree"),r(Bs,"components",{MarkdownTreeNode:xn,SidebarGroup:Re,SidebarMenu:Kt}),r(Bs,"props",{src:{type:String},activePath:n(String),onSelect:{type:Function},className:n(String),style:n([String,Object])});R();function Ja(e=document.querySelector("[b-block-code-template]")){let o=((e?.tagName==="SCRIPT"?e.textContent:e?.innerHTML)?.replace(/^\n/,"").replace(/\s+$/,"")||"").split(`
43
- `),i=o.filter(u=>u.trim()).map(u=>u.match(/^\s*/)?.[0].length||0),l=i.length?Math.min(...i):0;return o.map(u=>u.slice(l)).join(`
44
- `)}function Ya(e,t=0){let s=" ".repeat(t),o=[];for(let i of e.childNodes){if(i.nodeType===Node.TEXT_NODE){let h=i.textContent.trim();h&&o.push(`${s}${h}`);continue}if(i.nodeType!==Node.ELEMENT_NODE)continue;let l=[...i.attributes].map(h=>` ${h.name}="${h.value}"`).join("");if(![...i.childNodes].some(h=>h.nodeType===Node.ELEMENT_NODE||h.nodeType===Node.TEXT_NODE&&h.textContent.trim())){o.push(`${s}<${i.localName}${l}>${i.textContent.trim()}</${i.localName}>`);continue}o.push(`${s}<${i.localName}${l}>`),o.push(...Ya(i,t+1)),o.push(`${s}</${i.localName}>`)}return o}async function Qa(e){if(!e?.trim())return"";let{expandSelfClosingTags:t,extractTagCaseMap:s,normalizeOwlPreviewMarkup:o}=await Promise.resolve().then(()=>(di(),ka)),i=document.createElement("div");return i.innerHTML=t(e),o(i,s(e)),Ya(i).join(`
45
- `)}function Xa(e){e.querySelectorAll('[b-block="dashboard-01"], [b-block^="sidebar-"]').forEach(t=>{let s=t.querySelector("[b-block-sidebar-toggle], button[aria-label='Toggle sidebar']"),o=t.querySelector("[b-block-sidebar]");!s||!o||(t.setAttribute("b-att-sidebar",t.getAttribute("b-att-sidebar")||"open"),s.setAttribute("b-block-sidebar-toggle",""),s.setAttribute("aria-expanded",t.getAttribute("b-att-sidebar")==="open"?"true":"false"),s.addEventListener("click",()=>{let i=t.getAttribute("b-att-sidebar")!=="open";t.setAttribute("b-att-sidebar",i?"open":"collapsed"),s.setAttribute("aria-expanded",i?"true":"false")}))}),e.querySelectorAll('[b-block^="sidebar-"] [b-block-subnav]').forEach(t=>{let s=t.previousElementSibling;s&&(s.setAttribute("b-block-subnav-toggle",""),s.setAttribute("aria-expanded","true"),t.setAttribute("b-att-state","open"),s.addEventListener("click",o=>{o.preventDefault();let i=t.getAttribute("b-att-state")!=="open";t.setAttribute("b-att-state",i?"open":"collapsed"),s.setAttribute("aria-expanded",i?"true":"false")}))})}N();var Un=fn({storageKey:"b-example-theme",toggleSelector:"",labelSelector:""}),Su=[{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"}],Cu={desktop:"",tablet:"768px",mobile:"390px"},ku="/dist/icons/lucide";function Au(){return document.querySelector("[b-block-code-template]")}function Eu(e){return e.match(/<templates[^>]*>([\s\S]*)<\/templates>/)?.[1]||e}function Nu(e){for(let t of e.querySelectorAll?.("[b-block] [b-icon], [b-block] [b-ui='icon']")||[])!t.hasAttribute("b-icon-base-url")&&!t.hasAttribute("b-att-base-url")&&t.setAttribute("b-icon-base-url",ku)}var Jt=class extends a{setup(){this.navItems=this.props.navItems||Su,this.previewFrame=B("previewFrame"),this.embedRoot=B("embedRoot"),this.code=Ja(),this.state=O({mode:"preview",viewport:"desktop",copyLabel:"Copy code",embed:new URLSearchParams(globalThis.location.search).get("embed")==="1",codeVariant:"owl",staticTemplate:"",staticTemplateStatus:"idle"}),J(()=>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(t){if(this.state.codeVariant=t,t==="template"&&this.state.staticTemplateStatus==="idle"){this.state.staticTemplateStatus="loading";let s=await Qa(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 t=Cu[this.state.viewport]||"";return t?`max-width:${t}`:""}setMode(t){this.state.mode=t}setViewport(t){this.state.viewport=t}async copyCode(){await globalThis.navigator?.clipboard?.writeText(this.activeCode),this.state.copyLabel="Copied"}mountPreview(){this.state.embed&&(document.body.className="m-0");let t=this.state.embed?this.embedRoot.el:this.previewFrame.el,s=Au();if(!(!t||!s)){if(s.tagName==="SCRIPT"){this.mountOwlPreview(t,s);return}t.replaceChildren(s.content.cloneNode(!0)),this.mountStaticNodexUI(t),Xa(t)}}async mountOwlPreview(t,s){t.replaceChildren();class o extends a{setup(){this.state=O({collapsed:!1})}}r(o,"template","examples.SidebarBlock");let i=[await De("/dist/nodexui.templates.xml"),s.textContent].map(Eu).join(`
46
- `);await Ds(o,t,{templates:`<templates>${i}</templates>`}),Un.set(Un.current(),{skipStorage:!0})}mountStaticNodexUI(t=document){Nu(t),globalThis.thebase?.mountAll(t),Un.set(Un.current(),{skipStorage:!0})}};r(Jt,"template","nodexui.BlockViewer"),r(Jt,"components",{Button:L,Icon:Y,ThemeButton:Vt}),r(Jt,"props",{navItems:n(Array)});R();N();var Yr=class extends a{setup(){this.pwaState=O({open:it(this.props)}),z({pwa:this.pwaState,setPwaOpen:t=>this.setOpen(t)}),ft(this.pwaState)}setOpen(t){gt(this.props,this.pwaState,t)}};r(Yr,"template","nodexui.Pwa"),r(Yr,"props",{open:n(Boolean),"default-open":n(Boolean),defaultOpen:n(Boolean),onOpenChange:n(Function),slots:n(Object)});var Is=class extends a{onClick(){this.env.setPwaOpen(!0)}};r(Is,"template","nodexui.PwaTrigger"),r(Is,"components",{Button:L}),r(Is,"props",p);var Qr=class extends a{setup(){this.rootRef=B("root"),vt(t=>{if(!t)return;let s=document.activeElement;return hn(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.pwa.open])}get open(){return this.env.pwa.open}onKeyDown(t){t.key==="Escape"&&this.env.setPwaOpen(!1)}onBackdropClick(t){t.target===this.rootRef.el&&this.env.setPwaOpen(!1)}};r(Qr,"template","nodexui.PwaContent"),r(Qr,"props",p);var Xr=class extends a{};r(Xr,"template","nodexui.PwaHeader"),r(Xr,"props",p);var tn=class extends a{};r(tn,"template","nodexui.PwaTitle"),r(tn,"props",p);var en=class extends a{};r(en,"template","nodexui.PwaDescription"),r(en,"props",p);var sn=class extends a{};r(sn,"template","nodexui.PwaBody"),r(sn,"props",p);var on=class extends a{get steps(){return Array.isArray(this.props.steps)?this.props.steps:[]}};r(on,"template","nodexui.PwaSteps"),r(on,"props",{...p,steps:n(Array)});var rn=class extends a{};r(rn,"template","nodexui.PwaFooter"),r(rn,"props",p);var Ps=class extends a{onClick(){this.env.setPwaOpen(!1)}};r(Ps,"template","nodexui.PwaClose"),r(Ps,"components",{Button:L}),r(Ps,"props",p);R();N();var tl="",el="";function sl(e,t){return typeof e=="string"?e:t}function Tu(e){return{title:e.submitted&&e.title.trim().length>0&&e.title.trim().length<5?"Bug title must be at least 5 characters.":"",description:e.submitted&&e.description.length>0&&e.description.length<20?"Description must be at least 20 characters.":""}}var _s=class extends a{setup(){this.state=O({title:sl(this.props.title,tl),description:sl(this.props.description,el),submitted:!1})}get classNames(){return m("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 Tu(this.state)}get titleInvalid(){return!!this.errors.title}get descriptionInvalid(){return!!this.errors.description}reset(){this.state.title=tl,this.state.description=el,this.state.submitted=!1}submit(t){t.preventDefault(),this.state.submitted=!0,!this.titleInvalid&&!this.descriptionInvalid&&this.props.onSubmit?.({title:this.state.title.trim(),description:this.state.description})}};r(_s,"template","nodexui.Form"),r(_s,"components",{Button:L,Field:_e,FieldDescription:Me,FieldError:Ue,FieldGroup:Pe,FieldLabel:$e}),r(_s,"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)});R();N();var Ni;function Ou(){return Ni??(Ni=import("./runtime/milkdown/milkdown-text-editor.js")),Ni}async function ol(e){return(await Ou()).createMilkdownTextEditor(e)}function rl({collaborative:e,providerType:t,url:s}={}){return!!e||!!(t&&s)}var nn=class extends a{setup(){this.editorRef=B("editor"),this.editorHandle=null,this.mountPromise=null,this.mountToken=0,this.isDestroyed=!1,this.state=O({content:"",status:"loading",error:""}),Tt(()=>this.load(this.props)),lt(t=>{if(this.shouldReload(t))return this.load(t);this.shouldRestartEditor(t)&&this.destroyEditor()}),J(()=>this.mountEditor()),rt(()=>this.mountEditor()),je(()=>{this.isDestroyed=!0,this.destroyEditor()})}get classNames(){return m("b-text-editor",this.props.className)}get isCollaborative(){return rl({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(t){return t.content!==this.props.content||t.src!==this.props.src}shouldRestartEditor(t){return t.collaborative!==this.props.collaborative||t.provider!==this.props.provider||t.room!==this.props.room||t.url!==this.props.url||t.password!==this.props.password||t.signaling!==this.props.signaling}async load(t){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=t.content??"";if(t.src)try{let o=await fetch(t.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 t=this.editorRef.el;if(this.isDestroyed||!t||this.editorHandle||this.mountPromise||this.state.status!=="ready")return;let s=++this.mountToken;return this.mountPromise=(async()=>{try{let o=await ol({root:t,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,l,u)=>{this.state.content=i,this.props.onChange?.(i,l,u)}});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(nn,"template","nodexui.TextEditor"),r(nn,"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])});Pi(Ti);R();Vn();function Lu(e){let t=De("/dist/nodexui.templates.xml").then(s=>Ds(Jt,e,{templates:s}));return{destroy:async()=>{(await t).destroy()}}}_t.register("block-viewer",{type:"owl",mount:Lu});_t.mountAll(document);