import{c as le,e as re,a as ie,p as d,i as p,s as b,t as f,j as F,n as I,b as i,d as ae,f as h,w as S,h as a,m,r as o,aZ as _,k as g,x as oe,aW as G}from"../../custom-element.js";import{i as W}from"../../if.js";import{a as se,s as E}from"../../slot.js";import{c as ne}from"../../svelte-component.js";import{B as H}from"../button/Button.js";import{D as de}from"../divider/Divider.js";import{B as me,D as ce,C as fe,d as ue}from"../../Condition20.js";import"../../branches.js";import"../../attributes.js";import"../../this.js";import"../loader/Loader.js";var ve=h('<span class="mc-file-uploader-item__details svelte-1sb9cm3"><!></span>'),pe=h('<!> <div class="mc-file-uploader-item__actions-container svelte-1sb9cm3"><!></div>',1),be=h('<div class="mc-file-uploader-item__delete-button-container svelte-1sb9cm3"><!></div>'),_e=h('<span class="mc-file-uploader-item__error-message svelte-1sb9cm3"><!></span>'),ge=h('<div><div><div><span class="mc-file-uploader-item__status-icon svelte-1sb9cm3"><!></span> <div class="mc-file-uploader-item__info-content svelte-1sb9cm3"><span class="mc-file-uploader-item__label svelte-1sb9cm3"><!></span> <!></div></div> <!></div> <!></div>');const he={hash:"svelte-1sb9cm3",code:`/**
 * Do not edit directly, this file was auto-generated.
 */.mc-file-uploader.svelte-1sb9cm3 {display:flex;flex-direction:column;gap:1rem;box-sizing:border-box;}.mc-file-uploader__files-list.svelte-1sb9cm3 {display:flex;flex-direction:column;gap:1rem;}.mc-file-uploader__hidden-input.svelte-1sb9cm3 {clip-path:inset(100%);clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;position:absolute;white-space:nowrap;padding:0;width:1px;}.mc-file-uploader__input.svelte-1sb9cm3 {display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-semi-bold, 600);border-radius:var(--border-radius-m, 0.5rem);color:var(--file-uploader-color-drag-and-drop-text-default, #242938);}.mc-file-uploader__input.svelte-1sb9cm3 .mc-file-uploader__button:where(.svelte-1sb9cm3) {width:100%;}.mc-file-uploader__input--disabled.svelte-1sb9cm3 .mc-file-uploader__button.mc-button.mc-button--outlined:where(.svelte-1sb9cm3) {background-color:var(--button-state-disabled-background, #d9d9d9);border-color:transparent;color:var(--button-state-disabled-color, #737373);cursor:not-allowed;}.mc-file-uploader__input-title.svelte-1sb9cm3 {height:1.125rem;font-size:var(--font-size-150, 1rem);}.mc-file-uploader__input-subtitle.svelte-1sb9cm3 {height:1.125rem;font-size:var(--font-size-100, 0.875rem);}.mc-file-uploader--draggable.svelte-1sb9cm3 .mc-file-uploader__input:where(.svelte-1sb9cm3) {padding:2rem;outline:0.125rem dashed var(--file-uploader-color-drag-and-drop-border-default, #464e63);display:flex;}.mc-file-uploader--draggable.svelte-1sb9cm3 .mc-file-uploader__input--disabled:where(.svelte-1sb9cm3) {outline-color:var(--file-uploader-color-drag-and-drop-border-disabled, #b3b3b3);color:var(--file-uploader-color-drag-and-drop-text-disabled, #b3b3b3);cursor:not-allowed;}.mc-file-uploader--draggable.svelte-1sb9cm3 .mc-file-uploader__input--dragged:where(.svelte-1sb9cm3) {outline-width:0.25rem;}.mc-file-uploader-item.svelte-1sb9cm3 {display:flex;flex-direction:column;gap:0.25rem;}.mc-file-uploader-item__container.svelte-1sb9cm3 {border:1px solid var(--file-uploader-color-file-item-border-default, #cccccc);border-radius:var(--border-radius-m, 0.5rem);padding:0.75rem;}.mc-file-uploader-item__meta-row.svelte-1sb9cm3 {display:flex;align-items:center;flex-grow:1;}.mc-file-uploader-item__meta-row--with-info.svelte-1sb9cm3 {align-items:start;}.mc-file-uploader-item__status-icon.svelte-1sb9cm3 {fill:var(--file-uploader-color-file-item-icon-valid, #3f9e10);}.mc-file-uploader-item__info-content.svelte-1sb9cm3 {display:flex;flex-direction:column;flex-grow:1;padding-left:0.5rem;padding-right:1rem;}.mc-file-uploader-item__label.svelte-1sb9cm3 {color:var(--file-uploader-color-file-item-text-file-name, #000000);font-size:var(--font-size-100, 0.875rem);line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-semi-bold, 600);}.mc-file-uploader-item__details.svelte-1sb9cm3 {color:var(--file-uploader-color-file-item-text-information, #666666);font-size:var(--font-size-50, 0.75rem);line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-regular, 400);}.mc-file-uploader-item__error-message.svelte-1sb9cm3 {color:var(--field-color-validation-invalid, #c61112);font-size:var(--font-size-100, 0.875rem);line-height:var(--line-height-s, 1.3);font-weight:var(--font-weight-regular, 400);}.mc-file-uploader-item__container--inline.svelte-1sb9cm3 {display:flex;align-items:center;}.mc-file-uploader-item__container--stacked.svelte-1sb9cm3 {display:flex;flex-direction:column;gap:0.75rem;}.mc-file-uploader-item__delete-button-container.svelte-1sb9cm3 {padding-left:0.25rem;margin-left:0.25rem;border-left:1px solid var(--divider-color-primary, #cccccc);}.mc-file-uploader-item__actions-container.svelte-1sb9cm3 {padding:0 2rem;display:flex;align-items:center;gap:0.25rem;justify-content:center;}.mc-file-uploader-item__action.svelte-1sb9cm3 {padding:0 0.75rem;flex-grow:1;}.mc-file-uploader-item--error.svelte-1sb9cm3 .mc-file-uploader-item__container:where(.svelte-1sb9cm3) {border-width:var(--border-width-m, 0.125rem);border-color:var(--file-uploader-color-file-item-border-invalid, #ea302d);}.mc-file-uploader-item--error.svelte-1sb9cm3 .mc-file-uploader-item__status-icon:where(.svelte-1sb9cm3) {fill:var(--file-uploader-color-file-item-icon-invalid, #ea302d);}.mc-file-uploader-item--loading.svelte-1sb9cm3 .mc-file-uploader-item__container:where(.svelte-1sb9cm3) {gap:1rem;flex-direction:column;align-items:normal;}.mc-file-uploader-item--loading.svelte-1sb9cm3 .mc-file-uploader-item__status-icon:where(.svelte-1sb9cm3) {fill:var(--color-standalone-disabled, #b3b3b3);}.mc-file-uploader-item--loading.svelte-1sb9cm3 .mc-file-uploader-item__label:where(.svelte-1sb9cm3),
.mc-file-uploader-item--loading.svelte-1sb9cm3 .mc-file-uploader-item__details:where(.svelte-1sb9cm3) {color:var(--color-standalone-disabled, #b3b3b3);}`};function xe(U,l){const Z=se(l);re(l,!0),ie(U,he);let u=d(l,"file",7),x=d(l,"format",7,"inline"),w=d(l,"valid",7),y=d(l,"errormessage",7),z=d(l,"deletebuttonlabel",7,"Delete"),v=d(l,"information",7),k=d(l,"ondelete",7);const J=S(()=>x()==="stacked"),P=S(()=>w()?"default":"error"),K={default:ce,error:me},L=S(()=>K[p(P)]);var N={get file(){return u()},set file(e){u(e),m()},get format(){return x()},set format(e="inline"){x(e),m()},get valid(){return w()},set valid(e){w(e),m()},get errormessage(){return y()},set errormessage(e){y(e),m()},get deletebuttonlabel(){return z()},set deletebuttonlabel(e="Delete"){z(e),m()},get information(){return v()},set information(e){v(e),m()},get ondelete(){return k()},set ondelete(e){k(e),m()}},D=ge(),C=a(D),M=a(C),j=a(M),O=a(j);ne(O,()=>p(L),(e,t)=>{t(e,{})}),o(j);var q=b(j,2),B=a(q),Q=a(B);E(Q,l,"name",{get file(){return u()}},e=>{var t=_();f(()=>g(t,u().name)),i(e,t)}),o(B);var R=b(B,2);{var T=e=>{var t=ve(),n=a(t);E(n,l,"information",{get file(){return u()}},r=>{var s=_();f(()=>g(s,v())),i(r,s)}),o(t),i(e,t)};W(R,e=>{(v()||Z.information)&&e(T)})}o(q),o(M);var V=b(M,2);{var X=e=>{var t=pe(),n=oe(t);de(n,{});var r=b(n,2),s=a(r);H(s,{ghost:!0,size:"s",iconposition:"left","aria-label":"Delete file",get onclick(){return k()},children:(c,te)=>{G();var A=_();f(()=>g(A,z())),i(c,A)},$$slots:{default:!0,icon:(c,te)=>{fe(c,{slot:"icon"})}}}),o(r),i(e,t)},Y=e=>{var t=be(),n=a(t);H(n,{ghost:!0,size:"s",iconposition:"only","aria-label":"Delete file",get onclick(){return k()},children:(r,s)=>{G();var c=_();f(()=>g(c,z())),i(r,c)},$$slots:{default:!0,icon:(r,s)=>{ue(r,{slot:"icon"})}}}),o(t),i(e,t)};W(V,e=>{p(J)?e(X):e(Y,-1)})}o(C);var $=b(C,2);{var ee=e=>{var t=_e(),n=a(t);E(n,l,"errorMessage",{},r=>{var s=_();f(()=>g(s,y())),i(r,s)}),o(t),i(e,t)};W($,e=>{!w()&&(y()||Z.errorMessage)&&e(ee)})}return o(D),f(()=>{F(D,1,I({"mc-file-uploader-item":!0,[`mc-file-uploader-item--${p(P)}`]:p(P)!=="default"}),"svelte-1sb9cm3"),F(C,1,I({"mc-file-uploader-item__container":!0,[`mc-file-uploader-item__container--${x()}`]:!0}),"svelte-1sb9cm3"),F(M,1,I({"mc-file-uploader-item__meta-row":!0,"mc-file-uploader-item__meta-row--with-info":v()}),"svelte-1sb9cm3")}),i(U,D),ae(N)}customElements.define("m-file-uploader-item",le(xe,{file:{},format:{},valid:{},errormessage:{},deletebuttonlabel:{},information:{},ondelete:{}},["name","information","errorMessage"],[],{mode:"open"}));export{xe as F};
//# sourceMappingURL=FileUploaderItem.js.map
