import{d as M,bD as E,bG as V,bC as Z,p as i,c as A,bb as L,bg as N,e as _,i as h,w as d,a7 as y,g as n,h as u,n as P,aB as R,bJ as U,k as q,t as x,Z as $,bK as z,z as j,A as G,m as J}from"./index-CYs9MVUz.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="e7b347da-a8eb-4c69-a0ee-45a90e3b2cdd",s._sentryDebugIdIdentifier="sentry-dbid-e7b347da-a8eb-4c69-a0ee-45a90e3b2cdd")}catch{}})();const K="data:image/svg+xml,%3csvg%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='32'%20cy='32'%20r='32'%20fill='%23EEF5FF'/%3e%3cpath%20d='M22.0949%2041.3604C23.5456%2040.3167%2025.0849%2039.4913%2026.7128%2038.8841C28.3407%2038.2769%2030.1031%2037.9733%2032.0001%2037.9733C33.8972%2037.9733%2035.6596%2038.2769%2037.2875%2038.8841C38.9154%2039.4913%2040.4547%2040.3167%2041.9054%2041.3604C43.0322%2040.1942%2043.9386%2038.8168%2044.6246%2037.2283C45.3105%2035.6398%2045.6535%2033.897%2045.6535%2032C45.6535%2028.2169%2044.3237%2024.9956%2041.6641%2022.336C39.0046%2019.6764%2035.7832%2018.3467%2032.0001%2018.3467C28.217%2018.3467%2024.9957%2019.6764%2022.3361%2022.336C19.6766%2024.9956%2018.3468%2028.2169%2018.3468%2032C18.3468%2033.897%2018.6898%2035.6398%2019.3757%2037.2283C20.0617%2038.8168%2020.9681%2040.1942%2022.0949%2041.3604ZM32.0011%2032.8533C30.5629%2032.8533%2029.3499%2032.3597%2028.362%2031.3725C27.3741%2030.3853%2026.8801%2029.1725%2026.8801%2027.7343C26.8801%2026.2961%2027.3737%2025.0831%2028.361%2024.0952C29.3482%2023.1073%2030.5609%2022.6133%2031.9992%2022.6133C33.4374%2022.6133%2034.6504%2023.107%2035.6383%2024.0942C36.6262%2025.0814%2037.1201%2026.2941%2037.1201%2027.7324C37.1201%2029.1706%2036.6265%2030.3836%2035.6393%2031.3715C34.652%2032.3594%2033.4393%2032.8533%2032.0011%2032.8533ZM32.0001%2047.36C29.858%2047.36%2027.8527%2046.9612%2025.9841%2046.1637C24.1156%2045.3662%2022.4899%2044.276%2021.107%2042.8931C19.7242%2041.5103%2018.634%2039.8846%2017.8364%2038.016C17.0389%2036.1474%2016.6401%2034.1421%2016.6401%2032C16.6401%2029.8579%2017.0389%2027.8526%2017.8364%2025.984C18.634%2024.1154%2019.7242%2022.4897%2021.107%2021.1069C22.4899%2019.724%2024.1156%2018.6338%2025.9841%2017.8363C27.8527%2017.0388%2029.858%2016.64%2032.0001%2016.64C34.1422%2016.64%2036.1476%2017.0388%2038.0161%2017.8363C39.8847%2018.6338%2041.5104%2019.724%2042.8933%2021.1069C44.2761%2022.4897%2045.3663%2024.1154%2046.1638%2025.984C46.9614%2027.8526%2047.3601%2029.8579%2047.3601%2032C47.3601%2034.1421%2046.9614%2036.1474%2046.1638%2038.016C45.3663%2039.8846%2044.2761%2041.5103%2042.8933%2042.8931C41.5104%2044.276%2039.8847%2045.3662%2038.0161%2046.1637C36.1476%2046.9612%2034.1422%2047.36%2032.0001%2047.36ZM32.0001%2045.6533C33.5733%2045.6533%2035.1214%2045.3782%2036.6442%2044.8279C38.1671%2044.2776%2039.4832%2043.5244%2040.5926%2042.5682C39.4832%2041.6777%2038.1999%2040.9737%2036.7427%2040.4562C35.2855%2039.9387%2033.7046%2039.68%2032.0001%2039.68C30.2957%2039.68%2028.7093%2039.9333%2027.2412%2040.4398C25.773%2040.9463%2024.4952%2041.6558%2023.4077%2042.5682C24.517%2043.5244%2025.8332%2044.2776%2027.356%2044.8279C28.8789%2045.3782%2030.4269%2045.6533%2032.0001%2045.6533ZM32.0001%2031.1467C32.9585%2031.1467%2033.767%2030.8174%2034.4256%2030.1588C35.0842%2029.5002%2035.4135%2028.6917%2035.4135%2027.7333C35.4135%2026.775%2035.0842%2025.9665%2034.4256%2025.3079C33.767%2024.6493%2032.9585%2024.32%2032.0001%2024.32C31.0418%2024.32%2030.2333%2024.6493%2029.5747%2025.3079C28.9161%2025.9665%2028.5868%2026.775%2028.5868%2027.7333C28.5868%2028.6917%2028.9161%2029.5002%2029.5747%2030.1588C30.2333%2030.8174%2031.0418%2031.1467%2032.0001%2031.1467Z'%20fill='%23022859'/%3e%3c/svg%3e",O=s=>(j("data-v-872b9d1f"),s=s(),G(),s),T=["src","alt"],H=O(()=>n("button",{type:"button",class:"field__edit"},[n("i",{class:"icon icon-pencil"})],-1)),Q=M({__name:"FormUploadLogo",props:{name:{},rules:{},src:{},dimensions:{},round:{type:Boolean}},emits:["uploaded","remove"],setup(s,{emit:r}){E(a=>{var e,t;return{"652c5285":(e=a.dimensions)==null?void 0:e.width,"268f0448":(t=a.dimensions)==null?void 0:t.height}});const o=s,F=r,I=V(),{value:f,errorMessage:m}=Z(o.name,o.rules,{initialValue:o==null?void 0:o.src,syncVModel:!0}),g=i(null),b=i(null),k=i(!1),D=i(""),S=A(()=>{switch("lenetwork"){case L.PRO:return N;default:return K}}),B=a=>{var c,l;const e=(l=(c=a.target)==null?void 0:c.files)==null?void 0:l[0],t=new FileReader;if(!e)return null;b.value=null,t.onload=C=>{var v,w;const p=(v=t.result)==null?void 0:v.toString();D.value=(w=C.target)==null?void 0:w.result,p&&(b.value=e,f.value=p,F("uploaded",{name:e.name,b64:p}))},t.onerror=C=>{console.error(C)},e&&e.type.split("/")[0]==="image"&&o.dimensions&&(k.value=!0),t.readAsDataURL(e)};return(a,e)=>{var t;return _(),h(z,{class:"field",required:(t=a.rules)==null?void 0:t.toString().includes("required")},{label:d(()=>[y(a.$slots,"label",{},void 0,!0)]),hint:d(()=>[y(a.$slots,"hint",{},void 0,!0)]),default:d(()=>[n("div",{class:"field__preview-wrapper",onClick:e[0]||(e[0]=c=>{var l;return(l=g.value)==null?void 0:l.click()})},[n("img",{src:a.src||u(f)||S.value,alt:a.name,class:P(["field__preview",{"field__preview--round":a.round}])},null,10,T),n("input",R({ref_key:"inputEl",ref:g,class:"field__input",type:"file",accept:"image/jpeg,image/x-png"},u(I),{onChange:B}),null,16),H]),u(m)?(_(),h(U,{key:0},{default:d(()=>[q(x(u(m)),1)]),_:1})):$("",!0)]),_:3},8,["required"])}}}),X=J(Q,[["__scopeId","data-v-872b9d1f"]]);export{X as F}; //# sourceMappingURL=FormUploadLogo-BBKztjqS.js.map