"use strict";exports.id=872,exports.ids=[872],exports.modules={85031:(e,r,l)=>{l.d(r,{p:()=>PlusIcon});var t=l(20997);function PlusIcon(e){return t.jsx("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:t.jsx("path",{d:"M17.3471 8.77565H11.2246V2.6532C11.2246 1.97728 10.6761 1.42871 10.0001 1.42871C9.32422 1.42871 8.77565 1.97728 8.77565 2.6532V8.77565H2.6532C1.97728 8.77565 1.42871 9.32422 1.42871 10.0001C1.42871 10.6761 1.97728 11.2246 2.6532 11.2246H8.77565V17.3471C8.77565 18.023 9.32422 18.5716 10.0001 18.5716C10.6761 18.5716 11.2246 18.023 11.2246 17.3471V11.2246H17.3471C18.023 11.2246 18.5716 10.6761 18.5716 10.0001C18.5716 9.32422 18.023 8.77565 17.3471 8.77565Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.2"})})}},90872:(e,r,l)=>{l.a(e,async(e,t)=>{try{l.d(r,{Z:()=>Uploader});var a=l(20997),s=l(59003),o=l.n(s),n=l(54574),i=l(16689),c=l(56358),d=l(61175),u=l(29620),h=l(5114),f=l(60802),x=l(24612),m=l(85031),p=e([n]);function getDefaultValues(e){return e?Array.isArray(e)?e:[e]:null}function Uploader({onChange:e,value:r,name:l,onBlur:t,multiple:s=!0}){let[p,v]=(0,i.useState)(getDefaultValues(r));(0,i.useEffect)(()=>{v(getDefaultValues(r))},[r]);let{mutate:g,isLoading:j}=(0,d.useMutation)(n.Z.settings.upload,{onSuccess:r=>{let l=s?r:r[0];e(l),v(r)},onError:e=>{console.log(e)}}),w=(0,i.useCallback)(e=>{g(e)},[g]),{getRootProps:N,getInputProps:b}=(0,c.useDropzone)({accept:"image/*",multiple:s,onDrop:w});function remove(r){if(!p)return;let l=p.filter(e=>e.id!==r);if(!l.length){v(null),e(null);return}v(l);let t=s?l:l[0];e(t)}return(0,a.jsxs)("div",{className:"flex flex-wrap gap-2.5",children:[(0,a.jsxs)("div",{...N({className:o()("relative border-dashed border-2 border-light-500 dark:border-dark-600 text-center flex flex-col justify-center hover:text-black dark:hover:text-light items-center cursor-pointer focus:border-accent-400 focus:outline-none",{"h-20 w-20 rounded-md shrink-0":!0===s,"h-36 w-full rounded":!1===s})}),children:[a.jsx("input",{...b({name:l,onBlur:t})}),!0!==s?Array.isArray(p)?p.map(({id:e,original:r})=>(0,a.jsxs)("div",{children:[a.jsx("div",{className:"relative h-20 w-20 overflow-hidden rounded-full",children:a.jsx(u.Z,{alt:"Avatar",src:r,fill:!0,className:"object-scale-down"})}),a.jsx(f.Z,{onClick:r=>{r.stopPropagation(),remove(e)},variant:"icon",className:"absolute top-0 right-0 p-3",children:a.jsx(h.T,{className:"h-4 w-4 3xl:h-5 3xl:w-5"})})]},e)):"Upload Your Avatar Image (80 X 80)":!j&&a.jsx(m.p,{className:"h-5 w-5"}),j&&(0,a.jsxs)("span",{className:"mt-2.5 flex items-center gap-1 font-medium text-light-500",children:[a.jsx(x.L,{className:"h-auto w-5 animate-spin text-brand"})," ",!0!==s&&"Loading..."]})]}),Array.isArray(p)&&!0===s&&p.map(({id:e,original:r})=>(0,a.jsxs)("div",{className:"group relative h-20 w-20 overflow-hidden rounded-md",children:[a.jsx("div",{className:"relative h-full w-full overflow-hidden rounded-md",children:a.jsx(u.Z,{alt:"Attachment",src:r,fill:!0,className:"object-cover"})}),a.jsx("div",{className:"absolute top-0 right-0 flex h-full w-full items-center justify-center bg-dark/60 opacity-0 transition-all group-hover:opacity-100",children:a.jsx(f.Z,{onClick:r=>{r.stopPropagation(),remove(e)},variant:"icon",className:"h-9 w-9 rounded-full bg-dark/60",children:a.jsx(h.T,{className:"h-4 w-4"})})})]},e))]})}n=(p.then?(await p)():p)[0],t()}catch(e){t(e)}})}};