ray-template/js/Button-vr5e8LJV.js

109 lines
21 KiB
JavaScript

import{t as e}from"./color-to-class-G4jmrDIg.js";import{$t as t,D as n,E as r,Hn as i,Mn as a,On as o,Q as s,S as c,T as l,Tn as u,_n as d,_t as f,bt as p,d as m,en as h,fn as g,g as _,gn as v,ht as y,in as b,it as x,l as S,lt as C,m as w,mn as T,mt as E,nt as D,ot as O,tt as k,un as A,vt as j,wn as M,x as N,xn as P,yn as F,yt as I}from"./replaceable-DW6s2lkT.js";import{a as L,c as R,n as z,o as ee,r as te,t as B,u as V}from"./browser-m4QWgN_p.js";import{At as H,J as U,z as W}from"./toString-BWDzaUQG.js";var G=d({name:`FadeInExpandTransition`,props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:n}){function r(t){e.width?t.style.maxWidth=`${t.offsetWidth}px`:t.style.maxHeight=`${t.offsetHeight}px`,t.offsetWidth}function i(t){e.width?t.style.maxWidth=`0`:t.style.maxHeight=`0`,t.offsetWidth;let{onLeave:n}=e;n&&n()}function a(t){e.width?t.style.maxWidth=``:t.style.maxHeight=``;let{onAfterLeave:n}=e;n&&n()}function o(t){if(t.style.transition=`none`,e.width){let e=t.offsetWidth;t.style.maxWidth=`0`,t.offsetWidth,t.style.transition=``,t.style.maxWidth=`${e}px`}else if(e.reverse)t.style.maxHeight=`${t.offsetHeight}px`,t.offsetHeight,t.style.transition=``,t.style.maxHeight=`0`;else{let e=t.offsetHeight;t.style.maxHeight=`0`,t.offsetWidth,t.style.transition=``,t.style.maxHeight=`${e}px`}t.offsetWidth}function s(t){e.width?t.style.maxWidth=``:e.reverse||(t.style.maxHeight=``),e.onAfterEnter?.()}return()=>{let{group:c,width:l,appear:u,mode:d}=e,f=c?h:t,p={name:l?`fade-in-width-expand-transition`:`fade-in-height-expand-transition`,appear:u,onEnter:o,onAfterEnter:s,onBeforeLeave:r,onLeave:i,onAfterLeave:a};return c||(p.mode=d),F(f,p,n)}}}),{cubicBezierEaseInOut:K}=x;function q({duration:e=`.2s`,delay:t=`.1s`}={}){return[E(`&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to`,{opacity:1}),E(`&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from`,`
opacity: 0!important;
margin-left: 0!important;
margin-right: 0!important;
`),E(`&.fade-in-width-expand-transition-leave-active`,`
overflow: hidden;
transition:
opacity ${e} ${K},
max-width ${e} ${K} ${t},
margin-left ${e} ${K} ${t},
margin-right ${e} ${K} ${t};
`),E(`&.fade-in-width-expand-transition-enter-active`,`
overflow: hidden;
transition:
opacity ${e} ${K} ${t},
max-width ${e} ${K},
margin-left ${e} ${K},
margin-right ${e} ${K};
`)]}var J=y(`base-wave`,`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border-radius: inherit;
`),ne=d({name:`BaseWave`,props:{clsPrefix:{type:String,required:!0}},setup(e){D(`-base-wave`,J,U(e,`clsPrefix`));let t=W(null),n=W(!1),r=null;return o(()=>{r!==null&&window.clearTimeout(r)}),{active:n,selfRef:t,play(){r!==null&&(window.clearTimeout(r),n.value=!1,r=null),u(()=>{t.value?.offsetHeight,n.value=!0,r=window.setTimeout(()=>{n.value=!1,r=null},1e3)})}}},render(){let{clsPrefix:e}=this;return a(),T(`div`,{ref:`selfRef`,"aria-hidden":!0,class:s([`${e}-base-wave`,this.active&&`${e}-base-wave--active`])},null,2)}}),re={paddingTiny:`0 6px`,paddingSmall:`0 10px`,paddingMedium:`0 14px`,paddingLarge:`0 18px`,paddingRoundTiny:`0 10px`,paddingRoundSmall:`0 14px`,paddingRoundMedium:`0 18px`,paddingRoundLarge:`0 22px`,iconMarginTiny:`6px`,iconMarginSmall:`6px`,iconMarginMedium:`6px`,iconMarginLarge:`6px`,iconSizeTiny:`14px`,iconSizeSmall:`18px`,iconSizeMedium:`18px`,iconSizeLarge:`20px`,rippleDuration:`.6s`};function Y(e){let{heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:i,borderRadius:a,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:l,opacityDisabled:u,textColor2:d,textColor3:f,primaryColorHover:p,primaryColorPressed:m,borderColor:h,primaryColor:g,baseColor:_,infoColor:v,infoColorHover:y,infoColorPressed:b,successColor:x,successColorHover:S,successColorPressed:C,warningColor:w,warningColorHover:T,warningColorPressed:E,errorColor:D,errorColorHover:O,errorColorPressed:k,fontWeight:A,buttonColor2:j,buttonColor2Hover:M,buttonColor2Pressed:N,fontWeightStrong:P}=e;return{...re,heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:i,borderRadiusTiny:a,borderRadiusSmall:a,borderRadiusMedium:a,borderRadiusLarge:a,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:l,opacityDisabled:u,colorOpacitySecondary:`0.16`,colorOpacitySecondaryHover:`0.22`,colorOpacitySecondaryPressed:`0.28`,colorSecondary:j,colorSecondaryHover:M,colorSecondaryPressed:N,colorTertiary:j,colorTertiaryHover:M,colorTertiaryPressed:N,colorQuaternary:`#0000`,colorQuaternaryHover:M,colorQuaternaryPressed:N,color:`#0000`,colorHover:`#0000`,colorPressed:`#0000`,colorFocus:`#0000`,colorDisabled:`#0000`,textColor:d,textColorTertiary:f,textColorHover:p,textColorPressed:m,textColorFocus:p,textColorDisabled:d,textColorText:d,textColorTextHover:p,textColorTextPressed:m,textColorTextFocus:p,textColorTextDisabled:d,textColorGhost:d,textColorGhostHover:p,textColorGhostPressed:m,textColorGhostFocus:p,textColorGhostDisabled:d,border:`1px solid ${h}`,borderHover:`1px solid ${p}`,borderPressed:`1px solid ${m}`,borderFocus:`1px solid ${p}`,borderDisabled:`1px solid ${h}`,rippleColor:g,colorPrimary:g,colorHoverPrimary:p,colorPressedPrimary:m,colorFocusPrimary:p,colorDisabledPrimary:g,textColorPrimary:_,textColorHoverPrimary:_,textColorPressedPrimary:_,textColorFocusPrimary:_,textColorDisabledPrimary:_,textColorTextPrimary:g,textColorTextHoverPrimary:p,textColorTextPressedPrimary:m,textColorTextFocusPrimary:p,textColorTextDisabledPrimary:d,textColorGhostPrimary:g,textColorGhostHoverPrimary:p,textColorGhostPressedPrimary:m,textColorGhostFocusPrimary:p,textColorGhostDisabledPrimary:g,borderPrimary:`1px solid ${g}`,borderHoverPrimary:`1px solid ${p}`,borderPressedPrimary:`1px solid ${m}`,borderFocusPrimary:`1px solid ${p}`,borderDisabledPrimary:`1px solid ${g}`,rippleColorPrimary:g,colorInfo:v,colorHoverInfo:y,colorPressedInfo:b,colorFocusInfo:y,colorDisabledInfo:v,textColorInfo:_,textColorHoverInfo:_,textColorPressedInfo:_,textColorFocusInfo:_,textColorDisabledInfo:_,textColorTextInfo:v,textColorTextHoverInfo:y,textColorTextPressedInfo:b,textColorTextFocusInfo:y,textColorTextDisabledInfo:d,textColorGhostInfo:v,textColorGhostHoverInfo:y,textColorGhostPressedInfo:b,textColorGhostFocusInfo:y,textColorGhostDisabledInfo:v,borderInfo:`1px solid ${v}`,borderHoverInfo:`1px solid ${y}`,borderPressedInfo:`1px solid ${b}`,borderFocusInfo:`1px solid ${y}`,borderDisabledInfo:`1px solid ${v}`,rippleColorInfo:v,colorSuccess:x,colorHoverSuccess:S,colorPressedSuccess:C,colorFocusSuccess:S,colorDisabledSuccess:x,textColorSuccess:_,textColorHoverSuccess:_,textColorPressedSuccess:_,textColorFocusSuccess:_,textColorDisabledSuccess:_,textColorTextSuccess:x,textColorTextHoverSuccess:S,textColorTextPressedSuccess:C,textColorTextFocusSuccess:S,textColorTextDisabledSuccess:d,textColorGhostSuccess:x,textColorGhostHoverSuccess:S,textColorGhostPressedSuccess:C,textColorGhostFocusSuccess:S,textColorGhostDisabledSuccess:x,borderSuccess:`1px solid ${x}`,borderHoverSuccess:`1px solid ${S}`,borderPressedSuccess:`1px solid ${C}`,borderFocusSuccess:`1px solid ${S}`,borderDisabledSuccess:`1px solid ${x}`,rippleColorSuccess:x,colorWarning:w,colorHoverWarning:T,colorPressedWarning:E,colorFocusWarning:T,colorDisabledWarning:w,textColorWarning:_,textColorHoverWarning:_,textColorPressedWarning:_,textColorFocusWarning:_,textColorDisabledWarning:_,textColorTextWarning:w,textColorTextHoverWarning:T,textColorTextPressedWarning:E,textColorTextFocusWarning:T,textColorTextDisabledWarning:d,textColorGhostWarning:w,textColorGhostHoverWarning:T,textColorGhostPressedWarning:E,textColorGhostFocusWarning:T,textColorGhostDisabledWarning:w,borderWarning:`1px solid ${w}`,borderHoverWarning:`1px solid ${T}`,borderPressedWarning:`1px solid ${E}`,borderFocusWarning:`1px solid ${T}`,borderDisabledWarning:`1px solid ${w}`,rippleColorWarning:w,colorError:D,colorHoverError:O,colorPressedError:k,colorFocusError:O,colorDisabledError:D,textColorError:_,textColorHoverError:_,textColorPressedError:_,textColorFocusError:_,textColorDisabledError:_,textColorTextError:D,textColorTextHoverError:O,textColorTextPressedError:k,textColorTextFocusError:O,textColorTextDisabledError:d,textColorGhostError:D,textColorGhostHoverError:O,textColorGhostPressedError:k,textColorGhostFocusError:O,textColorGhostDisabledError:D,borderError:`1px solid ${D}`,borderHoverError:`1px solid ${O}`,borderPressedError:`1px solid ${k}`,borderFocusError:`1px solid ${O}`,borderDisabledError:`1px solid ${D}`,rippleColorError:D,waveOpacity:`0.6`,fontWeight:A,fontWeightStrong:P}}var X={name:`Button`,common:l,self:Y};function Z(e){return n(e,[255,255,255,.16])}function Q(e){return n(e,[0,0,0,.12])}var ie=C(`n-button-group`),ae=E([y(`button`,`
margin: 0;
font-weight: var(--n-font-weight);
line-height: 1;
font-family: inherit;
padding: var(--n-padding);
height: var(--n-height);
font-size: var(--n-font-size);
border-radius: var(--n-border-radius);
color: var(--n-text-color);
background-color: var(--n-color);
width: var(--n-width);
white-space: nowrap;
outline: none;
position: relative;
z-index: auto;
border: none;
display: inline-flex;
flex-wrap: nowrap;
flex-shrink: 0;
align-items: center;
justify-content: center;
user-select: none;
-webkit-user-select: none;
text-align: center;
cursor: pointer;
text-decoration: none;
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
opacity .3s var(--n-bezier),
border-color .3s var(--n-bezier);
`,[j(`color`,[f(`border`,{borderColor:`var(--n-border-color)`}),j(`disabled`,[f(`border`,{borderColor:`var(--n-border-color-disabled)`})]),I(`disabled`,[E(`&:focus`,[f(`state-border`,{borderColor:`var(--n-border-color-focus)`})]),E(`&:hover`,[f(`state-border`,{borderColor:`var(--n-border-color-hover)`})]),E(`&:active`,[f(`state-border`,{borderColor:`var(--n-border-color-pressed)`})]),j(`pressed`,[f(`state-border`,{borderColor:`var(--n-border-color-pressed)`})])])]),j(`disabled`,{backgroundColor:`var(--n-color-disabled)`,color:`var(--n-text-color-disabled)`},[f(`border`,{border:`var(--n-border-disabled)`})]),I(`disabled`,[E(`&:focus`,{backgroundColor:`var(--n-color-focus)`,color:`var(--n-text-color-focus)`},[f(`state-border`,{border:`var(--n-border-focus)`})]),E(`&:hover`,{backgroundColor:`var(--n-color-hover)`,color:`var(--n-text-color-hover)`},[f(`state-border`,{border:`var(--n-border-hover)`})]),E(`&:active`,{backgroundColor:`var(--n-color-pressed)`,color:`var(--n-text-color-pressed)`},[f(`state-border`,{border:`var(--n-border-pressed)`})]),j(`pressed`,{backgroundColor:`var(--n-color-pressed)`,color:`var(--n-text-color-pressed)`},[f(`state-border`,{border:`var(--n-border-pressed)`})])]),j(`loading`,`cursor: wait;`),y(`base-wave`,`
pointer-events: none;
top: 0;
right: 0;
bottom: 0;
left: 0;
animation-iteration-count: 1;
animation-duration: var(--n-ripple-duration);
animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out);
`,[j(`active`,{zIndex:1,animationName:`button-wave-spread, button-wave-opacity`})]),z&&`MozBoxSizing`in document.createElement(`div`).style?E(`&::moz-focus-inner`,{border:0}):null,f(`border, state-border`,`
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
border-radius: inherit;
transition: border-color .3s var(--n-bezier);
pointer-events: none;
`),f(`border`,`
border: var(--n-border);
`),f(`state-border`,`
border: var(--n-border);
border-color: #0000;
z-index: 1;
`),f(`icon`,`
margin: var(--n-icon-margin);
margin-left: 0;
height: var(--n-icon-size);
width: var(--n-icon-size);
max-width: var(--n-icon-size);
font-size: var(--n-icon-size);
position: relative;
flex-shrink: 0;
`,[y(`icon-slot`,`
height: var(--n-icon-size);
width: var(--n-icon-size);
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
`,[L({top:`50%`,originalTransform:`translateY(-50%)`})]),q()]),f(`content`,`
display: flex;
align-items: center;
flex-wrap: nowrap;
min-width: 0;
`,[E(`~`,[f(`icon`,{margin:`var(--n-icon-margin)`,marginRight:0})])]),j(`block`,`
display: flex;
width: 100%;
`),j(`dashed`,[f(`border, state-border`,{borderStyle:`dashed !important`})]),j(`disabled`,{cursor:`not-allowed`,opacity:`var(--n-opacity-disabled)`})]),E(`@keyframes button-wave-spread`,{from:{boxShadow:`0 0 0.5px 0 var(--n-ripple-color)`},to:{boxShadow:`0 0 0.5px 4.5px var(--n-ripple-color)`}}),E(`@keyframes button-wave-opacity`,{from:{opacity:`var(--n-wave-opacity)`},to:{opacity:0}})]),oe={...N.props,color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:`button`},type:{type:String,default:`default`},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:`left`},attrType:{type:String,default:`button`},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!B},spinProps:Object},$=d({name:`Button`,props:oe,slots:Object,setup(t){let n=W(null),i=W(null),a=W(!1),o=V(()=>!t.quaternary&&!t.tertiary&&!t.secondary&&!t.text&&(!t.color||t.ghost||t.dashed)&&t.bordered),s=P(ie,{}),{inlineThemeDisabled:l,mergedClsPrefixRef:u,mergedRtlRef:d,mergedComponentPropsRef:f}=O(t),{mergedSizeRef:m}=R({},{defaultSize:`medium`,mergedSize:e=>{let{size:n}=t;if(n)return n;let{size:r}=s;if(r)return r;let{mergedSize:i}=e||{};return i?i.value:f?.value?.Button?.size||`medium`}}),h=A(()=>t.focusable&&!t.disabled),g=e=>{h.value||e.preventDefault(),t.nativeFocusBehavior||(e.preventDefault(),t.disabled||h.value&&n.value?.focus({preventScroll:!0}))},v=e=>{if(!t.disabled&&!t.loading){let{onClick:n}=t;n&&_(n,e),t.text||i.value?.play()}},y=e=>{if(e.key===`Enter`){if(!t.keyboard)return;a.value=!1}},b=e=>{if(e.key===`Enter`){if(!t.keyboard||t.loading){e.preventDefault();return}a.value=!0}},x=()=>{a.value=!1},C=N(`Button`,`-button`,ae,X,t,u),w=S(`Button`,d,u),T=A(()=>{let{common:{cubicBezierEaseInOut:e,cubicBezierEaseOut:n},self:i}=C.value,{rippleDuration:a,opacityDisabled:o,fontWeight:s,fontWeightStrong:c}=i,l=m.value,{dashed:u,type:d,ghost:f,text:h,color:g,round:_,circle:v,textColor:y,secondary:b,tertiary:x,quaternary:S,strong:w}=t,T={"--n-font-weight":w?c:s},E={"--n-color":`initial`,"--n-color-hover":`initial`,"--n-color-pressed":`initial`,"--n-color-focus":`initial`,"--n-color-disabled":`initial`,"--n-ripple-color":`initial`,"--n-text-color":`initial`,"--n-text-color-hover":`initial`,"--n-text-color-pressed":`initial`,"--n-text-color-focus":`initial`,"--n-text-color-disabled":`initial`},D=d===`tertiary`,O=d==="default",k=D?`default`:d;if(h){let e=y||g;E={"--n-color":`#0000`,"--n-color-hover":`#0000`,"--n-color-pressed":`#0000`,"--n-color-focus":`#0000`,"--n-color-disabled":`#0000`,"--n-ripple-color":`#0000`,"--n-text-color":e||i[p(`textColorText`,k)],"--n-text-color-hover":e?Z(e):i[p(`textColorTextHover`,k)],"--n-text-color-pressed":e?Q(e):i[p(`textColorTextPressed`,k)],"--n-text-color-focus":e?Z(e):i[p(`textColorTextHover`,k)],"--n-text-color-disabled":e||i[p(`textColorTextDisabled`,k)]}}else if(f||u){let e=y||g;E={"--n-color":`#0000`,"--n-color-hover":`#0000`,"--n-color-pressed":`#0000`,"--n-color-focus":`#0000`,"--n-color-disabled":`#0000`,"--n-ripple-color":g||i[p(`rippleColor`,k)],"--n-text-color":e||i[p(`textColorGhost`,k)],"--n-text-color-hover":e?Z(e):i[p(`textColorGhostHover`,k)],"--n-text-color-pressed":e?Q(e):i[p(`textColorGhostPressed`,k)],"--n-text-color-focus":e?Z(e):i[p(`textColorGhostHover`,k)],"--n-text-color-disabled":e||i[p(`textColorGhostDisabled`,k)]}}else if(b){let e=O?i.textColor:D?i.textColorTertiary:i[p(`color`,k)],t=g||e,n=d!=="default"&&d!==`tertiary`;E={"--n-color":n?r(t,{alpha:Number(i.colorOpacitySecondary)}):i.colorSecondary,"--n-color-hover":n?r(t,{alpha:Number(i.colorOpacitySecondaryHover)}):i.colorSecondaryHover,"--n-color-pressed":n?r(t,{alpha:Number(i.colorOpacitySecondaryPressed)}):i.colorSecondaryPressed,"--n-color-focus":n?r(t,{alpha:Number(i.colorOpacitySecondaryHover)}):i.colorSecondaryHover,"--n-color-disabled":i.colorSecondary,"--n-ripple-color":`#0000`,"--n-text-color":t,"--n-text-color-hover":t,"--n-text-color-pressed":t,"--n-text-color-focus":t,"--n-text-color-disabled":t}}else if(x||S){let e=O?i.textColor:D?i.textColorTertiary:i[p(`color`,k)],t=g||e;x?(E[`--n-color`]=i.colorTertiary,E[`--n-color-hover`]=i.colorTertiaryHover,E[`--n-color-pressed`]=i.colorTertiaryPressed,E[`--n-color-focus`]=i.colorSecondaryHover,E[`--n-color-disabled`]=i.colorTertiary):(E[`--n-color`]=i.colorQuaternary,E[`--n-color-hover`]=i.colorQuaternaryHover,E[`--n-color-pressed`]=i.colorQuaternaryPressed,E[`--n-color-focus`]=i.colorQuaternaryHover,E[`--n-color-disabled`]=i.colorQuaternary),E[`--n-ripple-color`]=`#0000`,E[`--n-text-color`]=t,E[`--n-text-color-hover`]=t,E[`--n-text-color-pressed`]=t,E[`--n-text-color-focus`]=t,E[`--n-text-color-disabled`]=t}else E={"--n-color":g||i[p(`color`,k)],"--n-color-hover":g?Z(g):i[p(`colorHover`,k)],"--n-color-pressed":g?Q(g):i[p(`colorPressed`,k)],"--n-color-focus":g?Z(g):i[p(`colorFocus`,k)],"--n-color-disabled":g||i[p(`colorDisabled`,k)],"--n-ripple-color":g||i[p(`rippleColor`,k)],"--n-text-color":y||(g?i.textColorPrimary:D?i.textColorTertiary:i[p(`textColor`,k)]),"--n-text-color-hover":y||(g?i.textColorHoverPrimary:i[p(`textColorHover`,k)]),"--n-text-color-pressed":y||(g?i.textColorPressedPrimary:i[p(`textColorPressed`,k)]),"--n-text-color-focus":y||(g?i.textColorFocusPrimary:i[p(`textColorFocus`,k)]),"--n-text-color-disabled":y||(g?i.textColorDisabledPrimary:i[p(`textColorDisabled`,k)])};let A={"--n-border":`initial`,"--n-border-hover":`initial`,"--n-border-pressed":`initial`,"--n-border-focus":`initial`,"--n-border-disabled":`initial`};A=h?{"--n-border":`none`,"--n-border-hover":`none`,"--n-border-pressed":`none`,"--n-border-focus":`none`,"--n-border-disabled":`none`}:{"--n-border":i[p(`border`,k)],"--n-border-hover":i[p(`borderHover`,k)],"--n-border-pressed":i[p(`borderPressed`,k)],"--n-border-focus":i[p(`borderFocus`,k)],"--n-border-disabled":i[p(`borderDisabled`,k)]};let{[p(`height`,l)]:j,[p(`fontSize`,l)]:M,[p(`padding`,l)]:N,[p(`paddingRound`,l)]:P,[p(`iconSize`,l)]:F,[p(`borderRadius`,l)]:I,[p(`iconMargin`,l)]:L,waveOpacity:R}=i,z={"--n-width":v&&!h?j:`initial`,"--n-height":h?`initial`:j,"--n-font-size":M,"--n-padding":v||h?`initial`:_?P:N,"--n-icon-size":F,"--n-icon-margin":L,"--n-border-radius":h?`initial`:v||_?j:I};return{"--n-bezier":e,"--n-bezier-ease-out":n,"--n-ripple-duration":a,"--n-opacity-disabled":o,"--n-wave-opacity":R,...T,...E,...A,...z}}),E=l?c(`button`,A(()=>{let n=``,{dashed:r,type:i,ghost:a,text:o,color:s,round:c,circle:l,textColor:u,secondary:d,tertiary:f,quaternary:p,strong:h}=t;r&&(n+=`a`),a&&(n+=`b`),o&&(n+=`c`),c&&(n+=`d`),l&&(n+=`e`),d&&(n+=`f`),f&&(n+=`g`),p&&(n+=`h`),h&&(n+=`i`),s&&(n+=`j${e(s)}`),u&&(n+=`k${e(u)}`);let{value:g}=m;return n+=`l${g[0]}`,n+=`m${i[0]}`,n}),T,t):void 0;return{selfElRef:n,waveElRef:i,mergedClsPrefix:u,mergedFocusable:h,mergedSize:m,showBorder:o,enterPressed:a,rtlEnabled:w,handleMousedown:g,handleKeydown:b,handleBlur:x,handleKeyup:y,handleClick:v,customColorCssVars:A(()=>{let{color:e}=t;if(!e)return null;let n=Z(e);return{"--n-border-color":e,"--n-border-color-hover":n,"--n-border-color-pressed":Q(e),"--n-border-color-focus":n,"--n-border-color-disabled":e}}),cssVars:l?void 0:T,themeClass:E?.themeClass,onRender:E?.onRender}},render(){let{mergedClsPrefix:e,tag:t,onRender:n}=this;n?.();let r=w(this.$slots.default,t=>t&&(a(),T(`span`,{class:s(`${e}-button__content`)},[k(()=>t)],2)));return a(),g(t,{ref:`selfElRef`,class:s([this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`]),tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:H(this.cssVars),disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},{default:i(()=>[k(()=>this.iconPlacement===`right`&&r),v(G,{width:!0},{default:()=>w(this.$slots.icon,t=>(this.loading||this.renderIcon||t)&&(a(),T(`span`,{class:s(`${e}-button__icon`),style:H({margin:m(this.$slots.default)?`0`:``})},[v(ee,null,{default:()=>this.loading?(a(),g(te,M({clsPrefix:e,key:`loading`,class:`${e}-icon-slot`,strokeWidth:20},this.spinProps),null,16,[`clsPrefix`,`class`])):(a(),T(`div`,{key:`icon`,class:s(`${e}-icon-slot`),role:`none`},[this.renderIcon?(a(),T(b,{key:0},[k(()=>this.renderIcon())],64)):(a(),T(b,{key:1},[k(()=>t)],64))],2))},1024)],6)))},1024),k(()=>this.iconPlacement===`left`&&r),this.text?k(()=>null):(a(),g(ne,{key:0,ref:`waveElRef`,clsPrefix:e},null,8,[`clsPrefix`])),this.showBorder?(a(),T(`div`,{key:2,"aria-hidden":!0,class:s(`${e}-button__border`),style:H(this.customColorCssVars)},null,6)):k(()=>null),this.showBorder?(a(),T(`div`,{key:4,"aria-hidden":!0,class:s(`${e}-button__state-border`),style:H(this.customColorCssVars)},null,6)):k(()=>null)]),_:2},1032,[`class`,`tabindex`,`type`,`style`,`disabled`,`onClick`,`onBlur`,`onMousedown`,`onKeyup`,`onKeydown`])}}),se=$;export{G as a,Y as i,se as n,X as r,$ as t};