1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[87],{90087:(e,t,o)=>{o.d(t,{Pi:()=>p,hv:()=>h,zO:()=>g});var i=o(2626),r=o(65364);let a=r.env.NEXT_PUBLIC_SUPABASE_URL||"https://wxofebyviealmeyltqtm.supabase.co",n=r.env.NEXT_PUBLIC_SUPABASE_ANON_KEY||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Ind4b2ZlYnl2aWVhbG1leWx0cXRtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDc5MTU3NzUsImV4cCI6MjA2MzQ5MTc3NX0.r6jgXR48bAOL66JDsPBW9NpOCPxUszCLMWlStZ6AH34",s="chat-audio",c=null;function u(){return c||(c=(0,i.UU)(a,n,{auth:{persistSession:!1,autoRefreshToken:!1}})),c}let l={"audio/webm":"webm","audio/ogg":"ogg","audio/mp4":"m4a","audio/mpeg":"mp3","audio/aac":"aac","audio/wav":"wav"};function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return l[String(e).split(";")[0].trim().toLowerCase()]||"webm"}function p(){if("undefined"==typeof MediaRecorder)return"";for(let e of["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"])try{if(MediaRecorder.isTypeSupported(e))return e}catch(e){}return""}function f(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,10))}let m="chat-files";async function h(e,t){if(!e||!e.size)throw Error("File is empty");if(!t)throw Error("Missing leadId for file upload");if(e.size>0xa00000)throw Error("File is larger than 10MB");let o=e.type||"application/octet-stream",i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=String(e).match(/\.([a-z0-9]{1,8})$/i);return t?t[1].toLowerCase():"bin"}(e.name)||d(o),r="".concat("user_files","/").concat(t,"/").concat(f(),".").concat(i),{error:a}=await u().storage.from(m).upload(r,e,{contentType:o,upsert:!1});if(a){if("403"===String(a.statusCode||a.status))throw Error("File upload denied (403) â the Supabase RLS insert policy for the anon role on chat-files/user_files/ is likely missing.");throw a}let{data:n}=u().storage.from(m).getPublicUrl(r);return{fileUrl:(null==n?void 0:n.publicUrl)||"",path:r,fileName:e.name||"attachment.".concat(i),contentType:o,sizeBytes:e.size}}async function g(e,t){if(!e||!e.size)throw Error("Recording is empty");if(!t)throw Error("Missing leadId for voice note upload");let o=e.type||"audio/webm",i=d(o),r="".concat("user_audio","/").concat(t,"/").concat(f(),".").concat(i),{error:a}=await u().storage.from(s).upload(r,e,{contentType:o,upsert:!1});if(a){if("403"===String(a.statusCode||a.status))throw Error("Voice upload denied (403) â the Supabase RLS insert policy for the anon role on chat-audio/user_audio/ is likely missing.");throw a}let{data:n}=u().storage.from(s).getPublicUrl(r);return{audioUrl:(null==n?void 0:n.publicUrl)||"",path:r,contentType:o,sizeBytes:e.size}}}}]);
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.