1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7760],{88601:function(e,t,r){var a=r(85893),l=r(93967),o=r.n(l);r(67294),t.Z=e=>{let{buttonType:t="primary",buttonProps:r,children:l}=e,{className:n,...s}=r||{};return(0,a.jsx)("button",{...s,className:o()("transition-all duration-300 flex items-center gap-x-2 justify-center px-[18px]",{primary:"border border-transparent bg-successButton hover:bg-successPrimary text-white rounded-xl py-[10px] font-semibold text-balance shadow-xs disabled:bg-disabled disabled:cursor-not-allowed disabled:border-componentBg disabled:text-grayWarm400",secondary:"border border-borderPrimary bg-ButtonSecondary text-textSecondary rounded-xl py-[10px] font-semibold text-balance disabled:cursor-not-allowed disabled:text-grayWarm400",danger:"border border-errorPrimary bg-errorPrimary hover:bg-errorHover text-white rounded-xl py-[10px] font-semibold text-balance disabled:bg-disabled disabled:cursor-not-allowed disabled:border-componentBg disabled:text-grayWarm400",success:"border border-successButton bg-successButton text-white rounded-xl py-[10px] font-semibold text-balance disabled:bg-disabled disabled:cursor-not-allowed disabled:border-componentBg disabled:text-grayWarm400",transparent:"border border-transparent bg-transparent text-textSecondary rounded-xl py-[10px] font-semibold text-balance disabled:cursor-not-allowed disabled:text-grayWarm400",white:"border border-borderPrimary bg-[#FFFFFF] text-textSecondary rounded-xl py-[10px] font-semibold text-balance disabled:cursor-not-allowed disabled:text-grayWarm400"}[t],{[n]:n}),children:l})}},19913:function(e,t,r){var a=r(85893),l=r(93967),o=r.n(l),n=r(67294),s=r(44173),i=r(72547),d=r(47607),c=r(30558);function u(e){return(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}function p(e){return(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h4.125m0-15.75v15.75"})})}t.Z=e=>{let{labelProps:t,labelText:r,onChange:l,showInformation:m=!0,value:x,fileInputProps:f,containerProps:b,outerContainerProps:h,innerContainerProps:g,errorText:y,previousImages:v,previewClasses:w,dimensionDescription:j,uploadDescription:F,disableEdit:N=!1}=e,A=null==f?void 0:f.multiple,k=(0,n.useId)(),C=n.useRef(null),D=null==t?void 0:t.className,[B,W]=(0,n.useState)([]),M=(0,n.useCallback)(e=>"string"==typeof e?e.includes("image")||e.match(/\.(jpg|jpeg|png|gif|webp)$/i):e.type.startsWith("image/"),[]),R=(0,n.useCallback)(e=>"string"==typeof e?e.includes("pdf")||e.endsWith(".pdf"):"application/pdf"===e.type,[]),z=(0,n.useCallback)(e=>M(e)?"image":R(e)?"pdf":"document",[M,R]);(0,n.useEffect)(()=>{if(v)W((Array.isArray(v)?v:[v]).map(e=>({url:e,name:e.split("/").pop()||"file",type:z(e)})));else if(x&&x.length>0){let e=x.map(e=>({url:URL.createObjectURL(e),name:e.name,type:z(e)}));return W(e),()=>{e.forEach(e=>{e.url.startsWith("blob:")&&URL.revokeObjectURL(e.url)})}}else W([])},[v,x,z]);let P=e=>{let t=[...B];if(t.splice(e,1),W(t),x&&x.length>0){let t=[...x];t.splice(e,1),l(t)}else v&&((Array.isArray(v)?[...v]:[v]).splice(e,1),l([]))};return(0,a.jsxs)("div",{...h,className:o()("flex flex-col gap-y-2 max-w-[320px] w-full",null==h?void 0:h.className),children:[(0,a.jsx)("span",{...t,className:o()("text-textSecondary text-xs",D),children:r}),(0,a.jsxs)("div",{...g,className:o()("flex items-center justify-center w-full relative",null==g?void 0:g.className),children:[B.length>0?(()=>{let e=A?Math.min(B.length,5):1;return(0,a.jsx)("div",{className:o()("flex flex-wrap gap-2",A?"":"w-full"),children:B.slice(0,e).map((e,t)=>(0,a.jsxs)("div",{className:"relative",children:["image"===e.type?(0,a.jsx)("img",{src:e.url,className:o()("bg-transparent w-full rounded-xl object-contain border h-[126px]",w),alt:e.name}):(0,a.jsxs)("div",{className:o()("bg-gray-50 min-w-[126px] w-full rounded-xl border h-[126px] flex flex-col items-center justify-center p-4",w),children:["pdf"===e.type?(0,a.jsx)(u,{className:"w-8 h-8 text-red-500 mb-2"}):(0,a.jsx)(p,{className:"w-8 h-8 text-blue-500 mb-2"}),(0,a.jsx)("span",{className:"text-xs text-gray-600 text-center break-all line-clamp-2",children:e.name}),"pdf"===e.type&&(0,a.jsx)("span",{className:"text-xs text-red-500 font-medium mt
1-1",children:"PDF"})]}),A&&!N&&(0,a.jsx)("button",{type:"button",onClick:()=>P(t),className:"absolute top-1 right-1 p-1 bg-white border border-gray-300 rounded-full text-gray-600 hover:bg-red-100 hover:text-red-600 transition z-10","aria-label":"Remove file",children:(0,a.jsx)(d.Z,{width:10,height:10})}),!A&&!N&&(0,a.jsx)("button",{type:"button",onClick:()=>P(t),className:"absolute bottom-2 right-2 z-50 border border-solid border-gray-200 bg-white hover:bg-red-100 flex items-center justify-center rounded-md text-gray-700 transition-all duration-300 group p-1","aria-label":"Remove file",children:(0,a.jsx)(c.Z,{width:20,height:20,className:"text-gray-700 group-hover:text-red-500 transition-all duration-300"})})]},t))})})():(0,a.jsx)("label",{onDrop:e=>{e.preventDefault();let t=e.dataTransfer.files;if(t&&t.length>0){let e=Array.from(t);if(e.some(e=>e.size>30408704))return s.Am.error("File size is too large. Max file size is 30MB");l(e)}},onDragOver:e=>{e.preventDefault()},htmlFor:"file-upload-".concat(k),...b,className:o()("flex flex-col items-center justify-center w-full border border-solid rounded-xl cursor-pointer hover:border-gray-400 transition-all duration-300 md:py-8 py-6",null==b?void 0:b.className,{"border-dropZoneBorder":!y,"border-errorPrimary":y}),children:(0,a.jsx)("div",{className:"flex flex-col items-center justify-center",children:m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"mb-1 text-sm text-inputDescription text-center",children:F||(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]})}),(0,a.jsx)("p",{className:"text-xs text-gray-500 mb-1 text-center",children:j||"PNG or JPG (Max. 800x400px)"})]})})}),(0,a.jsx)("input",{ref:C,id:"file-upload-".concat(k),type:"file",className:"hidden",accept:"image/png, image/jpeg, image/jpg",onChange:e=>{let t=e.target.files;if(t&&t.length>0){let e=Array.from(t);if(e.some(e=>e.size>30408704))return s.Am.error("File size is too large. Max file size is 30MB");l(e)}},...f})]}),y&&(0,a.jsx)(i.Z,{children:y})]})}},19850:function(e,t,r){r.d(t,{Oo:function(){return x},TR:function(){return c},Yd:function(){return u},_S:function(){return p}});var a=r(53483),l=r(98029),o=r(29204),n=r(44173);let s=async e=>{let{file:t,type:r}=e,l=new FormData;l.append("file",t),l.append("fileType",r);try{return(await a.x.post("/files",l,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(e){if(e instanceof o.d7){var s,i;n.Am.error((null===(i=e.response)||void 0===i?void 0:null===(s=i.data)||void 0===s?void 0:s.message)||"Failed to upload file")}else n.Am.error("Failed to upload file");throw e}},i=async e=>{try{let t=new FormData;return t.append("file",e),t.append("type","USER_AVATAR"),(await a.x.post("/files/avatar",t,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(e){if(e instanceof o.d7){var t,r;n.Am.error((null===(r=e.response)||void 0===r?void 0:null===(t=r.data)||void 0===t?void 0:t.message)||"Failed to upload file")}else n.Am.error("Failed to upload file");throw e}},d=async e=>{try{let t=new FormData;return t.append("file",e),(await a.x.post("/files/svg",t,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(e){if(e instanceof o.d7){var t,r;n.Am.error((null===(r=e.response)||void 0===r?void 0:null===(t=r.data)||void 0===t?void 0:t.message)||"Failed to upload file")}else n.Am.error("Failed to upload file");throw e}},c=()=>(0,l.D)({mutationFn:s,mutationKey:["createFile"]}),u=()=>(0,l.D)({mutationFn:i,mutationKey:["createAvatarFile"]}),p=()=>(0,l.D)({mutationFn:d,mutationKey:["createSVGFile"]}),m=async e=>{let{file:t}=e,r=new FormData;r.append("file",t);try{return(await a.x.post("/files/tier",r,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(e){if(e instanceof o.d7){var l,s;n.Am.error((null===(s=e.response)||void 0===s?void 0:null===(l=s.data)||void 0===l?void 0:l.message)||"Failed to upload file")}else n.Am.error("Failed to upload file");throw e}},x=()=>(0,l.D)({mutationFn:m,mutationKey:["createBackgroundImageTier"]})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.