@uicraft/core 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/uicraft.min.js CHANGED
@@ -4,4 +4,4 @@
4
4
  * MIT License
5
5
  */
6
6
 
7
- var UCAccordion={init:function(){var uid=0;document.querySelectorAll('[data-accordion-item]').forEach(function(item){uid++;var trigger=item.querySelector('[data-accordion-trigger]');var content=item.querySelector('[data-accordion-content]');if(trigger&&content){var tId='acc-trigger-'+uid;var cId='acc-content-'+uid;trigger.id=tId;content.id=cId;trigger.setAttribute('aria-controls',cId);content.setAttribute('aria-labelledby',tId);}});function openContent(content){content.classList.remove('uc-hidden');content.classList.add('open');content.style.maxHeight=content.scrollHeight+16+'px';}function closeContent(content){content.style.maxHeight='0px';content.classList.remove('open');content.addEventListener('transitionend',function handler(){if(content.style.maxHeight==='0px'){content.classList.add('uc-hidden');}content.removeEventListener('transitionend',handler);});}document.querySelectorAll('[data-accordion-content]').forEach(function(content){if(!content.classList.contains('uc-hidden')&&!content.classList.contains('hidden')){content.classList.add('open');content.style.maxHeight=content.scrollHeight+16+'px';}});document.querySelectorAll('[data-accordion-trigger]').forEach(function(trigger){if(trigger.hasAttribute('data-accordion-init'))return;trigger.setAttribute('data-accordion-init','true');trigger.addEventListener('click',function(){var item=trigger.closest('[data-accordion-item]');var accordion=trigger.closest('[data-accordion]');var mode=accordion.getAttribute('data-accordion');var content=item.querySelector('[data-accordion-content]');var icon=trigger.querySelector('[data-accordion-icon]');var isOpen=!content.classList.contains('uc-hidden')&&!content.classList.contains('hidden')&&content.classList.contains('open');if(mode==='single'){accordion.querySelectorAll('[data-accordion-item]').forEach(function(otherItem){var otherContent=otherItem.querySelector('[data-accordion-content]');var otherTrigger=otherItem.querySelector('[data-accordion-trigger]');var otherIcon=otherItem.querySelector('[data-accordion-trigger][data-accordion-icon]');if(otherItem!==item&&!otherContent.classList.contains('uc-hidden')&&!otherContent.classList.contains('hidden')){closeContent(otherContent);if(otherIcon)otherIcon.classList.remove('uc-rotate-180');if(otherTrigger)otherTrigger.setAttribute('aria-expanded','false');}});}if(isOpen){closeContent(content);if(icon)icon.classList.remove('uc-rotate-180');trigger.setAttribute('aria-expanded','false');}else{content.classList.remove('uc-hidden');content.offsetHeight;openContent(content);if(icon)icon.classList.add('uc-rotate-180');trigger.setAttribute('aria-expanded','true');}});});}};var UCCollapsible={init:function(){document.querySelectorAll('[data-collapsible][data-collapsible-open]').forEach(function(collapsible){var content=collapsible.querySelector('[data-collapsible-content]');var icon=collapsible.querySelector('[data-collapsible-icon]');if(content){content.classList.remove('uc-hidden');if(collapsible.hasAttribute('data-collapsible-animated')){content.style.maxHeight=content.scrollHeight+'px';}}if(icon){icon.classList.add('uc-rotate-180');}});document.querySelectorAll('[data-collapsible-trigger]').forEach(function(trigger){if(trigger.hasAttribute('data-collapsible-bound'))return;trigger.setAttribute('data-collapsible-bound','true');trigger.addEventListener('click',function(){var collapsible=trigger.closest('[data-collapsible]');var content=collapsible.querySelector(':scope>[data-collapsible-content]');if(!content){content=collapsible.querySelector('[data-collapsible-content]');}var icon=collapsible.querySelector(':scope>*[data-collapsible-icon]')||collapsible.querySelector('[data-collapsible-icon]');var isAnimated=collapsible.hasAttribute('data-collapsible-animated');var labelCollapse=trigger.querySelector('[data-collapsible-label-collapse]');var labelExpand=trigger.querySelector('[data-collapsible-label-expand]');var isOpen;if(isAnimated){isOpen=parseInt(content.style.maxHeight)>0;}else{isOpen=!content.classList.contains('uc-hidden');}if(isOpen){if(isAnimated){content.style.maxHeight='0';}else{content.classList.add('uc-hidden');}if(icon)icon.classList.remove('uc-rotate-180');if(labelCollapse)labelCollapse.classList.add('uc-hidden');if(labelExpand)labelExpand.classList.remove('uc-hidden');collapsible.removeAttribute('data-collapsible-open');}else{if(isAnimated){content.style.maxHeight=content.scrollHeight+'px';}else{content.classList.remove('uc-hidden');}if(icon)icon.classList.add('uc-rotate-180');if(labelCollapse)labelCollapse.classList.remove('uc-hidden');if(labelExpand)labelExpand.classList.add('uc-hidden');collapsible.setAttribute('data-collapsible-open','');}});});}};var UCCombobox={init:function(){var checkSvg='<svg xmlns="http:var emptySpacer='<span class="uc-w-4 uc-h-4 uc-shrink-0 uc-combobox-icon"></span>';var xTagSvg='<svg xmlns="http:if(!document.body.hasAttribute('data-combobox-outside-init')){document.body.setAttribute('data-combobox-outside-init','true');document.addEventListener('click',function(e){if(!e.target.closest('.uc-combobox-wrapper')){document.querySelectorAll('[data-combobox-content]').forEach(function(el){el.classList.remove('uc-open');});}});}window.openCombobox=function(id){var el=document.getElementById(id);if(el)el.classList.add('uc-open');};window.toggleCombobox=function(id){var el=document.getElementById(id);if(el)el.classList.toggle('uc-open');};window.filterCombobox=function(input,id){var dropdown=document.getElementById(id);var query=input.value.toLowerCase();var items=dropdown.querySelectorAll('.uc-combobox-item');var groups=dropdown.querySelectorAll('[data-combobox-group]');var emptyEl=dropdown.querySelector('.uc-combobox-empty');var totalVisible=0;if(groups.length>0){groups.forEach(function(group){var groupItems=group.querySelectorAll('.uc-combobox-item');var groupVisible=0;groupItems.forEach(function(item){if(item.textContent.toLowerCase().includes(query)){item.classList.remove('uc-hidden');groupVisible++;totalVisible++;}else{item.classList.add('uc-hidden');}});group.style.display=groupVisible>0?'':'none';});}else{items.forEach(function(item){if(item.textContent.toLowerCase().includes(query)){item.classList.remove('uc-hidden');totalVisible++;}else{item.classList.add('uc-hidden');}});}if(emptyEl){emptyEl.classList.toggle('uc-hidden',totalVisible>0||!query);}};function setItemIcon(item,checked){var icon=item.querySelector('.uc-combobox-icon');if(icon)icon.outerHTML=checked?checkSvg:emptySpacer;}window.selectComboboxItem=function(item){var text=item.textContent.trim();var wrapper=item.closest('.uc-combobox-wrapper');var keepIcons=wrapper.hasAttribute('data-keep-icons');var input=wrapper.querySelector('input');var dropdown=item.closest('[data-combobox-content]');input.value=text;dropdown.querySelectorAll('.uc-combobox-item').forEach(function(i){i.classList.remove('uc-selected');if(!keepIcons)setItemIcon(i,false);});item.classList.add('uc-selected');if(!keepIcons)setItemIcon(item,true);dropdown.classList.remove('uc-open');};window.selectComboboxButton=function(item,dropdownId){var text=item.textContent.trim();var wrapper=item.closest('.uc-combobox-wrapper');var label=wrapper.querySelector('.uc-combobox-button-label');var dropdown=document.getElementById(dropdownId);label.textContent=text;label.classList.remove('uc-text-fg-disabled');dropdown.querySelectorAll('.uc-combobox-item').forEach(function(i){i.classList.remove('uc-selected');setItemIcon(i,false);});item.classList.add('uc-selected');setItemIcon(item,true);dropdown.classList.remove('uc-open');};window.toggleMultiComboboxItem=function(item){var isSelected=item.classList.toggle('uc-selected');setItemIcon(item,isSelected);var wrapper=item.closest('.uc-combobox-wrapper');var tagContainer=wrapper.querySelector('.uc-combobox-tags');var text=item.textContent.trim();if(isSelected){var tag=document.createElement('span');tag.className='uc-combobox-tag uc-inline-flex uc-items-center uc-gap-1 uc-rounded uc-bg-neutrals-subtle uc-px-2 uc-py-0.5 uc-text-xs uc-font-medium';tag.setAttribute('data-tag-value',text);tag.innerHTML=text+'<button type="button" onclick="event.stopPropagation();removeComboboxTag(this)" class="uc-ml-0.5 uc-rounded-sm uc-hover:bg-neutrals-muted uc-transition-colors">'+xTagSvg+'</button>';tagContainer.insertBefore(tag,tagContainer.querySelector('input'));}else{var existing=tagContainer.querySelector('[data-tag-value="'+text+'"]');if(existing)existing.remove();}UCCombobox._updateMultiPlaceholder(wrapper);};window.removeComboboxTag=function(btn){var tag=btn.closest('.uc-combobox-tag');if(!tag)return;var value=tag.getAttribute('data-tag-value');var wrapper=tag.closest('.uc-combobox-wrapper');tag.remove();var dropdown=wrapper.querySelector('[data-combobox-content]');if(dropdown){dropdown.querySelectorAll('.uc-combobox-item').forEach(function(item){if(item.textContent.trim()===value){item.classList.remove('uc-selected');setItemIcon(item,false);}});}UCCombobox._updateMultiPlaceholder(wrapper);};},_updateMultiPlaceholder:function(wrapper){var input=wrapper.querySelector('input');var tags=wrapper.querySelectorAll('.uc-combobox-tag');if(input){input.placeholder=tags.length>0?'':'Add framework...';}}};var UCResizable={init:function(){document.querySelectorAll('[data-resizable]').forEach(function(container){if(container.hasAttribute('data-resizable-init'))return;container.setAttribute('data-resizable-init','true');var direction=container.dataset.resizable;var isHorizontal=direction==='horizontal';var minPct=parseFloat(container.dataset.min||'10');var maxPct=parseFloat(container.dataset.max||'90');var handles=container.querySelectorAll(':scope>.uc-resize-handle');handles.forEach(function(handle){var isDown=false;var startPos=0;var prevPanel=null;var nextPanel=null;var containerSize=0;var prevStart=0;var nextStart=0;handle.addEventListener('mousedown',function(e){e.preventDefault();isDown=true;prevPanel=handle.previousElementSibling;nextPanel=handle.nextElementSibling;if(!prevPanel||!nextPanel)return;containerSize=isHorizontal?container.offsetWidth:container.offsetHeight;prevStart=isHorizontal?prevPanel.offsetWidth:prevPanel.offsetHeight;nextStart=isHorizontal?nextPanel.offsetWidth:nextPanel.offsetHeight;startPos=isHorizontal?e.clientX:e.clientY;document.body.style.cursor=isHorizontal?'col-resize':'row-resize';document.body.style.userSelect='none';handle.style.background='hsl(var(--accents-blue)/0.5)';});document.addEventListener('mousemove',function(e){if(!isDown||!prevPanel||!nextPanel)return;var delta=(isHorizontal?e.clientX:e.clientY)-startPos;var newPrev=prevStart+delta;var newNext=nextStart-delta;var minSize=containerSize*(minPct/100);var maxSize=containerSize*(maxPct/100);if(newPrev<minSize){newPrev=minSize;newNext=prevStart+nextStart-minSize;}if(newNext<minSize){newNext=minSize;newPrev=prevStart+nextStart-minSize;}if(newPrev>maxSize){newPrev=maxSize;newNext=prevStart+nextStart-maxSize;}if(newNext>maxSize){newNext=maxSize;newPrev=prevStart+nextStart-maxSize;}var prevPct=(newPrev/containerSize*100).toFixed(1);var nextPct=(newNext/containerSize*100).toFixed(1);if(isHorizontal){prevPanel.style.width=prevPct+'%';nextPanel.style.width=nextPct+'%';}else{prevPanel.style.height=prevPct+'%';nextPanel.style.height=nextPct+'%';}prevPanel.style.flex='none';nextPanel.style.flex='none';var prevLabel=prevPanel.querySelector('.uc-size-label');var nextLabel=nextPanel.querySelector('.uc-size-label');if(prevLabel)prevLabel.textContent=Math.round(parseFloat(prevPct))+'%';if(nextLabel)nextLabel.textContent=Math.round(parseFloat(nextPct))+'%';});document.addEventListener('mouseup',function(){if(!isDown)return;isDown=false;document.body.style.cursor='';document.body.style.userSelect='';handle.style.background='';});});});}};var UCCarousel={init:function(){document.querySelectorAll('[data-carousel]').forEach(function(el){if(el.hasAttribute('data-carousel-init'))return;el.setAttribute('data-carousel-init','true');var carousel=el;var track=carousel.querySelector('[data-carousel-track]');var prevBtn=carousel.querySelector('[data-carousel-prev]');var nextBtn=carousel.querySelector('[data-carousel-next]');var dotsContainer=carousel.querySelector('[data-carousel-dots]');var total=parseInt(carousel.dataset.total||'0');var visible=parseInt(carousel.dataset.visible||'1');var maxIndex=total-visible;var current=0;function update(){if(visible===1){track.style.transform='translateX(-'+(current*100)+'%)';}else{var slide=track.children[0];var gap=parseFloat(getComputedStyle(track).gap)||0;var offset=current*(slide.offsetWidth+gap);track.style.transform='translateX(-'+offset+'px)';}if(dotsContainer){dotsContainer.querySelectorAll('[data-dot]').forEach(function(dot){var idx=parseInt(dot.dataset.dot||'0');dot.className='uc-w-2 uc-h-2 uc-rounded-full uc-transition-colors '+(idx===current?'uc-bg-accents-blue':'uc-bg-neutrals-muted');});}if(prevBtn)prevBtn.style.opacity=current===0?'0.4':'1';if(nextBtn)nextBtn.style.opacity=current>=maxIndex?'0.4':'1';}if(prevBtn){prevBtn.addEventListener('click',function(){if(current>0){current--;update();}});}if(nextBtn){nextBtn.addEventListener('click',function(){if(current<maxIndex){current++;update();}});}if(dotsContainer){dotsContainer.querySelectorAll('[data-dot]').forEach(function(dot){dot.addEventListener('click',function(){current=Math.min(parseInt(dot.dataset.dot||'0'),maxIndex);update();});});}update();});}};var UCDropdown={init:function(){if(document.body.hasAttribute('data-dropdowns-init'))return;document.body.setAttribute('data-dropdowns-init','true');document.addEventListener('click',function(e){if(!e.target.closest('[data-dropdown-trigger]')&&!e.target.closest('.uc-dropdown-menu')){document.querySelectorAll('.uc-dropdown-menu').forEach(function(el){el.classList.remove('uc-open');});}});document.querySelectorAll('[data-dropdown-trigger]').forEach(function(trigger){if(trigger.hasAttribute('data-dropdown-bound'))return;trigger.setAttribute('data-dropdown-bound','true');trigger.addEventListener('click',function(e){e.stopPropagation();var targetId=trigger.getAttribute('data-dropdown-trigger');var content=document.getElementById(targetId);if(!content)return;document.querySelectorAll('.uc-dropdown-menu').forEach(function(el){if(el!==content)el.classList.remove('uc-open');});content.classList.toggle('uc-open');});});}};function toggleCheckbox(el){var indicator=el.querySelector('.checkbox-indicator');var isChecked=indicator.classList.contains('uc-bg-accents-blue');if(isChecked){indicator.classList.remove('uc-bg-accents-blue','uc-text-constant-white','uc-border-transparent');indicator.innerHTML='';}else{indicator.classList.add('uc-bg-accents-blue','uc-text-constant-white','uc-border-transparent');indicator.innerHTML='<svg xmlns="http:}}function selectRadio(el){var parent=el.closest('.uc-dropdown-menu');parent.querySelectorAll('.radio-indicator').forEach(function(r){r.classList.remove('uc-border-accents-blue');r.classList.add('uc-border-input');r.innerHTML='';});var indicator=el.querySelector('.radio-indicator');indicator.classList.remove('uc-border-input');indicator.classList.add('uc-border-accents-blue');indicator.innerHTML='<div class="uc-w-2 uc-h-2 uc-rounded-full uc-bg-accents-blue"></div>';}var UCScrollView={init:function(){document.querySelectorAll('.uc-drag-scroll').forEach(function(el){if(el.hasAttribute('data-drag-init'))return;el.setAttribute('data-drag-init','true');var isDown=false;var startX=0;var scrollLeft=0;el.addEventListener('mousedown',function(e){isDown=true;el.style.cursor='grabbing';el.style.userSelect='none';startX=e.pageX-el.offsetLeft;scrollLeft=el.scrollLeft;});el.addEventListener('mouseleave',function(){isDown=false;el.style.cursor='grab';el.style.userSelect='';});el.addEventListener('mouseup',function(){isDown=false;el.style.cursor='grab';el.style.userSelect='';});el.addEventListener('mousemove',function(e){if(!isDown)return;e.preventDefault();var x=e.pageX-el.offsetLeft;var walk=(x-startX)*1.5;el.scrollLeft=scrollLeft-walk;});});document.querySelectorAll('.uc-scroll-indicator').forEach(function(indicator){if(indicator.hasAttribute('data-indicator-init'))return;indicator.setAttribute('data-indicator-init','true');var scroll=indicator.querySelector('.uc-scroll,.uc-scroll-hidden,.uc-scroll-autohide');if(!scroll)return;scroll.addEventListener('scroll',function(){var st=scroll.scrollTop;var sh=scroll.scrollHeight;var ch=scroll.clientHeight;indicator.classList.toggle('uc-show-top',st>8);indicator.classList.toggle('uc-show-bottom',st<sh-ch-8);});});document.querySelectorAll('.uc-scroll-indicator-h').forEach(function(indicator){if(indicator.hasAttribute('data-indicator-h-init'))return;indicator.setAttribute('data-indicator-h-init','true');var scroll=indicator.querySelector('.uc-scroll,.uc-scroll-hidden,.uc-scroll-autohide,[class*="uc-overflow-x"]');if(!scroll)return;scroll.addEventListener('scroll',function(){var sl=scroll.scrollLeft;var sw=scroll.scrollWidth;var cw=scroll.clientWidth;indicator.classList.toggle('uc-show-left',sl>8);indicator.classList.toggle('uc-show-right',sl<sw-cw-8);});});}};var UCNumberInput={init:function(){document.querySelectorAll('[data-number-input]').forEach(function(wrapper){if(wrapper.hasAttribute('data-ni-bound'))return;wrapper.setAttribute('data-ni-bound','true');var input=wrapper.querySelector('[data-number-value]');var decBtn=wrapper.querySelector('[data-action="decrement"]');var incBtn=wrapper.querySelector('[data-action="increment"]');if(!input)return;function updateButtons(){var val=parseInt(input.value)||0;var min=input.hasAttribute('min')?parseInt(input.min):-Infinity;var max=input.hasAttribute('max')?parseInt(input.max):Infinity;if(decBtn)decBtn.disabled=val<=min;if(incBtn)incBtn.disabled=val>=max;}function step(delta){var val=parseInt(input.value)||0;var min=input.hasAttribute('min')?parseInt(input.min):-Infinity;var max=input.hasAttribute('max')?parseInt(input.max):Infinity;var next=Math.min(Math.max(val+delta,min),max);input.value=next;updateButtons();}if(decBtn)decBtn.addEventListener('click',function(){step(-1);});if(incBtn)incBtn.addEventListener('click',function(){step(1);});input.addEventListener('change',function(){var min=input.hasAttribute('min')?parseInt(input.min):-Infinity;var max=input.hasAttribute('max')?parseInt(input.max):Infinity;var val=parseInt(input.value)||min;input.value=Math.min(Math.max(val,min),max);updateButtons();});updateButtons();});}};var UCPopover={init:function(){document.querySelectorAll('[data-popover-trigger]').forEach(function(btn){btn.onclick=function(e){e.stopPropagation();var id=btn.getAttribute('data-popover-trigger');var el=id?document.getElementById(id):null;if(!el)return;var isOpen=el.classList.contains('uc-open');document.querySelectorAll('.uc-popover-content').forEach(function(p){p.classList.remove('uc-open');});if(!isOpen)el.classList.add('uc-open');};});if(!document.body.hasAttribute('data-popover-outside-init')){document.body.setAttribute('data-popover-outside-init','true');document.addEventListener('click',function(e){var target=e.target;if(!target.closest('.uc-popover-content')&&!target.closest('[data-popover-trigger]')){document.querySelectorAll('.uc-popover-content').forEach(function(p){p.classList.remove('uc-open');});}});}}};var UCSelect={init:function(){if(document.body.hasAttribute('data-select-init'))return;document.body.setAttribute('data-select-init','true');document.addEventListener('click',function(e){if(!e.target.closest('.uc-select-wrapper')){document.querySelectorAll('.uc-select-dropdown').forEach(function(d){d.classList.remove('open');});}});}};function toggleSelect(id){var dropdown=document.getElementById(id);document.querySelectorAll('.uc-select-dropdown').forEach(function(d){if(d.id!==id)d.classList.remove('open');});dropdown.classList.toggle('open');}function selectItem(id,triggerId,value){document.getElementById(triggerId).querySelector('span').textContent=value;document.getElementById(triggerId).querySelector('span').classList.remove('placeholder');var dropdown=document.getElementById(id);dropdown.querySelectorAll('.uc-select-item').forEach(function(i){i.classList.remove('selected');});dropdown.querySelectorAll('.uc-select-item').forEach(function(i){if(i.textContent.trim()===value)i.classList.add('selected');});dropdown.classList.remove('open');}var UCToast={_count:0,show:function(type){var container=document.getElementById('toast-container');if(!container)return;var id='toast-'+(++UCToast._count);var configs={default:{title:'Scheduled:Catch up',desc:'Friday,February 14,2026 at 5:57 PM',icon:'',btn:'Undo'},success:{title:'Success',desc:'Your changes have been saved.',icon:'<svg xmlns="http:error:{title:'Error',desc:'Something went wrong. Please try again.',icon:'<svg xmlns="http:action:{title:'Event created',desc:'Sunday,December 03,2023',icon:'',btn:'Undo'}};var c=configs[type]||configs.default;var toast=document.createElement('div');toast.id=id;toast.className='uc-flex uc-items-start uc-gap-3 uc-w-80 uc-p-4 uc-rounded-lg uc-border uc-border-border-default uc-bg-neutrals-surface uc-shadow-lg uc-mb-2';toast.innerHTML=(c.icon?'<div class="uc-flex-shrink-0 uc-mt-0.5">'+c.icon+'</div>':'')+'<div class="uc-flex-1 uc-min-w-0">'+'<p class="uc-text-sm uc-font-semibold">'+c.title+'</p>'+'<p class="uc-text-xs uc-text-fg-disabled uc-mt-0.5">'+c.desc+'</p>'+'</div>'+(c.btn?'<button onclick="this.parentElement.remove()" class="uc-flex-shrink-0 uc-inline-flex uc-items-center uc-justify-center uc-rounded-lg uc-text-xs uc-font-medium uc-h-7 uc-px-2 uc-border uc-border-border-strong uc-bg-neutrals-surface uc-hover:bg-neutrals-subtle uc-transition-colors">'+c.btn+'</button>':'')+'<button onclick="this.parentElement.remove()" class="uc-flex-shrink-0 uc-p-0.5 uc-text-fg-disabled uc-hover:text-fg-primary uc-transition-colors">'+'<svg xmlns="http:'</button>';container.appendChild(toast);setTimeout(function(){var el=document.getElementById(id);if(el)el.remove();},4000);},init:function(){window.showToast=function(type){UCToast.show(type);};}};var UCDialog={init:function(){window.openDialog=function(id){var el=document.getElementById(id);if(!el)return;el.classList.add('uc-open');el.removeAttribute('aria-hidden');var focusable=el.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');if(focusable)focusable.focus();el._keyHandler=function(e){if(e.key==='Escape'){window.closeDialog(id);return;}if(e.key!=='Tab')return;var all=el.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');var first=all[0];var last=all[all.length-1];if(e.shiftKey&&document.activeElement===first){e.preventDefault();last.focus();}else if(!e.shiftKey&&document.activeElement===last){e.preventDefault();first.focus();}};document.addEventListener('keydown',el._keyHandler);};window.closeDialog=function(id){var el=document.getElementById(id);if(!el)return;el.classList.remove('uc-open');el.setAttribute('aria-hidden','true');if(el._keyHandler)document.removeEventListener('keydown',el._keyHandler);};}};var UCTreeView={init:function(){document.querySelectorAll('[data-tree]').forEach(function(tree){if(tree.hasAttribute('data-tree-bound'))return;tree.setAttribute('data-tree-bound','true');tree.querySelectorAll('[data-tree-branch]').forEach(function(branch){var toggle=branch.querySelector(':scope>.uc-tree-toggle');if(!toggle)return;toggle.addEventListener('click',function(){branch.classList.toggle('open');});});});}};var UCSheet={init:function(){window.openSheet=function(id){var overlay=document.getElementById('uc-sheet-overlay');if(overlay)overlay.classList.add('uc-open');var sheet=document.getElementById(id);if(sheet)sheet.classList.add('uc-open');};window.closeSheet=function(id){var overlay=document.getElementById('uc-sheet-overlay');if(overlay)overlay.classList.remove('uc-open');var sheet=document.getElementById(id);if(sheet)sheet.classList.remove('uc-open');};window.closeAllSheets=function(){var overlay=document.getElementById('uc-sheet-overlay');if(overlay)overlay.classList.remove('uc-open');document.querySelectorAll('.uc-sheet-right,.uc-sheet-bottom,.uc-sheet-left').forEach(function(s){s.classList.remove('uc-open');});};}};(function(){function initAll(){UCAccordion.init();UCCollapsible.init();UCCombobox.init();UCResizable.init();UCCarousel.init();UCDropdown.init();UCScrollView.init();UCNumberInput.init();UCPopover.init();UCSelect.init();UCToast.init();UCDialog.init();UCTreeView.init();UCSheet.init();}if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',initAll);}else{initAll();}document.addEventListener('astro:after-swap',function(){document.body.removeAttribute('data-dropdowns-init');document.body.removeAttribute('data-select-init');document.body.removeAttribute('data-popover-outside-init');document.body.removeAttribute('data-combobox-outside-init');initAll();});})();
7
+ var UCAccordion={init:function(){var t=0;document.querySelectorAll("[data-accordion-item]").forEach(function(o){t++;var a=o.querySelector("[data-accordion-trigger]"),n=o.querySelector("[data-accordion-content]");if(a&&n){var c="acc-trigger-"+t,i="acc-content-"+t;a.id=c,n.id=i,a.setAttribute("aria-controls",i),!a.hasAttribute("role")&&a.tagName!=="BUTTON"&&(a.setAttribute("role","button"),a.setAttribute("tabindex","0")),n.setAttribute("aria-labelledby",c),n.setAttribute("role","region");var l=!n.classList.contains("uc-hidden")&&!n.classList.contains("hidden");a.setAttribute("aria-expanded",l?"true":"false")}});function e(o){o.classList.remove("uc-hidden"),o.classList.add("open"),o.style.maxHeight=o.scrollHeight+16+"px"}function r(o){o.style.maxHeight="0px",o.classList.remove("open"),o.addEventListener("transitionend",function a(){o.style.maxHeight==="0px"&&o.classList.add("uc-hidden"),o.removeEventListener("transitionend",a)})}document.querySelectorAll("[data-accordion-content]").forEach(function(o){!o.classList.contains("uc-hidden")&&!o.classList.contains("hidden")&&(o.classList.add("open"),o.style.maxHeight=o.scrollHeight+16+"px")}),document.querySelectorAll("[data-accordion-trigger]").forEach(function(o){o.hasAttribute("data-accordion-init")||(o.setAttribute("data-accordion-init","true"),o.addEventListener("keydown",function(a){(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),o.click())}),o.addEventListener("click",function(){var a=o.closest("[data-accordion-item]"),n=o.closest("[data-accordion]"),c=n.getAttribute("data-accordion"),i=a.querySelector("[data-accordion-content]"),l=o.querySelector("[data-accordion-icon]"),s=!i.classList.contains("uc-hidden")&&!i.classList.contains("hidden")&&i.classList.contains("open");c==="single"&&n.querySelectorAll("[data-accordion-item]").forEach(function(u){var d=u.querySelector("[data-accordion-content]"),f=u.querySelector("[data-accordion-trigger]"),v=u.querySelector("[data-accordion-trigger] [data-accordion-icon]");u!==a&&!d.classList.contains("uc-hidden")&&!d.classList.contains("hidden")&&(r(d),v&&v.classList.remove("uc-rotate-180"),f&&f.setAttribute("aria-expanded","false"))}),s?(r(i),l&&l.classList.remove("uc-rotate-180"),o.setAttribute("aria-expanded","false")):(i.classList.remove("uc-hidden"),i.offsetHeight,e(i),l&&l.classList.add("uc-rotate-180"),o.setAttribute("aria-expanded","true"))}))})}},UCCollapsible={init:function(){document.querySelectorAll("[data-collapsible][data-collapsible-open]").forEach(function(t){var e=t.querySelector("[data-collapsible-content]"),r=t.querySelector("[data-collapsible-icon]");e&&(e.classList.remove("uc-hidden"),t.hasAttribute("data-collapsible-animated")&&(e.style.maxHeight=e.scrollHeight+"px")),r&&r.classList.add("uc-rotate-180")}),document.querySelectorAll("[data-collapsible-trigger]").forEach(function(t){t.hasAttribute("data-collapsible-bound")||(t.setAttribute("data-collapsible-bound","true"),t.addEventListener("click",function(){var e=t.closest("[data-collapsible]"),r=e.querySelector(":scope > [data-collapsible-content]");r||(r=e.querySelector("[data-collapsible-content]"));var o=e.querySelector(":scope > * [data-collapsible-icon]")||e.querySelector("[data-collapsible-icon]"),a=e.hasAttribute("data-collapsible-animated"),n=t.querySelector("[data-collapsible-label-collapse]"),c=t.querySelector("[data-collapsible-label-expand]"),i;a?i=parseInt(r.style.maxHeight)>0:i=!r.classList.contains("uc-hidden"),i?(a?r.style.maxHeight="0":r.classList.add("uc-hidden"),o&&o.classList.remove("uc-rotate-180"),n&&n.classList.add("uc-hidden"),c&&c.classList.remove("uc-hidden"),e.removeAttribute("data-collapsible-open")):(a?r.style.maxHeight=r.scrollHeight+"px":r.classList.remove("uc-hidden"),o&&o.classList.add("uc-rotate-180"),n&&n.classList.remove("uc-hidden"),c&&c.classList.add("uc-hidden"),e.setAttribute("data-collapsible-open",""))}))})}},UCCombobox={init:function(){var t='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="uc-w-4 uc-h-4 uc-shrink-0 uc-text-accents-blue uc-combobox-icon"><path d="M20 6 9 17l-5-5"/></svg>',e='<span class="uc-w-4 uc-h-4 uc-shrink-0 uc-combobox-icon"></span>',r='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="uc-w-3 uc-h-3"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>';document.body.hasAttribute("data-combobox-outside-init")||(document.body.setAttribute("data-combobox-outside-init","true"),document.addEventListener("click",function(a){a.target.closest(".uc-combobox-wrapper")||document.querySelectorAll("[data-combobox-content]").forEach(function(n){n.classList.remove("uc-open")})})),window.openCombobox=function(a){var n=document.getElementById(a);n&&n.classList.add("uc-open")},window.toggleCombobox=function(a){var n=document.getElementById(a);n&&n.classList.toggle("uc-open")},window.filterCombobox=function(a,n){var c=document.getElementById(n),i=a.value.toLowerCase(),l=c.querySelectorAll(".uc-combobox-item"),s=c.querySelectorAll("[data-combobox-group]"),u=c.querySelector(".uc-combobox-empty"),d=0;s.length>0?s.forEach(function(f){var v=f.querySelectorAll(".uc-combobox-item"),m=0;v.forEach(function(p){p.textContent.toLowerCase().includes(i)?(p.classList.remove("uc-hidden"),m++,d++):p.classList.add("uc-hidden")}),f.style.display=m>0?"":"none"}):l.forEach(function(f){f.textContent.toLowerCase().includes(i)?(f.classList.remove("uc-hidden"),d++):f.classList.add("uc-hidden")}),u&&u.classList.toggle("uc-hidden",d>0||!i)};function o(a,n){var c=a.querySelector(".uc-combobox-icon");c&&(c.outerHTML=n?t:e)}window.selectComboboxItem=function(a){var n=a.textContent.trim(),c=a.closest(".uc-combobox-wrapper"),i=c.hasAttribute("data-keep-icons"),l=c.querySelector("input"),s=a.closest("[data-combobox-content]");l.value=n,s.querySelectorAll(".uc-combobox-item").forEach(function(u){u.classList.remove("uc-selected"),i||o(u,!1)}),a.classList.add("uc-selected"),i||o(a,!0),s.classList.remove("uc-open")},window.selectComboboxButton=function(a,n){var c=a.textContent.trim(),i=a.closest(".uc-combobox-wrapper"),l=i.querySelector(".uc-combobox-button-label"),s=document.getElementById(n);l.textContent=c,l.classList.remove("uc-text-fg-disabled"),s.querySelectorAll(".uc-combobox-item").forEach(function(u){u.classList.remove("uc-selected"),o(u,!1)}),a.classList.add("uc-selected"),o(a,!0),s.classList.remove("uc-open")},window.toggleMultiComboboxItem=function(a){var n=a.classList.toggle("uc-selected");o(a,n);var c=a.closest(".uc-combobox-wrapper"),i=c.querySelector(".uc-combobox-tags"),l=a.textContent.trim();if(n){var s=document.createElement("span");s.className="uc-combobox-tag uc-inline-flex uc-items-center uc-gap-1 uc-rounded uc-bg-neutrals-subtle uc-px-2 uc-py-0.5 uc-text-xs uc-font-medium",s.setAttribute("data-tag-value",l),s.appendChild(document.createTextNode(l));var u=document.createElement("button");u.type="button",u.className="uc-ml-0.5 uc-rounded-sm uc-hover:bg-neutrals-muted uc-transition-colors",u.innerHTML=r,u.addEventListener("click",function(f){f.stopPropagation(),window.removeComboboxTag(u)}),s.appendChild(u),i.insertBefore(s,i.querySelector("input"))}else{var d=i.querySelector('[data-tag-value="'+l+'"]');d&&d.remove()}UCCombobox._updateMultiPlaceholder(c)},window.removeComboboxTag=function(a){var n=a.closest(".uc-combobox-tag");if(n){var c=n.getAttribute("data-tag-value"),i=n.closest(".uc-combobox-wrapper");n.remove();var l=i.querySelector("[data-combobox-content]");l&&l.querySelectorAll(".uc-combobox-item").forEach(function(s){s.textContent.trim()===c&&(s.classList.remove("uc-selected"),o(s,!1))}),UCCombobox._updateMultiPlaceholder(i)}}},_updateMultiPlaceholder:function(t){var e=t.querySelector("input"),r=t.querySelectorAll(".uc-combobox-tag");e&&(e.placeholder=r.length>0?"":"Add framework...")}},UCResizable={init:function(){document.querySelectorAll("[data-resizable]").forEach(function(t){if(!t.hasAttribute("data-resizable-init")){t.setAttribute("data-resizable-init","true");var e=t.dataset.resizable,r=e==="horizontal",o=parseFloat(t.dataset.min||"10"),a=parseFloat(t.dataset.max||"90"),n=t.querySelectorAll(":scope > .uc-resize-handle");n.forEach(function(c){var i=!1,l=0,s=null,u=null,d=0,f=0,v=0;c.addEventListener("mousedown",function(m){m.preventDefault(),i=!0,s=c.previousElementSibling,u=c.nextElementSibling,!(!s||!u)&&(d=r?t.offsetWidth:t.offsetHeight,f=r?s.offsetWidth:s.offsetHeight,v=r?u.offsetWidth:u.offsetHeight,l=r?m.clientX:m.clientY,document.body.style.cursor=r?"col-resize":"row-resize",document.body.style.userSelect="none",c.style.background="hsl(var(--accents-blue) / 0.5)")}),document.addEventListener("mousemove",function(m){if(!(!i||!s||!u)){var p=(r?m.clientX:m.clientY)-l,b=f+p,h=v-p,y=d*(o/100),g=d*(a/100);b<y&&(b=y,h=f+v-y),h<y&&(h=y,b=f+v-y),b>g&&(b=g,h=f+v-g),h>g&&(h=g,b=f+v-g);var x=(b/d*100).toFixed(1),w=(h/d*100).toFixed(1);r?(s.style.width=x+"%",u.style.width=w+"%"):(s.style.height=x+"%",u.style.height=w+"%"),s.style.flex="none",u.style.flex="none";var L=s.querySelector(".uc-size-label"),A=u.querySelector(".uc-size-label");L&&(L.textContent=Math.round(parseFloat(x))+"%"),A&&(A.textContent=Math.round(parseFloat(w))+"%")}}),document.addEventListener("mouseup",function(){i&&(i=!1,document.body.style.cursor="",document.body.style.userSelect="",c.style.background="")})})}})}},UCCarousel={init:function(){document.querySelectorAll("[data-carousel]").forEach(function(t){if(t.hasAttribute("data-carousel-init"))return;t.setAttribute("data-carousel-init","true");var e=t,r=e.querySelector("[data-carousel-track]"),o=e.querySelector("[data-carousel-prev]"),a=e.querySelector("[data-carousel-next]"),n=e.querySelector("[data-carousel-dots]"),c=parseInt(e.dataset.total||"0"),i=parseInt(e.dataset.visible||"1"),l=c-i,s=0;function u(){if(i===1)r.style.transform="translateX(-"+s*100+"%)";else{var d=r.children[0],f=parseFloat(getComputedStyle(r).gap)||0,v=s*(d.offsetWidth+f);r.style.transform="translateX(-"+v+"px)"}n&&n.querySelectorAll("[data-dot]").forEach(function(m){var p=parseInt(m.dataset.dot||"0");m.className="uc-w-2 uc-h-2 uc-rounded-full uc-transition-colors "+(p===s?"uc-bg-accents-blue":"uc-bg-neutrals-muted")}),o&&(o.style.opacity=s===0?"0.4":"1"),a&&(a.style.opacity=s>=l?"0.4":"1")}o&&o.addEventListener("click",function(){s>0&&(s--,u())}),a&&a.addEventListener("click",function(){s<l&&(s++,u())}),n&&n.querySelectorAll("[data-dot]").forEach(function(d){d.addEventListener("click",function(){s=Math.min(parseInt(d.dataset.dot||"0"),l),u()})}),u()})}},UCDropdown={init:function(){document.body.hasAttribute("data-dropdowns-init")||(document.body.setAttribute("data-dropdowns-init","true"),document.addEventListener("click",function(t){!t.target.closest("[data-dropdown-trigger]")&&!t.target.closest(".uc-dropdown-menu")&&document.querySelectorAll(".uc-dropdown-menu").forEach(function(e){e.classList.remove("uc-open")})}),document.querySelectorAll("[data-dropdown-trigger]").forEach(function(t){if(!t.hasAttribute("data-dropdown-bound")){t.setAttribute("data-dropdown-bound","true");var e=t.getAttribute("data-dropdown-trigger");t.setAttribute("aria-haspopup","menu"),t.setAttribute("aria-expanded","false"),e&&t.setAttribute("aria-controls",e),t.addEventListener("click",function(r){r.stopPropagation();var o=document.getElementById(e);if(o){document.querySelectorAll(".uc-dropdown-menu").forEach(function(n){n!==o&&n.classList.remove("uc-open")});var a=!o.classList.contains("uc-open");o.classList.toggle("uc-open"),t.setAttribute("aria-expanded",a?"true":"false")}})}}),document.addEventListener("keydown",function(t){t.key==="Escape"&&(document.querySelectorAll(".uc-dropdown-menu.uc-open").forEach(function(e){e.classList.remove("uc-open")}),document.querySelectorAll("[data-dropdown-trigger]").forEach(function(e){e.setAttribute("aria-expanded","false")}))}))}};function toggleCheckbox(t){var e=t.querySelector(".checkbox-indicator"),r=e.classList.contains("uc-bg-accents-blue");r?(e.classList.remove("uc-bg-accents-blue","uc-text-constant-white","uc-border-transparent"),e.innerHTML="",t.setAttribute("aria-checked","false")):(e.classList.add("uc-bg-accents-blue","uc-text-constant-white","uc-border-transparent"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="uc-w-3 uc-h-3"><path d="M20 6 9 17l-5-5"/></svg>',t.setAttribute("aria-checked","true"))}function selectRadio(t){var e=t.closest(".uc-dropdown-menu");e.querySelectorAll(".radio-indicator").forEach(function(o){o.classList.remove("uc-border-accents-blue"),o.classList.add("uc-border-input"),o.innerHTML=""});var r=t.querySelector(".radio-indicator");r.classList.remove("uc-border-input"),r.classList.add("uc-border-accents-blue"),r.innerHTML='<div class="uc-w-2 uc-h-2 uc-rounded-full uc-bg-accents-blue"></div>'}var UCScrollView={init:function(){document.querySelectorAll(".uc-drag-scroll").forEach(function(t){if(!t.hasAttribute("data-drag-init")){t.setAttribute("data-drag-init","true");var e=!1,r=0,o=0;t.addEventListener("mousedown",function(a){e=!0,t.style.cursor="grabbing",t.style.userSelect="none",r=a.pageX-t.offsetLeft,o=t.scrollLeft}),t.addEventListener("mouseleave",function(){e=!1,t.style.cursor="grab",t.style.userSelect=""}),t.addEventListener("mouseup",function(){e=!1,t.style.cursor="grab",t.style.userSelect=""}),t.addEventListener("mousemove",function(a){if(e){a.preventDefault();var n=a.pageX-t.offsetLeft,c=(n-r)*1.5;t.scrollLeft=o-c}})}}),document.querySelectorAll(".uc-scroll-indicator").forEach(function(t){if(!t.hasAttribute("data-indicator-init")){t.setAttribute("data-indicator-init","true");var e=t.querySelector(".uc-scroll, .uc-scroll-hidden, .uc-scroll-autohide");e&&e.addEventListener("scroll",function(){var r=e.scrollTop,o=e.scrollHeight,a=e.clientHeight;t.classList.toggle("uc-show-top",r>8),t.classList.toggle("uc-show-bottom",r<o-a-8)})}}),document.querySelectorAll(".uc-scroll-indicator-h").forEach(function(t){if(!t.hasAttribute("data-indicator-h-init")){t.setAttribute("data-indicator-h-init","true");var e=t.querySelector('.uc-scroll, .uc-scroll-hidden, .uc-scroll-autohide, [class*="uc-overflow-x"]');e&&e.addEventListener("scroll",function(){var r=e.scrollLeft,o=e.scrollWidth,a=e.clientWidth;t.classList.toggle("uc-show-left",r>8),t.classList.toggle("uc-show-right",r<o-a-8)})}})}},UCNumberInput={init:function(){document.querySelectorAll("[data-number-input]").forEach(function(t){if(t.hasAttribute("data-ni-bound"))return;t.setAttribute("data-ni-bound","true");var e=t.querySelector("[data-number-value]"),r=t.querySelector('[data-action="decrement"]'),o=t.querySelector('[data-action="increment"]');if(!e)return;function a(){var c=parseInt(e.value)||0,i=e.hasAttribute("min")?parseInt(e.min):-1/0,l=e.hasAttribute("max")?parseInt(e.max):1/0;r&&(r.disabled=c<=i),o&&(o.disabled=c>=l)}function n(c){var i=parseInt(e.value)||0,l=e.hasAttribute("min")?parseInt(e.min):-1/0,s=e.hasAttribute("max")?parseInt(e.max):1/0,u=Math.min(Math.max(i+c,l),s);e.value=u,a()}r&&r.addEventListener("click",function(){n(-1)}),o&&o.addEventListener("click",function(){n(1)}),e.addEventListener("change",function(){var c=e.hasAttribute("min")?parseInt(e.min):-1/0,i=e.hasAttribute("max")?parseInt(e.max):1/0,l=parseInt(e.value)||c;e.value=Math.min(Math.max(l,c),i),a()}),a()})}},UCPopover={init:function(){document.querySelectorAll("[data-popover-trigger]").forEach(function(t){var e=t.getAttribute("data-popover-trigger");t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded","false"),e&&t.setAttribute("aria-controls",e),t.onclick=function(r){r.stopPropagation();var o=e?document.getElementById(e):null;if(o){var a=o.classList.contains("uc-open");document.querySelectorAll(".uc-popover-content").forEach(function(n){n.classList.remove("uc-open")}),document.querySelectorAll("[data-popover-trigger]").forEach(function(n){n.setAttribute("aria-expanded","false")}),a||(o.classList.add("uc-open"),t.setAttribute("aria-expanded","true"))}}}),document.body.hasAttribute("data-popover-outside-init")||(document.body.setAttribute("data-popover-outside-init","true"),document.addEventListener("click",function(t){var e=t.target;!e.closest(".uc-popover-content")&&!e.closest("[data-popover-trigger]")&&(document.querySelectorAll(".uc-popover-content").forEach(function(r){r.classList.remove("uc-open")}),document.querySelectorAll("[data-popover-trigger]").forEach(function(r){r.setAttribute("aria-expanded","false")}))}),document.addEventListener("keydown",function(t){t.key==="Escape"&&(document.querySelectorAll(".uc-popover-content").forEach(function(e){e.classList.remove("uc-open")}),document.querySelectorAll("[data-popover-trigger]").forEach(function(e){e.setAttribute("aria-expanded","false")}))}))}},UCSelect={init:function(){document.body.hasAttribute("data-select-init")||(document.body.setAttribute("data-select-init","true"),document.addEventListener("click",function(t){t.target.closest(".uc-select-wrapper")||document.querySelectorAll(".uc-select-dropdown").forEach(function(e){e.classList.remove("open")})}))}};function toggleSelect(t){var e=document.getElementById(t);document.querySelectorAll(".uc-select-dropdown").forEach(function(r){r.id!==t&&r.classList.remove("open")}),e.classList.toggle("open")}function selectItem(t,e,r){document.getElementById(e).querySelector("span").textContent=r,document.getElementById(e).querySelector("span").classList.remove("placeholder");var o=document.getElementById(t);o.querySelectorAll(".uc-select-item").forEach(function(a){a.classList.remove("selected")}),o.querySelectorAll(".uc-select-item").forEach(function(a){a.textContent.trim()===r&&a.classList.add("selected")}),o.classList.remove("open")}var UCToast={_count:0,show:function(t){var e=document.getElementById("toast-container");if(e){var r="toast-"+ ++UCToast._count,o={default:{title:"Scheduled: Catch up",desc:"Friday, February 14, 2026 at 5:57 PM",icon:"",btn:"Undo"},success:{title:"Success",desc:"Your changes have been saved.",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="uc-w-5 uc-h-5 uc-text-accents-blue"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="M22 4 12 14.01l-3-3"/></svg>',btn:""},error:{title:"Error",desc:"Something went wrong. Please try again.",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="uc-w-5 uc-h-5 uc-text-accents-red"><circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>',btn:"Retry"},action:{title:"Event created",desc:"Sunday, December 03, 2023",icon:"",btn:"Undo"}},a=o[t]||o.default,n=document.createElement("div");n.id=r,n.className="uc-flex uc-items-start uc-gap-3 uc-w-80 uc-p-4 uc-rounded-lg uc-border uc-border-border-default uc-bg-neutrals-surface uc-shadow-lg uc-mb-2",n.setAttribute("role",t==="error"?"alert":"status"),n.setAttribute("aria-live",t==="error"?"assertive":"polite"),n.setAttribute("aria-atomic","true"),n.innerHTML=(a.icon?'<div class="uc-flex-shrink-0 uc-mt-0.5">'+a.icon+"</div>":"")+'<div class="uc-flex-1 uc-min-w-0"><p class="uc-text-sm uc-font-semibold">'+a.title+'</p><p class="uc-text-xs uc-text-fg-disabled uc-mt-0.5">'+a.desc+"</p></div>"+(a.btn?'<button onclick="this.parentElement.remove()" class="uc-flex-shrink-0 uc-inline-flex uc-items-center uc-justify-center uc-rounded-lg uc-text-xs uc-font-medium uc-h-7 uc-px-2 uc-border uc-border-border-strong uc-bg-neutrals-surface uc-hover:bg-neutrals-subtle uc-transition-colors">'+a.btn+"</button>":"")+'<button onclick="this.parentElement.remove()" aria-label="Close" class="uc-flex-shrink-0 uc-p-0.5 uc-text-fg-disabled uc-hover:text-fg-primary uc-transition-colors"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="uc-w-3.5 uc-h-3.5"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>',e.appendChild(n),setTimeout(function(){var c=document.getElementById(r);c&&c.remove()},4e3)}},init:function(){window.showToast=function(t){UCToast.show(t)}}},UCDialog={init:function(){window.openDialog=function(t){var e=document.getElementById(t);if(e){e._keyHandler&&document.removeEventListener("keydown",e._keyHandler),e._previousFocus=document.activeElement,e.classList.add("uc-open"),e.removeAttribute("aria-hidden"),e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true");var r=e.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');r&&r.focus(),e._keyHandler=function(o){if(o.key==="Escape"){window.closeDialog(t);return}if(o.key==="Tab"){var a=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),n=a[0],c=a[a.length-1];o.shiftKey&&document.activeElement===n?(o.preventDefault(),c.focus()):!o.shiftKey&&document.activeElement===c&&(o.preventDefault(),n.focus())}},document.addEventListener("keydown",e._keyHandler)}},window.closeDialog=function(t){var e=document.getElementById(t);e&&(e.classList.remove("uc-open"),e.setAttribute("aria-hidden","true"),e._keyHandler&&document.removeEventListener("keydown",e._keyHandler),e._previousFocus&&typeof e._previousFocus.focus=="function"&&e._previousFocus.focus(),e._keyHandler=null,e._previousFocus=null)}}},UCTreeView={init:function(){document.querySelectorAll("[data-tree]").forEach(function(t){t.hasAttribute("data-tree-bound")||(t.setAttribute("data-tree-bound","true"),t.querySelectorAll("[data-tree-branch]").forEach(function(e){var r=e.querySelector(":scope > .uc-tree-toggle");r&&r.addEventListener("click",function(){e.classList.toggle("open")})}))})}},UCSheet={init:function(){window.openSheet=function(t){var e=document.getElementById("uc-sheet-overlay");e&&e.classList.add("uc-open");var r=document.getElementById(t);r&&(r.classList.add("uc-open"),r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"))},window.closeSheet=function(t){var e=document.getElementById("uc-sheet-overlay");e&&e.classList.remove("uc-open");var r=document.getElementById(t);r&&r.classList.remove("uc-open")},window.closeAllSheets=function(){var t=document.getElementById("uc-sheet-overlay");t&&t.classList.remove("uc-open"),document.querySelectorAll(".uc-sheet-right,.uc-sheet-bottom,.uc-sheet-left").forEach(function(e){e.classList.remove("uc-open")})},document.body.hasAttribute("data-sheet-esc-init")||(document.body.setAttribute("data-sheet-esc-init","true"),document.addEventListener("keydown",function(t){t.key==="Escape"&&window.closeAllSheets()}))}};(function(){function t(){UCAccordion.init(),UCCollapsible.init(),UCCombobox.init(),UCResizable.init(),UCCarousel.init(),UCDropdown.init(),UCScrollView.init(),UCNumberInput.init(),UCPopover.init(),UCSelect.init(),UCToast.init(),UCDialog.init(),UCTreeView.init(),UCSheet.init()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t(),document.addEventListener("astro:after-swap",function(){t()})})();