@mureka-fe/ui 2.0.0 → 3.0.0

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/dist/ui.umd.cjs CHANGED
@@ -1 +1 @@
1
- (function(_,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(_=typeof globalThis<"u"?globalThis:_||self,e(_.MurekaUi={},_.Vue))})(this,(function(_,e){"use strict";function L(t={}){return{type:t.type??"primary",status:t.status,appearance:t.appearance??"default",ghostTextTone:t.ghostTextTone??"secondary",size:t.size??"medium",shape:t.shape??"rectangular",disabled:t.disabled??!1,loading:t.loading??!1,iconOnly:t.iconOnly??!1,nativeType:t.nativeType??"button"}}function se(t={}){const o=L(t),a=["mu-button",`mu-button--${o.type}`,`mu-button--appearance-${o.appearance}`,`mu-button--${o.size}`];return o.type==="ghost"&&o.ghostTextTone==="primary"&&a.push(`mu-button--ghost-text-${o.ghostTextTone}`),o.shape==="pill"&&a.push("mu-button--shape-pill"),o.status&&a.push(`mu-button--status-${o.status}`),o.iconOnly&&a.push("mu-button--icon-only"),o.disabled&&a.push("is-disabled"),o.loading&&a.push("is-loading"),a}function le(t={}){const o=L(t);return!o.disabled&&!o.loading}function ce(t={}){const o=t.iconOnly??!1,a=t.hasPrefix??!1,s=t.hasSuffix??!1,r=t.loading??!1,n=t.hasAriaLabel??!1;return{showPrefixSlot:!o&&!r&&a,showSuffixSlot:!o&&s,showLoadingIndicator:r,requiresAriaLabel:o&&!n,isInvalidIconOnlyCombination:o&&(a||s)}}const ie=["type","disabled","aria-busy"],re={key:0,class:"mu-button__prefix","aria-hidden":"true"},de={class:"mu-button__content"},ue={key:1,class:"mu-button__suffix","aria-hidden":"true"},me=e.defineComponent({__name:"Button",props:{type:{default:"primary"},status:{},appearance:{default:"default"},ghostTextTone:{default:"secondary"},size:{default:"medium"},shape:{default:"rectangular"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},iconOnly:{type:Boolean,default:!1},nativeType:{default:"button"}},emits:["click"],setup(t,{emit:o}){const a=t,s=o,r=e.useSlots(),n=e.useAttrs(),l={small:{width:"var(--mu-button-icon-size-small)",height:"var(--mu-button-icon-size-small)"},medium:{width:"var(--mu-button-icon-size-medium)",height:"var(--mu-button-icon-size-medium)"},large:{width:"var(--mu-button-icon-size-large)",height:"var(--mu-button-icon-size-large)"}},u=e.computed(()=>L(a)),i=e.computed(()=>se(u.value)),c=e.computed(()=>l[u.value.size]),d=e.computed(()=>ce({iconOnly:u.value.iconOnly,hasPrefix:!!r.prefix,hasSuffix:!!r.suffix,loading:u.value.loading,hasDefaultSlot:!!r.default,hasAriaLabel:typeof n["aria-label"]=="string"&&n["aria-label"].trim().length>0}));function y(p){if(!le(u.value)){p.preventDefault(),p.stopPropagation();return}s("click",p)}return(p,g)=>(e.openBlock(),e.createElementBlock("button",{type:u.value.nativeType,class:e.normalizeClass(["mu-button",i.value]),disabled:u.value.disabled||u.value.loading,"aria-busy":u.value.loading?"true":void 0,onClick:y},[d.value.showLoadingIndicator||d.value.showPrefixSlot?(e.openBlock(),e.createElementBlock("span",re,[d.value.showLoadingIndicator?(e.openBlock(),e.createElementBlock("svg",{key:0,class:"mu-button__loading-icon",style:e.normalizeStyle(c.value),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...g[0]||(g[0]=[e.createElementVNode("path",{d:"M2.00293 12C2.00293 6.47853 6.47853 2.00293 12 2.00293C12.5509 2.00293 12.9971 2.4491 12.9971 3C12.9971 3.5509 12.5509 3.99707 12 3.99707C7.58034 3.99707 3.99707 7.58034 3.99707 12C3.99707 16.4197 7.58034 20.0029 12 20.0029C16.4197 20.0029 20.0029 16.4197 20.0029 12C20.0029 11.4491 20.4491 11.0029 21 11.0029C21.5509 11.0029 21.9971 11.4491 21.9971 12C21.9971 17.5215 17.5215 21.9971 12 21.9971C6.47853 21.9971 2.00293 17.5215 2.00293 12Z",fill:"currentColor"},null,-1)])],4)):e.renderSlot(p.$slots,"prefix",{key:1},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("span",de,[e.renderSlot(p.$slots,"default",{},void 0,!0)]),d.value.showSuffixSlot?(e.openBlock(),e.createElementBlock("span",ue,[e.renderSlot(p.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],10,ie))}}),$=(t,o)=>{const a=t.__vccOpts||t;for(const[s,r]of o)a[s]=r;return a},A=$(me,[["__scopeId","data-v-42de128c"]]),fe=3e3,he={close:()=>{}},M=e.reactive({items:[]});let pe=1;const x=new Map;function ge(t){return typeof t=="string"?{title:t}:{title:t.title,description:t.description,duration:t.duration,closable:t.closable,resetOnHover:t.resetOnHover,icon:t.icon}}function O(t){return t.duration>0}function ke(t){return M.items.findIndex(o=>o.id===t)}function q(t){return M.items.find(o=>o.id===t)}function R(t){const o=x.get(t);o&&o.timer!==null&&(globalThis.clearTimeout(o.timer),o.timer=null)}function D(t){const o=ke(t);o<0||(R(t),x.delete(t),M.items.splice(o,1))}function K(t,o){const a=x.get(t);a&&(R(t),a.remainingDuration=o,a.deadline=Date.now()+o,a.isPaused=!1,a.timer=globalThis.setTimeout(()=>{D(t)},o))}function be(t,o){return{id:pe++,type:t,title:o.title,description:o.description,duration:o.duration??fe,closable:o.closable??!1,resetOnHover:o.resetOnHover??!1,icon:o.icon}}function _e(){return typeof globalThis.window<"u"&&typeof globalThis.document<"u"}function ye(t,o){if(!_e())return he;const a=ge(o),s=be(t,a);return M.items.push(s),x.set(s.id,{timer:null,deadline:0,remainingDuration:s.duration,isPaused:!1}),O(s)&&K(s.id,s.duration),{close:()=>D(s.id)}}function E(t){return o=>ye(t,o)}const Ce={success:E("success"),warning:E("warning"),loading:E("loading"),error:E("error"),danger:E("danger")};function we(t){D(t)}function ve(t){const o=x.get(t),a=q(t);!o||!a||o.isPaused||!a.resetOnHover||!O(a)||(o.remainingDuration=Math.max(o.deadline-Date.now(),0),R(t),o.isPaused=!0)}function Be(t){const o=x.get(t),a=q(t);!o||!a||!o.isPaused||!a.resetOnHover||!O(a)||K(t,o.remainingDuration||a.duration)}const Ve={class:"mu-message-list","aria-live":"polite","aria-atomic":"true"},Te=["onMouseenter","onMouseleave"],Se={class:"mu-message__icon","aria-hidden":"true"},$e={class:"mu-message__content"},Ne={class:"mu-message__title"},xe={key:0,class:"mu-message__description"},Me=["onClick"],Ee=$(e.defineComponent({__name:"MessageList",setup(t){const o=e.computed(()=>M.items),a=e.defineComponent({name:"MarkupIcon",props:{markup:{type:String,required:!0}},setup(i){return()=>e.h("span",{class:"mu-message__icon-markup",innerHTML:i.markup})}});function s(i){return typeof i!="string"}function r(i){ve(i)}function n(i){Be(i)}function l(i){if(!(i instanceof globalThis.HTMLElement))return;const c=i.getBoundingClientRect();i.style.width=`${c.width}px`,i.style.height=`${c.height}px`}const u={success:'<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 6.5L9.5 17L4 11.5" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',warning:'<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 4.5L20 18.5H4L12 4.5Z" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/><path d="M12 9.5V13.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><circle cx="12" cy="16.5" r="1" fill="currentColor"/></svg>',loading:'<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="8" stroke="currentColor" stroke-width="2"/><path d="M12 8V12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M12 12H15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>',error:'<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="8" stroke="currentColor" stroke-width="2"/><path d="M12 9V12.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><circle cx="12" cy="15.5" r="1" fill="currentColor"/></svg>',danger:'<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="8" stroke="currentColor" stroke-width="2"/><path d="M9 9L15 15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M15 9L9 15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'};return(i,c)=>(e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(e.TransitionGroup,{name:"mu-message-fade",tag:"div",class:"mu-message-list__stack",onBeforeLeave:l},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id,class:e.normalizeClass(["mu-message",[`mu-message--${d.type}`,{"mu-message--compact":!d.description}]]),role:"status",onMouseenter:y=>r(d.id),onMouseleave:y=>n(d.id)},[e.createElementVNode("span",Se,[d.icon&&s(d.icon)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.icon),{key:0})):(e.openBlock(),e.createBlock(e.unref(a),{key:1,markup:typeof d.icon=="string"?d.icon:u[d.type]},null,8,["markup"]))]),e.createElementVNode("div",$e,[e.createElementVNode("div",Ne,e.toDisplayString(d.title),1),d.description?(e.openBlock(),e.createElementBlock("p",xe,e.toDisplayString(d.description),1)):e.createCommentVNode("",!0)]),d.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"mu-message__close","aria-label":"Close message",onClick:y=>e.unref(we)(d.id)},[...c[0]||(c[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 5L19 19M19 5L5 19",stroke:"white","stroke-width":"1.8","stroke-linecap":"round"})],-1)])],8,Me)):e.createCommentVNode("",!0)],42,Te))),128))]),_:1})]))}}),[["__scopeId","data-v-debf98d8"]]),Pe={medium:{width:"548px",minHeight:"228px"},large:{width:"800px",minHeight:"500px"}};function H(t={}){const o=t.size??"medium",a=Pe[o],s=t.variant??"form";return{visible:t.visible??!1,title:t.title??"",status:t.status??"default",variant:s,size:o,width:t.width??a.width,minHeight:a.minHeight,maskClosable:t.maskClosable??!0,escToClose:t.escToClose??!0,closable:t.closable??!0,okText:t.okText??"Confirm",cancelText:t.cancelText??"Cancel",hideCancel:t.hideCancel??s==="feedback",hideOk:t.hideOk??!1,okLoading:t.okLoading??!1}}function ze(t={}){const o=H(t),a=["mu-modal",`mu-modal--${o.size}`,`mu-modal--${o.status}`,`mu-modal--variant-${o.variant}`];return o.variant==="feedback"&&a.push("mu-modal--feedback"),a}function Ie(t={}){const o=H(t);return o.variant==="feedback"?{type:"secondary",status:o.status==="default"?void 0:o.status}:o.status==="danger"?{type:"secondary",status:"danger"}:{type:"primary"}}const Le={key:0,class:"mu-modal-root"},Ae={class:"mu-modal__header"},Oe=["data-status"],Re={class:"mu-modal__body"},De={key:0,class:"mu-modal__footer"},X=$(e.defineComponent({inheritAttrs:!1,__name:"Modal",props:{visible:{type:Boolean,default:!1},title:{default:""},status:{default:"default"},variant:{default:"form"},size:{default:"medium"},width:{},maskClosable:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},okText:{default:"Confirm"},cancelText:{default:"Cancel"},okLoading:{type:Boolean,default:!1},hideOk:{type:Boolean,default:!1},hideCancel:{type:Boolean,default:void 0}},emits:["update:visible","ok","cancel","close"],setup(t,{emit:o}){const a=t,s=o,r=e.useAttrs(),n=e.computed(()=>H(a)),l=e.computed(()=>[ze(a),r.class]),u=e.computed(()=>{const{class:m,style:C,...V}=r;return V}),i=e.computed(()=>Ie(a)),c=e.computed(()=>n.value.variant==="feedback"&&n.value.hideCancel),d=e.computed(()=>[{width:n.value.width,minHeight:n.value.minHeight},r.style]),y=`mu-modal-title-${Math.random().toString(36).slice(2,10)}`,g=typeof globalThis.document<"u"?globalThis.document:null;function v(){s("update:visible",!1)}function b(){n.value.maskClosable&&(v(),s("cancel",new globalThis.MouseEvent("click")))}function h(){v(),s("close")}function B(m){s("cancel",m),v()}function S(m){s("ok",m)}function N(m){m.key!=="Escape"||!n.value.visible||!n.value.escToClose||(v(),s("close"))}return e.onMounted(()=>{g&&g.addEventListener("keydown",N)}),e.onBeforeUnmount(()=>{g&&(g.removeEventListener("keydown",N),g.body.style.overflow="")}),e.watch(()=>n.value.visible,m=>{g&&(g.body.style.overflow=m?"hidden":"")},{immediate:!0}),(m,C)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[n.value.visible?(e.openBlock(),e.createElementBlock("div",Le,[e.createElementVNode("div",{class:"mu-modal__mask",onClick:b}),e.createElementVNode("div",e.mergeProps(u.value,{class:l.value,style:d.value,role:"dialog","aria-modal":"true","aria-labelledby":y}),[e.createElementVNode("header",Ae,[e.createElementVNode("div",{id:y,class:"mu-modal__title","data-status":n.value.status},[e.renderSlot(m.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(n.value.title),1)],!0)],8,Oe),n.value.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"mu-modal__close","aria-label":"Close dialog",onClick:h},[...C[0]||(C[0]=[e.createElementVNode("span",{class:"mu-modal__close-icon","aria-hidden":"true"},[e.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 5L15 15",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"}),e.createElementVNode("path",{d:"M15 5L5 15",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})])],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Re,[e.renderSlot(m.$slots,"default",{},void 0,!0)]),m.$slots.footer||!n.value.hideOk||!n.value.hideCancel?(e.openBlock(),e.createElementBlock("footer",De,[e.renderSlot(m.$slots,"footer",{},()=>[n.value.hideCancel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(A),{key:0,type:"ghost",class:"mu-modal__cancel",onClick:B},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value.cancelText),1)]),_:1})),n.value.hideOk?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(A),e.mergeProps({key:1},i.value,{loading:n.value.okLoading,class:["mu-modal__ok",{"mu-modal__ok--block":c.value}],onClick:S}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value.okText),1)]),_:1},16,["loading","class"]))],!0)])):e.createCommentVNode("",!0)],16)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-e94991b0"]]);function He(t){return t===void 0?null:typeof t=="function"?t():t}function P(t={}){return typeof globalThis.document>"u"?Promise.resolve(!1):new Promise(o=>{const a=globalThis.document.createElement("div");globalThis.document.body.appendChild(a);const s=e.ref(!0);let r=null,n=!1;const l=()=>{r&&(r.unmount(),r=null),a.parentNode&&a.parentNode.removeChild(a)},u=d=>{n||(n=!0,s.value=!1,queueMicrotask(()=>{l(),o(d)}))},{content:i,...c}=t;r=e.createApp({render(){return e.h(X,{...c,visible:s.value,"onUpdate:visible":d=>{d||u(!1)},onOk:()=>u(!0),onCancel:()=>u(!1),onClose:()=>u(!1)},{default:()=>He(i)})}}),r.mount(a)})}const Ge={show:P,confirm:(t={})=>P(t),success:(t={})=>P({...t,variant:"feedback",status:"success"}),danger:(t={})=>P({...t,variant:"feedback",status:"danger"})},Z=Symbol("MuRadioGroup"),Ue=["horizontal","vertical"];function je(t,o){return typeof o=="string"&&t.includes(o)}function Fe(t){return je(Ue,t)}function J(t={}){return{modelValue:t.modelValue,value:t.value??!0,defaultChecked:t.defaultChecked??!1,disabled:t.disabled??!1,name:t.name}}function Q(t={}){return{modelValue:t.modelValue,defaultValue:t.defaultValue,disabled:t.disabled??!1,name:t.name,direction:Fe(t.direction)?t.direction:"horizontal"}}function qe(t={}){return t.modelValue!==void 0}function Ke(t={}){return t.modelValue!==void 0}function G(t,o){return Object.is(t,o)}function Xe(t={},o={}){const a=J(t),s=["mu-radio"];return o.checked&&s.push("is-checked"),(o.disabled||a.disabled)&&s.push("is-disabled"),s}function Ze(t={}){const o=Q(t),a=["mu-radio-group",`mu-radio-group--${o.direction}`];return o.disabled&&a.push("is-disabled"),a}const Je=["checked","disabled","name","value"],Qe={class:"mu-radio__label"},We=$(e.defineComponent({inheritAttrs:!1,__name:"Radio",props:{modelValue:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:!0},defaultChecked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:{default:void 0}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:o}){const a=t,s=o,r=e.useAttrs(),n=e.inject(Z,null),l=e.computed(()=>J(a)),u=e.computed(()=>qe(a)),i=e.ref(l.value.defaultChecked),c=e.computed(()=>n?G(n.value.value,l.value.value):u.value?G(l.value.modelValue,l.value.value):i.value),d=e.computed(()=>l.value.disabled||!!(n!=null&&n.disabled.value)),y=e.computed(()=>(n==null?void 0:n.name.value)??l.value.name),p=e.computed(()=>String(l.value.value)),g=e.computed(()=>[Xe(a,{checked:c.value,disabled:d.value}),r.class]),v=e.computed(()=>{const{class:m,style:C,...V}=r;return V}),b=e.computed(()=>r.style);function h(m,C){u.value||(i.value=!0),s("update:modelValue",m),s("change",m,C)}function B(m){if(d.value)return;const C=l.value.value,V=m.target instanceof globalThis.HTMLInputElement?m.target:null;if(n){n.select(C,m),e.nextTick(()=>{V&&(V.checked=c.value)});return}h(C,m),e.nextTick(()=>{V&&(V.checked=c.value)})}function S(m){s("focus",m)}function N(m){s("blur",m)}return(m,C)=>(e.openBlock(),e.createElementBlock("label",e.mergeProps(v.value,{class:g.value,style:b.value}),[e.createElementVNode("input",{class:"mu-radio__input",type:"radio",checked:c.value,disabled:d.value,name:y.value,value:p.value,onChange:B,onFocus:S,onBlur:N},null,40,Je),C[0]||(C[0]=e.createElementVNode("span",{class:"mu-radio__control","aria-hidden":"true"},[e.createElementVNode("span",{class:"mu-radio__dot"})],-1)),e.createElementVNode("span",Qe,[e.renderSlot(m.$slots,"default",{},void 0,!0)])],16))}}),[["__scopeId","data-v-f1283749"]]),Ye=$(e.defineComponent({inheritAttrs:!1,__name:"RadioGroup",props:{modelValue:{type:[String,Number,Boolean],default:void 0},defaultValue:{type:[String,Number,Boolean],default:void 0},disabled:{type:Boolean,default:!1},name:{default:void 0},direction:{default:"horizontal"}},emits:["update:modelValue","change"],setup(t,{emit:o}){const a=t,s=o,r=e.useAttrs(),n=e.computed(()=>Q(a)),l=e.computed(()=>Ke(a)),u=e.ref(n.value.defaultValue),i=e.computed(()=>l.value?n.value.modelValue:u.value),c=e.computed(()=>n.value.disabled),d=e.computed(()=>n.value.name),y=e.computed(()=>[Ze(a),r.class]),p=e.computed(()=>{const{class:b,style:h,...B}=r;return B}),g=e.computed(()=>r.style);function v(b,h){n.value.disabled||G(i.value,b)||(l.value||(u.value=b),s("update:modelValue",b),s("change",b,h))}return e.provide(Z,{value:i,disabled:c,name:d,select:v}),(b,h)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps(p.value,{role:"radiogroup",class:y.value,style:g.value}),[e.renderSlot(b.$slots,"default",{},void 0,!0)],16))}}),[["__scopeId","data-v-3879fec4"]]),et=["circle","round","line"],tt=["small","medium"];function W(t,o){return typeof o=="string"&&t.includes(o)}function ot(t){return W(et,t)}function at(t){return W(tt,t)}function U(t={}){return{modelValue:t.modelValue,defaultChecked:t.defaultChecked??!1,disabled:t.disabled??!1,loading:t.loading??!1,type:ot(t.type)?t.type:"circle",size:at(t.size)?t.size:"medium",checkedValue:t.checkedValue??!0,uncheckedValue:t.uncheckedValue??!1,checkedColor:t.checkedColor,uncheckedColor:t.uncheckedColor,beforeChange:t.beforeChange,checkedText:t.checkedText,uncheckedText:t.uncheckedText}}function nt(t={}){return t.modelValue!==void 0}function Y(t,o){return Object.is(t,o.checkedValue)}function st(t,o){return Y(t,o)?o.uncheckedValue:o.checkedValue}function lt(t){return t.type!=="line"&&t.size!=="small"}function ct(t={},o={}){const a=U(t),s=["mu-switch",`mu-switch--${a.type}`,`mu-switch--${a.size}`];return o.checked&&s.push("is-checked"),a.disabled&&s.push("is-disabled"),(a.loading||o.loading)&&s.push("is-loading"),s}const it=["aria-checked","disabled"],rt={class:"mu-switch__thumb","aria-hidden":"true"},dt={key:0,class:"mu-switch__loading-icon",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ut={key:0,class:"mu-switch__label"},mt=$(e.defineComponent({inheritAttrs:!1,__name:"Switch",props:{modelValue:{type:[String,Number,Boolean],default:void 0},defaultChecked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},type:{default:"circle"},size:{default:"medium"},checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},checkedColor:{},uncheckedColor:{},beforeChange:{},checkedText:{},uncheckedText:{}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:o}){const a=t,s=o,r=e.useAttrs(),n=e.useSlots(),l=e.ref(!1),u=U(a),i=e.ref(u.defaultChecked?u.checkedValue:u.uncheckedValue),c=e.computed(()=>U(a)),d=e.computed(()=>nt(a)),y=e.computed(()=>d.value?c.value.modelValue:i.value),p=e.computed(()=>Y(y.value,c.value)),g=e.computed(()=>c.value.loading||l.value),v=e.computed(()=>lt(c.value)),b=e.computed(()=>v.value?p.value?!!(n.checked||c.value.checkedText):!!(n.unchecked||c.value.uncheckedText):!1),h=e.computed(()=>[ct(a,{checked:p.value,loading:l.value}),{"has-label":b.value},r.class]),B=e.computed(()=>{const{class:f,style:w,type:k,...T}=r;return T}),S=e.computed(()=>{const f={};return c.value.checkedColor&&(f["--mu-switch-current-checked-bg"]=c.value.checkedColor,f["--mu-switch-current-checked-border"]=c.value.checkedColor,f["--mu-switch-current-checked-thumb"]=c.value.checkedColor,f["--mu-switch-current-checked-glow"]=`0 0 12px ${c.value.checkedColor}`),c.value.uncheckedColor&&(f["--mu-switch-current-unchecked-bg"]=c.value.uncheckedColor),[f,r.style]});function N(){}function m(f){const w=c.value.beforeChange;if(!w)return!0;try{const k=w(f);return k instanceof Promise?(l.value=!0,k.then(T=>T!==!1).catch(()=>!1)):k!==!1}catch{return!1}}function C(f,w){d.value||(i.value=f),s("update:modelValue",f),s("change",f,w)}function V(f){if(c.value.disabled||g.value)return;const w=st(y.value,c.value),k=m(w);if(k instanceof Promise){k.then(T=>{T&&C(w,f)}).finally(()=>{l.value=!1});return}k&&C(w,f)}function z(f){s("focus",f)}function j(f){s("blur",f)}return(f,w)=>(e.openBlock(),e.createElementBlock("button",e.mergeProps(B.value,{type:"button",role:"switch",class:h.value,style:S.value,"aria-checked":p.value?"true":"false",disabled:c.value.disabled||g.value,onClick:V,onFocus:z,onBlur:j}),[w[1]||(w[1]=e.createElementVNode("span",{class:"mu-switch__line-track","aria-hidden":"true"},null,-1)),e.createElementVNode("span",rt,[g.value?(e.openBlock(),e.createElementBlock("svg",dt,[...w[0]||(w[0]=[e.createElementVNode("path",{d:"M8 1.5C8.41421 1.5 8.75 1.83579 8.75 2.25C8.75 2.66421 8.41421 3 8 3C5.23858 3 3 5.23858 3 8C3 10.7614 5.23858 13 8 13C10.7614 13 13 10.7614 13 8C13 7.58579 13.3358 7.25 13.75 7.25C14.1642 7.25 14.5 7.58579 14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8C1.5 4.41015 4.41015 1.5 8 1.5Z",fill:"currentColor"},null,-1)])])):p.value?e.renderSlot(f.$slots,"checked-icon",{key:1},void 0,!0):e.renderSlot(f.$slots,"unchecked-icon",{key:2},void 0,!0)]),b.value?(e.openBlock(),e.createElementBlock("span",ut,[p.value?e.renderSlot(f.$slots,"checked",{key:0},()=>[e.createTextVNode(e.toDisplayString(c.value.checkedText),1)],!0):e.renderSlot(f.$slots,"unchecked",{key:1},()=>[e.createTextVNode(e.toDisplayString(c.value.uncheckedText),1)],!0)])):e.createCommentVNode("",!0)],16,it))}}),[["__scopeId","data-v-8cfb8f2a"]]),ee=Symbol("MuTabs"),ft=["line","segment"],ht=["small","medium","large"],pt=["white","ghost"],gt=["content","equal"];function I(t,o){return typeof o=="string"&&t.includes(o)}function kt(t){return I(ft,t)}function bt(t){return I(ht,t)}function _t(t){return I(pt,t)}function yt(t){return I(gt,t)}function te(t={}){const o=t,a=kt(o.variant)?o.variant:"line";return{modelValue:t.modelValue,defaultValue:t.defaultValue,variant:a,appearance:a==="segment"&&_t(o.appearance)?o.appearance:a==="segment"?"white":void 0,size:bt(o.size)?o.size:"medium",layout:yt(o.layout)?o.layout:"content",disabled:t.disabled??!1}}function Ct(t){return{value:t.value,disabled:t.disabled??!1}}function wt(t={}){return t.modelValue!==void 0}function oe(t,o){return Object.is(t,o)}function vt(t={}){const o=te(t),a=["mu-tabs",`mu-tabs--variant-${o.variant}`,`mu-tabs--size-${o.size}`,`mu-tabs--layout-${o.layout}`];return o.variant==="segment"&&a.push(`mu-tabs--appearance-${o.appearance}`),o.disabled&&a.push("is-disabled"),a}function Bt(t,o={}){const a=["mu-tab"];return o.active&&a.push("is-active"),(o.disabled||t.disabled)&&a.push("is-disabled"),a}const Vt=["aria-selected","disabled"],Tt={key:0,class:"mu-tab__prefix","aria-hidden":"true"},St={class:"mu-tab__content"},$t={key:1,class:"mu-tab__suffix","aria-hidden":"true"},Nt=$(e.defineComponent({inheritAttrs:!1,__name:"Tab",props:{value:{},disabled:{type:Boolean}},emits:["click"],setup(t,{emit:o}){const a=t,s=o,r=e.useAttrs(),n=e.useSlots(),l=e.inject(ee,null),u=e.ref(null),i=e.computed(()=>Ct(a)),c=e.computed(()=>l?oe(l.value.value,i.value.value):!1),d=e.computed(()=>i.value.disabled||!!(l!=null&&l.disabled.value)),y=e.computed(()=>[Bt(a,{active:c.value,disabled:d.value}),r.class]),p=e.computed(()=>{const{class:h,style:B,...S}=r;return S}),g=e.computed(()=>r.style);function v(){!l||!u.value||l.registerItem(i.value.value,u.value)}function b(h){if(d.value){h.preventDefault(),h.stopPropagation();return}l&&l.select(i.value.value,h),s("click",h)}return e.onMounted(()=>{v()}),e.onBeforeUnmount(()=>{l==null||l.unregisterItem(i.value.value)}),e.watch(()=>i.value.value,(h,B)=>{!l||!u.value||(l.unregisterItem(B),l.registerItem(h,u.value))}),(h,B)=>(e.openBlock(),e.createElementBlock("button",e.mergeProps({ref_key:"buttonRef",ref:u},p.value,{type:"button",role:"tab",class:y.value,style:g.value,"aria-selected":c.value?"true":"false",disabled:d.value,onClick:b}),[e.unref(n).prefix?(e.openBlock(),e.createElementBlock("span",Tt,[e.renderSlot(h.$slots,"prefix",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("span",St,[e.renderSlot(h.$slots,"default",{},void 0,!0)]),e.unref(n).suffix?(e.openBlock(),e.createElementBlock("span",$t,[e.renderSlot(h.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],16,Vt))}}),[["__scopeId","data-v-97f04990"]]),xt=$(e.defineComponent({inheritAttrs:!1,__name:"Tabs",props:{modelValue:{},defaultValue:{},size:{},layout:{},disabled:{type:Boolean},variant:{},appearance:{}},emits:["update:modelValue","change"],setup(t,{emit:o}){const a=t,s=o,r=e.useAttrs(),n=e.ref(null),l=e.computed(()=>te(a)),u=e.computed(()=>wt(a)),i=e.ref(l.value.defaultValue),c=e.computed(()=>u.value?l.value.modelValue:i.value),d=e.computed(()=>l.value.variant),y=e.computed(()=>l.value.appearance),p=e.computed(()=>l.value.size),g=e.computed(()=>l.value.layout),v=e.computed(()=>l.value.disabled),b=e.ref(!1),h=e.ref(0),B=new Map,S=e.ref({transform:"translateX(0px)",width:"0px"}),N=e.computed(()=>[vt(a),r.class]),m=e.computed(()=>{const{class:k,style:T,...F}=r;return F}),C=e.computed(()=>r.style);function V(){const k=n.value,T=c.value!==void 0?B.get(c.value):void 0;if(!k||!T){S.value={transform:"translateX(0px)",width:"0px"};return}const F=k.getBoundingClientRect(),ne=T.getBoundingClientRect();S.value={transform:`translateX(${ne.left-F.left}px)`,width:`${ne.width}px`}}function z(){e.nextTick(()=>{V()})}function j(k,T){v.value||oe(c.value,k)||(u.value||(i.value=k),s("update:modelValue",k),s("change",k,T))}function f(k,T){B.set(k,T),h.value+=1,z()}function w(k){B.delete(k),h.value+=1,z()}return e.provide(ee,{value:c,variant:d,appearance:y,size:p,layout:g,disabled:v,select:j,registerItem:f,unregisterItem:w}),e.watch([c,d,p,g,h],()=>{z()},{flush:"post"}),e.onMounted(()=>{globalThis.window.addEventListener("resize",V),e.nextTick(()=>{V(),b.value=!0})}),e.onBeforeUnmount(()=>{globalThis.window.removeEventListener("resize",V)}),(k,T)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({ref_key:"rootRef",ref:n},m.value,{role:"tablist",class:[N.value,{"is-ready":b.value}],style:C.value}),[e.renderSlot(k.$slots,"default",{},void 0,!0),e.createElementVNode("span",{class:"mu-tabs__indicator",style:e.normalizeStyle(S.value),"aria-hidden":"true"},null,4)],16))}}),[["__scopeId","data-v-28e8c4f7"]]),Mt=["outline","solid","soft"];function Et(t,o){return typeof o=="string"&&t.includes(o)}function Pt(t){return Et(Mt,t)}function ae(t={}){return{variant:Pt(t.variant)?t.variant:"outline",selected:t.selected??!1,disabled:t.disabled??!1}}function zt(t={}){const o=ae(t),a=["mu-tag",`mu-tag--variant-${o.variant}`];return o.selected&&a.push("is-selected"),o.disabled&&a.push("is-disabled"),a}const It=["disabled","aria-pressed"],Lt={key:0,class:"mu-tag__prefix","aria-hidden":"true"},At={class:"mu-tag__content"},Ot={key:1,class:"mu-tag__suffix","aria-hidden":"true"},Rt=$(e.defineComponent({__name:"Tag",props:{variant:{},selected:{type:Boolean},disabled:{type:Boolean}},emits:["update:selected","click"],setup(t,{emit:o}){const a=t,s=o,r=e.useSlots(),n=e.computed(()=>ae(a)),l=e.computed(()=>zt(a));function u(i){n.value.disabled||(s("click",i),s("update:selected",!n.value.selected))}return(i,c)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:e.normalizeClass(l.value),disabled:n.value.disabled,"aria-pressed":n.value.selected,onClick:u},[e.unref(r).prefix?(e.openBlock(),e.createElementBlock("span",Lt,[e.renderSlot(i.$slots,"prefix",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("span",At,[e.renderSlot(i.$slots,"default",{},void 0,!0)]),e.unref(r).suffix?(e.openBlock(),e.createElementBlock("span",Ot,[e.renderSlot(i.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],10,It))}}),[["__scopeId","data-v-e3e9ee4d"]]);_.MessageList=Ee,_.MuButton=A,_.MuModal=X,_.MuRadio=We,_.MuRadioGroup=Ye,_.MuSwitch=mt,_.MuTab=Nt,_.MuTabs=xt,_.MuTag=Rt,_.message=Ce,_.muModal=Ge,_.openMuModal=P,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.MurekaUi={},b.Vue))})(this,(function(b,e){"use strict";const re=["new","new-mini","premier","pro","beta","free","studio","upload","publish","published","details","bpm"],ie=["outline","solid","soft"],ce={new:{isSvgPreset:!0},"new-mini":{isSvgPreset:!0},premier:{defaultContent:"Premier"},pro:{defaultContent:"Pro"},beta:{defaultContent:"Beta"},free:{defaultContent:"1 Free"},studio:{defaultContent:"Studio"},upload:{defaultContent:"Upload"},publish:{defaultContent:"Publish"},published:{defaultContent:"Published"},details:{defaultContent:"Details"},bpm:{defaultContent:"62 BPM"}};function Z(t,o){return typeof o=="string"&&t.includes(o)}function de(t){return Z(ie,t)}function ue(t){return Z(re,t)}function q(t={}){if(ue(t.preset)){const o=ce[t.preset];return{preset:t.preset,defaultContent:o.defaultContent,isSvgPreset:o.isSvgPreset??!1}}return{variant:de(t.variant)?t.variant:"outline",paid:t.paid??!1,isSvgPreset:!1}}function me(t={}){const o=q(t),a=["mu-badge"];return o.preset?(a.push(`mu-badge--preset-${o.preset}`),o.isSvgPreset&&a.push("mu-badge--svg"),o.preset==="details"&&a.push("mu-badge--with-default-icon"),a):(a.push(`mu-badge--variant-${o.variant}`,o.paid?"is-paid":"is-free"),a)}const fe=["role","aria-label"],pe={key:0,"data-test":"new-wordmark",class:"mu-badge__new-wordmark",viewBox:"0 0 20 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},he={key:1,"data-test":"new-mini-wordmark",class:"mu-badge__new-wordmark",viewBox:"0 0 15 6",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},ge={key:0,class:"mu-badge__prefix","aria-hidden":"true"},ke={class:"mu-badge__content"},be=e.defineComponent({__name:"Badge",props:{variant:{},paid:{type:Boolean},preset:{}},setup(t){const o=t,a=e.computed(()=>q(o)),s=e.computed(()=>me(o)),c=e.computed(()=>a.value.isSvgPreset?"img":void 0),n=e.computed(()=>a.value.isSvgPreset?"NEW":void 0),l=e.computed(()=>a.value.preset==="details");return(u,r)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(s.value),role:c.value,"aria-label":n.value},[a.value.isSvgPreset?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a.value.preset==="new"?(e.openBlock(),e.createElementBlock("svg",pe,[...r[0]||(r[0]=[e.createElementVNode("path",{d:"M0 8V0H1.49679L3.84103 6.65205C3.82636 6.44018 3.80802 6.18813 3.78601 5.89589C3.76399 5.60365 3.74565 5.30046 3.73098 4.9863C3.72364 4.67215 3.71997 4.38721 3.71997 4.13151V0H4.82055V8H3.32376L0.990525 1.34794C1.0052 1.5379 1.01987 1.77534 1.03455 2.06027C1.05656 2.34521 1.07123 2.6411 1.07857 2.94795C1.09325 3.25479 1.10058 3.53973 1.10058 3.80274V8H0Z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M7.40262 8V0H12.1241V1.05205H8.56924V3.32055H11.7389V4.36164H8.56924V6.94795H12.1241V8H7.40262Z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M14.7282 8L13.8587 0H14.9263L15.4656 5.74247C15.4803 5.88858 15.4913 6.04932 15.4986 6.22466C15.5133 6.4 15.5243 6.57169 15.5316 6.73973C15.5463 6.90776 15.5536 7.05388 15.5536 7.17808C15.5683 7.05388 15.583 6.90776 15.5977 6.73973C15.6123 6.57169 15.627 6.4 15.6417 6.22466C15.6637 6.04932 15.6857 5.88858 15.7077 5.74247L16.4011 0H17.5017L18.151 5.74247C18.1657 5.88858 18.1804 6.04932 18.195 6.22466C18.2171 6.4 18.2391 6.57169 18.2611 6.73973C18.2831 6.90776 18.2978 7.05388 18.3051 7.17808C18.3124 7.05388 18.3198 6.90776 18.3271 6.73973C18.3418 6.57169 18.3565 6.4 18.3711 6.22466C18.3858 6.04932 18.4005 5.88858 18.4152 5.74247L18.9655 0H20L19.0975 8H17.7218L17.0724 2.18082C17.0578 2.0274 17.0431 1.86667 17.0284 1.69863C17.0138 1.52329 16.9991 1.35525 16.9844 1.19452C16.9697 1.02648 16.9551 0.887671 16.9404 0.778082C16.933 0.887671 16.922 1.02648 16.9074 1.19452C16.8927 1.35525 16.878 1.52329 16.8633 1.69863C16.8487 1.86667 16.8303 2.0274 16.8083 2.18082L16.1149 8H14.7282Z",fill:"currentColor"},null,-1)])])):a.value.preset==="new-mini"?(e.openBlock(),e.createElementBlock("svg",he,[...r[1]||(r[1]=[e.createElementVNode("path",{d:"M0 6V0H1.12259L2.88078 4.98904C2.86977 4.83014 2.85601 4.6411 2.8395 4.42192C2.823 4.20274 2.80924 3.97534 2.79823 3.73973C2.79273 3.50411 2.78998 3.29041 2.78998 3.09863V0H3.61542V6H2.49282L0.742893 1.01096C0.753899 1.15342 0.764905 1.33151 0.775911 1.54521C0.79242 1.7589 0.803426 1.98082 0.808928 2.21096C0.819934 2.4411 0.825437 2.65479 0.825437 2.85205V6H0Z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M5.55197 6V0H9.09309V0.789041H6.42693V2.49041H8.80419V3.27123H6.42693V5.21096H9.09309V6H5.55197Z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M11.0462 6L10.3941 0H11.1947L11.5992 4.30685C11.6102 4.41644 11.6185 4.53699 11.624 4.66849C11.635 4.8 11.6432 4.92877 11.6487 5.05479C11.6597 5.18082 11.6652 5.29041 11.6652 5.38356C11.6762 5.29041 11.6872 5.18082 11.6982 5.05479C11.7093 4.92877 11.7203 4.8 11.7313 4.66849C11.7478 4.53699 11.7643 4.41644 11.7808 4.30685L12.3008 0H13.1263L13.6133 4.30685C13.6243 4.41644 13.6353 4.53699 13.6463 4.66849C13.6628 4.8 13.6793 4.92877 13.6958 5.05479C13.7123 5.18082 13.7233 5.29041 13.7288 5.38356C13.7343 5.29041 13.7398 5.18082 13.7453 5.05479C13.7563 4.92877 13.7673 4.8 13.7784 4.66849C13.7894 4.53699 13.8004 4.41644 13.8114 4.30685L14.2241 0H15L14.3231 6H13.2913L12.8043 1.63562C12.7933 1.52055 12.7823 1.4 12.7713 1.27397C12.7603 1.14247 12.7493 1.01644 12.7383 0.89589C12.7273 0.769863 12.7163 0.665753 12.7053 0.583561C12.6998 0.665753 12.6915 0.769863 12.6805 0.89589C12.6695 1.01644 12.6585 1.14247 12.6475 1.27397C12.6365 1.4 12.6227 1.52055 12.6062 1.63562L12.0862 6H11.0462Z",fill:"currentColor"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.value?(e.openBlock(),e.createElementBlock("span",ge,[...r[2]||(r[2]=[e.createElementVNode("svg",{"data-test":"details-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M1.5 3.5V2.5C1.5 2.23478 1.60536 1.98043 1.79289 1.79289C1.98043 1.60536 2.23478 1.5 2.5 1.5H3.5M8.5 1.5H9.5C9.76522 1.5 10.0196 1.60536 10.2071 1.79289C10.3946 1.98043 10.5 2.23478 10.5 2.5V3.5M10.5 8.5V9.5C10.5 9.76522 10.3946 10.0196 10.2071 10.2071C10.0196 10.3946 9.76522 10.5 9.5 10.5H8.5M3.5 10.5H2.5C2.23478 10.5 1.98043 10.3946 1.79289 10.2071C1.60536 10.0196 1.5 9.76522 1.5 9.5V8.5M3.5 4H7.5M3.5 6H8.5M3.5 8H6.5",stroke:"currentColor","stroke-opacity":"0.9","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",ke,[e.renderSlot(u.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.value.defaultContent),1)],!0)])],64))],10,fe))}}),T=(t,o)=>{const a=t.__vccOpts||t;for(const[s,c]of o)a[s]=c;return a},Ce=T(be,[["__scopeId","data-v-aa9886ca"]]);function z(t={}){return{type:t.type??"primary",status:t.status,appearance:t.appearance??"default",ghostTextTone:t.ghostTextTone??"secondary",size:t.size??"medium",shape:t.shape??"rectangular",disabled:t.disabled??!1,loading:t.loading??!1,iconOnly:t.iconOnly??!1,nativeType:t.nativeType??"button"}}function _e(t={}){const o=z(t),a=["mu-button",`mu-button--${o.type}`,`mu-button--appearance-${o.appearance}`,`mu-button--${o.size}`];return o.type==="ghost"&&o.ghostTextTone==="primary"&&a.push(`mu-button--ghost-text-${o.ghostTextTone}`),o.shape==="pill"&&a.push("mu-button--shape-pill"),o.status&&a.push(`mu-button--status-${o.status}`),o.iconOnly&&a.push("mu-button--icon-only"),o.disabled&&a.push("is-disabled"),o.loading&&a.push("is-loading"),a}function ye(t={}){const o=z(t);return!o.disabled&&!o.loading}function we(t={}){const o=t.iconOnly??!1,a=t.hasPrefix??!1,s=t.hasSuffix??!1,c=t.loading??!1,n=t.hasAriaLabel??!1;return{showPrefixSlot:!o&&!c&&a,showSuffixSlot:!o&&s,showLoadingIndicator:c,requiresAriaLabel:o&&!n,isInvalidIconOnlyCombination:o&&(a||s)}}const Ve=["type","disabled","aria-busy"],Be={key:0,class:"mu-button__prefix","aria-hidden":"true"},ve={class:"mu-button__content"},Se={key:1,class:"mu-button__suffix","aria-hidden":"true"},I=T(e.defineComponent({__name:"Button",props:{type:{default:"primary"},status:{},appearance:{default:"default"},ghostTextTone:{default:"secondary"},size:{default:"medium"},shape:{default:"rectangular"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},iconOnly:{type:Boolean,default:!1},nativeType:{default:"button"}},emits:["click"],setup(t,{emit:o}){const a=t,s=o,c=e.useSlots(),n=e.useAttrs(),l={small:{width:"var(--mu-button-icon-size-small)",height:"var(--mu-button-icon-size-small)"},medium:{width:"var(--mu-button-icon-size-medium)",height:"var(--mu-button-icon-size-medium)"},large:{width:"var(--mu-button-icon-size-large)",height:"var(--mu-button-icon-size-large)"}},u=e.computed(()=>z(a)),r=e.computed(()=>_e(u.value)),i=e.computed(()=>l[u.value.size]),d=e.computed(()=>we({iconOnly:u.value.iconOnly,hasPrefix:!!c.prefix,hasSuffix:!!c.suffix,loading:u.value.loading,hasDefaultSlot:!!c.default,hasAriaLabel:typeof n["aria-label"]=="string"&&n["aria-label"].trim().length>0}));function _(h){if(!ye(u.value)){h.preventDefault(),h.stopPropagation();return}s("click",h)}return(h,g)=>(e.openBlock(),e.createElementBlock("button",{type:u.value.nativeType,class:e.normalizeClass(["mu-button",r.value]),disabled:u.value.disabled||u.value.loading,"aria-busy":u.value.loading?"true":void 0,onClick:_},[d.value.showLoadingIndicator||d.value.showPrefixSlot?(e.openBlock(),e.createElementBlock("span",Be,[d.value.showLoadingIndicator?(e.openBlock(),e.createElementBlock("svg",{key:0,class:"mu-button__loading-icon",style:e.normalizeStyle(i.value),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[...g[0]||(g[0]=[e.createElementVNode("path",{d:"M2.00293 12C2.00293 6.47853 6.47853 2.00293 12 2.00293C12.5509 2.00293 12.9971 2.4491 12.9971 3C12.9971 3.5509 12.5509 3.99707 12 3.99707C7.58034 3.99707 3.99707 7.58034 3.99707 12C3.99707 16.4197 7.58034 20.0029 12 20.0029C16.4197 20.0029 20.0029 16.4197 20.0029 12C20.0029 11.4491 20.4491 11.0029 21 11.0029C21.5509 11.0029 21.9971 11.4491 21.9971 12C21.9971 17.5215 17.5215 21.9971 12 21.9971C6.47853 21.9971 2.00293 17.5215 2.00293 12Z",fill:"currentColor"},null,-1)])],4)):e.renderSlot(h.$slots,"prefix",{key:1},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("span",ve,[e.renderSlot(h.$slots,"default",{},void 0,!0)]),d.value.showSuffixSlot?(e.openBlock(),e.createElementBlock("span",Se,[e.renderSlot(h.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],10,Ve))}}),[["__scopeId","data-v-42de128c"]]),Ne=3e3,Te={close:()=>{}},x=e.reactive({items:[]});let $e=1;const M=new Map;function Me(t){return typeof t=="string"?{title:t}:{title:t.title,description:t.description,duration:t.duration,closable:t.closable,resetOnHover:t.resetOnHover,icon:t.icon}}function A(t){return t.duration>0}function xe(t){return x.items.findIndex(o=>o.id===t)}function K(t){return x.items.find(o=>o.id===t)}function O(t){const o=M.get(t);o&&o.timer!==null&&(globalThis.clearTimeout(o.timer),o.timer=null)}function D(t){const o=xe(t);o<0||(O(t),M.delete(t),x.items.splice(o,1))}function X(t,o){const a=M.get(t);a&&(O(t),a.remainingDuration=o,a.deadline=Date.now()+o,a.isPaused=!1,a.timer=globalThis.setTimeout(()=>{D(t)},o))}function Ee(t,o){return{id:$e++,type:t,title:o.title,description:o.description,duration:o.duration??Ne,closable:o.closable??!1,resetOnHover:o.resetOnHover??!1,icon:o.icon}}function Pe(){return typeof globalThis.window<"u"&&typeof globalThis.document<"u"}function Le(t,o){if(!Pe())return Te;const a=Me(o),s=Ee(t,a);return x.items.push(s),M.set(s.id,{timer:null,deadline:0,remainingDuration:s.duration,isPaused:!1}),A(s)&&X(s.id,s.duration),{close:()=>D(s.id)}}function E(t){return o=>Le(t,o)}const He={success:E("success"),warning:E("warning"),loading:E("loading"),error:E("error"),danger:E("danger")};function ze(t){D(t)}function Ie(t){const o=M.get(t),a=K(t);!o||!a||o.isPaused||!a.resetOnHover||!A(a)||(o.remainingDuration=Math.max(o.deadline-Date.now(),0),O(t),o.isPaused=!0)}function Ae(t){const o=M.get(t),a=K(t);!o||!a||!o.isPaused||!a.resetOnHover||!A(a)||X(t,o.remainingDuration||a.duration)}const Oe={class:"mu-message-list","aria-live":"polite","aria-atomic":"true"},De=["onMouseenter","onMouseleave"],Re={class:"mu-message__icon","aria-hidden":"true"},Ge={class:"mu-message__content"},Ue={class:"mu-message__title"},je={key:0,class:"mu-message__description"},Fe=["onClick"],Ze=T(e.defineComponent({__name:"MessageList",setup(t){const o=e.computed(()=>x.items),a=e.defineComponent({name:"MarkupIcon",props:{markup:{type:String,required:!0}},setup(r){return()=>e.h("span",{class:"mu-message__icon-markup",innerHTML:r.markup})}});function s(r){return typeof r!="string"}function c(r){Ie(r)}function n(r){Ae(r)}function l(r){if(!(r instanceof globalThis.HTMLElement))return;const i=r.getBoundingClientRect();r.style.width=`${i.width}px`,r.style.height=`${i.height}px`}const u={success:'<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 6.5L9.5 17L4 11.5" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',warning:'<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12 4.5L20 18.5H4L12 4.5Z" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/><path d="M12 9.5V13.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><circle cx="12" cy="16.5" r="1" fill="currentColor"/></svg>',loading:'<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="8" stroke="currentColor" stroke-width="2"/><path d="M12 8V12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M12 12H15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>',error:'<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="8" stroke="currentColor" stroke-width="2"/><path d="M12 9V12.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><circle cx="12" cy="15.5" r="1" fill="currentColor"/></svg>',danger:'<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="8" stroke="currentColor" stroke-width="2"/><path d="M9 9L15 15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M15 9L9 15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'};return(r,i)=>(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(e.TransitionGroup,{name:"mu-message-fade",tag:"div",class:"mu-message-list__stack",onBeforeLeave:l},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id,class:e.normalizeClass(["mu-message",[`mu-message--${d.type}`,{"mu-message--compact":!d.description}]]),role:"status",onMouseenter:_=>c(d.id),onMouseleave:_=>n(d.id)},[e.createElementVNode("span",Re,[d.icon&&s(d.icon)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.icon),{key:0})):(e.openBlock(),e.createBlock(e.unref(a),{key:1,markup:typeof d.icon=="string"?d.icon:u[d.type]},null,8,["markup"]))]),e.createElementVNode("div",Ge,[e.createElementVNode("div",Ue,e.toDisplayString(d.title),1),d.description?(e.openBlock(),e.createElementBlock("p",je,e.toDisplayString(d.description),1)):e.createCommentVNode("",!0)]),d.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"mu-message__close","aria-label":"Close message",onClick:_=>e.unref(ze)(d.id)},[...i[0]||(i[0]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 5L19 19M19 5L5 19",stroke:"white","stroke-width":"1.8","stroke-linecap":"round"})],-1)])],8,Fe)):e.createCommentVNode("",!0)],42,De))),128))]),_:1})]))}}),[["__scopeId","data-v-debf98d8"]]),qe={medium:{width:"548px",minHeight:"228px"},large:{width:"800px",minHeight:"500px"}};function R(t={}){const o=t.size??"medium",a=qe[o],s=t.variant??"form";return{visible:t.visible??!1,title:t.title??"",status:t.status??"default",variant:s,size:o,width:t.width??a.width,minHeight:a.minHeight,maskClosable:t.maskClosable??!0,escToClose:t.escToClose??!0,closable:t.closable??!0,okText:t.okText??"Confirm",cancelText:t.cancelText??"Cancel",hideCancel:t.hideCancel??s==="feedback",hideOk:t.hideOk??!1,okLoading:t.okLoading??!1}}function Ke(t={}){const o=R(t),a=["mu-modal",`mu-modal--${o.size}`,`mu-modal--${o.status}`,`mu-modal--variant-${o.variant}`];return o.variant==="feedback"&&a.push("mu-modal--feedback"),a}function Xe(t={}){const o=R(t);return o.variant==="feedback"?{type:"secondary",status:o.status==="default"?void 0:o.status}:o.status==="danger"?{type:"secondary",status:"danger"}:{type:"primary"}}const We={key:0,class:"mu-modal-root"},Je={class:"mu-modal__header"},Qe=["data-status"],Ye={class:"mu-modal__body"},et={key:0,class:"mu-modal__footer"},W=T(e.defineComponent({inheritAttrs:!1,__name:"Modal",props:{visible:{type:Boolean,default:!1},title:{default:""},status:{default:"default"},variant:{default:"form"},size:{default:"medium"},width:{},maskClosable:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},okText:{default:"Confirm"},cancelText:{default:"Cancel"},okLoading:{type:Boolean,default:!1},hideOk:{type:Boolean,default:!1},hideCancel:{type:Boolean,default:void 0}},emits:["update:visible","ok","cancel","close"],setup(t,{emit:o}){const a=t,s=o,c=e.useAttrs(),n=e.computed(()=>R(a)),l=e.computed(()=>[Ke(a),c.class]),u=e.computed(()=>{const{class:m,style:y,...v}=c;return v}),r=e.computed(()=>Xe(a)),i=e.computed(()=>n.value.variant==="feedback"&&n.value.hideCancel),d=e.computed(()=>[{width:n.value.width,minHeight:n.value.minHeight},c.style]),_=`mu-modal-title-${Math.random().toString(36).slice(2,10)}`,g=typeof globalThis.document<"u"?globalThis.document:null;function V(){s("update:visible",!1)}function C(){n.value.maskClosable&&(V(),s("cancel",new globalThis.MouseEvent("click")))}function p(){V(),s("close")}function B(m){s("cancel",m),V()}function N(m){s("ok",m)}function $(m){m.key!=="Escape"||!n.value.visible||!n.value.escToClose||(V(),s("close"))}return e.onMounted(()=>{g&&g.addEventListener("keydown",$)}),e.onBeforeUnmount(()=>{g&&(g.removeEventListener("keydown",$),g.body.style.overflow="")}),e.watch(()=>n.value.visible,m=>{g&&(g.body.style.overflow=m?"hidden":"")},{immediate:!0}),(m,y)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[n.value.visible?(e.openBlock(),e.createElementBlock("div",We,[e.createElementVNode("div",{class:"mu-modal__mask",onClick:C}),e.createElementVNode("div",e.mergeProps(u.value,{class:l.value,style:d.value,role:"dialog","aria-modal":"true","aria-labelledby":_}),[e.createElementVNode("header",Je,[e.createElementVNode("div",{id:_,class:"mu-modal__title","data-status":n.value.status},[e.renderSlot(m.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(n.value.title),1)],!0)],8,Qe),n.value.closable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"mu-modal__close","aria-label":"Close dialog",onClick:p},[...y[0]||(y[0]=[e.createElementVNode("span",{class:"mu-modal__close-icon","aria-hidden":"true"},[e.createElementVNode("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5 5L15 15",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"}),e.createElementVNode("path",{d:"M15 5L5 15",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"})])],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ye,[e.renderSlot(m.$slots,"default",{},void 0,!0)]),m.$slots.footer||!n.value.hideOk||!n.value.hideCancel?(e.openBlock(),e.createElementBlock("footer",et,[e.renderSlot(m.$slots,"footer",{},()=>[n.value.hideCancel?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(I),{key:0,type:"ghost",class:"mu-modal__cancel",onClick:B},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value.cancelText),1)]),_:1})),n.value.hideOk?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(I),e.mergeProps({key:1},r.value,{loading:n.value.okLoading,class:["mu-modal__ok",{"mu-modal__ok--block":i.value}],onClick:N}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value.okText),1)]),_:1},16,["loading","class"]))],!0)])):e.createCommentVNode("",!0)],16)])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-e94991b0"]]);function tt(t){return t===void 0?null:typeof t=="function"?t():t}function P(t={}){return typeof globalThis.document>"u"?Promise.resolve(!1):new Promise(o=>{const a=globalThis.document.createElement("div");globalThis.document.body.appendChild(a);const s=e.ref(!0);let c=null,n=!1;const l=()=>{c&&(c.unmount(),c=null),a.parentNode&&a.parentNode.removeChild(a)},u=d=>{n||(n=!0,s.value=!1,queueMicrotask(()=>{l(),o(d)}))},{content:r,...i}=t;c=e.createApp({render(){return e.h(W,{...i,visible:s.value,"onUpdate:visible":d=>{d||u(!1)},onOk:()=>u(!0),onCancel:()=>u(!1),onClose:()=>u(!1)},{default:()=>tt(r)})}}),c.mount(a)})}const ot={show:P,confirm:(t={})=>P(t),success:(t={})=>P({...t,variant:"feedback",status:"success"}),danger:(t={})=>P({...t,variant:"feedback",status:"danger"})},J=Symbol("MuRadioGroup"),at=["horizontal","vertical"];function nt(t,o){return typeof o=="string"&&t.includes(o)}function st(t){return nt(at,t)}function Q(t={}){return{modelValue:t.modelValue,value:t.value??!0,defaultChecked:t.defaultChecked??!1,disabled:t.disabled??!1,name:t.name}}function Y(t={}){return{modelValue:t.modelValue,defaultValue:t.defaultValue,disabled:t.disabled??!1,name:t.name,direction:st(t.direction)?t.direction:"horizontal"}}function lt(t={}){return t.modelValue!==void 0}function rt(t={}){return t.modelValue!==void 0}function G(t,o){return Object.is(t,o)}function it(t={},o={}){const a=Q(t),s=["mu-radio"];return o.checked&&s.push("is-checked"),(o.disabled||a.disabled)&&s.push("is-disabled"),s}function ct(t={}){const o=Y(t),a=["mu-radio-group",`mu-radio-group--${o.direction}`];return o.disabled&&a.push("is-disabled"),a}const dt=["checked","disabled","name","value"],ut={class:"mu-radio__label"},mt=T(e.defineComponent({inheritAttrs:!1,__name:"Radio",props:{modelValue:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:!0},defaultChecked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},name:{default:void 0}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:o}){const a=t,s=o,c=e.useAttrs(),n=e.inject(J,null),l=e.computed(()=>Q(a)),u=e.computed(()=>lt(a)),r=e.ref(l.value.defaultChecked),i=e.computed(()=>n?G(n.value.value,l.value.value):u.value?G(l.value.modelValue,l.value.value):r.value),d=e.computed(()=>l.value.disabled||!!(n!=null&&n.disabled.value)),_=e.computed(()=>(n==null?void 0:n.name.value)??l.value.name),h=e.computed(()=>String(l.value.value)),g=e.computed(()=>[it(a,{checked:i.value,disabled:d.value}),c.class]),V=e.computed(()=>{const{class:m,style:y,...v}=c;return v}),C=e.computed(()=>c.style);function p(m,y){u.value||(r.value=!0),s("update:modelValue",m),s("change",m,y)}function B(m){if(d.value)return;const y=l.value.value,v=m.target instanceof globalThis.HTMLInputElement?m.target:null;if(n){n.select(y,m),e.nextTick(()=>{v&&(v.checked=i.value)});return}p(y,m),e.nextTick(()=>{v&&(v.checked=i.value)})}function N(m){s("focus",m)}function $(m){s("blur",m)}return(m,y)=>(e.openBlock(),e.createElementBlock("label",e.mergeProps(V.value,{class:g.value,style:C.value}),[e.createElementVNode("input",{class:"mu-radio__input",type:"radio",checked:i.value,disabled:d.value,name:_.value,value:h.value,onChange:B,onFocus:N,onBlur:$},null,40,dt),y[0]||(y[0]=e.createElementVNode("span",{class:"mu-radio__control","aria-hidden":"true"},[e.createElementVNode("span",{class:"mu-radio__dot"})],-1)),e.createElementVNode("span",ut,[e.renderSlot(m.$slots,"default",{},void 0,!0)])],16))}}),[["__scopeId","data-v-f1283749"]]),ft=T(e.defineComponent({inheritAttrs:!1,__name:"RadioGroup",props:{modelValue:{type:[String,Number,Boolean],default:void 0},defaultValue:{type:[String,Number,Boolean],default:void 0},disabled:{type:Boolean,default:!1},name:{default:void 0},direction:{default:"horizontal"}},emits:["update:modelValue","change"],setup(t,{emit:o}){const a=t,s=o,c=e.useAttrs(),n=e.computed(()=>Y(a)),l=e.computed(()=>rt(a)),u=e.ref(n.value.defaultValue),r=e.computed(()=>l.value?n.value.modelValue:u.value),i=e.computed(()=>n.value.disabled),d=e.computed(()=>n.value.name),_=e.computed(()=>[ct(a),c.class]),h=e.computed(()=>{const{class:C,style:p,...B}=c;return B}),g=e.computed(()=>c.style);function V(C,p){n.value.disabled||G(r.value,C)||(l.value||(u.value=C),s("update:modelValue",C),s("change",C,p))}return e.provide(J,{value:r,disabled:i,name:d,select:V}),(C,p)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps(h.value,{role:"radiogroup",class:_.value,style:g.value}),[e.renderSlot(C.$slots,"default",{},void 0,!0)],16))}}),[["__scopeId","data-v-3879fec4"]]),pt=["circle","round","line"],ht=["small","medium"];function ee(t,o){return typeof o=="string"&&t.includes(o)}function gt(t){return ee(pt,t)}function kt(t){return ee(ht,t)}function U(t={}){return{modelValue:t.modelValue,defaultChecked:t.defaultChecked??!1,disabled:t.disabled??!1,loading:t.loading??!1,type:gt(t.type)?t.type:"circle",size:kt(t.size)?t.size:"medium",checkedValue:t.checkedValue??!0,uncheckedValue:t.uncheckedValue??!1,checkedColor:t.checkedColor,uncheckedColor:t.uncheckedColor,beforeChange:t.beforeChange,checkedText:t.checkedText,uncheckedText:t.uncheckedText}}function bt(t={}){return t.modelValue!==void 0}function te(t,o){return Object.is(t,o.checkedValue)}function Ct(t,o){return te(t,o)?o.uncheckedValue:o.checkedValue}function _t(t){return t.type!=="line"&&t.size!=="small"}function yt(t={},o={}){const a=U(t),s=["mu-switch",`mu-switch--${a.type}`,`mu-switch--${a.size}`];return o.checked&&s.push("is-checked"),a.disabled&&s.push("is-disabled"),(a.loading||o.loading)&&s.push("is-loading"),s}const wt=["aria-checked","disabled"],Vt={class:"mu-switch__thumb","aria-hidden":"true"},Bt={key:0,class:"mu-switch__loading-icon",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},vt={key:0,class:"mu-switch__label"},St=T(e.defineComponent({inheritAttrs:!1,__name:"Switch",props:{modelValue:{type:[String,Number,Boolean],default:void 0},defaultChecked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},type:{default:"circle"},size:{default:"medium"},checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},checkedColor:{},uncheckedColor:{},beforeChange:{},checkedText:{},uncheckedText:{}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:o}){const a=t,s=o,c=e.useAttrs(),n=e.useSlots(),l=e.ref(!1),u=U(a),r=e.ref(u.defaultChecked?u.checkedValue:u.uncheckedValue),i=e.computed(()=>U(a)),d=e.computed(()=>bt(a)),_=e.computed(()=>d.value?i.value.modelValue:r.value),h=e.computed(()=>te(_.value,i.value)),g=e.computed(()=>i.value.loading||l.value),V=e.computed(()=>_t(i.value)),C=e.computed(()=>V.value?h.value?!!(n.checked||i.value.checkedText):!!(n.unchecked||i.value.uncheckedText):!1),p=e.computed(()=>[yt(a,{checked:h.value,loading:l.value}),{"has-label":C.value},c.class]),B=e.computed(()=>{const{class:f,style:w,type:k,...S}=c;return S}),N=e.computed(()=>{const f={};return i.value.checkedColor&&(f["--mu-switch-current-checked-bg"]=i.value.checkedColor,f["--mu-switch-current-checked-border"]=i.value.checkedColor,f["--mu-switch-current-checked-thumb"]=i.value.checkedColor,f["--mu-switch-current-checked-glow"]=`0 0 12px ${i.value.checkedColor}`),i.value.uncheckedColor&&(f["--mu-switch-current-unchecked-bg"]=i.value.uncheckedColor),[f,c.style]});function $(){}function m(f){const w=i.value.beforeChange;if(!w)return!0;try{const k=w(f);return k instanceof Promise?(l.value=!0,k.then(S=>S!==!1).catch(()=>!1)):k!==!1}catch{return!1}}function y(f,w){d.value||(r.value=f),s("update:modelValue",f),s("change",f,w)}function v(f){if(i.value.disabled||g.value)return;const w=Ct(_.value,i.value),k=m(w);if(k instanceof Promise){k.then(S=>{S&&y(w,f)}).finally(()=>{l.value=!1});return}k&&y(w,f)}function L(f){s("focus",f)}function j(f){s("blur",f)}return(f,w)=>(e.openBlock(),e.createElementBlock("button",e.mergeProps(B.value,{type:"button",role:"switch",class:p.value,style:N.value,"aria-checked":h.value?"true":"false",disabled:i.value.disabled||g.value,onClick:v,onFocus:L,onBlur:j}),[w[1]||(w[1]=e.createElementVNode("span",{class:"mu-switch__line-track","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Vt,[g.value?(e.openBlock(),e.createElementBlock("svg",Bt,[...w[0]||(w[0]=[e.createElementVNode("path",{d:"M8 1.5C8.41421 1.5 8.75 1.83579 8.75 2.25C8.75 2.66421 8.41421 3 8 3C5.23858 3 3 5.23858 3 8C3 10.7614 5.23858 13 8 13C10.7614 13 13 10.7614 13 8C13 7.58579 13.3358 7.25 13.75 7.25C14.1642 7.25 14.5 7.58579 14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8C1.5 4.41015 4.41015 1.5 8 1.5Z",fill:"currentColor"},null,-1)])])):h.value?e.renderSlot(f.$slots,"checked-icon",{key:1},void 0,!0):e.renderSlot(f.$slots,"unchecked-icon",{key:2},void 0,!0)]),C.value?(e.openBlock(),e.createElementBlock("span",vt,[h.value?e.renderSlot(f.$slots,"checked",{key:0},()=>[e.createTextVNode(e.toDisplayString(i.value.checkedText),1)],!0):e.renderSlot(f.$slots,"unchecked",{key:1},()=>[e.createTextVNode(e.toDisplayString(i.value.uncheckedText),1)],!0)])):e.createCommentVNode("",!0)],16,wt))}}),[["__scopeId","data-v-8cfb8f2a"]]),oe=Symbol("MuTabs"),Nt=["line","segment"],Tt=["small","medium","large"],$t=["white","ghost"],Mt=["content","equal"];function H(t,o){return typeof o=="string"&&t.includes(o)}function xt(t){return H(Nt,t)}function Et(t){return H(Tt,t)}function Pt(t){return H($t,t)}function Lt(t){return H(Mt,t)}function ae(t={}){const o=t,a=xt(o.variant)?o.variant:"line";return{modelValue:t.modelValue,defaultValue:t.defaultValue,variant:a,appearance:a==="segment"&&Pt(o.appearance)?o.appearance:a==="segment"?"white":void 0,size:Et(o.size)?o.size:"medium",layout:Lt(o.layout)?o.layout:"content",disabled:t.disabled??!1}}function Ht(t){return{value:t.value,disabled:t.disabled??!1}}function zt(t={}){return t.modelValue!==void 0}function ne(t,o){return Object.is(t,o)}function It(t={}){const o=ae(t),a=["mu-tabs",`mu-tabs--variant-${o.variant}`,`mu-tabs--size-${o.size}`,`mu-tabs--layout-${o.layout}`];return o.variant==="segment"&&a.push(`mu-tabs--appearance-${o.appearance}`),o.disabled&&a.push("is-disabled"),a}function At(t,o={}){const a=["mu-tab"];return o.active&&a.push("is-active"),(o.disabled||t.disabled)&&a.push("is-disabled"),a}const Ot=["aria-selected","disabled"],Dt={key:0,class:"mu-tab__prefix","aria-hidden":"true"},Rt={class:"mu-tab__content"},Gt={key:1,class:"mu-tab__suffix","aria-hidden":"true"},Ut=T(e.defineComponent({inheritAttrs:!1,__name:"Tab",props:{value:{},disabled:{type:Boolean}},emits:["click"],setup(t,{emit:o}){const a=t,s=o,c=e.useAttrs(),n=e.useSlots(),l=e.inject(oe,null),u=e.ref(null),r=e.computed(()=>Ht(a)),i=e.computed(()=>l?ne(l.value.value,r.value.value):!1),d=e.computed(()=>r.value.disabled||!!(l!=null&&l.disabled.value)),_=e.computed(()=>[At(a,{active:i.value,disabled:d.value}),c.class]),h=e.computed(()=>{const{class:p,style:B,...N}=c;return N}),g=e.computed(()=>c.style);function V(){!l||!u.value||l.registerItem(r.value.value,u.value)}function C(p){if(d.value){p.preventDefault(),p.stopPropagation();return}l&&l.select(r.value.value,p),s("click",p)}return e.onMounted(()=>{V()}),e.onBeforeUnmount(()=>{l==null||l.unregisterItem(r.value.value)}),e.watch(()=>r.value.value,(p,B)=>{!l||!u.value||(l.unregisterItem(B),l.registerItem(p,u.value))}),(p,B)=>(e.openBlock(),e.createElementBlock("button",e.mergeProps({ref_key:"buttonRef",ref:u},h.value,{type:"button",role:"tab",class:_.value,style:g.value,"aria-selected":i.value?"true":"false",disabled:d.value,onClick:C}),[e.unref(n).prefix?(e.openBlock(),e.createElementBlock("span",Dt,[e.renderSlot(p.$slots,"prefix",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("span",Rt,[e.renderSlot(p.$slots,"default",{},void 0,!0)]),e.unref(n).suffix?(e.openBlock(),e.createElementBlock("span",Gt,[e.renderSlot(p.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],16,Ot))}}),[["__scopeId","data-v-97f04990"]]),jt=T(e.defineComponent({inheritAttrs:!1,__name:"Tabs",props:{modelValue:{},defaultValue:{},size:{},layout:{},disabled:{type:Boolean},variant:{},appearance:{}},emits:["update:modelValue","change"],setup(t,{emit:o}){const a=t,s=o,c=e.useAttrs(),n=e.ref(null),l=e.computed(()=>ae(a)),u=e.computed(()=>zt(a)),r=e.ref(l.value.defaultValue),i=e.computed(()=>u.value?l.value.modelValue:r.value),d=e.computed(()=>l.value.variant),_=e.computed(()=>l.value.appearance),h=e.computed(()=>l.value.size),g=e.computed(()=>l.value.layout),V=e.computed(()=>l.value.disabled),C=e.ref(!1),p=e.ref(0),B=new Map,N=e.ref({transform:"translateX(0px)",width:"0px"}),$=e.computed(()=>[It(a),c.class]),m=e.computed(()=>{const{class:k,style:S,...F}=c;return F}),y=e.computed(()=>c.style);function v(){const k=n.value,S=i.value!==void 0?B.get(i.value):void 0;if(!k||!S){N.value={transform:"translateX(0px)",width:"0px"};return}const F=k.getBoundingClientRect(),le=S.getBoundingClientRect();N.value={transform:`translateX(${le.left-F.left}px)`,width:`${le.width}px`}}function L(){e.nextTick(()=>{v()})}function j(k,S){V.value||ne(i.value,k)||(u.value||(r.value=k),s("update:modelValue",k),s("change",k,S))}function f(k,S){B.set(k,S),p.value+=1,L()}function w(k){B.delete(k),p.value+=1,L()}return e.provide(oe,{value:i,variant:d,appearance:_,size:h,layout:g,disabled:V,select:j,registerItem:f,unregisterItem:w}),e.watch([i,d,h,g,p],()=>{L()},{flush:"post"}),e.onMounted(()=>{globalThis.window.addEventListener("resize",v),e.nextTick(()=>{v(),C.value=!0})}),e.onBeforeUnmount(()=>{globalThis.window.removeEventListener("resize",v)}),(k,S)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps({ref_key:"rootRef",ref:n},m.value,{role:"tablist",class:[$.value,{"is-ready":C.value}],style:y.value}),[e.renderSlot(k.$slots,"default",{},void 0,!0),e.createElementVNode("span",{class:"mu-tabs__indicator",style:e.normalizeStyle(N.value),"aria-hidden":"true"},null,4)],16))}}),[["__scopeId","data-v-28e8c4f7"]]),Ft=["outline","solid","soft"];function Zt(t,o){return typeof o=="string"&&t.includes(o)}function qt(t){return Zt(Ft,t)}function se(t={}){return{variant:qt(t.variant)?t.variant:"outline",selected:t.selected??!1,disabled:t.disabled??!1}}function Kt(t={}){const o=se(t),a=["mu-tag",`mu-tag--variant-${o.variant}`];return o.selected&&a.push("is-selected"),o.disabled&&a.push("is-disabled"),a}const Xt=["disabled","aria-pressed"],Wt={key:0,class:"mu-tag__prefix","aria-hidden":"true"},Jt={class:"mu-tag__content"},Qt={key:1,class:"mu-tag__suffix","aria-hidden":"true"},Yt=T(e.defineComponent({__name:"Tag",props:{variant:{},selected:{type:Boolean},disabled:{type:Boolean}},emits:["update:selected","click"],setup(t,{emit:o}){const a=t,s=o,c=e.useSlots(),n=e.computed(()=>se(a)),l=e.computed(()=>Kt(a));function u(r){n.value.disabled||(s("click",r),s("update:selected",!n.value.selected))}return(r,i)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:e.normalizeClass(l.value),disabled:n.value.disabled,"aria-pressed":n.value.selected,onClick:u},[e.unref(c).prefix?(e.openBlock(),e.createElementBlock("span",Wt,[e.renderSlot(r.$slots,"prefix",{},void 0,!0)])):e.createCommentVNode("",!0),e.createElementVNode("span",Jt,[e.renderSlot(r.$slots,"default",{},void 0,!0)]),e.unref(c).suffix?(e.openBlock(),e.createElementBlock("span",Qt,[e.renderSlot(r.$slots,"suffix",{},void 0,!0)])):e.createCommentVNode("",!0)],10,Xt))}}),[["__scopeId","data-v-e3e9ee4d"]]);b.MessageList=Ze,b.MuBadge=Ce,b.MuButton=I,b.MuModal=W,b.MuRadio=mt,b.MuRadioGroup=ft,b.MuSwitch=St,b.MuTab=Ut,b.MuTabs=jt,b.MuTag=Yt,b.message=He,b.muModal=ot,b.openMuModal=P,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mureka-fe/ui",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/ui.umd.cjs",