var GNexusUIKit=(()=>{var H=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var ve=Object.prototype.hasOwnProperty;var ge=(e,t)=>{for(var a in t)H(e,a,{get:t[a],enumerable:!0})},ye=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of he(t))!ve.call(e,i)&&i!==a&&H(e,i,{get:()=>t[i],enumerable:!(n=pe(t,i))||n.enumerable});return e};var be=e=>ye(H({},"__esModule",{value:!0}),e);var pt={};ge(pt,{Accordion:()=>q,Drawer:()=>O,Helper:()=>m,InputPatterns:()=>$,Modals:()=>g,NavigationShell:()=>x,Overlays:()=>A,Tabs:()=>N,Toasts:()=>C,advancedSelect:()=>b,confirmPopup:()=>S,default:()=>mt,editableString:()=>E});function Ee(e){let t="";for(let a of e){let n="",i="";a.route&&(n=`<a class="list-action" href="${a.route}">`,i="</a>"),t+=`
			<li class="list-item ${a.is_active?"list-item-active":""}">
				${n}${a.content}${i}
			</li>
		`}return`
		<div class="sidebar block">
			<ul class="list list-nav">
				${t} 
			</ul>
		</div>
	`}function Se(e,t,a,n){let i='<tr class="table-row">',s=0;for(let d in t)i+=`<th scope="col">${t[d]}</th>`,s++;i+="</tr>";let l="";for(let d of a){l+='<tr class="table-row">';for(let f in t)l+=`<td>${d[f]}</td>`;l+="</tr>"}let r="";typeof n!="undefined"&&(r=`
			<tfoot class="table-foot">
				<tr class="table-row">
					<td colspan="${s}">
						${n}
					</td>
				</tr>
			</tfoot>
		`);let o=e?`<caption class="table-caption">${e}</caption>`:"",c=a.length?`<thead class="table-head">${i}</thead>`:"";return l=a.length?l:'<tr><td class="is-empty">Empty</td></tr>',`
		<div class="table-wrapper">
			<table class="table data-list ${a.length?"":"table-empty"}">
				${o}
				${c}
				<tbody class="table-body">${l}</tbody>
				${r}
			</table>
		</div>
	`}function Y(e,t,a){let n=document.createElement(e);for(let[i,s]of Object.entries(t))i==="class"?n.className=s:i==="dataset"?Object.assign(n.dataset,s):n.setAttribute(i,s);return n.innerHTML=typeof a!="undefined"?a:"",n}function Le(e,t){return["primary","success","secondary","info","warning","error","danger"].indexOf(e)<0?console.error("createAlert()","Error of type: "+e):Y("div",{class:`alert alert-${e}`},t)}function we(e,t={}){let a={};for(let n in e){if(typeof t[n]!="undefined"){a[t[n]]=e[n];continue}a[n]=e[n]}return a}function xe(e,t){if((e==null?void 0:e.isLoading)==t)return!1;if(t)e.isLoading=!0,e.originalContent=e.innerHTML,e.classList.contains("with-icon")?e.originalWithIcon=!0:e.classList.add("with-icon"),e.classList.add("loading-state"),e.setAttribute("disabled","disabled"),e.innerHTML='<i class="ph ph-bold ph-spinner"></i> Loading';else{if(e.isLoading=!1,!e.originalContent)return!1;e.removeAttribute("disabled"),e.classList.remove("loading-state"),e.originalWithIcon||e.classList.remove("with-icon"),e.innerHTML=e.originalContent}return e}function Ae(e,t){if((e==null?void 0:e.isLoading)==t)return!1;let a=e.querySelector(".status-icon");if(t)e.isLoading=!0,e.originalContent=a.innerHTML,e.classList.add("loading-state"),e.setAttribute("disabled","disabled"),a.innerHTML='<i class="ph ph-bold ph-spinner"></i>';else{if(e.isLoading=!1,!e.originalContent)return!1;e.removeAttribute("disabled"),e.classList.remove("loading-state"),a.innerHTML=e.originalContent}return e}function ke(e,t){return t=t!=null?t:"",`
		<div class="container">
			<div class="row adaptive g-6">
				<div class="col sidebar-container">
					${e}
				</div>
				<div class="col main-container w-100">
					${t}
				</div>
			</div>
		</div>
	`}function $e(e){return e=="active"?'<span class="badge badge-success">Online</span>':'<span class="badge badge-warning">Offline</span>'}function qe(e){return e=="enabled"?'<span class="badge badge-success">Enabled</span>':'<span class="badge badge-primary">Disabled</span>'}function Te(e){let t=new Date(e.replace(" ","T")),n=Math.floor((new Date-t)/1e3);if(n<60)return"less than a minute ago";let i=Math.floor(n/60),s=Math.floor(i/60),l=Math.floor(s/24);if(i<60)return`${i} minute${i!==1?"s":""} ago`;if(s<24){let r=i%60;return`${s} hour${s!==1?"s":""} ${r} minute${r!==1?"s":""} ago`}return`${l} day${l!==1?"s":""} ago`}function Ne(e){let t=new Date(e.replace(" ","T")),a=new Date,n=new Date(a.getFullYear(),a.getMonth(),a.getDate()),i=new Date(t.getFullYear(),t.getMonth(),t.getDate()),s=Math.floor((n-i)/864e5),l=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0");if(s===0)return`Today at ${l}:${r}`;if(s===1)return`Yesterday at ${l}:${r}`;let o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return`${t.getDate()} ${o[t.getMonth()]} ${t.getFullYear()} at ${l}:${r}`}function He(){return`
		<div class="circle-loader">
			<i class="ph ph-bold ph-spinner normalize"></i>
			Loading
		</div>
	`}function Ce(){return`
		<div class="empty-here">
			<div class="icon"><i class="ph ph-placeholder normalize"></i></div>
			<p class="text-msg">It's empty here yet</p>
		</div>
	`}var m={template:{sidebarNav:Ee,table:Se,createElement:Y,createAlert:Le,mainTemplate:ke,connectionStatusBadge:$e,toogleStateBadge:qe,circleLoaderHTML:He,emptyHereHTML:Ce},unification:{fieldsUnification:we,timeAgo:Te,formatDate:Ne},states:{btnLoadingState:xe,cardStatusLoadingState:Ae}};function Me(e,t){if(t instanceof Node){e.append(t);return}let a=document.createElement("span");a.innerHTML=t,e.append(...a.childNodes)}function De(e,t,a,n){let i=document.createElement("div");i.className=`toast toast-${e}`,i.setAttribute("role","alert");let s=document.createElement("div");s.className="toast-content";let l=document.createElement("h4");l.className="toast-title",Me(l,t),l.append(document.createTextNode(` ${a!=null?a:""}`));let r=document.createElement("p");r.className="toast-text",r.textContent=n!=null?n:"";let o=document.createElement("button");return o.className="btn-icon toast-close",o.type="button",o.setAttribute("aria-label","Close"),o.textContent="\u2715",s.append(l,r),i.append(s,o),i}function Oe(e,t){if(t!=null&&t.alone&&document.querySelectorAll(".toast").forEach(a=>{var n;return(n=a.close)==null?void 0:n.call(a)}),e.close=function(){this.classList.add("a-hide"),setTimeout(()=>{this.remove()},300)},e.querySelector(".toast-close").addEventListener("click",a=>{e.close()}),e.show=function(){document.querySelector("body").append(e),setTimeout(()=>{e.classList.add("a-show")},10)},e.addEventListener("mouseover",a=>e.ishovered=!0),e.addEventListener("mouseout",a=>e.ishovered=!1),t!=null&&t.lifetime){let a=setInterval(()=>{e.ishovered||(e.close(),clearInterval(a))},t==null?void 0:t.lifetime)}return e}function v(e,t,a,n,i){return Oe(De(e,t,a,n),i)}function Fe(e,t,a){return typeof a=="undefined"&&(a={}),typeof a.lifetime=="undefined"&&(a.lifetime=4e3),typeof a.alone=="undefined"&&(a.alone=!0),v("success",'<i class="ph ph-check-circle"></i>',e,t,a)}function Ie(e,t,a){return v("info",'<i class="ph ph-info"></i>',e,t,a)}function je(e,t,a){return v("warning",'<i class="ph ph-warning"></i>',e,t,a)}function _(e,t,a){return v("danger",'<i class="ph ph-warning-octagon"></i>',e,t,a)}var C={create:v,createInfo:Ie,createSuccess:Fe,createWarning:je,createError:_,createDanger:_};function y(e,t,a="html"){if(t instanceof Node){e.append(t);return}typeof t!="undefined"&&t!==null&&(a==="text"?e.textContent=t:e.innerHTML=t)}function Re(e,t,a,n={}){var V;let i=document.createElement("div");i.className="modal",i.setAttribute("aria-hidden","true"),i.id=e;let s=document.createElement("div");s.className="modal-backdrop";let l=document.createElement("div");l.className="modal-dialog",l.setAttribute("role","dialog"),l.setAttribute("aria-modal","true"),l.setAttribute("aria-labelledby",`${e}-title`);let r=document.createElement("div");r.className="modal-panel";let o=document.createElement("header");o.className="modal-header";let c=document.createElement("h4");c.className="modal-title",c.id=`${e}-title`,c.textContent=t;let u=document.createElement("button");u.className="btn-icon modal-close",u.type="button",u.setAttribute("aria-label","Close"),u.textContent="\u2715";let d=document.createElement("div");d.className="modal-body";let f=document.createElement("footer");return f.className="modal-footer",y(f,a,(V=n.footerMode)!=null?V:"html"),o.append(c,u),r.append(d,f),l.append(o,r),i.append(s,l),i}function Be(e,t){return e.show=function(){document.querySelector("body").append(e),setTimeout(()=>{e.classList.add("a-show")},10)},e.close=function(){e.classList.add("a-hide"),setTimeout(()=>{e.remove()},300)},e.querySelector(".modal-close").addEventListener("click",a=>{e.close()}),typeof t=="function"&&t(e),e}function Ue(e,t){var r;t=t!=null?t:{};let a=t.title||"",n=t.footer||"",i=Re(e,a,n,t),s=i.querySelector(".modal-body"),l=i.querySelector(".modal-footer");if(typeof t.actions=="function"){let o=t.actions(i);if(Array.isArray(o)&&o[0]instanceof Node){let c=document.createElement("div");c.classList.add("actions");for(let u of o)c.append(u);l.append(c)}else o instanceof Node&&l.append(o)}if(typeof t.body=="function"){let o=t.body(i);y(s,o,(r=t.bodyMode)!=null?r:"html")}else typeof t.bodyText!="undefined"?y(s,t.bodyText,"text"):typeof t.bodyHtml!="undefined"&&y(s,t.bodyHtml,"html");return Be(i,t==null?void 0:t.onready)}var g={create:Ue};function K(e){let t=e.querySelector(".focus");if(!t)return;let a=e.getBoundingClientRect(),n=t.getBoundingClientRect();n.top<a.top?e.scrollTop-=a.top-n.top:n.bottom>a.bottom&&(e.scrollTop+=n.bottom-a.bottom)}function M(e){e.advancedSelect.optionsElements.length-e.querySelectorAll(".option.hide").length==0?e.advancedSelect.showState("not-found"):e.advancedSelect.showState("options")}function D(e){return e.querySelector(".option:not(.hide)")}function We(e){return e.querySelector(".option:not(.hide):last-child")}function J(e,t,a){a&&(e.value=a.dataset.displayValue,e.blur(),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),t.advancedSelect.dispatchEvent("selected"),t.advancedSelect.closeList())}function b(e,t,a){let n=document.createElement("div");n.classList.add("advanced-select");let i=document.createElement("div");i.className="popup-options-container";let s=document.createElement("div");s.className="not-found",s.textContent=a!=null?a:"Nothing found";let l=document.createElement("div");l.className="options";for(let o in t){let c=document.createElement("div");c.className="option",c.dataset.value=o,c.dataset.displayValue=t[o],c.textContent=t[o],l.append(c)}i.append(s,l),n.append(i);let r=(o,c)=>{for(let u in c)if(c[u]==o){let d={};return d[u]=c[u],d}return!1};return n.advancedSelect={isOpened:!1,options:t,eventsHandlers:{openList:[],closeList:[],selected:[],changed:[]},openList:()=>{n.advancedSelect.isOpened=!0,n.classList.add("a-show"),M(n),n.advancedSelect.dispatchEvent("openList")},closeList:()=>{n.advancedSelect.isOpened=!1,n.classList.remove("a-show"),M(n),n.advancedSelect.dispatchEvent("closeList")},showState:o=>{o=="options"?(n.querySelector(".options").classList.add("show"),n.querySelector(".not-found").classList.remove("show")):o=="not-found"&&(n.querySelector(".options").classList.remove("show"),n.querySelector(".not-found").classList.add("show"))},optionsElements:n.querySelectorAll(".option"),value:()=>{let o=r(e.value,t);return{inputValue:e.value,isOption:!!o,option:o}},addEventListener:(o,c)=>{if(typeof n.advancedSelect.eventsHandlers[o]!="undefined")return n.advancedSelect.eventsHandlers[o].push(c);console.error("Advanced Select component.","addEventListener()","Invalid event name")},dispatchEvent:o=>{if(typeof n.advancedSelect.eventsHandlers[o]=="undefined")return console.error("Advanced Select component.","dispatchEvent()","Invalid event name");for(let c of n.advancedSelect.eventsHandlers[o])c(n)}},e.setAttribute("autocomplete","nope"),e.advancedSelect={value:()=>n.advancedSelect.value()},e.addEventListener("focus",o=>{n.advancedSelect.openList()}),e.addEventListener("blur",o=>{requestAnimationFrame(()=>{n.matches(":hover")||n.advancedSelect.closeList()})}),e.addEventListener("keydown",o=>{var c,u;if(o.key==="ArrowUp"){o.preventDefault();let d=n.querySelector(".option.focus");if(d){d.classList.remove("focus");let f=d.previousElementSibling;for(;f&&f.classList.contains("hide");)f=f.previousElementSibling;f||(f=D(n)),f==null||f.classList.add("focus")}else(c=We(n))==null||c.classList.add("focus");K(n)}else if(o.key==="ArrowDown"){o.preventDefault();let d=n.querySelector(".option.focus");if(d){d.classList.remove("focus");let f=d.nextElementSibling;for(;f&&f.classList.contains("hide");)f=f.nextElementSibling;f||(f=D(n)),f==null||f.classList.add("focus")}else(u=D(n))==null||u.classList.add("focus");K(n)}else if(o.key==="Enter"){o.preventDefault();let d=n.querySelector(".option.focus");J(e,n,d)}else o.key==="Escape"&&(n.advancedSelect.closeList(),e.blur())}),e.addEventListener("input",o=>{var u;let c=o.currentTarget.value.toLowerCase();c==""?n.advancedSelect.optionsElements.forEach(d=>d.classList.remove("hide")):([...n.advancedSelect.optionsElements].filter(d=>d.dataset.displayValue.toLowerCase().indexOf(c)!=-1).forEach(d=>d.classList.remove("hide")),[...n.advancedSelect.optionsElements].filter(d=>d.dataset.displayValue.toLowerCase().indexOf(c)==-1).forEach(d=>d.classList.add("hide")),M(n),(u=n.querySelector(".option.focus"))==null||u.classList.remove("focus"))}),e.addEventListener("change",o=>{n.advancedSelect.dispatchEvent("changed")}),[...n.advancedSelect.optionsElements].forEach(o=>{o.addEventListener("pointerdown",c=>{c.preventDefault(),J(e,n,c.currentTarget)})}),n}function ze(e,t){let a="Write something",n=t?`<textarea class="input" placeholder="${a}"></textarea>`:`<input type="text" class="input" placeholder="${a}">`;return`
		<div class="editable-string-content">
			<span class="editable-string">${e}</span>
			<button class="btn-icon without-hover edit-text-btn"><i class="ph ph-pencil-simple"></i></button>
		</div>
		<div class="editable-string-form d-none">
			<div class="form-group">
				<label class="label">
					${n}
				</label>
			</div>
			<button class="btn-icon without-hover apply-changes-btn"><i class="ph ph-check"></i></button>
			<button class="btn-icon without-hover cancel-changes-btn"><i class="ph ph-x"></i></button>
		</div>
	`}function E(e,t){t=t!=null?t:!1;let a=e.innerHTML,n=m.template.createElement("div",{class:"component editable-string-component"},ze(a,t));e.innerHTML="",e.append(n);let i=n.querySelector(".edit-text-btn"),s=n.querySelector(".apply-changes-btn"),l=n.querySelector(".cancel-changes-btn"),r=n.querySelector(".editable-string-content"),o=n.querySelector(".editable-string"),c=n.querySelector(".editable-string-form"),u=n.querySelector(".input");return n.editableString={formIsDisplaying:!1,value:a,input:u,eventsHandlers:{onChange:[],onSwitch:[]},switch:()=>{n.formIsDisplaying?(c.classList.add("d-none"),r.classList.remove("d-none"),o.innerText=n.editableString.value):(c.classList.remove("d-none"),r.classList.add("d-none"),u.value=n.editableString.value),n.formIsDisplaying=!n.formIsDisplaying,n.editableString.runEventHandler("onSwitch")},setValue:d=>{n.editableString.value=d,u.value=d,o.innerText=d},apply:()=>{n.editableString.value=u.value,n.editableString.switch(),u.value!=a&&n.editableString.runEventHandler("onChange")},onChange:d=>{n.editableString.eventsHandlers.onChange.push(d)},onSwitch:d=>{n.editableString.eventsHandlers.onSwitch.push(d)},runEventHandler:d=>{n.editableString.eventsHandlers[d].forEach(f=>f(n.editableString))}},i.addEventListener("click",d=>{n.editableString.switch()}),l.addEventListener("click",d=>{n.editableString.switch()}),s.addEventListener("click",d=>{n.editableString.apply()}),u.addEventListener("keydown",d=>{d.key==="Enter"&&(u.blur(),n.editableString.apply())}),n}function S(e,t,a){g.create("confirm-popup",{title:"Requires confirmation",body:()=>{let n=document.createElement("p");return n.textContent=e!=null?e:"",n},actions:n=>{let i=m.template.createElement("button",{class:"btn btn-primary"},"NO"),s=m.template.createElement("button",{class:"btn btn-warning"},"YES");return i.addEventListener("click",l=>{n.close(),a==null||a()}),s.addEventListener("click",l=>{n.close(),t==null||t()}),[i,s]}}).show()}function L(e,t,a="html"){if(t instanceof Node){e.append(t);return}typeof t!="undefined"&&t!==null&&(a==="text"?e.textContent=t:e.innerHTML=t)}function Pe(e,t,a,n={}){var f;let i=document.createElement("div");i.className="drawer",i.setAttribute("aria-hidden","true"),i.id=e,n.position==="left"&&i.classList.add("drawer-left");let s=document.createElement("div");s.className="drawer-backdrop";let l=document.createElement("aside");l.className="drawer-panel",l.setAttribute("role","dialog"),l.setAttribute("aria-modal","true"),l.setAttribute("aria-labelledby",`${e}-title`);let r=document.createElement("header");r.className="drawer-header";let o=document.createElement("h4");o.className="drawer-title",o.id=`${e}-title`,o.textContent=t;let c=document.createElement("button");c.className="btn-icon drawer-close",c.type="button",c.setAttribute("aria-label","Close"),c.textContent="\u2715";let u=document.createElement("div");u.className="drawer-body";let d=document.createElement("footer");return d.className="drawer-footer",L(d,a,(f=n.footerMode)!=null?f:"html"),r.append(o,c),l.append(r,u,d),i.append(s,l),i}function Ve(e,t){return e.show=function(){document.querySelector("body").append(e),setTimeout(()=>{e.classList.add("a-show")},10)},e.close=function(){e.classList.add("a-hide"),setTimeout(()=>{e.remove()},300)},e.querySelector(".drawer-close").addEventListener("click",()=>{e.close()}),e.querySelector(".drawer-backdrop").addEventListener("click",()=>{e.close()}),typeof t=="function"&&t(e),e}function Ye(e,t){var r;t=t!=null?t:{};let a=t.title||"",n=t.footer||"",i=Pe(e,a,n,t),s=i.querySelector(".drawer-body"),l=i.querySelector(".drawer-footer");if(typeof t.actions=="function"){let o=t.actions(i);if(Array.isArray(o)&&o[0]instanceof Node){let c=document.createElement("div");c.classList.add("actions");for(let u of o)c.append(u);l.append(c)}else o instanceof Node&&l.append(o)}if(typeof t.body=="function"){let o=t.body(i);L(s,o,(r=t.bodyMode)!=null?r:"html")}else typeof t.bodyText!="undefined"?L(s,t.bodyText,"text"):typeof t.bodyHtml!="undefined"&&L(s,t.bodyHtml,"html");return Ve(i,t==null?void 0:t.onready)}var O={create:Ye};var G=new WeakSet;function _e(e,t){var n,i;let a=e.getAttribute("aria-controls");return a?((n=t.getElementById)==null?void 0:n.call(t,a))||document.getElementById(a):((i=t.querySelector)==null?void 0:i.call(t,"[data-navigation-drawer]"))||document.querySelector("[data-navigation-drawer]")}function Z(e,t){var n;if(!e)return;e.classList.add("is-open"),e.setAttribute("aria-hidden","false"),e.removeAttribute("inert"),t==null||t.setAttribute("aria-expanded","true"),document.body.classList.add("nav-drawer-open");let a=e.querySelector("[data-navigation-close], a, button, input, select, textarea");(n=a==null?void 0:a.focus)==null||n.call(a)}function w(e,t,a=!0){var n;e&&(e.classList.remove("is-open"),e.setAttribute("aria-hidden","true"),e.setAttribute("inert",""),t==null||t.setAttribute("aria-expanded","false"),document.body.classList.remove("nav-drawer-open"),a&&((n=t==null?void 0:t.focus)==null||n.call(t)))}function Ke(e=document){G.has(e)||(e.addEventListener("click",t=>{let a=t.target.closest("[data-navigation-toggle]");if(!a)return;let n=_e(a,e);n!=null&&n.classList.contains("is-open")?w(n,a):Z(n,a)}),e.addEventListener("click",t=>{let a=t.target.closest("[data-navigation-close], [data-navigation-link], .nav-drawer .list-action");if(!a)return;let n=a.closest("[data-navigation-drawer]")||e.querySelector("[data-navigation-drawer]"),i=n!=null&&n.id?e.querySelector(`[data-navigation-toggle][aria-controls="${n.id}"]`):e.querySelector("[data-navigation-toggle]"),s=!a.matches("[data-navigation-link]");w(n,i,s)}),document.addEventListener("keydown",t=>{t.key==="Escape"&&e.querySelectorAll("[data-navigation-drawer].is-open").forEach(a=>{let n=a.id?e.querySelector(`[data-navigation-toggle][aria-controls="${a.id}"]`):e.querySelector("[data-navigation-toggle]");w(a,n)})}),G.add(e))}var x={init:Ke,open:Z,close:w};var Q=new WeakSet,X=!1;function Je(e){e.classList.remove("is-open"),e.querySelectorAll("[aria-expanded='true']").forEach(t=>{t.setAttribute("aria-expanded","false")})}function p(e=null){document.querySelectorAll(".dropdown.is-open, .popover.is-open, .tooltip.is-open").forEach(t=>{t!==e&&Je(t)})}function Ge(e=document){e.addEventListener("click",t=>{let a=t.target.closest("[data-dropdown-toggle]");if(!a)return;let n=a.closest(".dropdown");if(!n)return;t.preventDefault();let i=n.classList.contains("is-open");p(n),n.classList.toggle("is-open",!i),a.setAttribute("aria-expanded",String(!i))})}function Ze(e=document){e.addEventListener("click",t=>{let a=t.target.closest("[data-popover-toggle]");if(!a)return;let n=a.closest(".popover");if(!n)return;t.preventDefault();let i=n.classList.contains("is-open");p(n),n.classList.toggle("is-open",!i),a.setAttribute("aria-expanded",String(!i))})}function Qe(e=document){e.addEventListener("click",t=>{let a=t.target.closest("[data-tooltip-toggle]");if(!a)return;let n=a.closest(".tooltip");if(!n)return;t.preventDefault();let i=n.classList.contains("is-open");p(n),n.classList.toggle("is-open",!i)})}function Xe(e=document){e.addEventListener("click",t=>{t.target.closest(".dropdown, .popover, .tooltip")||p()}),X||(document.addEventListener("keydown",t=>{t.key==="Escape"&&p()}),X=!0)}function et(e=document){Q.has(e)||(Ge(e),Ze(e),Qe(e),Xe(e),Q.add(e))}var A={init:et,closeAll:p};var ee=new WeakSet,ae=new WeakMap;function te(e){return`${e.name}:${e.size}:${e.lastModified}`}function ie(e){e&&(e.querySelectorAll("img[data-object-url]").forEach(t=>{URL.revokeObjectURL(t.dataset.objectUrl)}),e.innerHTML="",e.hidden=!0)}function F(e){return ae.get(e)||[]}function I(e,t){ae.set(e,t);let a=new DataTransfer;t.forEach(n=>a.items.add(n)),e.files=a.files}function tt(e,t){let a=F(e),n=new Set(a.map(te)),i=[...a];return t.forEach(s=>{let l=te(s);n.has(l)||(n.add(l),i.push(s))}),I(e,i),i}function nt(e,t){let a=F(e).filter((n,i)=>i!==t);return I(e,a),a}function ne(e){let t=e.name.split("."),a=t.length>1?t.pop().trim():"";return a?a.slice(0,6).toUpperCase():e.type?e.type.split("/").pop().slice(0,6).toUpperCase():"FILE"}function at(e){if(!Number.isFinite(e))return"";if(e===0)return"0 B";let t=["B","KB","MB","GB"],a=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1),n=e/Math.pow(1024,a);return`${n.toFixed(n>=10||a===0?0:1)} ${t[a]}`}function k(e){let t=e.closest(".file-upload-panel, .file-upload"),a=t==null?void 0:t.querySelector("[data-file-upload-preview]");if(!t||!a)return;let n=F(e);if(!n.length){ie(a);return}it(a,n)}function it(e,t){e&&(ie(e),t.forEach((a,n)=>{let i=document.createElement("figure");i.className="file-upload-preview-item",i.dataset.fileUploadIndex=String(n);let s=document.createElement("div");if(s.className="file-upload-preview-visual",a.type.startsWith("image/")){let u=document.createElement("img"),d=URL.createObjectURL(a);u.src=d,u.dataset.objectUrl=d,u.alt="",u.loading="lazy",s.append(u)}else{let u=document.createElement("span");u.className="file-upload-preview-type",u.textContent=ne(a),s.append(u)}let l=document.createElement("figcaption"),r=document.createElement("span");r.className="file-upload-preview-name",r.textContent=a.name;let o=document.createElement("span");o.className="file-upload-preview-meta",o.textContent=`${ne(a)} / ${at(a.size)}`;let c=document.createElement("button");c.className="file-upload-preview-remove",c.type="button",c.dataset.fileUploadRemove=String(n),c.setAttribute("aria-label",`Remove ${a.name}`),c.innerHTML='<i class="ph ph-x"></i>',l.append(r,o),i.append(c,s,l),e.append(i)}),e.hidden=!1)}function ot(e=document){ee.has(e)||(e.addEventListener("click",t=>{let a=t.target.closest("[data-input-clear]");if(!a)return;let n=a.closest(".input-group"),i=n==null?void 0:n.querySelector("input, textarea");i&&(i.value="",i.dispatchEvent(new Event("input",{bubbles:!0})),i.focus())}),e.addEventListener("click",t=>{let a=t.target.closest("[data-file-upload-remove]");if(!a)return;let n=a.closest(".file-upload-panel, .file-upload"),i=n==null?void 0:n.querySelector("[data-file-upload-input]");i&&(nt(i,Number(a.dataset.fileUploadRemove)),k(i),i.dispatchEvent(new Event("change",{bubbles:!0})))}),e.addEventListener("click",t=>{let a=t.target.closest("[data-date-picker]");if(a&&(a.focus(),typeof a.showPicker=="function"))try{a.showPicker()}catch(n){}}),e.addEventListener("change",t=>{let a=t.target.closest("[data-file-upload-input]");a&&(tt(a,Array.from(a.files||[])),k(a))}),e.addEventListener("reset",t=>{let a=t.target.closest("form");a&&setTimeout(()=>{a.querySelectorAll("[data-file-upload-input]").forEach(n=>{I(n,[]),k(n)})},0)}),ee.add(e))}var $={init:ot,updateFileUpload:k};var oe=new WeakSet;function j(e){return e.querySelector(".accordion-panel")}function st(e){let t=j(e);t&&(t.style.height="auto",t.style.opacity="1",t.style.transform="translateY(0)")}function se(e){let t=j(e);if(!t||e.dataset.animating==="true")return;e.dataset.animating="true",e.open=!0,t.style.height="0px",t.style.opacity="0",t.style.transform="translateY(-8px)",requestAnimationFrame(()=>{t.style.height=`${t.scrollHeight}px`,t.style.opacity="1",t.style.transform="translateY(0)"});let a=n=>{n.propertyName==="height"&&(t.removeEventListener("transitionend",a),t.style.height="auto",delete e.dataset.animating)};t.addEventListener("transitionend",a)}function le(e){let t=j(e);if(!t||e.dataset.animating==="true")return;e.dataset.animating="true",t.style.height=`${t.scrollHeight}px`,t.style.opacity="1",t.style.transform="translateY(0)",requestAnimationFrame(()=>{t.style.height="0px",t.style.opacity="0",t.style.transform="translateY(-8px)"});let a=n=>{n.propertyName==="height"&&(t.removeEventListener("transitionend",a),e.open=!1,t.style.height="",t.style.opacity="",t.style.transform="",delete e.dataset.animating)};t.addEventListener("transitionend",a)}function ce(e){e.open?le(e):se(e)}function lt(e=document){oe.has(e)||(e.querySelectorAll(".accordion-item[open], .disclosure[open]").forEach(st),e.addEventListener("click",t=>{let a=t.target.closest(".accordion-summary");if(!a)return;let n=a.closest(".accordion-item, .disclosure");n&&(t.preventDefault(),ce(n))}),oe.add(e))}var q={init:lt,expand:se,collapse:le,toggle:ce};var re=new WeakSet;function B(e){return[...e.querySelectorAll('[role="tab"], .tab')]}function de(e){return[...e.querySelectorAll('[role="tabpanel"], .tab-panel')]}function ue(e,t){let a=t.getAttribute("aria-controls");return a?e.querySelector(`#${CSS.escape(a)}`):null}function fe(e,t){e.classList.toggle("tab-active",t),e.setAttribute("aria-selected",t?"true":"false"),e.setAttribute("tabindex",t?"0":"-1")}function R(e,t){e.classList.toggle("tab-panel-active",t),e.toggleAttribute("hidden",!t)}function U(e,t={}){var i;if(!e||e.disabled||e.getAttribute("aria-disabled")==="true")return;let a=e.closest(".tabs")||((i=e.closest('[role="tablist"]'))==null?void 0:i.parentElement);if(!a)return;B(a).forEach(s=>fe(s,s===e)),de(a).forEach(s=>R(s,!1));let n=ue(a,e);n&&R(n,!0),t.focus!==!1&&e.focus()}function T(e,t,a){for(let n=1;n<=e.length;n++){let i=(t+n*a+e.length)%e.length,s=e[i];if(!s.disabled&&s.getAttribute("aria-disabled")!=="true")return s}return e[t]}function ct(e){var l;let t=e.target.closest('[role="tab"], .tab');if(!t)return;let a=t.closest(".tabs")||((l=t.closest('[role="tablist"]'))==null?void 0:l.parentElement),n=a?B(a):[],i=n.indexOf(t);if(i<0)return;let s=null;e.key==="ArrowRight"||e.key==="ArrowDown"?s=T(n,i,1):e.key==="ArrowLeft"||e.key==="ArrowUp"?s=T(n,i,-1):e.key==="Home"?s=T(n,-1,1):e.key==="End"&&(s=T(n,0,-1)),s&&(e.preventDefault(),U(s))}function rt(e){let t=B(e),a=t.find(n=>n.classList.contains("tab-active")||n.getAttribute("aria-selected")==="true")||t.find(n=>!n.disabled&&n.getAttribute("aria-disabled")!=="true");t.forEach(n=>{n.setAttribute("role","tab"),fe(n,n===a)}),e.querySelectorAll(".tabs-list").forEach(n=>{n.setAttribute("role","tablist")}),de(e).forEach(n=>{n.setAttribute("role","tabpanel"),R(n,a?n===ue(e,a):n.classList.contains("tab-panel-active"))})}function dt(e=document){re.has(e)||(e.querySelectorAll(".tabs").forEach(rt),e.addEventListener("click",t=>{let a=t.target.closest('[role="tab"], .tab');!a||!e.contains(a)||(t.preventDefault(),U(a,{focus:!1}))}),e.addEventListener("keydown",ct),re.add(e))}var N={init:dt,activate:U};function W(){let e=[...document.querySelectorAll(".nav-drawer .list-item")],t=[...document.querySelectorAll(".docs-content .section[id]")],a=document.querySelector("[data-docs-current-section]");if(!e.length||!t.length)return;let n=o=>{e.forEach(c=>{var f;let u=c.querySelector(".list-action"),d=(u==null?void 0:u.getAttribute("href"))===`#${o}`;c.classList.toggle("list-item-active",d),d&&a&&(a.textContent=((f=u.querySelector(".list-label"))==null?void 0:f.textContent.trim())||o)})},i=()=>{let o=Math.min(window.innerHeight*.35,280),c=t[0];for(let u of t)if(u.getBoundingClientRect().top<=o)c=u;else break;return c},s=!1,l=()=>{s=!1;let o=i();o!=null&&o.id&&n(o.id)},r=()=>{s||(s=!0,window.requestAnimationFrame(l))};window.addEventListener("scroll",r,{passive:!0}),window.addEventListener("resize",r),window.location.hash?n(window.location.hash.slice(1)):l()}function me(e){let t=document.createElement("textarea");t.value=e,t.setAttribute("readonly","readonly"),t.style.position="fixed",t.style.opacity="0",document.body.append(t),t.select(),document.execCommand("copy"),t.remove()}function h(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ut(e){var l;let t=e.textContent,a=/\/\/.*$|\/\*[\s\S]*?\*\/|`(?:\\[\s\S]|[^`\\])*`|'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|\b(?:async|await|break|case|catch|class|const|continue|default|do|else|export|for|from|function|if|import|let|new|null|return|switch|throw|try|var|while)\b|\b\d+(?:\.\d+)?\b|\b[A-Za-z_$][\w$]*(?=\s*\()/gm,n="",i=0,s;for(;(s=a.exec(t))!==null;){let r=s[0];if(n+=h(t.slice(i,s.index)),r.startsWith("//")||r.startsWith("/*"))n+=`<span class="hljs-comment">${h(r)}</span>`;else if(r.startsWith('"')||r.startsWith("'")||r.startsWith("`"))n+=`<span class="hljs-string">${h(r)}</span>`;else if(/^\d/.test(r))n+=`<span class="hljs-number">${h(r)}</span>`;else if(/^[A-Za-z_$][\w$]*$/.test(r)&&((l=t[s.index+r.length])!=null&&l.match(/\s|\(/))){let o=/^(async|await|break|case|catch|class|const|continue|default|do|else|export|for|from|function|if|import|let|new|null|return|switch|throw|try|var|while)$/.test(r);n+=o?`<span class="hljs-keyword">${r}</span>`:`<span class="hljs-title function_">${r}</span>`}else n+=h(r);i=s.index+r.length}n+=h(t.slice(i)),e.innerHTML=n,e.classList.add("hljs")}function ft(){document.querySelectorAll("code.language-js, code.language-javascript").forEach(ut),window.hljs&&document.querySelectorAll("code:not(.language-js):not(.language-javascript)").forEach(e=>window.hljs.highlightElement(e))}function z(){ft(),document.querySelectorAll(".code-example .btn-icon").forEach(e=>{e.addEventListener("click",async()=>{var s,l;let t=e.closest(".code-example"),a=t==null?void 0:t.querySelector("code"),n=(s=a==null?void 0:a.textContent)!=null?s:"",i=e.innerHTML;if(n){try{(l=navigator.clipboard)!=null&&l.writeText?await navigator.clipboard.writeText(n):me(n)}catch(r){me(n)}e.innerHTML='<i class="ph ph-check"></i>',setTimeout(()=>{e.innerHTML=i},1200)}})})}var P={Helper:m,Toasts:C,Modals:g,advancedSelect:b,editableString:E,confirmPopup:S,Drawer:O,NavigationShell:x,Overlays:A,InputPatterns:$,Accordion:q,Tabs:N};window.GNexusUIKit=P;Object.assign(window,P);document.addEventListener("DOMContentLoaded",()=>{A.init(),x.init(),$.init(),q.init(),N.init(),W(),z()});var mt=P;return be(pt);})();
//# sourceMappingURL=gnexus-ui-kit.js.map
