import{h as t}from"./p-083180bf.js";import{c as o}from"./p-cef45012.js";import{H as r}from"./p-49b20dae.js";const n={right:"\nsl-input::part(input){\n  text-align: right;\n}",center:"  \nsl-input::part(input){\n  text-align: center;\n}",left:""};function i(i){const{buttonStyle:s="icon"}=i,l=o({HostBlock:r,inputStyle:{"&::part(input)":{textOverflow:"ellipsis",width:"100%",color:i.textColor||"var(--sl-input-color)"},"&::part(base)":{"--sl-input-border-radius":`${i.borderRadius}px`||"var(--sqm-border-radius-normal)","--sl-input-border-color":"var(--sqm-border-color)","--sl-input-border-color-hover":"#999999","--sl-input-border-color-focus":"#999999","--sl-input-color-hover":"var(--sqm-input-color-hover)","--sl-input-color-focus":"var(--sqm-input-color-focus)","--sl-input-color-disabled":"var(--sqm-input-disabled-color)","--sl-input-background-color-focus":"var(--sqm-input-background)","--sl-input-background-color-hover":"var(--sqm-input-background)",cursor:"pointer",overflow:"visible",borderRadius:`${i.borderRadius}px`||"var(--sqm-border-radius-normal)",background:i.backgroundColor||"var(--sqm-input-background)",border:`var(--sqm-border-thickness) solid ${i.borderColor||"var(--sqm-input-border-color)"}`},width:"100%"},icon:{"&::part(base)":{color:i.textColor||"var(--sqm-text)"}},inputErrorStyle:{},ContainerDiv:{display:"flex",alignItems:"flex-start",flexDirection:"column",justifyContent:"center",gap:"var(--sl-spacing-x-small)",width:"100%"},containerStyle:{display:"flex",alignItems:"center",gap:"var(--sl-spacing-x-small)",width:"100%"},errorTextStyle:{margin:"0",color:"var(--sqm-danger-color-text)"},notificationTextStyle:{margin:"0",color:"inherit"}}),e=l.toString(),a=!i.loading&&i.error,c=a?i.inputPlaceholderText:i.copyString,u=a||i.loading||i.disabled,p=t("sl-tooltip",{trigger:"manual",content:i.tooltiptext,placement:"button-below"===i.buttonStyle?"bottom":"button-outside"===i.buttonStyle?"top":"top-end",disabled:i.disabled,open:i.open,skidding:"icon"===i.buttonStyle?-5:0,slot:"suffix"},"icon"===s?t("sl-icon-button",{class:l.classes.icon,exportparts:"base: icon-button-base",onClick:()=>{var t;return null===(t=i.onClick)||void 0===t?void 0:t.call(i)},name:"files",disabled:u}):t("sl-button",{exportparts:`base: ${i.buttonType||"primary"}button-base`,onClick:()=>{var t;return null===(t=i.onClick)||void 0===t?void 0:t.call(i)},size:"medium",style:{width:`${"button-below"===s&&"100%"}`},disabled:u,type:"primary"},i.copyButtonLabel||"Copy"));return t("div",{class:l.classes.ContainerDiv},t("style",{type:"text/css"},e,"\n  :host{\n    display: block;   \n    width: 100%;\n  }\n",n[i.textAlign],u&&"\n  sl-input::part(input){\n    cursor: default;\n  }\n"),t("div",{class:l.classes.containerStyle,style:{flexDirection:"button-below"===s?"column":"row"}},t("sl-input",{class:`${l.classes.inputStyle} ${a?l.classes.inputErrorStyle:""}`,value:i.loading?"Loading...":c,readonly:!0,disabled:u},"icon"===s&&p,a&&t("p",{slot:"help-text",class:l.classes.errorTextStyle},i.errorText)),("button-outside"===s||"button-below"===s)&&p),i.isCopied&&i.showNotificationText&&i.notificationText&&t("p",{part:"sqm-notification-text",class:l.classes.notificationTextStyle},i.notificationText))}export{i as C}