import{_ as w,u as x,e as p,i as y}from"./index.fda318e3.js";import{o as c,b as u,i as s,d as k,s as f,K as C,Z as D,a2 as I,q as M,f as U,P as B}from"./vue-chunks.9a4915e5.js";import"./library-chunks-1.ba23b3b2.js";import"./vue-3-linkify.8f393b2a.js";import"./socket-io.bbbf255d.js";import"./floating-vue.9132a23d.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="fb91d391-9b10-4e57-ab6d-4bbfda254be6",o._sentryDebugIdIdentifier="sentry-dbid-fb91d391-9b10-4e57-ab6d-4bbfda254be6")}catch{}})();const F={},V={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","data-v-f170a402":""};function j(o,t){return c(),u("svg",V,t[0]||(t[0]=[s("path",{d:"M14 10V12.6667C14 13.0203 13.8595 13.3594 13.6095 13.6095C13.3594 13.8595 13.0203 14 12.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V10",stroke:"#93939D","stroke-linecap":"round","stroke-linejoin":"round","data-v-f170a402":""},null,-1),s("path",{d:"M11.3334 5.33333L8.00008 2L4.66675 5.33333",stroke:"#93939D","stroke-linecap":"round","stroke-linejoin":"round","data-v-f170a402":""},null,-1),s("path",{d:"M8 2V10",stroke:"#93939D","stroke-linecap":"round","stroke-linejoin":"round","data-v-f170a402":""},null,-1)]))}const z=w(F,[["render",j]]),L={style:{"margin-left":"-5px","margin-right":"3px"}},A=k({__name:"CustomFileUpload",emits:["fileUploaded","close"],setup(o,{emit:t}){const a=x(),m=t,i=f(null),g=f(!1),r=C(()=>a.widgetLang);function _(){var e;(e=i.value)==null||e.click()}const b=e=>{const n=e.target.files;n&&n.length>0&&h(n[0])},h=e=>{a.errorMessage="";const n=8*1024*1024,v=e.size>n;y(e)?v?(l(),a.errorMessage=r.value.the_file_must_not_be_greater_than_8_mb):(m("fileUploaded",e),l(),d()):(alert(r.value.please_select_valid_file_type),l())},l=()=>{i.value.value=""},d=()=>{g.value=!1};return D(()=>{p.on("fileDragged",()=>{d()})}),I(()=>{p.off("fileDragged")}),(e,n)=>(c(),u("div",L,[s("button",{class:"no--outline",onClick:_,tabindex:"0"},[M(z,{class:U({"icon-upload-sm":B(a).isMobile})},null,8,["class"])]),s("input",{class:"hidden",type:"file",ref_key:"fileInput",ref:i,accept:"image/png, image/gif, image/jpeg, application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, image/webp, video/mp4, audio/mp3, text/plain, text/csv, application/vnd.openxmlformats-officedocument.presentationml.presentation",onChange:b},null,544)]))}});export{A as default};