1import{jt as e,vt as t,wt as n}from"./react-BwCorr0Z.js";import{Or as r,bn as i}from"./core-BXImQz-A.js";import{a,b as o,l as s,m as c,u as l,x as u}from"./_zod-compiler-runtime-ztE3MjLO.js";var d=(()=>{function n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&typeof e.storedObjectPointerReferenceId==`string`&&o.test(e.storedObjectPointerReferenceId)}var r={};function i(e){var t,n;return typeof e!=`object`||!e||Array.isArray(e)||(t=e.storedObjectPointerReferenceId,!(typeof t==`string`&&o.test(t)))?r:(n={storedObjectPointerReferenceId:t},n)}function d(e){var t=[],n=e;if(typeof n!=`object`||!n||Array.isArray(n))t.push(l(`object`,n,[]));else{var r=n.storedObjectPointerReferenceId;typeof r==`string`?o.test(r)||t.push(s(`string`,`uuid`,r,[`storedObjectPointerReferenceId`],{pattern:u})):t.push(l(`string`,r,[`storedObjectPointerReferenceId`])),n={storedObjectPointerReferenceId:r}}return t}function f(e){var t=i(e);return t===r?a(d,e):{success:!0,data:t}}return c(f,t({storedObjectPointerReferenceId:e()}),null,n)})(),f=(()=>{function e(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&typeof e.message==`string`}var r={};function i(e){var t,n;return typeof e!=`object`||!e||Array.isArray(e)||(t=e.message,typeof t!=`string`)?r:(n={message:t},n)}function o(e){var t=[],n=e;if(typeof n!=`object`||!n||Array.isArray(n))t.push(l(`object`,n,[]));else{var r=n.message;typeof r!=`string`&&t.push(l(`string`,r,[`message`])),n={message:r}}return t}function s(e){var t=i(e);return t===r?a(o,e):{success:!0,data:t}}return c(s,t({message:n()}),null,e)})(),p=async({file:e,onProgress:t})=>await new Promise((n,a)=>{let o=new XMLHttpRequest,s=new FormData;s.append(`file`,e),t&&o.upload.addEventListener(`progress`,e=>{e.lengthComputable&&t(Math.round(e.loaded/e.total*100))}),o.addEventListener(`load`,()=>{if(o.status>=200&&o.status<300)n(d.parse(i(o.responseText)));else{let e=`Upload failed: ${o.status}`;try{let t=f.safeParse(i(o.responseText));t.success&&(e=t.data.message)}catch{}a(Error(e))}}),o.addEventListener(`error`,()=>a(Error(`Upload failed`))),o.open(`POST`,r(`/api/upload`)),o.send(s)});export{p as t}; 2//# sourceMappingURL=FileUpload.client-Cd413hCV.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.