@fileflow/sdk 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ImportWizard-CptGek_O.js → ImportWizard-D5B5j2TQ.js} +5 -5
- package/dist/{ImportWizard-CptGek_O.js.map → ImportWizard-D5B5j2TQ.js.map} +1 -1
- package/dist/{ImportWizard-Bl9foTic.mjs → ImportWizard-DrDHQwnE.mjs} +271 -271
- package/dist/{ImportWizard-Bl9foTic.mjs.map → ImportWizard-DrDHQwnE.mjs.map} +1 -1
- package/dist/{KYCWizard-B73SHhAI.js → KYCWizard-C1PumBBm.js} +3 -3
- package/dist/KYCWizard-C1PumBBm.js.map +1 -0
- package/dist/{KYCWizard-D4RKtikr.mjs → KYCWizard-W1poXII_.mjs} +40 -40
- package/dist/KYCWizard-W1poXII_.mjs.map +1 -0
- package/dist/import.js +1 -1
- package/dist/import.mjs +1 -1
- package/dist/index-A7EopL2N.js +112 -0
- package/dist/index-A7EopL2N.js.map +1 -0
- package/dist/{index-CEvc89fO.mjs → index-BIGw5rPX.mjs} +3037 -2998
- package/dist/index-BIGw5rPX.mjs.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +21 -18
- package/dist/kyc.js +1 -1
- package/dist/kyc.mjs +1 -1
- package/package.json +3 -7
- package/dist/KYCWizard-B73SHhAI.js.map +0 -1
- package/dist/KYCWizard-D4RKtikr.mjs.map +0 -1
- package/dist/index-CEvc89fO.mjs.map +0 -1
- package/dist/index-VbMSbLb2.js +0 -112
- package/dist/index-VbMSbLb2.js.map +0 -1
- package/dist/style.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),k=require("react"),l=require("./index-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),k=require("react"),l=require("./index-A7EopL2N.js");/**
|
|
2
2
|
* @license lucide-react v0.321.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const ce=l.createLucideIcon("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]),Y=c=>({id:null,type:c,status:"uploaded",file:null,previewUrl:null,extractedData:null,confidence:0,fraudFlags:[],error:null}),_={sessionId:null,status:"idle",step:"select",requiredDocuments:[],currentDocumentType:null,documents:new Map,isVerified:!1,verificationStatus:null,isLoading:!1,error:null},I=l.create((c,o)=>({..._,setSessionId:r=>c({sessionId:r}),setRequiredDocuments:r=>{const s=new Map;for(const a of r)s.set(a,Y(a));c({requiredDocuments:r,documents:s,currentDocumentType:r[0]||null})},setCurrentDocumentType:r=>c({currentDocumentType:r}),setDocumentFile:(r,s)=>{const{documents:a}=o(),t=a.get(r)||Y(r),f=URL.createObjectURL(s),x=new Map(a);x.set(r,{...t,file:s,previewUrl:f,status:"uploaded",error:null}),c({documents:x})},setDocumentStatus:(r,s)=>{const{documents:a}=o(),t=a.get(r);if(t){const f=new Map(a);f.set(r,{...t,status:s}),c({documents:f})}},setDocumentData:(r,s)=>{const{documents:a}=o(),t=a.get(r);if(t){const f=new Map(a);f.set(r,{...t,...s}),c({documents:f})}},clearDocumentPreview:r=>{const{documents:s}=o(),a=s.get(r);a!=null&&a.previewUrl&&URL.revokeObjectURL(a.previewUrl)},setStep:r=>c({step:r}),nextDocument:()=>{const{requiredDocuments:r,currentDocumentType:s,documents:a}=o(),t=s?r.indexOf(s):-1;for(let f=t+1;f<r.length;f++){const x=r[f],m=a.get(x);if(!(m!=null&&m.file)){c({currentDocumentType:x});return}}c({currentDocumentType:null,step:"processing"})},setVerificationStatus:r=>c({verificationStatus:r}),setVerified:r=>c({isVerified:r}),setStatus:r=>c({status:r}),setLoading:r=>c({isLoading:r}),setError:r=>c({error:r}),getNextRequiredDocument:()=>{const{requiredDocuments:r,documents:s}=o();for(const a of r){const t=s.get(a);if(!(t!=null&&t.file))return a}return null},areAllDocumentsUploaded:()=>{const{requiredDocuments:r,documents:s}=o();return r.every(a=>{const t=s.get(a);return(t==null?void 0:t.file)!==null})},areAllDocumentsProcessed:()=>{const{requiredDocuments:r,documents:s}=o();return r.every(a=>{const t=s.get(a);return(t==null?void 0:t.status)==="completed"||(t==null?void 0:t.status)==="requires_review"})},reset:()=>{const{documents:r}=o();for(const s of r.values())s.previewUrl&&URL.revokeObjectURL(s.previewUrl);c(_)}})),K=({documentType:c,onFileSelect:o})=>{const{documents:r,setDocumentFile:s,isLoading:a}=I(),t=r.get(c),f=l.DOCUMENT_TYPES[c],x=k.useCallback((d,z)=>{if(!(z.length>0)&&d.length>0){const h=d[0];s(c,h),o==null||o(h)}},[c,o,s]),{getRootProps:m,getInputProps:u,isDragActive:g}=l.useDropzone({onDrop:x,accept:{"application/pdf":[".pdf"],"image/jpeg":[".jpg",".jpeg"],"image/png":[".png"]},maxSize:f.maxFileSize,multiple:!1,disabled:a}),C=d=>d<1024?`${d} B`:d<1024*1024?`${(d/1024).toFixed(1)} KB`:`${(d/(1024*1024)).toFixed(1)} MB`,L=()=>{var d;return((d=t==null?void 0:t.file)==null?void 0:d.type)==="application/pdf"?e.jsx(O,{className:"ff-w-6 ff-h-6"}):e.jsx(ae,{className:"ff-w-6 ff-h-6"})},P=d=>{d.stopPropagation(),I.getState().clearDocumentPreview(c),s(c,null)};return t!=null&&t.file&&t.previewUrl?e.jsxs("div",{className:"ff-space-y-4",children:[e.jsx("div",{className:"ff-p-4 ff-rounded-xl",style:{backgroundColor:"var(--ff-primary-20)",border:"1px solid var(--ff-primary-50)"},children:e.jsxs("div",{className:"ff-flex ff-items-center ff-gap-3",children:[e.jsx("div",{className:"ff-p-2 ff-rounded-lg",style:{backgroundColor:"var(--ff-primary-30)"},children:e.jsx("span",{style:{color:"var(--ff-primary-90)"},children:L()})}),e.jsxs("div",{className:"ff-flex-1 ff-min-w-0",children:[e.jsx("p",{className:"ff-font-medium ff-truncate",style:{color:"var(--ff-primary-110)"},children:t.file.name}),e.jsx("p",{className:"ff-text-sm",style:{color:"var(--ff-primary-90)"},children:C(t.file.size)})]}),e.jsx("button",{onClick:P,className:"ff-p-1.5 ff-rounded-full ff-transition-colors",style:{color:"var(--ff-primary-90)"},"aria-label":"Remove file",children:e.jsx(l.X,{className:"ff-w-5 ff-h-5"})})]})}),e.jsx("div",{className:"ff-document-preview ff-aspect-[3/4] ff-max-h-96",children:t.file.type==="application/pdf"?e.jsx("iframe",{src:t.previewUrl,className:"ff-w-full ff-h-full ff-rounded-xl",title:"Document preview"}):e.jsx("img",{src:t.previewUrl,alt:"Document preview",className:"ff-w-full ff-h-full ff-object-contain ff-rounded-xl"})})]}):e.jsxs("div",{className:"ff-space-y-6",children:[e.jsxs("div",{className:"ff-text-center ff-mb-4",children:[e.jsx("h3",{className:"ff-text-lg ff-font-semibold",style:{color:"var(--ff-text-primary)"},children:f.label}),e.jsx("p",{className:"ff-text-sm ff-mt-1",style:{color:"var(--ff-text-muted)"},children:f.description})]}),e.jsxs("div",{...m(),className:l.clsx("ff-dropzone",g&&"ff-dropzone-active",a&&"ff-opacity-50 ff-cursor-not-allowed"),children:[e.jsx("input",{...u()}),e.jsx("div",{className:"ff-dropzone-icon-wrapper",children:e.jsx(l.Upload,{className:"ff-dropzone-icon"})}),e.jsx("h3",{className:"ff-dropzone-text",children:g?"Drop your document here":"Upload your document"}),e.jsx("p",{className:"ff-dropzone-hint",children:"Drag and drop or click to select"}),e.jsx("label",{className:"ff-inline-block",children:e.jsx("span",{className:l.clsx("ff-btn ff-btn-primary",a&&"ff-opacity-50 ff-cursor-wait"),children:a?"Processing...":"Choose file"})}),e.jsxs("div",{className:"ff-flex ff-flex-wrap ff-justify-center ff-gap-2 ff-mt-3",children:[f.acceptedFormats.map(d=>e.jsx("span",{className:"ff-px-2 ff-py-1 ff-rounded ff-text-xs",style:{backgroundColor:"var(--ff-bg-tertiary)",color:"var(--ff-text-muted)"},children:d.toUpperCase()},d)),e.jsxs("span",{className:"ff-px-2 ff-py-1 ff-text-xs",style:{color:"var(--ff-text-muted)"},children:["Max ",C(f.maxFileSize)]})]})]}),(t==null?void 0:t.error)&&e.jsxs("div",{className:"ff-flex ff-items-center ff-gap-2 ff-p-4 ff-rounded-lg ff-text-sm",style:{backgroundColor:"var(--ff-error-light)",color:"var(--ff-error)"},children:[e.jsx(l.AlertCircle,{className:"ff-w-4 ff-h-4 ff-flex-shrink-0"}),e.jsx("p",{children:t.error})]}),e.jsxs("div",{className:"ff-rounded-xl ff-p-4",style:{backgroundColor:"var(--ff-bg-secondary)"},children:[e.jsx("h4",{className:"ff-text-sm ff-font-medium ff-mb-2",style:{color:"var(--ff-text-secondary)"},children:"Tips for best results:"}),e.jsxs("ul",{className:"ff-text-sm ff-space-y-1 ff-list-disc ff-list-inside",style:{color:"var(--ff-text-muted)"},children:[e.jsx("li",{children:"Ensure all text is clearly visible and readable"}),e.jsx("li",{children:"Avoid glare, shadows, or blurry images"}),e.jsx("li",{children:"Include all four corners of the document"}),e.jsx("li",{children:"Use good lighting when taking photos"})]})]})]})},B=({documentType:c,showDetails:o=!0})=>{const{documents:r}=I(),s=r.get(c),a=l.DOCUMENT_TYPES[c],f=(u=>{switch(u){case"completed":return{icon:l.CheckCircle,iconColor:"var(--ff-success)",bgColor:"var(--ff-success-light)",label:"Verified",labelColor:"var(--ff-success)",description:"Document successfully processed"};case"requires_review":return{icon:l.AlertTriangle,iconColor:"var(--ff-warning)",bgColor:"var(--ff-warning-light)",label:"Review Required",labelColor:"var(--ff-warning)",description:"Manual verification may be needed"};case"failed":return{icon:l.XCircle,iconColor:"var(--ff-error)",bgColor:"var(--ff-error-light)",label:"Failed",labelColor:"var(--ff-error)",description:"Unable to process document"};case"processing":return{icon:l.Loader2,iconColor:"var(--ff-primary-90)",bgColor:"var(--ff-primary-20)",label:"Processing",labelColor:"var(--ff-primary-90)",description:"Analyzing document..."};case"uploaded":return{icon:A,iconColor:"var(--ff-text-secondary)",bgColor:"var(--ff-bg-tertiary)",label:"Pending",labelColor:"var(--ff-text-secondary)",description:"Waiting to be processed"};default:return{icon:A,iconColor:"var(--ff-text-muted)",bgColor:"var(--ff-bg-tertiary)",label:"Not Uploaded",labelColor:"var(--ff-text-muted)",description:"Upload document to continue"}}})(s==null?void 0:s.status),x=f.icon,m=u=>u>=.8?"var(--ff-success)":u>=.6?"var(--ff-warning)":"var(--ff-error)";return e.jsxs("div",{className:"ff-space-y-3",children:[e.jsxs("div",{className:"ff-flex ff-items-center ff-gap-3",children:[e.jsx("div",{className:"ff-p-2 ff-rounded-xl",style:{backgroundColor:f.bgColor},children:e.jsx(x,{className:l.clsx("ff-w-5 ff-h-5",(s==null?void 0:s.status)==="processing"&&"ff-animate-spin"),style:{color:f.iconColor}})}),e.jsxs("div",{children:[e.jsx("p",{className:"ff-font-medium",style:{color:"var(--ff-text-primary)"},children:a.label}),e.jsx("p",{className:"ff-text-sm",style:{color:f.labelColor},children:f.label})]})]}),(s==null?void 0:s.confidence)!==void 0&&s.confidence>0&&e.jsxs("div",{className:"ff-space-y-1",children:[e.jsxs("div",{className:"ff-flex ff-items-center ff-justify-between ff-text-sm",children:[e.jsx("span",{style:{color:"var(--ff-text-secondary)"},children:"Confidence"}),e.jsxs("span",{className:"ff-font-medium",style:{color:m(s.confidence)},children:[Math.round(s.confidence*100),"%"]})]}),e.jsx("div",{className:"ff-progress",children:e.jsx("div",{className:"ff-progress-bar",style:{width:`${s.confidence*100}%`,backgroundColor:m(s.confidence)}})})]}),o&&(s==null?void 0:s.fraudFlags)&&s.fraudFlags.length>0&&e.jsxs("div",{className:"ff-space-y-2",children:[e.jsx("p",{className:"ff-text-sm ff-font-medium",style:{color:"var(--ff-text-secondary)"},children:"Issues Detected"}),e.jsx("div",{className:"ff-space-y-1",children:s.fraudFlags.map((u,g)=>e.jsxs("div",{className:"ff-flex ff-items-start ff-gap-2 ff-p-2 ff-rounded-lg ff-text-sm",style:{backgroundColor:u.severity==="high"?"var(--ff-error-light)":u.severity==="medium"?"var(--ff-warning-light)":"var(--ff-bg-tertiary)",color:u.severity==="high"?"var(--ff-error)":u.severity==="medium"?"var(--ff-warning)":"var(--ff-text-secondary)"},children:[u.severity==="high"?e.jsx(l.XCircle,{className:"ff-w-4 ff-h-4 ff-flex-shrink-0 ff-mt-0.5"}):e.jsx(l.AlertTriangle,{className:"ff-w-4 ff-h-4 ff-flex-shrink-0 ff-mt-0.5"}),e.jsx("span",{children:u.message})]},g))})]}),o&&(s==null?void 0:s.extractedData)&&s.status==="completed"&&e.jsxs("div",{className:"ff-rounded-xl ff-p-3",style:{backgroundColor:"var(--ff-bg-tertiary)"},children:[e.jsx("p",{className:"ff-text-sm ff-font-medium ff-mb-2",style:{color:"var(--ff-text-secondary)"},children:"Extracted Information"}),e.jsxs("dl",{className:"ff-space-y-1 ff-text-sm",children:["fullName"in s.extractedData&&e.jsxs("div",{className:"ff-flex ff-justify-between",children:[e.jsx("dt",{style:{color:"var(--ff-text-muted)"},children:"Name"}),e.jsx("dd",{className:"ff-font-medium",style:{color:"var(--ff-text-primary)"},children:s.extractedData.fullName})]}),"dateOfBirth"in s.extractedData&&e.jsxs("div",{className:"ff-flex ff-justify-between",children:[e.jsx("dt",{style:{color:"var(--ff-text-muted)"},children:"Date of Birth"}),e.jsx("dd",{style:{color:"var(--ff-text-primary)"},children:s.extractedData.dateOfBirth})]}),s.extractedData.documentType==="passport"&&"passportNumber"in s.extractedData&&e.jsxs("div",{className:"ff-flex ff-justify-between",children:[e.jsx("dt",{style:{color:"var(--ff-text-muted)"},children:"Passport #"}),e.jsx("dd",{className:"ff-font-mono",style:{color:"var(--ff-text-primary)"},children:s.extractedData.passportNumber})]}),s.extractedData.documentType==="drivers_license"&&"licenseNumber"in s.extractedData&&e.jsxs("div",{className:"ff-flex ff-justify-between",children:[e.jsx("dt",{style:{color:"var(--ff-text-muted)"},children:"License #"}),e.jsx("dd",{className:"ff-font-mono",style:{color:"var(--ff-text-primary)"},children:s.extractedData.licenseNumber})]}),"address"in s.extractedData&&s.extractedData.address&&e.jsxs("div",{className:"ff-flex ff-justify-between",children:[e.jsx("dt",{style:{color:"var(--ff-text-muted)"},children:"Address"}),e.jsxs("dd",{className:"ff-text-right",style:{color:"var(--ff-text-primary)"},children:[s.extractedData.address.city,","," ",s.extractedData.address.province]})]})]})]})]})},M=["select","upload","review","complete"],ne={passport:O,drivers_license:re,proof_of_address:fe},ie=({requiredDocuments:c,onComplete:o,onCancel:r,onError:s})=>{const{sessionId:a,step:t,currentDocumentType:f,documents:x,isVerified:m,verificationStatus:u,isLoading:g,error:C,setSessionId:L,setRequiredDocuments:P,setCurrentDocumentType:d,setDocumentStatus:z,setDocumentData:h,setStep:j,nextDocument:H,setVerificationStatus:E,setVerified:W,setLoading:b,setError:U,areAllDocumentsUploaded:R,areAllDocumentsProcessed:F,reset:X}=I(),[oe,N]=k.useState(null);k.useEffect(()=>(P(c),$(),()=>{N(null)}),[c]);const $=async()=>{try{b(!0);const n=await l.getClient().createKYCSession(c);L(n.sessionId),j("upload")}catch(i){const n=i;U(n.message),s==null||s(n)}finally{b(!1)}},Z=k.useCallback(async i=>{if(!(!a||!f))try{b(!0),U(null);const p=await l.getClient().uploadKYCDocument(a,f,i);h(f,{id:p.documentId,status:"processing"}),N(p.documentId),G(p.documentId)}catch(n){const p=n;h(f,{status:"failed",error:p.message}),s==null||s(p)}finally{b(!1)}},[a,f]),G=async i=>{let v=0,D=0;const T=async()=>{var q;if(v>=30){N(null),f&&h(f,{status:"failed",error:"Processing timed out. Please try again."});return}if(D>=3){N(null),f&&h(f,{status:"failed",error:"Failed to check document status. Please refresh and try again."});return}try{const y=(await l.getClient().getKYCDocument(i)).document;D=0;const te=y.type;if(h(te,{id:y.id,status:y.status,extractedData:y.extractedData,confidence:y.confidence,fraudFlags:y.fraudFlags,error:null}),y.status==="completed"||y.status==="requires_review"||y.status==="failed"){N(null),R()?F()&&j("review"):H();return}v++,setTimeout(T,2e3)}catch(V){const S=V;if(D++,v++,S.status===404||(q=S.message)!=null&&q.includes("not found")){N(null),f&&h(f,{status:"failed",error:"Session not found or invalid state"});return}D<3?setTimeout(T,3e3*D):(N(null),f&&h(f,{status:"failed",error:S.message||"Failed to process document"}))}};T()},J=async()=>{if(a)try{b(!0),U(null);const n=await l.getClient().verifyKYCSession(a,!0);E(n.verificationStatus);const p=n.verificationStatus;W(p.isVerified),j("complete"),o==null||o(n)}catch(i){const n=i;U(n.message),s==null||s(n)}finally{b(!1)}},Q=()=>{X(),r==null||r()},ee=i=>{d(i),j("upload")},se=i=>{const n=x.get(i);return(n==null?void 0:n.status)==="completed"||(n==null?void 0:n.status)==="requires_review"},w=()=>{const i=t==="processing"?"upload":t;return M.indexOf(i)};return e.jsxs("div",{className:"ff-container ff-modal",children:[e.jsxs("div",{className:"ff-modal-header",children:[e.jsxs("div",{className:"ff-modal-header-left",children:[e.jsxs("div",{className:"ff-flex ff-items-center ff-gap-3",children:[e.jsx("div",{className:"ff-modal-icon",children:e.jsx(ce,{})}),e.jsx("h2",{className:"ff-modal-title",children:"Identity Verification"})]}),e.jsx("div",{className:"ff-steps ff-ml-4",children:M.map((i,n)=>e.jsxs(k.Fragment,{children:[e.jsx("div",{className:l.clsx("ff-step",w()===n&&"ff-step-active",w()>n&&"ff-step-complete",w()<n&&"ff-step-pending"),children:w()>n?"✓":n+1}),n<M.length-1&&e.jsx("div",{className:l.clsx("ff-step-connector",w()>n&&"ff-step-connector-complete")})]},i))})]}),e.jsx("button",{onClick:Q,className:"ff-modal-close",children:e.jsx(l.X,{className:"ff-w-5 ff-h-5"})})]}),e.jsxs("div",{className:"ff-modal-body",children:[C&&e.jsx("div",{className:"ff-mb-4 ff-p-4 ff-rounded-lg ff-text-sm",style:{backgroundColor:"var(--ff-error-light)",color:"var(--ff-error)"},children:C}),t==="select"&&e.jsxs("div",{className:"ff-space-y-4",children:[e.jsx("p",{className:"ff-text-center ff-mb-6",style:{color:"var(--ff-text-muted)"},children:"Please upload the following documents to verify your identity"}),e.jsx("div",{className:"ff-grid ff-gap-3",children:c.map(i=>{const n=ne[i],p=l.DOCUMENT_TYPES[i];x.get(i);const v=se(i);return e.jsxs("button",{onClick:()=>ee(i),className:l.clsx("ff-flex ff-items-center ff-gap-4 ff-p-4 ff-rounded-xl ff-border-2 ff-text-left ff-transition-all ff-duration-150",v?"ff-border-transparent":"ff-border-transparent hover:ff-border-transparent"),style:{backgroundColor:v?"var(--ff-success-light)":"var(--ff-bg-secondary)",borderColor:v?"var(--ff-success)":"var(--ff-border-light)"},children:[e.jsx("div",{className:"ff-p-3 ff-rounded-xl",style:{backgroundColor:v?"rgba(41, 142, 51, 0.15)":"var(--ff-bg-tertiary)"},children:v?e.jsx(l.CheckCircle,{className:"ff-w-6 ff-h-6",style:{color:"var(--ff-success)"}}):e.jsx(n,{className:"ff-w-6 ff-h-6",style:{color:"var(--ff-text-secondary)"}})}),e.jsxs("div",{className:"ff-flex-1",children:[e.jsx("p",{className:"ff-font-medium",style:{color:"var(--ff-text-primary)"},children:p.label}),e.jsx("p",{className:"ff-text-sm",style:{color:"var(--ff-text-muted)"},children:p.description})]}),e.jsx(l.ChevronRight,{className:"ff-w-5 ff-h-5",style:{color:"var(--ff-text-muted)"}})]},i)})})]}),t==="upload"&&f&&e.jsx("div",{className:"ff-py-4",children:e.jsx("div",{className:"ff-max-w-lg ff-mx-auto",children:e.jsx(K,{documentType:f,onFileSelect:Z})})}),t==="processing"&&e.jsxs("div",{className:"ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12",children:[e.jsx(l.Loader2,{className:"ff-w-12 ff-h-12 ff-animate-spin ff-mb-4",style:{color:"var(--ff-primary-90)"}}),e.jsx("h3",{className:"ff-text-lg ff-font-semibold ff-mb-2",style:{color:"var(--ff-text-primary)"},children:"Processing Documents"}),e.jsx("p",{style:{color:"var(--ff-text-muted)"},className:"ff-text-center",children:"We're analyzing your documents. This may take a moment..."})]}),t==="review"&&e.jsxs("div",{className:"ff-space-y-6",children:[e.jsxs("div",{className:"ff-text-center ff-mb-6",children:[e.jsx("h3",{className:"ff-text-lg ff-font-semibold",style:{color:"var(--ff-text-primary)"},children:"Review Your Documents"}),e.jsx("p",{style:{color:"var(--ff-text-muted)"},children:"Please review the extracted information before completing verification"})]}),e.jsx("div",{className:"ff-grid ff-gap-4",children:c.map(i=>e.jsx("div",{className:"ff-rounded-xl ff-p-4",style:{backgroundColor:"var(--ff-bg-secondary)",border:"1px solid var(--ff-border-light)"},children:e.jsx(B,{documentType:i,showDetails:!0})},i))})]}),t==="complete"&&e.jsxs("div",{className:"ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12",children:[e.jsx("div",{className:"ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4",style:{backgroundColor:m?"var(--ff-success-light)":"var(--ff-warning-light)"},children:m?e.jsx(l.CheckCircle,{className:"ff-w-10 ff-h-10",style:{color:"var(--ff-success)"}}):e.jsx(le,{className:"ff-w-10 ff-h-10",style:{color:"var(--ff-warning)"}})}),e.jsx("h3",{className:"ff-text-xl ff-font-semibold ff-mb-2",style:{color:"var(--ff-text-primary)"},children:m?"Verification Complete!":"Review Required"}),e.jsx("p",{style:{color:"var(--ff-text-muted)"},className:"ff-text-center",children:m?"Your identity has been successfully verified.":"Additional review may be required. We will contact you if needed."})]})]}),t!=="complete"&&e.jsxs("div",{className:"ff-modal-footer",children:[e.jsx("button",{onClick:()=>{(t==="upload"||t==="review")&&j("select")},disabled:g,className:"ff-btn ff-btn-secondary",children:"Back"}),t==="review"&&e.jsx("button",{onClick:J,disabled:g||!F(),className:"ff-btn ff-btn-primary",children:g?e.jsxs(e.Fragment,{children:[e.jsx(l.Loader2,{className:"ff-w-4 ff-h-4 ff-animate-spin"}),"Verifying..."]}):"Complete Verification"}),t==="select"&&R()&&e.jsx("button",{onClick:()=>j("review"),className:"ff-btn ff-btn-primary",children:"Review & Verify"})]})]})};exports.DocumentStatus=B;exports.DocumentUploader=K;exports.KYCWizard=ie;exports.useKYCStore=I;
|
|
37
|
-
//# sourceMappingURL=KYCWizard-
|
|
36
|
+
*/const ce=l.createLucideIcon("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]]),Y=c=>({id:null,type:c,status:"uploaded",file:null,previewUrl:null,extractedData:null,confidence:0,fraudFlags:[],error:null}),_={sessionId:null,status:"idle",step:"select",requiredDocuments:[],currentDocumentType:null,documents:new Map,isVerified:!1,verificationStatus:null,isLoading:!1,error:null},I=l.create((c,o)=>({..._,setSessionId:r=>c({sessionId:r}),setRequiredDocuments:r=>{const s=new Map;for(const a of r)s.set(a,Y(a));c({requiredDocuments:r,documents:s,currentDocumentType:r[0]||null})},setCurrentDocumentType:r=>c({currentDocumentType:r}),setDocumentFile:(r,s)=>{const{documents:a}=o(),t=a.get(r)||Y(r),f=URL.createObjectURL(s),x=new Map(a);x.set(r,{...t,file:s,previewUrl:f,status:"uploaded",error:null}),c({documents:x})},setDocumentStatus:(r,s)=>{const{documents:a}=o(),t=a.get(r);if(t){const f=new Map(a);f.set(r,{...t,status:s}),c({documents:f})}},setDocumentData:(r,s)=>{const{documents:a}=o(),t=a.get(r);if(t){const f=new Map(a);f.set(r,{...t,...s}),c({documents:f})}},clearDocumentPreview:r=>{const{documents:s}=o(),a=s.get(r);a!=null&&a.previewUrl&&URL.revokeObjectURL(a.previewUrl)},setStep:r=>c({step:r}),nextDocument:()=>{const{requiredDocuments:r,currentDocumentType:s,documents:a}=o(),t=s?r.indexOf(s):-1;for(let f=t+1;f<r.length;f++){const x=r[f],m=a.get(x);if(!(m!=null&&m.file)){c({currentDocumentType:x});return}}c({currentDocumentType:null,step:"processing"})},setVerificationStatus:r=>c({verificationStatus:r}),setVerified:r=>c({isVerified:r}),setStatus:r=>c({status:r}),setLoading:r=>c({isLoading:r}),setError:r=>c({error:r}),getNextRequiredDocument:()=>{const{requiredDocuments:r,documents:s}=o();for(const a of r){const t=s.get(a);if(!(t!=null&&t.file))return a}return null},areAllDocumentsUploaded:()=>{const{requiredDocuments:r,documents:s}=o();return r.every(a=>{const t=s.get(a);return(t==null?void 0:t.file)!==null})},areAllDocumentsProcessed:()=>{const{requiredDocuments:r,documents:s}=o();return r.every(a=>{const t=s.get(a);return(t==null?void 0:t.status)==="completed"||(t==null?void 0:t.status)==="requires_review"})},reset:()=>{const{documents:r}=o();for(const s of r.values())s.previewUrl&&URL.revokeObjectURL(s.previewUrl);c(_)}})),K=({documentType:c,onFileSelect:o})=>{const{documents:r,setDocumentFile:s,isLoading:a}=I(),t=r.get(c),f=l.DOCUMENT_TYPES[c],x=k.useCallback((d,z)=>{if(!(z.length>0)&&d.length>0){const h=d[0];s(c,h),o==null||o(h)}},[c,o,s]),{getRootProps:m,getInputProps:u,isDragActive:g}=l.useDropzone({onDrop:x,accept:{"application/pdf":[".pdf"],"image/jpeg":[".jpg",".jpeg"],"image/png":[".png"]},maxSize:f.maxFileSize,multiple:!1,disabled:a}),C=d=>d<1024?`${d} B`:d<1024*1024?`${(d/1024).toFixed(1)} KB`:`${(d/(1024*1024)).toFixed(1)} MB`,L=()=>{var d;return((d=t==null?void 0:t.file)==null?void 0:d.type)==="application/pdf"?e.jsx(O,{className:"ff-w-6 ff-h-6"}):e.jsx(ae,{className:"ff-w-6 ff-h-6"})},P=d=>{d.stopPropagation(),I.getState().clearDocumentPreview(c),s(c,null)};return t!=null&&t.file&&t.previewUrl?e.jsxs("div",{className:"ff-space-y-4",children:[e.jsx("div",{className:"ff-p-4 ff-rounded-xl",style:{backgroundColor:"var(--ff-primary-20)",border:"1px solid var(--ff-primary-50)"},children:e.jsxs("div",{className:"ff-flex ff-items-center ff-gap-3",children:[e.jsx("div",{className:"ff-p-2 ff-rounded-lg",style:{backgroundColor:"var(--ff-primary-30)"},children:e.jsx("span",{style:{color:"var(--ff-primary-90)"},children:L()})}),e.jsxs("div",{className:"ff-flex-1 ff-min-w-0",children:[e.jsx("p",{className:"ff-font-medium ff-truncate",style:{color:"var(--ff-primary-110)"},children:t.file.name}),e.jsx("p",{className:"ff-text-sm",style:{color:"var(--ff-primary-90)"},children:C(t.file.size)})]}),e.jsx("button",{onClick:P,className:"ff-p-1.5 ff-rounded-full ff-transition-colors",style:{color:"var(--ff-primary-90)"},"aria-label":"Remove file",children:e.jsx(l.X,{className:"ff-w-5 ff-h-5"})})]})}),e.jsx("div",{className:"ff-document-preview ff-aspect-[3/4] ff-max-h-96",children:t.file.type==="application/pdf"?e.jsx("iframe",{src:t.previewUrl,className:"ff-w-full ff-h-full ff-rounded-xl",title:"Document preview"}):e.jsx("img",{src:t.previewUrl,alt:"Document preview",className:"ff-w-full ff-h-full ff-object-contain ff-rounded-xl"})})]}):e.jsxs("div",{className:"ff-space-y-6",children:[e.jsxs("div",{className:"ff-text-center ff-mb-4",children:[e.jsx("h3",{className:"ff-text-lg ff-font-semibold",style:{color:"var(--ff-text-primary)"},children:f.label}),e.jsx("p",{className:"ff-text-sm ff-mt-1",style:{color:"var(--ff-text-muted)"},children:f.description})]}),e.jsxs("div",{...m(),className:l.clsx("ff-dropzone",g&&"ff-dropzone-active",a&&"ff-opacity-50 ff-cursor-not-allowed"),children:[e.jsx("input",{...u()}),e.jsx("div",{className:"ff-dropzone-icon-wrapper",children:e.jsx(l.Upload,{className:"ff-dropzone-icon"})}),e.jsx("h3",{className:"ff-dropzone-text",children:g?"Drop your document here":"Upload your document"}),e.jsx("p",{className:"ff-dropzone-hint",children:"Drag and drop or click to select"}),e.jsx("label",{className:"ff-inline-block",children:e.jsx("span",{className:l.clsx("ff-btn ff-btn-primary",a&&"ff-opacity-50 ff-cursor-wait"),children:a?"Processing...":"Choose file"})}),e.jsxs("div",{className:"ff-flex ff-flex-wrap ff-justify-center ff-gap-2 ff-mt-3",children:[f.acceptedFormats.map(d=>e.jsx("span",{className:"ff-px-2 ff-py-1 ff-rounded ff-text-xs",style:{backgroundColor:"var(--ff-bg-tertiary)",color:"var(--ff-text-muted)"},children:d.toUpperCase()},d)),e.jsxs("span",{className:"ff-px-2 ff-py-1 ff-text-xs",style:{color:"var(--ff-text-muted)"},children:["Max ",C(f.maxFileSize)]})]})]}),(t==null?void 0:t.error)&&e.jsxs("div",{className:"ff-flex ff-items-center ff-gap-2 ff-p-4 ff-rounded-lg ff-text-sm",style:{backgroundColor:"var(--ff-error-light)",color:"var(--ff-error)"},children:[e.jsx(l.AlertCircle,{className:"ff-w-4 ff-h-4 ff-flex-shrink-0"}),e.jsx("p",{children:t.error})]}),e.jsxs("div",{className:"ff-rounded-xl ff-p-4",style:{backgroundColor:"var(--ff-bg-secondary)"},children:[e.jsx("h4",{className:"ff-text-sm ff-font-medium ff-mb-2",style:{color:"var(--ff-text-secondary)"},children:"Tips for best results:"}),e.jsxs("ul",{className:"ff-text-sm ff-space-y-1 ff-list-disc ff-list-inside",style:{color:"var(--ff-text-muted)"},children:[e.jsx("li",{children:"Ensure all text is clearly visible and readable"}),e.jsx("li",{children:"Avoid glare, shadows, or blurry images"}),e.jsx("li",{children:"Include all four corners of the document"}),e.jsx("li",{children:"Use good lighting when taking photos"})]})]})]})},B=({documentType:c,showDetails:o=!0})=>{const{documents:r}=I(),s=r.get(c),a=l.DOCUMENT_TYPES[c],f=(u=>{switch(u){case"completed":return{icon:l.CheckCircle,iconColor:"var(--ff-success)",bgColor:"var(--ff-success-light)",label:"Verified",labelColor:"var(--ff-success)",description:"Document successfully processed"};case"requires_review":return{icon:l.AlertTriangle,iconColor:"var(--ff-warning)",bgColor:"var(--ff-warning-light)",label:"Review Required",labelColor:"var(--ff-warning)",description:"Manual verification may be needed"};case"failed":return{icon:l.XCircle,iconColor:"var(--ff-error)",bgColor:"var(--ff-error-light)",label:"Failed",labelColor:"var(--ff-error)",description:"Unable to process document"};case"processing":return{icon:l.Loader2,iconColor:"var(--ff-primary-90)",bgColor:"var(--ff-primary-20)",label:"Processing",labelColor:"var(--ff-primary-90)",description:"Analyzing document..."};case"uploaded":return{icon:A,iconColor:"var(--ff-text-secondary)",bgColor:"var(--ff-bg-tertiary)",label:"Pending",labelColor:"var(--ff-text-secondary)",description:"Waiting to be processed"};default:return{icon:A,iconColor:"var(--ff-text-muted)",bgColor:"var(--ff-bg-tertiary)",label:"Not Uploaded",labelColor:"var(--ff-text-muted)",description:"Upload document to continue"}}})(s==null?void 0:s.status),x=f.icon,m=u=>u>=.8?"var(--ff-success)":u>=.6?"var(--ff-warning)":"var(--ff-error)";return e.jsxs("div",{className:"ff-space-y-3",children:[e.jsxs("div",{className:"ff-flex ff-items-center ff-gap-3",children:[e.jsx("div",{className:"ff-p-2 ff-rounded-xl",style:{backgroundColor:f.bgColor},children:e.jsx(x,{className:l.clsx("ff-w-5 ff-h-5",(s==null?void 0:s.status)==="processing"&&"ff-animate-spin"),style:{color:f.iconColor}})}),e.jsxs("div",{children:[e.jsx("p",{className:"ff-font-medium",style:{color:"var(--ff-text-primary)"},children:a.label}),e.jsx("p",{className:"ff-text-sm",style:{color:f.labelColor},children:f.label})]})]}),(s==null?void 0:s.confidence)!==void 0&&s.confidence>0&&e.jsxs("div",{className:"ff-space-y-1",children:[e.jsxs("div",{className:"ff-flex ff-items-center ff-justify-between ff-text-sm",children:[e.jsx("span",{style:{color:"var(--ff-text-secondary)"},children:"Confidence"}),e.jsxs("span",{className:"ff-font-medium",style:{color:m(s.confidence)},children:[Math.round(s.confidence*100),"%"]})]}),e.jsx("div",{className:"ff-progress",children:e.jsx("div",{className:"ff-progress-bar",style:{width:`${s.confidence*100}%`,backgroundColor:m(s.confidence)}})})]}),o&&(s==null?void 0:s.fraudFlags)&&s.fraudFlags.length>0&&e.jsxs("div",{className:"ff-space-y-2",children:[e.jsx("p",{className:"ff-text-sm ff-font-medium",style:{color:"var(--ff-text-secondary)"},children:"Issues Detected"}),e.jsx("div",{className:"ff-space-y-1",children:s.fraudFlags.map((u,g)=>e.jsxs("div",{className:"ff-flex ff-items-start ff-gap-2 ff-p-2 ff-rounded-lg ff-text-sm",style:{backgroundColor:u.severity==="high"?"var(--ff-error-light)":u.severity==="medium"?"var(--ff-warning-light)":"var(--ff-bg-tertiary)",color:u.severity==="high"?"var(--ff-error)":u.severity==="medium"?"var(--ff-warning)":"var(--ff-text-secondary)"},children:[u.severity==="high"?e.jsx(l.XCircle,{className:"ff-w-4 ff-h-4 ff-flex-shrink-0 ff-mt-0.5"}):e.jsx(l.AlertTriangle,{className:"ff-w-4 ff-h-4 ff-flex-shrink-0 ff-mt-0.5"}),e.jsx("span",{children:u.message})]},g))})]}),o&&(s==null?void 0:s.extractedData)&&s.status==="completed"&&e.jsxs("div",{className:"ff-rounded-xl ff-p-3",style:{backgroundColor:"var(--ff-bg-tertiary)"},children:[e.jsx("p",{className:"ff-text-sm ff-font-medium ff-mb-2",style:{color:"var(--ff-text-secondary)"},children:"Extracted Information"}),e.jsxs("dl",{className:"ff-space-y-1 ff-text-sm",children:["fullName"in s.extractedData&&e.jsxs("div",{className:"ff-flex ff-justify-between",children:[e.jsx("dt",{style:{color:"var(--ff-text-muted)"},children:"Name"}),e.jsx("dd",{className:"ff-font-medium",style:{color:"var(--ff-text-primary)"},children:s.extractedData.fullName})]}),"dateOfBirth"in s.extractedData&&e.jsxs("div",{className:"ff-flex ff-justify-between",children:[e.jsx("dt",{style:{color:"var(--ff-text-muted)"},children:"Date of Birth"}),e.jsx("dd",{style:{color:"var(--ff-text-primary)"},children:s.extractedData.dateOfBirth})]}),s.extractedData.documentType==="passport"&&"passportNumber"in s.extractedData&&e.jsxs("div",{className:"ff-flex ff-justify-between",children:[e.jsx("dt",{style:{color:"var(--ff-text-muted)"},children:"Passport #"}),e.jsx("dd",{className:"ff-font-mono",style:{color:"var(--ff-text-primary)"},children:s.extractedData.passportNumber})]}),s.extractedData.documentType==="drivers_license"&&"licenseNumber"in s.extractedData&&e.jsxs("div",{className:"ff-flex ff-justify-between",children:[e.jsx("dt",{style:{color:"var(--ff-text-muted)"},children:"License #"}),e.jsx("dd",{className:"ff-font-mono",style:{color:"var(--ff-text-primary)"},children:s.extractedData.licenseNumber})]}),"address"in s.extractedData&&s.extractedData.address&&e.jsxs("div",{className:"ff-flex ff-justify-between",children:[e.jsx("dt",{style:{color:"var(--ff-text-muted)"},children:"Address"}),e.jsxs("dd",{className:"ff-text-right",style:{color:"var(--ff-text-primary)"},children:[s.extractedData.address.city,","," ",s.extractedData.address.province]})]})]})]})]})},M=["select","upload","review","complete"],ne={passport:O,drivers_license:re,proof_of_address:fe},ie=({requiredDocuments:c,onComplete:o,onCancel:r,onError:s})=>{const{sessionId:a,step:t,currentDocumentType:f,documents:x,isVerified:m,verificationStatus:u,isLoading:g,error:C,setSessionId:L,setRequiredDocuments:P,setCurrentDocumentType:d,setDocumentStatus:z,setDocumentData:h,setStep:j,nextDocument:H,setVerificationStatus:E,setVerified:W,setLoading:b,setError:U,areAllDocumentsUploaded:R,areAllDocumentsProcessed:F,reset:X}=I(),[oe,N]=k.useState(null);k.useEffect(()=>(P(c),$(),()=>{N(null)}),[c]);const $=async()=>{try{b(!0);const n=await l.getClient().createKYCSession(c);L(n.sessionId),j("upload")}catch(i){const n=i;U(n.message),s==null||s(n)}finally{b(!1)}},Z=k.useCallback(async i=>{if(!(!a||!f))try{b(!0),U(null);const p=await l.getClient().uploadKYCDocument(a,f,i);h(f,{id:p.documentId,status:"processing"}),N(p.documentId),G(p.documentId)}catch(n){const p=n;h(f,{status:"failed",error:p.message}),s==null||s(p)}finally{b(!1)}},[a,f]),G=async i=>{let v=0,D=0;const T=async()=>{var q;if(v>=30){N(null),f&&h(f,{status:"failed",error:"Processing timed out. Please try again."});return}if(D>=3){N(null),f&&h(f,{status:"failed",error:"Failed to check document status. Please refresh and try again."});return}try{const y=(await l.getClient().getKYCDocument(i)).document;D=0;const te=y.type;if(h(te,{id:y.id,status:y.status,extractedData:y.extractedData,confidence:y.confidence,fraudFlags:y.fraudFlags,error:null}),y.status==="completed"||y.status==="requires_review"||y.status==="failed"){N(null),R()?F()&&j("review"):H();return}v++,setTimeout(T,2e3)}catch(V){const S=V;if(D++,v++,S.status===404||(q=S.message)!=null&&q.includes("not found")){N(null),f&&h(f,{status:"failed",error:"Session not found or invalid state"});return}D<3?setTimeout(T,3e3*D):(N(null),f&&h(f,{status:"failed",error:S.message||"Failed to process document"}))}};T()},J=async()=>{if(a)try{b(!0),U(null);const n=await l.getClient().verifyKYCSession(a,!0);E(n.verificationStatus);const p=n.verificationStatus;W(p.isVerified),j("complete"),o==null||o(n)}catch(i){const n=i;U(n.message),s==null||s(n)}finally{b(!1)}},Q=()=>{X(),r==null||r()},ee=i=>{d(i),j("upload")},se=i=>{const n=x.get(i);return(n==null?void 0:n.status)==="completed"||(n==null?void 0:n.status)==="requires_review"},w=()=>{const i=t==="processing"?"upload":t;return M.indexOf(i)};return e.jsx(l.StyleProvider,{children:e.jsxs("div",{className:"ff-container ff-modal",children:[e.jsxs("div",{className:"ff-modal-header",children:[e.jsxs("div",{className:"ff-modal-header-left",children:[e.jsxs("div",{className:"ff-flex ff-items-center ff-gap-3",children:[e.jsx("div",{className:"ff-modal-icon",children:e.jsx(ce,{})}),e.jsx("h2",{className:"ff-modal-title",children:"Identity Verification"})]}),e.jsx("div",{className:"ff-steps ff-ml-4",children:M.map((i,n)=>e.jsxs(k.Fragment,{children:[e.jsx("div",{className:l.clsx("ff-step",w()===n&&"ff-step-active",w()>n&&"ff-step-complete",w()<n&&"ff-step-pending"),children:w()>n?"✓":n+1}),n<M.length-1&&e.jsx("div",{className:l.clsx("ff-step-connector",w()>n&&"ff-step-connector-complete")})]},i))})]}),e.jsx("button",{onClick:Q,className:"ff-modal-close",children:e.jsx(l.X,{className:"ff-w-5 ff-h-5"})})]}),e.jsxs("div",{className:"ff-modal-body",children:[C&&e.jsx("div",{className:"ff-mb-4 ff-p-4 ff-rounded-lg ff-text-sm",style:{backgroundColor:"var(--ff-error-light)",color:"var(--ff-error)"},children:C}),t==="select"&&e.jsxs("div",{className:"ff-space-y-4",children:[e.jsx("p",{className:"ff-text-center ff-mb-6",style:{color:"var(--ff-text-muted)"},children:"Please upload the following documents to verify your identity"}),e.jsx("div",{className:"ff-grid ff-gap-3",children:c.map(i=>{const n=ne[i],p=l.DOCUMENT_TYPES[i];x.get(i);const v=se(i);return e.jsxs("button",{onClick:()=>ee(i),className:l.clsx("ff-flex ff-items-center ff-gap-4 ff-p-4 ff-rounded-xl ff-border-2 ff-text-left ff-transition-all ff-duration-150",v?"ff-border-transparent":"ff-border-transparent hover:ff-border-transparent"),style:{backgroundColor:v?"var(--ff-success-light)":"var(--ff-bg-secondary)",borderColor:v?"var(--ff-success)":"var(--ff-border-light)"},children:[e.jsx("div",{className:"ff-p-3 ff-rounded-xl",style:{backgroundColor:v?"rgba(41, 142, 51, 0.15)":"var(--ff-bg-tertiary)"},children:v?e.jsx(l.CheckCircle,{className:"ff-w-6 ff-h-6",style:{color:"var(--ff-success)"}}):e.jsx(n,{className:"ff-w-6 ff-h-6",style:{color:"var(--ff-text-secondary)"}})}),e.jsxs("div",{className:"ff-flex-1",children:[e.jsx("p",{className:"ff-font-medium",style:{color:"var(--ff-text-primary)"},children:p.label}),e.jsx("p",{className:"ff-text-sm",style:{color:"var(--ff-text-muted)"},children:p.description})]}),e.jsx(l.ChevronRight,{className:"ff-w-5 ff-h-5",style:{color:"var(--ff-text-muted)"}})]},i)})})]}),t==="upload"&&f&&e.jsx("div",{className:"ff-py-4",children:e.jsx("div",{className:"ff-max-w-lg ff-mx-auto",children:e.jsx(K,{documentType:f,onFileSelect:Z})})}),t==="processing"&&e.jsxs("div",{className:"ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12",children:[e.jsx(l.Loader2,{className:"ff-w-12 ff-h-12 ff-animate-spin ff-mb-4",style:{color:"var(--ff-primary-90)"}}),e.jsx("h3",{className:"ff-text-lg ff-font-semibold ff-mb-2",style:{color:"var(--ff-text-primary)"},children:"Processing Documents"}),e.jsx("p",{style:{color:"var(--ff-text-muted)"},className:"ff-text-center",children:"We're analyzing your documents. This may take a moment..."})]}),t==="review"&&e.jsxs("div",{className:"ff-space-y-6",children:[e.jsxs("div",{className:"ff-text-center ff-mb-6",children:[e.jsx("h3",{className:"ff-text-lg ff-font-semibold",style:{color:"var(--ff-text-primary)"},children:"Review Your Documents"}),e.jsx("p",{style:{color:"var(--ff-text-muted)"},children:"Please review the extracted information before completing verification"})]}),e.jsx("div",{className:"ff-grid ff-gap-4",children:c.map(i=>e.jsx("div",{className:"ff-rounded-xl ff-p-4",style:{backgroundColor:"var(--ff-bg-secondary)",border:"1px solid var(--ff-border-light)"},children:e.jsx(B,{documentType:i,showDetails:!0})},i))})]}),t==="complete"&&e.jsxs("div",{className:"ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12",children:[e.jsx("div",{className:"ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4",style:{backgroundColor:m?"var(--ff-success-light)":"var(--ff-warning-light)"},children:m?e.jsx(l.CheckCircle,{className:"ff-w-10 ff-h-10",style:{color:"var(--ff-success)"}}):e.jsx(le,{className:"ff-w-10 ff-h-10",style:{color:"var(--ff-warning)"}})}),e.jsx("h3",{className:"ff-text-xl ff-font-semibold ff-mb-2",style:{color:"var(--ff-text-primary)"},children:m?"Verification Complete!":"Review Required"}),e.jsx("p",{style:{color:"var(--ff-text-muted)"},className:"ff-text-center",children:m?"Your identity has been successfully verified.":"Additional review may be required. We will contact you if needed."})]})]}),t!=="complete"&&e.jsxs("div",{className:"ff-modal-footer",children:[e.jsx("button",{onClick:()=>{(t==="upload"||t==="review")&&j("select")},disabled:g,className:"ff-btn ff-btn-secondary",children:"Back"}),t==="review"&&e.jsx("button",{onClick:J,disabled:g||!F(),className:"ff-btn ff-btn-primary",children:g?e.jsxs(e.Fragment,{children:[e.jsx(l.Loader2,{className:"ff-w-4 ff-h-4 ff-animate-spin"}),"Verifying..."]}):"Complete Verification"}),t==="select"&&R()&&e.jsx("button",{onClick:()=>j("review"),className:"ff-btn ff-btn-primary",children:"Review & Verify"})]})]})})};exports.DocumentStatus=B;exports.DocumentUploader=K;exports.KYCWizard=ie;exports.useKYCStore=I;
|
|
37
|
+
//# sourceMappingURL=KYCWizard-C1PumBBm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KYCWizard-C1PumBBm.js","sources":["../../../node_modules/.pnpm/lucide-react@0.321.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/car.js","../../../node_modules/.pnpm/lucide-react@0.321.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/clock.js","../../../node_modules/.pnpm/lucide-react@0.321.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/file-text.js","../../../node_modules/.pnpm/lucide-react@0.321.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/home.js","../../../node_modules/.pnpm/lucide-react@0.321.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/image.js","../../../node_modules/.pnpm/lucide-react@0.321.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/shield-check.js","../../../node_modules/.pnpm/lucide-react@0.321.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/shield.js","../src/store/kyc-store.ts","../src/kyc/components/DocumentUploader.tsx","../src/kyc/components/DocumentStatus.tsx","../src/kyc/components/KYCWizard.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.321.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Car = createLucideIcon(\"Car\", [\n [\n \"path\",\n {\n d: \"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2\",\n key: \"5owen\"\n }\n ],\n [\"circle\", { cx: \"7\", cy: \"17\", r: \"2\", key: \"u2ysq9\" }],\n [\"path\", { d: \"M9 17h6\", key: \"r8uit2\" }],\n [\"circle\", { cx: \"17\", cy: \"17\", r: \"2\", key: \"axvx0g\" }]\n]);\n\nexport { Car as default };\n//# sourceMappingURL=car.js.map\n","/**\n * @license lucide-react v0.321.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Clock = createLucideIcon(\"Clock\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"polyline\", { points: \"12 6 12 12 16 14\", key: \"68esgv\" }]\n]);\n\nexport { Clock as default };\n//# sourceMappingURL=clock.js.map\n","/**\n * @license lucide-react v0.321.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst FileText = createLucideIcon(\"FileText\", [\n [\"path\", { d: \"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\", key: \"1rqfz7\" }],\n [\"path\", { d: \"M14 2v4a2 2 0 0 0 2 2h4\", key: \"tnqrlb\" }],\n [\"path\", { d: \"M10 9H8\", key: \"b1mrlr\" }],\n [\"path\", { d: \"M16 13H8\", key: \"t4e002\" }],\n [\"path\", { d: \"M16 17H8\", key: \"z1uh3a\" }]\n]);\n\nexport { FileText as default };\n//# sourceMappingURL=file-text.js.map\n","/**\n * @license lucide-react v0.321.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Home = createLucideIcon(\"Home\", [\n [\"path\", { d: \"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\", key: \"y5dka4\" }],\n [\"polyline\", { points: \"9 22 9 12 15 12 15 22\", key: \"e2us08\" }]\n]);\n\nexport { Home as default };\n//# sourceMappingURL=home.js.map\n","/**\n * @license lucide-react v0.321.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Image = createLucideIcon(\"Image\", [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", ry: \"2\", key: \"1m3agn\" }],\n [\"circle\", { cx: \"9\", cy: \"9\", r: \"2\", key: \"af1f0g\" }],\n [\"path\", { d: \"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\", key: \"1xmnt7\" }]\n]);\n\nexport { Image as default };\n//# sourceMappingURL=image.js.map\n","/**\n * @license lucide-react v0.321.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ShieldCheck = createLucideIcon(\"ShieldCheck\", [\n [\"path\", { d: \"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10\", key: \"1irkt0\" }],\n [\"path\", { d: \"m9 12 2 2 4-4\", key: \"dzmm74\" }]\n]);\n\nexport { ShieldCheck as default };\n//# sourceMappingURL=shield-check.js.map\n","/**\n * @license lucide-react v0.321.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Shield = createLucideIcon(\"Shield\", [\n [\"path\", { d: \"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10\", key: \"1irkt0\" }]\n]);\n\nexport { Shield as default };\n//# sourceMappingURL=shield.js.map\n","import { create } from 'zustand';\nimport type { \n DocumentType, \n KYCDocument, \n DocumentStatus,\n FraudFlag,\n ExtractedData,\n} from '@fileflow/shared';\n\nexport type KYCStep = 'select' | 'upload' | 'processing' | 'review' | 'complete';\n\nexport interface DocumentState {\n id: string | null;\n type: DocumentType;\n status: DocumentStatus;\n file: File | null;\n previewUrl: string | null;\n extractedData: ExtractedData | null;\n confidence: number;\n fraudFlags: FraudFlag[];\n error: string | null;\n}\n\nexport interface KYCState {\n // Session\n sessionId: string | null;\n status: string;\n step: KYCStep;\n \n // Required documents\n requiredDocuments: DocumentType[];\n currentDocumentType: DocumentType | null;\n \n // Document states\n documents: Map<DocumentType, DocumentState>;\n \n // Verification\n isVerified: boolean;\n verificationStatus: object | null;\n \n // UI state\n isLoading: boolean;\n error: string | null;\n}\n\nexport interface KYCActions {\n // Initialize\n setSessionId: (sessionId: string) => void;\n setRequiredDocuments: (documents: DocumentType[]) => void;\n \n // Document management\n setCurrentDocumentType: (type: DocumentType) => void;\n setDocumentFile: (type: DocumentType, file: File) => void;\n setDocumentStatus: (type: DocumentType, status: DocumentStatus) => void;\n setDocumentData: (type: DocumentType, data: Partial<DocumentState>) => void;\n clearDocumentPreview: (type: DocumentType) => void;\n \n // Navigation\n setStep: (step: KYCStep) => void;\n nextDocument: () => void;\n \n // Verification\n setVerificationStatus: (status: object) => void;\n setVerified: (verified: boolean) => void;\n \n // Status\n setStatus: (status: string) => void;\n setLoading: (loading: boolean) => void;\n setError: (error: string | null) => void;\n \n // Helpers\n getNextRequiredDocument: () => DocumentType | null;\n areAllDocumentsUploaded: () => boolean;\n areAllDocumentsProcessed: () => boolean;\n \n // Reset\n reset: () => void;\n}\n\nconst createEmptyDocumentState = (type: DocumentType): DocumentState => ({\n id: null,\n type,\n status: 'uploaded',\n file: null,\n previewUrl: null,\n extractedData: null,\n confidence: 0,\n fraudFlags: [],\n error: null,\n});\n\nconst initialState: KYCState = {\n sessionId: null,\n status: 'idle',\n step: 'select',\n requiredDocuments: [],\n currentDocumentType: null,\n documents: new Map(),\n isVerified: false,\n verificationStatus: null,\n isLoading: false,\n error: null,\n};\n\nexport const useKYCStore = create<KYCState & KYCActions>((set, get) => ({\n ...initialState,\n\n setSessionId: (sessionId) => set({ sessionId }),\n\n setRequiredDocuments: (documents) => {\n const docsMap = new Map<DocumentType, DocumentState>();\n for (const type of documents) {\n docsMap.set(type, createEmptyDocumentState(type));\n }\n set({ \n requiredDocuments: documents, \n documents: docsMap,\n currentDocumentType: documents[0] || null,\n });\n },\n\n setCurrentDocumentType: (type) => set({ currentDocumentType: type }),\n\n setDocumentFile: (type, file) => {\n const { documents } = get();\n const doc = documents.get(type) || createEmptyDocumentState(type);\n \n // Create preview URL\n const previewUrl = URL.createObjectURL(file);\n \n const updated = new Map(documents);\n updated.set(type, {\n ...doc,\n file,\n previewUrl,\n status: 'uploaded',\n error: null,\n });\n \n set({ documents: updated });\n },\n\n setDocumentStatus: (type, status) => {\n const { documents } = get();\n const doc = documents.get(type);\n if (doc) {\n const updated = new Map(documents);\n updated.set(type, { ...doc, status });\n set({ documents: updated });\n }\n },\n\n setDocumentData: (type, data) => {\n const { documents } = get();\n const doc = documents.get(type);\n if (doc) {\n const updated = new Map(documents);\n updated.set(type, { ...doc, ...data });\n set({ documents: updated });\n }\n },\n\n clearDocumentPreview: (type) => {\n const { documents } = get();\n const doc = documents.get(type);\n if (doc?.previewUrl) {\n URL.revokeObjectURL(doc.previewUrl);\n }\n },\n\n setStep: (step) => set({ step }),\n\n nextDocument: () => {\n const { requiredDocuments, currentDocumentType, documents } = get();\n const currentIndex = currentDocumentType \n ? requiredDocuments.indexOf(currentDocumentType) \n : -1;\n \n // Find next document that needs upload\n for (let i = currentIndex + 1; i < requiredDocuments.length; i++) {\n const type = requiredDocuments[i];\n const doc = documents.get(type);\n if (!doc?.file) {\n set({ currentDocumentType: type });\n return;\n }\n }\n \n // All documents uploaded, move to processing/review\n set({ \n currentDocumentType: null,\n step: 'processing',\n });\n },\n\n setVerificationStatus: (status) => set({ verificationStatus: status }),\n \n setVerified: (verified) => set({ isVerified: verified }),\n\n setStatus: (status) => set({ status }),\n \n setLoading: (isLoading) => set({ isLoading }),\n \n setError: (error) => set({ error }),\n\n getNextRequiredDocument: () => {\n const { requiredDocuments, documents } = get();\n for (const type of requiredDocuments) {\n const doc = documents.get(type);\n if (!doc?.file) {\n return type;\n }\n }\n return null;\n },\n\n areAllDocumentsUploaded: () => {\n const { requiredDocuments, documents } = get();\n return requiredDocuments.every((type) => {\n const doc = documents.get(type);\n return doc?.file !== null;\n });\n },\n\n areAllDocumentsProcessed: () => {\n const { requiredDocuments, documents } = get();\n return requiredDocuments.every((type) => {\n const doc = documents.get(type);\n return doc?.status === 'completed' || doc?.status === 'requires_review';\n });\n },\n\n reset: () => {\n // Clean up preview URLs\n const { documents } = get();\n for (const doc of documents.values()) {\n if (doc.previewUrl) {\n URL.revokeObjectURL(doc.previewUrl);\n }\n }\n set(initialState);\n },\n}));\n","import React, { useCallback } from 'react';\nimport { useDropzone } from 'react-dropzone';\nimport { Upload, FileText, Image, AlertCircle, X } from 'lucide-react';\nimport { clsx } from 'clsx';\nimport { useKYCStore } from '../../store/kyc-store';\nimport type { DocumentType } from '@fileflow/shared';\nimport { DOCUMENT_TYPES } from '@fileflow/shared';\n\ninterface DocumentUploaderProps {\n documentType: DocumentType;\n onFileSelect?: (file: File) => void;\n}\n\nexport const DocumentUploader: React.FC<DocumentUploaderProps> = ({\n documentType,\n onFileSelect,\n}) => {\n const { documents, setDocumentFile, isLoading } = useKYCStore();\n const documentState = documents.get(documentType);\n const documentInfo = DOCUMENT_TYPES[documentType];\n\n const onDrop = useCallback(\n (acceptedFiles: File[], rejectedFiles: unknown[]) => {\n if (rejectedFiles.length > 0) {\n return;\n }\n\n if (acceptedFiles.length > 0) {\n const file = acceptedFiles[0];\n setDocumentFile(documentType, file);\n onFileSelect?.(file);\n }\n },\n [documentType, onFileSelect, setDocumentFile]\n );\n\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\n onDrop,\n accept: {\n 'application/pdf': ['.pdf'],\n 'image/jpeg': ['.jpg', '.jpeg'],\n 'image/png': ['.png'],\n },\n maxSize: documentInfo.maxFileSize,\n multiple: false,\n disabled: isLoading,\n });\n\n const formatFileSize = (bytes: number): string => {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n };\n\n const getFileIcon = () => {\n if (documentState?.file?.type === 'application/pdf') {\n return <FileText className=\"ff-w-6 ff-h-6\" />;\n }\n return <Image className=\"ff-w-6 ff-h-6\" />;\n };\n\n const clearFile = (e: React.MouseEvent) => {\n e.stopPropagation();\n useKYCStore.getState().clearDocumentPreview(documentType);\n setDocumentFile(documentType, null as unknown as File);\n };\n\n // Show preview if file is selected\n if (documentState?.file && documentState.previewUrl) {\n return (\n <div className=\"ff-space-y-4\">\n {/* Document Info */}\n <div className=\"ff-p-4 ff-rounded-xl\" style={{ backgroundColor: 'var(--ff-primary-20)', border: '1px solid var(--ff-primary-50)' }}>\n <div className=\"ff-flex ff-items-center ff-gap-3\">\n <div className=\"ff-p-2 ff-rounded-lg\" style={{ backgroundColor: 'var(--ff-primary-30)' }}>\n <span style={{ color: 'var(--ff-primary-90)' }}>{getFileIcon()}</span>\n </div>\n <div className=\"ff-flex-1 ff-min-w-0\">\n <p className=\"ff-font-medium ff-truncate\" style={{ color: 'var(--ff-primary-110)' }}>\n {documentState.file.name}\n </p>\n <p className=\"ff-text-sm\" style={{ color: 'var(--ff-primary-90)' }}>\n {formatFileSize(documentState.file.size)}\n </p>\n </div>\n <button\n onClick={clearFile}\n className=\"ff-p-1.5 ff-rounded-full ff-transition-colors\"\n style={{ color: 'var(--ff-primary-90)' }}\n aria-label=\"Remove file\"\n >\n <X className=\"ff-w-5 ff-h-5\" />\n </button>\n </div>\n </div>\n\n {/* Preview */}\n <div className=\"ff-document-preview ff-aspect-[3/4] ff-max-h-96\">\n {documentState.file.type === 'application/pdf' ? (\n <iframe\n src={documentState.previewUrl}\n className=\"ff-w-full ff-h-full ff-rounded-xl\"\n title=\"Document preview\"\n />\n ) : (\n <img\n src={documentState.previewUrl}\n alt=\"Document preview\"\n className=\"ff-w-full ff-h-full ff-object-contain ff-rounded-xl\"\n />\n )}\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"ff-space-y-6\">\n {/* Document Type Info */}\n <div className=\"ff-text-center ff-mb-4\">\n <h3 className=\"ff-text-lg ff-font-semibold\" style={{ color: 'var(--ff-text-primary)' }}>{documentInfo.label}</h3>\n <p className=\"ff-text-sm ff-mt-1\" style={{ color: 'var(--ff-text-muted)' }}>{documentInfo.description}</p>\n </div>\n\n {/* Dropzone - Demo style */}\n <div\n {...getRootProps()}\n className={clsx(\n 'ff-dropzone',\n isDragActive && 'ff-dropzone-active',\n isLoading && 'ff-opacity-50 ff-cursor-not-allowed'\n )}\n >\n <input {...getInputProps()} />\n <div className=\"ff-dropzone-icon-wrapper\">\n <Upload className=\"ff-dropzone-icon\" />\n </div>\n <h3 className=\"ff-dropzone-text\">\n {isDragActive ? 'Drop your document here' : 'Upload your document'}\n </h3>\n <p className=\"ff-dropzone-hint\">Drag and drop or click to select</p>\n <label className=\"ff-inline-block\">\n <span className={clsx(\n 'ff-btn ff-btn-primary',\n isLoading && 'ff-opacity-50 ff-cursor-wait'\n )}>\n {isLoading ? 'Processing...' : 'Choose file'}\n </span>\n </label>\n <div className=\"ff-flex ff-flex-wrap ff-justify-center ff-gap-2 ff-mt-3\">\n {documentInfo.acceptedFormats.map((format) => (\n <span \n key={format} \n className=\"ff-px-2 ff-py-1 ff-rounded ff-text-xs\"\n style={{ backgroundColor: 'var(--ff-bg-tertiary)', color: 'var(--ff-text-muted)' }}\n >\n {format.toUpperCase()}\n </span>\n ))}\n <span className=\"ff-px-2 ff-py-1 ff-text-xs\" style={{ color: 'var(--ff-text-muted)' }}>\n Max {formatFileSize(documentInfo.maxFileSize)}\n </span>\n </div>\n </div>\n\n {/* Error */}\n {documentState?.error && (\n <div className=\"ff-flex ff-items-center ff-gap-2 ff-p-4 ff-rounded-lg ff-text-sm\" style={{ backgroundColor: 'var(--ff-error-light)', color: 'var(--ff-error)' }}>\n <AlertCircle className=\"ff-w-4 ff-h-4 ff-flex-shrink-0\" />\n <p>{documentState.error}</p>\n </div>\n )}\n\n {/* Tips */}\n <div className=\"ff-rounded-xl ff-p-4\" style={{ backgroundColor: 'var(--ff-bg-secondary)' }}>\n <h4 className=\"ff-text-sm ff-font-medium ff-mb-2\" style={{ color: 'var(--ff-text-secondary)' }}>Tips for best results:</h4>\n <ul className=\"ff-text-sm ff-space-y-1 ff-list-disc ff-list-inside\" style={{ color: 'var(--ff-text-muted)' }}>\n <li>Ensure all text is clearly visible and readable</li>\n <li>Avoid glare, shadows, or blurry images</li>\n <li>Include all four corners of the document</li>\n <li>Use good lighting when taking photos</li>\n </ul>\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport { CheckCircle, XCircle, AlertTriangle, Loader2, Clock } from 'lucide-react';\nimport { clsx } from 'clsx';\nimport { useKYCStore } from '../../store/kyc-store';\nimport type { DocumentType, DocumentStatus as DocStatus } from '@fileflow/shared';\nimport { DOCUMENT_TYPES } from '@fileflow/shared';\n\ninterface DocumentStatusProps {\n documentType: DocumentType;\n showDetails?: boolean;\n}\n\nexport const DocumentStatus: React.FC<DocumentStatusProps> = ({\n documentType,\n showDetails = true,\n}) => {\n const { documents } = useKYCStore();\n const documentState = documents.get(documentType);\n const documentInfo = DOCUMENT_TYPES[documentType];\n\n const getStatusConfig = (status?: DocStatus) => {\n switch (status) {\n case 'completed':\n return {\n icon: CheckCircle,\n iconColor: 'var(--ff-success)',\n bgColor: 'var(--ff-success-light)',\n label: 'Verified',\n labelColor: 'var(--ff-success)',\n description: 'Document successfully processed',\n };\n case 'requires_review':\n return {\n icon: AlertTriangle,\n iconColor: 'var(--ff-warning)',\n bgColor: 'var(--ff-warning-light)',\n label: 'Review Required',\n labelColor: 'var(--ff-warning)',\n description: 'Manual verification may be needed',\n };\n case 'failed':\n return {\n icon: XCircle,\n iconColor: 'var(--ff-error)',\n bgColor: 'var(--ff-error-light)',\n label: 'Failed',\n labelColor: 'var(--ff-error)',\n description: 'Unable to process document',\n };\n case 'processing':\n return {\n icon: Loader2,\n iconColor: 'var(--ff-primary-90)',\n bgColor: 'var(--ff-primary-20)',\n label: 'Processing',\n labelColor: 'var(--ff-primary-90)',\n description: 'Analyzing document...',\n };\n case 'uploaded':\n return {\n icon: Clock,\n iconColor: 'var(--ff-text-secondary)',\n bgColor: 'var(--ff-bg-tertiary)',\n label: 'Pending',\n labelColor: 'var(--ff-text-secondary)',\n description: 'Waiting to be processed',\n };\n default:\n return {\n icon: Clock,\n iconColor: 'var(--ff-text-muted)',\n bgColor: 'var(--ff-bg-tertiary)',\n label: 'Not Uploaded',\n labelColor: 'var(--ff-text-muted)',\n description: 'Upload document to continue',\n };\n }\n };\n\n const statusConfig = getStatusConfig(documentState?.status);\n const Icon = statusConfig.icon;\n\n const getConfidenceColor = (confidence: number) => {\n if (confidence >= 0.8) return 'var(--ff-success)';\n if (confidence >= 0.6) return 'var(--ff-warning)';\n return 'var(--ff-error)';\n };\n\n return (\n <div className=\"ff-space-y-3\">\n {/* Status Header */}\n <div className=\"ff-flex ff-items-center ff-gap-3\">\n <div className=\"ff-p-2 ff-rounded-xl\" style={{ backgroundColor: statusConfig.bgColor }}>\n <Icon\n className={clsx(\n 'ff-w-5 ff-h-5',\n documentState?.status === 'processing' && 'ff-animate-spin'\n )}\n style={{ color: statusConfig.iconColor }}\n />\n </div>\n <div>\n <p className=\"ff-font-medium\" style={{ color: 'var(--ff-text-primary)' }}>{documentInfo.label}</p>\n <p className=\"ff-text-sm\" style={{ color: statusConfig.labelColor }}>{statusConfig.label}</p>\n </div>\n </div>\n\n {/* Confidence Score */}\n {documentState?.confidence !== undefined && documentState.confidence > 0 && (\n <div className=\"ff-space-y-1\">\n <div className=\"ff-flex ff-items-center ff-justify-between ff-text-sm\">\n <span style={{ color: 'var(--ff-text-secondary)' }}>Confidence</span>\n <span className=\"ff-font-medium\" style={{ color: getConfidenceColor(documentState.confidence) }}>\n {Math.round(documentState.confidence * 100)}%\n </span>\n </div>\n <div className=\"ff-progress\">\n <div\n className=\"ff-progress-bar\"\n style={{ \n width: `${documentState.confidence * 100}%`,\n backgroundColor: getConfidenceColor(documentState.confidence)\n }}\n />\n </div>\n </div>\n )}\n\n {/* Fraud Flags */}\n {showDetails && documentState?.fraudFlags && documentState.fraudFlags.length > 0 && (\n <div className=\"ff-space-y-2\">\n <p className=\"ff-text-sm ff-font-medium\" style={{ color: 'var(--ff-text-secondary)' }}>Issues Detected</p>\n <div className=\"ff-space-y-1\">\n {documentState.fraudFlags.map((flag, index) => (\n <div\n key={index}\n className=\"ff-flex ff-items-start ff-gap-2 ff-p-2 ff-rounded-lg ff-text-sm\"\n style={{\n backgroundColor: flag.severity === 'high' ? 'var(--ff-error-light)' : flag.severity === 'medium' ? 'var(--ff-warning-light)' : 'var(--ff-bg-tertiary)',\n color: flag.severity === 'high' ? 'var(--ff-error)' : flag.severity === 'medium' ? 'var(--ff-warning)' : 'var(--ff-text-secondary)',\n }}\n >\n {flag.severity === 'high' ? (\n <XCircle className=\"ff-w-4 ff-h-4 ff-flex-shrink-0 ff-mt-0.5\" />\n ) : (\n <AlertTriangle className=\"ff-w-4 ff-h-4 ff-flex-shrink-0 ff-mt-0.5\" />\n )}\n <span>{flag.message}</span>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Extracted Data Preview */}\n {showDetails &&\n documentState?.extractedData &&\n documentState.status === 'completed' && (\n <div className=\"ff-rounded-xl ff-p-3\" style={{ backgroundColor: 'var(--ff-bg-tertiary)' }}>\n <p className=\"ff-text-sm ff-font-medium ff-mb-2\" style={{ color: 'var(--ff-text-secondary)' }}>\n Extracted Information\n </p>\n <dl className=\"ff-space-y-1 ff-text-sm\">\n {'fullName' in documentState.extractedData && (\n <div className=\"ff-flex ff-justify-between\">\n <dt style={{ color: 'var(--ff-text-muted)' }}>Name</dt>\n <dd className=\"ff-font-medium\" style={{ color: 'var(--ff-text-primary)' }}>\n {documentState.extractedData.fullName}\n </dd>\n </div>\n )}\n {'dateOfBirth' in documentState.extractedData && (\n <div className=\"ff-flex ff-justify-between\">\n <dt style={{ color: 'var(--ff-text-muted)' }}>Date of Birth</dt>\n <dd style={{ color: 'var(--ff-text-primary)' }}>{documentState.extractedData.dateOfBirth}</dd>\n </div>\n )}\n {documentState.extractedData.documentType === 'passport' &&\n 'passportNumber' in documentState.extractedData && (\n <div className=\"ff-flex ff-justify-between\">\n <dt style={{ color: 'var(--ff-text-muted)' }}>Passport #</dt>\n <dd className=\"ff-font-mono\" style={{ color: 'var(--ff-text-primary)' }}>\n {documentState.extractedData.passportNumber}\n </dd>\n </div>\n )}\n {documentState.extractedData.documentType === 'drivers_license' &&\n 'licenseNumber' in documentState.extractedData && (\n <div className=\"ff-flex ff-justify-between\">\n <dt style={{ color: 'var(--ff-text-muted)' }}>License #</dt>\n <dd className=\"ff-font-mono\" style={{ color: 'var(--ff-text-primary)' }}>\n {documentState.extractedData.licenseNumber}\n </dd>\n </div>\n )}\n {'address' in documentState.extractedData && documentState.extractedData.address && (\n <div className=\"ff-flex ff-justify-between\">\n <dt style={{ color: 'var(--ff-text-muted)' }}>Address</dt>\n <dd className=\"ff-text-right\" style={{ color: 'var(--ff-text-primary)' }}>\n {documentState.extractedData.address.city},{' '}\n {documentState.extractedData.address.province}\n </dd>\n </div>\n )}\n </dl>\n </div>\n )}\n </div>\n );\n};\n","import React, { useCallback, useEffect, useState } from 'react';\nimport {\n FileText,\n Car,\n Home,\n CheckCircle,\n X,\n Loader2,\n ChevronRight,\n ShieldCheck,\n Shield,\n} from 'lucide-react';\nimport { clsx } from 'clsx';\nimport { useKYCStore, type KYCStep } from '../../store/kyc-store';\nimport { getClient } from '../../api/client';\nimport { DocumentUploader } from './DocumentUploader';\nimport { DocumentStatus } from './DocumentStatus';\nimport { StyleProvider } from '../../styles/StyleProvider';\nimport type { DocumentType, KYCSession, KYCDocument } from '@fileflow/shared';\nimport { DOCUMENT_TYPES } from '@fileflow/shared';\n\n// KYC steps for the step indicator\nconst KYC_STEP_LABELS = ['select', 'upload', 'review', 'complete'] as const;\n\ninterface KYCWizardProps {\n requiredDocuments: DocumentType[];\n onComplete?: (session: KYCSession) => void;\n onCancel?: () => void;\n onError?: (error: Error) => void;\n}\n\nconst DOCUMENT_ICONS: Record<DocumentType, React.ElementType> = {\n passport: FileText,\n drivers_license: Car,\n proof_of_address: Home,\n};\n\nexport const KYCWizard: React.FC<KYCWizardProps> = ({\n requiredDocuments,\n onComplete,\n onCancel,\n onError,\n}) => {\n const {\n sessionId,\n step,\n currentDocumentType,\n documents,\n isVerified,\n verificationStatus,\n isLoading,\n error,\n setSessionId,\n setRequiredDocuments,\n setCurrentDocumentType,\n setDocumentStatus,\n setDocumentData,\n setStep,\n nextDocument,\n setVerificationStatus,\n setVerified,\n setLoading,\n setError,\n areAllDocumentsUploaded,\n areAllDocumentsProcessed,\n reset,\n } = useKYCStore();\n\n const [pollingDocument, setPollingDocument] = useState<string | null>(null);\n\n // Initialize\n useEffect(() => {\n setRequiredDocuments(requiredDocuments);\n initializeSession();\n\n return () => {\n // Cleanup polling on unmount\n setPollingDocument(null);\n };\n }, [requiredDocuments]);\n\n const initializeSession = async () => {\n try {\n setLoading(true);\n const client = getClient();\n const result = await client.createKYCSession(requiredDocuments);\n setSessionId(result.sessionId);\n setStep('upload');\n } catch (err) {\n const error = err as Error;\n setError(error.message);\n onError?.(error);\n } finally {\n setLoading(false);\n }\n };\n\n const handleFileSelect = useCallback(\n async (file: File) => {\n if (!sessionId || !currentDocumentType) return;\n\n try {\n setLoading(true);\n setError(null);\n\n const client = getClient();\n const result = await client.uploadKYCDocument(sessionId, currentDocumentType, file);\n\n setDocumentData(currentDocumentType, {\n id: result.documentId,\n status: 'processing',\n });\n\n // Start polling for document status\n setPollingDocument(result.documentId);\n pollDocumentStatus(result.documentId);\n } catch (err) {\n const error = err as Error;\n setDocumentData(currentDocumentType, {\n status: 'failed',\n error: error.message,\n });\n onError?.(error);\n } finally {\n setLoading(false);\n }\n },\n [sessionId, currentDocumentType]\n );\n\n const pollDocumentStatus = async (documentId: string) => {\n const maxAttempts = 30;\n const maxConsecutiveErrors = 3; // Stop after 3 consecutive errors\n let attempts = 0;\n let consecutiveErrors = 0;\n\n const poll = async () => {\n if (attempts >= maxAttempts) {\n setPollingDocument(null);\n if (currentDocumentType) {\n setDocumentData(currentDocumentType, {\n status: 'failed',\n error: 'Processing timed out. Please try again.',\n });\n }\n return;\n }\n\n // Stop polling if we've had too many consecutive errors\n if (consecutiveErrors >= maxConsecutiveErrors) {\n setPollingDocument(null);\n if (currentDocumentType) {\n setDocumentData(currentDocumentType, {\n status: 'failed',\n error: 'Failed to check document status. Please refresh and try again.',\n });\n }\n return;\n }\n\n try {\n const client = getClient();\n const result = await client.getKYCDocument(documentId);\n const doc = result.document as KYCDocument;\n\n // Reset consecutive errors on success\n consecutiveErrors = 0;\n\n const docType = doc.type as DocumentType;\n setDocumentData(docType, {\n id: doc.id,\n status: doc.status,\n extractedData: doc.extractedData,\n confidence: doc.confidence,\n fraudFlags: doc.fraudFlags,\n error: null, // Clear any previous errors\n });\n\n if (doc.status === 'completed' || doc.status === 'requires_review' || doc.status === 'failed') {\n setPollingDocument(null);\n\n // Check if all documents are processed\n if (areAllDocumentsUploaded()) {\n const allProcessed = areAllDocumentsProcessed();\n if (allProcessed) {\n setStep('review');\n }\n } else {\n // Move to next document\n nextDocument();\n }\n return;\n }\n\n // Continue polling\n attempts++;\n setTimeout(poll, 2000);\n } catch (err) {\n const error = err as Error & { status?: number };\n consecutiveErrors++;\n attempts++;\n \n // On 404, stop immediately - the document doesn't exist\n if (error.status === 404 || error.message?.includes('not found')) {\n setPollingDocument(null);\n if (currentDocumentType) {\n setDocumentData(currentDocumentType, {\n status: 'failed',\n error: 'Session not found or invalid state',\n });\n }\n return;\n }\n\n // On other errors, retry with backoff (up to maxConsecutiveErrors times)\n if (consecutiveErrors < maxConsecutiveErrors) {\n setTimeout(poll, 3000 * consecutiveErrors); // Exponential backoff\n } else {\n setPollingDocument(null);\n if (currentDocumentType) {\n setDocumentData(currentDocumentType, {\n status: 'failed',\n error: error.message || 'Failed to process document',\n });\n }\n }\n }\n };\n\n poll();\n };\n\n const handleVerify = async () => {\n if (!sessionId) return;\n\n try {\n setLoading(true);\n setError(null);\n\n const client = getClient();\n const result = await client.verifyKYCSession(sessionId, true);\n\n setVerificationStatus(result.verificationStatus);\n const status = result.verificationStatus as { isVerified: boolean };\n setVerified(status.isVerified);\n setStep('complete');\n\n onComplete?.(result as unknown as KYCSession);\n } catch (err) {\n const error = err as Error;\n setError(error.message);\n onError?.(error);\n } finally {\n setLoading(false);\n }\n };\n\n const handleCancel = () => {\n reset();\n onCancel?.();\n };\n\n const selectDocument = (type: DocumentType) => {\n setCurrentDocumentType(type);\n setStep('upload');\n };\n\n const isDocumentComplete = (type: DocumentType) => {\n const doc = documents.get(type);\n return doc?.status === 'completed' || doc?.status === 'requires_review';\n };\n\n // Get step index for the step indicator\n const getDisplayStepIndex = () => {\n const currentStep = step === 'processing' ? 'upload' : step;\n return KYC_STEP_LABELS.indexOf(currentStep as typeof KYC_STEP_LABELS[number]);\n };\n\n return (\n <StyleProvider>\n <div className=\"ff-container ff-modal\">\n {/* Modal Header - Demo style */}\n <div className=\"ff-modal-header\">\n <div className=\"ff-modal-header-left\">\n <div className=\"ff-flex ff-items-center ff-gap-3\">\n <div className=\"ff-modal-icon\">\n <Shield />\n </div>\n <h2 className=\"ff-modal-title\">Identity Verification</h2>\n </div>\n {/* Step Indicator - Demo style */}\n <div className=\"ff-steps ff-ml-4\">\n {KYC_STEP_LABELS.map((s, i) => (\n <React.Fragment key={s}>\n <div\n className={clsx(\n 'ff-step',\n getDisplayStepIndex() === i && 'ff-step-active',\n getDisplayStepIndex() > i && 'ff-step-complete',\n getDisplayStepIndex() < i && 'ff-step-pending'\n )}\n >\n {getDisplayStepIndex() > i ? '✓' : i + 1}\n </div>\n {i < KYC_STEP_LABELS.length - 1 && (\n <div className={clsx(\n 'ff-step-connector',\n getDisplayStepIndex() > i && 'ff-step-connector-complete'\n )} />\n )}\n </React.Fragment>\n ))}\n </div>\n </div>\n <button\n onClick={handleCancel}\n className=\"ff-modal-close\"\n >\n <X className=\"ff-w-5 ff-h-5\" />\n </button>\n </div>\n\n {/* Modal Body */}\n <div className=\"ff-modal-body\">\n {error && (\n <div className=\"ff-mb-4 ff-p-4 ff-rounded-lg ff-text-sm\" style={{ backgroundColor: 'var(--ff-error-light)', color: 'var(--ff-error)' }}>\n {error}\n </div>\n )}\n\n {/* Document Selection */}\n {step === 'select' && (\n <div className=\"ff-space-y-4\">\n <p className=\"ff-text-center ff-mb-6\" style={{ color: 'var(--ff-text-muted)' }}>\n Please upload the following documents to verify your identity\n </p>\n <div className=\"ff-grid ff-gap-3\">\n {requiredDocuments.map((type) => {\n const Icon = DOCUMENT_ICONS[type];\n const info = DOCUMENT_TYPES[type];\n const doc = documents.get(type);\n const isComplete = isDocumentComplete(type);\n\n return (\n <button\n key={type}\n onClick={() => selectDocument(type)}\n className={clsx(\n 'ff-flex ff-items-center ff-gap-4 ff-p-4 ff-rounded-xl ff-border-2 ff-text-left ff-transition-all ff-duration-150',\n isComplete\n ? 'ff-border-transparent'\n : 'ff-border-transparent hover:ff-border-transparent'\n )}\n style={{\n backgroundColor: isComplete ? 'var(--ff-success-light)' : 'var(--ff-bg-secondary)',\n borderColor: isComplete ? 'var(--ff-success)' : 'var(--ff-border-light)',\n }}\n >\n <div\n className=\"ff-p-3 ff-rounded-xl\"\n style={{\n backgroundColor: isComplete ? 'rgba(41, 142, 51, 0.15)' : 'var(--ff-bg-tertiary)',\n }}\n >\n {isComplete ? (\n <CheckCircle className=\"ff-w-6 ff-h-6\" style={{ color: 'var(--ff-success)' }} />\n ) : (\n <Icon className=\"ff-w-6 ff-h-6\" style={{ color: 'var(--ff-text-secondary)' }} />\n )}\n </div>\n <div className=\"ff-flex-1\">\n <p className=\"ff-font-medium\" style={{ color: 'var(--ff-text-primary)' }}>{info.label}</p>\n <p className=\"ff-text-sm\" style={{ color: 'var(--ff-text-muted)' }}>{info.description}</p>\n </div>\n <ChevronRight className=\"ff-w-5 ff-h-5\" style={{ color: 'var(--ff-text-muted)' }} />\n </button>\n );\n })}\n </div>\n </div>\n )}\n\n {/* Document Upload */}\n {step === 'upload' && currentDocumentType && (\n <div className=\"ff-py-4\">\n <div className=\"ff-max-w-lg ff-mx-auto\">\n <DocumentUploader documentType={currentDocumentType} onFileSelect={handleFileSelect} />\n </div>\n </div>\n )}\n\n {/* Processing */}\n {step === 'processing' && (\n <div className=\"ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12\">\n <Loader2 className=\"ff-w-12 ff-h-12 ff-animate-spin ff-mb-4\" style={{ color: 'var(--ff-primary-90)' }} />\n <h3 className=\"ff-text-lg ff-font-semibold ff-mb-2\" style={{ color: 'var(--ff-text-primary)' }}>\n Processing Documents\n </h3>\n <p style={{ color: 'var(--ff-text-muted)' }} className=\"ff-text-center\">\n We're analyzing your documents. This may take a moment...\n </p>\n </div>\n )}\n\n {/* Review */}\n {step === 'review' && (\n <div className=\"ff-space-y-6\">\n <div className=\"ff-text-center ff-mb-6\">\n <h3 className=\"ff-text-lg ff-font-semibold\" style={{ color: 'var(--ff-text-primary)' }}>Review Your Documents</h3>\n <p style={{ color: 'var(--ff-text-muted)' }}>\n Please review the extracted information before completing verification\n </p>\n </div>\n\n <div className=\"ff-grid ff-gap-4\">\n {requiredDocuments.map((type) => (\n <div\n key={type}\n className=\"ff-rounded-xl ff-p-4\"\n style={{ backgroundColor: 'var(--ff-bg-secondary)', border: '1px solid var(--ff-border-light)' }}\n >\n <DocumentStatus documentType={type} showDetails={true} />\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Complete */}\n {step === 'complete' && (\n <div className=\"ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12\">\n <div\n className=\"ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4\"\n style={{ backgroundColor: isVerified ? 'var(--ff-success-light)' : 'var(--ff-warning-light)' }}\n >\n {isVerified ? (\n <CheckCircle className=\"ff-w-10 ff-h-10\" style={{ color: 'var(--ff-success)' }} />\n ) : (\n <ShieldCheck className=\"ff-w-10 ff-h-10\" style={{ color: 'var(--ff-warning)' }} />\n )}\n </div>\n <h3 className=\"ff-text-xl ff-font-semibold ff-mb-2\" style={{ color: 'var(--ff-text-primary)' }}>\n {isVerified ? 'Verification Complete!' : 'Review Required'}\n </h3>\n <p style={{ color: 'var(--ff-text-muted)' }} className=\"ff-text-center\">\n {isVerified\n ? 'Your identity has been successfully verified.'\n : 'Additional review may be required. We will contact you if needed.'}\n </p>\n </div>\n )}\n </div>\n\n {/* Modal Footer */}\n {step !== 'complete' && (\n <div className=\"ff-modal-footer\">\n <button\n onClick={() => {\n if (step === 'upload') {\n setStep('select');\n } else if (step === 'review') {\n setStep('select');\n }\n }}\n disabled={isLoading}\n className=\"ff-btn ff-btn-secondary\"\n >\n Back\n </button>\n\n {step === 'review' && (\n <button\n onClick={handleVerify}\n disabled={isLoading || !areAllDocumentsProcessed()}\n className=\"ff-btn ff-btn-primary\"\n >\n {isLoading ? (\n <>\n <Loader2 className=\"ff-w-4 ff-h-4 ff-animate-spin\" />\n Verifying...\n </>\n ) : (\n 'Complete Verification'\n )}\n </button>\n )}\n\n {step === 'select' && areAllDocumentsUploaded() && (\n <button\n onClick={() => setStep('review')}\n className=\"ff-btn ff-btn-primary\"\n >\n Review & Verify\n </button>\n )}\n </div>\n )}\n </div>\n </StyleProvider>\n );\n};\n"],"names":["Car","createLucideIcon","Clock","FileText","Home","Image","ShieldCheck","Shield","createEmptyDocumentState","type","initialState","useKYCStore","create","set","get","sessionId","documents","docsMap","file","doc","previewUrl","updated","status","data","step","requiredDocuments","currentDocumentType","currentIndex","i","verified","isLoading","error","DocumentUploader","documentType","onFileSelect","setDocumentFile","documentState","documentInfo","DOCUMENT_TYPES","onDrop","useCallback","acceptedFiles","rejectedFiles","getRootProps","getInputProps","isDragActive","useDropzone","formatFileSize","bytes","getFileIcon","_a","jsx","clearFile","e","jsxs","X","clsx","Upload","format","AlertCircle","DocumentStatus","showDetails","statusConfig","CheckCircle","AlertTriangle","XCircle","Loader2","Icon","getConfidenceColor","confidence","flag","index","KYC_STEP_LABELS","DOCUMENT_ICONS","KYCWizard","onComplete","onCancel","onError","isVerified","verificationStatus","setSessionId","setRequiredDocuments","setCurrentDocumentType","setDocumentStatus","setDocumentData","setStep","nextDocument","setVerificationStatus","setVerified","setLoading","setError","areAllDocumentsUploaded","areAllDocumentsProcessed","reset","pollingDocument","setPollingDocument","useState","useEffect","initializeSession","result","getClient","err","handleFileSelect","pollDocumentStatus","documentId","attempts","consecutiveErrors","poll","docType","handleVerify","handleCancel","selectDocument","isDocumentComplete","getDisplayStepIndex","currentStep","StyleProvider","s","React","info","isComplete","ChevronRight","Fragment"],"mappings":"sGAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAMA,GAAMC,EAAAA,iBAAiB,MAAO,CAClC,CACE,OACA,CACE,EAAG,6KACH,IAAK,OACX,CACA,EACE,CAAC,SAAU,CAAE,GAAI,IAAK,GAAI,KAAM,EAAG,IAAK,IAAK,SAAU,EACvD,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,QAAQ,CAAE,EACxC,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,IAAK,IAAK,QAAQ,CAAE,CAC1D,CAAC,ECpBD;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAMC,EAAQD,EAAAA,iBAAiB,QAAS,CACtC,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,KAAM,IAAK,SAAU,EACzD,CAAC,WAAY,CAAE,OAAQ,mBAAoB,IAAK,QAAQ,CAAE,CAC5D,CAAC,ECZD;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAME,EAAWF,EAAAA,iBAAiB,WAAY,CAC5C,CAAC,OAAQ,CAAE,EAAG,6DAA8D,IAAK,QAAQ,CAAE,EAC3F,CAAC,OAAQ,CAAE,E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AA,CAC3C,EACA3B,EAAAA,IAAC,IAAA,CAAE,MAAO,CAAE,MAAO,sBAAA,EAA0B,UAAU,iBACpD,SAAA2B,EACG,gDACA,mEAAA,CACN,CAAA,CAAA,CACF,CAAA,EAEJ,EAGCtD,IAAS,YACR8B,OAAC,MAAA,CAAI,UAAU,kBACb,SAAA,CAAAH,EAAAA,IAAC,SAAA,CACC,QAAS,IAAM,EACT3B,IAAS,UAEFA,IAAS,WAClB6D,EAAQ,QAAQ,CAEpB,EACA,SAAUvD,EACV,UAAU,0BACX,SAAA,MAAA,CAAA,EAIAN,IAAS,UACR2B,EAAAA,IAAC,SAAA,CACC,QAAS0D,EACT,SAAU/E,GAAa,CAAC8D,EAAA,EACxB,UAAU,wBAET,WACCtC,EAAAA,KAAAmE,EAAAA,SAAA,CACE,SAAA,CAAAtE,EAAAA,IAACe,EAAAA,QAAA,CAAQ,UAAU,+BAAA,CAAgC,EAAE,cAAA,CAAA,CAEvD,EAEA,uBAAA,CAAA,EAKL1C,IAAS,UAAYmE,EAAA,GACpBxC,EAAAA,IAAC,SAAA,CACC,QAAS,IAAMkC,EAAQ,QAAQ,EAC/B,UAAU,wBACX,SAAA,iBAAA,CAAA,CAED,CAAA,CAEJ,CAAA,CAAA,CAEJ,CAAA,CACF,CAEJ","x_google_ignoreList":[0,1,2,3,4,5,6]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e, Fragment as oe } from "react/jsx-runtime";
|
|
2
2
|
import de, { useCallback as E, useState as me, useEffect as ue } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { h as w, j as pe, D as q, k as he, X as Z, m as D, U as ve, A as ye, n as B, o as H, L, p as V, g as M, S as ge, q as xe } from "./index-BIGw5rPX.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* @license lucide-react v0.321.0 - ISC
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the ISC license.
|
|
8
8
|
* See the LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
const
|
|
10
|
+
const Ne = w("Car", [
|
|
11
11
|
[
|
|
12
12
|
"path",
|
|
13
13
|
{
|
|
@@ -48,7 +48,7 @@ const G = w("FileText", [
|
|
|
48
48
|
* This source code is licensed under the ISC license.
|
|
49
49
|
* See the LICENSE file in the root directory of this source tree.
|
|
50
50
|
*/
|
|
51
|
-
const
|
|
51
|
+
const be = w("Home", [
|
|
52
52
|
["path", { d: "m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z", key: "y5dka4" }],
|
|
53
53
|
["polyline", { points: "9 22 9 12 15 12 15 22", key: "e2us08" }]
|
|
54
54
|
]);
|
|
@@ -58,7 +58,7 @@ const Ne = w("Home", [
|
|
|
58
58
|
* This source code is licensed under the ISC license.
|
|
59
59
|
* See the LICENSE file in the root directory of this source tree.
|
|
60
60
|
*/
|
|
61
|
-
const
|
|
61
|
+
const we = w("Image", [
|
|
62
62
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", ry: "2", key: "1m3agn" }],
|
|
63
63
|
["circle", { cx: "9", cy: "9", r: "2", key: "af1f0g" }],
|
|
64
64
|
["path", { d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21", key: "1xmnt7" }]
|
|
@@ -69,7 +69,7 @@ const be = w("Image", [
|
|
|
69
69
|
* This source code is licensed under the ISC license.
|
|
70
70
|
* See the LICENSE file in the root directory of this source tree.
|
|
71
71
|
*/
|
|
72
|
-
const
|
|
72
|
+
const Ce = w("ShieldCheck", [
|
|
73
73
|
["path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10", key: "1irkt0" }],
|
|
74
74
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
75
75
|
]);
|
|
@@ -79,7 +79,7 @@ const we = w("ShieldCheck", [
|
|
|
79
79
|
* This source code is licensed under the ISC license.
|
|
80
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
81
|
*/
|
|
82
|
-
const
|
|
82
|
+
const De = w("Shield", [
|
|
83
83
|
["path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10", key: "1irkt0" }]
|
|
84
84
|
]), $ = (c) => ({
|
|
85
85
|
id: null,
|
|
@@ -193,13 +193,13 @@ const Ce = w("Shield", [
|
|
|
193
193
|
t.previewUrl && URL.revokeObjectURL(t.previewUrl);
|
|
194
194
|
c(X);
|
|
195
195
|
}
|
|
196
|
-
})),
|
|
196
|
+
})), ke = ({
|
|
197
197
|
documentType: c,
|
|
198
198
|
onFileSelect: o
|
|
199
199
|
}) => {
|
|
200
|
-
const { documents: f, setDocumentFile: t, isLoading: l } = j(), r = f.get(c), a =
|
|
201
|
-
(d,
|
|
202
|
-
if (!(
|
|
200
|
+
const { documents: f, setDocumentFile: t, isLoading: l } = j(), r = f.get(c), a = q[c], p = E(
|
|
201
|
+
(d, A) => {
|
|
202
|
+
if (!(A.length > 0) && d.length > 0) {
|
|
203
203
|
const v = d[0];
|
|
204
204
|
t(c, v), o == null || o(v);
|
|
205
205
|
}
|
|
@@ -217,7 +217,7 @@ const Ce = w("Shield", [
|
|
|
217
217
|
disabled: l
|
|
218
218
|
}), k = (d) => d < 1024 ? `${d} B` : d < 1024 * 1024 ? `${(d / 1024).toFixed(1)} KB` : `${(d / (1024 * 1024)).toFixed(1)} MB`, z = () => {
|
|
219
219
|
var d;
|
|
220
|
-
return ((d = r == null ? void 0 : r.file) == null ? void 0 : d.type) === "application/pdf" ? /* @__PURE__ */ e(G, { className: "ff-w-6 ff-h-6" }) : /* @__PURE__ */ e(
|
|
220
|
+
return ((d = r == null ? void 0 : r.file) == null ? void 0 : d.type) === "application/pdf" ? /* @__PURE__ */ e(G, { className: "ff-w-6 ff-h-6" }) : /* @__PURE__ */ e(we, { className: "ff-w-6 ff-h-6" });
|
|
221
221
|
}, F = (d) => {
|
|
222
222
|
d.stopPropagation(), j.getState().clearDocumentPreview(c), t(c, null);
|
|
223
223
|
};
|
|
@@ -309,11 +309,11 @@ const Ce = w("Shield", [
|
|
|
309
309
|
] })
|
|
310
310
|
] })
|
|
311
311
|
] });
|
|
312
|
-
},
|
|
312
|
+
}, Ue = ({
|
|
313
313
|
documentType: c,
|
|
314
314
|
showDetails: o = !0
|
|
315
315
|
}) => {
|
|
316
|
-
const { documents: f } = j(), t = f.get(c), l =
|
|
316
|
+
const { documents: f } = j(), t = f.get(c), l = q[c], a = ((m) => {
|
|
317
317
|
switch (m) {
|
|
318
318
|
case "completed":
|
|
319
319
|
return {
|
|
@@ -456,11 +456,11 @@ const Ce = w("Shield", [
|
|
|
456
456
|
] })
|
|
457
457
|
] })
|
|
458
458
|
] });
|
|
459
|
-
}, T = ["select", "upload", "review", "complete"],
|
|
459
|
+
}, T = ["select", "upload", "review", "complete"], Se = {
|
|
460
460
|
passport: G,
|
|
461
|
-
drivers_license:
|
|
462
|
-
proof_of_address:
|
|
463
|
-
},
|
|
461
|
+
drivers_license: Ne,
|
|
462
|
+
proof_of_address: be
|
|
463
|
+
}, Fe = ({
|
|
464
464
|
requiredDocuments: c,
|
|
465
465
|
onComplete: o,
|
|
466
466
|
onCancel: f,
|
|
@@ -478,14 +478,14 @@ const Ce = w("Shield", [
|
|
|
478
478
|
setSessionId: z,
|
|
479
479
|
setRequiredDocuments: F,
|
|
480
480
|
setCurrentDocumentType: d,
|
|
481
|
-
setDocumentStatus:
|
|
481
|
+
setDocumentStatus: A,
|
|
482
482
|
setDocumentData: v,
|
|
483
483
|
setStep: N,
|
|
484
484
|
nextDocument: J,
|
|
485
485
|
setVerificationStatus: Q,
|
|
486
486
|
setVerified: ee,
|
|
487
487
|
setLoading: C,
|
|
488
|
-
setError:
|
|
488
|
+
setError: I,
|
|
489
489
|
areAllDocumentsUploaded: _,
|
|
490
490
|
areAllDocumentsProcessed: O,
|
|
491
491
|
reset: te
|
|
@@ -500,7 +500,7 @@ const Ce = w("Shield", [
|
|
|
500
500
|
z(n.sessionId), N("upload");
|
|
501
501
|
} catch (i) {
|
|
502
502
|
const n = i;
|
|
503
|
-
|
|
503
|
+
I(n.message), t == null || t(n);
|
|
504
504
|
} finally {
|
|
505
505
|
C(!1);
|
|
506
506
|
}
|
|
@@ -508,7 +508,7 @@ const Ce = w("Shield", [
|
|
|
508
508
|
async (i) => {
|
|
509
509
|
if (!(!l || !a))
|
|
510
510
|
try {
|
|
511
|
-
C(!0),
|
|
511
|
+
C(!0), I(null);
|
|
512
512
|
const h = await M().uploadKYCDocument(l, a, i);
|
|
513
513
|
v(a, {
|
|
514
514
|
id: h.documentId,
|
|
@@ -526,7 +526,7 @@ const Ce = w("Shield", [
|
|
|
526
526
|
},
|
|
527
527
|
[l, a]
|
|
528
528
|
), se = async (i) => {
|
|
529
|
-
let y = 0,
|
|
529
|
+
let y = 0, S = 0;
|
|
530
530
|
const R = async () => {
|
|
531
531
|
var Y;
|
|
532
532
|
if (y >= 30) {
|
|
@@ -536,7 +536,7 @@ const Ce = w("Shield", [
|
|
|
536
536
|
});
|
|
537
537
|
return;
|
|
538
538
|
}
|
|
539
|
-
if (
|
|
539
|
+
if (S >= 3) {
|
|
540
540
|
b(null), a && v(a, {
|
|
541
541
|
status: "failed",
|
|
542
542
|
error: "Failed to check document status. Please refresh and try again."
|
|
@@ -545,7 +545,7 @@ const Ce = w("Shield", [
|
|
|
545
545
|
}
|
|
546
546
|
try {
|
|
547
547
|
const g = (await M().getKYCDocument(i)).document;
|
|
548
|
-
|
|
548
|
+
S = 0;
|
|
549
549
|
const ie = g.type;
|
|
550
550
|
if (v(ie, {
|
|
551
551
|
id: g.id,
|
|
@@ -562,14 +562,14 @@ const Ce = w("Shield", [
|
|
|
562
562
|
y++, setTimeout(R, 2e3);
|
|
563
563
|
} catch (K) {
|
|
564
564
|
const P = K;
|
|
565
|
-
if (
|
|
565
|
+
if (S++, y++, P.status === 404 || (Y = P.message) != null && Y.includes("not found")) {
|
|
566
566
|
b(null), a && v(a, {
|
|
567
567
|
status: "failed",
|
|
568
568
|
error: "Session not found or invalid state"
|
|
569
569
|
});
|
|
570
570
|
return;
|
|
571
571
|
}
|
|
572
|
-
|
|
572
|
+
S < 3 ? setTimeout(R, 3e3 * S) : (b(null), a && v(a, {
|
|
573
573
|
status: "failed",
|
|
574
574
|
error: P.message || "Failed to process document"
|
|
575
575
|
}));
|
|
@@ -579,14 +579,14 @@ const Ce = w("Shield", [
|
|
|
579
579
|
}, ae = async () => {
|
|
580
580
|
if (l)
|
|
581
581
|
try {
|
|
582
|
-
C(!0),
|
|
582
|
+
C(!0), I(null);
|
|
583
583
|
const n = await M().verifyKYCSession(l, !0);
|
|
584
584
|
Q(n.verificationStatus);
|
|
585
585
|
const h = n.verificationStatus;
|
|
586
586
|
ee(h.isVerified), N("complete"), o == null || o(n);
|
|
587
587
|
} catch (i) {
|
|
588
588
|
const n = i;
|
|
589
|
-
|
|
589
|
+
I(n.message), t == null || t(n);
|
|
590
590
|
} finally {
|
|
591
591
|
C(!1);
|
|
592
592
|
}
|
|
@@ -601,11 +601,11 @@ const Ce = w("Shield", [
|
|
|
601
601
|
const i = r === "processing" ? "upload" : r;
|
|
602
602
|
return T.indexOf(i);
|
|
603
603
|
};
|
|
604
|
-
return /* @__PURE__ */ s("div", { className: "ff-container ff-modal", children: [
|
|
604
|
+
return /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ s("div", { className: "ff-container ff-modal", children: [
|
|
605
605
|
/* @__PURE__ */ s("div", { className: "ff-modal-header", children: [
|
|
606
606
|
/* @__PURE__ */ s("div", { className: "ff-modal-header-left", children: [
|
|
607
607
|
/* @__PURE__ */ s("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
|
|
608
|
-
/* @__PURE__ */ e("div", { className: "ff-modal-icon", children: /* @__PURE__ */ e(
|
|
608
|
+
/* @__PURE__ */ e("div", { className: "ff-modal-icon", children: /* @__PURE__ */ e(De, {}) }),
|
|
609
609
|
/* @__PURE__ */ e("h2", { className: "ff-modal-title", children: "Identity Verification" })
|
|
610
610
|
] }),
|
|
611
611
|
/* @__PURE__ */ e("div", { className: "ff-steps ff-ml-4", children: T.map((i, n) => /* @__PURE__ */ s(de.Fragment, { children: [
|
|
@@ -641,7 +641,7 @@ const Ce = w("Shield", [
|
|
|
641
641
|
r === "select" && /* @__PURE__ */ s("div", { className: "ff-space-y-4", children: [
|
|
642
642
|
/* @__PURE__ */ e("p", { className: "ff-text-center ff-mb-6", style: { color: "var(--ff-text-muted)" }, children: "Please upload the following documents to verify your identity" }),
|
|
643
643
|
/* @__PURE__ */ e("div", { className: "ff-grid ff-gap-3", children: c.map((i) => {
|
|
644
|
-
const n =
|
|
644
|
+
const n = Se[i], h = q[i];
|
|
645
645
|
p.get(i);
|
|
646
646
|
const y = ne(i);
|
|
647
647
|
return /* @__PURE__ */ s(
|
|
@@ -671,14 +671,14 @@ const Ce = w("Shield", [
|
|
|
671
671
|
/* @__PURE__ */ e("p", { className: "ff-font-medium", style: { color: "var(--ff-text-primary)" }, children: h.label }),
|
|
672
672
|
/* @__PURE__ */ e("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: h.description })
|
|
673
673
|
] }),
|
|
674
|
-
/* @__PURE__ */ e(
|
|
674
|
+
/* @__PURE__ */ e(xe, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-text-muted)" } })
|
|
675
675
|
]
|
|
676
676
|
},
|
|
677
677
|
i
|
|
678
678
|
);
|
|
679
679
|
}) })
|
|
680
680
|
] }),
|
|
681
|
-
r === "upload" && a && /* @__PURE__ */ e("div", { className: "ff-py-4", children: /* @__PURE__ */ e("div", { className: "ff-max-w-lg ff-mx-auto", children: /* @__PURE__ */ e(
|
|
681
|
+
r === "upload" && a && /* @__PURE__ */ e("div", { className: "ff-py-4", children: /* @__PURE__ */ e("div", { className: "ff-max-w-lg ff-mx-auto", children: /* @__PURE__ */ e(ke, { documentType: a, onFileSelect: fe }) }) }),
|
|
682
682
|
r === "processing" && /* @__PURE__ */ s("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12", children: [
|
|
683
683
|
/* @__PURE__ */ e(L, { className: "ff-w-12 ff-h-12 ff-animate-spin ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
|
|
684
684
|
/* @__PURE__ */ e("h3", { className: "ff-text-lg ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Processing Documents" }),
|
|
@@ -694,7 +694,7 @@ const Ce = w("Shield", [
|
|
|
694
694
|
{
|
|
695
695
|
className: "ff-rounded-xl ff-p-4",
|
|
696
696
|
style: { backgroundColor: "var(--ff-bg-secondary)", border: "1px solid var(--ff-border-light)" },
|
|
697
|
-
children: /* @__PURE__ */ e(
|
|
697
|
+
children: /* @__PURE__ */ e(Ue, { documentType: i, showDetails: !0 })
|
|
698
698
|
},
|
|
699
699
|
i
|
|
700
700
|
)) })
|
|
@@ -705,7 +705,7 @@ const Ce = w("Shield", [
|
|
|
705
705
|
{
|
|
706
706
|
className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4",
|
|
707
707
|
style: { backgroundColor: u ? "var(--ff-success-light)" : "var(--ff-warning-light)" },
|
|
708
|
-
children: u ? /* @__PURE__ */ e(V, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ e(
|
|
708
|
+
children: u ? /* @__PURE__ */ e(V, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ e(Ce, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-warning)" } })
|
|
709
709
|
}
|
|
710
710
|
),
|
|
711
711
|
/* @__PURE__ */ e("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: u ? "Verification Complete!" : "Review Required" }),
|
|
@@ -745,12 +745,12 @@ const Ce = w("Shield", [
|
|
|
745
745
|
}
|
|
746
746
|
)
|
|
747
747
|
] })
|
|
748
|
-
] });
|
|
748
|
+
] }) });
|
|
749
749
|
};
|
|
750
750
|
export {
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
751
|
+
ke as D,
|
|
752
|
+
Fe as K,
|
|
753
|
+
Ue as a,
|
|
754
754
|
j as u
|
|
755
755
|
};
|
|
756
|
-
//# sourceMappingURL=KYCWizard-
|
|
756
|
+
//# sourceMappingURL=KYCWizard-W1poXII_.mjs.map
|