1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[45],{66908:(e,s,t)=>{t.d(s,{X:()=>y});var r=t(74848),a=t(96540),l=t(52698),i=t(25855),n=t(73807),d=t(47212),c=t(59140),o=t(20424),m=t(56034),x=t(90708),u=t(87296),h=t(82995),f=t(76897),g=t(92955),b=t(71468),p=t(61386),j=t(64721);function y(e){let{failedMethod:s,canDeductCredits:t,hasEnoughProfiles:y,availableCredits:v,creditCost:N,availableProfiles:w,requiredProfiles:C,featureName:k,isPurchasing:A,onUseCredits:D,onContributeProfiles:P,onPurchaseCredits:F,onUploadProfiles:O,contributionMode:I,walletBalance:S,onCancel:_}=e,q=(0,b.wA)(),{isBulkUploadLoading:E=!1}=(0,b.d4)(e=>(null==e?void 0:e.clientReducer)||{}),U="PAY_ONLY"===I,L="PROFILES"===s,[R,z]=(0,a.useState)(""),B=R?Math.floor(Number(R)/1):0,[X,W]=(0,a.useState)(!1),[M,T]=(0,a.useState)([]),[Y,K]=(0,a.useState)(!1),V=(0,a.useRef)(null),$=e=>{let s=e.filter(e=>e.name.toLowerCase().endsWith(".pdf")||e.name.toLowerCase().endsWith(".doc")||e.name.toLowerCase().endsWith(".docx"));if(s.filter(e=>e.size>0xa00000).length>0){j.toast.error("Some files exceed 10MB limit");return}s.length!==e.length&&j.toast.error("Only PDF, DOC, DOCX files are accepted"),s.length>0&&T(e=>[...e,...s])};return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-amber-50 border border-amber-200",children:[(0,r.jsx)(l.A,{className:"h-5 w-5 text-amber-500 mt-0.5 shrink-0"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-700",children:U?"Insufficient wallet balance to use this feature.":L?"No unique candidate profiles available to contribute.":"Insufficient credits to use this feature."}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:U?"â¹".concat(null!=S?S:v," available, â¹").concat(N," required"):L?"".concat(w," profile").concat(1!==w?"s":""," available, ").concat(C," required"):"".concat(v," credit").concat(1!==v?"s":""," available, ").concat(N," required")}),k&&(0,r.jsxs)("p",{className:"text-xs text-gray-400 mt-0.5",children:["Feature: ",k]})]})]}),L&&(t?(0,r.jsxs)("button",{onClick:D,className:"w-full group relative flex items-start gap-4 p-4 rounded-lg border-2 border-amber-300 bg-amber-50 hover:bg-amber-100 hover:border-amber-400 transition-all duration-200",children:[(0,r.jsx)("div",{className:"flex h-10 w-10 sm:h-12 sm:w-12 shrink-0 items-center justify-center rounded-full bg-amber-100",children:(0,r.jsx)(i.A,{className:"h-5 w-5 sm:h-6 sm:w-6 text-amber-600"})}),(0,r.jsxs)("div",{className:"flex-1 text-left",children:[(0,r.jsx)("h3",{className:"font-medium text-gray-900 text-sm sm:text-base",children:"Use Credits Instead"}),(0,r.jsxs)("p",{className:"text-xs sm:text-sm text-gray-500 mt-0.5",children:["Deduct ",N," credit",1!==N?"s":""," from your balance to use this feature."]}),(0,r.jsxs)("div",{className:"mt-1.5 inline-flex items-center gap-1.5 text-xs font-medium text-green-600",children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5"}),(0,r.jsxs)("span",{children:[v," credits available"]})]})]})]}):(0,r.jsxs)("div",{className:"w-full flex items-start gap-4 p-4 rounded-lg border border-gray-200 bg-gray-50 opacity-75",children:[(0,r.jsx)("div",{className:"flex h-10 w-10 sm:h-12 sm:w-12 shrink-0 items-center justify-center rounded-full bg-gray-200",children:(0,r.jsx)(i.A,{className:"h-5 w-5 sm:h-6 sm:w-6 text-gray-400"})}),(0,r.jsxs)("div",{className:"flex-1 text-left",children:[(0,r.jsx)("h3",{className:"font-medium text-gray-500 text-sm sm:text-base",children:"Use Credits"}),(0,r.jsxs)("div",{className:"mt-1 inline-flex items-center gap-1.5 text-xs font-medium text-red-500",children:[(0,r.jsx)(d.A,{className:"h-3.5 w-3.5"}),(0,r.jsxs)("span",{children:["Insufficient â ",v," credit",1!==v?"s":""," available, ",N," required"]})]})]})]})),"CREDITS"===s&&!U&&(y?(0,r.jsxs)("button",{onClick:P,className:"w-full group relative flex items-start gap-4 p-4 rounded-lg border-2 border-blue-300 bg-blue-50 hover:bg-blue-100 hover:border-blue-400 transition-all duration-200",children:[(0,r.jsx)("div",{className:"flex h-10 w-10 sm:h-12 sm:w-12 shrink-0 items-center justify-center rounded-full bg-blue-100",children:(0,r.jsx)(c.A,{className:"h-5 w-5 sm:h-6 sm:w-6 text-blue-600"})}),(0,r.jsxs)("div",{className:"flex-1 text-left",children:[(0,r.jsx)("h3",{className:"font-medium text-gray-900 text-sm sm:text-base",children:"Contribute Profiles Instead"}),(0,r.jsxs)("p",{className:"text-xs sm:text-sm text-gray-500 mt-0.5",children:["Contribute ",C," candidate profile",1!==C?"s":""," to use this feature."]}),(0,r.jsxs)("div",{className:"mt-1.5 inline-flex items-center gap-1.5 text-xs font-medium text-green-600",children:[(0,r.jsx)(n.A,{className:"h-3.5 w-3.5"}),(0,r.jsxs)("span",{children:[w," unique profiles available"]})]})]})]}):(0,r.jsxs)("div",{className:"w-full flex items-start gap-4 p-4 rounded-lg border border-gray-200 bg-gray-50 opacity-75",children:[(0,r.jsx)("div",{className:"flex h-10 w-10 sm:h-12 sm:w-12 shrink-0 items-center justify-center rounded-full bg-gray-200",children:(0,r.jsx)(c.A,{className:"h-5 w-5 sm:h-6 sm:w-6 text-gray-400"})}),(0,r.jsxs)("div",{className:"flex-1 text-left",children:[(0,r.jsx)("h3",{className:"font-medium text-gray-500 text-sm sm:text-base",children:"Contribute Profiles"}),(0,r.jsxs)("div",{className:"mt-1 inline-flex items-center gap-1.5 text-xs font-medium text-red-500",children:[(0,r.jsx)(d.A,{className:"h-3.5 w-3.5"}),(0,r.jsxs)("span",{children:["Insufficient â ",w," profile",1!==w?"s":""," available, ",C," required"]})]})]})]})),(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3 mb-3",children:[(0,r.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-gray-100",children:(0,r.jsx)(o.A,{className:"h-5 w-5 text-gray-600"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-medium text-gray-900 text-sm sm:text-base",children:U?"Add Funds to Wallet":"Purchase Credits"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:U?"Add money to your wallet to use this feature.":"Enter the amount of credits you want (1 Credit = â¹1)."})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Amount (INR)"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(m.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,r.jsx)("input",{type:"number",placeholder:"0",value:R,onChange:e=>z(e.target.value),min:"0",className:"w-full pl-9 pr-3 py-2 border border-gray-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]}),!U&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"text-gray-400 text-lg font-light mt-5",children:"="}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"You'll receive"}),(0,r.jsxs)("div",{className:"rounded-lg bg-blue-50 px-3 py-2 border border-blue-100",children:[(0,r.jsx)("span",{className:"text-lg font-bold text-blue-600 tabular-nums",children:B}),(0,r.jsx)("span",{className:"text-xs text-gray-600 ml-1",children:"credits"})]})]})]})]}),(0,r.jsx)("button",{onClick:()=>F(Number(R)),disabled:!R||B<=0||A,className:"mt-3 w-full py-2.5 px-4 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:A?"Processing...":U?"Add Funds":"Purchase"})]}),!U&&(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>W(!X),className:"w-full flex items-start gap-4",children:[(0,r.jsx)("div",{className:"flex h-10 w-10 sm:h-12 sm:w-12 shrink-0 items-center justify-center rounded-full bg-green-100",children:(0,r.jsx)(x.A,{className:"h-5 w-5 sm:h-6 sm:w-6 text-green-600"})}),(0,r.jsxs)("div",{className:"flex-1 text-left",children:[(0,r.jsx)("h3",{className:"font-medium text-gray-900 text-sm sm:text-base",children:"Upload Profiles"}),(0,r.jsx)("p",{className:"text-xs sm:text-sm text-gray-500 mt-0.5",children:"Upload candidate resumes (PDF, DOC, DOCX) to contribute them for features."})]})]}),X&&(0,r.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,r.jsxs)("div",{onDragOver:e=>{e.preventDefault(),K(!0)},onDragLeave:e=>{e.preventDefault(),K(!1)},onDrop:e=>{e.preventDefault(),K(!1),e.dataTransfer.files&&$(Array.from(e.dataTransfer.files))},className:"border-2 border-dashed rounded-lg p-6 text-center transition-colors cursor-pointer ".concat(Y?"border-green-400 bg-green-50":"border-gray-200 hover:border-gray-300 bg-gray-50/50"),onClick:()=>{var e;return null===(e=V.current)||void 0===e?void 0:e.click()},children:[(0,r.jsx)("input",{ref:V,type:"file",accept:".pdf,.doc,.docx",multiple:!0,onChange:e=>{e.target.files&&$(Array.from(e.target.files)),e.target.value=""},className:"hidden"}),(0,r.jsx)(u.A,{className:"w-8 h-8 text-gray-400 mx-auto mb-2"}),(0,r.jsxs)("p",{className:"text-sm text-gray-600",children:["Drag & drop resumes here or ",(0,r.jsx)("span",{className:"text-blue-600 font-medium",children:"browse"})]}),(0,r.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"PDF, DOC, DOCX â max 10MB each"})]}),M.length>0&&(0,r.jsx)("div",{className:"space-y-1.5 max-h-32 overflow-y-auto",children:M.map((e,s)=>(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-50 rounded-lg text-sm",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(h.A,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}),(0,r.jsx)("span",{className:"truncate text-gray-700",children:e.name}),(0,r.jsxs)("span",{className:"text-xs text-gray-400 flex-shrink-0",children:["(",(e.size/1024).toFixed(0)," KB)"]})]}),(0,r.jsx)("button",{type:"button",onClick:()=>T(e=>e.filter((e,t)=>
1t!==s)),className:"text-gray-400 hover:text-red-500 flex-shrink-0",children:(0,r.jsx)(f.A,{className:"w-4 h-4"})})]},s))}),M.length>0&&(0,r.jsx)("button",{type:"button",onClick:()=>{if(0===M.length){j.toast.error("Please select files to upload");return}let e=new FormData;M.forEach(s=>e.append("documents",s)),q((0,p.SE)({data:e,cb:()=>{j.toast.success("".concat(M.length," profile(s) uploaded successfully")),T([]),W(!1),_()},errorCB:()=>{j.toast.error("Upload failed. Please try again.")}}))},disabled:E,className:"w-full py-2.5 px-4 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",children:E?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.A,{className:"w-4 h-4 animate-spin"})," Uploading..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.A,{className:"w-4 h-4"})," Upload ",M.length," Profile",1!==M.length?"s":""]})})]})]}),(0,r.jsxs)("button",{onClick:_,className:"w-full flex items-center justify-center gap-2 p-3 rounded-lg border border-gray-200 bg-white hover:bg-gray-50 transition-all duration-200",children:[(0,r.jsx)(d.A,{className:"h-4 w-4 text-gray-400"}),(0,r.jsx)("span",{className:"text-sm text-gray-500",children:"Cancel"})]})]})}},11988:(e,s,t)=>{t.d(s,{$:()=>c});var r=t(74848),a=t(96540),l=t(33362),i=t(22732),n=t(18019);let d=(0,i.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border !border-primary !bg-transparent !text-primary !hover:text-primary/90 shadow-sm hover:text-accent-foreground",secondary:"bg-[#e2eaf8] text-primary hover:bg-primary-800 hover:text-white",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-11 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),c=a.forwardRef((e,s)=>{let{className:t,variant:a,size:i,asChild:c=!1,...o}=e,m=c?l.DX:"button";return(0,r.jsx)(m,{className:(0,n.cn)(d({variant:a,size:i,className:t})),ref:s,...o})});c.displayName="Button"}}]);
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.