1import{trackError as m,addSentryDiagnosticBreadcrumb as p}from"./track-error-DEre5AXz.js";import{l as k,n as v,o as z,p as E,h as w,i as M,q as O,r as R}from"./landingHandoffUploadClaim-B2LBwAI7.js";const y="document-upload-file-unreadable",S="document-upload-body-materialized-recovered";function x(e){var l;const o=e.name.split("/").pop()||"",t=o.includes(".")&&((l=o.split(".").pop())==null?void 0:l.toLowerCase())||"";return{fileName:o,fileExtension:t}}function L({error:e,surface:o,failureKind:t,fileReadErrorName:l,fileReadErrorMessage:a,file:n,uploadAttemptId:u,inputMethod:r,userId:i,additionalTags:d={},additionalExtra:c={}}){const{fileName:s,fileExtension:_}=x(n),g=k(n.size),f=v();m(e,{scope:y,fingerprint:[y,o,t],userId:i,level:"error",tags:{upload_surface:o,file_read_failure_kind:t,file_read_error_name:l||"missing",file_size_bucket:g,client_platform_family:f,input_method:r,upload_attempt_id:u,file_extension:_||"unknown",...d},extra:{uploadSurface:o,uploadAttemptId:u,fileName:s,fileExtension:_,fileMimeType:n.type||"unknown",fileSizeBytes:n.size,fileSizeBucket:g,fileReadFailureKind:t,fileReadErrorName:l,fileReadErrorMessage:a??null,clientPlatformFamily:f,userAgent:typeof navigator>"u"?null:navigator.userAgent,isOnline:typeof navigator>"u"?null:navigator.onLine,documentVisibility:typeof document>"u"?null:document.visibilityState,sentryOrigin:"frontend",...c}})}function h({surface:e,file:o,uploadAttemptId:t,inputMethod:l,userId:a,storageTransport:n,requestAttemptsBeforeRecovery:u,additionalTags:r={},additionalExtra:i={}}){const{fileName:d,fileExtension:c}=x(o),s=k(o.size),_=v();m(new Error("Upload recovered with an in-memory copy of the picked file"),{scope:S,fingerprint:[S,e,n],userId:a,level:"info",tags:{upload_surface:e,storage_transport:n,body_materialized:"true",file_size_bucket:s,client_platform_family:_,input_method:l,upload_attempt_id:t,file_extension:c||"unknown",...r},extra:{uploadSurface:e,uploadAttemptId:t,fileName:d,fileExtension:c,fileMimeType:o.type||"unknown",fileSizeBytes:o.size,fileSizeBucket:s,storageTransport:n,bodyMaterialized:!0,requestAttemptsBeforeRecovery:u,clientPlatformFamily:_,userAgent:typeof navigator>"u"?null:navigator.userAgent,isOnline:typeof navigator>"u"?null:navigator.onLine,sentryOrigin:"frontend",...i}})}function B({error:e,attemptId:o,inputMethod:t,file:l,contentMediumType:a,user:n}){L({error:e,surface:"document-upload",failureKind:e.fileReadFailureKind??"read-error",fileReadErrorName:R(e.cause),fileReadErrorMessage:O(e.cause),file:l,uploadAttemptId:o,inputMethod:t,userId:n==null?void 0:n.id,additionalTags:{file_upload_stage:e.stage,file_upload_error_code:e.code,ingestion_attempt_id:o,content_medium_type:a||"unknown"},additionalExtra:E({error:e,attemptId:o,inputMethod:t,file:l,contentMediumType:a})})}function C({attemptId:e,inputMethod:o,file:t,contentMediumType:l,user:a,stage:n,progressPercentage:u,elapsedMs:r,stableUploadedFileIdentifiers:i}){const d=z(t),c=(i==null?void 0:i.bucketName)||null,s=(i==null?void 0:i.objectKey)||null;m(new Error("Document upload abandoned before completion"),{scope:"document-upload-abandoned",fingerprint:["document-upload-abandoned",n],userId:a==null?void 0:a.id,level:"info",tags:{file_upload_stage:n,input_method:o,ingestion_attempt_id:e,content_medium_type:l||"unknown",file_extension:d.fileExtension||"unknown"},extra:{...d,attemptId:e,stage:n,progressPercentage:Math.min(100,Math.max(0,Math.round(u))),elapsedMs:Math.max(0,Math.round(r)),uploadedFileBucketName:c,uploadedFileObjectKey:s,uploadedFileLocator:c&&s?`s3://${c}/${s}`:null,fileProcessingTaskId:(i==null?void 0:i.taskId)||null,modalFunctionCallId:(i==null?void 0:i.modalFunctionCallId)||null,isOnline:typeof navigator>"u"?null:navigator.onLine,documentVisibility:typeof document>"u"?null:document.visibilityState,sentryOrigin:"frontend"}})}function A({error:e,attemptId:o,inputMethod:t,file:l,contentMediumType:a,user:n,stableUploadedFileIdentifiers:u,processingErrorCode:r,processingErrorMessage:i}){const d=E({error:e,attemptId:o,inputMethod:t,file:l,contentMediumType:a,stableUploadedFileIdentifiers:u});if(e.code===w.RestorationRequired){p({category:"document-upload",message:"File processing paused for restoration",data:{...d,fileProcessingPurpose:"new_upload"}});return}if(e.stage===M.ValidateInput){p({category:"document-upload",message:"Document upload input was rejected",data:{...d,userId:(n==null?void 0:n.id)||null,sentryOrigin:"frontend"}});return}m(e,{scope:"document-upload",userId:n==null?void 0:n.id,level:["image_dimensions_too_large","source_download_failed","not_pdf_header","file_empty"].includes(r||"")?"warning":"error",tags:{file_processing_purpose:"new_upload",file_upload_stage:e.stage,file_upload_error_code:e.code,file_upload_request_attempts:String(e.requestAttempts),input_method:t,ingestion_attempt_id:o,content_medium_type:a||"unknown",file_extension:String(d.fileExtension||"unknown"),file_processing_task_id:String(d.fileProcessingTaskId||"missing"),modal_function_call_id:String(d.modalFunctionCallId||"missing"),storage_error_code:e.storageErrorCode||"missing",file_upload_cause_code:String(d.causeCode||"missing"),file_processing_error_code:r||"missing",body_materialized:String(d.bodyMaterialized===!0)},extra:{...d,isOnline:navigator.onLine,sentryOrigin:"frontend",documentVisibility:document.visibilityState,backendMode:"production",processingErrorCode:r||null,processingErrorMessage:i||null}})}function D({file:e,contentMediumType:o,user:t,bucketName:l,objectKey:a,attemptId:n,requestAttemptsBeforeFallback:u,storageRequestId:r,storageExtendedRequestId:i,storageTransport:d,bodyMaterialized:c=!1}){p({category:"document-upload",message:`Document upload recovered through ${d==="fetch"?"fetch":d==="xhr"?"XHR":"Cloudflare proxy"} fallback`,data:{attemptId:n,userId:(t==null?void 0:t.id)||null,contentMediumType:o||"unknown",fileName:e.name,fileMimeType:e.type||null,fileSizeBytes:e.size,uploadedFileBucketName:l,uploadedFileObjectKey:a,uploadedFileLocator:l&&a?`s3://${l}/${a}`:null,requestAttemptsBeforeFallback:u,storageRequestId:r,storageExtendedRequestId:i,storageTransport:d,bodyMaterialized:c,outcome:"recovered"}})}function F({file:e,contentMediumType:o,user:t,inputMethod:l,bucketName:a,objectKey:n,attemptId:u,requestAttemptsBeforeFallback:r,storageTransport:i}){h({surface:"document-upload",file:e,uploadAttemptId:u,inputMethod:l,userId:t==null?void 0:t.id,storageTransport:i,requestAttemptsBeforeRecovery:r,additionalTags:{ingestion_attempt_id:u,content_medium_type:o||"unknown"},additionalExtra:{uploadedFileBucketName:a,uploadedFileObjectKey:n,uploadedFileLocator:a&&n?`s3://${a}/${n}`:null,fileProcessingTaskId:u}})}const T=Object.freeze(Object.defineProperty({__proto__:null,reportDocumentUploadAbandonment:C,reportDocumentUploadBodyMaterializedRecovery:F,reportDocumentUploadFailure:A,reportDocumentUploadFileUnreadable:B,reportDocumentUploadTransportRecovery:D},Symbol.toStringTag,{value:"Module"}));
1export{L as a,A as b,B as c,C as d,T as e,h as r}; 2//# sourceMappingURL=document-upload-sentry-Dl2_Y04U.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.